# Request bind between profile of two addresses Source: https://docs.moralis.com/api-reference/bind/request-bind-between-profile-of-two-addresses /openapi-files/auth-api/auth.json post /bind/request Request for message to bind profile that is belong to the two addresses
All profiles under the addresses will be bound and new profile will be generated. # Request to remove bind of an address from a profile Source: https://docs.moralis.com/api-reference/bind/request-to-remove-bind-of-an-address-from-a-profile /openapi-files/auth-api/auth.json post /bind/remove # Verify bind request Source: https://docs.moralis.com/api-reference/bind/verify-bind-request /openapi-files/auth-api/auth.json post /bind/request/verify # Verify remove bind request Source: https://docs.moralis.com/api-reference/bind/verify-remove-bind-request /openapi-files/auth-api/auth.json post /bind/remove/verify # Request Aptos challenge Source: https://docs.moralis.com/api-reference/challenge/request-aptos-challenge /openapi-files/auth-api/auth.json post /challenge/request/aptos # Request EVM challenge Source: https://docs.moralis.com/api-reference/challenge/request-evm-challenge /openapi-files/auth-api/auth.json post /challenge/request/evm # Request Solana challenge Source: https://docs.moralis.com/api-reference/challenge/request-solana-challenge /openapi-files/auth-api/auth.json post /challenge/request/solana # Verify Aptos challenge Source: https://docs.moralis.com/api-reference/challenge/verify-aptos-challenge /openapi-files/auth-api/auth.json post /challenge/verify/aptos # Verify EVM challenge Source: https://docs.moralis.com/api-reference/challenge/verify-evm-challenge /openapi-files/auth-api/auth.json post /challenge/verify/evm # Verify Solana challenge Source: https://docs.moralis.com/api-reference/challenge/verify-solana-challenge /openapi-files/auth-api/auth.json post /challenge/verify/solana # Get addresses that are bound to the specific profileId Source: https://docs.moralis.com/api-reference/profile/get-addresses-that-are-bound-to-the-specific-profileid /openapi-files/auth-api/auth.json get /profile/{profileId}/addresses # Auth API Source: https://docs.moralis.com/auth-api/overview Web3 authentication using wallet signature, built on the EIP-4361 standard for secure off-chain identity verification. ## Overview Moralis **Auth API** enables secure **Web3 authentication** by letting users prove wallet ownership through message signing. Instead of managing passwords or OAuth flows, Auth API uses cryptographic signatures to verify that users control their wallets - the native identity primitive of Web3. *** ## What Is Auth API? Auth API provides a complete **wallet-based authentication flow** that: * Generates secure challenge messages for users to sign * Verifies wallet signatures cryptographically * Returns a unique user identifier (`profileId`) across sessions * Works with both EVM chains and Solana The authentication follows the **EIP-4361** standard (Sign-In with Ethereum), ensuring compatibility with wallet apps and established security practices. *** ## How It Works The authentication flow consists of three steps: 1. **Request Challenge** - Your backend requests a challenge message from Moralis 2. **User Signs** - The user signs the challenge message with their wallet 3. **Verify Signature** - Your backend sends the signature to Moralis for verification Upon successful verification, you receive a `profileId` that uniquely identifies the user - regardless of which wallet or chain they used to authenticate. *** ## Key Features Auth API includes: * **EIP-4361 Standard** - Built on Sign-In with Ethereum for broad wallet compatibility * **Unified Profile ID** - Single identifier per user across wallets and chains * **Multi-Wallet Support** - Users can link multiple wallets to one profile * **Cross-Chain** - Works with EVM chains and Solana * **Stateless Verification** - No session management required on Moralis side *** ## Supported Networks Auth API supports wallet authentication across: * **EVM Chains** - Ethereum, Polygon, BNB Chain, Arbitrum, Optimism, Base, Avalanche, and more * **Solana** - Full support for Solana wallet signatures *** ## Wallet Integrations Auth API works with popular wallet connection libraries: * MetaMask * WalletConnect * RainbowKit * Coinbase Wallet * Web3Auth * Magic.Link * Particle Network *** ## Common Use Cases Auth API is commonly used for: * **dApp Authentication**\ (secure login without passwords) * **Gated Content**\ (verify wallet ownership before granting access) * **NFT Verification**\ (prove ownership for holder-only features) * **Multi-Wallet Accounts**\ (link multiple wallets to a single user profile) * **Cross-Chain Identity**\ (unified identity across EVM and Solana) *** ## Limitations Auth API currently does **not** support: * **EIP-1271 Signatures** - Smart contract wallet signatures (e.g., Safe, Argent) are not supported. Only EOA (Externally Owned Account) wallets can authenticate. *** ## Get Started * [How to Authenticate Users with MetaMask](/get-started/tutorials/auth-api/authenticate-users-with-meta-mask) * [How to Authenticate Users with RainbowKit](/get-started/tutorials/auth-api/authenticate-users-with-rainbow-kit) * [How to Authenticate Users with WalletConnect](/get-started/tutorials/auth-api/authenticate-users-with-wallet-connect) * [How to Authenticate Users with Coinbase Wallet](/get-started/tutorials/auth-api/authenticate-users-with-coinbase-wallet) * [How to Authenticate Users with Web3Auth](/get-started/tutorials/auth-api/authenticate-users-with-web3-auth) * [How to Authenticate Users with Magic.Link](/get-started/tutorials/auth-api/authenticate-users-with-magic-link) # Product updates Source: https://docs.moralis.com/changelog New releases and improvements **October 21, 2026** ## Tempo is now supported Tempo mainnet is now supported across the Moralis Data API, Streams, Datashare and Data Feeds. | Detail | Value | | - | - | | Chain ID | `0x1079` (4217) | | Chain values | `tempo`, `0x1079` | | Native token | None. Tempo has no native gas token, so balances and transfers are TIP-20 tokens | **Data API** Tempo supports every Data API feature except DeFi positions and NFT trades, sale prices and floor prices: * **Wallets:** token balances, transaction history, net worth and profitability * **Tokens:** metadata, transfers, owners and prices * **NFTs:** NFTs by wallet, collection metadata and transfers * **Blockchain:** blocks, transactions and [internal transactions](/data-api/data-features/data-enrichment/internal-transactions) * **Entities:** labelled addresses and entities Use `tempo` or `0x1079` as the `chain` or `chainAlias` value, or pass it through the `chains` query parameter on multi-chain endpoints. **Streams** Create Tempo streams with chain ID `0x1079` for token and NFT activity, contract events, internal transactions and transaction data. Streams requires the hex chain ID; the `tempo` alias is not accepted. See [Streams supported chains](/streams/supported-chains). **Data Feeds** [Data Feeds](/data-feeds/overview) index Tempo into your own infrastructure, from raw blocks through to decoded, USD-valued events, with no indexing layer to build or run. * **Full history and live data:** backfill from genesis, tail the chain head in realtime, or do both in [hybrid mode](/data-feeds/concepts/modes). Reorgs near the tip are [corrected automatically](/data-feeds/concepts/reorgs). * **Raw chain data:** block headers, transactions, receipts and every event log through the [`block` array](/data-feeds/concepts/the-block-array), for indexing any contract or event signature. * **Decoded activity:** token transfers with post-transfer balances, NFT transfers, swaps, token prices and token metadata, in the same unified schema as every other chain. * **Ready-made [templates](/data-feeds/templates/overview):** wallet history, token balances (current and historical), token holders, approvals, token transfers, prices and stats, swaps by wallet, token or pair, pair OHLCV and reserves, NFTs by wallet, NFT owners, NFT transfers and collection metadata, and contract logs. * **Use-case bundles:** [accounting](/data-feeds/use-cases/accounting), [portfolio tracking](/data-feeds/use-cases/portfolio-tracking), [token analytics](/data-feeds/use-cases/token-analytics), [compliance and AML](/data-feeds/use-cases/compliance-aml) and [event indexing](/data-feeds/use-cases/event-indexing). * **Your choice of destination:** land tables in [ClickHouse, Postgres or MySQL](/data-feeds/concepts/destinations), consume through [Kafka, RabbitMQ or SQS](/data-feeds/access-methods/streaming)-compatible clients, or pull with [REST or Arrow Flight](/data-feeds/access-methods/direct-reads). Tempo has no native gas token, so native balance templates don't apply, and the NFT Trades template stays empty because no NFT marketplace trades have happened on Tempo. **Datashare** Tempo token transfers, NFT transfers and swaps are available as bulk historical exports through [Datashare](/datashare/supported-chains). [View all supported chains →](/data-api/supported-chains) **September 30, 2026** ## Robinhood Chain is now supported Robinhood Chain mainnet is now supported across Moralis Data APIs and Streams. You can query Robinhood Chain for blocks, transactions, token prices, OHLCV data, DEX swaps, wallet token balances, and wallet transaction history, or use Streams to subscribe to realtime onchain events. Moralis indexing covers the chain from its genesis block on 30 April 2026. | Detail | Value | | - | - | | Chain ID | `0x1237` (4663) | | Chain values | `robinhood`, `0x1237` | | Native token | ETH | **Supported Data API capabilities** * **Blockchain:** blocks and transactions * **Token prices:** current price, [price sparkline](/data-api/universal/token/price/token-price-sparkline), [price timeseries](/data-api/universal/token/price/token-price-timeseries) * **Market data:** OHLCV candlesticks, swaps by pair, swaps by token * **Wallets:** token balances and transaction history For chain-specific endpoints, use `robinhood` or `0x1237` as the `chainAlias`. For wallet token balances and wallet transaction history, pass Robinhood Chain through the `chains` query parameter. **Streams** Robinhood Chain is also supported in [Moralis Streams](/streams/supported-chains). Use chain ID `0x1237` to create Robinhood Chain streams for native transfers, ERC-20 and NFT activity, contract events, and transaction data. Streams requires the hex chain ID; the `robinhood` alias is not accepted. **Internal transactions** Internal transactions are not supported on Robinhood Chain. Internal native transfers and trace-level contract deployments created through `CREATE` or `CREATE2` are therefore not included. Top-level contract creation is still reported through `contractAddress`. See [Internal Transactions](/data-api/data-features/data-enrichment/internal-transactions). [View all supported chains →](/data-api/supported-chains) **September 28, 2026** ## Sei Testnet Support Ends October 2, 2026 Moralis is removing support for **Sei Testnet** (`sei-testnet` / `0x530`) on **Friday, October 2, 2026**, across Data API, Streams, and Datashare. After that date, requests targeting Sei Testnet will return an unsupported-chain error. **Sei mainnet is not affected.** Sei (`sei` / `0x531`) remains fully supported across Data API, Streams, and Datashare, and no action is needed for mainnet integrations. If you use Sei Testnet for development or testing, switch to one of our other [supported testnets](/data-api/supported-chains) (such as Ethereum Sepolia, Base Sepolia, or Arbitrum Sepolia) before October 2, 2026, and update or delete any Streams configured for `0x530`. [Reach out to the team](https://admin.moralis.com/) (via chat widget) if you need help migrating. **September 28, 2026** ## Moralis Data Feeds [Moralis Data Feeds](/data-feeds/overview) is now available: the blockchain data your application needs, delivered straight into your own database. Backfill history, stay in sync block by block, and query the data directly in your own stack. **What you can do:** * **Start from a template or build from scratch**: use [pre-built templates](/data-feeds/templates/overview) for wallet history, token balances, swaps, NFT activity, contract logs, and more. * **Choose your chain and datasets**: work across supported EVM networks, Solana, and Bitcoin, then select the blockchain data relevant to your application. * **Transform data with SQL**: filter rows, select fields, and shape the output before it reaches your destination. * **Real-time + historical**: stream new blockchain data as new blocks arrive, or start from an earlier block or date to replay history. See [Modes](/data-feeds/concepts/modes) and [History and Backfill](/data-feeds/concepts/history-and-backfill). * **Connect your own stack**: send data to PostgreSQL, MySQL, ClickHouse, Kafka, AMQP, SQS, REST API, or Arrow Flight [destinations](/data-feeds/concepts/destinations). * **Build with Alpha**: use the AI co-pilot to configure and build Data Feeds from natural-language instructions. **Who it’s for:** wallets, trading platforms, analytics products, exchanges, accounting and compliance tools, and teams that need persistent blockchain datasets inside their own infrastructure. Browse [use cases](/data-feeds/use-cases/portfolio-tracking) for complete workflows. **Pricing:** All paid Moralis plans include real-time Data Feeds usage, with a monthly budget based on your plan. Historical backfill is billed separately, with cost based on the amount of historical data processed. **APIs give you ready-made answers. Data Feeds gives you the dataset to build on.** [Get started with the quickstart →](/data-feeds/migration/quickstart) [Compare Data Feeds and the REST API →](/data-feeds/concepts/data-feeds-vs-the-rest-api) **August 26, 2026** ## Moonbeam, Moonriver and Lisk Support Ends September 25, 2026 Moralis is removing support for **Moonbeam** (`0x504`), **Moonriver** (`0x505`), and **Lisk** (`0x46f`) on **September 25, 2026**, across all products: Data API, Streams, RPC Nodes, and Datashare. GLMR and MOVR have already migrated to Base ([Moonbeam](https://moonbeam.network/news/moonbeam-strategic-update-moonbeam-network-relaunches-on-base/), [Moonriver](https://moonbeam.network/news/moonriver-strategic-update-movr-is-migrating-to-base/)), and both original networks stopped producing new blocks on August 1, 2026. Lisk is winding down the Lisk Chain as part of [the next chapter for Lisk](https://lisk.com/blog/posts/introducing-the-new-lisk/). In both cases the activity has moved to chains Moralis already supports in full. **Timeline** | Date | State | | - | - | | August 1, 2026 | Moonbeam and Moonriver stopped producing new blocks | | September 25, 2026 | Moralis removes all three chains. Requests targeting them return an unsupported-chain error | | October 31, 2026 | Lisk's deadline to bridge assets from the Lisk Chain to Ethereum. Bridging takes at least 7 days | | November 30, 2026 | Final shutdown of the Lisk Chain and its related infrastructure | **Where to point your integration** | Removed chain | Migrate to | | - | - | | Moonbeam (`moonbeam` / `0x504`) | Base (`base` / `0x2105`) | | Moonriver (`moonriver` / `0x505`) | Base (`base` / `0x2105`) | | Lisk (`lisk` / `0x46f`) | Ethereum (`eth` / `0x1`) or Base (`base` / `0x2105`) | For RPC Nodes, swap the path segment, for example `https://site1.moralis-nodes.com/base/`. Your API key, authentication, request shapes, and response formats do not change. Only the target chain does. GLMR and MOVR use new contracts on Base. LSK is unchanged on Ethereum, so if you hold it there or on an exchange, no action is needed. | Token | Contract address on Base | | - | - | | GLMR | `0xb3846fd356c2149ee8d30b0449088dc74e265459` | | MOVR | `0x43fEB74608334DDa8c1a6500D185cFC3Ea962B83` | **What changes on September 25, 2026** * **Data API:** wallet, token, NFT, DeFi, and price endpoints reject `moonbeam`, `0x504`, `moonriver`, `0x505`, `lisk`, and `0x46f`. This applies to the `chain` query parameter on Deep Index endpoints and to the `chains` array on Universal API endpoints, so remove these values from your chain lists rather than relying on the rest of a multi-chain request still resolving. * **RPC Nodes:** the `moonbeam`, `moonriver`, and `lisk` paths on `site1.moralis-nodes.com` and `site2.moralis-nodes.com` stop resolving, including archive reads at historical block heights (`eth_getBlockByNumber`, `eth_getLogs`, `eth_getBalance` with a past block tag). * **Streams:** any stream that still lists `0x504`, `0x505`, or `0x46f` in `chainIds` is invalid. List your streams with [Get streams](/streams/api-reference/streams/get-streams), then either [update the stream](/streams/api-reference/streams/update-stream) to a supported chain or [delete it](/streams/api-reference/streams/delete-stream). * **Datashare:** all three chains are removed from the available datasets. * **Docs:** the Moonbeam and Lisk RPC reference pages and their rows in the supported-chains tables are removed from the navigation. Lisk Sepolia (`0x106a` / 4202) was already removed in the [June 15, 2026 testnet wind-down](#testnets-removed). **Export your history before September 25, 2026** Historical data stays queryable until then. Paginate each call with `cursor` until the response returns an empty `result` and no `cursor`. | Data | Endpoint | | - | - | | Full wallet history, decoded | [Wallet History](/data-api/evm/wallet/wallet-history) | | ERC-20 transfers | [Wallet Token Transfers](/data-api/evm/wallet/token-transfers) | | NFT transfers | [Wallet NFT Transfers](/data-api/evm/wallet/nft-transfers) | | Closing token balances | [Wallet Token Balances](/data-api/evm/wallet/token-balances) | **The Lisk Chain runs past our removal date** Moralis removes Lisk ahead of Lisk's own timeline. The Lisk Chain keeps producing blocks and its infrastructure keeps running as normal until November 30, 2026, so if you need chain access after September 25, 2026, point your integration at Lisk's own endpoints. Lisk's [documentation](https://docs.lisk.com/) stays available and user-facing support has moved to [support.lisk.com](https://support.lisk.com/). For a walkthrough of the Moonbeam and Moonriver migration, watch [Moonbeam and Moonriver Migration to Base](https://www.youtube.com/watch?v=63UJ4EaqfUM). If this change affects your integration or you need additional time, [reach out to the team](https://admin.moralis.com/) (via chat widget). **August 11, 2026** ## Moonbeam and Moonriver API Deprecation: Migrate to Base > [!NOTE] > > **Updated August 26, 2026.** Both chains stopped producing new blocks on August 1, 2026, so there has been no real-time data to serve since then. Historical data stayed available and is now scheduled for removal on **September 25, 2026**. See [Moonbeam, Moonriver and Lisk Support Ends September 25, 2026](#moonbeam-moonriver-and-lisk-support-ends-september-25-2026) for the current timeline. Moralis API support for **Moonbeam** (`0x504`) and **Moonriver** (`0x505`) is being removed. Both chains stopped producing new blocks on **August 1, 2026**, and historical support for both is removed on **September 25, 2026**. Following [Moonbeam's network relaunch on Base](https://moonbeam.network/news/moonbeam-strategic-update-moonbeam-network-relaunches-on-base/), GLMR has fully migrated from the Moonbeam Polkadot parachain to Base as a 1:1 ERC-20 token, and [MOVR has migrated to Base](https://moonbeam.network/news/moonriver-strategic-update-movr-is-migrating-to-base/) on the same terms. Holder bridging closed on July 31, 2026, both original networks stopped producing new blocks on August 1, 2026, and both have wound down. **What's changing:** * **Data API:** wallet, token, NFT, DeFi, and price endpoints no longer return new Moonbeam or Moonriver data, since neither chain has produced a block since August 1, 2026. Historical records up to the final block are still returned until September 25, 2026. * **RPC Nodes:** the Moonbeam and Moonriver RPC endpoints (`https://site1.moralis-nodes.com/moonbeam/` and `.../moonriver/`) still resolve and serve the final state of each chain. They are removed on September 25, 2026, along with their documentation. * **Streams:** existing Moonbeam and Moonriver streams no longer emit webhook notifications, since there are no new blocks, and should be deleted from your workspace. **What you need to do:** migrate your integration to Moralis Base endpoints. GLMR, MOVR, and all associated activity are now tracked on Base. * Update your `chain` parameter to `base` (`0x2105`). For RPC Nodes, switch the path segment to `https://site1.moralis-nodes.com/base/`. * Use the new token contracts on Base: | Token | Contract address on Base | | - | - | | GLMR | `0xb3846fd356c2149ee8d30b0449088dc74e265459` | | MOVR | `0x43fEB74608334DDa8c1a6500D185cFC3Ea962B83` | **Not affected:** your API key, authentication, request shapes, and response formats. Base is already fully supported across the Data API, RPC Nodes, and Streams. Only the target chain changes. Export anything you still need from Moonbeam or Moonriver before September 25, 2026 to avoid errored responses. Questions? [Reach out to the team](https://admin.moralis.com/) (via chat widget). **July 31, 2026** ## Token Holders and Solana Token Discovery Endpoints Removed As [announced on June 30](#token-holders-and-solana-token-discovery-endpoints-sunsetting), the following endpoints have now been **removed** as of July 31, 2026. Requests to these endpoints return a 404. If you are still calling any of them, migrate to the replacements below. **Solana token holders:** * `GET /token/{network}/holders/{address}` — migrate to [Token Holders](/data-feeds/templates/token/token-holders) * `GET /token/{network}/{address}/top-holders` — migrate to [Token Holders](/data-feeds/templates/token/token-holders) * `GET /token/{network}/holders/{address}/historical` — migrate to [Historical Balances](/data-feeds/templates/token/historical-balances) **EVM token holders (historical only):** * `GET /erc20/{tokenAddress}/holders/historical` — migrate to [Historical Balances](/data-feeds/templates/token/historical-balances) The other two EVM token holder endpoints, [`GET /erc20/{tokenAddress}/holders`](/data-api/evm/token/holders/token-holder-stats) (holder stats) and [`GET /erc20/{token_address}/owners`](/data-api/evm/token/holders/token-holders) (token holders), **remain fully supported**. **Solana token discovery (`/token/{network}/exchange/*`):** * `GET /token/{network}/exchange/{exchange}/new` * `GET /token/{network}/exchange/{exchange}/bonding` * `GET /token/{network}/exchange/{exchange}/graduated` * `GET /token/{network}/{address}/bonding-status` All four are served by [Token Bonding Status](/data-feeds/templates/token/token-bonding-status). The API reference pages for these endpoints have been removed from the navigation, and their entries are gone from the OpenAPI sources so generated docs and API clients no longer advertise them. If you need help identifying the right replacement, [reach out to the team](https://admin.moralis.com/) (via chat widget). **July 21, 2026** ## Cross-Chain Token Balances One of our most popular Deep Index endpoints, **Token Balances**, is now available on the Universal API as **Cross-Chain Token Balances**. A single request returns a wallet's token balances across multiple chains - no more one-request-per-chain plus client-side stitching. **What changed vs. the legacy endpoint:** | | Legacy ([getWalletTokenBalancesPrice](https://deep-index.moralis.io/api-docs-2.2/#/Wallets/getWalletTokenBalancesPrice)) | New ([getTokenBalances](https://api.moralis.com/api#/Wallets/getTokenBalances)) | | - | - | - | | Scope | Single chain per request | Multi-chain in one request | | Chain coverage | EVM | EVM + Bitcoin (Solana coming) | | Filters | Spam exclusion, unverified contracts, liquidity thresholds, etc. | All preserved | | Pricing data | Included | Included, plus optional `includeSparklines` and `includePnl` enrichment per token | Everything customers already rely on - spam filtering, unverified contract exclusion, liquidity thresholds, USD pricing - works exactly the same. The only difference is you can now ask for multiple chains in a single call. **Who it's for:** wallets, exchanges, portfolio dashboards, tax tools, and AI agents that need a wallet's full multi-chain holdings without firing one request per chain. **Why it matters:** * **Fewer requests, simpler integration** - one call instead of N (where N = chains your users hold assets on) * **Faster portfolio views** - no client-side stitching across responses * **Same trusted filters** - spam, unverified, and low-liquidity controls carry over unchanged, so existing implementations port cleanly **Roadmap:** covers EVM and Bitcoin (address or xpub) today. Coming next: * **Solana** - Solana token balances brought into the Universal API (we already offer Solana token balances as a dedicated API; this unifies them into the same multi-chain request structure) The end state: one endpoint, one request shape, balances across EVM, Bitcoin, and Solana wallets. [Try the new endpoint →](https://api.moralis.com/api#/Wallets/getTokenBalances) **July 20, 2026** ## Data Feeds Early Access Data Feeds is now available in **early access**. Instead of calling APIs per request, Data Feeds continuously syncs Moralis data (wallet history, balances, prices, swaps, holders, and more) directly into your own ClickHouse, Postgres, or MySQL database. **What's included:** * [Overview and concepts](/data-feeds/overview): how Data Feeds works, modes, destinations, history and backfill, and reorg handling. * [Quickstart](/data-feeds/migration/quickstart): run your first sink with the starter pack and see data land in minutes. * [Data Feed Templates](/data-feeds/templates/overview): 26 pre-built blueprints that reconstruct our most popular endpoints across Wallet, Token, Price, DeFi, NFT, and Blockchain APIs. * [Migration guides](/data-feeds/migration/overview): field-by-field mappings from the Moralis REST API to templates, including an [endpoint lookup](/data-feeds/migration/endpoints). * [Use cases](/data-feeds/use-cases/portfolio-tracking): portfolio tracking, accounting, token analytics, trading and charting, NFT marketplaces, compliance, and event indexing. Early access is limited. [Request access](https://admin.moralis.com/data-feeds) to get started. **July 18, 2026** ## Token Price Timeseries & Sparkline Two chart-ready price endpoints are now available on the Universal API, covering native coins and tokens across EVM (Ethereum, Base, BNB, Polygon, Arbitrum, Linea, and more), Solana, and Bitcoin - through a single request shape. * **[Token Price Timeseries](/data-api/universal/token/price/token-price-timeseries)** ([getTokenPriceTimeSeries](https://api.moralis.com/api#/Tokens/getTokenPriceTimeSeries)) - historical price points for a token at your chosen `interval` (`5m` up to `monthly`), with optional forward-fill for gap-free line charts. * **[Token Price Sparkline](/data-api/universal/token/price/token-price-sparkline)** ([getTokenPriceSparkline](https://api.moralis.com/api#/Tokens/getTokenPriceSparkline)) - a fixed number of price points for a selected `range` (`24h` to `1y`) - drop the response directly into a sparkline widget in token lists, watchlists, or portfolio rows, no resampling needed. **Who it's for:** wallets, portfolio dashboards, token screeners, and trading UIs that need price charts without building candle-aggregation pipelines. [Try the new endpoints →](https://api.moralis.com/api#/Tokens) **July 15, 2026** ## Multi-Chain PnL Endpoints Wallet profitability is now available on the Universal API as a dedicated **[PnL API](/data-api/universal/pnl/overview)** - three new endpoints that replace the legacy single-chain Deep Index profitability endpoints with **multi-chain requests**: | New (Universal) | Replaces (Deep Index) | | - | - | | [Wallet PnL](/data-api/universal/pnl/wallet-pnl) - per-token realized/unrealized PnL, ROI, volumes, and trade counts across multiple chains | [Wallet PnL Breakdown](/data-api/evm/wallet/wallet-pnl) | | [Wallet PnL Summary](/data-api/universal/pnl/wallet-pnl-summary) - aggregated wallet-level totals including win rate | [Wallet PnL Summary](/data-api/evm/wallet/wallet-pnl-summary) | | [Top Traders by Token](/data-api/universal/pnl/top-traders) - top-trader leaderboard for a token, ranked by a selectable PnL metric | [Top Traders by Token](/data-api/evm/token/signals/top-traders) | **What's new vs. the legacy endpoints:** * **Multi-chain in one call** - pass a list of `chains` (or `mainnets`) instead of one request per chain * **Broader chain coverage** - Ethereum, Base, BNB, Polygon, Optimism, Avalanche, and Pulse * **Quality filters** - `excludeLowLiquidity`, `minVolumeUsd`, and `minTradeCount` cut noise from the results * **Flexible time ranges** - a `period` shorthand (`7d`, `30d`, `all`) or explicit `fromTimestamp`/`toTimestamp` * **Selectable ranking** - sort top traders by realized, unrealized, or total PnL, volume, or trade count **Who it's for:** portfolio trackers, trading platforms, copy-trading products, and token analytics surfacing smart-money activity. [Try the new endpoints →](https://api.moralis.com/api#/PnL) **June 30, 2026** ## Token Holders and Solana Token Discovery Endpoints Sunsetting > [!NOTE] > > **These endpoints were removed on July 31, 2026.** See [Token Holders and Solana Token Discovery Endpoints Removed](#token-holders-and-solana-token-discovery-endpoints-removed) for the replacements. The following endpoints are now deprecated and will be removed on **July 31, 2026**. If you rely on any of them, please migrate before that date. [Reach out to the team](https://admin.moralis.com/) (via chat widget) if you need help identifying replacements. **Solana token holders (all sunset):** * `GET /token/{network}/holders/{address}` — Token holder metrics * `GET /token/{network}/{address}/top-holders` — Top token holders * `GET /token/{network}/holders/{address}/historical` — Historical token holders **EVM token holders (historical only):** * `GET /erc20/{tokenAddress}/holders/historical` — Historical token holders The other two EVM token holder endpoints — [`GET /erc20/{tokenAddress}/holders`](/data-api/evm/token/holders/token-holder-stats) (holder stats) and [`GET /erc20/{token_address}/owners`](/data-api/evm/token/holders/token-holders) (token holders) — **remain fully supported**. **Solana token discovery (`/token/{network}/exchange/*`):** * `GET /token/{network}/exchange/{exchange}/new` — New tokens by exchange * `GET /token/{network}/exchange/{exchange}/bonding` — Bonding tokens by exchange * `GET /token/{network}/exchange/{exchange}/graduated` — Graduated tokens by exchange * `GET /token/{network}/{address}/bonding-status` — Token bonding status **June 30, 2026** ## Token Score Becoming EVM-Only (Solana Support Sunsetting) Token Score is becoming an **EVM-only** feature. Solana support for Token Score is now deprecated and will be removed on **July 31, 2026**. Token Score remains fully supported on all EVM chains — nothing changes there. **What's changing on Solana:** * The Token Score and Historical Token Score endpoints — [`GET /tokens/{tokenAddress}/score`](/data-api/universal/token/score/token-score) and [`GET /tokens/{tokenAddress}/score/historical`](/data-api/universal/token/score/token-score-timeseries) — will no longer return data for Solana tokens. They remain available for EVM. * The embedded `score` field is being removed from Solana token responses: Solana token price, token metadata, and wallet token balances. The Solana `score` field is now marked deprecated in the API reference and will stop being returned on July 31, 2026. Remove any code that reads it before then. EVM Token Score — including the `securityScore` field on EVM token price — is unaffected. [Reach out to the team](https://admin.moralis.com/) (via chat widget) if you need help. **June 15, 2026** ## Testnets Removed As of June 15, 2026, the following testnets are no longer supported across Moralis products (Data API, Streams, RPC Nodes, and Datashare). Requests targeting these chains will no longer return data. * Chiliz Testnet (`0x15b32` / 88882) * Gnosis Chiado (`0x27d8` / 10200) * Linea Sepolia (`0xe705` / 59141) * Moonbase (`0x507` / 1287) * Lisk Sepolia (`0x106a` / 4202) The corresponding mainnets (Chiliz, Gnosis, Linea, Moonbeam, and Lisk) remain fully supported. API reference sources have been refreshed so generated endpoint docs no longer advertise these retired testnets. If you're impacted, we recommend switching to one of our other [supported testnets](/streams/supported-chains) (such as Ethereum Sepolia, Base Sepolia, or Arbitrum Sepolia) for your testing needs. **June 4, 2026** ## Cortex API and legacy Data API Endpoints Removed As [announced on May 5](#cortex-api-and-legacy-data-api-endpoints-sunsetting), the following endpoints and APIs have now been **removed** as of June 4, 2026. Requests to these endpoints will return an error. If you are still calling any of them, migrate to the replacements below. **Cortex API:** * `POST /chat` — migrate to [Onchain Skills](/data-api/onchain-skills/overview), which replaces Cortex as our AI interface for Moralis data. **Discovery endpoints (`/discovery/*`):** * `POST /discovery/tokens` * `GET /discovery/token` — migrate to the [Token Search API](/data-api/universal/token/search/token-search). * `GET /discovery/tokens/rising-liquidity` * `GET /discovery/tokens/buying-pressure` * `GET /discovery/tokens/solid-performers` * `GET /discovery/tokens/experienced-buyers` * `GET /discovery/tokens/risky-bets` * `GET /discovery/tokens/blue-chip` * `GET /discovery/tokens/top-gainers` * `GET /discovery/tokens/top-losers` * `GET /discovery/tokens/trending` **Volume endpoints (`/volume/*`):** * `GET /volume/chains` * `GET /volume/categories` * `GET /volume/timeseries` * `GET /volume/timeseries/{categoryId}` **Sniper endpoints (EVM and Solana):** * `GET /pairs/{address}/snipers` (EVM) * `GET /token/{network}/pairs/{pairAddress}/snipers` (Solana) **ERC20 endpoints (EVM):** * `GET /erc20/exchange/{exchangeName}/new` * `GET /erc20/exchange/{exchangeName}/bonding` * `GET /erc20/exchange/{exchangeName}/graduated` * `GET /erc20/{tokenAddress}/bondingStatus` * `GET /erc20/{address}/stats` * `GET /erc20/{token_address}/pairs/stats` — migrate to [`GET /tokens/{tokenAddress}/analytics`](/data-api/universal/token/analytics/token-analytics) * `GET /erc20/metadata/symbols` — migrate to [`GET /tokens/search`](/data-api/universal/token/search/token-search) **Market data endpoints (`/market-data/*`):** * `GET /market-data/erc20s/top-tokens` * `GET /market-data/erc20s/top-movers` * `GET /market-data/nfts/top-collections` * `GET /market-data/nfts/hottest-collections` * `GET /market-data/global/market-cap` * `GET /market-data/global/volume` If you need help identifying the right replacement for a removed endpoint, [reach out to the team](https://admin.moralis.com/) (via chat widget). **June 1, 2026** ## 11 New Solana DEXes We've expanded Solana DEX coverage with **11 newly indexed DEX programs**, powering token pairs, swaps, prices, OHLC, and other DEX-derived features across the Data API. **Newly supported:** * **BisonFi** * **HumidiFi** * **Phoenix** * **Manifest** * **Tessera V** * **SolFi** * **ZeroFi** * **GoonFi V1** (dormant) and **GoonFi V2** (active) * **Saber** * **PancakeSwap** For these protocols, swap data (and therefore prices) is available from **June 1, 2026** onwards. Full historical coverage is coming soon. All other Solana DEXes have full history. See the full list of program IDs on the [Supported DEXes](/data-api/data-features/integrations/supported-dexs#solana-dex-support) page. **June 1, 2026** ## Sunsetting Zeta Chain RPC As of June 1, 2026, Moralis is sunsetting RPC node support for Zeta Chain. The Zetachain and Zetachain Testnet RPC endpoints are no longer available, and their documentation has been removed. If you rely on Zeta Chain RPC, please migrate to an alternative provider. All other supported chains are unaffected. **May 29, 2026** ## Fantom Chain Sunsetting Fantom mainnet support is being removed across all Moralis APIs on **May 29, 2026**. Fantom Opera testnet has already been removed. The Fantom Opera network is winding down as a legacy chain, and we're retiring our integration in line with the broader ecosystem shift. **What's changing:** * **Data API** — wallet, token, NFT, DeFi, and price endpoints no longer return Fantom (`0xfa`) data. Requests passing `fantom` or chain id `0xfa` will return an error. * **RPC Nodes** — Fantom RPC node endpoints are no longer available, and their documentation has been removed. * **Streams** — existing Fantom streams will stop emitting webhook notifications and should be deleted from your workspace. * **Testnet** — Fantom Opera testnet was removed ahead of mainnet as part of this wind-down. **Why:** Fantom Opera has transitioned into a legacy chain with declining activity following the broader migration to Sonic. Maintaining a dedicated integration is no longer justified by usage, so we're consolidating support onto actively maintained networks. **What to do:** * Remove any `fantom` / `0xfa` references from your API requests, SDK calls, and stream configurations before May 29 to avoid errored responses. * If you still rely on Fantom data, migrate to an alternative provider, or move your workloads to one of the [supported chains](/data-api/supported-chains). All other supported chains are unaffected. **May 27, 2026** ## Bitcoin Data API Full Bitcoin coverage now lands on the Moralis Universal API — raw blocks and transactions, market prices with sparklines, address history and balances, plus native xpub tooling. Every endpoint is the same Universal endpoint EVM and Solana developers already use; just pass `bitcoin` as the chain. **What's new:** * **Raw data** — raw blocks and raw transactions for teams working directly with onchain data * **Market data** — current BTC price, full historical time series, and chart-ready price sparklines for chart UIs * **Address-level data** — transaction history and token balances for any Bitcoin address * [**Xpub tooling**](/data-api/bitcoin/utility/overview) — pass a Bitcoin address **or** an xpub to the wallet endpoints, plus a new [utility endpoint](/data-api/bitcoin/utility/addresses-from-xpub) to enumerate every derived address from a given xpub **Address or xpub inputs:** the wallet endpoints accept either a Bitcoin address or an xpub directly, so the API slots into whatever shape your wallet or backend already uses. ```bash theme={null} # Address input GET /v1/wallets/bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq/tokens?chains=bitcoin # Xpub input — same endpoint, derives addresses server-side GET /v1/wallets/{xpub}/tokens?chains=bitcoin ``` This brings the full Bitcoin data lifecycle under one consistent surface — replacing the block explorer, price feed, custom indexer, xpub derivation library, and chart caching layer teams used to stitch together — with the same auth, SDKs, pricing, and rate limits as the rest of Moralis. **Use cases:** Bitcoin wallets, custody platforms, block explorers, BTC analytics, and multi-chain platforms extending their Bitcoin coverage. See the [Bitcoin Data API overview](/data-api/bitcoin/overview) for the full endpoint list and schemas, or start with the [Bitcoin Quickstart](/get-started/tutorials/data-api/bitcoin/bitcoin-quickstart). [Explore the Bitcoin Data API →](/data-api/bitcoin/overview) **May 26, 2026** ## Three New Solana DeFi Protocols Three top-tier Solana DeFi protocols are now supported through our existing DeFi endpoints, taking total Solana DeFi coverage to **10 protocols** - roughly 90% of Solana DeFi TVL, including all of the top protocols by TVL (Jupiter, Kamino, Sanctum, and Raydium). **Newly supported:** * **Jupiter Perpetual Exchange** - derivatives on the dominant Solana DEX aggregator (Jupiter Lend was already supported) * **Kamino Lend** - the second-largest protocol on Solana by TVL * **Sanctum** - validator liquid staking; the third-largest protocol on Solana by TVL These plug into the existing [Solana DeFi endpoints](/data-api/solana/defi/overview), so anyone already pulling Solana DeFi data picks them up automatically - no code changes required. **New utility endpoint:** `GET /v1/defi/protocols` returns the full list of supported DeFi protocols for a given chain, so you can query coverage programmatically and keep your integration in sync. See [DeFi Protocols](/data-api/data-features/integrations/defi-protocols). [Explore the Solana DeFi API →](/data-api/solana/defi/overview) **May 14, 2026** ## Mempool Notifications for Bitcoin Streams Bitcoin Streams now emit webhook notifications for **unconfirmed transactions** as soon as they hit the mempool — no need to wait for block inclusion. **What's new:** * **Pre-confirmation delivery** — matching transactions fire a webhook the moment they are broadcast to the mempool * **Same payload shape** as a confirmed-block webhook, with sentinel fields on the `block` object marking the delivery as mempool: * `block.height` → `"0"` * `block.hash` → `"mempool"` * `confirmed` → `false` * **`vin` and `vout` addresses both populated** in mempool payloads, so a watched address triggers a match whether it is sending or receiving * **Xpub-derived addresses fully supported** **Behavior to plan around:** * Each mempool transaction is delivered **at most once per stream** * The mempool delivery has **no follow-up** — the regular confirmed-block stream (`confirmed: false` then `confirmed: true`) handles in-block and reorg-safe deliveries for the same `txid` * Mempool transactions are **not guaranteed to confirm** — they can be replaced (RBF), evicted, or expire on low fee. Treat them as pending, not settled **Use cases:** show users a pending balance the instant a tx is broadcast, trigger UX flows on payment broadcast instead of confirmation, mempool monitoring, RBF detection, fee analytics, and MEV / arbitrage signals. No new endpoint, parameter, or schema. Existing Bitcoin streams pick this up automatically — branch on `block.hash === "mempool"` in your webhook handler to separate mempool events from confirmed-block events. See the [Mempool Notifications](/streams/bitcoin-streams#mempool-notifications) section for the full payload and handler patterns. [Explore Bitcoin Streams →](/streams/bitcoin-streams) **May 7, 2026** ## Bitcoin Streams Moralis Streams now extends to Bitcoin mainnet. Define a stream, attach the addresses or xpubs you want to watch, and receive real-time webhook deliveries within seconds of a block being mined - no node, no polling, no missed blocks. **What's new:** * **Bitcoin mainnet support** on the same Streams developer model used for EVM and Solana * **Dual-phase notifications** - matched transactions fire a webhook in the mempool (unconfirmed) and again on block confirmation, so you can mark deposits `pending` then `confirmed` from the same stream * **All address formats supported** - P2PKH (legacy `1...`), P2SH (SegWit-wrapped `3...`), and Bech32 native SegWit (`bc1q...`) * **Xpub support** - attach an extended public key and Moralis derives and monitors its addresses automatically, ideal for HD wallets * **Automatic retries** until your endpoint returns HTTP 200 **Monitoring modes available at launch:** * `addresses` — watch specific Bitcoin addresses * `xpub` — derive and monitor addresses from an extended public key * `allAddresses` — firehose mode: receive every Bitcoin transaction **Use cases:** exchange deposit detection (mempool → confirmed lifecycle), cold wallet surveillance, mining pool payout tracking, and real-time treasury monitoring for corporate or DAO-held BTC. A few Bitcoin-specific behaviors to plan around: input `address` and `value` fields are not populated (inbound detection only), output values are BTC decimals rather than satoshis, and `isCoinbase` should be detected via heuristic. See the [Bitcoin Streams docs](/streams/bitcoin-streams) for the full payload structure and processing patterns. [Explore Bitcoin Streams →](/streams/bitcoin-streams) **May 5, 2026** ## Solana Streams Moralis Streams now extends to Solana mainnet. Define a stream, set filters, and receive real-time webhook deliveries the moment matching transactions land in a slot - no node, no polling, no missed slots. **What's new:** * **Solana mainnet support** on the same Streams developer model used for EVM * **Pre / post token balances** included in every payload, so you can compute exact SPL token deltas without replaying instructions * **Inner instructions included**, so you can trace nested behavior across Cross-Program Invocations (CPIs) directly from the payload * **Automatic retries** until your endpoint returns HTTP 200 **Filters available at launch:** * `addresses` — match transactions where any `accountKey` in the transaction matches a watched address * `programIds` — filter to transactions invoking specific Solana programs (e.g., the SPL Token Program) * `mintAddresses` — filter to transactions involving specific SPL tokens, matched via `pre` / `postTokenBalances` * `allAddresses` — firehose mode: receive every Solana transaction **Use cases:** wallet activity notifications, DEX / DeFi position monitoring by `programId`, SPL token transfer tracking, bot and MEV monitoring, and AI agents reacting to on-chain events as they happen. If you've used Streams on EVM, the developer model is identical — only the filters differ. [Explore Solana Streams →](/streams/solana-streams) **May 5, 2026** ## Cortex API and legacy Data API Endpoints Sunsetting The following endpoints and APIs are now deprecated and will be removed on **June 4, 2026**: **Cortex API:** * `POST /chat` — migrate to [Onchain Skills](/data-api/onchain-skills/overview), which replaces Cortex as our AI interface for Moralis data. **Discovery endpoints (`/discovery/*`):** * `POST /discovery/tokens` * `GET /discovery/token` — migrate to the [Token Search API](/data-api/universal/token/search/token-search). * `GET /discovery/tokens/rising-liquidity` * `GET /discovery/tokens/buying-pressure` * `GET /discovery/tokens/solid-performers` * `GET /discovery/tokens/experienced-buyers` * `GET /discovery/tokens/risky-bets` * `GET /discovery/tokens/blue-chip` * `GET /discovery/tokens/top-gainers` * `GET /discovery/tokens/top-losers` * `GET /discovery/tokens/trending` **Volume endpoints (`/volume/*`):** * `GET /volume/chains` * `GET /volume/categories` * `GET /volume/timeseries` * `GET /volume/timeseries/{categoryId}` **Sniper endpoints (EVM and Solana):** * `GET /pairs/{address}/snipers` (EVM) * `GET /token/{network}/pairs/{pairAddress}/snipers` (Solana) **ERC20 endpoints (EVM):** * `GET /erc20/exchange/{exchangeName}/new` * `GET /erc20/exchange/{exchangeName}/bonding` * `GET /erc20/exchange/{exchangeName}/graduated` * `GET /erc20/{tokenAddress}/bondingStatus` * `GET /erc20/{address}/stats` * `GET /erc20/{token_address}/pairs/stats` — migrate to [`GET /tokens/{tokenAddress}/analytics`](/data-api/universal/token/analytics/token-analytics) * `GET /erc20/metadata/symbols` — migrate to [`GET /tokens/search`](/data-api/universal/token/search/token-search) **Market data endpoints (`/market-data/*`):** * `GET /market-data/erc20s/top-tokens` * `GET /market-data/erc20s/top-movers` * `GET /market-data/nfts/top-collections` * `GET /market-data/nfts/hottest-collections` * `GET /market-data/global/market-cap` * `GET /market-data/global/volume` If you rely on any of these endpoints, please migrate before June 4, 2026. [Reach out to the team](https://admin.moralis.com/) (via chat widget) if you need help identifying replacements. **Apr 30, 2026** ## Fantom Chain Sunsetting Fantom mainnet support will be removed across all Moralis APIs on **May 29, 2026**. Fantom Opera testnet has already been removed as of today. The Fantom Opera network is winding down as a legacy chain, and we're retiring our integration in line with the broader ecosystem shift. **April 29, 2026** ## DeFi API: Now on Solana The same three Universal DeFi API endpoints that returned EVM positions last week now return Solana positions too. No new endpoints, no schema changes - the existing calls now cover the most-used Solana protocols alongside EVM. **What's new:** * **Solana support** on the same Universal DeFi endpoints used for EVM * **7 of the most-used Solana protocols** supported at launch: * Jito * Save (formerly Solend) * Jupiter Lending * Raydium * Orca * Drift * Marinade * **Unified schema:** identical response shape across EVM and Solana - no client-side stitching * **Single call:** query EVM and Solana wallets through the same endpoints with the same filters **Main endpoints:** * [`getDefiSummary`](/data-api/solana/defi/wallet-protocols) — every protocol a wallet holds positions in, total USD value, and unclaimed rewards * [`getDefiPositionsSummary`](/data-api/solana/defi/wallet-positions) — all positions with token types, values, and reward tokens * [`getDefiPositionsByProtocol`](/data-api/solana/defi/wallet-positions-detailed) — detailed per-protocol breakdown with position-level detail **Usecases:** portfolio trackers, exchanges, tax tools, DeFi dashboards, and AI agents that need a unified DeFi position view across EVM and Solana in a single, consistent response. More Solana protocols are being added on a rolling basis. If you need a specific Solana protocol prioritized, [reach out to the team](https://moralis.com/enterprise/). [Explore the Solana DeFi API →](/data-api/solana/defi/overview) **April 22, 2026** ## DeFi API: 5,000+ Protocols, Now Multichain We've significantly expanded the DeFi API (EVM) with broader protocol coverage and simpler multichain queries in a single call. **What's new:** * **5,000+ DeFi protocols** supported, covering 96% of the entire EVM DeFi market * **Multichain queries:** fetch positions from a single chain, multiple chains, or all EVM chains in one API call * **Protocols include:** Uniswap V2/V3, Aave V2/V3, Lido, Curve, Compound, MakerDAO, Pendle, Convex, Yearn, GMX, Aerodrome, Velodrome, SushiSwap, PancakeSwap, Eigenlayer, Etherfi, Rocket Pool, Spark, Morpho, and thousands more **Main endpoints:** * [`getDefiSummary`](/data-api/evm/defi/wallet-protocols) — every protocol a wallet holds positions in, total USD value, and unclaimed rewards * [`getDefiPositionsSummary`](/data-api/evm/defi/wallet-positions) — all positions with token types, values, and reward tokens * [`getDefiPositionsByProtocol`](/data-api/evm/defi/wallet-positions-detailed) — detailed per-protocol breakdown with position-level detail **Usecases:** portfolio trackers, DeFi dashboards, tax and accounting tools, and risk monitoring. Anywhere you need a unified view of a wallet's DeFi exposure without wiring each protocol in manually. Solana DeFi support is coming soon. [Explore the DeFi API →](/data-api/evm/defi/overview) [Moralis DeFi API Overview](https://www.youtube.com/embed/yc-THd5xH5s) **April 2, 2026** ## Wallet Insights We've launched the Wallet Insights endpoint - a single API call that returns a comprehensive behavioral profile for any EVM wallet address. Get wallet age, activity timelines, transaction counts, transfer breakdowns (native, ERC-20, NFT), swap volume, gas spend, net flow, unique counterparties, contracts created, and more - all in one response. Each metric is also available per-chain via the `includeChainBreakdown` array, so you can see exactly how a wallet behaves across different networks. [Explore Wallet Insights →](/data-api/evm/wallet/wallet-insights) **Feburary 4, 2026** ## Historical Token Scores We've added the ability to track Token Scores over time with a new Historical Token Score endpoint. The Historical Token Score endpoint lets you retrieve a token's score history across different timeframes, so you can see how a token's onchain quality has changed over time. [Explore Historical Token Scores →](/data-api/universal/token/score/token-score-timeseries) **December 16, 2025** ## Token Scores We've launched the Moralis Token Score - a unified 0–100 rating that summarizes a token's onchain quality in a single, easy-to-use metric. [Explore Token Scores →](/data-api/universal/token/score/token-score) **November 24, 2025** ## Monad EVM Live We've added Monad EVM support to both the Data APIs and the Streams API, giving you access to this next-generation, EVM-compatible Layer-1 that delivers 10,000 TPS, 0.4-second block times, 800 ms finality, and near-zero gas fees. **October 16, 2025** ## Sei EVM Live We’ve added Sei EVM support to both the Data APIs and the Streams API, expanding your access to this high-performance Layer 1 chain built for speed and scalability. **September 30, 2025** ## HyperEVM Live We've added HyperEVM mainnet to the Moralis Streams API. You can now listen to real-time blockchain activity on HyperEVM - perfect for notifications, indexing, and on-chain automation. # Data API Tutorials Source: https://docs.moralis.com/data-api-tutorials Step-by-step tutorials for building with the Moralis Data API — wallets, tokens, NFTs, prices, and blockchain data. ## Overview These tutorials walk you through common use cases with the Moralis Data API, with complete code examples you can run locally. *** ### Wallets & Accounts > [card] [Get Internal Transactions](/get-started/tutorials/data-api/wallets-and-accounts/get-internal-transactions-for-a-wallet-address) > > Fetch internal transactions for any wallet address. > [card] [Get Native Token Balances](/get-started/tutorials/data-api/wallets-and-accounts/get-native-token-balances-for-eoas-and-smart-accounts) > > Retrieve native balances for EOAs and smart accounts. > [card] [Get Multi-Chain Activity](/get-started/tutorials/data-api/wallets-and-accounts/get-multi-chain-activity-for-a-wallet-address) > > Track wallet activity across multiple chains. > [card] [Get Full Wallet History](/get-started/tutorials/data-api/wallets-and-accounts/get-full-wallet-transaction-history-eoa-and-smart-accounts) > > Fetch complete transaction history for any wallet. > [card] [Build a Revoke Dashboard](/get-started/tutorials/data-api/wallets-and-accounts/build-a-token-approval-and-revoke-dashboard-revoke-cash-style) > > Build a token approval and revoke dashboard. *** ### Tokens & Markets > [card] [Top ERC-20 by Market Cap](/get-started/tutorials/data-api/tokens-and-markets/get-top-erc-20-tokens-by-market-cap) > > Get the top ERC-20 tokens ranked by market cap. > [card] [Build a DEX Screener Clone](/get-started/tutorials/data-api/tokens-and-markets/build-a-dex-screener-clone) > > Build a DEX screener-style token dashboard. > [card] [ERC-20 Transfer History](/get-started/tutorials/data-api/tokens-and-markets/get-erc-20-transfer-history-by-wallet-or-token) > > Fetch ERC-20 transfer history by wallet or token. > [card] [Token Metadata](/get-started/tutorials/data-api/tokens-and-markets/get-erc-20-token-metadata-by-address-or-symbol) > > Get ERC-20 token metadata by address or symbol. > [card] [Token Pairs & Liquidity](/get-started/tutorials/data-api/tokens-and-markets/get-token-pairs-and-liquidity-data) > > Fetch token pairs and liquidity data. > [card] [DEX Pair Addresses](/get-started/tutorials/data-api/tokens-and-markets/get-dex-pair-addresses-uniswap-pancake-swap-sushi-swap) > > Get DEX pair addresses from Uniswap, PancakeSwap, and more. > [card] [Pump.fun Tokens & Swaps](/get-started/tutorials/data-api/tokens-and-markets/get-pump-fun-tokens-swaps-and-prices) > > Fetch Pump.fun token swaps and prices. > [card] [Pump.fun Bonding & Graduated](/get-started/tutorials/data-api/tokens-and-markets/get-pump-fun-new-bonding-and-graduated-tokens) > > Track new bonding and graduated Pump.fun tokens. *** ### NFTs > [card] [Get All NFTs by Wallet](/get-started/tutorials/data-api/nfts/get-all-nfts-owned-by-a-wallet-address) > > Fetch all NFTs owned by a wallet address. > [card] [NFT Collections by Wallet](/get-started/tutorials/data-api/nfts/get-nft-collections-owned-by-a-wallet) > > Get NFT collections owned by a wallet. > [card] [NFT Metadata](/get-started/tutorials/data-api/nfts/get-nft-metadata-by-contract-and-token-id) > > Fetch NFT metadata by contract and token ID. > [card] [NFT Owners & Ownership](/get-started/tutorials/data-api/nfts/get-nft-owners-and-ownership-details) > > Get NFT owners and ownership details. > [card] [NFT Floor Prices](/get-started/tutorials/data-api/nfts/get-nft-floor-prices) > > Fetch NFT floor prices for collections. *** ### Prices & Charts > [card] [Get ERC-20 Token Price](/get-started/tutorials/data-api/prices-and-charts/get-the-price-of-an-erc-20-token) > > Fetch the current price of any ERC-20 token. > [card] [Historical OHLC Data](/get-started/tutorials/data-api/prices-and-charts/get-historical-erc-20-token-prices-ohlc-data) > > Get historical OHLC price data for tokens. > [card] [Build Price Charts](/get-started/tutorials/data-api/prices-and-charts/build-crypto-price-charts-using-ohlc-data) > > Build crypto price charts using OHLC data. *** ### Blocks & Transactions > [card] [Get Transaction by Hash](/get-started/tutorials/data-api/blocks-and-transactions/get-a-blockchain-transaction-by-hash) > > Fetch a blockchain transaction by its hash. > [card] [Find Block by Timestamp](/get-started/tutorials/data-api/blocks-and-transactions/find-the-closest-block-by-unix-timestamp) > > Find the closest block to a Unix timestamp. *** ## Data API Overview Video [Moralis Data API Overview – Fetch Onchain Data at Scale](https://www.youtube.com/embed/O8PXFkN71oo) # Get Block Source: https://docs.moralis.com/data-api/bitcoin/blockchain/block openapi-files/data-api/bitcoin-api-v1.json GET /v1/chains/{chainAlias}/blocks/{blockIdentifier} Returns full Bitcoin block data including transactions, inputs, outputs, and UTXO-level detail. > [!NOTE] > > For Bitcoin, pass `bitcoin` (or `bitcoin-mainnet`) as `chainAlias`. The `blockIdentifier` accepts either a Bitcoin block height (all-digit values are treated as heights) or a block hash (any other value is forwarded as a hash). # Bitcoin Blockchain API Source: https://docs.moralis.com/data-api/bitcoin/blockchain/overview Raw Bitcoin blocks and transactions — block headers, full transaction payloads, inputs, outputs, and UTXO-level detail. ## Overview The **Bitcoin Blockchain API** provides direct access to raw Bitcoin blocks and transactions through Moralis's Universal API. Pass `bitcoin` as the chain alias on the standard block and transaction endpoints. Query block headers, full transaction payloads, inputs, outputs, and UTXO-level detail without running your own Bitcoin node. *** ## Endpoints | Endpoint | Universal path | | - | - | | [Get Block](/data-api/bitcoin/blockchain/block) | `GET /v1/chains/bitcoin/blocks/{blockIdentifier}` | | [Get Transaction](/data-api/bitcoin/blockchain/transaction) | `GET /v1/chains/bitcoin/transactions/{txHash}` | *** ## Common Use Cases * **Block explorers** — display block and transaction detail * **Analytics pipelines** — ingest raw onchain data for custom indexing * **Compliance and tracing** — follow UTXO flows across transactions * **Wallet backends** — verify transaction inclusion and confirmation depth # Get Transaction Source: https://docs.moralis.com/data-api/bitcoin/blockchain/transaction openapi-files/data-api/bitcoin-api-v1.json GET /v1/chains/{chainAlias}/transactions/{txHash} Returns full Bitcoin transaction data including inputs, outputs, and UTXO-level detail. > [!NOTE] > > For Bitcoin, pass `bitcoin` (or `bitcoin-mainnet`) as `chainAlias` and the Bitcoin txid as `txHash`. # Bitcoin Data API Source: https://docs.moralis.com/data-api/bitcoin/overview Complete Bitcoin data coverage — raw blocks and transactions, market prices with sparklines, address history and balances, plus native xpub-key tooling. ### Overview The **Bitcoin Data API** brings full Bitcoin coverage to the Moralis Universal API. Every endpoint is the same Universal endpoint EVM and Solana developers already use — just pass `bitcoin` as the chain. Historically, shipping a serious Bitcoin app meant stitching together five different services: a block explorer for raw data, a price feed, a custom indexer for address activity, a derivation library for xpubs, and your own caching layer for chart UIs. The Bitcoin API replaces all of that under one consistent surface with the same auth, SDKs, pricing, and rate limits as the rest of Moralis. *** ### Explore the Bitcoin API > [card] [Blockchain API](/data-api/bitcoin/blockchain/overview) > > Raw blocks and raw transactions — work directly with onchain data. > [card] [Price API](/data-api/bitcoin/price/overview) > > Current BTC price, full historical time series, and chart-ready sparklines. > [card] [Wallet API](/data-api/bitcoin/wallet/overview) > > Transaction history and token balances for any Bitcoin address or xpub. > [card] [Xpub Utility](/data-api/bitcoin/utility/overview) > > Derive every address associated with a Bitcoin xpub. *** ### How It Works The Bitcoin API is delivered through Moralis's Universal API endpoints: | Capability | Universal endpoint | Bitcoin parameters | | - | - | - | | Raw blocks | `GET /v1/chains/{chainAlias}/blocks/{blockIdentifier}` | `chainAlias=bitcoin` | | Raw transactions | `GET /v1/chains/{chainAlias}/transactions/{txHash}` | `chainAlias=bitcoin` | | BTC current price | `GET /v1/chains/{chainAlias}/tokens/{tokenAliasOrTokenAddress}/price` | `chainAlias=bitcoin`, `tokenAlias=native` | | BTC historical price | `GET /v1/chains/{chainAlias}/tokens/{tokenAliasOrTokenAddress}/price/timeseries` | `chainAlias=bitcoin`, `tokenAlias=native` | | BTC sparkline | `GET /v1/chains/{chainAlias}/tokens/{tokenAliasOrTokenAddress}/price/sparkline` | `chainAlias=bitcoin`, `tokenAlias=native` | | Wallet BTC balances | `GET /v1/wallets/{walletAddressOrPublicKey}/tokens` | `chains=bitcoin`, `walletAddress=address OR xpub` | | Wallet transaction history | `GET /v1/wallets/{walletAddressOrPublicKey}/history` | `chains=bitcoin`, `walletAddress=address OR xpub` | | Addresses from xpub | `GET /v1/chains/{chainAlias}/wallets/{publicKey}/addresses` | `chainAlias=bitcoin`, `publicKey=xpub` | *** ### Key Capabilities * **Full Bitcoin data lifecycle in one API** — raw blocks and transactions, market data, address activity, and balances. No stitching required. * **Native xpub support** — every wallet endpoint accepts a Bitcoin address **or** an xpub, plus a utility endpoint to enumerate every derived address from an xpub. * **Chart-ready price data** — sparklines bundled alongside historical time series, no second integration needed. * **Address OR xpub inputs** — slot the API into whatever your wallet or backend already uses. * **Same Moralis developer experience** — consistent auth, SDKs, pricing, and rate limits with the rest of Moralis coverage. *** ### Address or Xpub Inputs The wallet endpoints accept either a Bitcoin address or an xpub directly: ```bash theme={null} # Address input GET /v1/wallets/bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq/tokens?chains=bitcoin # Xpub input — same endpoint, derives addresses server-side GET /v1/wallets/xpub6CUGRUonZSQ4TWtTMmzXdrXDtypWKiKrhko4egpiMZbpiaQL2jkwSB1icqYh2cfDfVxdx4df189oLKnC5fSwqPfgyP3hooxujYzAu3fDVmz/tokens?chains=bitcoin ``` To **enumerate** every derived address from an xpub (rather than just query against it), use the [xpub utility endpoint](/data-api/bitcoin/utility/addresses-from-xpub). *** ### Get Started * [**Blockchain API**](/data-api/bitcoin/blockchain/overview) — raw blocks and transactions * [**Price API**](/data-api/bitcoin/price/overview) — current price, history, and sparklines * [**Wallet API**](/data-api/bitcoin/wallet/overview) — address history and balances * [**Xpub Utility**](/data-api/bitcoin/utility/overview) — derive addresses from an xpub * [**Bitcoin Quickstart**](/get-started/tutorials/data-api/bitcoin/bitcoin-quickstart) — first request, address-or-xpub flow *** ### Watch: Bitcoin Data API [Moralis Bitcoin Data API](https://www.youtube.com/embed/us4CIqGre0A) # Current Price Source: https://docs.moralis.com/data-api/bitcoin/price/current-price openapi-files/data-api/bitcoin-api-v1.json GET /v1/chains/{chainAlias}/tokens/{tokenAliasOrTokenAddress}/price Get the current BTC price and additional market metadata. > [!NOTE] > > For BTC, pass `bitcoin` as `chainAlias` and `native` as `tokenAliasOrTokenAddress`. # Historical Price Source: https://docs.moralis.com/data-api/bitcoin/price/historical-price openapi-files/data-api/bitcoin-api-v1.json GET /v1/chains/{chainAlias}/tokens/{tokenAliasOrTokenAddress}/price/timeseries Get historical BTC price data points suitable for rendering line charts. Supports time intervals from 5 minutes to monthly. > [!NOTE] > > For BTC, pass `bitcoin` as `chainAlias` and `native` as `tokenAliasOrTokenAddress`. # Bitcoin Price API Source: https://docs.moralis.com/data-api/bitcoin/price/overview Current BTC price, full historical time series, and chart-ready sparklines through the Universal Token Price endpoints. ## Overview The **Bitcoin Price API** delivers BTC market data through the Moralis Universal Token Price endpoints. Pass `bitcoin` as the chain alias and `native` as the token alias to target BTC itself. Sparklines ship alongside historical data, so building a price chart UI doesn't require a second integration or your own caching layer. *** ## Endpoints | Endpoint | Universal path | | - | - | | [Current Price](/data-api/bitcoin/price/current-price) | `GET /v1/chains/bitcoin/tokens/native/price` | | [Historical Price](/data-api/bitcoin/price/historical-price) | `GET /v1/chains/bitcoin/tokens/native/price/timeseries` | | [Sparkline](/data-api/bitcoin/price/sparkline) | `GET /v1/chains/bitcoin/tokens/native/price/sparkline` | *** ## Common Use Cases * **Portfolio dashboards** — BTC price, change, and a sparkline next to balances * **Trading apps** — full historical charts with configurable granularity * **Notifications** — fire on price thresholds without polling a third-party feed * **Reporting** — pull historical price for accounting and tax flows # Sparkline Source: https://docs.moralis.com/data-api/bitcoin/price/sparkline openapi-files/data-api/bitcoin-api-v1.json GET /v1/chains/{chainAlias}/tokens/{tokenAliasOrTokenAddress}/price/sparkline Get a small set of recent BTC price points suitable for sparkline charts. Returns a fixed number of points based on the selected range. > [!NOTE] > > For BTC, pass `bitcoin` as `chainAlias` and `native` as `tokenAliasOrTokenAddress`. The response is a compact, chart-ready price array — drop it directly into a sparkline widget without resampling. # Addresses From Xpub Source: https://docs.moralis.com/data-api/bitcoin/utility/addresses-from-xpub openapi-files/data-api/bitcoin-api-v1.json GET /v1/chains/{chainAlias}/wallets/{publicKey}/addresses Returns every derived address along with its transfer count for a given Bitcoin xpub key. > [!NOTE] > > Pass `bitcoin` (or `bitcoin-mainnet`) as `chainAlias` and your Bitcoin extended public key as `publicKey`. The response lists every derived address along with its transfer count, so you can show only the addresses that have actually been used. # Xpub Utility Source: https://docs.moralis.com/data-api/bitcoin/utility/overview Native Bitcoin xpub tooling — derive every address from a Bitcoin extended public key (xpub) along with its transfer count. ## Overview Bitcoin developers regularly need to map an xpub to **every address it derives** — and to know which of those addresses have actually been used. The xpub utility solves that natively. Pass a Bitcoin extended public key (xpub), and the API returns every derived address with its transfer count. No client-side derivation library required. *** ## Endpoint | Endpoint | Universal path | | - | - | | [Addresses From Xpub](/data-api/bitcoin/utility/addresses-from-xpub) | `GET /v1/chains/bitcoin/wallets/{publicKey}/addresses` | *** ## Pairing With the Wallet API The Wallet API endpoints accept either an address or an xpub directly. For most flows you don't need to call the utility endpoint first — the API derives the addresses server-side. Use the utility endpoint when you need to **enumerate and display** the derived addresses themselves — for example a wallet UI that surfaces "this xpub controls the following addresses," or an analytics pipeline that wants to track each derived address independently. # BTC Balances Source: https://docs.moralis.com/data-api/bitcoin/wallet/address-balances openapi-files/data-api/bitcoin-api-v1.json GET /v1/wallets/{walletAddressOrPublicKey}/tokens Get native BTC balances for a Bitcoin address or xpub. When an xpub is supplied, balances are aggregated across all derived addresses server-side. > [!NOTE] > > The `walletAddressOrPublicKey` path parameter accepts either a Bitcoin address or an **xpub** — when an xpub is supplied, balances are aggregated across all derived addresses server-side. > [!NOTE] > > **Address auto-detection:** for a Bitcoin address or xpub, the `chains` parameter is optional — Moralis detects the chain family from the address format. Passing `chains=bitcoin` explicitly still works. # Wallet History Source: https://docs.moralis.com/data-api/bitcoin/wallet/address-transactions openapi-files/data-api/bitcoin-api-v1.json GET /v1/wallets/{walletAddressOrPublicKey}/history Get Bitcoin transaction history for a wallet. The wallet identifier accepts either a Bitcoin address or an xpub - when an xpub is supplied, history is aggregated across all derived addresses server-side. **Supported chain family:** Bitcoin (native BTC transfers). > [!NOTE] > > The `walletAddressOrPublicKey` path parameter accepts either a Bitcoin address or an **xpub** — when an xpub is supplied, history is aggregated across all derived addresses server-side. > [!NOTE] > > **Address auto-detection:** for a Bitcoin address or xpub, the `chains` parameter is optional — Moralis detects the chain family from the address format. Passing `chains=bitcoin` explicitly still works. # Bitcoin Wallet API Source: https://docs.moralis.com/data-api/bitcoin/wallet/overview Transaction history and token balances for any Bitcoin address — or xpub. Slots into whatever shape your wallet or backend already uses. ## Overview The **Bitcoin Wallet API** provides address-level activity and balances through the Moralis Universal Wallet endpoints. Pass `bitcoin` as the chain and either a Bitcoin address **or** an xpub as the wallet identifier. For workflows that need to enumerate every address derived from an xpub, pair the Wallet API with the [xpub utility](/data-api/bitcoin/utility/addresses-from-xpub). *** ## Endpoints | Endpoint | Universal path | | - | - | | [BTC Balances](/data-api/bitcoin/wallet/address-balances) | `GET /v1/wallets/{addressOrXpub}/tokens?chains=bitcoin` | | [Wallet History](/data-api/bitcoin/wallet/address-transactions) | `GET /v1/wallets/{addressOrXpub}/history?chains=bitcoin` | *** ## Key Features * **Address OR xpub input** — pass either; the API derives addresses server-side for xpubs * **Paginated history** — cursor-based pagination tuned for high-activity addresses * **No node required** — managed indexer handles UTXO accounting and reorgs *** ## Common Use Cases * **Bitcoin wallets** — show balances and history without operating a node * **Custody platforms** — surface activity for managed addresses * **Block explorers** — render address pages with full history and holdings * **Analytics** — aggregate flows across every address derived from a single xpub # Address & Entity Labeling Source: https://docs.moralis.com/data-api/data-features/data-enrichment/address-labelling Moralis enriches blockchain data with human-readable labels and entities, helping you understand who is behind on-chain activity. Moralis enriches blockchain data with **human-readable labels and entities**, helping you understand *who* is behind on-chain activity. This includes both: * **Address labels** (e.g. “Coinbase Hot Wallet”) * **Entities** (e.g. Coinbase, Uniswap, BlackRock) Together, they provide identity, context, and discoverability across wallets, transactions, and protocols. *** ## What Are Entities? **Entities** represent real-world organizations, projects, protocols, or individuals that control one or more blockchain addresses. Examples include: * Companies and institutions (e.g. exchanges, funds, TradFi firms) * DeFi protocols and DAOs * NFT marketplaces and collections * Public individuals Entities build on top of address labels by grouping **multiple related addresses** under a single, identifiable actor. *** ## Why Entities Matter Historically, blockchain data exposed only raw addresses or simple labels.\ This made it difficult to answer higher-level questions like: * Who is interacting with this wallet? * Which addresses belong to the same organization? * How does an entity operate across chains? With Entities, Moralis provides: * **In-depth context**\ Entities include metadata such as name, logo, description, and website. * **Cross-address visibility**\ Multiple addresses can be linked to a single entity, giving a more complete picture of activity. * **Better discovery and analysis**\ You can search for entities and analyze their on-chain behavior, rather than dealing with individual addresses in isolation. *** ## Entity-Enriched Responses When supported, Moralis APIs enrich address fields with both **labels** and **entity information**. Example: ```json theme={null} { "hash": "0x70c30285a9a4cc1c147cc94e5d0cefebe693fffd5fd5cbf727e2f86b6829d71b", "nonce": "6810858", "transaction_index": "72", "from_address": "Oxa9d1e08c7793af67e9d92fe308d5697fb81d3e43", "from_address_label": "Coinbase: Hot Wallet", "from_address_entity": "Coinbase", "from_address_entity_logo": "https://entities-logos.s3.us-east-1.amazonaws.com/coinbase.png", "to_address": "Oxa9d1e08c7793af67e9d92fe308d5697fb81d3e43", "to_address_label": "Blackrock Wallet", "to_address_entity": "Blackrock, Inc", "to_address_entity_logo": "https://entities-logos.s3.us-east-1.amazonaws.com/blackrock.png", "value": "0", "gas": "207128", "gas_price": "32393720336", "input": "0xa9059cbb000000000000000000000000c476723407b737c173bdfd87c7abc80f6856e6320000000000000000000000000000000000000000000000008533e3870aec3000", "receipt_cumulative_gas_used": "8535588", "receipt_gas_used": "52089", "receipt_contract_address": null, "receipt_root": null, "receipt_status": "1", "block_timestamp": "2023-06-26T16:48:23.000Z", "block_number": "17564884", "block_hash": "0x4e61fbb792a84c419a22ffcc590cbcb2f5a1b88d8e864d608e3544a3594c0e69", "transfer_index": [17564884, 72] } ``` This allows you to display transactions as **entity-to-entity interactions**, rather than raw address transfers. *** ## Where Entity & Address Labeling Is Available Entity and address labeling is supported on: * Any endpoint that includes `from_address` and `to_address` * Dedicated **Entity API** endpoints for discovery and lookup This means labeling is automatically available across: * Transactions * Wallet activity * Transfers * DeFi interactions *** ## Entity Coverage Moralis currently supports: * **500+ entities** * **10,000+ labeled addresses** Coverage is strongest across: * Ethereum * Polygon * BNB Chain * Optimism * Base * Arbitrum ### Supported Entity Categories Entities span a wide range of categories, including: * Centralized Exchange * Decentralized Exchange * NFT Marketplace * DeFi * TradFi * Fund * DAO * Bridge * Stablecoin * Lending / Borrowing * Liquid Staking / Restaking * NFT Collection * Gaming * Wallet * MEV * Real World Assets * Privacy * Cross-chain Infrastructure * Individual * Misc Coverage and categorisation are continuously expanding. *** ## Common Use Cases Address & Entity Labeling enables you to: * Build readable transaction feeds * Detect interactions with known exchanges, protocols, or institutions * Power compliance, monitoring, and analytics workflows * Aggregate activity at the entity level instead of per address *** ## Notes & Limitations * Labeling and entity assignment is **best-effort** * Not all addresses belong to known entities * New entities and labels are added continuously as coverage expands # Internal Transactions Source: https://docs.moralis.com/data-api/data-features/data-enrichment/internal-transactions Understand and access internal transactions to get a complete view of wallet activity, contract execution, and native value transfers on EVM chains. ## Overview Internal transactions are a critical part of many EVM-based interactions - and without them, **your data is incomplete**. Moralis provides **full historical and real-time support for internal transactions**, allowing you to capture value transfers and contract interactions that do **not** appear as standalone blockchain transactions. This is a key differentiator versus many APIs that only index external (user-initiated) transactions. Related pages: * [Wallet History](/data-api/evm/wallet/wallet-history) * [Raw Transactions](/data-api/evm/wallet/wallet-transactions) * [Transaction Decoding](/data-api/data-features/data-enrichment/transaction-decoding) *** ## What are internal transactions? Internal transactions are **value transfers and contract calls that occur during the execution of a transaction**, rather than being initiated directly by an externally owned account (EOA). They typically occur when: * A smart contract calls another contract * A contract transfers native currency (ETH, BNB, etc.) * A single transaction triggers multiple downstream actions > Internal transactions are **not separate blockchain transactions** - they are derived from EVM execution traces. *** ## Why internal transactions matter Without internal transactions, you miss: * Native transfers triggered by smart contracts * Airdrops distributed within a single transaction * Protocol rewards, fees, and payouts * Full wallet balance movements * Complete contract execution paths ### Example A user interacts with a DeFi protocol: 1. User sends **one** transaction 2. Contract distributes ETH to multiple addresses internally 3. Only internal transactions show where value actually moved Without internal transactions: * Wallet history is incomplete * Net worth calculations are wrong * Important events appear to be missing *** ## What Moralis provides Moralis indexes **full EVM execution traces**, enabling: * Historical internal transactions * Real-time internal transaction detection * Native value transfers inside contract calls * Consistent internal transaction data across APIs This ensures: * Complete wallet activity * Accurate portfolio and PnL calculations * Better protocol analytics *** ## Supported chains Internal transactions are supported across all major EVM **mainnet** networks, with **full historical coverage**. Testnets are not supported. Robinhood Chain does not support internal transactions; top-level contract creation is still reported, but trace-level `CREATE` / `CREATE2` deployments are not. | Chain | Real-time | Historical | | :- | :- | :- | | Ethereum Mainnet | ✅ | ✅ | | Polygon Mainnet | ✅ | ✅ | | BNB Chain | ✅ | ✅ | | Arbitrum | ✅ | ✅ | | Avalanche | ✅ | ✅ | | Base | ✅ | ✅ | | Optimism | ✅ | ✅ | | Linea | ✅ | ✅ | | Chiliz | ✅ | ✅ | | Monad Mainnet | ✅ | ✅ | | Tempo | ✅ | ✅ | *** ## Internal transactions vs external transactions | Feature | External | Internal | | :- | :- | :- | | Initiated by user | ✅ | ❌ | | Has its own tx hash | ✅ | ❌ | | Appears on block explorers by default | ✅ | ❌ | | Transfers native value | ✅ | ✅ | | Required for full wallet history | ✅ | ✅ | *** ## Streams support Internal transactions are also available in **Streams**, enabling: * Real-time detection of internal value transfers * Monitoring protocol payouts and rewards * Capturing native transfers triggered by contracts See: * [Streams Overview](/streams/overview) * [Webhook Payload](/streams/webhooks/webhook-payloads) *** ## Summary Internal transactions are essential for **accurate, production-grade blockchain data**. Moralis provides: * Full historical and real-time internal transactions * Broad EVM chain coverage * Simple access via existing and dedicated endpoints If you care about **completeness**, internal transactions are not optional. # NFT Metadata Source: https://docs.moralis.com/data-api/data-features/data-enrichment/nft-metadata Fetch and normalize NFT metadata into a clean, predictable format across ERC721 and ERC1155 collections. ## Overview NFT metadata is notoriously inconsistent. Different collections use different schemas, naming conventions, attribute formats, and storage locations - making it difficult to work with at scale. Moralis solves this by **normalizing NFT metadata into a clean, predictable structure**, while still allowing access to the original source data when needed. Related pages: * [NFT API Overview](/data-api/evm/nft/overview) * [NFT Traits & Rarity](/data-api/data-features/data-enrichment/nft-rarity) * [NFT Image Previews](/data-api/data-features/data-enrichment/nft-metadata/image-previews-cdn) * [Supported NFT Marketplaces](/data-api/data-features/integrations/nft-marketplaces) *** ## What is NFT metadata normalization? When enabled, Moralis transforms raw NFT metadata into a **standardized JSON structure** that works consistently across: * ERC721 * ERC1155 * OpenSea-style metadata * Collection-specific formats (e.g. CryptoPunks, ENS) This removes the need for custom parsing logic per collection. ### Why this matters Without normalization: * Attributes are inconsistently named * Values change type across collections * Metadata is often returned as a raw JSON string * Frontends and analytics break easily With normalization: * Predictable fields * Consistent attribute structure * Easier UI rendering * Easier indexing and analytics *** ## How to enable normalized metadata Several NFT endpoints support metadata normalization via the `normalizeMetadata` query parameter. When enabled: * Raw metadata is preserved * A new `normalized_metadata` object is added to the response *** ## Normalized metadata structure The normalized metadata object provides a **stable schema** across collections. ### Core fields ```javascript theme={null} { "name": "Moralis Mug", "description": "Moralis Coffee mug 3D asset", "image": "https://...", "external_link": "https://...", "animation_url": "https://...", "attributes": [] } ``` *** ### Normalized attributes Each attribute follows a consistent structure: ```javascript theme={null} { "trait_type": "Eye Color", "value": "Hazel", "display_type": "string", "max_value": 100, "trait_count": 7, "order": 1 } ``` This makes it easy to: * Render traits * Sort attributes * Calculate rarity * Compare NFTs across collections See also: * [NFT Traits & Rarity](/data-api/data-features/data-enrichment/nft-rarity) *** ## Raw vs normalized metadata Moralis always preserves the original metadata source. ### Normalized metadata * Returned as structured JSON * Easy to consume * Consistent across collections ### Raw metadata * Returned as a string * Mirrors the original token URI response * Useful for debugging or edge cases Example (raw metadata string): ```text theme={null} "{ \"name\": \"Dave Starbelly\", \"attributes\": [...] }" ``` *** ## Collection-specific normalization Moralis includes **custom normalization logic** for well-known collections and standards, including: * CryptoPunks * CryptoKitties * ENS * OpenSea-style metadata If a collection does not match a known format: * A default transformation is applied * Based on ERC721 or ERC1155 conventions * Most fields are still normalized successfully This ensures broad compatibility without manual handling. *** ## Automatic metadata refresh NFT metadata can change over time - especially when hosted on IPFS. To keep data fresh, Moralis automatically refreshes metadata when NFTs are requested. ### How it works * When an NFT is requested, it is queued for refresh * If the metadata URI points to IPFS: * The token is eligible for periodic refresh * Refreshing happens transparently in the background ### Cool-off period Metadata refresh is resource-intensive, so a cool-off period applies: * **IPFS-based metadata:**\ Refresh allowed once every **10 minutes per token** This balances freshness with performance. *** ## Collection offchain metadata In addition to token-level metadata, Moralis also enriches NFT collections with **offchain metadata** sourced from trusted marketplaces such as **OpenSea**. This includes collection-level information that is often **not available on-chain**, such as: * Collection name * Collection description * Collection image and banner image * External links (website, Twitter, Discord, etc.) * Marketplace identifiers This enrichment allows you to: * Display richer collection pages * Avoid making separate marketplace API calls * Work with consistent collection metadata across chains Collection offchain metadata is returned alongside on-chain data on supported NFT endpoints. *** ## Common use cases * **NFT galleries**\ Render attributes consistently across collections * **Marketplaces**\ Normalize metadata for search, filtering, and ranking * **Analytics & rarity tools**\ Work with structured traits at scale * **Wallet & portfolio views**\ Display NFTs reliably without custom parsing logic *** ## Supported chains NFT metadata normalization is available on all supported **mainnet** networks only. Testnets are not supported. *** ## Summary Moralis NFT Metadata normalization provides: * Clean, predictable metadata * Broad collection support * Automatic refresh handling * Reduced frontend and backend complexity If you’re working with NFTs at scale, normalization isn’t optional — it’s foundational. # NFT Image Previews (CDN) Source: https://docs.moralis.com/data-api/data-features/data-enrichment/nft-metadata/image-previews-cdn Generate and serve optimized NFT image previews via Moralis CDN for faster loading and better user experiences. ## Overview Moralis provides optimized **NFT image previews** for both **EVM and Solana NFTs**, generated on demand and delivered via a global CDN. Instead of loading large, slow, and inconsistent original NFT images directly from IPFS or third-party hosts, you can rely on Moralis to serve **low, medium, and high-resolution thumbnails** that are fast, cacheable, and reliable - ideal for wallets, marketplaces, dashboards, and feeds. This removes the need to build and operate your own NFT media pipeline while significantly improving frontend performance and UX. Related pages: * [NFT Metadata](/data-api/data-features/data-enrichment/nft-metadata) * [NFT API Overview](/data-api/evm/nft/overview) *** ## What are NFT image previews? NFT image previews are **pre-generated thumbnails** of the original NFT media, optimized for common UI use cases such as: * Wallet views * Galleries * Marketplaces * Search results * Collection pages Moralis generates and caches these previews once, then serves them via CDN for subsequent requests. *** ## Supported image formats Moralis currently supports common static image formats, including: * JPG / JPEG * PNG * GIF * TIFF * WEBP * SVG ### Not yet supported * Video (planned) *** ## How to enable image previews Image previews are returned when the `media_items` query parameter is set to `true`. Once enabled, preview URLs are included directly in the API response. *** ## Does this cost extra? No. Enabling `media_items=true` does **not consume additional compute units (CUs)**. *** ## Preview generation lifecycle Image previews are generated **on demand**. ### What happens on first request? * If previews don’t yet exist: * Generation starts automatically * The original media URL is still returned * Once generated: * Previews are cached * Subsequent requests return previews instantly *** ## Preview generation statuses Each NFT media item includes a generation status: | Status | Description | | :- | :- | | `success` | Preview generated and returned | | `processing` | Preview is being generated | | `unsupported_media` | Media type not supported | | `invalid_url` | Metadata image URL is invalid | | `retry` | Generation failed and will retry | | `host_unavailable` | Media host is unavailable | | `temporarily_unavailable` | Temporary failure (e.g. rate limits) | Regardless of status, the API **always returns the original media URL** as a fallback. *** ## Retry behavior If preview generation fails, Moralis automatically retries with **exponential backoff**. * Up to **8 retry attempts** * Increasing delay between attempts ### Retry schedule | Attempt | Delay | | :- | :- | | 1 | 1 minute | | 2 | 5 minutes | | 3 | 10 minutes | | 4 | 15 minutes | | 5 | 30 minutes | | 6 | 40 minutes | | 7 | 50 minutes | | 8 | 60 minutes | This ensures resilience against: * Temporary host issues * Rate-limited IPFS gateways * Intermittent CDN failures *** ## Why this matters Without image previews: * Large images slow down UIs * IPFS gateways can be unreliable * Frontends must handle resizing and caching manually With Moralis image previews: * Faster load times * Predictable image sizes * CDN-backed delivery * No custom infrastructure required *** ## Common use cases * **Wallet dashboards**\ Fast-loading NFT grids * **Marketplaces**\ Consistent thumbnails for listings * **Search & discovery**\ Lightweight previews for large result sets * **Mobile apps**\ Reduced bandwidth and faster rendering *** ## Supported chains NFT image previews are supported across both major NFT ecosystems: * **EVM chains**\ Ethereum, Polygon, Base, Arbitrum, Optimism, BNB Chain, and more * **Solana**\ Including SPL NFTs and Metaplex-based collections Image previews behave consistently across supported chains, with the same: * Generation logic * Retry behavior * CDN delivery * API response structure *** ## Summary Moralis NFT Image Previews provide: * On-demand thumbnail generation * CDN-backed delivery * Multi-resolution previews * Zero additional CU cost * Automatic retries and fallbacks This allows you to ship fast, reliable NFT experiences without worrying about media hosting or processing. # NFT Rarity Source: https://docs.moralis.com/data-api/data-features/data-enrichment/nft-rarity Understand how Moralis calculates NFT rarity across collections using trait frequency analysis, rarity scores, rankings, and refreshable on-demand processing for ERC721 and ERC1155 NFTs. ## Overview NFT rarity measures how **unique an NFT is within its collection**, based on how common or uncommon its attributes are compared to other NFTs in the same collection. In most NFT collections, traits such as background, color, accessories, or attributes appear at different frequencies. NFTs with **less common trait combinations** are considered rarer and are often perceived as more valuable by collectors, marketplaces, and analytics platforms. Moralis provides **deterministic, collection-wide rarity scores and rankings**, calculated directly from indexed NFT metadata. Related pages: * [NFT Metadata](/data-api/data-features/data-enrichment/nft-metadata) * [NFT Image Previews (CDN)](/data-api/data-features/data-enrichment/nft-metadata/image-previews-cdn) * [NFT API Overview](/data-api/evm/nft/overview) *** ## How rarity is calculated Moralis computes rarity **per collection**, not globally. The rarity calculation process consists of two layers: ### 1. Trait-level analysis For every trait across the collection, we compute: * `count`\ Number of NFTs that contain this trait * `percentage`\ Percentage of the collection that contains this trait * `rarity_label`\ Human-readable label based on trait frequency\ *(e.g. “Top 1% trait”, “Top 10% trait”)* This makes rarity explainable, not just numeric. *** ### 2. NFT-level rarity scoring For each NFT, we compute: * `rarity_score`\ Numerical score derived from the combined rarity of all its traits * `rarity_rank`\ Rank of the NFT within the collection (1 = rarest) * `rarity_percentage`\ Relative rarity compared to the entire collection * `rarity_label`\ Human-readable summary (e.g. “Top 1% rarity”) These fields are returned directly in supported NFT endpoints. *** ## Supported collections Rarity calculations are supported for: * **ERC-721 collections** * **ERC-1155 collections** With the following constraints: * Maximum collection size: **50,000 NFTs** * All NFTs must be discoverable and indexed * Metadata and traits must be available for the full collection If these conditions are not met, rarity will not be calculated. *** ## Supported chains NFT rarity is supported on **all EVM chains** where Moralis NFT metadata is available, including: * Ethereum * Polygon * Base * Arbitrum * Optimism * BNB Chain * Other supported EVM chains Rarity logic is chain-agnostic and applied consistently. *** ## Trait syncing & rarity processing Rarity is computed **on demand**, per collection. ### Initial sync flow 1. A collection is queried using `getNFTTraitsByCollection` 2. The collection is added to a processing queue 3. Traits are synced for all NFTs 4. Rarity scores and rankings are calculated While processing is in progress, trait endpoints return: ``` 202 – Contract is being resynced at the moment. Please try again later. ``` *** ### Processing times Typical processing times: * Small collections: **5–15 seconds** * Medium collections: **15–60 seconds** * Large collections (20,000+ NFTs): may take longer If processing exceeds **5 minutes**, contact support. Once queued, a collection **cannot be reprocessed again for 30 minutes**. *** ## Refreshing rarity scores Rarity scores **can be refreshed** after: * NFT reveals * New mints * Metadata or trait updates Refreshing rarity is triggered by re-syncing traits, which automatically recalculates all rarity data. See: * [Metadata Resyncing](/data-api/evm/nft/utilities/resync-nft-metadata) * [Rarity Resyncing](/data-api/evm/nft/utilities/resync-nft-traits) *** ## Why rarity matters NFT rarity enables: * Collection ranking & discovery * Trait-based filtering * Floor price and valuation analysis * Wallet and portfolio insights * Marketplace and analytics UIs Without indexing internal trait distributions, rarity cannot be computed accurately - which is why many platforms approximate or omit this entirely. *** ## Best practices * Don’t assume rarity exists until processing completes * Handle `202` responses gracefully * Cache rarity results when possible * Re-sync after major collection events (e.g. reveals) *** ## Summary Moralis NFT Rarity provides: * Deterministic rarity scores * Trait-level transparency * Collection-wide rankings * Multichain support (EVM) * Refreshable, on-demand computation This allows you to build **analytics, discovery, and marketplace experiences** without maintaining your own rarity infrastructure. # Profitability (PnL) Source: https://docs.moralis.com/data-api/data-features/data-enrichment/profitability-pnl Analyze realized wallet and token profitability using Moralis PnL endpoints. Learn how realized PnL is calculated, supported swaps, pricing logic, chain coverage, and known limitations. ## Overview Moralis provides **realized profit and loss (PnL)** analytics for wallets and tokens, calculated directly from **on-chain swap activity**. PnL data is designed for: * Wallet analytics * Trading performance dashboards * Portfolio tools * Token-level profitability analysis * Leaderboards and rankings *** ## Supported PnL endpoints PnL data is exposed through the following endpoints: * [Wallet PnL Summary](/data-api/evm/wallet/wallet-pnl-summary)\ High-level profitability metrics for a wallet * [Wallet PnL Breakdown](/data-api/evm/wallet/wallet-pnl)\ Token-by-token profitability details * [Top Traders by Token](/data-api/evm/token/signals/top-traders)\ Rankings of wallets by realized profit for a given token *** ## What type of PnL is supported? Moralis currently supports **realized PnL only**. * **Realized PnL** is calculated from completed on-chain swaps (buys and sells). * **Unrealized PnL** (open positions based on current market prices) is **not calculated directly** by the PnL endpoints. #### Calculating Unrealized PnL You can calculate unrealized PnL yourself by combining: * **Cost basis / realized trade data** from the [PnL endpoints](/data-api/evm/wallet/wallet-pnl) * **Real-time token balances + real-time prices** from the [Token Balances](/data-api/evm/wallet/token-balances) endpoint A common approach is: ``` (currentPrice − averageCost) × currentTokenBalance ``` This approach gives you full flexibility to build portfolio views that include: * Realized PnL * Unrealized PnL * Total PnL (realized + unrealized) *** ## How PnL is calculated Moralis uses a method closely aligned with a **weighted average cost basis**. ### Core formula ``` (avgSellPriceUsd − avgCostOfQuantitySold) × totalTokensSold ``` Where: * **avgSellPriceUsd**\ Continuously updated average sell price in USD * **avgCostOfQuantitySold**\ Calculated as:\ `totalUsdInvested / totalTokensBought` This ensures profits are calculated based on **actual cost basis**, not FIFO or speculative pricing. *** ## How trades are matched PnL is calculated **per trading pair**, not per token globally. Examples: * Buy `UNI` with `WETH` → tracked as `UNI/WETH` * Sell `UNI` for `WETH` → updates the same trade * Sell `UNI` for `PEPE` → tracked as a **new trade** (`UNI/PEPE`) This avoids mixing unrelated price contexts. *** ## Token pricing & trade history Moralis determines token prices by: 1. Indexing on-chain **DEX swap events** 2. Extracting price directly from swap logs 3. Converting swap prices to USD 4. Applying those prices to PnL calculations No off-chain price feeds are used for PnL. *** ## Supported swap events Currently supported swap topics: * **Uniswap V2** ``` 0xd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d822 ``` * **Uniswap V3** ``` 0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67 ``` Only swaps emitting these events are included in PnL. *** ## Transaction fees **Gas fees and transaction fees are not included** in PnL calculations. PnL strictly reflects **token-level trading performance**, not net wallet balance changes. *** ## Update latency PnL data updates in **near real-time**. * Average update time: **\~10 seconds** * Triggered after swap settlement on-chain This makes PnL suitable for: * Live dashboards * Trading analytics * Near real-time alerts *** ## Token Support ### ERC20 Tokens PnL is supported for **all ERC20 tokens** that: * Have participated in a **supported DEX swap** * Emit **supported swap events** * Are **paired with either**: * a **stablecoin** (e.g. USDC, USDT, DAI), or * a **native or wrapped native token** (e.g. ETH, WETH) This covers the vast majority of actively traded ERC20 tokens. *** ### Native Tokens (e.g. ETH) * ***Native tokens are supported for PnL***, **but only when traded against stablecoins**. * Trades between native tokens and stablecoins are used to establish realized PnL. Examples: * ✅ ETH ↔ USDC → ETH PnL supported * ❌ ETH ↔ WETH → not tracked (native ↔ wrapped native) Native tokens are treated similarly to ERC20s **only when a stablecoin price anchor exists**. *** ### Wrapped Native Tokens (e.g. WETH) * **Wrapped native tokens are supported**, **but only when traded against stablecoins**. * They are **not tracked when traded against native tokens or other wrapped natives**. Examples: * ✅ WETH ↔ USDC → WETH PnL supported * ❌ WETH ↔ ETH → not tracked * ❌ WETH ↔ WBTC → not tracked unless a stablecoin leg exists *** ### Stablecoins * **Wallet PnL is not calculated for stablecoins themselves** (e.g. USDC, USDT, DAI). * However, **ERC20, native, and wrapped native tokens that are paired with stablecoins are fully supported**. Examples: * ✅ UNI ↔ USDC → UNI PnL supported * ✅ ETH ↔ USDT → ETH PnL supported * ❌ USDC ↔ DAI → no wallet PnL (stablecoin-only trade) Stablecoins act as **pricing anchors**, not PnL assets. *** ### Summary | Asset | PnL tracked? | Conditions | | :- | :- | :- | | ERC20 tokens | ✅ Yes | Paired with stable or native/wrapped native | | Native tokens (ETH, etc.) | ✅ Yes | **Only when paired with stablecoins** | | Wrapped native tokens (WETH, etc.) | ✅ Yes | **Only when paired with stablecoins** | | Stablecoins | ❌ No | Used for pricing only | | ERC20 ↔ Stablecoin | ✅ Yes | Fully supported | | ERC20 ↔ WETH | ✅ Yes | Fully supported | | ETH ↔ USDC | ✅ Yes | Supported | | ETH ↔ WETH | ❌ No | Not supported | *** ## Supported chains Profitability is currently live on: * **Ethereum Mainnet** * **Polygon Mainnet** * **Base Mainnet** More chains are planned. *** ## Known limitations * Unrealized gains are not included * Gas costs are excluded * Only supported DEX events are tracked * PnL is per trading pair, not global per token These trade-offs are intentional to ensure **accuracy and determinism**. *** ## Summary Moralis Profitability (PnL) provides: * Realized, on-chain PnL * Weighted average cost basis * Near real-time updates * Token- and wallet-level views * Deterministic, explainable calculations It’s built for **analytics accuracy**, not speculative valuation. # Solana Token Standards Source: https://docs.moralis.com/data-api/data-features/data-enrichment/solana-token-standards Understand the Solana token standards supported by Moralis, including the SPL Token Program and Metaplex metadata standard. Solana uses a different token model than EVM chains. Instead of each token deploying its own smart contract, all tokens are managed by shared **token programs**. Moralis supports the major Solana token standards and enriches API responses with decoded metadata. *** ## Token Programs ### SPL Token Program The original **SPL Token Program** is the standard for fungible and non-fungible tokens on Solana. Most tokens on Solana — including SOL-wrapped tokens, stablecoins, and meme coins — use this program. Key characteristics: * Tokens are identified by their **mint address** * Each holder has an **associated token account** (ATA) linked to their wallet * Token metadata (name, symbol, logo) is stored offchain via the **Metaplex** standard ## Metaplex Metadata Standard Most Solana tokens and NFTs use the **Metaplex** metadata standard to store human-readable information (name, symbol, image, attributes) offchain. The `standard` field in Moralis API responses indicates when a token follows this standard. When Moralis returns `"standard": "metaplex"`, the response includes a `metaplex` object: ```json theme={null} { "mint": "9BB6NFEcjBCtnNLFko2FqVQBq8HHM13kCyYcdQbgpump", "standard": "metaplex", "name": "Fartcoin", "symbol": "Fartcoin", "metaplex": { "metadataUri": "https://ipfs.io/ipfs/QmYfe8zVGHA1heej47AkBX3Nnetg2h2kqj5yymz1xyKeHb", "masterEdition": false, "isMutable": false, "sellerFeeBasisPoints": 0, "updateAuthority": "TSLvdd1pWpHVjahSpsvCXUbgwsL3JAcvokwaKt1eokM", "primarySaleHappened": 0 } } ``` ### Metaplex fields explained | Field | Description | | - | - | | `metadataUri` | URI pointing to the full metadata JSON (often IPFS or Arweave) | | `updateAuthority` | The address that can modify the token's metadata | | `sellerFeeBasisPoints` | Creator royalty on secondary sales (100 = 1%) | | `primarySaleHappened` | Whether the initial sale has occurred | | `isMutable` | Whether the metadata can still be updated | | `masterEdition` | Whether this is a master edition NFT | *** ## NFTs on Solana Unlike EVM chains where NFTs are grouped under a single contract, each Solana NFT is represented by a **unique mint address**. Moralis returns rich NFT metadata including: * **Collection data** — `collectionAddress`, collection name, description, and verification status * **Attributes** — Trait types and values (e.g., `"traitType": "Gender", "value": "Male"`) * **Creator information** — Addresses, share percentages, and verification status * **Media previews** — Low, medium, and high resolution image URLs via Moralis CDN Example NFT metadata: ```json theme={null} { "address": "FVzM6rUA1SigPxh6e3iQ8dAPjQNf2guap3Xcdj8Q6R2H", "standard": "metaplex", "name": "Mad Lads #7256", "symbol": "MAD", "metaplex": { "metadataUri": "https://madlads.s3.us-west-2.amazonaws.com/json/7256.json", "updateAuthority": "2RtGg6fsFiiF1EQzHqbd66AhW7R5bWeQGpTbv2UMkCdW", "sellerFeeBasisPoints": 420, "primarySaleHappened": 1, "isMutable": true, "masterEdition": false }, "collection": { "collectionAddress": "J1S9H3QjnRtBbbuD4HjPV6RpRhwuk4zKbxsnCHuTgh9w", "name": "Mad Lads", "description": "Fock it.", "metaplexMint": "J1S9H3QjnRtBbbuD4HjPV6RpRhwuk4zKbxsnCHuTgh9w", "sellerFeeBasisPoints": 500 }, "creators": [ { "address": "5XvhfmRjwXkGp3jHGmaKpqeerNYjkuZZBYLVQYdeVcRv", "share": 0, "verified": true }, { "address": "2RtGg6fsFiiF1EQzHqbd66AhW7R5bWeQGpTbv2UMkCdW", "share": 100, "verified": true } ] } ``` > [!NOTE] > > Some NFTs may lack a `collectionAddress` or other metadata fields. You can identify Metaplex-standard NFTs by the presence of a `metaplexMint` value. *** ## How Moralis Uses These Standards Moralis automatically detects the token standard and enriches responses accordingly: * **Fungible tokens** — Returns mint address, name, symbol, decimals, supply, logo, and market data (price, FDV) * **NFTs** — Returns full Metaplex metadata, collection info, creator details, attributes, and media previews * **Token balances** — Includes associated token account addresses and formatted amounts The `standard` field in API responses tells you which metadata standard a token uses (currently `"metaplex"` for most Solana tokens). *** ## Related Pages * [Token Metadata](/data-api/data-features/data-enrichment/token-metadata) — EVM token metadata enrichment * [NFT Metadata](/data-api/data-features/data-enrichment/nft-metadata) — NFT metadata across chains # Token Metadata Source: https://docs.moralis.com/data-api/data-features/data-enrichment/token-metadata Understand how Moralis combines onchain and offchain token metadata - names, supply, logos, categories, links, safety signals, and cross-chain implementations into a single developer-friendly response. Moralis token metadata combines **onchain facts** (what the contract reports) with **offchain enrichment** (logos, categories, descriptions, links, verification, and market fields) to give you a clean, consistent token object across chains. This page explains what data comes from where, how to interpret key fields, and how to use related data features like token scores and spam filtering. Related pages: * [Token API Overview](/data-api/evm/token/overview) * [Token Scores](/data-api/data-features/token-scores) * [Verified Contracts](/data-api/data-features/safety-and-trust/verified-contracts) * [Spam Filtering](/data-api/resources/spam-filtering) * [Token Search](/data-api/data-features/search-and-discovery/token-search) *** ## Onchain vs Offchain metadata ### Onchain metadata (from the token contract) These values are sourced directly from chain data and are generally deterministic: * `address` * `name` * `symbol` * `decimals` * `total_supply` * `block_number` (block created) * `created_at` (when Moralis first observed/indexed the contract) *** ### Offchain metadata (curated/enriched) These values are enriched using trusted external sources and Moralis internal systems: * `logo` * `description` * `categories` * `links` (website, twitter, telegram, etc.) * `security_score` * `possible_spam` * `verified_contract` * `circulating_supply` (sourced from CoinGecko where available) * `market_cap`, `fully_diluted_valuation` * `address_label` (human-readable label) Offchain enrichment improves UX and trust signals, and is especially useful for: * Wallet UIs * Token discovery experiences * Safety filtering * Market analytics See: * [Token Scores](/data-api/data-features/token-scores) * [Spam Filtering](/data-api/resources/spam-filtering) * [Verified Contracts](/data-api/data-features/safety-and-trust/verified-contracts) *** ## Example response ``` [ { "address": "0x6982508145454ce325ddbe47a25d4ec3d2311933", "address_label": "Pepe (PEPE)", "name": "Pepe", "symbol": "PEPE", "decimals": "18", "logo": "https://logo.moralis.io/0x1_0x6982508145454ce325ddbe47a25d4ec3d2311933_5c5ee6fce6d19f71c224cba025989229.jpeg", "total_supply": "420689899653542539491331875576506", "total_supply_formatted": "420689899653542.539491331875576506", "fully_diluted_valuation": "2095999648.29", "block_number": "17046105", "validated": 1, "created_at": "2023-04-14T14:51:35.000Z", "possible_spam": false, "verified_contract": true, "categories": ["Meme"], "links": { "reddit": "https://www.reddit.com", "telegram": "https://t.me/pepecoineth", "twitter": "https://twitter.com/pepecoineth", "website": "https://www.pepe.vip/" }, "security_score": 96, "description": "Pepe ($PEPE) is a meme coin aiming to bring back the glory days of memecoins...", "circulating_supply": "420690000000000", "market_cap": "2096000148.24", "implementations": [ { "chainId": "0xa86a", "chain": "avalanche", "chainName": "Avalanche", "address": "0xa659d083b677d6bffe1cb704e1473b896727be6d" }, { "chainId": "0x38", "chain": "bsc", "chainName": "BNB Smart Chain", "address": "0x25d887ce7a35172c62febfd67a1856f20faebb00" }, { "chainId": "0xa4b1", "chain": "arbitrum", "chainName": "Arbitrum One", "address": "0x25d887ce7a35172c62febfd67a1856f20faebb00" } ] } ] ``` *** ## Key fields explained ### Identity * `address_label`: Human-readable label (useful for UI) * `name`, `symbol`, `decimals`: Standard ERC-20 fields * `logo`: Offchain logo URL (may be missing for new/unknown tokens) Related: * [Token Search](/data-api/data-features/search-and-discovery/token-search) *** ### Supply & valuation * `total_supply`/ `total_supply_formatted`: Onchain total supply * `circulating_supply`: Offchain circulating supply (CoinGecko where available) * `market_cap`: Typically `price × circulating_supply` * `fully_diluted_valuation`**(FDV)** : Typically `price × total_supply` #### Circulating supply fallback If `circulating_supply` is not available, Moralis falls back to `total_supply`.\ In that case, **market cap effectively becomes FDV**. This is important when building: * token rankings * market cap charts * “top tokens” discovery feeds Related: * [Token Prices](/data-api/data-features/data-enrichment/token-prices) *** ### Safety & trust signals * `possible_spam`: Flag for suspicious/spam tokens * `verified_contract`: Verified by CoinGecko (not Etherscan) * `security_score`: Moralis safety score (0-100) Related: * [Spam Filtering](/data-api/resources/spam-filtering) * [Verified Contracts](/data-api/data-features/safety-and-trust/verified-contracts) * [Token Scores](/data-api/data-features/token-scores) *** ### Classification & links * `categories`: Token categories (e.g. Meme, DeFi) * `links`: Offchain links (twitter, website, telegram, etc.) * `description`: Offchain token description *** ### Cross-chain implementations * `implementations` lists known linked deployments of the “same” token across multiple chains (e.g. bridged or multi-chain versions). > [!NOTE] > > `implementations` only lists the **other** chains the token is deployed on. The chain you queried is never repeated in the array — that deployment is the token object itself (`address` at the top level). In the example above the token was requested on Ethereum, so the array contains Avalanche, BNB Smart Chain, and Arbitrum, but not Ethereum. If you need the full multi-chain set, combine the queried chain and address with the entries in `implementations`. This enables: * consistent UI labels/logos across chains * unified token discovery experiences * cross-chain token analytics *** ## Summary Moralis Token Metadata provides a unified token object that combines: * **Onchain** ERC-20 data (name, symbol, decimals, supply) * **Offchain** enrichment (logos, links, categories, descriptions) * **Trust signals** (spam flags, verification, security score) * **Market fields** (circulating supply, market cap, FDV) * **Cross-chain implementations** for linked tokens # Token Prices Source: https://docs.moralis.com/data-api/data-features/data-enrichment/token-prices Learn how Moralis token prices are derived from onchain DEX activity, including pool selection, pair-based pricing, liquidity filtering, inactivity rules, and mainnet-only behavior. ## Token Prices Moralis token prices are derived directly from **onchain DEX activity**, not from aggregated offchain price feeds. Prices are based on real swaps, making them: * Trust-minimized (no centralized oracle dependency) * Chain-specific * Deterministic and reproducible Prices can be fetched: * **By token address** (Moralis selects the best pool automatically), or * **Directly by pair address**, when you want full control over which pool is used Related concepts: * [Supported DEXes](/data-api/data-features/integrations/supported-dexs) * [Liquidity Filtering](/data-api/data-features/safety-and-trust/liquidity-filtering) *** ## How Token Prices Work Moralis calculates token prices using the **last traded price** observed on supported decentralized exchanges. Key characteristics: * Prices come from real onchain swap events * No volume-weighted averaging across exchanges * Prices are returned in USD * Pricing can be **pool-selected automatically** or **explicitly defined by pair** This makes token prices safe to use in downstream features such as [Token Balances](/data-api/evm/wallet/token-balances), [Wallet Net Worth](/data-api/evm/wallet/net-worth), [PnL](/data-api/evm/wallet/wallet-pnl) and many more. *** ## Fetching Prices by Token vs Pair Moralis supports two pricing models: ### Token-Based Pricing (Default) When querying by token address: * Moralis automatically selects the most appropriate pool * Pool selection follows liquidity and activity rules * Best suited for portfolio, net worth, and analytics use cases This is the recommended approach for most applications. Related pages: * [Token price by token address](/data-api/evm/token/prices/token-price) * [Token price by pair address](/data-api/evm/token/swaps/pair-stats) *** ### Pair-Based Pricing (Explicit Pool) You can also fetch prices **directly by pair address**. When querying by pair: * The specified pool is always used * No pool ranking or substitution occurs * The price reflects swaps in that exact pair This is useful when: * You need deterministic pricing from a known pool * You want to inspect or monitor a specific market * You are building trading, monitoring, or analytics tools around a single pair Liquidity and inactivity checks still apply to ensure price safety. *** ## Supported Pair Types Moralis supports **all DEX pair types**, including: * **Stablecoin pairs** (e.g. USDC / USDT / DAI) * **Wrapped native token pairs** (e.g. WETH, WBNB, SOL) * **Token / Token pairs** (e.g. REPPO / VIRTUAL) This applies to both **token-based** and **pair-based** price queries, as long as sufficient onchain liquidity exists. *** ## Mainnet-Only Support Token prices are **mainnet-only**. Why: * Prices depend on active onchain DEX liquidity * Testnets generally lack sustained or meaningful trading activity Any feature that depends on token prices is therefore also mainnet-only, including: * Token price * Wallet net worth * Portfolio percentages * PnL calculations *** ## What “Price” Means A token’s price represents: * The most recent swap price * Extracted from the DEX swap log * Converted to USD For Token / Token pairs, the price is resolved from the selected pair and converted to USD using the best available onchain reference. When querying by pair address, this conversion is based strictly on that pool’s swap activity. *** ### Multiple Swaps in the Same Block If multiple swaps occur within a single block: * The **final swap price in that block** is used * Intra-block price movements are not tracked This keeps pricing deterministic and avoids block-level noise. *** ## Pool Selection Logic (Token-Based Pricing) When querying prices by token address: ### Real-Time Prices 1. Pools that fail [liquidity filtering](/data-api/data-features/safety-and-trust/liquidity-filtering) are excluded 2. Remaining pools are ranked by swap activity over the last 24 hours 3. The most active pool is selected ### Historical Prices 1. The top two pools by lifetime usage are selected 2. The most recent record from each pool is compared 3. The pool with higher liquidity is chosen Pair-based queries bypass this logic and always use the specified pool. *** ## Liquidity Thresholds Moralis enforces minimum liquidity requirements per chain. Default thresholds: * **EVM chains:** \$50 minimum liquidity per side (each token in the pair) * **Solana:** no enforced liquidity threshold This threshold applies at the pool level and is evaluated for both assets in the pair. The pool is considered eligible only if **both sides** meet the minimum threshold. Read more about [Liquidity Thresholds](/data-api/data-features/safety-and-trust/liquidity-filtering). *** ## Inactivity Handling Tokens or pairs with no recent trading activity can be excluded. Use the `max_token_inactivity` query parameter to filter out inactive markets. This applies to: * Token-based pricing * Pair-based pricing * Token balances *** ## Common Error Scenarios You may encounter the following: * **No liquidity pool found**\ No qualifying pool exists for the token or pair * **Insufficient liquidity**\ Pool fails liquidity filtering * **Inactive market**\ Token or pair fails inactivity filtering * **Testnet request**\ Token prices are not supported on testnets *** ## When to Use Token Prices (and When Not To) Token prices are well-suited for: * Wallet net worth calculations * Portfolio tracking * PnL and trading analytics * Token discovery and filtering Pair-based pricing is best suited for: * Market monitoring * Trading analytics * Pool-specific dashboards They are not intended to replace: * High-frequency trading price feeds * Offchain oracle systems * Tick-level or order-book pricing data # Transaction Decoding Source: https://docs.moralis.com/data-api/data-features/data-enrichment/transaction-decoding Moralis enriches raw blockchain transactions with human-readable meaning, making it easier to understand what actually happened onchain. Instead of working with low-level logs and method calls, you get **decoded actions, labels, and categories** that describe wallet activity in a clear, consistent way. *** ## What This Includes Transaction decoding and enrichment combines two core capabilities: * **Wallet activity categorisation** (what type of action occurred) * **ABI-based decoding and labelling** (what the transaction did at a contract level) Together, these form Moralis’ **semantic transaction layer**. *** ## Wallet Activity Decoding Moralis can return a **single, chronological view of a wallet’s onchain activity**, covering all major transaction types. This includes: * Native transfers * ERC20 swaps and token transfers * NFT transfers and sales * DeFi interactions * Smart contract interactions All activity is normalized into a consistent timeline, removing the need to aggregate multiple endpoints or data sources. ### Key Benefits * **Single API request**\ Fetch a complete wallet history in one call. * **Automatic categorisation**\ Each transaction is classified into a clear, human-readable category. * **Reduced complexity**\ No need to manually decode logs, traces, or contract calls. * **Consistent ordering**\ Transactions are returned in a clean, chronological format. *** ## Transaction Categories Each transaction is assigned a category based on its onchain behavior. Currently supported categories include: * Send * Receive * Token Send * Token Receive * NFT Send * NFT Receive * Deposit * Withdraw * Token Swap * Airdrop * Mint * Burn * NFT Purchase * NFT Sale * Borrow * Approve * Revoke * Contract Interaction > [!NOTE] > > Category support is continuously expanding as new transaction patterns and protocols are added. *** ## ABI Decoding & Transaction Labelling Beyond high-level categories, Moralis also decodes transactions at the **contract interaction level**. Using verified ABIs and internal decoding logic, Moralis: * Decodes method calls * Interprets parameters * Assigns meaningful **labels** to transactions This allows you to distinguish between different contract interactions even when they fall under the same high-level category. *** ## Why This Matters Transaction decoding and enrichment enables you to: * Build readable wallet activity feeds * Show users *what they actually did* onchain * Power analytics, notifications, and alerts * Avoid custom ABI decoding and protocol-specific logic * Deliver consistent UX across chains and protocols This is especially valuable for: * Wallets and portfolio trackers * Analytics dashboards * Tax and accounting tools * Compliance and monitoring systems *** ## Important Notes * Decoding and categorisation are **best-effort** and based on available onchain data and ABIs * Unknown or unverified contracts may fall back to generic labels (e.g. `Contract Interaction`) * New transactions occurring during pagination will not affect already-decoded results (see Pagination) # Data Features Overview Source: https://docs.moralis.com/data-api/data-features/data-features-overview An overview of Moralis Data Features, including enrichment, safety signals, discovery tools, and protocol coverage that turn raw blockchain data into usable insights. Moralis transforms raw blockchain data into **structured, enriched, and trustworthy insights** that are easy to build on. Instead of dealing with low-level transactions, logs, and metadata inconsistencies, you get **interpreted data** - with context, labels, scores, and normalization applied consistently across chains and APIs. These features fall into four broad areas: > [card] [Data Enrichment](/data-api/data-features/data-enrichment/address-labelling) > > Logic and normalization that add **meaning and context** to onchain data. > [card] [Safety & Trust](/data-api/data-features/safety-and-trust/verified-contracts) > > Signals that help identify legitimate assets and reduce exposure to scams. > [card] [Search & Discovery](/data-api/data-features/search-and-discovery/token-search) > > Tools that help users **find relevant tokens and assets** across chains. > [card] [Prices](/data-api/data-features/data-enrichment/token-prices) > > Understand how Moralis **decodes and normalizes** token and NFT prices. > [card] [Integrations](/data-api/data-features/integrations/supported-dexs) > > Clear visibility into **what Moralis supports** across chains and protocols. # DeFi Protocols Source: https://docs.moralis.com/data-api/data-features/integrations/defi-protocols DeFi protocol coverage across EVM and Solana, how protocol decoding works, and how to fetch the full, always-current list of supported protocols from the API. Moralis decodes DeFi activity - lending, borrowing, staking, liquid staking, and liquidity pools - across **thousands of protocols on EVM chains** and the **top protocols on Solana**, returning enriched, protocol-aware positions through the [DeFi API](/data-api/universal/defi/overview). Coverage expands continuously, so the API itself is the source of truth for what is supported at any given moment. > [!NOTE] > > This page covers **protocol availability**. To fetch a wallet's actual DeFi **balances and positions**, use the DeFi API endpoints — [Wallet Protocols](/data-api/universal/defi/wallet-protocols), [Wallet Positions](/data-api/universal/defi/wallet-positions), and [Detailed Positions](/data-api/universal/defi/wallet-positions-detailed) — each accepts the `chain` parameter for EVM or Solana. ## Fetch the Full List of Supported Protocols Use the [**Get Supported DeFi Protocols**](/data-api/universal/defi/supported-protocols) endpoint to retrieve the complete, current list of supported protocols with their chain coverage - ideal for keeping your own UI or coverage checks in sync: ```bash theme={null} curl "https://api.moralis.com/v1/defi/protocols?chains=eth" \ -H "X-Api-Key: YOUR_API_KEY" ``` Pass the optional `chains` filter (for example `eth`, `base`, `polygon`, or `solana`) to narrow results to specific chains. > [!NOTE] > > By default, we track all forked Uniswap v2 protocols. If a particular protocol has not yet been decoded, it appears as `unknown` in API responses - [reach out to support](https://moralis.com/enterprise/) and we will prioritize decoding it. ## EVM Coverage DeFi protocol decoding is available across these EVM chains: * Arbitrum * Avalanche * Base * Binance * Ethereum * Linea * Monad * Optimism * Polygon * Sei > [!NOTE] > > **Coverage is not uniform across chains.** Protocol availability depends on where each protocol is deployed and its adoption per chain. Query the endpoint above for exact per-chain support. We support thousands of EVM protocols, including all forked Uniswap v2 protocols. A few of the most widely used, with their query parameters: | Protocol | Query Parameter | Example Chains | | - | - | - | | Aave v3 | `aave-v3` | Base, Ethereum, Polygon | | Uniswap v3 | `uniswap-v3` | Arbitrum, Avalanche, Base, Binance, Ethereum, Optimism, Polygon | | Pancakeswap v3 | `pancakeswap-v3` | Arbitrum, Base, Binance, Ethereum, Linea, Monad | | Lido | `lido` | Ethereum | | Rocket Pool | `rocketpool` | Arbitrum, Base, Ethereum, Optimism, Polygon | | Eigenlayer | `eigenlayer` | Ethereum | | MakerDAO | `makerdao` | Ethereum | | Pendle | `pendle` | Ethereum | This is a curated highlight, not the full list - call the endpoint above for complete, up-to-date coverage. ## Solana Coverage The Solana DeFi API supports **10 protocols**, together covering roughly **90% of Solana DeFi TVL** - including the top protocols by TVL (Jupiter, Kamino, Sanctum, and Raydium): | Protocol | Category | | - | - | | Jupiter Lend | Lending | | Jupiter Perpetual Exchange | Perpetuals | | Kamino Lend | Lending | | Sanctum | Liquid staking | | Save (formerly Solend) | Lending | | Raydium | DEX / AMM | | Orca | DEX / AMM | | Drift | Perpetuals | | Jito | Liquid staking | | Marinade | Liquid staking | See the [DeFi API](/data-api/universal/defi/overview) for endpoints and examples — the same cross-chain endpoints return Solana and EVM positions. More protocols are added on a rolling basis. To request prioritization of a specific protocol, [reach out to the team](https://moralis.com/enterprise/). # NFT Marketplaces Source: https://docs.moralis.com/data-api/data-features/integrations/nft-marketplaces See which NFT marketplaces Moralis supports across chains, powering NFT trades, sale prices, and marketplace analytics. ## Supported NFT Marketplaces Moralis indexes onchain NFT trades from a growing set of **NFT marketplaces** across multiple chains. This coverage powers features such as: * NFT trades * NFT sale prices * Collection and token-level trading analytics * Wallet NFT activity This page lists **marketplace coverage only**. Endpoint behavior and response structure are documented on the relevant NFT feature pages. *** ## Marketplace Support by Chain ### OpenSea Supported chains: * Ethereum * Polygon * Binance * Arbitrum * Avalanche * Optimism * Base * Monad OpenSea is the primary source of NFT trade activity across multiple EVM chains and provides broad, high-liquidity marketplace coverage. *** ### Blur Supported chains: * Ethereum Blur trades are included for high-frequency and professional NFT trading activity on Ethereum. *** ### LooksRare Supported chains: * Ethereum LooksRare trades are indexed for Ethereum-based NFT collections. *** ### X2Y2 Supported chains: * Ethereum X2Y2 marketplace trades are supported for Ethereum NFTs. *** ### 0x Protocol Supported chains: * Ethereum 0x Protocol trades are indexed where NFTs are bought and sold through the protocol's onchain execution layer. *** ## Notes and Expectations * Marketplace coverage is **chain-specific**. * Only **executed marketplace trades** are indexed - listings alone are not considered trades. * NFT transfers that are not marketplace sales (e.g. gifts or direct transfers) are excluded. * New marketplaces and chains are added continuously based on: * Trading volume * Ecosystem relevance * Customer demand # Supported DEXes Source: https://docs.moralis.com/data-api/data-features/integrations/supported-dexs See which decentralized exchanges (DEXes) Moralis indexes per chain across EVM and Solana, powering token pairs, swaps, pricing, and related DEX-derived features. ## Supported DEXes Moralis indexes onchain liquidity and swaps from a curated set of decentralized exchanges (DEXes) across **EVM chains and Solana**. This coverage powers token pairs, swaps, token prices, OHLC, and other DEX-derived features. If you don’t specify a DEX, Moralis automatically searches across supported DEXes on the target chain and selects eligible markets using safety rules such as [Liquidity Filtering](/data-api/data-features/safety-and-trust/liquidity-filtering). Related pages: * [Token Prices](/data-api/data-features/data-enrichment/token-prices) * [Liquidity Filtering](/data-api/data-features/safety-and-trust/liquidity-filtering) *** ## EVM DEX support by chain ### Ethereum (0x1) * Uniswap v4 * Uniswap v3 * Uniswap v2 * Sushiswap v2 * Fraxswap (v2) ### Polygon (0x89) * Uniswap v4 * Quickswap v2 * Uniswap v3 * Uniswap v2 * MM Finance ### Binance Smart Chain / BSC (0x38) * Uniswap v4 * PancakeSwap v3 * PancakeSwap v2 * PancakeSwap v1 * Uniswap v3 * Uniswap v2 ### Avalanche (0xa86a) * Uniswap v4 * Trader Joe * Pangolin ### Cronos (0x19) * VVS Finance * MM Finance * Crodex ### Arbitrum (0xa4b1) * Uniswap v4 * Uniswap v3 * Camelot v2 * Sparta Dex ### Optimism (0xa) * Uniswap v4 * Sushiswap v2 * Uniswap v2 ### Base (0x2105) * Uniswap v4 * Uniswap v3 * Uniswap v2 * Sushiswap v2 * Sushiswap v3 * PancakeSwap v2 * PancakeSwap v3 * Aerodrome * BaseSwap * Sharkswap ### Linea (0xe708) * PancakeSwap v3 * Nile ### Moonbeam (0x504) * Beamswap v3 * StellaSwap ### Ronin (0x7e4) * Katana ### PulseChain (0x171) * PulseX * 9inch ### Monad (0x8f) * Uniswap v4 * Uniswap v3 * Uniswap v2 * PancakeSwap v3 * PancakeSwap v2 *** ## Solana DEX support Moralis indexes multiple DEX programs on Solana to support token pairs, swaps, pricing, and other DEX-derived features. ### Solana * **Raydium v4**\ Program: `675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8` * **Raydium CLMM (concentrated liquidity)**\ Program: `CAMMCzo5YL8w4VFF8KVHrK22GGUsp5VTaW7grrKgrWqK` * **Raydium CPMM (constant product)**\ Program: `CPMMoo8L3F4NbTegBCKVNunggL7H1ZpdTHKxQB5qKP1C` * **Meteora Dynamic AMM**\ Program: `Eo7WjKq67rjJQSZxS6z3YkapzY3eMj6Xy8X5EQVn5UaB` * **Meteora Dynamic AMM v2**\ Program: `cpamdpZCGKUy5JxQXB4dcpGPiikHawvSWAd6mEn1sGG` * **Meteora DLMM (dynamic liquidity)**\ Program: `LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo` * **Meteora Dynamic Bonding Curve (DBC)**\ Program: `dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN` * **Orca / Whirlpool**\ Program: `whirLbMiicVdio4qvUfM5KAg6Ct8VwpYzGff3uctyCc` * **PumpFun**\ Program: `6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P` * **PumpSwap**\ Program: `pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA` * **LaunchLab**\ Program: `LanMV9sAd7wArD4vJFi2qDdfnVhFxYSUg6eADduJ3uj` * **BisonFi**\ Program: `BiSoNHVpsVZW2F7rx2eQ59yQwKxzU5NvBcmKshCSUypi` * **HumidiFi**\ Program: `9H6tua7jkLhdm3w8BvgpTn5LZNU7g4ZynDmCiNN3q6Rp` * **Phoenix**\ Program: `2rds7kS9FcvUqaz3dXtgxfGC1otD3vyf3PkKByWRT7Bmm9T9aWuJ1DTaj2KUJC7FP22qyawnivUsNfBqTxo7SkG` * **Manifest**\ Program: `MNFSTqtC93rEfYHB6hF82sKdZpUDFWkViLByLd1k1Ms` * **Tessera V**\ Program: `TessVdML9pBGgG9yGks7o4HewRaXVAMuoVj4x83GLQH` * **SolFi**\ Program: `SoLFiHG9TfgtdUXUjWAxi3LtvYuFyDLVhBWxdMZxyCe` * **ZeroFi**\ Program: `ZERor4xhbUycZ6gb9ntrhqscUcZmAbQDjEAtCf4hbZY` * **GoonFi V1 (dormant)**\ Program: `goonERTdGsjnkZqWuVjs73BZ3Pb9qoCUdBUL17BnS5j` * **GoonFi V2 (active)**\ Program: `goonuddtQRrWqqn5nFyczVKaie28f3kDkHWkHtURSLE` * **Saber**\ Program: `SSwpkEEcbUqx4vtoEByFjSkhKdCT862DNVb52nZg1UZ` * **PancakeSwap**\ Program: `HpNfyc2Saw7RKkQd8nEL4khUcuPhQ7WwY1B2qjx8jxFq` > [!NOTE] > > For the following protocols, swap data (and therefore prices) is available from **June 1, 2026** onwards. Full historical coverage for these protocols is coming soon. All other Solana DEXes listed above have full history. > > * BisonFi > * HumidiFi > * Phoenix > * Manifest > * Tessera V > * SolFi > * ZeroFi > * GoonFi V1 (dormant) > * GoonFi V2 (active) > * Saber > * PancakeSwap *** ## Notes and expectations * DEX coverage is chain-specific: a DEX brand may not exist (or be indexed) on every chain. * Inclusion does not guarantee every pool is eligible - [Liquidity Filtering](/data-api/data-features/safety-and-trust/liquidity-filtering) still applies. * This page is intentionally coverage-only. Endpoint-specific behavior belongs on the relevant feature pages. # NFT Floor Prices Source: https://docs.moralis.com/data-api/data-features/prices/floor-prices Learn how Moralis provides NFT floor prices, including what a floor price represents, supported chains, data sources, refresh cadence, inactivity rules, and historical availability. NFT Floor Prices provide a **collection-level snapshot** of the lowest-priced NFT currently listed for sale. This gives a fast, comparable baseline for what it would cost to acquire the cheapest item in a collection *right now*. Floor prices are best suited for: * Market overviews and dashboards * Collection comparisons * Entry-price signals and alerts They are intentionally different from [NFT Sale Prices](/data-api/data-features/prices/sale-prices), which are based on completed onchain trades. *** ## What a Floor Price Represents The floor price is the **lowest active listing price** for an NFT in a given collection. Important characteristics: * Based on **active listings**, not completed sales * Represents seller intent, not executed market price * Calculated at the **collection level**, not per token Because listings can be added or removed at any time, floor prices are inherently volatile and should be treated as **indicative**, not authoritative trade prices. *** ## Supported Chains NFT floor prices are currently supported on: * Ethereum * Base * Monad * Arbitrum * Ronin * Flow * Sei Coverage may expand over time. For trade-based pricing with broader chain support, see NFT Sale Prices. *** ## Data Sources Floor prices are sourced from a combination of marketplace and aggregation APIs: * **OpenSea API** (primary source) * **Magic Eden API**\ Magic Eden aggregates floor prices across multiple marketplaces, including OpenSea, Blur, X2Y2, and Magic Eden itself * **CoinGecko** (fallback / enrichment) These sources provide listing-level market data that cannot be derived purely from onchain events. Important distinction: * **NFT Sale Prices** → derived from onchain marketplace trades * **NFT Floor Prices** → derived from offchain marketplace listing data Related pages: * [NFT Marketplaces](/data-api/data-features/integrations/nft-marketplaces) * [NFT Sale Prices](/data-api/data-features/prices/sale-prices) *** ## Refresh Frequency Floor prices are refreshed **every 60 minutes**. This cadence balances: * Marketplace rate limits * Data freshness * Platform-wide performance and stability Floor prices are not real-time and should not be treated as tick-level market data. *** ## First-Time Requests (Warm-Up Behavior) If a collection’s floor price has **never been requested before**, the first request will return: * HTTP status: **202** * Message: ```javascript theme={null} { "message": "This contract is currently being processed. Floor price data will be available shortly. Please try again later." } ``` During this warm-up period: * The collection is registered for tracking * Floor price data begins syncing Once processing completes, subsequent requests return floor price data normally. *** ## Inactivity Handling If a collection has **no trading activity for 7 days**: * Floor price updates are paused * No new floor price snapshots are recorded Once trading activity resumes: * Floor price updates automatically resume * No manual action is required This prevents stale or misleading prices from being continuously refreshed for inactive markets. *** ## Historical Floor Price Data ### Backfilling Historical floor prices are **not backfilled**. Reason: * Marketplace APIs do not currently expose historical listing data * Historical tracking can only begin after the first request Moralis starts saving floor prices in **60-minute intervals** from the moment a collection is first requested. *** ### Supported Historical Intervals When requesting time-series floor price data, the interval determines the data resolution: * **1 day**\ Data points every 60 minutes * **7 days**\ Hourly data points * **30 days**\ Hourly data points * **Greater than 30 days**\ Daily data points This adaptive resolution keeps queries efficient while preserving meaningful trends. *** ## Inactive Collections and Historical Access If a collection becomes inactive: * Floor prices stop updating * **Previously saved historical data remains accessible** This allows you to: * Analyze past market conditions * Build long-term charts * Compare historical floors even for dormant collections *** ## When to Use Floor Prices (and When Not To) Use NFT Floor Prices when you need: * A quick market baseline * Collection-to-collection comparisons * Entry price signals Do not rely on floor prices for: * Valuation of a specific NFT * Profitability or realized value calculations * Historical execution accuracy For executed market prices and provenance, use [NFT Sale Prices](/data-api/data-features/prices/sale-prices). # NFT Sale Prices Source: https://docs.moralis.com/data-api/data-features/prices/sale-prices Understand how Moralis computes NFT sale prices from onchain marketplace trades, including last/lowest/highest/average sale, lookback windows, marketplace + chain coverage, and enriched trade metadata. Moralis NFT Sale Prices summarize **real onchain sale and trade activity** for NFTs and collections, based on buys/sells from supported NFT marketplaces. This feature is built on top of Moralis **NFT Trades** data and is designed for production use cases like: * Sale price tracking and alerts * Wallet and token-level trade analysis * Portfolio valuation and historical provenance *** ## What “Sale Price” Means A sale is recorded when an NFT is bought/sold on a supported marketplace. Moralis extracts and normalizes: * The **payment token** used (native or ERC20) * The **raw price** paid (base units) and **formatted price** * The **USD price at time of sale** * The **current USD value** using today’s token price Important: these are **marketplace sales**, not arbitrary transfers. Simple NFT transfers (gift/send) are not considered sales. *** ## What You Get Back Sale price summaries typically include: ### Last sale The most recent recorded sale within the available trade history, including: * `transaction_hash` * `block_timestamp` * `buyer_address` / `seller_address` * `token_id` * `price` (raw base units) * `price_formatted` (decimal-adjusted) * `usd_price_at_sale` * `current_usd_value` * `payment_token` metadata (name, symbol, decimals, address, logo) ### Lowest sale (within a lookback window) The lowest recorded sale price within the specified lookback period (see “Lookback window” below). ### Highest sale The highest recorded sale price (typically within the same scope as the response; depends on endpoint). ### Average sale An average price across trades included in the response scope: * `price` / `price_formatted` * `current_usd_value` ### Total trades A count of sales/trades included for that scope: * `total_trades` Notes on price fields: * `price` is the raw integer amount in the payment token’s base units. * `price_formatted` is the human-readable value using `token_decimals`. * `usd_price_at_sale` is the USD valuation at the time the sale happened. * `current_usd_value` is recalculated using the current price of the payment token (useful for mark-to-market comparisons). *** ## Lookback Window (`days`) Some sale price summaries (notably **lowest sale**) support an optional `days` query parameter: * Default: **7 days** * Maximum: **365 days** If you set `days=30`, “lowest sale” will be the lowest sale price found in the last 30 days. If you omit it, the system uses 7 days. Practical guidance: * Use smaller windows (7–30) for “recent floor” style features. * Use larger windows (90–365) for long-term volatility and range analysis. *** ## Marketplace Coverage Sale prices are derived from trades on supported marketplaces. Current coverage includes: * OpenSea * Blur * LooksRare * X2Y2 * 0xProtocol Coverage can vary by chain and marketplace. For the authoritative matrix, use the [Marketplaces](/data-api/data-features/integrations/nft-marketplaces) page. Related pages: * [NFT Marketplaces](/data-api/data-features/integrations/nft-marketplaces) *** ## Chain Coverage NFT Trades (and therefore NFT Sale Prices) are available on: * Ethereum * Polygon * Binance * Arbitrum * Avalanche * Optimism * Base * Monad *** ## Enriched Trade Metadata All NFT Trade endpoints (including those powering sale price summaries) can include enriched metadata such as: * Marketplace metadata (name + logo) * Collection metadata (collection name + logo) * Payment token metadata (name, symbol, logo, decimals, address) * Current USD value for each trade (mark-to-market) * Optional NFT metadata via `nft_metadata=true` Use `nft_metadata=true` when you need token attributes/media in the same response. Leave it off for performance when you only need pricing and trade facts. Related pages: * [NFT Metadata](/data-api/data-features/data-enrichment/nft-metadata) * [NFT Image Previews](/data-api/data-features/data-enrichment/nft-metadata/image-previews-cdn) *** ## Related Endpoints (Trade Feeds) Sale price summaries are most useful when paired with raw trade feeds: * [NFT Trades by Collection](/data-api/evm/nft/trades/collection-trades)\ Fetch the full trade history for a collection (sales feed) * [NFT Trades by Wallet](/data-api/evm/wallet/nft-trades-by-wallet)\ Fetch all NFT trades associated with a wallet address * [NFT Trades by Token ID](/data-api/evm/nft/trades/trades-by-token-id)\ Fetch the trade history for a specific NFT (collection + token id) # Accurate Net Worth & Token Balances Source: https://docs.moralis.com/data-api/data-features/safety-and-trust/accurate-net-worth-and-balances Keep spam tokens and unreliable prices out of wallet balances and net worth. Which filters to use, recommended values for each use case, and checks to run on the response. Wallets collect tokens they never asked for. Airdropped spam, dead tokens and tokens that trade in tiny pools can all carry a USD price, and one bad price is enough to inflate a portfolio total. You control how strict Moralis is when it values a wallet. This page explains the filters, recommends values for common use cases, and lists the extra checks worth running on the response. It applies to: * [Token Balances](/data-api/evm/wallet/token-balances) (`/wallets/{address}/tokens`) * [Wallet Net Worth](/data-api/evm/wallet/net-worth) (`/wallets/{address}/net-worth`) * [Cross-Chain Token Balances](/data-api/universal/wallet/cross-chain-token-balances) (`/v1/wallets/{address}/tokens`) * [Token Price](/data-api/evm/token/prices/token-price) and [Token Prices (Batch)](/data-api/evm/token/prices/token-prices-batch), which take the price filters > [!WARNING] > > On these endpoints every filter is **off by default**. If you show balances or net worth to end users, set them explicitly. *** ## Why values look wrong Moralis prices tokens from onchain DEX swaps: a token's price is the last price it traded at in its selected pool (see [Token Prices](/data-api/data-features/data-enrichment/token-prices)). This is accurate for actively traded tokens. It goes wrong in three cases: | Cause | What you see | Filter that fixes it | | - | - | - | | **Spam tokens.** Airdropped tokens with fake names, often copying a real token, sometimes with a pool set up to give them a price. | Unknown tokens with large balances and large USD values. | `exclude_spam` | | **Thin pools.** A token's only pool holds a few hundred dollars. One small swap moves the price by orders of magnitude. | A token's value spikes, then corrects on a later call once the pool trades again. | `min_pair_side_liquidity_usd` | | **Dead tokens.** Trading stopped weeks or months ago, so the last price is stale. | Tokens nobody can sell still add to net worth. | `max_token_inactivity` | If the inflated value goes away on the next call, the cause is almost always a thin pool. The price really was traded onchain, but in a pool too small to trust. A liquidity threshold stops those prices being used at all. *** ## The filters ### `exclude_spam` Removes tokens that Moralis flags as `possible_spam`. Detection uses contract metadata, known spam and phishing patterns, and onchain behaviour, and is updated as new patterns appear. See [Spam Filtering](/data-api/resources/spam-filtering). **Recommendation: always set `exclude_spam=true`** for anything shown to users. Hardly any real holdings are flagged, and spam is the most common source of inflated totals. ### `min_pair_side_liquidity_usd` Sets the minimum USD liquidity a pool must hold on **each side** before Moralis uses it to price a token. With `1000`, a TOKEN/USDC pool counts only if both the TOKEN side and the USDC side hold at least \$1,000. Tokens with no qualifying pool are excluded. The default on EVM chains is \$50 per side. See [Liquidity Filtering](/data-api/data-features/safety-and-trust/liquidity-filtering). This is the most effective filter against prices that jump and then correct. Pushing a price up with a single swap costs a lot more in a \$1,000-a-side pool than in a \$50-a-side pool. **Recommendation: `1000` for consumer wallets and portfolio apps.** Use `250` to keep more small-cap tokens, or `10000` or more for reporting, accounting or anything that moves money based on the value. Above \$1,000 a side you start losing real but small tokens, so raise it only when a false value costs more than a missing one. ### `max_token_inactivity` Excludes tokens that have not traded for more than the given number of days. **Recommendation: `7`.** A price more than a week old isn't a fair current value for a portfolio. Raise it to `30` if your users hold long-tail tokens that trade rarely and you would rather show a stale price than none. ### `exclude_unverified_contracts` Keeps only ERC20 tokens verified by CoinGecko (`verified_contract: true`). See [Verified Contracts](/data-api/data-features/safety-and-trust/verified-contracts). This is the strictest filter. It removes almost all spam and manipulated tokens, along with real tokens that are new or too small to be listed on CoinGecko. **Recommendation: use it for headline numbers that must be defensible**, such as a total balance shown on an exchange, a figure used in reporting, or an eligibility check. For a wallet that lists everything the user holds, leave it off and use the `verified_contract` field instead (see [Checks to run on the response](#checks-to-run-on-the-response)). *** ## Recommended settings | Use case | `exclude_spam` | `min_pair_side_liquidity_usd` | `max_token_inactivity` | `exclude_unverified_contracts` | | - | - | - | - | - | | **Wallet or portfolio app.** Show everything real, value it sensibly. | `true` | `1000` | `7` | `false` | | **Strict valuation.** Exchanges, reporting, rewards, risk and eligibility checks. | `true` | `10000` | `3` | `true` | | **Discovery or trading tools.** Users want the long tail and accept more noise. | `true` | `250` | `30` | `false` | Start with the first row. Move to a stricter row if users still report inflated values, and to a looser one if they report missing tokens. ```bash Wallet or portfolio app theme={null} curl "https://deep-index.moralis.io/api/v2.2/wallets/0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045/net-worth?chains=eth&chains=base&exclude_spam=true&exclude_unverified_contracts=false&min_pair_side_liquidity_usd=1000&max_token_inactivity=7" \ -H "X-API-Key: YOUR_API_KEY" ``` Use **the same values** on Token Balances and Net Worth. Then the tokens in the list add up to the total, and users don't see a figure they can't reconcile. *** ## Checks to run on the response The filters cover most cases. For a portfolio that real users rely on, also check these Token Balances fields before showing a value: * **`verified_contract`**: when unverified tokens are left in, show them in the list but leave them out of the headline total, or label them "unverified". You get the stricter total without hiding anything. * **`possible_spam`**: if you don't use `exclude_spam`, for example to show spam in a separate "hidden" tab, never count these tokens towards value. * **`percentage_relative_to_total_supply`**: an ordinary wallet that holds a large share (say more than 1%) of an unverified token's supply has usually been airdropped it. Real holdings of that size are rare outside the team that issued the token. * **`usd_price_24hr_percent_change`**: a price that is up several thousand percent in a day, on an unverified token, is more likely a bad print than a real move. Hold it back until it repeats on the next call. * **`portfolio_percentage`**: if one unverified token suddenly makes up most of a wallet's value, check it before you show the total. If you store snapshots, compare each token's value with the previous snapshot. A low-liquidity token that jumps more than about 10x between two calls can safely wait one refresh cycle before you show the new value. *** ## Endpoint reference | Endpoint | Spam | Liquidity | Inactivity | Verified only | | - | - | - | - | - | | [Token Balances](/data-api/evm/wallet/token-balances) | `exclude_spam` | `min_pair_side_liquidity_usd` | `max_token_inactivity` | `exclude_unverified_contracts` | | [Wallet Net Worth](/data-api/evm/wallet/net-worth) | `exclude_spam` | `min_pair_side_liquidity_usd` | `max_token_inactivity` | `exclude_unverified_contracts` | | [Cross-Chain Token Balances](/data-api/universal/wallet/cross-chain-token-balances) | `excludeSpam` | `liquidityThreshold` | `maxTokenInactivity` | `excludeUnverifiedContracts` | | [Token Price](/data-api/evm/token/prices/token-price), [Token Prices (Batch)](/data-api/evm/token/prices/token-prices-batch) | n/a | `min_pair_side_liquidity_usd` | `max_token_inactivity` | n/a | | [Solana Token Balances](/data-api/solana/wallet/token-balances), [Solana Portfolio](/data-api/solana/wallet/portfolio) | `excludeSpam` | n/a | n/a | n/a | Cross-Chain Token Balances also returns `securityScore` on each token, the token's [Token Score](/data-api/data-features/token-scores). Filtering out low scores is a good extra check on top of the filters above. On Solana, the wallet endpoints don't return USD values, and there is no default liquidity threshold. Set `excludeSpam=true`, use `isVerifiedContract` the way you would use `verified_contract`, and apply your own checks to any prices you fetch. > [!NOTE] > > The [legacy Token Balances](/data-api/evm/wallet/token-balances-legacy) endpoint (`/{address}/erc20`) excludes spam by default, but it doesn't take the price filters. Use [Token Balances](/data-api/evm/wallet/token-balances) for anything that shows USD values. # Liquidity Filtering Source: https://docs.moralis.com/data-api/data-features/safety-and-trust/liquidity-filtering Understand how Moralis uses liquidity filtering to protect price accuracy, including default thresholds, how pair-side liquidity is evaluated for both tokens in a pool, endpoint behavior, and custom liquidity controls. ## Liquidity Filtering Liquidity Filtering is a safety mechanism used across Moralis price-dependent features to avoid returning unreliable or easily manipulated prices. It ensures that prices are only derived from pools with sufficient onchain liquidity, making downstream data (net worth, PnL, analytics) safer and more predictable. Liquidity filtering is applied across: * [Token Prices](/data-api/evm/token/prices/token-prices-batch) * [Wallet Token Balances](/data-api/evm/wallet/token-balances) (with prices) * [Wallet Net Worth](/data-api/evm/wallet/net-worth) * Other price-dependent features *** ## Why Liquidity Filtering Exists Onchain markets often include: * Thin or inactive pools * Short-lived pools created for manipulation * Pools where one side has meaningful liquidity but the other side is effectively empty Without liquidity filtering, these pools can: * Produce unstable or misleading prices * Inflate portfolio values * Distort rankings and analytics Liquidity filtering acts as a minimum quality bar for any price Moralis returns. *** ## Default Liquidity Thresholds Moralis enforces minimum liquidity requirements per chain. Default thresholds: * **EVM chains:** \$50 minimum liquidity per side (each token in the pair) * **Solana:** no enforced liquidity threshold This threshold applies at the pool level and is evaluated for both assets in the pair. *** ## What “pair-side liquidity” means “Pair-side liquidity” means the USD liquidity of **each token in the pool**, evaluated independently. For a TOKEN / USDC pool, Moralis checks: * TOKEN-side liquidity (in USD) * USDC-side liquidity (in USD) The pool is considered eligible only if **both sides** meet the minimum threshold. ### Why this approach This prevents pools where one side is effectively illiquid, even if the other side looks healthy. Example: * TOKEN liquidity: \$100,000 * USDC liquidity: \$10 Even though the TOKEN side is deep, the USDC side is too small for the pool to be a reliable pricing venue, so Moralis excludes it. This is especially important for: * Long-tail tokens * Manipulation-resistant pricing * Stable portfolio and net worth calculations *** ## Liquidity Skew Get Token Pairs ([EVM](/data-api/evm/token/swaps/token-pairs), [Solana](/data-api/solana/token/pairs/token-pairs)) exposes a property that measures how balanced a pair's reserves are across both sides of the pool. It is named `liquidity_skew` on EVM and `liquiditySkew` on Solana. * `1` = perfectly balanced reserves * `0` = fully imbalanced (liquidity concentrated on one side) When this value is below `0.005`, the pair's liquidity is treated as `0`. This prevents heavily one-sided pools, where one side is effectively empty, from being used as a reliable pricing venue. *** ## Low Liquidity Behavior When a pool fails liquidity filtering, behavior depends on the endpoint. * [Get Token Price](/data-api/evm/token/prices/token-price)\ Returns a `404` error indicating insufficient liquidity * [Get Multiple Token Prices](/data-api/evm/token/prices/token-prices-batch)\ The token is omitted from the response * [Wallet Token Balances](/data-api/evm/wallet/token-balances) (with prices)\ Token price is returned as `null` * [Wallet Net Worth](/data-api/evm/wallet/net-worth)\ Token is excluded from the net worth calculation This behavior is intentional and consistent across price-dependent features. *** ## Consistency Across Features Liquidity filtering is applied uniformly so that: * A pool excluded from Token Prices\ will not silently be used to value assets in Wallet Net Worth * A token with `null` price in balances\ will not inflate portfolio values unexpectedly This consistency is critical for building reliable dashboards, analytics, and valuation logic. *** ## Custom Liquidity Thresholds You can override the default threshold using the `min_pair_side_liquidity_usd` query parameter. Example:\ `min_pair_side_liquidity_usd=5000` This ensures that only pools where **both sides** have at least \$5,000 USD liquidity are considered. For recommended thresholds by use case, see [Accurate Net Worth & Token Balances](/data-api/data-features/safety-and-trust/accurate-net-worth-and-balances). *** ### Common Use Cases for Custom Thresholds * Risk-averse or institutional reporting * Cleaner portfolio and net worth calculations * Excluding long-tail or thinly traded tokens * Reducing exposure to short-lived or manipulated pools *** ## What Liquidity Filtering Does Not Do Liquidity filtering: * Does not guarantee market fairness * Does not detect scams by itself * Does not replace deeper risk analysis It is one component of Moralis’ broader Safety & Trust model and should be used alongside: * [Token Scores](/data-api/data-features/token-scores) * [Spam Filtering](/data-api/resources/spam-filtering) * [Verified Contracts](/data-api/data-features/safety-and-trust/verified-contracts) # Verified Contracts Source: https://docs.moralis.com/data-api/data-features/safety-and-trust/verified-contracts Moralis surfaces verification signals for ERC20 tokens and NFT collections to help you distinguish legitimate projects from impersonators, clones, or scams. These signals are based on trusted third-party verification sources and are exposed directly in API responses. ## Verified Contracts (ERC20) The `verified_contract` flag indicates that an **ERC20 token contract has been verified by CoinGecko**. > [!NOTE] > > This verification is **not** based on Etherscan contract verification. ### What CoinGecko Verification Means When a contract is marked as verified: * The token has been reviewed by the **CoinGecko team** * It has passed CoinGecko’s internal criteria for legitimacy * It is considered a **trusted, recognised token** within the ecosystem This helps developers: * Filter out scam or impersonator tokens * Prioritise legitimate assets in search and UI * Build safer default experiences for users *** ## Verified NFT Collections The `verified_collection` flag applies to **NFT collections** that have been verified by **OpenSea**. When a collection is verified: * OpenSea has reviewed and validated the collection * The collection is recognised as authentic * Users can more easily distinguish real projects from fakes This is the same verification signal users see as a **verified badge on OpenSea**. *** ## Why Verification Matters Verification signals are especially useful for: * Wallets and portfolio trackers * Token and NFT discovery * Search and filtering experiences * Reducing exposure to scams and copycat projects They are often used alongside: * [Spam Filtering](/data-api/resources/spam-filtering) * [Token Scores](/data-api/data-features/token-scores) * [Token Search](/data-api/data-features/search-and-discovery/token-search) to build a layered safety model. *** ## Notes & Limitations * Verification is **source-dependent**: * ERC20 tokens → CoinGecko * NFT collections → OpenSea * Not all legitimate projects are verified * Verification status may change over time as source data updates Always treat verification as a **signal**, not a guarantee. # Token Search Source: https://docs.moralis.com/data-api/data-features/search-and-discovery/token-search Token Search lets you discover tokens across multiple blockchains using names, symbols, token address or DEX pair addresses, with built-in ranking and verification signals to surface high-quality results. Token Search indexes tokens across supported chains and returns ranked results based on relevance, activity, and verification signals. It’s designed for building fast, reliable token discovery experiences in wallets, dashboards, and trading applications. You can search by: * Token name (e.g. `Pepe`) * Token symbol (e.g. `PEPE`) * Token address * DEX pair address * Partial matches (e.g. `PEP` → `PEPE`) Search is: * Case-insensitive * Resilient to partial input * Optimized to prioritize legitimate tokens *** ## Search Controls & Ranking Token Search exposes several controls that affect how results are ranked and filtered. ### Verification Controls * `isVerifiedContract`\ When `true`, only [verified tokens](/data-api/data-features/safety-and-trust/verified-contracts) are returned.\ Default: `false` * `boostVerifiedContracts`\ When `true`, [verified tokens](/data-api/data-features/safety-and-trust/verified-contracts) are ranked higher.\ Default: `true` *** ### Sorting Options You can sort results using: * `volume1hDesc` *(default)* * `volume24hDesc` * `liquidityDesc` * `marketCapDesc` This allows you to tune search results for: * Trading UIs * Analytics dashboards * Discovery vs relevance *** ## Multi-Chain Search Token Search supports querying across multiple chains in a single request. Blockchains currently supported: * Ethereum * Polygon * BNB Chain * Arbitrum * Optimism * Base * Avalanche * Linea * Ronin * PulseChain * Solana Support is continuously expanding. *** ## Verified Token Prioritisation Token Search applies additional weighting to [verified tokens](/data-api/data-features/safety-and-trust/verified-contracts) to improve result quality. ### How verification affects results * Tokens listed on **CoinGecko** are treated as verified * Verified tokens are: * Ranked higher by default * Preferred over similarly named unverified tokens * This reduces exposure to spam, clones, and misleading symbols You can: * **Boost** verified tokens (default behavior) * **Filter** results to only verified tokens *** ## Response Data Each search result may include: ```json theme={null} { "tokenAddress": "0x6982508145454ce325ddbe47a25d4ec3d2311933", "chainId": "0x1", "name": "Pepe", "symbol": "PEPE", "blockNumber": 17046105, "blockTimestamp": 1681483895, "usdPrice": 0.00000660795798374201, "marketCap": 2779901844.180426, "experiencedNetBuyers": { "oneHour": -4, "oneDay": -6, "oneWeek": 50 }, "netVolumeUsd": { "oneHour": -109135.83610023865, "oneDay": 409602.78393524094 }, "liquidityChangeUSD": { "oneHour": -102512.48357243836, "oneDay": -334000.64153755084 }, "usdPricePercentChange": { "oneHour": -1.0458516076000621, "oneDay": 0.021417598614723917 }, "volumeUsd": { "oneHour": 190965.87173599334, "oneDay": 5241212.457093451 }, "securityScore": 96, "logo": "https://adds-token-info-29a861f.s3.eu-central-1.amazonaws.com/marketing/evm/0x6982508145454ce325ddbe47a25d4ec3d2311933_icon.png", "isVerifiedContract": true, "fullyDilutedValuation": 2779901181.0952516, "totalHolders": 503992, "totalLiquidityUsd": 24553340.56545042, "implementations": [] } ``` *** ## Limits & Constraints Current limitations to be aware of: * Default limit: **10 results** * Maximum limit: **1000 results** * No pagination support * Chain identifiers must be valid and correctly formatted *** ## Usage Guidelines To get the best results: * Use precise search queries where possible * Limit searches to relevant chains * Use verification filters for safer UX * Choose appropriate sorting for your use case *** ## Availability & Access Token Search is a **premium feature** and requires a **Pro plan** or higher. Trial access can be activated to evaluate the feature before upgrading. # Token Scores Source: https://docs.moralis.com/data-api/data-features/token-scores The Moralis Token Score is a unified 0-100 rating that evaluates the onchain quality of a token using six weighted metrics, supported across all EVM chains. > [!NOTE] > > **Token Score is becoming an EVM-only feature.** Solana support is deprecated and will be removed on **July 31, 2026** — after that date, Token Score and the embedded Solana `score` field are no longer available for Solana tokens. Token Score remains fully supported on all EVM chains. See the [changelog](/changelog) for details. ## What is the Token Score? The Token Score summarizes a token's onchain fundamentals into a single value between 0 and 100, where: * Higher scores indicate stronger onchain quality * Lower scores indicate weaker liquidity, activity, distribution, or unrealistic valuations It is designed to be: * Simple to display * Easy to filter and sort * Transparent and easy to explain *** ## How is the Token Score calculated? Each of the six metrics produces a sub-score from 0 to 100, and the final score is a weighted average. The metrics are: 1. Age - token activity across multiple timeframes 2. Liquidity - liquidity depth 3. FDV - fully diluted valuation reasonableness 4. Holder Supply - distribution of supply among top holders 5. Volume - trading volume 6. Activity - transaction counts *** ## Metrics Overview ### 1. Token Age & Maturity * Evaluates activity across timeframes (10m → 30d). * Tokens that sustain or grow activity over longer periods receive higher scores. ### 2. Liquidity Depth * Measures liquidity across all pools belonging to a token. * Higher liquidity generally indicates healthier and more resilient markets. ### 3. Fully Diluted Valuation (FDV) * Penalizes extreme or unrealistic valuations. * Reasonably valued tokens receive higher FDV scores. ### 4. Holder Distribution * Assesses how much of the supply is concentrated in the top holders. * More decentralization = higher score. ### 5. Trading Volume * Measures trading volume across all time windows. * High volume in any timeframe positively impacts the score. ### 6. Transaction Activity * Measures frequency of swaps and transfers. * High transaction counts indicate stronger adoption and usage. *** ## Dynamic Scoring The Token Score is **dynamic**, meaning it updates automatically as new onchain data becomes available. Because the model incorporates multiple rolling timeframes (10 minutes up to 1 month), a token’s score may change due to: * Increased or decreased transaction activity * Shifts in liquidity * Changes in trading volume * Supply distribution evolving * Market valuation moving significantly Scores naturally **decay over time** if a token becomes inactive, as older datapoints fall out of the model. This ensures the score always reflects **current** onchain conditions. *** ## Early & New Tokens Scores for very new tokens can sometimes be **volatile or appear inconsistent** in the earliest stages of trading. This is expected, as the scoring model is still collecting activity patterns across its time horizons. **Key points about new-token scoring:** * Early activity is often spiky and unstable * Short-term timeframes dominate the score until longer periods accumulate * As data builds up, the score stabilizes and becomes more representative * Tokens with genuine early adoption will quickly rise into their appropriate score range > [!NOTE] > > The model adapts rapidly to real onchain traction - tokens with strong fundamentals will see their scores normalize within a short timeframe. *** ## Score Updates * Scores are recalculated whenever a token has activity * As long as trading continues, the score stays up to date * If activity stops, older data decays out of the model and the score may decline *** ## How can the Token Score be used? The Token Score is an informational onchain quality signal suitable for: #### Wallets & Explorers * Displaying token quality at a glance * Highlighting high-quality tokens * Warning users about low-scoring assets ### DEXs & Trading Interfaces * Supporting safer trading experiences * Powering token discovery and ranking flows ### Analytics & Discovery Tools * Filtering tokens by score (e.g., score ≥ 70) * Sorting tokens by onchain quality * Highlighting trending or improving tokens ### Risk & Monitoring Systems * Triggering alerts for sharp score drops * Flagging potentially risky assets for review > [!NOTE] > > Note: The Token Score is not investment advice. It is an onchain quality indicator. *** ## Historical Token Scores In addition to the latest score, Moralis provides [historical Token Scores](/data-api/universal/token/score/token-score-timeseries), allowing you to track how a token’s onchain quality evolves over time. Historical scores return a **time-series of Token Scores**, making it possible to: * Visualize long-term trends * Detect momentum shifts * Identify improving or deteriorating tokens * Backtest filters and ranking strategies This is especially powerful when combined with discovery, alerts, or trading analytics. *** ### Supported Timeframes Historical Token Scores support the following lookback windows and resolutions: * **1 day** → hourly resolution * **7 days** → hourly resolution * **30 days** → daily resolution Each data point represents the Token Score at the start of the aggregation window. *** ### Historical Token Score Endpoint Developers can fetch the historical scoring breakdown using the [Timeseries Token Score](/data-api/universal/token/score/token-score-timeseries) endpoint: ``` GET /tokens/{tokenAddress}/score/historical ``` Example response: ```javascript theme={null} { "chainId": "0x1", "tokenAddress": "0xdac17f958d2ee523a2206206994597c13d831ec7", "timeseries": [ { "timestamp": "2026-01-22T00:00:00Z", "score": 85 }, { "timestamp": "2026-01-21T00:00:00Z", "score": 84 }, { "timestamp": "2026-01-20T00:00:00Z", "score": 82 }, {}, {}, {} ] } ``` > [!NOTE] > > Note: This endpoint is available on **Pro plans and above**. *** ## Accessing Detailed Score Data Developers can fetch the full scoring breakdown using the [Token Score](/data-api/universal/token/score/token-score) endpoint: ``` GET /tokens/{address}/score ``` This endpoint returns: * Final score (0–100) * Sub-scores for all six metrics * Raw onchain metrics used in the calculation * Timestamp of last update Example response: ```json theme={null} { "tokenAddress": "0x6982508145454ce325ddbe47a25d4ec3d2311933", "chainId": "0x1", "score": 94, "updatedAt": "2025-12-17T13:13:16.000Z", "metrics": { "usdPrice": 0.00000402842434389702, "liquidityUsd": 17796503.766060613, "volumeUsd": { "10m": 450.2313257520407, "30m": 1698.933789208249, "1h": 12046.524987589466, "4h": 258302.39298010131, "12h": 364831.1304703939, "1d": 775582.3422029199, "7d": 6831957.3632850265, "30d": 40129952.32714323 }, "transactions": { "10m": 4, "30m": 27, "1h": 47, "4h": 106, "12h": 389, "1d": 1393, "7d": 9614, "30d": 87370 }, "supply": { "total": 420689899653542.56, "top10Percent": 41.53 } } } ``` > [!NOTE] > > Note: This endpoint is available on **Pro plans and above**. *** ## Supported Chains The Token Score is available on all **EVM mainnet chains**, giving you a unified metric to **compare token quality across EVM chains**. > [!NOTE] > > Solana support for Token Score is deprecated and will be removed on **July 31, 2026**. After that date, Token Score is an EVM-only feature. See the [changelog](/changelog) for details. # Address Transactions Source: https://docs.moralis.com/data-api/evm/blockchain/address-transactions openapi-files/data-api/api.json GET /{address} Get raw native transactions ordered by block number in descending order. 📦 **Own this data instead.** Move this endpoint onto your own infrastructure with [Data Feeds](/data-feeds/migration/wallet-native-txns) — the same decoded onchain dataset, in real time, with no per-call limits. # Address Transactions (Decoded) Source: https://docs.moralis.com/data-api/evm/blockchain/address-transactions-decoded openapi-files/data-api/api.json GET /{address}/verbose Get ABI-decoded native transactions ordered by block number in descending order. # Block by Date Source: https://docs.moralis.com/data-api/evm/blockchain/block-by-date openapi-files/data-api/api.json GET /dateToBlock Find the closest block to a specific date on a blockchain. # Block by Hash or Number Source: https://docs.moralis.com/data-api/evm/blockchain/block-by-hash openapi-files/data-api/api.json GET /block/{block_number_or_hash} Get the contents of a block given the block hash. 📦 **Own this data instead.** Move this endpoint onto your own infrastructure with [Data Feeds](/data-feeds/migration/block) — the same decoded onchain dataset, in real time, with no per-call limits. # Latest Block Source: https://docs.moralis.com/data-api/evm/blockchain/latest-block openapi-files/data-api/api.json GET /latestBlockNumber/{chain} Get the most recent block number for a specified blockchain. # Blockchain API Source: https://docs.moralis.com/data-api/evm/blockchain/overview Low-level blockchain access made simple - query raw blocks, transactions, logs, and events with consistent, multi-chain APIs. ## Overview The **Blockchain API** provides low-level access to raw blockchain data including blocks, transactions, and logs. Query the blockchain directly without running your own nodes - get block data, transaction details, and decoded contract interactions across all supported EVM chains. *** ## What Is the Blockchain API? The Blockchain API lets you query: * **Blocks** - Block data by hash, number, or timestamp * **Transactions** - Raw and decoded transaction details * **Address Activity** - All transactions for a specific address * **Logs** - Event logs and contract emissions * **Internal Transactions** - Contract-to-contract calls *** ## Key Features The Blockchain API includes: * **Block Lookups** - Query blocks by hash or find blocks by timestamp * **Transaction Details** - Full transaction data including gas and status * **Decoded Transactions** - Human-readable interpretation of contract calls * **Address History** - Complete transaction history for any address * **Multi-Chain** - Consistent interface across all EVM chains * **Latest Block** - Get the current block number for any chain *** ## Common Use Cases The Blockchain API is commonly used for: * **Block Explorers**\ (display block and transaction data) * **Address Monitoring**\ (track transactions for specific wallets) * **Historical Analysis**\ (query blockchain state at specific times) * **Transaction Verification**\ (confirm transaction status and details) * **Data Indexing**\ (build custom indexes from raw data) * **Debugging**\ (inspect failed transactions and logs) *** ## Popular Endpoints | Endpoint | Description | | - | - | | [Get Block by Hash](/data-api/evm/blockchain/block-by-hash) | Retrieve block data by hash | | [Get Block by Date](/data-api/evm/blockchain/block-by-date) | Find block closest to a timestamp | | [Get Transaction](/data-api/evm/blockchain/transaction-by-hash) | Get transaction details by hash | | [Decoded Transaction](/data-api/evm/blockchain/transaction-by-hash-decoded) | Get decoded transaction data | | [Address Transactions](/data-api/evm/blockchain/address-transactions) | Get all transactions for an address | *** ## Get Started Explore some of the popular Blockchain API endpoints: * [Get Block by Hash](/data-api/evm/blockchain/block-by-hash) * [Get Block by Date](/data-api/evm/blockchain/block-by-date) * [Get Transaction](/data-api/evm/blockchain/transaction-by-hash) * [Get Address Transactions](/data-api/evm/blockchain/address-transactions) # Get Transaction Source: https://docs.moralis.com/data-api/evm/blockchain/transaction-by-hash openapi-files/data-api/api.json GET /transaction/{transaction_hash} Get the contents of a transaction by the given transaction hash. # Get Transaction (Decoded) Source: https://docs.moralis.com/data-api/evm/blockchain/transaction-by-hash-decoded openapi-files/data-api/api.json GET /transaction/{transaction_hash}/verbose Get the ABI-decoded contents of a transaction by the given transaction hash. 📦 **Own this data instead.** Move this endpoint onto your own infrastructure with [Data Feeds](/data-feeds/migration/transaction-verbose) — the same decoded onchain dataset, in real time, with no per-call limits. # Wallet Positions Source: https://docs.moralis.com/data-api/evm/defi/legacy/wallet-positions openapi-files/data-api/api.json GET /wallets/{address}/defi/positions Get a concise overview of a wallet’s DeFi positions across all protocols. # Detailed Positions Source: https://docs.moralis.com/data-api/evm/defi/legacy/wallet-positions-detailed openapi-files/data-api/api.json GET /wallets/{address}/defi/{protocol}/positions Fetch detailed DeFi positions for a given wallet and protocol. # Wallet Protocols Source: https://docs.moralis.com/data-api/evm/defi/legacy/wallet-protocols openapi-files/data-api/api.json GET /wallets/{address}/defi/summary Summarize a wallet’s DeFi activity, including total USD value, unclaimed rewards and active protocols. # DeFi API Source: https://docs.moralis.com/data-api/evm/defi/overview Track DeFi positions, balances, rewards, and protocol interactions with enriched, protocol-aware data across supported chains. ## Overview The **DeFi API** provides detailed insights into wallet positions across DeFi protocols including lending, borrowing, staking, and liquidity pools. Query a wallet's DeFi exposure without manually integrating with each protocol - get a unified view of positions, balances, and rewards across supported protocols. *** ## What Is the DeFi API? The DeFi API lets you query: * **Protocol Summary** - Overview of all DeFi protocols a wallet uses * **Positions** - Detailed position data per protocol * **Position Details** - Enhanced breakdown with underlying assets * **Multi-Protocol** - Support for major DeFi protocols *** ## Key Features The DeFi API includes: * **Protocol Detection** - Automatically identifies which protocols a wallet uses * **Position Breakdown** - Detailed view of deposits, borrows, and rewards * **USD Valuations** - Position values calculated in USD * **Multi-Chain** - Track positions across supported EVM chains * **Unified Format** - Consistent data structure across protocols *** ## Supported Protocols The DeFi API supports major protocols including: * Aave * Compound * Uniswap * Lido * Rocket Pool * Eigenlayer * And more *** ## Common Use Cases The DeFi API is commonly used for: * **Portfolio Trackers**\ (show DeFi positions alongside tokens and NFTs) * **DeFi Dashboards**\ (aggregate positions across protocols) * **Risk Monitoring**\ (track lending health factors and exposure) * **Yield Tracking**\ (monitor staking rewards and LP positions) * **Tax Reporting**\ (calculate DeFi gains and income) *** ## Popular Endpoints | Endpoint | Description | | - | - | | [Wallet Protocols](/data-api/evm/defi/wallet-protocols) | Summary of protocols used by a wallet | | [Wallet Positions](/data-api/evm/defi/wallet-positions) | Detailed positions per protocol | | [Detailed Positions](/data-api/evm/defi/wallet-positions-detailed) | Enhanced position breakdown | *** ## Get Started * [Get Wallet Protocols](/data-api/evm/defi/wallet-protocols) * [Get Wallet Positions](/data-api/evm/defi/wallet-positions) * [Get Detailed Positions](/data-api/evm/defi/wallet-positions-detailed) *** ## DeFi API Overview Video [Moralis DeFi API Overview](https://www.youtube.com/embed/dLcoB3vFf38) # Wallet Positions Source: https://docs.moralis.com/data-api/evm/defi/wallet-positions openapi-files/data-api/api-v1.json GET /v1/wallets/{walletAddress}/defi/positions Returns all DeFi positions (lending, liquidity, staking) for a wallet address across specified chains in a unified schema. # Detailed Positions Source: https://docs.moralis.com/data-api/evm/defi/wallet-positions-detailed openapi-files/data-api/api-v1.json GET /v1/wallets/{walletAddress}/defi/{protocol}/positions Returns DeFi positions for a wallet address filtered by a specific protocol across specified chains. # Wallet Protocols Source: https://docs.moralis.com/data-api/evm/defi/wallet-protocols openapi-files/data-api/api-v1.json GET /v1/wallets/{walletAddress}/defi/summary Returns a summary of all DeFi positions for a wallet address across specified chains. # NFT Collections by Wallet Source: https://docs.moralis.com/data-api/evm/nft/collections/nft-collections-by-wallet openapi-files/data-api/api.json GET /{address}/nft/collections Fetch all NFT Collections held by a specified wallet address. Each Collection returned includes on-chain metadata as well as off-chain metadata, floor prices and more where available. 📦 **Own this data instead.** Move this endpoint onto your own infrastructure with [Data Feeds](/data-feeds/migration/wallet-nft-collections) — the same decoded onchain dataset, in real time, with no per-call limits. # NFTs by Collection Source: https://docs.moralis.com/data-api/evm/nft/collections/nfts-by-collection openapi-files/data-api/api.json GET /nft/{address} Fetch all NFTs for a given collection. Each NFT returned includes on-chain metadata as well as off-chain metadata, floor prices, rarity and more where available. 📦 **Own this data instead.** Move this endpoint onto your own infrastructure with [Data Feeds](/data-feeds/migration/nfts-by-contract) — the same decoded onchain dataset, in real time, with no per-call limits. # NFTs by Wallet Source: https://docs.moralis.com/data-api/evm/nft/collections/nfts-by-wallet openapi-files/data-api/api.json GET /{address}/nft Fetch all NFTs held by a specified wallet address. Use `token_addresses` to filter by one or many specific contract(s). Each NFT returned includes on-chain metadata as well as off-chain metadata, floor prices, rarity and more where available. # Collection Metadata Source: https://docs.moralis.com/data-api/evm/nft/metadata/collection-metadata openapi-files/data-api/api.json GET /nft/{address}/metadata Fetch on-chain metadata like name, symbol, and base token URI for an NFT contract. Also returns off-chain metadata, floor prices and more where available. 📦 **Own this data instead.** Move this endpoint onto your own infrastructure with [Data Feeds](/data-feeds/migration/nft-collection-metadata) — the same decoded onchain dataset, in real time, with no per-call limits. # Collection Metadata (Batch) Source: https://docs.moralis.com/data-api/evm/nft/metadata/collection-metadata-batch openapi-files/data-api/api.json POST /nft/metadata Retrieve metadata (name, symbol) for up to 25 NFT contracts in one call. Also returns off-chain metadata, floor prices and more where available. # Collection Stats Source: https://docs.moralis.com/data-api/evm/nft/metadata/collection-stats openapi-files/data-api/api.json GET /nft/{address}/stats Get summary stats by NFT collection including total NFT transfers, total tokens and total owners. # NFT Metadata Source: https://docs.moralis.com/data-api/evm/nft/metadata/nft-metadata openapi-files/data-api/api.json GET /nft/{address}/{token_id} Fetch metadata for a specific NFT. Includes on-chain metadata as well as off-chain metadata, floor prices, rarity and more where available. # NFT Metadata (Batch) Source: https://docs.moralis.com/data-api/evm/nft/metadata/nft-metadata-batch openapi-files/data-api/api.json POST /nft/getMultipleNFTs Get NFT metadata for one or many NFTs. Accepts an array of up to 25 `tokens`, each requiring `token_address` and `token_id`. Each NFT returned includes on-chain metadata as well as off-chain metadata, floor prices, rarity and more where available. 📦 **Own this data instead.** Move this endpoint onto your own infrastructure with [Data Feeds](/data-feeds/migration/nft-multiple) — the same decoded onchain dataset, in real time, with no per-call limits. # NFT API Source: https://docs.moralis.com/data-api/evm/nft/overview Everything you need to build NFT experiences - metadata, ownership, transfers, sales, rarity, floor prices, and marketplace activity across major chains. ## Overview The **NFT API** provides complete NFT data including metadata, ownership, trading history, pricing, and collection analytics. Whether you're building a marketplace, portfolio tracker, or analytics platform, the NFT API gives you everything you need to work with NFTs across all EVM chains. *** ## What Is the NFT API? The NFT API lets you query: * **Metadata** - Token and collection metadata with media URLs * **Ownership** - Current owners and ownership history * **Transfers** - Transfer history by collection or token ID * **Pricing** - Floor prices, sale history, and price trends * **Traits** - Attribute data and rarity analysis * **Discovery** - Top collections by volume or market cap *** ## Key Features The NFT API includes: * **Rich Metadata** - Fully resolved metadata with IPFS gateway support * **Floor Price Tracking** - Current and historical floor prices * **Sales Data** - Trade history with prices and marketplaces * **Trait Analysis** - Collection traits with rarity percentages * **Ownership Queries** - Find all owners of a collection or token * **Market Discovery** - Discover trending collections * **Batch Queries** - Fetch metadata for multiple NFTs at once *** ## Common Use Cases The NFT API is commonly used for: * **NFT Marketplaces**\ (listings, metadata, ownership verification) * **Portfolio Trackers**\ (display NFT holdings with valuations) * **Analytics Platforms**\ (collection stats, volume, floor trends) * **Rarity Tools**\ (trait analysis and rarity rankings) * **Verification Systems**\ (prove NFT ownership for gating) * **Collection Dashboards**\ (monitor collection performance) *** ## Popular Endpoints | Endpoint | Description | | - | - | | [NFT Metadata](/data-api/evm/nft/metadata/nft-metadata) | Get metadata for a specific NFT | | [Collection Metadata](/data-api/evm/nft/metadata/collection-metadata) | Get collection-level metadata | | [Floor Price](/data-api/evm/nft/prices/collection-floor-price) | Current floor price for a collection | | [NFT Owners](/data-api/evm/nft/ownership/owners-by-contract) | List all owners of a collection | | [NFT Transfers](/data-api/evm/nft/transfers/collection-transfers) | Transfer history for a collection | | [Collection Trades](/data-api/evm/nft/trades/collection-trades) | Recent sales for a collection | *** ## Get Started Explore some of the popular NFT API endpoints: * [Get NFT Metadata](/data-api/evm/nft/metadata/nft-metadata) * [Get Collection Floor Price](/data-api/evm/nft/prices/collection-floor-price) * [Get NFT Owners](/data-api/evm/nft/ownership/owners-by-contract) * [Get NFT Transfers](/data-api/evm/wallet/nft-transfers) # Owners by Collection Source: https://docs.moralis.com/data-api/evm/nft/ownership/owners-by-contract openapi-files/data-api/api.json GET /nft/{address}/unique-owners Get unique wallet addresses owning NFTs from a contract. 📦 **Own this data instead.** Move this endpoint onto your own infrastructure with [Data Feeds](/data-feeds/migration/nft-owners) — the same decoded onchain dataset, in real time, with no per-call limits. # Owners by Token ID Source: https://docs.moralis.com/data-api/evm/nft/ownership/owners-by-token-id openapi-files/data-api/api.json GET /nft/{address}/{token_id}/owners List wallets owning a specific NFT, defined by its contract and token ID. # Floor Price by Collection Source: https://docs.moralis.com/data-api/evm/nft/prices/collection-floor-price openapi-files/data-api/api.json GET /nft/{address}/floor-price Get floor price for a given collection. Refreshes every 30 minutes. # Floor Price by Token ID Source: https://docs.moralis.com/data-api/evm/nft/prices/floor openapi-files/data-api/api.json GET /nft/{address}/{token_id}/floor-price Get the floor price for a specific NFT, defined by its contract and token ID. Refreshes every 30 minutes. # Timeseries Floor Price by Contract Source: https://docs.moralis.com/data-api/evm/nft/prices/historical-floor-price openapi-files/data-api/api.json GET /nft/{address}/floor-price/historical Get timeseries historical floor prices for a given NFT collection. Refreshes every 30 minutes. # Sale Price by Collection Source: https://docs.moralis.com/data-api/evm/nft/prices/sale-price-by-contract openapi-files/data-api/api.json GET /nft/{address}/price Fetch sale prices for NFTs in a contract over a specified number of days. Returns the last sale, lowest sale, highest sale, average sale and total trades within the specified period. # Sale Price by Token ID Source: https://docs.moralis.com/data-api/evm/nft/prices/sale-price-by-token-id openapi-files/data-api/api.json GET /nft/{address}/{token_id}/price Fetch sale prices for a specific NFT over a specified number of days. Returns the last sale, lowest sale, highest sale, average sale and total trades within the specified period. # NFT Trades by Collection Source: https://docs.moralis.com/data-api/evm/nft/trades/collection-trades openapi-files/data-api/api.json GET /nft/{address}/trades Get NFT trades for a given contract with the ability to filter by marketplace. # NFT Trades by Token ID Source: https://docs.moralis.com/data-api/evm/nft/trades/trades-by-token-id openapi-files/data-api/api.json GET /nft/{address}/{token_id}/trades Get NFT trades for a specific NFT by specifying a contract addres and token ID. # NFTs by Traits Source: https://docs.moralis.com/data-api/evm/nft/traits/nfts-by-traits openapi-files/data-api/api.json POST /nft/{address}/nfts-by-traits Find NFTs in a contract matching specific traits, perfect for attribute-based searches. # NFT Traits by Collection Source: https://docs.moralis.com/data-api/evm/nft/traits/traits-by-collection openapi-files/data-api/api.json GET /nft/{address}/traits Explore the distinct traits of NFTs in a contract, showcasing their unique attributes. # Traits by Collection (Paginated) Source: https://docs.moralis.com/data-api/evm/nft/traits/traits-by-collection-paginated openapi-files/data-api/api.json GET /nft/{address}/traits/paginate Fetch NFT traits for a contract with pagination for efficient navigation of large collections. # NFT Transfers by Contract Source: https://docs.moralis.com/data-api/evm/nft/transfers/collection-transfers openapi-files/data-api/api.json GET /nft/{address}/transfers Get NFT transfers for a contract, with options to filter by date, token, or other parameters. # NFT Transfers by Token ID Source: https://docs.moralis.com/data-api/evm/nft/transfers/token-id-transfers openapi-files/data-api/api.json GET /nft/{address}/{token_id}/transfers Get transfers of a specific NFT given a contract address and token ID. # Resync NFT Metadata Source: https://docs.moralis.com/data-api/evm/nft/utilities/resync-nft-metadata openapi-files/data-api/api.json GET /nft/{address}/{token_id}/metadata/resync Update an NFT’s metadata, either from its current token URI or a new one. Choose sync for immediate results or async for background processing. # Resync NFT Traits Source: https://docs.moralis.com/data-api/evm/nft/utilities/resync-nft-traits openapi-files/data-api/api.json GET /nft/{address}/traits/resync Refresh trait and rarity data for NFTs in a contract to ensure accuracy. # EVM Data API Source: https://docs.moralis.com/data-api/evm/overview The EVM Data API provides a single, consistent interface for accessing blockchain data across 30+ supported chains, including Ethereum, Base, Binance Smart Chain, and more. It standardizes complex on-chain data into clean, developer-friendly formats. ### Overview The **EVM API** provides **deep, EVM-native access** to blockchain data across **30+ EVM-compatible networks**, including Ethereum, Base, Binance Smart Chain, Polygon, Arbitrum, Optimism, and more. It exposes rich EVM-specific concepts while still delivering data in clean, structured, developer-friendly formats. *** ### Explore Data APIs: > [card] [Wallet API](/data-api/evm/wallet/overview) > > Wallet history, transfers balances, tokens and PnL. > [card] [Token API](/data-api/evm/token/overview) > > Token search, balances, transfers, holders and swaps. > [card] [NFT API](/data-api/evm/nft/overview) > > Metadata, floor prices, transfers and ownership. > [card] [Price API](/data-api/evm/price/overview) > > Real-time crypto prices, OHLC, trading volume. > [card] [DeFi API](/data-api/evm/defi/overview) > > DeFi positions, liquidity, reserves and token pairs. > [card] [Blockchain API](/data-api/evm/blockchain/overview) > > Raw blocks, transactions, internal transactions and logs. *** ### What the EVM API Is For The EVM API is designed for: * Applications focused primarily on **EVM ecosystems** * Advanced use cases that rely on **EVM-specific behavior** * Teams that need **maximum depth and flexibility** when working with EVM data Some EVM-specific endpoints and data models are **not available** in the Universal API. *** ### Relationship to the Universal API * The Universal API covers **shared functionality** across EVM and Solana * The EVM API provides **deeper, more specialized EVM support** * Not all EVM endpoints are candidates for universal consolidation Think of the EVM API as the **expert-level interface** for EVM chains. *** # Floor Price by Collection Source: https://docs.moralis.com/data-api/evm/price/collection-floor-price openapi-files/data-api/api.json GET /nft/{address}/floor-price Get floor price for a given collection. Refreshes every 30 minutes. # OHLC by Pair Address Source: https://docs.moralis.com/data-api/evm/price/ohlc openapi-files/data-api/api.json GET /pairs/{address}/ohlcv Retrieve OHLCV (Open, High, Low, Close, Volume) candlestick data for a token pair. 📦 **Own this data instead.** Move this endpoint onto your own infrastructure with [Data Feeds](/data-feeds/migration/pair-ohlcv) — the same decoded onchain dataset, in real time, with no per-call limits. > [!WARNING] > > This endpoint requires a **pair address**, not a token address. To find the pair addresses for a token, use the [Token Pairs endpoint](/data-api/evm/token/swaps/token-pairs). # Price API Source: https://docs.moralis.com/data-api/evm/price/overview Real-time crypto prices, OHLC, trading volume. ## Overview The **Price API** provides real-time and historical pricing data for tokens and NFTs across all supported EVM chains. Get current prices, OHLC candlestick data, floor prices, and trading volume without managing your own price feeds or aggregation infrastructure. *** ## What Is the Price API? The Price API lets you query: * **Token Prices** - Current USD prices for any ERC-20 token * **OHLC Data** - Candlestick data for charting and technical analysis * **NFT Floor Prices** - Current and historical floor prices by collection * **Sale Prices** - Recent NFT sales with transaction details * **Batch Queries** - Fetch prices for multiple tokens in one request *** ## Key Features The Price API includes: * **Real-Time Prices** - Current token prices with USD values * **Historical Data** - Price history for trend analysis * **OHLC Candles** - Open, high, low, close data for charting * **Floor Price History** - Track NFT collection floor over time * **Batch Support** - Query multiple tokens efficiently * **Multi-Chain** - Consistent pricing across all EVM chains *** ## Common Use Cases The Price API is commonly used for: * **Price Feeds**\ (display current token prices in apps) * **Trading Charts**\ (OHLC data for candlestick visualizations) * **Portfolio Valuation**\ (calculate holdings value in USD) * **NFT Analytics**\ (track floor price trends) * **Alerts & Notifications**\ (trigger on price thresholds) * **Market Data Dashboards**\ (aggregate pricing across tokens) *** ## Popular Endpoints | Endpoint | Description | | - | - | | [Token Price](/data-api/evm/token/prices/token-price) | Get current price for a token | | [Token Prices (Batch)](/data-api/evm/token/prices/token-prices-batch) | Get prices for multiple tokens | | [OHLC](/data-api/evm/price/ohlc) | Candlestick data for charting | | [Collection Floor Price](/data-api/evm/price/collection-floor-price) | Current NFT floor price | | [Historical Floor Price](/data-api/evm/price/timeseries-floor-price) | Floor price over time | # Sale Price by Token ID Source: https://docs.moralis.com/data-api/evm/price/sale-price-by-token-id openapi-files/data-api/api.json GET /nft/{address}/{token_id}/price Fetch sale prices for a specific NFT over a specified number of days. Returns the last sale, lowest sale, highest sale, average sale and total trades within the specified period. # Sale Price by Collection Source: https://docs.moralis.com/data-api/evm/price/sale-prices-by-collection openapi-files/data-api/api.json GET /nft/{address}/price Fetch sale prices for NFTs in a contract over a specified number of days. Returns the last sale, lowest sale, highest sale, average sale and total trades within the specified period. # Timeseries Floor Price by Contract Source: https://docs.moralis.com/data-api/evm/price/timeseries-floor-price openapi-files/data-api/api.json GET /nft/{address}/floor-price/historical Get timeseries historical floor prices for a given NFT collection. Refreshes every 30 minutes. # Floor Price by Token ID Source: https://docs.moralis.com/data-api/evm/price/token-id-floor-price openapi-files/data-api/api.json GET /nft/{address}/{token_id}/floor-price Get the floor price for a specific NFT, defined by its contract and token ID. Refreshes every 30 minutes. # Token Price Source: https://docs.moralis.com/data-api/evm/price/token-price openapi-files/data-api/api.json GET /erc20/{address}/price Retrieve the current or historical price of an ERC20 token in the blockchain’s native currency and USD. Each token returned includes on-chain metadata, as well as off-chain metadata, logos, spam status and more. Additional options to exclude low-liquidity tokens and inactive tokens. 📦 **Own this data instead.** Move this endpoint onto your own infrastructure with [Data Feeds](/data-feeds/migration/erc20-price) — the same decoded onchain dataset, in real time, with no per-call limits. # Token Prices (Batch) Source: https://docs.moralis.com/data-api/evm/price/token-prices-batch openapi-files/data-api/api.json POST /erc20/prices Retrieve the current or historical prices for multiple ERC20 tokens in the blockchain’s native currency and USD. Accepts an array of up to 100 `tokens`, each requiring `token_address` and optional fields such as `to_block` or `exchange`. Each token returned includes on-chain metadata, as well as off-chain metadata, logos, spam status and more. Additional options to exclude low-liquidity tokens and inactive tokens. 📦 **Own this data instead.** Move this endpoint onto your own infrastructure with [Data Feeds](/data-feeds/migration/erc20-prices) — the same decoded onchain dataset, in real time, with no per-call limits. # Token Categories Source: https://docs.moralis.com/data-api/evm/token/discovery/token-categories openapi-files/data-api/api.json GET /tokens/categories List all supported token categories, which can then be used for filtering on endpoints such as getFilteredTokens. # Token Holder Metrics Source: https://docs.moralis.com/data-api/evm/token/holders/token-holder-stats openapi-files/data-api/api.json GET /erc20/{tokenAddress}/holders Returns total holders for a given token, as well as aggregated stats holder supply, holder trends, holder distribution and holder acquisition metrics. 📦 **Own this data instead.** Move this endpoint onto your own infrastructure with [Data Feeds](/data-feeds/migration/erc20-holders) — the same decoded onchain dataset, in real time, with no per-call limits. # Top Token Holders Source: https://docs.moralis.com/data-api/evm/token/holders/token-holders openapi-files/data-api/api.json GET /erc20/{token_address}/owners Identify the major holders of an ERC20 token and understand their ownership percentages. Includes known entities, exchanges and wallet labels. 📦 **Own this data instead.** Move this endpoint onto your own infrastructure with [Data Feeds](/data-feeds/migration/erc20-owners) — the same decoded onchain dataset, in real time, with no per-call limits. # Token Metadata Source: https://docs.moralis.com/data-api/evm/token/metadata/token-metadata openapi-files/data-api/api.json GET /erc20/metadata Retrieve metadata (name, symbol, decimals, logo) for an ERC20 token contract, as well as off-chain metadata, total supply, categories, logos, spam status and more. 📦 **Own this data instead.** Move this endpoint onto your own infrastructure with [Data Feeds](/data-feeds/migration/erc20-metadata) — the same decoded onchain dataset, in real time, with no per-call limits. # Token Score Source: https://docs.moralis.com/data-api/evm/token/metadata/token-score openapi-files/data-api/api.json GET /tokens/{tokenAddress}/score Retrieve a score for a specific token along with detailed metrics including price, volume, liquidity, transaction counts, and supply information. # Token Score - Timeseries Source: https://docs.moralis.com/data-api/evm/token/metadata/token-score-timeseries openapi-files/data-api/api.json GET /tokens/{tokenAddress}/score/historical Retrieve historical score data for a specific token over time. # Token API Overview Source: https://docs.moralis.com/data-api/evm/token/overview The most powerful Token API in Web3 - fetch, analyse, and monitor ERC20 tokens across multiple chains, covering prices, balances, transfers, liquidity, holders, volume, profitability, and advanced safety signals through a single unified interface. ## Overview The **Token API** provides comprehensive ERC-20 token data including prices, balances, transfers, holders, liquidity, swaps, and advanced analytics across all supported EVM chains. From simple balance queries to complex token analytics, the Token API delivers the data you need to build trading platforms, portfolio trackers, and token analysis tools. *** ## What Is the Token API? The Token API lets you query: * **Balances** - Token holdings for any wallet address * **Transfers** - Transfer history by wallet or token contract * **Prices** - Real-time and historical token prices * **Holders** - Token holder lists and distribution analytics * **Swaps** - DEX trading activity and swap history * **Liquidity** - Trading pairs, reserves, and liquidity data * **Metadata** - Token details including name, symbol, decimals, and logo *** ## Key Features * **Real-Time Prices** - Current token prices with USD values * **Historical Data** - Price history and OHLC candlestick data * **Holder Analytics** - Top holders, holder counts, and distribution * **Swap Tracking** - DEX trades with token pairs and values * **Pair Discovery** - Find trading pairs across DEXs * **Token Search** - Search tokens by name or symbol * **Safety Signals** - Token security analysis and risk indicators * **Multi-Chain** - Consistent data across all EVM chains *** ## Common Use Cases * **Trading Platforms**\ (real-time prices, charts, swap history) * **Portfolio Trackers**\ (token balances with USD valuations) * **Token Analytics**\ (holder distribution, volume, liquidity) * **DEX Aggregators**\ (pair discovery, liquidity analysis) * **Wallet Apps**\ (display token holdings and transfers) * **Research Tools**\ (token metrics and safety analysis) *** ## Get Started Explore some of the popular Token API endpoints: * [Token Balances](/data-api/evm/wallet/token-balances) - Get token holdings for a wallet * [Token Search](/data-api/data-features/search-and-discovery/token-search) - Search for tokens * [Token Price](/data-api/evm/price/token-price) - Get current token price * [Token Transfers](/data-api/evm/wallet/token-transfers) - Get transfer history * [Token Metadata](/data-api/evm/token/metadata/token-metadata) - Get token details * [Token Pairs](/data-api/evm/token/swaps/token-pairs) - Get trading pairs # OHLC by Pair Address Source: https://docs.moralis.com/data-api/evm/token/prices/ohlc openapi-files/data-api/api.json GET /pairs/{address}/ohlcv Retrieve OHLCV (Open, High, Low, Close, Volume) candlestick data for a token pair. 📦 **Own this data instead.** Move this endpoint onto your own infrastructure with [Data Feeds](/data-feeds/migration/pair-ohlcv) — the same decoded onchain dataset, in real time, with no per-call limits. > [!WARNING] > > This endpoint requires a **pair address**, not a token address. To find the pair addresses for a token, use the [Token Pairs endpoint](/data-api/evm/token/swaps/token-pairs). # Token Price Source: https://docs.moralis.com/data-api/evm/token/prices/token-price openapi-files/data-api/api.json GET /erc20/{address}/price Retrieve the current or historical price of an ERC20 token in the blockchain’s native currency and USD. Each token returned includes on-chain metadata, as well as off-chain metadata, logos, spam status and more. Additional options to exclude low-liquidity tokens and inactive tokens. > [!TIP] > > To avoid prices from thin or stale pools, set `min_pair_side_liquidity_usd` and `max_token_inactivity`. See [Accurate Net Worth & Token Balances](/data-api/data-features/safety-and-trust/accurate-net-worth-and-balances). 📦 **Own this data instead.** Move this endpoint onto your own infrastructure with [Data Feeds](/data-feeds/migration/erc20-price) — the same decoded onchain dataset, in real time, with no per-call limits. # Token Prices (Batch) Source: https://docs.moralis.com/data-api/evm/token/prices/token-prices-batch openapi-files/data-api/api.json POST /erc20/prices Retrieve the current or historical prices for multiple ERC20 tokens in the blockchain’s native currency and USD. Accepts an array of up to 100 `tokens`, each requiring `token_address` and optional fields such as `to_block` or `exchange`. Each token returned includes on-chain metadata, as well as off-chain metadata, logos, spam status and more. Additional options to exclude low-liquidity tokens and inactive tokens. > [!TIP] > > To avoid prices from thin or stale pools, set `min_pair_side_liquidity_usd` and `max_token_inactivity`. See [Accurate Net Worth & Token Balances](/data-api/data-features/safety-and-trust/accurate-net-worth-and-balances). 📦 **Own this data instead.** Move this endpoint onto your own infrastructure with [Data Feeds](/data-feeds/migration/erc20-prices) — the same decoded onchain dataset, in real time, with no per-call limits. # Top Traders by Token Source: https://docs.moralis.com/data-api/evm/token/signals/top-traders openapi-files/data-api/api.json GET /erc20/{address}/top-gainers List the most profitable wallets that have traded a specific ERC20 token. \> [accordion] Supported Chains (Beta) \> \> This endpoint currently supports \> chain: \> \> \> \> \>
ChainQuery Params
> [!WARNING] > > We recommend using the new [Top Traders by Token](/data-api/universal/pnl/top-traders) endpoint on the Universal API - broader chain coverage, a selectable ranking metric, and low-liquidity filters. # Pair Stats Source: https://docs.moralis.com/data-api/evm/token/swaps/pair-stats openapi-files/data-api/api.json GET /pairs/{address}/stats Access key statistics for a token pair, such as price, buyers, sellers, liquidity, volume and more. # Pair Swaps Source: https://docs.moralis.com/data-api/evm/token/swaps/pair-swaps openapi-files/data-api/api.json GET /pairs/{address}/swaps Fetch swap transactions (buy, sell, add/remove liquidity) for a specific token pair. # Token Pairs Source: https://docs.moralis.com/data-api/evm/token/swaps/token-pairs openapi-files/data-api/api.json GET /erc20/{token_address}/pairs List supported trading pairs for a specific ERC20 token. Each pair returned includes price, liquidity, volume and more. 📦 **Own this data instead.** Move this endpoint onto your own infrastructure with [Data Feeds](/data-feeds/migration/token-pairs) — the same decoded onchain dataset, in real time, with no per-call limits. # Token Swaps Source: https://docs.moralis.com/data-api/evm/token/swaps/token-swaps openapi-files/data-api/api.json GET /erc20/{address}/swaps Get all swap transactions (buy/sell) for a specific ERC20 token. # Wallet Swaps Source: https://docs.moralis.com/data-api/evm/token/swaps/wallet-swaps openapi-files/data-api/api.json GET /wallets/{address}/swaps List all swap transactions (buy/sell) for a specific wallet. Optionally filter by `tokenAddress` for specific token swaps. 📦 **Own this data instead.** Move this endpoint onto your own infrastructure with [Data Feeds](/data-feeds/migration/wallet-swaps) — the same decoded onchain dataset, in real time, with no per-call limits. # Token Transfers by Contract Source: https://docs.moralis.com/data-api/evm/token/transfers/token-transfers openapi-files/data-api/api.json GET /erc20/{address}/transfers Get all ERC20 token transfers for a contract, ordered by block number (newest first). 📦 **Own this data instead.** Move this endpoint onto your own infrastructure with [Data Feeds](/data-feeds/migration/token-transfers) — the same decoded onchain dataset, in real time, with no per-call limits. # Token Approvals Source: https://docs.moralis.com/data-api/evm/wallet/approvals openapi-files/data-api/api.json GET /wallets/{address}/approvals List active ERC20 token approvals for a wallet, showing which contracts have access. 📦 **Own this data instead.** Move this endpoint onto your own infrastructure with [Data Feeds](/data-feeds/migration/wallet-approvals) — the same decoded onchain dataset, in real time, with no per-call limits. # Wallet Chain Activity Source: https://docs.moralis.com/data-api/evm/wallet/chain-activity openapi-files/data-api/api.json GET /wallets/{address}/chains List the blockchain networks a wallet is active on, including their first and last seen timestamps. Options to query cross-chain using the `chains` parameter. 📦 **Own this data instead.** Move this endpoint onto your own infrastructure with [Data Feeds](/data-feeds/migration/wallet-chains) — the same decoded onchain dataset, in real time, with no per-call limits. # Wallet Transactions (Decoded) Source: https://docs.moralis.com/data-api/evm/wallet/decoded-transactions openapi-files/data-api/api.json GET /{address}/verbose Get ABI-decoded native transactions ordered by block number in descending order. # Detailed Positions Source: https://docs.moralis.com/data-api/evm/wallet/detailed-positions openapi-files/data-api/api-v1.json GET /v1/wallets/{walletAddress}/defi/{protocol}/positions Returns DeFi positions for a wallet address filtered by a specific protocol across specified chains. # Resolve ENS Domain from Address Source: https://docs.moralis.com/data-api/evm/wallet/ens-lookup openapi-files/data-api/api.json GET /resolve/{address}/reverse Convert an Ethereum address to its associated ENS domain, if registered. # Detailed Positions Source: https://docs.moralis.com/data-api/evm/wallet/legacy/detailed-positions openapi-files/data-api/api.json GET /wallets/{address}/defi/{protocol}/positions Fetch detailed DeFi positions for a given wallet and protocol. # Wallet Positions Source: https://docs.moralis.com/data-api/evm/wallet/legacy/wallet-positions openapi-files/data-api/api.json GET /wallets/{address}/defi/positions Get a concise overview of a wallet’s DeFi positions across all protocols. # Wallet Protocols Source: https://docs.moralis.com/data-api/evm/wallet/legacy/wallet-protocols openapi-files/data-api/api.json GET /wallets/{address}/defi/summary Summarize a wallet’s DeFi activity, including total USD value, unclaimed rewards and active protocols. # Native Balance Source: https://docs.moralis.com/data-api/evm/wallet/native-balance openapi-files/data-api/api.json GET /{address}/balance Check the native token balance (e.g. ETH) for a specific wallet. 📦 **Own this data instead.** Move this endpoint onto your own infrastructure with [Data Feeds](/data-feeds/migration/native-balance) — the same decoded onchain dataset, in real time, with no per-call limits. # Native Balance (Batch) Source: https://docs.moralis.com/data-api/evm/wallet/native-balances-batch openapi-files/data-api/api.json GET /wallets/balances Retrieve native token balances (e.g. ETH) for one or many wallet addresses in single request. > [!NOTE] > > **Endpoint cost:** 10 CUs per wallet. [Learn more about compute units](/data-api/pricing). # Wallet Net Worth Source: https://docs.moralis.com/data-api/evm/wallet/net-worth openapi-files/data-api/api.json GET /wallets/{address}/net-worth Calculate the total net worth of a wallet in USD, with options to exclude spam tokens for accuracy. Options to query cross-chain using the `chains` parameter, as well as additional options to exclude spam tokens, low-liquidity tokens and inactive tokens. > [!TIP] > > Net worth inflated by spam or mispriced tokens? Set `exclude_spam`, `min_pair_side_liquidity_usd` and `max_token_inactivity`. They're all off by default. See [Accurate Net Worth & Token Balances](/data-api/data-features/safety-and-trust/accurate-net-worth-and-balances) for recommended values. 📦 **Own this data instead.** Move this endpoint onto your own infrastructure with [Data Feeds](/data-feeds/migration/wallet-networth) — the same decoded onchain dataset, in real time, with no per-call limits. # NFT Balances Source: https://docs.moralis.com/data-api/evm/wallet/nft-balances openapi-files/data-api/api.json GET /{address}/nft Fetch all NFTs held by a specified wallet address. Use `token_addresses` to filter by one or many specific contract(s). Each NFT returned includes on-chain metadata as well as off-chain metadata, floor prices, rarity and more where available. 📦 **Own this data instead.** Move this endpoint onto your own infrastructure with [Data Feeds](/data-feeds/migration/wallet-nfts) — the same decoded onchain dataset, in real time, with no per-call limits. # NFT Collections Source: https://docs.moralis.com/data-api/evm/wallet/nft-collections openapi-files/data-api/api.json GET /{address}/nft/collections Fetch all NFT Collections held by a specified wallet address. Each Collection returned includes on-chain metadata as well as off-chain metadata, floor prices and more where available. 📦 **Own this data instead.** Move this endpoint onto your own infrastructure with [Data Feeds](/data-feeds/migration/wallet-nft-collections) — the same decoded onchain dataset, in real time, with no per-call limits. # NFT Trades Source: https://docs.moralis.com/data-api/evm/wallet/nft-trades-by-wallet openapi-files/data-api/api.json GET /wallets/{address}/nfts/trades Get NFT trades for a specific wallet address. # NFT Transfers Source: https://docs.moralis.com/data-api/evm/wallet/nft-transfers openapi-files/data-api/api.json GET /{address}/nft/transfers Get NFT transfers for a wallet, with filters like `contract_addresses` and other parameters. Supports ERC-721, ERC-1155 as well as custom contracts such as CryptoPunks and CryptoKitties. 📦 **Own this data instead.** Move this endpoint onto your own infrastructure with [Data Feeds](/data-feeds/migration/wallet-nft-transfers) — the same decoded onchain dataset, in real time, with no per-call limits. # Wallet API Source: https://docs.moralis.com/data-api/evm/wallet/overview A unified Wallet API to fetch balances, transfers, DeFi positions, PnL, NFTs, and fully decoded wallet activity across multiple chains. ## Overview The **Wallet API** provides complete wallet intelligence across all activity types - tokens, NFTs, DeFi positions, swaps, and P\&L tracking. Instead of querying multiple endpoints and aggregating data yourself, the Wallet API gives you a unified view of any wallet's holdings, history, and financial performance across chains. *** ## What Is the Wallet API? The Wallet API lets you query everything about a wallet address: * **Asset Holdings** - Token balances, NFT collections, and ownership data * **Transaction History** - Raw and decoded transactions with human-readable labels * **DeFi Positions** - Protocol exposure across lending, staking, and liquidity pools * **Financial Metrics** - Net worth calculations and profit/loss tracking * **Identity** - ENS name resolution and address labels * **Approvals** - Token allowances granted to contracts *** ## Key Features The Wallet API includes: * **Decoded Transactions** - Human-readable transaction labels and summaries * **Multi-Chain Support** - Query across all supported EVM chains * **Net Worth Calculation** - Aggregate USD value of all holdings * **P\&L Tracking** - Realized and unrealized profit/loss per token * **Swap History** - DEX trading activity with token pairs and values * **NFT Trades** - Marketplace activity including buys, sells, and listings * **Chain Activity** - Identify which chains a wallet is active on *** ## Common Use Cases The Wallet API is commonly used for: * **Portfolio Trackers**\ (display holdings, value, and performance) * **Wallet Explorers**\ (transaction history and activity feeds) * **DeFi Dashboards**\ (show positions across protocols) * **Tax Tools**\ (calculate gains/losses from trading) * **Security Apps**\ (monitor approvals and revoke permissions) * **Identity Resolution**\ (resolve ENS names and wallet labels) *** ## Popular Endpoints | Endpoint | Description | | - | - | | [Wallet History](/data-api/evm/wallet/wallet-history) | Complete decoded activity feed | | [Token Balances](/data-api/evm/wallet/token-balances) | Current ERC-20 holdings | | [NFT Balances](/data-api/evm/wallet/nft-balances) | Current NFT holdings | | [Net Worth](/data-api/evm/wallet/net-worth) | Total wallet value in USD | | [Wallet P\&L](/data-api/evm/wallet/wallet-pnl) | Profit/loss per token | | [Decoded Transactions](/data-api/evm/wallet/decoded-transactions) | Human-readable transaction data | *** ## Get Started Explore some of the popular Wallet API endpoints: * [Token Balances](/data-api/evm/wallet/token-balances) * [NFT Balances](/data-api/evm/wallet/nft-balances) * [Wallet History](/data-api/evm/wallet/wallet-history) * [Net Worth](/data-api/evm/wallet/net-worth) # Resolve Address from ENS Domain Source: https://docs.moralis.com/data-api/evm/wallet/resolve-address openapi-files/data-api/api.json GET /resolve/ens/{domain} Resolve an ENS domain to its associated Ethereum address. # Token Balances Source: https://docs.moralis.com/data-api/evm/wallet/token-balances openapi-files/data-api/api.json GET /wallets/{address}/tokens Fetch ERC20 and native token balances for a given wallet address, including their USD prices. Each token returned includes on-chain metadata, as well as off-chain metadata, logos, spam status and more. Additional options to exclude spam tokens, low-liquidity tokens and inactive tokens. > [!TIP] > > Seeing spam tokens or inflated USD values? Set `exclude_spam`, `min_pair_side_liquidity_usd` and `max_token_inactivity`. They're all off by default. See [Accurate Net Worth & Token Balances](/data-api/data-features/safety-and-trust/accurate-net-worth-and-balances) for recommended values. 📦 **Own this data instead.** Move this endpoint onto your own infrastructure with [Data Feeds](/data-feeds/migration/wallet-tokens) — the same decoded onchain dataset, in real time, with no per-call limits. # Token Balances (Legacy) Source: https://docs.moralis.com/data-api/evm/wallet/token-balances-legacy openapi-files/data-api/api.json GET /{address}/erc20 Get an unpaginated list of token balances, without token prices, for a specific wallet address. Maximum of 2,000 tokens. Each token returned includes on-chain metadata, as well as off-chain metadata, logos, spam status and more. 📦 **Own this data instead.** Move this endpoint onto your own infrastructure with [Data Feeds](/data-feeds/migration/wallet-erc20) — the same decoded onchain dataset, in real time, with no per-call limits. > [!WARNING] > > We recommended using the latest [Token Balances](/data-api/evm/wallet/token-balances) endpoint. # Token Transfers Source: https://docs.moralis.com/data-api/evm/wallet/token-transfers openapi-files/data-api/api.json GET /{address}/erc20/transfers Get all ERC20 token transfers for a given wallet address, sorted by block number (newest first). 📦 **Own this data instead.** Move this endpoint onto your own infrastructure with [Data Feeds](/data-feeds/migration/wallet-erc20-transfers) — the same decoded onchain dataset, in real time, with no per-call limits. # Wallet History Source: https://docs.moralis.com/data-api/evm/wallet/wallet-history openapi-files/data-api/api.json GET /wallets/{address}/history Get the complete decoded transaction history for a given wallet. All transactions are parsed, decoded, categorized and summarized into human-readable records. 📦 **Own this data instead.** Move this endpoint onto your own infrastructure with [Data Feeds](/data-feeds/migration/wallet-history) — the same decoded onchain dataset, in real time, with no per-call limits. # Wallet Insights Source: https://docs.moralis.com/data-api/evm/wallet/wallet-insights openapi-files/data-api/api.json GET /wallets/{address}/insight Retrieve comprehensive wallet insight metrics including activity age, transfer counts, counterparties, and swap volume. \> [accordion] Supported Chains (Beta) \> \> This endpoint currently supports \> chain: \> \> \> \> \>
ChainQuery Params
# Wallet PnL Breakdown Source: https://docs.moralis.com/data-api/evm/wallet/wallet-pnl openapi-files/data-api/api.json GET /wallets/{address}/profitability Get a detailed profit and loss breakdown by token for a given wallet, over a specified timeframe (`days`). Optionally filter by `token_addresses` for specific tokens. \> [accordion] Supported Chains (Beta) \> \> This endpoint currently supports \> chain: \> \> \> \> \>
ChainQuery Params
> [!WARNING] > > We recommend using the new multi-chain [Wallet PnL](/data-api/universal/pnl/wallet-pnl) endpoint on the Universal API - same profitability data, multiple chains in a single request. # Wallet PnL Summary Source: https://docs.moralis.com/data-api/evm/wallet/wallet-pnl-summary openapi-files/data-api/api.json GET /wallets/{address}/profitability/summary Get a profit and loss summary for a given wallet, over a specified timeframe (`days`). \> [accordion] Supported Chains (Beta) \> \> This endpoint currently supports \> chain: \> \> \> \> \>
ChainQuery Params
> [!WARNING] > > We recommend using the new multi-chain [Wallet PnL Summary](/data-api/universal/pnl/wallet-pnl-summary) endpoint on the Universal API - same summary data, multiple chains in a single request. # Wallet Positions Source: https://docs.moralis.com/data-api/evm/wallet/wallet-positions openapi-files/data-api/api-v1.json GET /v1/wallets/{walletAddress}/defi/positions Returns all DeFi positions (lending, liquidity, staking) for a wallet address across specified chains in a unified schema. # Wallet Protocols Source: https://docs.moralis.com/data-api/evm/wallet/wallet-protocols openapi-files/data-api/api-v1.json GET /v1/wallets/{walletAddress}/defi/summary Returns a summary of all DeFi positions for a wallet address across specified chains. # Wallet Stats Source: https://docs.moralis.com/data-api/evm/wallet/wallet-stats openapi-files/data-api/api.json GET /wallets/{address}/stats Retrieve key statistics for a wallet, such as total transaction count and activity. 📦 **Own this data instead.** Move this endpoint onto your own infrastructure with [Data Feeds](/data-feeds/migration/wallet-stats) — the same decoded onchain dataset, in real time, with no per-call limits. # Wallet Swaps Source: https://docs.moralis.com/data-api/evm/wallet/wallet-swaps openapi-files/data-api/api.json GET /wallets/{address}/swaps List all swap transactions (buy/sell) for a specific wallet. Optionally filter by `tokenAddress` for specific token swaps. 📦 **Own this data instead.** Move this endpoint onto your own infrastructure with [Data Feeds](/data-feeds/migration/wallet-swaps) — the same decoded onchain dataset, in real time, with no per-call limits. # Wallet Transactions (Raw) Source: https://docs.moralis.com/data-api/evm/wallet/wallet-transactions openapi-files/data-api/api.json GET /{address} Get raw native transactions ordered by block number in descending order. 📦 **Own this data instead.** Move this endpoint onto your own infrastructure with [Data Feeds](/data-feeds/migration/wallet-native-txns) — the same decoded onchain dataset, in real time, with no per-call limits. # Make Your First Request Source: https://docs.moralis.com/data-api/first-request Learn how to get started with the Moralis Data API. ### Your first request Let's make your first request using the [Wallet API](/data-api/evm/wallet/overview).\ In this example, we'll retrieve **token balances** for a wallet on Ethereum - including **formatted balances, USD values, prices, and metadata** - with a single API call using [Token Balances](/data-api/evm/wallet/token-balances). ### What we'll fetch * All ERC-20 and native token balances for a wallet * Enriched data such as token metadata, prices, and USD values * Normalized output you can use directly in apps or dashboards ### Make the request ```bash cURL theme={null} curl --request GET \ --url 'https://deep-index.moralis.io/api/v2.2/wallets/0xcB1C1FdE09f811B294172696404e88E658659905/tokens?chain=eth' \ --header 'X-API-Key: YOUR_API_KEY' ``` > [!NOTE] > > Replace `YOUR_API_KEY` with the API key from your [Moralis dashboard](/data-api/get-your-api-key). ### Response The API returns a JSON object containing the wallet's token balances. Each entry includes balances, prices, USD values, and security metadata. ```json Response (JSON) expandable theme={null} { "cursor": null, "page": 0, "page_size": 100, "block_number": 23998783, "result": [ { "token_address": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee", "symbol": "ETH", "name": "Ether", "logo": "https://cdn.moralis.io/eth/0x.png", "thumbnail": "https://cdn.moralis.io/eth/0x_thumb.png", "decimals": 18, "balance": "1709495362615127", "possible_spam": false, "verified_contract": true, "total_supply": null, "total_supply_formatted": null, "percentage_relative_to_total_supply": null, "security_score": 99, "balance_formatted": "0.001709495362615127", "usd_price": 3074.275584969874, "usd_price_24hr_percent_change": -4.046936070446101, "usd_price_24hr_usd_change": -129.54660056550028, "usd_value": 5.255459855906907, "usd_value_24hr_usd_change": -0.22145931290927692, "native_token": true, "portfolio_percentage": 57.264259068625606 }, { "token_address": "0x4fabb145d64652a948d72533023f6e7a623c7c53", "symbol": "BUSD", "name": "BUSD", "logo": "https://logo.moralis.io/0x1_0x4fabb145d64652a948d72533023f6e7a623c7c53_05b49a8d713a42d99fc194279df539e7.png", "thumbnail": "https://logo.moralis.io/0x1_0x4fabb145d64652a948d72533023f6e7a623c7c53_05b49a8d713a42d99fc194279df539e7.png", "decimals": 18, "balance": "2102143890000000000", "possible_spam": false, "verified_contract": true, "total_supply": "55026240205945520000000000", "total_supply_formatted": "55026240.20594552", "percentage_relative_to_total_supply": 0.000003820257175726, "security_score": 76, "balance_formatted": "2.10214389", "usd_price": 0.9966474180866458, "usd_price_24hr_percent_change": -0.33116797769114314, "usd_price_24hr_usd_change": -0.0033115438720600077, "usd_value": 2.0950962804151176, "usd_value_24hr_usd_change": -0.006961341717117886, "native_token": false, "portfolio_percentage": 22.82847542647662 }, {}, {} ] } ``` ### What you get With a single request, Moralis provides: * **Low-latency access** to onchain wallet data * **Normalized balances** across tokens * **Enriched pricing and USD values** * **Token metadata and security signals** * Production-ready responses for apps and analytics No RPC calls, no custom indexing, no manual price joins. ### Next steps * Explore more endpoints in the **Wallet API** * Fetch **NFT balances** or **transaction history** * Combine with **Streams** to react to wallet activity in real time * Use **Data Feeds** for large-scale analytics # Get Your API Key Source: https://docs.moralis.com/data-api/get-your-api-key Learn how to get your Moralis API Key To start using Moralis products, you’ll need an API key to authenticate your requests. Follow this quick guide to create your account and retrieve your API key- then you'll be ready to make your [first request](/data-api/first-request). ## 1. Create Your Account Create your **Moralis account** by visiting the [Moralis Dashboard](https://admin.moralis.com/register). ![Create Account Web](https://mintcdn.com/moralis/z0RKSaPe_EdRhxsG/images/moralis-login.png?fit=max\&auto=format\&n=z0RKSaPe_EdRhxsG\&q=85\&s=5a6bc8dfdb01397425ec88b49d4bdf0a) ## 2. Navigate to Data APIs Once registered, navigate to the [Data APIs section](https://admin.moralis.com/data-api) in the dashboard. ![Moralis Dashboard](https://mintcdn.com/moralis/z0RKSaPe_EdRhxsG/images/moralis-dashboard.png?fit=max\&auto=format\&n=z0RKSaPe_EdRhxsG\&q=85\&s=c94279f9375fad567c87872171cff4ea) ## 3. Copy Your API Key Click the **copy** icon next to your API key to add it to your clipboard. ![Moralis Data APIs](https://mintcdn.com/moralis/z0RKSaPe_EdRhxsG/images/moralis-data-api.png?fit=max\&auto=format\&n=z0RKSaPe_EdRhxsG\&q=85\&s=3c729d301882d20c8eff1bb961e0f025) ## 4. Manage API keys (optional) You can also manage your keys from the **API Keys** section - including creating new keys or rotating existing ones. ![Moralis Api Keys Pn](https://mintcdn.com/moralis/z0RKSaPe_EdRhxsG/images/moralis-api-keys.png?fit=max\&auto=format\&n=z0RKSaPe_EdRhxsG\&q=85\&s=a5bc1c4c72a465c3d47eb872fa164648) That's it - you're now ready to make your [first API request](/data-api/first-request) # Performance Source: https://docs.moralis.com/data-api/introduction/resources/performance-and-reliability Performance characteristics of Moralis APIs, including latency percentiles, supported request rates, data freshness, uptime, and enterprise SLAs. This page outlines the **real-world performance characteristics** of Moralis APIs, including **latency**, **request throughput**, **data freshness**, and **availability**. The figures below reflect typical production behavior under normal load and are intended to help teams design and operate reliable systems. *** ## API Latency Moralis APIs are optimized for **low-latency, high-throughput** access to blockchain data. Typical response times across core read endpoints: | Percentile | Latency | | :- | :- | | **p50** | **\< 50 ms** | | **p90** | **\< 500 ms** | | **p95** | **\< 1 s** | Latency may vary based on: * Endpoint complexity * Chain and network conditions * Result size and pagination * Applied enrichment (decoding, pricing, analytics) *** ## Throughput & Request Rates Moralis supports **high sustained request volumes** for production workloads. * **1,000+ requests per second (RPS)** is supported on appropriate plans * Throughput is governed by **Compute Units (CUs)** and plan-level limits * Short bursts are supported within rolling rate-limit windows * Enterprise customers can request **custom throughput limits** and dedicated capacity For plan-specific limits, see: * [**Rate Limits**](/data-api/resources/rate-limits) * [**Pricing**](/data-api/pricing) *** ## Data Freshness Data freshness reflects how quickly new on-chain activity becomes available via the API. Typical freshness for indexed on-chain data: | Percentile | Freshness | | :- | :- | | **p50** | **\< 4 s** | | **p90** | **\< 8 s** | Notes: * Blocks, transactions, and transfers are indexed near real time * Price and market data update continuously * Derived metrics (holders, analytics, PnL) may lag slightly during periods of high activity *** ## Availability & Uptime Moralis operates production infrastructure **24/7/365**. * **Enterprise customers** are supported with a **24/7/365 SLA** * Platform uptime and incident history are publicly available at:\ [**status.moralis.io**](https://status.moralis.io) # Premium Endpoints Source: https://docs.moralis.com/data-api/introduction/resources/premium-endpoints Endpoints that require a paid plan to access. ## Overview Premium endpoints provide access to advanced analytics, market metrics, token discovery, and DeFi features. These endpoints require an API key on the plan listed for each endpoint or above. *** ## DeFi API | Endpoint | Method | Path | Required Plan | CUs | | - | - | - | - | - | | Wallet Protocols ([EVM](/data-api/evm/defi/wallet-protocols), [Solana](/data-api/solana/defi/wallet-protocols)) | GET | `/v1/wallets/{walletAddress}/defi/summary` | Starter | 5000 | | Wallet Positions ([EVM](/data-api/evm/defi/wallet-positions), [Solana](/data-api/solana/defi/wallet-positions)) | GET | `/v1/wallets/{walletAddress}/defi/positions` | Starter | 5000 | | Detailed Positions ([EVM](/data-api/evm/defi/wallet-positions-detailed), [Solana](/data-api/solana/defi/wallet-positions-detailed)) | GET | `/v1/wallets/{walletAddress}/defi/{protocol}/positions` | Starter | 5000 | *** ## Wallet | Endpoint | Method | Path | Required Plan | CUs | | - | - | - | - | - | | [Wallet Insights](/data-api/evm/wallet/wallet-insights) | GET | `/wallets/{address}/insight` | Pro | 100 | *** ## Entity API | Endpoint | Method | Path | Required Plan | CUs | | - | - | - | - | - | | [Entity Search](/data-api/universal/entity/endpoints/entity-search) | GET | `/entities/search` | Pro | 50 | | [Get Entity](/data-api/universal/entity/endpoints/entity-by-id) | GET | `/entities/{entityId}` | Pro | 50 | | [Get Entities by Category](/data-api/universal/entity/endpoints/entity-by-category) | GET | `/entities/categories/{categoryId}` | Pro | 50 | | [Get Entity Categories](/data-api/universal/entity/endpoints/entity-categories) | GET | `/entities/categories` | Pro | 10 | *** ## Token Analytics | Endpoint | Method | Path | Required Plan | CUs | | - | - | - | - | - | | [Token Score](/data-api/evm/token/metadata/token-score) | GET | `/tokens/{tokenAddress}/score` | Pro | 100 | | [Token Score - Timeseries](/data-api/evm/token/metadata/token-score-timeseries) | GET | `/tokens/{tokenAddress}/score/historical` | Pro | 150 | | [Token Analytics (Batch)](/data-api/universal/token/analytics/token-analytics-multi) | POST | `/tokens/analytics` | Pro | 150 | | [Token Analytics - Timeseries](/data-api/universal/token/analytics/token-analytics-timeseries) | POST | `/tokens/analytics/timeseries` | Pro | 200 | *** ## Token Discovery | Endpoint | Method | Path | Required Plan | CUs | | - | - | - | - | - | | [Token Search](/data-api/universal/token/search/token-search) | GET | `/tokens/search` | Pro | 150 | | [Token Categories](/data-api/evm/token/discovery/token-categories) | GET | `/tokens/categories` | Pro | 10 | | [Trending Tokens](/data-api/universal/token/trending-tokens) | GET | `/tokens/trending` | Pro | 150 | *** ## Upgrade Your Plan To access premium endpoints, upgrade your plan at [admin.moralis.com](https://admin.moralis.com). # Onchain Skills Source: https://docs.moralis.com/data-api/onchain-skills/overview Give your AI agent the ability to query blockchain data using Moralis APIs. Works with Claude Code, Cursor, Windsurf, GitHub Copilot, Cline, Codex, Gemini, and more. ![Installing Moralis Onchain Skills via npx skills add novnski/onchain-skills](https://mintcdn.com/moralis/oDmu2DlHpqHBO5U7/images/onchain-skills-install.png?fit=max\&auto=format\&n=oDmu2DlHpqHBO5U7\&q=85\&s=841f5073bae8f45e67c86f9ad5280f5e) ## What are Onchain Skills? Onchain Skills is an open-source package that lets AI agents call the [Moralis API](https://admin.moralis.com/register) directly — giving them the ability to query blockchain data from 40+ EVM chains and Solana in real time. It works with any agent that supports the [Agent Skills](https://skills.sh/) standard, including **Claude Code, Cursor, Windsurf, GitHub Copilot, Cline, Codex, Gemini**, and 18+ others. [Build Web3 Apps With AI Using Real Onchain Data | Moralis Onchain Skills](https://www.youtube.com/embed/hq-SlxYji4w) *** ## Quick Start ### 1. Install the Skills ```bash theme={null} npx skills add novnski/onchain-skills ``` ### 2. Set Your API Key Get your key from [admin.moralis.com](https://admin.moralis.com/register), then add it to a `.env` file in your project root: ```bash theme={null} echo "MORALIS_API_KEY=your_key_here" >> .env ``` That's it — your AI agent can now query blockchain data through Moralis. *** ## Skills Overview Onchain Skills includes three skills: | Skill | Description | Endpoints | | - | - | - | | **moralis-data-api** | EVM + Solana blockchain data | 136 | | **moralis-streams-api** | Real-time event monitoring with webhooks | 20 | | **learn-moralis** | Routing, FAQ, pricing, and capability guidance | — | ### moralis-data-api Unified skill for all blockchain data queries. Auto-detects EVM vs Solana from address format. For EVM addresses without a specified chain, defaults to Ethereum. **136 endpoints** (102 EVM + 34 Solana) across these categories: * **Wallet** (17) — balances, tokens, NFTs, history, profitability, net worth * **Token** (22) — prices, metadata, pairs, DEX swaps, analytics, security scores * **NFT** (22) — metadata, transfers, traits, rarity, floor prices, trades * **DeFi** (3) — protocol positions, liquidity, exposure * **Entity** (2) — labeled addresses (exchanges, funds, whales) * **Price** (4) — OHLCV, token prices, pair prices * **Blockchain** (5) — blocks, transactions, date-to-block * **Discovery** (13) — trending tokens * **Other** (14) — address resolution, token search, candlesticks * **Solana** (34) — native Solana endpoints + EVM endpoints with Solana support **Example prompts:** ``` /moralis-data-api Get the balance of 0x1234... /moralis-data-api Get the balance of 0x1234... on Polygon /moralis-data-api Get the balance of Solana wallet ABC123... ``` ### moralis-streams-api Real-time blockchain event monitoring with webhooks. **20 endpoints** for creating, managing, and monitoring streams. **Stream types:** `tx`, `log`, `erc20transfer`, `erc20approval`, `nfttransfer`, `internalTx` **Example prompts:** ``` /moralis-streams-api Create a stream to monitor all ERC20 transfers on Ethereum /moralis-streams-api Pause the stream with ID abc123 ``` ### learn-moralis Knowledge-only skill for answering general questions about Moralis. Routes you to the correct technical skill after answering. **Example prompts:** ``` /learn-moralis What is Moralis? /learn-moralis Which Moralis API should I use for tracking wallet activity? ``` *** ## Supported Chains **EVM (40+):** Ethereum, Polygon, BNB Smart Chain, Arbitrum, Optimism, Avalanche, Base, Sei, Monad, and more. **Solana:** Mainnet and Devnet. For the full list of supported chains, see [Supported Chains](/get-started/supported-chains). *** ## Architecture * **Zero dependencies** — all API calls use curl * **Works with 18+ agents** — any agent supporting the Agent Skills standard * **Auto-detects chain** — determines EVM vs Solana from address format *** ## Resources * [GitHub Repository](https://github.com/novnski/onchain-skills) * [Get an API Key](https://admin.moralis.com/register) * [Agent Skills Standard](https://skills.sh/) * [Video Tutorial: Build Web3 Apps With AI Using Real Onchain Data](https://www.youtube.com/watch?v=hq-SlxYji4w) # Tutorial Source: https://docs.moralis.com/data-api/onchain-skills/tutorial Step-by-step guide to installing and using Moralis Onchain Skills with your AI agent. ## Video Tutorial Watch the full walkthrough on setting up and using Onchain Skills to build Web3 apps with AI: [Build Web3 Apps With AI Using Real Onchain Data | Moralis Onchain Skills](https://www.youtube.com/embed/hq-SlxYji4w) *** ## Prerequisites * **Node.js** installed on your machine * A **Moralis API key** — get one at [admin.moralis.com](https://admin.moralis.com/register) * An AI agent that supports the [Agent Skills](https://skills.sh/) standard (e.g., Claude Code, Cursor, Windsurf, GitHub Copilot, Cline, Codex, Gemini) *** ## Step 1: Install Onchain Skills Run the following command in your project directory: ```bash theme={null} npx skills add novnski/onchain-skills ``` ![Installing Moralis Onchain Skills via npx skills add novnski/onchain-skills](https://mintcdn.com/moralis/oDmu2DlHpqHBO5U7/images/onchain-skills-install.png?fit=max\&auto=format\&n=oDmu2DlHpqHBO5U7\&q=85\&s=841f5073bae8f45e67c86f9ad5280f5e) This installs three skills into your project: * **moralis-data-api** — query blockchain data (136 endpoints) * **moralis-streams-api** — real-time event monitoring (20 endpoints) * **learn-moralis** — general Moralis knowledge and routing ### Alternative Installation Methods **Via [ClawHub](https://clawhub.ai/):** ```bash theme={null} clawhub install moralis-data-api clawhub install moralis-streams-api clawhub install learn-moralis ``` **Via OpenClaw agent:** If you have an [OpenClaw](https://openclaw.ai/) agent running, ask it to search for and install the Moralis API skills from ClawHub. *** ## Step 2: Configure Your API Key Add your Moralis API key to a `.env` file in your project root: ```bash theme={null} echo "MORALIS_API_KEY=your_key_here" >> .env ``` Replace `your_key_here` with your actual API key from [admin.moralis.com](https://admin.moralis.com/register). > [!NOTE] > > Without the API key, the skills cannot call the Moralis API on your behalf. **For OpenClaw users**, add the key to the `env` section in `~/.openclaw/openclaw.json` instead: ```json theme={null} { "env": { "MORALIS_API_KEY": "your_key_here" } } ``` *** ## Step 3: Start Using Skills Once installed and configured, you can prompt your AI agent with skill-specific commands. Prefix your prompt with the skill name to load it directly. ### Query Blockchain Data ``` /moralis-data-api Get the token balances of 0x1234... ``` ``` /moralis-data-api What are the top trending tokens on Ethereum? ``` ``` /moralis-data-api Get the NFT collections owned by 0x1234... ``` ### Monitor Real-Time Events ``` /moralis-streams-api Create a stream to monitor all ERC20 transfers on Ethereum ``` ``` /moralis-streams-api List all my active streams ``` ### Ask General Questions ``` /learn-moralis What chains does Moralis support? ``` ``` /learn-moralis Which API should I use for tracking wallet activity? ``` *** ## What's Next? * Explore the full list of available endpoints in the [Onchain Skills Overview](/data-api/onchain-skills/overview) * Browse the [EVM API](/data-api/evm) and [Solana API](/data-api/solana) documentation for detailed endpoint references * Check out the [GitHub repository](https://github.com/novnski/onchain-skills) for source code and contributions # Data API Source: https://docs.moralis.com/data-api/overview The universal multichain Data API provides a single, consistent interface for accessing blockchain data across 30+ supported chains, including Ethereum, Solana, Bitcoin, Base, Binance Smart Chain, and more. It standardizes complex on-chain data into clean, developer-friendly formats. ### How it's structured The Data API is made up of **four core components**, designed to balance **cross-chain consistency** with **chain-specific depth**: #### Universal API Our [Universal API](/data-api/universal/overview) supports cross-chain endpoints that work across **EVM, Solana, and Bitcoin**, using unified schemas wherever possible. Ideal for applications that need to support multiple chains without maintaining separate integrations. #### EVM API The [EVM API](/data-api/evm/overview) offers deep, EVM-specific APIs covering Ethereum and EVM-compatible chains, exposing rich transaction, token, NFT, DeFi, and contract-level data. #### Solana API Our [Solana API](/data-api/solana/overview) provides parsed, high-performance access to Solana transactions, programs, token accounts, and NFTs, designed around Solana’s unique architecture. #### Bitcoin API The [Bitcoin API](/data-api/bitcoin/overview) brings full Bitcoin coverage — raw blocks and transactions, BTC market data, address activity, and balances — through the same Universal endpoints used for EVM and Solana. Pass `bitcoin` as the chain, with native xpub support across every wallet endpoint. ### Explore Data APIs > [card] [Wallet API](/data-api/evm/wallet/overview) > > Wallet history, transfers balances, tokens and PnL. > [card] [Token API](/data-api/evm/token/overview) > > Token search, balances, transfers, holders and swaps. > [card] [NFT API](/data-api/evm/nft/overview) > > Metadata, floor prices, transfers and ownership. > [card] [Price API](/data-api/evm/price/overview) > > Real-time crypto prices, OHLC, trading volume. > [card] [DeFi API](/data-api/evm/defi/overview) > > DeFi positions, liquidity, reserves and token pairs. > [card] [Blockchain API](/data-api/evm/blockchain/overview) > > Raw blocks, transactions, internal transactions and logs. ### Types of use cases * Building wallets and portfolio trackers * Powering Web3 dashboards and analytics tools * Supporting multi-chain dApps from a single backend * Tracking wallet activity, balances, and history * Token discovery, monitoring, and market analysis * NFT marketplaces and NFT analytics platforms * DeFi apps showing positions, liquidity, and protocol data * Backend services that need low-latency blockchain reads ### Key features * **Low-latency APIs** optimized for production workloads * **Unified schemas** across EVM, Solana, and Bitcoin where possible * **Decoded and enriched data** (tokens, NFTs, prices, metadata) * **Multi-chain support** across 30+ blockchains * **High throughput & reliability** at scale * **Consistent developer experience** across chains * **Enterprise-grade infrastructure**, SLAs, and security * No RPC management or custom indexer maintenance ### For which teams * **Product teams** building wallets, dashboards, and user-facing apps * **Backend engineers** who need reliable blockchain data without infra overhead * **Frontend teams** consuming clean, predictable APIs * **Analytics teams** accessing structured on-chain data * **Startups and enterprises** scaling multi-chain applications *** ## Data API Overview Video [Moralis Data API Overview – Fetch Onchain Data at Scale](https://www.youtube.com/embed/O8PXFkN71oo) # Data API Pricing Source: https://docs.moralis.com/data-api/pricing Detailed pricing information for our Data API. For a detailed explanation of Compute Units (CUs) and how they work, check out our [Compute Units section](/get-started/pricing). ## Free Trial Moralis doesn't have a self-serve free plan. To try it before you subscribe, request a free trial and the team will reach out. Request a free trial *** ## Universal API Compute Units These endpoints support both EVM and Solana chains. ### Token Discovery & Analytics | Method | CU Cost | | - | - | | [searchTokens](/data-api/universal/token/search/token-search) | 150 | | [getTokenScore](/data-api/universal/token/score/token-score) | 100 | | [getHistoricalTokenScore](/data-api/universal/token/score/token-score-timeseries) | 150 | | [getTokenAnalytics](/data-api/universal/token/analytics/token-analytics) | 80 | | [getMultipleTokenAnalytics](/data-api/universal/token/analytics/token-analytics-multi) | 150 | | [getTimeSeriesTokenAnalytics](/data-api/universal/token/analytics/token-analytics-timeseries) | 200 | | [getTrendingTokens](/data-api/universal/token/trending-tokens) | 150 | ### PnL API | Method | CU Cost | | - | - | | [getWalletProfitability](/data-api/universal/pnl/wallet-pnl) | 50 per requested chain | | [getWalletProfitabilitySummary](/data-api/universal/pnl/wallet-pnl-summary) | 30 per requested chain | | [getTopTradersByToken](/data-api/universal/pnl/top-traders) | 50 | ### Token Prices | Method | CU Cost | | - | - | | [getTokenPriceTimeSeries](/data-api/universal/token/price/token-price-timeseries) | 50 | | [getTokenPriceSparkline](/data-api/universal/token/price/token-price-sparkline) | 50 | ### Entity API | Method | CU Cost | | - | - | | [searchEntities](/data-api/universal/entity/endpoints/entity-search) | 50 | | [getEntity](/data-api/universal/entity/endpoints/entity-by-id) | 50 | | [getEntitiesByCategory](/data-api/universal/entity/endpoints/entity-by-category) | 50 | | [getEntityCategories](/data-api/universal/entity/endpoints/entity-categories) | 10 | *** ## Bitcoin API Compute Units Bitcoin endpoint costs mirror the closest Web3 API endpoint where applicable. Per-chain wallet endpoints are billed once for each requested chain. ### Bitcoin Blockchain API | Method | CU Cost | | - | - | | [getBlockByNumberOrHash](/data-api/bitcoin/blockchain/block) | 100 | | [getTransactionByHash](/data-api/bitcoin/blockchain/transaction) | 10 | ### Bitcoin Price API | Method | CU Cost | | - | - | | [getTokenPrice](/data-api/bitcoin/price/current-price) | 50 | | [getTokenPriceTimeSeries](/data-api/bitcoin/price/historical-price) | 50 | | [getTokenPriceSparkline](/data-api/bitcoin/price/sparkline) | 50 | ### Bitcoin Wallet API | Method | CU Cost | | - | - | | [getWalletHistory](/data-api/bitcoin/wallet/address-transactions) | 150 per chain | | [getTokenBalances](/data-api/bitcoin/wallet/address-balances) | 50 per chain | ### Bitcoin Xpub Utility | Method | CU Cost | | - | - | | [getAddressesByXpub](/data-api/bitcoin/utility/addresses-from-xpub) | 50 | *** ## EVM API Compute Units ### EVM Wallet API | Method | CU Cost | | - | - | | [getWalletHistory](/data-api/evm/wallet/wallet-history) | 150 | | [getWalletStats](/data-api/evm/wallet/wallet-stats) | 50 | | [getWalletActiveChains](/data-api/evm/wallet/chain-activity) | 50 per chain | | [getWalletTokenBalancesPrice](/data-api/evm/wallet/token-balances) | 100 | | [getWalletTokenBalances](/data-api/evm/wallet/token-balances-legacy) | 100 | | [getNativeBalance](/data-api/evm/wallet/native-balance) | 10 | | [getNativeBalancesForAddresses](/data-api/evm/wallet/native-balances-batch) | 10 per wallet | | [getWalletNFTs](/data-api/evm/wallet/nft-balances) | 50 | | [getWalletNFTCollections](/data-api/evm/wallet/nft-collections) | 50 | | [getWalletNFTTransfers](/data-api/evm/wallet/nft-transfers) | 50 | | [getNFTTradesByWallet](/data-api/evm/wallet/nft-trades-by-wallet) | 40 | | [getWalletTokenTransfers](/data-api/evm/wallet/token-transfers) | 50 | | [getWalletTransactions](/data-api/evm/wallet/wallet-transactions) | 30 | | [getWalletTransactionsVerbose](/data-api/evm/wallet/decoded-transactions) | 50 | | [getWalletApprovals](/data-api/evm/wallet/approvals) | 100 | | [getWalletNetWorth](/data-api/evm/wallet/net-worth) | 250 per chain | | [getWalletProfitability](/data-api/evm/wallet/wallet-pnl) | 50 | | [getWalletProfitabilitySummary](/data-api/evm/wallet/wallet-pnl-summary) | 30 | | [getDefiSummary](/data-api/evm/wallet/wallet-protocols) | 5000 | | [getDefiPositionsSummary](/data-api/evm/wallet/wallet-positions) | 5000 | | [getDefiPositionsByProtocol](/data-api/evm/wallet/detailed-positions) | 5000 | | [getSwapsByWalletAddress](/data-api/evm/wallet/wallet-swaps) | 50 | | [resolveENSDomain](/data-api/evm/wallet/ens-lookup) | 10 | | [resolveAddress](/data-api/evm/wallet/resolve-address) | 10 | | [getWalletInsight](/data-api/evm/wallet/wallet-insights) | 100 per chain | ### EVM Token API | Method | CU Cost | | - | - | | [getTokenMetadata](/data-api/evm/token/metadata/token-metadata) | 10 | | [getTokenPrice](/data-api/evm/token/prices/token-price) | 50 | | [getMultipleTokenPrices](/data-api/evm/token/prices/token-prices-batch) | 100 | | [getPairCandlesticks](/data-api/evm/token/prices/ohlc) | 150 | | [getTokenScore](/data-api/evm/token/metadata/token-score) | 100 | | [getHistoricalTokenScore](/data-api/evm/token/metadata/token-score-timeseries) | 150 | | [getTokenHolders](/data-api/evm/token/holders/token-holders) | 50 | | [getTokenStats](/data-api/evm/token/holders/token-holder-stats) | 50 | | [getTokenTransfers](/data-api/evm/token/transfers/token-transfers) | 50 | | [getTokenPairs](/data-api/evm/token/swaps/token-pairs) | 50 | | [getSwapsByTokenAddress](/data-api/evm/token/swaps/token-swaps) | 50 | | [getSwapsByPairAddress](/data-api/evm/token/swaps/pair-swaps) | 50 | | [getPairStats](/data-api/evm/token/swaps/pair-stats) | 100 | | [getTopProfitableWalletPerToken](/data-api/evm/token/signals/top-traders) | 50 | | [getTokenCategories](/data-api/evm/token/discovery/token-categories) | 10 | ### EVM NFT API | Method | CU Cost | | - | - | | [getNFTMetadata](/data-api/evm/nft/metadata/nft-metadata) | 20 | | [getMultipleNFTs](/data-api/evm/nft/metadata/nft-metadata-batch) | 150 | | [getNFTContractMetadata](/data-api/evm/nft/metadata/collection-metadata) | 50 | | [getNFTBulkContractMetadata](/data-api/evm/nft/metadata/collection-metadata-batch) | 5 | | [getNFTCollectionStats](/data-api/evm/nft/metadata/collection-stats) | 50 | | [getNFTFloorPriceByToken](/data-api/evm/nft/prices/floor) | 30 | | [getNFTFloorPriceByContract](/data-api/evm/nft/prices/collection-floor-price) | 30 | | [getNFTHistoricalFloorPriceByContract](/data-api/evm/nft/prices/historical-floor-price) | 50 | | [getNFTSalePrices](/data-api/evm/nft/prices/sale-price-by-token-id) | 30 | | [getNFTContractSalePrices](/data-api/evm/nft/prices/sale-price-by-contract) | 1 | | [getNFTTrades](/data-api/evm/nft/trades/collection-trades) | 40 | | [getNFTTradesByToken](/data-api/evm/nft/trades/trades-by-token-id) | 40 | | [getNFTOwners](/data-api/evm/nft/ownership/owners-by-contract) | 50 | | [getNFTTokenIdOwners](/data-api/evm/nft/ownership/owners-by-token-id) | 50 | | [getNFTContractTransfers](/data-api/evm/nft/transfers/collection-transfers) | 50 | | [getNFTTransfers](/data-api/evm/nft/transfers/token-id-transfers) | 20 | | [getNFTTraitsByCollection](/data-api/evm/nft/traits/traits-by-collection) | 50 | | [getNFTTraitsByCollectionPaginate](/data-api/evm/nft/traits/traits-by-collection-paginated) | 10 | | [getNFTByContractTraits](/data-api/evm/nft/traits/nfts-by-traits) | 50 | | [reSyncMetadata](/data-api/evm/nft/utilities/resync-nft-metadata) | 50 | | [resyncNFTRarity](/data-api/evm/nft/utilities/resync-nft-traits) | 10 | ### EVM Price API | Method | CU Cost | | - | - | | [getTokenPrice](/data-api/evm/price/token-price) | 50 | | [getMultipleTokenPrices](/data-api/evm/price/token-prices-batch) | 100 | | [getPairCandlesticks](/data-api/evm/price/ohlc) | 150 | | [getNFTFloorPriceByToken](/data-api/evm/price/token-id-floor-price) | 30 | | [getNFTFloorPriceByContract](/data-api/evm/price/collection-floor-price) | 30 | | [getNFTHistoricalFloorPriceByContract](/data-api/evm/price/timeseries-floor-price) | 50 | | [getNFTSalePrices](/data-api/evm/price/sale-price-by-token-id) | 30 | | [getNFTContractSalePrices](/data-api/evm/price/sale-prices-by-collection) | 1 | ### EVM DeFi API | Method | CU Cost | | - | - | | [getDefiSummary](/data-api/evm/defi/wallet-protocols) | 5000 | | [getDefiPositionsSummary](/data-api/evm/defi/wallet-positions) | 5000 | | [getDefiPositionsByProtocol](/data-api/evm/defi/wallet-positions-detailed) | 5000 | ### EVM Blockchain API | Method | CU Cost | | - | - | | [getWalletTransactions](/data-api/evm/blockchain/address-transactions) | 30 | | [getWalletTransactionsVerbose](/data-api/evm/blockchain/address-transactions-decoded) | 50 | | [getDateToBlock](/data-api/evm/blockchain/block-by-date) | 1 | | [getBlock](/data-api/evm/blockchain/block-by-hash) | 100 | | [getLatestBlockNumber](/data-api/evm/blockchain/latest-block) | 10 | | [getTransaction](/data-api/evm/blockchain/transaction-by-hash) | 10 | | [getTransactionVerbose](/data-api/evm/blockchain/transaction-by-hash-decoded) | 20 | *** ## Solana API Compute Units ### Solana Wallet API | Method | CU Cost | | - | - | | [balance](/data-api/solana/wallet/native-balance) | 10 | | [getSPL](/data-api/solana/wallet/token-balances) | 10 | | [getNFTs](/data-api/solana/wallet/nft-balances) | 10 | | [getPortfolio](/data-api/solana/wallet/portfolio) | 10 | | [getSwapsByWalletAddress](/data-api/solana/wallet/wallet-swaps) | 50 | ### Solana Token API | Method | CU Cost | | - | - | | [getTokenMetadata](/data-api/solana/token/token-metadata) | 10 | | [getMultipleTokenMetadata](/data-api/solana/token/token-metadata-batch) | 100 | | [getTokenScore](/data-api/solana/token/token-score) | 100 | | [getHistoricalTokenScore](/data-api/solana/token/token-score-timeseries) | 150 | | [getTokenPrice](/data-api/solana/token/prices/token-price) | 10 | | [getMultipleTokenPrices](/data-api/solana/token/prices/token-prices-batch) | 100 | | [getCandleSticks](/data-api/solana/token/prices/ohlc) | 150 | | [getTokenPairs](/data-api/solana/token/pairs/token-pairs) | 50 | | [getSwapsByTokenAddress](/data-api/solana/token/swaps/token-swaps) | 50 | | [getSwapsByPairAddress](/data-api/solana/token/pairs/pair-swaps) | 50 | | [getPairStats](/data-api/solana/token/pairs/pair-stats) | 100 | | [getAggregatedTokenPairStats](/data-api/solana/token/market-metrics/token-analytics) | 80 | ### Solana NFT API | Method | CU Cost | | - | - | | [getNFTMetadata](/data-api/solana/nft/nft-metadata) | 10 | ### Solana Price API | Method | CU Cost | | - | - | | [getTokenPrice](/data-api/solana/price/token-price) | 10 | | [getMultipleTokenPrices](/data-api/solana/price/token-prices-batch) | 100 | | [getCandleSticks](/data-api/solana/price/ohlc) | 150 | # Pagination Source: https://docs.moralis.com/data-api/resources/pagination Moralis uses cursor-based pagination for endpoints that return lists (e.g. transactions, transfers, logs, NFTs, etc.). Pagination lets an API return large result sets in smaller “pages” so responses stay fast and predictable. Moralis uses **cursor-based pagination** for endpoints that return lists (e.g. transactions, transfers, logs, NFTs, etc.). ## Cursor Pagination Cursor pagination works by returning a **cursor token** with each response. You pass that cursor into the next request to fetch the next page. * **First request:** returns `result` + `cursor` * **Next request:** send the returned `cursor` to get the next page * When there are no more results, the cursor will be `null` Cursor pagination is ideal for long lists because performance stays consistent even at large offsets. ## Cursor Pagination in Moralis Moralis returns a cursor with list endpoints. Keep calling the endpoint with the latest cursor until no cursor is returned. **Important notes** * `limit` can only be set on the **initial request**. You can’t change the limit mid-pagination (because the cursor is tied to the original query settings). * A cursor represents a **stable snapshot of the dataset at the time your first request was made** (a “point in time”). ## Snapshot Behavior (No Duplicates Across Pages) When you paginate using a cursor, Moralis keeps the ordering consistent across pages for that pagination session. Example: if you’re fetching “latest wallet transactions” and **new transactions occur while you’re paging**, those new transactions: * **will not** reshuffle the pages you’re currently fetching * **will not** cause items from page 1 to appear again on page 2 * **will not** be included in the current cursor run If you want **new / delta results**, you should **start a new request** (i.e., re-call the endpoint without the old cursor) after you finish paging, or periodically re-poll from the top depending on your use case. ## Example: Cursor Pagination Below is a simple Node.js example showing how to page through all results using a cursor. This example: * Makes an initial request with a `limit` * Reuses the returned `cursor` to fetch the next page * Stops when no cursor is returned * Uses plain `fetch` ```typescript theme={null} const fetch = require("node-fetch"); const API_KEY = "YOUR_API_KEY"; const BASE_URL = "https://deep-index.moralis.io/api/v2.2"; const address = "0xb47e3cd837dDF8e4c57F05d70Ab865de6e193BBB"; const chain = "eth"; const limit = 100; async function fetchAllPages() { let cursor = null; let allResults = []; do { const url = new URL(`${BASE_URL}/nft/${address}/owners`); url.searchParams.set("chain", chain); url.searchParams.set("limit", limit); if (cursor) { url.searchParams.set("cursor", cursor); } const res = await fetch(url.toString(), { headers: { "X-API-Key": API_KEY, }, }); const data = await res.json(); allResults.push(...data.result); cursor = data.cursor; // null / empty when no more pages } while (cursor); return allResults; } fetchAllPages().then((results) => { console.log("Total records:", results.length); }); ``` # Rate Limits Source: https://docs.moralis.com/data-api/resources/rate-limits Moralis APIs use a throughput-based rate-limiting system, measured in requests per second. Each plan defines how many requests you can send per second. If you exceed this, requests will be rate-limited. ## Throughput & Rolling Window Throughput limits are evaluated over a **rolling 4-second window**, not per exact second. This allows short request bursts, as long as your total request count stays within your plan's limits over that window. ## Maximum requests per second | Plan | Throughput | | :- | :- | | Starter | 40 reqs/s | | Pro | 80 reqs/s | | Business | 200 reqs/s | | Enterprise | Custom | ## Avoiding Rate Limits To avoid rate limiting: * Keep your request rate within your plan's throughput * Avoid sustained spikes that exceed the rolling 4-second limit * Upgrade your plan if you consistently hit limits If you exceed your throughput, the API will return a **429 Too Many Requests** response. # Response Codes Source: https://docs.moralis.com/data-api/resources/response-codes Moralis uses conventional HTTP response codes to indicate success or failure of an API request. | Status Code | Message | Description | | - | - | - | | 200 | OK | Everything worked as expected. | | 201 | Created | Resource has been successfully created or added to a queue. | | 202 | Accepted | Resource has been successfully created or added to a queue. | | 400 | Bad Request | Bad request, often due to missing or malformed parameter(s). | | 401 | Unauthorized | Missing or invalid API key. | | 404 | Not Found | Resource not found (for example pair or token not found for a specific chain). | | 429 | Rate Limited | Too many requests. Consider upgrading your plan. | | 500 | Internal Server Error | Something went wrong on Moralis' end. | # Spam Filtering Source: https://docs.moralis.com/data-api/resources/spam-filtering Spam detection helps you identify and handle potentially harmful contracts in the Web3 ecosystem, in real time. Our spam filtering is designed to protect applications and end users from interacting with spam, phishing, or low-quality token and NFT contracts. ## How It Works Moralis automatically evaluates contracts as they are processed onchain. For both **ERC20 tokens** and **NFT contracts**, Moralis adds a boolean field: ``` "possible_spam": true | false ``` This field indicates whether a contract is **likely to be spam or malicious**. Spam detection is applied **in real time** as part of contract metadata processing (e.g. name, symbol, decimals, NFT metadata). ## Detection Logic Spam detection is based on multiple internal signals, including: * Keyword-based matching across contract metadata * Known spam and phishing patterns * Heuristic analysis from historical onchain behavior Detection rules are continuously updated as new spam patterns emerge. ## Using Spam Detection You can use the `possible_spam` field to: * Hide suspicious tokens or NFTs from your UI * Warn users before interacting with risky contracts * Filter out spam from analytics, balances, or portfolios Many Moralis endpoints (such as [Token Balances](/data-api/evm/wallet/token-balances)) support **excluding spam contracts** directly at query time. For which filters to combine when calculating balances and net worth, see [Accurate Net Worth & Token Balances](/data-api/data-features/safety-and-trust/accurate-net-worth-and-balances). ## ERC20 Tokens & Token Scores For ERC20 tokens, spam detection works well alongside [**Token Scores**](/data-api/data-features/token-scores). While `possible_spam` focuses on **known and likely spam signals**, Token Scores provide a broader **token quality and safety assessment**, considering factors such as: * Liquidity * Trading volume * Holder distribution * Transaction activity * Token age Using both together gives a more complete picture of token risk and quality. *** ## Notes * `possible_spam` is a **best-effort signal**, not a guarantee * Always apply additional validation for high-value or security-critical workflows # Solana DeFi API Source: https://docs.moralis.com/data-api/solana/defi/overview Track DeFi positions, balances, and rewards across the most-used Solana protocols using the same Universal API endpoints as EVM. ## Overview The **Solana DeFi API** provides a unified view of a wallet's DeFi positions across the most-used Solana protocols - lending, borrowing, staking, liquid staking, and liquidity pools. The same three Universal API endpoints used for EVM DeFi positions now return Solana data, with no schema changes and no separate integration. *** ## What Is the Solana DeFi API? The Solana DeFi API lets you query: * **Protocol Summary** - Overview of all Solana DeFi protocols a wallet uses * **Positions** - Detailed position data per protocol * **Position Details** - Enhanced breakdown with underlying assets * **Multi-Chain in One Call** - Query EVM and Solana wallets through the same endpoints *** ## Key Features * **Protocol Detection** - Automatically identifies which Solana protocols a wallet uses * **Position Breakdown** - Detailed view of deposits, borrows, staking, and rewards * **USD Valuations** - Position values calculated in USD * **Unified Schema** - Identical response shape across EVM and Solana * **Single Integration** - Same filters and parameters as the EVM DeFi API *** ## Supported Protocols The Solana DeFi API supports 10 of the most-used protocols on Solana - together covering roughly 90% of Solana DeFi TVL, including the top protocols by TVL (Jupiter, Kamino, Sanctum, and Raydium): * Jito * Save (formerly Solend) * Jupiter Lend * Jupiter Perpetual Exchange * Kamino Lend * Sanctum * Raydium * Orca * Drift * Marinade More Solana protocols are being added on a rolling basis. If you need a specific protocol prioritized, [reach out to the team](https://moralis.com/enterprise/). *** ## Common Use Cases The Solana DeFi API is commonly used for: * **Portfolio Trackers**\ (show Solana DeFi positions alongside SPL tokens and NFTs) * **DeFi Dashboards**\ (aggregate positions across Solana protocols) * **Cross-Ecosystem Wallets**\ (display EVM and Solana DeFi positions side by side) * **Yield Tracking**\ (monitor staking rewards and LP positions on Solana) * **Tax Reporting**\ (calculate DeFi gains and income across Solana) *** ## Popular Endpoints | Endpoint | Description | | - | - | | [Wallet Protocols](/data-api/solana/defi/wallet-protocols) | Summary of Solana protocols used by a wallet | | [Wallet Positions](/data-api/solana/defi/wallet-positions) | Detailed Solana positions per protocol | | [Detailed Positions](/data-api/solana/defi/wallet-positions-detailed) | Enhanced Solana position breakdown | *** ## Get Started * [Get Wallet Protocols](/data-api/solana/defi/wallet-protocols) * [Get Wallet Positions](/data-api/solana/defi/wallet-positions) * [Get Detailed Positions](/data-api/solana/defi/wallet-positions-detailed) *** ## Get Solana DeFi Data in 1 API Call [Get Solana DeFi Data in 1 API Call](https://www.youtube.com/embed/Q3W3RFj42bE) # Wallet Positions Source: https://docs.moralis.com/data-api/solana/defi/wallet-positions openapi-files/data-api/api-v1.json GET /v1/wallets/{walletAddress}/defi/positions Returns all DeFi positions (lending, liquidity, staking) for a wallet address across specified chains in a unified schema. # Detailed Positions Source: https://docs.moralis.com/data-api/solana/defi/wallet-positions-detailed openapi-files/data-api/api-v1.json GET /v1/wallets/{walletAddress}/defi/{protocol}/positions Returns DeFi positions for a wallet address filtered by a specific protocol across specified chains. # Wallet Protocols Source: https://docs.moralis.com/data-api/solana/defi/wallet-protocols openapi-files/data-api/api-v1.json GET /v1/wallets/{walletAddress}/defi/summary Returns a summary of all DeFi positions for a wallet address across specified chains. # NFT Metadata Source: https://docs.moralis.com/data-api/solana/nft/nft-metadata openapi-files/data-api/solana-api.json GET /nft/{network}/{address}/metadata Gets the contract level metadata (mint, standard, name, symbol, metaplex) for the given contract # Solana NFT API Overview Source: https://docs.moralis.com/data-api/solana/nft/overview Query Solana NFT metadata including token details, attributes, and media URLs. ## Overview The **Solana NFT API** provides NFT metadata for tokens on the Solana blockchain, including attributes, media URLs, and collection information. Built for Solana's unique NFT standards, the API delivers the data you need to display and work with Solana NFTs. *** ## What Is the Solana NFT API? The Solana NFT API lets you query: * **NFT Metadata** - Token metadata including name, symbol, and description * **Attributes** - NFT traits and properties * **Media** - Image and media URLs * **Collection Info** - Collection-level metadata *** ## Key Features * **Complete Metadata** - Full NFT metadata with all attributes * **Media Resolution** - Resolved media URLs for display * **Solana Standards** - Support for Metaplex and other Solana NFT standards * **Fast Queries** - Optimized for quick metadata retrieval *** ## Common Use Cases * **NFT Galleries**\ (display Solana NFT collections) * **Wallet Apps**\ (show NFT holdings with metadata) * **Marketplaces**\ (NFT listings with full details) * **Portfolio Trackers**\ (include NFTs in portfolio views) *** ## Get Started Explore the Solana NFT API endpoints: * [**NFT Metadata**](/data-api/solana/nft/nft-metadata) - Get metadata for a Solana NFT # Solana Data API Source: https://docs.moralis.com/data-api/solana/overview A dedicated API for accessing Solana blockchain data with Solana-native semantics and structures. ### Overview The **Solana Data API** provides **deep, Solana-native access** to Solana blockchain data, standardizing complex on-chain structures into clean, developer-friendly formats. It is designed specifically around **Solana’s account model, programs, and transaction semantics**, rather than forcing Solana data into an EVM-style abstraction. *** ### What the Solana Data API Is For The Solana Data API is built for: * Applications focused exclusively on **Solana** * Use cases that require **Solana-specific data models** * Developers who need precise control over Solana program and account data *** ### Relationship to the Universal API * The Universal API includes **shared EVM + Solana functionality** * The Solana Data API provides **deeper Solana-specific coverage** * Some Solana-specific endpoints are not available in the Universal API As with EVM, not all Solana features are suitable for a fully universal abstraction. *** ### When to Use the Solana Data API Use the Solana Data API if you: * Are building a Solana-only application * Need Solana-specific transaction or account details * Want the most accurate representation of Solana on-chain behavior # OHLC by Pair Address Source: https://docs.moralis.com/data-api/solana/price/ohlc openapi-files/data-api/solana-api.json GET /token/{network}/pairs/{address}/ohlcv Gets the candlesticks for a specific pair address > [!WARNING] > > This endpoint requires a **pair address**, not a token address. To find the pair addresses for a token, use the [Token Pairs endpoint](/data-api/solana/token/pairs/token-pairs). # Solana Price API Overview Source: https://docs.moralis.com/data-api/solana/price/overview Real-time and historical price data for Solana SPL tokens including current prices, batch queries, and OHLC candlestick data. ## Overview The **Solana Price API** provides real-time and historical pricing data for SPL tokens on Solana, including current prices, batch queries, and OHLC candlestick data for charting. Get accurate token prices without managing your own price feeds or aggregation infrastructure. *** ## What Is the Solana Price API? The Solana Price API lets you query: * **Token Prices** - Current USD prices for any SPL token * **Batch Prices** - Fetch prices for multiple tokens in one request * **OHLC Data** - Candlestick data for charting and technical analysis *** ## Key Features * **Real-Time Prices** - Current token prices with USD values * **Batch Support** - Query multiple tokens efficiently * **OHLC Candles** - Open, high, low, close data for charts * **Historical Data** - Price history for trend analysis * **Fast Response** - Optimized for low-latency queries *** ## Common Use Cases * **Price Feeds**\ (display current token prices) * **Trading Charts**\ (OHLC data for candlestick visualizations) * **Portfolio Valuation**\ (calculate holdings value in USD) * **Price Alerts**\ (trigger notifications on price changes) * **Market Dashboards**\ (aggregate pricing across tokens) *** ## Get Started Explore the Solana Price API endpoints: * [**Token Price**](/data-api/solana/price/token-price) - Get current price for a token * [**Token Prices (Batch)**](/data-api/solana/price/token-prices-batch) - Get prices for multiple tokens * [**OHLC**](/data-api/solana/price/ohlc) - Get candlestick data for charting # Token Price Source: https://docs.moralis.com/data-api/solana/price/token-price openapi-files/data-api/solana-api.json GET /token/{network}/{address}/price Gets the token price (usd and native) for a given contract address and network. # Token Analytics Source: https://docs.moralis.com/data-api/solana/token/market-metrics/token-analytics openapi-files/data-api/api.json GET /tokens/{tokenAddress}/analytics Retrieve detailed trading analytics for a specific token, including buy volume, sell volume, buyers, sellers, transactions, liquidity and FDV trends over time. # Token Analytics (Batch) Source: https://docs.moralis.com/data-api/solana/token/market-metrics/token-analytics-batch openapi-files/data-api/api.json POST /tokens/analytics Fetch analytics for multiple tokens, including buy volume, sell volume, buyers, sellers, transactions, liquidity and FDV trends over time. Accepts an array of up to 200 tokens, each requiring chain and tokenAddress. # Token Analytics - Timeseries Source: https://docs.moralis.com/data-api/solana/token/market-metrics/token-analytics-timeseries openapi-files/data-api/api.json POST /tokens/analytics/timeseries Fetch timeseries swap buy volume, sell volume, liquidity and FDV for multiple tokens. Accepts an array of up to 200 tokens, each requiring chain and tokenAddress. # Solana Token API Overview Source: https://docs.moralis.com/data-api/solana/token/overview Comprehensive Solana token data including metadata, prices, swaps, pairs, and advanced analytics for SPL tokens. ## Overview The **Solana Token API** provides complete SPL token data including metadata, real-time prices, swap history, trading pairs, and advanced market metrics. From basic token lookups to complex analytics, the Token API delivers everything you need to build trading platforms and token analysis tools on Solana. *** ## What Is the Solana Token API? The Solana Token API lets you query: * **Metadata** - Token details including name, symbol, and logo * **Prices** - Real-time and historical token prices with OHLC data * **Swaps** - DEX trading activity and swap history * **Pairs** - Trading pairs with liquidity and stats * **Discovery** - Search tokens by name, symbol, or address *** ## Key Features * **Real-Time Prices** - Current token prices with USD values * **OHLC Data** - Candlestick data for charting * **Swap Tracking** - DEX trades on Raydium, Orca, and more * **Pair Stats** - Liquidity, volume, and trading metrics * **Token Search** - Find tokens by name or address * **Pump.fun Integration** - Track new and graduated tokens * **Top Movers** - Discover top gainers and losers * **Token Score** - Quality and safety metrics *** ## Common Use Cases * **Trading Platforms**\ (prices, charts, swap execution) * **Token Analytics**\ (volume, pair, and market metrics) * **DEX Interfaces**\ (pair discovery, liquidity data) * **Token Screeners**\ (filter and discover tokens) * **New Token Tracking**\ (monitor Pump.fun launches) * **Research Tools**\ (token metrics and analysis) *** ## Get Started Explore the Solana Token API endpoints: * [**Token Metadata**](/data-api/solana/token/token-metadata) - Get token details * [**Token Price**](/data-api/solana/token/prices/token-price) - Get current price * [**OHLC**](/data-api/solana/token/prices/ohlc) - Get candlestick data * [**Token Swaps**](/data-api/solana/token/swaps/token-swaps) - Get swap history * [**Token Pairs**](/data-api/solana/token/pairs/token-pairs) - Get trading pairs * [**Token Search**](/data-api/solana/token/search-and-discovery/token-search) - Search tokens # Pair Stats Source: https://docs.moralis.com/data-api/solana/token/pairs/pair-stats openapi-files/data-api/solana-api.json GET /token/{network}/pairs/{pairAddress}/stats Gets the stats for a specific pair address # Pair Swaps Source: https://docs.moralis.com/data-api/solana/token/pairs/pair-swaps openapi-files/data-api/solana-api.json GET /token/{network}/pairs/{pairAddress}/swaps Get all swap related transactions (buy, sell, add liquidity & remove liquidity) for a specific pair address. # Token Pairs Source: https://docs.moralis.com/data-api/solana/token/pairs/token-pairs openapi-files/data-api/solana-api.json GET /token/{network}/{address}/pairs Get the supported pairs for a specific token address. # OHLC by Pair Address Source: https://docs.moralis.com/data-api/solana/token/prices/ohlc openapi-files/data-api/solana-api.json GET /token/{network}/pairs/{address}/ohlcv Gets the candlesticks for a specific pair address > [!WARNING] > > This endpoint requires a **pair address**, not a token address. To find the pair addresses for a token, use the [Token Pairs endpoint](/data-api/solana/token/pairs/token-pairs). # Token Price Source: https://docs.moralis.com/data-api/solana/token/prices/token-price openapi-files/data-api/solana-api.json GET /token/{network}/{address}/price Gets the token price (usd and native) for a given contract address and network. # Token Price (Batch) Source: https://docs.moralis.com/data-api/solana/token/prices/token-prices-batch openapi-files/data-api/solana-api.json POST /token/{network}/prices Gets the token price (usd and native) for a given contract address and network. # Token Search Source: https://docs.moralis.com/data-api/solana/token/search-and-discovery/token-search openapi-files/data-api/api.json GET /tokens/search Search for tokens using their contract address, pair address, name, or symbol. Cross-chain by default with support to filter by chains. Additional options to sortBy various metrics, such as market cap, liquidity or volume. # Token Swaps Source: https://docs.moralis.com/data-api/solana/token/swaps/token-swaps openapi-files/data-api/solana-api.json GET /token/{network}/{address}/swaps Get all swap related transactions (buy, sell) for a specific token address. # Wallet Swaps Source: https://docs.moralis.com/data-api/solana/token/swaps/wallet-swaps openapi-files/data-api/solana-api.json GET /account/{network}/{address}/swaps Get all swap related transactions (buy, sell) for a specific wallet address. # Token Metadata Source: https://docs.moralis.com/data-api/solana/token/token-metadata openapi-files/data-api/solana-api.json GET /token/{network}/{address}/metadata Get the global token metadata for a given network and contract (mint, standard, name, symbol, metaplex). # Token Metadata (Batch) Source: https://docs.moralis.com/data-api/solana/token/token-metadata-batch openapi-files/data-api/solana-api.json POST /token/{network}/metadata Get multiple global token metadata for a given network and contract (mint, standard, name, symbol, metaplex). Supports up to 100 tokens per request. # Token Score Source: https://docs.moralis.com/data-api/solana/token/token-score openapi-files/data-api/api.json GET /tokens/{tokenAddress}/score Retrieve a score for a specific token along with detailed metrics including price, volume, liquidity, transaction counts, and supply information. > [!WARNING] > > **Deprecated — scheduled for removal on July 31, 2026.** See the [changelog](/changelog) for details and migration guidance. # Native Balance Source: https://docs.moralis.com/data-api/solana/wallet/native-balance openapi-files/data-api/solana-api.json GET /account/{network}/{address}/balance Gets native balance owned by the given address # NFT Balances Source: https://docs.moralis.com/data-api/solana/wallet/nft-balances openapi-files/data-api/solana-api.json GET /account/{network}/{address}/nft Gets NFTs owned by the given address # Solana Wallet API Overview Source: https://docs.moralis.com/data-api/solana/wallet/overview Query Solana wallet data including native SOL balance, SPL token holdings, NFT balances, portfolio overview, and swap history. ## Overview The **Solana Wallet API** provides complete wallet data for Solana addresses including native SOL balance, SPL token holdings, NFT balances, and trading activity. Built specifically for Solana's account model, the Wallet API delivers the data you need to build wallets, portfolio trackers, and Solana-native applications. *** ## What Is the Solana Wallet API? The Solana Wallet API lets you query: * **Native Balance** - SOL balance for any wallet address * **Token Balances** - SPL token holdings with metadata and prices * **NFT Balances** - NFT holdings on Solana * **Portfolio** - Complete portfolio overview with valuations * **Swaps** - DEX trading history on Solana *** ## Key Features * **Native SOL Balance** - Current SOL holdings with USD value * **SPL Token Support** - All SPL tokens with metadata * **NFT Holdings** - Solana NFT balances and metadata * **Portfolio Valuation** - Total portfolio value in USD * **Swap History** - Trading activity on Solana DEXs * **Real-Time Data** - Up-to-date wallet state *** ## Common Use Cases * **Solana Wallets**\ (display SOL and token balances) * **Portfolio Trackers**\ (aggregate holdings with valuations) * **Trading Apps**\ (show swap history and activity) * **NFT Galleries**\ (display Solana NFT collections) * **DeFi Dashboards**\ (track wallet activity on Solana) *** ## Get Started Explore the Solana Wallet API endpoints: * [**Native Balance**](/data-api/solana/wallet/native-balance) - Get SOL balance * [**Token Balances**](/data-api/solana/wallet/token-balances) - Get SPL token holdings * [**NFT Balances**](/data-api/solana/wallet/nft-balances) - Get NFT holdings * [**Portfolio**](/data-api/solana/wallet/portfolio) - Get complete portfolio * [**Wallet Swaps**](/data-api/solana/wallet/wallet-swaps) - Get swap history # Wallet Portfolio Source: https://docs.moralis.com/data-api/solana/wallet/portfolio openapi-files/data-api/solana-api.json GET /account/{network}/{address}/portfolio Gets all the native and token balances of the given address > [!TIP] > > Set `excludeSpam=true` to keep spam tokens out of the response. See [Accurate Net Worth & Token Balances](/data-api/data-features/safety-and-trust/accurate-net-worth-and-balances) for more checks. # Token Balances Source: https://docs.moralis.com/data-api/solana/wallet/token-balances openapi-files/data-api/solana-api.json GET /account/{network}/{address}/tokens Gets token balances owned by the given address > [!TIP] > > Set `excludeSpam=true` to keep spam tokens out of the response. See [Accurate Net Worth & Token Balances](/data-api/data-features/safety-and-trust/accurate-net-worth-and-balances) for more checks. # Wallet Swaps Source: https://docs.moralis.com/data-api/solana/wallet/wallet-swaps openapi-files/data-api/solana-api.json GET /account/{network}/{address}/swaps Get all swap related transactions (buy, sell) for a specific wallet address. # Data API Supported Chains Source: https://docs.moralis.com/data-api/supported-chains Blockchains supported by the Moralis Data APIs for tokens, wallets, NFTs, DeFi, and pricing. ### Data API Supported ChainsThe Moralis Data APIs support multiple blockchain networks for **onchain data access**, including wallets, tokens, NFTs, DeFi, and prices.Chain support may vary by feature. Some chains support the full Data API surface, while others support a subset depending on:- Indexing depth - Protocol availability - Onchain data structureUse the selector below to filter the table by feature, or view all features at once.⚠️**Moonbeam and Moonriver are deprecated.** Both chains stopped producing new blocks on August 1, 2026, and Moralis support is removed on **September 25, 2026**, following Moonbeam's network relaunch on Base. GLMR and MOVR are now ERC-20 tokens on Base, so migrate to the `base` chain parameter and export any history you still need before that date. See the [deprecation notice](/changelog#moonbeam-moonriver-and-lisk-support-ends-september-25-2026) for contract addresses and details.⚠️**Lisk is deprecated.** Moralis support for Lisk ( `0x46f`) is removed on **September 25, 2026**, ahead of the Lisk Chain wind-down. Migrate to the `eth` or `base` chain parameter and export any history you still need before that date. See the [deprecation notice](/changelog#moonbeam-moonriver-and-lisk-support-ends-september-25-2026) for the full timeline. Showing chain . \ \ \ \ \
ChainTypeChain IDQuery Params
> [!NOTE] > > **Robinhood Chain** is currently supported through the [Universal API](/data-api/universal/overview) only; its checks reflect Universal API support. Internal transactions are not supported. # DeFi API Source: https://docs.moralis.com/data-api/universal/defi/overview Track DeFi positions, balances, rewards, and protocol interactions with enriched, protocol-aware data across EVM chains and Solana — through one unified set of endpoints. ## Overview The **DeFi API** provides a unified view of a wallet's DeFi positions across protocols - lending, borrowing, staking, liquid staking, and liquidity pools - on both **EVM chains and Solana**. It is one cross-chain endpoint set: the **same three endpoints** return EVM and Solana positions, with an identical response shape. Pass the `chain` parameter (for example `eth`, `base`, `polygon`, or `solana`) to choose the network - no separate integration per chain. *** ## What Is the DeFi API? The DeFi API lets you query: * **Protocol Summary** - overview of all DeFi protocols a wallet uses * **Positions** - detailed position data per protocol * **Position Details** - enhanced breakdown with underlying assets * **Multi-Chain in One Integration** - query EVM and Solana wallets through the same endpoints and schema *** ## Key Features * **Protocol Detection** - automatically identifies which protocols a wallet uses * **Position Breakdown** - detailed view of deposits, borrows, staking, and rewards * **USD Valuations** - position values calculated in USD * **Unified Schema** - identical response shape across EVM and Solana * **Single Integration** - the same filters and parameters across every supported chain *** ## Supported Protocols Coverage spans **thousands of EVM protocols** and the **top Solana protocols**: * **EVM** - 3,000+ protocols including Aave, Compound, Uniswap, Lido, Rocket Pool, Eigenlayer, and all forked Uniswap v2 protocols. * **Solana** - 10 of the most-used protocols, together covering roughly 90% of Solana DeFi TVL: Jito, Save (formerly Solend), Jupiter Lend, Jupiter Perpetual Exchange, Kamino Lend, Sanctum, Raydium, Orca, Drift, and Marinade. For the full, always-current list per chain, see [DeFi Protocols](/data-api/data-features/integrations/defi-protocols) or call the Get Supported DeFi Protocols endpoint with the `chain` parameter. *** ## Common Use Cases * **Portfolio Trackers** - show DeFi positions alongside tokens and NFTs * **Cross-Ecosystem Wallets** - display EVM and Solana DeFi positions side by side * **DeFi Dashboards** - aggregate positions across protocols and chains * **Risk Monitoring** - track lending health factors and exposure * **Yield Tracking** - monitor staking rewards and LP positions * **Tax Reporting** - calculate DeFi gains and income *** ## Popular Endpoints | Endpoint | Description | | - | - | | [Wallet Protocols](/data-api/universal/defi/wallet-protocols) | Summary of protocols a wallet uses | | [Wallet Positions](/data-api/universal/defi/wallet-positions) | Detailed positions per protocol | | [Detailed Positions](/data-api/universal/defi/wallet-positions-detailed) | Enhanced position breakdown | Each endpoint accepts the `chain` parameter to target an EVM chain or Solana. *** ## Get Started * [Get Wallet Protocols](/data-api/universal/defi/wallet-protocols) * [Get Wallet Positions](/data-api/universal/defi/wallet-positions) * [Get Detailed Positions](/data-api/universal/defi/wallet-positions-detailed) *** ## DeFi API Overview Video [Moralis DeFi API Overview](https://www.youtube.com/embed/dLcoB3vFf38) # Supported Protocols Source: https://docs.moralis.com/data-api/universal/defi/supported-protocols openapi-files/data-api/api-v1.json GET /v1/defi/protocols Returns the full list of DeFi protocols supported by Moralis, with their chain coverage. Use the optional `chains` filter to narrow results to specific chains. Returns the full list of DeFi protocols supported by Moralis, with their chain coverage. Use the optional `chains` filter to narrow results to specific chains — ideal for keeping your own UI or coverage checks in sync. # Wallet Positions Source: https://docs.moralis.com/data-api/universal/defi/wallet-positions openapi-files/data-api/api-v1.json GET /v1/wallets/{walletAddress}/defi/positions Returns all DeFi positions (lending, liquidity, staking) for a wallet address across specified chains in a unified schema. # Detailed Positions Source: https://docs.moralis.com/data-api/universal/defi/wallet-positions-detailed openapi-files/data-api/api-v1.json GET /v1/wallets/{walletAddress}/defi/{protocol}/positions Returns DeFi positions for a wallet address filtered by a specific protocol across specified chains. # Wallet Protocols Source: https://docs.moralis.com/data-api/universal/defi/wallet-protocols openapi-files/data-api/api-v1.json GET /v1/wallets/{walletAddress}/defi/summary Returns a summary of all DeFi positions for a wallet address across specified chains. # Get Entities by Category Source: https://docs.moralis.com/data-api/universal/entity/endpoints/entity-by-category openapi-files/data-api/api.json GET /entities/categories/{categoryId} Fetch entities belonging to a specific category. Each entity returns name, logo, description, external links, total addresses and more. # Get Entity Source: https://docs.moralis.com/data-api/universal/entity/endpoints/entity-by-id openapi-files/data-api/api.json GET /entities/{entityId} Retrieve details for a specific entity using its unique ID. Returns name, logo, description, external links and related addresses. # Get Entity Categories Source: https://docs.moralis.com/data-api/universal/entity/endpoints/entity-categories openapi-files/data-api/api.json GET /entities/categories List available categories for blockchain entities. # Entity Search Source: https://docs.moralis.com/data-api/universal/entity/endpoints/entity-search openapi-files/data-api/api.json GET /entities/search Find entities, organizations, addresses or wallets linked to blockchain addresses. Results are categorised into 3 arrays: entities, addresses, categories. # Entity API Overview Source: https://docs.moralis.com/data-api/universal/entity/overview Search and discover blockchain entities including exchanges, institutions, protocols, and notable addresses with verified labels. ## Overview The **Entity API** lets you search and discover blockchain entities - organizations, protocols, exchanges, and notable addresses with verified labels and metadata. Instead of working with raw addresses, the Entity API provides context about who owns and operates wallets across the blockchain ecosystem. *** ## What Is the Entity API? The Entity API lets you: * **Search Entities** - Find entities by name (e.g., "Coinbase", "BlackRock") * **Discover Addresses** - Get known addresses associated with an entity * **Get Labels** - Retrieve verified labels and categories for addresses * **Explore Protocols** - Find addresses related to dApps and protocols *** ## Key Features * **Entity Search** - Query by name to find organizations and protocols * **Address Discovery** - Find all addresses linked to an entity * **Verified Labels** - Trusted address labels and categorization * **Cross-Chain** - Entity data spans EVM and Solana chains * **Rich Metadata** - Entity descriptions, logos, and categories *** ## Supported Entities The Entity API covers: * **Exchanges** - Coinbase, Kraken, Binance, and more * **Institutions** - BlackRock, Grayscale, and asset managers * **Protocols** - Uniswap, Aave, Compound, and DeFi protocols * **DAOs** - Major DAOs and governance entities * **Notable Wallets** - Whales, founders, and known addresses *** ## Common Use Cases * **Address Labels**\ (display human-readable names for addresses) * **Whale Tracking**\ (monitor institutional and large holder activity) * **Compliance**\ (identify exchange and custodian addresses) * **Analytics**\ (understand flows between known entities) * **Portfolio Context**\ (show which entities hold similar assets) *** ## Get Started Explore the Entity API to search and discover blockchain entities. # Market Metrics Overview Source: https://docs.moralis.com/data-api/universal/market-metrics/overview Access market-wide metrics and analytics across chains including volume, market cap, and trending data. ## Overview The **Market Metrics API** provides market-wide analytics and metrics across blockchain ecosystems, helping you understand broader market trends and activity. Get aggregated market data without building your own analytics infrastructure. *** ## What Is the Market Metrics API? The Market Metrics API lets you query: * **Market Overview** - Aggregate market statistics * **Volume Data** - Trading volume across markets * **Trending Metrics** - Popular tokens and collections * **Cross-Chain Data** - Unified metrics across chains *** ## Key Features * **Aggregated Data** - Market-wide statistics and summaries * **Volume Tracking** - Trading volume and activity metrics * **Trend Analysis** - Identify trending assets and markets * **Cross-Chain** - Unified view across EVM and Solana * **Real-Time Updates** - Current market state *** ## Common Use Cases * **Market Dashboards**\ (display overall market health and activity) * **Analytics Platforms**\ (aggregate market metrics for analysis) * **Trading Apps**\ (show market context and trends) * **Research Tools**\ (track market-wide patterns) *** ## Get Started Explore the Market Metrics API to access market-wide analytics and trends. # Universal API Source: https://docs.moralis.com/data-api/universal/overview A unified, multichain API for accessing blockchain data across 30+ EVM networks, Solana, and Bitcoin through a single, consistent interface. ### Overview The **Universal API** is Moralis’ unified, multichain Data API, designed to provide a **single, consistent interface** for accessing blockchain data across **30+ supported chains**, including **EVM networks, Solana, and Bitcoin**. It standardizes complex on-chain data into **clean, developer-friendly formats**, allowing you to build multichain applications without handling chain-specific differences. *** ### What the Universal API Is For The Universal API is intended for: * Applications that support **EVM, Solana, and Bitcoin** * Teams building **chain-agnostic** products * Use cases where a **consistent data model** across chains is more important than chain-specific depth Where possible, new endpoints are introduced in the Universal API first. Robinhood Chain Data API support is currently available only through the Universal API. See [Supported Chains](/data-api/supported-chains) for details. *** ### Selecting a Chain Universal API endpoints take the chain in one of two ways, depending on the endpoint: | Parameter | Where | Chains per request | Example | | - | - | - | - | | `chainAlias` | Path | One | `GET /v1/chains/ethereum/tokens/{tokenAddress}/price` | | `chains` | Query | One or more | `GET /v1/wallets/{walletAddress}/tokens?chains=ethereum&chains=base` | When using `chains`: * To query several chains, repeat the parameter once per chain. Comma-separated values are not supported. * Use `chains` (plural). The singular `chain` parameter is rejected with a `400` error. * If you omit `chains`, the request covers every mainnet the endpoint supports. * The shortcuts `all`, `mainnets`, and `testnets` are also accepted. They work only with `chains`, not with `chainAlias`. EVM chains accept either the hex chain ID or an alias. Solana and Bitcoin accept aliases only. Common values: | Chain | Accepted values | | - | - | | Ethereum | `0x1`, `ethereum`, `eth` | | Base | `0x2105`, `base` | | BNB Chain | `0x38`, `binance`, `bsc` | | Polygon | `0x89`, `polygon`, `matic` | | Robinhood Chain | `0x1237`, `robinhood` | | Tempo | `0x1079`, `tempo` | | Solana | `solana-mainnet`, `sol`, `solana` | | Bitcoin | `bitcoin-mainnet`, `bitcoin` | > [!NOTE] > > Supported chains vary by endpoint. Each endpoint page lists one accepted value per chain; the other values in this table work too. For the full chain list, see [Supported Chains](/data-api/supported-chains). > [!TIP] > > [Streams](/streams/supported-chains) uses hex chain IDs only (for example, `0x1`). Aliases such as `ethereum` or `robinhood` are not accepted there. *** ### Consolidation Strategy Moralis is **gradually consolidating cross-chain functionality into the Universal API**. This means: * New multichain endpoints are added to the Universal API * Existing EVM- or Solana-specific endpoints may be mirrored or superseded over time * No breaking changes are introduced without notice The Universal API represents the **long-term direction** for multichain data access at Moralis. *** ### When to Use the Universal API Use the Universal API if you: * Need the **same endpoint to work across EVM, Solana, and Bitcoin** * Want to minimize chain-specific logic * Are building dashboards, analytics, or wallets that span multiple ecosystems *** ### When Not to Use It For advanced, chain-specific features, you may still want: * **EVM API** for deep EVM-only functionality * **Solana Data API** for Solana-specific data and semantics * **Bitcoin API** for Bitcoin-specific endpoints including the [xpub utility](/data-api/bitcoin/utility/addresses-from-xpub) # PnL API Source: https://docs.moralis.com/data-api/universal/pnl/overview Multi-chain profit and loss endpoints in the Universal API - wallet profitability, wallet PnL summaries, and top-trader leaderboards per token. ## Overview The **Universal PnL API** answers the question every trading, portfolio, and analytics product gets asked: *is this wallet (or this token's traders) making money?* It replaces the legacy Deep Index profitability endpoints with multi-chain versions that query several chains in a single request. *** ## Endpoints | Endpoint | Purpose | | - | - | | [Wallet PnL](/data-api/universal/pnl/wallet-pnl) | Per-token profitability rows for a wallet across multiple chains - realized and unrealized PnL, ROI, volumes, and trade counts | | [Wallet PnL Summary](/data-api/universal/pnl/wallet-pnl-summary) | Aggregated wallet-level totals across all queried chains - PnL, volumes, trade counts, and win rate | | [Top Traders by Token](/data-api/universal/pnl/top-traders) | Leaderboard of top traders for a (chain, token) pair, ranked by a selectable PnL metric | *** ## Migrating from the legacy Deep Index endpoints These endpoints supersede the single-chain Deep Index profitability endpoints. The headline change is **multi-chain in one request**, plus new filters (`excludeLowLiquidity`, `minVolumeUsd`, `minTradeCount`) and flexible time ranges (`period` or explicit timestamps). | Legacy (Deep Index) | New (Universal) | | - | - | | [Wallet PnL Breakdown](/data-api/evm/wallet/wallet-pnl) - `GET /wallets/{address}/profitability` | [Wallet PnL](/data-api/universal/pnl/wallet-pnl) - `GET /v1/wallets/{walletAddress}/pnl` | | [Wallet PnL Summary](/data-api/evm/wallet/wallet-pnl-summary) - `GET /wallets/{address}/profitability/summary` | [Wallet PnL Summary](/data-api/universal/pnl/wallet-pnl-summary) - `GET /v1/wallets/{walletAddress}/pnl/summary` | | [Top Traders by Token](/data-api/evm/token/signals/top-traders) - `GET /erc20/{address}/top-gainers` | [Top Traders by Token](/data-api/universal/pnl/top-traders) - `GET /v1/chains/{chainAlias}/tokens/{tokenAddress}/top-traders` | *** ## Common Use Cases * **Portfolio Trackers** - show realized/unrealized PnL and ROI per holding across every chain in one call * **Trading Platforms** - surface win rate and PnL summaries on wallet profiles * **Token Analytics** - rank a token's top traders by realized PnL, volume, or trade count to spot smart money * **Copy Trading & Signals** - find consistently profitable wallets for a token and follow their activity * **AI Agents** - hand the model a wallet's full multi-chain profitability picture in a single response *** ## Get Started * [Wallet PnL](/data-api/universal/pnl/wallet-pnl) * [Wallet PnL Summary](/data-api/universal/pnl/wallet-pnl-summary) * [Top Traders by Token](/data-api/universal/pnl/top-traders) # Top Traders by Token Source: https://docs.moralis.com/data-api/universal/pnl/top-traders openapi-files/data-api/api-v1.json GET /v1/chains/{chainAlias}/tokens/{tokenAddress}/top-traders Leaderboard of top traders for a (chain, token) pair, ranked by a selectable PnL metric, with per-trader volumes and realized/unrealized profit. > [!NOTE] > > This is the successor to the legacy Deep Index [Top Traders by Token](/data-api/evm/token/signals/top-traders) endpoint, with a selectable ranking metric (`sortBy`) and low-liquidity, volume, and trade-count filters. # Wallet PnL Source: https://docs.moralis.com/data-api/universal/pnl/wallet-pnl openapi-files/data-api/api-v1.json GET /v1/wallets/{walletAddress}/pnl Per-token profitability rows for a wallet, including realized and unrealized PnL, ROI, volumes, and trade counts. > [!NOTE] > > This is the multi-chain successor to the legacy Deep Index [Wallet PnL Breakdown](/data-api/evm/wallet/wallet-pnl) endpoint. Pass multiple `chains` (or `mainnets`) to get per-token profitability across chains in a single request. # Wallet PnL Summary Source: https://docs.moralis.com/data-api/universal/pnl/wallet-pnl-summary openapi-files/data-api/api-v1.json GET /v1/wallets/{walletAddress}/pnl/summary Aggregated wallet-level profitability totals across all queried chains: PnL, volumes, trade counts, and win rate. > [!NOTE] > > This is the multi-chain successor to the legacy Deep Index [Wallet PnL Summary](/data-api/evm/wallet/wallet-pnl-summary) endpoint. Pass multiple `chains` (or `mainnets`) to get aggregated wallet-level totals across chains in a single request. # Token Analytics Source: https://docs.moralis.com/data-api/universal/token/analytics/token-analytics openapi-files/data-api/api.json GET /tokens/{tokenAddress}/analytics Retrieve detailed trading analytics for a specific token, including buy volume, sell volume, buyers, sellers, transactions, liquidity and FDV trends over time. 📦 **Own this data instead.** Move this endpoint onto your own infrastructure with [Data Feeds](/data-feeds/migration/token-analytics) — the same decoded onchain dataset, in real time, with no per-call limits. # Token Analytics (Batch) Source: https://docs.moralis.com/data-api/universal/token/analytics/token-analytics-multi openapi-files/data-api/api.json POST /tokens/analytics Fetch analytics for multiple tokens, including buy volume, sell volume, buyers, sellers, transactions, liquidity and FDV trends over time. Accepts an array of up to 200 tokens, each requiring chain and tokenAddress. # Token Analytics - Timeseries Source: https://docs.moralis.com/data-api/universal/token/analytics/token-analytics-timeseries openapi-files/data-api/api.json POST /tokens/analytics/timeseries Fetch timeseries swap buy volume, sell volume, liquidity and FDV for multiple tokens. Accepts an array of up to 200 tokens, each requiring chain and tokenAddress. # Token API Overview Source: https://docs.moralis.com/data-api/universal/token/overview Search, score, rank, and analyze tokens across EVM chains and Solana through a single, multichain interface. ## Overview The **Token API** gives you a unified, multichain interface for discovering and analyzing tokens across EVM networks and Solana. Search by address, name, or symbol, pull token scores and analytics, and surface trending or top-moving tokens — all without writing chain-specific logic. *** ## What Is the Token API? The Token API lets you: * **Search Tokens** — find tokens by contract address, pair address, name, or symbol * **Score Tokens** — retrieve a token score and historical score timeseries * **Discover Tokens** — list filtered, trending, and top-gaining / top-losing tokens * **Analyze Tokens** — get buy/sell volume, buyers, sellers, transactions, liquidity, and FDV trends *** ## Key Features * **Cross-chain by default** — one endpoint shape spans EVM and Solana * **Discovery and ranking** — trending, top gainers, top losers, and customizable filtering * **Scoring** — current token score plus historical timeseries to track quality over time * **Deep analytics** — buy/sell volume, buyer/seller counts, transactions, liquidity, and FDV — single token, multi-token, or timeseries * **Sort and filter** — rank results by market cap, liquidity, volume, and more *** ## Endpoints | Group | Endpoint | Purpose | | - | - | - | | Search | [Token Search](/data-api/universal/token/search/token-search) | Find tokens by address, name, or symbol | | Score | [Token Score](/data-api/universal/token/score/token-score) | Current score and quality metrics for a token | | Score | [Token Score Timeseries](/data-api/universal/token/score/token-score-timeseries) | Historical score for a token | | Discovery | [Trending Tokens](/data-api/universal/token/trending-tokens) | Tokens trending across the market | | Analytics | [Token Analytics](/data-api/universal/token/analytics/token-analytics) | Trading analytics for a single token | | Analytics | [Multi-Token Analytics](/data-api/universal/token/analytics/token-analytics-multi) | Trading analytics for a batch of tokens | | Analytics | [Token Analytics Timeseries](/data-api/universal/token/analytics/token-analytics-timeseries) | Historical trading analytics for a token | | Prices | [Token Price Timeseries](/data-api/universal/token/price/token-price-timeseries) | Historical price points for line charts | | Prices | [Token Price Sparkline](/data-api/universal/token/price/token-price-sparkline) | Compact, chart-ready price array for sparklines | *** ## Common Use Cases * **Token discovery**\ (surface trending, top-gaining, and newly notable tokens) * **Wallet and portfolio apps**\ (resolve token metadata and show market context next to holdings) * **Trading and analytics platforms**\ (rank tokens by quality, momentum, or liquidity and dive into per-token analytics) * **Research and screening**\ (filter the long tail by score, volume, or liquidity to find candidates) * **Risk and quality signals**\ (combine score and analytics to flag illiquid or low-quality tokens) *** ## Get Started Pick an endpoint above to start querying tokens, or head to the [Universal API overview](/data-api/universal/overview) to see how the Token API fits alongside the rest of the multichain Data API. # Token Price Sparkline Source: https://docs.moralis.com/data-api/universal/token/price/token-price-sparkline openapi-files/data-api/api-v1.json GET /v1/chains/{chainAlias}/tokens/{tokenAliasOrTokenAddress}/price/sparkline Get a small set of historical price points suitable for sparkline charts (tiny charts in token lists, watchlists, portfolio rows). Returns a fixed number of points based on the selected range. > [!NOTE] > > Returns a fixed number of price points for the selected `range` (`24h` to `1y`) - a compact, chart-ready array you can drop directly into a sparkline widget without resampling. For native coins, pass `native` as `tokenAliasOrTokenAddress`. # Token Price Timeseries Source: https://docs.moralis.com/data-api/universal/token/price/token-price-timeseries openapi-files/data-api/api-v1.json GET /v1/chains/{chainAlias}/tokens/{tokenAliasOrTokenAddress}/price/timeseries Get historical price data points for a specific token address, suitable for rendering line charts. Supports various time intervals from 5 minutes to monthly. > [!NOTE] > > Returns historical price data points for a token, ready for line charts. Choose an `interval` from `5m` up to `monthly`, and set `forwardFill=true` to fill gaps with the last known price. For native coins, pass `native` as `tokenAliasOrTokenAddress`. # Token Score Source: https://docs.moralis.com/data-api/universal/token/score/token-score openapi-files/data-api/api.json GET /tokens/{tokenAddress}/score Retrieve a score for a specific token along with detailed metrics including price, volume, liquidity, transaction counts, and supply information. # Token Score - Timeseries Source: https://docs.moralis.com/data-api/universal/token/score/token-score-timeseries openapi-files/data-api/api.json GET /tokens/{tokenAddress}/score/historical Retrieve historical score data for a specific token over time. # Token Search Source: https://docs.moralis.com/data-api/universal/token/search/token-search openapi-files/data-api/api.json GET /tokens/search Search for tokens using their contract address, pair address, name, or symbol. Cross-chain by default with support to filter by chains. Additional options to sortBy various metrics, such as market cap, liquidity or volume. # Trending Tokens Source: https://docs.moralis.com/data-api/universal/token/trending-tokens openapi-files/data-api/api.json GET /tokens/trending List top tokens trending based on trading activity, volume, liquidity and more. By default this returns cross-chain results, including Solana. Optionally filter by `chain` for single chain results. # Cross-Chain Token Balances Source: https://docs.moralis.com/data-api/universal/wallet/cross-chain-token-balances openapi-files/data-api/api-v1.json GET /v1/wallets/{walletAddressOrPublicKey}/tokens Get token balances from multiple chains for a specific wallet address. For Bitcoin wallets, filter parameters (excludeNative, excludeSpam, etc.) are ignored — only the native BTC balance is returned. > [!TIP] > > Seeing spam tokens or inflated USD values? Set `excludeSpam`, `liquidityThreshold` and `maxTokenInactivity`. See [Accurate Net Worth & Token Balances](/data-api/data-features/safety-and-trust/accurate-net-worth-and-balances) for recommended values. > [!NOTE] > > This is the multi-chain successor to the legacy Deep Index [Token Balances](/data-api/evm/wallet/token-balances-legacy) endpoint. The same filters - spam exclusion, unverified contracts, liquidity thresholds, USD pricing - are preserved. The headline change is that **a single request now returns balances across multiple chains.** > > Covers EVM chains and Bitcoin (pass `bitcoin` in `chains`, with an address or xpub as the path parameter). Solana balances are available today through the dedicated [Solana Wallet API](/data-api/solana/wallet/overview); bringing them into this endpoint is on the roadmap. Set `includeSparklines` or `includePnl` to enrich each token with a 7-day price sparkline or a PnL summary. ## How to Fetch Cross-Chain Token Balances [How to Fetch Cross-Chain Token Balances with One API Call | Moralis Data APIs](https://www.youtube.com/embed/zjL5oEp8MFM) # Wallets API Source: https://docs.moralis.com/data-api/universal/wallet/overview Multi-chain wallet endpoints in the Universal API - return balances and holdings across multiple chains in a single request. ## Overview The **Universal Wallets API** brings multi-chain wallet data into a single, consistent request shape. Instead of querying one chain at a time and stitching responses together client-side, you ask for the chains you care about in one call and receive a unified response. The first endpoint in this group is **Cross-Chain Token Balances** - a multi-chain version of one of our most-used Deep Index endpoints. *** ## What Is the Universal Wallets API? The Universal Wallets API lets you query: * **Cross-Chain Token Balances** - Token balances for a wallet across multiple chains in one call Wallet profitability also went multi-chain: see [Wallet PnL](/data-api/universal/pnl/wallet-pnl) and [Wallet PnL Summary](/data-api/universal/pnl/wallet-pnl-summary) in the [PnL API](/data-api/universal/pnl/overview). More multi-chain wallet endpoints are on the way as we consolidate cross-chain functionality into the Universal API. *** ## Key Features * **Multi-chain in one call** - Query a wallet across many chains in a single request * **Same trusted filters** - Spam exclusion, unverified contracts, liquidity thresholds, USD pricing - all carry over from the legacy Deep Index endpoints * **Unified response shape** - One schema across chains, no client-side stitching * **Direct migration path** - Existing implementations port cleanly with minimal changes *** ## Common Use Cases * **Wallets** - Show full multi-chain holdings on a single screen * **Exchanges** - Surface a user's deposit balances across networks * **Portfolio Trackers** - Aggregate token holdings across EVM and Bitcoin in one query, with Solana available today through its [dedicated Wallet API](/data-api/solana/wallet/overview) * **Tax Tools** - Pull a complete asset list per wallet for cost-basis and reporting flows * **AI Agents** - Hand the model a single response containing the wallet's full token footprint *** ## Roadmap Cross-Chain Token Balances currently covers EVM chains and Bitcoin (address or xpub) in the same multi-chain request. Solana already has full standalone coverage through its dedicated API: * [**Solana Wallet API**](/data-api/solana/wallet/overview) - Solana balances, NFTs, and portfolio, today Next on this endpoint: bringing Solana into the same multi-chain request shape, so one call returns balances across EVM, Bitcoin, and Solana wallets. *** ## Get Started * [Cross-Chain Token Balances](/data-api/universal/wallet/cross-chain-token-balances) # Direct Reads: REST/HTTP and Arrow Flight Source: https://docs.moralis.com/data-feeds/access-methods/direct-reads Read Data Feeds directly over REST/HTTP for simple pulls, or over Arrow Flight (gRPC) for high-throughput columnar transfers into analytical tooling. Not every workload needs a database sink or a streaming consumer. When you want to **pull feed data on demand**, Data Feeds supports two direct read paths. ## REST / HTTP Read feed data over plain HTTP. This is the simplest way in: no client libraries beyond an HTTP client, no infrastructure to run. **Use it for** spot checks, low-volume integrations, and getting a feel for a feed's shape before committing to a heavier access method. ## Arrow Flight (gRPC) [Arrow Flight](https://arrow.apache.org/docs/format/Flight.html) is a gRPC-based protocol for moving [Apache Arrow](https://arrow.apache.org/) columnar data at high throughput. Instead of serializing rows one at a time, it transfers column batches that land directly in Arrow-native tooling (dataframes, query engines, and analytical libraries) without a conversion step. **Use it for** bulk pulls into Python or other analytical environments, where row-oriented HTTP APIs become the bottleneck. ## Choosing a direct read path | You want… | Use | | - | - | | A quick look at a feed, or a simple low-volume integration | **REST / HTTP** | | Bulk, high-throughput pulls into dataframes or analytics | **Arrow Flight** | | The same data continuously landed or streamed instead | See the [access methods overview](./overview) | > [!NOTE] > > **Availability.** Endpoint details and availability vary per feed. Check the feed configuration in Moralis Admin. [Try it today](https://admin.moralis.com/data-feeds) # Access Methods: Databases, Streams, and Direct Reads Source: https://docs.moralis.com/data-feeds/access-methods/overview One data lake, many ways out. Compare the three ways to consume Data Feeds (database sinks, streaming clients, and direct reads) and pick the right path for your workload. Data Feeds is a single service over **one data lake**. Moralis writes each chain's decoded data once, then exposes that same data through several interfaces, so you consume it with the tools your team already works with, **without building the blockchain indexing layer behind it**. There are three ways out. They are access modes of one service, not separate products, so you can mix them and switch between them without re-tooling. ## Database sinks: Postgres, MySQL, ClickHouse Point a [template](../templates/overview) at your own **Postgres, MySQL, or ClickHouse** database and the sink continuously lands **ready-to-query tables**. Moralis does the heavy lifting in the template, decoding, enrichment, and reorg correction, so you query a production-grade dataset inside your own stack. **Use this if** you want queryable tables in a database you control, especially for request/response needs like "a wallet's balances." See [Database sinks](../concepts/destinations) for choosing between the three. ## Streaming: Kafka, RabbitMQ, SQS Consume feeds through **supported streaming interfaces** using **Kafka-compatible**, **RabbitMQ/AMQP**, or **SQS-compatible** clients, depending on the feed and current availability. Bring the consumers you already run instead of building a new ingestion path. **Use this if** you already operate an event pipeline and want onchain data flowing through it. See [Streaming](./streaming). ## Direct reads: REST/HTTP and Arrow Flight Read feed data directly over **REST/HTTP** for simple pulls, or over **Arrow Flight (gRPC)** for high-throughput columnar transfers straight into analytical tooling. **Use this if** you want to pull data on demand without running a sink or a streaming consumer. See [Direct reads](./direct-reads). ## Which path fits your workload? | You need… | Best path | | - | - | | Real-time, high-volume analytics you query yourself | **ClickHouse sink** | | Tables inside an existing relational app | **Postgres or MySQL sink** | | Events flowing into an existing pipeline | **Streaming** (Kafka-compatible, RabbitMQ/AMQP, or SQS-compatible) | | High-throughput columnar pulls into dataframes | **Arrow Flight** | | Simple, occasional request/response reads | **REST/HTTP** (or a database sink for repeated queries) | > [!NOTE] > > **Availability.** Supported interfaces can vary by feed and chain. Confirm availability for the protocols and platforms you plan to use. Whichever path you choose, it's the **same data lake** underneath: each record is a block carrying decoded balances, transfers, swaps, prices, approvals, NFT activity, and raw logs. See [What Are Data Feeds?](../concepts/what-are-data-feeds) and [The `block` array](../concepts/the-block-array). [Try it today](https://admin.moralis.com/data-feeds) # Streaming Data Feeds: Kafka, RabbitMQ, and SQS Source: https://docs.moralis.com/data-feeds/access-methods/streaming Consume Data Feeds through supported streaming interfaces using Kafka-compatible, RabbitMQ/AMQP, or SQS-compatible clients. Bring your existing consumers instead of building new ingestion. If your infrastructure already moves events through Kafka, RabbitMQ, or SQS, you don't need to build a new ingestion path for onchain data. Data Feeds supports **familiar streaming interfaces**, so you can consume feeds with the client libraries your team already runs: * **Kafka-compatible**: consume feeds using Kafka client libraries. * **RabbitMQ / AMQP**: consume feeds using standard AMQP clients. * **SQS-compatible**: poll feeds through an SQS-style HTTP API. Which interfaces are available can depend on the feed and current availability, so confirm the protocols available for your feed before you build. ## What you receive Each message carries **block-level decoded data**: the block's token transfers, swaps, price updates, balances, NFT activity, approvals, and the raw block/transaction/log data, laid out as typed arrays. You consume decoded records, not raw RPC payloads. See [The `block` array](../concepts/the-block-array) for the exact layout. ## Reorg handling Streaming consumers see blocks as they land. Each block records its **position and parent**, so when the chain reorganizes, your consumer (or a downstream process) can detect the rollback and correct affected records. This differs from the [database sinks](../concepts/destinations), where templates apply reorg corrections for you. See [Reorgs](../concepts/reorgs) for how rollbacks are signaled. ## Streaming vs. the sink | Choose… | When… | | - | - | | **Streaming** | You already run an event pipeline, want fan-out to multiple consumers, or apply your own processing before storage | | **Database sink** | You want ready-to-query tables with decoding, enrichment, and reorg correction handled for you | You can also combine them: land ready-to-query tables with the sink while streaming the same feed into an existing pipeline. It's the same data lake underneath, see the [access methods overview](./overview). [Try it today](https://admin.moralis.com/data-feeds) # Data Feeds vs. the REST API Source: https://docs.moralis.com/data-feeds/concepts/data-feeds-vs-the-rest-api How results from Moralis Data Feeds compare to a Web3 API endpoint, what comes through exactly, what you calculate, and what you add yourself. A Moralis Web3 API endpoint hands you a single, **pre-packaged, enriched response**. Data Feeds give you the **decoded onchain dataset that produces it**, which is exactly what lets you own the data and query it freely. Migrating means thinking in terms of that dataset rather than one fixed response. This page explains what to expect in general; each migration guide then says precisely how it applies to that endpoint. ## The one idea > The REST endpoint is a *finished dish*. A Data Feed is the *ingredients*, the same onchain facts, plus > live prices, ready for you to plate however you like (or let a template plate them for you). That's a feature, not a compromise: you get the underlying data, in real time, with no per-call limits and full control over shape, storage, and queries. ## How values compare Every migration guide classifies each field into one of these, so there are no surprises: | Class | What it means | Examples | | - | - | - | | **Exact** | Comes straight from the chain, identical to the endpoint | balances, transfers, token name/symbol/decimals, supply | | **Calculated** | Computed from the feed (often from live DEX trades). Tracks the endpoint closely; compare with a small **tolerance** rather than expecting penny-for-penny equality | USD price, USD value, portfolio %, 24-hour change | | **Yours to control** | The feed gives you everything; you apply your own rules. A gain in control, not a gap | spam/dust filtering, which rows count as a "holding" | | **Add yourself** | Off-chain signals that aren't part of onchain data, so they aren't in the feed | token **logo**/thumbnail, **spam**/**verified** labels, **security score** | ## Why these differences exist * **Prices come from real onchain trades.** Data Feeds derive USD values from DEX activity in the data lake, so they're live and verifiable, and may differ slightly from the REST API's pricing engine. A token that hasn't traded recently may not have a price yet. * **Off-chain signals live off-chain.** Logos, spam/verification labels, and security scores are curation Moralis layers on top of the chain. They aren't onchain facts, so they aren't in a feed. Bring your own source (e.g. a public token list), or layer them in alongside your Data Feeds tables. * **You own the filtering.** The REST endpoint bakes in choices (which tokens to include, spam rules); with a feed those choices are yours, so you can match your product exactly. ## Adding the off-chain extras When you need logos, spam/verification, or security scores, you have options: * **Skip them** if your app doesn't use them. * **Bring your own source**, a public token list for logos, or your own allow/deny lists. * **Layer them in** from a dedicated metadata source alongside your Data Feeds tables. ## How this shows up in a migration guide Each guide includes a **What to expect** section that applies this model to the specific endpoint, listing its fields as *exact / calculated / add yourself*, plus a field-mapping table. Read it before you start so the differences are choices you made, not surprises in production. # Database Sinks: ClickHouse, Postgres, and MySQL Source: https://docs.moralis.com/data-feeds/concepts/destinations The sink writes template data into your own database. Each template ships for ClickHouse, Postgres, and MySQL. Here's how to choose, and what changes between them. # Database sinks Data Feeds land in **your own database**. You run the sink, point it at a template, and it writes rows into a schema you own. Every template ships three destination variants, ClickHouse, Postgres, and MySQL, built from the same source data. The template and the columns are the same across all three. What differs is how each store handles **live data, chain reorgs, and scale**, and that is what should drive your choice. The sink is one of three ways to consume Data Feeds, alongside streaming and direct reads, see the [access methods overview](../access-methods/overview) if you're still choosing a path. ## The short version > **Going live or going big, use ClickHouse. Backfilling into an existing relational app, Postgres or MySQL > are first-class.** ## ClickHouse The recommended destination for **realtime, hybrid, and high-volume** workloads. * **Corrects reorgs automatically, at the block level.** ClickHouse templates use a collapsing table that emits a balancing row when a block is rolled back, so the corrected view is always available (see [Reorgs](./reorgs)). This is why every live mode prefers ClickHouse. * **Columnar and fast for analytics.** Aggregations over millions of swaps, transfers, or logs stay quick, which suits the event-list templates and dashboards. * **One reading rule to remember:** add `FINAL` to a query (or use sign-aware sums) so reorg corrections are applied. The template's example queries already show this. ## Postgres and MySQL First-class for **historical backfills** and for slotting Data Feeds into an existing relational app. * **Familiar and transactional.** If your product already runs on Postgres or MySQL, a template table drops straight in next to your other tables, with ordinary indexes and SQL. * **Best for current-state and backfill loads.** Balances, holders, metadata, and one-off history windows map cleanly. * **Realtime has a constraint.** The live reorg path needs a single-column unique key on the block position, but event-list templates expand many rows per block, so they cannot carry that key. For those templates the Postgres and MySQL variants ship in `historical` mode, and live tailing should run on ClickHouse. (See the realtime caveat in any event-list template.) ## Quick reference | You want to… | Recommended destination | | - | - | | Run a template in `realtime` or `hybrid` | **ClickHouse** | | Index high-volume event lists (swaps, transfers, logs) and query analytics | **ClickHouse** | | Backfill current-state data (balances, holders, metadata) into an app DB | **Postgres** or **MySQL** | | Keep everything in the relational store your app already uses | **Postgres** or **MySQL** (historical) | ## What stays the same Whichever you choose, the **template, the column names, and the meaning of each field are identical**. The schema variant only adapts storage details: ClickHouse uses a collapsing fact table plus skip indexes, Postgres and MySQL use plain tables with B-tree indexes. You can develop a query against one and port it with minimal change, the main difference being the `FINAL` / sign-aware reading rule that ClickHouse needs for reorg correctness. > [!NOTE] > > **Choosing by template type.** Current-state templates (balances, holders, approvals) sit comfortably in any of > the three. Live, high-volume event-list templates (swaps, transfers, logs, prices) are best on ClickHouse, > which is also where their `realtime` / `hybrid` modes are supported. See [Modes](./modes) and > [History & backfill](./history-and-backfill). [Try it today](https://admin.moralis.com/data-feeds) # History & Backfill: How Far Back Do You Need to Index? Source: https://docs.moralis.com/data-feeds/concepts/history-and-backfill Some Data Feeds answers need full history to be correct (balances, holders); others only need as much history as you want to show (swaps, logs, prices). Here's how to tell, and how to scope your backfill. When you move an endpoint onto Data Feeds, one early decision shapes your setup cost: **how far back does the sink need to index?** Get it right and you avoid both wasted backfill and, more importantly, silently wrong results. The answer depends on whether the endpoint returns **current state** or an **event list**. ## The rule of thumb > **Current-state answers need full history. Event-list answers need only as much history as you want to show.** ### Current state → needs full history Balances, holders, approvals, native balances, total supply, token metadata, these describe **what is true right now**, and "right now" is the cumulative result of **every past event**. You can't know a wallet's current balance without its most recent transfer, and that transfer could have happened at any point since the token launched. Data Feeds make this efficient, each transfer carries the **absolute balance after it** (`*PostBalance`), so a template just keeps the *latest* observation per holder rather than replaying every delta. But "latest" still means you must have **seen** each holder's most recent transfer. Start indexing too late and you simply **miss** every holder whose last activity predates your start, an incomplete, quietly wrong result. So for correctness, backfill from the beginning of the relevant history: * **By a single token** (e.g. all holders of token X) → from **that token's first block** (its deployment). You don't need chain genesis, just everything since the token existed. Much cheaper. * **By a wallet across all tokens** (e.g. a wallet's full balance set) → effectively **full history**, because the wallet may still hold something it last touched years ago. ### Event list → your choice Swaps, transfers, raw logs, price history, NFT trades, a wallet's activity feed, these are **append-only streams of past events**. Each event is independent, so there's no cumulative state to reconstruct. Backfill is purely a **product decision**: how much history do you want to display or analyze? * Only need new activity from now on? Run **realtime** with no backfill. * Want the last 90 days, or since a token launched, or everything? Backfill to that point. * Either way the data is correct, you're just choosing the window. ## Quick reference | If the endpoint returns… | Type | Backfill you need | | - | - | - | | Token holders / balances **by token** | current state | from the **token's first block** | | Wallet token balances / net worth **by wallet** | current state | **full history** | | Native balance, approvals, total supply | current state | full history (or token's first block, if token-scoped) | | Token metadata (name/symbol/decimals) | current state | back to the **token's deployment** (or read from chain) | | Swaps / transfers / logs / prices / trades / wallet activity | event list | **your choice** (realtime, or any window) | ## How to set it Templates run in three modes, **historical** (backfill a window), **realtime** (live tail), or **hybrid** (backfill then hand off to live). For current-state answers, use historical or hybrid with the start block set to the beginning of the relevant history (`MORALIS_HISTORICAL_FROM_BLOCK`); for event lists, pick whatever window your product needs, or realtime-only. > [!NOTE] > > **Scope your backfill to save time.** Indexing a single token's holders from its deployment block is far > cheaper than indexing the whole chain from genesis. Only the broad, by-wallet/chain-wide current-state cases > truly need full history. Each migration guide states the specific answer for its endpoint up front, so you can size the backfill before you start. # Modes: Historical, Realtime, and Hybrid Source: https://docs.moralis.com/data-feeds/concepts/modes A template runs in one of three modes. The mode decides whether the sink backfills past history, tails live blocks, or does both. Here's how to pick. # Modes Every template runs in one of three modes. The mode is a single setting, but it decides the shape of your whole setup: whether the sink fills in **past history**, follows **new blocks** as they arrive, or does **both**. Pick the mode from what your product needs to show, then size the backfill window to match. ## The three modes > **Most production setups want hybrid: backfill the history you need, then stay live automatically.** ### historical Backfill a fixed window of past blocks, then stop. The sink indexes everything from your start block (`MORALIS_HISTORICAL_FROM_BLOCK`) up to the chain tip at the time it runs, and finishes. Use it for one-off loads, analytics snapshots, or to seed a table you will keep current another way. ### realtime Tail live blocks from now on, with no backfill. The sink starts at the current tip and writes each new block as it arrives. Use it when you only care about activity going forward, for example a live trade tape or a transfer alert, and you do not need any history. ### hybrid Backfill first, then hand off to live with no gap. The sink indexes your history window, then continues straight into realtime tailing. This is the default for most templates because it gives you a complete table that also stays current. Use it whenever you want both history and live data, which is most of the time. ## Quick reference | Mode | What the sink does | Use when | | - | - | - | | `historical` | Backfill a window, then stop | One-off load, analytics snapshot, seed-then-maintain-elsewhere | | `realtime` | Tail new blocks from now, no backfill | You only need activity going forward | | `hybrid` | Backfill, then continue live with no gap | You want history **and** live data (most cases) | ## How the mode relates to backfill The mode is only half the decision. The other half is **how far back** to set your start block, and that depends on whether your answer is current state or an event list, covered in [History & backfill](./history-and-backfill). In short: * **Current-state answers** (balances, holders, approvals) must backfill from the beginning of the relevant history to be correct, so they run `historical` or `hybrid` with the start block set accordingly. * **Event-list answers** (swaps, transfers, logs, prices) are correct at any window, so the start block is purely a product choice, and `realtime` with no backfill is a valid option. ## How to set it The mode is set in the template's sink config, alongside the start block: ```yaml theme={null} mode: hybrid source: filters: - "blockNumber >= ${MORALIS_HISTORICAL_FROM_BLOCK}" # e.g. tip-50000, or a token's deploy block cutoff: auto: true # let the sink choose the historical/realtime handoff point ``` > [!NOTE] > > **Realtime and hybrid run best on ClickHouse.** ClickHouse corrects chain reorgs at the block level > automatically (see [Reorgs](./reorgs)), so it is the recommended destination for any live mode. The Postgres > and MySQL template variants ship in `historical` mode for backfill loads. See [Destinations](./destinations) > for the full trade-off. # Reorgs: How Chain Reorganizations Surface, and How Templates Correct Them Source: https://docs.moralis.com/data-feeds/concepts/reorgs Near the chain tip, a block can be replaced by another. Data Feeds detect this and emit a correction, so your table converges on the canonical chain. Here's what that means for your queries. # Reorgs Blockchains do not always agree on the most recent blocks. For a short window near the tip, the network can **reorganize**: a block that looked final gets replaced by a competing block at the same height, and anything only in the replaced block is no longer part of the canonical chain. Data Feeds handle this for you, but it shapes one thing you must get right: **how you read the most recent rows.** ## How a reorg surfaces Each block carries its **position** (the block number) and its **block hash**, and the feed tracks the link back to the parent block. When the sink sees that a block at a given position has been replaced by a different hash, it knows the earlier block's rows are no longer canonical. Rather than silently deleting them, the sink writes a **correction**. The original rows were written with a `+1` marker; the reorg emits matching `-1` rows for the same data. The pair cancels out, and the rows from the new, canonical block are written in their place. Your table converges on the true chain without you re-running anything. ## What this means for your queries The correction rows are how reorgs stay safe, but they mean a naive `SELECT *` over a ClickHouse fact table can briefly show both the original and its `-1` cancel. You apply the corrections at read time: > **On ClickHouse fact tables, read with `FINAL` (or use sign-aware sums). That applies reorg corrections and > gives you the canonical result.** ```sql theme={null} -- Correct: FINAL applies the collapse SELECT block_number, from_address, to_address, amount FROM recipe_token_transfers.fact_token_transfers FINAL WHERE chain_id = 1 AND token_address = lower('0x...') ORDER BY block_number DESC LIMIT 50; -- For aggregates, sign-aware sums are cheaper than FINAL and equally correct: SELECT sum(toFloat64OrZero(amount) * sign) AS net FROM recipe_token_transfers.fact_token_transfers WHERE chain_id = 1 AND token_address = lower('0x...'); ``` The template's own example queries already follow this rule, so if you start from those you get it automatically. Postgres and MySQL template variants are intended for `historical` backfill of settled blocks, where reorgs do not apply, which is why the live reorg path is a ClickHouse strength (see [Destinations](./destinations)). ## Only the tip is provisional Reorgs only affect the **most recent** blocks. Once a block is buried under enough confirmations it is settled and will not change. So: * **Historical and settled data is stable.** A backfill of last month's swaps will not be revised. * **Near-tip data is provisional for a short window.** A row for a block from a few seconds ago may be corrected if that block reorganizes. This is normal and expected, not data loss. > [!WARNING] > > **Do not treat a brand-new tip block as final.** If your product acts on the very latest blocks (live > balances, instant alerts), expect occasional corrections in that tip window and read with `FINAL` so a > reorged row is collapsed away rather than double-counted. For settled history, no special handling is needed. ## Related * [The `block` array](./the-block-array) for where `position` and the block hash live on each row. * [Destinations](./destinations) for why ClickHouse is the home for live, reorg-correcting workloads. * [Modes](./modes) for choosing realtime or hybrid, the modes where reorg handling matters. # The `block` Array: How Transactions and Logs Are Laid Out Source: https://docs.moralis.com/data-feeds/concepts/the-block-array How raw transactions, logs, withdrawals, and block headers are packed into a single flattened array per block, and how to read them. # The `block` array A Data Feed delivers **one row per block**. Most onchain activity is exposed as typed arrays on that row (`tokenSwaps`, `tokenTransfers`, …), but the **raw** block header, transactions, logs, withdrawals, and access lists all arrive together in a single flattened array called `block`. If you're coming from the REST API, where `GET /{address}/logs` hands you ready-made log objects, this is the biggest shape change to understand. ## One array, many row types Every element of `block` has the **same wide shape**: all the `block*`, `transaction*`, `log*`, and `withdrawal*` columns exist on every element. A discriminator column, **`itemType`**, tells you what each element actually is; only the columns matching that `itemType` are populated, the rest are `null`. `itemType` is one of: `block`, `transaction`, `log`, `withdrawal`, `accessList`. So for a block with **110 transactions, each emitting 4 logs**, the `block` array contains roughly: | `itemType` | Count | Populated columns | | - | - | - | | `block` | 1 | `block*` (number, hash, timestamp, miner, gas…) | | `transaction` | 110 | `transaction*` (hash, from, to, value, receipt…) | | `log` | 440 | `log*` (index, address, topic0-3, data) | ≈ **551 elements** in that one block row (plus any `withdrawal` / `accessList` rows). ## ⚠️ Log rows don't carry the transaction hash This is the detail that trips people up. A `log` element has its `transactionIndex` and `logIndex`, the emitting `logAddress`, the four topics, and the raw `logData`, but **no `transactionHash`**. To attach the hash, join each log to its sibling `transaction` element on `transactionIndex`: * `itemType = 'transaction' AND transactionIndex = N` → the tx hash + metadata * `itemType = 'log' AND transactionIndex = N` → that transaction's logs Block-level context (`blockNumber`, `timestamp`, `blockHash`) comes from the **top-level row** (`position`, `timestamp`, `hash`), not from the log element. ## Worked example, two transactions, four logs each Top-level row for the block: `position = 21000000`, `hash = "0xblk…"`, `timestamp = 1718800000`. Below is an excerpt of its `block` array showing transactions `#5` and `#6` with their logs. Only populated columns are shown; everything else on each element is `null`. ```jsonc theme={null} [ // transaction #5, the hash lives here { "itemType": "transaction", "transactionIndex": 5, "sequenceIndex": 21, "transactionHash": "0xTX5", "transactionFrom": "0xalice", "transactionTo": "0xrouter", "transactionValue": "0", "transactionReceiptStatus": "1" /* …more tx* fields… */ }, // transaction #5's 4 logs, note: NO transactionHash, only transactionIndex = 5 { "itemType": "log", "transactionIndex": 5, "logIndex": 30, "sequenceIndex": 22, "logAddress": "0xUSDC", "logTopic0": "0xddf252ad… (Transfer)", "logTopic1": "0x…alice", "logTopic2": "0x…router", "logTopic3": null, "logData": "0x…amount" }, { "itemType": "log", "transactionIndex": 5, "logIndex": 31, "sequenceIndex": 23, "logAddress": "0xPair", "logTopic0": "0x1c411e9a… (Sync)", "logTopic1": null, "logTopic2": null, "logTopic3": null, "logData": "0x…reserves" }, { "itemType": "log", "transactionIndex": 5, "logIndex": 32, "sequenceIndex": 24, "logAddress": "0xPair", "logTopic0": "0xd78ad95f… (Swap)", "logTopic1": "0x…router", "logTopic2": "0x…alice", "logTopic3": null, "logData": "0x…amounts" }, { "itemType": "log", "transactionIndex": 5, "logIndex": 33, "sequenceIndex": 25, "logAddress": "0xWETH", "logTopic0": "0xe1fffcc4… (Withdrawal)", "logTopic1": "0x…router", "logTopic2": null, "logTopic3": null, "logData": "0x…amount" }, // transaction #6 { "itemType": "transaction", "transactionIndex": 6, "sequenceIndex": 26, "transactionHash": "0xTX6", "transactionFrom": "0xbob", "transactionTo": "0xnft", "transactionValue": "1000000000000000000", "transactionReceiptStatus": "1" }, // transaction #6's 4 logs { "itemType": "log", "transactionIndex": 6, "logIndex": 34, "sequenceIndex": 27, "logAddress": "0xNFT", "logTopic0": "0xddf252ad… (Transfer)", "logTopic1": "0x0… (mint)", "logTopic2": "0x…bob", "logTopic3": "0x…tokenId", "logData": "0x" }, { "itemType": "log", "transactionIndex": 6, "logIndex": 35, "sequenceIndex": 28, "logAddress": "0xMarket", "logTopic0": "0x… (Sale)", "logTopic1": "0x…bob", "logTopic2": null, "logTopic3": null, "logData": "0x…price" }, { "itemType": "log", "transactionIndex": 6, "logIndex": 36, "sequenceIndex": 29, "logAddress": "0xMarket", "logTopic0": "0x… (Fee)", "logTopic1": null, "logTopic2": null, "logTopic3": null, "logData": "0x…fee" }, { "itemType": "log", "transactionIndex": 6, "logIndex": 37, "sequenceIndex": 30, "logAddress": "0xRoyalty", "logTopic0": "0x… (Paid)", "logTopic1": null, "logTopic2": null, "logTopic3": null, "logData": "0x…amount" } ] ``` ## Reading it * **Get a transaction with its logs:** filter `itemType='transaction'` for the hash/metadata and `itemType='log'` for the events, both on the same `transactionIndex`, then join on `transactionIndex`. * **On-chain order** of a log is `(blockNumber, transactionIndex, logIndex)`, don't rely on physical array position; use the index columns (or `sequenceIndex` for the raw interleaving). * **Topics are flat columns.** `topic0` (the event signature hash) is always present; `topic1..topic3` are `null` when the event has fewer topics. Re-assemble a `topics[]` array if your downstream expects one. * **No decoding.** `logData` + topics are raw hex, the event name and parameters are yours to decode from the contract ABI. (The REST API's decoded/"verbose" responses do this for you; on a raw feed it's a derive-yourself step.) > The `logsByContract` and `logsByTopic0` templates do exactly this filtering+join for you and write a flat > one-row-per-log table, a drop-in for `GET /{address}/logs`. # What Are Data Feeds? Source: https://docs.moralis.com/data-feeds/concepts/what-are-data-feeds Moralis Data Feeds deliver the decoded onchain dataset as a real-time stream available inside your own stack, consumed through whatever already fits it. Moralis **Data Feeds** give you the **decoded onchain dataset**, every block turned into balances, transfers, swaps, prices, approvals, NFT activity, and raw logs, as a **real-time stream available inside your own stack**. It's the same data that powers Moralis, available for you to consume directly, without building the blockchain indexing layer behind it. ## One data lake, many ways out Data Feeds is a single service over one data lake. Moralis writes each chain's data **once**, then exposes that same data through whatever interface fits your stack, so you adopt it **without re-tooling**: ### Stream it with the tools you already use Consume feeds through **supported streaming interfaces**, using the client libraries your team already runs, depending on the feed and current availability: * **Kafka-compatible** clients. * **RabbitMQ / AMQP** clients. * **SQS-compatible** clients. …or read directly over **REST / HTTP** or **Arrow Flight (gRPC)** when you want high-throughput columnar pulls. See [Streaming](../access-methods/streaming) and [Direct reads](../access-methods/direct-reads). ### Land it with the sink Point a **template** at your own **Postgres, MySQL, or ClickHouse** and the sink continuously lands ready-to-query tables. Moralis does the heavy lifting in the template, decoding, enrichment, and reorg correction, so you get a production-grade dataset inside your own stack, queried however you like. This is the smoothest path for request/response needs (e.g. "a wallet's balances"). See [Database sinks](./destinations). > It's the **same data lake** under all of these, they're access modes of one service, not separate products. > Choose by your stack and use case; you're never locked into one shape. ## What's in a feed Each record is a **block**, carrying the decoded onchain activity for that block as typed arrays, token transfers, swaps, price updates, balances, NFT transfers, approvals, and the raw block/transaction/log data. See [The `block` array](./the-block-array) for how transactions and logs are laid out. A few properties worth knowing: * **Decoded, not raw RPC.** Swaps, transfers, balances, and prices are already extracted, you don't decode logs yourself (though the raw logs are there if you want them). * **Real-time and historical.** Read the latest blocks as they land, backfill history, or both. * **Reorg-aware.** Each block records its position and parent, so consumers (and the sink's templates) correct for chain reorganizations rather than serving stale data. * **Onchain data.** A feed contains what's on the chain. Off-chain signals (token logos, spam/verification labels, security scores) are layered on separately, see [Data Feeds vs. the REST API](./data-feeds-vs-the-rest-api). ## Where to go next * **Migrating from a Moralis REST endpoint?** Start with the relevant migration guide. * **Building something new?** Browse the template cookbook for a ready-to-run feed. * **Choosing how to consume it?** The [access methods overview](../access-methods/overview) compares all three paths with a decision table. # Data Feeds Features Source: https://docs.moralis.com/data-feeds/features Core capabilities of Moralis Data Feeds: custom indexing pipelines, real-time and historical data, multi-chain support, and enterprise-grade reliability. ### Custom indexing pipelines Build custom indexing pipelines with full control over your blockchain data. | Capability | Description | | - | - | | **Custom Schemas** | Define your own data models and schemas tailored to your use case | | **Full Control** | Configure exactly which data to index, how to transform it, and where to deliver it | | **Enterprise SLAs** | Guaranteed performance and uptime for mission-critical applications | ### Real-time & historical data Stream live events and backfill historical data across chains. | Capability | Description | | - | - | | **Live Streaming** | Stream events in real-time from any wallet, contract, or address | | **Custom Filters** | Apply custom filters with guaranteed delivery | | **Historical Backfills** | Fast backfills across chains to populate your data infrastructure | ### Ready-made templates Skip the schema design. Start from a **template** that reconstructs a popular Moralis endpoint as a continuous sync into your own database. | Capability | Description | | - | - | | **Endpoint clones** | Wallet history, token balances, prices, swaps, holders, NFT data, and raw logs: each as a copy-and-run template | | **Your schema, your control** | Templates are blueprints: keep the columns and events you want, drop the rest | | **Use-case bundles** | Group templates for a full workflow: accounting, portfolio, analytics, compliance | [Browse the template catalogue →](/data-feeds/templates/overview) ### Multi-chain support A single unified schema across EVM, Solana, and Bitcoin chains. > [card] EVM > [card] Solana > [card] Bitcoin Support across **EVM, Solana, and Bitcoin chains**, including 50+ EVM chains such as Ethereum, Polygon, Arbitrum, Base, Optimism, Avalanche, BNB Chain, and Tempo. Data is normalised into a unified schema, making cross-chain analytics straightforward. ### Enterprise-grade infrastructure Built for teams with strict compliance, security, and reliability requirements. | Capability | Description | | - | - | | **SOC 2 Type II Certified** | Pipelines meet enterprise security and compliance standards | | **Dedicated Support** | Direct access to Moralis engineering and support teams | | **Audit-Grade Data** | Data integrity verified for compliance and audit requirements | | **High Availability** | Redundant infrastructure with guaranteed uptime SLAs | ### Get started Build your first Data Feed from a template, or configure one from scratch in Moralis Admin. > [card] [Get started with Data Feeds](https://admin.moralis.com/data-feeds) > > Open Data Feeds in Moralis Admin and set up your first pipeline. # How Data Feeds Works Source: https://docs.moralis.com/data-feeds/how-it-works Understand the Data Feeds workflow: start from a template or a custom schema, configure your pipeline, and have indexed blockchain data delivered into your own database. ### Overview Moralis Data Feeds handles the complexity of blockchain data indexing so you can focus on building. It reads Moralis-indexed, normalized per-block onchain data and continuously projects it into your own database. The workflow is straightforward: ### 1. Define Start from a **template** or define a **custom schema**: * **Templates** – ready-made blueprints that reconstruct popular Moralis endpoints (wallet history, balances, prices, swaps, holders, raw logs). The fastest on-ramp. [Browse templates →](/data-feeds/templates/overview) * **Custom** – specify exactly which chains, contracts, events, and data types to index, with your own schema * **Chains** – EVM, Solana, and Bitcoin chains * **Data types** – raw data, decoded data, or both ### 2. Configure Set up your schema and transformation rules: * Define your data models and field mappings (or adapt a template's) * Configure transformations and enrichments (e.g. inline USD valuation) * Set up filters to capture only the data you need * Choose your mode: **historical** backfill, **realtime** tail, or **hybrid** (both) ### 3. Deploy Moralis deploys and manages the indexing infrastructure: * No infrastructure to provision or maintain * Automatic scaling based on data volume * Built-in redundancy and fault tolerance * Continuous monitoring and alerting ### 4. Deliver Data lands directly in your own database: * Real-time delivery as events occur on-chain * Historical backfills delivered in parallel * Reorg-safe: corrections converge your tables on canonical state automatically * Data arrives in your schema, ready to query ### Delivery destinations Data Feeds syncs into the database you run, indexed for your access pattern. | Destination | Notes | | - | - | | **ClickHouse** | First-class: the only destination with live, reorg-safe ingestion. Best for production and large windows. | | **Postgres** | Historical backfill, analytics, and smaller windows. | | **MySQL** | Historical backfill and existing MySQL stacks. | ### Architecture benefits | Benefit | Description | | - | - | | **Fully Managed** | Moralis handles all infrastructure, scaling, and maintenance | | **Low Latency** | Optimised pipelines for minimal delay between on-chain events and delivery | | **Guaranteed Delivery** | No data loss, with built-in retries and exactly-once-effective semantics | | **Reorg-Safe** | Chain reorganizations are corrected automatically so your data stays canonical | | **Cost Efficient** | Pay for the data you need, not unused infrastructure | ### Get started Build your first Data Feed from a template, or configure one from scratch in Moralis Admin. > [card] [Get started with Data Feeds](https://admin.moralis.com/data-feeds) > > Open Data Feeds in Moralis Admin and set up your first pipeline. # Map Endpoints to Templates Source: https://docs.moralis.com/data-feeds/migration/endpoints Every covered Moralis REST API endpoint, mapped to the template (or combination of templates) that replaces it. Find the endpoint you call today and see exactly what to turn on. This is the full list of Moralis REST endpoints covered by Data Feeds, **ordered by how widely each is used** (most-used first). Find the endpoint you call today; the **Templates** column tells you exactly what to turn on. Each template page has a **"Migrating from the REST API"** section with the field-by-field mapping for the endpoints it replaces. > [!WARNING] > > **Data Feeds are not a 1:1 endpoint swap.** Many endpoints return pre-joined objects that map to **a > combination of templates**: the first template listed is the core dataset, the rest complete the response. Plan > for a join (usually one SQL view) rather than a drop-in replacement. New to Data Feeds first? Read the [migration overview](/data-feeds/migration/overview) for how the API and Data Feeds differ, then come back here to pick your endpoint. ## Endpoints by usage | # | REST endpoint | Templates you need | Headline fidelity | | - | - | - | - | | 1 | `GET /wallets/:address/tokens` | [Token Balances by Wallet](/data-feeds/templates/wallet/token-balances-by-wallet) + [Native Balances](/data-feeds/templates/wallet/native-balances) + [Token Prices](/data-feeds/templates/token/token-prices) + [Token Metadata](/data-feeds/templates/token/token-metadata) | balances exact, prices calculated | | 2 | `GET /erc20/:token_address/owners` | [Token Holders](/data-feeds/templates/token/token-holders) + [Token Metadata](/data-feeds/templates/token/token-metadata) | exact | | 3 | `GET /wallets/:address/history` | [Wallet History](/data-feeds/templates/wallet/wallet-history) | exact, decode-yourself + off-chain labels | | 4 | `GET /:address/nft` | [NFTs by Wallet](/data-feeds/templates/wallet/nfts-by-wallet) + [NFT Collection Metadata](/data-feeds/templates/nft/nft-collection-metadata) | onchain exact, metadata add-yourself | | 5 | `GET /:address/erc20` | [Token Balances by Wallet](/data-feeds/templates/wallet/token-balances-by-wallet) + [Token Metadata](/data-feeds/templates/token/token-metadata) | exact | | 6 | `GET /erc20/prices` | [Token Prices](/data-feeds/templates/token/token-prices) + [Token Metadata](/data-feeds/templates/token/token-metadata) | calculated | | 7 | `GET /erc20/:tokenAddress/holders` | [Token Holders](/data-feeds/templates/token/token-holders) + [Token Transfers](/data-feeds/templates/token/token-transfers) | counts exact, tiers your-definition | | 8 | `GET /:address/erc20/transfers` | [Token Transfers](/data-feeds/templates/token/token-transfers) + [Token Metadata](/data-feeds/templates/token/token-metadata) | exact | | 9 | `POST /nft/getMultipleNFTs` | [NFT Collection Metadata](/data-feeds/templates/nft/nft-collection-metadata) + [NFT Owners by Contract](/data-feeds/templates/nft/nft-owners-by-contract) | onchain exact, metadata add-yourself | | 10 | `GET /:address/nft/transfers` | [NFT Transfers](/data-feeds/templates/nft/nft-transfers) | exact | | 11 | `GET /:address/nft/collections` | [NFTs by Wallet](/data-feeds/templates/wallet/nfts-by-wallet) + [NFT Collection Metadata](/data-feeds/templates/nft/nft-collection-metadata) | exact | | 12 | `GET /erc20/:address/price` | [Token Prices](/data-feeds/templates/token/token-prices) | calculated | | 13 | `GET /transaction/:hash/verbose` | [Contract Logs](/data-feeds/templates/logs/contract-logs) + [the block array](/data-feeds/concepts/the-block-array) | raw exact, ABI decode-yourself | | 14 | `GET /block/:block_number_or_hash` | [Contract Logs](/data-feeds/templates/logs/contract-logs) + [the block array](/data-feeds/concepts/the-block-array) | exact | | 15 | `GET /:address` (native txns) | [Wallet History](/data-feeds/templates/wallet/wallet-history) | exact | | 16 | `GET /wallets/:address/net-worth` | [Token Balances by Wallet](/data-feeds/templates/wallet/token-balances-by-wallet) + [Native Balances](/data-feeds/templates/wallet/native-balances) + [Token Prices](/data-feeds/templates/token/token-prices) | calculated | | 17 | `GET /wallets/:address/approvals` | [Token Approvals](/data-feeds/templates/wallet/token-approvals) + [Token Metadata](/data-feeds/templates/token/token-metadata) + [Token Prices](/data-feeds/templates/token/token-prices) | exact, USD-at-risk calculated | | 18 | `GET /wallets/:address/chains` | [Wallet History](/data-feeds/templates/wallet/wallet-history) | exact | | 19 | `GET /erc20/metadata` | [Token Metadata](/data-feeds/templates/token/token-metadata) + [Token Prices](/data-feeds/templates/token/token-prices) | exact, market data calculated | | 20 | `GET /pairs/:address/ohlcv` | [Pair OHLCV](/data-feeds/templates/markets/pair-ohlcv) | calculated from real trades | | 21 | `GET /erc20/:token_address/pairs` | [Swaps by Pair](/data-feeds/templates/markets/swaps-by-pair) + [Pair Reserves](/data-feeds/templates/markets/pair-reserves) + [Token Metadata](/data-feeds/templates/token/token-metadata) | pools exact, market data calculated | | 22 | `GET /erc20/:address/transfers` | [Token Transfers](/data-feeds/templates/token/token-transfers) | exact | | 23 | `GET /erc20/:tokenAddress/holders/historical` | [Historical Balances](/data-feeds/templates/token/historical-balances) + [Token Transfers](/data-feeds/templates/token/token-transfers) | exact + calculated | | 24 | `GET /nft/:address/metadata` | [NFT Collection Metadata](/data-feeds/templates/nft/nft-collection-metadata) | exact, off-chain extras | | 25 | `GET /tokens/:tokenAddress/analytics` | [Swaps by Token](/data-feeds/templates/markets/swaps-by-token) + [Token Prices](/data-feeds/templates/token/token-prices) + [Pair Reserves](/data-feeds/templates/markets/pair-reserves) | calculated | | 26 | `GET /:address/balance` | [Native Balances](/data-feeds/templates/wallet/native-balances) | exact | | 27 | `GET /nft/:address` | [NFT Owners by Contract](/data-feeds/templates/nft/nft-owners-by-contract) + [NFT Collection Metadata](/data-feeds/templates/nft/nft-collection-metadata) | onchain exact, metadata add-yourself | | 28 | `GET /wallets/:address/stats` | [Wallet History](/data-feeds/templates/wallet/wallet-history) + [NFTs by Wallet](/data-feeds/templates/wallet/nfts-by-wallet) | exact | | 29 | `GET /wallets/:address/swaps` | [Swaps by Wallet](/data-feeds/templates/markets/swaps-by-wallet) | onchain exact, USD calculated | | 30 | `GET /nft/:address/owners` | [NFT Owners by Contract](/data-feeds/templates/nft/nft-owners-by-contract) | onchain exact | ## Solana endpoints The removed Solana **token-holder** endpoints map onto the same holder templates, pointed at Solana (the feed's SPL `tokenTransfers` carry absolute post-balances, so the templates run unchanged): | REST endpoint | Templates you need | Headline fidelity | | - | - | - | | `GET /token/:network/:address/top-holders` | [Token Holders](/data-feeds/templates/token/token-holders) | exact, USD calculated | | `GET /token/:network/holders/:address` | [Token Holders](/data-feeds/templates/token/token-holders) + [Token Transfers](/data-feeds/templates/token/token-transfers) | totalHolders exact, tiers your-definition | | `GET /token/:network/holders/:address/historical` | [Historical Balances](/data-feeds/templates/token/historical-balances) | per-bucket totals exact, change calculated | The removed **launchpad / discovery** endpoints (pump.fun, Raydium LaunchLab) are all served by the one [Token Bonding Status](/data-feeds/templates/token/token-bonding-status) template over the `launchpadEvents` feed: | REST endpoint | Templates you need | Headline fidelity | | - | - | - | | `GET /token/:network/exchange/:exchange/new` | [Token Bonding Status](/data-feeds/templates/token/token-bonding-status) | exact, price calculated | | `GET /token/:network/exchange/:exchange/bonding` | [Token Bonding Status](/data-feeds/templates/token/token-bonding-status) | progress exact, price calculated | | `GET /token/:network/exchange/:exchange/graduated` | [Token Bonding Status](/data-feeds/templates/token/token-bonding-status) + [Token Prices](/data-feeds/templates/token/token-prices) | exact (+ DEX pool) | | `GET /token/:network/:address/bonding-status` | [Token Bonding Status](/data-feeds/templates/token/token-bonding-status) | exact | ## Not covered yet * **Other Solana endpoints** (prices, swaps, portfolio, metadata) are not yet covered. * **Search and discovery endpoints** (`/tokens/search`) are a search product, not an indexed feed. * **RPC node methods** (`eth_*`) belong to the node product, not Data Feeds. # Migrating from the Moralis REST API Source: https://docs.moralis.com/data-feeds/migration/overview Already using Moralis REST API endpoints? This is the background you need before you move an endpoint onto Data Feeds: how the two differ, why the schema is not a copy, and the gotchas to plan for. If you already call the Moralis Web3 Data API, you can move endpoint by endpoint onto **Data Feeds**. You go from a pre-packaged REST response to the **underlying decoded data that produces it**, served from a database you own, in real time, with no per-call limits and full control over how you store and query it. This page is the background to read **once**. When you are ready to move a specific endpoint, go to the [endpoint list](/data-feeds/migration/endpoints) and pick the one you call today. ## API vs. Data Feeds: why they are different The Data API hands you a **finished answer**. A single call returns a wallet's tokens, already joined to prices, metadata, and spam flags, shaped into one JSON response. Data Feeds hand you the **decoded onchain data that answer is built from**, streamed into a database you own. You assemble the answer yourself, which is what gives you no per-call limits, full history, and control over filtering and pricing. That trade has one consequence worth internalizing before you start: > [!NOTE] > > **A Data Feed reconstructs an endpoint, it is not a byte-for-byte copy of the old response.** The same facts > are there, but they arrive as raw rows across a few datasets rather than one pre-joined object. You do the > join (usually one SQL view), and you decide what to do about the off-chain extras. ## Start with the model, once Two concept pages explain how Data Feeds work, so every template links here instead of repeating it. Read these first and the per-endpoint migration sections go quickly: * [What are Data Feeds?](/data-feeds/concepts/what-are-data-feeds) The one data lake, and the [ways to consume it](/data-feeds/access-methods/overview) (Kafka-compatible / AMQP / SQS-compatible clients, REST / Arrow Flight, or the sink into your own database). * [Data Feeds vs. the REST API](/data-feeds/concepts/data-feeds-vs-the-rest-api) The fidelity model: a Data Feed reconstructs an endpoint from raw onchain data, it is not a byte-for-byte copy of the old response. ## The schema gotchas to plan for These are the differences that surprise people first. Each template's migration section states the answer for its own endpoint(s), but the pattern is always one of these: | You had in the API response | Where it comes from in Data Feeds | | - | - | | **One pre-joined object** (e.g. a wallet token with balance, price, metadata) | Several datasets you join yourself, usually in one SQL view. One endpoint often maps to **more than one template**. | | **A derived USD value** (price, net worth, USD-at-risk) | **Calculated** from live DEX trades. Very close to the old value, best compared with a small tolerance, not byte-equality. | | **An off-chain signal** (logos, spam flags, security scores) | **Not in the lake.** Bring your own source, or drop the field. | | **A field that needs full history to be correct** (balances, holders, approvals) | Correct only once you backfill. Decide your [backfill](/data-feeds/concepts/history-and-backfill) before you start. | ### How to read the fidelity of a migration Every field-mapping table classifies each output value so you can plan with confidence. Throughout, you will see three labels: | Label | Meaning | | - | - | | **exact** | Comes straight from the chain, identical to the old endpoint (balances, transfers, metadata). | | **calculated** | Derived from real onchain activity, for example USD prices from live DEX trades. Very close to the old value, best compared with a small tolerance. | | **add yourself** | An off-chain signal (logos, spam flags, security scores) that is not in the lake. Bring your own source, or skip it. | ## Find your endpoint When you are ready, the **[Map endpoints to templates](/data-feeds/migration/endpoints)** table maps every covered Moralis REST endpoint to the template (or **combination of templates**) that replaces it, ordered by usage. Migration details live **on the template pages themselves**: each template has a "Migrating from the REST API" section with the field-by-field mapping, the required template combination, one reconstruction query, and the endpoint-specific gotchas. One page per dataset: the template is the single source of truth. New to Data Feeds entirely? Start with the **[quickstart](/data-feeds/migration/quickstart)** to get live data flowing into your own database in about ten minutes, then come back and migrate your endpoints. And skim [Gotchas & troubleshooting](/data-feeds/migration/troubleshooting) before your first run; it lists every known failure point with the fix. ## How each migration section is structured Every template's "Migrating from the REST API" section follows the same shape, so once you have read one you can skim the rest: 1. **The REST endpoint(s)** it replaces, and whether you need this template alone or a **combination**, stated up front, with links to the other templates you need. 2. **Field mapping reference**, the per-field table with the fidelity label. 3. **One reconstruction query**, the SQL view that rebuilds the old response shape. 4. **Good to know**, the endpoint-specific gotchas worth knowing before you ship. # Quickstart: Run Your First Sink Source: https://docs.moralis.com/data-feeds/migration/quickstart Get live, decoded onchain data flowing into your own database in about ten minutes. Generate a sink starter pack, run it with Docker, and query your first rows. This quickstart takes you from nothing to **live onchain data in your own database** in about ten minutes. You generate a **sink starter pack** in the Admin Panel, run it with Docker, and query your first rows. Every [template](/data-feeds/templates/overview) and [migration guide](/data-feeds/migration/overview) then follows the same pattern. ## Before you begin > [!WARNING] > > **Data Feeds is a technical product: you run the infrastructure.** Unlike the REST API, the data lands in a > database **you own and operate**: you run the Docker sink, you provision Postgres/ClickHouse (locally for this > quickstart; on your own servers in production), and you are responsible for storing, sizing, and backing up > the decompressed data. Decoded onchain data expands significantly from its compressed transport size, so budget > disk accordingly. * **Docker** and Docker Compose installed and running. * A **Data Feeds API key** (`cm_live_...`) from Moralis Admin. * Access to the **Moralis Admin Panel**, where you generate the sink config. * A machine with enough **disk headroom** for your backfill window: start small (`tip-500`) and widen once you've seen the per-block footprint for your chain. [Open Data Feeds in Moralis Admin](https://admin.moralis.com/data-feeds) ## Step 1: generate your sink starter pack In the Admin Panel, configure a sink (pick your **chain**, **topic**, and **destination database**) and download the **starter pack** (`continuum-sink-starter.zip`). Unzip it. You get: | File | What it is | | - | - | | `sink-config.yaml` | The sink config you generated: Continuum URL, `namespace` (chain), `topic`, and destination. | | `docker-compose.yml` | Brings up the sink (`moralisweb3/continuum-sink`) plus a local PostgreSQL. | | `.env` | Your API key and DB password. **Do not commit or share it.** | | `schema.sql` | DDL for the destination table(s), auto-applied to Postgres on first start. | | `README.txt` | The same steps you are reading here. | > [!NOTE] > > **`namespace` is the chain, as a hex chain ID.** For example `0x1` is Ethereum, `0xa4b1` is Arbitrum One. See > the [chain reference](#chain-reference) below. `topic` (e.g. `master-3`) is the master block stream the sink > reads. ## Step 2: add your API key Open `.env` and confirm your key is set; the generated file sometimes ships with a **blank or placeholder** key: ```bash theme={null} # .env (do not commit) MORALIS_API_KEY=cm_live_... # your full key — the sink fails with "api_key is required" if blank SINK_PG_PASSWORD=... # already set for the bundled Postgres ``` > [!WARNING] > > **Keep your key private.** It is a live credential. Never commit `.env` or paste the key into shared docs or > chat. If a key leaks, rotate it. ## Step 3: start the stack From the unzipped directory: ```bash theme={null} docker compose up -d ``` This starts PostgreSQL (with `schema.sql` applied) and the sink. The sink reads a backfill window from the upstream S3 store, then tails live blocks. Watch it work: ```bash theme={null} docker compose logs -f sink ``` > [!TIP] > > **Querying from your own app on the host?** The bundled Postgres is only reachable inside the Docker network > by default. Add a port mapping to the `postgres` service so you can connect from your machine: > > ```yaml theme={null} > postgres: > ports: > - "5544:5432" > ``` > > Then connect to `localhost:5544` (user/db `sdf`, password from `.env`). ## Step 4: query your first rows The default `tokenTransfers` config writes to a table named after your sink (here, `sdf`): ```bash theme={null} docker compose exec postgres psql -U sdf -d sdf -c \ "SELECT count(*), max(position) AS latest_block FROM public.sdf;" ``` ```sql theme={null} -- the most recent transfers SELECT position, tokenaddress, fromaddress, toaddress, value FROM public.sdf ORDER BY position DESC LIMIT 20; ``` You should see the count climb as new blocks land. That is live, decoded onchain data in a store you own: no API quotas, no per-call limits. ## If no rows arrive The pipe has a few moving parts. Work down this list: | Symptom | Cause | Fix | | - | - | - | | `continuum.api_key is required` in sink logs | `MORALIS_API_KEY` blank in `.env` | Paste your full `cm_live_...` key, `docker compose up -d --force-recreate sink`. | | Sink logs stop after `s3-proxy reachable` and rows stay at 0 | Upstream S3 backfill stalled (e.g. "Partition not found") | Not your setup. Confirm the chain/topic backfill is healthy with the team, then it resumes automatically. | | Can connect but app can't reach Postgres | No host port mapping | Add the `ports` block from Step 3. | ## Chain reference `namespace` in `sink-config.yaml` is the chain's ID in hex: | Chain | Chain ID | `namespace` | | - | - | - | | Ethereum | 1 | `0x1` | | Optimism | 10 | `0xa` | | BNB Chain | 56 | `0x38` | | Polygon | 137 | `0x89` | | Base | 8453 | `0x2105` | | Arbitrum One | 42161 | `0xa4b1` | | Avalanche | 43114 | `0xa86a` | ## What just happened * The **starter pack** carried a generated `sink-config.yaml` (chain, topic, destination) and a matching schema. * The **sink** (`moralisweb3/continuum-sink`) read the master block stream, backfilled history, then stayed live. * You queried a normal SQL table, yours to join and shape freely. ## Next steps * **Migrating an existing integration?** Find your endpoint in the [Migration guides](/data-feeds/migration/overview). * **Want a different dataset?** Browse the [templates](/data-feeds/templates/overview): swaps, balances, holders, prices, NFT activity. They all run the same way; swap the transform and schema. * **Understand the model:** [What are Data Feeds?](/data-feeds/concepts/what-are-data-feeds), [History & backfill](/data-feeds/concepts/history-and-backfill), and [Destinations](/data-feeds/concepts/destinations). * **Hit something surprising?** The [Troubleshooting](/data-feeds/migration/troubleshooting) page covers the common first-run questions. # Migrating from Moralis Streams Source: https://docs.moralis.com/data-feeds/migration/streams-overview Using Streams webhooks today? Here is how the model maps onto Data Feeds: push webhooks vs. data flowing into a database you own. If you use **Moralis Streams**, you receive webhooks: you define a stream (addresses, topics, chains), Moralis watches the chain, and decoded events are **pushed** to your server as they happen. **Data Feeds** deliver the same decoded onchain data with the direction reversed: instead of receiving pushes and storing what you need, the data **flows directly into a database you own**: historical backfill and live tail through one pipe. Your webhook handler, retry logic, and ingestion queue disappear; what remains is a table you query. ## How the concepts map | In Streams | In Data Feeds | | - | - | | A **stream config** (addresses, topics, ABIs) | A **template** plus SQL filters, e.g. [token-transfers](/data-feeds/templates/token/token-transfers), [contract-logs](/data-feeds/templates/logs/contract-logs) filtered to your addresses or topics | | A **webhook payload** pushed per event | **Rows in your own database**, written by the sink as blocks land | | Your **webhook endpoint + retries + queue** | Nothing: delivery, ordering, and resume are the sink's job | | `confirmed: true/false` payloads for reorg safety | [Reorg handling](/data-feeds/concepts/reorgs) built into the pipe | | **Replay / history** (limited) | **Full backfill**: the same feed serves history and live data ([how backfill works](/data-feeds/concepts/history-and-backfill)) | The practical difference: a webhook tells you *something happened*, and building state from webhooks (balances, holder counts, volumes) is your accounting problem. A Data Feed hands you the rows already in SQL: state is a query, not a pipeline you maintain. ## Why teams move * **No delivery infrastructure.** No public webhook endpoint, no signature checks, no retry handling, no ingestion queue. Data lands in your database directly. * **History and live in one pipe.** A new stream starts at "now"; a feed backfills as deep as you need, then stays live. * **Consume it your way.** The same feed can flow into Postgres today and your own Kafka, AMQP, or SQS consumers as the platform's export options roll out; see [What are Data Feeds?](/data-feeds/concepts/what-are-data-feeds) for the consumption model. ## Try the model now You can evaluate Data Feeds against your current Streams setup today: 1. Run the **[quickstart](/data-feeds/migration/quickstart)**: live decoded data in your own Postgres in about ten minutes. 2. Find the [template](/data-feeds/templates/overview) closest to what your stream watches (token transfers, contract logs, swaps, NFT activity). 3. Keep your stream running in parallel while you compare; nothing about trying Data Feeds disturbs your existing Streams setup. # Gotchas & Troubleshooting Source: https://docs.moralis.com/data-feeds/migration/troubleshooting Every known failure point when consuming Data Feeds (symptom, why it happens, and the fix) so you don't discover them the hard way. Covers the sink pipe, the live-vs-settled data boundary, and query-time surprises. The complete list of things that surprise people when consuming Data Feeds. Each entry is **symptom, why, and what to do**. Skim the headings before your first run; five minutes here saves hours of debugging. > [!WARNING] > > **You are running real infrastructure.** Data Feeds deliver decoded onchain data into a database **you own and > operate**: Docker, Postgres/ClickHouse, disk, and backfill windows are your responsibility. If you have not > run the pipe yet, start with the [quickstart](/data-feeds/migration/quickstart). ## Sink pipe gotchas ### The sink exits with `NUMBER_OF_COLUMNS_DOESNT_MATCH` **Symptom:** every batch fails with `Code: 20. DB::Exception: Number of columns doesn't match (source: 1 and result: 7)`. **Why:** the sink's `transform_sql` output must **positionally match** the destination table's columns. With no transform configured, the sink falls back to selecting a single column, which can never match a multi-column schema. **Do this:** make sure `sink-config.yaml` has a `transform_sql` whose SELECT list matches your destination table column-for-column, and a `parquet_columns` list naming the top-level fields the transform reads (e.g. `[position, tokenTransfers]`). If your starter pack shipped without one, add it; the config schema inside the sink image documents the pattern. ### The sink logs `api_key is required` **Why:** the generated `.env` sometimes ships with a blank or placeholder key. **Do this:** paste your full `cm_live_...` key into `.env`, then `docker compose up -d --force-recreate sink`. ### Every request returns HTTP 500 immediately **Why:** usually the wrong Continuum URL. The config must point at the **read-replica host**, not the admin panel host. Also check you are connected through your assigned VPN gateway if your access is VPN-gated. **Do this:** verify `continuum.url` in `sink-config.yaml` and your VPN connection before debugging anything else. ### The backfill fails with `Partition not found` **Symptom:** `HTTP 500: Failed to read Parquet footer: Partition not found: s3://...`. **Why:** your backfill window includes blocks whose settled files are not available: either the window reaches **too close to the tip** (recent blocks are served live, not as files yet), **too far back** on a chain with a thin retention window, or the settled store is **temporarily lagging**. The window is validated up front, so one missing partition fails the whole job; there is no partial backfill. **Do this:** shrink the window (`tip-500` instead of `tip-5000`) and retry. You can also cap the upper end with a `blockNumber <= N` filter to pin the window entirely inside available history. If a modest window still fails for hours, the settled store is lagging. Report it with the exact error; it resumes automatically once fixed upstream. ### The sink completes instantly with 0 rows, and no error **Symptom:** logs show `Complete: 0 URL(s) processed`, exit code 0, empty table. **Looks like success; isn't.** **Why:** the window resolved to a range with no settled files in it: typically a window so close to the tip that no complete partition exists yet, or a range the store is still catching up on. **Do this:** always verify with a row count (`SELECT count(*) FROM ...`) after a run, never trust a clean exit alone. Widen the window backward until files exist. ### Sizing the backfill window **Why it matters:** the window is set as a filter, e.g. `blockNumber >= tip-1000`; `tip-` resolves against the chain tip at start. Too deep on a thin-retention chain fails with `Partition not found`; too shallow returns 0 rows (see above). A `blockNumber <= N` filter caps the upper end when you need to pin a range. **Do this:** start small (`tip-500`), confirm rows land, then widen to the depth your use case needs. Remember [current-state answers need deep history](/data-feeds/concepts/history-and-backfill): balances and holders are only correct once you've backfilled the relevant range. ## The live vs. settled boundary ### Live data and file storage are two different stores **Why:** the chain status can show the feed tracking the tip (live, in-memory) while the most recent blocks are **not yet flushed to settled file storage**. These are different systems with different lag: "the feed is live" does not mean "every recent block is downloadable." **Do this:** read near-tip data from the live stream and settled history from files; the chain status tells you where the boundary sits. If you only consume through the sink, this is why a very shallow backfill can find nothing while the feed is demonstrably live. ### Do not hard-code the feed version **Why:** each chain's feed carries a version that can roll over when the producer is upgraded; a hard-coded version can start returning a lagging tip or stop resolving. **Do this:** resolve the active topic from the chain's status before reading. ### Older history may be missing newer fields **Why:** the decoded schema has gained fields over time; partitions from before a field existed genuinely do not carry it. On some chains, always-null struct fields are stripped from the files entirely. **Do this:** discover the columns actually present for the range you read, and treat an absent field as zero/none rather than a failure. When reading nested structs, wrap optional fields defensively so a missing field yields a default instead of an error. ## Query-time gotchas ### The sink started but no rows have appeared yet **Why:** a template in `historical` or `hybrid` mode backfills a window of past blocks before (or while) it goes live, so there is a short warm-up before rows land. **Do this:** give it a minute, then check the sink logs: healthy output shows the cursor seeded near the tip and block windows advancing without errors. Still nothing? Confirm your chain ID and start block, then see [Modes](/data-feeds/concepts/modes), and the 0-rows gotcha above. ### The newest rows look duplicated or briefly wrong **Why:** near the tip a block can be replaced by a reorg. ClickHouse templates write a **correcting row** rather than silently deleting, so a naive `SELECT *` can momentarily show both the original and its cancel. **Do this:** read ClickHouse fact tables with **`FINAL`** (or sign-aware sums for aggregates). Settled history is never affected, only the tip. See [Reorgs](/data-feeds/concepts/reorgs). ### A token has no price **Why:** prices are **calculated from real onchain DEX trades**, not a pricing engine. A token that has not traded recently has no current mark. **Do this:** treat a missing price as "no recent trades", not an error, and fall back gracefully. USD values are **calculated**: compare with a small tolerance, never byte-equality. See [Data Feeds vs. the REST API](/data-feeds/concepts/data-feeds-vs-the-rest-api). ### My current-state results are incomplete **Why:** balances, holders, and approvals are **cumulative state**: start indexing too late and anyone whose last activity predates your start block is quietly missing. **Do this:** backfill from the beginning of the relevant history (the token's deploy block for by-token answers, full history for by-wallet answers). Event-list answers (swaps, transfers, logs) don't have this constraint. See [History & backfill](/data-feeds/concepts/history-and-backfill). ### I get a 403 or a 402 from the API **Why:** **403** = your key is not scoped to that chain. **402** = your subscription or access is inactive (account-level, not per-chain). **Do this:** for 403, use a key that includes the chain, or add the chain to your key in [Moralis Admin](https://admin.moralis.com/data-feeds); for 402, check your Data Feeds access is active. ## Reading the lake directly (REST / Arrow Flight) ### Keep direct-read concurrency modest **Why:** each direct read does real work to prepare data, so very high concurrency degrades rather than cleanly rate-limiting. **Do this:** keep concurrency modest and retry transient `5xx` with exponential backoff. > [!NOTE] > > **Still stuck?** Most first-run issues come down to the backfill window (too shallow → 0 rows, too deep → > `Partition not found`), the `FINAL` reading rule, or an access/chain scope mismatch. If you have ruled those > out, capture the template, chain, window, and the exact error, and reach out through your Data Feeds support > channel. # Data Feeds Source: https://docs.moralis.com/data-feeds/overview Moralis Data Feeds is a blockchain indexing engine for building custom, enterprise-grade data pipelines. It combines real-time and historical indexing with rich schema controls and delivers data straight into your own database, with high performance and reliability. ### At a glance > [card] Custom Indexing > > Index exactly the contracts, events, and data types you need. > [card] Real-time Pipelines > > Live tail from the chain head as events occur on-chain. > [card] Historical Backfill > > Fast backfills to populate your database with full history. > [card] Multichain Support > > EVM, Solana, and Bitcoin chains. > [card] Custom Schemas > > Define your own data models, or start from a ready-made template. > [card] Raw & Enriched Data > > Raw logs through to decoded, USD-valued events. ### Templates & use cases The fastest way to start is a **template**: a ready-made blueprint that reconstructs a popular Moralis endpoint (wallet history, token balances, prices, swaps, holders, raw logs) as a continuous sync into your own database. Bundle several into a **use case** for a complete workflow. > [card] [Browse templates](/data-feeds/templates/overview) > > Per-endpoint sync blueprints with schema, queries, and reorg strategy. > [card] [Use cases](/data-feeds/use-cases/accounting) > > Ready-made template bundles: accounting, portfolio, analytics, compliance, and more. ### Types of use cases * Self-hosted clones of popular Moralis endpoints, queryable in your own database * Custom blockchain data pipelines for internal applications * Real-time and historical on-chain analytics * Back-office and accounting systems needing structured, valued blockchain data * Apps needing tailored data models, beyond generic APIs * Institutional workflows with compliance and SLA requirements ### For which teams * **Data engineering & backend teams** who build in-house infrastructure * **Analytics teams** requiring custom indexed datasets * **Product teams** that need high control over how on-chain data is structured * **Enterprise & institutional teams** with compliance, security, and SLA needs * **Quant/trading and risk teams** building mission-critical data pipelines # Contract Logs Source: https://docs.moralis.com/data-feeds/templates/logs/contract-logs Sync every raw event log emitted by a contract, all topics and raw data, in on-chain order, into your own database. Mirrors the Moralis GET /{address}/logs endpoint. ### Question it answers > "Give me every raw event log emitted by contract **0x…**, in on-chain order." Mirrors Moralis `GET /{address}/logs`. This is the **raw** event log, `topic0…topic3` plus the ABI-encoded `data` payload, keyed by the emitting contract. Unlike the decoded templates (Token Transfers, Token Approvals, Swaps), it does not decode event names or arguments; you decode `data` in your application against the contract's ABI. Use it to index **any contract's events**, including custom or non-standard ones the decoded templates don't cover. ### What you get One row per log, keyed by the emitting contract: | Column | Description | | - | - | | `contract_address` | The emitting contract (the log's address) | | `block_number`, `transaction_index`, `log_index` | On-chain ordering tuple | | `tx_hash` | Transaction that produced the log | | `topic0` | Event signature hash (`keccak256` of the canonical signature), always present | | `topic1`, `topic2`, `topic3` | Indexed event parameters; `NULL` when the log has fewer topics | | `data` | Raw, ABI-encoded, non-indexed payload as hex, decode in your app | | `block_timestamp` | Block time | ### On-chain ordering A log's canonical position is the tuple **`(block_number, transaction_index, log_index)`**, block height, then the transaction's position in the block, then the log's index within the transaction. Every destination is keyed `contract_address` first, then that tuple, so "all logs for a contract, in order" is a sort-free range scan: * **ClickHouse**: `ORDER BY (chain_id, contract_address, block_number, transaction_index, log_index, …)`; a prefix scan returns rows already ordered. * **Postgres / MySQL**: a composite index on `(contract_address, block_number, transaction_index, log_index)` answers the read with no filesort step. ### Optional: group by event signature (topic0) The primary key already leads with `contract_address`, so "all `Transfer` logs for contract X" prefix-scans to the contract and filters `topic0` within it. On a **high-volume contract that emits many event types**, an opt-in `(contract_address, topic0, …)` structure makes that read a tight `(contract, topic0)` range that stays sort-free *and* skips the contract's other event types. These are shipped **commented-out** in each schema (extra write cost + storage), uncomment to enable: | Destination | Optional structure | | - | - | | Postgres | `CREATE INDEX … (contract_address, topic0, block_number, transaction_index, log_index)` | | MySQL | `ADD KEY (contract_address, topic0, block_number, transaction_index, log_index)` | | ClickHouse | A `topic0` `bloom_filter` skip-index (light), or a projection sorted by `(chain_id, contract_address, topic0, …)` (sort-free, heavier) | ### Source Raw logs aren't a decoded entity array, they live in the flattened `block` raw-passthrough array, where each block is expanded into items discriminated by `itemType` (`log` / `transaction` / …). The transform `ARRAY JOIN`s `block`, keeps `itemType = 'log'`, and lands one row per log. A log row carries **no transaction hash**, so `tx_hash` is recovered by joining each log to its sibling `itemType = 'transaction'` row on `(block_number, transaction_index)`. ### Destination | Destination | Table | By-contract access | | - | - | - | | **ClickHouse** (first-class) | `fact_logs` | Prefix scan on `(chain_id, contract_address, …)`; read with `FINAL` | | **Postgres** | `contract_logs` | Composite index `(contract_address, block_number, transaction_index, log_index)` | | **MySQL** | `contract_logs` | Composite key `(contract_address, block_number, transaction_index, log_index)` | Logs are immutable append-only events, so the ClickHouse fact table is a plain collapsing table, each log is one row, and a chain reorganization cancels it via the companion log table. There's no latest-wins logic; every log is a distinct row. ### Full schema The complete read table. Keep the columns you need; `topic1…topic3` and `data` are nullable raw fields you decode in your app (see [Schema & flexibility](/data-feeds/templates/overview#schema--flexibility)). > [accordion] ClickHouse, fact\_logs (contract-keyed) > > ```sql theme={null} > CREATE TABLE recipe_logs_by_contract.fact_logs > ( > vendor_event_id String, > ingested_at DateTime64(3), > chain_id UInt32, > block_hash String, > block_number UInt64, > transaction_index UInt32, > log_index UInt32, > event_ts DateTime64(3), > tx_hash String, > contract_address String, > topic0 String, > topic1 Nullable(String), > topic2 Nullable(String), > topic3 Nullable(String), > data Nullable(String), -- raw ABI-encoded payload (hex) > sign Int8 > ) > ENGINE = ReplicatedCollapsingMergeTree( > '/clickhouse/tables/{database}/fact_logs', '{replica}', sign) > PARTITION BY (chain_id, toYYYYMM(event_ts)) > ORDER BY (chain_id, contract_address, block_number, transaction_index, log_index, vendor_event_id); > > -- OPTIONAL (commented out by default): accelerate "specific event type for this > -- contract" reads on high-volume contracts. Enable at most one. > -- (a) lightweight topic0 skip-index: > -- ALTER TABLE recipe_logs_by_contract.fact_logs > -- ADD INDEX idx_topic0 topic0 TYPE bloom_filter GRANULARITY 4; > -- (b) sort-free projection keyed (contract_address, topic0, …): > -- ALTER TABLE recipe_logs_by_contract.fact_logs > -- ADD PROJECTION proj_contract_topic0 > -- (SELECT * ORDER BY (chain_id, contract_address, topic0, block_number, transaction_index, log_index)); > ``` > > Postgres / MySQL mirror this as a flat `contract_logs` table with a composite index `(contract_address, block_number, transaction_index, log_index)` and the optional `(contract_address, topic0, …)` index commented out. ### Example reads All logs emitted by a contract, in on-chain order (ClickHouse): ```sql theme={null} SELECT block_number, transaction_index, log_index, tx_hash, topic0, topic1, topic2, topic3, data FROM recipe_logs_by_contract.fact_logs FINAL WHERE chain_id = 1 AND contract_address = lower('0x...') ORDER BY block_number, transaction_index, log_index LIMIT 100; ``` Only a specific event type (`0xddf2…` = `keccak("Transfer(address,address,uint256)")`): ```sql theme={null} SELECT block_number, transaction_index, log_index, tx_hash, topic1, topic2, data FROM recipe_logs_by_contract.fact_logs FINAL WHERE chain_id = 1 AND contract_address = lower('0x...') AND topic0 = '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef' ORDER BY block_number, transaction_index, log_index LIMIT 100; ``` ### Modes Shipped defaults: **ClickHouse `hybrid`**, **Postgres / MySQL `historical`**. For live/reorg-safe ingestion use ClickHouse, see the [overview](/data-feeds/templates/overview#modes). > [!NOTE] > > This template reads the wide raw `block` column (every log **and** transaction per block), so per-block bytes are higher than the decoded templates. The transaction rows are read only to recover `tx_hash`, drop that join if you don't need it. ### EVM only Contract Logs extracts EVM event logs (`topic0…3` + `data`). Solana program logs are a different model and aren't emitted into this array. ### Fidelity gaps Raw on-chain log primitives, emitter, all topics, raw data, block, tx hash, on-chain ordering, are fully covered. Fields with no onchain source are omitted: `decoded_event` (needs the contract ABI, decode in your app) and transaction receipt fields beyond `tx_hash`. ## Migrating from the REST API This template is the landing point for the two **Blockchain API** REST endpoints. Neither maps 1:1 to a single template: both responses are assembled from the raw `block` array, the flattened header / transaction / log rows this template already reads (see [The block array](/data-feeds/concepts/the-block-array)). This template lands the **log** rows in a queryable table; the transaction and header fields come from the sibling rows in the same array. The subsections below cover each endpoint: what replaces it, the field mapping (**exact** = straight from the chain, **decoded** = you decode from the ABI or a typed template covers it, **gap** = not delivered today, **off-chain** = add yourself), and the gotchas specific to that endpoint. ### GET /transaction/:transaction\_hash/verbose The decoded-transaction-by-hash endpoint. Replaced by reading the transaction's logs from this template's table and its raw fields from the transaction row of [the block array](/data-feeds/concepts/the-block-array), the "verbose" ABI decoding becomes a step you own. > [!WARNING] > > This is **not** a 1:1 table swap, it's a three-part workflow. **Logs** come from this template's table, keyed by `tx_hash`. **The transaction's own fields** (`from`, `to`, `value`, `input`, gas, receipt) come from the sibling `itemType = 'transaction'` row in the block array, the matching log rows give you its `block_number`. **Decoding** is yours: standard events are already typed rows in the decoded templates ([Token Transfers](/data-feeds/templates/token/token-transfers), [NFT Transfers](/data-feeds/templates/nft/nft-transfers), [Swaps by Pair](/data-feeds/templates/markets/swaps-by-pair)); custom events and `decoded_call` decode from the contract ABI. | `/transaction/:hash/verbose` | Data Feeds | Fidelity | | - | - | - | | `hash`, `nonce`, `transaction_index`, `from/to_address`, `value`, `input`, `gas*`, `receipt_*` | `block` array transaction row | exact | | `transaction_fee` | derive: `receipt_gas_used × gas_price` | exact | | `block_number`, `block_timestamp`, `block_hash` | transaction row / this template's table | exact | | `logs[]` (address, topics, data, indices) | this template (`fact_logs` / `contract_logs`) | exact | | `logs[].decoded_event` (standard events) | decoded templates (Token Transfers, NFT Transfers, Swaps) | decoded | | `logs[].decoded_event` (custom), `decoded_call` | decode topics/`data`/`input` with the contract ABI | decoded | | `internal_transactions` | not carried in the `block` array today | gap | | `from/to_address_entity`, `*_label`, `*_entity_logo` | add yourself | off-chain | A transaction's logs by hash (Postgres, same shape on ClickHouse with `FINAL`): ```sql theme={null} SELECT block_number, transaction_index, log_index, contract_address, topic0, topic1, topic2, topic3, data FROM contract_logs WHERE tx_hash = lower('0x...') ORDER BY log_index; ``` **Gotchas** * **By-hash is a point lookup, but the shipped keys are contract-first.** Add an index on `tx_hash` (or keep your own hash-to-block map), the shipped `(contract_address, block_number, …)` ordering doesn't serve it. * **Index the history you'll look up.** Arbitrary historical hashes need a `historical`/`hybrid` backfill across the range; recent-only lookups need only a recent window, see [History & backfill](/data-feeds/concepts/history-and-backfill). * `internal_transactions` is a gap today, it isn't carried in the `block` array. * The `*_entity` / `*_label` / `*_entity_logo` fields are off-chain address labels; bring your own directory or drop them. ### GET /block/:block\_number\_or\_hash The whole-block endpoint. Replaced by reading the block directly from the feed, a feed row's native unit **is** a block, so the header, transactions, and logs arrive together in [the block array](/data-feeds/concepts/the-block-array) and a by-number read is a direct positional read (a block's position is its block number). > [!WARNING] > > This template's table alone does **not** reconstruct the response, it holds only the log rows. The header and transaction rows come from the block array itself (`itemType = 'block'` / `'transaction'` / `'log'`): read the block's row from the feed, split the array by `itemType`, and join each log to its transaction on `transaction_index`. Keep this template running alongside to make logs queryable by block without re-reading whole blocks, and to resolve `block_hash → block_number` for by-hash reads. | `/block/:block_number_or_hash` | Data Feeds | Fidelity | | - | - | - | | Header (`number`, `hash`, `parent_hash`, `timestamp`, `miner`, `gas_*`, `base_fee_per_gas`, roots, …) | `block` array block row | exact | | `transaction_count` | count of transaction rows | exact | | `transactions[]` (hash, from, to, value, input, gas, receipt\_\*) | `block` array transaction rows | exact | | `transaction_fee` | derive: `receipt_gas_used × gas_price` | exact | | `logs[]` (address, topics, data, indices) | `block` array log rows / this template | exact | | `internal_transactions` | not carried in the `block` array today | gap | | `from/to_address_entity`, `*_label`, `*_entity_logo` | add yourself | off-chain | Resolve a by-hash read to a position, then all of that block's logs (ClickHouse): ```sql theme={null} SELECT block_number, transaction_index, log_index, tx_hash, contract_address, topic0, topic1, topic2, topic3, data FROM recipe_logs_by_contract.fact_logs FINAL WHERE chain_id = 1 AND block_hash = lower('0x...') ORDER BY transaction_index, log_index; ``` **Gotchas** * **By-hash resolves to a number first**: the feed is positioned by block number; this template's `block_hash` column (or your own index) does the resolve. * **Raw log rows carry no tx hash**: they join to their transaction on `(block_number, transaction_index)`; this template already attaches `tx_hash` for you. * **Busy blocks are large** (a megabyte or two of JSON), read by position and process the array. * The REST responses return **raw** logs, matching this template exactly; if you also want decoded events, add the decoded templates or decode from the ABI. * `internal_transactions` and address labels: same gaps as above. ### Related > [card] [Logs by Event Signature](/data-feeds/templates/logs/logs-by-topic0) > > The sibling, index one event type across all contracts. > [card] [Onchain Event Indexing](/data-feeds/use-cases/event-indexing) > > The use case these raw-log templates power. # Logs by Event Signature Source: https://docs.moralis.com/data-feeds/templates/logs/logs-by-topic0 Sync every raw event log of one signature, every Transfer, Approval, or Swap, across all contracts, chain-wide, into your own database. The by-event-type sibling of Contract Logs. ### Question it answers > "Give me every raw event log of signature **T** (`topic0`), chain-wide, in on-chain order." The by-event-type mirror of [Contract Logs](/data-feeds/templates/logs/contract-logs), the **same** raw-log extraction, but keyed by the event signature (`topic0`) instead of the emitting contract. Use it to index one event **across all contracts**: every `Transfer`, every `Approval`, every Uniswap `Swap`, typically scoped to a block range. ### What you get One row per log, keyed by event signature. Same columns as Contract Logs, `topic0…topic3`, `data`, `contract_address`, `tx_hash`, and the `(block_number, transaction_index, log_index)` ordering tuple, but `topic0` leads the sort key so a chain-wide "all logs of this signature" read is a contiguous range. ### On-chain ordering Every destination is keyed `topic0` first, then the on-chain tuple: * **ClickHouse**: `ORDER BY (chain_id, topic0, block_number, transaction_index, log_index, …)`. `topic0` is low cardinality (one value per signature), so it's a cheap, highly selective leading key. * **Postgres / MySQL**: a composite index on `(topic0, block_number, transaction_index, log_index)`; `WHERE topic0 = T AND block_number BETWEEN … ORDER BY …` is answered by an index range scan with no filesort. Logs with an empty `topic0` (anonymous events) are filtered out, they have no signature to key on. ### Optional: scope to a contract (topic0 + contract) The primary key leads with `topic0`, so "all `Transfer` logs emitted by contract X" prefix-scans to the signature and filters `contract_address` within it. Because a popular signature (`Transfer`, `Approval`) spans **millions of contracts**, an opt-in `(topic0, contract_address, …)` structure makes that read a tight `(topic0, contract)` range that stays sort-free *and* skips the signature's other contracts. Shipped **commented-out** in each schema: | Destination | Optional structure | | - | - | | Postgres | `CREATE INDEX … (topic0, contract_address, block_number, transaction_index, log_index)` | | MySQL | `ADD KEY (topic0, contract_address, block_number, transaction_index, log_index)` | | ClickHouse | A `contract_address` `bloom_filter` skip-index (light), or a projection sorted by `(chain_id, topic0, contract_address, …)` (sort-free, heavier) | ### Destination | Destination | Table | By-signature access | | - | - | - | | **ClickHouse** (first-class) | `fact_logs` | Prefix scan on `(chain_id, topic0, …)`; read with `FINAL` | | **Postgres** | `topic_logs` | Composite index `(topic0, block_number, transaction_index, log_index)` | | **MySQL** | `topic_logs` | Composite key `(topic0, block_number, transaction_index, log_index)` | Same source and reorg model as Contract Logs (raw `block` array → `itemType = 'log'`, `tx_hash` recovered from the sibling transaction row; immutable append-only logs in a collapsing table). ### Full schema Identical columns to [Contract Logs](/data-feeds/templates/logs/contract-logs#full-schema), the only difference is the sort key leads with `topic0`. Keep the columns you need (see [Schema & flexibility](/data-feeds/templates/overview#schema--flexibility)). > [accordion] ClickHouse, fact\_logs (topic0-keyed) > > ```sql theme={null} > CREATE TABLE recipe_logs_by_topic0.fact_logs > ( > vendor_event_id String, > ingested_at DateTime64(3), > chain_id UInt32, > block_hash String, > block_number UInt64, > transaction_index UInt32, > log_index UInt32, > event_ts DateTime64(3), > tx_hash String, > contract_address String, > topic0 String, > topic1 Nullable(String), > topic2 Nullable(String), > topic3 Nullable(String), > data Nullable(String), -- raw ABI-encoded payload (hex) > sign Int8 > ) > ENGINE = ReplicatedCollapsingMergeTree( > '/clickhouse/tables/{database}/fact_logs', '{replica}', sign) > PARTITION BY (chain_id, toYYYYMM(event_ts)) > ORDER BY (chain_id, topic0, block_number, transaction_index, log_index, vendor_event_id); > > -- OPTIONAL (commented out by default): accelerate "specific contract within a > -- signature" reads. Enable at most one. > -- (a) lightweight contract_address skip-index: > -- ALTER TABLE recipe_logs_by_topic0.fact_logs > -- ADD INDEX idx_contract contract_address TYPE bloom_filter GRANULARITY 4; > -- (b) sort-free projection keyed (topic0, contract_address, …): > -- ALTER TABLE recipe_logs_by_topic0.fact_logs > -- ADD PROJECTION proj_topic0_contract > -- (SELECT * ORDER BY (chain_id, topic0, contract_address, block_number, transaction_index, log_index)); > ``` > > Postgres / MySQL mirror this as a flat `topic_logs` table keyed `(topic0, block_number, transaction_index, log_index)`, with the optional `(topic0, contract_address, …)` index commented out. ### Example reads All logs of an event signature in a block range, in on-chain order (ClickHouse): ```sql theme={null} SELECT block_number, transaction_index, log_index, contract_address, tx_hash, topic1, topic2, topic3, data FROM recipe_logs_by_topic0.fact_logs FINAL WHERE chain_id = 1 AND topic0 = '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef' AND block_number BETWEEN 18000000 AND 18010000 ORDER BY block_number, transaction_index, log_index LIMIT 100; ``` ### Modes Shipped defaults: **ClickHouse `hybrid`**, **Postgres / MySQL `historical`**. For live/reorg-safe ingestion use ClickHouse. > [!WARNING] > > A `topic0`-keyed sync is heavy for popular signatures, `Transfer` and `Approval` span the whole chain. Scope reads to a block range, and for chain-heavy backfills run the ClickHouse path. ### EVM only Like Contract Logs, this extracts EVM event logs (`topic0…3` + `data`); Solana program logs are a different model. ### Related > [card] [Contract Logs](/data-feeds/templates/logs/contract-logs) > > The sibling, every log from one contract, keyed by emitter. > [card] [Onchain Event Indexing](/data-feeds/use-cases/event-indexing) > > The use case these raw-log templates power. # Pair OHLCV Source: https://docs.moralis.com/data-feeds/templates/markets/pair-ohlcv Sync time-bucketed OHLCV candles, open, high, low, close, volume, and trade count per DEX pair, built by aggregating on-chain swaps, into your own database. Mirrors the Moralis GET /pairs/{address}/ohlcv endpoint. ### Question it answers > "Give me 1-hour OHLCV candles for pool/pair **0x…**, open, high, low, close, volume, and trade count per hour." Mirrors Moralis `GET /pairs/{address}/ohlcv`. Candles are built by **aggregating swaps**, not reported by an exchange. This template is a downstream aggregation on top of the same trade ingest as Swaps by Pair: the sync lands every trade once (USD-enriched in-block), then a candle surface buckets those trades into fixed **1-hour** candles per `(pool_address, hour)`. "Price" per fill is the bought-leg (token1) in-block USD price already on the trade (`price_usd`); `volume` is `sum(abs(notional_usd))` and `trades` is the fill count. ### What you get One candle row per `(pool_address, bucket_start)`, where `bucket_start` is the start of a 1-hour window. Only **priced** trades (a same-block USD price update for the bought leg) contribute: | Column | Description | | - | - | | `chain_id` | Chain the pool lives on | | `pool_address` | The DEX pair / pool | | `bucket_start` | Start of the 1-hour candle window | | `open` | First trade's `price_usd` in the bucket (by `event_ts`, tiebroken by `vendor_event_id`) | | `high` | `max(price_usd)` across the bucket | | `low` | `min(price_usd)` across the bucket | | `close` | Last trade's `price_usd` in the bucket | | `volume` | `sum(abs(notional_usd))`: absolute traded USD over the bucket | | `trades` | Count of priced fills in the bucket | The candles sit on top of a trade fact table (`fact_swaps` / `swaps`) carrying every fill, `tx_hash`, `trader_address`, `token0/1_address`, `amount0/1`, `side`, `source_kind`, `protocol`, `price_usd`, `notional_usd`, so you can drop to the underlying trades whenever you need detail behind a candle. ### Source The trade ingest is identical to Swaps by Pair: two projection branches expand the per-block swap arrays into one row per fill: `tokenSwaps` (pool fills) · `aggregateTokenSwaps` (aggregator routes) Each fill is USD-enriched **inline** from the same block's `tokenPriceUpdates` (reversed so the chronologically-last update wins on duplicate keys), no separate price join at read time. The candle surface then aggregates these priced fills by hour. ### Destination | Destination | Trade table | Candle surface | Read pattern | | - | - | - | - | | **ClickHouse** (first-class) | `fact_swaps` | `candles` (VIEW over `candles_agg`); `candles_exact` (reorg-exact) | Prefix scan on `(chain_id, pool_address, bucket_start)` | | **Postgres** | `swaps` | `candles` (always-fresh VIEW) + `candles_mat` (REFRESHable matview) | Index on `(pool_address, bucket_start DESC)` | | **MySQL** | `swaps` | `candles` (always-fresh VIEW) | Index on `(pool_address, block_timestamp)` | ClickHouse uses the collapsing log-table pattern (see the [templates overview](/data-feeds/templates/overview#destinations)) so chain reorganizations self-correct. Two candle surfaces ship on ClickHouse: `candles` is a low-latency accelerator backed by an `AggregatingMergeTree` that is sign-aware for additive measures, and `candles_exact` reads `fact_swaps FINAL` for always-exact OHLC. On Postgres/MySQL the `candles` VIEW aggregates `swaps` at read time and is correct the moment a backfill lands. ### Full schema Below are the trade fact table and the candle surfaces this template produces. The candle columns are a fixed shape (`open`/`high`/`low`/`close`/`volume`/`trades`); the underlying trade table is the wider starting point, keep the columns you need (see [Schema & flexibility](/data-feeds/templates/overview#schema--flexibility)). Raw `uint256` amounts are stored as text on ClickHouse and `NUMERIC(76,0)` on Postgres (they exceed standard numeric precision); USD columns are wide decimals so a low-decimals token × price never overflows. > [accordion] ClickHouse, fact\_swaps + candles > > ```sql theme={null} > -- Trade fact: one row per fill, sign-carrying for reorg collapse. > CREATE TABLE recipe_pair_ohlcv.fact_swaps > ( > vendor_event_id String, > ingested_at DateTime64(3), > chain_id UInt32, > block_hash String, > block_number UInt64, > event_ts DateTime64(3), > pool_address String, -- pair (pool_fill) or aggregator > token0_address String, > token1_address String, > amount0 String, -- raw uint256 > amount1 String, -- raw uint256 > trader_address String, > price_usd Nullable(String), -- bought-leg (token1) USD price > notional_usd Nullable(String), -- signed token1 amount × price > side LowCardinality(String), -- buy | sell > source_kind LowCardinality(String), -- aggregator | pool_fill > protocol LowCardinality(String), > sign Int8 > ) > ENGINE = ReplicatedCollapsingMergeTree( > '/clickhouse/tables/{database}/fact_swaps', '{replica}', sign) > PARTITION BY (chain_id, toYYYYMM(event_ts)) > ORDER BY (chain_id, pool_address, event_ts, vendor_event_id); > > -- Candle accelerator: one state-row per (chain, pool, hour). > -- Additive measures are sign-weighted so reorg −1 rows subtract cleanly. > CREATE TABLE recipe_pair_ohlcv.candles_agg > ( > chain_id UInt32, > pool_address String, > bucket_start DateTime, -- toStartOfHour(event_ts) > open_state AggregateFunction(argMin, Float64, DateTime64(3)), > high_state AggregateFunction(max, Float64), > low_state AggregateFunction(min, Float64), > close_state AggregateFunction(argMax, Float64, DateTime64(3)), > volume_state AggregateFunction(sum, Float64), > trades_state AggregateFunction(sum, Int64) > ) > ENGINE = ReplicatedAggregatingMergeTree( > '/clickhouse/tables/{database}/candles_agg', '{replica}') > PARTITION BY (chain_id, toYYYYMM(bucket_start)) > ORDER BY (chain_id, pool_address, bucket_start); > > -- candles VIEW: finalizes the aggregate state to scalars (the fast surface). > CREATE VIEW recipe_pair_ohlcv.candles AS > SELECT > chain_id, > pool_address, > bucket_start, > argMinMerge(open_state) AS open, > maxMerge(high_state) AS high, > minMerge(low_state) AS low, > argMaxMerge(close_state) AS close, > sumMerge(volume_state) AS volume, > sumMerge(trades_state) AS trades > FROM recipe_pair_ohlcv.candles_agg > GROUP BY chain_id, pool_address, bucket_start > HAVING trades > 0; > > -- candles_exact VIEW: reorg-EXACT — FINAL collapses each +1/−1 pair before > -- aggregating, so OHLC reflects only canonical trades. Slower; use after a reorg > -- may have retracted an hour's all-time high/low. > CREATE VIEW recipe_pair_ohlcv.candles_exact AS > SELECT > chain_id, > pool_address, > toStartOfHour(event_ts) AS bucket_start, > argMin(toFloat64OrZero(price_usd), event_ts) AS open, > max(toFloat64OrZero(price_usd)) AS high, > min(toFloat64OrZero(price_usd)) AS low, > argMax(toFloat64OrZero(price_usd), event_ts) AS close, > sum(abs(toFloat64OrZero(notional_usd))) AS volume, -- absolute traded USD > count() AS trades > FROM recipe_pair_ohlcv.fact_swaps FINAL > WHERE price_usd IS NOT NULL AND price_usd != '' > GROUP BY chain_id, pool_address, bucket_start; > ``` > > The `sign` column on `fact_swaps` drives reorg collapsing. `candles` is the low-latency accelerator; `candles_exact` is always reorg-exact (see fidelity gaps). A single-node setup can use the non-replicated engines (`CollapsingMergeTree(sign)`, `AggregatingMergeTree`) without the replication path. > [accordion] Postgres, swaps + candles > > ```sql theme={null} > -- Flat one-row-per-trade landing table (the Swaps by Pair ingest). > CREATE TABLE public.swaps ( > position BIGINT NOT NULL, > log_index BIGINT, -- NULL for aggregator rows > transaction_index BIGINT, > block_number BIGINT NOT NULL, > block_timestamp BIGINT NOT NULL, -- unix seconds > tx_hash TEXT NOT NULL, > vendor_event_id TEXT NOT NULL, > trader_address TEXT NOT NULL, > pool_address TEXT NOT NULL, -- pair (pool_fill) or aggregator > token0_address TEXT NOT NULL, > token1_address TEXT NOT NULL, > amount0 NUMERIC(76, 0) NOT NULL, > amount1 NUMERIC(76, 0) NOT NULL, > price_usd NUMERIC(38, 18), > notional_usd NUMERIC(38, 18), > side TEXT NOT NULL, > source_kind TEXT NOT NULL, -- aggregator | pool_fill > protocol TEXT NOT NULL > ); > > -- Candle aggregation reads pool_address + block_timestamp. > CREATE INDEX swaps_pool_ts_idx ON public.swaps (pool_address, block_timestamp); > CREATE INDEX swaps_block_idx ON public.swaps (block_number); > > -- candles: always-fresh 1-hour OHLCV VIEW (the read surface). > -- Only priced trades participate; open/close use the array_agg-ORDER-BY idiom. > CREATE VIEW public.candles AS > SELECT > pool_address, > date_trunc('hour', to_timestamp(block_timestamp)) AS bucket_start, > (array_agg(price_usd ORDER BY block_timestamp ASC, vendor_event_id ASC))[1] AS open, > max(price_usd) AS high, > min(price_usd) AS low, > (array_agg(price_usd ORDER BY block_timestamp DESC, vendor_event_id DESC))[1] AS close, > sum(abs(notional_usd)) AS volume, -- absolute traded USD > count(*) AS trades > FROM public.swaps > WHERE price_usd IS NOT NULL > GROUP BY pool_address, date_trunc('hour', to_timestamp(block_timestamp)); > > -- OPTIONAL accelerator: a REFRESHable matview when read-time aggregation gets > -- expensive. Refresh on a schedule (cron / pg_cron) after the backfill lands. > -- CREATE MATERIALIZED VIEW public.candles_mat AS > -- SELECT * FROM public.candles WITH NO DATA; > -- CREATE UNIQUE INDEX candles_mat_pk ON public.candles_mat (pool_address, bucket_start); > -- SELECT public.refresh_candles(); -- REFRESH MATERIALIZED VIEW CONCURRENTLY > ``` > > MySQL is the same shape with `DECIMAL(38,18)` for the USD columns and `DECIMAL(76,0)` for raw amounts, and ships the `candles` VIEW only. `position` is the block-level cursor used during backfill. To change the bucket interval, swap `date_trunc('hour', …)` (and the ClickHouse `toStartOfHour` / partition expression) for your target window. ### Example reads Newest 24 hourly candles for one pool (ClickHouse, fast accelerator): ```sql theme={null} SELECT bucket_start, open, high, low, close, volume, trades FROM recipe_pair_ohlcv.candles WHERE chain_id = 1 AND pool_address = lower('0x88e6A0c2dDD26FEEb64F039a2c41296FcB3f5640') -- USDC/WETH 0.05% v3 ORDER BY bucket_start DESC LIMIT 24; ``` Same window, reorg-exact (collapses +1/−1 pairs via `FINAL` before aggregating): ```sql theme={null} SELECT bucket_start, open, high, low, close, volume, trades FROM recipe_pair_ohlcv.candles_exact WHERE chain_id = 1 AND pool_address = lower('0x88e6A0c2dDD26FEEb64F039a2c41296FcB3f5640') ORDER BY bucket_start DESC LIMIT 24; ``` Sanity-check OHLC ordering across every candle (should return 0): ```sql theme={null} SELECT count() FROM recipe_pair_ohlcv.candles WHERE NOT (low <= open AND low <= close AND open <= high AND close <= high AND volume > 0 AND trades > 0); ``` On Postgres / MySQL the `candles` VIEW reads the same way, keyed on `pool_address`: ```sql theme={null} SELECT pool_address, bucket_start, open, high, low, close, volume, trades FROM candles WHERE pool_address = lower('0x88e6A0c2dDD26FEEb64F039a2c41296FcB3f5640') ORDER BY bucket_start DESC LIMIT 24; ``` ### Modes Shipped defaults: **ClickHouse `hybrid`** (backfill → realtime), **Postgres / MySQL `historical`** (one-shot backfill). For live/reorg-safe ingestion, use ClickHouse, see the [overview](/data-feeds/templates/overview#modes). > [!NOTE] > > **Realtime on Postgres / MySQL is not supported for this shape.** The realtime reorg path needs a single-column unique on the block-level position, but trades are array-expanded (many per block), so these tables can only carry a composite unique. Run realtime/hybrid on ClickHouse, where the collapsing log table corrects reorgs per-block and the candle accelerator is sign-aware. The Postgres/MySQL configs are intended for `historical` backfill, re-run the backfill (and `REFRESH` the candle matview) to pick up corrections. ### Multichain The template is chain-parametrized, point it at any supported EVM chain or Solana, and the candle math is chain-agnostic. On Solana, the same `logIndex` can repeat across events in one instruction, so the pool-fill event identity is widened (with `token0Address`, `token1Address`, `token0Amount`) to keep trade rows distinct; the candle surface it produces is identical in shape. ### Fidelity gaps * **Fixed 1-hour interval (v1).** Moralis' `/pairs/{address}/ohlcv` takes a `timeframe` param (1m/5m/1h/1d/…); this template ships a single fixed **1-hour** bucket. For other intervals, change the bucket expression (`toStartOfHour` / `date_trunc('hour', …)` / the MySQL modulus) to your target window. * **Trade-reconstructed, not exchange-reported.** Candles are built from on-chain swap fills, so they may differ slightly from a DEX's own reported OHLC (which can apply off-chain smoothing or a different price reference). No off-chain smoothing is applied. * **Price = bought-leg in-block USD; no carry-forward.** A candle only includes trades whose bought-leg token had a same-block `tokenPriceUpdate`. Thin/illiquid pools with no in-block price update in an hour produce **no candle for that hour** (a gap), rather than a flat carry-forward candle. Dense pools (the majority of volume) are unaffected. * **ClickHouse `candles` high/low under reorg.** The fast accelerator's `high`/`low` are monotonic state functions; a reorg `−1` row cannot retract an extreme, so if a reorg removes an hour's all-time high/low, `candles` may stay slightly wide until the next canonical trade re-establishes the range. Read **`candles_exact`** when post-reorg precision matters. `volume` and `trades` are sign-weighted and always exact on both surfaces. * **`volume` is absolute traded USD.** `notional_usd` carries the **signed** token1 delta (V3/V4 report signed swap amounts, negative when the token leaves the pool), so `volume` uses `abs(notional_usd)` (×reorg-sign on ClickHouse), otherwise buy/sell legs cancel and volume goes negative. This is the canonical OHLCV "traded value" definition. * **Missing-decimals volume outliers.** A handful of exotic tokens arrive with `token1` decimals absent/0 (coalesced to 0 in the shared swap transform); their raw amount isn't decimal-scaled and `notional_usd` is wildly inflated, producing an implausibly large candle `volume`. OHLC prices are unaffected (they use per-unit `price_usd`). Filter `volume < 1e12` for a clean volume distribution; a production deployment should source token decimals from a metadata table rather than the in-event field. ## Migrating from the REST API This template replaces the pair-OHLCV REST endpoint, and it's the closest to 1:1 in the swaps family: the shipped candle surface mirrors the endpoint at a 1-hour timeframe, and because the underlying `swaps` table is trade-level, any other timeframe is a `GROUP BY` you own rather than a fixed parameter. Fidelity labels: **exact** = straight from the chain, **calculated** = aggregated from real DEX trades (very close, compare with a tolerance). ### GET /pairs/:address/ohlcv Candlestick data for a pool/pair. Replaced by this template's `candles` surface for 1-hour candles, or a bucket query over `swaps` for any other timeframe. | `/pairs/:address/ohlcv` | Data Feeds | Fidelity | | - | - | - | | `timestamp` | `candles.bucket_start` / your time bucket | exact | | `open`, `high`, `low`, `close` | first / max / min / last `price_usd` in the bucket | calculated | | `volume` | `sum(abs(notional_usd))` | calculated | | `trades` | count of priced fills in the bucket | exact | | `pairAddress` | `pool_address` | exact | | `tokenAddress` (priced leg) | the bought leg (`token1`), priced in USD | exact | | `timeframe`, `currency` | your `GROUP BY` bucket + price leg | your choice | The REST `timeframe` parameter becomes the bucket expression. A 5-minute example over `swaps` (Postgres, use 60 / 3600 / 86400 for 1m / 1h / 1d): ```sql theme={null} SELECT to_timestamp(floor(block_timestamp / 300) * 300) AS timestamp, (array_agg(price_usd ORDER BY block_timestamp, vendor_event_id))[1] AS open, max(price_usd) AS high, min(price_usd) AS low, (array_agg(price_usd ORDER BY block_timestamp DESC, vendor_event_id DESC))[1] AS close, sum(abs(notional_usd)) AS volume, -- abs: notional is signed on V3/V4 count(*) AS trades FROM swaps WHERE pool_address = lower($1) AND price_usd IS NOT NULL AND block_timestamp BETWEEN $2 AND $3 GROUP BY 1 ORDER BY 1; ``` **Gotchas** * OHLC is trade-reconstructed, not exchange-reported, it tracks the old endpoint closely, but compare with a tolerance rather than expecting identical figures. * The REST `currency` parameter has no direct analog: candles here are priced in the bought leg's in-block USD price, so be explicit about which token the OHLC is quoted in. * Thinly-traded pairs produce sparse candles, gaps where no priced trade occurred, not flat carry-forward candles (see [Fidelity gaps](#fidelity-gaps)). * `volume` must be `sum(abs(notional_usd))`, the notional is signed on V3/V4 pools, so a plain `sum` lets buy and sell legs cancel. * For live charts, run the template `realtime` on ClickHouse and read `candles` (or `candles_exact` after a reorg); for historical candles back to a date, backfill `historical` / `hybrid` from that date, no need to index from genesis. See [History & backfill](/data-feeds/concepts/history-and-backfill). ### Related > [card] [Swaps by Pair](/data-feeds/templates/markets/swaps-by-pair) > > The per-trade ingest these candles aggregate, every fill on a pair. > [card] [Trading & Charting](/data-feeds/use-cases/trading-charting) > > The use case OHLCV candles power. # Pair Reserves Source: https://docs.moralis.com/data-feeds/templates/markets/pair-reserves Sync the current reserve0 / reserve1 of any DEX pair, the pool's absolute token balances, kept latest-wins per pair, into your own database. Mirrors the Moralis GET /{pair_address}/reserves endpoint. ### Question it answers > "What are the current `reserve0` / `reserve1` of DEX pair **0x…**?" Mirrors Moralis `GET /{pair_address}/reserves` → `{ reserve0, reserve1 }`. The template lands the pool's absolute token balances and keeps the **latest observation per pair**, so a single read returns each pair's current reserves. ### What you get The template lands **one observation per swap**, the pool's absolute token balances captured *after* each trade, and the current reserves of a pair are the highest-`(block_number, log_index)` observation for that pair: | Column | Description | | - | - | | `pair_address` | The DEX pair (pool) the reserves belong to | | `token0_address`, `token1_address` | The pool's two token sides | | `reserve0` | Pool's absolute `token0` balance after the swap (raw `uint256`, as text) | | `reserve1` | Pool's absolute `token1` balance after the swap (raw `uint256`, as text) | | `block_number`, `log_index` | Recency key, the latest pair wins | | `event_ts` / `block_timestamp` | Block time of the observation | These are **absolute snapshots, not deltas**, no running sum, no pre-window baseline, no genesis requirement. The latest snapshot in any window is the answer (**window-safe**). ### Source The faithful source for reserves is `tokenSwaps`. Each swap carries `token0PostBalance` / `token1PostBalance`, the pool's absolute balances after the trade, which are exactly the pair's reserves. The transform projects one reserve observation per swap, keyed by pair. `pairLiquidityChanges` is **not** used: it only fires on add/remove liquidity, so a running sum of its deltas misses all swap-driven reserve movement and is window-relative. Aggregated swaps are also not used, they carry an aggregator address, not a `pair_address`, so their post-balances can't be attributed to a specific pool. ### Destination | Destination | Table | By-pair access | | - | - | - | | **ClickHouse** (first-class) | `fact_pair_reserves` | `argMax(reserveN, (block_number, log_index))` per pair over `FINAL` | | **Postgres** | `pair_reserves` (materialized view over `pair_reserve_observations`) | Unique index `(pair_address)` | | **MySQL** | `pair_reserves` (trigger-maintained over `pair_reserve_observations`) | Primary key `(pair_address)` | ClickHouse uses the collapsing log-table pattern (see the [templates overview](/data-feeds/templates/overview#destinations)) so chain reorganizations self-correct: a reorg negates the rolled-back block's observations (`sign = -1`) and re-emits the corrected ones. Read with `FINAL` to collapse the `±1` pair, then `argMax` to pick the latest observation, never a bare `WHERE sign = 1`. Postgres and MySQL append append-only observations and derive a **latest-wins** current-reserves surface per pair: Postgres via a `DISTINCT ON (pair_address) … ORDER BY block_number DESC, log_index DESC` materialized view, MySQL via an `AFTER INSERT` upsert trigger. ### Full schema The ClickHouse fact table is the per-pair observation table; the current reserves are an `argMax` over it. Reserves are raw `uint256` stored as text (matching the API's string reserves), `argMax` over text ordered by the numeric recency key is exact. Keep the columns you need (see [Schema & flexibility](/data-feeds/templates/overview#schema--flexibility)). > [accordion] ClickHouse, fact\_pair\_reserves > > ```sql theme={null} > CREATE TABLE recipe_pair_reserves.fact_pair_reserves > ( > vendor_event_id String, > ingested_at DateTime64(3), > chain_id UInt32, > block_hash String, > block_number UInt64, > log_index UInt32, > event_ts DateTime64(3), > pair_address String, > token0_address String, > token1_address String, > reserve0 String, -- absolute pool reserve0 after this swap > reserve1 String, > sign Int8 > ) > ENGINE = ReplicatedCollapsingMergeTree( > '/clickhouse/tables/{database}/fact_pair_reserves', '{replica}', sign) > PARTITION BY (chain_id, toYYYYMM(event_ts)) > ORDER BY (chain_id, pair_address, block_number, log_index, vendor_event_id); > ``` > > The `sign` column drives reorg collapsing, read with `FINAL` then `argMax`. A single-node setup can use `CollapsingMergeTree(sign)` without the replication path. > [accordion] Postgres, pair\_reserves > > ```sql theme={null} > -- 1. Observations (sink target): one raw row per swap. > CREATE TABLE public.pair_reserve_observations ( > position BIGINT NOT NULL, > log_index BIGINT NOT NULL, > block_number BIGINT NOT NULL, > block_timestamp BIGINT NOT NULL, -- unix seconds > pair_address TEXT NOT NULL, > token0_address TEXT NOT NULL, > token1_address TEXT NOT NULL, > reserve0 NUMERIC(76, 0) NOT NULL, -- absolute pool reserve0 post-swap > reserve1 NUMERIC(76, 0) NOT NULL, > vendor_event_id TEXT NOT NULL > ); > > -- Speeds the DISTINCT ON (latest-per-pair) the materialized view computes. > CREATE INDEX IF NOT EXISTS pro_pair_recency_idx > ON public.pair_reserve_observations > (pair_address, block_number DESC, log_index DESC); > > -- 2. Current-reserves materialized view: latest observation per pair. > CREATE MATERIALIZED VIEW public.pair_reserves AS > SELECT DISTINCT ON (pair_address) > pair_address, > token0_address, > token1_address, > reserve0, > reserve1, > block_number, > log_index, > block_timestamp > FROM public.pair_reserve_observations > ORDER BY pair_address, block_number DESC, log_index DESC; > > -- Required by REFRESH MATERIALIZED VIEW CONCURRENTLY and the by-pair lookup. > CREATE UNIQUE INDEX IF NOT EXISTS pair_reserves_pk > ON public.pair_reserves (pair_address); > ``` > > MySQL is the same shape: an append-only `pair_reserve_observations` table plus a `pair_reserves` table kept current by an `AFTER INSERT` latest-wins upsert trigger, with `reserve0` / `reserve1` as `DECIMAL(65,0)`. `position` is the block-level cursor used during backfill. ### Example reads Current reserves of a pair, latest observation; `FINAL` collapses reorg `±1` pairs before `argMax` (ClickHouse): ```sql theme={null} SELECT pair_address, argMax(token0_address, (block_number, log_index)) AS token0, argMax(token1_address, (block_number, log_index)) AS token1, argMax(reserve0, (block_number, log_index)) AS reserve0, argMax(reserve1, (block_number, log_index)) AS reserve1 FROM recipe_pair_reserves.fact_pair_reserves FINAL WHERE chain_id = 1 AND pair_address = lower('0x...') GROUP BY pair_address; ``` Largest pools by latest `reserve0` (ClickHouse): ```sql theme={null} SELECT pair_address, argMax(reserve0, (block_number, log_index)) AS reserve0 FROM recipe_pair_reserves.fact_pair_reserves FINAL WHERE chain_id = 1 GROUP BY pair_address ORDER BY toFloat64OrZero(reserve0) DESC LIMIT 100; ``` Postgres, refresh the view, then look up the pair: ```sql theme={null} REFRESH MATERIALIZED VIEW CONCURRENTLY pair_reserves; SELECT reserve0, reserve1 FROM public.pair_reserves WHERE pair_address = lower('0x...'); ``` ### Modes Shipped defaults: **ClickHouse `hybrid`** (backfill → realtime), **Postgres / MySQL `historical`** (one-shot backfill). For live/reorg-safe ingestion, use ClickHouse, see the [overview](/data-feeds/templates/overview#modes). > [!NOTE] > > The Postgres / MySQL realtime reorg path needs a single-column `UNIQUE` on the position column, but `position` is block-level. Run **realtime / hybrid on ClickHouse** (the collapsing log table corrects reorgs per block); the Postgres / MySQL configs target `historical` backfill and re-derive their current-reserves surface on refresh. ### Multichain The template is chain-parametrized via the `chain` setting, point it at any supported EVM chain or Solana. On Solana, the event identity already folds in `(pair_address, token0PostBalance, token1PostBalance)` on top of `(transaction_hash, log_index)`, so it stays row-unique despite Solana's repeated log indices within an instruction. ### Fidelity gaps * **Only pairs with a swap in-window get current reserves.** Reserves are read from swap post-balances, so a pair appears only if it had at least one swap with resolved post-balances in the ingested window. A pool that is quiet (no swaps) for the whole window won't be present, but quiet pools have unchanged reserves by definition, so widening the window picks them up. * **Swaps without resolved post-balances are skipped.** `token0PostBalance` / `token1PostBalance` are nullable; rows where either is null/empty, or where the swap has no pair address, are filtered out. * **V4 pair addresses** arrive as `poolId_0xaddress` (\~109 chars) and are stored **raw** for a key that's consistent across destinations. MySQL caps `pair_address` at `VARCHAR(160)`; Postgres `TEXT` and ClickHouse `String` are unbounded. * **MySQL precision ceiling.** MySQL `DECIMAL(65,0)` cannot represent a full 78-digit `uint256`, though no real reserve approaches that magnitude. Postgres (`NUMERIC(76,0)`) and ClickHouse (`String`) carry the larger range. ### Related > [card] [Swaps by Pair](/data-feeds/templates/markets/swaps-by-pair) > > Every DEX trade for a pair, the same swap stream these reserves derive from. > [card] [Pair OHLCV](/data-feeds/templates/markets/pair-ohlcv) > > Per-pair price candles for charting. # Swaps by Pair Source: https://docs.moralis.com/data-feeds/templates/markets/swaps-by-pair Sync every DEX trade on a pool/pair, direct pool fills and aggregator-routed trades, USD-enriched in-block, keyed by pool address so a pair's trade feed is a prefix scan, into your own database. ### Question it answers > "Give me every DEX trade on pool/pair **0x…**, newest first, each row is one trade with both token legs, the side, the protocol, and a USD notional." Same trade projection as [Swaps by Token](/data-feeds/templates/markets/swaps-by-token), but keyed by the **pool/pair address** with **one row per trade** (no per-token-side unpivot). `pool_address` is the **pair address** for direct pool fills and the **aggregator address** for aggregator-routed trades. ### What you get One row per trade, keyed by `pool_address`: | Column | Description | | - | - | | `pool_address` | Pair address (pool fills) or aggregator address (aggregator-routed trades) | | `token0_address`, `token1_address` | The pair's two tokens | | `amount0`, `amount1` | Raw token-unit deltas for each leg (`uint256` as text) | | `side` | `buy` · `sell`, derived from the base token's pool-balance delta | | `source_kind` | `pool_fill` (direct pool) · `aggregator` (aggregator-routed) | | `price_usd` | Bought-leg (`token1`) USD price; `NULL` with no in-block price update | | `notional_usd` | `token1Amount / 10^token1Decimals × price_usd`; `NULL` if unpriced | | `protocol` | DEX/protocol identifier | | `fee_amount`, `fee_token`, `fee_usd` | Trade fee, pool fills only (`NULL` on aggregator rows) | | `trader_address` | The trading wallet | | `block_number`, `event_ts`, `tx_hash`, `vendor_event_id` | On-chain ordering and identity | ### Source The transform reads two per-block trade arrays and projects them into one feed: `tokenSwaps` (direct pool fills, `source_kind='pool_fill'`, `pool_address = pairAddress`) · `aggregateTokenSwaps` (aggregator-routed trades, `source_kind='aggregator'`, `pool_address = aggregatorAddress`) The two branches are disjoint by construction, together they give every fill exactly once. USD values are computed **inline** from the same block's `tokenPriceUpdates` (the chronologically-last update wins on duplicate keys), no separate price join at read time. ### Destination | Destination | Table | By-pair access | | - | - | - | | **ClickHouse** (first-class) | `fact_swaps_by_pair` | Prefix scan on `(chain_id, pool_address, event_ts, …)`; read with `FINAL` or `sum(sign)` | | **Postgres** | `swaps` | Index lead `(pool_address, block_number DESC)` | | **MySQL** | `swaps` | Index lead `(pool_address, block_number)` | ClickHouse uses the collapsing log-table pattern (see the [templates overview](/data-feeds/templates/overview#destinations)) so chain reorganizations self-correct, the `+1/−1` reorg pair for a trade shares an identical key and collapses cleanly. The fact table's sort key is pool-first, so a pair's full trade feed is a contiguous range read. ### Full schema The complete read table this template produces, one row per trade. Keep the columns you need and drop the rest (see [Schema & flexibility](/data-feeds/templates/overview#schema--flexibility)). Raw `uint256` amounts are stored as text in ClickHouse (they exceed numeric precision); USD columns are nullable so an unpriced token leaves them empty. > [accordion] ClickHouse, fact\_swaps\_by\_pair > > ```sql theme={null} > CREATE TABLE recipe_swaps_by_pair.fact_swaps_by_pair > ( > vendor_event_id String, > ingested_at DateTime64(3), > chain_id UInt32, > block_hash String, > block_number UInt64, > event_ts DateTime64(3), > pool_address String, -- pair (pool_fill) or aggregator > token0_address String, > token1_address String, > amount0 String, -- raw uint256 > amount1 String, -- raw uint256 > trader_address String, > price_usd Nullable(String), > notional_usd Nullable(String), > side LowCardinality(String), -- buy | sell > source_kind LowCardinality(String), -- aggregator | pool_fill > protocol LowCardinality(String), > fee_amount Nullable(String), > fee_token Nullable(String), > fee_usd Nullable(String), > sign Int8 > ) > ENGINE = ReplicatedCollapsingMergeTree( > '/clickhouse/tables/{database}/fact_swaps_by_pair', '{replica}', sign) > PARTITION BY (chain_id, toYYYYMM(event_ts)) > ORDER BY (chain_id, pool_address, event_ts, vendor_event_id); > ``` > > The `sign` column drives reorg collapsing, read with `FINAL` or `sum(sign)`, never a bare `WHERE sign=1`. A single-node setup can use `CollapsingMergeTree(sign)` without the replication path. > [accordion] Postgres, swaps > > ```sql theme={null} > CREATE TABLE public.swaps ( > position BIGINT NOT NULL, > log_index BIGINT, -- NULL for aggregator rows > transaction_index BIGINT, > block_number BIGINT NOT NULL, > block_timestamp BIGINT NOT NULL, -- unix seconds > tx_hash TEXT NOT NULL, > vendor_event_id TEXT NOT NULL, > trader_address TEXT NOT NULL, > pool_address TEXT NOT NULL, -- pair (pool_fill) or aggregator > token0_address TEXT NOT NULL, > token1_address TEXT NOT NULL, > amount0 NUMERIC(76, 0) NOT NULL, > amount1 NUMERIC(76, 0) NOT NULL, > price_usd NUMERIC(38, 18), > notional_usd NUMERIC(38, 18), > side TEXT NOT NULL, > source_kind TEXT NOT NULL, -- aggregator | pool_fill > protocol TEXT NOT NULL, > fee_amount NUMERIC(76, 0), > fee_token TEXT, > fee_usd NUMERIC(38, 18) > ); > > -- By-pair access (the template's primary purpose). > CREATE INDEX IF NOT EXISTS swaps_pool_block_idx > ON public.swaps (pool_address, block_number DESC); > -- Token + trader + block-range helpers. > CREATE INDEX IF NOT EXISTS swaps_token0_block_idx > ON public.swaps (token0_address, block_number DESC); > CREATE INDEX IF NOT EXISTS swaps_token1_block_idx > ON public.swaps (token1_address, block_number DESC); > CREATE INDEX IF NOT EXISTS swaps_trader_block_idx > ON public.swaps (trader_address, block_number DESC); > CREATE INDEX IF NOT EXISTS swaps_block_idx > ON public.swaps (block_number); > ``` > > MySQL is the same shape with `DECIMAL(38,18)` for the USD columns. Amounts use `NUMERIC(76,0)` so large raw `uint256` balances never overflow. `position` is the block-level cursor used during backfill. ### Example reads All trades on a pool/pair, newest first (ClickHouse): ```sql theme={null} SELECT event_ts, side, source_kind, token0_address, token1_address, amount0, amount1, notional_usd, protocol FROM recipe_swaps_by_pair.fact_swaps_by_pair FINAL WHERE chain_id = 1 AND pool_address = lower('0x88e6A0c2dDD26FEEb64F039a2c41296FcB3f5640') ORDER BY event_ts DESC LIMIT 50; ``` 24h USD volume per pool (sign-aware, cheaper than `FINAL`): ```sql theme={null} SELECT pool_address, sumIf(toFloat64OrZero(notional_usd), sign = 1) - sumIf(toFloat64OrZero(notional_usd), sign = -1) AS volume_usd FROM recipe_swaps_by_pair.fact_swaps_by_pair WHERE chain_id = 1 AND event_ts >= now() - INTERVAL 1 DAY GROUP BY pool_address ORDER BY volume_usd DESC LIMIT 25; ``` Postgres / MySQL: ```sql theme={null} SELECT block_number, side, source_kind, token0_address, token1_address, amount0, amount1, notional_usd, protocol FROM swaps WHERE pool_address = lower('0x88e6...') ORDER BY block_number DESC LIMIT 50; ``` ### Modes Shipped defaults: **ClickHouse `hybrid`** (backfill → realtime), **Postgres / MySQL `historical`** (one-shot backfill). For live/reorg-safe ingestion use ClickHouse, see the [overview](/data-feeds/templates/overview#modes). > [!NOTE] > > The realtime reorg path needs a single-column `UNIQUE` on the position column, but `position` is block-level (many trades per block), so array-expanded trade rows can only carry a composite unique. Run realtime/hybrid on **ClickHouse** (the log table corrects reorgs per-block via the collapsing companion table); the Postgres / MySQL configs are intended for `historical` backfill. ### Multichain The template is chain-parametrized, point it at any supported EVM chain or Solana. On Solana, the same `logIndex` can be assigned to multiple events in one instruction, so for production the pool-fill event identity is widened with `(token0_address, token1_address, token0_amount)` to keep rows distinct; the trade feed it produces is identical in shape. ### How much data does this consume? This template's exact selection has not been measured end to end yet. The closest measured scope: on **Solana mainnet**, a continuous real-time feed of `tokenSwaps` plus `tokenPriceUpdates` (plus the negligible `launchpadEvents` slice) measured **\~250 GB** in a typical month and **\~330 GB** in a busy one (measured 2026-08-04, 30 sampled partitions, `metered` delivery, uncompressed bytes). This template additionally reads `aggregateTokenSwaps`, so expect a somewhat larger figure than that band. Three caveats: * **Real-time only.** A historical backfill is billed separately and is usually the larger number; its size depends entirely on how far back you go. * **Solana only.** Volume concentrates hard per chain, so this figure does not extrapolate to other chains. * **Filtering does not reduce it.** Restricting to specific pairs or tokens happens after the data is delivered. To reduce cost, narrow the **block range**, not the entity set. If you want your exact scope measured before you commit to a plan, [reach out](https://admin.moralis.com/data-feeds) and we will probe it against the live feed rather than estimate it. ### Fidelity gaps * **`price_usd` / `notional_usd` / `fee_usd` are `NULL`** when the relevant token had no in-block `tokenPriceUpdate` (illiquid or brand-new tokens). The template enriches only from same-block price updates, there is no cross-block carry-forward. * **`fee_*` is populated for pool fills only.** Aggregator-routed trades carry no per-fill fee, so `fee_amount` / `fee_token` / `fee_usd` are `NULL` on `source_kind='aggregator'` rows. * **One trade can appear under two `pool_address` values** when it is observed both as a direct pool fill (the pair address) and as part of an aggregator route (the aggregator address). These are distinct events with distinct `vendor_event_id`s by design, the two source arrays are disjoint per event. ## Migrating from the REST API This template supplies the volume leg of the token-pairs REST endpoint. That endpoint composes a pool registry with live numbers, so there is **no 1:1 replacement**, you land the pieces and join them in one view. Fidelity labels: **exact** = straight from the chain, **calculated** = derived from real DEX trades (very close, compare with a tolerance), **add yourself** = off-chain signal not in the feed. ### GET /erc20/:token\_address/pairs Lists every DEX pool that trades a token, with price, liquidity, and 24h volume per pool. The pool list itself comes through exactly from a purpose-built registry; the live figures are computed from the same onchain trades the old endpoint uses. > [!WARNING] > > This endpoint needs a **combination of templates**, not one. The pool list comes from the `pairAddressLookup` registry template (`pair_address_lookup_observations`, one row per pool with exchange, protocol, fee, and both tokens); this template's `swaps` table supplies the 24h volume; add [Pair Reserves](/data-feeds/templates/markets/pair-reserves) for liquidity, [Token Prices](/data-feeds/templates/token/token-prices) for `usd_price` and the 24h change, and [Token Metadata](/data-feeds/templates/token/token-metadata) for symbols and `pair_label`, then join them in one view. | `/erc20/:token_address/pairs` | Data Feeds | Fidelity | | - | - | - | | `pair_address`, `exchange_address` | `pair_address_lookup_observations.*` | exact | | `exchange_name` | `.protocol` | exact | | `base_token`, `quote_token` | `.token0_address` / `.token1_address` | exact | | `pair_label`, `token_name`, `token_symbol`, `token_decimals` | `token_metadata` / registry, derive the label | exact | | `usd_price`, `usd_price_24hr*` | `token_price_updates` | calculated | | `liquidity_usd`, `liquidity_skew` | `pair_reserves` × price | calculated | | `volume_24h_usd`, `volume_24h_native` | `sum(swaps.notional_usd)` over 24h | calculated | | `inactive_pair` | no trades in the window | calculated | | `exchange_logo`, `token_logo` | add yourself | add yourself | The composed view (Postgres, query it with `WHERE base_token = $1 OR quote_token = $1 ORDER BY liquidity_usd DESC NULLS LAST`): ```sql theme={null} CREATE VIEW token_pairs AS SELECT r.pair_address, r.exchange_address, r.protocol AS exchange_name, m0.symbol || '/' || m1.symbol AS pair_label, r.token0_address AS base_token, r.token1_address AS quote_token, p0.usd_price, (res.reserve0 / power(10, r.token0_decimals) * p0.usd_price) + (res.reserve1 / power(10, r.token1_decimals) * p1.usd_price) AS liquidity_usd, v.volume_24h_usd, (v.volume_24h_usd IS NULL) AS inactive_pair FROM pair_address_lookup_observations r LEFT JOIN token_metadata m0 ON m0.token_address = r.token0_address LEFT JOIN token_metadata m1 ON m1.token_address = r.token1_address LEFT JOIN pair_reserves res ON res.pair_address = r.pair_address LEFT JOIN LATERAL (SELECT usd_price FROM token_price_updates WHERE token_address = r.token0_address ORDER BY block_number DESC LIMIT 1) p0 ON true LEFT JOIN LATERAL (SELECT usd_price FROM token_price_updates WHERE token_address = r.token1_address ORDER BY block_number DESC LIMIT 1) p1 ON true LEFT JOIN LATERAL (SELECT sum(notional_usd) AS volume_24h_usd FROM swaps WHERE pool_address = r.pair_address AND block_timestamp >= extract(epoch FROM now()) - 86400) v ON true; ``` **Gotchas** * A token trades in **many** pools (fee tiers, DEXes), list them by matching either side of the registry, and sort by liquidity to surface the meaningful ones. * Backfill is mixed: the pool list needs history far enough back to see each pool's deployment (full history for completeness), while price, liquidity, and 24h volume only need `realtime` plus a 24-hour window. See [History & backfill](/data-feeds/concepts/history-and-backfill). * The volume join keys on the **pair address**, so it matches this template's `pool_fill` rows only, aggregator-routed fills carry the aggregator's address in `pool_address` (see [Fidelity gaps](#fidelity-gaps)). * The live figures track the old endpoint closely but come from a pricing computation, compare with a tolerance, not bit-for-bit. * `exchange_logo` and `token_logo` are off-chain images, layer them in from your own source keyed by address, or drop them. ### Related > [card] [Swaps by Token](/data-feeds/templates/markets/swaps-by-token) > > The same trade projection, keyed by token with one row per token side. > [card] [Pair OHLCV](/data-feeds/templates/markets/pair-ohlcv) > > Roll a pair's trades into candlesticks for charting. > [card] [Trading & Charting](/data-feeds/use-cases/trading-charting) > > The use case this per-pair trade feed powers. > [card] [Token Analytics](/data-feeds/use-cases/token-analytics) > > Pool-level volume and trade flow for token analytics. # Swaps by Token Source: https://docs.moralis.com/data-feeds/templates/markets/swaps-by-token Sync every DEX trade that touched a token, pool fills and aggregator-routed trades, USD-enriched at block time, into your own database, keyed for fast by-token lookups. ### Question it answers > "Give me every DEX trade that touched token **0x…**, newest first, with the amount on each side, the USD notional, the protocol, and whether it was a buy or a sell." A single read returns what the public Moralis Swaps endpoints serve by token, stored **pre-shaped and indexed by token** in your own database. Both direct pool fills and aggregator-routed trades are captured, so you see every fill of the token once. ### What you get The template lands **one row per (trade, token side)**, each trade is unpivoted so it appears under both of its tokens, and a by-token lookup is a prefix scan. Key columns of the fact table: | Column | Description | | - | - | | `token_address` | This side's token (the leg you're querying by) | | `counter_token_address` | The other token in the trade | | `leg` | `token0` or `token1`, which side of the underlying trade this row is | | `side` | `buy` or `sell`, derived from the base token's pool-balance delta | | `side_amount` | Raw amount of `token_address` (uint256, as text) | | `counter_amount` | Raw amount of `counter_token_address` | | `notional_usd` | Trade notional in USD (bought-leg amount × in-block price) | | `price_usd` | Bought-leg (token1) USD price used for the notional | | `source_kind` | `pool_fill` (direct pool) or `aggregator` (aggregator-routed) | | `protocol` | DEX/protocol label | | `fee_amount`, `fee_token`, `fee_usd` | Trade fee (pool fills only) | | `trader_address`, `pool_address` | Trader and pool/aggregator address | | `block_number`, `event_ts`, `tx_hash` | On-chain ordering and time | ### Source The transform reads two per-block trade arrays and unions them into the trade feed: `tokenSwaps` (direct pool fills) · `aggregateTokenSwaps` (aggregator-routed trades) The two branches are disjoint by construction, pool fills are keyed off the pair address, aggregator routes off the aggregator address, so together they give every fill exactly once. USD values are computed **inline** from the same block's `tokenPriceUpdates` (the chronologically-last update wins on duplicate keys), so no separate price join is needed at read time. ### Destination | Destination | Table | Read pattern | | - | - | - | | **ClickHouse** (first-class) | `fact_swaps_by_token` | Prefix scan on `(chain_id, token_address, event_ts)`; read with `FINAL` or `sum(sign)` | | **Postgres** | `swaps` | Indexes on `token0_address` and `token1_address`, each `(…, block_number DESC)` | | **MySQL** | `swaps` | Indexes on `token0_address` and `token1_address` | ClickHouse uses the collapsing log-table pattern (see the [templates overview](/data-feeds/templates/overview#destinations)) so chain reorganizations self-correct. The fact table is token-first, so all trades for a token, newest first, are a contiguous range read. Postgres/MySQL keep a flat one-row-per-trade `swaps` table and reach a token via either side's index. ### Full schema Below is the complete read table this template produces. It's a starting point: keep the columns you need and drop the rest (see [Schema & flexibility](/data-feeds/templates/overview#schema--flexibility)). Raw `uint256` amounts and fees are stored as text in ClickHouse and as `NUMERIC(76, 0)` in Postgres (explicit precision so large raw balances never overflow); USD columns are nullable wide decimals. > [accordion] ClickHouse, fact\_swaps\_by\_token > > ```sql theme={null} > CREATE TABLE recipe_swaps_by_token.fact_swaps_by_token > ( > vendor_event_id String, > ingested_at DateTime64(3), > chain_id UInt32, > block_hash String, > block_number UInt64, > event_ts DateTime64(3), > token_address String, -- this side's token (token0 or token1) > counter_token_address String, > leg LowCardinality(String), -- 'token0' | 'token1' > side_amount String, -- this token's amount (raw uint256) > counter_amount String, > trader_address String, > pool_address String, > price_usd Nullable(String), > notional_usd Nullable(String), > side LowCardinality(String), -- buy | sell > source_kind LowCardinality(String), -- aggregator | pool_fill > protocol LowCardinality(String), > fee_amount Nullable(String), > fee_token Nullable(String), > fee_usd Nullable(String), > sign Int8 > ) > ENGINE = ReplicatedCollapsingMergeTree( > '/clickhouse/tables/{database}/fact_swaps_by_token', '{replica}', sign) > PARTITION BY (chain_id, toYYYYMM(event_ts)) > ORDER BY (chain_id, token_address, event_ts, vendor_event_id, leg); > ``` > > Each trade is unpivoted into two rows (`leg = 'token0'` and `'token1'`) so it's found under both tokens. `leg` is part of the `ORDER BY` so the two sides never collapse into each other, while the `+1/−1` reorg pair for one side shares an identical key and collapses cleanly. Read with `FINAL` or `sum(sign)`, never a bare `WHERE sign = 1`. A single-node setup can use `CollapsingMergeTree(sign)` without the replication path. > [accordion] Postgres, swaps > > ```sql theme={null} > CREATE TABLE public.swaps ( > position BIGINT NOT NULL, > log_index BIGINT, -- NULL for aggregator rows > transaction_index BIGINT, > block_number BIGINT NOT NULL, > block_timestamp BIGINT NOT NULL, -- unix seconds > tx_hash TEXT NOT NULL, > vendor_event_id TEXT NOT NULL, > trader_address TEXT NOT NULL, > pool_address TEXT NOT NULL, > token0_address TEXT NOT NULL, > token1_address TEXT NOT NULL, > amount0 NUMERIC(76, 0) NOT NULL, > amount1 NUMERIC(76, 0) NOT NULL, > price_usd NUMERIC(38, 18), > notional_usd NUMERIC(38, 18), > side TEXT NOT NULL, > source_kind TEXT NOT NULL, -- aggregator | pool_fill > protocol TEXT NOT NULL, > fee_amount NUMERIC(76, 0), > fee_token TEXT, > fee_usd NUMERIC(38, 18) > ); > > -- By-token access (the template's primary purpose). > CREATE INDEX IF NOT EXISTS swaps_token0_block_idx > ON public.swaps (token0_address, block_number DESC); > CREATE INDEX IF NOT EXISTS swaps_token1_block_idx > ON public.swaps (token1_address, block_number DESC); > -- Trader + block-range helpers. > CREATE INDEX IF NOT EXISTS swaps_trader_block_idx > ON public.swaps (trader_address, block_number DESC); > CREATE INDEX IF NOT EXISTS swaps_block_idx > ON public.swaps (block_number); > ``` > > MySQL is the same shape with `DECIMAL(38,18)` for the USD columns. The Postgres/MySQL table is one row per trade (not unpivoted), so a by-token read filters either `token0_address` or `token1_address`. `position` is the block-level cursor used during backfill. ### Example reads All trades touching a token, newest first (ClickHouse): ```sql theme={null} SELECT event_ts, leg, side, side_amount, counter_amount, notional_usd, protocol, source_kind FROM recipe_swaps_by_token.fact_swaps_by_token FINAL WHERE chain_id = 1 AND token_address = lower('0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48') ORDER BY event_ts DESC LIMIT 50; ``` 24h USD volume per token (sign-aware, cheaper than `FINAL`): ```sql theme={null} SELECT token_address, sumIf(toFloat64OrZero(notional_usd), sign = 1) - sumIf(toFloat64OrZero(notional_usd), sign = -1) AS volume_usd FROM recipe_swaps_by_token.fact_swaps_by_token WHERE chain_id = 1 AND event_ts >= now() - INTERVAL 1 DAY GROUP BY token_address ORDER BY volume_usd DESC LIMIT 25; ``` By-token read on Postgres / MySQL (either side matches): ```sql theme={null} SELECT block_number, side, source_kind, amount0, amount1, notional_usd, protocol FROM swaps WHERE token0_address = lower('0xA0b8...') OR token1_address = lower('0xA0b8...') ORDER BY block_number DESC LIMIT 50; ``` ### Modes Shipped defaults: **ClickHouse `hybrid`** (backfill → realtime), **Postgres / MySQL `historical`** (one-shot backfill). For live/reorg-safe ingestion, use ClickHouse, see the [overview](/data-feeds/templates/overview#modes). > [!NOTE] > > The realtime reorg path needs a single-column unique on the position cursor, but `position` is block-level (many trades per block), so the array-expanded trade rows can only carry a composite unique. Run **realtime/hybrid on ClickHouse**, where the collapsing log table corrects reorgs per-block; the Postgres/MySQL configs are intended for `historical` backfill. ### Multichain The template is chain-parametrized, point it at any supported EVM chain or Solana. On Solana, multiple events in one instruction can share a `logIndex`, so the pool-fill event identity is widened (with the token addresses and amount) to keep rows distinct; the by-token feed it produces is identical in shape. ### USD valuation and fidelity gaps * **`notional_usd`** is the bought-leg (`token1`) amount scaled by its decimals × the in-block price (`token1Amount / 10^token1Decimals × price`), so it's a true dollar value when the token had an in-block price update. * **`price_usd`, `notional_usd`, `fee_usd`** are `NULL` when the bought token had **no in-block price update**, there's no off-block price backfill at write time. Join the Token Prices sync for fuller coverage. * **`fee_*`** is populated for **pool fills only**; bps-style fees (V3/V4/CL) are converted to an absolute amount, and already-absolute fees pass through. Aggregator-routed rows leave fees `NULL`. * **`side`** (`buy`/`sell`) is derived from the lower-priority (base) token's pool-balance delta on the trade. ## Migrating from the REST API This template is the trade-level foundation for the token-analytics REST endpoint. That endpoint returns a pre-aggregated dashboard, so there is **no 1:1 replacement table**, you land the token's trades with this template and compute the rolling windows yourself, joining sibling templates for price, liquidity, and FDV. Every figure is **calculated** (aggregated from real trades, prices, reserves, and supply, very close, compare with a tolerance); there are no off-chain fields to add. ### GET /tokens/:tokenAddress/analytics Buy/sell volume, buyers/sellers, trade counts, unique wallets, price change, liquidity, and FDV per rolling window (5m / 1h / 6h / 24h). On Data Feeds those windows become queries you own, and so does any other window or metric (buy/sell ratio, VWAP, …). > [!WARNING] > > This endpoint needs a **combination of templates**, not one. Run this template (the trades) plus [Token Prices](/data-feeds/templates/token/token-prices) (`token_price_updates`, `usdPrice` and `pricePercentChange`), [Pair Reserves](/data-feeds/templates/markets/pair-reserves) (`pair_reserves`, `totalLiquidityUsd`), and [Token Metadata](/data-feeds/templates/token/token-metadata) (`token_metadata.total_supply`, FDV) against the same database, then aggregate. There is no pre-aggregated analytics template, the composition is the supported path. | `/tokens/:tokenAddress/analytics` | Data Feeds | Fidelity | | - | - | - | | `totalBuyVolume`, `totalSellVolume` (per window) | `sum(swaps.notional_usd)` by side | calculated | | `totalBuyers`, `totalSellers`, `totalBuys`, `totalSells` | distinct traders / trade counts by side | calculated | | `uniqueWallets` | distinct traders in the window | calculated | | `usdPrice`, `pricePercentChange` | latest `token_price_updates.usd_price` / price now vs window-ago | calculated | | `totalLiquidityUsd` | sum of the token's pool reserves × price | calculated | | `totalFullyDilutedValuation` | `total_supply` × price | calculated | The trade-side aggregation for one window (Postgres, run per window: 300 / 3600 / 21600 / 86400 seconds): ```sql theme={null} SELECT sum(notional_usd) FILTER (WHERE side = 'buy') AS total_buy_volume, sum(notional_usd) FILTER (WHERE side = 'sell') AS total_sell_volume, count(DISTINCT trader_address) FILTER (WHERE side='buy') AS total_buyers, count(DISTINCT trader_address) FILTER (WHERE side='sell') AS total_sellers, count(*) FILTER (WHERE side = 'buy') AS total_buys, count(*) FILTER (WHERE side = 'sell') AS total_sells, count(DISTINCT trader_address) AS unique_wallets FROM swaps WHERE (token0_address = lower($1) OR token1_address = lower($1)) AND block_timestamp >= extract(epoch FROM now()) - 86400; ``` Layer the rest on top: `usdPrice` is the latest price update, `pricePercentChange` compares it to the price a window ago, `totalLiquidityUsd` sums the token's pool reserves valued at price, and `totalFullyDilutedValuation` is `total_supply × price`. **Gotchas** * Backfill enough history to cover your longest window, a day or more for the 24h figures, plus price history for the price change. See [History & backfill](/data-feeds/concepts/history-and-backfill). * Materialize per token and window on a schedule if you serve many tokens, don't recompute per request. * Thin tokens have sparse windows, and trades whose bought leg had no in-block price carry `NULL` notional and drop out of USD sums. * On ClickHouse, run the same aggregation over `fact_swaps_by_token` with a prefix scan on `token_address` (the unpivot means a by-token filter already sees each trade once), and make it reorg-safe with `FINAL` or sign-aware sums, never a bare `WHERE sign = 1`. ### Related > [card] [Swaps by Pair](/data-feeds/templates/markets/swaps-by-pair) > > The sibling, every trade keyed by pool/pair address. > [card] [Token Analytics](/data-feeds/use-cases/token-analytics) > > The use case this by-token trade feed powers. # Swaps by Wallet Source: https://docs.moralis.com/data-feeds/templates/markets/swaps-by-wallet Sync every DEX trade made by a wallet, pool fills and aggregator-routed trades, USD-enriched at block time, keyed for by-trader lookups in your own database. ### Question it answers > "Give me every DEX trade made by wallet **0x…**, newest first, direct pool fills and aggregator-routed trades alike, each with its USD notional, side, and protocol." A single prefix scan returns what the public Moralis Swaps endpoints serve, pre-shaped and keyed by trader so a wallet's trade history is a contiguous range read. ### What you get The template lands **one row per trade**, a trade belongs to exactly one trader (`fromAddress`), so there's no per-side fan-out. Both direct pool fills and aggregator-routed trades land in the same table: | Column | Description | | - | - | | `trader_address` | The wallet that made the trade | | `event_ts`, `block_number` | When the trade happened | | `tx_hash` | Transaction that produced the trade | | `pool_address` | The pair (pool fill) or aggregator (aggregator route) | | `token0_address`, `token1_address` | The two legs of the trade | | `amount0`, `amount1` | Raw `uint256` amounts moved on each leg | | `side` | `buy` / `sell`, decided by the base token's pool-balance delta | | `source_kind` | `pool_fill` (direct pool) or `aggregator` (router) | | `price_usd` | Bought-leg (`token1`) USD price at block time | | `notional_usd` | Trade value: `token1Amount / 10^token1Decimals × price_usd` | | `protocol` | The DEX protocol of the fill | | `fee_amount`, `fee_token`, `fee_usd` | Pool-fill fees (bps fees converted to absolute), `NULL` for aggregator rows | ### Source The transform reads two per-block arrays and unions them into the trade feed, so every fill is captured exactly once: `tokenSwaps` (direct pool fills, `source_kind = 'pool_fill'`) · `aggregateTokenSwaps` (aggregator routes, `source_kind = 'aggregator'`) The two branches are disjoint by construction. USD enrichment is computed **inline** from the same block's `tokenPriceUpdates`, a per-block price map is built once and the bought leg is priced O(log N) per trade, with no separate price join at read time. ### Destination | Destination | Table | Read pattern | | - | - | - | | **ClickHouse** (first-class) | `fact_swaps_by_wallet` | Prefix scan on `(chain_id, trader_address, event_ts)`; read with `FINAL` or `sum(sign)` | | **Postgres** | `swaps` | Index on `(trader_address, block_number DESC)` | | **MySQL** | `swaps` | Index on `(trader_address, block_number)` | ClickHouse uses the collapsing log-table pattern (see the [templates overview](/data-feeds/templates/overview#destinations)) so chain reorganizations self-correct, a trade's `+1/−1` pair shares an identical key and collapses cleanly. The fact table's sort key is trader-first, so a wallet's trade history is a contiguous range read. ### Full schema Below is the complete read table this template produces. It's a starting point, keep the columns you need and drop the rest (see [Schema & flexibility](/data-feeds/templates/overview#schema--flexibility)). Raw `uint256` amounts are stored as text in ClickHouse (they exceed numeric precision) and as `NUMERIC(76, 0)` in Postgres; USD columns are wide decimals so a low-decimals token × price never overflows. > [accordion] ClickHouse, fact\_swaps\_by\_wallet > > ```sql theme={null} > CREATE TABLE recipe_swaps_by_wallet.fact_swaps_by_wallet > ( > vendor_event_id String, > ingested_at DateTime64(3), > chain_id UInt32, > block_hash String, > block_number UInt64, > event_ts DateTime64(3), > trader_address String, > pool_address String, > token0_address String, > token1_address String, > amount0 String, -- raw uint256 > amount1 String, -- raw uint256 > price_usd Nullable(String), -- bought-leg (token1) USD price > notional_usd Nullable(String), -- token1 amount × price_usd > side LowCardinality(String), -- buy | sell > source_kind LowCardinality(String), -- aggregator | pool_fill > protocol LowCardinality(String), > fee_amount Nullable(String), > fee_token Nullable(String), > fee_usd Nullable(String), > sign Int8 > ) > ENGINE = ReplicatedCollapsingMergeTree( > '/clickhouse/tables/{database}/fact_swaps_by_wallet', '{replica}', sign) > PARTITION BY (chain_id, toYYYYMM(event_ts)) > ORDER BY (chain_id, trader_address, event_ts, vendor_event_id); > ``` > > The `sign` column drives reorg collapsing, read with `FINAL` or `sum(sign)`. A single-node setup can use `CollapsingMergeTree(sign)` without the replication path. > [accordion] Postgres, swaps > > ```sql theme={null} > CREATE TABLE public.swaps ( > position BIGINT NOT NULL, > log_index BIGINT, -- NULL for aggregator rows > transaction_index BIGINT, > block_number BIGINT NOT NULL, > block_timestamp BIGINT NOT NULL, -- unix seconds > tx_hash TEXT NOT NULL, > vendor_event_id TEXT NOT NULL, > trader_address TEXT NOT NULL, > pool_address TEXT NOT NULL, > token0_address TEXT NOT NULL, > token1_address TEXT NOT NULL, > amount0 NUMERIC(76, 0) NOT NULL, -- raw uint256 > amount1 NUMERIC(76, 0) NOT NULL, -- raw uint256 > price_usd NUMERIC(38, 18), > notional_usd NUMERIC(38, 18), > side TEXT NOT NULL, > source_kind TEXT NOT NULL, -- aggregator | pool_fill > protocol TEXT NOT NULL, > fee_amount NUMERIC(76, 0), > fee_token TEXT, > fee_usd NUMERIC(38, 18) > ); > > -- By-wallet access (the template's primary purpose). > CREATE INDEX IF NOT EXISTS swaps_trader_block_idx > ON public.swaps (trader_address, block_number DESC); > -- By-token access helpers. > CREATE INDEX IF NOT EXISTS swaps_token0_block_idx > ON public.swaps (token0_address, block_number DESC); > CREATE INDEX IF NOT EXISTS swaps_token1_block_idx > ON public.swaps (token1_address, block_number DESC); > -- Block-range helper. > CREATE INDEX IF NOT EXISTS swaps_block_idx > ON public.swaps (block_number); > ``` > > MySQL is the same shape with `DECIMAL(38,18)` for the USD columns and `DECIMAL(76,0)` for raw amounts. `position` is the block-level cursor used during backfill. ### Example reads All trades made by a wallet, newest first (ClickHouse): ```sql theme={null} SELECT event_ts, side, source_kind, amount0, amount1, notional_usd, protocol FROM recipe_swaps_by_wallet.fact_swaps_by_wallet FINAL WHERE chain_id = 1 AND trader_address = lower('0x28C6c06298d514Db089934071355E5743bf21d60') ORDER BY event_ts DESC LIMIT 50; ``` 24h USD volume per wallet (sign-aware, cheaper than `FINAL`): ```sql theme={null} SELECT trader_address, sumIf(toFloat64OrZero(notional_usd), sign = 1) - sumIf(toFloat64OrZero(notional_usd), sign = -1) AS volume_usd FROM recipe_swaps_by_wallet.fact_swaps_by_wallet WHERE chain_id = 1 AND event_ts >= now() - INTERVAL 1 DAY GROUP BY trader_address ORDER BY volume_usd DESC LIMIT 25; ``` The same by-wallet read on Postgres / MySQL: ```sql theme={null} SELECT block_number, side, source_kind, amount0, amount1, notional_usd, protocol FROM swaps WHERE trader_address = lower('0x28C6...') ORDER BY block_number DESC LIMIT 50; ``` ### Modes Shipped defaults: **ClickHouse `hybrid`** (backfill → realtime), **Postgres / MySQL `historical`** (one-shot backfill). For live/reorg-safe ingestion, use ClickHouse, see the [overview](/data-feeds/templates/overview#modes). > [!NOTE] > > The realtime reorg path needs a single-column unique on the block-level position, but `position` is block-level (many trades share one block), so array-expanded trade rows can only carry a composite unique. Run realtime/hybrid on **ClickHouse**, where the collapsing log table corrects reorgs per-block. The Postgres / MySQL configs are intended for `historical` backfill. ### Multichain The template is chain-parametrized, point it at any supported EVM chain or Solana. On Solana, the same `logIndex` can be assigned to multiple events in one instruction, so the pool-fill event identity is widened with `(token0_address, token1_address, token0_amount)` to keep rows distinct; the trade feed it produces is identical in shape. ### Fidelity gaps * **`notional_usd` is single-leg.** The trade value is computed from the bought leg (`token1`) only, `token1Amount / 10^token1Decimals × price_usd`. If the bought token had no in-block price update, `price_usd`, `notional_usd`, and `fee_usd` are `NULL`. * **`amount0` / `amount1` are raw `uint256`.** They are not decimal-scaled, divide by `10^token_decimals` (sourced from a Token Metadata sync) to read human amounts. * **Fees are pool-fill only.** `fee_*` columns are populated for direct pool fills (bps fees converted to an absolute amount); aggregator rows leave them `NULL`. ## Migrating from the REST API This template replaces the wallet-swaps REST endpoint. It is **not** a 1:1 replica of the response, you land the trades in your own database and reconstruct the response shape with a query. Fidelity labels: **exact** = straight from the chain, **calculated** = derived from real DEX trades (very close, compare with a tolerance), **add yourself** = off-chain signal not in the feed. ### GET /wallets/:address/swaps A wallet's DEX trade history with bought/sold legs and USD values. Replaced directly by this template, trades are keyed by `trader_address`, so the REST response is a single by-wallet read, with [Token Metadata](/data-feeds/templates/token/token-metadata) joined in for the leg symbols and `pairLabel`. | `/wallets/:address/swaps` | Data Feeds | Fidelity | | - | - | - | | `transactionHash`, `transactionIndex`, `blockNumber`, `blockTimestamp` | `swaps.*` | exact | | `transactionType` (buy/sell) | `swaps.side` | exact | | `pairAddress`, `exchangeName` | `swaps.pool_address` / `protocol` | exact | | `bought` / `sold` legs (address, amount) | `swaps.token0/1_address`, `amount0/1` | exact | | `bought/sold.symbol`, `name`, `pairLabel` | `token_metadata` join / derive | exact | | `usdPrice`, `usdAmount`, `totalValueUsd`, `baseQuotePrice` | `swaps.price_usd` / `notional_usd` | calculated | | `walletAddressLabel`, `entity`, `entityLogo`, `exchangeLogo`, token logos | add yourself | add yourself | | `subCategory` (accumulation/distribution) | classify yourself | add yourself | The REST read with keyset pagination (Postgres, adapt to your destination): ```sql theme={null} SELECT s.* FROM swaps s WHERE s.trader_address = lower($1) AND ($2::bigint IS NULL OR s.block_number < $2) -- keyset pagination (REST cursor) ORDER BY s.block_number DESC LIMIT $3; ``` **Gotchas** * USD values are calculated from real trades, compare with a tolerance, and they're `NULL` when the bought leg had no in-block price update (see [Fidelity gaps](#fidelity-gaps)). * Leg symbols and `pairLabel` need the `token_metadata` join, and `amount0`/`amount1` land as raw `uint256`, scale by `10^decimals` from the same table. * The off-chain extras (`walletAddressLabel`, `entity`, logos) come from your own directory or get dropped; `subCategory` is a classification rule you define over the wallet's trades. * The REST `transactionTypes` filter becomes `WHERE side = 'buy'` / `'sell'`; date and block windows are plain SQL. * Both direct pool fills and aggregator-routed trades land in the one table, `source_kind` distinguishes them, matching the old endpoint's mixed feed. ### Related > [card] [Swaps by Token](/data-feeds/templates/markets/swaps-by-token) > > The same trade feed keyed by token instead of trader. > [card] [Token Analytics](/data-feeds/use-cases/token-analytics) > > The use case this trade feed powers. # NFT Collection Metadata Source: https://docs.moralis.com/data-feeds/templates/nft/nft-collection-metadata Sync the on-chain name, symbol, and contract type (ERC-721 / ERC-1155) of every NFT collection, keyed by collection address, into your own database. Mirrors the Moralis GET /nft/{address}/metadata endpoint. ### Question it answers > "Give me the collection metadata (name, symbol, contract type) for NFT collection **0x…**." Mirrors Moralis `GET /nft/{address}/metadata`. This is the NFT-collection sibling of [Token Metadata](/data-feeds/templates/token/token-metadata). Both read the same per-block deployed-contracts stream, but this template keeps only **NFT-type** contracts (ERC-721 / ERC-1155) and drops ERC-20 tokens. Collection metadata is fixed at deploy time, so there is normally exactly one row per `(chain_id, token_address)`: the latest deploy by `(block_number, transaction_index)` is canonical (defensive against a CREATE2 re-deploy at a reused address). ### What you get One row per NFT-type contract deploy, keyed by the collection (`token_address`): | Column | Description | | - | - | | `token_address` | The NFT collection contract address | | `name` | On-chain collection name, best-effort; may be empty for many ERC-1155 collections | | `symbol` | On-chain collection symbol, best-effort; may be empty | | `contract_type` | `ERC721` · `ERC1155` · `NFT` (derived from the EIP-165 interface ids; `NFT` is the fallback when neither interface is advertised) | | `deployer_address` | Address that deployed the contract | | `block_number`, `transaction_index` | Deploy position, the recency tiebreaker for latest-wins | | `block_timestamp` | Block time of the deploy | Unlike the ERC-20 path, symbol-less contracts are **not** dropped: `name`/`symbol` are best-effort on-chain fields, not filter keys. Far fewer rows land than Token Metadata: only a handful of NFT contracts deploy per \~1000 blocks. ### Source The transform reads the per-block deployed-contracts stream and keeps the **NFT slice**, contracts whose `type` contains `NFT` (ERC-721 / ERC-1155). A contract is kept when its `deployer_address` is non-empty. `contract_type` is derived from the contract's `supportedInterfaces` (EIP-165 ids): `0xd9b67a26` → `ERC1155`, else `0x80ac58cd` → `ERC721`, else the `NFT` fallback. ### Destination | Destination | Table | By-collection access | | - | - | - | | **ClickHouse** (first-class) | `fact_nft_collection_metadata` | `ORDER BY (chain_id, token_address)`; latest deploy via `argMax(…, (block_number, transaction_index))`, read with `FINAL` | | **Postgres** | `nft_collection_metadata` (matview over `nft_collection_metadata_observations`) | Unique index on `(token_address)` | | **MySQL** | `nft_collection_metadata` (latest-wins state table over the observations) | Primary key on `(token_address)` | ClickHouse uses the collapsing log-table pattern (see the [templates overview](/data-feeds/templates/overview#destinations)) so a reorg of a deploy block self-corrects. Because a collection can in principle deploy more than once at the same address (CREATE2), reads resolve **latest deploy wins** with `argMax(…, (block_number, transaction_index))` rather than assuming a single row. Postgres derives the current-metadata surface as a `DISTINCT ON (token_address)` materialized view; MySQL maintains it incrementally with a latest-wins trigger. ### Full schema The complete read table this template produces. Keep the columns you need, `name`/`symbol`/`contract_type` are usually enough for a metadata lookup (see [Schema & flexibility](/data-feeds/templates/overview#schema--flexibility)). `name` and `symbol` are stored as text; they can contain quotes and odd characters, which are parameter-bound on insert so there is no quoting breakage. > [accordion] ClickHouse, fact\_nft\_collection\_metadata > > ```sql theme={null} > CREATE TABLE recipe_nft_collection_metadata.fact_nft_collection_metadata > ( > vendor_event_id String, > ingested_at DateTime64(3), > chain_id UInt32, > block_hash String, > block_number UInt64, > transaction_index UInt32, > event_ts DateTime64(3), > token_address String, > deployer_address String, > name String, > symbol String, > contract_type LowCardinality(String), -- ERC721 | ERC1155 | NFT > sign Int8 > ) > ENGINE = ReplicatedCollapsingMergeTree( > '/clickhouse/tables/{database}/fact_nft_collection_metadata', '{replica}', sign) > PARTITION BY (chain_id, toYYYYMM(event_ts)) > ORDER BY (chain_id, token_address, block_number, transaction_index, vendor_event_id); > ``` > > The `sign` column drives reorg collapsing, read with `FINAL` or a sign-aware aggregate, never a bare `WHERE sign = 1`. A single-node setup can use `CollapsingMergeTree(sign)` without the replication path. The collection-keyed sort order makes a single-collection lookup a tight prefix scan. > [accordion] Postgres, nft\_collection\_metadata > > ```sql theme={null} > -- 1. Observations (sink target): one row per NFT-contract deploy. > CREATE TABLE public.nft_collection_metadata_observations ( > position BIGINT NOT NULL, -- block-level cursor used during backfill > transaction_index BIGINT, > block_number BIGINT NOT NULL, > block_timestamp BIGINT NOT NULL, -- unix seconds > tx_hash VARCHAR(66) NOT NULL, > vendor_event_id TEXT NOT NULL, > token_address VARCHAR(66) NOT NULL, > deployer_address VARCHAR(66) NOT NULL, > name TEXT NOT NULL, > symbol TEXT NOT NULL, > contract_type VARCHAR(16) NOT NULL -- ERC721 | ERC1155 | NFT > ); > > -- Speeds the DISTINCT ON (latest-per-collection) the materialized view computes. > CREATE INDEX IF NOT EXISTS ncmo_token_recency_idx > ON public.nft_collection_metadata_observations > (token_address, block_number DESC, transaction_index DESC); > > -- 2. Current-metadata materialized view: latest deploy per token_address. > CREATE MATERIALIZED VIEW public.nft_collection_metadata AS > SELECT DISTINCT ON (token_address) > token_address, > name, > symbol, > contract_type, > block_number, > deployer_address > FROM public.nft_collection_metadata_observations > ORDER BY token_address, block_number DESC, transaction_index DESC; > > -- Required by REFRESH MATERIALIZED VIEW CONCURRENTLY (one row per collection). > CREATE UNIQUE INDEX IF NOT EXISTS nft_collection_metadata_pk > ON public.nft_collection_metadata (token_address); > > -- Lookup helpers. > CREATE INDEX IF NOT EXISTS nft_collection_metadata_symbol_idx > ON public.nft_collection_metadata (symbol); > CREATE INDEX IF NOT EXISTS nft_collection_metadata_type_idx > ON public.nft_collection_metadata (contract_type); > ``` > > The sink appends to `nft_collection_metadata_observations`; refresh the current-metadata view on a schedule with `REFRESH MATERIALIZED VIEW CONCURRENTLY nft_collection_metadata;`. MySQL mirrors this shape, `VARCHAR(255)` for `name`/`symbol`, with the current-metadata `nft_collection_metadata` table maintained incrementally by an `AFTER INSERT` latest-wins trigger. ### Example reads Metadata for one collection, latest deploy wins (ClickHouse): ```sql theme={null} SELECT token_address, argMax(name, (block_number, transaction_index)) AS name, argMax(symbol, (block_number, transaction_index)) AS symbol, argMax(contract_type, (block_number, transaction_index)) AS contract_type, argMax(deployer_address, (block_number, transaction_index)) AS deployer_address FROM recipe_nft_collection_metadata.fact_nft_collection_metadata FINAL WHERE chain_id = 1 AND token_address = lower('0x...') GROUP BY token_address; ``` All NFT collections deployed in a block range (ClickHouse): ```sql theme={null} SELECT token_address, name, symbol, contract_type, block_number FROM recipe_nft_collection_metadata.fact_nft_collection_metadata FINAL WHERE chain_id = 1 AND block_number BETWEEN 19000000 AND 19001000 ORDER BY block_number, transaction_index LIMIT 100; ``` Metadata for one collection (Postgres, after `REFRESH MATERIALIZED VIEW CONCURRENTLY nft_collection_metadata;`): ```sql theme={null} SELECT token_address, name, symbol, contract_type FROM public.nft_collection_metadata WHERE token_address = lower('0x...'); ``` ### Modes Shipped defaults: **ClickHouse `hybrid`** (backfill → realtime), **Postgres / MySQL `historical`** (one-shot backfill). For live/reorg-safe ingestion, use ClickHouse, see the [overview](/data-feeds/templates/overview#modes). > [!NOTE] > > The realtime reorg path on Postgres / MySQL needs a single-column `UNIQUE` on the block-level `position`, but a single block can deploy several NFT contracts, so the array-expanded rows can only carry a composite unique. Run **realtime/hybrid on ClickHouse**, where the collapsing log table corrects reorgs per-block. The Postgres / MySQL configs are intended for `historical` backfill, which is the dominant use of this template, a once-off metadata census. ### EVM only This template is EVM-shaped: it reads EVM contract deploys. Solana NFT (Metaplex) collection metadata does not flow through the deployed-contracts stream the same way EVM contract deploys do, so the template targets EVM chains. It is chain-parametrized via the `chain` setting across any supported EVM chain. ### Fidelity gaps `GET /nft/{address}/metadata` returns enrichment fields this template does not source, all off-chain indexer or editorial state: * `collection_logo` / `collection_banner_image`, off-chain CDN assets. * `collection_category`: editorial categorisation. * `project_url` / `discord_url` / `telegram_url` / `wiki_url`, social links. * `possible_spam` / `verified_collection`, spam & verification heuristics from a separate pipeline. * `synced_at` (wall-clock), this template carries on-chain `block_number` / `block_timestamp` instead. The core on-chain fields, `token_address`, `name`, `symbol`, `contract_type`, plus `block_number` and `deployer_address`, are fully sourced. ## Migrating from the REST API This template replaces the collection-metadata side of the NFT REST endpoints. Data Feeds are **not** 1:1 replicas of those responses, you land the underlying data in your own database and reconstruct the response shape with a query. The subsections below cover each REST endpoint: what replaces it, the field mapping (**exact** = straight from the chain, **calculated** = derived from real trades, very close, **add yourself** = off-chain signal not in the feed), and the endpoint-specific gotchas. ### GET /nft/:address/metadata A collection's identity. Replaced directly by this template's `nft_collection_metadata` table, `name`, `symbol`, and `contract_type` land from the contract's deploy, keyed by `token_address`. Optionally add [NFT Trades](/data-feeds/templates/nft/nft-trades) for `last_sale`. The editorial layer (logo, banner, category, description, social links) and floor price are off-chain, bring your own collection directory and floor source, or drop them. | `/nft/:address/metadata` | Data Feeds | Fidelity | | - | - | - | | `token_address`, `name`, `symbol`, `contract_type` | `nft_collection_metadata.*` | exact | | `last_sale` (sale facts) | `nftTrades` | exact | | `last_sale` USD | `nftTrades` + price feed | calculated | | `collection_logo`, `collection_banner_image`, `collection_category`, `description`, social links | add yourself | off-chain | | `possible_spam`, `verified_collection` | add yourself | off-chain | | `floor_price`, `floor_price_usd`, `floor_price_currency` | add yourself | off-chain | | `synced_at`, `created_date` | add yourself (on-chain `block_number` / `block_timestamp` carried instead) | off-chain | The lookup (Postgres, adapt to your destination): ```sql theme={null} SELECT token_address, name, symbol, contract_type FROM nft_collection_metadata WHERE token_address = lower('0x...'); ``` **Gotchas** * **`name`/`symbol` can be empty** for some ERC-1155 collections (no on-chain name), expected, not an error. * **Backfill from the collection's deploy block**: metadata is recorded at deployment, so the deploy block must be in your indexed window. See [History & backfill](/data-feeds/concepts/history-and-backfill). * `contract_type` may be the `NFT` fallback when a contract advertises neither EIP-165 interface; the REST endpoint made a similar best-effort call. ### POST /nft/getMultipleNFTs Batch NFT lookup by `(token_address, token_id)`. The onchain half, ownership, mint provenance, contract type, collection identity, realized sales, is replaced by a composition of templates, with no 25-NFT batch cap. > [!WARNING] > > This endpoint needs **multiple templates**, and it is *mostly a metadata product*. Run [NFT Owners by Contract](/data-feeds/templates/nft/nft-owners-by-contract) (current owner per token\_id) plus this template (collection `name` / `symbol`), [NFT Transfers](/data-feeds/templates/nft/nft-transfers) (mint provenance), and [NFT Trades](/data-feeds/templates/nft/nft-trades) (`last_sale`) against the same database. The resolved token JSON, media, rarity, and floor/listing prices are built off-chain from each token's `tokenURI` and marketplace data, pair the templates with your own metadata resolver and pricing sources, or drop those fields. If resolved metadata is the entire job, keep a metadata indexer for that layer; the templates supply the ownership and provenance to pair with it. | `/nft/getMultipleNFTs` | Data Feeds | Fidelity | | - | - | - | | `token_address`, `token_id` | the lookup key | exact | | `contract_type`, `owner_of`, `amount`, `block_number` | `nft_owners.*` (`owner_of` = `wallet_address`, `amount > 0`) | exact | | `block_number_minted`, `minter_address` | `nft_transfers` (mint = from the zero address) | exact | | `name`, `symbol` | `nft_collection_metadata.*` | exact | | `token_hash` | derive (hash of contract + id) | exact | | `last_sale` (sale facts) | `nftTrades` | exact | | `last_sale` USD values | `nftTrades` + price feed | calculated | | `token_uri`, `metadata`, `normalized_metadata`, `media` | add yourself (resolve token URI) | off-chain | | `rarity_rank`, `rarity_percentage`, `rarity_label` | add yourself (rarity tool) | off-chain | | `floor_price*`, `list_price` | add yourself (pricing/marketplace) | off-chain | | `possible_spam`, `verified_collection`, collection editorial, `*_sync` timestamps | add yourself | off-chain | The batch lookup (Postgres, adapt to your destination): ```sql theme={null} SELECT o.token_address, o.token_id, o.contract_type, o.wallet_address AS owner_of, o.amount, o.block_number, c.name, c.symbol FROM nft_owners o LEFT JOIN nft_collection_metadata c ON c.token_address = o.token_address WHERE (o.token_address, o.token_id) IN (VALUES (lower('0x...'), '1234'), (lower('0x...'), '5678')) AND o.amount > 0; ``` **Gotchas** * **Backfill each collection from its deploy block**: a token's current owner is the cumulative result of every transfer, so a late start returns stale or missing owners. * **ERC-1155** token\_ids can have many owners, you get `(owner, amount)` rows rather than a single `owner_of`. * `token_id` is a `uint256` stored as text, compare as strings, never as numbers. * No batch cap and no per-call limits, the 25-NFT ceiling disappears; batch size is just the length of your `IN` list. ### Related > [card] [NFT Owners by Contract](/data-feeds/templates/nft/nft-owners-by-contract) > > Current holders of a collection, pair with this metadata for a complete collection view. > [card] [NFT Marketplace](/data-feeds/use-cases/nft-marketplace) > > The use case this collection metadata powers. # NFT Owners by Contract Source: https://docs.moralis.com/data-feeds/templates/nft/nft-owners-by-contract Sync the current owner set for an NFT collection (every wallet holding a token_id, with live counts for ERC-1155 editions) into your own database. Mirrors the Moralis GET /nft/{address}/owners endpoint. ### Question it answers > "Give me every current owner of NFT collection **0x…**: each `token_id`, the wallet that holds it, and how many (ERC-1155 editions)." Mirrors Moralis `GET /nft/{address}/owners`. This is the by-collection sibling of [NFTs by Wallet](/data-feeds/templates/wallet/nfts-by-wallet): **same ingest, sorted the other way.** Each NFT transfer carries the **absolute** post-transfer holdings of both wallets, so the latest observation per `(token_address, token_id, wallet)` is the current owner. Storing the resolved owner set in your own database, keyed by collection, is the value. ### What you get Each NFT transfer becomes **two per-wallet holding observations** (`leg = from | to`), where `amount` is the absolute count of that `token_id` held by the wallet *after* the transfer. The latest observation per `(token_address, token_id, wallet_address)` wins; keep `amount > 0` for the current owner set. | Column | Description | | - | - | | `token_address` | The NFT collection (contract) | | `token_id` | The specific NFT: `uint256`, stored as text (256-bit ids overflow numeric types) | | `wallet_address` | The holder; the EVM zero address is excluded (mint/burn counterparty) | | `amount` | Absolute post-transfer holding of this `token_id`: `0`/`1` for ERC-721, an arbitrary count for ERC-1155 editions | | `contract_type` | ERC-721 / ERC-1155 discriminator | | `leg` | `from` or `to`: which side of the transfer produced this observation | | `block_number`, `log_index` | Recency tuple; latest wins per holding key | | `event_ts` / `block_timestamp` | Block time | ### Source The transform reads one per-block array, `nftTokenTransfers`, and unpivots each event into two observations using its `fromPostBalance` / `toPostBalance` fields (the from- and to-wallet's absolute count of that `token_id` after the transfer). No price or metadata join is involved. ### Destination | Destination | Table | By-collection access | | - | - | - | | **ClickHouse** (first-class) | `fact_nft_owners_by_contract` | Prefix scan on `(chain_id, token_address, token_id, wallet_address, …)`; current owner via `argMax` over `FINAL` | | **Postgres** | `nft_owner_observations` → `nft_owners` (materialized view) | Partial index `(token_address, token_id, wallet_address) WHERE amount > 0` | | **MySQL** | `nft_owner_observations` → `nft_owners` (trigger-maintained) | PK `(token_address, token_id, wallet_address)` + `amount = 0` cleanup | ClickHouse uses the collapsing log-table pattern (see the [templates overview](/data-feeds/templates/overview#destinations)) so chain reorganizations self-correct. The fact table is sorted collection-first, so "every owner of collection X" is a contiguous range read. Ownership is **latest-wins**: an observation is current state for its holding key, not an append-only event. Read canonical state with `FINAL` then `argMax`, never a bare `WHERE sign = 1`. ### Full schema Below is the complete read table this template produces: one row per holding observation. Keep the columns you need and drop the rest (see [Schema & flexibility](/data-feeds/templates/overview#schema--flexibility)). `token_id` and `amount` are stored as text / wide numeric because full-range `uint256` ids and counts overflow standard numeric types. > [accordion] ClickHouse, fact\_nft\_owners\_by\_contract > > ```sql theme={null} > CREATE TABLE recipe_nft_owners_by_contract.fact_nft_owners_by_contract > ( > vendor_event_id String, > ingested_at DateTime64(3), > chain_id UInt32, > block_hash String, > block_number UInt64, > log_index UInt32, > event_ts DateTime64(3), > token_address String, > token_id String, -- uint256, kept as text > contract_type LowCardinality(String), -- ERC721 | ERC1155 > wallet_address String, > amount String, -- absolute post-transfer holding of this token_id > leg LowCardinality(String), -- from | to > sign Int8 > ) > ENGINE = ReplicatedCollapsingMergeTree( > '/clickhouse/tables/{database}/fact_nft_owners_by_contract', '{replica}', sign) > PARTITION BY (chain_id, toYYYYMM(event_ts)) > ORDER BY (chain_id, token_address, token_id, wallet_address, block_number, log_index, vendor_event_id, leg); > ``` > > The `sign` column drives reorg collapsing: read with `FINAL` then `argMax`, or a sign-aware aggregate. A single-node setup can use `CollapsingMergeTree(sign)` without the replication path. > [accordion] Postgres, nft\_owner\_observations + nft\_owners > > ```sql theme={null} > CREATE TABLE public.nft_owner_observations ( > position BIGINT NOT NULL, > log_index BIGINT NOT NULL, > block_number BIGINT NOT NULL, > block_timestamp BIGINT NOT NULL, -- unix seconds > token_address TEXT NOT NULL, > token_id TEXT NOT NULL, -- uint256, kept as text > contract_type TEXT NOT NULL, -- ERC721 | ERC1155 > wallet_address TEXT NOT NULL, > amount NUMERIC(76, 0) NOT NULL, -- absolute post-balance of this token_id > leg TEXT NOT NULL, > vendor_event_id TEXT NOT NULL > ); > > -- Recency index for the DISTINCT ON; leads with the holding key so > -- REFRESH MATERIALIZED VIEW CONCURRENTLY avoids a sort. > CREATE INDEX noo_owner_recency_idx > ON public.nft_owner_observations > (token_address, token_id, wallet_address, block_number DESC, log_index DESC); > > -- Current-owner surface: latest observation per (token, id, wallet). > CREATE MATERIALIZED VIEW public.nft_owners AS > SELECT DISTINCT ON (token_address, token_id, wallet_address) > token_address, token_id, wallet_address, contract_type, > amount, block_number, log_index, block_timestamp > FROM public.nft_owner_observations > ORDER BY token_address, token_id, wallet_address, block_number DESC, log_index DESC; > > CREATE UNIQUE INDEX nft_owners_pk > ON public.nft_owners (token_address, token_id, wallet_address); > > -- Primary access path: current owners of a collection. > CREATE INDEX nft_owners_by_contract_active_idx > ON public.nft_owners (token_address, token_id, wallet_address) WHERE amount > 0; > > -- OPTIONAL: sibling by-wallet access path — every NFT held by a wallet. > -- CREATE INDEX nft_owners_by_wallet_active_idx > -- ON public.nft_owners (wallet_address, token_address, token_id) WHERE amount > 0; > ``` > > MySQL is the same shape with a trigger-maintained `nft_owners` state table and a `DELETE … WHERE amount = 0` cleanup. `position` is the block-level cursor used during backfill. Refresh the materialized view on a schedule with `REFRESH MATERIALIZED VIEW CONCURRENTLY nft_owners;`. ### Example reads Current owners of a collection, latest non-zero holding per `token_id` + wallet (ClickHouse): ```sql theme={null} SELECT token_id, wallet_address, contract_type, current_amount FROM ( SELECT token_id, wallet_address, argMax(contract_type, (block_number, log_index)) AS contract_type, argMax(amount, (block_number, log_index)) AS current_amount FROM recipe_nft_owners_by_contract.fact_nft_owners_by_contract FINAL WHERE chain_id = 1 AND token_address = lower('0x...') GROUP BY token_id, wallet_address ) WHERE current_amount != '0' AND current_amount != '' ORDER BY token_id, wallet_address; ``` Current owners (Postgres, after refreshing the materialized view): ```sql theme={null} REFRESH MATERIALIZED VIEW CONCURRENTLY nft_owners; SELECT token_id, wallet_address, contract_type, amount FROM public.nft_owners WHERE token_address = lower('0x...') AND amount > 0 ORDER BY token_id, wallet_address; ``` Distinct holder count for a collection (Postgres): ```sql theme={null} SELECT count(DISTINCT wallet_address) FROM public.nft_owners WHERE token_address = lower('0x...') AND amount > 0; ``` ### Modes Shipped defaults: **ClickHouse `hybrid`** (backfill → realtime), **Postgres / MySQL `historical`** (one-shot backfill). For live/reorg-safe ingestion, use ClickHouse (see the [overview](/data-feeds/templates/overview#modes)). > [!NOTE] > > Realtime/hybrid on Postgres / MySQL is constrained because the block-level `position` cursor requires a single-column unique key. Run realtime/hybrid on **ClickHouse**; the Postgres / MySQL configs target `historical` backfill. ### Multichain The template is chain-parametrized via the `chain` setting: point it at any supported EVM chain. NFTs on Solana are SPL tokens; if a chain emits NFT transfers under the same `nftTokenTransfers` struct, set the Solana chain variables. The `vendor_event_id` already incorporates `(token_id, amount)` on top of `log_index` to stay row-unique under Solana's repeated log indices; the owner surface it produces is identical in shape. ### Fidelity gaps This template returns on-chain ownership only. Fields a Moralis `/nft/{address}/owners` response carries that have **no onchain source** (they need a separate metadata/indexer service) are not populated: * `name`, `symbol`, `token_uri`, `metadata`, `normalized_metadata`: collection / token metadata (use an NFT Collection Metadata template). * `possible_spam`, verified-collection flags: risk / curation signals. * `block_number_minted` and historical mint provenance beyond the backfill window. `amount` is the raw on-chain holding count, not a marketplace listing. The core access key (`token_address` → owners with `token_id`, `amount`, `contract_type`) is fully sourced from `nftTokenTransfers`. ## Migrating from the REST API This template replaces the by-collection ownership endpoints of the Web3 API. Data Feeds are **not** 1:1 replicas of those responses: you land the underlying data in your own database and reconstruct the response shape with a query. The subsections below cover each REST endpoint: what replaces it, the field mapping (**exact** = straight from the chain, **calculated** = derived from real trades, very close, **add yourself** = off-chain signal not in the feed), and the endpoint-specific gotchas. ### GET /nft/:address/owners Every owner of every token in a collection. Replaced by this template's owner surface (`nft_owners` on Postgres/MySQL, `argMax` over the ClickHouse fact table): one row per `(token_id, owner)` with `amount > 0`. > [!WARNING] > > Reproducing the full REST response needs **three templates**, not one. Run this template plus [NFT Collection Metadata](/data-feeds/templates/nft/nft-collection-metadata) (`name` / `symbol`) and [NFT Transfers](/data-feeds/templates/nft/nft-transfers) (mint provenance; the mint is the transfer from the zero address) against the same database. The resolved token metadata is a different story entirely: `token_uri`, `metadata`, and `normalized_metadata` are derived from each token's `tokenURI` off-chain. Pair the template with your own metadata resolver, or drop those fields. | `/nft/:address/owners` | Data Feeds | Fidelity | | - | - | - | | `token_address`, `token_id`, `contract_type`, `owner_of`, `amount` | `nft_owners.*` (`owner_of` = `wallet_address`) | exact | | `block_number` | `nft_owners.block_number` | exact | | `block_number_minted`, `minter_address` | `nft_transfers` (mint = from the zero address) | exact | | `name`, `symbol` | `nft_collection_metadata.*` | exact | | `token_hash` | derive (hash of contract + id) | exact | | `last_sale` USD | `nftTrades` + price feed | calculated | | `token_uri`, `metadata`, `normalized_metadata` | add yourself (resolve token URI) | off-chain | | `rarity_*`, `floor_price*`, `list_price` | add yourself (rarity tool / marketplace source) | off-chain | | `possible_spam`, `verified_collection`, `*_sync` timestamps | add yourself | off-chain | The reconstruction query (Postgres; adapt to your destination): ```sql theme={null} SELECT o.token_id, o.wallet_address AS owner_of, o.amount, o.contract_type, c.name, c.symbol, o.block_number FROM nft_owners o LEFT JOIN nft_collection_metadata c ON c.token_address = o.token_address WHERE o.token_address = lower('0x...') AND o.amount > 0 ORDER BY o.token_id, o.wallet_address; ``` **Gotchas** * **Backfill from the collection's deploy block.** Ownership is current state (the cumulative result of every transfer), so a late start returns stale or missing owners. See [History & backfill](/data-feeds/concepts/history-and-backfill). * **ERC-1155** token\_ids can have many owners, so you get a row per `(token_id, owner)`; ERC-721 has one owner per id. * Big collections paginate heavily; keyset on `(token_id, wallet_address)` instead of offset pages. ### GET /nft/:address Every NFT in a collection with its current owner. Same template, same tables, same joins as `/nft/:address/owners` above: the two endpoints are one read ordered differently (`ORDER BY o.token_id` for the collection listing). The field mapping is identical, plus the listing's extra enrichment fields: `media`, the collection editorial fields (logo, banner, category, social links), and `floor_price*` are all off-chain. **Add yourself** from your metadata resolver and marketplace sources, or drop them. **Gotchas** * The REST endpoint was mostly a metadata product; the chain only carries ownership, mint, and identity. If resolved JSON metadata and media are the entire job, keep a metadata indexer for that layer; this template supplies the ownership and provenance to pair with it. * The REST `totalRanges` / `range` parallel-scan pagination has no equivalent: it's your table now; scan or keyset on `token_id`. * Backfill from the collection's deploy block, as above. ### Related > [card] [NFTs by Wallet](/data-feeds/templates/wallet/nfts-by-wallet) > > The same ingest, sorted by wallet: every NFT a wallet holds. > [card] [NFT Transfers](/data-feeds/templates/nft/nft-transfers) > > The event-level feed behind these owner observations. > [card] [NFT Collection Metadata](/data-feeds/templates/nft/nft-collection-metadata) > > The name, symbol, and token URIs this template leaves out. > [card] [NFT Marketplace](/data-feeds/use-cases/nft-marketplace) > > The use case this owner surface powers. # NFT Trades Source: https://docs.moralis.com/data-feeds/templates/nft/nft-trades Sync every NFT marketplace trade (seller, buyer, collection, token ID, marketplace, and raw price), re-assembled into one row per traded NFT, into your own database. ### Question it answers > "Give me every NFT marketplace trade: for collection **0x…**, for a single `(collection, token_id)`, or for wallet **0x…** as seller or buyer." A single sync serves all three access paths. It mirrors the on-chain subset of Moralis `GET /nft/{address}/trades` (by collection), `GET /nft/{address}/{token_id}/trades` (single token), and `GET /wallets/{address}/nfts/trades` (by wallet). It is an on-chain trade log with no off-chain enrichment: no USD price, no reliable marketplace human-name, no address labels. ### What you get One row per **traded NFT**: a bundle/batch fill that moves several NFTs lands one row per `(trade, token_id)`, each carrying the bundle's per-item average price: | Column | Description | | - | - | | `token_address` | NFT collection address | | `token_id` | Token ID traded (`uint256`, stored as text) | | `seller_address` | The NFT sender on the trade | | `buyer_address` | The NFT recipient on the trade | | `amount` | ERC-1155 quantity (`1` for ERC-721) | | `price` | Raw price in `price_token_address` units; for bundles, the per-item average | | `price_token_address` | Payment token; `''` means native (ETH) | | `marketplace_address` | The marketplace contract, the canonical join key for naming | | `marketplace` | Marketplace human name when decoded (`''` otherwise) | | `tx_hash`, `block_number`, `log_index`, `transaction_index` | On-chain ordering and provenance | | `event_ts` | Block time | To collapse a bundle back to one logical trade, `GROUP BY (tx_hash, log_index)` and `groupArray(token_id)`. ### Source The template consumes the per-block `tradeTransactions` array, which is **fully flattened**: each element is one item (an NFT transfer, a token transfer, or an internal tx) for one participant in one trade. A single sale is spread across many rows. The transform re-joins those parts into one trade: it identifies the buyer (a participant who received an NFT **and** paid), reads the seller and collection off the received-NFT row, derives the price from the buyer's native or token payment, and emits one row per received NFT. ### Destination | Destination | Table | Read pattern | | - | - | - | | **ClickHouse** (first-class) | `fact_nft_trades` | Prefix scan on `(chain_id, token_address, token_id, block_number)`; `bloom_filter` skip-indexes on `seller_address` / `buyer_address`; read with `FINAL` | | **Postgres** | `nft_trades` | Indexes on `(token_address, block_number DESC)`, `(token_address, token_id, block_number DESC)`, and seller/buyer | | **MySQL** | `nft_trades` | Same indexes (without `DESC` on the key) | ClickHouse uses the collapsing log-table pattern (see the [templates overview](/data-feeds/templates/overview#destinations)): every trade row in a block shares the block's hash, so a per-block reorg corrects all of that block's trades together. The fact table's sort key is collection-first, so by-collection is a prefix scan and by-`(collection, token_id)` is a tighter prefix; by-wallet is served by the bloom-filter indexes. Read canonical state with `FINAL` or a sign-aware aggregate, never a bare `WHERE sign = 1`. ### Full schema Below is the complete read table this template produces. It's a starting point: keep the columns you need and drop the rest (see [Schema & flexibility](/data-feeds/templates/overview#schema--flexibility)). `token_id` and `price` are raw `uint256` values that exceed numeric precision, so they're stored as text / wide decimals. > [accordion] ClickHouse, fact\_nft\_trades > > ```sql theme={null} > CREATE TABLE recipe_nft_trades.fact_nft_trades > ( > vendor_event_id String, > ingested_at DateTime64(3), > chain_id UInt32, > block_hash String, > block_number UInt64, > event_ts DateTime64(3), > token_address String, -- NFT collection address > token_id String, -- uint256 big decimal, NEVER numeric > seller_address String, > buyer_address String, > amount String, -- ERC-1155 quantity (1 for ERC-721) > price String, -- raw, in price_token units > price_token_address String, -- '' ⇒ native (ETH) > marketplace String, -- human name when decoded ('' otherwise) > marketplace_address String, > tx_hash String, > log_index Nullable(UInt32), > transaction_index Nullable(Int32), > sign Int8, > -- by-wallet skip indexes: prune granules that cannot contain the wallet. > INDEX bf_seller seller_address TYPE bloom_filter(0.01) GRANULARITY 4, > INDEX bf_buyer buyer_address TYPE bloom_filter(0.01) GRANULARITY 4 > ) > ENGINE = ReplicatedCollapsingMergeTree( > '/clickhouse/tables/{database}/fact_nft_trades', '{replica}', sign) > PARTITION BY (chain_id, toYYYYMM(event_ts)) > ORDER BY (chain_id, token_address, token_id, block_number, vendor_event_id); > ``` > > The `sign` column drives reorg collapsing: read with `FINAL` or `sum(sign)`. A single-node setup can use `CollapsingMergeTree(sign)` without the replication path. The seller/buyer bloom-filter indexes ship enabled because by-wallet is a first-class access path here. > [accordion] Postgres, nft\_trades > > ```sql theme={null} > CREATE TABLE public.nft_trades ( > position BIGINT NOT NULL, > log_index BIGINT, > transaction_index BIGINT, > block_number BIGINT NOT NULL, > block_timestamp BIGINT NOT NULL, -- unix seconds > tx_hash TEXT NOT NULL, > vendor_event_id TEXT NOT NULL, > token_address TEXT NOT NULL, -- NFT collection address > token_id TEXT NOT NULL, -- uint256 big decimal, NEVER numeric > seller_address TEXT NOT NULL, > buyer_address TEXT NOT NULL, > amount NUMERIC(76, 0) NOT NULL, -- ERC-1155 quantity (1 for ERC-721) > price NUMERIC(76, 0) NOT NULL, -- raw, in price_token units > price_token_address TEXT NOT NULL, -- '' ⇒ native (ETH) > marketplace TEXT NOT NULL, -- human name when decoded ('' otherwise) > marketplace_address TEXT NOT NULL > ); > > -- By-collection access (the template's primary purpose). > CREATE INDEX IF NOT EXISTS nft_trades_token_block_idx > ON public.nft_trades (token_address, block_number DESC); > -- By-token-id access (single NFT sale history). > CREATE INDEX IF NOT EXISTS nft_trades_token_id_block_idx > ON public.nft_trades (token_address, token_id, block_number DESC); > -- By-wallet access (either side). > CREATE INDEX IF NOT EXISTS nft_trades_seller_block_idx > ON public.nft_trades (seller_address, block_number DESC); > CREATE INDEX IF NOT EXISTS nft_trades_buyer_block_idx > ON public.nft_trades (buyer_address, block_number DESC); > -- Block-range helper. > CREATE INDEX IF NOT EXISTS nft_trades_block_idx > ON public.nft_trades (block_number); > ``` > > MySQL is the same shape with `DECIMAL(76,0)` for `amount` / `price` and the equivalent keys. `position` is the block-level cursor used during backfill. ### Example reads All trades of an NFT collection, newest first (ClickHouse): ```sql theme={null} SELECT block_number, token_id, seller_address, buyer_address, price, price_token_address, marketplace_address, tx_hash FROM recipe_nft_trades.fact_nft_trades FINAL WHERE chain_id = 1 AND token_address = lower('0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D') ORDER BY block_number DESC LIMIT 50; ``` Sale history of a single token (collection + token\_id): ```sql theme={null} SELECT block_number, seller_address, buyer_address, price, price_token_address, tx_hash FROM recipe_nft_trades.fact_nft_trades FINAL WHERE chain_id = 1 AND token_address = lower('0xBC4C...') AND token_id = '1234' ORDER BY block_number DESC LIMIT 50; ``` All trades involving a wallet (as seller or buyer), bloom-pruned: ```sql theme={null} SELECT block_number, token_address, token_id, seller_address, buyer_address, price FROM recipe_nft_trades.fact_nft_trades FINAL WHERE chain_id = 1 AND (seller_address = lower('0x...') OR buyer_address = lower('0x...')) ORDER BY block_number DESC LIMIT 50; ``` ### Modes Shipped defaults: **ClickHouse `hybrid`** (backfill → realtime), **Postgres / MySQL `historical`** (one-shot backfill). For live/reorg-safe ingestion, use ClickHouse (see the [overview](/data-feeds/templates/overview#modes)). > [!NOTE] > > The realtime reorg path needs a single-column `UNIQUE` on the position column, but `position` is block-level; many trades share one block. Array-expanded trade rows can only carry a composite unique, so run realtime/hybrid on **ClickHouse** (its log table corrects reorgs per-block). The Postgres / MySQL configs are intended for `historical` backfill. ### Multichain The template is chain-parametrized: point it at any supported EVM chain or Solana. Solana marketplace trades (Magic Eden, Tensor, and others) populate the same `tradeTransactions` shape. Solana assigns the same `log_index` to multiple events in one instruction, so the trade's identity is widened with `(seller, buyer, token_address, token_id)` to keep rows distinct; the trade log it produces is identical in shape. ### Fidelity gaps The template lands the columns the trade array carries. Fields a Moralis NFT trades endpoint surfaces that have no reliable on-chain source here are omitted: * **USD price.** `price` is the raw amount in `price_token_address` units (native ETH when `price_token_address = ''`). Converting to USD needs a same-block Token Prices join or an external price feed, which is out of scope for this on-chain trade log. * **Marketplace human name.** The `marketplace` field is frequently empty/unreliable on-chain and is landed as-is (`''` when absent). `marketplace_address` is always present; map it to a human name with an off-chain marketplace directory. * **Address labels** (`seller_address_label`, `buyer_address_label`): off-chain entity tags, not on-chain data. * **Collection metadata** (`token_name`, `token_symbol`): from the NFT contract or a metadata indexer, not the trade event (see NFT Collection Metadata). * **Smallest-total price-token quirk.** When a buyer pays in tokens across multiple token addresses, the price token is chosen as the **smallest** summed total. This is preserved for parity with the production transformer; it is a likely upstream quirk. Native-paid trades (the common case) are unaffected. ### Related > [card] [NFT Transfers](/data-feeds/templates/nft/nft-transfers) > > Every NFT movement (mints, transfers, burns), the untraded counterpart to this trade log. > [card] [NFT Marketplace](/data-feeds/use-cases/nft-marketplace) > > The use case this trade feed powers. # NFT Transfers Source: https://docs.moralis.com/data-feeds/templates/nft/nft-transfers Sync every ERC-721 / ERC-1155 transfer, by contract, by wallet, or for a single (contract, token_id), as a flat event log into your own database. ### Question it answers > "Give me every NFT transfer: by contract **0x…**, by wallet **0x…**, or for a single `(contract, token_id)`." A single template serves all three access paths. It mirrors the on-chain subset of Moralis `GET /nft/{address}/transfers` (by contract), `GET /{address}/nft/transfers` (by wallet), and `GET /nft/{address}/{token_id}/transfers` (single token). It carries no off-chain enrichment: the source array has no collection metadata or address labels (see [Fidelity gaps](#fidelity-gaps)). ### What you get One row per NFT transfer, mapped straight from Moralis-indexed, normalized per-block onchain data: | Column | Description | | - | - | | `token_address` | The NFT contract that emitted the transfer | | `token_id` | The token id, a `uint256` big decimal stored as text (never numeric); compare as strings | | `from_address`, `to_address` | The two sides of the transfer | | `amount` | The ERC-1155 quantity (`1` for ERC-721) | | `contract_type` | `ERC721` or `ERC1155` (the emitted `tokenType`) | | `initiated_by` | The address that initiated the transfer | | `tx_hash` | Transaction that produced the transfer | | `block_number`, `transaction_index`, `log_index` | On-chain ordering tuple | | `block_timestamp` | Block time | ### Source The transform reads one per-block array and lands one row per transfer: `nftTokenTransfers` Fields map straight from the source struct: `tokenAddress`, `tokenId` (as a string), `fromAddress`, `toAddress`, `amount`, `tokenType` (→ `contract_type`), and `initiatedBy`. There's no price or metadata join; this is a flat event stream. ### Destination | Destination | Table | Read pattern | | - | - | - | | **ClickHouse** (first-class) | `fact_nft_transfers` | Prefix scan on `(chain_id, token_address, token_id, block_number)`; by-wallet via `bloom_filter` skip indexes; read with `FINAL` or `sum(sign)` | | **Postgres** | `nft_transfers` | Index on `(token_address, block_number DESC)`, `(token_address, token_id, block_number DESC)`, and `(from_address, …)` / `(to_address, …)` | | **MySQL** | `nft_transfers` | Same composite indexes (ascending) | ClickHouse uses the collapsing log-table pattern (see the [templates overview](/data-feeds/templates/overview#destinations)) so chain reorganizations self-correct: the `+1/−1` reorg pair for a row shares an identical key and collapses cleanly. The fact table's sort key is contract-first, so by-contract is a prefix scan on `token_address` and by-token-id a prefix scan on `(token_address, token_id)`. By-wallet reads are served by `bloom_filter` data-skipping indexes on `from_address` and `to_address`. ### Full schema Below is the complete read table this template produces. Keep the columns you need and drop the rest (see [Schema & flexibility](/data-feeds/templates/overview#schema--flexibility)). `token_id` and `amount` are stored at full `uint256` width: `token_id` as text (hash-derived ENS / ERC-1155 ids routinely exceed any SQL numeric precision), `amount` as a wide decimal. > [accordion] ClickHouse, fact\_nft\_transfers > > ```sql theme={null} > CREATE TABLE recipe_nft_transfers.fact_nft_transfers > ( > vendor_event_id String, > ingested_at DateTime64(3), > chain_id UInt32, > block_hash String, > block_number UInt64, > event_ts DateTime64(3), > token_address String, > token_id String, -- uint256 big decimal, NEVER numeric > from_address String, > to_address String, > amount String, -- ERC-1155 quantity (1 for ERC-721) > contract_type LowCardinality(String), -- ERC721 | ERC1155 > initiated_by String, > tx_hash String, > log_index Nullable(UInt32), > transaction_index Nullable(Int32), > sign Int8, > -- by-wallet skip indexes: prune granules that cannot contain the wallet. > INDEX bf_from from_address TYPE bloom_filter(0.01) GRANULARITY 4, > INDEX bf_to to_address TYPE bloom_filter(0.01) GRANULARITY 4 > ) > ENGINE = ReplicatedCollapsingMergeTree( > '/clickhouse/tables/{database}/fact_nft_transfers', '{replica}', sign) > PARTITION BY (chain_id, toYYYYMM(event_ts)) > ORDER BY (chain_id, token_address, token_id, block_number, vendor_event_id); > ``` > > The `sign` column drives reorg collapsing: read with `FINAL` or `sum(sign)`, never a bare `WHERE sign = 1`. A single-node setup can use `CollapsingMergeTree(sign)` without the replication path. > [accordion] Postgres, nft\_transfers > > ```sql theme={null} > CREATE TABLE public.nft_transfers ( > position BIGINT NOT NULL, > log_index BIGINT, > transaction_index BIGINT, > block_number BIGINT NOT NULL, > block_timestamp BIGINT NOT NULL, -- unix seconds > tx_hash TEXT NOT NULL, > vendor_event_id TEXT NOT NULL, > token_address TEXT NOT NULL, > token_id TEXT NOT NULL, -- uint256 big decimal, NEVER numeric > from_address TEXT NOT NULL, > to_address TEXT NOT NULL, > amount NUMERIC(76, 0) NOT NULL, > contract_type TEXT NOT NULL, -- ERC721 | ERC1155 > initiated_by TEXT NOT NULL > ); > > -- By-contract access (the template's primary purpose). > CREATE INDEX IF NOT EXISTS nft_transfers_token_block_idx > ON public.nft_transfers (token_address, block_number DESC); > -- By-token-id access (single NFT provenance). > CREATE INDEX IF NOT EXISTS nft_transfers_token_id_block_idx > ON public.nft_transfers (token_address, token_id, block_number DESC); > -- By-wallet access (either side). > CREATE INDEX IF NOT EXISTS nft_transfers_from_block_idx > ON public.nft_transfers (from_address, block_number DESC); > CREATE INDEX IF NOT EXISTS nft_transfers_to_block_idx > ON public.nft_transfers (to_address, block_number DESC); > -- Block-range helper. > CREATE INDEX IF NOT EXISTS nft_transfers_block_idx > ON public.nft_transfers (block_number); > ``` > > MySQL is the same shape with `VARCHAR(80)` for `token_id` and equivalent ascending composite keys. `position` is the block-level cursor used during backfill. ### Example reads All transfers of an NFT contract, newest first (ClickHouse): ```sql theme={null} SELECT block_number, token_id, from_address, to_address, amount, contract_type, tx_hash FROM recipe_nft_transfers.fact_nft_transfers FINAL WHERE chain_id = 1 AND token_address = lower('0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D') ORDER BY block_number DESC LIMIT 50; ``` Provenance of a single token (contract + token\_id): ```sql theme={null} SELECT block_number, from_address, to_address, amount, tx_hash FROM recipe_nft_transfers.fact_nft_transfers FINAL WHERE chain_id = 1 AND token_address = lower('0xBC4C...') AND token_id = '1234' ORDER BY block_number DESC LIMIT 50; ``` All NFT transfers involving a wallet (either side), bloom-pruned: ```sql theme={null} SELECT block_number, token_address, token_id, from_address, to_address, amount FROM recipe_nft_transfers.fact_nft_transfers FINAL WHERE chain_id = 1 AND (from_address = lower('0x...') OR to_address = lower('0x...')) ORDER BY block_number DESC LIMIT 50; ``` ### Modes Shipped defaults: **ClickHouse `hybrid`** (backfill → realtime), **Postgres / MySQL `historical`** (one-shot backfill). For live/reorg-safe ingestion, use ClickHouse (see the [overview](/data-feeds/templates/overview#modes)). > [!NOTE] > > The realtime reorg path needs a single-column `UNIQUE` on the position column, but `position` is block-level (many transfers share one block), so array-expanded transfer rows can only carry a composite unique. Run **realtime / hybrid on ClickHouse**: its log table corrects reorgs per-block via the collapsing companion table. The Postgres / MySQL shapes here are intended for `historical` backfill. ### Multichain The template is chain-parametrized: point it at any supported EVM chain or Solana. On Solana the same `logIndex` can be assigned to multiple events in one instruction, so the event identity is widened with `(from_address, to_address, token_address, token_id, amount)` to keep rows distinct; the transfer log it produces is identical in shape. ### Fidelity gaps The template lands only what the `nftTokenTransfers` array carries. Fields a Moralis NFT transfers endpoint surfaces that have **no onchain source** in this array are omitted: * **Collection metadata** (`token_name`, `token_symbol`): these come from the NFT contract / a metadata indexer, not the transfer event. Out of scope for a flat transfer log; see NFT Collection Metadata for the contract-metadata pattern. * **Address labels / entity tags** (`from_address_label`, `to_address_entity`, …): off-chain labels from a separate labelling service, not on-chain data. * **`value`**: the native value attached to the transfer transaction isn't carried on the transfer event; omitted. `amount` (the ERC-1155 quantity) is present. * **Pre/post NFT balances**: the template omits the balance surface to stay a flat event stream. ## Migrating from the REST API This template replaces the wallet NFT transfers REST endpoint. Data Feeds are **not** 1:1 replicas of the old responses: you land the underlying data in your own database and reconstruct the response shape with a query. Below: what replaces the endpoint, the field mapping (**exact** = straight from the chain, **calculated** = derived from real trades, very close, **add yourself** = off-chain signal not in the feed), and the endpoint-specific gotchas. ### GET /:address/nft/transfers A wallet's NFT transfer history. Replaced by this template's `nft_transfers` table: a wallet's transfers are the rows where it appears on either side, and the old endpoint's `contract_addresses`, `from_block`/`to_block`, and `order` parameters become plain `WHERE` / `ORDER BY` clauses. > [!WARNING] > > Reproducing the full REST response needs **three templates**, not one. The transfer event carries no collection metadata or sale context. Run this template plus [NFT Collection Metadata](/data-feeds/templates/nft/nft-collection-metadata) (`token_name` / `token_symbol`) and [NFT Trades](/data-feeds/templates/nft/nft-trades) (`last_sale`) against the same database and join them. | `/:address/nft/transfers` | Data Feeds | Fidelity | | - | - | - | | `token_address`, `token_id`, `contract_type` | `nft_transfers.*` | exact | | `from_address`, `to_address`, `amount` | `nft_transfers.*` | exact | | `operator` | `nft_transfers.initiated_by` | exact | | `transaction_hash`, `block_number`, `block_timestamp`, `transaction_index`, `log_index` | `nft_transfers.tx_hash` / `nft_transfers.*` | exact | | `value` (tx native value), `transaction_type` (Single/Batch) | the `nftTokenTransfers` source array, not the flat table (or `nftTrades` for sale price) | exact | | `token_name`, `token_symbol` | `nft_collection_metadata.*` | exact | | `last_sale` (sale facts) | `nftTrades` | exact | | `last_sale` USD values | `nftTrades` + price feed | calculated | | `possible_spam`, `verified_collection` | add yourself | off-chain | | `from/to_address_label`, `*_entity`, `*_entity_logo` | add yourself | off-chain | The reconstruction query (Postgres; adapt to your destination): ```sql theme={null} SELECT t.*, c.name AS token_name, c.symbol AS token_symbol, CASE WHEN t.from_address = lower('0xWALLET') THEN 'send' ELSE 'receive' END AS direction FROM nft_transfers t LEFT JOIN nft_collection_metadata c ON c.token_address = t.token_address WHERE (t.from_address = lower('0xWALLET') OR t.to_address = lower('0xWALLET')) ORDER BY t.block_number DESC, t.log_index DESC LIMIT 100; ``` **Gotchas** * **Direction is yours to derive**: the feed has no `send`/`receive` flag; compare the wallet to `from_address`/`to_address` as above. The template indexes both sides, so the OR match stays fast. * The address labels and spam/verification flags are off-chain signals with no onchain source: drop them, bring your own lists, or layer in a label source. * `token_id` is a `uint256` stored as text; compare as strings, never as numbers. * Backfill depth is your choice: transfers are an event list, not current state, so index only as much history as your app serves. ### Related > [card] [NFT Trades](/data-feeds/templates/nft/nft-trades) > > Marketplace sales with price, the trade-priced complement to raw transfers. > [card] [NFT Marketplace](/data-feeds/use-cases/nft-marketplace) > > The use case these NFT templates power. # Data Feed Templates Source: https://docs.moralis.com/data-feeds/templates/overview Pre-built blueprints that reconstruct Moralis's most popular endpoints (wallet history, balances, prices, swaps, holders) as continuous syncs into your own ClickHouse, Postgres, or MySQL. ### What a template is A **template** is a ready-made blueprint that reconstructs one popular Moralis endpoint as a continuous sync into a database you own. Instead of calling an API per request, you run the template once and the data lands, and stays current, in your own ClickHouse, Postgres, or MySQL. > [!NOTE] > > **Coming from the Moralis REST API?** Each template maps to one or more REST endpoints. Start with the [migration overview](/data-feeds/migration/overview) for how the API and Data Feeds differ, then use the [endpoint list](/data-feeds/migration/endpoints) to find the field-by-field guide for the endpoint you call today. Each template ships everything you need to run it: > [card] Sync config > > The source data, the projection that shapes it, and the destination wiring. > [card] Schema > > The destination DDL: tables, indexes, and materialized views. > [card] Queries > > The exact reads that answer the endpoint's question. Templates are **blueprints, not turnkey deployments**: they show the projection, schema, index layout, and reorg strategy for each access pattern. Lift the pieces you need. ### How a template works Every template is the same three-stage pipeline: ```text theme={null} Data Feeds source → transform (projection) → your database ``` 1. **Source**: normalized per-block data from Data Feeds. One block carries arrays of every event type (token transfers, native transfers, NFT transfers, swaps, approvals, price updates, and more). 2. **Transform**: a projection that expands the arrays you care about into one row per event and shapes them into the endpoint's schema. 3. **Destination**: the rows land in your database, indexed for the access pattern the endpoint serves (by wallet, by token, by pair, …). The same source event stream can land **different ways** for different questions: e.g. "balances by wallet" and "balances by token" are the same sync with a different sort key. ### Schema & flexibility Every template page includes a **full schema** (the complete set of columns that access pattern can produce), but nothing about it is fixed. Templates are blueprints you shape to your needs: * **Select the columns you want.** Start from the full wide table and keep only the fields your app reads. The projection pulls just the source fields behind the columns you keep, so trimming the schema trims the work. * **Select the events you want.** Multi-event templates (like [Wallet History](/data-feeds/templates/wallet/wallet-history)) union several event types into one table; drop the branches you don't need. * **Choose your keys and indexes.** The sort key and indexes are tuned for the headline access pattern; re-key for yours. Optional structures (like the by-`topic0` grouping on the [log templates](/data-feeds/templates/logs/contract-logs)) ship commented-out; enable them only when you need them. * **Pick your destination types.** Adjust column types to fit your warehouse. The shipped DDL flags where precision matters: raw `uint256` amounts as text, USD as wide decimals. In other words: the full schema is a **starting point, not a contract**. Take the complete shape and pare it down. ### Destinations Templates support three destinations. **ClickHouse is the first-class path**; it's the only one that handles live, reorg-safe ingestion: | Destination | Best for | Realtime / reorg-safe | | - | - | - | | **ClickHouse** | Production, large windows, live tailing | ✅ Yes (corrects chain reorganizations automatically) | | **Postgres** | Historical backfill, analytics, smaller windows | Backfill-first | | **MySQL** | Historical backfill, existing MySQL stacks | Backfill-first | ClickHouse templates use a **collapsing log-table** pattern: events land in a wide table, and a companion log table carries one signed row per block. When the chain reorganizes, the log emits a counter-row and ClickHouse collapses the pair on merge, so your tables converge on canonical state without manual cleanup. Read canonical state with `FINAL` or a sign-aware aggregate, never a bare `WHERE sign = 1`. Postgres and MySQL templates write flat, uniquely-keyed event tables and are **first-class for historical backfill**. For live/reorg-safe ingestion on these shapes, use ClickHouse. ### Modes | Mode | What it does | Default for | | - | - | - | | `historical` | One-shot backfill of a block window | Postgres / MySQL | | `realtime` | Live tail from the chain head | None | | `hybrid` | Backfill, then a seamless handoff to realtime | ClickHouse | ### Token Prices is the connective tissue Any "what is this worth in USD" question (a transfer's value, a portfolio's worth, a trade's notional) needs prices. The [Token Prices](/data-feeds/templates/token/token-prices) template is the shared join target across the accounting, portfolio, and trading use cases. Several templates (like [Wallet History](/data-feeds/templates/wallet/wallet-history)) also fold per-block USD values inline so common reads need no extra join. ### Template catalogue Templates are grouped by the API product they replace, so you can start from the API you use today. ⭐ marks the most popular endpoints. **Coming from the REST API?** Each template page ends with a **"Migrating from the REST API"** section: the REST endpoint(s) it replaces, the field-by-field mapping, and (because Data Feeds are not a 1:1 endpoint swap) the exact combination of templates you need when one endpoint spans several datasets. The [Map endpoints to templates](/data-feeds/migration/endpoints) table maps all covered endpoints in one place. | API | Template | Answers | | - | - | - | | **Wallet API** | [Wallet History](/data-feeds/templates/wallet/wallet-history) ⭐ | Every event a wallet was involved in | | | [Token Balances by Wallet](/data-feeds/templates/wallet/token-balances-by-wallet) ⭐ | Every token a wallet holds, with balance | | | [Native Balances](/data-feeds/templates/wallet/native-balances) | Native-asset balance per wallet | | | [NFTs by Wallet](/data-feeds/templates/wallet/nfts-by-wallet) ⭐ | Every NFT a wallet holds | | | [Token Approvals](/data-feeds/templates/wallet/token-approvals) | Current allowances a wallet has granted | | **Token API** | [Token Holders](/data-feeds/templates/token/token-holders) ⭐ | All non-zero holders of a token | | | [Token Balances by Token](/data-feeds/templates/token/token-balances-by-token) | Holder balances, keyed by token | | | [Token Transfers](/data-feeds/templates/token/token-transfers) | Every transfer of a token | | | [Token Stats](/data-feeds/templates/token/token-stats) | Per-token transfer counters | | | [Token Metadata](/data-feeds/templates/token/token-metadata) | Name, symbol, decimals, supply | | **Price API** | [Token Prices](/data-feeds/templates/token/token-prices) ⭐ | USD/native mark history for a token | | | [Pair OHLCV](/data-feeds/templates/markets/pair-ohlcv) | Candles per pool | | **DeFi API** | [Swaps by Wallet](/data-feeds/templates/markets/swaps-by-wallet) ⭐ | Every DEX trade made by a wallet | | | [Swaps by Token](/data-feeds/templates/markets/swaps-by-token) ⭐ | Every DEX trade touching a token | | | [Swaps by Pair](/data-feeds/templates/markets/swaps-by-pair) | Every DEX trade on a pool/pair | | | [Pair Reserves](/data-feeds/templates/markets/pair-reserves) | Current reserves per pool | | **NFT API** | [NFT Trades](/data-feeds/templates/nft/nft-trades) | Marketplace trades per collection / token / wallet | | | [NFT Transfers](/data-feeds/templates/nft/nft-transfers) | Every NFT movement | | | [NFT Owners by Contract](/data-feeds/templates/nft/nft-owners-by-contract) | Current owners of a collection | | | [NFT Collection Metadata](/data-feeds/templates/nft/nft-collection-metadata) | Collection-level metadata | | **Blockchain API** | [Contract Logs](/data-feeds/templates/logs/contract-logs) | Every raw event log emitted by a contract | | | [Logs by Event Signature](/data-feeds/templates/logs/logs-by-topic0) | One event signature (`topic0`) across all contracts | > [!NOTE] > > These are blueprints, not turnkey deployments; lift the projection, schema, and queries you need. See the use cases for ready-made template bundles: [Accounting & Tax](/data-feeds/use-cases/accounting), [Portfolio Tracking](/data-feeds/use-cases/portfolio-tracking), [Token Analytics](/data-feeds/use-cases/token-analytics), [Trading & Charting](/data-feeds/use-cases/trading-charting), [NFT Marketplace](/data-feeds/use-cases/nft-marketplace), [Compliance & AML](/data-feeds/use-cases/compliance-aml), and [Onchain Event Indexing](/data-feeds/use-cases/event-indexing). ### Get started > [card] [Run your first template](/data-feeds/migration/quickstart) > > Set up a sink and see template data land in your own database. # Historical Balances Source: https://docs.moralis.com/data-feeds/templates/token/historical-balances Reconstruct any wallet's balance of any token at any past block, and the full holder set of a token as of a block, from a retained per-(wallet, token) balance event log in your own database. ### Question it answers > "What was wallet **0x…**'s balance of token **0x…** at block **N**, for any past block? And who held the token back then?" The latest-state balance templates ([Token Balances by Wallet](/data-feeds/templates/wallet/token-balances-by-wallet), [Token Holders](/data-feeds/templates/token/token-holders)) keep only the *current* balance. This template keeps **every** observation, so an as-of-block balance is a point lookup and a token's **holder set at block N** is a single query. ### What you get Token transfers carry the **absolute** post-transfer balance of both sides (`fromPostBalance` / `toPostBalance`). Each transfer becomes two per-wallet observations, and **all** of them are retained (not just the latest). The balance as of block N is the observation with the highest `(block_number, log_index)` at or below N. | Column | Description | | - | - | | `wallet_address` | The holder, leading sort key | | `token_address` | The token contract | | `balance` | Absolute post-transfer balance, raw `uint256` as text | | `block_number`, `log_index` | Recency tuple, the latest at or below N wins | | `leg` | `from` / `to`, which side of the transfer produced this observation | | `tx_hash`, `event_ts` | The transaction and block time | | `vendor_event_id` | Stable per-observation identity | ### Source The transform reads one per-block array, `tokenTransfers`, and unpivots each transfer into `(from_address, from_post_balance)` and `(to_address, to_post_balance)`. Because the source supplies **absolute** post-balances, there's no running-sum reconstruction: the balance at any block is just the latest retained observation at or below it. ### Destination | Destination | Table | As-of-block access | | - | - | - | | **ClickHouse** (first-class) | `fact_balance_observations` | `argMax(balance, (block_number, log_index))` over `FINAL` `WHERE block_number <= N` | | **Postgres** | `wallet_token_balance_history` (append-only event log) | `DISTINCT ON (wallet, token) … WHERE block_number <= N ORDER BY … block_number DESC, log_index DESC` | | **MySQL** | `wallet_token_balance_history` (append-only event log) | correlated subquery per `(wallet, token)` served by `(wallet, token, block_number, log_index)` | ClickHouse uses the collapsing log-table pattern (see the [templates overview](/data-feeds/templates/overview#destinations)) so chain reorganizations self-correct. The fact table's sort key is wallet-first, so a wallet's balance timeline is a contiguous range read; a bloom skip index on `token_address` serves the inverse "holders of token T" access path. ### Full schema > [accordion] ClickHouse, fact\_balance\_observations > > ```sql theme={null} > CREATE TABLE recipe_historical_balance_at_block.fact_balance_observations > ( > vendor_event_id String, > ingested_at DateTime64(3), > chain_id UInt32, > block_hash String, > block_number UInt64, > log_index UInt32, > event_ts DateTime64(3), > tx_hash String, > token_address String, > wallet_address String, > balance String, -- absolute post-transfer balance, raw uint256 > leg LowCardinality(String), -- 'from' | 'to' > sign Int8, > INDEX bf_token token_address TYPE bloom_filter(0.01) GRANULARITY 4 > ) > ENGINE = ReplicatedCollapsingMergeTree( > '/clickhouse/tables/{database}/fact_balance_observations', '{replica}', sign) > PARTITION BY (chain_id, toYYYYMM(event_ts)) > ORDER BY (chain_id, wallet_address, token_address, block_number, log_index, vendor_event_id, leg); > ``` > > Read with `FINAL` (then `argMax`) or a sign-aware aggregate, never a bare `WHERE sign = 1`. A single-node setup can use `CollapsingMergeTree(sign)` without the replication path. > [accordion] Postgres, wallet\_token\_balance\_history > > ```sql theme={null} > CREATE TABLE public.wallet_token_balance_history ( > position BIGINT NOT NULL, > log_index BIGINT NOT NULL, > block_number BIGINT NOT NULL, > block_timestamp BIGINT NOT NULL, -- unix seconds > tx_hash TEXT NOT NULL, > token_address TEXT NOT NULL, > wallet_address TEXT NOT NULL, > balance NUMERIC(76, 0) NOT NULL, -- absolute post-transfer balance > leg TEXT NOT NULL, -- 'from' | 'to' > vendor_event_id TEXT NOT NULL, > UNIQUE (vendor_event_id, leg) > ); > > -- As-of-block recency index: leads with (wallet, token) so a DISTINCT ON with a > -- block_number cap avoids a sort and range-scans on block_number. > CREATE INDEX wtbh_wallet_token_recency_idx > ON public.wallet_token_balance_history > (wallet_address, token_address, block_number DESC, log_index DESC); > ``` > > MySQL is the same shape with `DECIMAL(76,0)`. `position` is the block-level cursor used during backfill. ### Run it Everything runs in **your** infrastructure: the sink writes into a database you own and you query it with plain SQL, no API and no per-call limits. **Prerequisites** * **Docker** and Docker Compose. * A **Data Feeds key**, a `cm_live_…` key with `continuum:read` scope (this is *not* your Web3 API key). > [card] [Sign up for a Data Feeds key](https://admin.moralis.com) > > Log in to the Moralis admin panel to create your account and generate a `cm_live_…` key. **Start the sink** Generate a **starter pack** for `historicalBalanceAtBlock` in the [Moralis Admin Panel](https://admin.moralis.com), pick your chain and destination database, then run it with Docker. The [quickstart](/data-feeds/migration/quickstart) walks through it end to end. Set the backfill window (`MORALIS_HISTORICAL_FROM_BLOCK`) as noted below. > [!NOTE] > > **Backfill full history for correct point-in-time answers.** An as-of-block balance (or holder set) is only correct if the observation log goes back far enough, a wallet may have last moved the token long before block N. For token-scoped questions ("holders of token T at block N"), backfill from around the **token's deployment block**; for whole-wallet history, backfill from an early block. A recent-only window gives wrong historical answers. See [History & backfill](/data-feeds/concepts/history-and-backfill). Then run the example reads below to confirm rows are landing. ### Example reads Balance of one `(wallet, token)` as of block N (ClickHouse): ```sql theme={null} SELECT argMax(balance, (block_number, log_index)) AS balance_at_n FROM recipe_historical_balance_at_block.fact_balance_observations FINAL WHERE chain_id = 1 AND wallet_address = lower('0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045') AND token_address = lower('0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48') AND block_number <= {N:UInt64}; ``` A token's **holder set as of block N**, the historical-holders query, biggest first: ```sql theme={null} SELECT wallet_address, argMax(balance, (block_number, log_index)) AS balance_at_n FROM recipe_historical_balance_at_block.fact_balance_observations FINAL WHERE chain_id = 1 AND token_address = lower('0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48') AND block_number <= {N:UInt64} GROUP BY wallet_address HAVING balance_at_n != '0' AND balance_at_n != '' ORDER BY toFloat64OrZero(balance_at_n) DESC LIMIT 100; ``` Postgres (as-of-block balance for a wallet, index-driven): ```sql theme={null} SELECT DISTINCT ON (token_address) token_address, balance FROM public.wallet_token_balance_history WHERE wallet_address = lower('0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045') AND block_number <= $1 ORDER BY token_address, block_number DESC, log_index DESC; ``` ### Other ways to consume this data The sink is the way to get **this retained balance log** (`fact_balance_observations` / `wallet_token_balance_history`), recommended for point-in-time queries you own. The *same underlying data* is also available as the **raw decoded feed**, if you'd rather retain balance history yourself: * **Your existing message clients**: stream it with **Kafka / AMQP / SQS**. * **REST / Arrow Flight**: pull the decoded block stream directly. Those give you the **source array** (`tokenTransfers`, with absolute post-balances) to build the history yourself, not this retained log. All of them read the one data lake into **your** infrastructure. See [What are Data Feeds?](/data-feeds/concepts/what-are-data-feeds). ### Modes Shipped defaults: **ClickHouse `hybrid`** (backfill → realtime), **Postgres / MySQL `historical`** (one-shot backfill). For live/reorg-safe ingestion, use ClickHouse, see the [overview](/data-feeds/templates/overview#modes). > [!NOTE] > > The append-only log on Postgres / MySQL isn't reorg-aware on its own. Run realtime/hybrid on **ClickHouse**, where the collapsing log table corrects reorgs per-block via `sign`; the Postgres / MySQL configs target `historical` backfill. ### Multichain The template is chain-parametrized via the `chain` setting, point it at any supported EVM chain or **Solana**. The Solana feed's `tokenTransfers` carry the same absolute `fromPostBalance` / `toPostBalance` fields, so the template produces an identically-shaped balance history; the `vendor_event_id` already folds in `(from, to, token, amount)` to stay row-unique under Solana's repeated `logIndex`. ### Fidelity gaps * **`balance_formatted`**: needs the token's `decimals` (contract metadata, not in `tokenTransfers`). Only the raw `balance` is emitted; divide by `10^decimals` off-stream, sourcing decimals from a [Token Metadata](/data-feeds/templates/token/token-metadata) sync. * **No USD value**: this template lands quantities. Join a price feed at read time if you want historical USD. * **Native balance at block**: not covered in v1; the same pattern over `nativeTransfers` post-balances would unlock it. On-chain primitives, wallet, token, raw post-event balance, block, log index, tx hash, are fully covered. ## Migrating from the REST API This template replaces the deprecated **historical token holders** endpoints on EVM and Solana. > [!WARNING] > > Both REST endpoints below are **deprecated and sunset on July 31, 2026**. Migrate before that date. Neither move is 1:1: the REST endpoints returned a **pre-bucketed time series**, while this template lands the retained balance log that produces it. You resolve each bucket boundary to a block, count the as-of-block holder set, and diff adjacent buckets, and a **full backfill from the token's deployment block is required**, or early buckets undercount (see the backfill note in [Run it](#run-it) and [History & backfill](/data-feeds/concepts/history-and-backfill)). ### EVM: historical token holders ``` GET /erc20/:tokenAddress/holders/historical ``` The holder-count time series becomes an aggregation over this template's balance log: the [holder set as of block N](#example-reads) query, run per bucket boundary. > [!NOTE] > > **This endpoint needs more than one template.** Counts and deltas come from this template alone, but `newHoldersByAcquisition` (swap / transfer / airdrop) classifies each new holder's first inbound event, which you build from [Token Transfers](/data-feeds/templates/token/token-transfers) + [Swaps by Token](/data-feeds/templates/markets/swaps-by-token). | REST API field | Data Feeds | Fidelity | | - | - | - | | `timestamp` | your chosen bucket boundary, resolved to a block | your definition | | `totalHolders` | count of the as-of-block holder set | exact | | `netHolderChange`, `holderPercentChange` | deltas between adjacent buckets | calculated | | `holdersIn` / `holdersOut` (whales … shrimps) | size-tier flows on thresholds you set | your definition | | `newHoldersByAcquisition` (swap / transfer / airdrop) | classify new holders' first inbound transfer/swap | your definition | Holder count as of a bucket's end block (ClickHouse, repeat per bucket, or drive from a calendar): ```sql theme={null} SELECT countIf(balance_at_n != '0' AND balance_at_n != '') AS total_holders FROM ( SELECT wallet_address, argMax(balance, (block_number, log_index)) AS balance_at_n FROM recipe_historical_balance_at_block.fact_balance_observations FINAL WHERE chain_id = 1 AND token_address = lower('0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48') AND block_number <= {bucket_end_block:UInt64} GROUP BY wallet_address ); ``` Gotchas: * **Materialize, don't recompute.** Large tokens have millions of holders, compute `total_holders` per bucket on a schedule and store the small series; the deltas are then trivial. * **No fixed `timeFrame`.** Every observation is retained, so the same log serves hourly, daily, or custom windows. * **Tiers and acquisition are conventions you set**: a feature, not a black box, but budget time to define them. * **Backfill from the token's deployment block**, not chain genesis, the template is token-scoped for this question. ### Solana: historical holders ``` GET /token/:network/holders/:address/historical ``` The same template, pointed at **Solana** in the Admin Panel wizard, replaces it, Solana's `tokenTransfers` carry the same absolute post-balances, so the balance log is identical in shape (see [Multichain](#multichain)). The field mapping matches the EVM table above, with the mint as `token_address`; `newHoldersByAcquisition` likewise needs [Token Transfers](/data-feeds/templates/token/token-transfers) + [Swaps by Token](/data-feeds/templates/markets/swaps-by-token) layered in. Holder set as of a past block, the building block for each bucket (ClickHouse): ```sql theme={null} SELECT wallet_address, argMax(balance, (block_number, log_index)) AS balance_at_n FROM recipe_historical_balance_at_block.fact_balance_observations FINAL WHERE token_address = lower('') AND block_number <= {N:UInt64} GROUP BY wallet_address HAVING balance_at_n != '0' AND balance_at_n != ''; ``` Gotchas: * **SPL account model.** Count **owner wallets**, summing a wallet's token accounts for its per-owner balance. * **Backfill from the mint's deployment**: a short window gives wrong historical counts. * **Slot boundaries.** Resolve each interval boundary to a block/slot before running the as-of query. ## Related > [card] [Token Holders](/data-feeds/templates/token/token-holders) > > The latest-state holder set this time-travels. > [card] [Token Balances by Wallet](/data-feeds/templates/wallet/token-balances-by-wallet) > > Current balances per wallet, the latest-state sibling. # Token Balances by Token Source: https://docs.moralis.com/data-feeds/templates/token/token-balances-by-token Sync the current non-zero balance of every wallet that holds a given token into your own database, the holder list behind a token, latest-wins per wallet. > [!NOTE] > > **Coming from `GET /erc20/{address}/owners` or `GET /erc20/{address}/holders`?** The field-by-field migration > for those endpoints lives on the [Token Holders](/data-feeds/templates/token/token-holders#migrating-from-the-rest-api) > template; this page is the same balance data in its raw by-token shape. ### Question it answers > "Give me the non-zero balance of every wallet that holds token **0x…**, largest first." This is the by-token sort of the same balance data the public API exposes per holder, the holder list and balances for a single token. The sibling template [Token Balances by Wallet](/data-feeds/templates/wallet/token-balances-by-wallet) is the exact same data sorted the other way (wallet-first); in production you land the source once and add both read shapes. ### What you get The template lands **one balance observation per side of every transfer**, then resolves the **latest observation per `(token, wallet)`** as the current balance. Moralis-indexed transfers carry the *absolute* post-transfer balance of both sides (`fromPostBalance` / `toPostBalance`), so no running-sum reconstruction is needed; the highest `(block_number, log_index)` observation is the truth. | Column | Description | | - | - | | `token_address` | The token being held (the read key) | | `wallet_address` | The holder | | `balance` | Absolute balance after this transfer, raw `uint256` as text | | `block_number`, `log_index` | Recency tuple, the latest pair wins per `(token, wallet)` | | `event_ts` / `block_timestamp` | Block time of the observation | | `leg` | `from` or `to`, which side of the transfer this observation came from | | `vendor_event_id` | Stable per-observation identity (keeps the two unpivoted rows distinct) | Each transfer yields two observations: `(from_address, from_post_balance)` and `(to_address, to_post_balance)`. The EVM zero address (mint/burn counterparty) and any side without a producer-resolved post-balance are skipped. ### Source The transform reads one per-block array, `tokenTransfers`, and **unpivots** each transfer into the two per-wallet balance observations it carries. Balance comes straight from the transfer's `fromPostBalance` / `toPostBalance`; there is no separate balance feed or join. ### Destination | Destination | Table | By-token read pattern | | - | - | - | | **ClickHouse** (first-class) | `fact_balances_by_token` | Prefix scan on `(chain_id, token_address, wallet_address, …)`; current balance via `argMax(balance, (block_number, log_index))` over `FINAL` | | **Postgres** | `token_balances` (materialized view over `token_balance_observations`) | Partial index `(token_address, wallet_address) WHERE balance > 0` | | **MySQL** | `token_balances` (trigger-maintained over observations) | PK `(token_address, wallet_address)` + `DELETE … WHERE balance = 0` cleanup | ClickHouse uses the collapsing log-table pattern (see the [templates overview](/data-feeds/templates/overview#destinations)) so chain reorganizations self-correct: a reorg negates the rolled-back block's observations (`sign = -1`) and re-emits the corrected ones, and `FINAL` collapses the pair before `argMax` runs. Read canonical state with `FINAL` or a sign-aware aggregate, never a bare `WHERE sign = 1`. On Postgres and MySQL the sink appends observations and the current-balance projection is derived: Postgres via a `DISTINCT ON (token_address, wallet_address)` materialized view, MySQL via an `AFTER INSERT` latest-wins upsert trigger plus a periodic zero-balance cleanup. ### Full schema Below is the complete read table this template produces, the per-wallet balance observations, keyed by token. Keep the columns you need and drop the rest (see [Schema & flexibility](/data-feeds/templates/overview#schema--flexibility)). Raw `uint256` balances are stored as text in ClickHouse (they exceed numeric precision); Postgres uses an explicit `NUMERIC(76, 0)` so large raw balances don't overflow a narrower inferred type. > [accordion] ClickHouse, fact\_balances\_by\_token > > ```sql theme={null} > CREATE TABLE recipe_token_balances_by_token.fact_balances_by_token > ( > vendor_event_id String, > ingested_at DateTime64(3), > chain_id UInt32, > block_hash String, > block_number UInt64, > log_index UInt32, > event_ts DateTime64(3), > token_address String, > wallet_address String, > balance String, -- absolute balance after this transfer (raw uint256) > leg LowCardinality(String), -- 'from' | 'to' > sign Int8 > ) > ENGINE = ReplicatedCollapsingMergeTree( > '/clickhouse/tables/{database}/fact_balances_by_token', '{replica}', sign) > PARTITION BY (chain_id, toYYYYMM(event_ts)) > ORDER BY (chain_id, token_address, wallet_address, block_number, log_index, vendor_event_id, leg); > ``` > > The `leg` (`from` / `to`) keeps the two unpivoted rows of one transfer distinct; the `+1`/`−1` reorg pair for one leg shares a key and collapses. Read with `FINAL` then `argMax`, or a sign-aware aggregate. A single-node setup can use `CollapsingMergeTree(sign)` without the replication path. > [accordion] Postgres, token\_balances (materialized view) > > ```sql theme={null} > -- Observations (sink target). Append-only, keyed on the block-level position. > CREATE TABLE public.token_balance_observations ( > position BIGINT NOT NULL, > log_index BIGINT NOT NULL, > block_number BIGINT NOT NULL, > block_timestamp BIGINT NOT NULL, -- unix seconds > token_address TEXT NOT NULL, > wallet_address TEXT NOT NULL, > balance NUMERIC(76, 0) NOT NULL, -- absolute balance after the transfer > leg TEXT NOT NULL, -- 'from' | 'to' > vendor_event_id TEXT NOT NULL > ); > > -- Speeds the DISTINCT ON (latest-per-key) the materialized view computes. > CREATE INDEX IF NOT EXISTS tbo_token_wallet_recency_idx > ON public.token_balance_observations > (token_address, wallet_address, block_number DESC, log_index DESC); > > -- Current-balance projection: latest observation per (token, wallet). > CREATE MATERIALIZED VIEW public.token_balances AS > SELECT DISTINCT ON (token_address, wallet_address) > token_address, > wallet_address, > balance, > block_number, > log_index, > block_timestamp > FROM public.token_balance_observations > ORDER BY token_address, wallet_address, block_number DESC, log_index DESC; > > -- Required by REFRESH MATERIALIZED VIEW CONCURRENTLY. > CREATE UNIQUE INDEX IF NOT EXISTS token_balances_pk > ON public.token_balances (token_address, wallet_address); > > -- Active holders of a token (this template's primary access path). > CREATE INDEX IF NOT EXISTS token_balances_by_token_active_idx > ON public.token_balances (token_address, wallet_address) > WHERE balance > 0; > > -- Sibling access path: all non-zero balances held by a wallet. > CREATE INDEX IF NOT EXISTS token_balances_by_wallet_active_idx > ON public.token_balances (wallet_address, token_address) > WHERE balance > 0; > > -- Cleanup index: find zeroed-out positions to prune. > CREATE INDEX IF NOT EXISTS token_balances_zero_cleanup_idx > ON public.token_balances (token_address, wallet_address) > WHERE balance = 0; > ``` > > The materialized view is the current-balance projection, refresh it on a schedule with `REFRESH MATERIALIZED VIEW CONCURRENTLY token_balances;` (the `CONCURRENTLY` form needs the unique index above and never blocks readers). MySQL is the same shape with a trigger-maintained `token_balances` table and a periodic `DELETE … WHERE balance = 0` standing in for the cleanup index. ### Example reads All current non-zero holders of a token, largest first, `FINAL` collapses reorg `±1` pairs before `argMax` resolves the latest balance per wallet (ClickHouse): ```sql theme={null} SELECT wallet_address, argMax(balance, (block_number, log_index)) AS current_balance FROM recipe_token_balances_by_token.fact_balances_by_token FINAL WHERE chain_id = 1 AND token_address = lower('0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48') GROUP BY wallet_address HAVING current_balance != '0' AND current_balance != '' ORDER BY toFloat64OrZero(current_balance) DESC LIMIT 100; ``` Holder count for a token: ```sql theme={null} SELECT countDistinct(wallet_address) FROM ( SELECT wallet_address, argMax(balance, (block_number, log_index)) AS bal FROM recipe_token_balances_by_token.fact_balances_by_token FINAL WHERE chain_id = 1 AND token_address = lower('0xA0b8...') GROUP BY wallet_address HAVING bal != '0' AND bal != '' ); ``` Postgres, refresh the view, then query the partial index: ```sql theme={null} REFRESH MATERIALIZED VIEW CONCURRENTLY token_balances; SELECT wallet_address, balance FROM public.token_balances WHERE token_address = lower('0xA0b8...') AND balance > 0 ORDER BY balance DESC LIMIT 100; ``` ### Modes Shipped defaults: **ClickHouse `hybrid`** (backfill → realtime), **Postgres / MySQL `historical`** (one-shot backfill). For live/reorg-safe ingestion, use ClickHouse, see the [overview](/data-feeds/templates/overview#modes). > [!NOTE] > > **Postgres / MySQL are backfill-first here.** The realtime reorg path needs a single-column unique key on the position column, but the template's position is block-level, so the Postgres / MySQL configs target `historical`. The Postgres materialized view and the MySQL cleanup are also not reorg-aware on their own; under realtime you would re-derive them. ClickHouse handles reorgs automatically via `sign`, so run realtime/hybrid there. ### Multichain The template is chain-parametrized, point it at any supported EVM chain or Solana. On Solana, the per-observation `vendor_event_id` already folds in `(from, to, token, amount)`, so each observation stays row-unique despite Solana's repeated `logIndex` within an instruction; the holder list it produces is identical in shape. ### Fidelity notes * **Latest-wins, not a delta sum.** Balances are absolute post-transfer observations, so the current balance is purely the most recent observation per `(token, wallet)`. There is no running-sum reconstruction and no dependence on having seen every prior transfer. * **Raw amounts only.** `balance` is the raw `uint256` (text in ClickHouse, `NUMERIC(76, 0)` in Postgres). It is not decimal-scaled and carries no USD value, divide by `10^token_decimals` for human units (fold in a decimals lookup from a Token Metadata sync), and join Token Prices if you need USD. * **Zero address excluded.** Mint/burn counterparties (the EVM zero address) and sides without a producer-resolved post-balance are not holders and are skipped at unpivot time. ### Related > [card] [Token Balances by Wallet](/data-feeds/templates/wallet/token-balances-by-wallet) > > The sibling, the same balance data sorted wallet-first. > [card] [Token Analytics](/data-feeds/use-cases/token-analytics) > > The use case holder lists and balances power. # Token Bonding Status (Solana Launchpads) Source: https://docs.moralis.com/data-feeds/templates/token/token-bonding-status Sync every pump.fun / Raydium LaunchLab launchpad event, created, traded, migrated, into your own database, and serve a launchpad's new / bonding / graduated token lists plus any token's bonding-curve status. ### Question it answers > "For a Solana launchpad like **pump.fun**: which tokens just launched, which are still climbing the bonding curve, and which have graduated to a DEX, and what's a given token's bonding-curve status?" Lands one row per **launchpad event** (`created` / `traded` / `migrated`) from the decoded `launchpadEvents` feed, and derives a per-token latest-status projection. The four deprecated pump.fun surfaces, new, bonding, graduated, and per-token status, are all reads over this one template. ### What you get The template reads the master-block `launchpadEvents` array and lands two surfaces: * **The launchpad event log**, keyed by exchange, one row per `created` / `traded` / `migrated` event. * **A per-token status projection**, keyed by token, latest bonding progress, graduated flag, and graduation time. | Column | Description | | - | - | | `token_address` | The launchpad token (SPL mint) | | `exchange_address` | The launchpad program (the `:exchange` path param, e.g. pump.fun `6EF8…F6P`) | | `launchpad_platform` | Friendly name, `pumpfun`, `raydium_launchlab` | | `event_type` | `created` · `traded` · `migrated` (**migrated = graduated**) | | `progress_percentage` | Bonding-curve progress 0–100 (sparse, set on trading activity) | | `pool_address` | The DEX pool a token migrated into, populated on the `migrated` event (take `max(pool_address)`) | | `token_name`, `token_symbol`, `token_uri` | Emitted on the `created` event only | | `trade_direction`, `token_amount`, `native_amount` | On `traded` events, native price = `native_amount / token_amount` | | `block_number`, `log_index`, `event_ts`, `tx_hash` | On-chain ordering + provenance | ### Source The transform reads one per-block array, `launchpadEvents`, one row per event. `event_type` distinguishes `created` (a new token, carries name/symbol/uri), `traded` (a bonding-curve fill, carries `progress_percentage` and trade amounts), and `migrated` (graduation to a DEX pool, carries `pool_address`). On the Solana feed today the price field (`current_price`) is **not populated**, see [Fidelity gaps](#fidelity-gaps). The `exchange_address` (launchpad program) is shared by every token on a platform. ### Destination | Destination | Tables | Access | | - | - | - | | **ClickHouse** (first-class) | `fact_launchpad_events` (by exchange) + `fact_token_bonding_status` (by token) | prefix scan on `(chain_id, exchange_address, block_number)` for the event log; per-token aggregate for status | | **Postgres** | `launchpad_events` + `token_bonding_status` (materialized view) | index on `(exchange_address, block_number)`; unique on `token_address` | | **MySQL** | `launchpad_events` + `token_bonding_status` (trigger-maintained) | same shape | ClickHouse uses the collapsing log-table pattern so chain reorganizations self-correct. `fact_launchpad_events` is ordered for the by-exchange event log (bloom skip index on `token_address` for the by-token log); `fact_token_bonding_status` is keyed by token for the latest-state read. ### Full schema > [accordion] ClickHouse, fact\_launchpad\_events > > ```sql theme={null} > CREATE TABLE recipe_token_bonding_status.fact_launchpad_events > ( > vendor_event_id String, > ingested_at DateTime64(3), > chain_id UInt32, > block_hash String, > block_number UInt64, > event_ts DateTime64(3), > token_address String, > launchpad_platform LowCardinality(String), -- pumpfun | raydium_launchlab | … > event_type LowCardinality(String), -- created | traded | migrated > exchange_address String, > initiated_by String, > token_name String, > token_symbol String, > token_uri String, > token_amount String, > native_amount String, > trade_direction LowCardinality(String), -- buy | sell | '' > bonding_curve_address String, > pool_address String, -- DEX pool (migrated events) > current_price String, > progress_percentage Nullable(Float64), -- 0-100, sparse > metadata String, > tx_hash String, > log_index Nullable(UInt32), > transaction_index Nullable(Int32), > sign Int8, > INDEX bf_token token_address TYPE bloom_filter(0.01) GRANULARITY 4 > ) > ENGINE = ReplicatedCollapsingMergeTree( > '/clickhouse/tables/{database}/fact_launchpad_events', '{replica}', sign) > PARTITION BY (chain_id, toYYYYMM(event_ts)) > ORDER BY (chain_id, exchange_address, block_number, vendor_event_id); > ``` > [accordion] ClickHouse, fact\_token\_bonding\_status (per-token) > > ```sql theme={null} > CREATE TABLE recipe_token_bonding_status.fact_token_bonding_status > ( > vendor_event_id String, > ingested_at DateTime64(3), > chain_id UInt32, > block_number UInt64, > event_ts DateTime64(3), > token_address String, > launchpad_platform LowCardinality(String), > exchange_address String, > event_type LowCardinality(String), > token_name String, > token_symbol String, > progress_percentage Nullable(Float64), > current_price String, > log_index Nullable(UInt32), > sign Int8 > ) > ENGINE = ReplicatedCollapsingMergeTree( > '/clickhouse/tables/{database}/fact_token_bonding_status', '{replica}', sign) > PARTITION BY (chain_id, toYYYYMM(event_ts)) > ORDER BY (chain_id, token_address, block_number, vendor_event_id); > ``` > > Postgres / MySQL keep an append-only `launchpad_events` table plus a `token_bonding_status` current-state projection (a materialized view on Postgres, a trigger-maintained table on MySQL). ### Run it Everything runs in **your** infrastructure: the sink writes into a database you own and you query it with plain SQL, no API and no per-call limits. **Prerequisites** * **Docker** and Docker Compose. * A **Data Feeds key**, a `cm_live_…` key with `continuum:read` scope (this is *not* your Web3 API key). > [card] [Sign up for a Data Feeds key](https://admin.moralis.com) > > Log in to the Moralis admin panel to create your account and generate a `cm_live_…` key. **Start the sink** Generate a **starter pack** for `tokenBondingStatus` in the [Moralis Admin Panel](https://admin.moralis.com), choose **Solana** as the chain (launchpad activity is densest on pump.fun and Raydium LaunchLab) and your destination, then run it with Docker. The [quickstart](/data-feeds/migration/quickstart) walks through it end to end. > [!NOTE] > > **Backfill by use case.** The new / bonding / graduated **lists** are event feeds, run **realtime** to track launches live, no backfill needed. A per-token **status** is current state, backfill from the token's `created` event to capture its full curve. See [History & backfill](/data-feeds/concepts/history-and-backfill). ### Example reads **New tokens** on a launchpad, the token's `created` event, newest first: ```sql theme={null} SELECT token_address, argMax(token_name, (block_number, log_index)) AS name, argMax(token_symbol, (block_number, log_index)) AS symbol, min(event_ts) AS created_at FROM recipe_token_bonding_status.fact_launchpad_events FINAL WHERE exchange_address = '6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P' AND event_type = 'created' GROUP BY token_address ORDER BY created_at DESC LIMIT 50; ``` **Bonding tokens**, progress \< 100, not yet graduated, closest to graduating first: ```sql theme={null} SELECT token_address, argMaxIf(progress_percentage, block_number, progress_percentage IS NOT NULL) AS bonding_progress FROM recipe_token_bonding_status.fact_token_bonding_status FINAL WHERE exchange_address = '6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P' GROUP BY token_address HAVING maxIf(1, event_type = 'migrated') = 0 AND bonding_progress < 100 ORDER BY bonding_progress DESC LIMIT 50; ``` **Graduated tokens**, tokens with a `migrated` event, plus the DEX pool they migrated into (`max` grabs the non-empty `pool_address`, since a graduation can emit more than one `migrated` row): ```sql theme={null} SELECT token_address, minIf(event_ts, event_type = 'migrated') AS graduated_at, max(pool_address) AS pool_address FROM recipe_token_bonding_status.fact_launchpad_events FINAL WHERE exchange_address = '6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P' GROUP BY token_address HAVING maxIf(1, event_type = 'migrated') = 1 ORDER BY graduated_at DESC LIMIT 50; ``` **Bonding status** for one token: ```sql theme={null} SELECT token_address AS mint, argMaxIf(progress_percentage, (block_number, log_index), progress_percentage IS NOT NULL) AS bonding_progress, maxIf(1, event_type = 'migrated') = 1 AS graduated, minIf(event_ts, event_type = 'migrated') AS graduated_at FROM recipe_token_bonding_status.fact_token_bonding_status FINAL WHERE token_address = {mint:String} GROUP BY token_address; ``` ### Other ways to consume this data The sink is the way to get **these pre-shaped tables**. The *same underlying data* is also available as the **raw decoded feed**, if you'd rather shape it yourself: * **Your existing message clients**: stream `launchpadEvents` live with **Kafka / AMQP / SQS** (great for a real-time launch feed). * **REST / Arrow Flight**: pull the decoded Solana block stream directly. Those give you the raw `launchpadEvents` array to project yourself, not these tables. All read the one data lake into **your** infrastructure. See [What are Data Feeds?](/data-feeds/concepts/what-are-data-feeds). ### Modes Shipped defaults: **ClickHouse `hybrid`** (backfill → realtime), **Postgres / MySQL `historical`**. For live launch discovery use ClickHouse, see the [overview](/data-feeds/templates/overview#modes). ### Multichain Launchpad activity is densest on **Solana** (pump.fun, Raydium LaunchLab) and **Base**; on Ethereum mainnet the `launchpadEvents` array is effectively empty. Point the template at Solana in the Admin Panel wizard for real coverage. On Solana `logIndex` isn't row-unique within an instruction, so `vendor_event_id` widens with `(tokenAddress, eventType)` to keep rows distinct. ### How much data does this consume? `tokenBondingStatus` reads a single per-block array, `launchpadEvents`, one of the smallest slices in the feed. On **Solana mainnet**, where launchpad activity is concentrated, a continuous real-time feed measured: | | Uncompressed bytes per month | | - | - | | Typical month (P50) | **\~8.7 GB** | | Busy month (P90) | **\~15.1 GB** | Measured 2026-08-04 against the live feed, 30 sampled partitions over 30 days, `metered` delivery. Billing is on uncompressed bytes. **Size your allowance against the top of the band, not the middle.** Chain activity varies, and this template tracks launchpad activity specifically, which is bursty by nature: a quiet month and a memecoin frenzy are not the same month. Worked example, against a hypothetical 10 GB monthly allowance: | If the month runs at | Against a 10 GB allowance | | - | - | | 8.5 GB | Within allowance, nothing extra to pay | | 15 GB | 5 GB of overage | Both are inside the measured range for this template, so choose an allowance that covers the busy figure and treat the typical figure as the good case. What this figure does and does not cover: * **Real-time only.** A historical backfill is billed separately and is usually the larger number; its size depends entirely on how far back you go. * **Solana.** On EVM chains the `launchpadEvents` array is effectively unpopulated (see [Multichain](#multichain)), so this template reads close to nothing on Ethereum. * **The whole slice, across every launchpad and every token.** Filtering to specific tokens, platforms, or programs happens after the data is delivered, so it does not reduce the figure. To reduce cost, narrow the **block range**, not the entity set. * **`metered` delivery.** Under `presigned_url` you are billed for whole partitions rather than the columns you project, which is a different number. If you want your exact scope measured before you commit to a plan, [reach out](https://admin.moralis.com/data-feeds) and we will probe it against the live feed rather than estimate it. ### Fidelity gaps * **`name` / `symbol`** ride on the `created` event; a token seen only via `traded` events carries none until you join [Token Metadata](/data-feeds/templates/token/token-metadata) (also the source of `decimals`). * **`progress_percentage` is sparse**: `created` events carry no curve progress (0 is coerced to null), so a freshly-created token has null progress until its first trade. * **No price in the feed.** `current_price` lands **empty on the Solana feed today** (0 populated in live sampling). Derive the **native price** per token from `traded` events (`native_amount / token_amount`), and convert to **USD** with a SOL/USD mark (e.g. wrapped SOL from a [Token Prices](/data-feeds/templates/token/token-prices) sync). **Liquidity** (cumulative curve `native_amount`, or post-graduation [Pair Reserves](/data-feeds/templates/markets/pair-reserves)) and **FDV** (`token_metadata.total_supply` × price) are derive-or-omit. * **`pool_address` arrives on the `migrated` event**: the DEX pool the token graduated into (verified live). A graduation can emit **more than one** `migrated` row, so take the non-empty value with `max(pool_address)` rather than `anyLast`. * **`logo`** and other off-chain metadata aren't in the feed. Core fields, `token_address`, `exchange_address`, `event_type`, `progress_percentage`, graduation (the `migrated` event, with `pool_address`), token name/symbol (on `created`), trade amounts, and timestamps, are sourced from `launchpadEvents`. ## Migrating from the REST API > [!WARNING] > > All four Solana launchpad endpoints below are **deprecated and sunset on July 31, 2026**. This one template replaces all of them, each REST response is a read over the tables above. The four endpoints share most of their response shape, so the common fields map once: | REST API field (all four endpoints) | Data Feeds | Fidelity | | - | - | - | | `tokenAddress` / `mint` | `token_address` | exact | | `name`, `symbol` | `token_name` / `token_symbol` on the `created` event, or [Token Metadata](/data-feeds/templates/token/token-metadata) | exact | | `decimals` | `token_metadata.decimals` (join [Token Metadata](/data-feeds/templates/token/token-metadata)) | exact | | `priceNative` | derive `native_amount / token_amount` from `traded` events, `currentPrice` is **not populated** on the Solana feed today | calculated | | `priceUsd` | `priceNative` × a SOL/USD mark (wrapped SOL via [Token Prices](/data-feeds/templates/token/token-prices)) | calculated | | `liquidity` | cumulative curve `native_amount` × price; post-graduation, [Pair Reserves](/data-feeds/templates/markets/pair-reserves) × price | calculated | | `fullyDilutedValuation` | `token_metadata.total_supply` × price | calculated | | `logo` | not in the feed, bring your own token list, or omit | add yourself | In every deprecated endpoint URL, `:exchange` is the launchpad's onchain **program address** (pump.fun is `6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P`); each event carries it as `exchange_address` plus a friendly `launchpad_platform` (`pumpfun`, `raydium_launchlab`), filter on either. None of the lists have a per-call cap anymore; page with a keyset on the sort column. ### New tokens by exchange ```text theme={null} GET /token/:network/exchange/:exchange/new ``` "New" is the set of **`created`** events on a launchpad, newest first, a view over `fact_launchpad_events`: ```sql theme={null} CREATE VIEW new_tokens_by_exchange AS SELECT token_address, exchange_address, argMax(token_name, (block_number, log_index)) AS name, argMax(token_symbol, (block_number, log_index)) AS symbol, min(event_ts) AS created_at FROM recipe_token_bonding_status.fact_launchpad_events FINAL WHERE event_type = 'created' GROUP BY token_address, exchange_address; -- per launchpad: WHERE exchange_address = :exchange ORDER BY created_at DESC ``` `createdAt` maps to `min(event_ts)` over the `created` event (exact). * Launches are an **event list**, run the template realtime for a live feed, no backfill needed; index back only to list tokens created before you started. * A brand-new token has **no price and no curve progress** until its first trade. ### Bonding tokens by exchange ```text theme={null} GET /token/:network/exchange/:exchange/bonding ``` "Bonding" is the set of tokens still on the curve, progress below 100, never migrated, ranked by progress: ```sql theme={null} CREATE VIEW bonding_tokens_by_exchange AS SELECT token_address, exchange_address, argMaxIf(progress_percentage, block_number, progress_percentage IS NOT NULL) AS bonding_progress FROM recipe_token_bonding_status.fact_token_bonding_status FINAL GROUP BY token_address, exchange_address HAVING maxIf(1, event_type = 'migrated') = 0 -- still bonding (not graduated) AND bonding_progress < 100; -- per launchpad: WHERE exchange_address = :exchange ORDER BY bonding_progress DESC ``` `bondingCurveProgress` maps to the latest non-null `progress_percentage` per token (exact). * **Progress is carried forward**: it updates with each trade, and is null until the first trade (same as the old endpoint, which had nothing to report before curve activity). * A token **leaves the bonding list** the moment it emits a `migrated` event; the `HAVING` clause excludes those. ### Graduated tokens by exchange ```text theme={null} GET /token/:network/exchange/:exchange/graduated ``` Graduation is the **`migrated`** event, a token with one has left the curve for a DEX pool: ```sql theme={null} CREATE VIEW graduated_tokens_by_exchange AS SELECT token_address, exchange_address, minIf(event_ts, event_type = 'migrated') AS graduated_at, max(pool_address) AS pool_address -- the migrated DEX pool FROM recipe_token_bonding_status.fact_launchpad_events FINAL GROUP BY token_address, exchange_address HAVING maxIf(1, event_type = 'migrated') = 1; -- has graduated -- per launchpad: WHERE exchange_address = :exchange ORDER BY graduated_at DESC ``` `graduatedAt` maps to `minIf(event_ts, event_type = 'migrated')`, and `poolAddress`, which the old endpoint didn't even expose, is `max(pool_address)` over the token's `migrated` events (both exact). > [!NOTE] > > **This one is not a 1:1 swap.** The REST response bundled prices, liquidity, and FDV, but a graduated token trades on a normal DEX pool, so price it with [Token Prices](/data-feeds/templates/token/token-prices) and read pool liquidity with [Pair Reserves](/data-feeds/templates/markets/pair-reserves), keyed on the migrated `pool_address`. Run those templates alongside this one if you serve those fields. * `pool_address` is **only populated on `migrated` events** (verified live), and a graduation can emit more than one `migrated` row, take the non-empty value with `max(pool_address)`, not `anyLast`. * Graduations are an event list, run realtime to catch them as they happen. ### Token bonding status ```text theme={null} GET /token/:network/:address/bonding-status ``` The most direct migration of the set, the template's per-token projection *is* this response. `mint`, `bondingProgress`, and `graduatedAt` map to `token_address`, `bonding_progress`, and `graduated_at` (all exact). On Postgres or MySQL it's a single-row lookup on the maintained status table: ```sql theme={null} SELECT token_address AS mint, bonding_progress, graduated, graduated_at FROM token_bonding_status WHERE token_address = $1; ``` On ClickHouse, use the per-token aggregate shown in [Example reads](#example-reads). * **Status is current state**, not an event list, backfill from the token's `created` event to capture its full curve and graduation history. * `graduated` / `graduated_at` come from the `migrated` event; both are empty until the token graduates. ### Related > [card] [Token Metadata](/data-feeds/templates/token/token-metadata) > > Names, symbols, and decimals for launchpad tokens. > [card] [Token Prices](/data-feeds/templates/token/token-prices) > > USD marks to layer onto bonding and graduated tokens. # Token Holders Source: https://docs.moralis.com/data-feeds/templates/token/token-holders Sync the full holder list of a token, every non-zero wallet, its current balance, and a best-effort USD value, as a continuously updated table in your own database. Mirrors the Moralis GET /erc20/{address}/owners endpoint. ### Question it answers > "Who holds token **0x…**, with their current balance and USD value? Give me the full holder list, biggest first." Mirrors Moralis [`GET /erc20/{address}/owners`](/data-api/evm/token/holders/token-holders). Storing the holder set **pre-aggregated**, keyed by token, in your own database is the value, no per-request rebuild from raw transfers. ### What you get Token transfers carry the **absolute** post-transfer balance of both sides of every transfer (`fromPostBalance` / `toPostBalance`). Each transfer becomes two per-wallet balance observations, and the latest observation per `(token, wallet)` is the current holding, no running-sum reconstruction. Each observation is USD-enriched in-block from the same block's price updates. | Column | Description | | - | - | | `token_address` | The token contract being held | | `wallet_address` | The holder | | `balance` | Absolute balance after the latest transfer, raw `uint256` as text | | `usd_price` | In-block USD spot price per **whole** token (newest-wins from the block's price updates; `0` if no same-block update) | | `usd_value` | Best-effort holding value, `balance / 10^18 × usd_price` (see [fidelity gaps](#fidelity-gaps)) | | `block_number`, `log_index` | Recency tuple, the latest pair wins as the current holding | | `leg` | `from` / `to`, which side of the transfer produced this observation | Balances are **latest-wins**: the current holding of a `(token, wallet)` is simply the observation with the highest `(block_number, log_index)`. ### Source The transform reads one per-block array and unpivots it: `tokenTransfers` Each transfer yields `(from_address, from_post_balance)` and `(to_address, to_post_balance)`. The EVM zero address (mint/burn counterparty) and any side without a resolved post-balance are skipped. USD spot prices are folded in **inline** from the same block's `tokenPriceUpdates` (reversed so the chronologically-last update wins per token), no separate price join at read time. This template is **Token Balances by Token** plus the in-block USD valuation leg. ### Destination | Destination | Table | Read pattern | | - | - | - | | **ClickHouse** (first-class) | `fact_token_holders` | Prefix scan on `(chain_id, token_address, wallet_address, …)`; current holding via `argMax` over `FINAL` | | **Postgres** | `token_holders` (materialized view over `token_holder_observations`) | Partial index `(token_address, wallet_address) WHERE balance > 0` | | **MySQL** | `token_holders` (trigger-maintained from `token_holder_observations`) | PK `(token_address, wallet_address)` + `DELETE … WHERE balance = 0` cleanup | ClickHouse uses the collapsing log-table pattern (see the [templates overview](/data-feeds/templates/overview#destinations)) so chain reorganizations self-correct, a reorg negates the rolled-back block's observations (`sign = -1`) and re-emits the corrected ones, and `FINAL` collapses the pair before `argMax` so the aggregate sees only canonical state. The fact table's sort key is token-first, so a token's holder set is a contiguous range read. Postgres and MySQL keep an append-only observations table and derive the current-holder projection: Postgres as a `DISTINCT ON (token, wallet) … ORDER BY block_number DESC, log_index DESC` materialized view (refresh on a schedule), MySQL via an `AFTER INSERT` latest-wins upsert trigger with a periodic `DELETE … WHERE balance = 0` cleanup. ### Full schema Below is the complete read table this template produces. It's a starting point, keep the columns you need and drop the rest (see [Schema & flexibility](/data-feeds/templates/overview#schema--flexibility)). Raw `uint256` balances are stored as text (they exceed numeric precision); `usd_price` is a wide decimal so a low-decimals token × price never overflows. > [accordion] ClickHouse, fact\_token\_holders > > ```sql theme={null} > CREATE TABLE recipe_token_holders.fact_token_holders > ( > vendor_event_id String, > ingested_at DateTime64(3), > chain_id UInt32, > block_hash String, > block_number UInt64, > log_index UInt32, > event_ts DateTime64(3), > token_address String, > wallet_address String, > balance String, -- absolute balance after this transfer (raw uint256) > usd_price Nullable(String), -- in-block USD spot per whole token > leg LowCardinality(String), -- 'from' | 'to' > sign Int8 > ) > ENGINE = ReplicatedCollapsingMergeTree( > '/clickhouse/tables/{database}/fact_token_holders', '{replica}', sign) > PARTITION BY (chain_id, toYYYYMM(event_ts)) > ORDER BY (chain_id, token_address, wallet_address, block_number, log_index, vendor_event_id, leg); > ``` > > The `sign` column drives reorg collapsing, read with `FINAL` (then `argMax`) or a sign-aware aggregate, never a bare `WHERE sign = 1`. `leg` keeps the two unpivoted rows of one transfer distinct; the `+1`/`-1` reorg pair for one leg shares a key and collapses. A single-node setup can use `CollapsingMergeTree(sign)` without the replication path. > [accordion] Postgres, token\_holders > > ```sql theme={null} > -- 1. Observations (append-only sink target). > CREATE TABLE public.token_holder_observations ( > position BIGINT NOT NULL, > log_index BIGINT NOT NULL, > block_number BIGINT NOT NULL, > block_timestamp BIGINT NOT NULL, -- unix seconds > token_address TEXT NOT NULL, > wallet_address TEXT NOT NULL, > balance NUMERIC(76, 0) NOT NULL, -- absolute balance after the transfer > usd_price NUMERIC(38, 18) NOT NULL, -- in-block USD spot per whole token (0 if none) > leg TEXT NOT NULL, -- 'from' | 'to' > vendor_event_id TEXT NOT NULL > ); > > -- Speeds the DISTINCT ON (latest-per-key) the materialized view computes. > CREATE INDEX tho_token_wallet_recency_idx > ON public.token_holder_observations > (token_address, wallet_address, block_number DESC, log_index DESC); > > -- 2. Current-holder materialized view: latest observation per (token, wallet), > -- with the best-effort usd_value (assumes 18 decimals). > CREATE MATERIALIZED VIEW public.token_holders AS > SELECT DISTINCT ON (token_address, wallet_address) > token_address, > wallet_address, > balance, > usd_price, > (balance / 1e18 * usd_price)::NUMERIC(38, 18) AS usd_value, > block_number, > log_index, > block_timestamp > FROM public.token_holder_observations > ORDER BY token_address, wallet_address, block_number DESC, log_index DESC; > > -- Required by REFRESH MATERIALIZED VIEW CONCURRENTLY. > CREATE UNIQUE INDEX token_holders_pk > ON public.token_holders (token_address, wallet_address); > > -- Active holders of a token (this template's primary access path). > CREATE INDEX token_holders_by_token_active_idx > ON public.token_holders (token_address, wallet_address) > WHERE balance > 0; > > -- OPTIONAL: sibling access path — all non-zero balances held by a wallet. > -- CREATE INDEX token_holders_by_wallet_active_idx > -- ON public.token_holders (wallet_address, token_address) > -- WHERE balance > 0; > > -- OPTIONAL: cleanup index — find zeroed-out positions to prune. > -- CREATE INDEX token_holders_zero_cleanup_idx > -- ON public.token_holders (token_address, wallet_address) > -- WHERE balance = 0; > ``` > > MySQL is the same shape with `DECIMAL(76,0)` / `DECIMAL(38,18)`, and replaces the materialized view with a trigger-maintained `token_holders` table. `position` is the block-level cursor used during backfill. `balance` is typed `NUMERIC(76, 0)` so the raw `uint256` survives without overflow. ### Run it Everything runs in **your** infrastructure: the sink writes into a database you own and you query it with plain SQL, no API and no per-call limits. **Prerequisites** * **Docker** and Docker Compose. * A **Data Feeds key**, a `cm_live_…` key with `continuum:read` scope (this is *not* your Web3 API key). > [card] [Sign up for a Data Feeds key](https://admin.moralis.com) > > Log in to the Moralis admin panel to create your account and generate a `cm_live_…` key. **Start the sink** Generate a **starter pack** for `tokenHolders` in the [Moralis Admin Panel](https://admin.moralis.com), pick your chain and destination database, then run it with Docker. The [quickstart](/data-feeds/migration/quickstart) walks through it end to end. Set the backfill window (`MORALIS_HISTORICAL_FROM_BLOCK`) as noted below. > [!NOTE] > > **Backfill from the token's first block for a complete holder set.** A holder list is *current state*, the latest transfer-derived balance per `(token, wallet)`, so to return **every** holder you need the token's full transfer history. The good news: that's history since the **token launched**, not chain genesis, so set `MORALIS_HISTORICAL_FROM_BLOCK` to around the token's deployment block. A recent-only window would miss holders who haven't moved the token lately. See [History & backfill](/data-feeds/concepts/history-and-backfill). Then run the example reads below to confirm rows are landing. ### Example reads All current non-zero holders of a token with balance and best-effort `usd_value`, `FINAL` collapses reorg `±1` pairs before `argMax` (ClickHouse). The example assumes 18 decimals; substitute the token's real decimals to be exact: ```sql theme={null} SELECT wallet_address, argMax(balance, (block_number, log_index)) AS current_balance, argMax(usd_price, (block_number, log_index)) AS usd_price, toString(toDecimal256( (toFloat64OrZero(argMax(balance, (block_number, log_index))) / pow(10, 18)) * toFloat64OrZero(argMax(usd_price, (block_number, log_index))), 18)) AS usd_value FROM recipe_token_holders.fact_token_holders FINAL WHERE chain_id = 1 AND token_address = lower('0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48') GROUP BY wallet_address HAVING current_balance != '0' AND current_balance != '' ORDER BY toFloat64OrZero(current_balance) DESC LIMIT 100; ``` Holder count for a token (ClickHouse): ```sql theme={null} SELECT countDistinct(wallet_address) FROM ( SELECT wallet_address, argMax(balance, (block_number, log_index)) AS bal FROM recipe_token_holders.fact_token_holders FINAL WHERE chain_id = 1 AND token_address = lower('0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48') GROUP BY wallet_address HAVING bal != '0' AND bal != ''); ``` The same read on Postgres after refreshing the view (the partial index serves it directly): ```sql theme={null} REFRESH MATERIALIZED VIEW CONCURRENTLY token_holders; SELECT wallet_address, balance, usd_price, usd_value FROM public.token_holders WHERE token_address = lower('0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48') AND balance > 0 ORDER BY balance DESC LIMIT 100; ``` ### Other ways to consume this data The sink is the way to get **this pre-aggregated table** (`token_holders`), recommended for a holder list you own. The *same underlying data* is also available as the **raw decoded feed**, if you'd rather maintain holder state yourself: * **Your existing message clients**: stream it with **Kafka / AMQP / SQS**. * **REST / Arrow Flight**: pull the decoded block stream directly. Those give you the **source array** (`tokenTransfers`, which carries absolute post-transfer balances) to compute the holder set yourself, not this pre-aggregated table. All of them read the one data lake into **your** infrastructure. See [What are Data Feeds?](/data-feeds/concepts/what-are-data-feeds). ### Modes Shipped defaults: **ClickHouse `hybrid`** (backfill → realtime), **Postgres / MySQL `historical`** (one-shot backfill). For live/reorg-safe ingestion, use ClickHouse, see the [overview](/data-feeds/templates/overview#modes). > [!NOTE] > > The Postgres materialized view and the MySQL trigger state are not reorg-aware on their own, under realtime you would have to re-derive or refresh them. Run **realtime/hybrid on ClickHouse**, where the collapsing log table corrects reorgs per-block via `sign` automatically; the Postgres/MySQL configs target `historical` backfill. ### Multichain The template is chain-parametrized via the `chain` setting, point it at any supported EVM chain or Solana. On Solana, the event identity already includes `(from, to, token, amount)` so each observation stays row-unique despite Solana's repeated `logIndex` within an instruction; the holder set it produces is identical in shape. ### How much data does this consume? A continuous real-time feed for this template's exact selection, `tokenTransfers` plus the inline `tokenPriceUpdates` mark, measured: | Chain | Typical month (P50) | Busy month (P90) | | - | - | - | | Solana | **\~530 GB** | **\~670 GB** | | BNB Smart Chain | **\~210 GB** | **\~285 GB** | | Ethereum | **\~17 GB** | **\~23 GB** | Measured 2026-07-31, 30 sampled partitions per chain, `metered` delivery. Billing is on uncompressed bytes. **Size your allowance against the busy figure, not the typical one.** Chain activity is bursty, and the same feed can land on either side of a fixed allowance depending on the month. Three caveats: * **Real-time only.** A historical backfill is billed separately and is usually the larger number; its size depends entirely on how far back you go. * **Measured chains only.** Volume concentrates hard per chain (BNB Smart Chain measured over 10x Ethereum on this exact selection), so these figures do not extrapolate to unmeasured chains. * **Filtering does not reduce it.** Restricting to specific tokens or holders happens after the data is delivered. To reduce cost, narrow the **block range**, not the entity set. If you want your exact scope measured before you commit to a plan, [reach out](https://admin.moralis.com/data-feeds) and we will probe it against the live feed rather than estimate it. ### Fidelity gaps The Moralis `/erc20/{address}/owners` response has fields that aren't derivable from normalized per-block data and are therefore omitted or approximated: * **`balance_formatted`**: needs the token's `decimals`, which is contract metadata not present in `tokenTransfers`. Only the raw `balance` (uint256 string) is emitted; divide by `10^decimals` off-stream to format. Source decimals from a Token Metadata sync. * **`usd_value`**: emitted **best-effort assuming 18 decimals** (`balance / 1e18 × usd_price`). The faithful per-token USD spot `usd_price` (same-block, newest-wins) is stored alongside, so a consumer that knows the real decimals can recompute exactly: `usd_value = balance / 10^decimals × usd_price`. Tokens with no same-block price update get `usd_price = 0` (→ `usd_value = 0`) for that observation. * **`percentage_relative_to_total_supply`** and **`total_supply`**, there's no clean circulating/total-supply figure in the block stream (it would require summing all mints − burns since genesis or a contract `totalSupply()` read). Omitted. * **`owner_address_label`**, **`is_contract`**, **`entity`**, **`entity_logo`**, off-chain enrichment / address-classification metadata, not on-chain block data. Omitted. The core access key, `token_address` → holder `wallet_address` + current `balance`, is fully covered, so these gaps don't block the template. ## Migrating from the REST API This template replaces the token-holder family of REST endpoints, the EVM Web3 API holder list and summary, and the deprecated Solana Token API holder endpoints. Data Feeds are **not** 1:1 replicas of those responses: you land the holder set in your own database and reconstruct each response shape with SQL. The subsections below cover each REST endpoint, what replaces it, the field mapping (**exact** = straight from the chain, **calculated** = derived from real DEX trades, very close, **add yourself** = off-chain signal or a definition you set), and the gotchas specific to that endpoint. ### GET /erc20/:address/owners The per-holder list, every owner, biggest first, with balance and USD value. The most direct migration on this page: this template's `token_holders` table *is* the holder list, and the ranking becomes your `ORDER BY`. For `balance_formatted`, `percentage_relative_to_total_supply`, and the envelope `totalSupply`, add [Token Metadata](/data-feeds/templates/token/token-metadata) (`token_metadata`) to the same database, the raw list needs only this template, the formatted fields need the join. | `/erc20/:address/owners` | Data Feeds | Fidelity | | - | - | - | | `owner_address` | `token_holders.wallet_address` | exact | | `balance` (raw) | `token_holders.balance` | exact | | `balance_formatted` | derive: `balance / 10^decimals` (`token_metadata`) | exact | | `usd_value` | `token_holders.usd_value` | calculated | | `percentage_relative_to_total_supply` | derive: `balance / total_supply` (`token_metadata`) | exact | | `totalSupply` (envelope) | `token_metadata.total_supply` | exact | | `is_contract`, `owner_address_label`, `entity`, `entity_logo` | your own label / contract-address source | add yourself | The reconstruction query (Postgres, adapt to your destination): ```sql theme={null} SELECT h.wallet_address AS owner_address, h.balance, h.balance / power(10, m.decimals) AS balance_formatted, h.usd_value, h.balance / NULLIF(m.total_supply, 0) AS percentage_relative_to_total_supply FROM token_holders h LEFT JOIN token_metadata m ON m.token_address = h.token_address WHERE h.token_address = lower($1) AND h.balance > 0 -- current owners only, like the endpoint ORDER BY h.balance DESC -- biggest first, like the endpoint LIMIT $2 OFFSET $3; ``` **Gotchas** * Ordering and filtering are yours: the endpoint hard-coded biggest-first and non-zero-only; with your own table you rank by `balance` or `usd_value`, set any minimum, and page with plain SQL, no per-call limit. * The stored `usd_value` assumes 18 decimals, recompute as `balance / 10^decimals × usd_price` with real decimals from `token_metadata` for non-18-decimal tokens (see [fidelity gaps](#fidelity-gaps)). * USD values come from real DEX trades, very close to the old endpoint, compare with a tolerance; a thinly-traded token may value at 0. * Backfill from the token's deployment block (see [Run it](#run-it)) or the list silently misses holders who haven't moved the token lately. ### GET /erc20/:tokenAddress/holders The **aggregate holder summary**, `totalHolders`, supply concentration, size tiers, acquisition split, and trend windows, not the per-holder list. There is no single replacement table: you compute the summary yourself over this template's holder set, which turns the black-box buckets into definitions you control. > [!WARNING] > > This endpoint needs **multiple templates**, not one. Run this template plus [Token Metadata](/data-feeds/templates/token/token-metadata) (`total_supply` for the concentration percentages), and add [Token Transfers](/data-feeds/templates/token/token-transfers) if you want the `holdersByAcquisition` split (classify each holder's first inbound transfer). The `holderChange` trend windows need a holder-count series **you maintain**, snapshot the count per interval and read the deltas. | `/erc20/:tokenAddress/holders` | Data Feeds | Fidelity | | - | - | - | | `totalHolders` | `COUNT(*)` over `token_holders` (`balance > 0`) | exact | | `holderSupply.topN.supply` / `.supplyPercent` | top-N by balance vs `token_metadata.total_supply` | exact | | `holderDistribution.{whales…shrimps}` | bucket holders by size, thresholds you set | add yourself | | `holdersByAcquisition.{swap,transfer,airdrop}` | classify each holder's first inbound from `token_transfers` | add yourself | | `holderChange.{5min…30d}` | holder count now vs one window ago, from your count series | calculated | The headline numbers in one pass (Postgres, tier thresholds are illustrative, set your own): ```sql theme={null} WITH ranked AS ( SELECT usd_value, row_number() OVER (ORDER BY balance DESC) AS rnk, balance / sum(balance) OVER () AS supply_share FROM token_holders WHERE token_address = lower($1) AND balance > 0 ) SELECT count(*) AS total_holders, sum(supply_share) FILTER (WHERE rnk <= 10) * 100 AS top10_percent, sum(supply_share) FILTER (WHERE rnk <= 100) * 100 AS top100_percent, sum(supply_share) FILTER (WHERE rnk <= 500) * 100 AS top500_percent, count(*) FILTER (WHERE usd_value >= 1000000) AS whales, count(*) FILTER (WHERE usd_value < 100) AS shrimps FROM ranked; ``` **Gotchas** * The foundation is exact, the analytics are yours: holder count and concentration are deterministic SQL; the tier boundaries and acquisition rules are conventions you define, once fixed, the counts are exact. * Materialize for large tokens, USDC has millions of holders; compute the summary on a schedule into its own table, not per request. * Full-history backfill matters even more here: start late and you undercount holders and skew **every** aggregate, including the 30-day trend and the first-acquisition split. * Decimals matter for USD tiering, recompute `usd_value` with real `decimals` before bucketing non-18-decimal tokens. ### Solana: GET /token/:network/holders/:address > [!WARNING] > > This endpoint and `/token/:network/:address/top-holders` below are **deprecated Solana Token API endpoints sunsetting July 31, 2026**. Migrate before that date, after sunset the endpoints stop responding. This template pointed at Solana (see [Multichain](#multichain)) is the replacement for both. The Solana holder-metrics summary, holder count and size distribution for an SPL token. Replaced by this template with `chain` set to Solana: `tokenHolders` maintains one current balance per `(mint, owner)` and you aggregate the metrics in SQL. The field mapping matches the `/erc20/:tokenAddress/holders` table above, `totalHolders` is exact, `holderDistribution` and `holdersByAcquisition` are definitions you set (the acquisition split again needs [Token Transfers](/data-feeds/templates/token/token-transfers)), and `holderChange` is calculated from a count series you maintain. Total plus distribution tiers (Postgres, swap in your own thresholds, by `usd_value` or raw `balance`): ```sql theme={null} SELECT count(*) AS total_holders, count(*) FILTER (WHERE usd_value >= 1000000) AS whales, count(*) FILTER (WHERE usd_value >= 100000 AND usd_value < 1000000) AS sharks, count(*) FILTER (WHERE usd_value >= 10000 AND usd_value < 100000) AS dolphins, count(*) FILTER (WHERE usd_value < 10000) AS shrimps FROM token_holders WHERE token_address = $1 -- base58 mint, case-sensitive: do NOT lowercase AND balance > 0; ``` **Gotchas** * Don't lowercase Solana addresses: EVM addresses in this template are stored lowercased, but base58 mints and owners are **case-sensitive**, match them as-is. * SPL account model: the decoded feed resolves transfers to **owner wallets**, so `wallet_address` is the owner; one owner can hold across multiple token accounts, sum them for a per-owner total. * Backfill from around the mint's deployment or the count silently undershoots. ### Solana: GET /token/:network/:address/top-holders The ranked per-holder list for an SPL token, the Solana twin of `/erc20/:address/owners`, and the same direct migration: this template on Solana plus `ORDER BY balance DESC`. The field mapping matches the `/erc20/:address/owners` table above with camelCase names (`ownerAddress`, `balanceFormatted`, `usdValue`, `percentageRelativeToTotalSupply`); `isContract` (is the owner a program-owned account) is **add yourself** from your own account-type source. Formatted balance and supply percentage again need [Token Metadata](/data-feeds/templates/token/token-metadata). ```sql theme={null} SELECT wallet_address AS owner_address, balance, usd_value FROM token_holders WHERE token_address = $1 -- base58 mint, case-sensitive: do NOT lowercase AND balance > 0 ORDER BY balance DESC LIMIT $2 OFFSET $3; ``` **Gotchas** * Sunsetting **July 31, 2026** along with the holder-metrics endpoint above, plan the cutover now. * SPL decimals vary per token, format against real `decimals` from `token_metadata`, never a fixed 18; the stored best-effort `usd_value` assumes 18. * Same base58 case-sensitivity and owner-vs-token-account notes as above. * USD value comes from real trades, compare with a tolerance; a thinly-traded token may value at 0. ### Related > [card] [Token Transfers](/data-feeds/templates/token/token-transfers) > > The per-token movement ledger this holder set is derived from. > [card] [Token Analytics](/data-feeds/use-cases/token-analytics) > > The use case holder distribution and concentration power. # Token Metadata Source: https://docs.moralis.com/data-feeds/templates/token/token-metadata Sync ERC-20 token metadata (name, symbol, decimals, total supply, and deployer) captured at deploy time into your own database. Mirrors the Moralis GET /erc20/metadata endpoint. ### Question it answers > "Give me the ERC-20 metadata (`name` / `symbol` / `decimals` / `total_supply`) for token **0x…**." Mirrors Moralis `GET /erc20/metadata`. The template lands one observation per **TOKEN-type deployed contract** and projects it into a one-row-per-token metadata surface. Token metadata is fixed at deploy time, so there is normally exactly one row per `(chain_id, token_address)`; the latest deploy by `(block_number, transaction_index)` is canonical (defensive against a CREATE2 re-deploy at a reused address). ### What you get One row per token contract, keyed by `token_address`: | Column | Description | | - | - | | `token_address` | The deployed token contract address | | `name` | ERC-20 token name (raw string; may contain quotes/odd characters) | | `symbol` | ERC-20 token symbol | | `decimals` | ERC-20 decimals; apply at read time to scale `total_supply` and any raw amounts | | `total_supply` | Raw `uint256` supply, **no decimals applied**; divide by `10^decimals` for the human-readable value | | `deployer_address` | Address that deployed the contract | | `block_number`, `transaction_index` | Deploy position (the recency tiebreaker for re-deploys) | | `block_timestamp` / `event_ts` | Deploy block time | Token contracts are filtered to real ERC-20 deploys: a contract is kept only if its `symbol` is non-empty and ≤ 100 chars, `decimals` ≤ 50, and `deployer_address` is non-empty. ### Source The transform reads the per-block `deployedContracts` array, filtered to entries whose `type` contains `TOKEN` (the token-contract slice of the block EVM data). Each surviving entry becomes one row. `deployedContracts` carries no log index, so `transaction_index` is the intra-block tiebreaker: one deploy per `(tx, contract)`. ### Destination | Destination | Table | Read pattern | | - | - | - | | **ClickHouse** (first-class) | `fact_token_metadata` | Prefix scan on `(chain_id, token_address)`; read with `FINAL`, take latest deploy via `argMax(…, (block_number, transaction_index))` | | **Postgres** | `token_metadata` (materialized view over `token_metadata_observations`) | Unique index on `(token_address)` | | **MySQL** | `token_metadata` (latest-wins trigger state table over observations) | Primary key on `(token_address)` | ClickHouse uses the collapsing log-table pattern (see the [templates overview](/data-feeds/templates/overview#destinations)) so chain reorganizations self-correct. The fact table's sort key is token-first, so a token's metadata is a point lookup. Postgres derives the current-metadata surface as a `DISTINCT ON (token_address)` materialized view; MySQL maintains it incrementally via an `AFTER INSERT` latest-wins trigger. ### Full schema The complete read table this template produces. Keep the columns you need and drop the rest (see [Schema & flexibility](/data-feeds/templates/overview#schema--flexibility)). `total_supply` is the raw `uint256` stored as text / wide integer (it exceeds standard numeric precision); apply `decimals` at read time for the human-readable value. > [accordion] ClickHouse, fact\_token\_metadata > > ```sql theme={null} > CREATE TABLE recipe_token_metadata.fact_token_metadata > ( > vendor_event_id String, > ingested_at DateTime64(3), > chain_id UInt32, > block_hash String, > block_number UInt64, > transaction_index UInt32, > event_ts DateTime64(3), > token_address String, > deployer_address String, > name String, > symbol String, > decimals Int16, > total_supply String, -- raw uint256, no decimals applied > sign Int8 > ) > ENGINE = ReplicatedCollapsingMergeTree( > '/clickhouse/tables/{database}/fact_token_metadata', '{replica}', sign) > PARTITION BY (chain_id, toYYYYMM(event_ts)) > ORDER BY (chain_id, token_address, block_number, transaction_index, vendor_event_id); > ``` > > The `sign` column drives reorg collapsing: read with `FINAL` or a sign-aware aggregate, and take the latest deploy with `argMax(…, (block_number, transaction_index))`. A single-node setup can use `CollapsingMergeTree(sign)` without the replication path. Because metadata is fixed at deploy, there is normally one row per token; the latest-deploy logic only matters for a CREATE2 re-deploy at a reused address. > [accordion] Postgres, token\_metadata > > ```sql theme={null} > -- 1. Observations (sink target) — append-only, one row per deploy. > CREATE TABLE public.token_metadata_observations ( > position BIGINT NOT NULL, > transaction_index BIGINT, > block_number BIGINT NOT NULL, > block_timestamp BIGINT NOT NULL, -- unix seconds > tx_hash TEXT NOT NULL, > vendor_event_id TEXT NOT NULL, > token_address TEXT NOT NULL, > deployer_address TEXT NOT NULL, > name TEXT NOT NULL, > symbol TEXT NOT NULL, > decimals SMALLINT NOT NULL, > total_supply NUMERIC(76, 0) -- raw uint256, no decimals applied > ); > > -- Speeds the DISTINCT ON (latest-per-token) the materialized view computes. > CREATE INDEX IF NOT EXISTS tmo_token_recency_idx > ON public.token_metadata_observations > (token_address, block_number DESC, transaction_index DESC); > > -- 2. Current-metadata materialized view: latest deploy per token_address. > CREATE MATERIALIZED VIEW public.token_metadata AS > SELECT DISTINCT ON (token_address) > token_address, > name, > symbol, > decimals, > total_supply, > block_number, > deployer_address > FROM public.token_metadata_observations > ORDER BY token_address, block_number DESC, transaction_index DESC; > > -- Required by REFRESH MATERIALIZED VIEW CONCURRENTLY (one row per token). > CREATE UNIQUE INDEX IF NOT EXISTS token_metadata_pk > ON public.token_metadata (token_address); > > -- Lookup helper. > CREATE INDEX IF NOT EXISTS token_metadata_symbol_idx > ON public.token_metadata (symbol); > ``` > > Refresh the view on a schedule: `REFRESH MATERIALIZED VIEW CONCURRENTLY token_metadata;`. `total_supply` is `NUMERIC(76, 0)`: the explicit precision keeps large raw supplies from overflowing. MySQL is the same shape with `DECIMAL(65,0)` for `total_supply` and `VARCHAR(255)` for `name` / `symbol`, maintaining `token_metadata` incrementally via an `AFTER INSERT` latest-wins trigger. `position` is the block-level cursor used during backfill. ### Example reads Metadata for one token, latest deploy wins (ClickHouse): ```sql theme={null} SELECT token_address, argMax(name, (block_number, transaction_index)) AS name, argMax(symbol, (block_number, transaction_index)) AS symbol, argMax(decimals, (block_number, transaction_index)) AS decimals, argMax(total_supply, (block_number, transaction_index)) AS total_supply, argMax(deployer_address, (block_number, transaction_index)) AS deployer_address FROM recipe_token_metadata.fact_token_metadata FINAL WHERE chain_id = 1 AND token_address = lower('0x...') GROUP BY token_address; ``` All tokens deployed in a block range (ClickHouse): ```sql theme={null} SELECT token_address, name, symbol, decimals, block_number FROM recipe_token_metadata.fact_token_metadata FINAL WHERE chain_id = 1 AND block_number BETWEEN 19000000 AND 19001000 ORDER BY block_number, transaction_index; ``` Current metadata for one token (Postgres, after refreshing the view): ```sql theme={null} SELECT token_address, name, symbol, decimals, total_supply FROM public.token_metadata WHERE token_address = lower('0x...'); ``` ### Modes Shipped defaults: **ClickHouse `hybrid`** (backfill → realtime), **Postgres / MySQL `historical`** (one-shot backfill). For live/reorg-safe ingestion, use ClickHouse; see the [overview](/data-feeds/templates/overview#modes). > [!NOTE] > > The Postgres / MySQL realtime reorg path needs a single-column `UNIQUE` on the position column, but `position` is block-level (one block can deploy several token contracts), so array-expanded rows can only carry a composite unique. Run realtime/hybrid on **ClickHouse**, where the collapsing log table corrects reorgs per-block. The Postgres / MySQL configs are intended for `historical` backfill; a once-off metadata census is the dominant use of this template anyway. ### Multichain The template is chain-parametrized via the `chain` setting: point it at any supported EVM chain. The `vendor_event_id` already includes `chain_id`, `tx_hash`, `transaction_index`, and `token_address`, so rows stay unique without the Solana log-index widening other templates need. Note that SPL token metadata does not flow through `deployedContracts` the way EVM contract deploys do; this template is **EVM-shaped**. ### Fidelity gaps The core on-chain fields (`token_address`, `name`, `symbol`, `decimals`, `total_supply`, plus `block_number` and `deployer_address`) are fully sourced. A few enrichment fields `GET /erc20/metadata` returns are **not** sourced here, as they come from off-chain or separate pipelines: * `logo` / `thumbnail` / `logo_hash`: off-chain logo CDN assets. * `validated` / `possible_spam` / `verified_contract`: Moralis spam & verification heuristics. * `categories`: editorial token categorisation. * `created_at` (wall-clock): this template carries on-chain `block_number` / `block_timestamp` instead. Also note `total_supply` is the **raw** `uint256` with no decimals applied; divide by `10^decimals` for the human-readable supply. ## Migrating from the REST API ### `GET /erc20/metadata`: ERC-20 token metadata This template replaces the endpoint's on-chain core: `name`, `symbol`, `decimals`, `total_supply`, and the deploy position come through exactly, with no batch cap on how many contracts you look up per query. > [!NOTE] > > **Not 1:1.** `fully_diluted_valuation` needs a price join: pair this template with [Token Prices](/data-feeds/templates/token/token-prices) and multiply. The endpoint's editorial layer (`logo` / `thumbnail`, `possible_spam` / `verified_contract` / `validated` / `security_score`, `categories`, `links`, `description`) is off-chain: bring your own token list and allow/deny lists, or drop those fields. `market_cap` needs an off-chain `circulating_supply` (there is no on-chain equivalent); FDV is the on-chain-derivable alternative. | `/erc20/metadata` | Data Feeds | Fidelity | | - | - | - | | `address`, `name`, `symbol`, `decimals` | `token_metadata.*` | exact | | `total_supply` (raw) | `token_metadata.total_supply` | exact | | `total_supply_formatted` | `total_supply / 10^decimals` | calculated | | `block_number` (deploy) | `token_metadata.block_number` | exact | | `created_at` (deploy time) | `token_metadata_observations.block_timestamp` (not on the `token_metadata` view) | exact | | `fully_diluted_valuation` | `total_supply_formatted × usd_price` via [Token Prices](/data-feeds/templates/token/token-prices) | calculated | | `market_cap` | `circulating_supply × price`; needs off-chain circulating supply | add yourself | | `circulating_supply` | None | add yourself | | `implementations` | match the token across the chains you index, or a multichain token list | add yourself | | `logo`, `logo_hash`, `thumbnail` | None | add yourself | | `possible_spam`, `verified_contract`, `validated`, `security_score` | None | add yourself | | `categories`, `links`, `description`, `address_label` | None | add yourself | Any set of contracts in one query, with formatted supply and FDV (Postgres): ```sql theme={null} SELECT m.token_address AS address, m.name, m.symbol, m.decimals, m.total_supply, m.total_supply / power(10, m.decimals) AS total_supply_formatted, m.total_supply / power(10, m.decimals) * p.usd_price AS fully_diluted_valuation FROM token_metadata m LEFT JOIN LATERAL ( SELECT usd_price FROM token_price_updates WHERE token_address = m.token_address ORDER BY block_number DESC LIMIT 1 ) p ON true WHERE m.token_address = ANY($1); -- lowercased addresses, no batch cap ``` * **Backfill from the deploy block.** Metadata is captured at contract deployment, so a token only appears if its deploy block is indexed; for arbitrary token lookups, run `historical` / `hybrid` over full history. * `total_supply` is **raw and live**: no decimals applied (scale at read time), and it tracks mint/burn, so keep the feed current for an up-to-date figure. * `created_at` isn't on the `token_metadata` view; read `block_timestamp` from `token_metadata_observations` (Postgres) or `event_ts` on the ClickHouse fact table. * The template is **EVM-shaped**: SPL token metadata doesn't flow through `deployedContracts` (see [Multichain](#multichain)). ### Related > [card] [Token Holders](/data-feeds/templates/token/token-holders) > > All non-zero holders of a token; pair with metadata for decimals and symbol. > [card] [Token Analytics](/data-feeds/use-cases/token-analytics) > > The use case this metadata census powers: the decimals lookup behind every scaled amount. # Token Prices Source: https://docs.moralis.com/data-feeds/templates/token/token-prices Sync a token's full USD / native mark price history (every in-block price update for each pair and protocol) as a continuous feed into your own database, with a carry-forward latest mark for valuing quiet positions. ### Question it answers > "Give me the USD / native mark price history for token **0x…**, newest first, and the freshest mark right now so I can value a position that hasn't traded recently." Token Prices is the **valuation join target** across Data Feeds. Any "what is this worth in USD" question (a transfer's value, a portfolio's worth, a trade's notional) joins a token's mark at a given block from this feed. ### What you get The template lands **one row per in-block price update**: Moralis' continuous mark for each `(token, pair, protocol)` at the block it changed. A token traded across several pairs or protocols produces several marks per block; the table keeps them all, keyed for by-token lookups. | Column | Description | | - | - | | `token_address` | The token the mark prices | | `pair_address` | The pair the mark was observed on | | `protocol` | The DEX/protocol that produced the mark | | `usd_price` | USD mark, carried as text for full precision; cast at read time | | `native_price` | Native-asset mark (e.g. ETH), text for full precision | | `block_number`, `event_ts` | When the mark was set (block height and block time) | | `tx_hash` | Transaction the price update came from | | `chain_id` | Chain the mark belongs to | On ClickHouse, a companion **`latest_token_price_dict`** dictionary keeps the freshest mark per `(chain_id, token_address)` for O(1) carry-forward valuation of tokens that haven't updated recently. ### Source The transform reads one per-block array, `tokenPriceUpdates`, and lands one row per entry. Each entry is Moralis' mark for a `(token, pair, protocol)` at that block. There is no read-time join: every mark is already a row keyed by token. ### Destination | Destination | Table | Read pattern | | - | - | - | | **ClickHouse** (first-class) | `fact_token_price_update` (+ `latest_token_price_dict`) | Prefix scan on `(chain_id, token_address, event_ts)`; read with `FINAL` or `sum(sign)` | | **Postgres** | `token_price_updates` | Index on `(token_address, block_number DESC)` | | **MySQL** | `token_price_updates` | Index on `(token_address, block_number)` | ClickHouse uses the collapsing log-table pattern (see the [templates overview](/data-feeds/templates/overview#destinations)) so chain reorganizations self-correct. The fact table's sort key is token-first, so a token's full price history is a contiguous range read; the `latest_token_price_dict` dictionary holds the carry-forward mark for quiet positions. ### Full schema Below is the complete read table this template produces. It's a starting point: keep the columns you need and drop the rest (see [Schema & flexibility](/data-feeds/templates/overview#schema--flexibility)). `usd_price` and `native_price` are carried as text to preserve full precision across many orders of magnitude; cast at read time. > [accordion] ClickHouse, fact\_token\_price\_update > > ```sql theme={null} > CREATE TABLE recipe_token_price_history.fact_token_price_update > ( > vendor_event_id String, > ingested_at DateTime64(3), > chain_id UInt32, > block_hash String, > block_number UInt64, > event_ts DateTime64(3), > token_address String, > pair_address String, > protocol LowCardinality(String), > usd_price String, -- toString(usdPrice), cast at read time > native_price String, -- toString(nativePrice) > sign Int8 > ) > ENGINE = ReplicatedCollapsingMergeTree( > '/clickhouse/tables/{database}/fact_token_price_update', '{replica}', sign) > PARTITION BY (chain_id, toYYYYMM(event_ts)) > ORDER BY (chain_id, token_address, event_ts, vendor_event_id); > > -- OPTIONAL (carry-forward valuation): the freshest USD mark per token, O(1). > -- Refreshes every 30-60s, so a quiet token carries its last on-chain mark > -- forward without a new price event. argMax over FINAL/sign=1 is reorg-correct. > CREATE DICTIONARY recipe_token_price_history.latest_token_price_dict > ( > chain_id UInt32, > token_address String, > usd_price String, > block_number UInt64, > event_ts DateTime64(3) > ) > PRIMARY KEY chain_id, token_address > SOURCE(CLICKHOUSE( > QUERY $$ > SELECT chain_id, token_address, > argMax(usd_price, (block_number, event_ts)) AS usd_price, > max(block_number) AS block_number, > max(event_ts) AS event_ts > FROM recipe_token_price_history.fact_token_price_update FINAL > WHERE sign = 1 > GROUP BY chain_id, token_address > $$ > )) > LAYOUT(COMPLEX_KEY_HASHED()) > LIFETIME(MIN 30 MAX 60); > ``` > > The `sign` column drives reorg collapsing: read with `FINAL` or `sum(sign)`. A single-node setup can use `CollapsingMergeTree(sign)` without the replication path. Inside the dictionary the `WHERE sign = 1` is safe (not the bare-`WHERE` anti-pattern) because `FINAL` has already collapsed the ±1 reorg pairs. > [accordion] Postgres, token\_price\_updates > > ```sql theme={null} > CREATE TABLE public.token_price_updates ( > position BIGINT NOT NULL, > log_index BIGINT, > transaction_index BIGINT, > block_number BIGINT NOT NULL, > block_timestamp BIGINT NOT NULL, -- unix seconds > tx_hash TEXT NOT NULL, > vendor_event_id TEXT NOT NULL, > token_address TEXT NOT NULL, > pair_address TEXT NOT NULL, > protocol TEXT NOT NULL, > usd_price NUMERIC(38, 18), > native_price NUMERIC(38, 18) > ); > > -- By-token price history (the template's primary purpose). > CREATE INDEX ON public.token_price_updates (token_address, block_number DESC); > -- Block-range helper. > CREATE INDEX ON public.token_price_updates (block_number); > ``` > > MySQL is the same shape with `DECIMAL(38,18)` for the price columns. `position` is the block-level cursor used during backfill. The explicit `NUMERIC(38,18)` precision keeps room for marks that span many orders of magnitude. ### Example reads A token's price history, newest first (ClickHouse): ```sql theme={null} SELECT event_ts, usd_price, native_price, pair_address, protocol FROM recipe_token_price_history.fact_token_price_update FINAL WHERE chain_id = 1 AND token_address = lower('0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48') ORDER BY event_ts DESC LIMIT 50; ``` The latest carry-forward mark via the dictionary (O(1), refreshes every 30–60s): ```sql theme={null} SELECT dictGetOrDefault( 'recipe_token_price_history.latest_token_price_dict', 'usd_price', tuple(1, lower('0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48')), '0' ) AS usd_price; ``` Hourly close per token (last mark in each hour bucket, sign-aware): ```sql theme={null} SELECT toStartOfHour(event_ts) AS hour, argMax(usd_price, (block_number, event_ts)) AS close_usd FROM recipe_token_price_history.fact_token_price_update WHERE chain_id = 1 AND token_address = lower('0xA0b8…') AND sign = 1 GROUP BY hour ORDER BY hour DESC LIMIT 24; ``` ### Modes Shipped defaults: **ClickHouse `hybrid`** (backfill → realtime), **Postgres / MySQL `historical`** (one-shot backfill). For live/reorg-safe ingestion, use ClickHouse; see the [overview](/data-feeds/templates/overview#modes). > [!NOTE] > > The realtime reorg path needs a single-column `UNIQUE` on the position column, but `position` is block-level (many price updates share one block), so the array-expanded rows can only carry a composite unique. Run realtime/hybrid on **ClickHouse**, where the collapsing log table corrects reorgs per-block. The Postgres / MySQL configs are intended for `historical` backfill. ### Multichain The template is chain-parametrized via the `chain` setting: point it at any supported EVM chain or Solana. On Solana, the same `logIndex` can be assigned to multiple events in one instruction, so the event identity is widened with `pairAddress` (or `protocol`) to keep marks distinct; the price feed it produces is identical in shape. ### How much data does this consume? `tokenPriceUpdates` is one of the smaller slices in the feed. A continuous real-time feed measured: | Chain | Typical month (P50) | Busy month (P90) | | - | - | - | | Solana | **\~84 GB** | **\~110 GB** | | BNB Smart Chain | **\~23 GB** | not measured | | Base | **\~6.0 GB** | not measured | | Polygon | **\~3.0 GB** | not measured | | Arbitrum | **\~2.7 GB** | not measured | | Ethereum | **\~1.3 GB** | not measured | | Optimism | **\~0.9 GB** | not measured | Measured 2026-07-30, `metered` delivery; Solana over 25 sampled partitions, the EVM chains over 60. Billing is on uncompressed bytes. All runs included the negligible `deployedContracts` slice. **Size your allowance against a busy month, not a typical one.** Where only a typical figure exists, leave meaningful headroom above it rather than sizing to it — chain activity is bursty, and busy months on comparable slices have measured 30–70% above typical. Three caveats: * **Real-time only.** A historical backfill is billed separately and is usually the larger number; its size depends entirely on how far back you go. * **Measured chains only.** Volume concentrates hard per chain, so these figures do not extrapolate to unmeasured chains. * **Filtering does not reduce it.** Restricting to specific tokens or venues happens after the data is delivered. To reduce cost, narrow the **block range**, not the entity set. If you want your exact scope measured before you commit to a plan, [reach out](https://admin.moralis.com/data-feeds) and we will probe it against the live feed rather than estimate it. ### Fidelity and valuation notes * **Precision.** `usd_price` and `native_price` are carried as strings end-to-end to preserve full precision; cast at read time (`toDecimal*` on ClickHouse, the `NUMERIC` / `DECIMAL` columns on Postgres / MySQL). * **Multiple marks per block.** A token priced on several pairs/protocols lands one row per `(pair, protocol)` per block. Pick a venue (filter `pair_address` / `protocol`) or aggregate (`argMax`) depending on whether you want a specific venue's mark or a representative one. * **Carry-forward staleness.** The `latest_token_price_dict` refreshes every 30–60s, so a quiet token's mark is at most \~a minute stale without needing a fresh price event, but it does not interpolate between updates. ## Migrating from the REST API This template replaces both REST price endpoints. Their responses were **not 1:1 rows in one table**: prices, token details, and pair liquidity came bundled in a single payload, but they live in different parts of the dataset here. > [!NOTE] > > Rebuilding the full REST response takes a **combination of templates**: this one for the marks, plus [Token Metadata](/data-feeds/templates/token/token-metadata) for `tokenName` / `tokenSymbol` / `tokenDecimals` and [Pair Reserves](/data-feeds/templates/markets/pair-reserves) if you need `pairTotalLiquidityUsd` (reserves × price). Join them at read time on `token_address` / `pair_address`. Two workflow changes to plan for: * **USD prices are calculated from DEX trades**: the same trades the REST endpoints priced from, so marks track closely, but compare with a small tolerance rather than expecting identical figures. * **You pick the reference pair.** The REST endpoints chose one pair (typically deepest liquidity) as "the price"; this table keeps every `(pair, protocol)` mark, so you define the rule: filter by `pair_address`, or `argMax` for the newest overall. Both endpoints returned the same shape, so one field mapping covers them: | REST API field | Data Feeds | Fidelity | | - | - | - | | `tokenAddress` | `token_address` | exact | | `usdPrice` / `usdPriceFormatted` | latest `usd_price` per token | calculated | | `nativePrice` | latest `native_price` (a scalar, not the REST endpoint's object) | calculated | | `pairAddress`, `exchangeName` | `pair_address`, `protocol` | exact | | `priceLastChangedAtBlock`, `blockTimestamp` | `block_number`, `event_ts` (`block_timestamp` on Postgres / MySQL, in **seconds**, not ms) | exact | | `tokenName`, `tokenSymbol`, `tokenDecimals` | [Token Metadata](/data-feeds/templates/token/token-metadata) template | exact | | `24hrPercentChange`, `usdPrice24hr*` | derive: mark \~24h ago vs latest, from this table's history | calculated | | `pairTotalLiquidityUsd` | [Pair Reserves](/data-feeds/templates/markets/pair-reserves) template (reserves × price) | calculated | | `exchangeAddress` | not in these templates: `protocol` names the venue; bring a factory list if you need the address | add yourself | | `tokenLogo`, `possibleSpam`, `verifiedContract`, `securityScore` | off-chain signals; bring your own token / allow / deny lists | add yourself | ### GET /erc20/:address/price: single token price ```text theme={null} GET /erc20/:address/price ``` Replaced by the newest mark for one token in this template's table, joined to [Token Metadata](/data-feeds/templates/token/token-metadata) for the token details the endpoint bundled in. On Postgres: ```sql theme={null} SELECT DISTINCT ON (p.token_address) p.token_address, m.symbol, m.name, m.decimals, p.usd_price, p.native_price, p.pair_address, p.protocol AS exchange_name, p.block_number AS price_last_changed_at_block, p.block_timestamp FROM token_price_updates p LEFT JOIN token_metadata m ON m.token_address = p.token_address WHERE p.token_address = lower('0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48') ORDER BY p.token_address, p.block_number DESC; -- newest mark ``` * On ClickHouse, skip the scan for "price now": `latest_token_price_dict` is the O(1) carry-forward lookup (see [Example reads](#example-reads)). * For "price now" you only need the feed running recently; backfill only if you want historical prices (the old `to_block` behavior) or a 24h-change window. See [History & backfill](/data-feeds/concepts/history-and-backfill). * A token that hasn't traded recently carries an older mark; the dictionary carries it forward but does not interpolate. ### POST /erc20/prices: batch token prices ```text theme={null} POST /erc20/prices ``` Replaced by the same newest-mark-per-token read over a set of tokens: one query, **no 100-token batch cap**. On ClickHouse: ```sql theme={null} SELECT token_address, argMax(usd_price, (block_number, event_ts)) AS usd_price, argMax(native_price, (block_number, event_ts)) AS native_price, argMax(pair_address, (block_number, event_ts)) AS pair_address, max(block_number) AS price_last_changed_at_block FROM recipe_token_price_history.fact_token_price_update FINAL WHERE chain_id = 1 AND sign = 1 AND token_address IN (lower('0xA0b8…'), lower('0xC02a…'), lower('0x6B17…')) GROUP BY token_address; ``` * The REST 24h-change fields (`24hrPercentChange`, `usdPrice24hr*`) aren't stored; derive them by comparing each token's latest mark against its mark \~24 hours earlier from this same table. * Pin the reference pair per token (filter `pair_address` or order by your liquidity column) before `argMax`, or the "price" can flip between venues call to call. * Tokens with no recent DEX activity return their last mark, not `null`; check `price_last_changed_at_block` if staleness matters. ### Related > [card] [Token Transfers](/data-feeds/templates/token/token-transfers) > > The per-token transfer ledger you value against these marks. > [card] [Portfolio Tracking](/data-feeds/use-cases/portfolio-tracking) > > Token Prices is the valuation join target behind portfolio worth. # Token Stats Source: https://docs.moralis.com/data-feeds/templates/token/token-stats Maintain per-token transfer counters (how many transfers a token has had) as a continuous, reorg-safe aggregate in your own database. Replaces the removed Moralis GET /erc20/{address}/stats endpoint. ### Question it answers > "How many transfers has token **0x…** had?" Replaces the removed Moralis `GET /erc20/{address}/stats` (`{ transfers: { total } }`). Each ERC-20 transfer event contributes `+1` to that token's counter. The shape is intentionally compact (one counter today), but the **pattern** is the value: fold any future per-token counter (holder-count delta, daily active addresses, …) onto the same row so a single read returns the full stats block for a token. ### What you get One aggregated row per token, keyed by `token_address`: | Column | Description | | - | - | | `chain_id` | The chain the token lives on | | `token_address` | The ERC-20 contract address (the counter key) | | `transfers_total` | Net count of transfer events for the token (`transfers.total`) | `transfers_total` counts every row in the source transfer array, **including mints (`from = 0x0`) and burns (`to = 0x0`)**, matching the endpoint's "transfers of the token" semantics. See [Counter semantics](#counter-semantics) to exclude mints/burns. ### Source The transform reads one per-block array and counts it: `tokenTransfers` This is by definition the ERC-20 transfer event collection (NFT and native transfers are separate arrays: `nftTokenTransfers`, `nativeTransfers`), so no token-standard filter is needed. Each event contributes `+1` to `transfers_total` for its `token_address`. `block_number` / `block_timestamp` come from the block envelope. ### Destination | Destination | Table | Read pattern | | - | - | - | | **ClickHouse** (first-class) | `fact_token_stats` | `ORDER BY (chain_id, token_address)`; net count via `sum(transfers_total)` or `FINAL` | | **Postgres** | `token_stats` (materialized view over `token_transfer_events`) | Unique index `(token_address)` | | **MySQL** | `token_stats` (trigger-maintained over `token_transfer_events`) | Primary key `(token_address)` | ClickHouse uses a **SummingMergeTree** counter table (not the collapsing pattern most templates use): the table is keyed by `(chain_id, token_address)`, so every event for a token shares one key and the engine **sums** the per-event rows on background merges. The materialized view emits `transfers_total = sign` per event (`+1` for forward inserts, `-1` for reorg reverts), so the per-token sum is always the net count and is naturally reorg-safe. ### Full schema Below is the complete read table this template produces. It's deliberately minimal (one counter) and is a starting point for the forward-compatible counter pattern: add more summable columns to land more per-token stats on the same row (see [Schema & flexibility](/data-feeds/templates/overview#schema--flexibility)). > [accordion] ClickHouse, fact\_token\_stats > > ```sql theme={null} > CREATE TABLE recipe_token_stats.fact_token_stats > ( > chain_id UInt32, > token_address String, > transfers_total Int64 > ) > ENGINE = ReplicatedSummingMergeTree( > '/clickhouse/tables/{database}/fact_token_stats', '{replica}') > ORDER BY (chain_id, token_address); > ``` > > SummingMergeTree sums every numeric column that isn't part of the `ORDER BY` tuple, so adding a new counter is just another `Int64` / `UInt64` column plus a projection branch in the materialized view; no engine change. Read the net counter with `sum(transfers_total)` or `FINAL` (which forces the merge first); **never** a bare `WHERE sign = 1`. A single-node setup can use `SummingMergeTree()` without the replication path. > [accordion] Postgres, token\_stats > > ```sql theme={null} > -- 1. Transfer events (sink target). > CREATE TABLE public.token_transfer_events ( > position BIGINT NOT NULL, > log_index BIGINT NOT NULL, > block_number BIGINT NOT NULL, > block_timestamp BIGINT NOT NULL, -- unix seconds > tx_hash TEXT NOT NULL, > token_address TEXT NOT NULL, > vendor_event_id TEXT NOT NULL > ); > > -- Row-uniqueness for idempotent ingestion. > CREATE UNIQUE INDEX IF NOT EXISTS token_transfer_events_uq_event > ON public.token_transfer_events (vendor_event_id); > > -- Per-token grouping index — lets the view's GROUP BY do an index scan, not a sort. > CREATE INDEX IF NOT EXISTS token_transfer_events_token_idx > ON public.token_transfer_events (token_address); > > -- 2. Per-token counter materialized view. > CREATE MATERIALIZED VIEW public.token_stats AS > SELECT > token_address, > COUNT(*)::BIGINT AS transfers_total > FROM public.token_transfer_events > GROUP BY token_address; > > CREATE UNIQUE INDEX IF NOT EXISTS token_stats_pk > ON public.token_stats (token_address); > ``` > > Refresh on a schedule: `REFRESH MATERIALIZED VIEW CONCURRENTLY token_stats;`. MySQL keeps the same `token_transfer_events` table plus a trigger-maintained `token_stats` state table doing `INSERT … ON DUPLICATE KEY UPDATE transfers_total = transfers_total + 1`. Add another aggregate column to the view (Postgres) or another trigger column (MySQL) to land more counters. ### Example reads Per-token transfer counters on chain 1, most-transferred first; `sum()` is reorg-safe (ClickHouse): ```sql theme={null} SELECT token_address, sum(transfers_total) AS transfers_total FROM recipe_token_stats.fact_token_stats WHERE chain_id = 1 GROUP BY token_address ORDER BY transfers_total DESC LIMIT 10; ``` A single token: this is the read that replaces `GET /erc20/{address}/stats`: ```sql theme={null} SELECT sum(transfers_total) AS transfers_total FROM recipe_token_stats.fact_token_stats WHERE chain_id = 1 AND token_address = lower('0x...'); ``` Same query via `FINAL` (forces the background merge first; identical result): ```sql theme={null} SELECT token_address, transfers_total FROM recipe_token_stats.fact_token_stats FINAL WHERE chain_id = 1 ORDER BY transfers_total DESC LIMIT 10; ``` ### Counter semantics `transfers_total` includes **mints and burns**, matching the endpoint's "transfers of the token" definition: every `+1` of supply movement is counted, with no `from = 0x0` / `to = 0x0` filter. The ClickHouse fact table carries only the aggregated counter, so to exclude mints/burns query the Postgres/MySQL event table (which retains per-event rows), or add `from`/`to` columns to the transform and event-table schema if you need that surface in ClickHouse: ```sql theme={null} -- Postgres: counts excluding mints + burns (requires from/to columns on the event table). SELECT token_address, COUNT(*) AS transfers_total FROM public.token_transfer_events WHERE token_address = lower('0x...') GROUP BY token_address; ``` ### Modes Shipped defaults: **ClickHouse `hybrid`** (backfill → realtime), **Postgres / MySQL `historical`** (one-shot backfill). For live, reorg-corrected counters, use ClickHouse; see the [overview](/data-feeds/templates/overview#modes). > [!NOTE] > > On Postgres / MySQL the counter **only ever increments** in `historical` mode: there is no reorg-safe row-deletion path on these destinations, and the per-event `vendor_event_id` uniqueness only guards against double-ingestion of the same canonical event. `position` is block-level and array-expanded transfer rows share it, which constrains realtime/hybrid here. Run realtime/hybrid on **ClickHouse**, which corrects reorgs per-block via signed `-1` rows. ### Multichain The template is chain-parametrized via the `chain` setting: point it at any supported EVM chain or Solana. On Solana, every SPL token transfer contributes `+1`; the `vendor_event_id` is widened to stay unique even where a log index repeats within an instruction, so per-token counts round-trip identically in shape. ### Related > [card] [Token Transfers](/data-feeds/templates/token/token-transfers) > > The per-event transfer ledger this counter is derived from. > [card] [Token Analytics](/data-feeds/use-cases/token-analytics) > > The use case per-token stats power. # Token Transfers Source: https://docs.moralis.com/data-feeds/templates/token/token-transfers Sync every ERC-20 token transfer, by token or by wallet, as a flat, ordered event log into your own database. ### Question it answers > "Give me every ERC-20 transfer: all transfers of token **0x…**, or every transfer wallet **0x…** sent or received." One flat event log of token transfers, served two ways from a single sync: **by-token** (every movement of a given token) and **by-wallet** (every transfer a wallet was on either side of). Each row is one transfer carrying exactly one token and one amount; there's no USD enrichment, because a transfer event carries no price. ### What you get One row per transfer, from Moralis-indexed, normalized per-block onchain data: | Column | Description | | - | - | | `token_address` | The transferred token's contract | | `from_address`, `to_address` | Sender and recipient | | `amount` | Raw `uint256` token units (not decimal-adjusted) | | `transfer_type` | Transfer kind as emitted (`erc20`, …) | | `initiated_by` | Address that initiated the transfer | | `block_number`, `log_index`, `transaction_index` | On-chain ordering tuple | | `tx_hash` | Transaction that produced the transfer | | `block_timestamp` / `event_ts` | Block time | ### Source The transform reads a single per-block array, `tokenTransfers`, and lands one row per transfer. Fields map straight from the source struct (`tokenAddress → token_address`, `fromAddress → from_address`, `toAddress → to_address`, `amount → amount`, `type → transfer_type`, `initiatedBy → initiated_by`). There's no price join: transfers are unpriced, so there is no `amount_usd` column. The per-transfer `vendor_event_id` is widened beyond `(tx_hash, log_index)` so the id stays unique on Solana, where `logIndex` is not row-unique within an instruction (see [Multichain](#multichain)). ### Destination | Destination | Table | Read pattern | | - | - | - | | **ClickHouse** (first-class) | `fact_token_transfers` | Prefix scan on `(chain_id, token_address, block_number)` for by-token; `bloom_filter` skip-indexes on `from_address` / `to_address` for by-wallet; read with `FINAL` or `sum(sign)` | | **Postgres** | `token_transfers` | Index on `(token_address, block_number DESC)`; plus `(from_address, …)` and `(to_address, …)` | | **MySQL** | `token_transfers` | Index on `(token_address, block_number)`; plus `(from_address, …)` and `(to_address, …)` | ClickHouse uses the collapsing log-table pattern (see the [templates overview](/data-feeds/templates/overview#destinations)) so chain reorganizations self-correct: the `+1/−1` reorg pair for a row shares an identical key and collapses on merge. The fact table's sort key is token-first, so all transfers of a token are a contiguous range read; by-wallet reads are accelerated by data-skipping bloom filters rather than a second sort key. ### Full schema Below is the complete read table this template produces. It's a starting point: keep the columns you need and drop the rest (see [Schema & flexibility](/data-feeds/templates/overview#schema--flexibility)). `amount` is stored raw (`uint256` token units) because the transfer event carries no decimals; scale by `10^token_decimals` at read time. > [accordion] ClickHouse, fact\_token\_transfers > > ```sql theme={null} > CREATE TABLE recipe_token_transfers.fact_token_transfers > ( > vendor_event_id String, > ingested_at DateTime64(3), > chain_id UInt32, > block_hash String, > block_number UInt64, > event_ts DateTime64(3), > token_address String, > from_address String, > to_address String, > amount String, -- raw uint256 token units > transfer_type LowCardinality(String), > initiated_by String, > tx_hash String, > log_index Nullable(UInt32), > transaction_index Nullable(Int32), > sign Int8, > -- by-wallet skip indexes: prune granules that cannot contain the wallet. > INDEX bf_from from_address TYPE bloom_filter(0.01) GRANULARITY 4, > INDEX bf_to to_address TYPE bloom_filter(0.01) GRANULARITY 4 > ) > ENGINE = ReplicatedCollapsingMergeTree( > '/clickhouse/tables/{database}/fact_token_transfers', '{replica}', sign) > PARTITION BY (chain_id, toYYYYMM(event_ts)) > ORDER BY (chain_id, token_address, block_number, vendor_event_id); > ``` > > The `sign` column drives reorg collapsing: read with `FINAL` or `sum(sign)`, never a bare `WHERE sign = 1`. A single-node setup can use `CollapsingMergeTree(sign)` without the replication path. > [accordion] Postgres, token\_transfers > > ```sql theme={null} > CREATE TABLE public.token_transfers ( > position BIGINT NOT NULL, > log_index BIGINT, > transaction_index BIGINT, > block_number BIGINT NOT NULL, > block_timestamp BIGINT NOT NULL, -- unix seconds > tx_hash TEXT NOT NULL, > vendor_event_id TEXT NOT NULL, > token_address TEXT NOT NULL, > from_address TEXT NOT NULL, > to_address TEXT NOT NULL, > amount NUMERIC(76, 0) NOT NULL, -- raw uint256 token units > transfer_type TEXT NOT NULL, > initiated_by TEXT NOT NULL > ); > > -- By-token access (the template's primary purpose). > CREATE INDEX IF NOT EXISTS token_transfers_token_block_idx > ON public.token_transfers (token_address, block_number DESC); > -- By-wallet access (either side). > CREATE INDEX IF NOT EXISTS token_transfers_from_block_idx > ON public.token_transfers (from_address, block_number DESC); > CREATE INDEX IF NOT EXISTS token_transfers_to_block_idx > ON public.token_transfers (to_address, block_number DESC); > -- Block-range helper. > CREATE INDEX IF NOT EXISTS token_transfers_block_idx > ON public.token_transfers (block_number); > ``` > > MySQL is the same shape with the same indexes. `amount` uses `NUMERIC(76, 0)` so large raw `uint256` values don't overflow; `position` is the block-level cursor used during backfill. ### Example reads All transfers of a token, newest first (ClickHouse): ```sql theme={null} SELECT block_number, from_address, to_address, amount, transfer_type, tx_hash FROM recipe_token_transfers.fact_token_transfers FINAL WHERE chain_id = 1 AND token_address = lower('0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48') ORDER BY block_number DESC LIMIT 50; ``` All transfers involving a wallet on either side (bloom-pruned): ```sql theme={null} SELECT block_number, token_address, from_address, to_address, amount FROM recipe_token_transfers.fact_token_transfers FINAL WHERE chain_id = 1 AND (from_address = lower('0x...') OR to_address = lower('0x...')) ORDER BY block_number DESC LIMIT 50; ``` Net amount received by a wallet for one token (sign-aware, cheaper than `FINAL`): ```sql theme={null} SELECT sumIf(toFloat64OrZero(amount), to_address = lower('0xwallet') AND sign = 1) - sumIf(toFloat64OrZero(amount), to_address = lower('0xwallet') AND sign = -1) AS received FROM recipe_token_transfers.fact_token_transfers WHERE chain_id = 1 AND token_address = lower('0xtoken'); ``` ### Modes Shipped defaults: **ClickHouse `hybrid`** (backfill → realtime), **Postgres / MySQL `historical`** (one-shot backfill). For live/reorg-safe ingestion, use ClickHouse; see the [overview](/data-feeds/templates/overview#modes). > [!NOTE] > > The realtime reorg path needs a single-column `UNIQUE` on the position column, but `position` is block-level (many transfers share one block), so array-expanded transfer rows can only carry a composite unique. Run realtime/hybrid on **ClickHouse**, where the collapsing log table corrects reorgs per-block. The Postgres / MySQL configs are intended for `historical` backfill. ### Multichain The template is chain-parametrized via the `chain` setting: point it at any supported EVM chain or Solana. On Solana, multiple events in one instruction can share a `logIndex`, so the `vendor_event_id` is widened with `(from_address, to_address, token_address, amount)` to keep rows distinct; the transfer log it produces is identical in shape. ### How much data does this consume? A continuous real-time feed centered on `tokenTransfers` measured: | Chain | Typical month (P50) | Busy month (P90) | | - | - | - | | Solana | **\~480 GB** | **\~590 GB** | | BNB Smart Chain | **\~210 GB** | **\~285 GB** | | Ethereum | **\~17 GB** | **\~23 GB** | Measured 2026-07-31, 30 sampled partitions per chain, `metered` delivery. Billing is on uncompressed bytes. The Ethereum and BNB Smart Chain runs included the small `tokenPriceUpdates` slice, so they run slightly high for a transfers-only feed; the Solana run included the `nftTokenTransfers` slice, which is negligible there. **Size your allowance against the busy figure, not the typical one.** Chain activity is bursty, and the same feed can land on either side of a fixed allowance depending on the month. Three caveats: * **Real-time only.** A historical backfill is billed separately and is usually the larger number; its size depends entirely on how far back you go. * **Measured chains only.** Volume concentrates hard per chain (BNB Smart Chain measured over 10x Ethereum on the same selection), so these figures do not extrapolate to unmeasured chains. * **Filtering does not reduce it.** Restricting to specific tokens or wallets happens after the data is delivered. To reduce cost, narrow the **block range**, not the entity set. If you want your exact scope measured before you commit to a plan, [reach out](https://admin.moralis.com/data-feeds) and we will probe it against the live feed rather than estimate it. ### Fidelity gaps The template lands exactly what the `tokenTransfers` array carries. Fields a transfers endpoint might surface that have **no onchain source in this array** are omitted: * **USD value**: a transfer carries no price. Pricing requires joining the same-block price data; that's out of scope for a plain transfer log (see Token Prices for the price-join pattern). * **Token metadata** (`symbol`, `name`, `decimals`, logo, verified/spam flags): these come from a separate token-metadata sync, not the transfer event. `amount` is therefore stored raw, not decimal-adjusted. * **Pre/post balances**: the balance surface lives in the balances templates (Token Balances by Token / by Wallet); this transfer log stays a flat event stream. ## Migrating from the REST API This template replaces both ERC-20 transfer REST endpoints from one sync: the same `token_transfers` table serves the by-token and by-wallet reads. > [!NOTE] > > **Not 1:1.** The REST responses inlined `token_name` / `token_symbol` / `token_decimals` and a pre-scaled `value_decimal`; this template's `amount` is raw `uint256`. Pair it with [Token Metadata](/data-feeds/templates/token/token-metadata) and join on `token_address` to scale amounts and label tokens. `token_logo`, `possible_spam`, `verified_contract`, `security_score`, and the address `*_label` / `*_entity` fields are off-chain signals; add them from your own token/label lists or drop them. Field mapping (both endpoints share it; **calculated** = derived at read time, **add yourself** = off-chain): | REST API field | Data Feeds | Fidelity | | - | - | - | | `from_address`, `to_address`, token contract | `token_transfers.from_address` / `to_address` / `token_address` | exact | | `value` (raw) | `token_transfers.amount` | exact | | `value_decimal` | `amount / 10^decimals` (decimals via Token Metadata) | calculated | | `transaction_hash` | `token_transfers.tx_hash` | exact | | `block_number`, `block_timestamp`, `block_hash`, `transaction_index`, `log_index` | `token_transfers.*` | exact | | `token_name`, `token_symbol`, `token_decimals` | join [Token Metadata](/data-feeds/templates/token/token-metadata) | exact | | `token_logo`, `possible_spam`, `verified_contract`, `security_score` | None | add yourself | | `from/to_address_label`, `*_entity`, `*_entity_logo` | None | add yourself | Neither endpoint returned USD values (a transfer carries no price), so every mapped value is exact from the chain, and the feed adds two fields the API omitted: `transfer_type` and `initiated_by`. ### `GET /erc20/{address}/transfers`: transfers by token Every transfer of one token becomes a plain by-token read of `token_transfers`, the table's primary sort, so it's a contiguous range scan: ```sql theme={null} SELECT t.*, t.amount / power(10, m.decimals) AS value_decimal FROM token_transfers t LEFT JOIN token_metadata m ON m.token_address = t.token_address WHERE t.token_address = lower('0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48') ORDER BY t.block_number DESC, t.log_index DESC LIMIT 100; ``` * The endpoint's `from_date` / `to_date`, `from_block` / `to_block`, and `order` params are plain `WHERE` / `ORDER BY` clauses; no fixed page size. * High-volume tokens have enormous histories: keyset-paginate on `(block_number, log_index)`, not `OFFSET`. * For a token's *complete* history, backfill from its deploy block (`historical` or `hybrid` mode); `realtime` alone only captures new transfers. ### `GET /{address}/erc20/transfers`: transfers by wallet A wallet's transfers are the rows where it appears on **either side**; the template indexes both `from_address` and `to_address`, so it's one query: ```sql theme={null} SELECT t.*, t.amount / power(10, m.decimals) AS value_decimal, CASE WHEN t.from_address = lower('0xwallet') THEN 'send' ELSE 'receive' END AS direction FROM token_transfers t LEFT JOIN token_metadata m ON m.token_address = t.token_address WHERE (t.from_address = lower('0xwallet') OR t.to_address = lower('0xwallet')) ORDER BY t.block_number DESC, t.log_index DESC LIMIT 100; ``` * In each row the `token_address` is the token, not the wallet; derive direction by comparing the wallet to `from_address` / `to_address`, as above. * The endpoint's `contract_addresses` filter becomes `AND t.token_address = ANY($tokens)`; block/date windows and `order` map the same way as by-token. * On ClickHouse the by-wallet read is served by the `bloom_filter` skip indexes on `from_address` / `to_address` (see [Example reads](#example-reads)) rather than a second sort key. ### Related > [card] [Token Holders](/data-feeds/templates/token/token-holders) > > The balance roll-up these transfers feed: all non-zero holders of a token. > [card] [Accounting & Tax](/data-feeds/use-cases/accounting) > > Per-asset transfer ledgers for reconciliation, valued via Token Prices. # Native Balances Source: https://docs.moralis.com/data-feeds/templates/wallet/native-balances Sync each wallet's current native-asset (ETH/MATIC/…) balance into your own database, kept current from per-block onchain data. Mirrors the Moralis GET /{address}/balance and GET /wallets/balances endpoints. ### Question it answers > "What is wallet **0x…**'s current native-asset (ETH / MATIC / …) balance?" Mirrors Moralis `GET /{address}/balance` and `GET /wallets/balances`. It is the native-asset analog of [Token Balances by Wallet](/data-feeds/templates/wallet/token-balances-by-wallet): each `nativeTransfers` event carries the absolute post-transfer native balance for both legs, so the latest observation per `(chain_id, wallet_address)` is the current balance, with no replaying of deltas. ### What you get The template lands **one row per balance observation**: each native transfer is unpivoted into two observations (the `from` leg and the `to` leg), each carrying that wallet's absolute native balance immediately after the transfer. There is **no `token_address` and no `token_id`**, because the native asset is implied by the chain. | Column | Description | | - | - | | `wallet_address` | The wallet whose post-transfer balance this row records | | `balance` | Absolute native balance after the transfer (raw `uint256`, in wei) | | `leg` | `from` or `to`: which side of the transfer produced this observation | | `block_number` | Block the transfer landed in | | `native_seq` | 1-based position of the transfer within the block's `nativeTransfers` array (the recency tiebreaker) | | `transaction_index` | Informational only (not unique per native transfer) | | `block_hash`, `event_ts` | Block hash and block time | | `vendor_event_id` | Stable per-observation identity | Current balance is **latest-wins**: the most recent observation by `(block_number, native_seq)` per wallet is the live balance. ### Source The transform reads one per-block array and unpivots it: `nativeTransfers` Each transfer becomes two observations: `(fromAddress, fromPostBalance)` and `(toAddress, toPostBalance)`. The zero address and empty post-balances are dropped, and `toAddress` (nullable on block-reward / fee-burn legs) is coalesced before those filters apply. ### Destination | Destination | Table | Read pattern | | - | - | - | | **ClickHouse** (first-class) | `fact_native_balances` | Prefix scan on `(chain_id, wallet_address, block_number, native_seq)`; current balance via `argMax` over `FINAL` | | **Postgres** | `native_balances` (materialized view over `native_balance_observations`) | Partial index `(wallet_address) WHERE balance > 0` | | **MySQL** | `native_balances` (trigger-maintained from `native_balance_observations`) | PK `(wallet_address)` | ClickHouse uses the collapsing log-table pattern (see the [templates overview](/data-feeds/templates/overview#destinations)) so chain reorganizations self-correct. The fact table's sort key is wallet-first, so a wallet's observations are a contiguous range read and `argMax` picks the live balance. Postgres collapses observations into a current-balance materialized view; MySQL keeps a trigger-maintained state table. ### Full schema Below is the complete read table this template produces: observations keyed by wallet. Keep the columns you need and drop the rest (see [Schema & flexibility](/data-feeds/templates/overview#schema--flexibility)). The raw `balance` is a `uint256` in wei and is stored as text (it exceeds numeric precision); divide by `10^18` (the native decimals) in your app to read whole units. > [accordion] ClickHouse, fact\_native\_balances > > ```sql theme={null} > CREATE TABLE recipe_native_balances.fact_native_balances > ( > vendor_event_id String, > ingested_at DateTime64(3), > chain_id UInt32, > block_hash String, > block_number UInt64, > transaction_index UInt32, -- informational only (not unique per native transfer) > native_seq UInt32, -- 1-based in-block ordinal; recency tiebreaker > event_ts DateTime64(3), > wallet_address String, > balance String, -- absolute post-transfer native balance, raw uint256 (wei) > leg LowCardinality(String), -- from | to > sign Int8 > ) > ENGINE = ReplicatedCollapsingMergeTree( > '/clickhouse/tables/{database}/fact_native_balances', '{replica}', sign) > PARTITION BY (chain_id, toYYYYMM(event_ts)) > ORDER BY (chain_id, wallet_address, block_number, native_seq, vendor_event_id, leg); > ``` > > The `sign` column drives reorg collapsing; read with `FINAL` + `argMax`, never a bare `WHERE sign = 1`. A single-node setup can use `CollapsingMergeTree(sign)` without the replication path. > [accordion] Postgres, native\_balances > > ```sql theme={null} > -- Observations (sink target). > CREATE TABLE public.native_balance_observations ( > position BIGINT NOT NULL, -- block-level backfill cursor > transaction_index BIGINT NOT NULL, -- informational only > native_seq BIGINT NOT NULL, -- 1-based in-block ordinal; recency tiebreaker > block_number BIGINT NOT NULL, > block_timestamp BIGINT NOT NULL, -- unix seconds > wallet_address TEXT NOT NULL, > balance NUMERIC(76, 0) NOT NULL, -- absolute native balance (wei) > leg TEXT NOT NULL, -- from | to > vendor_event_id TEXT NOT NULL > ); > > -- Recency index for the DISTINCT ON; leads with the DISTINCT ON key so > -- REFRESH MATERIALIZED VIEW CONCURRENTLY avoids a sort. > CREATE INDEX nbo_wallet_recency_idx > ON public.native_balance_observations > (wallet_address, block_number DESC, native_seq DESC); > > -- Current-balance materialized view: latest observation per wallet. > CREATE MATERIALIZED VIEW public.native_balances AS > SELECT DISTINCT ON (wallet_address) > wallet_address, balance, block_number, native_seq, transaction_index, block_timestamp > FROM public.native_balance_observations > ORDER BY wallet_address, block_number DESC, native_seq DESC; > > CREATE UNIQUE INDEX native_balances_pk ON public.native_balances (wallet_address); > > -- Active (non-zero) native balances — this template's primary access path. > CREATE INDEX native_balances_active_idx > ON public.native_balances (wallet_address) WHERE balance > 0; > -- Cleanup index for zeroed wallets. > CREATE INDEX native_balances_zero_cleanup_idx > ON public.native_balances (wallet_address) WHERE balance = 0; > ``` > > MySQL is the same shape with `DECIMAL(65,0)` for `balance` and a trigger-maintained `native_balances` state table (PK `wallet_address`, plus a `DELETE … WHERE balance = 0` cleanup). `position` is the block-level cursor used during backfill. Refresh the Postgres view on a schedule: `REFRESH MATERIALIZED VIEW CONCURRENTLY native_balances;`. ### Example reads Current native balance for a wallet (ClickHouse; `argMax` picks the latest observation): ```sql theme={null} SELECT argMax(balance, (block_number, native_seq)) AS current_balance FROM recipe_native_balances.fact_native_balances FINAL WHERE chain_id = 1 AND wallet_address = lower('0x...') GROUP BY wallet_address HAVING current_balance != '0' AND current_balance != ''; ``` All current non-zero native balances (mirrors `GET /wallets/balances`): ```sql theme={null} SELECT wallet_address, argMax(balance, (block_number, native_seq)) AS current_balance FROM recipe_native_balances.fact_native_balances FINAL WHERE chain_id = 1 GROUP BY wallet_address HAVING current_balance != '0' AND current_balance != '' ORDER BY wallet_address; ``` Postgres: current balance for one wallet, after a refresh: ```sql theme={null} REFRESH MATERIALIZED VIEW CONCURRENTLY native_balances; SELECT balance FROM public.native_balances WHERE wallet_address = lower('0x...'); ``` ### Modes Shipped defaults: **ClickHouse `hybrid`** (backfill → realtime), **Postgres / MySQL `historical`** (one-shot backfill). For live/reorg-safe ingestion, use ClickHouse; see the [overview](/data-feeds/templates/overview#modes). > [!NOTE] > > The backfill cursor (`position`) is block-level, so realtime/hybrid on Postgres / MySQL is constrained by their single-column `UNIQUE` requirement. Run realtime/hybrid on ClickHouse; the Postgres / MySQL configs target `historical` backfill. ### Multichain The template is chain-parametrized via the `chain` setting: point it at any supported EVM chain or Solana. On Solana, the `vendor_event_id` already folds in `(transactionIndex, fromAddress, toAddress, amount, 'native')`, so observations stay row-unique even where Solana repeats indices within a transaction. The balance surface it produces is identical in shape. ### Recency: why `native_seq`, not `log_index` `nativeTransfers` carry **no `logIndex`**, and `transactionIndex` is **not unique** per transfer (a single transaction with several internal native movements reuses it). "Which post-balance is current" is therefore tiebroken by **`native_seq`**, the 1-based position of each transfer within the block's `nativeTransfers` array. It is a stable block-global ordinal emitted in canonical order and computed once in the shared transform, so ClickHouse `argMax`, Postgres `DISTINCT ON`, and the MySQL trigger all converge on the same current balance per wallet. ### Fidelity gaps * **No USD value.** Moralis `GET /{address}/balance` can return a USD-valued balance; that needs the native-asset/USD price at the block, which is not carried on `nativeTransfers`. Join against a native-price source (e.g. the wrapped-native pair from a [Token Prices](/data-feeds/templates/token/token-prices) sync) to add it. * **Raw wei, no decimals scaling.** `balance` is the raw `uint256` in wei; divide by `10^18` in your app to read whole native units. ## Migrating from the REST API ``` GET /:address/balance ``` This template replaces the endpoint on its own: the latest observation per wallet **is** the response's `balance`, exact and straight from the chain, with no other template required. `GET /wallets/balances` is the same read across many wallets. Two workflow changes: you query your own table instead of calling an endpoint, and you must **backfill history first**: a wallet only has a row once it appears in a native transfer within your indexed range, so run the template `historical` or `hybrid` from an early block (see [History & backfill](/data-feeds/concepts/history-and-backfill)). Set up the sink via the [quickstart](/data-feeds/migration/quickstart), then read the current balance as shown in [Example reads](#example-reads) above. **Field mapping** | `/:address/balance` | Data Feeds | Fidelity | | - | - | - | | `balance` (raw wei) | `native_balances.balance` | exact | | `balance_formatted` | derive: `balance / 1e18` | exact | **Good to know** * **Exact and single-valued.** Nothing off-chain and nothing to price here. * **Raw wei.** Divide by `10^18` in your app for whole native units. * **USD value is not included.** Multiply by the native asset's price, e.g. the wrapped-native pair from a [Token Prices](/data-feeds/templates/token/token-prices) sync. * **Freshness.** Postgres / MySQL configs target one-shot `historical` state; use ClickHouse for realtime / `hybrid`. ### Related > [card] [Token Balances by Wallet](/data-feeds/templates/wallet/token-balances-by-wallet) > > The ERC-20 sibling: every token a wallet holds, with balance. > [card] [Portfolio Tracking](/data-feeds/use-cases/portfolio-tracking) > > Native balances are the base-asset leg of a wallet's portfolio. # NFTs by Wallet Source: https://docs.moralis.com/data-feeds/templates/wallet/nfts-by-wallet Sync every NFT a wallet currently holds (collection, token ID, contract type, and balance) as a continuously updated holdings table in your own database. Mirrors the Moralis GET /{address}/nft endpoint. ### Question it answers > "Give me every NFT wallet **0x…** currently holds. Each row is a `(collection, token_id)` it owns, with the ERC-721/ERC-1155 contract type and current balance." Mirrors Moralis `GET /{address}/nft`. It's the NFT-keyed sibling of [Token Balances by Wallet](/data-feeds/templates/wallet/token-balances-by-wallet): the same observation/latest-wins pattern, but sourced from NFT transfers and keyed on `(wallet, token_address, token_id)` instead of `(wallet, token_address)`. ### What you get The template lands **NFT holding observations**, then the current holding is the latest non-zero observation per `(wallet, token_address, token_id)`. Each NFT transfer carries the **absolute post-transfer holdings** of each side (`from`/`to`), so the template never has to sum a running balance; the latest observation *is* the balance. | Column | Description | | - | - | | `wallet_address` | The holder (the `from` or `to` side of a transfer) | | `token_address` | The NFT contract (collection) | | `token_id` | The NFT identifier, a `uint256`, stored as text (it exceeds numeric precision) | | `contract_type` | `ERC721` or `ERC1155` discriminator (from the transfer's token type) | | `balance` | Absolute post-transfer holding of this `token_id` for this wallet (`1`/`0` for ERC-721, a count for ERC-1155) | | `block_number`, `log_index` | Ordering tuple, the latest pair wins as the current holding | | `event_ts` / `block_timestamp` | Block time | The EVM zero address (`0x0000…0000`) is a mint/burn counterparty, not a holder, so it's excluded. Observations with an empty post-balance string are filtered so the balance column never receives `''`. ### Source The transform reads one per-block array and unpivots each transfer into two per-wallet observations: `nftTokenTransfers` Each transfer becomes `(from_address, from_post_balance)` and `(to_address, to_post_balance)`. `from_post_balance` / `to_post_balance` are the absolute post-transfer holdings of that wallet for the given `(token_address, token_id)`, so the latest observation with a non-zero balance is a current holding. ### Destination | Destination | Table | Read pattern | | - | - | - | | **ClickHouse** (first-class) | `fact_wallet_nfts` | Prefix scan on `(chain_id, wallet_address, token_address, token_id, …)`; current holding via `argMax` over `FINAL` | | **Postgres** | `wallet_nfts` (materialized view over `wallet_nft_observations`) | Partial index `(wallet_address, token_address, token_id) WHERE balance > 0` | | **MySQL** | `wallet_nfts` | PK `(wallet_address, token_address, token_id)` with zeroed positions cleaned up | ClickHouse uses the collapsing log-table pattern (see the [templates overview](/data-feeds/templates/overview#destinations)) so chain reorganizations self-correct. The fact table's sort key is wallet-first, so a wallet's full holdings set is a contiguous range read; `argMax` over `(block_number, log_index)` resolves the current balance per id. On Postgres/MySQL the current-holding table is derived by keeping the latest observation per `(wallet, token_address, token_id)`. ### Full schema Below is the complete read table this template produces. It's a starting point, keep the columns you need and drop the rest (see [Schema & flexibility](/data-feeds/templates/overview#schema--flexibility)). `token_id` is a `uint256` identifier stored as text (never numeric, ERC-1155/721 ids exceed any practical numeric precision), and `balance` is the absolute post-transfer holding. > [accordion] ClickHouse, fact\_wallet\_nfts > > ```sql theme={null} > CREATE TABLE recipe_wallet_nfts.fact_wallet_nfts > ( > vendor_event_id String, > ingested_at DateTime64(3), > chain_id UInt32, > block_hash String, > block_number UInt64, > log_index UInt32, > event_ts DateTime64(3), > token_address String, > token_id String, -- uint256 id → String, not numeric > contract_type LowCardinality(String), -- ERC721 | ERC1155 > wallet_address String, > balance String, -- absolute post-transfer holding > leg LowCardinality(String), -- from | to > sign Int8 > ) > ENGINE = ReplicatedCollapsingMergeTree( > '/clickhouse/tables/{database}/fact_wallet_nfts', '{replica}', sign) > PARTITION BY (chain_id, toYYYYMM(event_ts)) > ORDER BY (chain_id, wallet_address, token_address, token_id, block_number, log_index, vendor_event_id, leg); > ``` > > The `sign` column drives reorg collapsing, read with `FINAL` then `argMax`, or a sign-aware aggregate, never a bare `WHERE sign = 1`. A single-node setup can use `CollapsingMergeTree(sign)` without the replication path. > [accordion] Postgres, wallet\_nfts > > ```sql theme={null} > -- 1. Observations (sink target). Latest per key wins as the current holding. > CREATE TABLE public.wallet_nft_observations ( > position BIGINT NOT NULL, > log_index BIGINT NOT NULL, > block_number BIGINT NOT NULL, > block_timestamp BIGINT NOT NULL, -- unix seconds > token_address TEXT NOT NULL, > token_id TEXT NOT NULL, -- uint256 id → TEXT, not numeric > contract_type TEXT NOT NULL, -- ERC721 | ERC1155 > wallet_address TEXT NOT NULL, > balance NUMERIC(76, 0) NOT NULL, -- absolute post-balance of the id > leg TEXT NOT NULL, > vendor_event_id TEXT NOT NULL > ); > > -- Recency index: leads with the DISTINCT ON keys so REFRESH avoids a sort. > CREATE INDEX wno_wallet_token_id_recency_idx > ON public.wallet_nft_observations > (wallet_address, token_address, token_id, block_number DESC, log_index DESC); > > -- 2. Current-holding view: latest observation per (wallet, token, token_id). > CREATE MATERIALIZED VIEW public.wallet_nfts AS > SELECT DISTINCT ON (wallet_address, token_address, token_id) > wallet_address, token_address, token_id, contract_type, > balance, block_number, log_index, block_timestamp > FROM public.wallet_nft_observations > ORDER BY wallet_address, token_address, token_id, block_number DESC, log_index DESC; > > CREATE UNIQUE INDEX wallet_nfts_pk > ON public.wallet_nfts (wallet_address, token_address, token_id); > > -- Primary access path: NFTs currently held by a wallet. > CREATE INDEX wallet_nfts_active_idx > ON public.wallet_nfts (wallet_address, token_address, token_id) > WHERE balance > 0; > > -- Sibling access path: all current holders of a given NFT id. > CREATE INDEX wallet_nfts_by_token_active_idx > ON public.wallet_nfts (token_address, token_id, wallet_address) > WHERE balance > 0; > > -- Cleanup index for zeroed (no-longer-held) positions. > CREATE INDEX wallet_nfts_zero_cleanup_idx > ON public.wallet_nfts (wallet_address, token_address, token_id) > WHERE balance = 0; > ``` > > Refresh the current-holding view on a schedule with `REFRESH MATERIALIZED VIEW CONCURRENTLY wallet_nfts;`. MySQL is the same shape with a trigger-maintained `wallet_nfts` table and a `DELETE … WHERE balance = 0` cleanup. `position` is the block-level cursor used during backfill. ### Example reads Every NFT a wallet currently holds, latest non-zero post-balance per id (ClickHouse): ```sql theme={null} SELECT token_address, token_id, contract_type, argMax(balance, (block_number, log_index)) AS amount FROM recipe_wallet_nfts.fact_wallet_nfts FINAL WHERE chain_id = 1 AND wallet_address = lower('0x...') GROUP BY token_address, token_id, contract_type HAVING amount != '0' AND amount != '' ORDER BY token_address, token_id; ``` The same holdings read on Postgres (after refreshing the view): ```sql theme={null} REFRESH MATERIALIZED VIEW CONCURRENTLY wallet_nfts; SELECT token_address, token_id, contract_type, balance FROM public.wallet_nfts WHERE wallet_address = lower('0x...') AND balance > 0 ORDER BY token_address, token_id; ``` ### Modes Shipped defaults: **ClickHouse `hybrid`** (backfill → realtime), **Postgres / MySQL `historical`** (one-shot backfill). For live/reorg-safe ingestion, use ClickHouse, see the [overview](/data-feeds/templates/overview#modes). > [!NOTE] > > `position` is block-level, so realtime/hybrid on Postgres/MySQL is constrained by their single-column `UNIQUE` requirement. Run realtime/hybrid on **ClickHouse**; the Postgres/MySQL configs target `historical` backfill. ### Multichain The template is chain-parametrized via the `chain` setting, point it at any supported EVM chain or Solana. NFTs on Solana are emitted on `nftTokenTransfers` too; the `vendor_event_id` identity already includes `(from, to, token, tokenId, amount)` so each row stays unique under Solana's repeated log indices. The holdings table it produces is identical in shape. ### Fidelity gaps `GET /{address}/nft` returns collection and metadata fields that have **no source in this per-block stream**, so they are intentionally not populated: * `name`, `symbol`, NFT contract name/symbol. Enrich downstream from a contract-metadata table if you need them. * `token_uri`, `metadata`, `normalized_metadata`, per-token metadata fetched from the token URI by a separate indexer; not in block data. * `owner_of`: the API echoes the queried wallet; here it is the `wallet_address` holding key. * `block_number_minted`, `minter_address`, `possible_spam`, `verified_collection`, `collection_logo`, `floor_price*`, `rarity*`, enrichment from separate indexers / pricing services, with no per-block source. Core holding fields, `token_address`, `token_id`, `contract_type`, `balance`, owner (via `wallet_address`), and block coordinates, are fully populated. ## Migrating from the REST API This template is the landing point for two wallet-NFT REST endpoints. In both cases the onchain holding is exact; the metadata, spam, and pricing layers the API bundled in are separate templates or your own sources. ### GET /:address/nft ``` GET /:address/nft ``` This template replaces it directly: one current row per `(wallet, token_address, token_id)` with a non-zero balance is exactly the holdings list the endpoint returned. > [!NOTE] > > **Not 1:1**, the full response spans two templates. This template supplies the holdings; join [NFT Collection Metadata](/data-feeds/templates/nft/nft-collection-metadata) (`nft_collection_metadata`, keyed by `token_address`) for `name`/`symbol`. Token-level metadata (`token_uri`, `metadata`, media) is resolved off-chain from each token's URI and is not in any per-block feed, you fetch it yourself or layer in a metadata source. | `/:address/nft` field | Here | Fidelity | | - | - | - | | `token_address`, `token_id`, `contract_type` | same columns | exact | | `amount` | `balance` | exact | | `owner_of` | `wallet_address` (the query key) | exact | | `block_number` | `block_number` | exact | | `name`, `symbol` | `nft_collection_metadata.*` | exact | | `token_hash` | derive (hash of contract + token\_id) | exact | | `token_uri`, `metadata`, `normalized_metadata`, `media` | resolve from the token URI | add yourself | | `rarity_*`, `floor_price*`, `last_sale`, `list_price` | marketplace/rarity data ([NFT Trades](/data-feeds/templates/nft/nft-trades) for realized sales) | add yourself | | `possible_spam`, `verified_collection`, collection art | your own lists / sources | add yourself | | `block_number_minted`, `minter_address`, `*_sync` | indexer-derived | add yourself | The endpoint response, as one query (Postgres table names; keyset pagination on `(token_address, token_id)` replaces the old cursor): ```sql theme={null} SELECT n.token_address, n.token_id, n.contract_type, n.balance AS amount, m.name, m.symbol FROM wallet_nfts n LEFT JOIN nft_collection_metadata m ON m.token_address = n.token_address WHERE n.wallet_address = lower('0x...') AND n.balance > 0 ORDER BY n.token_address, n.token_id LIMIT 100; ``` Gotchas: * **Backfill full history.** Holdings are current state, a wallet can still hold an NFT it last moved years ago, so run `historical`/`hybrid` from an early block. Only tracking specific collections? Filter to those `token_addresses` and start from each collection's first block. See [History & backfill](/data-feeds/concepts/history-and-backfill). * **No fixed spam filter.** The old `exclude_spam` was off-chain curation; it becomes your own `WHERE` against your own lists. * **ERC-1155 `amount` is a real count**, not always `1`, the `balance` column carries it. * **Empty `name`/`symbol` is normal** for many ERC-1155 (and some ERC-721) collections; it isn't an error. ### GET /:address/nft/collections ``` GET /:address/nft/collections ``` There is no separate collections dataset, this endpoint is a **`GROUP BY` rollup of this template's holdings table**. If you've built the per-NFT query above, the collection list is one more query over the same tables. > [!NOTE] > > **Not 1:1**, combine this template (holdings to group) with [NFT Collection Metadata](/data-feeds/templates/nft/nft-collection-metadata) for `name`/`symbol`, and optionally [NFT Trades](/data-feeds/templates/nft/nft-trades) if you want `last_sale` from realized onchain sales. | `/:address/nft/collections` field | Here | Fidelity | | - | - | - | | `token_address`, `contract_type` | same columns (grouped) | exact | | `count` | `count(*)` over held token\_ids | exact | | `name`, `symbol` | `nft_collection_metadata.*` | exact | | `last_sale` (sale facts) | `nft_trades` | exact | | `last_sale` USD values | `nft_trades` + price feed | calculated | | `possible_spam`, `verified_collection` | your own lists | add yourself | | `collection_logo`, `collection_banner_image`, `floor_price*` | your own sources | add yourself | The rollup: ```sql theme={null} SELECT n.token_address, n.contract_type, m.name, m.symbol, count(*) AS count -- token_ids held in this collection FROM wallet_nfts n LEFT JOIN nft_collection_metadata m ON m.token_address = n.token_address WHERE n.wallet_address = lower('0x...') AND n.balance > 0 GROUP BY n.token_address, n.contract_type, m.name, m.symbol ORDER BY count DESC; ``` Gotchas: * **ERC-1155 `count`.** `count(*)` counts distinct token\_ids (matches the old endpoint); swap in `sum(balance)` to count units instead, a one-word change. * **Same full-history requirement** as the per-NFT endpoint: start the backfill late and the rollup silently misses collections. * **`last_sale` USD is calculated** from real trades plus a price feed, compare with a small tolerance, not an identical figure. * **Floor price, logo, banner are off-chain**: layer them in from your own sources keyed by `token_address`, or drop them. ### Related > [card] [Token Balances by Wallet](/data-feeds/templates/wallet/token-balances-by-wallet) > > The ERC-20 sibling, same latest-wins pattern, keyed by (wallet, token). > [card] [NFT Owners by Contract](/data-feeds/templates/nft/nft-owners-by-contract) > > The inverse view, all current holders of a collection. > [card] [Portfolio Tracking](/data-feeds/use-cases/portfolio-tracking) > > Wallet holdings across tokens and NFTs in one owned dataset. > [card] [NFT Marketplace](/data-feeds/use-cases/nft-marketplace) > > Per-wallet NFT inventory behind a marketplace. # Token Approvals Source: https://docs.moralis.com/data-feeds/templates/wallet/token-approvals Sync the current ERC-20 allowances a wallet has granted, and to whom, as a continuous, reorg-safe feed into your own database. Mirrors the Moralis GET /wallets/{address}/approvals endpoint. ### Question it answers > "What ERC-20 allowances has wallet **0x…** granted, and to whom?" Mirrors Moralis `GET /wallets/{address}/approvals`. Each ERC-20 `Approval(owner, spender, value)` log is one approval event. The **current allowance** for an `(owner, token, spender)` triple is the latest approval by `(block_number, log_index)`, a fresh `approve` overwrites the prior allowance (latest-wins, the same machinery as the balances templates). A revoke is just `approve(spender, 0)`, so it lands as a new event whose value is `'0'`. ### What you get One row per approval event, keyed by the approving wallet (`owner_address`). The **current** allowance for a triple is the latest event, resolved with `argMax` (ClickHouse) or a latest-wins projection (Postgres / MySQL): | Column | Description | | - | - | | `owner_address` | The approving wallet (the `owner` on the `Approval` log) | | `spender_address` | The address authorized to spend | | `token_address` | The ERC-20 token the allowance is for | | `value` | The raw allowance amount, stored as text (an unlimited approve is `type(uint256).max`, 78 digits) | | `block_number`, `log_index` | On-chain ordering tuple; the latest pair per triple wins | | `tx_hash` | Transaction that produced the approval | | `event_ts` / `block_timestamp` | Block time | Compare `value` against `'0'` for the revoked / non-revoked distinction; do any arbitrary-precision arithmetic in your application layer. ### Source The transform reads a single per-block array and lands one row per approval log: `tokenApprovals` The struct carries `approverAddress` (→ `owner_address`), `spenderAddress`, `tokenAddress`, and `amount` (→ `value`); `block_number` and `block_timestamp` come from the block envelope. ### Destination | Destination | Table | Read pattern | | - | - | - | | **ClickHouse** (first-class) | `fact_token_approvals` | Prefix scan on `(chain_id, owner_address, token_address, spender_address, …)`; current allowance via `argMax(value, (block_number, log_index))` over `FINAL` | | **Postgres** | `token_approval_events` + `token_allowances` materialized view | Partial index `(owner_address, token_address, spender_address) WHERE value <> '0'` | | **MySQL** | `token_approval_events` + maintained `token_allowances` state table | PK `(owner_address, token_address, spender_address)` with `value = '0'` cleanup | ClickHouse uses the collapsing log-table pattern (see the [templates overview](/data-feeds/templates/overview#destinations)) so chain reorganizations self-correct. The fact table's sort key is owner-first, so "all allowances granted by owner Y" is a contiguous range read. Postgres keeps a flat event table plus a `token_allowances` materialized view (latest approve per triple, refreshed on a schedule); MySQL keeps the same event table plus a latest-wins state table. ### Full schema Below is the complete read table this template produces, keep the columns you need and drop the rest (see [Schema & flexibility](/data-feeds/templates/overview#schema--flexibility)). The raw allowance `value` is stored as text on all three destinations: an unlimited approve uses `type(uint256).max` (78 digits), which overflows Postgres `NUMERIC(76,0)` and MySQL `DECIMAL(65,0)`. > [accordion] ClickHouse, fact\_token\_approvals > > ```sql theme={null} > CREATE TABLE recipe_token_approvals.fact_token_approvals > ( > vendor_event_id String, > ingested_at DateTime64(3), > chain_id UInt32, > block_hash String, > block_number UInt64, > log_index UInt32, > event_ts DateTime64(3), > tx_hash String, > token_address String, > owner_address String, > spender_address String, > value String, -- raw allowance; unlimited approve = uint256 max (78 digits) > sign Int8 > ) > ENGINE = ReplicatedCollapsingMergeTree( > '/clickhouse/tables/{database}/fact_token_approvals', '{replica}', sign) > PARTITION BY (chain_id, toYYYYMM(event_ts)) > ORDER BY (chain_id, owner_address, token_address, spender_address, block_number, log_index, vendor_event_id); > ``` > > The `sign` column drives reorg collapsing. Read the current allowance with `argMax(value, (block_number, log_index))` over `FINAL`, never a bare `WHERE sign = 1`. A single-node setup can use `CollapsingMergeTree(sign)` without the replication path. > [accordion] Postgres, token\_approval\_events + token\_allowances > > ```sql theme={null} > -- 1. Approval events (sink target) — one row per Approval log. > CREATE TABLE public.token_approval_events ( > position BIGINT NOT NULL, > log_index BIGINT NOT NULL, > block_number BIGINT NOT NULL, > block_timestamp BIGINT NOT NULL, -- unix seconds > tx_hash TEXT NOT NULL, > token_address TEXT NOT NULL, > owner_address TEXT NOT NULL, > spender_address TEXT NOT NULL, > value TEXT NOT NULL, -- allowance; max-uint = 78 digits > vendor_event_id TEXT NOT NULL > ); > > -- Recency index leading with the DISTINCT ON keys so REFRESH avoids a sort. > CREATE INDEX tae_owner_token_spender_recency_idx > ON public.token_approval_events > (owner_address, token_address, spender_address, block_number DESC, log_index DESC); > > -- 2. Current-allowance materialized view: latest approve per (owner, token, spender). > CREATE MATERIALIZED VIEW public.token_allowances AS > SELECT DISTINCT ON (owner_address, token_address, spender_address) > owner_address, token_address, spender_address, > value, tx_hash, block_number, log_index, block_timestamp > FROM public.token_approval_events > ORDER BY owner_address, token_address, spender_address, block_number DESC, log_index DESC; > > CREATE UNIQUE INDEX token_allowances_pk > ON public.token_allowances (owner_address, token_address, spender_address); > > -- Primary access path: all live allowances granted by an owner. > CREATE INDEX token_allowances_by_owner_active_idx > ON public.token_allowances (owner_address, token_address, spender_address) > WHERE value <> '0'; > > -- Sibling access path: who can spend a given token on behalf of others. > CREATE INDEX token_allowances_by_spender_idx > ON public.token_allowances (spender_address, token_address); > ``` > > MySQL is the same shape with `VARCHAR(80)` for `value` and a trigger-maintained `token_allowances` state table doing the latest-wins upsert. `position` is the block-level cursor used during backfill. ### Example reads All current allowances granted by an owner, latest approve per token + spender, dropping revoked (`'0'`) rows (ClickHouse): ```sql theme={null} SELECT token_address, spender_address, argMax(value, (block_number, log_index)) AS current_allowance FROM recipe_token_approvals.fact_token_approvals FINAL WHERE chain_id = 1 AND owner_address = lower('0x...') GROUP BY token_address, spender_address HAVING current_allowance != '0' AND current_allowance != '' ORDER BY token_address, spender_address; ``` Postgres, refresh the projection, then read the live allowances: ```sql theme={null} REFRESH MATERIALIZED VIEW CONCURRENTLY token_allowances; SELECT token_address, spender_address, value FROM public.token_allowances WHERE owner_address = lower('0x...') AND value <> '0' ORDER BY token_address, spender_address; ``` ### Modes Shipped defaults: **ClickHouse `hybrid`** (backfill → realtime), **Postgres / MySQL `historical`** (one-shot backfill). For live/reorg-safe ingestion, use ClickHouse, see the [overview](/data-feeds/templates/overview#modes). > [!NOTE] > > Realtime / hybrid on Postgres / MySQL is constrained: the block-level cursor means array-expanded approval rows share a `position`, which collides with the single-column `UNIQUE` requirement. Run realtime / hybrid on **ClickHouse**, which corrects reorgs per-block via the collapsing log table; the Postgres / MySQL configs target `historical` backfill. ### EVM only `tokenApprovals` is an EVM ERC-20 `Approval` log array. SPL token delegation on Solana is a different model and is not emitted into this array. ### Fidelity gaps On-chain primitives, owner, spender, token, raw allowance value, block, and tx hash, are fully covered. Response fields of `GET /wallets/{address}/approvals` with no on-chain source are intentionally omitted: * `value_formatted`: needs token `decimals`; scale `value` by `10^token_decimals` using a Token Metadata sync. * `token.name` / `token.symbol` / `token.logo` / `token.decimals`, token metadata, not in `tokenApprovals`. * `spender.entity` / `spender.entity_logo` / `spender.address_label`, off-chain spender labelling. ## Migrating from the REST API ``` GET /wallets/:address/approvals ``` The **active allowance set**, allowance value, spender, token address, block and tx, comes from this template directly: the latest approve per `(owner, token, spender)` wins, and revokes (approve-to-zero) drop out. The rest of the endpoint's response (token metadata, wallet balance, USD figures) does not live on the `Approval` log, you rebuild it with joins. > [!NOTE] > > **This endpoint needs four templates.** Data Feeds are not 1:1 endpoint replicas, to reproduce the full response, run these together and join their tables yourself (query below): > > * **Token Approvals** (this page), allowance, spender, token address, block / tx > * [Token Metadata](/data-feeds/templates/token/token-metadata): `token.name`, `token.symbol`, `decimals` for `value_formatted` > * [Token Balances by Wallet](/data-feeds/templates/wallet/token-balances-by-wallet): the wallet's current balance of each approved token > * [Token Prices](/data-feeds/templates/token/token-prices): `usd_price`, and `usd_at_risk` derived from it **Field mapping**, **exact** comes from the chain, **calculated** is derived from real onchain trades (very close; compare with a small tolerance), **add yourself** is an off-chain signal: | `/wallets/:address/approvals` | Data Feeds | Fidelity | | - | - | - | | `value` (allowance) | `token_allowances.value` | exact | | `value_formatted` | derive: `value / 10^decimals` | exact | | `block_number`, `block_timestamp`, `transaction_hash` | `token_allowances.*` | exact | | `spender.address` | `token_allowances.spender_address` | exact | | `token.address` | `token_allowances.token_address` | exact | | `token.name`, `token.symbol` | token metadata sync | exact | | `token.current_balance(_formatted)` | token balances sync | exact | | `token.usd_price` | latest price update | calculated | | `token.usd_at_risk` | derive: `min(allowance, balance) × price` | calculated | | `token.logo`, `possible_spam`, `verified_contract`, `address_label` | add yourself | off-chain | | `spender.address_label`, `entity`, `entity_logo` | add yourself | off-chain | **The join** (Postgres; table names follow each template's default schema), one view that reproduces the response, with `usd_at_risk` computed the realistic way (`min(allowance, balance) × price`, a spender can't take more than the wallet holds): ```sql theme={null} CREATE VIEW wallet_approvals AS SELECT a.owner_address AS wallet_address, a.token_address, a.spender_address, m.name, m.symbol, a.value AS allowance, a.value / power(10, m.decimals) AS value_formatted, b.balance AS current_balance, p.usd_price, least(a.value, coalesce(b.balance, 0)) / power(10, m.decimals) * p.usd_price AS usd_at_risk, a.block_number, a.block_timestamp, a.tx_hash FROM token_allowances a LEFT JOIN token_metadata m ON m.token_address = a.token_address LEFT JOIN token_balances b ON b.token_address = a.token_address AND b.wallet_address = a.owner_address LEFT JOIN LATERAL ( SELECT usd_price FROM token_price_updates WHERE token_address = a.token_address ORDER BY block_number DESC LIMIT 1 ) p ON true; ``` Query it per wallet with `ORDER BY usd_at_risk DESC NULLS LAST` so the riskiest approvals surface first. **Good to know** * **Backfill full history first.** The latest approve for a triple can sit at any past block, run `historical` / `hybrid` from an early block or you'll miss or misstate allowances ([History & backfill](/data-feeds/concepts/history-and-backfill)). * **Unlimited approvals** show as a max-uint `value` (78 digits, stored as text). Lead with `usd_at_risk`, it caps the scary figure to what the wallet actually holds. * **Revokes disappear automatically** (an approve to zero), so you always see the live, active set. * **Compare USD figures with a tolerance**: prices come from real DEX trades, not the REST API's pricing. * **Real-time is the strength here.** Stream the `tokenApprovals` feed (Kafka / AMQP / SQS) to alert the moment a risky allowance is granted, instead of polling. ### Related > [card] [Wallet History](/data-feeds/templates/wallet/wallet-history) > > The full chronological event feed, approvals included alongside transfers and swaps. > [card] [Compliance & AML](/data-feeds/use-cases/compliance-aml) > > Outstanding allowances are a core risk surface for wallet monitoring. # Token Balances by Wallet Source: https://docs.moralis.com/data-feeds/templates/wallet/token-balances-by-wallet Sync every ERC-20 token a wallet holds, with its current non-zero balance, into your own database: a portfolio lookup that's a single prefix scan. ### Question it answers > "Give me every token wallet **0x…** holds, with its current non-zero balance." This is the by-wallet portfolio read. It's the same ingest as Token Balances by Token, sorted the other way: this template keys **wallet-first** so one wallet's full token holdings are a contiguous range read, while the sibling keys token-first to list a token's holders. ### What you get The template lands **one balance observation per wallet, per transfer leg**. Each `token_transfer` carries absolute post-transfer balances (`from_post_balance` / `to_post_balance`), so every transfer becomes two observations: one for the sender, one for the receiver. The **latest observation per `(wallet, token)`** is the current balance ("latest-wins"). | Column | Description | | - | - | | `chain_id` | Chain identifier | | `wallet_address` | The holder (leading sort key) | | `token_address` | The ERC-20 contract | | `balance` | Absolute post-transfer balance for this wallet, raw `uint256` (the latest per `(wallet, token)` is the current balance) | | `leg` | `from` or `to`: which side of the transfer produced this observation | | `block_number`, `log_index` | On-chain ordering tuple; picks the latest observation | | `event_ts` | Block time | | `vendor_event_id` | Stable per-observation identity (keeps rows unique) | The zero address is excluded, so a token's balance going to `0` on a full transfer-out is a real observation you read as the current state, not a missing row. ### Source The transform reads one per-block array, `tokenTransfers`, and unpivots each transfer into two per-wallet observations: `(from_address, from_post_balance)` and `(to_address, to_post_balance)`. Because the source supplies **absolute** post-balances on each transfer, there's no running-sum reconstruction: the latest observation is the balance. ### Destination | Destination | Table | By-wallet access | | - | - | - | | **ClickHouse** (first-class) | `fact_balances_by_wallet` | Prefix scan on `(chain_id, wallet_address, token_address, …)`; current balance via `argMax` over `FINAL` | | **Postgres** | `token_balances` (materialized view over `token_balance_observations`) | Partial index `(wallet_address, token_address) WHERE balance > 0` | | **MySQL** | `token_balances` (trigger-maintained over `token_balance_observations`) | PK `(wallet_address, token_address)` + `DELETE … WHERE balance = 0` cleanup | ClickHouse uses the collapsing log-table pattern (see the [templates overview](/data-feeds/templates/overview#destinations)) so chain reorganizations self-correct. The fact table's sort key is wallet-first, so a wallet's holdings are a contiguous range read; you collapse to the current balance per token with `argMax` over `FINAL`. ### Full schema Below is the complete read table this template produces. It's a starting point: keep the columns you need and drop the rest (see [Schema & flexibility](/data-feeds/templates/overview#schema--flexibility)). Raw `uint256` balances are stored as text (ClickHouse) or `NUMERIC(76, 0)` (Postgres) so they never overflow. > [accordion] ClickHouse, fact\_balances\_by\_wallet > > ```sql theme={null} > CREATE TABLE recipe_token_balances_by_wallet.fact_balances_by_wallet > ( > vendor_event_id String, > ingested_at DateTime64(3), > chain_id UInt32, > block_hash String, > block_number UInt64, > log_index UInt32, > event_ts DateTime64(3), > token_address String, > wallet_address String, > balance String, -- absolute post-transfer balance, raw uint256 > leg LowCardinality(String), -- from | to > sign Int8 > ) > ENGINE = ReplicatedCollapsingMergeTree( > '/clickhouse/tables/{database}/fact_balances_by_wallet', '{replica}', sign) > PARTITION BY (chain_id, toYYYYMM(event_ts)) > ORDER BY (chain_id, wallet_address, token_address, block_number, log_index, vendor_event_id, leg); > ``` > > The `sign` column drives reorg collapsing; read with `FINAL` then `argMax`, or a sign-aware aggregate, never a bare `WHERE sign = 1`. A single-node setup can use `CollapsingMergeTree(sign)` without the replication path. > [accordion] Postgres, token\_balances > > ```sql theme={null} > -- 1. Observations (sink target): one row per wallet, per transfer leg. > CREATE TABLE public.token_balance_observations ( > position BIGINT NOT NULL, > log_index BIGINT NOT NULL, > block_number BIGINT NOT NULL, > block_timestamp BIGINT NOT NULL, -- unix seconds > token_address TEXT NOT NULL, > wallet_address TEXT NOT NULL, > balance NUMERIC(76, 0) NOT NULL, > leg TEXT NOT NULL, > vendor_event_id TEXT NOT NULL > ); > > -- Recency index leads with the DISTINCT ON keys so the REFRESH avoids a sort. > CREATE INDEX tbo_token_wallet_recency_idx > ON public.token_balance_observations > (token_address, wallet_address, block_number DESC, log_index DESC); > > -- 2. Current-balance materialized view: latest observation per (token, wallet). > CREATE MATERIALIZED VIEW public.token_balances AS > SELECT DISTINCT ON (token_address, wallet_address) > token_address, > wallet_address, > balance, > block_number, > log_index, > block_timestamp > FROM public.token_balance_observations > ORDER BY token_address, wallet_address, block_number DESC, log_index DESC; > > CREATE UNIQUE INDEX token_balances_pk > ON public.token_balances (token_address, wallet_address); > > -- This template's primary access path: active balances held by a wallet. > CREATE INDEX token_balances_by_wallet_active_idx > ON public.token_balances (wallet_address, token_address) > WHERE balance > 0; > > -- Sibling access path (all non-zero holders of a token). > CREATE INDEX token_balances_by_token_active_idx > ON public.token_balances (token_address, wallet_address) > WHERE balance > 0; > > -- Cleanup index for zeroed positions. > CREATE INDEX token_balances_zero_cleanup_idx > ON public.token_balances (wallet_address, token_address) > WHERE balance = 0; > ``` > > Refresh the view on a schedule: `REFRESH MATERIALIZED VIEW CONCURRENTLY token_balances;`. MySQL is the same shape with a trigger-maintained `token_balances` table and a `DELETE … WHERE balance = 0` cleanup. `position` is the block-level cursor used during backfill. ### Run it Everything runs in **your** infrastructure: the sink writes into a database you own and you query it with plain SQL, no API and no per-call limits. **Prerequisites** * **Docker** and Docker Compose. * A **Data Feeds key**, a `cm_live_…` key with `continuum:read` scope (this is *not* your Web3 API key). > [card] [Sign up for a Data Feeds key](https://admin.moralis.com) > > Log in to the Moralis admin panel to create your account and generate a `cm_live_…` key. **Start the sink** Generate a **starter pack** for `tokenBalancesByWalletAddress` in the [Moralis Admin Panel](https://admin.moralis.com), pick your chain and destination database, then run it with Docker. The [quickstart](/data-feeds/migration/quickstart) walks through it end to end. Set the backfill window (`MORALIS_HISTORICAL_FROM_BLOCK`) as noted below. > [!NOTE] > > **Backfill full history for complete balances.** A balance is *current state* (the latest transfer-derived observation per `(wallet, token)`), and a wallet can still hold a token it last moved years ago. To return a wallet's *complete* holdings, backfill from an early block (`MORALIS_HISTORICAL_FROM_BLOCK=0`, or a token's deploy block if you scope to one token). A recent-only window like `tip-1000` captures only tokens that moved in that window, so balances would be incomplete. Unlike an event feed, a partial window is **not** correct here. Full-chain backfill on a busy chain is large; plan for it. See [History & backfill](/data-feeds/concepts/history-and-backfill). Then run the example reads below to confirm rows are landing. ### Example reads Every token a wallet holds, current non-zero balance only (ClickHouse; `argMax` over `FINAL` picks the latest observation per token): ```sql theme={null} SELECT token_address, argMax(balance, (block_number, log_index)) AS current_balance FROM recipe_token_balances_by_wallet.fact_balances_by_wallet FINAL WHERE chain_id = 1 AND wallet_address = lower('0x...') GROUP BY token_address HAVING current_balance != '0' AND current_balance != '' ORDER BY token_address; ``` Postgres (after `REFRESH MATERIALIZED VIEW CONCURRENTLY token_balances;`): ```sql theme={null} SELECT token_address, balance FROM public.token_balances WHERE wallet_address = lower('0x...') AND balance > 0 ORDER BY balance DESC; ``` MySQL: ```sql theme={null} SELECT token_address, balance FROM token_balances WHERE wallet_address = LOWER('0x...') AND balance > 0 ORDER BY balance DESC; ``` ### Other ways to consume this data The sink is the way to get **this pre-shaped table** (`token_balances`), recommended for a portfolio lookup you own. The *same underlying data* is also available as the **raw decoded feed**, if you'd rather derive balances yourself: * **Your existing message clients**: stream it with **Kafka / AMQP / SQS**. * **REST / Arrow Flight**: pull the decoded block stream directly. Those give you the **source array** (`tokenTransfers`, which carries absolute post-transfer balances) to compute balances yourself, not this pre-computed table. All of them read the one data lake into **your** infrastructure. See [What are Data Feeds?](/data-feeds/concepts/what-are-data-feeds). ### Modes Shipped defaults: **ClickHouse `hybrid`** (backfill → realtime), **Postgres / MySQL `historical`** (one-shot backfill). For live/reorg-safe ingestion, use ClickHouse; see the [overview](/data-feeds/templates/overview#modes). > [!NOTE] > > The backfill cursor (`position`) is block-level, so realtime/hybrid on Postgres / MySQL is constrained by their single-column `UNIQUE` requirement. Run realtime/hybrid on **ClickHouse**; the Postgres / MySQL configs target `historical` backfill. ### Multichain The template is chain-parametrized: point it at any supported EVM chain or Solana. On Solana, the per-observation identity already folds `(from, to, token, amount)` into `vendor_event_id` so rows stay unique under Solana's repeated `logIndex`; the balances it produces are identical in shape. ### Fidelity gaps * **Raw balances only.** `balance` is the raw `uint256` post-transfer amount; divide by `10^token_decimals` to read human units. Fold in a decimals lookup from a Token Metadata sync if you need it pre-scaled. * **No USD value.** This template lands quantities, not dollar value. Join to a Token Prices sync at read time for portfolio valuation. * **Latest-wins semantics.** A `(wallet, token)` row reflects the most recent transfer-derived post-balance. Direct mints/burns or rebases that emit a transfer are captured; balance changes with no transfer event are not. ## Migrating from the REST API This template replaces the wallet-balance family of Web3 API endpoints. Data Feeds are **not** 1:1 replicas of those responses: you land the underlying data in your own database and reconstruct the response shape with a view. The subsections below cover each REST endpoint: what replaces it, the field mapping (**exact** = straight from the chain, **calculated** = derived from real DEX trades, very close, **add yourself** = off-chain signal not in the feed), and the gotchas specific to that endpoint. ### GET /wallets/:address/tokens The enriched balances-plus-prices endpoint. Replaced by this template's `token_balances` table joined with three sibling templates for native balance, token details, and prices. > [!WARNING] > > This endpoint needs **four templates**, not one. Run this template plus [Native Balances](/data-feeds/templates/wallet/native-balances) (`native_balances`), [Token Metadata](/data-feeds/templates/token/token-metadata) (`token_metadata`), and [Token Prices](/data-feeds/templates/token/token-prices) (`token_price_updates`) against the same database, then join them in one view. There is no single pre-joined template; the composition is the supported path. | `/wallets/:address/tokens` | Data Feeds | Fidelity | | - | - | - | | `token_address`, `balance` (raw) | `token_balances.*` | exact | | `balance_formatted` | derive: `balance / 10^decimals` | exact | | `name`, `symbol`, `decimals`, `total_supply(_formatted)` | `token_metadata.*` | exact | | `usd_price` | latest `token_price_updates.usd_price` | calculated | | `usd_value`, `usd_price_24hr_*`, `portfolio_percentage` | derive from balance × price / price history | calculated | | `percentage_relative_to_total_supply` | derive: `balance / total_supply` | exact | | `native_token` + native balance | `native_balances` | exact | | `logo`, `thumbnail`, `possible_spam`, `verified_contract`, `security_score` | add yourself | off-chain | The reconstruction view (Postgres; adapt to your destination): ```sql theme={null} CREATE VIEW wallet_token_balances_price AS WITH latest_price AS ( SELECT DISTINCT ON (token_address) token_address, usd_price FROM token_price_updates ORDER BY token_address, block_number DESC -- newest price per token ) SELECT b.wallet_address, b.token_address, m.symbol, m.name, m.decimals, b.balance AS balance_raw, b.balance / power(10, m.decimals) AS balance_formatted, p.usd_price, (b.balance / power(10, m.decimals)) * p.usd_price AS usd_value, m.total_supply, b.balance / NULLIF(m.total_supply, 0) AS percentage_relative_to_total_supply FROM token_balances b LEFT JOIN token_metadata m ON m.token_address = b.token_address LEFT JOIN latest_price p ON p.token_address = b.token_address WHERE b.balance > 0; ``` Finishing touches: `portfolio_percentage` is `usd_value / SUM(usd_value)` per wallet at query time; `UNION` in `native_balances` priced with the native asset's USD mark; derive 24-hour change from the price \~24h ago in `token_price_updates`. **Gotchas** * USD values come from real DEX trades: very close to the old endpoint, but compare with a tolerance, not bit-for-bit. A thinly-traded token may not have a price yet. * No fixed spam filter: you get every token the wallet holds, then apply your own spam/dust rules. * No wallet-size limit: the old endpoint caps very large wallets; your own dataset has none. * Balances are current-state on Postgres/MySQL; use ClickHouse for real-time/hybrid. ### GET /:address/erc20 The plain ERC-20 balances endpoint (no prices, no portfolio math). Replaced by this template's `token_balances` table joined with [Token Metadata](/data-feeds/templates/token/token-metadata) for name/symbol/decimals/supply: two templates, one view, every onchain value exact. | `/:address/erc20` | Data Feeds | Fidelity | | - | - | - | | `token_address`, `balance` (raw) | `token_balances.*` | exact | | `name`, `symbol`, `decimals`, `total_supply` | `token_metadata.*` | exact | | `total_supply_formatted`, `percentage_relative_to_total_supply` | derive from those values | exact | | `balance_formatted` *(bonus, the REST response omits it)* | derive: `balance / 10^decimals` | exact | | `logo`, `thumbnail`, `possible_spam`, `verified_contract`, `security_score` | add yourself | off-chain | The view is the balances-and-prices view above minus the price join: join `token_balances` to `token_metadata`, keep `balance > 0`, and derive the formatted/supply-relative columns. The old `exclude_spam` / `exclude_unverified_contracts` filters become a `WHERE` against your own list. **Gotchas** * Everything onchain is exact: no pricing engine in the loop, nothing to reconcile with a tolerance. * ERC-20 only, matching the REST endpoint. For native (ETH) balance, add [Native Balances](/data-feeds/templates/wallet/native-balances). * No wallet-size limit: the old endpoint errors on very large wallets ("too many ERC20 token balances"); your dataset doesn't, and you get real keyset pagination on top. ### GET /wallets/:address/net-worth The USD net-worth roll-up. There is no single replacement table; net worth is `SUM(token balance × price) + native balance × native price`, computed over the same tables as `/wallets/:address/tokens`. > [!WARNING] > > This endpoint needs **four templates**: this template plus [Native Balances](/data-feeds/templates/wallet/native-balances), [Token Metadata](/data-feeds/templates/token/token-metadata), and [Token Prices](/data-feeds/templates/token/token-prices). Build the balances-and-prices view above first, then aggregate it; net worth is a `SUM` on top of that view. | `/wallets/:address/net-worth` | Data Feeds | Fidelity | | - | - | - | | `native_balance`, `native_balance_formatted` | `native_balances.balance` | exact | | `native_balance_usd` | derive: native balance × native price | calculated | | `token_balance_usd` | `SUM(usd_value)` over the balances view | calculated | | `networth_usd` | derive: native + token USD | calculated | | `total_networth_usd` | derive: sum across chains | calculated | The roll-up view (Postgres; sums the balances view above and adds the native leg): ```sql theme={null} CREATE VIEW wallet_net_worth AS WITH tokens AS ( SELECT wallet_address, sum(usd_value) AS token_balance_usd -- exclude what shouldn't count (see gotchas) FROM wallet_token_balances_price WHERE usd_value IS NOT NULL GROUP BY wallet_address ), native AS ( SELECT n.wallet_address, n.balance / 1e18 AS native_balance_formatted, n.balance / 1e18 * p.usd_price AS native_balance_usd FROM native_balances n LEFT JOIN LATERAL ( SELECT usd_price FROM token_price_updates WHERE token_address = lower('0xC02aaa39b223FE8D0A0e5C4F27eAD9083C756Cc2') -- WETH = native mark ORDER BY block_number DESC LIMIT 1 ) p ON true ) SELECT coalesce(t.wallet_address, n.wallet_address) AS wallet_address, n.native_balance_formatted, n.native_balance_usd, coalesce(t.token_balance_usd, 0) AS token_balance_usd, coalesce(t.token_balance_usd, 0) + coalesce(n.native_balance_usd, 0) AS networth_usd FROM tokens t FULL JOIN native n ON n.wallet_address = t.wallet_address; ``` **Gotchas** * **Curating the token set is the whole game.** One spam or bogus-priced token can dominate the total. The old `exclude_spam` / `exclude_unverified_contracts` / `min_pair_side_liquidity_usd` filters become your own `WHERE` in the `tokens` CTE; here they're essential, not polish. * Stale prices: a token that hasn't traded recently has no fresh mark. Decide whether to value it at zero, carry forward the last mark, or exclude it. Each choice moves the total. * Cross-chain net worth: each chain is its own feed. Compute per chain and sum `networth_usd` into `total_networth_usd`. * Compare with a tolerance: USD comes from real DEX trades, very close to the old figure, not identical. * A missed holding silently changes the total, so full-history backfill (see the note in [Run it](#run-it)) matters even more here. ### Related > [card] [Token Balances by Token](/data-feeds/templates/token/token-balances-by-token) > > The sibling: same ingest, keyed token-first to list a token's holders. > [card] [Portfolio Tracking](/data-feeds/use-cases/portfolio-tracking) > > The use case this balance feed powers. # Wallet History Source: https://docs.moralis.com/data-feeds/templates/wallet/wallet-history Reconstruct a wallet's full chronological event feed (every transfer, swap, NFT move, approval, and LP change, with USD value per event) as a continuous sync into your own database. ### Question it answers > "Show me the full chronological event feed for wallet **0x…**, newest first. Each row is one event with its actual payload (counterparty, amounts, token IDs, pair address, USD value), and I can filter by event type." A single read returns what the public API stitches together client-side from `/wallets/{address}/erc20-transfers`, `/native-transactions`, `/nfts/transfers`, `/swaps`, `/approvals`, and `/defi/positions`. Storing it **pre-stitched**, in your own database, is the value. ### What you get The template lands **one row per wallet-bearing event**. A wallet is "involved" if it is a non-empty `from`/`to` (or owner/approver) on the event. Six event types share one wide, flat table; per-type columns are populated as relevant: | `event_type` | Rows per event | Populated columns | USD value | | - | - | - | - | | `token_transfer` | 2 (from + to) | `token_address`, `amount` | ✅ inline (unscaled) | | `native_transfer` | 2 (from + to) | `amount` | None | | `nft_transfer` | 2 (from + to) | `token_address`, `token_id`, `amount` | None | | `swap` | 1 (the wallet) | `pair_address`, `token_in/out_address`, `amount_in/out` | ✅ inline | | `approval` | 1 (approver) | `spender_address`, `token_address`, `amount` | None | | `liquidity_change` | 1 (LP owner) | `change_type`, `pair_address`, `token0/1_address`, `token0/1_amount` | ✅ inline | Each row also carries `direction` (`sent` · `received` · `self` · `minted` · `burned`), `counterparty`, `tx_hash`, `block_number`, `block_timestamp`, and `log_index`. ### Source The transform reads six per-block arrays and `UNION`s them into the event feed: `tokenTransfers` · `nativeTransfers` · `nftTokenTransfers` · `tokenSwaps` · `tokenApprovals` · `pairLiquidityChanges` USD values are computed **inline** from the same block's `tokenPriceUpdates`, with no separate price join at read time. ### Destination | Destination | Table | Read pattern | | - | - | - | | **ClickHouse** (first-class) | `fact_wallet_history_full` | Prefix scan on `(chain_id, wallet_address, block_number, log_index)`; read with `FINAL` or `sum(sign)` | | **Postgres** | `wallet_history_full` | Index on `(wallet_address, block_number DESC)` | | **MySQL** | `wallet_history_full` | Index on `(wallet_address, block_number)` | ClickHouse uses the collapsing log-table pattern (see the [templates overview](/data-feeds/templates/overview#destinations)) so chain reorganizations self-correct. The fact table's sort key is wallet-first, so a wallet's feed, optionally filtered by `event_type`, is a contiguous range read. ### Full schema Below is the complete read table this template produces. It's the **full shape**: every event type's columns in one wide row. This is a starting point: keep the columns and event types you need and drop the rest (see [Schema & flexibility](/data-feeds/templates/overview#schema--flexibility)). Raw `uint256` amounts and `token_id` are stored as text (they exceed numeric precision); USD columns are wide decimals so a low-decimals token × price never overflows. > [accordion] ClickHouse, fact\_wallet\_history\_full > > ```sql theme={null} > CREATE TABLE recipe_wallet_history_full.fact_wallet_history_full > ( > chain_id UInt32, > wallet_address String, > block_number UInt64, > log_index UInt32, > event_type LowCardinality(String), -- token_transfer | native_transfer | nft_transfer | swap | approval | liquidity_change > vendor_event_id String, > block_timestamp DateTime64(3), > tx_hash String, > transaction_index Nullable(Int32), > direction LowCardinality(String), -- sent | received | self | minted | burned | n/a > counterparty String, > token_address String, > amount String, -- raw uint256 > amount_usd Nullable(String), > token_id String, > pair_address String, > token_in_address String, > amount_in String, > amount_in_usd Nullable(String), > token_out_address String, > amount_out String, > amount_out_usd Nullable(String), > spender_address String, > change_type LowCardinality(String), -- mint | burn | sync | '' > token0_address String, > token0_amount String, > token0_amount_usd Nullable(String), > token1_address String, > token1_amount String, > token1_amount_usd Nullable(String), > sign Int8 > ) > ENGINE = ReplicatedCollapsingMergeTree( > '/clickhouse/tables/{database}/fact_wallet_history_full', '{replica}', sign) > PARTITION BY (chain_id, toYYYYMM(block_timestamp)) > ORDER BY (chain_id, wallet_address, block_number, log_index, event_type, vendor_event_id); > ``` > > The `sign` column drives reorg collapsing; read with `FINAL` or `sum(sign)`. A single-node setup can use `CollapsingMergeTree(sign)` without the replication path. > [accordion] Postgres, wallet\_history\_full > > ```sql theme={null} > CREATE TABLE public.wallet_history_full ( > position BIGINT NOT NULL, > chain_id BIGINT NOT NULL, > block_number BIGINT NOT NULL, > block_timestamp BIGINT NOT NULL, -- unix seconds > tx_hash TEXT NOT NULL, > log_index BIGINT NOT NULL, > wallet_address TEXT NOT NULL, > event_type TEXT NOT NULL, > vendor_event_id TEXT NOT NULL, > direction TEXT NOT NULL, > counterparty TEXT NOT NULL, > token_address TEXT NOT NULL, > amount TEXT NOT NULL, -- raw uint256 > amount_usd NUMERIC(65, 18) NULL, > token_id TEXT NOT NULL, > pair_address TEXT NOT NULL, > token_in_address TEXT NOT NULL, > amount_in TEXT NOT NULL, > amount_in_usd NUMERIC(65, 18) NULL, > token_out_address TEXT NOT NULL, > amount_out TEXT NOT NULL, > amount_out_usd NUMERIC(65, 18) NULL, > spender_address TEXT NOT NULL, > change_type TEXT NOT NULL, > token0_address TEXT NOT NULL, > token0_amount TEXT NOT NULL, > token0_amount_usd NUMERIC(65, 18) NULL, > token1_address TEXT NOT NULL, > token1_amount TEXT NOT NULL, > token1_amount_usd NUMERIC(65, 18) NULL > ); > > -- Primary access pattern: every event for a wallet, newest first. > CREATE INDEX ON public.wallet_history_full (chain_id, wallet_address, block_number DESC); > -- Event-type filter within a wallet. > CREATE INDEX ON public.wallet_history_full (chain_id, wallet_address, event_type, block_number DESC); > ``` > > MySQL is the same shape with `DECIMAL(65,18)` for the USD columns. `position` is the block-level cursor used during backfill. ### Run it Everything runs in **your** infrastructure: the sink writes into a database you own and you query it with plain SQL, no API and no per-call limits. **Prerequisites** * **Docker** and Docker Compose. * A **Data Feeds key**, a `cm_live_…` key with `continuum:read` scope (this is *not* your Web3 API key). > [card] [Sign up for a Data Feeds key](https://admin.moralis.com) > > Log in to the Moralis admin panel to create your account and generate a `cm_live_…` key. **Start the sink** Generate a **starter pack** for `walletHistoryFull` in the [Moralis Admin Panel](https://admin.moralis.com), pick your chain and destination database, then run it with Docker. The [quickstart](/data-feeds/migration/quickstart) walks through it end to end. Choose the backfill window (`MORALIS_HISTORICAL_FROM_BLOCK`, e.g. `tip-1000`) as noted below. > [!NOTE] > > **Size the window deliberately.** This template lands one row per event across six event types, so history adds up fast, `tip-1000` on Ethereum is roughly 3M rows. The 9-branch transform is memory-hungry: on chain-heavy windows raise the sink's ClickHouse memory ceiling (`CLICKHOUSE_MAX_MEMORY_USAGE`, default 4 GiB). See [Modes](#modes) for backfill vs realtime. Then run the example reads below to confirm rows are landing. ### Example reads A wallet's full feed, newest first (ClickHouse): ```sql theme={null} SELECT block_number, log_index, event_type, direction, counterparty, token_address, amount, amount_usd FROM recipe_wallet_history_full.fact_wallet_history_full FINAL WHERE chain_id = 1 AND wallet_address = lower('0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045') ORDER BY block_number DESC, log_index DESC LIMIT 50; ``` Only swaps and token transfers (the `event_type` filter compresses the scan further): ```sql theme={null} SELECT block_number, event_type, token_in_address, amount_in, token_out_address, amount_out, amount_in_usd, amount_out_usd FROM recipe_wallet_history_full.fact_wallet_history_full FINAL WHERE chain_id = 1 AND wallet_address = lower('0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045') AND event_type IN ('swap', 'token_transfer') ORDER BY block_number DESC, log_index DESC; ``` Per-event-type breakdown (sign-aware, cheaper than `FINAL`): ```sql theme={null} SELECT event_type, sum(sign) AS events FROM recipe_wallet_history_full.fact_wallet_history_full WHERE chain_id = 1 AND wallet_address = lower('0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045') GROUP BY event_type ORDER BY events DESC; ``` ### Other ways to consume this data The sink is the way to get **this pre-shaped table** (`wallet_history_full`), recommended for a queryable history you own. The *same underlying data* is also available as the **raw decoded feed**, if you'd rather shape it yourself: * **Your existing message clients**: stream it with **Kafka / AMQP / SQS**. * **REST / Arrow Flight**: pull the decoded block stream directly. Those give you the **source arrays** (`tokenTransfers`, `tokenSwaps`, …) to assemble yourself, not this pre-stitched wallet table. All of them read the one data lake into **your** infrastructure. See [What are Data Feeds?](/data-feeds/concepts/what-are-data-feeds). ### USD valuation and fidelity gaps * **Swaps and LP changes** carry per-leg decimals, so their `*_usd` columns are true dollar values (`raw / 10^decimals × price`). * **Token transfers** have no decimals field on the transfer event, so `amount_usd` is `raw_amount × price` (**unscaled**). Divide by `10^token_decimals` to read dollars; fold in a decimals lookup from a Token Metadata sync if you need it pre-scaled. * **Native and NFT transfers** leave USD `NULL`: native pricing needs a separate native-price feed, and NFT pricing is out of scope (use an NFT Trades template for trade-priced data). * **Approvals** leave USD `NULL` by design: an unlimited allowance × price is meaningless. ### Lightweight variant: transaction pointers If you only need a wallet's **transaction list** (one pointer per `(wallet, tx)`, not the full payload), there's a slimmer variant that lands just the deduplicated pointers from the transfer arrays. Use the full feed above when you need amounts, counterparties, and USD value; use the pointer variant when you only need "which transactions touched this wallet." ### Modes Shipped defaults: **ClickHouse `hybrid`** (backfill → realtime), **Postgres / MySQL `historical`** (one-shot backfill). For live/reorg-safe ingestion, use ClickHouse; see the [overview](/data-feeds/templates/overview#modes). ### Multichain The template is chain-parametrized via the `chain` setting: point it at any supported EVM chain or Solana. On Solana, the event identity is widened to stay unique under Solana's repeated log indices; the wallet feed it produces is identical in shape. ### How much data does this consume? Wallet history is one of the **largest** scopes in the feed, because it unions several transfer arrays across every wallet on the chain. On **Solana mainnet**, continuous real-time feeds measured: | Selection | Typical month (P50) | Busy month (P90) | | - | - | - | | The three transfer arrays alone (`nativeTransfers`, `tokenTransfers`, `nftTokenTransfers`) | **\~1,300 GB** | **\~1,600 GB** | | The full nine-slice wallet-history selection (adds swaps, aggregator swaps, approvals, liquidity changes, prices) | **\~1,400 GB** | **\~1,800 GB** | | The transfer arrays **without** `nativeTransfers` | **\~480 GB** | **\~590 GB** | Measured 2026-07-31, 30 sampled partitions per selection, `metered` delivery. Billing is on uncompressed bytes. This template's selection sits between the first two rows. Note the third row: **`nativeTransfers` is roughly two thirds of the bill on its own** — if your use case doesn't need native (SOL/ETH) transfers, dropping that one slice is the single largest cost lever available. **Size your allowance against the busy figure, not the typical one.** Chain activity is bursty, and the same feed can land on either side of a fixed allowance depending on the month. Three caveats: * **Real-time only.** A historical backfill is billed separately and is usually the larger number; its size depends entirely on how far back you go. * **Solana only.** Volume concentrates hard per chain — Solana has measured over 20x Ethereum on comparable transfer-shaped selections — so this figure does not extrapolate to other chains. * **Filtering does not reduce it.** Restricting to specific wallets happens after the data is delivered. To reduce cost, narrow the **block range**, not the entity set. If you want your exact scope measured before you commit to a plan, [reach out](https://admin.moralis.com/data-feeds) and we will probe it against the live feed rather than estimate it. ### Powers these use cases > [card] [Accounting & Tax](/data-feeds/use-cases/accounting) > > The chronological, USD-valued event feed behind a ledger. > [card] [Compliance & AML](/data-feeds/use-cases/compliance-aml) > > Full counterparty and transfer trail per address. ## Migrating from the REST API Coming from the Web3 Data API? This template replaces the wallet-activity endpoints below. Data Feeds are **not 1:1 replicas** of REST responses (you own the table and reshape it with SQL), so each subsection states exactly what maps, what's calculated for you, and what you add yourself. For the general model see [Data Feeds vs. the REST API](/data-feeds/concepts/data-feeds-vs-the-rest-api); for the full endpoint index see the [endpoint map](/data-feeds/migration/endpoints). ### Wallet transaction history `GET /wallets/{address}/history` Replaced by this template's `wallet_history_full` table: the same activity, flattened to **one row per event** instead of one object per transaction, with a per-event USD value the old endpoint never had. > [!NOTE] > > **Not a 1:1 swap.** The old response nests events under each transaction and layers on a decoded/curated layer. You need **this template** for the events, plus [Token Metadata](/data-feeds/templates/token/token-metadata) for token names/symbols/decimals, plus a `GROUP BY tx_hash` reshape if your UI expects the transaction-grouped shape. Transaction-level fields (gas, nonce, receipt) come from the raw `block` transaction rows; see [The `block` array](/data-feeds/concepts/the-block-array). | `/wallets/{address}/history` | Data Feeds | Fidelity | | - | - | - | | `hash`, `block_number`, `block_timestamp`, `transaction_index`, `from`/`to`, `value` | `wallet_history_full.*` | exact | | `nonce`, `gas`, `gas_price`, `input`, `receipt_*`, `transaction_fee` | raw `block` transaction row (join on `tx_hash`) | exact | | nested transfer `value` (raw) / `value_formatted` | `amount`, `amount_in/out`, `token0/1_amount`; formatted = `amount / 10^decimals` | exact | | per-event USD value | `amount_usd`, `amount_in/out_usd`, `token0/1_amount_usd` | calculated *(new; the endpoint had none)* | | token `name` / `symbol` / `decimals` | `token_metadata.*` ([Token Metadata](/data-feeds/templates/token/token-metadata)) | exact | | `direction` | `wallet_history_full.direction` | exact | | `internal_transactions[]` | not delivered by a shipped template today | gap | | `logs[]` (raw) / `logs[].decoded_event` | raw `block` log rows / decode from the ABI yourself | exact / add yourself | | `category`, `summary`, `method_label` | build yourself, or omit | add yourself | | `*_label`, `*_entity`, logos, `possible_spam`, `verified_collection` | your own label / curation source | add yourself | To reproduce the endpoint's transaction-grouped shape, group events by `tx_hash` (Postgres): ```sql theme={null} SELECT tx_hash, max(block_number) AS block_number, max(block_timestamp) AS block_timestamp, jsonb_agg(to_jsonb(e) ORDER BY log_index) FILTER (WHERE event_type = 'token_transfer') AS erc20_transfers, jsonb_agg(to_jsonb(e) ORDER BY log_index) FILTER (WHERE event_type = 'nft_transfer') AS nft_transfers, jsonb_agg(to_jsonb(e) ORDER BY log_index) FILTER (WHERE event_type = 'native_transfer') AS native_transfers FROM wallet_history_full e WHERE wallet_address = lower($1) GROUP BY tx_hash ORDER BY block_number DESC LIMIT $2; ``` **Good to know** * The biggest migration task is the reshape: event-flat → transaction-grouped is a `GROUP BY tx_hash`. Skip it entirely if your UI prefers an event feed. * You gain per-event USD the endpoint never provided. Compare with a tolerance, and expect `NULL`/0 for unpriced tokens. * The decoded/categorized/labeled layer is off-chain processing, not onchain data; add it yourself or drop it. * Only need "which transactions touched this wallet"? Use the [lightweight pointer variant](#lightweight-variant-transaction-pointers) instead of the full feed. * No per-call limit: page a wallet's entire history with plain SQL. ### Wallet native transactions `GET /{address}` Replaced by this template filtered to `event_type = 'native_transfer'`: the native slice of the same event feed. Direction, date, block, and ordering filters become plain `WHERE` / `ORDER BY` clauses. > [!NOTE] > > **Not a 1:1 swap for strict parity.** The REST endpoint returns *every* transaction where the wallet is `from` or `to`, including `value = 0` contract calls; native value movements alone miss those. For exact parity, and for gas/nonce/receipt fields, read the raw transaction rows from the `block` array (filter `transactionFrom` / `transactionTo` = your wallet) alongside this template. See [The `block` array](/data-feeds/concepts/the-block-array). | `/{address}` | Data Feeds | Fidelity | | - | - | - | | `hash`, `nonce`, `transaction_index` | `block` array transaction row | exact | | `from_address`, `to_address`, `value`, `input` | transaction row / `nativeTransfers` | exact | | `gas`, `gas_price`, `receipt_*` | `block` array transaction row | exact | | `transaction_fee` | derive: `receipt_gas_used × gas_price` | exact | | `block_number`, `block_timestamp`, `block_hash` | block / transaction row | exact | | `logs[]` | `block` array log rows | exact | | `internal_transactions` | not delivered by a shipped template today | gap | | `method_label` | decode the 4-byte selector from the ABI | add yourself | | `from/to_address_entity`, `*_label`, `*_entity_logo` | your own label directory | add yourself | **Good to know** * No wallet-size cap: the old endpoint can error on very large wallets; your own table has no such limit. * Strict parity includes `value = 0` sends, so use the block-array transaction rows when you need every transaction, not just value movements. * Run the template `realtime` (ClickHouse recommended) for a live feed of new transactions. ### Wallet active chains `GET /wallets/{address}/chains` Replaced by a roll-up you build: run this template on **each chain** you cover, keep a `min`/`max` activity summary per wallet per chain, and union the results in your app. > [!NOTE] > > **Not a 1:1 swap.** Data Feeds are one feed per chain. This endpoint needs this template running on every chain you want to report, plus a small cross-chain union in your application layer. A wallet active on a chain you don't index simply won't appear; that coverage is yours to set. | `/wallets/{address}/chains` | Data Feeds | Fidelity | | - | - | - | | `address` | the query | exact | | `active_chains[].chain`, `chain_id` | the indexed chains where the wallet has rows | exact | | `first_transaction` (block, timestamp, hash) | `MIN` activity block per chain + the tx there | exact | | `last_transaction` (block, timestamp, hash) | `MAX` activity block per chain + the tx there | exact | Keep the per-chain read cheap with a summary view over the template's table: ```sql theme={null} CREATE VIEW wallet_chain_activity AS SELECT wallet_address, min(block_number) AS first_block, max(block_number) AS last_block FROM wallet_history_full GROUP BY wallet_address; ``` **Good to know** * First-seen needs full history; "active" and last-seen do not. Backfill each chain to an early block where you want a correct first transaction; a wallet's first activity can be genesis-era. * Every value is exact: no prices, no off-chain data, just onchain presence and the bounding transactions. * Stream each chain's feed to keep last-seen live as the wallet transacts. ### Wallet stats `GET /wallets/{address}/stats` Replaced by plain `COUNT`s: three of the five stats come straight from this template's table; the NFT holdings counts need a second template. > [!NOTE] > > **Not a 1:1 swap.** You need this template **plus** [NFTs by Wallet](/data-feeds/templates/wallet/nfts-by-wallet). `transactions`, `token_transfers`, and `nft_transfers` are `event_type` counts over `wallet_history_full`; `nfts` and `collections` are counts over the wallet-NFT holdings table. | `/wallets/{address}/stats` | Data Feeds | Fidelity | | - | - | - | | `nfts` | `count` over `wallet_nfts` where `balance > 0` ([NFTs by Wallet](/data-feeds/templates/wallet/nfts-by-wallet)) | exact | | `collections` | `count(DISTINCT token_address)` over `wallet_nfts` | exact | | `transactions.total` | `count` of the wallet's native transactions | exact | | `nft_transfers.total` | `count` where `event_type = 'nft_transfer'` | exact | | `token_transfers.total` | `count` where `event_type = 'token_transfer'` | exact | ```sql theme={null} SELECT (SELECT count(*) FROM wallet_nfts WHERE wallet_address = $1 AND balance > 0) AS nfts, (SELECT count(DISTINCT token_address) FROM wallet_nfts WHERE wallet_address = $1 AND balance > 0) AS collections, (SELECT count(*) FROM wallet_history_full WHERE wallet_address = $1 AND event_type = 'native_transfer') AS transactions_total, (SELECT count(*) FROM wallet_history_full WHERE wallet_address = $1 AND event_type = 'nft_transfer') AS nft_transfers_total, (SELECT count(*) FROM wallet_history_full WHERE wallet_address = $1 AND event_type = 'token_transfer') AS token_transfers_total; ``` **Good to know** * These counts are **cumulative over the wallet's life**: accurate totals need the full chain history backfilled (`historical` / `hybrid` from an early block). See [History & backfill](/data-feeds/concepts/history-and-backfill). * For `transactions.total`, native transfers miss `value = 0` contract calls; count the raw block-array transaction rows for strict parity (same caveat as [native transactions](#wallet-native-transactions)). * For `nfts`, decide whether you count held token IDs or sum ERC-1155 amounts. The endpoint counted token IDs. * Serving many wallets? Materialize a per-wallet stats row and update it as events land. # Accounting & Tax Source: https://docs.moralis.com/data-feeds/use-cases/accounting A Data Feeds template bundle for accounting, tax, and treasury tools: a wallet's full event feed plus per-asset transfer ledgers, valued in USD at block time, synced into your own database. ### Who it's for Teams building **accounting, tax, bookkeeping, treasury, and audit** tooling: anything that needs a complete, valued, auditable record of what moved through a set of wallets. The goal is a ledger you own: every inflow and outflow, classified, with a USD value at the time it happened. ### The template bundle This use case combines a small set of templates. Start with **Wallet History** as the backbone, then add the standalone transfer templates when you need per-asset ledger tables, and **Token Prices** for valuation. | Template | Role in the ledger | | - | - | | [Wallet History](/data-feeds/templates/wallet/wallet-history) | The backbone: every event a wallet was involved in, in order, with inline USD value. Covers token, native, and NFT transfers, swaps, approvals, and LP changes in one feed. | | [Token Transfers](/data-feeds/templates/token/token-transfers) | Per-token transfer ledger: every ERC-20 movement of a given token, keyed for asset-level reconciliation. | | Native Transfers | Native-asset (gas-token) movements, including internal transfers; available within Wallet History's `native_transfer` rows. | | [NFT Transfers](/data-feeds/templates/nft/nft-transfers) | NFT movements (collection + token ID) for inventory and disposal tracking. | | [Token Balances by Wallet](/data-feeds/templates/wallet/token-balances-by-wallet) | Period-end token holdings per wallet: the balance-sheet snapshot, reconciled against the transfer ledger. | | [Native Balances](/data-feeds/templates/wallet/native-balances) | Period-end native-asset (gas-token) balance per wallet. | | [Token Prices](/data-feeds/templates/token/token-prices) | The valuation join target: USD/native marks used to value every transfer and holding at block time. | | [Contract Logs](/data-feeds/templates/logs/contract-logs) | Raw events from contracts you can't book from decoded feeds: staking rewards, vesting, rebases, custom protocol events. Decode against the ABI to classify them as income/expense. | | [Logs by Event Signature](/data-feeds/templates/logs/logs-by-topic0) | One event type chain-wide: e.g. capture a specific reward or distribution event across every protocol you interact with, in one feed. | > [!NOTE] > > **Wallet History already contains the transfer events.** If a single, filterable event feed per wallet is enough, the backbone template alone covers accounting. Add the standalone **Token / NFT Transfers** templates when you want dedicated, per-asset tables (e.g. one table per token to reconcile against an exchange's books) rather than filtering one wide feed. Add the **log templates** when income or expense lives in events the decoded feeds don't model (staking rewards, vesting unlocks, rebases, or any custom protocol event), so nothing falls outside the books. Add the **balance templates** for the positions side: period-end holdings (the balance sheet) to reconcile against the transaction ledger. ### How the pieces fit ```text theme={null} Wallet History ──┐ Token Transfers ──┤ Native Transfers ──┼──► transaction ledger (flows) ──┐ NFT Transfers ──┤ │ Contract Logs ──┘ (custom income/expense events) ├──► valued by ── Token Prices │ Token Balances by Wallet ──┐ │ Native Balances ──┴─► balance-sheet (positions)┘ ``` * **Wallet History** gives you the chronological, classified feed: each row already tagged `sent` / `received` / `self` / `minted` / `burned`, so debits and credits fall out of `direction`. * **The transfer templates** give you asset-first tables for reconciliation: "every movement of token X across all tracked wallets." * **The log templates** close the gap for income and expense that isn't a plain transfer: staking rewards, vesting unlocks, rebases, fee distributions. Decode the raw `data` against the contract ABI and classify each event into your chart of accounts. * **Transfers are the flows; balances are the positions.** [Token Balances by Wallet](/data-feeds/templates/wallet/token-balances-by-wallet) and [Native Balances](/data-feeds/templates/wallet/native-balances) give the period-end holdings snapshot, the balance sheet, to reconcile against the transfer ledger and to value at the reporting date. * **Token Prices** is the connective tissue: join any transfer or holding to the token's mark at its `block_number` to compute USD value at the time of the event (for the P\&L) or at period end (for the balance sheet). This is the basis every tax and accounting calculation needs. ### Valuing transfers in USD Wallet History folds USD values inline for the event types that carry decimals (swaps, LP changes) and for token transfers as an **unscaled** product (`raw_amount × price`). For a ledger you'll typically want fully-scaled dollar values for every asset, which is a join against the Token Prices sync: ```sql theme={null} -- Token transfers for a wallet, valued in USD at block time. SELECT wh.block_timestamp, wh.direction, wh.token_address, wh.amount, wh.counterparty, wh.tx_hash FROM fact_wallet_history_full AS wh FINAL WHERE wh.chain_id = 1 AND wh.wallet_address = lower('0x…') AND wh.event_type = 'token_transfer' ORDER BY wh.block_number DESC, wh.log_index DESC; ``` Pair this with the Token Prices sync (joined on token + nearest block) and a token-decimals lookup to produce a fully-scaled, dated, dollar-valued ledger. ### Notes and considerations * **Cost basis** is a downstream calculation (FIFO/LIFO/average) your application performs over this ledger. The templates give you the valued, ordered events it needs, not the basis itself. * **Decimals.** Scale raw `amount` values by `10^token_decimals` before reporting dollars; source decimals from a Token Metadata sync. * **Native and NFT USD.** Wallet History leaves these `NULL`; value native movements against a native-price feed, and treat NFTs separately (cost/proceeds from trade data, not transfers). * **Completeness for audit.** Run the ClickHouse path in `hybrid` mode so the ledger backfills history and then stays current, reorg-safe, at the chain head. ### Get started Start with the templates in this workflow, then follow the Quickstart to run them. > [card] [Get started](/data-feeds/migration/quickstart) > > Build an owned, auditable onchain ledger. # Compliance & AML Source: https://docs.moralis.com/data-feeds/use-cases/compliance-aml A Data Feeds template bundle for compliance, AML, and forensics teams: a complete, ordered, auditable trail of everything an address did, plus its asset positions and risk surface, synced into your own database. ### Who it's for Teams building **compliance, AML, transaction-monitoring, and forensics** tooling: anything that needs a complete, ordered, defensible record of what an address did and what it holds. The goal is a full audit trail you own: every event in sequence, every counterparty, the address's current and historical positions, and the standing risk it has granted, all reconstructable from Moralis-indexed, normalized per-block onchain data. ### The template bundle This use case combines a small set of templates. Start with **Wallet History** as the chronological backbone, layer **Token Transfers** and **Swaps by Wallet** for asset-level and DEX-activity trails, **Token Balances by Wallet** and **Native Balances** for the address's full asset positions, and **Token Approvals** for the standing risk surface. | Template | Role in the trail | | - | - | | [Wallet History](/data-feeds/templates/wallet/wallet-history) | The backbone: every event an address was involved in, in on-chain order, classified by `direction` and `event_type`, with USD value inline. Token, native, and NFT transfers, swaps, approvals, and LP changes in one feed. | | [Token Transfers](/data-feeds/templates/token/token-transfers) | Asset-first movement trail: every ERC-20 transfer of a token, with `from_address` / `to_address` and the initiator, for counterparty and flow tracing. | | [Token Balances by Wallet](/data-feeds/templates/wallet/token-balances-by-wallet) | The address's token holdings: current and historical positions per token, for net-worth, exposure, and balance-at-block snapshots. | | [Native Balances](/data-feeds/templates/wallet/native-balances) | The address's native-asset (gas-token) position over time, for net-worth and balance-at-block snapshots. | | [Token Approvals](/data-feeds/templates/wallet/token-approvals) | The risk surface: every allowance the address has granted, so you can compute the live exposure to each spender. | | [Swaps by Wallet](/data-feeds/templates/markets/swaps-by-wallet) | DEX activity per address: every trade, with notional in USD, for layering/structuring detection. | | [Contract Logs](/data-feeds/templates/logs/contract-logs) | Audit-grade completeness: every raw event log emitted by a contract of interest (mixer, bridge, sanctioned address, custom protocol), including events the decoded templates don't model. | | [Logs by Event Signature](/data-feeds/templates/logs/logs-by-topic0) | One event signature (`topic0`) chain-wide: capture a specific event across all contracts (e.g. every interaction of a flagged signature) for screening and pattern detection. | > [!NOTE] > > **Wallet History already contains the transfer, swap, and approval events.** If a single, filterable event feed per address is enough, the backbone template alone is your audit trail. Add the standalone templates when you want dedicated, differently-keyed tables: **Token Transfers** keyed by token for counterparty tracing, **Swaps by Wallet** for trade-level notional, **Token Approvals** for live-allowance reconciliation, and **Token Balances by Wallet** + **Native Balances** for current/historical position snapshots. Add the **log templates** when you need raw, decode-it-yourself completeness: events on custom or non-standard contracts that the decoded feeds don't cover, which an audit can't afford to miss. ### How the pieces fit ```text theme={null} ┌──► Token Transfers (counterparty / flow trail) Wallet History ──────────┤ (ordered event feed) ├──► Swaps by Wallet (DEX activity / notional) │ Token Balances ─────────┐│ Native Balances ─────────┤│ Token Approvals ─────────┤├──► your audit trail per address │ Contract Logs ───────────┤ (raw events the decoded feeds don't model — Logs by Signature ───────┘ custom contracts, flagged signatures) ``` * **Wallet History** is the spine: the complete, ordered, classified feed for one address. Each row is tagged `sent` / `received` / `self` / `minted` / `burned` via `direction`, and the event kind via `event_type`, so a full activity timeline falls out of one table. * **Token Transfers** and **Swaps by Wallet** are asset-first and trade-first views of the same source events, keyed for the questions a forensics workflow asks: "who did this address transact with for token X" and "what was the USD notional of each trade." * **Token Balances by Wallet**, **Native Balances**, and **Token Approvals** describe *state*: the address's token and native positions over time, and the standing allowances it has granted. Balances answer "what does this address hold, now or at block N"; approvals are the risk surface: an unrevoked unlimited allowance is live exposure regardless of activity. * **The log templates** are the completeness backstop. The decoded feeds cover standard transfers, swaps, and approvals; **Contract Logs** and **Logs by Event Signature** capture *everything else* (custom protocol events, non-standard contracts, interactions with a flagged address) as raw `topic0…3` + `data` you decode against the ABI. For audit defensibility, "we indexed every event" beats "we indexed the events we had a decoder for." ### Building the per-address audit trail The compliance question is "show me everything this address did, in order." That is the Wallet History feed, read reorg-safe with `FINAL`: ```sql theme={null} -- Full chronological event trail for one address. SELECT block_timestamp, event_type, direction, counterparty, token_address, amount, amount_usd, tx_hash FROM recipe_wallet_history_full.fact_wallet_history_full FINAL WHERE chain_id = 1 AND wallet_address = lower('0x…') ORDER BY block_number DESC, log_index DESC; ``` To assess the standing risk surface alongside the activity trail, compute the address's live allowances: the latest approval per `(token, spender)`, dropping anything revoked to zero: ```sql theme={null} -- Live allowances the address has granted (the risk surface). SELECT token_address, spender_address, argMax(value, (block_number, log_index)) AS current_allowance FROM recipe_token_approvals.fact_token_approvals FINAL WHERE chain_id = 1 AND owner_address = lower('0x…') GROUP BY token_address, spender_address HAVING current_allowance != '0' AND current_allowance != '' ORDER BY token_address, spender_address; ``` Use `argMax` over `(block_number, log_index)` rather than a bare `WHERE sign = 1` so the read is correct under the collapsing log-table model and converges after reorgs. ### Notes and considerations * **Read canonical state correctly.** On ClickHouse, every fact table follows the collapsing log-table pattern. Read with `FINAL` or a sign-aware aggregate (`argMax`, `sum(sign)`), never a bare `WHERE sign = 1`, so the trail stays correct across chain reorganizations. * **Approvals are EVM-only** (ERC-20 `Approval(owner, spender, value)`). Value the *exposure*, not allowance × price. An unlimited approval is `2^256-1`, so dollar-weighting it is meaningless; treat unrevoked unlimited allowances as a categorical risk flag. * **Chains.** Wallet History, Token Transfers, Token Balances by Wallet, Native Balances, and Swaps by Wallet are chain-parametrized across EVM and Solana; Token Approvals is EVM only. * **Counterparty enrichment is yours.** The templates deliver the complete, ordered primitives: addresses, amounts, directions, counterparties. Sanctions screening, address labelling, and risk scoring are downstream layers your application runs over this trail. * **Decimals and USD.** Scale raw `amount` / `value` text fields by `10^token_decimals` before reporting; source decimals from a Token Metadata sync. Wallet History folds USD inline where decimals are known (swaps, LP changes); Swaps by Wallet carries `notional_usd` per trade. * **Completeness for audit.** Run the ClickHouse path in `hybrid` mode so the trail backfills full history and then stays current, reorg-safe, at the chain head. * **Pairing.** For valuation across every asset, add [Token Prices](/data-feeds/templates/token/token-prices); for holder-side context on a token of interest, add [Token Holders](/data-feeds/templates/token/token-holders). ### Get started Start with the templates in this workflow, then follow the Quickstart to run them. > [card] [Get started](/data-feeds/migration/quickstart) > > Build an owned, auditable per-address trail. # Onchain Event Indexing Source: https://docs.moralis.com/data-feeds/use-cases/event-indexing A Data Feeds template bundle for indexing raw event logs (every event from a contract, or one event signature across all contracts) into your own database for custom decoding and analytics. ### Who it's for Teams that need **raw onchain events** in their own database: protocol teams indexing their own contracts, analytics platforms building chain-wide event feeds, and data teams covering **custom or non-standard events** that the decoded endpoints don't model. The output is a complete, ordered, reorg-safe log table you decode against your own ABIs. ### Raw logs vs decoded templates Data Feeds ships two kinds of event data. Reach for raw logs when the decoded path doesn't cover what you need: | Use… | When | | - | - | | **Decoded templates** (Token Transfers, Token Approvals, Swaps, NFT Transfers) | The event is a standard, already-decoded type: you want typed columns, no ABI decoding. | | **Raw log templates** (this use case) | A custom/unsupported contract or event, or you want *every* event a contract emits, or one signature chain-wide. You'll decode `data` against your own ABI. | ### The template bundle | Template | Role | | - | - | | [Contract Logs](/data-feeds/templates/logs/contract-logs) | Every raw event log emitted by a specific contract, in on-chain order. The "index my protocol's contracts" path. Optional `(contract, topic0)` grouping for high-volume contracts. | | [Logs by Event Signature](/data-feeds/templates/logs/logs-by-topic0) | One event signature (`topic0`) across **all** contracts, chain-wide: every `Transfer`, `Approval`, `Swap`, etc. The "index one event everywhere" path. Optional `(topic0, contract)` grouping. | ### Two access patterns ```text theme={null} Contract Logs Logs by Event Signature key: contract_address key: topic0 "everything contract "this event across X emitted" all contracts" ``` * **By contract**: point Contract Logs at your protocol's addresses and get a complete, ordered event log per contract. Decode in your application against the contract ABI. * **By event signature**: point Logs by Event Signature at a `topic0` and capture that event chain-wide. Because popular signatures (`Transfer`, `Approval`) span the whole chain, scope reads to a block range. Enable the optional `(topic0, contract)` grouping when you frequently narrow to specific contracts within a signature. ### Decoding the payload Both templates are intentionally raw: `topic0` is the event signature hash, `topic1…topic3` are the indexed parameters, and `data` is the ABI-encoded non-indexed payload as hex. Decode `data` (and interpret the indexed topics) against the event ABI in your application. Data Feeds delivers the complete, ordered, reorg-safe primitives; the decode layer stays under your control. ### Notes and considerations * **EVM only.** Raw log extraction covers EVM event logs (`topic0…3` + `data`). Solana program logs are a different model. * **Heavier source.** Logs come from the wide raw `block` data (all logs and transactions per block), so per-block volume is higher than the compact decoded templates. `tx_hash` is recovered by joining each log to its sibling transaction row; drop that join if you don't need it. * **Scope popular signatures.** A chain-wide `Transfer`/`Approval` feed is large. Bound it to a block range and run the ClickHouse path for live, reorg-safe ingestion. * **Pair with decoded templates.** Use raw logs for the long tail and custom events; use the decoded templates where a typed, ready-made shape already exists. ### Get started Start with the templates in this workflow, then follow the Quickstart to run them. > [card] [Get started](/data-feeds/migration/quickstart) > > Index any contract or event into your own infrastructure. # NFT Marketplace Source: https://docs.moralis.com/data-feeds/use-cases/nft-marketplace A Data Feeds template bundle for NFT marketplaces and analytics platforms: collection trade history, current ownership, wallet inventories, and collection metadata, synced into your own database. ### Who it's for Teams building **NFT marketplaces, collection explorers, and NFT analytics** platforms need sale history, current ownership, and per-wallet inventories without polling an API per page view. The output is your own set of tables: every marketplace trade, the live owner of every token, what each wallet holds, and the collection metadata to label it all. ### The template bundle This use case combines a handful of templates. Start with **NFT Trades** for sale history, layer **NFT Owners by Contract** and **NFTs by Wallet** for the two ownership views, and add **NFT Collection Metadata** to label collections. Drop down to **NFT Transfers** when you need the raw movement feed under the trades. | Template | Role in this use case | | - | - | | [NFT Trades](/data-feeds/templates/nft/nft-trades) | The sale feed: every marketplace trade (seller, buyer, collection, token ID, price, marketplace) by collection, by single token, or by wallet as seller/buyer. | | [NFT Owners by Contract](/data-feeds/templates/nft/nft-owners-by-contract) | Current owners of a collection: the latest non-zero holding per `(token_id, wallet)`. The holder list and floor/holder analytics base. | | [NFTs by Wallet](/data-feeds/templates/wallet/nfts-by-wallet) | A wallet's NFT inventory: every token a wallet currently holds, keyed by `(wallet, token_address, token_id)`. | | [NFT Collection Metadata](/data-feeds/templates/nft/nft-collection-metadata) | Collection-level metadata (name, symbol, ERC-721/1155 type, deployer) to label collections across every other table. | | [NFT Transfers](/data-feeds/templates/nft/nft-transfers) | The raw movement feed: every NFT transfer (mints, burns, plain sends, and the transfer legs of trades). Provenance and the substrate the ownership views are built from. | > [!NOTE] > > **Trades and transfers are different feeds.** NFT Transfers is *every* movement of a token: mints, gifts, wallet-to-wallet sends, and the transfer leg of a marketplace sale. NFT Trades is the subset that settled through a marketplace, re-assembled with seller, buyer, price, and the marketplace address. Use Trades for sale history and volume; use Transfers for full provenance and to drive ownership. ### How the pieces fit ```text theme={null} NFT Collection Metadata (labels everything) │ NFT Transfers ──► NFT Owners by Contract (owners of a collection) (movements)└─► NFTs by Wallet (a wallet's inventory) NFT Trades ─────► sale history · volume · floor / last-sale ``` * **NFT Transfers** is the substrate: every `(token_address, token_id)` movement, in on-chain order. The two ownership views are the same ingest sorted two ways: **NFT Owners by Contract** keys on `(token_address, token_id, wallet)` to answer "who owns this collection," and **NFTs by Wallet** keys on `(wallet, token_address, token_id)` to answer "what does this wallet hold." * **NFT Trades** is the marketplace-settled subset, enriched with seller, buyer, price, and marketplace address: the feed behind sale history, volume charts, and last-sale prices. * **NFT Collection Metadata** is the label layer: join `token_address` to attach a collection's name, symbol, and contract type to any trade, holding, or transfer row. ### Building a collection dashboard A typical collection page needs sale history and the current holder set, labeled with collection metadata. The trades feed answers sale history and volume directly: ```sql theme={null} -- Recent sales for a collection, newest first. SELECT t.block_number, t.token_id, t.seller_address, t.buyer_address, t.price, t.price_token_address, t.marketplace_address, t.tx_hash FROM recipe_nft_trades.fact_nft_trades AS t FINAL WHERE t.chain_id = 1 AND t.token_address = lower('0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D') ORDER BY t.block_number DESC LIMIT 50; ``` The current holder set comes from the ownership view: read the latest non-zero holding per `(token_id, wallet)` with a sign-aware aggregate over `FINAL`: ```sql theme={null} -- Current owners of a collection (latest non-zero holding per token_id + wallet). SELECT token_id, wallet_address, argMax(contract_type, (block_number, log_index)) AS contract_type, argMax(amount, (block_number, log_index)) AS current_amount FROM recipe_nft_owners_by_contract.fact_nft_owners_by_contract FINAL WHERE chain_id = 1 AND token_address = lower('0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D') GROUP BY token_id, wallet_address HAVING current_amount != '0' AND current_amount != '' ORDER BY token_id, wallet_address; ``` Label either result with a collection row from the metadata sync (latest deploy wins, defensive against CREATE2 re-deploys): ```sql theme={null} SELECT token_address, argMax(name, (block_number, transaction_index)) AS name, argMax(symbol, (block_number, transaction_index)) AS symbol, argMax(contract_type, (block_number, transaction_index)) AS contract_type FROM recipe_nft_collection_metadata.fact_nft_collection_metadata FINAL WHERE chain_id = 1 AND token_address = lower('0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D') GROUP BY token_address; ``` ### Notes and considerations * **Read canonical state correctly.** ClickHouse templates use the collapsing log-table pattern. Read with `FINAL` or a sign-aware aggregate (`argMax` over the latest `(block_number, log_index)`), never a bare `WHERE sign = 1`, which double-counts reorged rows. * **No off-chain enrichment.** The trade and transfer arrays carry no marketplace human-name, no USD price, and no address labels. `price` is in `price_token_address` units; value it in USD by joining a Token Prices sync, and resolve marketplace/address names in your own application. * **Ownership = current state.** NFT Owners by Contract and NFTs by Wallet keep the *latest* holding per key; filter to non-zero amounts to drop wallets that transferred out. For full history, read NFT Transfers or NFT Trades directly. * **ERC-721 vs ERC-1155.** `contract_type` carries the discriminator. ERC-1155 `amount` can exceed 1 per `(token_id, wallet)`; raw `uint256` amounts are stored as text. Compare against `'0'`, don't assume a single-owner-per-token model. * **Chains.** NFT Trades, Transfers, Owners by Contract, NFTs by Wallet, and Collection Metadata are chain-parametrized: point them at any supported EVM chain or Solana. Solana marketplace trades (Magic Eden, Tensor, and others) populate the same trade shape; trade identity is widened with `(seller, buyer, token_address, token_id)` to keep rows distinct where one instruction shares a `log_index`. * **Scale and live tailing.** Run the ClickHouse path in `hybrid` mode to backfill collection history and then stay current, reorg-safe, at the chain head. For a chain-wide view across many collections, the by-collection and by-token-id prefixes keep reads scoped. * **Pair with other templates.** Add [Token Prices](/data-feeds/templates/token/token-prices) to value trades in USD, and [Wallet History](/data-feeds/templates/wallet/wallet-history) for a per-wallet feed that already folds NFT transfers in alongside tokens and swaps. ### Get started Start with the templates in this workflow, then follow the Quickstart to run them. > [card] [Get started](/data-feeds/migration/quickstart) > > Build NFT marketplace and analytics data into your own infrastructure. # Portfolio Tracking Source: https://docs.moralis.com/data-feeds/use-cases/portfolio-tracking A Data Feeds template bundle for portfolio apps, wallets, and dashboards: every token, native asset, and NFT a wallet holds, valued in USD, synced into your own database. ### Who it's for Teams building **portfolio apps, wallets, and dashboards** need to show what a wallet holds right now and what it's worth. The goal is a current-holdings view you own: every token balance, native-asset balance, and NFT, each marked in USD, refreshed live at the chain head. ### The template bundle This use case combines three balance templates, one per asset class, with **Token Prices** for valuation. Each balance template is keyed by wallet, so "everything wallet Y holds" is a single prefix scan. | Template | Role in the portfolio | | - | - | | [Token Balances by Wallet](/data-feeds/templates/wallet/token-balances-by-wallet) | Every ERC-20 / SPL token a wallet holds, with its current balance: the core fungible-holdings table, keyed by wallet. | | [Native Balances](/data-feeds/templates/wallet/native-balances) | The wallet's native-asset (gas-token) balance (ETH, BNB, SOL, etc.), tracked separately from tokens. | | [NFTs by Wallet](/data-feeds/templates/wallet/nfts-by-wallet) | Every NFT a wallet holds: collection address, token ID, and ERC-721 / ERC-1155 type. | | [Token Prices](/data-feeds/templates/token/token-prices) | The valuation join target: the latest USD/native mark per token used to value fungible holdings. | > [!NOTE] > > Balances are tracked as **post-balance observations**: each template records the holder's balance *after* every transfer it was part of, so the latest observation per `(wallet, asset)` is the current balance. No periodic re-scan of the chain is needed. ### How the pieces fit ```text theme={null} Token Balances by Wallet ──┐ Native Balances ──┼──► current holdings ◄── valued by ── Token Prices NFTs by Wallet ──┘ (per wallet) ``` * **The three balance templates** each unpivot every transfer into per-wallet `(from, post-balance)` and `(to, post-balance)` observations. The latest observation per `(wallet, asset)`, `argMax` over `(block_number, log_index)`, is the live holding. Token and NFT balances are keyed by `(chain_id, wallet_address, token_address[, token_id])`; native balances drop `token_address` and tiebreak on `native_seq` (native transfers carry no `log_index`). * **Token Prices** is the connective tissue: join each fungible balance to its token's latest mark to value the holding. The template ships a carry-forward `latest_token_price_dict`, so even quiet tokens keep their last on-chain mark: a single `dictGet` per token. ### Valuing a wallet's fungible holdings Read the current non-zero token balances for a wallet, then value each against the latest USD mark from the Token Prices sync: ```sql theme={null} SELECT b.token_address, b.current_balance, dictGetOrDefault( 'recipe_token_price_history.latest_token_price_dict', 'usd_price', tuple(b.chain_id, b.token_address), '0') AS usd_price FROM ( SELECT chain_id, token_address, argMax(balance, (block_number, log_index)) AS current_balance FROM recipe_token_balances_by_wallet.fact_balances_by_wallet FINAL WHERE chain_id = 1 AND wallet_address = lower('0x…') GROUP BY chain_id, token_address HAVING current_balance != '0' AND current_balance != '' ) AS b; ``` Scale `current_balance` by `10^token_decimals` before multiplying by `usd_price` to get a fully-scaled dollar value; source decimals from a Token Metadata sync. The native balance follows the same pattern against the Native Balances fact (tiebreak on `native_seq`), valued against a native-price feed. ### Notes and considerations * **Read canonical state.** All three balance facts and Token Prices use the collapsing log-table pattern. Read with `FINAL` (then `argMax`) or a sign-aware aggregate, never a bare `WHERE sign = 1`, or unmerged reorg counter-rows will skew balances. * **Decimals.** Balances are raw integer strings. Scale by `10^token_decimals` before displaying or valuing; pull decimals from a Token Metadata sync. * **Chains.** Token Balances and Token Prices are chain-parametrized (EVM + Solana); set the chain env vars per sync. NFTs by Wallet is EVM (ERC-721 / ERC-1155). * **Native vs token.** The native asset is not an ERC-20 and is tracked by its own template. Don't expect it in the token-balances table. Value it against a native-price mark, not the token-price dictionary. * **Pair with other templates.** Add [Wallet History](/data-feeds/templates/wallet/wallet-history) for the chronological feed behind a holding, and [Token Approvals](/data-feeds/templates/wallet/token-approvals) to surface outstanding allowances in a wallet's security view. * **Run mode.** Run the ClickHouse path in `hybrid` mode so balances backfill history and then stay current, reorg-safe, at the chain head. ### Get started Start with the templates in this workflow, then follow the Quickstart to run them. > [card] [Get started](/data-feeds/migration/quickstart) > > Build a live, valued portfolio view on your own infrastructure. # Token Analytics Source: https://docs.moralis.com/data-feeds/use-cases/token-analytics A Data Feeds template bundle for tracking a token's distribution and activity (holders, balances, transfers, transfer counters, and every DEX trade), synced into your own database. ### Who it's for Token and project teams, growth and analytics functions, and dashboards that need a live, owned view of **a token's distribution and activity**: who holds it, how it's spread, how much it moves, and how it trades. The output is a set of token-keyed tables in your own warehouse: the holder list and its balances, the full transfer log, per-token counters, and every DEX trade touching the token. ### The template bundle All of these templates read the same Moralis-indexed, normalized per-block onchain data and key by token, so they compose into one token-centric view. | Template | Role in the analytics view | | - | - | | [Token Holders](/data-feeds/templates/token/token-holders) | The holder list: every non-zero holder with their current balance and a best-effort USD value, derived from the absolute post-transfer balances. The "who owns it" leg. | | [Token Balances by Token](/data-feeds/templates/token/token-balances-by-token) | The same holder balances without the in-block USD valuation: the lean distribution table when you don't need price enrichment. | | [Token Stats](/data-feeds/templates/token/token-stats) | Per-token transfer counters: a reorg-safe rollup row per token, queried as one row for the full stats block. | | [Token Transfers](/data-feeds/templates/token/token-transfers) | The flat transfer log: one row per ERC-20 transfer of the token, the raw activity feed every counter and balance derives from. | | [Swaps by Token](/data-feeds/templates/markets/swaps-by-token) | Every DEX trade that touched the token, direct pool fills and aggregator-routed trades, USD-enriched in-block for volume and notional. | > [!NOTE] > > **Token Holders is Token Balances by Token plus the USD valuation leg.** If you only need the distribution table (addresses and balances), run Token Balances by Token alone. Add Token Holders when you want the in-block USD spot price and `usd_value` folded onto each holding. ### How the pieces fit ```text theme={null} Token Transfers ──┬──► Token Stats (per-token transfer counters) ├──► Token Balances by Token (latest balance per wallet) └──► Token Holders (balances + in-block USD value) Swaps by Token ──────► trade + volume feed (every DEX fill, USD-enriched) ``` * **Token Transfers** is the activity backbone: every movement of the token, one row each. It carries each side's absolute post-transfer balance, which is what makes the balance and holder views a latest-observation lookup rather than a running sum. * **Token Stats** folds the transfer stream into a per-token counter row: the cheap, always-current "how many transfers" answer, and the pattern to extend with any future per-token metric. * **Token Balances by Token** and **Token Holders** project the same transfers into the current balance per `(token, wallet)`; Token Holders adds the in-block USD spot price and best-effort `usd_value`. * **Swaps by Token** is the market leg: trading activity and USD volume, separate from raw transfers, so you can split "moved" from "traded." ### Distribution + activity in one read A token dashboard usually wants the headline numbers together: holder count, top holders, transfer count, and recent trading volume. Each comes from its own template's token-keyed table, read with `FINAL` or a sign-aware aggregate so reorgs are corrected. **Top holders with USD value** (Token Holders: `FINAL` collapses reorg `±1` pairs before `argMax`): ```sql theme={null} SELECT wallet_address, argMax(balance, (block_number, log_index)) AS current_balance, argMax(usd_price, (block_number, log_index)) AS usd_price FROM recipe_token_holders.fact_token_holders FINAL WHERE chain_id = 1 AND token_address = lower('0xA0b8...') GROUP BY wallet_address HAVING current_balance != '0' AND current_balance != '' ORDER BY toFloat64OrZero(current_balance) DESC LIMIT 100; ``` **Total transfer count** (Token Stats: `sum` is reorg-safe, the reverted block's `-1` rows cancel the original `+1`): ```sql theme={null} SELECT sum(transfers_total) AS transfers_total FROM recipe_token_stats.fact_token_stats WHERE chain_id = 1 AND token_address = lower('0xA0b8...'); ``` **24h DEX volume** (Swaps by Token: sign-aware, cheaper than `FINAL`): ```sql theme={null} SELECT sumIf(toFloat64OrZero(notional_usd), sign = 1) - sumIf(toFloat64OrZero(notional_usd), sign = -1) AS volume_usd FROM recipe_swaps_by_token.fact_swaps_by_token WHERE chain_id = 1 AND token_address = lower('0xA0b8...') AND event_ts >= now() - INTERVAL 1 DAY; ``` Holder count is the same Token Holders table wrapped in a `count()` over the non-zero `argMax` balances; the raw activity behind any of these numbers is a scan of `recipe_token_transfers.fact_token_transfers` filtered to the token. ### Notes and considerations * **Read canonical state correctly.** On ClickHouse, read with `FINAL` or a sign-aware aggregate (`sum`, `sumIf … sign`), never a bare `WHERE sign = 1`. The collapsing/summing log tables converge on canonical state on merge; a bare sign filter sees uncollapsed reorg rows. * **Balances are observations, not deltas.** Token Holders and Token Balances by Token rely on the absolute `fromPostBalance` / `toPostBalance` carried on each transfer, so the current holding is just the latest observation per `(token, wallet)`: no reconstruction. The EVM zero address (mint/burn counterparty) is skipped. * **Decimals and USD.** Token Holders' `usd_value` is a best-effort in-block mark using a fixed scale; for precise reporting, scale raw amounts by `10^token_decimals` from a Token Metadata sync and value against a Token Prices feed. * **EVM + Solana.** These templates are chain-parametrized; set the Solana chain env vars to run the same shapes against Solana, where the event ids stay row-unique despite repeated `logIndex` within an instruction. * **Run mode and scale.** Run the ClickHouse path in `hybrid` mode to backfill history and then tail the chain head, reorg-safe. A high-volume token's transfer and swap tables are large; scope chain-wide reads to a block or time range, and lean on the token-first sort key for prefix scans. * **Pair with other templates.** Add [Token Prices](/data-feeds/templates/token/token-prices) for precise valuation and price history, and [Token Metadata](/data-feeds/templates/token/token-metadata) for decimals, name, and symbol on your dashboard. ### Get started Start with the templates in this workflow, then follow the Quickstart to run them. > [card] [Get started](/data-feeds/migration/quickstart) > > Track a token's holders, transfers, and trading in your own database. # Trading & Charting Source: https://docs.moralis.com/data-feeds/use-cases/trading-charting A Data Feeds template bundle for trading terminals, charting UIs, and bots: every DEX trade per pool and per token, candles, live reserves, and USD marks, synced into your own database. ### Who it's for Teams building **trading terminals, charting UIs, market-data backends, and trading bots** need live, owned market data keyed by pool/pair or by token. The goal is your own market-data store: every fill on a pool, every trade touching a token, OHLCV candles, current pool reserves, and a USD mark for every asset, all reorg-safe and current at the chain head. ### The template bundle This use case combines the markets templates. **Swaps by Pair** is the trade backbone (one row per fill); **Pair OHLCV** is a downstream aggregation of that same trade ingest; **Swaps by Token** re-keys the trades for token-centric views; **Pair Reserves** and **Token Prices** add live state and valuation. | Template | Role in the terminal | | - | - | | [Swaps by Pair](/data-feeds/templates/markets/swaps-by-pair) | The trade backbone: every fill on a pool/pair (direct pool fills and aggregator-routed trades), one row per trade, USD-enriched in-block. The "trade tape" for a pool. | | [Swaps by Token](/data-feeds/templates/markets/swaps-by-token) | The same trades re-keyed by token: every trade that touched token X, found under either side of the pair. The token-centric tape. | | [Pair OHLCV](/data-feeds/templates/markets/pair-ohlcv) | Time-bucketed open/high/low/close + volume + trade count per pool, built by aggregating the swap ingest into candles. | | [Pair Reserves](/data-feeds/templates/markets/pair-reserves) | Current `reserve0` / `reserve1` per pool, read from each swap's pool post-balances: live depth without a running sum. | | [Token Prices](/data-feeds/templates/token/token-prices) | USD/native mark history per token, plus a latest-mark dictionary for carry-forward valuation of quiet positions. | > [!NOTE] > > **Swaps by Pair, Swaps by Token, and Pair OHLCV share one trade projection.** They are the same trade ingest shaped three ways: one row per fill keyed by pool, the same fills re-keyed by token, and those fills bucketed into candles. Pick the keys your screens read; you don't need all three if one access pattern covers your UI. ### How the pieces fit ```text theme={null} ┌──► Swaps by Pair (trade tape, by pool) trade fills ────────┼──► Swaps by Token (trade tape, by token) └──► Pair OHLCV (candles, by pool) pool post-balances ──► Pair Reserves (live depth, by pool) price updates ──► Token Prices (USD/native marks, by token) ``` * **The swap templates** all draw from the same normalized in-block trade events, direct pool fills (`tokenSwaps`) and aggregator-routed trades (`aggregateTokenSwaps`), so every fill lands exactly once. Key by pool for a pool's tape, by token for a token's tape. * **Pair OHLCV** is a downstream aggregation of that ingest: the same trades land, then a candle surface buckets them per `(pool, hour)`. "Price" per fill is the bought-leg in-block USD mark; `volume` is summed notional; `trades` is the count. * **Pair Reserves** reads the pool's absolute `token0PostBalance` / `token1PostBalance` from each swap, so current reserves are simply the latest observation per pair: live depth without reconstructing a running sum. * **Token Prices** is the connective tissue for valuation: join any trade, balance, or position to the token's mark, and use the latest-mark dictionary to value quiet positions with no fresh update. ### Building a pool overview A trading terminal's pool screen wants the live tape, the candles, the current depth, and a mark: each from its own template, keyed by the same pool. Read ClickHouse with `FINAL` or a sign-aware aggregate so reorg `±1` pairs collapse before you aggregate; never a bare `WHERE sign = 1`. The trade tape for a pool, newest first: ```sql theme={null} SELECT event_ts, side, source_kind, token0_address, token1_address, amount0, amount1, notional_usd, protocol FROM recipe_swaps_by_pair.fact_swaps_by_pair FINAL WHERE chain_id = 1 AND pool_address = lower('0x88e6A0c2dDD26FEEb64F039a2c41296FcB3f5640') ORDER BY event_ts DESC LIMIT 50; ``` The hourly candles backing the chart (fast sign-aware accelerator): ```sql theme={null} SELECT bucket_start, open, high, low, close, volume, trades FROM recipe_pair_ohlcv.candles WHERE chain_id = 1 AND pool_address = lower('0x88e6A0c2dDD26FEEb64F039a2c41296FcB3f5640') ORDER BY bucket_start DESC LIMIT 24; ``` The current depth (latest reserves; `FINAL` collapses reorg pairs before `argMax`): ```sql theme={null} SELECT pair_address, argMax(reserve0, (block_number, log_index)) AS reserve0, argMax(reserve1, (block_number, log_index)) AS reserve1 FROM recipe_pair_reserves.fact_pair_reserves FINAL WHERE chain_id = 1 AND pair_address = lower('0x88e6A0c2dDD26FEEb64F039a2c41296FcB3f5640') GROUP BY pair_address; ``` And the latest USD mark for either side, via the Token Prices dictionary (O(1), refreshes every 30–60s, no fresh trade required): ```sql theme={null} SELECT dictGetOrDefault( 'recipe_token_price_history.latest_token_price_dict', 'usd_price', tuple(1, lower('0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2')), '0' ) AS usd_price; ``` For a token's market overview across all its pools, swap `fact_swaps_by_pair` for `recipe_swaps_by_token.fact_swaps_by_token` keyed on `token_address`. ### Notes and considerations * **EVM + Solana.** The trade, candle, reserve, and price templates are chain-parametrized. On Solana, repeated `logIndex` within one instruction means the pool-fill `vendor_event_id` should be widened (e.g. with the token addresses/amounts) to keep rows distinct; the candle math is chain-agnostic. * **One trade, two pool addresses.** A fill observed both as a direct pool fill (`pairAddress`) and as part of an aggregator route (`aggregatorAddress`) appears under both; they are distinct events by design. `source_kind` (`pool_fill` vs `aggregator`) tells them apart. * **USD is in-block only.** Trades, candles, and notional are enriched from same-block `tokenPriceUpdates`. No cross-block carry-forward. Illiquid or brand-new tokens with no in-block mark leave `price_usd` / `notional_usd` `NULL` (and produce candle gaps for that hour). For valuing quiet positions, use the Token Prices latest-mark dictionary, which carries the last on-chain mark forward. * **OHLCV is fixed 1-hour and trade-reconstructed.** Candles are built from on-chain swap fills, so they can differ slightly from a DEX's own reported OHLC. For other intervals, re-bucket the trade ingest. Use `candles` for the fast accelerator and `candles_exact` (over `fact_swaps FINAL`) when post-reorg precision on high/low matters; `volume` and `trades` are sign-weighted and always exact. * **Reserves need an in-window swap.** Current reserves come from swap post-balances, so a pool appears only if it had at least one swap with resolved post-balances in the ingested window. Quiet pools have unchanged reserves by definition. Widen the window to pick them up. * **Run ClickHouse in `hybrid` for live terminals.** It backfills history then hands off to a seamless, reorg-safe realtime tail at the chain head. Postgres/MySQL are first-class for historical backfill; the trade templates expand many rows per block, so live/reorg-safe ingestion is ClickHouse-only. * **Pair with other bundles.** Add [Swaps by Wallet](/data-feeds/templates/markets/swaps-by-wallet) for per-user trade history, or see [Token Analytics](/data-feeds/use-cases/token-analytics) and [Portfolio Tracking](/data-feeds/use-cases/portfolio-tracking) for adjacent template bundles. ### Get started Start with the templates in this workflow, then follow the Quickstart to run them. > [card] [Get started](/data-feeds/migration/quickstart) > > Build a live, owned market-data backend. # Get Your API Key Source: https://docs.moralis.com/get-started/get-your-api-key Learn how to get your Moralis API Key To start using Moralis products, you’ll need an API key to authenticate your requests. Follow this quick guide to create your account and retrieve your API key - then you'll be ready to make your [first request](/data-api/first-request). ## 1. Create Your Account Create your **Moralis account** by visiting the [Moralis Dashboard](https://admin.moralis.com/register). ![Create Account Web](https://mintcdn.com/moralis/z0RKSaPe_EdRhxsG/images/moralis-login.png?fit=max\&auto=format\&n=z0RKSaPe_EdRhxsG\&q=85\&s=5a6bc8dfdb01397425ec88b49d4bdf0a) > [!TIP] > > Moralis doesn't have a self-serve free plan. To try it before you subscribe, request a free trial and the team will reach out. > > Request a free trial ## 2. Navigate to Data APIs Once registered, navigate to the [Data APIs section](https://admin.moralis.com/data-api) in the dashboard. ![Moralis Dashboard](https://mintcdn.com/moralis/z0RKSaPe_EdRhxsG/images/moralis-dashboard.png?fit=max\&auto=format\&n=z0RKSaPe_EdRhxsG\&q=85\&s=c94279f9375fad567c87872171cff4ea) ## 3. Copy Your API Key Click the **copy** icon next to your API key to add it to your clipboard. ![Moralis Data APIs](https://mintcdn.com/moralis/z0RKSaPe_EdRhxsG/images/moralis-data-api.png?fit=max\&auto=format\&n=z0RKSaPe_EdRhxsG\&q=85\&s=3c729d301882d20c8eff1bb961e0f025) ## 4. Manage API keys (optional) You can also manage your keys from the **API Keys** section - including creating new keys or rotating existing ones. ![Moralis Api Keys Pn](https://mintcdn.com/moralis/z0RKSaPe_EdRhxsG/images/moralis-api-keys.png?fit=max\&auto=format\&n=z0RKSaPe_EdRhxsG\&q=85\&s=a5bc1c4c72a465c3d47eb872fa164648) That's it - you're now ready to make your [first API request](/data-api/first-request) # Global API Reference Source: https://docs.moralis.com/get-started/global-api-reference This is a single, consolidated quick-reference catalog of the Moralis Data API endpoints. A unified API to fetch balances, transfers, DeFi positions, PnL, NFTs, and fully decoded wallet activity across multiple chains. ### EVM Wallet API A comprehensive suite of wallet-focused endpoints: balances, history, DeFi positions, PnL, approvals, and identity resolution. | Endpoint | Description | | :- | :- | | [Wallet History](/data-api/evm/wallet/wallet-history) | Complete decoded activity feed for a wallet. | | [Wallet Transactions](/data-api/evm/wallet/wallet-transactions) | Raw transaction list for a wallet. | | [Decoded Transactions](/data-api/evm/wallet/decoded-transactions) | Human-readable transaction data and summaries. | | [Token Balances](/data-api/evm/wallet/token-balances) | Current ERC-20 holdings for a wallet. | | [Token Balances (Legacy)](/data-api/evm/wallet/token-balances-legacy) | Legacy token balance endpoint. | | [Token Transfers](/data-api/evm/wallet/token-transfers) | ERC-20 transfer history for a wallet. | | [Native Balance](/data-api/evm/wallet/native-balance) | Native currency balance for a wallet. | | [Native Balances (Batch)](/data-api/evm/wallet/native-balances-batch) | Native balances for multiple wallets. | | [NFT Balances](/data-api/evm/wallet/nft-balances) | Current NFT holdings for a wallet. | | [NFT Collections](/data-api/evm/wallet/nft-collections) | NFT collections held by a wallet. | | [NFT Transfers](/data-api/evm/wallet/nft-transfers) | NFT transfer history for a wallet. | | [NFT Trades](/data-api/evm/wallet/nft-trades-by-wallet) | NFT trade history for a wallet. | | [Net Worth](/data-api/evm/wallet/net-worth) | Total wallet value in USD. | | [Wallet P\&L](/data-api/evm/wallet/wallet-pnl) | Profit / loss calculated per token. | | [Wallet P\&L Summary](/data-api/evm/wallet/wallet-pnl-summary) | Aggregated profit / loss summary. | | [Wallet Stats](/data-api/evm/wallet/wallet-stats) | General wallet statistics. | | [Wallet Swaps](/data-api/evm/wallet/wallet-swaps) | DEX swap history for a wallet. | | [Approvals](/data-api/evm/wallet/approvals) | Token approval / allowance data for a wallet. | | [Chain Activity](/data-api/evm/wallet/chain-activity) | Multi-chain activity summary for a wallet. | | [Wallet Protocols](/data-api/evm/wallet/wallet-protocols) | Summary of DeFi protocols used by a wallet. | | [Wallet Positions](/data-api/evm/wallet/wallet-positions) | DeFi positions per protocol. | | [Detailed Positions](/data-api/evm/wallet/detailed-positions) | Enhanced DeFi position breakdown. | | [ENS Lookup](/data-api/evm/wallet/ens-lookup) | Resolve an ENS name to an address. | | [Resolve Address](/data-api/evm/wallet/resolve-address) | Reverse-resolve an address to an ENS name. | ### EVM Token API The most powerful Token API in Web3 — fetch, analyse, and monitor ERC-20 tokens across multiple chains, covering prices, balances, transfers, liquidity, holders, volume, profitability, and advanced safety signals. #### Prices | Endpoint | Description | | :- | :- | | [Token Price](/data-api/evm/token/prices/token-price) | Get real-time and historical price for a token. | | [Token Prices (Batch)](/data-api/evm/token/prices/token-prices-batch) | Get prices for multiple tokens in one call. | | [OHLC Candlesticks](/data-api/evm/token/prices/ohlc) | Get historical OHLC (Open-High-Low-Close) data. | #### Transfers | Endpoint | Description | | :- | :- | | [Token Transfers](/data-api/evm/token/transfers/token-transfers) | Get transfer history by wallet or token contract. | #### Metadata | Endpoint | Description | | :- | :- | | [Token Metadata](/data-api/evm/token/metadata/token-metadata) | Get token details including name, symbol, and logo. | | [Token Score](/data-api/evm/token/metadata/token-score) | Get safety / quality score for a token. | | [Token Score Timeseries](/data-api/evm/token/metadata/token-score-timeseries) | Historical token score data over time. | #### Pairs & Swaps | Endpoint | Description | | :- | :- | | [Token Pairs](/data-api/evm/token/swaps/token-pairs) | Get DEX trading pairs, reserves, and liquidity data. | | [Pair Stats](/data-api/evm/token/swaps/pair-stats) | Get stats for a specific DEX pair. | | [Pair Swaps](/data-api/evm/token/swaps/pair-swaps) | Get recent swaps for a specific pair. | | [Token Swaps](/data-api/evm/token/swaps/token-swaps) | Get swap history for a token. | #### Holders | Endpoint | Description | | :- | :- | | [Token Holders](/data-api/evm/token/holders/token-holders) | Get current holders of a token. | | [Token Holder Stats](/data-api/evm/token/holders/token-holder-stats) | Get holder distribution and statistics. | #### Discovery | Endpoint | Description | | :- | :- | | [Token Categories](/data-api/evm/token/discovery/token-categories) | Get available token categories. | #### Signals | Endpoint | Description | | :- | :- | | [Top Traders](/data-api/evm/token/signals/top-traders) | Get top profitable traders for a token. | ### EVM NFT API Everything needed to build NFT experiences: metadata, ownership, transfers, sales, rarity, floor prices, and marketplace activity. #### Collections | Endpoint | Description | | :- | :- | | [NFT Collections by Wallet](/data-api/evm/nft/collections/nft-collections-by-wallet) | Get NFT collections held by a wallet. | | [NFTs by Collection](/data-api/evm/nft/collections/nfts-by-collection) | Get all NFTs in a collection. | | [NFTs by Wallet](/data-api/evm/nft/collections/nfts-by-wallet) | Get all NFTs owned by a wallet. | #### Metadata | Endpoint | Description | | :- | :- | | [NFT Metadata](/data-api/evm/nft/metadata/nft-metadata) | Get metadata for a specific NFT. | | [NFT Metadata (Batch)](/data-api/evm/nft/metadata/nft-metadata-batch) | Get metadata for multiple NFTs. | | [Collection Metadata](/data-api/evm/nft/metadata/collection-metadata) | Get collection-level metadata. | | [Collection Metadata (Batch)](/data-api/evm/nft/metadata/collection-metadata-batch) | Get metadata for multiple collections. | | [Collection Stats](/data-api/evm/nft/metadata/collection-stats) | Get statistics for a collection. | #### Ownership | Endpoint | Description | | :- | :- | | [Owners by Contract](/data-api/evm/nft/ownership/owners-by-contract) | List all owners of a collection. | | [Owners by Token ID](/data-api/evm/nft/ownership/owners-by-token-id) | Get owner(s) of a specific NFT. | #### Prices | Endpoint | Description | | :- | :- | | [Collection Floor Price](/data-api/evm/nft/prices/collection-floor-price) | Current floor price for a collection. | | [Floor Price by Token ID](/data-api/evm/nft/prices/floor) | Floor price for a specific token. | | [Historical Floor Price](/data-api/evm/nft/prices/historical-floor-price) | Floor price history for a collection. | | [Sale Price by Contract](/data-api/evm/nft/prices/sale-price-by-contract) | Last sale prices for a collection. | | [Sale Price by Token ID](/data-api/evm/nft/prices/sale-price-by-token-id) | Last sale price for a specific NFT. | #### Trades | Endpoint | Description | | :- | :- | | [Collection Trades](/data-api/evm/nft/trades/collection-trades) | Recent sales for a collection. | | [Trades by Token ID](/data-api/evm/nft/trades/trades-by-token-id) | Trade history for a specific NFT. | #### Transfers | Endpoint | Description | | :- | :- | | [Collection Transfers](/data-api/evm/nft/transfers/collection-transfers) | Transfer history for a collection. | | [Token ID Transfers](/data-api/evm/nft/transfers/token-id-transfers) | Transfer history for a specific NFT. | #### Traits | Endpoint | Description | | :- | :- | | [NFTs by Traits](/data-api/evm/nft/traits/nfts-by-traits) | Filter NFTs by trait values. | | [Traits by Collection](/data-api/evm/nft/traits/traits-by-collection) | Get all traits for a collection. | | [Traits by Collection (Paginated)](/data-api/evm/nft/traits/traits-by-collection-paginated) | Paginated trait data for a collection. | #### Utilities | Endpoint | Description | | :- | :- | | [Resync NFT Metadata](/data-api/evm/nft/utilities/resync-nft-metadata) | Trigger a metadata refresh for an NFT. | | [Resync NFT Traits](/data-api/evm/nft/utilities/resync-nft-traits) | Trigger a traits refresh for a collection. | ### EVM DeFi API Track DeFi positions, balances, rewards, and protocol interactions with enriched, protocol-aware data. | Endpoint | Description | | :- | :- | | [Wallet Protocols](/data-api/evm/defi/wallet-protocols) | Summary of protocols used by a wallet. | | [Wallet Positions](/data-api/evm/defi/wallet-positions) | Detailed positions per protocol. | | [Detailed Positions](/data-api/evm/defi/wallet-positions-detailed) | Enhanced position breakdown. | ### EVM Price API Dedicated APIs to fetch comprehensive historical and real-time token and NFT price data. | Endpoint | Description | | :- | :- | | [Token Price](/data-api/evm/price/token-price) | Get real-time price for a token. | | [Token Prices (Batch)](/data-api/evm/price/token-prices-batch) | Get prices for multiple tokens. | | [OHLC Candlesticks](/data-api/evm/price/ohlc) | Get historical OHLC data. | | [Collection Floor Price](/data-api/evm/price/collection-floor-price) | Current floor price for an NFT collection. | | [Timeseries Floor Price](/data-api/evm/price/timeseries-floor-price) | Historical floor price data. | | [Token ID Floor Price](/data-api/evm/price/token-id-floor-price) | Floor price for a specific token ID. | | [Sale Prices by Collection](/data-api/evm/price/sale-prices-by-collection) | Sale prices for NFTs in a collection. | | [Sale Price by Token ID](/data-api/evm/price/sale-price-by-token-id) | Last sale price for a specific NFT. | ### EVM Blockchain API Core block-level data, logs, and internal transactions for EVM chains. | Endpoint | Description | | :- | :- | | [Address Transactions](/data-api/evm/blockchain/address-transactions) | Get transactions for an address. | | [Address Transactions (Decoded)](/data-api/evm/blockchain/address-transactions-decoded) | Get decoded transactions for an address. | | [Block by Hash](/data-api/evm/blockchain/block-by-hash) | Retrieve a block by its hash. | | [Block by Date](/data-api/evm/blockchain/block-by-date) | Retrieve the closest block to a given date. | | [Latest Block](/data-api/evm/blockchain/latest-block) | Get the latest block number. | | [Transaction by Hash](/data-api/evm/blockchain/transaction-by-hash) | Get a transaction by its hash. | | [Transaction by Hash (Decoded)](/data-api/evm/blockchain/transaction-by-hash-decoded) | Get a decoded transaction by its hash. | ### Solana API #### Solana Wallet API | Endpoint | Description | | :- | :- | | [Native Balance](/data-api/solana/wallet/native-balance) | Get the native SOL balance for a wallet. | | [Token Balances](/data-api/solana/wallet/token-balances) | Get SPL token balances for a wallet. | | [Wallet Swaps](/data-api/solana/wallet/wallet-swaps) | Get swap transactions for a wallet. | | [Wallet Portfolio](/data-api/solana/wallet/portfolio) | Get complete portfolio overview for a wallet. | | [NFT Balances](/data-api/solana/wallet/nft-balances) | Get NFT balances for a wallet. | #### Solana Token API **Metadata & Scores** | Endpoint | Description | | :- | :- | | [Token Metadata](/data-api/solana/token/token-metadata) | Get metadata for an SPL token. | | [Token Metadata (Batch)](/data-api/solana/token/token-metadata-batch) | Get metadata for multiple SPL tokens. | | [Token Score](/data-api/solana/token/token-score) | Get safety / quality score for a token. | | [Token Score Timeseries](/data-api/solana/token/token-score-timeseries) | Historical token score data. | **Prices** | Endpoint | Description | | :- | :- | | [Token Price](/data-api/solana/token/prices/token-price) | Get real-time price for a Solana token. | | [Token Prices (Batch)](/data-api/solana/token/prices/token-prices-batch) | Get prices for multiple Solana tokens. | | [OHLC Candlesticks](/data-api/solana/token/prices/ohlc) | Get OHLC price data for a Solana token. | **Pairs & Swaps** | Endpoint | Description | | :- | :- | | [Token Pairs](/data-api/solana/token/pairs/token-pairs) | Get DEX pairs for a Solana token. | | [Pair Stats](/data-api/solana/token/pairs/pair-stats) | Get stats for a specific pair. | | [Pair Swaps](/data-api/solana/token/pairs/pair-swaps) | Get recent swaps for a pair. | | [Token Swaps](/data-api/solana/token/swaps/token-swaps) | Get swap history for a token. | | [Wallet Swaps](/data-api/solana/token/swaps/wallet-swaps) | Get swap history for a wallet. | **Market Metrics** | Endpoint | Description | | :- | :- | | [Token Analytics](/data-api/solana/token/market-metrics/token-analytics) | Get market analytics for a token. | | [Token Analytics (Batch)](/data-api/solana/token/market-metrics/token-analytics-batch) | Get analytics for multiple tokens. | | [Token Analytics Timeseries](/data-api/solana/token/market-metrics/token-analytics-timeseries) | Historical analytics data. | **Discovery** | Endpoint | Description | | :- | :- | | [Token Search](/data-api/solana/token/search-and-discovery/token-search) | Search for Solana tokens by name or symbol. | #### Solana NFT API | Endpoint | Description | | :- | :- | | [NFT Metadata](/data-api/solana/nft/nft-metadata) | Get metadata for a Solana NFT. | #### Solana Price API | Endpoint | Description | | :- | :- | | [Token Price](/data-api/solana/price/token-price) | Get real-time price for a Solana token. | | [Token Prices (Batch)](/data-api/solana/price/token-prices-batch) | Get prices for multiple Solana tokens. | | [OHLC Candlesticks](/data-api/solana/price/ohlc) | Get OHLC price data for a Solana token. | ### Universal API Cross-chain data covering token analytics, entity data, and market metrics. #### Token API | Endpoint | Description | | :- | :- | | [Token Analytics](/data-api/universal/token/analytics/token-analytics) | Get cross-chain analytics for a token. | | [Token Analytics (Multi)](/data-api/universal/token/analytics/token-analytics-multi) | Get analytics for multiple tokens. | | [Token Analytics Timeseries](/data-api/universal/token/analytics/token-analytics-timeseries) | Historical cross-chain analytics. | | [Token Score](/data-api/universal/token/score/token-score) | Get cross-chain safety / quality score. | | [Token Score Timeseries](/data-api/universal/token/score/token-score-timeseries) | Historical token score data. | | [Token Search](/data-api/universal/token/search/token-search) | Search tokens across all chains. | | [Trending Tokens](/data-api/universal/token/trending-tokens) | Get currently trending tokens. | #### Entity API | Endpoint | Description | | :- | :- | | [Entity Search](/data-api/universal/entity/endpoints/entity-search) | Search for known entities (exchanges, protocols, etc.). | | [Entity by ID](/data-api/universal/entity/endpoints/entity-by-id) | Get entity details by ID. | | [Entity by Category](/data-api/universal/entity/endpoints/entity-by-category) | Get entities filtered by category. | | [Entity Categories](/data-api/universal/entity/endpoints/entity-categories) | List all entity categories. | ### Streams API Real-time blockchain event streaming via webhooks. Create and manage streams that push decoded blockchain data to your backend. #### Stream Management | Endpoint | Description | | :- | :- | | [Create Stream](/streams/api-reference/streams/create-streams) | Create a new stream. | | [Get Streams](/streams/api-reference/streams/get-streams) | List all streams. | | [Get Stream by ID](/streams/api-reference/streams/get-stream-by-id) | Get a specific stream. | | [Update Stream](/streams/api-reference/streams/update-stream) | Update stream configuration. | | [Update Stream Status](/streams/api-reference/streams/update-stream-status) | Pause or resume a stream. | | [Delete Stream](/streams/api-reference/streams/delete-stream) | Delete a stream. | | [Duplicate Stream](/streams/api-reference/streams/duplicate-stream) | Clone an existing stream. | #### Address Management | Endpoint | Description | | :- | :- | | [Add Address](/streams/api-reference/streams/add-address-to-stream) | Add an address to a stream. | | [Get Addresses](/streams/api-reference/streams/get-addresses-by-stream) | List addresses on a stream. | | [Replace Address](/streams/api-reference/streams/replace-address-on-stream) | Replace an address on a stream. | | [Delete Address](/streams/api-reference/streams/delete-address-from-stream) | Remove an address from a stream. | #### History & Replay | Endpoint | Description | | :- | :- | | [Get History](/streams/api-reference/history/get-history) | Get webhook delivery history. | | [Get Logs](/streams/api-reference/history/get-logs) | Get stream processing logs. | | [Replay History](/streams/api-reference/history/replay-history) | Replay missed webhook deliveries. | #### Project Settings | Endpoint | Description | | :- | :- | | [Get Project Settings](/streams/api-reference/project/get-project-settings) | Get current project settings. | | [Set Project Settings](/streams/api-reference/project/set-project-settings) | Update project settings. | #### Statistics | Endpoint | Description | | :- | :- | | [Get Stats](/streams/api-reference/stats/get-stats) | Get global stream statistics. | | [Get Stats by Stream](/streams/api-reference/stats/get-stats-by-stream) | Get statistics for a specific stream. | #### Webhook Data | Endpoint | Description | | :- | :- | | [Get Webhook Data by Block](/streams/api-reference/streams/get-webhook-data-by-block-number) | Get webhook payload for a specific block. | | [Send Webhook Data by Block](/streams/api-reference/streams/send-webhook-data-by-block-number) | Manually trigger webhook for a block. | # Pricing Source: https://docs.moralis.com/get-started/pricing Moralis plans, compute units and rate limits. There is no self-serve free plan; request a free trial from the team on this page. All Moralis plans come with generous monthly request limits. The number of included requests depends on your plan - see the [product pricing page](https://moralis.com/pricing) for details. Moralis uses **Compute Units (CUs)** as a standard way to measure and bill for usage across all products - including [Data API](/data-api/overview), [Streams](/streams/overview), and [RPC Nodes](/rpc-nodes/overview). CUs provide a unified way to account for **computational complexity** across every product, so usage is metered consistently regardless of which product you're using. ## Plan Overview | Plan | Price | CUs Included | RPS | RPC Nodes | Archive Data | | - | - | - | - | - | - | | Starter | \$149/mo | 2,000,000/mo | 40 | 5 | Yes | | Pro | \$249/mo | 100,000,000/mo | 80 | 20 | Yes | | Business | \$749/mo | 500,000,000/mo | 200 | Unlimited | Yes | | Enterprise | Custom | Custom | Custom | Unlimited | Yes | Prices shown are for monthly billing. Annual billing is also available - see the [pricing page](https://moralis.com/pricing) for current rates. [View all plans](https://moralis.com/pricing) ## Free Trial Moralis doesn't have a self-serve free plan. If you want to try Moralis before you subscribe, request a free trial with the form below and the team will reach out to set you up. ## What is a Compute Unit? A **Compute Unit (CU)** represents the relative computational cost of a request, task, or operation within the Moralis platform. Simple operations consume fewer CUs, while more complex or resource-intensive ones consume more. For example: * A basic wallet balance check may consume a small number of CUs. * A multi-chain portfolio aggregation, or a high-frequency stream of on-chain events, may consume significantly more. CUs ensure you're only billed for the resources you actually use - and that high-load workloads are fairly metered across the system. ## CU Cost Each product applies CU-based billing differently. Generally: * **CUs are deducted from your plan’s included quota**. * **Usage beyond your quota is billed as overage**, at the per-million rate for your plan. ### Overage Rates | Plan | Overage Rate | | - | - | | Starter | \$11.25 per million CUs | | Pro | \$5 per million CUs | | Business | \$4 per million CUs | | Enterprise | Custom | Overage applies once you exceed the CUs included in your plan. Higher plans carry a lower per-million rate, so sustained overage is usually a signal to upgrade. Visit the individual pricing pages to see how CUs apply to each product: * [Data API Pricing](/data-api/pricing) * [Streams Pricing](/streams/pricing) * [Nodes Pricing](/rpc-nodes/pricing) ## Dynamic Endpoints Some API endpoints have **dynamic CU costs** that scale based on the scope of the request. Instead of a fixed cost per call, these endpoints charge a base CU amount multiplied by a variable factor such as the number of chains, wallets, or addresses involved. For example: * An endpoint costing **50 CUs per chain** that queries 3 chains will consume **150 CUs** total. * An endpoint costing **250 CUs per chain** that queries 5 chains will consume **1,250 CUs** total. Dynamic endpoints are clearly marked on their respective documentation pages. You can find CU costs for all endpoints on the individual product pricing pages listed above. ## RPS Throughput Rate limits are enforced as **requests per second (RPS)**, separately from CU consumption. CUs meter how much you use, RPS caps how fast you can call. Each plan defines a maximum request rate, evaluated over a rolling 4-second window. This allows short bursts as long as your total request count stays within the limit across that window. Exceeding it returns a **429 Too Many Requests** response. See [Rate Limits](/data-api/resources/rate-limits) for the full breakdown. Different products may apply throughput differently. Check the respective documentation for details. # Quickstart Guides Source: https://docs.moralis.com/get-started/quickstart-guides Get up and running with Moralis APIs and services. Choose a product to get started: > [card] [Data API](/data-api/quickstart) > > Query blockchain data across 30+ chains with a unified API. > [card] [Streams](/streams/quickstart) > > Receive real-time blockchain events via webhooks. > [card] [RPC Nodes](/rpc-nodes/overview) > > Connect to blockchain nodes with reliable RPC endpoints. > [card] [Data Feeds](/data-feeds/overview) > > Build custom indexes with SQL-based queries (Early Access). > [card] [Auth API](/auth-api/overview) > > Authenticate users with wallet signatures. # Supported Chains Source: https://docs.moralis.com/get-started/supported-chains Overview of all blockchain networks supported by Moralis across Data APIs, Streams and RPC. ### Supported ChainsMoralis supports a wide range of EVM and non-EVM blockchain networks across its product stack, including Data APIs, Streams, and RPC nodes.This page provides a **high-level view of chain coverage across Moralis**, helping you quickly understand:- Which chains are actively supported - Which products are available per chain - Where coverage may differ between productsUse the selector below to filter the table by product.⚠️**Moonbeam and Moonriver are deprecated.** Both chains stopped producing new blocks on August 1, 2026, and Moralis support is removed on **September 25, 2026**, following Moonbeam's network relaunch on Base. GLMR and MOVR are now ERC-20 tokens on Base, so migrate to the `base` chain parameter and export any history you still need before that date. See the [deprecation notice](/changelog#moonbeam-moonriver-and-lisk-support-ends-september-25-2026) for contract addresses and details.⚠️**Lisk is deprecated.** Moralis support for Lisk ( `0x46f`) is removed on **September 25, 2026**, ahead of the Lisk Chain wind-down. Migrate to the `eth` or `base` chain parameter and export any history you still need before that date. See the [deprecation notice](/changelog#moonbeam-moonriver-and-lisk-support-ends-september-25-2026) for the full timeline. Showing chain . \ \ \ \ \ \ \ \ \
Chain NameTypeChain IDData APIStreamsDatashareRPC NodesAuth API
For product-specific details, see the dedicated supported-chains pages below\.Related pages:- [Data API Supported Chains](/data-api/supported-chains) - [Streams Supported Chains](/streams/supported-chains) - [RPC Node Supported Chains](/rpc-nodes/supported-chains) # How to Authenticate Users with Coinbase Wallet Source: https://docs.moralis.com/get-started/tutorials/auth-api/authenticate-users-with-coinbase-wallet This tutorial will teach you how to add secure Web3 Moralis authentication to your NextJS application by walking you through creating a full-stack Web3 authentication solution using the popular NextJS framework. ## Before Starting You can start this tutorial if you already have a NextJS dapp with [MetaMask sign-in](/get-started/tutorials/auth-api/authenticate-users-with-meta-mask) functionality. ## Configuring the Coinbase Wallet Connector 1. Open the `pages/signin.jsx` file and add `CoinbaseWalletConnector` as a connector to `connectAsync()`: ```javascript theme={null} import { CoinbaseWalletConnector } from 'wagmi/connectors/coinbaseWallet' import { signIn } from 'next-auth/react' import { useAccount, useConnect, useSignMessage, useDisconnect } from 'wagmi' import { useRouter } from 'next/router' import { useAuthRequestChallengeEvm } from '@moralisweb3/next' function SignIn() { const { connectAsync } = useConnect() const { disconnectAsync } = useDisconnect() const { isConnected } = useAccount() const { signMessageAsync } = useSignMessage() const { push } = useRouter() const { requestChallengeAsync } = useAuthRequestChallengeEvm() const handleAuth = async () => { if (isConnected) { await disconnectAsync() } const { account, chain } = await connectAsync({ connector: new CoinbaseWalletConnector({ options: { appName: 'amazing.finance', }, }), }) const userData = { address: account, chain: chain.id, network: 'evm' } const { message } = await requestChallengeAsync(userData) const signature = await signMessageAsync({ message }) // redirect user after success authentication to '/user' page const { url } = await signIn('moralis-auth', { message, signature, redirect: false, callbackUrl: '/user', }) /** * instead of using signIn(..., redirect: "/user") * we get the url from callback and push it to the router to avoid page refreshing */ push(url) } return (

Web3 Authentication

) } export default SignIn ``` ## Testing the Coinbase Wallet Connector Visit [`http://localhost:3000/signin`](http://localhost:3000/signin) to test authentication. 1. Click on `Authenticate via Coinbase Wallet` 2. Connect Coinbase Wallet 3. Sign the message 4. After successful authentication, you will be redirected to the `/user` page 5. Visit [`http://localhost:3000/user`](http://localhost:3000/user) to test the user session's functionality: * When a user is authenticated, we show the user's info on the page. * When a user is not authenticated, we redirect to the `/signin` page. * When a user is authenticated, we show the user's info on the page, even refreshing after the page. ([***`Explanation: After Web3 wallet authentication, the next-auth library creates a session cookie with an encrypted JWT [JWE] stored inside. It contains session info [such as an address and signed message] in the user's browser.`***](https://jwt.io/introduction)) # How to Authenticate Users with Magic.Link Source: https://docs.moralis.com/get-started/tutorials/auth-api/authenticate-users-with-magic-link This tutorial will teach you how to add secure Web3 Moralis authentication to your NextJS application by walking you through the task of creating a full-stack Web3 authentication solution using the popular NextJS framework. ## Before Starting You can start this tutorial if you already have a NextJS dapp with [MetaMask sign-in](/get-started/tutorials/auth-api/authenticate-users-with-meta-mask) functionality. ## Installing the Magic Connector [WAGMI Magic Connector](https://www.npmjs.com/package/@everipedia/wagmi-magic-connector) - the easiest way to add [Magic.Link authentication](https://magic.link/auth) for dapps using [wagmi](https://wagmi.sh/): ```bash npm2yarn theme={null} npm install @everipedia/wagmi-magic-connector ``` ## Configuring the Magic Connector 1. Open the`pages/signin.jsx` file and add `MagicConnector` as a connector to the `useConnect()` hook: ```javascript theme={null} import { MagicAuthConnector } from "@everipedia/wagmi-magic-connector"; import { signIn } from "next-auth/react"; import { useAccount, useConnect, useSignMessage, useDisconnect } from "wagmi"; import { useRouter } from "next/router"; import { useAuthRequestChallengeEvm } from "@moralisweb3/next"; function SignIn() { const { connectAsync } = useConnect({ connector: new MagicAuthConnector({ options: { apiKey: "YOUR_MAGIC_LINK_API_KEY", //required }, }), }); const { disconnectAsync } = useDisconnect(); const { isConnected } = useAccount(); const { signMessageAsync } = useSignMessage(); const { requestChallengeAsync } = useAuthRequestChallengeEvm(); const { push } = useRouter(); const handleAuth = async () => { if (isConnected) { await disconnectAsync(); } const { account } = await connectAsync(); const { message } = await requestChallengeAsync({ address: account, chainId: "0x1", }); const signature = await signMessageAsync({ message }); // redirect user after success authentication to '/user' page const { url } = await signIn("moralis-auth", { message, signature, redirect: false, callbackUrl: "/user", }); /** * instead of using signIn(..., redirect: "/user") * we get the url from callback and push it to the router to avoid page refreshing */ push(url); }; return (

Web3 Authentication

); } export default SignIn; ``` ## Testing the WalletConnect Connector Visit [`http://localhost:3000/signin`](http://localhost:3000/signin) to test authentication. 1. Click on `Authenticate via Magic.Link` 2. Enter your email 3. Verify the login from your email 4. After successful authentication, you will be redirected to the `/user` page 5. Visit [`http://localhost:3000/user`](http://localhost:3000/user) to test the user session's functionality: * When a user is authenticated, we show the user's info on the page. * When a user is not authenticated, we redirect to the `/signin` page. * When a user is authenticated, we show the user's info on the page, even refreshing after the page. ([***`Explanation: After Web3 wallet authentication, the next-auth library creates a session cookie with an encrypted JWT [JWE] stored inside. It contains session info [such as an address and signed message] in the user's browser.`***](https://jwt.io/introduction)) # How to Authenticate Users with MetaMask Source: https://docs.moralis.com/get-started/tutorials/auth-api/authenticate-users-with-meta-mask ## Introduction This tutorial demonstrates how to create a NextJS application that allows users to log in using their Web3 wallets. After Web3 wallet authentication, the [**next-auth**](https://next-auth.js.org/) library creates a session cookie with an encrypted [**JWT**](https://jwt.io/introduction) (**JWE**) stored inside. It contains session info (such as an address, signed message, and expiration time) in the user's browser. It's a secure way to store users' info without a database, and it's impossible to read/modify the **JWT** without a [secret key](https://next-auth.js.org/configuration/options#secret). Once the user is logged in, they will be able to visit a page that displays all their user data. You can find the repository with the final code [here](https://github.com/MoralisWeb3/demo-apps/tree/main/nextjs_moralis_auth). > [!NOTE] > > You can find the final dapp with implemented style on our [GitHub](https://github.com/MoralisWeb3/Moralis-JS-SDK/tree/beta/demos/nextjs). ## Prerequisites 1. Create a [Moralis account](https://www.moralis.io). 2. Install and set up [Visual Studio](https://code.visualstudio.com/). 3. Create your NextJS dapp (you can create it using [**create-next-app**](https://nextjs.org/docs/api-reference/create-next-app) or follow the **NextJS dapp** tutorial). ## Install the Required Dependencies 1. Install `moralis` and `@moralisweb3/next` (if not installed) and `next-auth`dependencies: ```bash npm2yarn theme={null} npm install moralis @moralisweb3/next next-auth ``` 2. To implement authentication using a Web3 wallet (e.g., MetaMask), we need to use a Web3 library. For the tutorial, we will use [wagmi](https://wagmi.sh/docs/getting-started). So, install the `wagmi` dependency: ```bash npm2yarn theme={null} npm install wagmi viem ``` 3. Add new environment variables in your `.env.local` file in the app root: * **APP\_DOMAIN**: RFC 4501 DNS authority that is requesting the signing. * **MORALIS\_API\_KEY**: You can get it [here](https://admin.moralis.com/account/profile). * **NEXTAUTH\_URL**: Your app address. In the development stage, use [`http://localhost:3000`](http://localhost:3000). * **NEXTAUTH\_SECRET**: Used for encrypting JWT tokens of users. You can put any value here or generate it on [`https://generate-secret.now.sh/32`](https://generate-secret.now.sh/32). Here's an `.env.local` example: ```text .env.local theme={null} APP_DOMAIN=amazing.finance MORALIS_API_KEY=xxxx NEXTAUTH_URL=http://localhost:3000 NEXTAUTH_SECRET=7197b3e8dbee5ea6274cab37245eec212 ``` > [!WARNING] > > Keep your `NEXTAUTH_SECRET` value in secret to prevent security problems.\ > \ > Every time you modify the `.env.local` file, you need to restart your dapp. ## Wrapping App with `WagmiConfig` and `SessionProvider` 4. Create the `pages/_app.jsx` file. We need to wrap our pages with `WagmiConfig` ([docs](https://wagmi.sh/docs/WagmiConfig)) and `SessionProvider` ([docs](https://next-auth.js.org/getting-started/client#sessionprovider)): ```javascript theme={null} import { createConfig, configureChains, WagmiConfig } from "wagmi"; import { publicProvider } from "wagmi/providers/public"; import { SessionProvider } from "next-auth/react"; import { mainnet } from "wagmi/chains"; const { publicClient, webSocketPublicClient } = configureChains( [mainnet], [publicProvider()] ); const config = createConfig({ autoConnect: true, publicClient, webSocketPublicClient, }); function MyApp({ Component, pageProps }) { return ( ); } export default MyApp; ``` > [!NOTE] > > NextJS uses the `App` component to initialize pages. You can override it and control the page initialization. Check out the [NextJS docs](https://nextjs.org/docs/advanced-features/custom-app). ## Configure Next-Auth and MoralisNextAuth 5. Create a new file, `pages/api/auth/[...nextauth].js`, with the following content: > [tab] Tab > > ```javascript Javascript theme={null} > import NextAuth from "next-auth"; > import { MoralisNextAuthProvider } from "@moralisweb3/next"; > > export default NextAuth({ > providers: [MoralisNextAuthProvider()], > // adding user info to the user session object > callbacks: { > async jwt({ token, user }) { > if (user) { > token.user = user; > } > return token; > }, > async session({ session, token }) { > session.user = token.user; > return session; > }, > }, > }); > ``` > [tab] Tab > > ```typescript theme={null} > import NextAuth from "next-auth"; > import { MoralisNextAuthProvider } from "@moralisweb3/next"; > > export default NextAuth({ > providers: [MoralisNextAuthProvider()], > // adding user info to the user session object > callbacks: { > async jwt({ token, user }) { > if (user) { > token.user = user; > } > return token; > }, > async session({ session, token }) { > (session as { user: unknown }).user = token.user; > return session; > }, > }, > }); > ``` 6. Add an authenticating config to the `pages/api/moralis/[...moralis].ts`: ```javascript theme={null} import { MoralisNextApi } from "@moralisweb3/next"; export default MoralisNextApi({ apiKey: process.env.MORALIS_API_KEY, authentication: { domain: "amazing.dapp", uri: process.env.NEXTAUTH_URL, timeout: 120, }, }); ``` ## Create Sign-In Page 7. Create a new page file, `pages/signin.jsx`, with the following content: ```javascript theme={null} function SignIn() { return (

Web3 Authentication

); } export default SignIn; ``` 8. Let's create a button for enabling our Web3 provider and `console.log` users' information: ```javascript theme={null} import { useConnect } from "wagmi"; import { MetaMaskConnector } from "wagmi/connectors/metaMask"; function SignIn() { const { connectAsync } = useConnect(); const handleAuth = async () => { const { account, chain } = await connectAsync({ connector: new MetaMaskConnector(), }); const userData = { address: account, chainId: chain.id }; console.log(userData); }; return (

Web3 Authentication

); } export default SignIn; ``` 9. Extend the `handleAuth` functionality for calling `useSignMessage()` hook: ```javascript theme={null} import { MetaMaskConnector } from "wagmi/connectors/metaMask"; import { useAccount, useConnect, useSignMessage, useDisconnect } from "wagmi"; import { useAuthRequestChallengeEvm } from "@moralisweb3/next"; function SignIn() { const { connectAsync } = useConnect(); const { disconnectAsync } = useDisconnect(); const { isConnected } = useAccount(); const { signMessageAsync } = useSignMessage(); const { requestChallengeAsync } = useAuthRequestChallengeEvm(); const handleAuth = async () => { if (isConnected) { await disconnectAsync(); } const { account, chain } = await connectAsync({ connector: new MetaMaskConnector(), }); const { message } = await requestChallengeAsync({ address: account, chainId: chain.id, }); const signature = await signMessageAsync({ message }); console.log(signature); }; return (

Web3 Authentication

); } export default SignIn; ``` ## Secure Authentication after Signing and Verifying the Signed Message 10. Return to the `pages/signin.jsx` file. Let's add the `next-auth` authentication: ```javascript theme={null} import { MetaMaskConnector } from "wagmi/connectors/metaMask"; import { signIn } from "next-auth/react"; import { useAccount, useConnect, useSignMessage, useDisconnect } from "wagmi"; import { useRouter } from "next/router"; import { useAuthRequestChallengeEvm } from "@moralisweb3/next"; function SignIn() { const { connectAsync } = useConnect(); const { disconnectAsync } = useDisconnect(); const { isConnected } = useAccount(); const { signMessageAsync } = useSignMessage(); const { requestChallengeAsync } = useAuthRequestChallengeEvm(); const { push } = useRouter(); const handleAuth = async () => { if (isConnected) { await disconnectAsync(); } const { account, chain } = await connectAsync({ connector: new MetaMaskConnector(), }); const { message } = await requestChallengeAsync({ address: account, chainId: chain.id, }); const signature = await signMessageAsync({ message }); // redirect user after success authentication to '/user' page const { url } = await signIn("moralis-auth", { message, signature, redirect: false, callbackUrl: "/user", }); /** * instead of using signIn(..., redirect: "/user") * we get the url from callback and push it to the router to avoid page refreshing */ push(url); }; return (

Web3 Authentication

); } export default SignIn; ``` ## Showing the User Profile 11. Let's create a user page, `pages/user.jsx`, with the following content: ```javascript theme={null} import { getSession, signOut } from "next-auth/react"; // gets a prop from getServerSideProps function User({ user }) { return (

User session:

{JSON.stringify(user, null, 2)}
); } export async function getServerSideProps(context) { const session = await getSession(context); // redirect if not authenticated if (!session) { return { redirect: { destination: "/signin", permanent: false, }, }; } return { props: { user: session.user }, }; } export default User; ``` ## Testing the MetaMask Wallet Connector Visit [`http://localhost:3000/signin`](http://localhost:3000/signin`) to test the authentication. 1. Click on the `Authenticate via Metamask` button: 2. Connect the MetaMask wallet 3. Sign the message 4. After successful authentication, you will be redirected to the `/user` page 5. Visit [`http://localhost:3000/user`](http://localhost:3000/user`) to test the user session functionality: * When a user authenticates, we show the user's info on the page. * When a user is not authenticated, we redirect to the `/signin` page. * When a user is authenticated, we show the user's info on the page, even refreshing after the page. * (**Explanation:** [*****`After Web3 wallet authentication, the next-auth library creates a session cookie with an encrypted JWT (JWE) stored inside. It contains session info [such as an address and signed message] in the user's browser.)`*****](https://jwt.io/introduction) * # How to Authenticate Users with MetaMask using Angular Source: https://docs.moralis.com/get-started/tutorials/auth-api/authenticate-users-with-meta-mask-using-angular Learn how Moralis authentication works and see how to add secure authentication to your Angular dapp. This tutorial covers how to create full-stack Web3 authentication using the popular Angular framework. ## Introduction This tutorial demonstrates how to create an Angular application that allows users to log in using their Web3 wallets. After Web3 wallet authentication, the server creates a session cookie with a signed [JWT](https://jwt.io/introduction) stored inside. It contains session info (such as an address, signed message) in the user's browser. Once the user is logged in, they will be able to visit a page that displays all their user data. ## Prerequisites 1. Follow the Your First Dapp - Angular tutorial to set up your Angular dapp and server ## Install the Required Dependencies To implement authentication using a Web3 wallet (e.g., MetaMask), we will use a Web3 library. For the tutorial, we will use [@wagmi/core](https://github.com/wagmi-dev/wagmi/tree/main/packages/core). 1. Install `@wagmi/core`, `@wagmi/connectors`, `viem@2.x`, and `axios` dependencies. ```bash npm2yarn theme={null} npm install @wagmi/core @wagmi/connectors viem@2.x ``` 2. Generate an environment file for our Angular app: ```bash npm2yarn theme={null} ng generate environments ``` 3. Open `src/environments/environment.ts` and `src/environments/environment.prod.ts` - add a variable of `SERVER_URL` for our server. ```typescript theme={null} export const environment = { SERVER_URL: "http://localhost:3000", }; ``` 4. We will generate two components (pages) - `/signin` (to authenticate) and `/user` (to show the user profile): ```shell theme={null} ng generate component signin ng generate component user ``` 5. Open `src/app/app.routes.ts`, add these two components as routes: ```typescript theme={null} import { SigninComponent } from "./signin/signin.component"; import { UserComponent } from "./user/user.component"; const routes: Routes = [ { path: "signin", component: SigninComponent }, { path: "user", component: UserComponent }, ]; ``` ## Initial Setup We will do an initial setup of our `/signin` and `/user` pages to make sure they work before integrating with our server. 1. Open `src/app/signin/signin.component.html` and replace the contents with: ```typescript theme={null}

Web3 Authentication

``` 2. Open `src/app/signin/signin.component.ts` and add an empty `handleAuth` function below `ngOnInit(): void {}`: ```typescript theme={null} ngOnInit(): void {} async handleAuth() {} ``` 3. Run `npm run start` and open [`http://localhost:4200/signin`](http://localhost:4200/signin) in your browser. It should look like: 4. Import `NgIf` in `src/app/user/user.component.ts`: ```typescript theme={null} import { Component } from "@angular/core"; import { NgIf } from "@angular/common"; // Import NgIf @Component({ selector: "app-user", standalone: true, imports: [NgIf], // Include NgIf in the imports array templateUrl: "./user.component.html", styleUrls: ["./user.component.css"], }) export class UserComponent {} ``` 5. Open `src/app/user/user.component.html` and replace the contents with: ```typescript theme={null}

User session:

{{ session }}
``` 6. Open `src/app/user/user.component.ts` and add the variable we used above and an empty `signOut()` function: ```typescript theme={null} session = ''; ngOnInit(): void {} async signOut() {} ``` ## Server Setup Now we will update our server's `index.js` for the code we need for authentication. In this demo, cookies will be used for the user data. 1. Install the required dependencies for our server: ```shell theme={null} npm install cookie-parser jsonwebtoken dotenv ``` 2. Create a file called `.env` in your server's root directory (where `package.json` is): * **APP\_DOMAIN**: RFC 4501 DNS authority that is requesting the signing. * **MORALIS\_API\_KEY**: You can get it [here](https://admin.moralis.com/account/profile). * **ANGULAR\_URL**: Your app address. By default Angular uses [`http://localhost:4200`](http://localhost:4200/). * **AUTH\_SECRET**: Used for signing JWT tokens of users. You can put any value here or generate it on [`https://generate-secret.now.sh/32`](https://generate-secret.now.sh/32). Here's an `.env` example: ``` APP_DOMAIN=localhost MORALIS_API_KEY=xxxx ANGULAR_URL=http://localhost:4200 AUTH_SECRET=1234 ``` 3. Open `index.js`. We will create a `/request-message` endpoint for making requests to `Moralis.Auth` to generate a unique message (Angular will use this endpoint on the `/signin` page): ```javascript theme={null} // to use our .env variables require("dotenv").config(); // for our server's method of setting a user session const cookieParser = require("cookie-parser"); const jwt = require("jsonwebtoken"); const config = { domain: process.env.APP_DOMAIN, statement: "Please sign this message to confirm your identity.", uri: process.env.ANGULAR_URL, timeout: 60, }; app.post("/request-message", async (req, res) => { const { address, chain } = req.body; try { const message = await Moralis.Auth.requestMessage({ address, chain, ...config, }); res.status(200).json(message); } catch (error) { res.status(400).json({ error: error.message }); console.error(error); } }); ``` 4. We will create a `/verify` endpoint for verifying the signed message from the user. After the user successfully verifies, they will be redirected to the `/user` page where their info will be displayed. ```javascript theme={null} app.post("/verify", async (req, res) => { try { const { message, signature } = req.body; const { address, profileId } = ( await Moralis.Auth.verify({ message, signature, networkType: "evm", }) ).raw; const user = { address, profileId, signature }; // create JWT token const token = jwt.sign(user, process.env.AUTH_SECRET); // set JWT cookie res.cookie("jwt", token, { httpOnly: true, }); res.status(200).json(user); } catch (error) { res.status(400).json({ error: error.message }); console.error(error); } }); ``` 5. We will create an `/authenticate` endpoint for checking the JWT cookie we previously set to allow the user access to the `/user` page: ```javascript theme={null} app.get("/authenticate", async (req, res) => { const token = req.cookies.jwt; if (!token) return res.sendStatus(403); // if the user did not send a jwt token, they are unauthorized try { const data = jwt.verify(token, process.env.AUTH_SECRET); res.json(data); } catch { return res.sendStatus(403); } }); ``` 6. Lastly we will create a `/logout` endpoint for removing the cookie. ```javascript theme={null} app.get("/logout", async (req, res) => { try { res.clearCookie("jwt"); return res.sendStatus(200); } catch { return res.sendStatus(403); } }); ``` Your final `index.js` should look like this: ```javascript theme={null} const Moralis = require("moralis").default; const express = require("express"); const cors = require("cors"); const cookieParser = require("cookie-parser"); const jwt = require("jsonwebtoken"); require("dotenv").config(); const app = express(); const port = 3000; app.use(express.json()); app.use(cookieParser()); // allow access to Angular app domain app.use( cors({ origin: process.env.ANGULAR_URL, credentials: true, }) ); const config = { domain: process.env.APP_DOMAIN, statement: "Please sign this message to confirm your identity.", uri: process.env.ANGULAR_URL, timeout: 60, }; // request message to be signed by client app.post("/request-message", async (req, res) => { const { address, chain } = req.body; try { const message = await Moralis.Auth.requestMessage({ address, chain, ...config, }); res.status(200).json(message); } catch (error) { res.status(400).json({ error: error.message }); console.error(error); } }); // verify message signed by client app.post("/verify", async (req, res) => { try { const { message, signature } = req.body; const { address, profileId } = ( await Moralis.Auth.verify({ message, signature, networkType: "evm", }) ).raw; const user = { address, profileId, signature }; // create JWT token const token = jwt.sign(user, process.env.AUTH_SECRET); // set JWT cookie res.cookie("jwt", token, { httpOnly: true, }); res.status(200).json(user); } catch (error) { res.status(400).json({ error: error.message }); console.error(error); } }); // verify JWT cookie to allow access app.get("/authenticate", async (req, res) => { const token = req.cookies.jwt; if (!token) return res.sendStatus(403); // if the user did not send a jwt token, they are unauthorized try { const data = jwt.verify(token, process.env.AUTH_SECRET); res.json(data); } catch { return res.sendStatus(403); } }); // remove JWT cookie app.get("/logout", async (req, res) => { try { res.clearCookie("jwt"); return res.sendStatus(200); } catch { return res.sendStatus(403); } }); const startServer = async () => { await Moralis.start({ apiKey: process.env.MORALIS_API_KEY, }); app.listen(port, () => { console.log(`Example app listening on port ${port}`); }); }; startServer(); ``` 7. Run `npm run start` to make sure your server runs without immediate errors. ```shell theme={null} node index.js ``` ## Bringing It All Together Now we will finish setting up our Angular pages to integrate with our server. 1. Open `src/app/signin/signin.component.ts`. Add our required imports: ```typescript theme={null} import { Component } from "@angular/core"; // for navigating to other routes import { Router } from "@angular/router"; // for making HTTP requests import axios from "axios"; import { connect, disconnect, getAccount, injected, signMessage, } from "@wagmi/core"; import { http, createConfig } from "@wagmi/core"; import { mainnet, sepolia } from "@wagmi/core/chains"; import { environment } from "../../environments/environment"; ``` 2. Add this code to set up the Wagmi client: ```typescript theme={null} export const config = createConfig({ chains: [mainnet, sepolia], transports: { [mainnet.id]: http(), [sepolia.id]: http(), }, }); ``` 3. Replace our empty `handleAuth()` function with the following: ```typescript theme={null} async handleAuth() { const { isConnected } = getAccount(config); if (isConnected) await disconnect(config); //disconnects the web3 provider if it's already active const provider = await connect(config, { connector: injected() }); // enabling the web3 provider metamask const userData = { address: provider.accounts[0], chain: provider.chainId, }; const { data } = await axios.post( `${environment.SERVER_URL}/request-message`, userData ); const message = data.message; const signature = await signMessage(config, { message }); await axios.post( `${environment.SERVER_URL}/verify`, { message, signature, }, { withCredentials: true } // set cookie from Express server ); // redirect to /user this.router.navigateByUrl('/user'); } ``` 4. The full `signin.component.ts` should look like: ```typescript theme={null} import { Component } from "@angular/core"; // for navigating to other routes import { Router } from "@angular/router"; // for making HTTP requests import axios from "axios"; import { connect, disconnect, getAccount, injected, signMessage, } from "@wagmi/core"; import { http, createConfig } from "@wagmi/core"; import { mainnet, sepolia } from "@wagmi/core/chains"; import { environment } from "../../environments/environment"; export const config = createConfig({ chains: [mainnet, sepolia], transports: { [mainnet.id]: http(), [sepolia.id]: http(), }, }); @Component({ selector: "app-signin", standalone: true, imports: [], templateUrl: "./signin.component.html", styleUrl: "./signin.component.css", }) export class SigninComponent { constructor(private router: Router) {} ngOnInit(): void {} async handleAuth() { const { isConnected } = getAccount(config); if (isConnected) await disconnect(config); //disconnects the web3 provider if it's already active const provider = await connect(config, { connector: injected() }); // enabling the web3 provider metamask const userData = { address: provider.accounts[0], chain: provider.chainId, }; const { data } = await axios.post( `${environment.SERVER_URL}/request-message`, userData ); const message = data.message; const signature = await signMessage(config, { message }); await axios.post( `${environment.SERVER_URL}/verify`, { message, signature, }, { withCredentials: true } // set cookie from Express server ); // redirect to /user this.router.navigateByUrl("/user"); } } ``` 5. Open `src/app/user/user.component.ts`. Add our required imports: ```typescript theme={null} import { Router } from "@angular/router"; import axios from "axios"; import { environment } from "../../environments/environment"; ``` 6. Replace `ngOnInit(): void {}` with: ```typescript theme={null} async ngOnInit() { try { const { data } = await axios.get( `${environment.SERVER_URL}/authenticate`, { withCredentials: true, } ); const { iat, ...authData } = data; // remove unimportant iat value this.session = JSON.stringify(authData, null, 2); // format to be displayed nicely } catch (err) { // if user does not have a "session" token, redirect to /signin this.router.navigateByUrl('/signin'); } } ``` 7. Replace our empty `signOut()` function with the following: ```typescript theme={null} async signOut() { await axios.get(`${environment.SERVER_URL}/logout`, { withCredentials: true, }); this.router.navigateByUrl('/signin'); } ``` 8. The full `user.component.ts` should look like: ```typescript theme={null} import { Component } from "@angular/core"; import { NgIf } from "@angular/common"; // Import NgIf import { Router } from "@angular/router"; import axios from "axios"; import { environment } from "../../environments/environment"; @Component({ selector: "app-user", standalone: true, imports: [NgIf], // Include NgIf in the imports array templateUrl: "./user.component.html", styleUrls: ["./user.component.css"], }) export class UserComponent { constructor(private router: Router) {} session = ""; async ngOnInit() { try { const { data } = await axios.get( `${environment.SERVER_URL}/authenticate`, { withCredentials: true, } ); const { iat, ...authData } = data; // remove unimportant iat value this.session = JSON.stringify(authData, null, 2); // format to be displayed nicely } catch (err) { // if user does not have a "session" token, redirect to /signin this.router.navigateByUrl("/signin"); } } async signOut() { await axios.get(`${environment.SERVER_URL}/logout`, { withCredentials: true, }); this.router.navigateByUrl("/signin"); } } ``` If you get errors related to default imports, open your `tsconfig.app.json` file and add `"allowSyntheticDefaultImports": true` under `compilerOptions`: ```json theme={null} "compilerOptions": {   "allowSyntheticDefaultImports": true,   "outDir": "./out-tsc/app",   "types": [] } ``` ## Testing the MetaMask Wallet Connector Visit [`http://localhost:4200/signin`](http://localhost:4200/signin) to test the authentication. 1. Click on the `Authenticate via MetaMask` button 2. Connect the MetaMask wallet and sign the message 3. After successful authentication, you will be redirected to the `/user` page * When a user authenticates, we show the user's info on the page. * When a user is not authenticated, we redirect to the `/signin` page. * When a user is authenticated, we show the user's info on the page, even refreshing after the page. # How to Authenticate Users with MetaMask using Python and Django Source: https://docs.moralis.com/get-started/tutorials/auth-api/authenticate-users-with-meta-mask-using-python-and-django This tutorial will teach you how Moralis authentication works and demonstrates how to add secure authentication to your Django application by walking you through creating a full-stack Web3 authentication stack using the popular Django web framework. ## Introduction In this tutorial, we show you how to create a full-stack Django app that allows users to log in using their Web3 wallets, and Django will create a session associated with the individual user. Once logged in, the user can visit a page that displays all their user data. You can find the repository with the final code [here](https://github.com/MoralisWeb3/demo-apps/tree/main/django_moralis_auth). ## Prerequisites 1. Create a [Moralis account](https://admin.moralis.com/login). 2. Install Python 3 (in case you don't already have it). In this tutorial, we used Python 3.10 on a Windows system. 3. Basic Django knowledge ([Django documentation](https://docs.djangoproject.com/en/dev/intro/tutorial01/)). ## Installing Required Dependencies 1. Create a virtual environment if needed: `python3 -m venv django_web3_auth_env`. 2. Install `django` and `requests` dependencies. Django version 4.1 was used for this tutorial: * `django_web3_auth_env\Scripts>pip3.10.exe install django`. * `django_web3_auth_env\Scripts>pip3.10.exe install requests`.\ (These commands, for example, `pip3.10.exe install django`, are meant to be executed in that specific **Scripts** folder from that virtual environment.) ## Creating a Django Project and App 1. Create the Django project: * `django_web3_auth_env\Scripts\django-admin startproject moralis_auth` and `django-admin` will be found in the `Scripts` folder: `django_web3_auth_env\Scripts\django-admin.exe`. 2. Create the Django app: * `django_web3_auth_env\Scripts\python.exe manage.py startapp web3_auth`. * You can move that newly created app folder named `web3_auth` into the same folder where the `moralis_auth` project is in - the same folder where `manage.py` is located. 3. Run database migrations: * `django_web3_auth_env\Scripts\python.exe manage.py migrate`. Here, you will have to use the complete path that points to the Python executable in the newly created virtual environment. 4. Create a **super user** (it can be used in the Django admin interface); it is optional: * `django_web3_auth_env\Scripts\python.exe manage.py createsuperuser`. Here, you will have to use the complete path that points to the Python executable in the new created virtual environment. ## Edit `moralis_auth` Project Settings 1. Add the newly created app named `web3_auth` to the list of installed apps in `settings.py` at the end of the `INSTALLED_APPS` list: ```python settings.py theme={null} INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'web3_auth' ] ``` 2. Include URLs from the newly created app in the new project (here, we also added the URLs from `django.contrib.auth.urls` to be able to use the log-out functionality): ```python urls.py theme={null} from django.contrib import admin from django.urls import path, include urlpatterns = [ path('admin/', admin.site.urls), path('web3_auth/', include('web3_auth.urls')), path('auth/', include('django.contrib.auth.urls')), ] ``` ## Creating the Main *web3\_auth* Application (`urls.py`, `views.py`, and Templates) 1. The contents for `urls.py` (you will have to create this file): ```python urls.py theme={null} from django.urls import path from . import views urlpatterns = [ path('moralis_auth', views.moralis_auth, name='moralis_auth'), path('request_message', views.request_message, name='request_message'), path('my_profile', views.my_profile, name='my_profile'), path('verify_message', views.verify_message, name='verify_message') ] ``` * `moralis_auth` will contain the data from where a user can authenticate. * `request_message` will make a request to the Moralis Auth API for a message to be signed. * `my_profile` will show current profile info for a user when authenticated. * `verify_message` will be used to verify a message that was signed. 2. The contents for `views.py` (you will need to set your Web3 API key on line nine \[`API_KEY = 'WEB3_API_KEY_HERE'`]): ```python views.py theme={null} import json import requests from django.shortcuts import render, redirect from django.http import HttpResponse, JsonResponse from django.contrib.auth import authenticate, login from django.contrib.auth.models import User from datetime import datetime, timedelta, timezone API_KEY = 'WEB3_API_KEY_HERE' # this is a check to make sure the API key was set # you have to set the API key only in line 9 above # you don't have to change the next line if API_KEY == 'WEB3_API_KEY_HERE': print("API key is not set") raise SystemExit def moralis_auth(request): return render(request, 'login.html', {}) def my_profile(request): return render(request, 'profile.html', {}) def request_message(request): data = json.loads(request.body) print(data) #setting request expiration time to 1 minute after the present-> present = datetime.now(timezone.utc) present_plus_one_m = present + timedelta(minutes=1) expirationTime = str(present_plus_one_m.isoformat()) expirationTime = str(expirationTime[:-6]) + 'Z' REQUEST_URL = 'https://authapi.moralis.io/challenge/request/evm' request_object = { "domain": "defi.finance", "chainId": 1, "address": data['address'], "statement": "Please confirm", "uri": "https://defi.finance/", "expirationTime": expirationTime, "notBefore": "2020-01-01T00:00:00.000Z", "timeout": 15 } x = requests.post( REQUEST_URL, json=request_object, headers={'X-API-KEY': API_KEY}) return JsonResponse(json.loads(x.text)) def verify_message(request): data = json.loads(request.body) print(data) REQUEST_URL = 'https://authapi.moralis.io/challenge/verify/evm' x = requests.post( REQUEST_URL, json=data, headers={'X-API-KEY': API_KEY}) print(json.loads(x.text)) print(x.status_code) if x.status_code == 201: # user can authenticate eth_address=json.loads(x.text).get('address') print("eth address", eth_address) try: user = User.objects.get(username=eth_address) except User.DoesNotExist: user = User(username=eth_address) user.is_staff = False user.is_superuser = False user.save() if user is not None: if user.is_active: login(request, user) request.session['auth_info'] = data request.session['verified_data'] = json.loads(x.text) return JsonResponse({'user': user.username}) else: return JsonResponse({'error': 'account disabled'}) else: return JsonResponse(json.loads(x.text)) ``` Here we have a view for the main authentication: `moralis_auth`; one view to display the profile info: `my_profile`; and two views specific to authentication: `request_message` and `verify_message`. Furthermore, `verify_message` will request a message from the Moralis Auth API that will be signed with MetaMask, and `verify_message` will validate the received signature and create a user when the validation succeeds. After that, a session is created for that user, and we can add additional info in that session, such as the data that was used specifically for authentication. 3. Templates (you will have to create a folder named templates): * `login.html`, this template contains all the JavaScript code required to sign a message with MetaMask: ```html login.html theme={null} Moralis Auth Django Demo
{% if user.is_authenticated %}

Welcome Moralis Web3 User, {{ user.username }} !

Logout
My profile {% else %}

Moralis Web3 Login Django demo

{% endif %}
{% if user.is_authenticated %} {% else %} {% endif %} ``` * `profile.html`, this template only shows current info associated with an authenticated user: ```html profile.html theme={null} Moralis Auth Django Profile Page Demo
{% if user.is_authenticated %}

Eth address: {{ user.username }}

Session auth info

{% for key,value in request.session.auth_info.items %} {% endfor %}
{{key}}
{{ value }}

Verified user info

{% for key,value in request.session.verified_data.items %} {% endfor %}
{{key}}{{ value }}

Logout {% else %} Login page {% endif %}
``` ## Starting the Application * `django_web3_auth_env\Scripts\python.exe manage.py runserver 1000` (this will start a local server on port **1000**). After the application starts, this is how it should look when you access `http://127.0.0.1:1000/web3_auth/moralis_auth` This will show when clicking on the above "login" button After the message is signed and the authentication is successful, you can see the complete profile page: # How to Authenticate Users with MetaMask using React Source: https://docs.moralis.com/get-started/tutorials/auth-api/authenticate-users-with-meta-mask-using-react Learn how Moralis authentication works and see how to add secure authentication to your React dapp. This tutorial covers how to create full-stack Web3 authentication using the popular React framework. ## Introduction This tutorial demonstrates how to create a React app that allows users to log in using their Web3 wallets. After Web3 wallet authentication, the server creates a session cookie with a signed [JWT](https://jwt.io/introduction) stored inside. It contains session info (such as an address, signed message) in the user's browser. Once the user is logged in, they will be able to visit a page that displays all their user data. ## Prerequisites 1. Follow the Your First Dapp - React tutorial to set up your React dapp and server ## Install the Required Dependencies To implement authentication using a Web3 wallet (e.g., MetaMask), we will use a Web3 library. For the tutorial, we will use [wagmi](https://wagmi.sh). 1. Install `wagmi` and `viem` in your React app: ```bash npm2yarn theme={null} npm install wagmi viem ``` ## Initial Setup First we will add an environment variable that will be used when calling our API. 1. Create a file called `.env` in the root of your react project (where `package.json` is) and add: ```sh theme={null} REACT_APP_SERVER_URL=http://localhost:4000 ``` Next we will add the providers required for `wagmi`. 2. Open `src/App.js` and add our required imports: ```javascript theme={null} import { createConfig, configureChains, WagmiConfig } from "wagmi"; import { publicProvider } from "wagmi/providers/public"; import { mainnet } from "wagmi/chains"; import Signin from "./signin"; import User from "./user"; ``` 3. We will add the client and providers, and update the routes for our `/signin` component (to be set up next): ```javascript theme={null} const { publicClient, webSocketPublicClient } = configureChains( [mainnet], [publicProvider()] ); const config = createConfig({ autoConnect: true, publicClient, webSocketPublicClient, }); const router = createBrowserRouter([ { path: "/signin", element: , }, { path: "/user", element: , }, { path: "/", element:

Home Component

, }, ]); function App() { return ( ); } export default App; ``` # Your full App.js file should look like this ```javascript theme={null} import { createBrowserRouter, RouterProvider } from "react-router-dom"; import { createConfig, configureChains, WagmiConfig } from "wagmi"; import { publicProvider } from "wagmi/providers/public"; import { mainnet } from "wagmi/chains"; import Signin from "./signin"; import User from "./user"; const { publicClient, webSocketPublicClient } = configureChains( [mainnet], [publicProvider()] ); const config = createConfig({ autoConnect: true, publicClient, webSocketPublicClient, }); const router = createBrowserRouter([ { path: "/signin", element: , }, { path: "/user", element: , }, { path: "/", element:

Home Component

, }, ]); function App() { return ( ); } export default App; ``` ## Server Setup Back in our server directory we will update our server's `index.js` for the code we need for authentication. In this demo, cookies will be used for the user data. 1. Install the required dependencies for our server: ```shell theme={null} npm install cookie-parser jsonwebtoken dotenv ``` 2. Create a file called `.env` in your server's root directory (where `package.json` is): * **APP\_DOMAIN**: RFC 4501 DNS authority that is requesting the signing. * **MORALIS\_API\_KEY**: You can get it [here](https://admin.moralis.com/account/profile). * **REACT\_URL**: Your app address. By default React uses [`http://localhost:3000`](http://localhost:3000). * **AUTH\_SECRET**: Used for signing JWT tokens of users. You can put any value here or generate it on [`https://generate-secret.now.sh/32`](https://generate-secret.now.sh/32). ``` APP_DOMAIN=amazing.finance MORALIS_API_KEY=xxxx REACT_URL=http://localhost:3000 AUTH_SECRET=1234 ``` 3. Open `index.js`. We will create a `/request-message` endpoint for making requests to `Moralis.Auth` to generate a unique message (React will use this endpoint on the `/signin` page): ```javascript theme={null} // to use our .env variables require("dotenv").config(); app.use(express.json()); // for our server's method of setting a user session const cookieParser = require("cookie-parser"); const jwt = require("jsonwebtoken"); const config = { domain: process.env.APP_DOMAIN, statement: "Please sign this message to confirm your identity.", uri: process.env.REACT_URL, timeout: 60, }; app.post("/request-message", async (req, res) => { const { address, chain, network } = req.body; try { const message = await Moralis.Auth.requestMessage({ address, chain, ...config, }); res.status(200).json(message); } catch (error) { res.status(400).json({ error: error.message }); console.error(error); } }); ``` 4. We will create a `/verify` endpoint for verifying the signed message from the user. After the user successfully verifies, they will be redirected to the `/user` page where their info will be displayed: ```javascript theme={null} app.post("/verify", async (req, res) => { try { const { message, signature } = req.body; const { address, profileId } = ( await Moralis.Auth.verify({ message, signature, networkType: "evm", }) ).raw; const user = { address, profileId, signature }; // create JWT token const token = jwt.sign(user, process.env.AUTH_SECRET); // set JWT cookie res.cookie("jwt", token, { httpOnly: true, }); res.status(200).json(user); } catch (error) { res.status(400).json({ error: error.message }); console.error(error); } }); ``` 5. We will create an `/authenticate` endpoint for checking the JWT cookie we previously set to allow the user access to the `/user` page: ```javascript theme={null} app.get("/authenticate", async (req, res) => { const token = req.cookies.jwt; if (!token) return res.sendStatus(403); // if the user did not send a jwt token, they are unauthorized try { const data = jwt.verify(token, process.env.AUTH_SECRET); res.json(data); } catch { return res.sendStatus(403); } }); ``` 6. Lastly we will create a `/logout` endpoint for removing the cookie: ```javascript theme={null} app.get("/logout", async (req, res) => { try { res.clearCookie("jwt"); return res.sendStatus(200); } catch { return res.sendStatus(403); } }); ``` Your final `index.js` should look like this: ```javascript theme={null} const Moralis = require("moralis").default; const express = require("express"); const cors = require("cors"); const cookieParser = require("cookie-parser"); const jwt = require("jsonwebtoken"); // to use our .env variables require("dotenv").config(); const app = express(); const port = 4000; app.use(express.json()); app.use(cookieParser()); // allow access to React app domain app.use( cors({ origin: "http://localhost:3000", credentials: true, }) ); const config = { domain: process.env.APP_DOMAIN, statement: "Please sign this message to confirm your identity.", uri: process.env.REACT_URL, timeout: 60, }; // request message to be signed by client app.post("/request-message", async (req, res) => { const { address, chain, network } = req.body; try { const message = await Moralis.Auth.requestMessage({ address, chain, ...config, }); res.status(200).json(message); } catch (error) { res.status(400).json({ error: error.message }); console.error(error); } }); app.post("/verify", async (req, res) => { try { const { message, signature } = req.body; const { address, profileId } = ( await Moralis.Auth.verify({ message, signature, networkType: "evm", }) ).raw; const user = { address, profileId, signature }; // create JWT token const token = jwt.sign(user, process.env.AUTH_SECRET); // set JWT cookie res.cookie("jwt", token, { httpOnly: true, }); res.status(200).json(user); } catch (error) { res.status(400).json({ error: error.message }); console.error(error); } }); app.get("/authenticate", async (req, res) => { const token = req.cookies.jwt; if (!token) return res.sendStatus(403); // if the user did not send a jwt token, they are unauthorized try { const data = jwt.verify(token, process.env.AUTH_SECRET); res.json(data); } catch { return res.sendStatus(403); } }); app.get("/logout", async (req, res) => { try { res.clearCookie("jwt"); return res.sendStatus(200); } catch { return res.sendStatus(403); } }); const startServer = async () => { await Moralis.start({ apiKey: process.env.MORALIS_API_KEY, }); app.listen(port, () => { console.log(`Example app listening on port ${port}`); }); }; startServer(); ``` ## Bringing It All Together Now we will finish setting up our React pages to integrate with our server. 1. In `src`, create a file called `signin.jsx` and add: ```javascript theme={null} import { useNavigate } from "react-router-dom"; import { useAccount, useConnect, useSignMessage, useDisconnect } from "wagmi"; import { InjectedConnector } from "wagmi/connectors/injected"; import axios from "axios"; export default function SignIn() { const navigate = useNavigate(); const { connectAsync } = useConnect(); const { disconnectAsync } = useDisconnect(); const { isConnected } = useAccount(); const { signMessageAsync } = useSignMessage(); const handleAuth = async () => { //disconnects the web3 provider if it's already active if (isConnected) { await disconnectAsync(); } // enabling the web3 provider metamask const { account } = await connectAsync({ connector: new InjectedConnector(), }); const userData = { address: account, chain: 1 }; // making a post request to our 'request-message' endpoint const { data } = await axios.post( `${process.env.REACT_APP_SERVER_URL}/request-message`, userData, { headers: { "content-type": "application/json", }, } ); const message = data.message; // signing the received message via metamask const signature = await signMessageAsync({ message }); await axios.post( `${process.env.REACT_APP_SERVER_URL}/verify`, { message, signature, }, { withCredentials: true } // set cookie from Express server ); // redirect to /user navigate("/user"); }; return (

Web3 Authentication

); } ``` 2. Inside `src`, create a new file called `user.jsx` and add: ```js theme={null} import { useEffect, useState } from "react"; import { useNavigate } from "react-router-dom"; import axios from "axios"; export default function User() { const navigate = useNavigate(); const [session, setSession] = useState({}); useEffect(() => { axios(`${process.env.REACT_APP_SERVER_URL}/authenticate`, { withCredentials: true, }) .then(({ data }) => { const { iat, ...authData } = data; // remove unimportant iat value setSession(authData); }) .catch((err) => { navigate("/signin"); }); }, []); async function signOut() { await axios(`${process.env.REACT_APP_SERVER_URL}/logout`, { withCredentials: true, }); navigate("/signin"); } return (

User session:

{JSON.stringify(session, null, 2)}
); } ``` ## Testing the MetaMask Wallet Connector In your teminal run `npm run start` and visit [`http://localhost:3000/signin`](http://localhost:3000/signin) to test the authentication. 1. Click on the `Authenticate via MetaMask` button 2. Connect the MetaMask wallet and sign the message 3. After successful authentication, you will be redirected to the `/user` page * When a user authenticates, we show the user's info on the page. * When a user is not authenticated, we redirect to the `/signin` page. * When a user is authenticated, we show the user's info on the page, even refreshing after the page. # How to Authenticate Users with Particle Network Source: https://docs.moralis.com/get-started/tutorials/auth-api/authenticate-users-with-particle-network ## What is Particle Network? > [!TIP] > > Check the Particle Network [documentation website](https://docs.particle.network/) to get more information. **Particle Network** is the Intent-Centric, Modular Access Layer of Web3. With Particle's [Smart Wallet-as-a-Service](https://blog.particle.network/announcing-our-smart-wallet-as-a-service-modular-stack-upgrading-waas-with-erc-4337/), developers can curate unparalleled user experience through modular and customizable EOA/AA embedded wallet components. By utilizing MPC-TSS for key management, Particle can streamline onboarding via familiar Web2 accounts—such as Google accounts, email addresses, and phone numbers. ## Prerequisites ### Next.js Dapp with MetaMask Sign-In Before you begin this tutorial, make sure you have set up a Next.js decentralized application (Dapp) that includes MetaMask sign-in functionality. If you haven't integrated MetaMask sign-in yet, refer to the guide [How to Authenticate Users with MetaMask](/get-started/tutorials/auth-api/authenticate-users-with-meta-mask). ### Install Dependencies To prepare for this tutorial, you'll need to install the following dependencies for Particle Connect: * **@particle-network/connect-react-ui**: This package provides React UI components for Particle Connect. You can install it using npm or yarn. ```bash theme={null} npm install @particle-network/connect-react-ui ``` or ```bash theme={null} yarn add @particle-network/connect-react-ui ``` * **@particle-network/connect**: This package is essential for integrating Particle Connect into your Dapp. Install it using npm or yarn. ```bash theme={null} npm install @particle-network/connect ``` or ```bash theme={null} yarn add @particle-network/connect ``` * **@particle-network/chains**: This optional dependency is leveraged for handling blockchain chains within Particle Connect. You can install it using npm or yarn. ```bash theme={null} npm install @particle-network/chains ``` or ```bash theme={null} yarn add @particle-network/chains ``` With these prerequisites organized, you'll be fully prepared to smoothly integrate Particle Connect into your Next.js Dapp. ## Configure Particle Connect Open the `pages/signin.jsx` file and restructure your code as shown below. This code utilizes Particle Connect's components and hooks for handling the connection process and wallet interactions. ```javascript theme={null} import { useRouter } from 'next/router'; import { useEffect } from 'react'; import { useAccount, ConnectButton, useConnectKit, ModalProvider } from '@particle-network/connect-react-ui'; import { useAuthRequestChallengeEvm } from '@moralisweb3/next'; import { signIn } from 'next-auth/react'; import { Ethereum } from '@particle-network/chains'; import { evmWallets } from '@particle-network/connect'; import '@particle-network/connect-react-ui/dist/index.css'; export default function SignIn() { const { requestChallengeAsync } = useAuthRequestChallengeEvm(); const { push } = useRouter(); const account = useAccount(); const connect = useConnectKit(); useEffect(() => { if (account) { (async () => { const { message } = await requestChallengeAsync({ address: account, chainId: '0x1', }); const signature = await connect.particle.evm.personalSign(`0x${Buffer.from(message).toString('hex')}`); // Conversion to hex, then signing with connected Particle account (whether that be through Particle Auth or otherwise) const result = await signIn("moralis-auth", { message, signature, redirect: false, callbackUrl: '/user', }); if (result && result.url) { push(result.url); } })(); } }, [account]); return (

Web3 Authentication

); } ``` ## Test Particle Connect To test the authentication process with Particle Connect, follow these steps: 1. **Visit Sign-In Page**: Go to [`http://localhost:3000/signin`](http://localhost:3000/signin). 2. **Connect Wallet**: Click the "Connect Wallet" button to initiate the login process. You can choose to log in through Particle Auth or a supported Web3 (EVM) wallet. 3. **Select Sign-In Method**: Choose your preferred sign-in method from the options provided. 4. **Successful Authentication**: After successful authentication, you will be automatically redirected to the `/user` page. 5. **Test User Session**: Visit [`http://localhost:3000/user`](http://localhost:3000/user) to test the functionality of the user session: * When a user is authenticated, their information will be displayed on the page. * If a user is not authenticated, they will be redirected to the `/signin` page. * Even after refreshing the page, the user's information will still be displayed. (***`Explanation: After Web3 wallet authentication, the next-auth library creates a session cookie with an encrypted [JWT] containing session information, stored in the user's browser.`***) # How to Authenticate Users with Phantom Wallet Source: https://docs.moralis.com/get-started/tutorials/auth-api/authenticate-users-with-phantom-wallet This tutorial covers how to create full-stack Web3 authentication for the Phantom wallet, using the popular NextJS framework. ## Introduction This tutorial shows you how to create a NextJS application that lets users log in using their Phantom wallet. After Web3 wallet authentication, the [**next-auth**](https://next-auth.js.org/) library creates a session cookie with an encrypted [**JWT**](https://jwt.io/introduction) (**JWE**) stored inside. It contains session info (such as an address, signed message, and expiration time) in the user's browser. It's a secure way to store users' info without a database, and it's impossible to read/modify the **JWT** without a [secret key](https://next-auth.js.org/configuration/options#secret). Once the user is logged in, they will be able to visit a page that displays all their user data. > [!NOTE] > > You can find the final dapp with implemented style on our [GitHub](https://github.com/JohnVersus/nextjs_solana_auth_api/tree/moralisweb3-next-client-auth). ## Prerequisites 1. Create a [Moralis account](https://www.moralis.io). 2. Install and set up [Visual Studio](https://code.visualstudio.com/). 3. Create your NextJS dapp (you can create it using [**create-next-app**](https://nextjs.org/docs/api-reference/create-next-app) or follow the **NextJS dapp** tutorial). ## Install the Required Dependencies 1. Install `@moralisweb3/next` (if not installed), `next-auth` and `@web3uikit/core` dependencies: ```bash npm2yarn theme={null} npm install @moralisweb3/next next-auth @web3uikit/core ``` 2. To process data like the signature of a Solana Web3 wallet (e.g., Phantom), we need the `bs58` package to encode and decode data from the wallet. Let's install the `bs58` package: ```bash npm2yarn theme={null} npm install bs58 ``` 3. Add new environment variables in your `.env.local` file in the app root: * **APP\_DOMAIN**: RFC 4501 DNS authority that is requesting the signing. * **MORALIS\_API\_KEY**: You can get it [here](https://admin.moralis.com/account/profile). * **NEXTAUTH\_URL**: Your app address. In the development stage, use [`http://localhost:3000`](http://localhost:3000). * **NEXTAUTH\_SECRET**: Used for encrypting JWT tokens of users. You can put any value here or generate it on [`https://generate-secret.now.sh/32`](https://generate-secret.now.sh/32). Here's an `.env.local` example: ```text .env.local theme={null} APP_DOMAIN=amazing.finance MORALIS_API_KEY=xxxx NEXTAUTH_URL=http://localhost:3000 NEXTAUTH_SECRET=7197b3e8dbee5ea6274cab37245eec212 ``` > [!NOTE] > > Keep your `NEXTAUTH_SECRET` value in secret to prevent security problems.\ > \ > Every time you modify the `.env.local` file, you need to restart your dapp. ## Wrapping App with `SessionProvider` 4. Create the `pages/_app.jsx` file. We need to wrap our pages with `SessionProvider` ([docs](https://next-auth.js.org/getting-started/client#sessionprovider)): ```javascript theme={null} import "../styles/globals.css"; import { SessionProvider } from "next-auth/react"; function MyApp({ Component, pageProps }) { return ( ); } export default MyApp; ``` > [!NOTE] > > NextJS uses the `App` component to initialize pages. You can override it and control the page initialization. Check out the [NextJS docs](https://nextjs.org/docs/advanced-features/custom-app). ## Configure Next-Auth and MoralisNextAuth 5. Create a new file, `pages/api/auth/[...nextauth].ts`, with the following content: > [tab] Tab > > ```typescript theme={null} > import NextAuth from "next-auth"; > import { MoralisNextAuthProvider } from "@moralisweb3/next"; > > export default NextAuth({ > providers: [MoralisNextAuthProvider()], > // adding user info to the user session object > callbacks: { > async jwt({ token, user }) { > if (user) { > token.user = user; > } > return token; > }, > async session({ session, token }) { > (session as { user: unknown }).user = token.user; > return session; > }, > }, > }); > ``` > [tab] Tab > > ```javascript Javascript theme={null} > import NextAuth from "next-auth"; > import { MoralisNextAuthProvider } from "@moralisweb3/next"; > > export default NextAuth({ > providers: [MoralisNextAuthProvider()], > // adding user info to the user session object > callbacks: { > async jwt({ token, user }) { > if (user) { > token.user = user; > } > return token; > }, > async session({ session, token }) { > session.user = token.user; > return session; > }, > }, > }); > ``` 6. Add an authenticating config to the `pages/api/moralis/[...moralis].ts`: > [tab] Tab > > ```typescript [...moralis].ts theme={null} > import { MoralisNextApi } from "@moralisweb3/next"; > > const DATE = new Date(); > const FUTUREDATE = new Date(DATE); > FUTUREDATE.setDate(FUTUREDATE.getDate() + 1); > > const { MORALIS_API_KEY, APP_DOMAIN, NEXTAUTH_URL } = process.env; > > if (!MORALIS_API_KEY || !APP_DOMAIN || !NEXTAUTH_URL) { > throw new Error( > "Missing env variables. Please add the required env variables." > ); > } > > export default MoralisNextApi({ > apiKey: MORALIS_API_KEY, > authentication: { > timeout: 120, > domain: APP_DOMAIN, > uri: NEXTAUTH_URL, > expirationTime: FUTUREDATE.toISOString(), > statement: "Sign message to authenticate.", > }, > }); > ``` > [tab] Tab > > ```typescript [...moralis].js theme={null} > import { MoralisNextApi } from "@moralisweb3/next"; > > const DATE = new Date(); > const FUTUREDATE = new Date(DATE); > FUTUREDATE.setDate(FUTUREDATE.getDate() + 1); > > const { MORALIS_API_KEY, APP_DOMAIN, NEXTAUTH_URL } = process.env; > > if (!MORALIS_API_KEY || !APP_DOMAIN || !NEXTAUTH_URL) { > throw new Error( > "Missing env variables. Please add the required env variables." > ); > } > > export default MoralisNextApi({ > apiKey: MORALIS_API_KEY, > authentication: { > timeout: 120, > domain: APP_DOMAIN, > uri: NEXTAUTH_URL, > expirationTime: FUTUREDATE.toISOString(), > statement: "Sign message to authenticate.", > }, > }); > ``` ## Create Wallet Component 7. Create a new file under `app/components/loginBtn/phantomBtn.tsx`: > [tab] Tab > > ```typescript phantomBtn.tsx theme={null} > import React from "react"; > import { Button } from "@web3uikit/core"; > import { signIn } from "next-auth/react"; > import base58 from "bs58"; > import { useAuthRequestChallengeSolana } from "@moralisweb3/next"; > > export default function PhantomBtn() { > const { requestChallengeAsync, error } = useAuthRequestChallengeSolana(); > const authenticate = async () => { > // @ts-ignore > const provider = window.phantom?.solana; > const resp = await provider.connect(); > const address = resp.publicKey.toString(); > const chain = "devnet"; > const account = { > address: address, > chain: chain, > network: "solana", > }; > // const message = "Sign to provide access to app"; > const challenge = await requestChallengeAsync({ > address, > network: "devnet", > }); > const encodedMessage = new TextEncoder().encode(challenge?.message); > const signedMessage = await provider.signMessage(encodedMessage, "utf8"); > const signature = base58.encode(signedMessage.signature); > try { > const authResponse = await signIn("moralis-auth", { > message: challenge?.message, > signature, > network: "Solana", > redirect: false, > }); > if (authResponse?.error) { > throw new Error(authResponse.error); > } > } catch (e) { > return; > } > }; > > return ( > > ); > } > ``` > [tab] Tab > > ```typescript userData.js theme={null} > // File path > // app/components/logoutBtn/userData.js > > import React from "react"; > import styles from "../../../styles/User.module.css"; > import { Typography } from "@web3uikit/core"; > import { useSession } from "next-auth/react"; > > export default function UserData() { > const { data: session, status } = useSession(); > > if (session) { > return ( >
>
> Profile Id: >
> {session?.user.profileId} >
>
>
> Account: >
> {/* account address */} > > {session?.user.address} > >
>
>
> Network: >
> {session?.user.network} >
>
>
> ExpTime: >
> > {session?.user.expirationTime} > >
>
>
> ); > } > } > ``` ## Showing the User Profile 9. Let's create a `user.jsx` page to view user data when the user is logged in. ```javascript theme={null} import React, { useEffect, useTransition } from "react"; import styles from "../styles/User.module.css"; import { getSession, signOut } from "next-auth/react"; import UserData from "../app/components/userData/userData"; import LogoutBtn from "../app/components/logoutBtn/logoutBtn"; export async function getServerSideProps(context) { const session = await getSession(context); if (!session) { return { redirect: { destination: "/" } }; } return { props: { userSession: session }, }; } export default function Home({ userSession }) { if (userSession) { return (
{!isPending && (
<>
)}
); } } ``` ## Testing with Phantom Wallet Visit `http://localhost:3000` to test the authentication. 1. Click on the `Select Wallet` button to select and connect to wallet 2. Connect to the Solana wallet extension 3. Sign the message 4. After successful authentication, you will be redirected to the `/user` page And that completes the authentication process to Solana wallet using Phantom Wallet. # How to Authenticate Users with RainbowKit Source: https://docs.moralis.com/get-started/tutorials/auth-api/authenticate-users-with-rainbow-kit ## Before Starting You can start this tutorial if you already have a NextJS dapp with [MetaMask sign-in](/get-started/tutorials/auth-api/authenticate-users-with-meta-mask) functionality. ## RainbowKit Installation ```bash npm2yarn theme={null} npm install @rainbow-me/rainbowkit@latest wagmi viem ``` ## RainbowKit Configuration We are going to modify `pages/_app.jsx` and add the required code to set up RainbowKit Authentication. > [!NOTE] > > You can get your project ID on the [WalletConnect Dashboard](https://cloud.walletconnect.com/). ```javascript theme={null} import { getDefaultWallets, RainbowKitProvider } from "@rainbow-me/rainbowkit"; import { createConfig, configureChains, WagmiConfig } from "wagmi"; import { mainnet } from "wagmi/chains"; import { publicProvider } from "wagmi/providers/public"; import { SessionProvider } from "next-auth/react"; import "@rainbow-me/rainbowkit/styles.css"; const { chains, publicClient, webSocketPublicClient } = configureChains( [mainnet], [publicProvider()] ); const { connectors } = getDefaultWallets({ appName: "My RainbowKit App", projectId: "WALLET_CONNECT_PROJECT_ID", // Get your project ID from https://cloud.walletconnect.com/ chains, }); const config = createConfig({ autoConnect: true, publicClient, webSocketPublicClient, connectors, }); // added RainbowKitProvider wrapper function MyApp({ Component, pageProps }) { return ( ); } export default MyApp; ``` ## Authentication with RainbowKit The logic we're achieving works as this. A user connects his wallet using `ConnectButton` from `rainbowkit`. Once the wallet is connected, we get `address` and `chain` from the following **wagmi** hooks: `useAccount()` and `useNetwork()`. In case the user is not authenticated, we will start the authentication flow (request and **sign** message). 1. Open the `pages/signin.jsx` file and replace the old `Authenticate via MetaMask` button with `` from `@rainbow-me/rainbowkit`: ```javascript theme={null} import { ConnectButton } from '@rainbow-me/rainbowkit'; ... return (

Web3 Authentication

); ... ``` 2. Edit `handleAuth()` and move it under `useEffect()`: ```javascript theme={null} ... useEffect(() => { const handleAuth = async () => { const { message } = await requestChallengeAsync({ address: address, chainId: chain.id, }); const signature = await signMessageAsync({ message }); // redirect user after success authentication to '/user' page const { url } = await signIn("moralis-auth", { message, signature, redirect: false, callbackUrl: "/user", }); /** * instead of using signIn(..., redirect: "/user") * we get the url from callback and push it to the router to avoid page refreshing */ push(url); }; if (status === "unauthenticated" && isConnected) { handleAuth(); } }, [status, isConnected]); ... ``` 3. Update missing imports and add new hooks. This is the final code of `pages/signin.jsx`: ```javascript theme={null} import { useRouter } from "next/router"; import { useAuthRequestChallengeEvm } from "@moralisweb3/next"; import { ConnectButton } from "@rainbow-me/rainbowkit"; import { signIn, useSession } from "next-auth/react"; import { useAccount, useSignMessage, useNetwork } from "wagmi"; import { useEffect } from "react"; function SignIn() { const { isConnected, address } = useAccount(); const { chain } = useNetwork(); const { status } = useSession(); const { signMessageAsync } = useSignMessage(); const { push } = useRouter(); const { requestChallengeAsync } = useAuthRequestChallengeEvm(); useEffect(() => { const handleAuth = async () => { const { message } = await requestChallengeAsync({ address: address, chainId: chain.id, }); const signature = await signMessageAsync({ message }); // redirect user after success authentication to '/user' page const { url } = await signIn("moralis-auth", { message, signature, redirect: false, callbackUrl: "/user", }); /** * instead of using signIn(..., redirect: "/user") * we get the url from callback and push it to the router to avoid page refreshing */ push(url); }; if (status === "unauthenticated" && isConnected) { handleAuth(); } }, [status, isConnected]); return (

Web3 Authentication

); } export default SignIn; ``` ## Set Up RainbowKit with NextJS > [!NOTE] > > The Webpack v5 bundler used by Next.js no longer provides Node polyfills, so you'll need to include these modules yourself to satisfy RainbowKit's peer dependencies. In previous versions of RainbowKit that relied on ethers, the fs, net, and tls modules were automatically polyfilled. This is no longer the case with RainbowKit v1 + wagmi v1, which are built on viem. Open `next.config.js` file in the root of your project and add the following code: ```javascript theme={null} /** @type {import('next').NextConfig} */ const nextConfig = { reactStrictMode: true, webpack: (config) => { config.resolve.fallback = { fs: false, net: false, tls: false }; return config; }, }; module.exports = nextConfig; ``` Read more about RainbowKit configuration on the [official documentation](https://www.rainbowkit.com/docs/installation#additional-build-tooling-setup). ## Testing the RainbowKit Connector Visit [`http://localhost:3000/signin`](http://localhost:3000/signin) to test authentication. 1. Click on `Connect Wallet` 2. Select and connect a wallet you want to use for authentication from the RainbowKit modal 3. Sign the message: 4. After successful authentication, you will be redirected to the `/user` page 5. Visit [`http://localhost:3000/user`](http://localhost:3000/user) to test the user session's functionality: * When a user is authenticated, we show the user's info on the page. * When a user is not authenticated, we redirect to the `/signin` page. * When a user is authenticated, we show the user's info on the page, even refreshing after the page. ([***`Explanation: After Web3 wallet authentication, the next-auth library creates a session cookie with an encrypted JWT [JWE] stored inside. It contains session info [such as an address and signed message] in the user's browser.`***](https://jwt.io/introduction)) # How to Authenticate Users with WalletConnect Source: https://docs.moralis.com/get-started/tutorials/auth-api/authenticate-users-with-wallet-connect ## Before the Start You can start this tutorial if you already have a NextJS dapp with [MetaMask](/get-started/tutorials/auth-api/authenticate-users-with-meta-mask) functionality. ## Configuring the WalletConnect Connector 1. Open the`pages/signin.jsx` file and add `WalletConnectConnector` as a connector to `connectAsync()`. You should have your [Project ID](https://cloud.walletconnect.com/sign-in) for the WalletConnect configuration and replace `xxx` with it in the code below. ```javascript theme={null} import { WalletConnectConnector } from "wagmi/connectors/walletConnect"; import { signIn } from "next-auth/react"; import { useAccount, useConnect, useSignMessage, useDisconnect } from "wagmi"; import { useRouter } from "next/router"; import { useAuthRequestChallengeEvm } from "@moralisweb3/next"; function SignIn() { const { connectAsync } = useConnect({ connector: new WalletConnectConnector({ options: { projectId: "xxx", showQrModal: true }, }), }); const { disconnectAsync } = useDisconnect(); const { isConnected } = useAccount(); const { signMessageAsync } = useSignMessage(); const { requestChallengeAsync } = useAuthRequestChallengeEvm(); const { push } = useRouter(); const handleAuth = async () => { if (isConnected) { await disconnectAsync(); } const { account, chain } = await connectAsync(); const { message } = await requestChallengeAsync({ address: account, chainId: chain.id, }); const signature = await signMessageAsync({ message }); // redirect user after success authentication to '/user' page const { url } = await signIn("moralis-auth", { message, signature, redirect: false, callbackUrl: "/user", }); /** * instead of using signIn(..., redirect: "/user") * we get the url from callback and push it to the router to avoid page refreshing */ push(url); }; return (

Web3 Authentication

); } export default SignIn; ``` ## Testing the WalletConnect Connector Visit [`http://localhost:3000/signin`](http://localhost:3000/signin`) to test authentication. 1. Click on `Authenticate via WalletConnect` 2. Scan the QR code with your wallet 3. Connect your wallet 4. Sign the message: 5. Visit [`http://localhost:3000/user`](http://localhost:3000/user) to test the user session's functionality: * When a user is authenticated, we show the user's info on the page. * When a user is not authenticated, we redirect to the `/signin` page. * When a user is authenticated, we show the user's info on the page, even refreshing after the page. ([*`Explanation: After Web3 wallet authentication, the next-auth library creates a session cookie with an encrypted JWT [JWE] stored inside. It contains session info [such as an address and signed message] in the user's browser.`*](https://jwt.io/introduction)) # How to Authenticate Users with Web3Auth Source: https://docs.moralis.com/get-started/tutorials/auth-api/authenticate-users-with-web3-auth ## What is Web3Auth? > [!NOTE] > > Visit [Web3Auth docs](https://web3auth.io/docs/index.html) to get more information. Web3Auth is a pluggable auth infrastructure for Web3 wallets and applications. It streamlines the onboarding of mainstream and crypto-native users in under a minute by providing experiences they're most comfortable with. With support for all social logins, web and mobile-native platforms, wallets, and other key management methods, Web3Auth results in a standard cryptographic key provider specific to the user and application. ## Before Starting You can start this tutorial if you already have a NextJS dapp with [MetaMask sign-in](/get-started/tutorials/auth-api/authenticate-users-with-meta-mask) functionality.Installing the Web3Auth Wagmi Connector Install the `@web3auth/web3auth-wagmi-connector` dependency: ```bash npm2yarn theme={null} npm install @web3auth/web3auth-wagmi-connector@1.0.0 ``` ## Configuring the Web3Auth Wagmi Connector 1. Open the `pages/signin.jsx` file and add `Web3AuthConnector` as a connector to the `useConnect()` hook: ```javascript theme={null} import { Web3AuthConnector } from "@web3auth/web3auth-wagmi-connector"; import { signIn } from "next-auth/react"; import { useAccount, useConnect, useSignMessage, useDisconnect } from "wagmi"; import { useRouter } from "next/router"; import { useAuthRequestChallengeEvm } from "@moralisweb3/next"; function SignIn() { const { connectAsync } = useConnect({ connector: new Web3AuthConnector({ chains: ["0x1"], options: { clientId: "YOUR_CLIENT_ID", // Get your own client id from https://dashboard.web3auth.io }, }), }); const { disconnectAsync } = useDisconnect(); const { isConnected } = useAccount(); const { signMessageAsync } = useSignMessage(); const { push } = useRouter(); const { requestChallengeAsync } = useAuthRequestChallengeEvm() const handleAuth = async () => { if (isConnected) { await disconnectAsync(); } const { account } = await connectAsync(); const { message } = await requestChallengeAsync({ address: account, chainId: "0x1", }); const signature = await signMessageAsync({ message }); // redirect user after success authentication to '/user' page const { url } = await signIn("moralis-auth", { message, signature, redirect: false, callbackUrl: "/user", }); /** * instead of using signIn(..., redirect: "/user") * we get the url from callback and push it to the router to avoid page refreshing */ push(url); }; return (

Web3 Authentication

); } export default SignIn; ``` ## Testing the Web3Auth Connector Visit [`http://localhost:3000/signin`](http://localhost:3000/signin) to test authentication. 1. Click on `Authenticate via Web3Auth` 2. Select the preferred sign-in method 3. After successful authentication, you will be redirected to the `/user` page 4. Visit `http://localhost:3000/user` to test the user session's functionality: * When a user is authenticated, we show the user's info on the page. * When a user is not authenticated, we redirect to the `/signin` page. * When a user is authenticated, we show the user's info on the page, even refreshing after the page. ([***`Explanation: After Web3 wallet authentication, the next-auth library creates a session cookie with an encrypted JWT [JWE] stored inside. It contains session info [such as an address and signed message] in the user's browser.`***](https://jwt.io/introduction)) # Embed a TradingView Candlestick Chart for Pump.fun Tokens Source: https://docs.moralis.com/get-started/tutorials/charts-and-widgets/embed-pump-fun-trading-view-chart Learn how to embed a real-time TradingView candlestick chart for Pump.fun tokens using the Moralis Price Chart Widget. ## Overview Want to display real-time price charts for Pump.fun tokens on your website or app? With Moralis' Price Chart Widget, you can easily embed TradingView-style candlestick charts in just a few steps. ### What You Can Do * Embed real-time price charts for any Pump.fun token * Customize colors, layout, and time intervals * Works for pre-bonded Pump.fun tokens too * Supports HTML & React implementations *** ## Step 1: Configure Your Chart 1. Go to **[Moralis Price Chart Widget](https://moralis.com/crypto-price-chart-widget/)**. 2. Enter your **token address or pair address**. 3. Customize your **theme, background, candle colors, text colors, etc.**. 4. Choose a **default time interval** (e.g., `1D`, `1H`, `5M`). 5. Copy the **embed code** for HTML or React. *** ## Step 2: Embed the Chart in Your Project If you're using a basic website, you can copy and paste the HTML embed code. You can also use the React embed code if you're using a React project. ### HTML Embed Code ```html theme={null}
``` ## Step 3: Customize Your Chart You can customize the chart's appearance by tweaking these options: | Option | Description | | - | - | | backgroundColor | Background color of the chart | | candleUpColor | Color for bullish candles | | candleDownColor | Color for bearish candles | | textColor | Text color for labels | | gridColor | Gridline color | | defaultInterval | Default time interval (1D, 1H, 5M, etc.) | | hideLeftToolbar | Hide/show the left toolbar | | hideTopToolbar | Hide/show the top toolbar | | hideBottomToolbar | Hide/show the bottom toolbar | > [!TIP] > > You can embed charts for pre-bonded Pump.fun tokens the same way. Just enter the pre-bonded token address when configuring the widget. *** Charts are powered by [TradingView](https://www.tradingview.com/), the leading provider of financial charting tools and trading platform. *** ## Build a TradingView app in 5 minutes [Build a TradingView app in 5 minutes](https://www.youtube.com/embed/JJUBVOEkNH8) # OHLC Chart Configurator Source: https://docs.moralis.com/get-started/tutorials/charts-and-widgets/ohlc-chart-configurator Learn how to build interactive cryptocurrency candlestick charts using Chart.js or TradingView Lightweight Charts with the Moralis OHLCV API. ## Overview This tutorial covers two approaches to building crypto candlestick charts with the Moralis OHLCV API: 1. **Chart.js** — A popular, flexible charting library with a custom candlestick plugin 2. **TradingView Lightweight Charts** — A professional-grade charting library built for financial data Both approaches use React and fetch OHLCV data from the Moralis API. *** ## Option 1: Building with Chart.js ### Prerequisites * Node.js installed * Basic understanding of React * A Moralis API key ([get one](https://admin.moralis.com)) ### Step 1: Project Setup Create a new React project and install dependencies: ```bash theme={null} npx create-react-app chartjs-crypto cd chartjs-crypto npm install chart.js react-chartjs-2 axios react-spinners ``` Create a `.env` file in your project root: ``` REACT_APP_MORALIS_API_KEY=YOUR_API_KEY ``` ### Step 2: Setup Chart.js Components Create `src/components/CandlestickChart.js`: ```javascript theme={null} import React from "react"; import { Chart as ChartJS, CategoryScale, LinearScale, PointElement, LineElement, Title, Tooltip, Legend, } from "chart.js"; import { Line } from "react-chartjs-2"; import "chart.js/auto"; ChartJS.register( CategoryScale, LinearScale, PointElement, LineElement, Title, Tooltip, Legend ); const CandlestickChart = ({ candlestickData }) => { const formatData = () => { const labels = candlestickData.map((data) => new Date(data.time * 1000).toLocaleDateString() ); return { labels, datasets: [ { label: "High", data: candlestickData.map((data) => data.high), borderColor: "rgba(75, 192, 192, 1)", borderWidth: 1, fill: false, }, { label: "Low", data: candlestickData.map((data) => data.low), borderColor: "rgba(255, 99, 132, 1)", borderWidth: 1, fill: false, }, { label: "Open", data: candlestickData.map((data) => data.open), borderColor: "rgba(54, 162, 235, 1)", borderWidth: 1, fill: false, }, { label: "Close", data: candlestickData.map((data) => data.close), borderColor: "rgba(255, 206, 86, 1)", borderWidth: 1, fill: false, }, ], }; }; const options = { responsive: true, plugins: { legend: { position: "top" }, title: { display: true, text: "Cryptocurrency Price Chart" }, tooltip: { mode: "index", intersect: false }, }, scales: { y: { type: "linear", display: true, position: "left" }, }, interaction: { mode: "index", intersect: false }, }; return (
); }; export default CandlestickChart; ``` ### Step 3: Create Custom Candlestick Plugin Create `src/plugins/candlestickPlugin.js`: ```javascript theme={null} const candlestickPlugin = { id: "candlestick", beforeDatasetsDraw(chart, args, options) { const { ctx, data, scales: { x, y }, } = chart; ctx.strokeStyle = options.borderColor || "rgba(0, 0, 0, 0.8)"; ctx.lineWidth = options.borderWidth || 1; const candleWidth = x.getPixelForValue(1) - x.getPixelForValue(0); data.datasets[0].data.forEach((point, i) => { const open = y.getPixelForValue(data.datasets[2].data[i]); const close = y.getPixelForValue(data.datasets[3].data[i]); const high = y.getPixelForValue(point); const low = y.getPixelForValue(data.datasets[1].data[i]); const x1 = x.getPixelForValue(i); // Draw the wicks ctx.beginPath(); ctx.moveTo(x1, high); ctx.lineTo(x1, Math.min(open, close)); ctx.moveTo(x1, Math.max(open, close)); ctx.lineTo(x1, low); ctx.stroke(); // Draw the candle body ctx.fillStyle = close > open ? "#26a69a" : "#ef5350"; ctx.fillRect( x1 - candleWidth / 3, Math.min(open, close), (candleWidth * 2) / 3, Math.abs(close - open) ); }); }, }; export default candlestickPlugin; ``` ### Step 4: Update Chart Component with Plugin Update your CandlestickChart to use the custom plugin: ```javascript theme={null} import candlestickPlugin from "../plugins/candlestickPlugin"; const CandlestickChart = ({ candlestickData }) => { const options = { responsive: true, plugins: { legend: { display: false }, candlestick: { borderColor: "rgba(0, 0, 0, 0.8)", borderWidth: 1, }, }, scales: { y: { type: "linear", position: "left" }, }, }; const formatData = () => { const labels = candlestickData.map((data) => new Date(data.time * 1000).toLocaleDateString() ); return { labels, datasets: [ { data: candlestickData.map((data) => data.high), yAxisID: "y" }, { data: candlestickData.map((data) => data.low), yAxisID: "y" }, { data: candlestickData.map((data) => data.open), yAxisID: "y" }, { data: candlestickData.map((data) => data.close), yAxisID: "y" }, ], }; }; return (
); }; ``` ### Step 5: Implement Main App Component Update `App.js`: ```javascript theme={null} import React, { useState, useEffect } from "react"; import axios from "axios"; import CandlestickChart from "./components/CandlestickChart"; import ClipLoader from "react-spinners/ClipLoader"; import "./styles.css"; const App = () => { const [candlestickData, setCandlestickData] = useState([]); const [loading, setLoading] = useState(false); const fetchOHLCVData = async () => { setLoading(true); try { const apiKey = process.env.REACT_APP_MORALIS_API_KEY; const currentTime = Math.floor(Date.now() / 1000); const fromDate = currentTime - 30 * 24 * 60 * 60; const response = await axios.get( `https://deep-index.moralis.io/api/v2.2/pairs/0xa478c2975ab1ea89e8196811f51a7b7ade33eb11/ohlcv`, { params: { chain: "eth", timeframe: "1d", currency: "usd", fromDate, toDate: currentTime, limit: 1000, }, headers: { "X-API-Key": apiKey }, } ); const formattedData = response.data.result.map((item) => ({ time: Math.floor(new Date(item.timestamp).getTime() / 1000), open: item.open, high: item.high, low: item.low, close: item.close, })); setCandlestickData(formattedData); } catch (error) { console.error("Error fetching OHLCV data:", error); } finally { setLoading(false); } }; useEffect(() => { fetchOHLCVData(); }, []); return (

Crypto Candlestick Chart

{loading ? (
) : ( candlestickData.length > 0 && ( ) )}
); }; export default App; ``` ### Step 6: Add Styling Create `src/styles.css`: ```css theme={null} .app-container { max-width: 1200px; margin: 2rem auto; padding: 2rem; background: white; border-radius: 12px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1); } .chart-container { margin-top: 2rem; padding: 1.5rem; background: white; border-radius: 12px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05); height: 500px; } .loading-spinner { display: flex; justify-content: center; margin: 2rem 0; } h1 { text-align: center; color: #1a237e; margin-bottom: 2rem; } ``` Run with `npm start`. *** ## Option 2: Building with TradingView Lightweight Charts ### Step 1: Project Setup ```bash theme={null} npx create-react-app crypto-charts cd crypto-charts npm install lightweight-charts axios react-spinners ``` Create a `.env` file: ``` REACT_APP_MORALIS_API_KEY=YOUR_API_KEY ``` ### Step 2: Create Components **ChainSelector** (`src/components/ChainSelector.js`): ```javascript theme={null} import React from "react"; const chains = [ { id: "eth", name: "Ethereum", icon: "🔷" }, { id: "bsc", name: "BSC", icon: "💛" }, { id: "polygon", name: "Polygon", icon: "💜" }, { id: "arbitrum", name: "Arbitrum", icon: "🔵" }, ]; const ChainSelector = ({ onSelect }) => ( ); export default ChainSelector; ``` **TokenInput** (`src/components/TokenInput.js`): ```javascript theme={null} import React, { useState } from "react"; import axios from "axios"; const TokenInput = ({ chain, onPairsFetched, onReset }) => { const [tokenAddress, setTokenAddress] = useState(""); const [loading, setLoading] = useState(false); const fetchPairs = async () => { const apiKey = process.env.REACT_APP_MORALIS_API_KEY; const url = `https://deep-index.moralis.io/api/v2.2/erc20/${tokenAddress}/pairs?chain=${chain}`; setLoading(true); try { const response = await axios.get(url, { headers: { "X-API-Key": apiKey, accept: "application/json" }, }); const sortedPairs = response.data.pairs .map((pair) => ({ ...pair, liquidity: pair.liquidity_usd || pair.liquidityUsd || 0, })) .sort((a, b) => b.liquidity - a.liquidity); onPairsFetched(sortedPairs); } catch (error) { console.error("Error fetching token pairs:", error); onPairsFetched([]); } finally { setLoading(false); } }; return (
{ setTokenAddress(e.target.value); onReset(); }} /> {loading &&
Loading pairs...
}
); }; export default TokenInput; ``` ### Step 3: Implement the Chart Component Create `src/components/CandlestickChart.js`: ```javascript theme={null} import React, { useEffect, useRef } from "react"; import { createChart } from "lightweight-charts"; const CandlestickChart = ({ candlestickData }) => { const chartContainerRef = useRef(); const chartRef = useRef(); useEffect(() => { if (!chartRef.current) { const chart = createChart(chartContainerRef.current, { width: chartContainerRef.current.offsetWidth || 800, height: 400, layout: { backgroundColor: "#ffffff", textColor: "#333", }, grid: { vertLines: { color: "#f0f3fa" }, horzLines: { color: "#f0f3fa" }, }, timeScale: { timeVisible: true, borderVisible: true, }, }); const candlestickSeries = chart.addCandlestickSeries({ upColor: "#4caf50", downColor: "#f44336", borderVisible: false, wickUpColor: "#4caf50", wickDownColor: "#f44336", }); chartRef.current = { chart, candlestickSeries }; } if (candlestickData.length > 0) { chartRef.current.candlestickSeries.setData(candlestickData); } return () => { if (chartRef.current) { chartRef.current.chart.remove(); chartRef.current = null; } }; }, [candlestickData]); return (
); }; export default CandlestickChart; ``` ### Step 4: Implement Main App Update `App.js`: ```javascript theme={null} import React, { useState, useEffect } from "react"; import axios from "axios"; import ChainSelector from "./components/ChainSelector"; import TokenInput from "./components/TokenInput"; import CandlestickChart from "./components/CandlestickChart"; import ClipLoader from "react-spinners/ClipLoader"; import "./styles.css"; const App = () => { const [chain, setChain] = useState(""); const [pairs, setPairs] = useState([]); const [selectedPair, setSelectedPair] = useState(""); const [candlestickData, setCandlestickData] = useState([]); const [loading, setLoading] = useState(false); const fetchCandlestickData = async (pairAddress) => { if (!pairAddress) return; setLoading(true); try { const apiKey = process.env.REACT_APP_MORALIS_API_KEY; const currentTime = Math.floor(Date.now() / 1000); const fromDate = currentTime - 30 * 24 * 60 * 60; const response = await axios.get( `https://deep-index.moralis.io/api/v2.2/pairs/${pairAddress}/ohlcv`, { params: { chain, timeframe: "1d", currency: "usd", fromDate, toDate: currentTime, limit: 1000, }, headers: { "X-API-Key": apiKey }, } ); const formattedData = response.data.result.map((item) => ({ time: Math.floor(new Date(item.timestamp).getTime() / 1000), open: item.open, high: item.high, low: item.low, close: item.close, })); setCandlestickData(formattedData); } catch (error) { console.error("Error fetching candlestick data:", error); } finally { setLoading(false); } }; useEffect(() => { if (selectedPair) { fetchCandlestickData(selectedPair); } }, [selectedPair]); return (

Crypto Trading Charts

{ setPairs([]); setSelectedPair(""); setCandlestickData([]); }} /> {pairs.length > 0 && ( )}
{loading ? (
) : ( candlestickData.length > 0 && ( ) )}
); }; export default App; ``` ### Step 5: Add Styling Create `src/styles.css`: ```css theme={null} .app-container { max-width: 1200px; margin: 2rem auto; padding: 2rem; background: white; border-radius: 12px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1); } .controls-container { display: flex; flex-direction: column; gap: 1rem; max-width: 400px; margin: 0 auto 2rem auto; } select, input { width: 100%; padding: 0.75rem 1rem; border: 2px solid #e0e0e0; border-radius: 8px; font-size: 1rem; } button { background: #2196f3; color: white; padding: 0.75rem 1.5rem; border: none; border-radius: 8px; font-weight: 600; cursor: pointer; } button:disabled { background: #e0e0e0; cursor: not-allowed; } .chart-container { margin-top: 2rem; padding: 1.5rem; background: white; border-radius: 12px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05); } .loading-spinner { display: flex; justify-content: center; margin: 2rem 0; } ``` ### Using the Application 1. Select a blockchain network from the dropdown 2. Enter a token address (e.g., USDT, WETH) 3. Click "Fetch Pairs" to get available trading pairs 4. Select a trading pair to view its price chart 5. The chart will display OHLCV data for the last 30 days # Bitcoin API Quickstart Source: https://docs.moralis.com/get-started/tutorials/data-api/bitcoin/bitcoin-quickstart Make your first Bitcoin API request — fetch balances and history using either a Bitcoin address or an xpub via the Moralis Universal API. ## Introduction This quickstart walks you through your first request to the **Bitcoin Data API**. Under the hood it's the Moralis Universal API — every endpoint is the same one EVM and Solana developers already use, just with `bitcoin` as the chain. You'll fetch BTC balances and a page of wallet history, then call the xpub utility. The interesting part: the wallet endpoints accept **either an address or an xpub** as input, so you can drop the API into whichever shape your app already has. ## Prerequisites * Node.js v18+ installed * A Moralis API key ([get one](https://admin.moralis.com)) ## Step 1: Set up your project ```bash theme={null} mkdir bitcoin-quickstart && cd bitcoin-quickstart npm init -y ``` ## Step 2: Fetch a BTC balance — by address Create a file called `balance-by-address.js`: ```javascript theme={null} const API_KEY = 'YOUR_API_KEY'; const ADDRESS = 'bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq'; async function getBalance() { const response = await fetch( `https://api.moralis.com/v1/wallets/${ADDRESS}/tokens?chains=bitcoin`, { headers: { 'X-API-Key': API_KEY } } ); const data = await response.json(); console.log(JSON.stringify(data, null, 2)); } getBalance(); ``` Run it: ```bash theme={null} node balance-by-address.js ``` You should see the native BTC balance for the address. ## Step 3: Fetch the same kind of balance — by xpub The same endpoint accepts an xpub. Create `balance-by-xpub.js`: ```javascript theme={null} const API_KEY = 'YOUR_API_KEY'; const XPUB = 'xpub6CUGRUonZSQ4TWtTMmzXdrXDtypWKiKrhko4egpiMZbpiaQL2jkwSB1icqYh2cfDfVxdx4df189oLKnC5fSwqPfgyP3hooxujYzAu3fDVmz'; async function getBalance() { const response = await fetch( `https://api.moralis.com/v1/wallets/${XPUB}/tokens?chains=bitcoin`, { headers: { 'X-API-Key': API_KEY } } ); const data = await response.json(); console.log(JSON.stringify(data, null, 2)); } getBalance(); ``` The API derives every address from the xpub and aggregates balances for you. No client-side derivation, no extra libraries. ## Step 4: Pull wallet transaction history ```javascript theme={null} const API_KEY = 'YOUR_API_KEY'; const ADDRESS_OR_XPUB = 'bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq'; async function getHistory() { const response = await fetch( `https://api.moralis.com/v1/wallets/${ADDRESS_OR_XPUB}/history?chains=bitcoin&limit=10`, { headers: { 'X-API-Key': API_KEY } } ); const data = await response.json(); console.log(JSON.stringify(data, null, 2)); } getHistory(); ``` Use the returned `cursor` to paginate. ## Step 5: Get the current BTC price (with sparkline) ```javascript theme={null} const API_KEY = 'YOUR_API_KEY'; async function getPrice() { const [priceRes, sparkRes] = await Promise.all([ fetch('https://api.moralis.com/v1/chains/bitcoin/tokens/native/price', { headers: { 'X-API-Key': API_KEY }, }), fetch( 'https://api.moralis.com/v1/chains/bitcoin/tokens/native/price/sparkline', { headers: { 'X-API-Key': API_KEY } } ), ]); console.log('price:', await priceRes.json()); console.log('sparkline:', await sparkRes.json()); } getPrice(); ``` ## Step 6: Enumerate the addresses derived from an xpub If your UI needs to **display every address** controlled by an xpub (not just query against it), call the utility endpoint: ```javascript theme={null} const API_KEY = 'YOUR_API_KEY'; const XPUB = 'xpub6CUGRUonZSQ4TWtTMmzXdrXDtypWKiKrhko4egpiMZbpiaQL2jkwSB1icqYh2cfDfVxdx4df189oLKnC5fSwqPfgyP3hooxujYzAu3fDVmz'; async function getAddresses() { const response = await fetch( `https://api.moralis.com/v1/chains/bitcoin/wallets/${XPUB}/addresses`, { headers: { 'X-API-Key': API_KEY } } ); const data = await response.json(); console.log(JSON.stringify(data, null, 2)); } getAddresses(); ``` You'll get every derived address with its transfer count. ## What's next * [Bitcoin Wallet API](/data-api/bitcoin/wallet/overview) — balances and history * [Bitcoin Price API](/data-api/bitcoin/price/overview) — current price, history, sparklines * [Bitcoin Blockchain API](/data-api/bitcoin/blockchain/overview) — raw blocks and transactions * [Xpub Utility](/data-api/bitcoin/utility/addresses-from-xpub) — enumerate derived addresses *** ## Bitcoin API Overview [Bitcoin API Overview](https://www.youtube.com/embed/us4CIqGre0A) # How to Find the Closest Block by Unix Timestamp Source: https://docs.moralis.com/get-started/tutorials/data-api/blocks-and-transactions/find-the-closest-block-by-unix-timestamp Learn how to find the block number closest to any given date or timestamp using the Moralis API. ## Introduction In this tutorial, you'll learn how to find the block number that was mined closest to a specific date or Unix timestamp. This is useful for querying historical blockchain data at specific points in time, such as getting token balances or prices at a particular date. We'll use the following Moralis API endpoint: * [Get Block by Date](/data-api/evm/blockchain/block-by-date) - Find the block number closest to a given date or timestamp ## Prerequisites * Node.js v18+ installed * A Moralis API key ([get one](https://admin.moralis.com)) ## Step 1: Set Up Your Project Create a new directory for your project and initialize it: ```bash theme={null} mkdir get-block-by-date && cd get-block-by-date npm init -y ``` ## Step 2: Create the Script Create a file called `index.js` and add the following code: ```javascript theme={null} // index.js const API_KEY = 'YOUR_API_KEY'; async function getBlockByDate() { // Find the block closest to January 1, 2024 const date = '2024-01-01T00:00:00Z'; const response = await fetch( `https://deep-index.moralis.io/api/v2.2/dateToBlock?chain=eth&date=${encodeURIComponent(date)}`, { headers: { 'X-API-Key': API_KEY, }, } ); const data = await response.json(); console.log(JSON.stringify(data, null, 2)); } getBlockByDate(); ``` Replace `YOUR_API_KEY` with your actual Moralis API key. ## Step 3: Run the Script Execute the script to find the block: ```bash theme={null} node index.js ``` ## Example Response ```json theme={null} { "block": 18908895, "date": "2024-01-01T00:00:11.000Z", "timestamp": 1704067211, "block_timestamp": "2024-01-01T00:00:11.000Z", "hash": "0x..." } ``` ## Understanding the Response | Field | Description | | - | - | | `block` | The block number closest to the requested date | | `date` | ISO timestamp of when the block was mined | | `timestamp` | Unix timestamp of the block | | `block_timestamp` | Same as `date`, in ISO format | | `hash` | The block hash | ## Next Steps * [Get Transaction by Hash](/get-started/tutorials/data-api/blocks-and-transactions/get-a-blockchain-transaction-by-hash) - Fetch transaction details * [Get Wallet History](/get-started/tutorials/data-api/wallets-and-accounts/get-full-wallet-transaction-history-eoa-and-smart-accounts) - Get wallet transaction history # How to Get a Blockchain Transaction by Hash Source: https://docs.moralis.com/get-started/tutorials/data-api/blocks-and-transactions/get-a-blockchain-transaction-by-hash Learn how to fetch detailed transaction data using a transaction hash with the Moralis API. ## Introduction In this tutorial, you'll learn how to retrieve detailed information about any blockchain transaction using its hash. This is essential for building transaction explorers, tracking payments, or verifying on-chain activity in your application. We'll use the following Moralis API endpoint: * [Get Transaction by Hash](/data-api/evm/blockchain/transaction-by-hash) - Fetch detailed transaction data using a transaction hash ## Prerequisites * Node.js v18+ installed * A Moralis API key ([get one](https://admin.moralis.com)) ## Step 1: Set Up Your Project Create a new directory for your project and initialize it: ```bash theme={null} mkdir get-transaction && cd get-transaction npm init -y ``` ## Step 2: Create the Script Create a file called `index.js` and add the following code: ```javascript theme={null} // index.js const API_KEY = 'YOUR_API_KEY'; const TX_HASH = '0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060'; async function getTransaction() { const response = await fetch( `https://deep-index.moralis.io/api/v2.2/transaction/${TX_HASH}?chain=eth`, { headers: { 'X-API-Key': API_KEY, }, } ); const data = await response.json(); console.log(JSON.stringify(data, null, 2)); } getTransaction(); ``` Replace `YOUR_API_KEY` with your actual Moralis API key. ## Step 3: Run the Script Execute the script to fetch the transaction details: ```bash theme={null} node index.js ``` ## Example Response ```json theme={null} { "hash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "nonce": "0", "transaction_index": "0", "from_address": "0xa1e4380a3b1f749673e270229993ee55f35663b4", "from_address_label": null, "to_address": "0x5df9b87991262f6ba471f09758cde1c0fc1de734", "to_address_label": null, "value": "31337000000000000", "gas": "21000", "gas_price": "20000000000", "input": "0x", "receipt_cumulative_gas_used": "21000", "receipt_gas_used": "21000", "receipt_status": "1", "block_timestamp": "2015-08-07T03:30:33.000Z", "block_number": "46147", "block_hash": "0x4e3a3754410177e6937ef1f84bba68ea139e8d1a2258c5f85db9f1cd715a1bdd", "transaction_fee": "0.00042" } ``` ## Understanding the Response | Field | Description | | - | - | | `hash` | The transaction hash | | `from_address` | The sender's wallet address | | `to_address` | The recipient's wallet address | | `value` | Amount transferred in wei | | `gas` | Gas limit set for the transaction | | `gas_price` | Gas price in wei | | `receipt_status` | Transaction status (1 = success, 0 = failed) | | `block_timestamp` | When the transaction was mined | | `block_number` | Block number containing this transaction | | `transaction_fee` | Total fee paid in native token | ## Next Steps * [Get Wallet Transaction History](/get-started/tutorials/data-api/wallets-and-accounts/get-full-wallet-transaction-history-eoa-and-smart-accounts) - Fetch all transactions for a wallet * [Find Block by Timestamp](/get-started/tutorials/data-api/blocks-and-transactions/find-the-closest-block-by-unix-timestamp) - Find blocks at specific times # How to Get All NFTs Owned by a Wallet Address Source: https://docs.moralis.com/get-started/tutorials/data-api/nfts/get-all-nfts-owned-by-a-wallet-address Learn how to fetch all NFTs (ERC721 and ERC1155) owned by any wallet address using the Moralis API. ## Introduction In this tutorial, you'll learn how to retrieve all NFTs owned by a wallet address using the Moralis API. This works for both ERC721 and ERC1155 tokens and includes metadata, images, and collection information. This is essential for building NFT galleries, portfolio trackers, or wallet applications. We'll use the following Moralis API endpoint: * [Get Wallet NFTs](/data-api/evm/wallet/nft-balances) - Fetch all NFTs owned by a wallet address ## Prerequisites * Node.js v18+ installed * A Moralis API key ([get one](https://admin.moralis.com)) ## Step 1: Set Up Your Project Create a new directory for your project and initialize it: ```bash theme={null} mkdir get-nft-balances && cd get-nft-balances npm init -y ``` ## Step 2: Create the Script Create a file called `index.js` and add the following code: ```javascript theme={null} // index.js const API_KEY = 'YOUR_API_KEY'; const WALLET_ADDRESS = '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045'; // Vitalik's wallet async function getNFTs() { const response = await fetch( `https://deep-index.moralis.io/api/v2.2/${WALLET_ADDRESS}/nft?chain=eth`, { headers: { 'X-API-Key': API_KEY, }, } ); const data = await response.json(); console.log(JSON.stringify(data, null, 2)); } getNFTs(); ``` Replace `YOUR_API_KEY` with your actual Moralis API key. ## Step 3: Run the Script Execute the script to fetch the NFTs: ```bash theme={null} node index.js ``` ## Example Response ```json theme={null} { "status": "SYNCED", "page": 1, "page_size": 100, "cursor": null, "result": [ { "token_address": "0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d", "token_id": "1234", "amount": "1", "owner_of": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045", "token_hash": "abc123...", "contract_type": "ERC721", "name": "Bored Ape Yacht Club", "symbol": "BAYC", "token_uri": "ipfs://QmeSjSinHpPnmXmspMjwiXyN6zS4E9zccariGR3jxcaWtq/1234", "metadata": { "name": "Bored Ape #1234", "image": "ipfs://QmRRPWG96cmgTn2qSzjwr2qvfNEuhunv6FNeMFGa9bx6mQ", "attributes": [ { "trait_type": "Background", "value": "Aquamarine" }, { "trait_type": "Fur", "value": "Blue" } ] }, "last_token_uri_sync": "2024-01-15T10:30:00.000Z", "last_metadata_sync": "2024-01-15T10:30:00.000Z", "possible_spam": false, "verified_collection": true, "floor_price": 25.5, "floor_price_usd": 45000 } ] } ``` ## Understanding the Response | Field | Description | | - | - | | `token_address` | The NFT collection contract address | | `token_id` | The unique token ID within the collection | | `amount` | Quantity owned (relevant for ERC1155) | | `contract_type` | Token standard (ERC721 or ERC1155) | | `name` | Collection name | | `symbol` | Collection symbol | | `metadata` | NFT metadata (name, image, attributes) | | `possible_spam` | Whether the NFT is flagged as spam | | `verified_collection` | Whether the collection is verified | | `floor_price` | Current floor price in native token | | `floor_price_usd` | Floor price in USD | ## Next Steps * [Get NFT Metadata](/data-api/evm/nft/metadata/nft-metadata) - Get detailed NFT metadata * [Get NFT Floor Prices](/data-api/evm/nft/prices/collection-floor-price) - Fetch collection floor prices * [NFT Metadata](/data-api/data-features/data-enrichment/nft-metadata) - explore detailed metadata * [NFT Media Images (CDN)](/data-api/data-features/data-enrichment/nft-metadata/image-previews-cdn) - learn how we store NFT images *** ## Fetch NFT Data [Fetch NFT Data](https://www.youtube.com/embed/ap2MJf1XrcU) # How to Get NFT Collections Owned by a Wallet Source: https://docs.moralis.com/get-started/tutorials/data-api/nfts/get-nft-collections-owned-by-a-wallet Learn how to fetch a summary of NFT collections owned by any wallet address using the Moralis API. ## Introduction In this tutorial, you'll learn how to retrieve a summary of all NFT collections owned by a wallet address using the Moralis API. Instead of listing every individual NFT, this endpoint groups NFTs by collection and provides counts, making it perfect for portfolio overviews and collection summaries. We'll use the following Moralis API endpoint: * [Get Wallet NFT Collections](/data-api/evm/wallet/nft-collections) - Fetch a summary of NFT collections owned by a wallet ## Prerequisites * Node.js v18+ installed * A Moralis API key ([get one](https://admin.moralis.com)) ## Step 1: Set Up Your Project Create a new directory for your project and initialize it: ```bash theme={null} mkdir get-nft-collections && cd get-nft-collections npm init -y ``` ## Step 2: Create the Script Create a file called `index.js` and add the following code: ```javascript theme={null} // index.js const API_KEY = 'YOUR_API_KEY'; const WALLET_ADDRESS = '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045'; // Vitalik's wallet async function getNFTCollections() { const response = await fetch( `https://deep-index.moralis.io/api/v2.2/${WALLET_ADDRESS}/nft/collections?chain=eth`, { headers: { 'X-API-Key': API_KEY, }, } ); const data = await response.json(); console.log(JSON.stringify(data, null, 2)); } getNFTCollections(); ``` Replace `YOUR_API_KEY` with your actual Moralis API key. ## Step 3: Run the Script Execute the script to fetch the collections: ```bash theme={null} node index.js ``` ## Example Response ```json theme={null} { "status": "SYNCED", "page": 1, "page_size": 100, "cursor": null, "result": [ { "token_address": "0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d", "contract_type": "ERC721", "name": "Bored Ape Yacht Club", "symbol": "BAYC", "count": 3, "collection_logo": "https://...", "collection_banner_image": "https://...", "possible_spam": false, "verified_collection": true, "floor_price": 25.5, "floor_price_usd": 89250.75 }, { "token_address": "0x60e4d786628fea6478f785a6d7e704777c86a7c6", "contract_type": "ERC721", "name": "Mutant Ape Yacht Club", "symbol": "MAYC", "count": 2, "collection_logo": "https://...", "possible_spam": false, "verified_collection": true, "floor_price": 4.2, "floor_price_usd": 14700.00 } ] } ``` ## Understanding the Response | Field | Description | | - | - | | `token_address` | Collection contract address | | `contract_type` | Token standard (ERC721 or ERC1155) | | `name` | Collection name | | `symbol` | Collection symbol | | `count` | Number of NFTs owned from this collection | | `collection_logo` | URL to collection logo | | `possible_spam` | Whether flagged as spam | | `verified_collection` | Whether collection is verified | | `floor_price` | Current floor price in ETH | | `floor_price_usd` | Floor price in USD | ## Next Steps * [Get NFT Metadata](/data-api/evm/nft/metadata/nft-metadata) - Get detailed NFT metadata * [Get NFT Floor Prices](/data-api/evm/nft/prices/collection-floor-price) - Fetch collection floor prices * [NFT Metadata](/data-api/data-features/data-enrichment/nft-metadata) - explore detailed metadata * [NFT Media Images (CDN)](/data-api/data-features/data-enrichment/nft-metadata/image-previews-cdn) - learn how we store NFT images # How to Get NFT Floor Prices Source: https://docs.moralis.com/get-started/tutorials/data-api/nfts/get-nft-floor-prices Learn how to fetch NFT collection floor prices using the Moralis API. ## Introduction In this tutorial, you'll learn how to retrieve floor prices for any NFT collection using the Moralis API. Floor prices represent the lowest listed price for an NFT in a collection, which is a key metric for understanding collection value and market trends. We'll use the following Moralis API endpoint: * [Get NFT Floor Price](/data-api/evm/nft/prices/collection-floor-price) - Fetch the current floor price for an NFT collection ## Prerequisites * Node.js v18+ installed * A Moralis API key ([get one](https://admin.moralis.com)) ## Step 1: Set Up Your Project Create a new directory for your project and initialize it: ```bash theme={null} mkdir get-nft-floor-price && cd get-nft-floor-price npm init -y ``` ## Step 2: Create the Script Create a file called `index.js` and add the following code: ```javascript theme={null} // index.js const API_KEY = 'YOUR_API_KEY'; const NFT_ADDRESS = '0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D'; // BAYC async function getFloorPrice() { const response = await fetch( `https://deep-index.moralis.io/api/v2.2/nft/${NFT_ADDRESS}/floor-price?chain=eth`, { headers: { 'X-API-Key': API_KEY, }, } ); const data = await response.json(); console.log(JSON.stringify(data, null, 2)); } getFloorPrice(); ``` Replace `YOUR_API_KEY` with your actual Moralis API key. ## Step 3: Run the Script Execute the script to fetch the floor price: ```bash theme={null} node index.js ``` ## Example Response ```json theme={null} { "floor_price": 25.5, "floor_price_usd": 89250.75, "floor_price_currency": "ETH", "marketplace": "opensea", "marketplace_logo": "https://cdn.moralis.io/marketplaces/opensea.png", "last_updated": "2024-01-15T10:30:00.000Z" } ``` ## Understanding the Response | Field | Description | | - | - | | `floor_price` | Floor price in native token (ETH) | | `floor_price_usd` | Floor price converted to USD | | `floor_price_currency` | Currency of the floor price | | `marketplace` | Marketplace where floor was found | | `marketplace_logo` | Logo URL of the marketplace | | `last_updated` | When the floor price was last updated | ## Next Steps * [Get All Wallet NFTs](/get-started/tutorials/data-api/nfts/get-all-nfts-owned-by-a-wallet-address) - Fetch NFTs for a wallet * [Get NFT Metadata](/get-started/tutorials/data-api/nfts/get-nft-metadata-by-contract-and-token-id) - Get detailed NFT info * [Get NFT Owners](/get-started/tutorials/data-api/nfts/get-nft-owners-and-ownership-details) - Get ownership data * [API Reference](/data-api/evm/nft/prices/collection-floor-price) - Full API documentation # How to Get NFT Metadata by Contract and Token ID Source: https://docs.moralis.com/get-started/tutorials/data-api/nfts/get-nft-metadata-by-contract-and-token-id Learn how to fetch detailed metadata for a specific NFT using its contract address and token ID with the Moralis API. ## Introduction In this tutorial, you'll learn how to retrieve detailed metadata for a specific NFT using its contract address and token ID. This includes the name, description, image, attributes/traits, and ownership information. This is essential for building NFT detail pages, verification tools, or collection browsers. We'll use the following Moralis API endpoint: * [Get NFT Metadata](/data-api/evm/nft/metadata/nft-metadata) - Fetch detailed metadata for a specific NFT ## Prerequisites * Node.js v18+ installed * A Moralis API key ([get one](https://admin.moralis.com)) ## Step 1: Set Up Your Project Create a new directory for your project and initialize it: ```bash theme={null} mkdir get-nft-metadata && cd get-nft-metadata npm init -y ``` ## Step 2: Create the Script Create a file called `index.js` and add the following code: ```javascript theme={null} // index.js const API_KEY = 'YOUR_API_KEY'; const NFT_ADDRESS = '0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D'; // BAYC const TOKEN_ID = '1234'; async function getNFTMetadata() { const response = await fetch( `https://deep-index.moralis.io/api/v2.2/nft/${NFT_ADDRESS}/${TOKEN_ID}?chain=eth`, { headers: { 'X-API-Key': API_KEY, }, } ); const data = await response.json(); console.log(JSON.stringify(data, null, 2)); } getNFTMetadata(); ``` Replace `YOUR_API_KEY` with your actual Moralis API key. ## Step 3: Run the Script Execute the script to fetch the NFT metadata: ```bash theme={null} node index.js ``` ## Example Response ```json theme={null} { "token_address": "0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d", "token_id": "1234", "amount": "1", "owner_of": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045", "token_hash": "abc123def456...", "block_number_minted": "12346789", "contract_type": "ERC721", "name": "Bored Ape Yacht Club", "symbol": "BAYC", "token_uri": "ipfs://QmeSjSinHpPnmXmspMjwiXyN6zS4E9zccariGR3jxcaWtq/1234", "metadata": { "name": "Bored Ape #1234", "description": "A unique Bored Ape NFT", "image": "ipfs://QmRRPWG96cmgTn2qSzjwr2qvfNEuhunv6FNeMFGa9bx6mQ", "attributes": [ { "trait_type": "Background", "value": "Aquamarine" }, { "trait_type": "Fur", "value": "Blue" }, { "trait_type": "Eyes", "value": "Bored" }, { "trait_type": "Mouth", "value": "Grin" }, { "trait_type": "Clothes", "value": "Sailor Shirt" } ] }, "last_token_uri_sync": "2024-01-15T10:30:00.000Z", "last_metadata_sync": "2024-01-15T10:30:00.000Z", "minter_address": "0x1234567890abcdef...", "possible_spam": false, "verified_collection": true, "floor_price": 25.5, "floor_price_usd": 45000 } ``` ## Understanding the Response | Field | Description | | - | - | | `token_address` | The NFT collection contract address | | `token_id` | The unique token ID | | `owner_of` | Current owner's wallet address | | `contract_type` | Token standard (ERC721 or ERC1155) | | `name` | Collection name | | `symbol` | Collection symbol | | `metadata` | Raw metadata from token URI | | `minter_address` | Address that originally minted the NFT | | `possible_spam` | Whether flagged as spam | | `verified_collection` | Whether collection is verified | | `floor_price` | Current collection floor price | | `floor_price_usd` | Floor price in USD | ## Next Steps * [Get NFT Metadata](/data-api/evm/nft/metadata/nft-metadata) - Get detailed NFT metadata * [NFT Metadata](/data-api/data-features/data-enrichment/nft-metadata) - explore detailed metadata * [NFT Media Images (CDN)](/data-api/data-features/data-enrichment/nft-metadata/image-previews-cdn) - learn how we store NFT images # How to Get NFT Owners and Ownership Details Source: https://docs.moralis.com/get-started/tutorials/data-api/nfts/get-nft-owners-and-ownership-details Learn how to fetch ownership data for NFT collections and individual tokens using the Moralis API. ## Introduction In this tutorial, you'll learn how to retrieve ownership data for NFT collections using the Moralis API. This includes getting all unique owners of a collection, finding who owns a specific token, and analyzing ownership distribution. This is essential for building collection analytics, whale tracking, or ownership verification tools. We'll use the following Moralis API endpoint: * [Get NFT Owners](/data-api/evm/nft/ownership/owners-by-contract) - Fetch ownership data for NFT collections and individual tokens ## Prerequisites * Node.js v18+ installed * A Moralis API key ([get one](https://admin.moralis.com)) ## Step 1: Set Up Your Project Create a new directory for your project and initialize it: ```bash theme={null} mkdir get-nft-owners && cd get-nft-owners npm init -y ``` ## Step 2: Create the Script Create a file called `index.js` and add the following code: ```javascript theme={null} // index.js const API_KEY = 'YOUR_API_KEY'; const NFT_ADDRESS = '0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D'; // BAYC async function getCollectionOwners() { const response = await fetch( `https://deep-index.moralis.io/api/v2.2/nft/${NFT_ADDRESS}/owners?chain=eth`, { headers: { 'X-API-Key': API_KEY, }, } ); const data = await response.json(); console.log(JSON.stringify(data, null, 2)); } getCollectionOwners(); ``` Replace `YOUR_API_KEY` with your actual Moralis API key. ## Step 3: Run the Script Execute the script to fetch the owners: ```bash theme={null} node index.js ``` ## Example Response ```json theme={null} { "status": "SYNCED", "page": 1, "page_size": 100, "cursor": "abc123...", "result": [ { "token_address": "0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d", "token_id": "1234", "amount": "1", "owner_of": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045", "token_hash": "...", "block_number_minted": "12346789", "contract_type": "ERC721", "name": "Bored Ape Yacht Club", "symbol": "BAYC", "last_token_uri_sync": "2024-01-15T10:30:00.000Z", "last_metadata_sync": "2024-01-15T10:30:00.000Z" } ] } ``` ## Understanding the Response | Field | Description | | - | - | | `token_id` | The unique token ID | | `owner_of` | Current owner's wallet address | | `amount` | Quantity owned (1 for ERC721) | | `block_number_minted` | Block when the NFT was minted | | `contract_type` | Token standard (ERC721 or ERC1155) | ## Next Steps * [Get NFT Metadata](/data-api/evm/nft/metadata/nft-metadata) - Get detailed NFT metadata * [Get NFT Floor Prices](/data-api/evm/nft/prices/collection-floor-price) - Fetch collection floor prices * [NFT Metadata](/data-api/data-features/data-enrichment/nft-metadata) - explore detailed metadata * [NFT Media Images (CDN)](/data-api/data-features/data-enrichment/nft-metadata/image-previews-cdn) - learn how we store NFT images # How to Build Crypto Price Charts Using OHLC Data Source: https://docs.moralis.com/get-started/tutorials/data-api/prices-and-charts/build-crypto-price-charts-using-ohlc-data Learn how to create interactive candlestick price charts using OHLC data from the Moralis API. ## Introduction In this tutorial, you'll learn how to build interactive cryptocurrency price charts using OHLC (Open, High, Low, Close) data from the Moralis API. We'll use the Lightweight Charts library from TradingView to create professional-looking candlestick charts that can be embedded in any web application. We'll use the following Moralis API endpoint: * [Get OHLCV Data](/data-api/evm/price/ohlc) - Fetch historical candlestick price data for token pairs ## Prerequisites * Node.js v18+ installed * A Moralis API key ([get one](https://admin.moralis.com)) * Basic HTML/JavaScript knowledge ## Step 1: Set Up Your Project Create a new directory and files: ```bash theme={null} mkdir crypto-charts && cd crypto-charts npm init -y ``` ## Step 2: Create the HTML File Create an `index.html` file: ```html theme={null} Crypto Price Chart

ETH/USDC Price Chart

``` ## Step 3: Create the JavaScript File Create a `chart.js` file: ```javascript theme={null} const API_KEY = 'YOUR_API_KEY'; const PAIR_ADDRESS = '0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640'; // WETH/USDC on Uniswap V3 async function initChart() { const chartContainer = document.getElementById('chart'); const chart = LightweightCharts.createChart(chartContainer, { layout: { background: { color: '#1a1a2e' }, textColor: '#d1d4dc', }, grid: { vertLines: { color: '#2a2a4e' }, horzLines: { color: '#2a2a4e' }, }, }); const candleSeries = chart.addCandlestickSeries({ upColor: '#26a69a', downColor: '#ef5350', borderUpColor: '#26a69a', borderDownColor: '#ef5350', wickUpColor: '#26a69a', wickDownColor: '#ef5350', }); // Required: specify date range for OHLC data const fromDate = new Date(Date.now() - 30 * 24 * 60 * 60 * 1000).toISOString(); const toDate = new Date().toISOString(); const response = await fetch( `https://deep-index.moralis.io/api/v2.2/pairs/${PAIR_ADDRESS}/ohlcv?chain=eth&timeframe=1d&from_date=${fromDate}&to_date=${toDate}`, { headers: { 'X-API-Key': API_KEY }, } ); const data = await response.json(); const candleData = data.result .map((candle) => ({ time: Math.floor(new Date(candle.timestamp).getTime() / 1000), open: candle.open, high: candle.high, low: candle.low, close: candle.close, })) .sort((a, b) => a.time - b.time); candleSeries.setData(candleData); chart.timeScale().fitContent(); } initChart(); ``` Replace `YOUR_API_KEY` with your actual Moralis API key. ## Step 4: Run the Chart Open `index.html` in your browser, or serve it with a simple HTTP server: ```bash theme={null} npx serve . ``` ## Example OHLC Response ```json theme={null} { "pair_address": "0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640", "result": [ { "timestamp": "2024-01-15T00:00:00.000Z", "open": 3450.25, "high": 3475.50, "low": 3445.00, "close": 3468.75, "volume": 15234567.89 } ] } ``` ## Understanding the Response | Field | Description | | - | - | | `timestamp` | The start time of the candle | | `open` | Opening price for the period | | `high` | Highest price during the period | | `low` | Lowest price during the period | | `close` | Closing price for the period | | `volume` | Trading volume in USD | ## Next Steps * [Get OHLC Data](/get-started/tutorials/data-api/prices-and-charts/get-historical-erc-20-token-prices-ohlc-data) - Learn about OHLC data * [Get Token Price](/get-started/tutorials/data-api/prices-and-charts/get-the-price-of-an-erc-20-token) - Get current prices * [Build a DEX Screener](/get-started/tutorials/data-api/tokens-and-markets/build-a-dex-screener-clone) - Build a trading dashboard * [API Reference](/data-api/evm/price/ohlc) - Full API documentation # How to Get Historical ERC20 Token Prices (OHLC Data) Source: https://docs.moralis.com/get-started/tutorials/data-api/prices-and-charts/get-historical-erc-20-token-prices-ohlc-data Learn how to fetch historical OHLC (candlestick) price data for any ERC20 token using the Moralis API. ## Introduction In this tutorial, you'll learn how to retrieve historical OHLC (Open, High, Low, Close) price data for any ERC20 token using the Moralis API. This candlestick data is essential for building price charts, technical analysis tools, or trading interfaces. We'll use the following Moralis API endpoint: * [Get OHLCV Data](/data-api/evm/price/ohlc) - Fetch historical candlestick price data for token pairs > [!NOTE] > > Candlestick data is also available for Solana - see the [Solana OHLCV endpoint](/data-api/solana/price/ohlc). ## Prerequisites * Node.js v18+ installed * A Moralis API key ([get one](https://admin.moralis.com)) ## Step 1: Set Up Your Project Create a new directory for your project and initialize it: ```bash theme={null} mkdir get-ohlc-data && cd get-ohlc-data npm init -y ``` ## Step 2: Create the Script Create a file called `index.js` and add the following code: ```javascript theme={null} // index.js const API_KEY = 'YOUR_API_KEY'; // WETH/USDC pair on Uniswap V3 const PAIR_ADDRESS = '0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640'; async function getOHLCData() { // Required: specify date range for OHLC data const fromDate = new Date(Date.now() - 7 * 24 * 60 * 60 * 1000).toISOString(); // 7 days ago const toDate = new Date().toISOString(); const response = await fetch( `https://deep-index.moralis.io/api/v2.2/pairs/${PAIR_ADDRESS}/ohlcv?chain=eth&timeframe=1h¤cy=usd&fromDate=${fromDate}&toDate=${toDate}`, { headers: { 'X-API-Key': API_KEY, }, } ); const data = await response.json(); console.log(JSON.stringify(data, null, 2)); } getOHLCData(); ``` Replace `YOUR_API_KEY` with your actual Moralis API key. ## Step 3: Run the Script Execute the script to fetch the OHLC data: ```bash theme={null} node index.js ``` ## Example Response ```json theme={null} { "page": 1, "cursor": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...", "pairAddress": "0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640", "timeframe": "1h", "currency": "usd", "result": [ { "timestamp": "2024-01-15T10:00:00.000Z", "open": 3450.25, "high": 3475.50, "low": 3445.00, "close": 3468.75, "volume": 15234567.89, "trades": 1523 }, { "timestamp": "2024-01-15T11:00:00.000Z", "open": 3468.75, "high": 3490.00, "low": 3460.00, "close": 3485.25, "volume": 18456789.12, "trades": 1847 } ] } ``` ## Understanding the Response | Field | Description | | - | - | | `pairAddress` | The liquidity pair contract address | | `timeframe` | The candle timeframe requested | | `currency` | The currency prices are denominated in (`usd` or `native`) | | `page` | The current page of the result | | `cursor` | Cursor for fetching the next page of results | | `timestamp` | The start time of the candle | | `open` | Opening price for the period | | `high` | Highest price during the period | | `low` | Lowest price during the period | | `close` | Closing price for the period | | `volume` | Trading volume in USD | | `trades` | Number of trades in the period | ## Next Steps * [Build Price Charts](/get-started/tutorials/data-api/prices-and-charts/build-crypto-price-charts-using-ohlc-data) - Create interactive charts * [Get Token Price](/get-started/tutorials/data-api/prices-and-charts/get-the-price-of-an-erc-20-token) - Get current prices * [Get Token Pairs](/get-started/tutorials/data-api/tokens-and-markets/get-token-pairs-and-liquidity-data) - Find trading pairs * [API Reference](/data-api/evm/price/ohlc) - Full API documentation # How to Get the Price of an ERC20 Token Source: https://docs.moralis.com/get-started/tutorials/data-api/prices-and-charts/get-the-price-of-an-erc-20-token Learn how to fetch the current price of any ERC20 token using the Moralis API. ## Introduction In this tutorial, you'll learn how to get the current USD price of any ERC20 token using the Moralis API. This is essential for building price trackers, trading interfaces, or portfolio applications that need real-time token pricing. We'll use the following Moralis API endpoint: * [Get Token Price](/data-api/evm/token/prices/token-prices-batch) - Fetch the current price of any ERC20 token ## Prerequisites * Node.js v18+ installed * A Moralis API key ([get one](https://admin.moralis.com)) ## Step 1: Set Up Your Project Create a new directory for your project and initialize it: ```bash theme={null} mkdir get-token-price && cd get-token-price npm init -y ``` ## Step 2: Create the Script Create a file called `index.js` and add the following code: ```javascript theme={null} // index.js const API_KEY = 'YOUR_API_KEY'; const TOKEN_ADDRESS = '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48'; // USDC async function getTokenPrice() { const response = await fetch( `https://deep-index.moralis.io/api/v2.2/erc20/${TOKEN_ADDRESS}/price?chain=eth`, { headers: { 'X-API-Key': API_KEY, }, } ); const data = await response.json(); console.log(JSON.stringify(data, null, 2)); } getTokenPrice(); ``` Replace `YOUR_API_KEY` with your actual Moralis API key. ## Step 3: Run the Script Execute the script to fetch the token price: ```bash theme={null} node index.js ``` ## Example Response ```json theme={null} { "tokenName": "USD Coin", "tokenSymbol": "USDC", "tokenLogo": "https://cdn.moralis.io/eth/0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48.png", "tokenDecimals": "6", "nativePrice": { "value": "296177284127975", "decimals": 18, "name": "Ether", "symbol": "ETH", "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2" }, "usdPrice": 0.9998, "usdPriceFormatted": "0.9998", "24hrPercentChange": "0.02", "exchangeAddress": "0x1f98431c8ad98523631ae4a59f267346ea31f984", "exchangeName": "Uniswap v3" } ``` ## Understanding the Response | Field | Description | | - | - | | `tokenName` | The full name of the token | | `tokenSymbol` | The token's ticker symbol | | `tokenLogo` | URL to the token's logo image | | `tokenDecimals` | Number of decimal places the token uses | | `nativePrice` | Price in the chain's native token (ETH) | | `usdPrice` | Current price in USD | | `24hrPercentChange` | Price change percentage over 24 hours | | `exchangeAddress` | DEX address where the price was sourced | | `exchangeName` | Name of the DEX (e.g., Uniswap v3) | ## Next Steps * [Get Historical Prices (OHLC)](/get-started/tutorials/data-api/prices-and-charts/get-historical-erc-20-token-prices-ohlc-data) - Fetch OHLC candlestick data * [Build Price Charts](/get-started/tutorials/data-api/prices-and-charts/build-crypto-price-charts-using-ohlc-data) - Create interactive price charts * [API Reference](/data-api/evm/token/prices/token-prices-batch) - Full API documentation # How to Build a DexScreener Clone Source: https://docs.moralis.com/get-started/tutorials/data-api/tokens-and-markets/build-a-dex-screener-clone Learn how to build a DEX token screener dashboard using the Moralis API. ## Introduction In this tutorial, you'll learn how to build a DEX token screener similar to DexScreener using the Moralis API. The screener will display tokens ranked by volume with real-time prices, market cap, and price changes. We'll use the following Moralis API endpoint: * [Token Search](/data-api/universal/token/search/token-search) - Search and rank tokens by volume, market cap, or liquidity > [!NOTE] > > Token Search requires a `query`, so it ranks the tokens matching your search rather than the entire token universe. ## Prerequisites * Node.js v18+ installed * A Moralis API key ([get one](https://admin.moralis.com)) ## Step 1: Set Up Your Project Create a new directory for your project and initialize it: ```bash theme={null} mkdir dex-screener && cd dex-screener npm init -y ``` ## Step 2: Create the Script Create a file called `index.js` and add the following code: ```javascript theme={null} // index.js const API_KEY = 'YOUR_API_KEY'; async function getTopTokens() { const params = new URLSearchParams({ query: 'pepe', chains: 'eth', sortBy: 'volume24hDesc', isVerifiedContract: 'true', limit: '20', }); const response = await fetch( `https://deep-index.moralis.io/api/v2.2/tokens/search?${params}`, { headers: { accept: 'application/json', 'X-API-Key': API_KEY, }, } ); const data = await response.json(); console.log(JSON.stringify(data, null, 2)); } getTopTokens(); ``` Replace `YOUR_API_KEY` with your actual Moralis API key. ## Step 3: Run the Script Execute the script to get the top tokens: ```bash theme={null} node index.js ``` ## Example Response ```json theme={null} { "total": 10000, "result": [ { "tokenAddress": "0x6982508145454ce325ddbe47a25d4ec3d2311933", "chainId": "0x1", "name": "Pepe", "symbol": "PEPE", "logo": "https://cdn.moralis.io/eth/0x6982508145454ce325ddbe47a25d4ec3d2311933.png", "usdPrice": 0.000024509478199144, "marketCap": 9825629287.860994, "fullyDilutedValuation": 71242582.97741453, "usdPricePercentChange": { "oneHour": 1.079210724244654, "oneDay": 2.079210724244654 }, "volumeUsd": { "oneHour": 188552.0639107914, "oneDay": 76927981.5281831 }, "totalLiquidityUsd": 18908.234, "totalHolders": 18908, "securityScore": 92, "isVerifiedContract": false } ] } ``` ## Understanding the Response | Field | Description | | - | - | | `tokenAddress` | Contract address of the token | | `chainId` | Chain the token is on, in hex | | `name` | Token name | | `symbol` | Token ticker symbol | | `logo` | URL to token logo image | | `usdPrice` | Current price in USD | | `marketCap` | Total market capitalization in USD | | `fullyDilutedValuation` | FDV based on total supply | | `usdPricePercentChange.oneDay` | 24-hour price change percentage | | `volumeUsd.oneDay` | 24-hour trading volume in USD | | `totalLiquidityUsd` | Total liquidity across pairs, in USD | | `totalHolders` | Number of token holders | | `securityScore` | Token security score (0-100) | | `isVerifiedContract` | Whether the contract is verified | ## Next Steps * [Get Token Price](/get-started/tutorials/data-api/prices-and-charts/get-the-price-of-an-erc-20-token) - Price data * [Get OHLC Data](/get-started/tutorials/data-api/prices-and-charts/get-historical-erc-20-token-prices-ohlc-data) - Historical prices * [Get Token Pairs](/get-started/tutorials/data-api/tokens-and-markets/get-token-pairs-and-liquidity-data) - Liquidity data * [API Reference](/data-api/universal/token/search/token-search) - Full API documentation # How to Get DEX Pair Addresses (Uniswap, PancakeSwap, SushiSwap) Source: https://docs.moralis.com/get-started/tutorials/data-api/tokens-and-markets/get-dex-pair-addresses-uniswap-pancake-swap-sushi-swap Learn how to find liquidity pair addresses for any token pair on popular DEXs using the Moralis API. ## Introduction In this tutorial, you'll learn how to find DEX liquidity pair addresses for any two tokens using the Moralis API. This is essential for getting trading data, liquidity information, and price data for token pairs on decentralized exchanges like Uniswap, PancakeSwap, and SushiSwap. We'll use the following Moralis API endpoint: ## Prerequisites * Node.js v18+ installed * A Moralis API key ([get one](https://admin.moralis.com)) ## Step 1: Set Up Your Project Create a new directory for your project and initialize it: ```bash theme={null} mkdir get-pair-address && cd get-pair-address npm init -y ``` ## Step 2: Create the Script Create a file called `index.js` and add the following code: ```javascript theme={null} // index.js const API_KEY = 'YOUR_API_KEY'; // Token addresses const WETH = '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2'; const USDC = '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48'; async function getPairAddress() { const response = await fetch( `https://deep-index.moralis.io/api/v2.2/${WETH}/${USDC}/pairAddress?chain=eth`, { headers: { 'X-API-Key': API_KEY, }, } ); const data = await response.json(); console.log(JSON.stringify(data, null, 2)); } getPairAddress(); ``` Replace `YOUR_API_KEY` with your actual Moralis API key. ## Step 3: Run the Script Execute the script to find the pair address: ```bash theme={null} node index.js ``` ## Example Response ```json theme={null} { "token0": { "address": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", "name": "USD Coin", "symbol": "USDC", "decimals": 6, "logo": "https://cdn.moralis.io/eth/0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48.png" }, "token1": { "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", "name": "Wrapped Ether", "symbol": "WETH", "decimals": 18, "logo": "https://cdn.moralis.io/eth/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.png" }, "pairAddress": "0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640", "exchange": "uniswapv3", "exchangeAddress": "0x1f98431c8ad98523631ae4a59f267346ea31f984", "exchangeLogo": "https://cdn.moralis.io/eth/0x1f98431c8ad98523631ae4a59f267346ea31f984.png" } ``` ## Understanding the Response | Field | Description | | - | - | | `token0` | First token in the pair with metadata | | `token1` | Second token in the pair with metadata | | `pairAddress` | The liquidity pair contract address | | `exchange` | Name of the DEX (uniswapv2, uniswapv3, sushiswap, etc.) | | `exchangeAddress` | The DEX factory contract address | | `exchangeLogo` | URL to the exchange logo | ## Next Steps * [Get Token Pairs and Liquidity](/get-started/tutorials/data-api/tokens-and-markets/get-token-pairs-and-liquidity-data) - Get liquidity data for pairs * [Get OHLC Data](/get-started/tutorials/data-api/prices-and-charts/get-historical-erc-20-token-prices-ohlc-data) - Fetch price history * [Build a DEX Screener](/get-started/tutorials/data-api/tokens-and-markets/build-a-dex-screener-clone) - Create a trading dashboard * [API Reference](/data-api/evm/token/overview) - Full API documentation # How to Get ERC20 Token Balances for a Wallet Source: https://docs.moralis.com/get-started/tutorials/data-api/tokens-and-markets/get-erc-20-token-balances-for-a-wallet Learn how to fetch all ERC20 token balances for any wallet address using the Moralis API. ## Introduction In this tutorial, you'll learn how to retrieve all ERC20 token balances for a wallet address using the Moralis API. This is essential for building portfolio trackers, wallet dashboards, or any application that needs to display a user's token holdings. We'll use the following Moralis API endpoint: * [Get Wallet Token Balances](/data-api/evm/wallet/token-balances) - Fetch all ERC20 tokens held by a wallet ## Prerequisites * Node.js v18+ installed * A Moralis API key ([get one](https://admin.moralis.com)) ## Step 1: Set Up Your Project Create a new directory for your project and initialize it: ```bash theme={null} mkdir get-token-balances && cd get-token-balances npm init -y ``` ## Step 2: Create the Script Create a file called `index.js` and add the following code: ```javascript theme={null} // index.js const API_KEY = 'YOUR_API_KEY'; const WALLET_ADDRESS = '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045'; // Vitalik's wallet async function getTokenBalances() { const response = await fetch( `https://deep-index.moralis.io/api/v2.2/wallets/${WALLET_ADDRESS}/tokens?chain=eth`, { headers: { 'X-API-Key': API_KEY, }, } ); const data = await response.json(); console.log(JSON.stringify(data, null, 2)); } getTokenBalances(); ``` Replace `YOUR_API_KEY` with your actual Moralis API key. ## Step 3: Run the Script Execute the script to fetch the token balances: ```bash theme={null} node index.js ``` ## Example Response ```json theme={null} { "result": [ { "token_address": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", "symbol": "USDC", "name": "USD Coin", "logo": "https://cdn.moralis.io/eth/0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48.png", "thumbnail": "https://cdn.moralis.io/eth/0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48_thumb.png", "decimals": 6, "balance": "1000000000", "possible_spam": false, "verified_contract": true, "balance_formatted": "1000", "usd_price": 0.999, "usd_price_24hr_percent_change": 0.01, "usd_value": 999.0, "portfolio_percentage": 25.5 } ] } ``` ## Understanding the Response | Field | Description | | - | - | | `token_address` | The contract address of the ERC20 token | | `symbol` | The token's ticker symbol (e.g., USDC) | | `name` | The full name of the token | | `decimals` | Number of decimal places the token uses | | `balance` | Raw token balance (in smallest unit) | | `balance_formatted` | Human-readable balance with decimals applied | | `usd_price` | Current USD price of the token | | `usd_value` | Total USD value of the token balance | | `possible_spam` | Whether the token is flagged as potential spam | | `verified_contract` | Whether the token contract is verified | | `portfolio_percentage` | Percentage this token represents in the wallet | ## Next Steps * [Get Token Metadata](/get-started/tutorials/data-api/tokens-and-markets/get-erc-20-token-metadata-by-address-or-symbol) - Learn how to get detailed token information * [Get Token Price](/get-started/tutorials/data-api/prices-and-charts/get-the-price-of-an-erc-20-token) - Fetch current token prices * [API Reference](/data-api/evm/wallet/token-balances) - Full API documentation *** ## Fetch Wallet Data [Fetch Wallet Data](https://www.youtube.com/embed/DnfTx7hgD_E) # How to Get ERC20 Token Metadata by Address or Symbol Source: https://docs.moralis.com/get-started/tutorials/data-api/tokens-and-markets/get-erc-20-token-metadata-by-address-or-symbol Learn how to fetch detailed token metadata including name, symbol, decimals, and logo using the Moralis API. ## Introduction In this tutorial, you'll learn how to retrieve detailed metadata for any ERC20 token using the Moralis API. This includes the token name, symbol, decimals, logo, and more. This is useful for displaying token information in your application without needing to query the blockchain directly. We'll use the following Moralis API endpoint: * [Get Token Metadata](/data-api/evm/token/metadata/token-metadata) - Fetch detailed metadata for ERC20 tokens ## Prerequisites * Node.js v18+ installed * A Moralis API key ([get one](https://admin.moralis.com)) ## Step 1: Set Up Your Project Create a new directory for your project and initialize it: ```bash theme={null} mkdir get-token-metadata && cd get-token-metadata npm init -y ``` ## Step 2: Create the Script Create a file called `index.js` and add the following code: ```javascript theme={null} // index.js const API_KEY = 'YOUR_API_KEY'; const TOKEN_ADDRESS = '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48'; // USDC async function getTokenMetadata() { const response = await fetch( `https://deep-index.moralis.io/api/v2.2/erc20/metadata?chain=eth&addresses=${TOKEN_ADDRESS}`, { headers: { 'X-API-Key': API_KEY, }, } ); const data = await response.json(); console.log(JSON.stringify(data, null, 2)); } getTokenMetadata(); ``` Replace `YOUR_API_KEY` with your actual Moralis API key. ## Step 3: Run the Script Execute the script to fetch the token metadata: ```bash theme={null} node index.js ``` ## Example Response ```json theme={null} [ { "address": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", "address_label": "USD Coin", "name": "USD Coin", "symbol": "USDC", "decimals": "6", "logo": "https://cdn.moralis.io/eth/0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48.png", "logo_hash": "a5d5d6eb25e2b5a8c26e7e47f7c6a2c8", "thumbnail": "https://cdn.moralis.io/eth/0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48_thumb.png", "total_supply": "26000000000000000", "total_supply_formatted": "26000000000", "block_number": "12345678", "validated": true, "created_at": "2018-09-10T00:00:00.000Z", "possible_spam": false, "verified_contract": true, "categories": ["stablecoin"], "links": { "website": "https://www.circle.com/usdc", "twitter": "https://twitter.com/circle" } } ] ``` ## Understanding the Response | Field | Description | | - | - | | `address` | The token's contract address | | `name` | The full name of the token | | `symbol` | The token's ticker symbol | | `decimals` | Number of decimal places the token uses | | `logo` | URL to the token's logo image | | `thumbnail` | URL to a smaller version of the logo | | `total_supply` | Total supply in the smallest unit | | `total_supply_formatted` | Human-readable total supply | | `possible_spam` | Whether the token is flagged as potential spam | | `verified_contract` | Whether the contract source code is verified | | `categories` | Token categories (e.g., stablecoin, meme) | | `links` | Official links (website, Twitter, etc.) | ## Next Steps * [Get Token Balances](/get-started/tutorials/data-api/tokens-and-markets/get-erc-20-token-balances-for-a-wallet) - Fetch wallet token balances * [Get Token Price](/get-started/tutorials/data-api/prices-and-charts/get-the-price-of-an-erc-20-token) - Get current token prices * [API Reference](/data-api/evm/token/metadata/token-metadata) - Full API documentation # How to Get ERC20 Transfer History by Wallet or Token Source: https://docs.moralis.com/get-started/tutorials/data-api/tokens-and-markets/get-erc-20-transfer-history-by-wallet-or-token Learn how to fetch ERC20 token transfer history for any wallet or token contract using the Moralis API. ## Introduction In this tutorial, you'll learn how to retrieve ERC20 token transfer history using the Moralis API. You can fetch transfers for a specific wallet address or for a specific token contract. This is essential for building transaction history pages, token analytics dashboards, or tracking token movements. We'll use the following Moralis API endpoint: * [Get Wallet Token Transfers](/data-api/evm/wallet/token-transfers) - Fetch ERC20 transfer history for a wallet or token ## Prerequisites * Node.js v18+ installed * A Moralis API key ([get one](https://admin.moralis.com)) ## Step 1: Set Up Your Project Create a new directory for your project and initialize it: ```bash theme={null} mkdir get-token-transfers && cd get-token-transfers npm init -y ``` ## Step 2: Create the Script Create a file called `index.js` and add the following code: ```javascript theme={null} // index.js const API_KEY = 'YOUR_API_KEY'; const WALLET_ADDRESS = '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045'; // Vitalik's wallet async function getWalletTokenTransfers() { const response = await fetch( `https://deep-index.moralis.io/api/v2.2/${WALLET_ADDRESS}/erc20/transfers?chain=eth`, { headers: { 'X-API-Key': API_KEY, }, } ); const data = await response.json(); console.log(JSON.stringify(data, null, 2)); } getWalletTokenTransfers(); ``` Replace `YOUR_API_KEY` with your actual Moralis API key. ## Step 3: Run the Script Execute the script to fetch the transfer history: ```bash theme={null} node index.js ``` ## Example Response ```json theme={null} { "page": 1, "page_size": 100, "cursor": null, "result": [ { "token_name": "USD Coin", "token_symbol": "USDC", "token_logo": "https://cdn.moralis.io/eth/0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48.png", "token_decimals": "6", "from_address": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045", "from_address_label": "Vitalik Buterin", "to_address": "0x1234567890abcdef1234567890abcdef12345678", "to_address_label": null, "address": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", "block_hash": "0x...", "block_number": "18500000", "block_timestamp": "2024-01-15T10:30:00.000Z", "transaction_hash": "0x...", "transaction_index": 45, "log_index": 123, "value": "1000000000", "value_formatted": "1000", "possible_spam": false, "verified_contract": true } ] } ``` ## Understanding the Response | Field | Description | | - | - | | `token_name` | Name of the transferred token | | `token_symbol` | Symbol of the token | | `from_address` | Sender's wallet address | | `from_address_label` | Known label for sender (if available) | | `to_address` | Recipient's wallet address | | `to_address_label` | Known label for recipient (if available) | | `value` | Transfer amount in smallest unit | | `value_formatted` | Human-readable transfer amount | | `block_timestamp` | When the transfer occurred | | `transaction_hash` | Transaction hash of the transfer | | `possible_spam` | Whether the token is flagged as spam | ## Next Steps * [Get Token Balances](/data-api/evm/wallet/token-balances) - Fetch current token balances * [Get Wallet History](/data-api/evm/wallet/wallet-history) - Get complete wallet activity * [API Reference](/data-api/evm/wallet/overview) - Full API documentation # How to Get Pump.fun New, Bonding & Graduated Tokens Source: https://docs.moralis.com/get-started/tutorials/data-api/tokens-and-markets/get-pump-fun-new-bonding-and-graduated-tokens Learn how to fetch new, bonding, and graduated tokens from Pump.fun on Solana using the Moralis API. ## Introduction In this tutorial, you'll learn how to retrieve Pump.fun token data using the Moralis Solana API. Pump.fun is a popular token launchpad on Solana where new tokens go through bonding curve phases before graduating to DEXs. You'll learn how to fetch newly created tokens, tokens in bonding phase, and graduated tokens. We'll use the following Moralis API endpoint: * [Get Pump.fun New Tokens](/data-api/solana/token/search-and-discovery/pump-fun-new-tokens) - Fetch newly created tokens on Pump.fun ## Prerequisites * Node.js v18+ installed * A Moralis API key ([get one](https://admin.moralis.com)) ## Step 1: Set Up Your Project Create a new directory for your project and initialize it: ```bash theme={null} mkdir pump-fun-tokens && cd pump-fun-tokens npm init -y ``` ## Step 2: Create the Script Create a file called `index.js` and add the following code: ```javascript theme={null} // index.js const API_KEY = 'YOUR_API_KEY'; async function getNewPumpFunTokens() { const response = await fetch( 'https://solana-gateway.moralis.io/token/mainnet/exchange/pumpfun/new', { headers: { 'X-API-Key': API_KEY, }, } ); const data = await response.json(); console.log(JSON.stringify(data, null, 2)); } getNewPumpFunTokens(); ``` Replace `YOUR_API_KEY` with your actual Moralis API key. ## Step 3: Run the Script ```bash theme={null} node index.js ``` ## Example Response ```json theme={null} { "result": [ { "tokenAddress": "ABC123...", "name": "Example Token", "symbol": "EXT", "logo": "https://...", "createdAt": "2024-01-15T10:30:00.000Z", "marketCap": 15000, "priceUsd": 0.000015, "volume24h": 5000, "holders": 150, "bondingProgress": 5.5, "isGraduated": false } ] } ``` ## Understanding the Response | Field | Description | | - | - | | `tokenAddress` | The Solana token mint address | | `name` | Token name | | `symbol` | Token symbol | | `createdAt` | When the token was created | | `marketCap` | Current market cap in USD | | `priceUsd` | Current price in USD | | `volume24h` | 24-hour trading volume | | `holders` | Number of unique holders | | `bondingProgress` | Progress through bonding curve (0-100%) | | `isGraduated` | Whether token has graduated to DEX | ## Understanding Pump.fun Token States | State | Description | | - | - | | **New** | Recently created tokens (less than 24 hours old) | | **Bonding** | Tokens in bonding curve with 20%+ progress | | **Graduated** | Tokens that completed bonding and are on DEXs | ## Next Steps * [Get Pump.fun Token Swaps and Prices](/get-started/tutorials/data-api/tokens-and-markets/get-pump-fun-tokens-swaps-and-prices) - Get trading data * [API Reference - New Tokens](/data-api/solana/token/search-and-discovery/pump-fun-new-tokens) - Full API documentation * [API Reference - Bonding Tokens](/data-api/solana/token/search-and-discovery/pump-fun-bonding-tokens) - Bonding endpoint docs * [API Reference - Graduated Tokens](/data-api/solana/token/search-and-discovery/pump-fun-graduated-tokens) - Graduated endpoint docs # How to Get Pump.fun Tokens, Swaps and Prices Source: https://docs.moralis.com/get-started/tutorials/data-api/tokens-and-markets/get-pump-fun-tokens-swaps-and-prices Learn how to fetch swap data and price information for Pump.fun tokens on Solana using the Moralis API. ## Introduction In this tutorial, you'll learn how to retrieve swap (trade) data and price information for Pump.fun tokens using the Moralis Solana API. This includes getting recent swaps, price history, and OHLC data for any token launched on Pump.fun. We'll use the following Moralis API endpoint: * [Get Token Swaps](/data-api/solana/token/swaps/token-swaps) - Fetch swap history and trading data for Solana tokens ## Prerequisites * Node.js v18+ installed * A Moralis API key ([get one](https://admin.moralis.com)) ## Step 1: Set Up Your Project Create a new directory for your project and initialize it: ```bash theme={null} mkdir pump-fun-swaps && cd pump-fun-swaps npm init -y ``` ## Step 2: Create the Script Create a file called `index.js` and add the following code: ```javascript theme={null} // index.js const API_KEY = 'YOUR_API_KEY'; const TOKEN_ADDRESS = 'YOUR_PUMP_FUN_TOKEN_ADDRESS'; // Solana token mint address async function getTokenSwaps() { const response = await fetch( `https://solana-gateway.moralis.io/token/mainnet/${TOKEN_ADDRESS}/swaps`, { headers: { 'X-API-Key': API_KEY, }, } ); const data = await response.json(); console.log(JSON.stringify(data, null, 2)); } getTokenSwaps(); ``` Replace `YOUR_API_KEY` and `YOUR_PUMP_FUN_TOKEN_ADDRESS` with your actual values. ## Step 3: Run the Script ```bash theme={null} node index.js ``` ## Example Response ```json theme={null} { "result": [ { "transactionHash": "5abc123...", "blockTime": "2024-01-15T10:30:00.000Z", "tokenIn": { "address": "So11111111111111111111111111111111111111112", "symbol": "SOL", "amount": "1.5", "amountUsd": 150.00 }, "tokenOut": { "address": "ABC123...", "symbol": "PUMP", "amount": "1000000", "amountUsd": 150.00 }, "walletAddress": "7abc...", "exchange": "pumpfun", "swapType": "buy" } ] } ``` ## Understanding the Response | Field | Description | | - | - | | `transactionHash` | Solana transaction signature | | `blockTime` | When the swap occurred | | `tokenIn` | Token being sold (with amount and USD value) | | `tokenOut` | Token being bought (with amount and USD value) | | `walletAddress` | Wallet that made the swap | | `exchange` | DEX where swap occurred | | `swapType` | Type of trade (buy or sell) | ## Next Steps * [Get Pump.fun New/Bonding/Graduated Tokens](/get-started/tutorials/data-api/tokens-and-markets/get-pump-fun-new-bonding-and-graduated-tokens) - Discover tokens * [API Reference - Token Swaps](/data-api/solana/token/swaps/token-swaps) - Full API documentation * [API Reference - Token Price](/data-api/solana/price/token-price) - Price endpoint docs # How to Get Token Pairs and Liquidity Data Source: https://docs.moralis.com/get-started/tutorials/data-api/tokens-and-markets/get-token-pairs-and-liquidity-data Learn how to fetch trading pairs and liquidity information for any ERC20 token using the Moralis API. ## Introduction In this tutorial, you'll learn how to retrieve all trading pairs and liquidity data for any ERC20 token using the Moralis API. This includes pair addresses, liquidity amounts, volume data, and exchange information. This is essential for building token analytics, DEX aggregators, or trading interfaces. We'll use the following Moralis API endpoint: * [Get Token Pairs](/data-api/evm/token/swaps/token-pairs) - Fetch all trading pairs and liquidity data for a token ## Prerequisites * Node.js v18+ installed * A Moralis API key ([get one](https://admin.moralis.com)) ## Step 1: Set Up Your Project Create a new directory for your project and initialize it: ```bash theme={null} mkdir get-token-pairs && cd get-token-pairs npm init -y ``` ## Step 2: Create the Script Create a file called `index.js` and add the following code: ```javascript theme={null} // index.js const API_KEY = 'YOUR_API_KEY'; const TOKEN_ADDRESS = '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48'; // USDC async function getTokenPairs() { const response = await fetch( `https://deep-index.moralis.io/api/v2.2/erc20/${TOKEN_ADDRESS}/pairs?chain=eth`, { headers: { 'X-API-Key': API_KEY, }, } ); const data = await response.json(); console.log(JSON.stringify(data, null, 2)); } getTokenPairs(); ``` Replace `YOUR_API_KEY` with your actual Moralis API key. ## Step 3: Run the Script Execute the script to fetch the token pairs: ```bash theme={null} node index.js ``` ## Example Response ```json theme={null} { "page": 1, "page_size": 100, "cursor": null, "result": [ { "pairAddress": "0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640", "pairLabel": "WETH/USDC", "exchange": "uniswapv3", "exchangeAddress": "0x1f98431c8ad98523631ae4a59f267346ea31f984", "exchangeLogo": "https://cdn.moralis.io/eth/0x1f98431c8ad98523631ae4a59f267346ea31f984.png", "token0": { "address": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", "name": "USD Coin", "symbol": "USDC", "decimals": 6, "logo": "https://cdn.moralis.io/eth/0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48.png" }, "token1": { "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", "name": "Wrapped Ether", "symbol": "WETH", "decimals": 18, "logo": "https://cdn.moralis.io/eth/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.png" }, "usdPrice": 3500.50, "usdPriceFormatted": "3500.50", "liquidityUsd": 250000000, "volume24h": 15000000, "priceChange24h": 2.5 } ] } ``` ## Understanding the Response | Field | Description | | - | - | | `pairAddress` | The liquidity pair contract address | | `pairLabel` | Human-readable pair name (e.g., WETH/USDC) | | `exchange` | DEX name (uniswapv2, uniswapv3, sushiswap) | | `token0` / `token1` | Token metadata for both sides of the pair | | `usdPrice` | Current price in USD | | `liquidityUsd` | Total liquidity in USD | | `volume24h` | 24-hour trading volume in USD | | `priceChange24h` | 24-hour price change percentage | ## Next Steps * [Get OHLC Data](/get-started/tutorials/data-api/prices-and-charts/get-historical-erc-20-token-prices-ohlc-data) - Get price history * [Get Pair Stats](/data-api/evm/token/swaps/pair-stats) - detailed market data * [Build a DEX Screener](/get-started/tutorials/data-api/tokens-and-markets/build-a-dex-screener-clone) - Build a trading dashboard * [API Reference](/data-api/evm/token/overview) - Full API documentation # How to Get Top ERC20 Tokens by Market Cap Source: https://docs.moralis.com/get-started/tutorials/data-api/tokens-and-markets/get-top-erc-20-tokens-by-market-cap Learn how to rank ERC20 tokens by market cap, volume, and liquidity using the Moralis Token Search API. ## Introduction In this tutorial, you'll learn how to rank ERC20 tokens by market cap using the Moralis API. You can also sort by trading volume and liquidity. This is useful for building token discovery platforms, market dashboards, or trading screeners. We'll use the following Moralis API endpoint: * [Token Search](/data-api/universal/token/search/token-search) - Search and rank tokens by market cap, volume, or liquidity > [!NOTE] > > Token Search requires a `query`, so it ranks the tokens matching your search rather than the entire token universe. There is no endpoint that returns a global top N by market cap. If that's what you need, [reach out to the team](https://admin.moralis.com/) (via chat widget). ## Prerequisites * Node.js v18+ installed * A Moralis API key ([get one](https://admin.moralis.com)) ## Step 1: Set Up Your Project Create a new directory for your project and initialize it: ```bash theme={null} mkdir get-top-tokens && cd get-top-tokens npm init -y ``` ## Step 2: Create the Script Create a file called `index.js` and add the following code: ```javascript theme={null} // index.js const API_KEY = 'YOUR_API_KEY'; async function getTopTokens() { const params = new URLSearchParams({ query: 'pepe', chains: 'eth', sortBy: 'marketCapDesc', limit: '20', }); const response = await fetch( `https://deep-index.moralis.io/api/v2.2/tokens/search?${params}`, { headers: { accept: 'application/json', 'X-API-Key': API_KEY, }, } ); const data = await response.json(); console.log(JSON.stringify(data, null, 2)); } getTopTokens(); ``` Replace `YOUR_API_KEY` with your actual Moralis API key. ## Step 3: Run the Script Execute the script to get tokens ranked by market cap: ```bash theme={null} node index.js ``` ## Query Parameters | Parameter | Description | | - | - | | `query` | Required. Contract address, pair address, token name, or symbol to search for | | `chains` | Comma-separated chains to filter by. Omit for a cross-chain search | | `sortBy` | `marketCapDesc`, `liquidityDesc`, `volume24hDesc`, or `volume1hDesc` | | `limit` | Page size of the result | | `isVerifiedContract` | Set to `true` to return only verified contracts | ## Example Response ```json theme={null} { "total": 10000, "result": [ { "tokenAddress": "0x6982508145454ce325ddbe47a25d4ec3d2311933", "chainId": "0x1", "name": "Pepe", "symbol": "PEPE", "logo": "https://cdn.moralis.io/eth/0x6982508145454ce325ddbe47a25d4ec3d2311933.png", "usdPrice": 0.000024509478199144, "marketCap": 9825629287.860994, "fullyDilutedValuation": 71242582.97741453, "usdPricePercentChange": { "oneHour": 1.079210724244654, "oneDay": 2.079210724244654 }, "volumeUsd": { "oneHour": 188552.0639107914, "oneDay": 76927981.5281831 }, "totalLiquidityUsd": 18908.234, "totalHolders": 18908, "securityScore": 92, "isVerifiedContract": false } ] } ``` ## Understanding the Response | Field | Description | | - | - | | `tokenAddress` | Token contract address | | `chainId` | Chain the token is on, in hex | | `name` / `symbol` | Token name and symbol | | `usdPrice` | Current price in USD | | `marketCap` | Current market capitalization in USD | | `fullyDilutedValuation` | FDV based on total supply | | `usdPricePercentChange` | Price change over one hour and one day | | `volumeUsd` | Trading volume over one hour and one day | | `totalLiquidityUsd` | Total liquidity across pairs, in USD | | `totalHolders` | Number of unique holders | | `securityScore` | Token security score (0-100) | | `isVerifiedContract` | Whether the contract is verified | ## Next Steps * [Get Token Price](/get-started/tutorials/data-api/prices-and-charts/get-the-price-of-an-erc-20-token) - Get current token prices # How to Build a Token Approval & Revoke Dashboard (Revoke.cash-Style) Source: https://docs.moralis.com/get-started/tutorials/data-api/wallets-and-accounts/build-a-token-approval-and-revoke-dashboard-revoke-cash-style Learn how to build a dashboard to view and revoke token approvals using the Moralis API. ## Introduction In this tutorial, you'll learn how to build a token approval dashboard similar to Revoke.cash using the Moralis API. Users can view all their ERC20 token approvals and identify potentially risky unlimited approvals. This is an important security tool for managing DeFi permissions. We'll use the following Moralis API endpoint: * [Get Token Approvals](/data-api/evm/wallet/approvals) - Fetch all token approvals granted by a wallet ## Prerequisites * Node.js v18+ installed * A Moralis API key ([get one](https://admin.moralis.com)) ## Step 1: Set Up Your Project Create a new directory for your project and initialize it: ```bash theme={null} mkdir revoke-dashboard && cd revoke-dashboard npm init -y ``` ## Step 2: Create the Script Create a file called `index.js` and add the following code: ```javascript theme={null} // index.js const API_KEY = 'YOUR_API_KEY'; const WALLET_ADDRESS = '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045'; async function getTokenApprovals() { const response = await fetch( `https://deep-index.moralis.io/api/v2.2/wallets/${WALLET_ADDRESS}/approvals?chain=eth`, { headers: { 'X-API-Key': API_KEY, }, } ); const data = await response.json(); console.log(JSON.stringify(data, null, 2)); } getTokenApprovals(); ``` Replace `YOUR_API_KEY` with your actual Moralis API key. ## Step 3: Run the Script ```bash theme={null} node index.js ``` ## Example Response ```json theme={null} { "page": 1, "page_size": 100, "result": [ { "block_number": "12526958", "block_timestamp": "2024-01-15T10:30:00.000Z", "transaction_hash": "0x...", "value": "115792089237316195423570985008687907853269984665640564039457584007913129639935", "value_formatted": "unlimited", "token": { "address": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", "name": "USD Coin", "symbol": "USDC", "logo": "https://cdn.moralis.io/eth/0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48.png", "decimals": 6, "current_balance": "1000000000", "current_balance_formatted": "1000", "usd_price": 0.9998, "usd_at_risk": 999.80 }, "spender": { "address": "0x7a250d5630b4cf539739df2c5dacb4c659f2488d", "address_label": "Uniswap V2: Router 2", "entity": "Uniswap", "entity_logo": "https://cdn.moralis.io/entities/uniswap.png" } } ] } ``` ## Understanding the Response | Field | Description | | - | - | | `value` | Approved amount in smallest unit | | `value_formatted` | Human-readable approval (may be "unlimited") | | `token` | Token details including current balance and USD at risk | | `token.usd_at_risk` | USD value of tokens that could be taken | | `spender` | Contract with permission to spend tokens | | `spender.address_label` | Known label for the spender | | `spender.entity` | Entity name (e.g., Uniswap, OpenSea) | ## Next Steps * [Get Token Balances](/get-started/tutorials/data-api/tokens-and-markets/get-erc-20-token-balances-for-a-wallet) - See your token balances * [Get Wallet History](/get-started/tutorials/data-api/wallets-and-accounts/get-full-wallet-transaction-history-eoa-and-smart-accounts) - View transaction history * [API Reference](/data-api/evm/wallet/approvals) - Full API documentation # How to Get Full Wallet Transaction History (EOA & Smart Accounts) Source: https://docs.moralis.com/get-started/tutorials/data-api/wallets-and-accounts/get-full-wallet-transaction-history-eoa-and-smart-accounts Learn how to fetch the complete transaction history for any wallet address using the Moralis API. ## Introduction In this tutorial, you'll learn how to retrieve the full transaction history for any wallet address using the Moralis API. This includes all transactions, token transfers, NFT transfers, and internal transactions in a single, unified timeline. This works for both externally owned accounts (EOAs) and smart contract wallets. We'll use the following Moralis API endpoint: * [Get Wallet History](/data-api/evm/wallet/wallet-history) - Fetch the complete transaction history for any wallet ## Prerequisites * Node.js v18+ installed * A Moralis API key ([get one](https://admin.moralis.com)) ## Step 1: Set Up Your Project Create a new directory for your project and initialize it: ```bash theme={null} mkdir get-wallet-history && cd get-wallet-history npm init -y ``` ## Step 2: Create the Script Create a file called `index.js` and add the following code: ```javascript theme={null} // index.js const API_KEY = 'YOUR_API_KEY'; const WALLET_ADDRESS = '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045'; // Vitalik's wallet async function getWalletHistory() { const response = await fetch( `https://deep-index.moralis.io/api/v2.2/wallets/${WALLET_ADDRESS}/history?chain=eth`, { headers: { 'X-API-Key': API_KEY, }, } ); const data = await response.json(); console.log(JSON.stringify(data, null, 2)); } getWalletHistory(); ``` Replace `YOUR_API_KEY` with your actual Moralis API key. ## Step 3: Run the Script Execute the script to fetch the wallet history: ```bash theme={null} node index.js ``` ## Example Response ```json theme={null} { "page": 1, "page_size": 100, "cursor": "abc123...", "result": [ { "hash": "0x...", "nonce": "123", "transaction_index": "45", "from_address": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045", "from_address_label": "Vitalik Buterin", "to_address": "0x1234567890abcdef1234567890abcdef12345678", "to_address_label": null, "value": "1000000000000000000", "gas": "21000", "gas_price": "50000000000", "receipt_gas_used": "21000", "receipt_status": "1", "block_timestamp": "2024-01-15T10:30:00.000Z", "block_number": "18500000", "block_hash": "0x...", "category": "send", "summary": "Sent 1 ETH", "possible_spam": false, "method_label": null, "native_transfers": [], "erc20_transfers": [], "nft_transfers": [] } ] } ``` ## Understanding the Response | Field | Description | | - | - | | `hash` | Transaction hash | | `from_address` | Sender's wallet address | | `from_address_label` | Known label for sender | | `to_address` | Recipient's wallet address | | `to_address_label` | Known label for recipient | | `value` | Native token amount in wei | | `receipt_status` | Transaction status (1 = success) | | `block_timestamp` | When the transaction was mined | | `category` | Type of transaction (send, receive, token send, etc.) | | `summary` | Human-readable transaction summary | | `erc20_transfers` | ERC20 token transfers in this transaction | | `nft_transfers` | NFT transfers in this transaction | | `native_transfers` | Native token transfers | ## Next Steps * [Get Token Balances](/data-api/evm/wallet/token-balances) - Fetch current balances * [NFT Balances](/data-api/evm/wallet/nft-balances) - Fetch NFTs by wallet * [Get Multi-Chain Activity](/get-started/tutorials/data-api/wallets-and-accounts/get-multi-chain-activity-for-a-wallet-address) - See cross-chain activity # How to Get Internal Transactions for a Wallet Address Source: https://docs.moralis.com/get-started/tutorials/data-api/wallets-and-accounts/get-internal-transactions-for-a-wallet-address Learn how to fetch internal transactions (contract calls and ETH transfers between contracts) for any wallet using the Moralis API. ## Introduction In this tutorial, you'll learn how to retrieve internal transactions for any wallet address using the Moralis API. Internal transactions are calls made between smart contracts during a transaction's execution, including ETH transfers from contracts. These are not visible in standard transaction lists but are important for tracking the complete flow of funds. We'll use the following Moralis API endpoint: * [Get Decoded Transactions](/data-api/evm/wallet/decoded-transactions) - Fetch transactions with internal calls and detailed execution data ## Prerequisites * Node.js v18+ installed * A Moralis API key ([get one](https://admin.moralis.com)) ## Step 1: Set Up Your Project Create a new directory for your project and initialize it: ```bash theme={null} mkdir get-internal-transactions && cd get-internal-transactions npm init -y ``` ## Step 2: Create the Script Create a file called `index.js` and add the following code: ```javascript theme={null} // index.js const API_KEY = 'YOUR_API_KEY'; const WALLET_ADDRESS = '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045'; async function getInternalTransactions() { const response = await fetch( `https://deep-index.moralis.io/api/v2.2/${WALLET_ADDRESS}/verbose?chain=eth&include=internal_transactions`, { headers: { 'X-API-Key': API_KEY, }, } ); const data = await response.json(); console.log(JSON.stringify(data, null, 2)); } getInternalTransactions(); ``` Replace `YOUR_API_KEY` with your actual Moralis API key. ## Step 3: Run the Script Execute the script to fetch the internal transactions: ```bash theme={null} node index.js ``` ## Example Response ```json theme={null} { "page_size": 100, "page": 1, "cursor": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...", "result": [ { "hash": "0x1ed85b3757a6d31d01a4d6677fc52fd3911d649a0af21d29f3e2c2f10c82e12c", "nonce": "1848059", "transaction_index": "73", "from_address": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045", "to_address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", "value": "100000000000000000", "gas": "30000", "gas_price": "22434567890", "receipt_cumulative_gas_used": "4923073", "receipt_gas_used": "21000", "receipt_status": "1", "block_timestamp": "2023-01-01T01:28:23.000Z", "block_number": "16308190", "block_hash": "0x3c6d5e2a1b2b1b2b1b2b1b2b1b2b1b2b1b2b1b2b1b2b1b2b1b2b1b2b1b2b1b2b", "internal_transactions": [ { "transaction_hash": "0x1ed85b3757a6d31d01a4d6677fc52fd3911d649a0af21d29f3e2c2f10c82e12c", "block_number": 16308190, "block_hash": "0x3c6d5e2a1b2b1b2b1b2b1b2b1b2b1b2b1b2b1b2b1b2b1b2b1b2b1b2b1b2b1b2b", "type": "CALL", "from": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", "to": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045", "value": "100000000000000000", "gas": "2300", "gas_used": "0", "input": "0x", "output": "0x" } ] } ] } ``` ## Understanding the Response | Field | Description | | - | - | | `hash` | Parent transaction hash | | `from_address` | Address that initiated the transaction | | `to_address` | Address the transaction was sent to | | `value` | ETH value transferred (in wei) | | `receipt_status` | Transaction status (1 = success, 0 = failed) | | `block_timestamp` | When the transaction was mined | | `internal_transactions` | Array of internal calls within this transaction | | `internal_transactions.type` | Type of internal call (CALL, CREATE, DELEGATECALL, etc.) | | `internal_transactions.from` | Address initiating the internal call | | `internal_transactions.to` | Address receiving the internal call | | `internal_transactions.value` | ETH value transferred internally (in wei) | ## Next Steps * [Get Wallet History](/data-api/evm/wallet/wallet-history) - Get complete transaction history * [Get Transaction by Hash](/data-api/evm/blockchain/transaction-by-hash-decoded) - Get specific transaction details # How to Get Multi-Chain Activity for a Wallet Address Source: https://docs.moralis.com/get-started/tutorials/data-api/wallets-and-accounts/get-multi-chain-activity-for-a-wallet-address Learn how to detect which chains a wallet has been active on using the Moralis API. ## Introduction In this tutorial, you'll learn how to detect which blockchain networks a wallet address has activity on using the Moralis API. This is useful for building multi-chain portfolio views, determining which chains to query for a user's assets, or understanding a wallet's cross-chain behavior. We'll use the following Moralis API endpoint: * [Get Chain Activity](/data-api/evm/wallet/chain-activity) - Detect which chains a wallet has been active on ## Prerequisites * Node.js v18+ installed * A Moralis API key ([get one](https://admin.moralis.com)) ## Step 1: Set Up Your Project Create a new directory for your project and initialize it: ```bash theme={null} mkdir get-chain-activity && cd get-chain-activity npm init -y ``` ## Step 2: Create the Script Create a file called `index.js` and add the following code: ```javascript theme={null} // index.js const API_KEY = 'YOUR_API_KEY'; const WALLET_ADDRESS = '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045'; async function getChainActivity() { const response = await fetch( `https://deep-index.moralis.io/api/v2.2/wallets/${WALLET_ADDRESS}/chains?chains=eth,polygon,bsc,arbitrum,base`, { headers: { 'X-API-Key': API_KEY, }, } ); const data = await response.json(); console.log(JSON.stringify(data, null, 2)); } getChainActivity(); ``` Replace `YOUR_API_KEY` with your actual Moralis API key. ## Step 3: Run the Script Execute the script to get the chain activity: ```bash theme={null} node index.js ``` ## Example Response ```json theme={null} { "address": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045", "active_chains": [ { "chain": "eth", "chain_id": "0x1", "first_transaction": { "block_number": "46147", "block_timestamp": "2015-08-07T03:30:33.000Z", "transaction_hash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060" }, "last_transaction": { "block_number": "19234567", "block_timestamp": "2024-02-15T10:30:00.000Z", "transaction_hash": "0x1ed85b3757a6d31d01a4d6677fc52fd3911d649a0af21d29f3e2c2f10c82e12c" } }, { "chain": "polygon", "chain_id": "0x89", "first_transaction": { "block_number": "15678900", "block_timestamp": "2021-06-15T08:00:00.000Z", "transaction_hash": "0x2bc7a8f12345678901234567890abcdef12345678901234567890abcdef1234" }, "last_transaction": { "block_number": "52345678", "block_timestamp": "2024-02-14T15:45:00.000Z", "transaction_hash": "0x3cd8b9e23456789012345678901abcdef23456789012345678901abcdef2345" } } ] } ``` ## Understanding the Response | Field | Description | | - | - | | `address` | The wallet address queried | | `active_chains` | Array of chains where the wallet has activity | | `chain` | Chain identifier (eth, polygon, arbitrum, etc.) | | `chain_id` | Hexadecimal chain ID | | `first_transaction` | Details of the wallet's first transaction on this chain | | `last_transaction` | Details of the wallet's most recent transaction on this chain | | `block_number` | Block number of the transaction | | `block_timestamp` | When the transaction was mined | | `transaction_hash` | Hash of the transaction | ## Next Steps * [Get Wallet History](/data-api/evm/wallet/wallet-history) - Get full transaction history * [Get Token Balances](/data-api/evm/wallet/token-balances) - Fetch token balances # How to Get Native Token Balances for EOAs and Smart Accounts Source: https://docs.moralis.com/get-started/tutorials/data-api/wallets-and-accounts/get-native-token-balances-for-eoas-and-smart-accounts Learn how to fetch native token balances (ETH, MATIC, BNB) for any wallet address using the Moralis API. ## Introduction In this tutorial, you'll learn how to retrieve native token balances (like ETH, MATIC, or BNB) for any wallet address using the Moralis API. This works for both externally owned accounts (EOAs) and smart contract wallets like Safe or Argent. We'll use the following Moralis API endpoint: * [Get Native Balance](/data-api/evm/wallet/native-balance) - Fetch the native token balance for any wallet ## Prerequisites * Node.js v18+ installed * A Moralis API key ([get one](https://admin.moralis.com)) ## Step 1: Set Up Your Project Create a new directory for your project and initialize it: ```bash theme={null} mkdir get-native-balance && cd get-native-balance npm init -y ``` ## Step 2: Create the Script Create a file called `index.js` and add the following code: ```javascript theme={null} // index.js const API_KEY = 'YOUR_API_KEY'; const WALLET_ADDRESS = '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045'; // Vitalik's wallet async function getNativeBalance() { const response = await fetch( `https://deep-index.moralis.io/api/v2.2/${WALLET_ADDRESS}/balance?chain=eth`, { headers: { 'X-API-Key': API_KEY, }, } ); const data = await response.json(); console.log(JSON.stringify(data, null, 2)); } getNativeBalance(); ``` Replace `YOUR_API_KEY` with your actual Moralis API key. ## Step 3: Run the Script Execute the script to fetch the native balance: ```bash theme={null} node index.js ``` ## Example Response ```json theme={null} { "balance": "2847583920000000000000" } ``` ## Understanding the Response | Field | Description | | - | - | | `balance` | The native token balance in wei (smallest unit) | To convert to a human-readable format, divide by 10^18: ```javascript theme={null} const balanceInEth = Number(data.balance) / 1e18; console.log(`Balance: ${balanceInEth} ETH`); ``` ## Next Steps * [Get Token Balances](/data-api/evm/wallet/token-balances) - Fetch ERC20 token balances * [Get Multi-Chain Activity](/data-api/evm/wallet/chain-activity) - See activity across chains # Migrating from Alchemy to Moralis Source: https://docs.moralis.com/get-started/tutorials/migration-guides/migrating-from-alchemy-to-moralis Move from Alchemy to Moralis without rewriting your data layer. This guide maps the Alchemy NFT API, Token API, Prices API, Portfolio API, Transfers API, and Webhooks (Notify) to their Moralis equivalents, endpoint by endpoint, across EVM and Solana. # Migrating from Alchemy to Moralis > [!NOTE] > > **Moralis is a drop-in alternative to Alchemy.** Moralis combines RPC node access, an enriched Web3 Data API, and real-time Streams behind a single API key — so you can replace Alchemy's enhanced APIs (NFT, Token, Prices, Portfolio, Transfers, Webhooks) and, if you want, your RPC traffic too. This page maps the Alchemy surface to Moralis method-by-method so the swap is mostly search-and-replace. Alchemy and Moralis solve the same problem: get clean, decoded, enriched blockchain data into your app without running indexers. Alchemy exposes this through its Enhanced APIs (mostly JSON-RPC method extensions plus REST Data APIs); Moralis exposes it through a REST Web3 Data API. Field names differ, but the resource shapes line up — most teams write a thin response adapter and keep shipping. ## Quick reference: Alchemy → Moralis ### NFT API | Alchemy method | Moralis equivalent | | - | - | | `getNFTsForOwner` | [Get NFTs by Wallet](/data-api/evm/wallet/nft-balances) | | `getContractsForOwner` | [Get NFT Collections by Wallet](/data-api/evm/wallet/nft-collections) | | `getNFTsForContract` | [Get NFTs by Contract](/data-api/evm/nft/collections/nfts-by-collection) | | `getNFTMetadata` / `getNFTMetadataBatch` | [Get NFT Metadata](/data-api/evm/nft/metadata/nft-metadata) | | `getContractMetadata` | [Get NFT Collection Metadata](/data-api/evm/nft/metadata/collection-metadata) | | `getOwnersForNFT` | [Get NFT Owners by Token ID](/data-api/evm/nft/ownership/owners-by-token-id) | | `getOwnersForContract` | [Get NFT Owners by Contract](/data-api/evm/nft/ownership/owners-by-contract) | | `getFloorPrice` | [Get NFT Floor Price by Contract](/data-api/evm/nft/prices/collection-floor-price) | | `getNFTSales` | [Get NFT Trades by Contract](/data-api/evm/nft/trades/collection-trades) | | `getTransfersForContract` | [Get NFT Contract Transfers](/data-api/evm/nft/transfers/collection-transfers) | | `getTransfersForOwner` | [Get NFT Trades by Wallet](/data-api/evm/wallet/nft-trades-by-wallet) | | `summarizeNFTAttributes` | [Get NFT Traits by Collection](/data-api/evm/nft/traits/traits-by-collection) | | `computeRarity` / search by trait | [Get NFTs by Traits](/data-api/evm/nft/traits/nfts-by-traits) | | `getSpamContracts` / `isSpamContract` | Built in — every NFT response includes a `possible_spam` flag | ### Token API & Prices API | Alchemy method | Moralis equivalent | | - | - | | `alchemy_getTokenBalances` | [Get Token Balances by Wallet](/data-api/evm/wallet/token-balances) | | `alchemy_getTokenMetadata` | [Get Token Metadata](/data-api/evm/token/metadata/token-metadata) | | `alchemy_getTokenAllowance` | [Get Wallet Token Approvals](/data-api/evm/wallet/approvals) | | Prices — Token Prices by Address/Symbol | [Get Token Price](/data-api/evm/token/prices/token-price) · [Get Multiple Token Prices](/data-api/evm/token/prices/token-prices-batch) | | Prices — Historical Token Prices | [Get OHLCV by Pair Address](/data-api/evm/token/prices/ohlc) | | Token holders (via indexing) | [Get Token Holders](/data-api/evm/token/holders/token-holders) | ### Transfers & transaction data | Alchemy method | Moralis equivalent | | - | - | | `alchemy_getAssetTransfers` | [Get Wallet History](/data-api/evm/wallet/wallet-history) (native + ERC20 + NFT, decoded) | | `alchemy_getTransactionReceipts` | [Get Wallet Transactions](/data-api/evm/wallet/wallet-transactions) | | Decoded transaction view | [Get Decoded Wallet Transactions](/data-api/evm/wallet/decoded-transactions) | | `eth_getTransactionByHash` | [Get Transaction by Hash](/data-api/evm/blockchain/transaction-by-hash) | ### Portfolio API (multichain) | Alchemy endpoint | Moralis equivalent | | - | - | | Tokens by Wallet (`/assets/tokens/by-address`) | [Cross-Chain Token Balances](/data-api/universal/wallet/cross-chain-token-balances) | | NFTs by Wallet (`/assets/nfts/by-address`) | [Get NFTs by Wallet](/data-api/evm/wallet/nft-balances) | | NFT Collections by Wallet | [Get NFT Collections by Wallet](/data-api/evm/wallet/nft-collections) | | Transaction History by Wallet | [Get Wallet History](/data-api/evm/wallet/wallet-history) | | Net worth (derived) | [Get Wallet Net Worth](/data-api/evm/wallet/net-worth) | ### Real-time — Webhooks (Notify) & Subscription API → Streams | Alchemy feature | Moralis equivalent | | - | - | | Address Activity webhook | [EVM Streams](/streams/evm-streams) — address activity + ERC20/native filters | | NFT Activity / NFT Metadata Update | [EVM Streams](/streams/evm-streams) — NFT transfer filters | | Mined / Dropped Transaction | [EVM Streams](/streams/evm-streams) | | Custom (GraphQL) webhook | [EVM Streams](/streams/evm-streams) — contract-event + smart-filter expressions | | Subscription API (`eth_subscribe`, `alchemy_minedTransactions`) | [Streams API](/streams/api-reference/streams/create-streams) (push delivery) or websockets via [RPC Nodes](/rpc-nodes/overview) | ### Solana (SVM) | Alchemy capability | Moralis equivalent | | - | - | | Solana token balances / `getTokenAccountsByOwner` | [Get SPL Token Balances](/data-api/solana/wallet/token-balances) · [Get Portfolio](/data-api/solana/wallet/portfolio) | | Solana NFTs (DAS `getAssetsByOwner`) | [Get NFTs by Wallet](/data-api/solana/wallet/nft-balances) | | Solana NFT metadata | [Get NFT Metadata](/data-api/solana/nft/nft-metadata) | | Solana token prices | [Get Token Price](/data-api/solana/token/prices/token-price) | | Solana swaps / transactions | [Get Wallet Swaps](/data-api/solana/wallet/wallet-swaps) | | Real-time events | [Solana Streams](/streams/solana-streams) | ### RPC | Alchemy feature | Moralis equivalent | | - | - | | Supernode JSON-RPC | [Moralis RPC Nodes](/rpc-nodes/overview) | ## Endpoint details Each section shows the Alchemy call, the Moralis URL(s) that replace it by chain, and a runnable example. ### NFTs by wallet **Alchemy**: `GET https://{network}.g.alchemy.com/nft/v3/{apiKey}/getNFTsForOwner` | Chain | Moralis Equivalent | Moralis URL | Documentation | | - | - | - | - | | EVM | Get NFTs by Wallet | `https://deep-index.moralis.io/api/v2.2/:address/nft` | [Documentation](/data-api/evm/wallet/nft-balances) | | Solana | Get NFTs by Wallet | `https://solana-gateway.moralis.io/account/:network/:address/nft` | [Documentation](/data-api/solana/wallet/nft-balances) | ```bash theme={null} # Alchemy curl "https://eth-mainnet.g.alchemy.com/nft/v3/$ALCHEMY_API_KEY/getNFTsForOwner?owner=0xd8da6bf26964af9d7eed9e03e53415d37aa96045&withMetadata=true" # Moralis curl "https://deep-index.moralis.io/api/v2.2/0xd8da6bf26964af9d7eed9e03e53415d37aa96045/nft?chain=eth&format=decimal&normalizeMetadata=true&media_items=true" \ -H "X-API-Key: $MORALIS_API_KEY" ``` **Notes**: Moralis returns ERC721 and ERC1155 holdings with normalized metadata, hosted media previews, and a `possible_spam` flag — no separate `getSpamContracts` call needed. ### Token balances **Alchemy**: `POST {rpcUrl}` with method `alchemy_getTokenBalances` | Chain | Moralis Equivalent | Moralis URL | Documentation | | - | - | - | - | | EVM | Get Native & ERC20 Balances | `https://deep-index.moralis.io/api/v2.2/wallets/:address/tokens` | [Documentation](/data-api/evm/wallet/token-balances) | | Solana | Get Portfolio (native + SPL) | `https://solana-gateway.moralis.io/account/:network/:address/portfolio` | [Documentation](/data-api/solana/wallet/portfolio) | ```bash theme={null} # Alchemy curl "https://eth-mainnet.g.alchemy.com/v2/$ALCHEMY_API_KEY" \ -X POST -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","id":1,"method":"alchemy_getTokenBalances","params":["0xd8da6bf26964af9d7eed9e03e53415d37aa96045"]}' # Moralis curl "https://deep-index.moralis.io/api/v2.2/wallets/0xd8da6bf26964af9d7eed9e03e53415d37aa96045/tokens?chain=eth" \ -H "X-API-Key: $MORALIS_API_KEY" ``` **Notes**: Unlike `alchemy_getTokenBalances` (which returns raw balances and requires a second `alchemy_getTokenMetadata` call), Moralis returns balance, decimals, USD price, USD value, and full metadata (symbol, name, logo, verified flag, spam flag) in one response. ### Asset transfers / wallet history **Alchemy**: `POST {rpcUrl}` with method `alchemy_getAssetTransfers` | Chain | Moralis Equivalent | Moralis URL | Documentation | | - | - | - | - | | EVM | Wallet History | `https://deep-index.moralis.io/api/v2.2/wallets/:address/history` | [Documentation](/data-api/evm/wallet/wallet-history) | | Solana | Wallet Swaps | `https://solana-gateway.moralis.io/account/:network/:address/swaps` | [Documentation](/data-api/solana/wallet/wallet-swaps) | ```bash theme={null} # Alchemy curl "https://eth-mainnet.g.alchemy.com/v2/$ALCHEMY_API_KEY" \ -X POST -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","id":1,"method":"alchemy_getAssetTransfers","params":[{"fromAddress":"0xd8da6bf26964af9d7eed9e03e53415d37aa96045","category":["external","erc20","erc721","erc1155"]}]}' # Moralis curl "https://deep-index.moralis.io/api/v2.2/wallets/0xd8da6bf26964af9d7eed9e03e53415d37aa96045/history?chain=eth" \ -H "X-API-Key: $MORALIS_API_KEY" ``` **Notes**: Moralis returns a single normalized, chronological feed of native transfers, ERC20 movements, NFT transfers, swaps, contract interactions, and approvals — already decoded into human-readable summaries. ### Token prices **Alchemy**: `GET https://api.g.alchemy.com/prices/v1/{apiKey}/tokens/by-address` | Chain | Moralis Equivalent | Moralis URL | Documentation | | - | - | - | - | | EVM | Get Token Price | `https://deep-index.moralis.io/api/v2.2/erc20/:address/price` | [Documentation](/data-api/evm/token/prices/token-price) | | EVM | Get Multiple Token Prices | `https://deep-index.moralis.io/api/v2.2/erc20/prices` | [Documentation](/data-api/evm/token/prices/token-prices-batch) | | Solana | Get Token Price | `https://solana-gateway.moralis.io/token/:network/:address/price` | [Documentation](/data-api/solana/token/prices/token-price) | **Notes**: For historical prices and candles, use [Get OHLCV by Pair Address](/data-api/evm/token/prices/ohlc). Moralis pricing is sourced from on-chain DEX liquidity with USD conversion. ### Portfolio (multichain balances) **Alchemy**: `POST https://api.g.alchemy.com/data/v1/{apiKey}/assets/tokens/by-address` | Chain | Moralis Equivalent | Moralis URL | Documentation | | - | - | - | - | | EVM | Cross-Chain Token Balances | `https://deep-index.moralis.io/api/v2.2/wallets/:address/tokens` | [Documentation](/data-api/universal/wallet/cross-chain-token-balances) | **Notes**: Alchemy's Portfolio API rolls up multiple chains in one request; Moralis offers the same with [Cross-Chain Token Balances](/data-api/universal/wallet/cross-chain-token-balances), and per-chain calls can be parallelized for full control. ### Webhooks (Notify) → Moralis Streams **Alchemy**: Notify API webhooks (Address Activity, NFT Activity, Mined/Dropped Transaction, Custom GraphQL) | Feature | Moralis Equivalent | Documentation | | - | - | - | | Address activity events | EVM Streams | [Documentation](/streams/evm-streams) | | NFT activity events | EVM Streams | [Documentation](/streams/evm-streams) | | Solana account events | Solana Streams | [Documentation](/streams/solana-streams) | | Stream management API | Streams API Reference | [Documentation](/streams/api-reference/streams/create-streams) | ```bash theme={null} # Moralis Streams — create one stream, then attach many addresses to it curl -X POST "https://api.moralis-streams.com/streams/evm" \ -H "X-API-Key: $MORALIS_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "webhookUrl": "https://your.app/webhooks/moralis", "description": "Wallet activity", "tag": "wallet-activity", "chainIds": ["0x1", "0x2105"], "includeNativeTxs": true, "includeContractLogs": true }' ``` **Notes**: Where Alchemy's Notify API is one webhook per address list, Moralis Streams uses a stream-with-attached-addresses model — create the stream once and add or remove addresses dynamically without re-subscribing. Streams also adds ABI-decoded contract events and smart-filter expressions, covering the same ground as Alchemy's Custom (GraphQL) webhooks. ## Chain coverage Alchemy supports 80+ EVM networks plus Solana. Moralis covers a comparable footprint across EVM, Solana, and Bitcoin — see [Supported Chains](/data-api/supported-chains). Before cutover, diff the chains you've configured in Alchemy against the supported list and flag any gaps. ## Migration checklist 1. **Get an API key** — [Get your API key](/data-api/get-your-api-key). 2. **Map your call sites** — replace each Alchemy method with the equivalent above. Field names differ; most teams write a thin response adapter rather than threading new shapes through the codebase. 3. **Collapse multi-call patterns** — Alchemy flows that chained `getTokenBalances` + `getTokenMetadata` (or `getNFTsForOwner` + spam checks) usually become a single Moralis call. 4. **Move Notify webhooks to Streams** — create one Stream per event class and attach addresses dynamically instead of one webhook per address list. 5. **Verify chain coverage** — diff your Alchemy network configuration against [Supported Chains](/data-api/supported-chains). 6. **(Optional) Move RPC traffic** — point your JSON-RPC calls at [Moralis RPC Nodes](/rpc-nodes/overview) to consolidate billing. ## Beyond Alchemy: what Moralis adds Once migrated, teams commonly adopt Moralis endpoints that have no direct Alchemy counterpart: * **Wallet PnL** — realized and unrealized PnL per wallet with token-level breakdown. See [Wallet PnL Summary](/data-api/evm/wallet/wallet-pnl-summary) and [Wallet PnL by Token](/data-api/evm/wallet/wallet-pnl). * **Wallet Net Worth** — full USD net worth in one call. See [Wallet Net Worth](/data-api/evm/wallet/net-worth). * **DeFi positions** — protocol positions with USD value and breakdown. See [Wallet DeFi Positions](/data-api/evm/defi/wallet-positions). * **Token discovery** — [Trending Tokens](/data-api/universal/token/trending-tokens). * **Token holder analytics** — [Token Holder Stats](/data-api/evm/token/holders/token-holder-stats). * **DEX & pair analytics** — [Pair Stats](/data-api/evm/token/swaps/pair-stats) and [Token Pairs](/data-api/evm/token/swaps/token-pairs). * **Name resolution** — [ENS Lookup](/data-api/evm/wallet/ens-lookup) and [Resolve Address](/data-api/evm/wallet/resolve-address). ## Need help migrating off Alchemy? If you're moving a production Alchemy workload to Moralis, the support team can help size the migration and review your call patterns — reach out via [moralis.com](https://moralis.com/). # Migrating from Infura to Moralis Source: https://docs.moralis.com/get-started/tutorials/migration-guides/migrating-from-infura-to-moralis Move from Infura (MetaMask Developer) to Moralis and get an enriched Web3 Data API and real-time Streams on top of RPC. This guide maps Infura RPC, the Gas API, IPFS, and the NFT API to their Moralis equivalents across EVM and Solana. # Migrating from Infura to Moralis > [!NOTE] > > **Moralis is a drop-in alternative to Infura — and more.** Infura (now part of MetaMask Developer) is primarily an RPC node provider with a Gas API and IPFS. Moralis gives you RPC node access *plus* the enriched Web3 Data API and real-time Streams that Infura doesn't offer — so migrating isn't just a swap, it removes the indexing layer you'd otherwise build yourself on top of Infura's raw RPC. Infura serves raw JSON-RPC and a handful of supporting services (Gas API, IPFS). To turn that into product features — wallet token balances, transaction history, NFT data, token prices, DeFi positions, real-time webhooks — teams typically build and operate an indexing layer on top of Infura's nodes. Moralis ships that layer as a REST API, so you replace the RPC endpoint *and* delete the indexer. ## Quick reference: Infura → Moralis ### RPC & node services | Infura service | Moralis equivalent | | - | - | | JSON-RPC node access | [Moralis RPC Nodes](/rpc-nodes/overview) | | Gas API (`suggestedGasFees`, `basefeehistory`, `basefeepercentile`, `busythreshold`) | `eth_gasPrice` / `eth_feeHistory` via [Moralis RPC Nodes](/rpc-nodes/overview) | | Archive data / failover | [Moralis RPC Nodes](/rpc-nodes/overview) | | IPFS API & gateway | No direct equivalent — see note below | ### Data the Infura RPC layer doesn't give you (Moralis does) | What you'd build on Infura RPC | Moralis endpoint (no indexing required) | | - | - | | Wallet token balances + USD value | [Get Token Balances by Wallet](/data-api/evm/wallet/token-balances) | | Native balance | [Get Native Balance by Wallet](/data-api/evm/wallet/native-balance) | | Decoded transaction history | [Get Wallet History](/data-api/evm/wallet/wallet-history) | | Token metadata & prices | [Get Token Metadata](/data-api/evm/token/metadata/token-metadata) · [Get Token Price](/data-api/evm/token/prices/token-price) | | Token holders | [Get Token Holders](/data-api/evm/token/holders/token-holders) | | DeFi positions | [Get Wallet DeFi Positions](/data-api/evm/defi/wallet-positions) | | Wallet net worth | [Get Wallet Net Worth](/data-api/evm/wallet/net-worth) | ### NFT API (legacy Infura NFT API) | Infura NFT API capability | Moralis equivalent | | - | - | | NFTs owned by an address | [Get NFTs by Wallet](/data-api/evm/wallet/nft-balances) | | NFTs in a collection | [Get NFTs by Contract](/data-api/evm/nft/collections/nfts-by-collection) | | NFT collection metadata | [Get NFT Collection Metadata](/data-api/evm/nft/metadata/collection-metadata) | | NFT token metadata | [Get NFT Metadata](/data-api/evm/nft/metadata/nft-metadata) | | NFT owners | [Get NFT Owners by Contract](/data-api/evm/nft/ownership/owners-by-contract) | | NFT transfers / trades | [Get NFT Contract Transfers](/data-api/evm/nft/transfers/collection-transfers) · [Get NFT Trades](/data-api/evm/nft/trades/collection-trades) | ### Real-time (Infura has no webhook product) → Streams | Need | Moralis equivalent | | - | - | | Address activity events | [EVM Streams](/streams/evm-streams) | | Contract / log events | [EVM Streams](/streams/evm-streams) | | Solana account events | [Solana Streams](/streams/solana-streams) | | Stream management API | [Streams API Reference](/streams/api-reference/streams/create-streams) | ### Solana (SVM) | Capability | Moralis equivalent | | - | - | | Solana RPC | [Moralis RPC Nodes](/rpc-nodes/overview) | | Solana token balances | [Get SPL Token Balances](/data-api/solana/wallet/token-balances) · [Get Portfolio](/data-api/solana/wallet/portfolio) | | Solana NFTs | [Get NFTs by Wallet](/data-api/solana/wallet/nft-balances) | | Solana swaps / transactions | [Get Wallet Swaps](/data-api/solana/wallet/wallet-swaps) | ## Endpoint details ### RPC node access **Infura**: `https://mainnet.infura.io/v3/{apiKey}` (and per-network subdomains) | Chain | Moralis Equivalent | Documentation | | - | - | - | | EVM | Moralis RPC Nodes | [Documentation](/rpc-nodes/overview) | | Solana | Moralis RPC Nodes | [Documentation](/rpc-nodes/overview) | ```bash theme={null} # Infura curl "https://mainnet.infura.io/v3/$INFURA_API_KEY" \ -X POST -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}' # Moralis RPC Nodes — same JSON-RPC interface, different endpoint URL curl "$MORALIS_RPC_URL" \ -X POST -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}' ``` **Notes**: Moralis RPC Nodes speak standard JSON-RPC, so existing `web3.js`/`ethers`/`viem` code keeps working — point the provider URL at your Moralis RPC endpoint. Grab the URL from the [RPC Nodes](/rpc-nodes/overview) dashboard. ### Gas API **Infura**: `https://gas.api.infura.io/v3/{apiKey}/networks/{chainId}/suggestedGasFees` | Chain | Moralis Equivalent | Documentation | | - | - | - | | EVM | `eth_feeHistory` / `eth_gasPrice` | [Documentation](/rpc-nodes/overview) | **Notes**: Infura's Gas API (`suggestedGasFees`, `basefeehistory`, `basefeepercentile`, `busythreshold`) wraps EIP-1559 fee estimation. With Moralis, call the standard `eth_feeHistory` and `eth_gasPrice` JSON-RPC methods through [Moralis RPC Nodes](/rpc-nodes/overview) to compute priority and max fees. ### Wallet token balances (build-it-yourself on Infura) On Infura you'd enumerate token contracts and batch `eth_call` to `balanceOf`, then resolve metadata yourself. Moralis returns it directly: | Chain | Moralis Equivalent | Moralis URL | Documentation | | - | - | - | - | | EVM | Get Native & ERC20 Balances | `https://deep-index.moralis.io/api/v2.2/wallets/:address/tokens` | [Documentation](/data-api/evm/wallet/token-balances) | | Solana | Get Portfolio (native + SPL) | `https://solana-gateway.moralis.io/account/:network/:address/portfolio` | [Documentation](/data-api/solana/wallet/portfolio) | ```bash theme={null} # Moralis — one call, no contract enumeration, no metadata round-trips curl "https://deep-index.moralis.io/api/v2.2/wallets/0xd8da6bf26964af9d7eed9e03e53415d37aa96045/tokens?chain=eth" \ -H "X-API-Key: $MORALIS_API_KEY" ``` **Notes**: Response includes balance, decimals, USD price, USD value, and metadata (symbol, name, logo, verified flag, spam flag). ### Transaction history | Chain | Moralis Equivalent | Moralis URL | Documentation | | - | - | - | - | | EVM | Get Wallet History | `https://deep-index.moralis.io/api/v2.2/wallets/:address/history` | [Documentation](/data-api/evm/wallet/wallet-history) | ```bash theme={null} # Moralis — decoded, chronological feed of all wallet activity curl "https://deep-index.moralis.io/api/v2.2/wallets/0xd8da6bf26964af9d7eed9e03e53415d37aa96045/history?chain=eth" \ -H "X-API-Key: $MORALIS_API_KEY" ``` **Notes**: Reconstructing this on Infura means paging blocks, pulling receipts, and decoding logs against ABIs. Moralis returns native transfers, ERC20 movements, NFT transfers, swaps, contract interactions, and approvals already decoded. ### NFTs by wallet **Infura**: legacy NFT API — NFTs owned by an address | Chain | Moralis Equivalent | Moralis URL | Documentation | | - | - | - | - | | EVM | Get NFTs by Wallet | `https://deep-index.moralis.io/api/v2.2/:address/nft` | [Documentation](/data-api/evm/wallet/nft-balances) | | Solana | Get NFTs by Wallet | `https://solana-gateway.moralis.io/account/:network/:address/nft` | [Documentation](/data-api/solana/wallet/nft-balances) | ```bash theme={null} # Moralis curl "https://deep-index.moralis.io/api/v2.2/0xd8da6bf26964af9d7eed9e03e53415d37aa96045/nft?chain=eth&format=decimal&normalizeMetadata=true&media_items=true" \ -H "X-API-Key: $MORALIS_API_KEY" ``` **Notes**: Returns ERC721 and ERC1155 holdings with normalized metadata, hosted media previews, and a `possible_spam` flag. ### Real-time events → Moralis Streams Infura does not offer a webhook or notification product — to react to on-chain events you'd poll RPC or run a log subscription and your own delivery infrastructure. Moralis Streams replaces that with managed webhooks: | Feature | Moralis Equivalent | Documentation | | - | - | - | | Address activity events | EVM Streams | [Documentation](/streams/evm-streams) | | Contract / log events | EVM Streams | [Documentation](/streams/evm-streams) | | Solana account events | Solana Streams | [Documentation](/streams/solana-streams) | | Stream management API | Streams API Reference | [Documentation](/streams/api-reference/streams/create-streams) | ```bash theme={null} # Moralis Streams — create one stream, then attach many addresses to it curl -X POST "https://api.moralis-streams.com/streams/evm" \ -H "X-API-Key: $MORALIS_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "webhookUrl": "https://your.app/webhooks/moralis", "description": "Wallet activity", "tag": "wallet-activity", "chainIds": ["0x1", "0x2105"], "includeNativeTxs": true, "includeContractLogs": true }' ``` **Notes**: Streams delivers HTTP webhooks with retries, signature verification, and dynamic address management, plus ABI-decoded contract events and smart-filter expressions. > [!NOTE] > > Infura's **IPFS** pinning service has no direct Moralis equivalent — Moralis is a blockchain data and streaming platform, not a file-storage host. Keep a dedicated IPFS provider for pinning, and use Moralis for on-chain data and real-time events. ## Chain coverage Infura supports a broad set of EVM networks plus Solana and Starknet. Moralis covers EVM, Solana, and Bitcoin — see [Supported Chains](/data-api/supported-chains). Before cutover, diff the networks you've configured in Infura against the supported list and flag any gaps. ## Migration checklist 1. **Get an API key** — [Get your API key](/data-api/get-your-api-key). 2. **Repoint RPC** — swap your Infura RPC URL for a [Moralis RPC Nodes](/rpc-nodes/overview) URL in your provider config; no code changes for standard JSON-RPC calls. 3. **Replace home-grown indexing** — delete the balance/history/NFT/price logic you built on Infura RPC and call the Moralis Data API endpoints instead. 4. **Swap the Gas API** — compute fees from `eth_feeHistory` / `eth_gasPrice` via Moralis RPC. 5. **Add Streams for real-time** — replace polling or self-hosted log subscriptions with [Moralis Streams](/streams/overview). 6. **Verify chain coverage** — diff your Infura network configuration against [Supported Chains](/data-api/supported-chains). ## Beyond Infura: what Moralis adds Because Infura is RPC-first, almost the entire Moralis Data API is net-new capability after you migrate: * **Wallet PnL** — realized and unrealized PnL per wallet. See [Wallet PnL Summary](/data-api/evm/wallet/wallet-pnl-summary) and [Wallet PnL by Token](/data-api/evm/wallet/wallet-pnl). * **Wallet net worth & approvals** — [Wallet Net Worth](/data-api/evm/wallet/net-worth) and [Wallet Approvals](/data-api/evm/wallet/approvals). * **DeFi positions** — [Wallet DeFi Positions](/data-api/evm/defi/wallet-positions). * **Token discovery** — [Trending Tokens](/data-api/universal/token/trending-tokens). * **Token holder analytics** — [Token Holder Stats](/data-api/evm/token/holders/token-holder-stats). * **DEX & pair analytics** — [Pair Stats](/data-api/evm/token/swaps/pair-stats) and [OHLCV by Pair Address](/data-api/evm/token/prices/ohlc). * **Name resolution** — [ENS Lookup](/data-api/evm/wallet/ens-lookup) and [Resolve Address](/data-api/evm/wallet/resolve-address). ## Need help migrating off Infura? If you're moving a production Infura workload to Moralis — RPC, home-grown indexing, or both — the support team can help size the migration and review your call patterns. Reach out via [moralis.com](https://moralis.com/). # Migrating from OKLink to Moralis Source: https://docs.moralis.com/get-started/tutorials/migration-guides/migrating-from-ok-link-to-moralis OKLink is suspending their Explorer API on May 20th, 2025. Any project using OKLink Explorer API needs a new provider before then. Migrate to Moralis APIs in 4 simple steps! # Migrating from OKLink to Moralis > [!WARNING] > > **URGENT MIGRATION NEEDED** - OKLink is suspending all their Explorer APIs on May 20th, 2025. Applications and platforms using OKLink Explorer API need to migrate as soon as possible to avoid service disruptions. Moralis APIs offer equivalent functionality, making migration straightforward. With OKLink suspending their API offering, Moralis provides a comprehensive alternative with equivalent functionality and additional capabilities. This guide will help you seamlessly transition your projects from OKLink to Moralis. ## API Endpoint Equivalence OKLink endpoints can be easily mapped to Moralis equivalents. Below you'll find the mapping organized by API category. ## Quick Reference Guide Make use of the table below to quickly find the Moralis equivalent for each OKLink endpoint by clicking on the Moralis Equivalent column. ### Solana API | Feature | OKLink Endpoint | Moralis Equivalent | | - | - | - | | Get Account Asset Balances | `https://www.oklink.com/docs/en/#sol-data-account-data-get-addresses-asset-balance` | [Details](#get-account-asset-balances) | | Get SOL Account Balance | `https://www.oklink.com/docs/en/#sol-data-account-data-get-sol-account-balance` | [Details](#get-sol-account-balance) | | Get Token Balance | `https://www.oklink.com/docs/en/#sol-data-account-data-get-token-balance` | [Details](#get-token-balance) | | Get Transaction List | `https://www.oklink.com/docs/en/#sol-data-account-data-get-transaction-list` | [Details](#get-transaction-list) | ### NFT API | Feature | OKLink Endpoint | Moralis Equivalent | | - | - | - | | Get Collection Overview | `https://www.oklink.com/docs/en/#nft-data-get-collection-overview` | [Details](#get-collection-overview) | | Get NFT List Within Collection | `https://www.oklink.com/docs/en/#nft-data-get-nft-list-within-collection` | [Details](#get-nft-list-within-collection) | | Get Holder List for Collection | `https://www.oklink.com/docs/en/#nft-data-get-holder-list-for-collection` | [Details](#get-holder-list-for-collection) | | Get Collection Floor Price | `https://www.oklink.com/docs/en/#nft-data-get-collection-floor-price` | [Details](#get-collection-floor-price) | | Get Detailed Data for NFT | `https://www.oklink.com/docs/en/#nft-data-get-detailed-data-for-nft` | [Details](#get-detailed-data-for-nft) | | Get NFT Holder Address | `https://www.oklink.com/docs/en/#nft-data-get-nft-holder-address` | [Details](#get-nft-holder-address) | | Get NFT Transaction History | `https://www.oklink.com/docs/en/#nft-data-get-nft-transaction-history` | [Details](#get-nft-transaction-history) | | Get NFT List Held by Address | `https://www.oklink.com/docs/en/#nft-data-get-nft-list-held-by-address` | [Details](#get-nft-list-held-by-address) | ### Token API | Feature | OKLink Endpoint | Moralis Equivalent | | - | - | - | | Get Token List | `https://www.oklink.com/docs/en/#token-price-data-get-token-list` | [Details](#get-token-list) | | Get Historical Token Price | `https://www.oklink.com/docs/en/#token-price-data-get-historical-token-price` | [Details](#get-historical-token-price) | | Get Latest Token Price in Batches | `https://www.oklink.com/docs/en/#token-price-data-get-latest-token-price-in-batches` | [Details](#get-latest-token-price-in-batches) | | Get Token Market Data | `https://www.oklink.com/docs/en/#token-price-data-get-latest-token-price-in-batches` | [Details](#get-token-market-data) | | Check Liquidity Pool Addresses | `https://www.oklink.com/docs/en/#token-price-data-check-liquidity-pool-addresses-by-token` | [Details](#check-liquidity-pool-addresses) | | Get Individual Transaction Data | `https://www.oklink.com/docs/en/#token-price-data-get-individual-transaction-data` | [Details](#get-individual-transaction-data) | ### Other Services | Feature | OKLink Endpoint | Moralis Equivalent | | - | - | - | | Webhook Subscription | `https://www.oklink.com/docs/en/#webhook-subscription-service` | [Details](#webhook-subscription) | | EVM RPC Data | `https://www.oklink.com/docs/en/#evm-rpc-data` | [Details](#evm-rpc-data) | ## Solana API ### Get Account Asset Balances **OKLink Endpoint**: `https://www.oklink.com/docs/en/#sol-data-account-data-get-addresses-asset-balance` | Chain | Moralis Equivalent | Documentation | | - | - | - | | Solana | Get Sol Portfolio | [Documentation](/data-api/solana/wallet/portfolio) | | Solana | Get Wallet NFTs | [Documentation](/data-api/solana/wallet/nft-balances) | | Solana | Get Native SOL Balance | [Documentation](/data-api/solana/wallet/native-balance) | **Notes**: Moralis provides comprehensive asset balance data including SOL tokens, SPL tokens, and NFTs in a single API call or through dedicated endpoints for each asset type. ### Get SOL Account Balance **OKLink Endpoint**: `https://www.oklink.com/docs/en/#sol-data-account-data-get-sol-account-balance` | Chain | Moralis Equivalent | Documentation | | - | - | - | | Solana | Get Native SOL Balance | [Documentation](/data-api/solana/wallet/native-balance) | **Notes**: This endpoint provides the native SOL balance for a given wallet address. ### Get Token Balance **OKLink Endpoint**: `https://www.oklink.com/docs/en/#sol-data-account-data-get-token-balance` | Chain | Moralis Equivalent | Documentation | | - | - | - | | Solana | Get SPL Token Info | [Documentation](/data-api/solana/wallet/token-balances) | **Notes**: This endpoint returns detailed information about SPL tokens, including balances, metadata, and more. ### Get Transaction List **OKLink Endpoint**: `https://www.oklink.com/docs/en/#sol-data-account-data-get-transaction-list` | Chain | Moralis Equivalent | Documentation | | - | - | - | | Solana | Get Wallet Swap Transactions | [Documentation](/data-api/solana/wallet/wallet-swaps) | **Notes**: This endpoint provides swap transaction history for a wallet on Solana. ## NFT API ### Get Collection Overview **OKLink Endpoint**: `https://www.oklink.com/docs/en/#nft-data-get-collection-overview` | Chain | Moralis Equivalent | Documentation | | - | - | - | | EVM | Get NFT Collection Metadata | [Documentation](/data-api/evm/nft/metadata/collection-metadata) | **Notes**: This endpoint returns comprehensive metadata about an NFT collection, including name, symbol, token standard, and more. ### Get NFT List Within Collection **OKLink Endpoint**: `https://www.oklink.com/docs/en/#nft-data-get-nft-list-within-collection` | Chain | Moralis Equivalent | Documentation | | - | - | - | | EVM | Get NFTs by Contract | [Documentation](/data-api/evm/nft/collections/nfts-by-collection) | **Notes**: This endpoint retrieves all NFTs within a specific contract with pagination support for large collections. ### Get Holder List for Collection **OKLink Endpoint**: `https://www.oklink.com/docs/en/#nft-data-get-holder-list-for-collection` | Chain | Moralis Equivalent | Documentation | | - | - | - | | EVM | Get NFT Owners by Contract | [Documentation](/data-api/evm/nft/ownership/owners-by-contract) | **Notes**: This endpoint retrieves the complete list of owners for a specific NFT collection. ### Get Collection Floor Price **OKLink Endpoint**: `https://www.oklink.com/docs/en/#nft-data-get-collection-floor-price` | Chain | Moralis Equivalent | Documentation | | - | - | - | | EVM | Get NFT Floor Price by Contract | [Documentation](/data-api/evm/nft/prices/collection-floor-price) | **Notes**: This endpoint provides floor price data from major marketplaces for a specific NFT collection. ### Get Detailed Data for NFT **OKLink Endpoint**: `https://www.oklink.com/docs/en/#nft-data-get-detailed-data-for-nft` | Chain | Moralis Equivalent | Documentation | | - | - | - | | EVM | Get NFT Metadata | [Documentation](/data-api/evm/nft/metadata/nft-metadata) | | Solana | Get SOL NFT Metadata | [Documentation](/data-api/solana/nft/nft-metadata) | **Notes**: These endpoints provide comprehensive metadata for individual NFTs, including attributes, images, and other on-chain data. ### Get NFT Holder Address **OKLink Endpoint**: `https://www.oklink.com/docs/en/#nft-data-get-nft-holder-address` | Chain | Moralis Equivalent | Documentation | | - | - | - | | EVM | Get NFT Owners by Token ID | [Documentation](/data-api/evm/nft/ownership/owners-by-token-id) | **Notes**: This endpoint retrieves owner information for a specific NFT token ID within a collection. ### Get NFT Transaction History **OKLink Endpoint**: `https://www.oklink.com/docs/en/#nft-data-get-nft-transaction-history` | Chain | Moralis Equivalent | Documentation | | - | - | - | | EVM | Get NFT Contract Transfers | [Documentation](/data-api/evm/nft/transfers/collection-transfers) | | EVM | Get NFT Trades | [Documentation](/data-api/evm/nft/trades/collection-trades) | **Notes**: These endpoints provide comprehensive transfer and trade history for NFTs, including marketplace sales and P2P transfers. ### Get NFT List Held by Address **OKLink Endpoint**: `https://www.oklink.com/docs/en/#nft-data-get-nft-list-held-by-address` | Chain | Moralis Equivalent | Documentation | | - | - | - | | EVM | Get Wallet NFTs | [Documentation](/data-api/evm/nft/collections/nfts-by-wallet) | | Solana | Get SOL NFTs | [Documentation](/data-api/solana/wallet/nft-balances) | **Notes**: These endpoints retrieve all NFTs held by a specific wallet address with rich metadata. ## Token API ### Get Token List **OKLink Endpoint**: `https://www.oklink.com/docs/en/#token-price-data-get-token-list` | Chain | Moralis Equivalent | Documentation | | - | - | - | | EVM | Token Search | [Documentation](/data-api/universal/token/search/token-search) | **Notes**: This endpoint allows retrieving tokens with various filtering options. ### Get Historical Token Price **OKLink Endpoint**: `https://www.oklink.com/docs/en/#token-price-data-get-historical-token-price` | Chain | Moralis Equivalent | Documentation | | - | - | - | | EVM | Get Multiple Token Prices | [Documentation](/data-api/evm/token/prices/token-prices-batch) | | EVM | Get OHLCV by Pair Address | [Documentation](/data-api/evm/token/prices/ohlc) | | Solana | Get Multiple Token Prices | [Documentation](/data-api/solana/token/prices/token-prices-batch) | | Solana | Get OHLCV by Pair Address | [Documentation](/data-api/solana/token/prices/ohlc) | **Notes**: These endpoints provide price history data for tokens across different timeframes. ### Get Latest Token Price in Batches **OKLink Endpoint**: `https://www.oklink.com/docs/en/#token-price-data-get-latest-token-price-in-batches` | Chain | Moralis Equivalent | Documentation | | - | - | - | | EVM | Get Multiple Token Prices | [Documentation](/data-api/evm/token/prices/token-prices-batch) | | EVM | Get OHLCV by Pair Address | [Documentation](/data-api/evm/token/prices/ohlc) | | Solana | Get Multiple Token Prices | [Documentation](/data-api/solana/token/prices/token-prices-batch) | | Solana | Get OHLCV by Pair Address | [Documentation](/data-api/solana/token/prices/ohlc) | **Notes**: These endpoints support batch requests for fetching current prices of multiple tokens in a single API call. ### Get Token Market Data **OKLink Endpoint**: `https://www.oklink.com/docs/en/#token-price-data-get-latest-token-price-in-batches` | Chain | Moralis Equivalent | Documentation | | - | - | - | | EVM | Get Token Metadata | [Documentation](/data-api/evm/token/metadata/token-metadata) | | EVM | Get Token Analytics | [Documentation](/data-api/evm/token/metadata/token-score) | | Solana | Get Token Metadata | [Documentation](/data-api/solana/token/token-metadata) | | Solana | Get Token Analytics | [Documentation](/data-api/solana/token/market-metrics/token-analytics) | **Notes**: These endpoints provide comprehensive token metadata including marketcap, supply information, and other analytics. ### Check Liquidity Pool Addresses **OKLink Endpoint**: `https://www.oklink.com/docs/en/#token-price-data-check-liquidity-pool-addresses-by-token` | Chain | Moralis Equivalent | Documentation | | - | - | - | | EVM | Get Token Pairs | [Documentation](/data-api/evm/token/swaps/token-pairs) | | Solana | Get Token Pairs by Address | [Documentation](/data-api/solana/token/pairs/token-pairs) | **Notes**: These endpoints provide information about liquidity pairs for specific tokens across various DEXes. ### Get Individual Transaction Data **OKLink Endpoint**: `https://www.oklink.com/docs/en/#token-price-data-get-individual-transaction-data` | Chain | Moralis Equivalent | Documentation | | - | - | - | | EVM | Get Transaction | [Documentation](/data-api/evm/blockchain/transaction-by-hash) | | EVM | Get Decoded Transaction | [Documentation](/data-api/evm/blockchain/transaction-by-hash-decoded) | **Notes**: These endpoints retrieve detailed transaction data, including decoded information for enhanced readability. ## Other Services ### Webhook Subscription **OKLink Endpoint**: `https://www.oklink.com/docs/en/#webhook-subscription-service` | Service | Moralis Equivalent | Documentation | | - | - | - | | Webhooks | Streams API | [Documentation](/streams/overview) | **Notes**: Moralis Streams API provides powerful real-time blockchain data capabilities, including filters, webhooks, and managed infrastructure. ### EVM RPC Data **OKLink Endpoint**: `https://www.oklink.com/docs/en/#evm-rpc-data` | Service | Moralis Equivalent | Documentation | | - | - | - | | RPC | Moralis RPC Nodes | [Documentation](/rpc-nodes/overview) | **Notes**: Moralis provides reliable and high-performance RPC nodes across multiple blockchain networks. ## Beyond OKLink: Exclusive Moralis Capabilities Moralis offers many additional endpoints and features not available in OKLink. Here are some of our most popular exclusive endpoints: ### Advanced Wallet Analysis | Feature | Endpoint | Documentation | | - | - | - | | **Wallet History** | `GET https://deep-index.moralis.io/api/v2.2/wallets/:address/history` | [Documentation](/data-api/evm/wallet/wallet-history) | | **Wallet Approvals** | `GET https://deep-index.moralis.io/api/v2.2/wallets/:address/approvals` | [Documentation](/data-api/evm/wallet/approvals) | | **Wallet Net Worth** | `GET https://deep-index.moralis.io/api/v2.2/wallets/:address/net-worth` | [Documentation](/data-api/evm/wallet/net-worth) | ### Token Analytics | Feature | Endpoint | Documentation | | - | - | - | | **Token Holder Stats** | `GET https://deep-index.moralis.io/api/v2.2/erc20/:token_address/holders/stats` | [Documentation](/data-api/evm/token/holders/token-holder-stats) | ### Token Search & Discovery | Feature | Endpoint | Documentation | | - | - | - | | **Search Tokens** | `GET https://deep-index.moralis.io/api/v2.2/tokens/search` | [Documentation](/data-api/universal/token/search/token-search) | | **Trending Tokens** | `GET https://deep-index.moralis.io/api/v2.2/tokens/trending` | [Documentation](/data-api/universal/token/trending-tokens) | ### DEX and Pair Analytics | Feature | Endpoint | Documentation | | - | - | - | | **Pair Stats** | `GET https://deep-index.moralis.io/api/v2.2/pairs/:address/stats` | [Documentation](/data-api/evm/token/swaps/pair-stats) | | **Aggregated Token Pair Stats** | `GET https://deep-index.moralis.io/api/v2.2/:token_address/pairs/stats` | [Documentation](/data-api/evm/token/swaps/pair-stats) | ## Getting Started with Moralis 1. **Sign up for a Moralis account**: [https://admin.moralis.com/register](https://admin.moralis.com/register) 2. **Get your API key**: Navigate to the Web3 APIs section in your dashboard 3. **Update your API calls**: Replace OKLink endpoints with the corresponding Moralis endpoints 4. **Explore the documentation**: [https://docs.moralis.com/](https://docs.moralis.com/) ## Why Choose Moralis? > [!TIP] > > **MIGRATION SUPPORT AVAILABLE** - Moralis has a dedicated team to help you migrate smoothly from OKLink. [Contact our team](https://developers.moralis.com/) for personalized support and to learn about special developer discounts for teams transitioning from OKLink. ### Trusted by Industry Leaders Moralis APIs power some of the biggest names in the crypto space: * MetaMask * Kraken * Blockchain.com * And many other top wallets and applications ### Migration Support Our dedicated migration team is ready to help OKLink users transition smoothly: * Technical guidance to map your existing implementation * Support with API key setup and configuration * Best practices for optimizing API usage ### Developer Discounts Contact our team today to learn about special pricing options available for teams migrating from OKLink. Moralis is committed to providing a seamless transition for OKLink users with comprehensive support throughout your migration journey. # Migrating from QuickNode to Moralis Source: https://docs.moralis.com/get-started/tutorials/migration-guides/migrating-from-quicknode-to-moralis Move from QuickNode to Moralis without rewriting your data layer. This guide maps the QuickNode Token & NFT API (v2), Streams, and QuickAlerts to their Moralis equivalents, endpoint by endpoint, across EVM, Solana, and Bitcoin. # Migrating from QuickNode to Moralis > [!NOTE] > > **Moralis is a drop-in alternative to QuickNode.** Moralis combines RPC node access, an enriched Web3 Data API, and real-time Streams behind a single API key — so you can replace QuickNode's Token & NFT API add-ons, Streams, and QuickAlerts, and consolidate your RPC traffic too. This page maps the QuickNode surface to Moralis method-by-method so the swap is mostly search-and-replace. QuickNode delivers blockchain data through RPC plus marketplace add-ons — most notably the **Token and NFT API v2 bundle** (the `qn_*` RPC methods), **Streams**, and **QuickAlerts**. Moralis delivers the same data through a first-party REST Web3 Data API and Streams, with no add-on bundles to enable per endpoint. Field names differ, but the resource shapes line up. ## Quick reference: QuickNode → Moralis ### Token API (v2) | QuickNode method | Moralis equivalent | | - | - | | `qn_getWalletTokenBalance` | [Get Token Balances by Wallet](/data-api/evm/wallet/token-balances) | | `qn_getWalletTokenTransactions` | [Get Wallet History](/data-api/evm/wallet/wallet-history) | | `qn_getTokenMetadataByContractAddress` | [Get Token Metadata](/data-api/evm/token/metadata/token-metadata) | | `qn_getTokenMetadataBySymbol` | [Search Tokens](/data-api/universal/token/search/token-search) | ### NFT API (v2) | QuickNode method | Moralis equivalent | | - | - | | `qn_fetchNFTs` | [Get NFTs by Wallet](/data-api/evm/wallet/nft-balances) | | `qn_fetchNFTsByCollection` / `qn_getNFTsByCollection` | [Get NFTs by Contract](/data-api/evm/nft/collections/nfts-by-collection) | | `qn_fetchNFTCollectionDetails` | [Get NFT Collection Metadata](/data-api/evm/nft/metadata/collection-metadata) | | `qn_verifyNFTsOwner` | [Get NFT Owners by Token ID](/data-api/evm/nft/ownership/owners-by-token-id) | | `qn_getTransfersByNFT` | [Get NFT Contract Transfers](/data-api/evm/nft/transfers/collection-transfers) | ### Prices, swaps & DeFi (QuickNode Marketplace add-ons) | QuickNode capability | Moralis equivalent | | - | - | | Token price add-ons | [Get Token Price](/data-api/evm/token/prices/token-price) · [Get Multiple Token Prices](/data-api/evm/token/prices/token-prices-batch) | | OHLC / candle add-ons | [Get OHLCV by Pair Address](/data-api/evm/token/prices/ohlc) | | DEX / swap data add-ons | [Get Swaps by Token Address](/data-api/evm/token/swaps/token-swaps) · [Pair Stats](/data-api/evm/token/swaps/pair-stats) | | DeFi position add-ons | [Get Wallet DeFi Positions](/data-api/evm/defi/wallet-positions) | ### Real-time — Streams & QuickAlerts → Streams | QuickNode feature | Moralis equivalent | | - | - | | Streams (data feeds) | [EVM Streams](/streams/evm-streams) / [Solana Streams](/streams/solana-streams) | | QuickAlerts (webhooks) | [EVM Streams](/streams/evm-streams) — address activity + ERC20/contract filters | | Stream management | [Streams API Reference](/streams/api-reference/streams/create-streams) | ### Solana (SVM) | QuickNode capability | Moralis equivalent | | - | - | | Solana token balances | [Get SPL Token Balances](/data-api/solana/wallet/token-balances) · [Get Portfolio](/data-api/solana/wallet/portfolio) | | Solana NFTs (DAS / add-ons) | [Get NFTs by Wallet](/data-api/solana/wallet/nft-balances) | | Solana token metadata | [Get Token Metadata](/data-api/solana/token/token-metadata) | | Solana swaps / transactions | [Get Wallet Swaps](/data-api/solana/wallet/wallet-swaps) | | Real-time events | [Solana Streams](/streams/solana-streams) | ### RPC | QuickNode feature | Moralis equivalent | | - | - | | Core API JSON-RPC endpoints | [Moralis RPC Nodes](/rpc-nodes/overview) | ## Endpoint details Each section shows the QuickNode call, the Moralis URL(s) that replace it by chain, and a runnable example. QuickNode's `qn_*` methods are JSON-RPC calls against your QuickNode endpoint URL with the relevant add-on enabled; the Moralis equivalents are plain REST calls. ### Token balances by wallet **QuickNode**: `qn_getWalletTokenBalance` (Token API v2) | Chain | Moralis Equivalent | Moralis URL | Documentation | | - | - | - | - | | EVM | Get Native & ERC20 Balances | `https://deep-index.moralis.io/api/v2.2/wallets/:address/tokens` | [Documentation](/data-api/evm/wallet/token-balances) | | Solana | Get Portfolio (native + SPL) | `https://solana-gateway.moralis.io/account/:network/:address/portfolio` | [Documentation](/data-api/solana/wallet/portfolio) | ```bash theme={null} # QuickNode (Token & NFT API v2 add-on enabled on your endpoint) curl "https://your-endpoint.quiknode.pro/$QUICKNODE_TOKEN/" \ -X POST -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","id":1,"method":"qn_getWalletTokenBalance","params":[{"wallet":"0xd8da6bf26964af9d7eed9e03e53415d37aa96045"}]}' # Moralis curl "https://deep-index.moralis.io/api/v2.2/wallets/0xd8da6bf26964af9d7eed9e03e53415d37aa96045/tokens?chain=eth" \ -H "X-API-Key: $MORALIS_API_KEY" ``` **Notes**: Moralis returns balance, decimals, USD price, USD value, and token metadata (symbol, name, logo, verified flag, spam flag) in one call — no separate metadata lookup. ### NFTs by wallet **QuickNode**: `qn_fetchNFTs` (NFT API v2) | Chain | Moralis Equivalent | Moralis URL | Documentation | | - | - | - | - | | EVM | Get NFTs by Wallet | `https://deep-index.moralis.io/api/v2.2/:address/nft` | [Documentation](/data-api/evm/wallet/nft-balances) | | Solana | Get NFTs by Wallet | `https://solana-gateway.moralis.io/account/:network/:address/nft` | [Documentation](/data-api/solana/wallet/nft-balances) | ```bash theme={null} # QuickNode curl "https://your-endpoint.quiknode.pro/$QUICKNODE_TOKEN/" \ -X POST -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","id":1,"method":"qn_fetchNFTs","params":[{"wallet":"0xd8da6bf26964af9d7eed9e03e53415d37aa96045","perPage":40,"page":1}]}' # Moralis curl "https://deep-index.moralis.io/api/v2.2/0xd8da6bf26964af9d7eed9e03e53415d37aa96045/nft?chain=eth&format=decimal&normalizeMetadata=true&media_items=true" \ -H "X-API-Key: $MORALIS_API_KEY" ``` **Notes**: In Token & NFT API v2, `qn_fetchNFTs` no longer returns provenance or `currentOwner` (those moved to separate calls). Moralis returns normalized metadata, hosted media previews, and a `possible_spam` flag inline. ### Verify NFT ownership **QuickNode**: `qn_verifyNFTsOwner` | Chain | Moralis Equivalent | Moralis URL | Documentation | | - | - | - | - | | EVM | Get NFT Owners by Token ID | `https://deep-index.moralis.io/api/v2.2/nft/:address/:token_id/owners` | [Documentation](/data-api/evm/nft/ownership/owners-by-token-id) | **Notes**: `qn_verifyNFTsOwner` confirms a wallet holds specific tokens; the Moralis owners-by-token-id endpoint returns the owner set for a token, and [Get NFTs by Wallet](/data-api/evm/wallet/nft-balances) can be filtered by contract for the inverse check. ### NFT transfers **QuickNode**: `qn_getTransfersByNFT` | Chain | Moralis Equivalent | Moralis URL | Documentation | | - | - | - | - | | EVM | Get NFT Contract Transfers | `https://deep-index.moralis.io/api/v2.2/nft/:address/transfers` | [Documentation](/data-api/evm/nft/transfers/collection-transfers) | | EVM | Get NFT Trades by Token | `https://deep-index.moralis.io/api/v2.2/nft/:address/:token_id/trades` | [Documentation](/data-api/evm/nft/trades/trades-by-token-id) | ### Token & wallet transactions **QuickNode**: `qn_getWalletTokenTransactions` | Chain | Moralis Equivalent | Moralis URL | Documentation | | - | - | - | - | | EVM | Get Wallet History | `https://deep-index.moralis.io/api/v2.2/wallets/:address/history` | [Documentation](/data-api/evm/wallet/wallet-history) | | EVM | Get Decoded Wallet Transactions | `https://deep-index.moralis.io/api/v2.2/wallets/:address/history` | [Documentation](/data-api/evm/wallet/decoded-transactions) | **Notes**: Moralis Wallet History returns native, ERC20, NFT, swap, and contract activity as one decoded, chronological feed — broader than the token-only view from `qn_getWalletTokenTransactions`. ### Streams & QuickAlerts → Moralis Streams **QuickNode**: Streams (data feeds) and QuickAlerts (webhooks) | Feature | Moralis Equivalent | Documentation | | - | - | - | | Address activity events | EVM Streams | [Documentation](/streams/evm-streams) | | Contract / log events | EVM Streams | [Documentation](/streams/evm-streams) | | Solana account events | Solana Streams | [Documentation](/streams/solana-streams) | | Stream management API | Streams API Reference | [Documentation](/streams/api-reference/streams/create-streams) | ```bash theme={null} # Moralis Streams — create one stream, then attach many addresses to it curl -X POST "https://api.moralis-streams.com/streams/evm" \ -H "X-API-Key: $MORALIS_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "webhookUrl": "https://your.app/webhooks/moralis", "description": "Wallet activity", "tag": "wallet-activity", "chainIds": ["0x1", "0x2105"], "includeNativeTxs": true, "includeContractLogs": true }' ``` **Notes**: Both QuickNode Streams and Moralis Streams deliver real-time on-chain data over HTTP webhooks with retries and address management. Moralis Streams adds ABI-decoded contract events and smart-filter expressions on top of the address-activity feed. > [!NOTE] > > QuickNode **Functions** (serverless compute) and **Key-Value Store** have no direct Moralis equivalent — Moralis is a data and streaming platform, not a compute host. Keep that logic in your own backend or a function host, and call Moralis APIs from it. ## Chain coverage QuickNode supports 75+ chains including EVM networks, Solana, and Bitcoin. Moralis covers a comparable footprint across EVM, Solana, and Bitcoin — see [Supported Chains](/data-api/supported-chains). Before cutover, diff the chains you've configured in QuickNode against the supported list and flag any gaps. ## Migration checklist 1. **Get an API key** — [Get your API key](/data-api/get-your-api-key). 2. **Map your call sites** — replace each `qn_*` method with the REST equivalent above. Field names differ; most teams write a thin response adapter. 3. **Drop the add-on bundles** — capabilities that required enabling the Token & NFT API v2 (or other Marketplace add-ons) are first-party in Moralis, available on one key. 4. **Move Streams / QuickAlerts to Moralis Streams** — create one Stream per event class and attach addresses dynamically. 5. **Verify chain coverage** — diff your QuickNode chain configuration against [Supported Chains](/data-api/supported-chains). 6. **(Optional) Move RPC traffic** — point your JSON-RPC calls at [Moralis RPC Nodes](/rpc-nodes/overview). ## Beyond QuickNode: what Moralis adds Once migrated, teams commonly adopt Moralis endpoints that QuickNode covers only via add-ons or not at all: * **Wallet PnL** — realized and unrealized PnL per wallet. See [Wallet PnL Summary](/data-api/evm/wallet/wallet-pnl-summary) and [Wallet PnL by Token](/data-api/evm/wallet/wallet-pnl). * **Wallet Net Worth** — full USD net worth in one call. See [Wallet Net Worth](/data-api/evm/wallet/net-worth). * **DeFi positions** — protocol positions with USD value and breakdown. See [Wallet DeFi Positions](/data-api/evm/defi/wallet-positions). * **Token discovery** — [Trending Tokens](/data-api/universal/token/trending-tokens). * **Token holder analytics** — [Token Holder Stats](/data-api/evm/token/holders/token-holder-stats). ## Need help migrating off QuickNode? If you're moving a production QuickNode workload to Moralis, the support team can help size the migration and review your call patterns — reach out via [moralis.com](https://moralis.com/). # Migrating from Reservoir to Moralis Source: https://docs.moralis.com/get-started/tutorials/migration-guides/migrating-from-reservoir-to-moralis Reservoir is sunsetting its API on October 15th, 2025. Any project using Reservoir API needs a new provider before then. Migrate to Moralis APIs in 4 simple steps! # Migrating from Reservoir to Moralis > [!WARNING] > > **URGENT MIGRATION NEEDED** - Reservoir is sunsetting their NFT APIs on October 15th, 2025. Applications and platforms using Reservoir API need to migrate as soon as possible to avoid service disruptions. Moralis APIs offer equivalent functionality, making migration straightforward. With Reservoir deprecating their API offering, Moralis provides a comprehensive alternative with equivalent functionality. This guide will help you seamlessly transition your projects from Reservoir to Moralis. ## Quick Reference Guide Make use of the table below to quickly find the Moralis equivalent for each Reservoir endpoint. ### NFT Data API | Feature | Reservoir Endpoint | Moralis Equivalent | | - | - | - | | Get Multiple NFTs | `nft.reservoir.tools/reference/gettokensv7` | [Details](#get-multiple-nfts) | | NFT Prices | `nft.reservoir.tools/reference/gettokensfloorv1` | [Details](#nft-prices) | | Get Token IDs | `nft.reservoir.tools/reference/gettokensidsv1` | [Details](#get-token-ids) | | Refresh Metadata | `nft.reservoir.tools/reference/posttokensrefreshv2` | [Details](#refresh-metadata) | | Collection Activity | `nft.reservoir.tools/reference/getcollectionsactivityv6` | [Details](#collection-activity) | | User Activity | `nft.reservoir.tools/reference/getusersactivityv6` | [Details](#user-activity) | | Token Activity | `nft.reservoir.tools/reference/gettokenstokenactivityv5` | [Details](#token-activity) | | Sales | `nft.reservoir.tools/reference/getsalesv6` | [Details](#sales) | | NFT Transfers | `nft.reservoir.tools/reference/gettransfersbulkv2` | [Details](#nft-transfers) | | User Tokens | `nft.reservoir.tools/reference/getusersusertokensv10` | [Details](#user-tokens) | | User Collections | `nft.reservoir.tools/reference/getusersusercollectionsv4` | [Details](#user-collections) | | Owners | `nft.reservoir.tools/reference/getownersv2` | [Details](#owners) | | Stats | `nft.reservoir.tools/reference/getstatsv1` | [Details](#stats) | ## Endpoint Details ### Get Multiple NFTs | Chain | Moralis Equivalent | Moralis URL | | - | - | - | | EVM | Get Multiple NFTs | `https://deep-index.moralis.io/api/v2.2/nft/getMultiple` | ### NFT Prices | Chain | Moralis Equivalent | Moralis URL | | - | - | - | | EVM | Get NFTs by Contract | `https://deep-index.moralis.io/api/v2.2/nft/:address` | ### Get Token IDs | Chain | Moralis Equivalent | Moralis URL | | - | - | - | | EVM | Get Multiple NFTs | `https://deep-index.moralis.io/api/v2.2/nft/getMultiple` | ### Refresh Metadata | Chain | Moralis Equivalent | Moralis URL | | - | - | - | | EVM | Resync NFT Metadata | `https://deep-index.moralis.io/api/v2.2/nft/:address/:token_id/metadata/resync` | **Note**: Refresh entire collection metadata is available as a premium feature. ### Collection Activity | Chain | Moralis Equivalent | Moralis URL | | - | - | - | | EVM | Get NFT Contract Transfers | `https://deep-index.moralis.io/api/v2.2/nft/:address/transfers` | | EVM | Get NFT Trades | `https://deep-index.moralis.io/api/v2.2/nft/:address/trades` | ### User Activity | Chain | Moralis Equivalent | Moralis URL | | - | - | - | | EVM | Get NFT Trades by Wallet | `https://deep-index.moralis.io/api/v2.2/wallets/:address/nfts/trades` | | EVM | Get Wallet NFT Transfers | `https://deep-index.moralis.io/api/v2.2/:address/nft/transfers` | | EVM | Get Wallet History | `https://deep-index.moralis.io/api/v2.2/wallets/:address/history` | ### Token Activity | Chain | Moralis Equivalent | Moralis URL | | - | - | - | | EVM | Get NFT Transfers | `https://deep-index.moralis.io/api/v2.2/nft/:address/:token_id/transfers` | | EVM | Get NFT Trades by Token | `https://deep-index.moralis.io/api/v2.2/nft/:address/:token_id/trades` | ### Sales | Chain | Moralis Equivalent | Moralis URL | | - | - | - | | EVM | Get NFT Trades by Token | `https://deep-index.moralis.io/api/v2.2/nft/:address/:token_id/trades` | | EVM | Get NFT Trades | `https://deep-index.moralis.io/api/v2.2/nft/:address/trades` | ### NFT Transfers | Chain | Moralis Equivalent | Moralis URL | | - | - | - | | EVM | Get NFT Contract Transfers | `https://deep-index.moralis.io/api/v2.2/nft/:address/transfers` | | EVM | Get NFT Transfers | `https://deep-index.moralis.io/api/v2.2/nft/:address/:token_id/transfers` | | EVM | Get Wallet NFT Transfers | `https://deep-index.moralis.io/api/v2.2/:address/nft/transfers` | ### User Tokens | Chain | Moralis Equivalent | Moralis URL | | - | - | - | | EVM | Get Wallet NFTs | `https://deep-index.moralis.io/api/v2.2/wallets/:address/nfts` | ### User Collections | Chain | Moralis Equivalent | Moralis URL | | - | - | - | | EVM | Get Wallet NFT Collections | `https://deep-index.moralis.io/api/v2.2/wallets/:address/nft-collections` | ### Owners | Chain | Moralis Equivalent | Moralis URL | | - | - | - | | EVM | Get NFT Owners | `https://deep-index.moralis.io/api/v2.2/nft/:address/owners` | | EVM | Get NFT Token ID Owners | `https://deep-index.moralis.io/api/v2.2/nft/:address/:token_id/owners` | ### Stats | Chain | Moralis Equivalent | Moralis URL | | - | - | - | | EVM | Get NFT Contract Sale Prices | `https://deep-index.moralis.io/api/v2.2/nft/:address/sales` | | EVM | Get NFT Sale Prices | `https://deep-index.moralis.io/api/v2.2/nft/:address/:token_id/sales` | ## Real-time Data ### Webhooks | Feature | Moralis Equivalent | Moralis URL | Documentation | | - | - | - | - | | Real-time Events | Streams API | N/A - Setup through dashboard | [Documentation](/streams/overview) | **Notes**: Moralis Streams API provides powerful real-time blockchain data capabilities, including filters, webhooks, and managed infrastructure. ## Beyond Reservoir: Exclusive Moralis Capabilities Moralis offers many additional endpoints and features not available in Reservoir. Here are some of our most popular exclusive endpoints: ### Advanced Wallet Analysis | Feature | Endpoint | Documentation | | - | - | - | | **Wallet History** | `GET https://deep-index.moralis.io/api/v2.2/wallets/:address/history` | [Documentation](/data-api/evm/wallet/wallet-history) | | **Wallet Approvals** | `GET https://deep-index.moralis.io/api/v2.2/wallets/:address/approvals` | [Documentation](/data-api/evm/wallet/approvals) | | **Wallet Net Worth** | `GET https://deep-index.moralis.io/api/v2.2/wallets/:address/net-worth` | [Documentation](/data-api/evm/wallet/net-worth) | ### Token Analytics | Feature | Endpoint | Documentation | | - | - | - | | **Token Holder Stats** | `GET https://deep-index.moralis.io/api/v2.2/erc20/:token_address/holders/stats` | [Documentation](/data-api/evm/token/holders/token-holder-stats) | ### Token Search & Discovery | Feature | Endpoint | Documentation | | - | - | - | | **Search Tokens** | `GET https://deep-index.moralis.io/api/v2.2/tokens/search` | [Documentation](/data-api/universal/token/search/token-search) | | **Trending Tokens** | `GET https://deep-index.moralis.io/api/v2.2/tokens/trending` | [Documentation](/data-api/universal/token/trending-tokens) | ### DEX and Pair Analytics | Feature | Endpoint | Documentation | | - | - | - | | **Pair Stats** | `GET https://deep-index.moralis.io/api/v2.2/pairs/:address/stats` | [Documentation](/data-api/evm/token/swaps/pair-stats) | | **Aggregated Token Pair Stats** | `GET https://deep-index.moralis.io/api/v2.2/:token_address/pairs/stats` | [Documentation](/data-api/evm/token/swaps/pair-stats) | ### NFT Advanced Capabilities * **Enriched Metadata**: Access fully enriched and normalized metadata on NFT collections and individual tokens through a single API call * **Real-time NFT Transfer Data**: Get all the latest NFT transfer data for specific NFTs, wallets, or track real-time transfers * **Advanced Spam Detection**: Protect your platform from undesirable NFTs with collection spam indicators * **On-chain Pricing Data**: Incorporate on-chain pricing data including last sale prices and floor prices * **Optimized Image Previews**: Benefit from dynamically sized image previews and conversions to user-friendly formats ## Getting Started with Moralis 1. **Sign up for a Moralis account**: [https://admin.moralis.com/register](https://admin.moralis.com/register) 2. **Get your API key**: Navigate to the Web3 APIs section in your dashboard 3. **Update your API calls**: Replace Reservoir endpoints with the corresponding Moralis endpoints 4. **Explore the documentation**: [https://docs.moralis.com/](https://docs.moralis.com/) > [!TIP] > > **MIGRATION SUPPORT AVAILABLE** - Moralis has a dedicated team to help you migrate smoothly from Reservoir. [Contact our team](https://developers.moralis.com/) for personalized support. # Migrating from Sim APIs (Sim by Dune) to Moralis Source: https://docs.moralis.com/get-started/tutorials/migration-guides/migrating-from-sim-by-dune-to-moralis Sim APIs (Sim by Dune) are being sunset on August 1, 2026, and new signups closed on May 18, 2026. This guide maps every Sim APIs endpoint to its Moralis equivalent so you can keep shipping without rewriting your data layer. # Migrating from Sim APIs (Sim by Dune) to Moralis > [!NOTE] > > The **Sim APIs** (`sim.dune.com`) are being sunset on **August 1, 2026**. New signups for Sim APIs were disabled on May 18, 2026. Any production workload backed by the Sim APIs needs a replacement read layer before the cutoff — this page maps the Sim APIs surface to Moralis endpoint-by-endpoint so the swap is a search-and-replace in most cases. The **Sim APIs** and Moralis cover the same wallet-centric problem space: real-time balances, activity, NFTs, DeFi positions, token metadata, and webhook subscriptions across 60+ EVM chains and Solana. Moralis is a drop-in target for the vast majority of Sim APIs usage — the field names differ, but the resource shapes line up. ## Quick reference: Sim APIs → Moralis ### EVM — Account data | Sim feature | Sim endpoint | Moralis equivalent | | - | - | - | | Activity (full history) | `GET /v1/evm/activity/{address}` | [Wallet History](/data-api/evm/wallet/wallet-history) | | Token balances | `GET /v1/evm/balances/{address}` | [Get Token Balances by Wallet](/data-api/evm/wallet/token-balances) | | Native balance | `GET /v1/evm/balances/{address}` (native row) | [Get Native Balance by Wallet](/data-api/evm/wallet/native-balance) | | Transactions | `GET /v1/evm/transactions/{address}` | [Get Wallet Transactions](/data-api/evm/wallet/wallet-transactions) | | Decoded transactions | `GET /v1/evm/transactions/{address}` (decoded view) | [Get Decoded Wallet Transactions](/data-api/evm/wallet/decoded-transactions) | | Collectibles (NFTs) | `GET /v1/evm/collectibles/{address}` | [Get NFTs by Wallet](/data-api/evm/wallet/nft-balances) | | NFT collections held | `GET /v1/evm/collectibles/{address}` (grouped) | [Get NFT Collections by Wallet](/data-api/evm/wallet/nft-collections) | | Net worth | `GET /v1/evm/balances/{address}` (`value_usd` sum) | [Get Wallet Net Worth](/data-api/evm/wallet/net-worth) | ### EVM — Token data | Sim feature | Sim endpoint | Moralis equivalent | | - | - | - | | Token info / metadata | `GET /v1/evm/token-info/{address}` | [Get Token Metadata](/data-api/evm/token/metadata/token-metadata) | | Search tokens | `GET /v1/evm/token-search` | [Search Tokens](/data-api/universal/token/search) | | Token holders | `GET /v1/evm/token-holders/{address}` | [Get Token Holders](/data-api/evm/token/holders/token-holders) | | Holder distribution stats | (derived from holders endpoint) | [Get Token Holder Stats](/data-api/evm/token/holders/token-holder-stats) | | Stablecoin balances | `GET /v1/evm/stablecoins/{address}` | [Get Token Balances by Wallet](/data-api/evm/wallet/token-balances) — filter on `category` | ### EVM — DeFi | Sim feature | Sim endpoint | Moralis equivalent | | - | - | - | | DeFi positions | `GET /v1/evm/defi/positions/{address}` | [Get Wallet DeFi Positions Summary](/data-api/evm/defi/wallet-positions) | | Position details | `GET /v1/evm/defi/positions/{address}` | [Get Detailed Wallet Positions](/data-api/evm/defi/wallet-positions-detailed) | | Supported protocols | `GET /v1/evm/defi/protocols` | [Get DeFi Protocols by Wallet](/data-api/evm/defi/wallet-protocols) | ### Real-time — Webhooks → Streams | Sim feature | Sim endpoint | Moralis equivalent | | - | - | - | | Create webhook | `POST /v1/webhooks` | [Create a Stream](/streams/api-reference) (or via the [Streams dashboard](/streams/overview)) | | List / get webhooks | `GET /v1/webhooks` | [List Streams](/streams/api-reference) | | Update / delete webhook | `PUT` / `DELETE /v1/webhooks/{id}` | [Update / Delete Stream](/streams/api-reference) | | Add or replace addresses | `POST /v1/webhooks/{id}/addresses` | [Add Address to Stream](/streams/api-reference) | | Balance-change events | Subscription `type: balance_change` | [EVM Streams](/streams/evm-streams) — address activity + ERC20 transfer filters | | Activity / transfer events | Subscription `type: activity` | [EVM Streams](/streams/evm-streams) | Moralis Streams covers the same delivery model (HTTP webhooks with retries, signature verification, and address management) and adds richer filtering — contract events by ABI, smart-filter expressions, internal-tx visibility, and per-chain throughput tuning. ### Solana (SVM) | Sim feature | Sim endpoint | Moralis equivalent | | - | - | - | | Balances | `GET /v1/svm/balances/{address}` | [Get SPL Token Balances](/data-api/solana/wallet/token-balances) | | Portfolio (with USD) | `GET /v1/svm/balances/{address}` | [Get Portfolio](/data-api/solana/wallet/portfolio) | | Native SOL balance | `GET /v1/svm/balances/{address}` (native) | [Get Native Balance](/data-api/solana/wallet/native-balance) | | Transactions / swaps | `GET /v1/svm/transactions/{address}` | [Get Wallet Swaps](/data-api/solana/wallet/wallet-swaps) | | NFT holdings | (via balances endpoint) | [Get NFTs by Wallet](/data-api/solana/wallet/nft-balances) | | Token metadata | `GET /v1/svm/token-info/{mint}` | [Get Token Metadata](/data-api/solana/token/token-metadata) | | Real-time events | Webhooks | [Solana Streams](/streams/solana-streams) | ## Sim APIs endpoint details Each section below shows the Sim APIs endpoint, the Moralis URL(s) that replace it broken out by chain, and a runnable example. ### Wallet activity **Sim APIs Endpoint**: `https://api.sim.dune.com/v1/evm/activity/{address}` | Chain | Moralis Equivalent | Moralis URL | Documentation | | - | - | - | - | | EVM | Wallet History | `https://deep-index.moralis.io/api/v2.2/wallets/:address/history` | [Documentation](/data-api/evm/wallet/wallet-history) | | Solana | Wallet Swaps | `https://solana-gateway.moralis.io/account/:network/:address/swaps` | [Documentation](/data-api/solana/wallet/wallet-swaps) | ```bash theme={null} # Sim APIs curl "https://api.sim.dune.com/v1/evm/activity/0xd8da6bf26964af9d7eed9e03e53415d37aa96045?chain_ids=1,8453" \ -H "X-Sim-Api-Key: $SIM_API_KEY" # Moralis curl "https://deep-index.moralis.io/api/v2.2/wallets/0xd8da6bf26964af9d7eed9e03e53415d37aa96045/history?chain=eth" \ -H "X-API-Key: $MORALIS_API_KEY" ``` **Notes**: Moralis returns a normalized, chronological feed of native transfers, ERC20 movements, NFT transfers, swaps, contract interactions, and approvals in a single call. For multi-chain rollups, call per chain in parallel or use [Cross-Chain Token Balances](/data-api/universal/wallet/cross-chain-token-balances) for the balance view. ### Token balances **Sim APIs Endpoint**: `https://api.sim.dune.com/v1/evm/balances/{address}` | Chain | Moralis Equivalent | Moralis URL | Documentation | | - | - | - | - | | EVM | Get Native & ERC20 Balances | `https://deep-index.moralis.io/api/v2.2/wallets/:address/tokens` | [Documentation](/data-api/evm/wallet/token-balances) | | EVM | Get Native Balance | `https://deep-index.moralis.io/api/v2.2/:address/balance` | [Documentation](/data-api/evm/wallet/native-balance) | | Solana | Get Portfolio (native + SPL) | `https://solana-gateway.moralis.io/account/:network/:address/portfolio` | [Documentation](/data-api/solana/wallet/portfolio) | | Solana | Get SPL Token Balances | `https://solana-gateway.moralis.io/account/:network/:address/tokens` | [Documentation](/data-api/solana/wallet/token-balances) | ```bash theme={null} # Sim APIs curl "https://api.sim.dune.com/v1/evm/balances/0xd8da6bf26964af9d7eed9e03e53415d37aa96045?chain_ids=1" \ -H "X-Sim-Api-Key: $SIM_API_KEY" # Moralis curl "https://deep-index.moralis.io/api/v2.2/wallets/0xd8da6bf26964af9d7eed9e03e53415d37aa96045/tokens?chain=eth" \ -H "X-API-Key: $MORALIS_API_KEY" ``` **Notes**: Response includes balance, decimals, USD price, USD value, and token metadata (symbol, name, logo, verified-contract flag, possible-spam flag). ### Transactions **Sim APIs Endpoint**: `https://api.sim.dune.com/v1/evm/transactions/{address}` | Chain | Moralis Equivalent | Moralis URL | Documentation | | - | - | - | - | | EVM | Get Wallet Transactions | `https://deep-index.moralis.io/api/v2.2/:address` | [Documentation](/data-api/evm/wallet/wallet-transactions) | | EVM | Get Decoded Wallet Transactions | `https://deep-index.moralis.io/api/v2.2/wallets/:address/history` | [Documentation](/data-api/evm/wallet/decoded-transactions) | ```bash theme={null} # Sim APIs curl "https://api.sim.dune.com/v1/evm/transactions/0xd8da6bf26964af9d7eed9e03e53415d37aa96045" \ -H "X-Sim-Api-Key: $SIM_API_KEY" # Moralis curl "https://deep-index.moralis.io/api/v2.2/0xd8da6bf26964af9d7eed9e03e53415d37aa96045?chain=eth" \ -H "X-API-Key: $MORALIS_API_KEY" ``` **Notes**: The Moralis decoded variant returns method names, parameters, and human-readable event summaries — comparable to Sim APIs' decoded view but with ABI coverage across the indexed contract universe. ### NFTs / collectibles **Sim APIs Endpoint**: `https://api.sim.dune.com/v1/evm/collectibles/{address}` | Chain | Moralis Equivalent | Moralis URL | Documentation | | - | - | - | - | | EVM | Get NFTs by Wallet | `https://deep-index.moralis.io/api/v2.2/:address/nft` | [Documentation](/data-api/evm/wallet/nft-balances) | | EVM | Get NFT Collections by Wallet | `https://deep-index.moralis.io/api/v2.2/:address/nft/collections` | [Documentation](/data-api/evm/wallet/nft-collections) | | Solana | Get NFTs by Wallet | `https://solana-gateway.moralis.io/account/:network/:address/nft` | [Documentation](/data-api/solana/wallet/nft-balances) | ```bash theme={null} # Sim APIs curl "https://api.sim.dune.com/v1/evm/collectibles/0xd8da6bf26964af9d7eed9e03e53415d37aa96045?chain_ids=1" \ -H "X-Sim-Api-Key: $SIM_API_KEY" # Moralis curl "https://deep-index.moralis.io/api/v2.2/0xd8da6bf26964af9d7eed9e03e53415d37aa96045/nft?chain=eth&format=decimal&normalizeMetadata=true&media_items=true" \ -H "X-API-Key: $MORALIS_API_KEY" ``` **Notes**: Moralis returns ERC721 and ERC1155 holdings with normalized metadata, hosted media previews, and spam indicators. ### Token info / metadata **Sim APIs Endpoint**: `https://api.sim.dune.com/v1/evm/token-info/{address}` | Chain | Moralis Equivalent | Moralis URL | Documentation | | - | - | - | - | | EVM | Get Token Metadata | `https://deep-index.moralis.io/api/v2.2/erc20/metadata` | [Documentation](/data-api/evm/token/metadata/token-metadata) | | Solana | Get Token Metadata | `https://solana-gateway.moralis.io/token/:network/:address/metadata` | [Documentation](/data-api/solana/token/token-metadata) | ### Token holders **Sim APIs Endpoint**: `https://api.sim.dune.com/v1/evm/token-holders/{address}` | Chain | Moralis Equivalent | Moralis URL | Documentation | | - | - | - | - | | EVM | Get Token Holders | `https://deep-index.moralis.io/api/v2.2/erc20/:token_address/owners` | [Documentation](/data-api/evm/token/holders/token-holders) | | EVM | Get Token Holder Stats | `https://deep-index.moralis.io/api/v2.2/erc20/:token_address/holders/stats` | [Documentation](/data-api/evm/token/holders/token-holder-stats) | ### Search tokens **Sim APIs Endpoint**: `https://api.sim.dune.com/v1/evm/token-search` | Chain | Moralis Equivalent | Moralis URL | Documentation | | - | - | - | - | | Cross-chain | Search Tokens | `https://deep-index.moralis.io/api/v2.2/tokens/search` | [Documentation](/data-api/universal/token/search) | ### DeFi positions **Sim APIs Endpoint**: `https://api.sim.dune.com/v1/evm/defi/positions/{address}` | Chain | Moralis Equivalent | Moralis URL | Documentation | | - | - | - | - | | EVM | Get Wallet DeFi Positions Summary | `https://deep-index.moralis.io/api/v2.2/wallets/:address/defi/positions` | [Documentation](/data-api/evm/defi/wallet-positions) | | EVM | Get Detailed Wallet Positions | `https://deep-index.moralis.io/api/v2.2/wallets/:address/defi/:protocol/positions` | [Documentation](/data-api/evm/defi/wallet-positions-detailed) | | EVM | Get DeFi Protocols by Wallet | `https://deep-index.moralis.io/api/v2.2/wallets/:address/defi/summary` | [Documentation](/data-api/evm/defi/wallet-protocols) | ```bash theme={null} # Sim APIs curl "https://api.sim.dune.com/v1/evm/defi/positions/0xd8da6bf26964af9d7eed9e03e53415d37aa96045" \ -H "X-Sim-Api-Key: $SIM_API_KEY" # Moralis curl "https://deep-index.moralis.io/api/v2.2/wallets/0xd8da6bf26964af9d7eed9e03e53415d37aa96045/defi/positions?chain=eth" \ -H "X-API-Key: $MORALIS_API_KEY" ``` **Notes**: Returns positions grouped by protocol with USD value, position type (liquidity, staking, lending, etc.), and per-position breakdown. ### Real-time webhooks → Moralis Streams **Sim APIs Endpoint**: `POST/PUT/DELETE https://api.sim.dune.com/v1/webhooks/...` | Feature | Moralis Equivalent | Documentation | | - | - | - | | Address activity events | EVM Streams | [Documentation](/streams/evm-streams) | | Balance-change events | EVM Streams (ERC20 + native filters) | [Documentation](/streams/evm-streams) | | Solana account events | Solana Streams | [Documentation](/streams/solana-streams) | | Stream management API | Streams API Reference | [Documentation](/streams/api-reference) | ```bash theme={null} # Moralis Streams — create one stream, attach many addresses to it later curl -X POST "https://api.moralis-streams.com/streams/evm" \ -H "X-API-Key: $MORALIS_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "webhookUrl": "https://your.app/webhooks/moralis", "description": "Wallet activity", "tag": "wallet-activity", "chainIds": ["0x1", "0x2105"], "includeNativeTxs": true, "includeContractLogs": true, "includeInternalTxs": false }' ``` **Notes**: Where the Sim APIs model is one webhook per address, Moralis Streams uses a stream-with-attached-addresses model — create the stream once and add/remove addresses dynamically without re-subscribing. Streams also supports ABI-decoded contract events and smart-filter expressions on top of the basic address-activity feed. ### Solana balances and activity **Sim APIs Endpoint**: `https://api.sim.dune.com/v1/svm/balances/{address}` and `https://api.sim.dune.com/v1/svm/transactions/{address}` | Feature | Moralis Equivalent | Moralis URL | Documentation | | - | - | - | - | | Portfolio (native + SPL + USD) | Get Portfolio | `https://solana-gateway.moralis.io/account/:network/:address/portfolio` | [Documentation](/data-api/solana/wallet/portfolio) | | SPL token balances | Get Token Balances | `https://solana-gateway.moralis.io/account/:network/:address/tokens` | [Documentation](/data-api/solana/wallet/token-balances) | | Native SOL balance | Get Native Balance | `https://solana-gateway.moralis.io/account/:network/:address/balance` | [Documentation](/data-api/solana/wallet/native-balance) | | Swap history | Get Wallet Swaps | `https://solana-gateway.moralis.io/account/:network/:address/swaps` | [Documentation](/data-api/solana/wallet/wallet-swaps) | | Real-time events | Solana Streams | N/A — configured via the Streams dashboard or API | [Documentation](/streams/solana-streams) | ```bash theme={null} # Sim APIs curl "https://api.sim.dune.com/v1/svm/balances/D8da6bf26964af9d7eed9e03e53415d37aa96045aaaaaaaaaaaaaaaaaaaaaaaa" \ -H "X-Sim-Api-Key: $SIM_API_KEY" # Moralis curl "https://solana-gateway.moralis.io/account/mainnet/D8da6bf26964af9d7eed9e03e53415d37aa96045aaaaaaaaaaaaaaaaaaaaaaaa/portfolio" \ -H "X-API-Key: $MORALIS_API_KEY" ``` ## Chain coverage The Sim APIs cover 60+ EVM chains plus Solana. Moralis covers a comparable footprint across EVM, Solana, and Bitcoin. The full list is on [Supported Chains](/data-api/supported-chains) — if you're migrating off the Sim APIs, do a one-time diff against the chains you've configured in Sim and flag any gaps before cutover. ## Sim APIs migration checklist 1. **Get an API key** — [Get your API key](/data-api/get-your-api-key). 2. **Map your call sites** — replace each Sim APIs endpoint with the equivalent above. Field names differ; most teams write a thin response adapter rather than threading new shapes through the codebase. 3. **Move Sim APIs webhooks to Streams** — create one Stream per event class (activity, ERC20 transfers, contract events) and attach addresses dynamically instead of one webhook per address. 4. **Verify chain coverage** — diff your Sim APIs chain configuration against [Supported Chains](/data-api/supported-chains). 5. **Cut over before August 1, 2026** — the Sim APIs stop serving on that date. ## Beyond the Sim APIs: what Moralis adds The Sim APIs surface maps cleanly onto Moralis, but Moralis also exposes endpoints that don't have a Sim APIs counterpart and that are commonly used by teams once they migrate: * **Wallet PnL** — realized and unrealized PnL per wallet with token-level breakdown. See [Wallet PnL Summary](/data-api/evm/wallet/wallet-pnl-summary) and [Wallet PnL by Token](/data-api/evm/wallet/wallet-pnl). * **Wallet Stats & Insights** — first/last activity, chain-level activity rollups, and behavioral signals. See [Wallet Stats](/data-api/evm/wallet/wallet-stats) and [Wallet Insights](/data-api/evm/wallet/wallet-insights). * **Token approvals** — open ERC20 approvals for a wallet, used widely in revoke flows. See [Wallet Approvals](/data-api/evm/wallet/approvals). * **Token discovery** — [Trending Tokens](/data-api/universal/token/trending-tokens). * **OHLCV & pair stats** — candle data and DEX pair analytics. See [Get OHLCV by Pair Address](/data-api/evm/token/swaps/pair-stats). * **Cross-chain balances in one call** — see [Cross-Chain Token Balances](/data-api/universal/wallet/cross-chain-token-balances). ## Need help migrating off the Sim APIs? If you're moving a production Sim APIs workload over before the August 1 deadline, the support team can help size the migration and review your call patterns — reach out via [moralis.com](https://moralis.com/). # Migrating from SimpleHash to Moralis Source: https://docs.moralis.com/get-started/tutorials/migration-guides/migrating-from-simple-hash-to-moralis SimpleHash is shutting down on March 27, 2025. Any project using SimpleHash API needs a new provider before then. Migrate to Moralis APIs in 4 simple steps! # Migrating from SimpleHash to Moralis > [!WARNING] > > **URGENT MIGRATION NEEDED** - SimpleHash is shutting down ALL THEIR APIs. Wallet providers and applications using SimpleHash API need to migrate as soon as possible to avoid service disruptions. Moralis APIs are almost an exact match, making migration straightforward. With SimpleHash deprecating their API offering, Moralis provides a comprehensive alternative with equivalent functionality and additional capabilities. This guide will help you seamlessly transition your projects from SimpleHash to Moralis. ## API Endpoint Equivalence SimpleHash endpoints can be easily mapped to Moralis equivalents. Below you'll find the mapping organized by API category. ## Quick Reference Guide Make use of the table below to quickly find the Moralis equivalent for each SimpleHash endpoint by clicking on the Moralis Equivalent column. ### Token API | Feature | SimpleHash Endpoint | Moralis Equivalent | | - | - | - | | Token & Prices | `api.simplehash.com/api/v0/fungibles/assets` | [Details](#token--prices) | | Token Balances by Wallet(s) | `api.simplehash.com/api/v0/fungibles/balances` | [Details](#token-balances-by-wallets) | | Token Top Holders | `api.simplehash.com/api/v0/fungibles/top_wallets` | [Details](#token-top-holders) | | Swaps & Transfers by Wallet(s) | `api.simplehash.com/api/v0/fungibles/transfers/wallets` | [Details](#swaps--transfers-by-wallets) | | Swaps & Transfers by Token | `api.simplehash.com/api/v0/fungibles/transfers/wallets` | [Details](#swaps--transfers-by-token) | | Historical Token Prices | `api.simplehash.com/api/v0/fungibles/prices_v2/{fungible_id}` | [Details](#historical-token-prices) | | Historical Token OHLC | `api.simplehash.com/api/v0/fungibles/ohlc/{fungible_id}` | [Details](#historical-token-ohlc) | | Native Token Balances by Wallet(s) | `api.simplehash.com/api/v0/native_tokens/balances` | [Details](#native-token-balances-by-wallets) | ### NFT API | Feature | SimpleHash Endpoint | Moralis Equivalent | | - | - | - | | NFT by Token ID | `api.simplehash.com/api/v0/nfts/{chain}/{contract_address}/{token_id}` | [Details](#nft-by-token-id) | | NFTs by Contract | `api.simplehash.com/api/v0/nfts/{chain}/{contract_address}` | [Details](#nfts-by-contract) | | NFTs by Wallet(s) | `api.simplehash.com/api/v0/nfts/owners_v2` | [Details](#nfts-by-wallets) | | Sales & Transfers by Wallet(s) | `api.simplehash.com/api/v0/nfts/transfers/wallets` | [Details](#sales--transfers-by-wallets) | | Sales & Transfers by NFT | `api.simplehash.com/api/v0/nfts/transfers/{chain}/{contract_address}/{token_id}` | [Details](#sales--transfers-by-nft) | | Sales & Transfers by Contract | `api.simplehash.com/api/v0/nfts/transfers/{chain}/{contract_address}` | [Details](#sales--transfers-by-contract) | | Owners by NFT | `api.simplehash.com/api/v0/nfts/owners/{chain}/{contract_address}/{token_id}` | [Details](#owners-by-nft) | | Owners by Contract | `api.simplehash.com/api/v0/nfts/owners/{chain}/{contract_address}/` | [Details](#owners-by-contract) | | Ownership Summary by Wallet(s) | `api.simplehash.com/api/v0/nfts/contracts` | [Details](#ownership-summary-by-wallets) | | Collections by Wallet(s) | `api.simplehash.com/api/v0/nfts/collections_by_wallets_v2` | [Details](#collections-by-wallets) | | Collections by Contract | `api.simplehash.com/api/v0/nfts/collections/{chain}/{contract_address}` | [Details](#collections-by-contract) | | Collection Historical Floor Prices | `api.simplehash.com/api/v0/nfts/floor_prices_v2/collection/{collection_id}/{granularity}` | [Details](#collection-historical-floor-prices) | | Top Collections | `api.simplehash.com/api/v0/nfts/collections/top_v2` | [Details](#top-collections) | | Trending Collections | `api.simplehash.com/api/v0/nfts/collections/trending` | [Details](#trending-collections) | | Traits by Collection | `api.simplehash.com/api/v0/nfts/traits/collection/{collection_id}` | [Details](#traits-by-collection) | | Wallet Valuation | `api.simplehash.com/api/v0/nfts/owners/value` | [Details](#wallet-valuation) | | Refresh NFT Metadata | `api.simplehash.com/api/v0/nfts/refresh/{chain}/{contract_address}/{token_id}` | [Details](#refresh-nft-metadata) | | Refresh Contract Metadata | `api.simplehash.com/reference/refresh-contract-metadata` | [Details](#refresh-contract-metadata) | ## Token API ### Token & Prices **SimpleHash Endpoint**: `https://api.simplehash.com/api/v0/fungibles/assets` | Chain | Moralis Equivalent | Moralis URL | Documentation | | - | - | - | - | | EVM | Get Token Price | `https://deep-index.moralis.io/api/v2.2/erc20/:address/price` | [Documentation](/data-api/evm/token/prices/token-price) | | EVM | Get Multiple Token Prices | `https://deep-index.moralis.io/api/v2.2/erc20/prices` | [Documentation](/data-api/evm/token/prices/token-prices-batch) | | Solana | Get Token Price | `https://solana-gateway.moralis.io/token/:network/:address/price` | [Documentation](/data-api/solana/token/prices/token-price) | **Notes**: Moralis also supports historical price lookups by block number and returns additional metadata like links. ### Token Balances by Wallet(s) **SimpleHash Endpoint**: `https://api.simplehash.com/api/v0/fungibles/balances?chains={chains}&wallet_addresses={wallet_addresses}` | Chain | Moralis Equivalent | Moralis URL | Documentation | | - | - | - | - | | EVM | Get Token Balances | `https://deep-index.moralis.io/api/v2.2/wallets/:address/tokens` | [Documentation](/data-api/evm/wallet/token-balances) | | Solana | Get Wallet Portfolio | `https://solana-gateway.moralis.io/account/:network/:address/portfolio` | [Documentation](/data-api/solana/wallet/portfolio) | | Solana | Get Token Balances | `https://solana-gateway.moralis.io/account/:network/:address/tokens` | [Documentation](/data-api/solana/wallet/token-balances) | ### Token Top Holders **SimpleHash Endpoint**: `https://api.simplehash.com/api/v0/fungibles/top_wallets` | Chain | Moralis Equivalent | Moralis URL | Documentation | | - | - | - | - | | EVM | Get Token Holders | `https://deep-index.moralis.io/api/v2.2/erc20/:token_address/owners` | [Documentation](/data-api/evm/token/holders/token-holders) | | Solana | Coming Soon (March 2025) | - | - | **Notes**: Moralis provides additional endpoints including ERC20 Token Holder Stats and ERC20 Token Holders Timeseries. #### Swaps & Transfers by Wallet(s) **SimpleHash Endpoint**: `https://api.simplehash.com/api/v0/fungibles/transfers/wallets?chains={chains}&wallet_addresses={wallet_addresses}` | Chain | Moralis Equivalent | Moralis URL | Documentation | | - | - | - | - | | EVM | Get Swaps by Wallet | `https://deep-index.moralis.io/api/v2.2/wallets/:address/swaps` | [Documentation](/data-api/evm/wallet/wallet-swaps) | | Solana | Get Swaps by Wallet | `https://solana-gateway.moralis.io/account/:network/:walletAddress/swaps` | [Documentation](/data-api/solana/wallet/wallet-swaps) | **Notes**: Moralis offers additional related endpoints including ERC20 token transfers by wallet and the comprehensive wallet history API. ### Swaps & Transfers by Token **SimpleHash Endpoint**: `https://api.simplehash.com/api/v0/fungibles/transfers/wallets?chains={chains}&wallet_addresses={wallet_addresses}` | Chain | Moralis Equivalent | Moralis URL | Documentation | | - | - | - | - | | EVM | Get Swaps by Token Address | `https://deep-index.moralis.io/api/v2.2/erc20/:address/swaps` | [Documentation](/data-api/evm/token/swaps/token-swaps) | | Solana | Get Swaps by Token Address | `https://solana-gateway.moralis.io/token/:network/:tokenAddress/swaps` | [Documentation](/data-api/solana/token/swaps/token-swaps) | **Notes**: Moralis provides additional related endpoints including ERC20 token transfers by contract, swaps by pair address, and Solana swaps by pair address. ### Historical Token Prices **SimpleHash Endpoint**: `https://api.simplehash.com/api/v0/fungibles/prices_v2/{fungible_id}` | Chain | Moralis Equivalent | Moralis URL | Documentation | | - | - | - | - | | EVM | Get Token Price | `https://deep-index.moralis.io/api/v2.2/erc20/:address/price` | [Documentation](/data-api/evm/token/prices/token-price) | | EVM | Get Multiple Token Prices | `https://deep-index.moralis.io/api/v2.2/erc20/prices` | [Documentation](/data-api/evm/token/prices/token-prices-batch) | ### Historical Token OHLC **SimpleHash Endpoint**: `https://api.simplehash.com/api/v0/fungibles/ohlc/{fungible_id}` | Chain | Moralis Equivalent | Moralis URL | Documentation | | - | - | - | - | | EVM | Get OHLCV by Pair Address | `https://deep-index.moralis.io/api/v2.2/pairs/:address/ohlcv` | [Documentation](/data-api/evm/token/prices/ohlc) | | Solana | Get OHLCV by Pair Address | `https://solana-gateway.moralis.io/token/:network/pairs/:pairAddress/ohlcv` | [Documentation](/data-api/solana/token/prices/ohlc) | ### Native Token Balances by Wallet(s) **SimpleHash Endpoint**: `https://api.simplehash.com/api/v0/native_tokens/balances?chains={chains}&wallet_addresses={wallet_addresses}` | Chain | Moralis Equivalent | Moralis URL | Documentation | | - | - | - | - | | EVM | Get Native Balance by Wallet | `https://deep-index.moralis.io/api/v2.2/:address/balance` | [Documentation](/data-api/evm/wallet/native-balance) | | EVM | Get Native Balance for Multiple Wallets | `https://deep-index.moralis.io/api/v2.2/wallets/balances` | [Documentation](/data-api/evm/wallet/native-balances-batch) | | EVM | Get Native & ERC20 Token Balances by Wallet | `https://deep-index.moralis.io/api/v2.2/wallets/:address/tokens` | [Documentation](/data-api/evm/wallet/token-balances) | | Solana | Get Native Token Balance by Wallet | `https://solana-gateway.moralis.io/account/:network/:address/balance` | [Documentation](/data-api/solana/wallet/native-balance) | ## NFT API ### NFT by Token ID **SimpleHash Endpoint**: `https://api.simplehash.com/api/v0/nfts/{chain}/{contract_address}/{token_id}` | Chain | Moralis Equivalent | Moralis URL | Documentation | | - | - | - | - | | EVM | Get NFT Metadata | `https://deep-index.moralis.io/api/v2.2/nft/:address/:token_id` | [Documentation](/data-api/evm/nft/metadata/nft-metadata) | | Solana | Get NFT Metadata | `https://solana-gateway.moralis.io/nft/:network/:address/metadata` | [Documentation](/data-api/solana/nft/nft-metadata) | ### NFTs by Contract **SimpleHash Endpoint**: `https://api.simplehash.com/api/v0/nfts/{chain}/{contract_address}` | Chain | Moralis Equivalent | Moralis URL | Documentation | | - | - | - | - | | EVM | Get NFTs by Contract | `https://deep-index.moralis.io/api/v2.2/nft/:address` | [Documentation](/data-api/evm/nft/collections/nfts-by-collection) | ### NFTs by Wallet(s) **SimpleHash Endpoint**: `https://api.simplehash.com/api/v0/nfts/owners_v2?chains={chains}&wallet_addresses={wallet_addresses}` | Chain | Moralis Equivalent | Moralis URL | Documentation | | - | - | - | - | | EVM | Get NFTs by Wallet | `https://deep-index.moralis.io/api/v2.2/:address/nft` | [Documentation](/data-api/evm/nft/collections/nfts-by-wallet) | | Solana | Get NFTs by Wallet | `https://solana-gateway.moralis.io/account/:network/:address/nft` | [Documentation](/data-api/solana/wallet/nft-balances) | ### Sales & Transfers by Wallet(s) **SimpleHash Endpoint**: `https://api.simplehash.com/api/v0/nfts/transfers/wallets?chains={chains}&wallet_addresses={wallet_addresses}` | Chain | Moralis Equivalent | Moralis URL | Documentation | | - | - | - | - | | EVM | Get NFT Trades by Wallet | `https://deep-index.moralis.io/api/v2.2/wallets/:address/nfts/trades` | [Documentation](/data-api/evm/wallet/nft-trades-by-wallet) | **Notes**: Moralis offers additional related endpoints including NFT transfers by wallet and comprehensive wallet history. ### Sales & Transfers by NFT **SimpleHash Endpoint**: `https://api.simplehash.com/api/v0/nfts/transfers/{chain}/{contract_address}/{token_id}` | Chain | Moralis Equivalent | Moralis URL | Documentation | | - | - | - | - | | EVM | Get NFT Trades by Token | `https://deep-index.moralis.io/api/v2.2/nft/:address/:token_id/trades` | [Documentation](/data-api/evm/nft/trades/trades-by-token-id) | ### Sales & Transfers by Contract **SimpleHash Endpoint**: `https://api.simplehash.com/api/v0/nfts/transfers/{chain}/{contract_address}` | Chain | Moralis Equivalent | Moralis URL | Documentation | | - | - | - | - | | EVM | Get NFT Trades by Contract | `https://deep-index.moralis.io/api/v2.2/nft/:address/trades` | [Documentation](/data-api/evm/nft/trades/collection-trades) | ### Owners by NFT **SimpleHash Endpoint**: `https://api.simplehash.com/api/v0/nfts/owners/{chain}/{contract_address}/{token_id}` | Chain | Moralis Equivalent | Moralis URL | Documentation | | - | - | - | - | | EVM | Get NFT Owners by Token ID | `https://deep-index.moralis.io/api/v2.2/nft/:address/:token_id/owners` | [Documentation](/data-api/evm/nft/ownership/owners-by-token-id) | ### Owners by Contract **SimpleHash Endpoint**: `https://api.simplehash.com/api/v0/nfts/owners/{chain}/{contract_address}/` | Chain | Moralis Equivalent | Moralis URL | Documentation | | - | - | - | - | | EVM | Get NFT Owners by Contract | `https://deep-index.moralis.io/api/v2.2/nft/:address/owners` | [Documentation](/data-api/evm/nft/ownership/owners-by-contract) | ### Ownership Summary by Wallet(s) **SimpleHash Endpoint**: `https://api.simplehash.com/api/v0/nfts/contracts?chains={chains}&wallet_addresses={wallet_addresses}` | Chain | Moralis Equivalent | Moralis URL | Documentation | | - | - | - | - | | EVM | Get NFT Collections by Wallet | `https://deep-index.moralis.io/api/v2.2/:address/nft/collections` | [Documentation](/data-api/evm/nft/collections/nft-collections-by-wallet) | **Notes**: Moralis supports filtering by token address(es). ### Collections by Wallet(s) **SimpleHash Endpoint**: `https://api.simplehash.com/api/v0/nfts/collections_by_wallets_v2?chains={chains}&wallet_addresses={wallet_addresses}` | Chain | Moralis Equivalent | Moralis URL | Documentation | | - | - | - | - | | EVM | Get NFT Collections by Wallet | `https://deep-index.moralis.io/api/v2.2/:address/nft/collections` | [Documentation](/data-api/evm/nft/collections/nft-collections-by-wallet) | ### Collections by Contract **SimpleHash Endpoint**: `https://api.simplehash.com/api/v0/nfts/collections/{chain}/{contract_address}` | Chain | Moralis Equivalent | Moralis URL | Documentation | | - | - | - | - | | EVM | Get NFT Collection Metadata | `https://deep-index.moralis.io/api/v2.2/nft/:address/metadata` | [Documentation](/data-api/evm/nft/metadata/collection-metadata) | ### Collection Historical Floor Prices **SimpleHash Endpoint**: `https://api.simplehash.com/api/v0/nfts/floor_prices_v2/collection/{collection_id}/{granularity}` | Chain | Moralis Equivalent | Moralis URL | Documentation | | - | - | - | - | | EVM | Get NFT Historical Floor Price by Contract | `https://deep-index.moralis.io/api/v2.2/nft/:address/floor-price/historical` | [Documentation](/data-api/evm/nft/prices/historical-floor-price) | **Notes**: Floor prices are supported on Ethereum & Base. Moralis also offers additional endpoints for NFT Floor Price by Contract, NFT Floor Price by Token ID, Sale Prices by Contract, and Sale Prices by Token ID. ### Trait Floor Prices by NFT | Chain | Moralis Equivalent | Moralis URL | Documentation | | - | - | - | - | | EVM | Get NFTs by Traits | `https://deep-index.moralis.io/api/v2.2/nft/:address/nfts-by-traits` | [Documentation](/data-api/evm/nft/traits/nfts-by-traits) | ### Traits by Collection **SimpleHash Endpoint**: `https://api.simplehash.com/api/v0/nfts/traits/collection/{collection_id}` | Chain | Moralis Equivalent | Moralis URL | Documentation | | - | - | - | - | | EVM | Get NFT Traits by Collection | `https://deep-index.moralis.io/api/v2.2/nft/:address/traits` | [Documentation](/data-api/evm/nft/traits/traits-by-collection) | **Notes**: Moralis also offers an endpoint to get NFTs by traits. ### Wallet Valuation **SimpleHash Endpoint**: `https://api.simplehash.com/api/v0/nfts/owners/value` | Chain | Moralis Equivalent | Moralis URL | Documentation | | - | - | - | - | | EVM | Get Wallet Networth | `https://deep-index.moralis.io/api/v2.2/wallets/:address/net-worth` | [Documentation](/data-api/evm/wallet/net-worth) | **Notes**: Currently calculates based on fungibles. ### Refresh NFT Metadata **SimpleHash Endpoint**: `https://api.simplehash.com/api/v0/nfts/refresh/{chain}/{contract_address}/{token_id}` | Chain | Moralis Equivalent | Moralis URL | Documentation | | - | - | - | - | | EVM | Resync NFT Metadata | `https://deep-index.moralis.io/api/v2.2/nft/:address/:token_id/metadata/resync` | [Documentation](/data-api/evm/nft/utilities/resync-nft-metadata) | ### Refresh Contract Metadata **SimpleHash Endpoint**: `https://docs.simplehash.com/reference/refresh-contract-metadata` | Chain | Moralis Equivalent | Moralis URL | Documentation | | - | - | - | - | | EVM | Available as Premium Endpoint | Available as Premium Endpoint | Available as Premium Endpoint | ## Name Resolution ### ENS Lookup **SimpleHash Endpoint**: `https://api.simplehash.com/api/v0/ens/lookup` | Chain | Moralis Equivalent | Moralis URL | Documentation | | - | - | - | - | | EVM | Resolve ENS Domain | `https://deep-index.moralis.io/api/v2.2/resolve/ens/:domain` | [Documentation](/data-api/evm/wallet/ens-lookup) | **Notes**: Moralis offers additional endpoints for resolving Unstoppable Domains and other resolution services. ### Reverse ENS Lookup **SimpleHash Endpoint**: `https://api.simplehash.com/api/v0/ens/reverse_lookup` | Chain | Moralis Equivalent | Moralis URL | Documentation | | - | - | - | - | | EVM | Resolve Address | `https://deep-index.moralis.io/api/v2.2/resolve/:address/reverse` | [Documentation](/data-api/evm/wallet/resolve-address) | **Notes**: Moralis provides additional endpoints for getting Unstoppable Domain by Address and Address by Unstoppable Domain. ## Real-time Data ### Webhooks | Feature | Moralis Equivalent | Moralis URL | Documentation | | - | - | - | - | | Real-time Events | Streams API | N/A - Setup through dashboard | [Documentation](/streams/overview) | **Notes**: Moralis Streams API provides powerful real-time blockchain data capabilities, including filters, webhooks, and managed infrastructure. Unlike SimpleHash, Moralis offers comprehensive support for real-time blockchain events tracking. ## Beyond SimpleHash: Exclusive Moralis Capabilities Moralis offers many additional endpoints and features not available in SimpleHash. Here are some of our most popular exclusive endpoints: ### Advanced Wallet Analysis | Feature | Endpoint | Documentation | | - | - | - | | **Wallet History** | `GET https://deep-index.moralis.io/api/v2.2/wallets/:address/history` | [Documentation](/data-api/evm/wallet/wallet-history) | | **Wallet Approvals** | `GET https://deep-index.moralis.io/api/v2.2/wallets/:address/approvals` | [Documentation](/data-api/evm/wallet/approvals) | | **Wallet Net Worth** | `GET https://deep-index.moralis.io/api/v2.2/wallets/:address/net-worth` | [Documentation](/data-api/evm/wallet/net-worth) | ### Token Analytics | Feature | Endpoint | Documentation | | - | - | - | | **Token Holder Stats** | `GET https://deep-index.moralis.io/api/v2.2/erc20/:token_address/holders/stats` | [Documentation](/data-api/evm/token/holders/token-holder-stats) | ### Token Search & Discovery | Feature | Endpoint | Documentation | | - | - | - | | **Search Tokens** | `GET https://deep-index.moralis.io/api/v2.2/tokens/search` | [Documentation](/data-api/universal/token/search/token-search) | | **Trending Tokens** | `GET https://deep-index.moralis.io/api/v2.2/tokens/trending` | [Documentation](/data-api/universal/token/trending-tokens) | ### DEX and Pair Analytics | Feature | Endpoint | Documentation | | - | - | - | | **Pair Stats** | `GET https://deep-index.moralis.io/api/v2.2/pairs/:address/stats` | [Documentation](/data-api/evm/token/swaps/pair-stats) | | **Aggregated Token Pair Stats** | `GET https://deep-index.moralis.io/api/v2.2/:token_address/pairs/stats` | [Documentation](/data-api/evm/token/swaps/pair-stats) | ### NFT Advanced Capabilities * **Enriched Metadata**: Access fully enriched and normalized metadata on NFT collections and individual tokens through a single API call * **Real-time NFT Transfer Data**: Get all the latest NFT transfer data for specific NFTs, wallets, or track real-time transfers * **Advanced Spam Detection**: Protect your platform from undesirable NFTs with collection spam indicators * **On-chain Pricing Data**: Incorporate on-chain pricing data including last sale prices and floor prices * **Optimized Image Previews**: Benefit from dynamically sized image previews and conversions to user-friendly formats ## Getting Started with Moralis 1. **Sign up for a Moralis account**: [https://admin.moralis.com/register](https://admin.moralis.com/register) 2. **Get your API key**: Navigate to the Web3 APIs section in your dashboard 3. **Update your API calls**: Replace SimpleHash endpoints with the corresponding Moralis endpoints 4. **Explore the documentation**: [https://docs.moralis.com/](https://docs.moralis.com/) ## Why Choose Moralis? > [!TIP] > > **MIGRATION SUPPORT AVAILABLE** - Moralis has a dedicated team to help you migrate smoothly from SimpleHash. [Contact our team](https://developers.moralis.com/) for personalized support and to learn about special developer discounts for teams transitioning from SimpleHash. ### Trusted by Industry Leaders Moralis APIs power some of the biggest names in the crypto space: * MetaMask * Kraken * Blockchain.com * And many other top wallets and applications ### Migration Support Our dedicated migration team is ready to help SimpleHash users transition smoothly: * Technical guidance to map your existing implementation * Support with API key setup and configuration * Best practices for optimizing API usage ### Developer Discounts Contact our team today to learn about special pricing options available for teams migrating from SimpleHash. Moralis is committed to providing a seamless transition for SimpleHash users with comprehensive support throughout your migration journey. # Migrating from The Graph to Moralis Source: https://docs.moralis.com/get-started/tutorials/migration-guides/migrating-from-the-graph-to-moralis Move from The Graph to Moralis without building or maintaining subgraphs. This guide maps The Graph Token API (balances, transfers, holders, prices, NFTs), custom subgraph GraphQL queries, and Substreams to their Moralis equivalents, endpoint by endpoint, across EVM and Solana. # Migrating from The Graph to Moralis > [!NOTE] > > **Moralis is a drop-in alternative to The Graph.** Moralis combines RPC node access, an enriched Web3 Data API, and real-time Streams behind a single API key — so you can replace The Graph's Token API, retire the custom subgraphs you maintain for standard token/NFT/wallet data, and move Substreams real-time workloads to webhooks. This page maps the The Graph surface to Moralis endpoint-by-endpoint so the swap is mostly search-and-replace. The Graph exposes blockchain data three ways: **subgraphs** (custom GraphQL APIs you define with a schema and mappings, then deploy and wait to index), the **Token API** (a prebuilt REST service for balances, transfers, holders, prices, and NFTs), and **Substreams** (high-throughput streaming extraction). Moralis delivers the same data through a prebuilt REST Web3 Data API plus Streams — with no subgraph to write, deploy, or keep in sync, and no indexing lead time. For standard token, NFT, wallet, and price data, the migration is mostly search-and-replace; most subgraphs exist to reindex exactly this kind of data. ## Quick reference: The Graph → Moralis ### Token API (REST) | The Graph endpoint | Moralis equivalent | | - | - | | `GET /v1/evm/balances` | [Get Token Balances by Wallet](/data-api/evm/wallet/token-balances) | | `GET /v1/evm/transfers` | [Get ERC20 Transfers](/data-api/evm/token/transfers/token-transfers) · [Get Wallet History](/data-api/evm/wallet/wallet-history) | | `GET /v1/evm/tokens` | [Get Token Metadata](/data-api/evm/token/metadata/token-metadata) | | `GET /v1/evm/holders` | [Get Token Holders](/data-api/evm/token/holders/token-holders) | | `GET /v1/evm/swaps` | [Get Swaps by Token Address](/data-api/evm/token/swaps/token-swaps) | | `GET /v1/evm/pools/ohlc` | [Get OHLCV by Pair Address](/data-api/evm/token/prices/ohlc) | | `GET /v1/evm/nft/ownerships` | [Get NFTs by Wallet](/data-api/evm/wallet/nft-balances) | | `GET /v1/evm/nft/items` | [Get NFTs by Contract](/data-api/evm/nft/collections/nfts-by-collection) | | `GET /v1/evm/nft/collections` | [Get NFT Collection Metadata](/data-api/evm/nft/metadata/collection-metadata) | | `GET /v1/evm/nft/holders` | [Get NFT Owners by Contract](/data-api/evm/nft/ownership/owners-by-contract) | | `GET /v1/evm/nft/sales` | [Get NFT Trades by Contract](/data-api/evm/nft/trades/collection-trades) | | `GET /v1/evm/nft/transfers` | [Get NFT Contract Transfers](/data-api/evm/nft/transfers/collection-transfers) | ### Subgraphs (custom GraphQL) → prebuilt Moralis endpoints Most subgraphs reindex standard token, NFT, wallet, and DeFi data. Those become a single prebuilt Moralis call — no schema, mappings, deployment, or indexing wait. | Common subgraph use case | Moralis prebuilt equivalent | | - | - | | Account / wallet token balances | [Get Token Balances by Wallet](/data-api/evm/wallet/token-balances) | | `Transfer` event indexing | [Get Wallet History](/data-api/evm/wallet/wallet-history) · [Get ERC20 Transfers](/data-api/evm/token/transfers/token-transfers) | | Token holder / holder-count tracking | [Get Token Holders](/data-api/evm/token/holders/token-holders) · [Token Holder Stats](/data-api/evm/token/holders/token-holder-stats) | | NFT ownership & transfer indexing | [Get NFTs by Wallet](/data-api/evm/wallet/nft-balances) · [NFT Contract Transfers](/data-api/evm/nft/transfers/collection-transfers) | | DEX pool / swap indexing | [Get Swaps by Token Address](/data-api/evm/token/swaps/token-swaps) · [Pair Stats](/data-api/evm/token/swaps/pair-stats) | | Price / OHLC from pool events | [Get Token Price](/data-api/evm/token/prices/token-price) · [Get OHLCV by Pair Address](/data-api/evm/token/prices/ohlc) | | Portfolio value / PnL aggregation | [Wallet Net Worth](/data-api/evm/wallet/net-worth) · [Wallet PnL](/data-api/evm/wallet/wallet-pnl-summary) | ### Substreams & real-time → Streams | The Graph feature | Moralis equivalent | | - | - | | Substreams (real-time extraction) | [EVM Streams](/streams/evm-streams) / [Solana Streams](/streams/solana-streams) | | Polling a subgraph for new events | [EVM Streams](/streams/evm-streams) — push delivery via webhooks | | Contract / log event handling | [EVM Streams](/streams/evm-streams) — contract-event + smart-filter expressions | | Stream / subscription management | [Streams API Reference](/streams/api-reference/streams/create-streams) | ### Solana (SVM) | The Graph capability | Moralis equivalent | | - | - | | `GET /v1/svm/balances` | [Get SPL Token Balances](/data-api/solana/wallet/token-balances) · [Get Portfolio](/data-api/solana/wallet/portfolio) | | `GET /v1/svm/tokens` | [Get Token Metadata](/data-api/solana/token/token-metadata) | | `GET /v1/svm/swaps` / `/v1/svm/transfers` | [Get Wallet Swaps](/data-api/solana/wallet/wallet-swaps) | | Solana NFTs | [Get NFTs by Wallet](/data-api/solana/wallet/nft-balances) | | Solana token prices | [Get Token Price](/data-api/solana/token/prices/token-price) | | Real-time events | [Solana Streams](/streams/solana-streams) | ## Endpoint details Each section shows the The Graph call, the Moralis URL(s) that replace it by chain, and a runnable example. The Graph Token API calls are REST against `https://token-api.thegraph.com` with a `Bearer` token; the Moralis equivalents are plain REST with an `X-API-Key` header. ### Token balances by wallet **The Graph**: `GET /v1/evm/balances` | Chain | Moralis Equivalent | Moralis URL | Documentation | | - | - | - | - | | EVM | Get Native & ERC20 Balances | `https://deep-index.moralis.io/api/v2.2/wallets/:address/tokens` | [Documentation](/data-api/evm/wallet/token-balances) | | Solana | Get Portfolio (native + SPL) | `https://solana-gateway.moralis.io/account/:network/:address/portfolio` | [Documentation](/data-api/solana/wallet/portfolio) | ```bash theme={null} # The Graph (Token API) curl "https://token-api.thegraph.com/v1/evm/balances?network=mainnet&address=0xd8da6bf26964af9d7eed9e03e53415d37aa96045" \ -H "Accept: application/json" \ -H "Authorization: Bearer $THEGRAPH_API_TOKEN" # Moralis curl "https://deep-index.moralis.io/api/v2.2/wallets/0xd8da6bf26964af9d7eed9e03e53415d37aa96045/tokens?chain=eth" \ -H "X-API-Key: $MORALIS_API_KEY" ``` **Notes**: Moralis returns balance, decimals, USD price, USD value, and token metadata (symbol, name, logo, verified flag, spam flag) in one call. ### Token transfers **The Graph**: `GET /v1/evm/transfers` | Chain | Moralis Equivalent | Moralis URL | Documentation | | - | - | - | - | | EVM | Get ERC20 Transfers | `https://deep-index.moralis.io/api/v2.2/erc20/:address/transfers` | [Documentation](/data-api/evm/token/transfers/token-transfers) | | EVM | Get Wallet History | `https://deep-index.moralis.io/api/v2.2/wallets/:address/history` | [Documentation](/data-api/evm/wallet/wallet-history) | ```bash theme={null} # The Graph curl "https://token-api.thegraph.com/v1/evm/transfers?network=mainnet&address=0xd8da6bf26964af9d7eed9e03e53415d37aa96045" \ -H "Authorization: Bearer $THEGRAPH_API_TOKEN" # Moralis curl "https://deep-index.moralis.io/api/v2.2/wallets/0xd8da6bf26964af9d7eed9e03e53415d37aa96045/history?chain=eth" \ -H "X-API-Key: $MORALIS_API_KEY" ``` **Notes**: For transfers of one token, use Get ERC20 Transfers; for a full decoded, chronological feed of native, ERC20, NFT, swap, and contract activity for a wallet, use Get Wallet History. ### Token holders **The Graph**: `GET /v1/evm/holders` | Chain | Moralis Equivalent | Moralis URL | Documentation | | - | - | - | - | | EVM | Get Token Holders | `https://deep-index.moralis.io/api/v2.2/erc20/:address/owners` | [Documentation](/data-api/evm/token/holders/token-holders) | **Notes**: For aggregate metrics (holder count, distribution, acquisition) use [Token Holder Stats](/data-api/evm/token/holders/token-holder-stats) — a common target for custom holder-tracking subgraphs. ### Swaps & OHLC prices **The Graph**: `GET /v1/evm/swaps` and `GET /v1/evm/pools/ohlc` | Chain | Moralis Equivalent | Moralis URL | Documentation | | - | - | - | - | | EVM | Get Swaps by Token Address | `https://deep-index.moralis.io/api/v2.2/erc20/:address/swaps` | [Documentation](/data-api/evm/token/swaps/token-swaps) | | EVM | Get OHLCV by Pair Address | `https://deep-index.moralis.io/api/v2.2/pairs/:address/ohlcv` | [Documentation](/data-api/evm/token/prices/ohlc) | | EVM | Get Token Price | `https://deep-index.moralis.io/api/v2.2/erc20/:address/price` | [Documentation](/data-api/evm/token/prices/token-price) | | Solana | Get Token Price | `https://solana-gateway.moralis.io/token/:network/:address/price` | [Documentation](/data-api/solana/token/prices/token-price) | **Notes**: Moralis pricing is sourced from on-chain DEX liquidity with USD conversion. For pair-level analytics see [Pair Stats](/data-api/evm/token/swaps/pair-stats) and [Token Pairs](/data-api/evm/token/swaps/token-pairs). ### NFTs by wallet & by contract **The Graph**: `GET /v1/evm/nft/ownerships` and `GET /v1/evm/nft/items` | Chain | Moralis Equivalent | Moralis URL | Documentation | | - | - | - | - | | EVM | Get NFTs by Wallet | `https://deep-index.moralis.io/api/v2.2/:address/nft` | [Documentation](/data-api/evm/wallet/nft-balances) | | EVM | Get NFTs by Contract | `https://deep-index.moralis.io/api/v2.2/nft/:address` | [Documentation](/data-api/evm/nft/collections/nfts-by-collection) | | Solana | Get NFTs by Wallet | `https://solana-gateway.moralis.io/account/:network/:address/nft` | [Documentation](/data-api/solana/wallet/nft-balances) | ```bash theme={null} # The Graph curl "https://token-api.thegraph.com/v1/evm/nft/ownerships?network=mainnet&address=0xd8da6bf26964af9d7eed9e03e53415d37aa96045" \ -H "Authorization: Bearer $THEGRAPH_API_TOKEN" # Moralis curl "https://deep-index.moralis.io/api/v2.2/0xd8da6bf26964af9d7eed9e03e53415d37aa96045/nft?chain=eth&format=decimal&normalizeMetadata=true&media_items=true" \ -H "X-API-Key: $MORALIS_API_KEY" ``` **Notes**: Moralis returns ERC721 and ERC1155 holdings with normalized metadata, hosted media previews, and a `possible_spam` flag inline. For owner sets use [Get NFT Owners by Contract](/data-api/evm/nft/ownership/owners-by-contract) or [by Token ID](/data-api/evm/nft/ownership/owners-by-token-id); for sales/trades use [Get NFT Trades by Contract](/data-api/evm/nft/trades/collection-trades). ### Replacing a subgraph GraphQL query A typical subgraph query for a wallet's token transfers maps to one Moralis REST call — no subgraph deploy or indexing wait. ```graphql theme={null} # The Graph — subgraph GraphQL query { transfers(where: { from: "0xd8da6bf26964af9d7eed9e03e53415d37aa96045" }, first: 100) { id from to value blockNumber } } ``` ```bash theme={null} # Moralis — prebuilt REST equivalent curl "https://deep-index.moralis.io/api/v2.2/wallets/0xd8da6bf26964af9d7eed9e03e53415d37aa96045/history?chain=eth" \ -H "X-API-Key: $MORALIS_API_KEY" ``` ### Substreams & real-time → Moralis Streams **The Graph**: Substreams / polling a subgraph for new entities | Feature | Moralis Equivalent | Documentation | | - | - | - | | Address activity events | EVM Streams | [Documentation](/streams/evm-streams) | | Contract / log events | EVM Streams | [Documentation](/streams/evm-streams) | | Solana account events | Solana Streams | [Documentation](/streams/solana-streams) | | Stream management API | Streams API Reference | [Documentation](/streams/api-reference/streams/create-streams) | ```bash theme={null} # Moralis Streams — create one stream, then attach many addresses to it curl -X POST "https://api.moralis-streams.com/streams/evm" \ -H "X-API-Key: $MORALIS_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "webhookUrl": "https://your.app/webhooks/moralis", "description": "Wallet activity", "tag": "wallet-activity", "chainIds": ["0x1", "0x2105"], "includeNativeTxs": true, "includeContractLogs": true }' ``` **Notes**: Where Substreams is a streaming-extraction primitive you wire into your own sink, Moralis Streams pushes decoded events to an HTTP webhook with retries and dynamic address management, plus ABI-decoded contract events and smart-filter expressions. > [!NOTE] > > The Graph's **fully custom subgraphs** — indexing bespoke protocol state, derived entities, or arbitrary contract business logic — have no prebuilt Moralis equivalent. Moralis ships standard token, NFT, wallet, price, and DeFi data out of the box; it is not a general-purpose custom indexer. If a subgraph encodes domain-specific logic you can't express as standard data, keep that on [Streams](/streams/evm-streams) plus your own processing, or retain it on The Graph and use Moralis for everything standard. The decentralized network, curation, and GRT query economics likewise have no Moralis counterpart — Moralis is a managed API with a single key. ## Chain coverage The Graph Token API covers Ethereum, BNB Smart Chain, Polygon, Optimism, Arbitrum, Base, Unichain, Avalanche, and Solana; subgraphs can index many more chains via custom deployments. Moralis covers a comparable footprint across EVM, Solana, and Bitcoin — see [Supported Chains](/data-api/supported-chains). Before cutover, diff the chains you index on The Graph against the supported list and flag any gaps. ## Migration checklist 1. **Get an API key** — [Get your API key](/data-api/get-your-api-key). 2. **Map Token API calls** — replace each `/v1/...` REST call with the Moralis equivalent above. Field names differ; most teams write a thin response adapter. 3. **Retire standard subgraphs** — any subgraph that indexes balances, transfers, holders, NFTs, prices, or swaps can be replaced by a prebuilt Moralis endpoint. Delete the schema/mappings you were maintaining and drop the deploy + indexing wait. 4. **Move Substreams / polling to Streams** — create one Stream per event class and attach addresses dynamically for push delivery. 5. **Verify chain coverage** — diff your indexed chains against [Supported Chains](/data-api/supported-chains). 6. **(Optional) Add RPC** — The Graph isn't a JSON-RPC provider; if you also need RPC, [Moralis RPC Nodes](/rpc-nodes/overview) consolidate it onto the same key. ## Beyond The Graph: what Moralis adds Once migrated, teams commonly adopt Moralis endpoints that would each require a separate custom subgraph on The Graph: * **Wallet PnL** — realized and unrealized PnL per wallet with token-level breakdown. See [Wallet PnL Summary](/data-api/evm/wallet/wallet-pnl-summary) and [Wallet PnL by Token](/data-api/evm/wallet/wallet-pnl). * **Wallet Net Worth** — full USD net worth in one call. See [Wallet Net Worth](/data-api/evm/wallet/net-worth). * **DeFi positions** — protocol positions with USD value and breakdown. See [Wallet DeFi Positions](/data-api/evm/defi/wallet-positions). * **Token discovery** — [Trending Tokens](/data-api/universal/token/trending-tokens). * **Token holder analytics** — [Token Holder Stats](/data-api/evm/token/holders/token-holder-stats). * **DEX & pair analytics** — [Pair Stats](/data-api/evm/token/swaps/pair-stats) and [Token Pairs](/data-api/evm/token/swaps/token-pairs). ## Need help migrating off The Graph? If you're moving production subgraphs or Token API traffic to Moralis, the support team can help size the migration and review which subgraphs map cleanly to prebuilt endpoints — reach out via [moralis.com](https://moralis.com/). # Tutorials and Guides Source: https://docs.moralis.com/get-started/tutorials/overview Step-by-step tutorials for common blockchain data use cases and migration guides from other providers. ## Overview This section contains practical **tutorials** and **guides** to help you build with Moralis APIs. Each tutorial walks through a specific use case with code examples you can adapt for your own projects. *** ## What You'll Find ### Data API Tutorials Step-by-step guides covering common blockchain data queries: * **Tokens and Markets** - Query token balances, swaps, metadata, and market data * **Prices and Charts** - Fetch historical prices and OHLC data for charting * **Blocks and Transactions** - Look up blocks by timestamp and query transactions * **NFTs** - Get NFT ownership, floor prices, metadata, and traits ### Migration Guides Guides for migrating from other blockchain data providers: * **From Reservoir** - Migrate NFT data queries to Moralis * **From OK Link** - Migrate blockchain data queries to Moralis * **From SimpleHash** - Migrate NFT API calls to Moralis *** ## Tutorial Categories ### Tokens and Markets | Tutorial | Description | | - | - | | [Get ERC-20 Token Balance](/get-started/tutorials/data-api/tokens-and-markets/get-erc-20-token-balances-for-a-wallet) | Query token holdings for a wallet | | [Get Token Metadata](/get-started/tutorials/data-api/tokens-and-markets/get-erc-20-token-metadata-by-address-or-symbol) | Retrieve token details and decimals | | [Get Top Tokens by Market Cap](/get-started/tutorials/data-api/tokens-and-markets/get-top-erc-20-tokens-by-market-cap) | Discover trending tokens | ### Prices and Charts | Tutorial | Description | | - | - | | [Get Historical Token Prices](/get-started/tutorials/data-api/prices-and-charts/get-historical-erc-20-token-prices-ohlc-data) | Query price history for tokens | | [Get OHLC Data](/get-started/tutorials/data-api/prices-and-charts/build-crypto-price-charts-using-ohlc-data) | Fetch candlestick data for charts | ### NFTs | Tutorial | Description | | - | - | | [Get NFT Owners](/get-started/tutorials/data-api/nfts/get-nft-owners-and-ownership-details) | List all owners of an NFT collection | | [Get NFT Floor Price](/get-started/tutorials/data-api/nfts/get-nft-floor-prices) | Query collection floor prices | | [Get NFT Metadata](/get-started/tutorials/data-api/nfts/get-nft-metadata-by-contract-and-token-id) | Retrieve NFT attributes and media | *** ## Get Started Choose a tutorial based on what you want to build: * **Building a wallet?** Start with [Token Balances](/data-api/evm/wallet/token-balances) * **Building charts?** Start with [OHLC Data](/data-api/evm/token/prices/ohlc) * **Building NFT features?** Start with [NFT Metadata](/data-api/evm/nft/metadata/nft-metadata) *** ## Build a DeFi App in 5 minutes - Video Tutorial [Build a DeFi App in 5 minutes - Video Tutorial](https://www.youtube.com/embed/9rETiKV7jQE) # Monitoring NFT Transfers from Specific Wallet Addresses Source: https://docs.moralis.com/get-started/tutorials/streams/nft-monitoring/monitoring-nft-transfers-from-specific-wallet-addresses Let's create a stream that monitors all the NFT contract transfers from a specific sender address. > [!TIP] > > This stream uses the listen to all addresses feature that is available only on Business and Enterprise plans. > There will be a few NFT contracts that don't follow the standards like CryptoPunks that have a different ABI, and you will not receive webhook requests from those non-standard NFT contracts. > [!TIP] > > You will use the ABI specific to NFT transfers, the one that has indexed for tokenId. ## Programmatically ```javascript theme={null} const NFT_transfer_ABI = [{ "anonymous": false, "inputs": [ { "indexed": true, "name": "from", "type": "address" }, { "indexed": true, "name": "to", "type": "address" }, { "indexed": true, "name": "tokenId", "type": "uint256" }, ], "name": "transfer", "type": "event", }]; // valid abi of the event const options = { chains: [EvmChain.ETHEREUM], // list of blockchains to monitor description: "monitor all NFT transfers", // your description tag: "NFT_transfers", // give it a tag abi: NFT_transfer_ABI, includeContractLogs: true, allAddresses: true, topic0: ["Transfer(address,address,uint256)"], // topic of the event advancedOptions: [ { topic0: "Transfer(address,address,uint256)", filter: { "eq": ["from", "0x283af0b28c62c092c9727f1ee09c02ca627eb7f5"] }, // only receive NFT transfer events from this address }, ], webhookUrl: "https://YOUR_WEBHOOK_URL", // webhook url to receive events, }; const stream = await Moralis.Streams.add(options); ``` ## Via WebUI 1. Create a new Stream 2. Fill out the form 3. Switch on Event Emittance and Add the Abi and select the topic 4. Select `Listen to all addresses` and `Contract interactions (logs)` 5. Add below value to advanced options ```json theme={null} [{ "topic0": "Transfer(address,address,uint256)", "filter": { "eq": ["from", "0x283af0b28c62c092c9727f1ee09c02ca627eb7f5"] } }] ``` 6. Click on create stream button # How to Track NFT Transfers in Real Time Source: https://docs.moralis.com/get-started/tutorials/streams/nft-monitoring/track-nft-transfers-in-real-time Let's create a stream that monitors all the NFT contract transfers. > [!TIP] > > This stream uses the listen to all addresses feature that is available only on Business and Enterprise plans. > [!TIP] > > There will be a few NFT contracts that don't follow the standards like CryptoPunks that have a different ABI, and you will not receive webhook requests from those non-standard NFT contracts. ## Programmatically ```javascript theme={null} const NFT_transfer_ABI = [{ "anonymous": false, "inputs": [ { "indexed": true, "name": "from", "type": "address" }, { "indexed": true, "name": "to", "type": "address" }, { "indexed": true, "name": "tokenId", "type": "uint256" }, ], "name": "transfer", "type": "event", }]; // valid abi of the event const options = { chains: [EvmChain.ETHEREUM], // list of blockchains to monitor description: "monitor all NFT transfers", // your description tag: "NFT_transfers", // give it a tag abi: NFT_transfer_ABI, includeContractLogs: true, allAddresses: true, topic0: ["Transfer(address,address,uint256)"], // topic of the event webhookUrl: "https://YOUR_WEBHOOK_URL", // webhook url to receive events, }; const stream = await Moralis.Streams.add(options); ``` ## Via WebUI 1. Create a new Stream 2. Fill out the form 3. Switch on Event Emittance and Add the Abi and select the topic 4. Select `Listen to all addresses` and `Contract interactions (logs)` 5. Click on create stream button # How to Track Specific NFTs or NFT Collections in Real Time Source: https://docs.moralis.com/get-started/tutorials/streams/nft-monitoring/track-specific-nfts-or-nft-collections-in-real-time Let's create a stream that monitors specific CryptoPunk NFTs based on an array of Token IDs. ## Programmatically **JavaScript** ```javascript theme={null} const punkTransferAbi = [ { anonymous: false, inputs: [ { indexed: true, name: "from", type: "address" }, { indexed: true, name: "to", type: "address" }, { indexed: false, name: "punkIndex", type: "uint256" }, ], name: "PunkTransfer", type: "event", }, ]; // valid abi of the event const options = { chains: [EvmChain.ETHEREUM], // list of blockchains to monitor description: "1000 to 1002 cryptopunks", // your description tag: "cryptoPunks", // give it a tag abi: punkTransferAbi, includeContractLogs: true, topic0: ["PunkTransfer(address,address,uint256)"], // topic of the event advancedOptions: [ { topic0: "PunkTransfer(address,address,uint256)", filter: { in: ["punkIndex", ["1000", "1001", "1002"]] }, // only receive transfer events if the token id is 1000/1001/1002 includeNativeTxs: true, }, ], webhookUrl: "https://YOUR_WEBHOOK_URL", // webhook url to receive events, }; const stream = await Moralis.Streams.add(options); const { id } = stream.toJSON(); // { id: 'YOUR_STREAM_ID', ...stream } // Attach the contract address to the stream await Moralis.Streams.addAddress({ id, address: "0xb47e3cd837dDF8e4c57F05d70Ab865de6e193BBB", // crypto punks address }); ``` **Python** ```python theme={null} from moralis import streams api_key = "YOUR_API_KEY" punk_transfer_abi = [{ "anonymous": False, "inputs": [ { "indexed": True, "name": "from", "type": "address" }, { "indexed": True, "name": "to", "type": "address" }, { "indexed": False, "name": "punkIndex", "type": "uint256" }, ], "name": "PunkTransfer", "type": "event", }] body = { "webhookUrl": "https://YOUR_WEBHOOK_URL", "description": "1000 to 1002 cryptopunks", "tag": "cryptoPunks", "topic0": ["PunkTransfer(address,address,uint256)"], "includeContractLogs": True, "abi": punk_transfer_abi, "advancedOptions": [ { "topic0": "PunkTransfer(address,address,uint256)", "filter": { "in": ["punkIndex", ["1000", "1001", "1002"]] }, "includeNativeTxs": True, }, ], "chainIds": ["0x1"], } result = streams.evm.create_stream( api_key=api_key, body=body, ) print(result) ``` ## Via WebUI 1. Create a new Stream 2. Fill out the form 3. Switch on Event Emittance and Add the Abi and select the topic 4. Add below value to advanced options ```json theme={null} [ { "topic0": "PunkTransfer(address,address,uint256)", "filter": { "in": ["punkIndex", ["1000", "1001", "1002"]] } } ] ``` 5. Click on create stream button # How to Track Smart Contract Events in Real Time Source: https://docs.moralis.com/get-started/tutorials/streams/smart-contracts-and-events/track-smart-contract-events-in-real-time Let's create a stream that monitors all the events specific to a contract factory. > [!TIP] > > This stream uses the listen to all addresses feature that is available only on Business and Enterprise plans. > [!NOTE] > > You will need an ABI that is used only on your contracts in order to not receive the events from other contracts that use the same ABI. ## Programmatically: How to Listen to Events from a Contract Factory ```javascript theme={null} const Contract_Factory_ABI = [{ "anonymous": false, "inputs": [ { "indexed": true, "name": "from", "type": "address" }, { "indexed": true, "name": "to", "type": "address" }, { "indexed": true, "name": "contract", "type": "address" }, ], "name": "factoryEvent", "type": "event", }]; // valid abi of the event const options = { chains: [EvmChain.ETHEREUM], // list of blockchains to monitor description: "monitor a contract factory", // your description tag: "contract_Factory", // give it a tag abi: Contract_Factory_ABI, includeContractLogs: true, allAddresses: true, topic0: ["factoryEvent(address,address,address)"], // topic of the event webhookUrl: "https://YOUR_WEBHOOK_URL", // webhook url to receive events, }; const stream = await Moralis.Streams.add(options); ``` ## WebUI: How to Listen to Events from a Contract Factory 1. Create a new Stream 2. Fill out the form 3. Switch on Event Emittance and Add the Abi and select the topic 4. Select `Listen to all addresses` and `Contract interactions (logs)` 5. Click on create stream button # How to Monitor High-Value ERC20 Transfers in Real Time Source: https://docs.moralis.com/get-started/tutorials/streams/token-monitoring/monitor-high-value-erc-20-transfers-in-real-time Learn how to listen to all ERC20 token transfers over certain amount sent by specific address using Moralis Streams API. Let's create a stream that monitors all the ERC20 contract transfers where sender is a specific address and the number of coins transferred is over 1000. > [!TIP] > > This stream uses listen to all addresses feature that is available only on Business and Enterprise plans. There could be few ERC20 contracts that don't follow the standards, and they may use a different ABI for transfers. You will use the ABI specific to ERC20 transfers, the one that doesn't have indexed for third parameter. ## Programmatically ```javascript theme={null} const ERC20_transfer_ABI = [{ "anonymous": false, "inputs": [ { "indexed": true, "name": "from", "type": "address" }, { "indexed": true, "name": "to", "type": "address" }, { "indexed": false, "name": "value", "type": "uint256" }, ], "name": "transfer", "type": "event", }]; // valid abi of the event const filter_ERC20 = { "and": [ { "eq": ["from", "0x283af0b28c62c092c9727f1ee09c02ca627eb7f5"] }, { "gt": ["value", "1000000000"] }, // Example of USDT (6 Decimals) ], }; // only receive ERC20 contract transfers where sender is a specific address and the number of coins transferred is over 1000 const options = { chains: [EvmChain.ETHEREUM], // list of blockchains to monitor description: "monitor all ERC20 transfers", // your description tag: "ERC20_transfers", // give it a tag abi: ERC20_transfer_ABI, includeContractLogs: true, allAddresses: true, topic0: ["Transfer(address,address,uint256)"], // topic of the event advancedOptions: [ { topic0: "Transfer(address,address,uint256)", filter: filter_ERC20 }, ], webhookUrl: "https://YOUR_WEBHOOK_URL", // webhook url to receive events, }; const stream = await Moralis.Streams.add(options); ``` ## Via WebUI 1. Create a new Stream 2. Fill out the form 3. Switch on Event Emittance and Add the Abi and select the topic 4. Select `Listen to all addresses` and `Contract interactions (logs)` 5. Add below value to advanced options ```json theme={null} [ { "topic0": "Transfer(address,address,uint256)", "filter": { "and": [ { "eq": ["from", "0x283af0b28c62c092c9727f1ee09c02ca627eb7f5"] }, { "gt": ["value", "1000000000"] } ] } } ] ``` 6. Click on create stream button. # How to Track ERC20 Token Mints and Burns in Real Time Source: https://docs.moralis.com/get-started/tutorials/streams/token-monitoring/track-erc-20-token-mints-and-burns-in-real-time Learn how to monitor ERC20 token burns or mints using Moralis Streams API. Lets check all USDC transfers but filter transaction where the recipient or the sender is the zero address and if the amount is greater or equal to 10000 USDC. ## Programmatically ```javascript theme={null} const transferUsdcAbi = [ { anonymous: false, inputs: [ { indexed: true, internalType: "address", name: "from", type: "address", }, { indexed: true, internalType: "address", name: "to", type: "address", }, { indexed: false, internalType: "uint256", name: "value", type: "uint256", }, ], name: "Transfer", type: "event", }, ]; const filter = { or: [ { and: [ { eq: ["sender", "0x00000...00000"] }, { gte: ["amount", "10000000000"] }, ], }, { and: [ { eq: ["receiver", "0x00000...00000"] }, { gte: ["amount", "10000000000"] }, ], }, ], }; // we will only receive events when the transfer recipent or the sender is the zero address meaning we are filtering mints and burn const options = { chains: [EvmChain.ETHEREUM], // Monitor USDC on ethereum description: "Token burns and mints", // your description tag: "mintsAndBurns", // give it a tag abi: transferUsdcAbi, includeContractLogs: true, topic0: ["Transfer(address,address,uint256)"], advancedOptions: [ { topic0: "Transfer(address,address,uint256)", filter, includeNativeTxs: true, }, ], webhookUrl: "https://YOUR_WEBHOOK_URL", // webhook url to receive events, }; const stream = await Moralis.Streams.add(options); const { id } = stream.toJSON(); // { id: 'YOUR_STREAM_ID', ...stream } // Attach the contract address to the stream await Moralis.Streams.addAddress({ id, address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", // USDC address }); ``` ## Via WebUI 1. Create a new Stream 2. Fill out the form 3. Switch on Event Emittance and Add the Abi and select the topic 4. Add below value to advanced options ```json theme={null} [ { "topic0": "Transfer(address,address,uint256)", "filter": { "or": [ { "and": [ { "eq": ["sender", "0x00000...00000"] }, { "gte": ["amount", "10000000000"] } ] }, { "and": [ { "eq": ["receiver", "0x00000...00000"] }, { "gte": ["amount", "10000000000"] } ] } ] } } ] ``` 5. Click on create stream button. # How to Track New Tokens and Trading Pairs in Real Time Source: https://docs.moralis.com/get-started/tutorials/streams/token-monitoring/track-new-tokens-and-trading-pairs-in-real-time Learn how to monitor for new tokens by tracking DEX pair creation events using Moralis Streams API. Monitoring for new tokens in the DeFi space is essential for discovering opportunities and building token discovery platforms. While you could monitor for token minting events, a more reliable approach is to track DEX pair creation events, as these indicate tokens that are actually being launched with liquidity. > [!TIP] > > Pair creation events are more reliable indicators of new tokens than minting events because they indicate a token is being launched with actual trading liquidity. ## Approach 1: Monitoring DEX Pair Creation Uniswap V2 is one popular DEX protocols. ```javascript theme={null} // Note: This is a sample ABI for Uniswap V2 Factory. Always verify the latest const uniswapV2FactoryAbi = [ { anonymous: false, inputs: [ { indexed: true, internalType: "address", name: "token0", type: "address", }, { indexed: true, internalType: "address", name: "token1", type: "address", }, { indexed: false, internalType: "address", name: "pair", type: "address", }, { indexed: false, internalType: "uint256", name: "", type: "uint256", }, ], name: "PairCreated", type: "event", } ]; const options = { chains: [EvmChain.ETHEREUM], // Monitor on Ethereum description: "Track new Uniswap V2 pairs", tag: "uniswap_v2_pairs", abi: uniswapV2FactoryAbi, includeContractLogs: true, topic0: ["PairCreated(address,address,address,uint256)"], advancedOptions: [ { topic0: "PairCreated(address,address,address,uint256)", includeNativeTxs: true, }, ], webhookUrl: "https://YOUR_WEBHOOK_URL", }; const stream = await Moralis.Streams.add(options); const { id } = stream.toJSON(); // Attach the Uniswap V2 Factory address to the stream // Verify factory addresses and ABIs from official sources, as they may change over time. await Moralis.Streams.addAddress({ id, address: "0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f", // Uniswap V2 Factory }); ``` ## Approach 2: Monitoring Multiple DEXes To get comprehensive coverage, monitor multiple DEXes simultaneously: ```javascript theme={null} const multiDexOptions = { chains: ["0x1", "0x38", "0x89"], // Ethereum, BSC, Polygon description: "Track pairs across multiple DEXes", tag: "multidex_pairs", abi: uniswapV2FactoryAbi, // Compatible with most V2-style DEXes includeContractLogs: true, topic0: ["PairCreated(address,address,address,uint256)"], advancedOptions: [ { topic0: "PairCreated(address,address,address,uint256)", includeNativeTxs: true, }, ], webhookUrl: "https://YOUR_WEBHOOK_URL", }; const stream = await Moralis.Streams.add(multiDexOptions); const { id } = stream.toJSON(); // Attach multiple factory addresses. // Verify the official DEX documentations to get the latest addresses. const factories = [ "0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f", // Uniswap V2 "0xC0AEe478e3658e2610c5F7A4A2E1777cE9e4f2Ac", // SushiSwap "0xcA143Ce32Fe78f1f7019d7d551a6402fC5350c73", // PancakeSwap V2 "0x5757371414417b8C6CAad45bAeF941aBc7d3Ab32", // QuickSwap ]; await Moralis.Streams.addAddress({ id, address: factories, }); ``` ## Use Cases This approach is perfect for: * **Token Discovery Platforms**: Automatically discover and list new tokens * **DeFi Analytics**: Track new token launches for market analysis * **Trading Bots**: React to new token launches with liquidity * **Portfolio Trackers**: Add new tokens to user portfolios automatically * **Security Monitoring**: Monitor for potential scam tokens # Track Specific ERC20 Token Transfers From a List of Wallets Source: https://docs.moralis.com/get-started/tutorials/streams/token-monitoring/track-specific-erc-20-token-transfers-from-a-list-of-wallets Learn how to Track Specific ERC20 Token Transfers From a List of Wallets using Moralis Streams API. Lets check a list of wallets and filter only a specific ERC20 Token Transfers. We will use the built-in `moralis_streams_contract_address` filter, to filter only the specific token transfers. ## Programmatically ```javascript theme={null} const ERC20TransferABI = [ { anonymous: false, inputs: [ { indexed: true, name: "from", type: "address", }, { indexed: true, name: "to", type: "address", }, { indexed: false, name: "value", type: "uint256", }, ], name: "Transfer", type: "event", }, ]; // This filter will only listen to BUST token transfers const filter = { eq: [ "moralis_streams_contract_address", "0x55d398326f99059ff775485246999027b3197955", ], // BUST contract https://bscscan.com/token/0x55d398326f99059ff775485246999027b3197955 }; const options = { chains: ["0x38"], description: "Listen to a list of wallets for BUSD transfers", tag: "busd-transfers", webhookUrl: "https://webhook.site/e04c2edc-afb9-45b8-aff5-20724b2b1561", includeContractLogs: true, topic0: ["Transfer(address,address,uint256)"], abi: ERC20TransferABI, advancedOptions: [ { topic0: "Transfer(address,address,uint256)", filter, }, ], }; const stream = await Moralis.Streams.add(options); const { id } = stream.toJSON(); // { id: 'YOUR_STREAM_ID', ...stream } // Attach the list of addresses to the stream await Moralis.Streams.addAddress({ id, address: ["0x1234...5678", "0x8765...4321", "0x543...0f43"], }); ``` # Get Native Balances Source: https://docs.moralis.com/get-started/tutorials/streams/wallet-monitoring/get-native-balances Learn how to get native balances of addresses that appear in your Stream webhooks. There is an option `getNativeBalances` when creating or editing a Stream. It is a list of native balance calls for specific addresses. You can get native balances (ETH/BNB/MATIC and many more) of addresses that appear in your webhook. They work similarly to [Triggers](/streams/streams-concepts/triggers). > [!NOTE] > > The `getNativeBalances` trigger is currently available with a business plan or higher. ## Native Balance Trigger ```json theme={null} "getNativeBalances": [ { "selectors": ["$fromAddress", "$toAddress"], "type": "tx" } ] ``` * `selectors` is a list of [valid Selectors](/streams/streams-concepts/triggers#selectors). For each selector you will get the native balance in the webhook. * `type` specifies which part of the webhook you want to select the addresses from. See [Valid Types](/streams/streams-concepts/triggers#type). The value `internalTx` is also allowed. ## Response The webhook introduces a new field `nativeBalances` that has the balances uniquely ordered by the triggers: ```json theme={null} { "confirmed": true, "chainId": "0x1", "abi": [], "streamId": "v900a834-a542-43f9-98f6-0f76caf65394", "tag": "someString", "retries": 0, "block": { "number": "16140655", "hash": "0xfc0b1ae5d04b3c5a780f1f72658edc9e26a6340df4b1118a713652b6d043039a", "timestamp": "1670510543" }, "logs": [], "txs": [ { "hash": "0xd304ef0dd0df001d8f37de569af63585dbf7637247b17dc12224828960b4d830", "gas": "120000", "gasPrice": "17605149814", "nonce": "43904", "input": "0xa9059cbb00000000000000000000000072f54455fbdbff1b8975ab2df599ff9f9afb5310000000000000000000000000000000000000000000000000000000000606a9e0", "transactionIndex": "16", "fromAddress": "0x0b5c4a7fcda49e0a8661419bb55b86161a86db2a", "toAddress": "0xdac17f958d2ee523a2206206994597c13d831ec7", "value": "0", "type": "2", "v": "0", "r": "52200684288032529078283440758240219132630446778024109656659293182067276426999", "s": "25805856329951682196861199677610079726197925451457581628939426805653323455347", "receiptCumulativeGasUsed": "1214527", "receiptGasUsed": "63209", "receiptContractAddress": null, "receiptRoot": null, "receiptStatus": "1" } ], "txsInternal": [], "erc20Transfers": [], "erc20Approvals": [], "nftTokenApprovals": [], "nftApprovals": { "ERC721": [], "ERC1155": [] }, "nftTransfers": [], "nativeBalances": [ { "address": "0x0b5c4a7fcda49e0a8661419bb55b86161a86db2a", "balance": "3921415148849464186" }, { "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", "balance": "2135786324" } ] } ``` # Listen to all Addresses Source: https://docs.moralis.com/get-started/tutorials/streams/wallet-monitoring/listen-to-all-addresses Learn how to listen to all addresses, NFT contract transfers, events from new contracts specific to a contract factory, and NFT contract transfers where the sender is a specific address. Learn how to listen to all addresses, NFT contract transfers, events from new contracts specific to a contract factory, and NFT contract transfers where the sender is a specific address. * Listen to all NFT contract transfers [tutorial](/get-started/tutorials/streams/nft-monitoring/track-nft-transfers-in-real-time) * Listen to all events from new contracts specific to a contract factory [tutorial](/get-started/tutorials/streams/smart-contracts-and-events/track-smart-contract-events-in-real-time) * Listen to all NFT contract transfers where sender is a specific address [tutorial](/get-started/tutorials/streams/nft-monitoring/monitoring-nft-transfers-from-specific-wallet-addresses) * Listen to all ERC20 contract transfers where sender is a specific address and number of coins transferred is over 1000 [tutorial](/get-started/tutorials/streams/token-monitoring/track-specific-erc-20-token-transfers-from-a-list-of-wallets) Say you have the following topic `Transfer(address,address,uint256)`. You can get every transfer happening on chain by setting the topic to `Transfer(address,address,uint256)` and setting `allAddresses` to `true`. That means you will get all transactions that match this topic. > [!NOTE] > > This feature is not available in all plans. You will also have to provide the ABI, and the events will match only that particular ABI and topic. There are cases when different ABIs have the same topic (for example the `indexed` field can be different for two ABIs and the topic will be the same). ## Example The following stream will listen to ALL NFT Transfers, without the need to provide the smart contract address: ```json theme={null} { "tag": "anyEthNFTTransfer", "topic0": ["Transfer(address,address,uint256)"], "allAddresses": true, "includeContractLogs": true, "abi": [ { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "from", "type": "address" }, { "indexed": true, "internalType": "address", "name": "to", "type": "address" }, { "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "Transfer", "type": "event" } ], "chainIds": ["0x1"] } ``` # Monitor High-Value ENS Domain Registrations Source: https://docs.moralis.com/get-started/tutorials/streams/wallet-monitoring/monitor-high-value-ens-domain-registrations Learn how to monitor ENS domain registrations that cost higher than 1 ETH using the Moralis Streams API. Learn how to monitor ENS domain registrations that cost higher than 1 ETH using the Moralis Streams API. ## Programmatically **JavaScript:** ```javascript theme={null} const ensNameRegisteredAbi = [{ "anonymous": false, "inputs": [ { "indexed": false, "internalType": "string", "name": "name", "type": "string", }, { "indexed": true, "internalType": "bytes32", "name": "label", "type": "bytes32", }, { "indexed": true, "internalType": "address", "name": "owner", "type": "address", }, { "indexed": false, "internalType": "uint256", "name": "cost", "type": "uint256", }, { "indexed": false, "internalType": "uint256", "name": "expires", "type": "uint256", }, ], "name": "NameRegistered", "type": "event", }]; // valid abi of the event const filter = { "and": [ { "eq": ["owner", "0x283Af0B28c62C092C9727F1Ee09c02CA627EB7F5"] }, { "gt": ["cost", "1000000000000000000"] }, ], }; // only receive registration events if the owner is the address and the cost is higher than 1 ETH const options = { chains: [EvmChain.ETHEREUM], // Ethereum Name Service so we only monitor Ethereum description: "ENS Name Registrations", // your description tag: "ensRegistrationByBob", // give it a tag abi: ensNameRegisteredAbi, topic0: ["NameRegistered(string,bytes32,address,uint256,uint256)"], includeContractLogs: true, advancedOptions: [ { topic0: "NameRegistered(string,bytes32,address,uint256,uint256)", filter, includeNativeTxs: true, }, ], webhookUrl: "https://YOUR_WEBHOOK_URL", // webhook url to receive events }; const stream = await Moralis.Streams.add(options); const { id } = stream.toJSON(); // { id: 'YOUR_STREAM_ID', ...stream } // Attach the contract address to the stream await Moralis.Streams.addAddress({ id, address: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e", // ENS Registry address }); ``` **Python:** ```python theme={null} """ Requirements: moralis python sdk Install with: pip install moralis """ from moralis import streams webhook_url = "WEB_HOOK_URL_HERE" api_key = "API_KEY_HERE" abi = [{ "anonymous": False, "inputs": [ { "indexed": False, "internalType": "string", "name": "name", "type": "string", }, { "indexed": True, "internalType": "bytes32", "name": "label", "type": "bytes32", }, { "indexed": True, "internalType": "address", "name": "owner", "type": "address", }, { "indexed": False, "internalType": "uint256", "name": "cost", "type": "uint256", }, { "indexed": False, "internalType": "uint256", "name": "expires", "type": "uint256", }, ], "name": "NameRegistered", "type": "event", }] advanced_options = [ { "topic0": "NameRegistered(string,bytes32,address,uint256,uint256)", "filter": { "and": [ { "eq": ["owner", "0x283Af0B28c62C092C9727F1Ee09c02CA627EB7F5"] }, { "gt": ["cost", "1000000000000000000"] } ] } } ] body = { "webhookUrl": webhook_url, "description": "ENS Name Registrations", "tag": "ensRegistrationByBob", "topic0": ["NameRegistered(string,bytes32,address,uint256,uint256)"], "allAddresses": False, "includeNativeTxs": True, "includeContractLogs": True, "includeInternalTxs": False, "abi": abi, "advancedOptions": advanced_options, "chainIds": ["0x1"], } result = streams.evm.create_stream( api_key=api_key, body=body, ) print(result) # Attach the contract address to the stream params = { "id": result["id"], } body = { "address": "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e", } result = streams.evm.add_address_to_stream( api_key=api_key, params=params, body=body, ) print(result) ``` ## Via WebUI 1. Create a new Stream 2. Fill out the form 3. Switch on Event Emittance and add the ABI, then select the topic 4. Add the following value to advanced options: ```json theme={null} [ { "topic0": "NameRegistered(string,bytes32,address,uint256,uint256)", "filter": { "and": [ { "eq": ["owner", "0x283Af0B28c62C092C9727F1Ee09c02CA627EB7F5"] }, { "gt": ["cost", "1000000000000000000"] } ] } } ] ``` 5. Click on the create stream button. # Monitor Multiple Addresses Source: https://docs.moralis.com/get-started/tutorials/streams/wallet-monitoring/monitor-multiple-addresses Learn best practices for handling multiple addresses in your streams. You do not have to create a separate stream for each address. Instead, you can attach multiple addresses to the same stream. The best practice is to create as few streams as possible and instead attach addresses to existing streams whenever it makes sense. You can attach any number of addresses to a stream. > [!TIP] > > If you need more streams, update to a paid plan or contact support ([hello@moralis.io](mailto:hello@moralis.io)) if you are already a paying client. If you want to add multiple addresses to another stream, you can always attach them to an existing stream. ### Attaching multiple addresses to a stream ```javascript theme={null} // Add addresses await Moralis.Streams.addAddress({ id: streamId, address: [ "0xCFDF6Aaae9f6B927E3736FBD327853B622c5060E", "0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B", ], // Can also be a single string }); ``` ### Delete an address from a stream ```javascript theme={null} // Delete an address await Moralis.Streams.deleteAddress({ id, address, }); ``` ### Get all addresses from a stream ```javascript theme={null} // Get all addresses await Moralis.Streams.getAddresses({ id, limit, }); ``` # How to Monitor Wallet Activity in Real Time Source: https://docs.moralis.com/get-started/tutorials/streams/wallet-monitoring/monitor-wallet-activity-in-real-time Learn how to monitor wallet transactions in real time using the Moralis Streams API, including setting up webhook listeners for on-chain activity. The [Streams API](https://moralis.io/streams/) enables you to stream real-time blockchain data to your application through webhooks. This tutorial focuses on monitoring wallet transactions as they happen on-chain. Common use cases include: * Web3 alerts (e.g. whale alerts monitoring) * Real-time transaction and crypto wallet notifications * Monitoring wallet balances ## Prerequisites * A [Moralis account](https://admin.moralis.com) with an API key * Node.js or Python installed * A webhook URL (you can use [https://webhook.site](https://webhook.site) for testing) ## Step 1: Install the Moralis SDK Install the Moralis SDK for your preferred language: ```bash npm theme={null} npm install moralis @moralisweb3/common-evm-utils ``` ```bash yarn theme={null} yarn add moralis @moralisweb3/common-evm-utils ``` ```bash pip theme={null} pip install moralis ``` ## Step 2: Create a Stream to Monitor Wallet Transactions Once you have your API key and webhook URL, set up a stream to monitor on-chain wallet transactions. In this example, we will monitor the address `0x68b3f12d6e8d85a8d3dbbc15bba9dc5103b888a4`. **JavaScript:** ```javascript index.js theme={null} const Moralis = require("moralis").default; const { EvmChain } = require("@moralisweb3/common-evm-utils"); const runApp = async () => { await Moralis.start({ apiKey: "YOUR_API_KEY", }); const stream = { chains: [EvmChain.ETHEREUM, EvmChain.POLYGON], description: "monitor Bobs wallet", tag: "bob", webhookUrl: "https://YOUR_WEBHOOK_URL", includeNativeTxs: true, }; const newStream = await Moralis.Streams.add(stream); const { id } = newStream.toJSON(); // Now we attach bobs address to the stream const address = "0x68b3f12d6e8d85a8d3dbbc15bba9dc5103b888a4"; await Moralis.Streams.addAddress({ address, id }); }; runApp(); ``` **TypeScript:** ```typescript index.ts theme={null} import Moralis from "moralis"; import { EvmChain } from "@moralisweb3/common-evm-utils"; const runApp = async () => { await Moralis.start({ apiKey: "YOUR_API_KEY", }); const stream = { chains: [EvmChain.ETHEREUM, EvmChain.POLYGON], description: "monitor Bobs wallet", tag: "bob", webhookUrl: "https://YOUR_WEBHOOK_URL", includeNativeTxs: true, }; const newStream = await Moralis.Streams.add(stream); const { id } = newStream.toJSON(); // Now we attach bobs address to the stream const address = "0x68b3f12d6e8d85a8d3dbbc15bba9dc5103b888a4"; await Moralis.Streams.addAddress({ address, id }); }; runApp(); ``` **Python:** ```python index.py theme={null} from moralis import streams api_key = "YOUR_API_KEY" create_stream_body = { "description": "monitor Bobs wallet", "tag": "bob", "webhook_url": "https://YOUR_WEBHOOK_URL", "include_native_txs": True, "chain_ids": [ "0x1", "0x89" ] } result = streams.evm_streams.create_stream( api_key=api_key, body=create_stream_body, ) add_address_body = { "address": "0x68b3f12d6e8d85a8d3dbbc15bba9dc5103b888a4" } params = { "id": result.id } # Now we attach bobs address to the stream streams.evm_streams.add_address_to_stream( api_key=api_key, body=add_address_body, params=params, ) ``` Once the code has been added, run the script to create the stream. This will be reflected on your Moralis Dashboard as well. From here, you will receive new real-time responses on your attached webhook for any new transactions occurring on either Ethereum or Polygon. ## Step 3: Listen to Smart Contract Events In addition to monitoring wallet transactions in real-time, you can use Streams to listen to smart contract events whenever they are emitted on the blockchain. For example, to listen to all ERC20 transfers for [USDT](https://etherscan.io/token/0xdac17f958d2ee523a2206206994597c13d831ec7): **JavaScript:** ```javascript index.js theme={null} const Moralis = require("moralis").default; const { EvmChain } = require("@moralisweb3/common-evm-utils"); const ERC20_transfer_ABI = [ { anonymous: false, inputs: [ { indexed: true, name: "from", type: "address" }, { indexed: true, name: "to", type: "address" }, { indexed: false, name: "value", type: "uint256" }, ], name: "Transfer", type: "event", }, ]; const runApp = async () => { await Moralis.start({ apiKey: "YOUR_API_KEY", }); const stream = { chains: [EvmChain.ETHEREUM], description: "monitor USDT transfers", tag: "USDT", webhookUrl: "https://YOUR_WEBHOOK_URL", abi: ERC20_transfer_ABI, includeContractLogs: true, topic0: ["Transfer(address,address,uint256)"], }; const newStream = await Moralis.Streams.add(stream); const { id } = newStream.toJSON(); // Now we attach USDT address to the stream const address = "0xdAC17F958D2ee523a2206206994597C13D831ec7"; await Moralis.Streams.addAddress({ address, id }); }; runApp(); ``` **Python:** ```python index.py theme={null} from moralis import streams api_key = "YOUR_API_KEY" ERC20_transfer_ABI = [{ "anonymous": False, "inputs": [ { "indexed": True, "name": "from", "type": "address" }, { "indexed": True, "name": "to", "type": "address" }, { "indexed": False, "name": "value", "type": "uint256" }, ], "name": "Transfer", "type": "event", }] create_stream_body = { "description": "monitor USDT transfers", "tag": "USDT", "webhook_url": "https://YOUR_WEBHOOK_URL", "include_contract_logs": True, "chain_ids": [ "0x1" ], "abi": ERC20_transfer_ABI, "topic0": ["Transfer(address,address,uint256)"] } result = streams.evm_streams.create_stream( api_key=api_key, body=create_stream_body, ) add_address_body = { "address": "0xdAC17F958D2ee523a2206206994597C13D831ec7" } params = { "id": result.id } # Now we attach USDT address to the stream streams.evm_streams.add_address_to_stream( api_key=api_key, body=add_address_body, params=params, ) ``` ## Step 4: Add Filters for Specific Use Cases For listening to smart contracts, you can add the [Filters feature](/streams/streams-concepts/filters) to filter out results that only fulfill certain criteria. This is useful for specific use cases such as whale monitoring. For example, to monitor all USDT transactions on Ethereum over \$1M: **JavaScript:** ```javascript index.js theme={null} const filter_ERC20 = { "and": [ { "eq": ["from", "0x283af0b28c62c092c9727f1ee09c02ca627eb7f5"] }, { "gt": ["value", "1000000000"] }, // Example of USDT (6 Decimals) ], }; const runApp = async () => { const stream = { // same parameters as prior advancedOptions: [ { topic0: "Transfer(address,address,uint256)", filter: filter_ERC20 }, ] }; const newStream = await Moralis.Streams.add(stream); const { id } = newStream.toJSON(); // Now we attach USDT address to the stream const address = "0xdAC17F958D2ee523a2206206994597C13D831ec7"; await Moralis.Streams.addAddress({ address, id }); }; runApp(); ``` **Python:** ```python index.py theme={null} filter_ERC20 = { "and": [ { "eq": ["from", "0x283af0b28c62c092c9727f1ee09c02ca627eb7f5"] }, { "gt": ["value", "1000000000"] }, # Example of USDT (6 Decimals) ], } create_stream_body = { # same parameters as prior "advanced_options": [ { "topic0": "Transfer(address,address,uint256)", "filter": filter_ERC20 } ] } result = streams.evm_streams.create_stream( api_key=api_key, body=create_stream_body, ) add_address_body = { "address": "0xdAC17F958D2ee523a2206206994597C13D831ec7" } params = { "id": result.id } # Now we attach USDT address to the stream streams.evm_streams.add_address_to_stream( api_key=api_key, body=add_address_body, params=params, ) ``` Once modified, you will only receive USDT transfers on Ethereum over \$1M in real-time on your webhooks. # Overview Source: https://docs.moralis.com/index One platform for real-time blockchain data - APIs, streams, datasets and enterprise indexing powering wallets, compliance, AI, and next-gen finance. ## Moralis Data Platform Moralis is an onchain data platform that provides a complete, production-grade data layer for Web3 It enables teams to fetch, monitor, index, and export blockchain data across 30+ supported chains - without running RPCs, DIY indexers, or custom infrastructure. The platform is built for scale, low latency, and reliability, and is used by both startups and enterprises to power wallets, analytics, automation, and data pipelines. > [card] [Data APIs](/data-api/index) > > Fetch Crypto Data > [card] [Streams](/streams) > > Monitor Crypto Data > [card] [Data Feeds](/data-feeds) > > Deliver Crypto Data ### Data API The [Data API](/data-api/index) provides a **single**, **consistent interface** for accessing decoded and enriched onchain data across EVM, Solana, and Bitcoin chains. It delivers **low-latency**, **high-throughput APIs** for wallets, tokens, NFTs, prices, DeFi, and raw blockchain data, allowing teams to build multi-chain applications from a single backend. **Best for:** powering user-facing applications, dashboards, and backend services that need fast, reliable onchain reads. ### Streams [Streams](/streams/index) enables **real-time access to onchain events** through webhooks, allowing applications to react instantly without polling the blockchain. Teams can subscribe to wallet activity, transfers, contract events, or custom triggers and receive events as they happen onchain. **Best for:** notifications, automation, monitoring, and event-driven workflows. ### Data Feeds [Data Feeds](/data-feeds/index) is a managed, enterprise-grade solution for building **custom onchain data pipelines**. It combines historical backfills with real-time indexing, supports **custom schemas**, and delivers indexed data directly into your infrastructure - giving teams full control without the operational burden of running indexers in-house. **Best for:** custom data models, internal analytics systems, and enterprise workloads requiring tailored onchain data. ## How the platform fits together * **Data API →** Read onchain data on demand with low latency * **Streams →** React to onchain events in real time * **Data Feeds →** Deliver custom, controlled onchain data pipelines Together, these products form Moralis’ **onchain data layer**, enabling teams to build, scale, and operate Web3 products on a single platform ## Product comparison | Product | Primary purpose | Access pattern | Data type | Best suited for | | - | - | - | - | - | | [Data API](/data-api/index) | Read onchain data | On-demand (request/response) | Decoded, enriched blockchain data | Apps, dashboards, backend services | | [Streams](/streams/index) | React to onchain events | Real-time webhooks | Live wallet & contract events | Notifications, automation, monitoring | | [Data Feeds](/data-feeds/index) | Deliver custom data pipelines | Continuous indexing | Custom-structured onchain data | Enterprise systems, internal analytics | ## Build Web3 Apps With AI Using Real Onchain Data [Build Web3 Apps With AI Using Real Onchain Data | Moralis Onchain Skills](https://www.youtube.com/embed/hq-SlxYji4w) # eth_blockNumber Source: https://docs.moralis.com/rpc-nodes/arbitrum/eth-blockNumber Returns the number of most recent block. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request body No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/arbitrum/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x4b7" } ``` # eth_call Source: https://docs.moralis.com/rpc-nodes/arbitrum/eth-call Executes a new message call immediately without creating a transaction on the blockchain. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **from** `string` The address the transaction is sent from **to** `string` *required* The address the transaction is directed to **gas** `string` Integer of the gas provided for the transaction execution **gasPrice** `string` Integer of the gasPrice used for each paid gas **value** `string` Integer of the value sent with this transaction **data** `string` Hash of the method signature and encoded parameters **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ { "from": "0x0000000000000000000000000000000000000000", "to": "0x0000000000000000000000000000000000000000", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0x" }, "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/arbitrum/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_call", "params": [{"from": "0xb60e8dd61c5d32be8058bb8eb970870f07233155", "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"}, "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x15536ee" } ``` # eth_chainId Source: https://docs.moralis.com/rpc-nodes/arbitrum/eth-chain-id Returns the chain ID of the current connected node as described in EIP-695. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request body No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/arbitrum/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_chainId", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` # eth_createAccessList Source: https://docs.moralis.com/rpc-nodes/arbitrum/eth-create-access-list Creates an access list that you can include in a transaction. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **from** `string` The address the transaction is sent from **to** `string` The address the transaction is directed to **gas** `string` Integer of the gas provided for the transaction execution **gasPrice** `string` Integer of the gasPrice used for each paid gas **maxPriorityFeePerGas** `string` Maximum fee per gas the sender is willing to pay to miners **maxFeePerGas** `string` Maximum total fee per gas the sender is willing to pay **value** `string` Integer of the value sent with this transaction **data** `string` Hash of the method signature and encoded parameters **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ { "from": "0x8ba1f109551bd432803012645haca66c9834d7c6", "to": "0x6b175474e89094c44da98b954eedeac495271d0f", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0xa9059cbb0000000000000000000000008ba1f109551bd432803012645haca66c9834d7c60000000000000000000000000000000000000000000000000de0b6b3a7640000" }, "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/arbitrum/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_createAccessList", "params": [{"from": "0x8ba1f109551bd432803012645haca66c9834d7c6", "to": "0x6b175474e89094c44da98b954eedeac495271d0f", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0xa9059cbb0000000000000000000000008ba1f109551bd432803012645haca66c9834d7c60000000000000000000000000000000000000000000000000de0b6b3a7640000"}, "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "accessList": [ { "address": "0x6b175474e89094c44da98b954eedeac495271d0f", "storageKeys": [ "0x0000000000000000000000000000000000000000000000000000000000000000" ] } ], "gasUsed": "0x7671" } } ``` # eth_estimateGas Source: https://docs.moralis.com/rpc-nodes/arbitrum/eth-estimate-gas Generates and returns an estimate of how much gas is necessary to allow the transaction to complete. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **from** `string` The address the transaction is sent from **to** `string` The address the transaction is directed to **gas** `string` Integer of the gas provided for the transaction execution **gasPrice** `string` Integer of the gasPrice used for each paid gas **value** `string` Integer of the value sent with this transaction **data** `string` Hash of the method signature and encoded parameters **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ { "from": "0x8D97689C9818892B700e27F316cc3E41e17fBeb9", "to": "0xd3CdA913deB6f67967B99D67aCDFa1712C293601", "value": "0x186a0" }, "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/arbitrum/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_estimateGas", "params": [{"from": "0x8D97689C9818892B700e27F316cc3E41e17fBeb9", "to": "0xd3CdA913deB6f67967B99D67aCDFa1712C293601", "value": "0x186a0"}, "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x5208" } ``` # eth_feeHistory Source: https://docs.moralis.com/rpc-nodes/arbitrum/eth-fee-history Returns historical gas information for a range of blocks. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockCount** `string` *required* Number of blocks in the requested range **newestBlock** `string` *required* Highest number block of the requested range **rewardPercentiles** `array` Array of percentile values to sample from each block's effective priority fees per gas #### Example request `params` ```javascript theme={null} [ "0x4", "latest", [25, 75] ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/arbitrum/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_feeHistory", "params": ["0x4", "latest", [25, 75]], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": [ "0x7", "0x7", "0x7", "0x7", "0x7" ], "gasUsedRatio": [ 0.026089875, 0.406803, 0.010817, 0.5 ], "baseFeePerBlobGas": [ "0x3319eb", "0x350c54", "0x364072", "0x364072", "0x32279d" ], "blobGasUsedRatio": [ 0.47619047619047616, 0.2857142857142857, 0, 0.3333333333333333 ], "oldestBlock": "0x11b9231", "reward": [ ["0x4a817c800", "0x4a817c800"], ["0x773593c0", "0x773593c0"], ["0x0", "0x0"], ["0x0", "0x0"] ] } } ``` # eth_gasPrice Source: https://docs.moralis.com/rpc-nodes/arbitrum/eth-gas-price Returns the current price per gas in wei. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/arbitrum/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x09184e72a000" } ``` # eth_getBalance Source: https://docs.moralis.com/rpc-nodes/arbitrum/eth-get-balance Returns the balance of the account of given address. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address to check for balance **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/arbitrum/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0234c8a3397aab58" } ``` # eth_getBlockByHash Source: https://docs.moralis.com/rpc-nodes/arbitrum/eth-get-block-by-hash Returns information about a block by hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block **fullTransactionObjects** `boolean` *required* If true it returns the full transaction objects, if false only the hashes of the transactions #### Example request `params` ```javascript theme={null} [ "0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c", false ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/arbitrum/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c", false], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x3319bb0", "blobGasUsed": "0x120000", "difficulty": "0x0", "excessBlobGas": "0xa576243", "extraData": "0xe29ca82051756173617220287175617361722e77696e2920e29ca8", "gasLimit": "0x3938700", "gasUsed": "0x2965eaa", "hash": "0xc319ec0da50d354ce425b63fb6914a42aafdb9ee9807518edd595809e25fbe38", "logsBloom": "0x7feeeb37793b4fdfff7ab7aefde2d7fdfff9575bfef5bdff3fb97bfef7bcddbbdf9d55e77fdf7ead7b98ffd9bb6fefff7e77b163bf9eeebdddd1ffbf376cfbeb7efffef83ffbe9eb7ff7776ab3dcf8bfee7ebaddfffdf7fe3fffdf6ed3f7dff77cf2fd7efffff7a19ef7ffbbe3e8befdb7fff76b6ed6e7ffceeb99ff7eeb5efebfff3fff7da1fb39f9fff3fd7f3f77b6dd0bed39f5fff3bfa7fbbce7f9f6ec6e0fff50bfe7f9f79efff35ff6d93fecfefbffdaf7b7eff35ec6ff42fe7e6f77f7deff7eff57f6aafa597feebdffff7bbd677e27ffbfadfdf57f7e7d2aeeffffff6676ffa7f3f375eb95eecf9ffa235cbfcdefafbf8feed9dc7b56ff2fdfedfefe", "miner": "0x396343362be2a4da1ce0c1c210945346fb82aa49", "mixHash": "0x07444bb5750f746e200e1dcd8d83221b26576d3357b833cc1e434e7966d0e774", "nonce": "0x0000000000000000", "number": "0x1736791", "parentBeaconBlockRoot": "0x2759f248e2d1cb1a2f5c2657c4efcc623dd8ea7f23e8700162e7fccdacedfd5d", "parentHash": "0xdf0e4dee910167d7b1687a6cb677983ce7ed351ae78ab7e2c5ba39d793c80391", "receiptsRoot": "0x5f1c58e498161509245daad0f60319d9abab7f04d2ca60e99a3674cfdc9b8327", "requestsHash": "0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x1ef1e", "stateRoot": "0x728c7e38107037b573d719e67b6872ee3ca4e01b47818598316cd696bfe24f2c", "timestamp": "0x697b4bcb", "transactions": [ "0xbf7bd0cf98c3b65525f1f7267b1d02e7ccd7cd133b137f46723a91cf187616d5", "0x06ac9281da76d530aa19600e2c34aae7564a78702d3eb52b1fb363985473e296" ], "transactionsRoot": "0xa8c680f6ad8ccc7a49db5ab76cbd9194c88e16dbcfa440104f7787e5ba815c4f", "uncles": [], "withdrawals": [ { "index": "0x6f78bfb", "validatorIndex": "0x955f5", "address": "0x5d3ca1842d0988816434ea51ca420182f3f1e31a", "amount": "0x102d2f1" } ], "withdrawalsRoot": "0x9b7ecf1ba575fc02e4b4c14bd65d5ca95c0e066adaae3fc2ef16f5acd90214d8" } } ``` # eth_getBlockByNumber Source: https://docs.moralis.com/rpc-nodes/arbitrum/eth-get-block-by-number Returns information about a block by block number. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" **fullTransactionObjects** `boolean` *required* If true it returns the full transaction objects, if false only the hashes of the transactions #### Example request `params` ```javascript theme={null} [ "0x1b4", true ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/arbitrum/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["0x1b4", true], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x3319bb0", "blobGasUsed": "0x120000", "difficulty": "0x0", "excessBlobGas": "0xa576243", "extraData": "0xe29ca82051756173617220287175617361722e77696e2920e29ca8", "gasLimit": "0x3938700", "gasUsed": "0x2965eaa", "hash": "0xc319ec0da50d354ce425b63fb6914a42aafdb9ee9807518edd595809e25fbe38", "logsBloom": "0x7feeeb37793b4fdfff7ab7aefde2d7fdfff9575bfef5bdff3fb97bfef7bcddbbdf9d55e77fdf7ead7b98ffd9bb6fefff7e77b163bf9eeebdddd1ffbf376cfbeb7efffef83ffbe9eb7ff7776ab3dcf8bfee7ebaddfffdf7fe3fffdf6ed3f7dff77cf2fd7efffff7a19ef7ffbbe3e8befdb7fff76b6ed6e7ffceeb99ff7eeb5efebfff3fff7da1fb39f9fff3fd7f3f77b6dd0bed39f5fff3bfa7fbbce7f9f6ec6e0fff50bfe7f9f79efff35ff6d93fecfefbffdaf7b7eff35ec6ff42fe7e6f77f7deff7eff57f6aafa597feebdffff7bbd677e27ffbfadfdf57f7e7d2aeeffffff6676ffa7f3f375eb95eecf9ffa235cbfcdefafbf8feed9dc7b56ff2fdfedfefe", "miner": "0x396343362be2a4da1ce0c1c210945346fb82aa49", "mixHash": "0x07444bb5750f746e200e1dcd8d83221b26576d3357b833cc1e434e7966d0e774", "nonce": "0x0000000000000000", "number": "0x1736791", "parentBeaconBlockRoot": "0x2759f248e2d1cb1a2f5c2657c4efcc623dd8ea7f23e8700162e7fccdacedfd5d", "parentHash": "0xdf0e4dee910167d7b1687a6cb677983ce7ed351ae78ab7e2c5ba39d793c80391", "receiptsRoot": "0x5f1c58e498161509245daad0f60319d9abab7f04d2ca60e99a3674cfdc9b8327", "requestsHash": "0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x1ef1e", "stateRoot": "0x728c7e38107037b573d719e67b6872ee3ca4e01b47818598316cd696bfe24f2c", "timestamp": "0x697b4bcb", "transactions": [ "0xbf7bd0cf98c3b65525f1f7267b1d02e7ccd7cd133b137f46723a91cf187616d5", "0x06ac9281da76d530aa19600e2c34aae7564a78702d3eb52b1fb363985473e296" ], "transactionsRoot": "0xa8c680f6ad8ccc7a49db5ab76cbd9194c88e16dbcfa440104f7787e5ba815c4f", "uncles": [], "withdrawals": [ { "index": "0x6f78bfb", "validatorIndex": "0x955f5", "address": "0x5d3ca1842d0988816434ea51ca420182f3f1e31a", "amount": "0x102d2f1" } ], "withdrawalsRoot": "0x9b7ecf1ba575fc02e4b4c14bd65d5ca95c0e066adaae3fc2ef16f5acd90214d8" } } ``` # eth_getBlockReceipts Source: https://docs.moralis.com/rpc-nodes/arbitrum/eth-get-block-receipts Returns all transaction receipts for a given block. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" #### Example request `params` ```javascript theme={null} [ "0xf21d9c" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/arbitrum/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockReceipts", "params": ["0xf21d9c"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": [ { "blockHash": "0x8243343df08b9751f5ca0c5f8c9c0460d8a9b6351066fae0acbd4d3e776de8bb", "blockNumber": "0xf21d9c", "contractAddress": null, "cumulativeGasUsed": "0x5208", "effectiveGasPrice": "0x1dcd6500", "from": "0x8ba1f109551bd432803012645haca66c9834d7c6", "gasUsed": "0x5208", "logs": [], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "status": "0x1", "to": "0x95cED938F7991cd0dFcb48F0a06a40FA1aF46EBC", "transactionHash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "transactionIndex": "0x0", "type": "0x2" } ] } ``` # eth_getBlockTransactionCountByHash Source: https://docs.moralis.com/rpc-nodes/arbitrum/eth-get-block-transaction-count-by-hash Returns the number of transactions in a block from a block matching the given block hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block #### Example request `params` ```javascript theme={null} [ "0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/arbitrum/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` # eth_getBlockTransactionCountByNumber Source: https://docs.moralis.com/rpc-nodes/arbitrum/eth-get-block-transaction-count-by-number Returns the number of transactions in a block matching the given block number. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" #### Example request `params` ```javascript theme={null} [ "0xe8" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/arbitrum/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["0xe8"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` # eth_getCode Source: https://docs.moralis.com/rpc-nodes/arbitrum/eth-get-code Returns code at a given address. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address to get the code from **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x2" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/arbitrum/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getCode", "params": ["0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x2"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x600160008035811a818181146012578301005b601b6001356025565b8060005260206000f25b600060078202905091905056" } ``` # eth_getLogs Source: https://docs.moralis.com/rpc-nodes/arbitrum/eth-get-logs Returns an array of all logs matching a given filter object. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **fromBlock** `string` Integer block number, or "latest" for the last mined block or "pending", "earliest" for not yet mined transactions **toBlock** `string` Integer block number, or "latest" for the last mined block or "pending", "earliest" for not yet mined transactions **address** `string` Contract address or a list of addresses from which logs should originate **topics** `array` Array of 32 Bytes DATA topics. Topics are order-dependent **blockhash** `string` Using blockhash is equivalent to fromBlock = toBlock = the block number with hash blockhash #### Example request `params` ```javascript theme={null} [ { "fromBlock": "0x1", "toBlock": "0x2", "address": "0x8888f1f195afa192cfee860698584c030f4c9db1", "topics": [ "0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", null, [ "0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x0000000000000000000000000aff3454fce5edbc8cca8697c15331677e6ebccc" ] ] } ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/arbitrum/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getLogs", "params": [{"fromBlock": "0x1", "toBlock": "0x2", "address": "0x8888f1f195afa192cfee860698584c030f4c9db1", "topics": ["0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", null, ["0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x0000000000000000000000000aff3454fce5edbc8cca8697c15331677e6ebccc"]]}], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": [ { "logIndex": "0x1", "blockNumber": "0x1b4", "blockHash": "0x8216c5785ac562ff41e2dcfdf5785ac562ff41e2dcfdf829c5a142f1fccd7d", "transactionHash": "0xdf829c5a142f1fccd7d8216c5785ac562ff41e2dcfdf5785ac562ff41e2dcf", "transactionIndex": "0x0", "address": "0x16c5785ac562ff41e2dcfdf829c5a142f1fccd7d", "data": "0x0000000000000000000000000000000000000000000000000000000000000000", "topics": [ "0x59ebeb90bc63057b6515673c3ecf9438e5058bca0f92585014eced636878c9a5" ] } ] } ``` # eth_getProof Source: https://docs.moralis.com/rpc-nodes/arbitrum/eth-get-proof Returns the account and storage values of the specified account including the Merkle-proof. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address of the account or contract **storageKeys** `array` *required* Array of storage-keys which should be proofed and included **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842", [ "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421" ], "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/arbitrum/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getProof", "params": ["0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842", ["0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"], "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "address": "0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842", "accountProof": [ "0xf90211a090dcaf88c40c7bbc95a912cbdde67c175767b31173df9ee4b0d733bfdd511c43a0babe369f6b12092f49181ae04ca173fb68d1a5456f18d20fa32cba73954052bda0473ecf8a7e36a829e75039a3b055e51b8332cbf03324ab4af2066bbd6fbf0021fa0bbda34753d7aa6c38e603f360244e8f59611921d9e1f128372fec0d586d4f9e0a04e44caecff45c9891f74f6a2156735886eedf6f1a733628ebc802ec79d844648a0a5f3f2f7542148c973977c8a1e154c4300fec92f755f7846f1b734d3ab1d90e7a0e823850f50bf72baae9d1733a36a444ab65d0a6faaba404f0583ce0ca4dad92da0f7a00cbe7d4b30b11faea3ae61b7f1f2b315017e79a3de5ab2dc8bb46a59fdb37a09b3b8d0e0e4c1e3b2d3e8f7c6e5d4c3b2a1e0f9e8d7c6b5a4e3f2e1d0c9b8a7a0b1f8e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0a0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0a0d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a08080" ], "balance": "0x0", "codeHash": "0x5e61b0f7919ab4e6fc7cfa6f3f5f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f", "nonce": "0x0", "storageHash": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "storageProof": [ { "key": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "value": "0x1", "proof": [ "0xf90211a090dcaf88c40c7bbc95a912cbdde67c175767b31173df9ee4b0d733bfdd511c43a0babe369f6b12092f49181ae04ca173fb68d1a5456f18d20fa32cba73954052bda0473ecf8a7e36a829e75039a3b055e51b8332cbf03324ab4af2066bbd6fbf0021fa0bbda34753d7aa6c38e603f360244e8f59611921d9e1f128372fec0d586d4f9e0a04e44caecff45c9891f74f6a2156735886eedf6f1a733628ebc802ec79d844648a0a5f3f2f7542148c973977c8a1e154c4300fec92f755f7846f1b734d3ab1d90e7a0e823850f50bf72baae9d1733a36a444ab65d0a6faaba404f0583ce0ca4dad92da0f7a00cbe7d4b30b11faea3ae61b7f1f2b315017e79a3de5ab2dc8bb46a59fdb37a09b3b8d0e0e4c1e3b2d3e8f7c6e5d4c3b2a1e0f9e8d7c6b5a4e3f2e1d0c9b8a7a0b1f8e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0a0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0a0d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a08080" ] } ] } } ``` # eth_getStorageAt Source: https://docs.moralis.com/rpc-nodes/arbitrum/eth-get-storage-at Returns the value from a storage position at a given address. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address of the storage **position** `string` *required* Integer of the position in the storage **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x0", "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/arbitrum/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x0", "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x00000000000000000000000000000000000000000000000000000000000004d2" } ``` # eth_getTransactionByBlockHashAndIndex Source: https://docs.moralis.com/rpc-nodes/arbitrum/eth-get-transaction-by-block-hash-and-index Returns information about a transaction by block hash and transaction index position. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block **index** `string` *required* Integer of the transaction index position #### Example request `params` ```javascript theme={null} [ "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/arbitrum/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5daf3b", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "gas": "0xc350", "gasPrice": "0x4a817c800", "hash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "input": "0x68656c6c6f21", "nonce": "0x15", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "transactionIndex": "0x0", "value": "0xf3dbb76162000", "v": "0x25", "r": "0x1b5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5", "s": "0x5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5c5" } } ``` # eth_getTransactionByBlockNumberAndIndex Source: https://docs.moralis.com/rpc-nodes/arbitrum/eth-get-transaction-by-block-number-and-index Returns information about a transaction by block number and transaction index position. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* A block number, or the string "earliest", "latest" or "pending" **index** `string` *required* The transaction index position #### Example request `params` ```javascript theme={null} [ "0x5BAE9E", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/arbitrum/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["0x5BAE9E", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5BAE9E", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "gas": "0xc350", "gasPrice": "0x4a817c800", "hash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "input": "0x68656c6c6f21", "nonce": "0x15", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "transactionIndex": "0x0", "value": "0xf3dbb76162000", "v": "0x25", "r": "0x1b5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5", "s": "0x5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5c5" } } ``` # eth_getTransactionByHash Source: https://docs.moralis.com/rpc-nodes/arbitrum/eth-get-transaction-by-hash Returns the information about a transaction requested by transaction hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a transaction #### Example request `params` ```javascript theme={null} [ "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/arbitrum/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5daf3b", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "gas": "0xc350", "gasPrice": "0x4a817c800", "hash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "input": "0x68656c6c6f21", "nonce": "0x15", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "transactionIndex": "0x41", "value": "0xf3dbb76162000", "v": "0x25", "r": "0x1b5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5", "s": "0x5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5c5" } } ``` # eth_getTransactionCount Source: https://docs.moralis.com/rpc-nodes/arbitrum/eth-get-transaction-count Returns the number of transactions sent from an address. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address to get transaction count for **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/arbitrum/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` # eth_getTransactionReceipt Source: https://docs.moralis.com/rpc-nodes/arbitrum/eth-get-transaction-receipt Returns the receipt of a transaction by transaction hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a transaction #### Example request `params` ```javascript theme={null} [ "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/arbitrum/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "transactionHash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "transactionIndex": "0x41", "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5daf3b", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "cumulativeGasUsed": "0x33bc", "gasUsed": "0x4dc", "contractAddress": null, "logs": [], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "status": "0x1" } } ``` # eth_getUncleByBlockHashAndIndex Source: https://docs.moralis.com/rpc-nodes/arbitrum/eth-get-uncle-by-block-hash-and-index Returns information about an uncle of a block by hash and uncle index position. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block **index** `string` *required* The uncle's index position #### Example request `params` ```javascript theme={null} [ "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/arbitrum/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x027f07", "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000", "gasLimit": "0x9f759", "gasUsed": "0x9f759", "hash": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331", "logsBloom": "0x1a060020000015554c000200000003050000200017041014032020801000056020000001000a00d0020204040020012150010010000000280005000c00000000000020c0000000024008104011000080020020000001006100900000024208002000020002100000000000000080000000120080000002003c0000200000000200002010008300300001001031100100040010420000800000000014000004002000000c040200060000000080000000100000000040a2000001000061000042021080400200000410000404080800014008201000c20100500020011000000030001100100024008c80190400402008000020000c0041104218100000000000000002000800000", "miner": "0x4e65fda2159562a496f9f3522f89122a3088497a", "mixHash": "0x99e9d85137db46ef1e85fff042bb15a7b6f46618b7f600b0b4e7fb52fceafc3a", "nonce": "0xfcf4db6d9bce1b8b", "number": "0x1b4", "parentHash": "0xa057c32b6ed8eb5e006cadfad55c7e635549c6e2135c4e6c3a9d5a6a80f72c3", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0x1a7e46b37b26e0c3f67ed4de3b5d3b1ff84a2e0a5e2dcf4d4b0d34b5a22b6e3", "timestamp": "0x55ba467c", "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` # eth_getUncleByBlockNumberAndIndex Source: https://docs.moralis.com/rpc-nodes/arbitrum/eth-get-uncle-by-block-number-and-index Returns information about an uncle of a block by number and uncle index position. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* A block number, or the string "earliest", "latest" or "pending" **index** `string` *required* The uncle's index position #### Example request `params` ```javascript theme={null} [ "0x29c", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/arbitrum/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["0x29c", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x027f07", "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000", "gasLimit": "0x9f759", "gasUsed": "0x9f759", "hash": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331", "logsBloom": "0x1a060020000015554c000200000003050000200017041014032020801000056020000001000a00d0020204040020012150010010000000280005000c00000000000020c0000000024008104011000080020020000001006100900000024208002000020002100000000000000080000000120080000002003c0000200000000200002010008300300001001031100100040010420000800000000014000004002000000c040200060000000080000000100000000040a2000001000061000042021080400200000410000404080800014008201000c20100500020011000000030001100100024008c80190400402008000020000c0041104218100000000000000002000800000", "miner": "0x4e65fda2159562a496f9f3522f89122a3088497a", "mixHash": "0x99e9d85137db46ef1e85fff042bb15a7b6f46618b7f600b0b4e7fb52fceafc3a", "nonce": "0xfcf4db6d9bce1b8b", "number": "0x29c", "parentHash": "0xa057c32b6ed8eb5e006cadfad55c7e635549c6e2135c4e6c3a9d5a6a80f72c3", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0x1a7e46b37b26e0c3f67ed4de3b5d3b1ff84a2e0a5e2dcf4d4b0d34b5a22b6e3", "timestamp": "0x55ba467c", "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` # eth_getUncleCountByBlockHash Source: https://docs.moralis.com/rpc-nodes/arbitrum/eth-get-uncle-count-by-block-hash Returns the number of uncles in a block from a block matching the given block hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block #### Example request `params` ```javascript theme={null} [ "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/arbitrum/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` # eth_getUncleCountByBlockNumber Source: https://docs.moralis.com/rpc-nodes/arbitrum/eth-get-uncle-count-by-block-number Returns the number of uncles in a block from a block matching the given block number. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" #### Example request `params` ```javascript theme={null} [ "0x5BAE9E" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/arbitrum/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["0x5BAE9E"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` # eth_maxPriorityFeePerGas Source: https://docs.moralis.com/rpc-nodes/arbitrum/eth-max-priority-fee-per-gas Returns a suggestion for the max priority fee per gas for dynamic fee transactions in wei. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/arbitrum/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_maxPriorityFeePerGas", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x59682f00" } ``` # eth_sendRawTransaction Source: https://docs.moralis.com/rpc-nodes/arbitrum/eth-send-raw-transaction Submits a pre-signed transaction for broadcast to the network. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **data** `string` *required* The signed transaction data #### Example request `params` ```javascript theme={null} [ "0xf869808504e3b2928082520894f0109fc8df283027b6285cc889f5aa624eac1f55843b9aca008025a0c9cf86333bcb065d140032ecaab5d9281bde80f21b9687b3e94161de42d51895a0727a108a0b8d101465414033c3f705a9c7b826e596766046ee1183dbc8aeaa68" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/arbitrum/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["0xf869808504e3b2928082520894f0109fc8df283027b6285cc889f5aa624eac1f55843b9aca008025a0c9cf86333bcb065d140032ecaab5d9281bde80f21b9687b3e94161de42d51895a0727a108a0b8d101465414033c3f705a9c7b826e596766046ee1183dbc8aeaa68"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" } ``` # Overview Source: https://docs.moralis.com/rpc-nodes/arbitrum/overview Explore Arbitrum JSON-RPC methods ## Introduction Arbitrum is a Layer 2 scaling solution for Ethereum that leverages optimistic rollups to improve transaction speed and reduce fees. By bundling multiple transactions together and posting them on the Ethereum main chain, Arbitrum significantly enhances the throughput while retaining the security of Ethereum. Arbitrum is ideal for decentralized finance (DeFi) applications and developers seeking fast and affordable Ethereum-compatible solutions. ## Supported Networks The Arbitrum RPC API is available for the following networks: 1. **Arbitrum Mainnet** 2. **Arbitrum Sepolia Testnet** ## Network Details | **Network** | **Chain ID** | **Path Parameter** | | :- | :- | :- | | **Arbitrum Mainnet** | 0xa4b1 (42161) | `arbitrum` | | **Arbitrum Sepolia** | 0x66eee (421614) | `arbitrum-sepolia` | ## Supported RPC Methods * [eth\_blockNumber](/rpc-nodes/arbitrum/eth-blockNumber) * [eth\_call](/rpc-nodes/arbitrum/eth-call) * [eth\_chainId](/rpc-nodes/arbitrum/eth-chain-id) * [eth\_createAccessList](/rpc-nodes/arbitrum/eth-create-access-list) * [eth\_estimateGas](/rpc-nodes/arbitrum/eth-estimate-gas) * [eth\_feeHistory](/rpc-nodes/arbitrum/eth-fee-history) * [eth\_gasPrice](/rpc-nodes/arbitrum/eth-gas-price) * [eth\_getBalance](/rpc-nodes/arbitrum/eth-get-balance) * [eth\_getBlockByHash](/rpc-nodes/arbitrum/eth-get-block-by-hash) * [eth\_getBlockByNumber](/rpc-nodes/arbitrum/eth-get-block-by-number) * [eth\_getBlockTransactionCountByHash](/rpc-nodes/arbitrum/eth-get-block-transaction-count-by-hash) * [eth\_getBlockTransactionCountByNumber](/rpc-nodes/arbitrum/eth-get-block-transaction-count-by-number) * [eth\_getBlockReceipts](/rpc-nodes/arbitrum/eth-get-block-receipts) * [eth\_getCode](/rpc-nodes/arbitrum/eth-get-code) * [eth\_getLogs](/streams/api-reference/history/get-logs) * [eth\_getProof](/rpc-nodes/arbitrum/eth-get-proof) * [eth\_getStorageAt](/rpc-nodes/arbitrum/eth-get-storage-at) * [eth\_getTransactionByHash](/rpc-nodes/arbitrum/eth-get-transaction-by-hash) * [eth\_getTransactionByBlockHashAndIndex](/rpc-nodes/arbitrum/eth-get-transaction-by-block-hash-and-index) * [eth\_getTransactionByBlockNumberAndIndex](/rpc-nodes/arbitrum/eth-get-transaction-by-block-number-and-index) * [eth\_getTransactionCount](/rpc-nodes/arbitrum/eth-get-transaction-count) * [eth\_getTransactionReceipt](/rpc-nodes/arbitrum/eth-get-transaction-receipt) * [eth\_getUncleByBlockHashAndIndex](/rpc-nodes/arbitrum/eth-get-uncle-by-block-hash-and-index) * [eth\_getUncleByBlockNumberAndIndex](/rpc-nodes/arbitrum/eth-get-uncle-by-block-number-and-index) * [eth\_getUncleCountByBlockHash](/rpc-nodes/arbitrum/eth-get-uncle-count-by-block-hash) * [eth\_getUncleCountByBlockNumber](/rpc-nodes/arbitrum/eth-get-uncle-count-by-block-number) * [eth\_maxPriorityFeePerGas](/rpc-nodes/arbitrum/eth-max-priority-fee-per-gas) * [eth\_sendRawTransaction](/rpc-nodes/arbitrum/eth-send-raw-transaction) # eth_blockNumber Source: https://docs.moralis.com/rpc-nodes/avalanche/eth-blockNumber Returns the number of most recent block. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request body No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/avalanche/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x4b7" } ``` # eth_call Source: https://docs.moralis.com/rpc-nodes/avalanche/eth-call Executes a new message call immediately without creating a transaction on the blockchain. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **from** `string` The address the transaction is sent from **to** `string` *required* The address the transaction is directed to **gas** `string` Integer of the gas provided for the transaction execution **gasPrice** `string` Integer of the gasPrice used for each paid gas **value** `string` Integer of the value sent with this transaction **data** `string` Hash of the method signature and encoded parameters **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ { "from": "0x0000000000000000000000000000000000000000", "to": "0x0000000000000000000000000000000000000000", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0x" }, "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/avalanche/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_call", "params": [{"from": "0xb60e8dd61c5d32be8058bb8eb970870f07233155", "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"}, "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x15536ee" } ``` # eth_chainId Source: https://docs.moralis.com/rpc-nodes/avalanche/eth-chain-id Returns the chain ID of the current connected node as described in EIP-695. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request body No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/avalanche/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_chainId", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` # eth_createAccessList Source: https://docs.moralis.com/rpc-nodes/avalanche/eth-create-access-list Creates an access list that you can include in a transaction. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **from** `string` The address the transaction is sent from **to** `string` The address the transaction is directed to **gas** `string` Integer of the gas provided for the transaction execution **gasPrice** `string` Integer of the gasPrice used for each paid gas **maxPriorityFeePerGas** `string` Maximum fee per gas the sender is willing to pay to miners **maxFeePerGas** `string` Maximum total fee per gas the sender is willing to pay **value** `string` Integer of the value sent with this transaction **data** `string` Hash of the method signature and encoded parameters **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ { "from": "0x8ba1f109551bd432803012645haca66c9834d7c6", "to": "0x6b175474e89094c44da98b954eedeac495271d0f", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0xa9059cbb0000000000000000000000008ba1f109551bd432803012645haca66c9834d7c60000000000000000000000000000000000000000000000000de0b6b3a7640000" }, "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/avalanche/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_createAccessList", "params": [{"from": "0x8ba1f109551bd432803012645haca66c9834d7c6", "to": "0x6b175474e89094c44da98b954eedeac495271d0f", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0xa9059cbb0000000000000000000000008ba1f109551bd432803012645haca66c9834d7c60000000000000000000000000000000000000000000000000de0b6b3a7640000"}, "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "accessList": [ { "address": "0x6b175474e89094c44da98b954eedeac495271d0f", "storageKeys": [ "0x0000000000000000000000000000000000000000000000000000000000000000" ] } ], "gasUsed": "0x7671" } } ``` # eth_estimateGas Source: https://docs.moralis.com/rpc-nodes/avalanche/eth-estimate-gas Generates and returns an estimate of how much gas is necessary to allow the transaction to complete. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **from** `string` The address the transaction is sent from **to** `string` The address the transaction is directed to **gas** `string` Integer of the gas provided for the transaction execution **gasPrice** `string` Integer of the gasPrice used for each paid gas **value** `string` Integer of the value sent with this transaction **data** `string` Hash of the method signature and encoded parameters **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ { "from": "0x8D97689C9818892B700e27F316cc3E41e17fBeb9", "to": "0xd3CdA913deB6f67967B99D67aCDFa1712C293601", "value": "0x186a0" }, "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/avalanche/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_estimateGas", "params": [{"from": "0x8D97689C9818892B700e27F316cc3E41e17fBeb9", "to": "0xd3CdA913deB6f67967B99D67aCDFa1712C293601", "value": "0x186a0"}, "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x5208" } ``` # eth_feeHistory Source: https://docs.moralis.com/rpc-nodes/avalanche/eth-fee-history Returns historical gas information for a range of blocks. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockCount** `string` *required* Number of blocks in the requested range **newestBlock** `string` *required* Highest number block of the requested range **rewardPercentiles** `array` Array of percentile values to sample from each block's effective priority fees per gas #### Example request `params` ```javascript theme={null} [ "0x4", "latest", [25, 75] ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/avalanche/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_feeHistory", "params": ["0x4", "latest", [25, 75]], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": [ "0x7", "0x7", "0x7", "0x7", "0x7" ], "gasUsedRatio": [ 0.026089875, 0.406803, 0.010817, 0.5 ], "baseFeePerBlobGas": [ "0x3319eb", "0x350c54", "0x364072", "0x364072", "0x32279d" ], "blobGasUsedRatio": [ 0.47619047619047616, 0.2857142857142857, 0, 0.3333333333333333 ], "oldestBlock": "0x11b9231", "reward": [ ["0x4a817c800", "0x4a817c800"], ["0x773593c0", "0x773593c0"], ["0x0", "0x0"], ["0x0", "0x0"] ] } } ``` # eth_gasPrice Source: https://docs.moralis.com/rpc-nodes/avalanche/eth-gas-price Returns the current price per gas in wei. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/avalanche/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x09184e72a000" } ``` # eth_getBalance Source: https://docs.moralis.com/rpc-nodes/avalanche/eth-get-balance Returns the balance of the account of given address. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address to check for balance **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/avalanche/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0234c8a3397aab58" } ``` # eth_getBlockByHash Source: https://docs.moralis.com/rpc-nodes/avalanche/eth-get-block-by-hash Returns information about a block by hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block **fullTransactionObjects** `boolean` *required* If true it returns the full transaction objects, if false only the hashes of the transactions #### Example request `params` ```javascript theme={null} [ "0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c", false ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/avalanche/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c", false], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x3319bb0", "blobGasUsed": "0x120000", "difficulty": "0x0", "excessBlobGas": "0xa576243", "extraData": "0xe29ca82051756173617220287175617361722e77696e2920e29ca8", "gasLimit": "0x3938700", "gasUsed": "0x2965eaa", "hash": "0xc319ec0da50d354ce425b63fb6914a42aafdb9ee9807518edd595809e25fbe38", "logsBloom": "0x7feeeb37793b4fdfff7ab7aefde2d7fdfff9575bfef5bdff3fb97bfef7bcddbbdf9d55e77fdf7ead7b98ffd9bb6fefff7e77b163bf9eeebdddd1ffbf376cfbeb7efffef83ffbe9eb7ff7776ab3dcf8bfee7ebaddfffdf7fe3fffdf6ed3f7dff77cf2fd7efffff7a19ef7ffbbe3e8befdb7fff76b6ed6e7ffceeb99ff7eeb5efebfff3fff7da1fb39f9fff3fd7f3f77b6dd0bed39f5fff3bfa7fbbce7f9f6ec6e0fff50bfe7f9f79efff35ff6d93fecfefbffdaf7b7eff35ec6ff42fe7e6f77f7deff7eff57f6aafa597feebdffff7bbd677e27ffbfadfdf57f7e7d2aeeffffff6676ffa7f3f375eb95eecf9ffa235cbfcdefafbf8feed9dc7b56ff2fdfedfefe", "miner": "0x396343362be2a4da1ce0c1c210945346fb82aa49", "mixHash": "0x07444bb5750f746e200e1dcd8d83221b26576d3357b833cc1e434e7966d0e774", "nonce": "0x0000000000000000", "number": "0x1736791", "parentBeaconBlockRoot": "0x2759f248e2d1cb1a2f5c2657c4efcc623dd8ea7f23e8700162e7fccdacedfd5d", "parentHash": "0xdf0e4dee910167d7b1687a6cb677983ce7ed351ae78ab7e2c5ba39d793c80391", "receiptsRoot": "0x5f1c58e498161509245daad0f60319d9abab7f04d2ca60e99a3674cfdc9b8327", "requestsHash": "0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x1ef1e", "stateRoot": "0x728c7e38107037b573d719e67b6872ee3ca4e01b47818598316cd696bfe24f2c", "timestamp": "0x697b4bcb", "transactions": [ "0xbf7bd0cf98c3b65525f1f7267b1d02e7ccd7cd133b137f46723a91cf187616d5", "0x06ac9281da76d530aa19600e2c34aae7564a78702d3eb52b1fb363985473e296" ], "transactionsRoot": "0xa8c680f6ad8ccc7a49db5ab76cbd9194c88e16dbcfa440104f7787e5ba815c4f", "uncles": [], "withdrawals": [ { "index": "0x6f78bfb", "validatorIndex": "0x955f5", "address": "0x5d3ca1842d0988816434ea51ca420182f3f1e31a", "amount": "0x102d2f1" } ], "withdrawalsRoot": "0x9b7ecf1ba575fc02e4b4c14bd65d5ca95c0e066adaae3fc2ef16f5acd90214d8" } } ``` # eth_getBlockByNumber Source: https://docs.moralis.com/rpc-nodes/avalanche/eth-get-block-by-number Returns information about a block by block number. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" **fullTransactionObjects** `boolean` *required* If true it returns the full transaction objects, if false only the hashes of the transactions #### Example request `params` ```javascript theme={null} [ "0x1b4", true ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/avalanche/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["0x1b4", true], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x3319bb0", "blobGasUsed": "0x120000", "difficulty": "0x0", "excessBlobGas": "0xa576243", "extraData": "0xe29ca82051756173617220287175617361722e77696e2920e29ca8", "gasLimit": "0x3938700", "gasUsed": "0x2965eaa", "hash": "0xc319ec0da50d354ce425b63fb6914a42aafdb9ee9807518edd595809e25fbe38", "logsBloom": "0x7feeeb37793b4fdfff7ab7aefde2d7fdfff9575bfef5bdff3fb97bfef7bcddbbdf9d55e77fdf7ead7b98ffd9bb6fefff7e77b163bf9eeebdddd1ffbf376cfbeb7efffef83ffbe9eb7ff7776ab3dcf8bfee7ebaddfffdf7fe3fffdf6ed3f7dff77cf2fd7efffff7a19ef7ffbbe3e8befdb7fff76b6ed6e7ffceeb99ff7eeb5efebfff3fff7da1fb39f9fff3fd7f3f77b6dd0bed39f5fff3bfa7fbbce7f9f6ec6e0fff50bfe7f9f79efff35ff6d93fecfefbffdaf7b7eff35ec6ff42fe7e6f77f7deff7eff57f6aafa597feebdffff7bbd677e27ffbfadfdf57f7e7d2aeeffffff6676ffa7f3f375eb95eecf9ffa235cbfcdefafbf8feed9dc7b56ff2fdfedfefe", "miner": "0x396343362be2a4da1ce0c1c210945346fb82aa49", "mixHash": "0x07444bb5750f746e200e1dcd8d83221b26576d3357b833cc1e434e7966d0e774", "nonce": "0x0000000000000000", "number": "0x1736791", "parentBeaconBlockRoot": "0x2759f248e2d1cb1a2f5c2657c4efcc623dd8ea7f23e8700162e7fccdacedfd5d", "parentHash": "0xdf0e4dee910167d7b1687a6cb677983ce7ed351ae78ab7e2c5ba39d793c80391", "receiptsRoot": "0x5f1c58e498161509245daad0f60319d9abab7f04d2ca60e99a3674cfdc9b8327", "requestsHash": "0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x1ef1e", "stateRoot": "0x728c7e38107037b573d719e67b6872ee3ca4e01b47818598316cd696bfe24f2c", "timestamp": "0x697b4bcb", "transactions": [ "0xbf7bd0cf98c3b65525f1f7267b1d02e7ccd7cd133b137f46723a91cf187616d5", "0x06ac9281da76d530aa19600e2c34aae7564a78702d3eb52b1fb363985473e296" ], "transactionsRoot": "0xa8c680f6ad8ccc7a49db5ab76cbd9194c88e16dbcfa440104f7787e5ba815c4f", "uncles": [], "withdrawals": [ { "index": "0x6f78bfb", "validatorIndex": "0x955f5", "address": "0x5d3ca1842d0988816434ea51ca420182f3f1e31a", "amount": "0x102d2f1" } ], "withdrawalsRoot": "0x9b7ecf1ba575fc02e4b4c14bd65d5ca95c0e066adaae3fc2ef16f5acd90214d8" } } ``` # eth_getBlockReceipts Source: https://docs.moralis.com/rpc-nodes/avalanche/eth-get-block-receipts Returns all transaction receipts for a given block. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" #### Example request `params` ```javascript theme={null} [ "0xf21d9c" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/avalanche/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockReceipts", "params": ["0xf21d9c"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": [ { "blockHash": "0x8243343df08b9751f5ca0c5f8c9c0460d8a9b6351066fae0acbd4d3e776de8bb", "blockNumber": "0xf21d9c", "contractAddress": null, "cumulativeGasUsed": "0x5208", "effectiveGasPrice": "0x1dcd6500", "from": "0x8ba1f109551bd432803012645haca66c9834d7c6", "gasUsed": "0x5208", "logs": [], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "status": "0x1", "to": "0x95cED938F7991cd0dFcb48F0a06a40FA1aF46EBC", "transactionHash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "transactionIndex": "0x0", "type": "0x2" } ] } ``` # eth_getBlockTransactionCountByHash Source: https://docs.moralis.com/rpc-nodes/avalanche/eth-get-block-transaction-count-by-hash Returns the number of transactions in a block from a block matching the given block hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block #### Example request `params` ```javascript theme={null} [ "0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/avalanche/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` # eth_getBlockTransactionCountByNumber Source: https://docs.moralis.com/rpc-nodes/avalanche/eth-get-block-transaction-count-by-number Returns the number of transactions in a block matching the given block number. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" #### Example request `params` ```javascript theme={null} [ "0xe8" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/avalanche/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["0xe8"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` # eth_getCode Source: https://docs.moralis.com/rpc-nodes/avalanche/eth-get-code Returns code at a given address. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address to get the code from **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x2" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/avalanche/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getCode", "params": ["0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x2"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x600160008035811a818181146012578301005b601b6001356025565b8060005260206000f25b600060078202905091905056" } ``` # eth_getLogs Source: https://docs.moralis.com/rpc-nodes/avalanche/eth-get-logs Returns an array of all logs matching a given filter object. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **fromBlock** `string` Integer block number, or "latest" for the last mined block or "pending", "earliest" for not yet mined transactions **toBlock** `string` Integer block number, or "latest" for the last mined block or "pending", "earliest" for not yet mined transactions **address** `string` Contract address or a list of addresses from which logs should originate **topics** `array` Array of 32 Bytes DATA topics. Topics are order-dependent **blockhash** `string` Using blockhash is equivalent to fromBlock = toBlock = the block number with hash blockhash #### Example request `params` ```javascript theme={null} [ { "fromBlock": "0x1", "toBlock": "0x2", "address": "0x8888f1f195afa192cfee860698584c030f4c9db1", "topics": [ "0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", null, [ "0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x0000000000000000000000000aff3454fce5edbc8cca8697c15331677e6ebccc" ] ] } ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/avalanche/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getLogs", "params": [{"fromBlock": "0x1", "toBlock": "0x2", "address": "0x8888f1f195afa192cfee860698584c030f4c9db1", "topics": ["0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", null, ["0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x0000000000000000000000000aff3454fce5edbc8cca8697c15331677e6ebccc"]]}], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": [ { "logIndex": "0x1", "blockNumber": "0x1b4", "blockHash": "0x8216c5785ac562ff41e2dcfdf5785ac562ff41e2dcfdf829c5a142f1fccd7d", "transactionHash": "0xdf829c5a142f1fccd7d8216c5785ac562ff41e2dcfdf5785ac562ff41e2dcf", "transactionIndex": "0x0", "address": "0x16c5785ac562ff41e2dcfdf829c5a142f1fccd7d", "data": "0x0000000000000000000000000000000000000000000000000000000000000000", "topics": [ "0x59ebeb90bc63057b6515673c3ecf9438e5058bca0f92585014eced636878c9a5" ] } ] } ``` # eth_getProof Source: https://docs.moralis.com/rpc-nodes/avalanche/eth-get-proof Returns the account and storage values of the specified account including the Merkle-proof. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address of the account or contract **storageKeys** `array` *required* Array of storage-keys which should be proofed and included **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842", [ "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421" ], "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/avalanche/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getProof", "params": ["0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842", ["0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"], "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "address": "0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842", "accountProof": [ "0xf90211a090dcaf88c40c7bbc95a912cbdde67c175767b31173df9ee4b0d733bfdd511c43a0babe369f6b12092f49181ae04ca173fb68d1a5456f18d20fa32cba73954052bda0473ecf8a7e36a829e75039a3b055e51b8332cbf03324ab4af2066bbd6fbf0021fa0bbda34753d7aa6c38e603f360244e8f59611921d9e1f128372fec0d586d4f9e0a04e44caecff45c9891f74f6a2156735886eedf6f1a733628ebc802ec79d844648a0a5f3f2f7542148c973977c8a1e154c4300fec92f755f7846f1b734d3ab1d90e7a0e823850f50bf72baae9d1733a36a444ab65d0a6faaba404f0583ce0ca4dad92da0f7a00cbe7d4b30b11faea3ae61b7f1f2b315017e79a3de5ab2dc8bb46a59fdb37a09b3b8d0e0e4c1e3b2d3e8f7c6e5d4c3b2a1e0f9e8d7c6b5a4e3f2e1d0c9b8a7a0b1f8e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0a0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0a0d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a08080" ], "balance": "0x0", "codeHash": "0x5e61b0f7919ab4e6fc7cfa6f3f5f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f", "nonce": "0x0", "storageHash": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "storageProof": [ { "key": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "value": "0x1", "proof": [ "0xf90211a090dcaf88c40c7bbc95a912cbdde67c175767b31173df9ee4b0d733bfdd511c43a0babe369f6b12092f49181ae04ca173fb68d1a5456f18d20fa32cba73954052bda0473ecf8a7e36a829e75039a3b055e51b8332cbf03324ab4af2066bbd6fbf0021fa0bbda34753d7aa6c38e603f360244e8f59611921d9e1f128372fec0d586d4f9e0a04e44caecff45c9891f74f6a2156735886eedf6f1a733628ebc802ec79d844648a0a5f3f2f7542148c973977c8a1e154c4300fec92f755f7846f1b734d3ab1d90e7a0e823850f50bf72baae9d1733a36a444ab65d0a6faaba404f0583ce0ca4dad92da0f7a00cbe7d4b30b11faea3ae61b7f1f2b315017e79a3de5ab2dc8bb46a59fdb37a09b3b8d0e0e4c1e3b2d3e8f7c6e5d4c3b2a1e0f9e8d7c6b5a4e3f2e1d0c9b8a7a0b1f8e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0a0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0a0d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a08080" ] } ] } } ``` # eth_getStorageAt Source: https://docs.moralis.com/rpc-nodes/avalanche/eth-get-storage-at Returns the value from a storage position at a given address. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address of the storage **position** `string` *required* Integer of the position in the storage **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x0", "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/avalanche/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x0", "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x00000000000000000000000000000000000000000000000000000000000004d2" } ``` # eth_getTransactionByBlockHashAndIndex Source: https://docs.moralis.com/rpc-nodes/avalanche/eth-get-transaction-by-block-hash-and-index Returns information about a transaction by block hash and transaction index position. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block **index** `string` *required* Integer of the transaction index position #### Example request `params` ```javascript theme={null} [ "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/avalanche/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5daf3b", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "gas": "0xc350", "gasPrice": "0x4a817c800", "hash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "input": "0x68656c6c6f21", "nonce": "0x15", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "transactionIndex": "0x0", "value": "0xf3dbb76162000", "v": "0x25", "r": "0x1b5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5", "s": "0x5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5c5" } } ``` # eth_getTransactionByBlockNumberAndIndex Source: https://docs.moralis.com/rpc-nodes/avalanche/eth-get-transaction-by-block-number-and-index Returns information about a transaction by block number and transaction index position. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* A block number, or the string "earliest", "latest" or "pending" **index** `string` *required* The transaction index position #### Example request `params` ```javascript theme={null} [ "0x5BAE9E", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/avalanche/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["0x5BAE9E", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5BAE9E", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "gas": "0xc350", "gasPrice": "0x4a817c800", "hash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "input": "0x68656c6c6f21", "nonce": "0x15", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "transactionIndex": "0x0", "value": "0xf3dbb76162000", "v": "0x25", "r": "0x1b5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5", "s": "0x5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5c5" } } ``` # eth_getTransactionByHash Source: https://docs.moralis.com/rpc-nodes/avalanche/eth-get-transaction-by-hash Returns the information about a transaction requested by transaction hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a transaction #### Example request `params` ```javascript theme={null} [ "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/avalanche/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5daf3b", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "gas": "0xc350", "gasPrice": "0x4a817c800", "hash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "input": "0x68656c6c6f21", "nonce": "0x15", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "transactionIndex": "0x41", "value": "0xf3dbb76162000", "v": "0x25", "r": "0x1b5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5", "s": "0x5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5c5" } } ``` # eth_getTransactionCount Source: https://docs.moralis.com/rpc-nodes/avalanche/eth-get-transaction-count Returns the number of transactions sent from an address. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address to get transaction count for **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/avalanche/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` # eth_getTransactionReceipt Source: https://docs.moralis.com/rpc-nodes/avalanche/eth-get-transaction-receipt Returns the receipt of a transaction by transaction hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a transaction #### Example request `params` ```javascript theme={null} [ "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/avalanche/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "transactionHash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "transactionIndex": "0x41", "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5daf3b", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "cumulativeGasUsed": "0x33bc", "gasUsed": "0x4dc", "contractAddress": null, "logs": [], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "status": "0x1" } } ``` # eth_getUncleByBlockHashAndIndex Source: https://docs.moralis.com/rpc-nodes/avalanche/eth-get-uncle-by-block-hash-and-index Returns information about an uncle of a block by hash and uncle index position. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block **index** `string` *required* The uncle's index position #### Example request `params` ```javascript theme={null} [ "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/avalanche/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x027f07", "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000", "gasLimit": "0x9f759", "gasUsed": "0x9f759", "hash": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331", "logsBloom": "0x1a060020000015554c000200000003050000200017041014032020801000056020000001000a00d0020204040020012150010010000000280005000c00000000000020c0000000024008104011000080020020000001006100900000024208002000020002100000000000000080000000120080000002003c0000200000000200002010008300300001001031100100040010420000800000000014000004002000000c040200060000000080000000100000000040a2000001000061000042021080400200000410000404080800014008201000c20100500020011000000030001100100024008c80190400402008000020000c0041104218100000000000000002000800000", "miner": "0x4e65fda2159562a496f9f3522f89122a3088497a", "mixHash": "0x99e9d85137db46ef1e85fff042bb15a7b6f46618b7f600b0b4e7fb52fceafc3a", "nonce": "0xfcf4db6d9bce1b8b", "number": "0x1b4", "parentHash": "0xa057c32b6ed8eb5e006cadfad55c7e635549c6e2135c4e6c3a9d5a6a80f72c3", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0x1a7e46b37b26e0c3f67ed4de3b5d3b1ff84a2e0a5e2dcf4d4b0d34b5a22b6e3", "timestamp": "0x55ba467c", "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` # eth_getUncleByBlockNumberAndIndex Source: https://docs.moralis.com/rpc-nodes/avalanche/eth-get-uncle-by-block-number-and-index Returns information about an uncle of a block by number and uncle index position. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* A block number, or the string "earliest", "latest" or "pending" **index** `string` *required* The uncle's index position #### Example request `params` ```javascript theme={null} [ "0x29c", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/avalanche/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["0x29c", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x027f07", "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000", "gasLimit": "0x9f759", "gasUsed": "0x9f759", "hash": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331", "logsBloom": "0x1a060020000015554c000200000003050000200017041014032020801000056020000001000a00d0020204040020012150010010000000280005000c00000000000020c0000000024008104011000080020020000001006100900000024208002000020002100000000000000080000000120080000002003c0000200000000200002010008300300001001031100100040010420000800000000014000004002000000c040200060000000080000000100000000040a2000001000061000042021080400200000410000404080800014008201000c20100500020011000000030001100100024008c80190400402008000020000c0041104218100000000000000002000800000", "miner": "0x4e65fda2159562a496f9f3522f89122a3088497a", "mixHash": "0x99e9d85137db46ef1e85fff042bb15a7b6f46618b7f600b0b4e7fb52fceafc3a", "nonce": "0xfcf4db6d9bce1b8b", "number": "0x29c", "parentHash": "0xa057c32b6ed8eb5e006cadfad55c7e635549c6e2135c4e6c3a9d5a6a80f72c3", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0x1a7e46b37b26e0c3f67ed4de3b5d3b1ff84a2e0a5e2dcf4d4b0d34b5a22b6e3", "timestamp": "0x55ba467c", "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` # eth_getUncleCountByBlockHash Source: https://docs.moralis.com/rpc-nodes/avalanche/eth-get-uncle-count-by-block-hash Returns the number of uncles in a block from a block matching the given block hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block #### Example request `params` ```javascript theme={null} [ "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/avalanche/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` # eth_getUncleCountByBlockNumber Source: https://docs.moralis.com/rpc-nodes/avalanche/eth-get-uncle-count-by-block-number Returns the number of uncles in a block from a block matching the given block number. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" #### Example request `params` ```javascript theme={null} [ "0x5BAE9E" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/avalanche/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["0x5BAE9E"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` # eth_maxPriorityFeePerGas Source: https://docs.moralis.com/rpc-nodes/avalanche/eth-max-priority-fee-per-gas Returns a suggestion for the max priority fee per gas for dynamic fee transactions in wei. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/avalanche/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_maxPriorityFeePerGas", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x59682f00" } ``` # eth_sendRawTransaction Source: https://docs.moralis.com/rpc-nodes/avalanche/eth-send-raw-transaction Submits a pre-signed transaction for broadcast to the network. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **data** `string` *required* The signed transaction data #### Example request `params` ```javascript theme={null} [ "0xf869808504e3b2928082520894f0109fc8df283027b6285cc889f5aa624eac1f55843b9aca008025a0c9cf86333bcb065d140032ecaab5d9281bde80f21b9687b3e94161de42d51895a0727a108a0b8d101465414033c3f705a9c7b826e596766046ee1183dbc8aeaa68" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/avalanche/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["0xf869808504e3b2928082520894f0109fc8df283027b6285cc889f5aa624eac1f55843b9aca008025a0c9cf86333bcb065d140032ecaab5d9281bde80f21b9687b3e94161de42d51895a0727a108a0b8d101465414033c3f705a9c7b826e596766046ee1183dbc8aeaa68"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" } ``` # Overview Source: https://docs.moralis.com/rpc-nodes/avalanche/overview Explore Avalanche JSON-RPC methods ## Introduction Avalanche is an open-source platform for launching decentralized applications (dApps) and enterprise blockchain deployments in one interoperable, highly scalable ecosystem. Known for its high throughput, low latency, and security, Avalanche achieves near-instant finality and offers compatibility with the Ethereum Virtual Machine (EVM). It is widely used for decentralized finance (DeFi), NFTs, and gaming applications. ## Supported Networks The Avalanche RPC API is available for the following network: 1. **Avalanche Mainnet** ## Network Details | **Network** | **Chain ID** | **Path Parameter** | | :- | :- | :- | | **Avalanche Mainnet** | 0xa86a (43114) | `avalanche` | ## Supported RPC Methods * [eth\_blockNumber](/rpc-nodes/avalanche/eth-blockNumber) * [eth\_call](/rpc-nodes/avalanche/eth-call) * [eth\_chainId](/rpc-nodes/avalanche/eth-chain-id) * [eth\_createAccessList](/rpc-nodes/avalanche/eth-create-access-list) * [eth\_estimateGas](/rpc-nodes/avalanche/eth-estimate-gas) * [eth\_feeHistory](/rpc-nodes/avalanche/eth-fee-history) * [eth\_gasPrice](/rpc-nodes/avalanche/eth-gas-price) * [eth\_getBalance](/rpc-nodes/avalanche/eth-get-balance) * [eth\_getBlockByHash](/rpc-nodes/avalanche/eth-get-block-by-hash) * [eth\_getBlockByNumber](/rpc-nodes/avalanche/eth-get-block-by-number) * [eth\_getBlockTransactionCountByHash](/rpc-nodes/avalanche/eth-get-block-transaction-count-by-hash) * [eth\_getBlockTransactionCountByNumber](/rpc-nodes/avalanche/eth-get-block-transaction-count-by-number) * [eth\_getBlockReceipts](/rpc-nodes/avalanche/eth-get-block-receipts) * [eth\_getCode](/rpc-nodes/avalanche/eth-get-code) * [eth\_getLogs](/streams/api-reference/history/get-logs) * [eth\_getProof](/rpc-nodes/avalanche/eth-get-proof) * [eth\_getStorageAt](/rpc-nodes/avalanche/eth-get-storage-at) * [eth\_getTransactionByHash](/rpc-nodes/avalanche/eth-get-transaction-by-hash) * [eth\_getTransactionByBlockHashAndIndex](/rpc-nodes/avalanche/eth-get-transaction-by-block-hash-and-index) * [eth\_getTransactionByBlockNumberAndIndex](/rpc-nodes/avalanche/eth-get-transaction-by-block-number-and-index) * [eth\_getTransactionCount](/rpc-nodes/avalanche/eth-get-transaction-count) * [eth\_getTransactionReceipt](/rpc-nodes/avalanche/eth-get-transaction-receipt) * [eth\_getUncleByBlockHashAndIndex](/rpc-nodes/avalanche/eth-get-uncle-by-block-hash-and-index) * [eth\_getUncleByBlockNumberAndIndex](/rpc-nodes/avalanche/eth-get-uncle-by-block-number-and-index) * [eth\_getUncleCountByBlockHash](/rpc-nodes/avalanche/eth-get-uncle-count-by-block-hash) * [eth\_getUncleCountByBlockNumber](/rpc-nodes/avalanche/eth-get-uncle-count-by-block-number) * [eth\_maxPriorityFeePerGas](/rpc-nodes/avalanche/eth-max-priority-fee-per-gas) * [eth\_sendRawTransaction](/rpc-nodes/avalanche/eth-send-raw-transaction) # eth_blockNumber Source: https://docs.moralis.com/rpc-nodes/base/eth-blockNumber Returns the number of most recent block. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request body No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/base/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x4b7" } ``` # eth_call Source: https://docs.moralis.com/rpc-nodes/base/eth-call Executes a new message call immediately without creating a transaction on the blockchain. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **from** `string` The address the transaction is sent from **to** `string` *required* The address the transaction is directed to **gas** `string` Integer of the gas provided for the transaction execution **gasPrice** `string` Integer of the gasPrice used for each paid gas **value** `string` Integer of the value sent with this transaction **data** `string` Hash of the method signature and encoded parameters **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ { "from": "0x0000000000000000000000000000000000000000", "to": "0x0000000000000000000000000000000000000000", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0x" }, "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/base/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_call", "params": [{"from": "0xb60e8dd61c5d32be8058bb8eb970870f07233155", "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"}, "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x15536ee" } ``` # eth_chainId Source: https://docs.moralis.com/rpc-nodes/base/eth-chain-id Returns the chain ID of the current connected node as described in EIP-695. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request body No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/base/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_chainId", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` # eth_createAccessList Source: https://docs.moralis.com/rpc-nodes/base/eth-create-access-list Creates an access list that you can include in a transaction. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **from** `string` The address the transaction is sent from **to** `string` The address the transaction is directed to **gas** `string` Integer of the gas provided for the transaction execution **gasPrice** `string` Integer of the gasPrice used for each paid gas **maxPriorityFeePerGas** `string` Maximum fee per gas the sender is willing to pay to miners **maxFeePerGas** `string` Maximum total fee per gas the sender is willing to pay **value** `string` Integer of the value sent with this transaction **data** `string` Hash of the method signature and encoded parameters **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ { "from": "0x8ba1f109551bd432803012645haca66c9834d7c6", "to": "0x6b175474e89094c44da98b954eedeac495271d0f", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0xa9059cbb0000000000000000000000008ba1f109551bd432803012645haca66c9834d7c60000000000000000000000000000000000000000000000000de0b6b3a7640000" }, "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/base/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_createAccessList", "params": [{"from": "0x8ba1f109551bd432803012645haca66c9834d7c6", "to": "0x6b175474e89094c44da98b954eedeac495271d0f", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0xa9059cbb0000000000000000000000008ba1f109551bd432803012645haca66c9834d7c60000000000000000000000000000000000000000000000000de0b6b3a7640000"}, "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "accessList": [ { "address": "0x6b175474e89094c44da98b954eedeac495271d0f", "storageKeys": [ "0x0000000000000000000000000000000000000000000000000000000000000000" ] } ], "gasUsed": "0x7671" } } ``` # eth_estimateGas Source: https://docs.moralis.com/rpc-nodes/base/eth-estimate-gas Generates and returns an estimate of how much gas is necessary to allow the transaction to complete. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **from** `string` The address the transaction is sent from **to** `string` The address the transaction is directed to **gas** `string` Integer of the gas provided for the transaction execution **gasPrice** `string` Integer of the gasPrice used for each paid gas **value** `string` Integer of the value sent with this transaction **data** `string` Hash of the method signature and encoded parameters **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ { "from": "0x8D97689C9818892B700e27F316cc3E41e17fBeb9", "to": "0xd3CdA913deB6f67967B99D67aCDFa1712C293601", "value": "0x186a0" }, "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/base/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_estimateGas", "params": [{"from": "0x8D97689C9818892B700e27F316cc3E41e17fBeb9", "to": "0xd3CdA913deB6f67967B99D67aCDFa1712C293601", "value": "0x186a0"}, "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x5208" } ``` # eth_feeHistory Source: https://docs.moralis.com/rpc-nodes/base/eth-fee-history Returns historical gas information for a range of blocks. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockCount** `string` *required* Number of blocks in the requested range **newestBlock** `string` *required* Highest number block of the requested range **rewardPercentiles** `array` Array of percentile values to sample from each block's effective priority fees per gas #### Example request `params` ```javascript theme={null} [ "0x4", "latest", [25, 75] ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/base/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_feeHistory", "params": ["0x4", "latest", [25, 75]], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": [ "0x7", "0x7", "0x7", "0x7", "0x7" ], "gasUsedRatio": [ 0.026089875, 0.406803, 0.010817, 0.5 ], "baseFeePerBlobGas": [ "0x3319eb", "0x350c54", "0x364072", "0x364072", "0x32279d" ], "blobGasUsedRatio": [ 0.47619047619047616, 0.2857142857142857, 0, 0.3333333333333333 ], "oldestBlock": "0x11b9231", "reward": [ ["0x4a817c800", "0x4a817c800"], ["0x773593c0", "0x773593c0"], ["0x0", "0x0"], ["0x0", "0x0"] ] } } ``` # eth_gasPrice Source: https://docs.moralis.com/rpc-nodes/base/eth-gas-price Returns the current price per gas in wei. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/base/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x09184e72a000" } ``` # eth_getBalance Source: https://docs.moralis.com/rpc-nodes/base/eth-get-balance Returns the balance of the account of given address. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address to check for balance **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/base/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0234c8a3397aab58" } ``` # eth_getBlockByHash Source: https://docs.moralis.com/rpc-nodes/base/eth-get-block-by-hash Returns information about a block by hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block **fullTransactionObjects** `boolean` *required* If true it returns the full transaction objects, if false only the hashes of the transactions #### Example request `params` ```javascript theme={null} [ "0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c", false ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/base/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c", false], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x3319bb0", "blobGasUsed": "0x120000", "difficulty": "0x0", "excessBlobGas": "0xa576243", "extraData": "0xe29ca82051756173617220287175617361722e77696e2920e29ca8", "gasLimit": "0x3938700", "gasUsed": "0x2965eaa", "hash": "0xc319ec0da50d354ce425b63fb6914a42aafdb9ee9807518edd595809e25fbe38", "logsBloom": "0x7feeeb37793b4fdfff7ab7aefde2d7fdfff9575bfef5bdff3fb97bfef7bcddbbdf9d55e77fdf7ead7b98ffd9bb6fefff7e77b163bf9eeebdddd1ffbf376cfbeb7efffef83ffbe9eb7ff7776ab3dcf8bfee7ebaddfffdf7fe3fffdf6ed3f7dff77cf2fd7efffff7a19ef7ffbbe3e8befdb7fff76b6ed6e7ffceeb99ff7eeb5efebfff3fff7da1fb39f9fff3fd7f3f77b6dd0bed39f5fff3bfa7fbbce7f9f6ec6e0fff50bfe7f9f79efff35ff6d93fecfefbffdaf7b7eff35ec6ff42fe7e6f77f7deff7eff57f6aafa597feebdffff7bbd677e27ffbfadfdf57f7e7d2aeeffffff6676ffa7f3f375eb95eecf9ffa235cbfcdefafbf8feed9dc7b56ff2fdfedfefe", "miner": "0x396343362be2a4da1ce0c1c210945346fb82aa49", "mixHash": "0x07444bb5750f746e200e1dcd8d83221b26576d3357b833cc1e434e7966d0e774", "nonce": "0x0000000000000000", "number": "0x1736791", "parentBeaconBlockRoot": "0x2759f248e2d1cb1a2f5c2657c4efcc623dd8ea7f23e8700162e7fccdacedfd5d", "parentHash": "0xdf0e4dee910167d7b1687a6cb677983ce7ed351ae78ab7e2c5ba39d793c80391", "receiptsRoot": "0x5f1c58e498161509245daad0f60319d9abab7f04d2ca60e99a3674cfdc9b8327", "requestsHash": "0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x1ef1e", "stateRoot": "0x728c7e38107037b573d719e67b6872ee3ca4e01b47818598316cd696bfe24f2c", "timestamp": "0x697b4bcb", "transactions": [ "0xbf7bd0cf98c3b65525f1f7267b1d02e7ccd7cd133b137f46723a91cf187616d5", "0x06ac9281da76d530aa19600e2c34aae7564a78702d3eb52b1fb363985473e296" ], "transactionsRoot": "0xa8c680f6ad8ccc7a49db5ab76cbd9194c88e16dbcfa440104f7787e5ba815c4f", "uncles": [], "withdrawals": [ { "index": "0x6f78bfb", "validatorIndex": "0x955f5", "address": "0x5d3ca1842d0988816434ea51ca420182f3f1e31a", "amount": "0x102d2f1" } ], "withdrawalsRoot": "0x9b7ecf1ba575fc02e4b4c14bd65d5ca95c0e066adaae3fc2ef16f5acd90214d8" } } ``` # eth_getBlockByNumber Source: https://docs.moralis.com/rpc-nodes/base/eth-get-block-by-number Returns information about a block by block number. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" **fullTransactionObjects** `boolean` *required* If true it returns the full transaction objects, if false only the hashes of the transactions #### Example request `params` ```javascript theme={null} [ "0x1b4", true ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/base/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["0x1b4", true], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x3319bb0", "blobGasUsed": "0x120000", "difficulty": "0x0", "excessBlobGas": "0xa576243", "extraData": "0xe29ca82051756173617220287175617361722e77696e2920e29ca8", "gasLimit": "0x3938700", "gasUsed": "0x2965eaa", "hash": "0xc319ec0da50d354ce425b63fb6914a42aafdb9ee9807518edd595809e25fbe38", "logsBloom": "0x7feeeb37793b4fdfff7ab7aefde2d7fdfff9575bfef5bdff3fb97bfef7bcddbbdf9d55e77fdf7ead7b98ffd9bb6fefff7e77b163bf9eeebdddd1ffbf376cfbeb7efffef83ffbe9eb7ff7776ab3dcf8bfee7ebaddfffdf7fe3fffdf6ed3f7dff77cf2fd7efffff7a19ef7ffbbe3e8befdb7fff76b6ed6e7ffceeb99ff7eeb5efebfff3fff7da1fb39f9fff3fd7f3f77b6dd0bed39f5fff3bfa7fbbce7f9f6ec6e0fff50bfe7f9f79efff35ff6d93fecfefbffdaf7b7eff35ec6ff42fe7e6f77f7deff7eff57f6aafa597feebdffff7bbd677e27ffbfadfdf57f7e7d2aeeffffff6676ffa7f3f375eb95eecf9ffa235cbfcdefafbf8feed9dc7b56ff2fdfedfefe", "miner": "0x396343362be2a4da1ce0c1c210945346fb82aa49", "mixHash": "0x07444bb5750f746e200e1dcd8d83221b26576d3357b833cc1e434e7966d0e774", "nonce": "0x0000000000000000", "number": "0x1736791", "parentBeaconBlockRoot": "0x2759f248e2d1cb1a2f5c2657c4efcc623dd8ea7f23e8700162e7fccdacedfd5d", "parentHash": "0xdf0e4dee910167d7b1687a6cb677983ce7ed351ae78ab7e2c5ba39d793c80391", "receiptsRoot": "0x5f1c58e498161509245daad0f60319d9abab7f04d2ca60e99a3674cfdc9b8327", "requestsHash": "0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x1ef1e", "stateRoot": "0x728c7e38107037b573d719e67b6872ee3ca4e01b47818598316cd696bfe24f2c", "timestamp": "0x697b4bcb", "transactions": [ "0xbf7bd0cf98c3b65525f1f7267b1d02e7ccd7cd133b137f46723a91cf187616d5", "0x06ac9281da76d530aa19600e2c34aae7564a78702d3eb52b1fb363985473e296" ], "transactionsRoot": "0xa8c680f6ad8ccc7a49db5ab76cbd9194c88e16dbcfa440104f7787e5ba815c4f", "uncles": [], "withdrawals": [ { "index": "0x6f78bfb", "validatorIndex": "0x955f5", "address": "0x5d3ca1842d0988816434ea51ca420182f3f1e31a", "amount": "0x102d2f1" } ], "withdrawalsRoot": "0x9b7ecf1ba575fc02e4b4c14bd65d5ca95c0e066adaae3fc2ef16f5acd90214d8" } } ``` # eth_getBlockReceipts Source: https://docs.moralis.com/rpc-nodes/base/eth-get-block-receipts Returns all transaction receipts for a given block. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" #### Example request `params` ```javascript theme={null} [ "0xf21d9c" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/base/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockReceipts", "params": ["0xf21d9c"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": [ { "blockHash": "0x8243343df08b9751f5ca0c5f8c9c0460d8a9b6351066fae0acbd4d3e776de8bb", "blockNumber": "0xf21d9c", "contractAddress": null, "cumulativeGasUsed": "0x5208", "effectiveGasPrice": "0x1dcd6500", "from": "0x8ba1f109551bd432803012645haca66c9834d7c6", "gasUsed": "0x5208", "logs": [], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "status": "0x1", "to": "0x95cED938F7991cd0dFcb48F0a06a40FA1aF46EBC", "transactionHash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "transactionIndex": "0x0", "type": "0x2" } ] } ``` # eth_getBlockTransactionCountByHash Source: https://docs.moralis.com/rpc-nodes/base/eth-get-block-transaction-count-by-hash Returns the number of transactions in a block from a block matching the given block hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block #### Example request `params` ```javascript theme={null} [ "0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/base/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` # eth_getBlockTransactionCountByNumber Source: https://docs.moralis.com/rpc-nodes/base/eth-get-block-transaction-count-by-number Returns the number of transactions in a block matching the given block number. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" #### Example request `params` ```javascript theme={null} [ "0xe8" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/base/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["0xe8"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` # eth_getCode Source: https://docs.moralis.com/rpc-nodes/base/eth-get-code Returns code at a given address. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address to get the code from **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x2" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/base/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getCode", "params": ["0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x2"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x600160008035811a818181146012578301005b601b6001356025565b8060005260206000f25b600060078202905091905056" } ``` # eth_getLogs Source: https://docs.moralis.com/rpc-nodes/base/eth-get-logs Returns an array of all logs matching a given filter object. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **fromBlock** `string` Integer block number, or "latest" for the last mined block or "pending", "earliest" for not yet mined transactions **toBlock** `string` Integer block number, or "latest" for the last mined block or "pending", "earliest" for not yet mined transactions **address** `string` Contract address or a list of addresses from which logs should originate **topics** `array` Array of 32 Bytes DATA topics. Topics are order-dependent **blockhash** `string` Using blockhash is equivalent to fromBlock = toBlock = the block number with hash blockhash #### Example request `params` ```javascript theme={null} [ { "fromBlock": "0x1", "toBlock": "0x2", "address": "0x8888f1f195afa192cfee860698584c030f4c9db1", "topics": [ "0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", null, [ "0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x0000000000000000000000000aff3454fce5edbc8cca8697c15331677e6ebccc" ] ] } ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/base/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getLogs", "params": [{"fromBlock": "0x1", "toBlock": "0x2", "address": "0x8888f1f195afa192cfee860698584c030f4c9db1", "topics": ["0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", null, ["0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x0000000000000000000000000aff3454fce5edbc8cca8697c15331677e6ebccc"]]}], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": [ { "logIndex": "0x1", "blockNumber": "0x1b4", "blockHash": "0x8216c5785ac562ff41e2dcfdf5785ac562ff41e2dcfdf829c5a142f1fccd7d", "transactionHash": "0xdf829c5a142f1fccd7d8216c5785ac562ff41e2dcfdf5785ac562ff41e2dcf", "transactionIndex": "0x0", "address": "0x16c5785ac562ff41e2dcfdf829c5a142f1fccd7d", "data": "0x0000000000000000000000000000000000000000000000000000000000000000", "topics": [ "0x59ebeb90bc63057b6515673c3ecf9438e5058bca0f92585014eced636878c9a5" ] } ] } ``` # eth_getProof Source: https://docs.moralis.com/rpc-nodes/base/eth-get-proof Returns the account and storage values of the specified account including the Merkle-proof. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address of the account or contract **storageKeys** `array` *required* Array of storage-keys which should be proofed and included **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842", [ "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421" ], "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/base/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getProof", "params": ["0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842", ["0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"], "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "address": "0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842", "accountProof": [ "0xf90211a090dcaf88c40c7bbc95a912cbdde67c175767b31173df9ee4b0d733bfdd511c43a0babe369f6b12092f49181ae04ca173fb68d1a5456f18d20fa32cba73954052bda0473ecf8a7e36a829e75039a3b055e51b8332cbf03324ab4af2066bbd6fbf0021fa0bbda34753d7aa6c38e603f360244e8f59611921d9e1f128372fec0d586d4f9e0a04e44caecff45c9891f74f6a2156735886eedf6f1a733628ebc802ec79d844648a0a5f3f2f7542148c973977c8a1e154c4300fec92f755f7846f1b734d3ab1d90e7a0e823850f50bf72baae9d1733a36a444ab65d0a6faaba404f0583ce0ca4dad92da0f7a00cbe7d4b30b11faea3ae61b7f1f2b315017e79a3de5ab2dc8bb46a59fdb37a09b3b8d0e0e4c1e3b2d3e8f7c6e5d4c3b2a1e0f9e8d7c6b5a4e3f2e1d0c9b8a7a0b1f8e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0a0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0a0d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a08080" ], "balance": "0x0", "codeHash": "0x5e61b0f7919ab4e6fc7cfa6f3f5f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f", "nonce": "0x0", "storageHash": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "storageProof": [ { "key": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "value": "0x1", "proof": [ "0xf90211a090dcaf88c40c7bbc95a912cbdde67c175767b31173df9ee4b0d733bfdd511c43a0babe369f6b12092f49181ae04ca173fb68d1a5456f18d20fa32cba73954052bda0473ecf8a7e36a829e75039a3b055e51b8332cbf03324ab4af2066bbd6fbf0021fa0bbda34753d7aa6c38e603f360244e8f59611921d9e1f128372fec0d586d4f9e0a04e44caecff45c9891f74f6a2156735886eedf6f1a733628ebc802ec79d844648a0a5f3f2f7542148c973977c8a1e154c4300fec92f755f7846f1b734d3ab1d90e7a0e823850f50bf72baae9d1733a36a444ab65d0a6faaba404f0583ce0ca4dad92da0f7a00cbe7d4b30b11faea3ae61b7f1f2b315017e79a3de5ab2dc8bb46a59fdb37a09b3b8d0e0e4c1e3b2d3e8f7c6e5d4c3b2a1e0f9e8d7c6b5a4e3f2e1d0c9b8a7a0b1f8e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0a0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0a0d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a08080" ] } ] } } ``` # eth_getStorageAt Source: https://docs.moralis.com/rpc-nodes/base/eth-get-storage-at Returns the value from a storage position at a given address. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address of the storage **position** `string` *required* Integer of the position in the storage **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x0", "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/base/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x0", "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x00000000000000000000000000000000000000000000000000000000000004d2" } ``` # eth_getTransactionByBlockHashAndIndex Source: https://docs.moralis.com/rpc-nodes/base/eth-get-transaction-by-block-hash-and-index Returns information about a transaction by block hash and transaction index position. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block **index** `string` *required* Integer of the transaction index position #### Example request `params` ```javascript theme={null} [ "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/base/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5daf3b", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "gas": "0xc350", "gasPrice": "0x4a817c800", "hash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "input": "0x68656c6c6f21", "nonce": "0x15", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "transactionIndex": "0x0", "value": "0xf3dbb76162000", "v": "0x25", "r": "0x1b5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5", "s": "0x5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5c5" } } ``` # eth_getTransactionByBlockNumberAndIndex Source: https://docs.moralis.com/rpc-nodes/base/eth-get-transaction-by-block-number-and-index Returns information about a transaction by block number and transaction index position. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* A block number, or the string "earliest", "latest" or "pending" **index** `string` *required* The transaction index position #### Example request `params` ```javascript theme={null} [ "0x5BAE9E", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/base/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["0x5BAE9E", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5BAE9E", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "gas": "0xc350", "gasPrice": "0x4a817c800", "hash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "input": "0x68656c6c6f21", "nonce": "0x15", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "transactionIndex": "0x0", "value": "0xf3dbb76162000", "v": "0x25", "r": "0x1b5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5", "s": "0x5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5c5" } } ``` # eth_getTransactionByHash Source: https://docs.moralis.com/rpc-nodes/base/eth-get-transaction-by-hash Returns the information about a transaction requested by transaction hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a transaction #### Example request `params` ```javascript theme={null} [ "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/base/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5daf3b", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "gas": "0xc350", "gasPrice": "0x4a817c800", "hash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "input": "0x68656c6c6f21", "nonce": "0x15", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "transactionIndex": "0x41", "value": "0xf3dbb76162000", "v": "0x25", "r": "0x1b5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5", "s": "0x5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5c5" } } ``` # eth_getTransactionCount Source: https://docs.moralis.com/rpc-nodes/base/eth-get-transaction-count Returns the number of transactions sent from an address. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address to get transaction count for **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/base/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` # eth_getTransactionReceipt Source: https://docs.moralis.com/rpc-nodes/base/eth-get-transaction-receipt Returns the receipt of a transaction by transaction hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a transaction #### Example request `params` ```javascript theme={null} [ "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/base/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "transactionHash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "transactionIndex": "0x41", "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5daf3b", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "cumulativeGasUsed": "0x33bc", "gasUsed": "0x4dc", "contractAddress": null, "logs": [], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "status": "0x1" } } ``` # eth_getUncleByBlockHashAndIndex Source: https://docs.moralis.com/rpc-nodes/base/eth-get-uncle-by-block-hash-and-index Returns information about an uncle of a block by hash and uncle index position. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block **index** `string` *required* The uncle's index position #### Example request `params` ```javascript theme={null} [ "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/base/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x027f07", "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000", "gasLimit": "0x9f759", "gasUsed": "0x9f759", "hash": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331", "logsBloom": "0x1a060020000015554c000200000003050000200017041014032020801000056020000001000a00d0020204040020012150010010000000280005000c00000000000020c0000000024008104011000080020020000001006100900000024208002000020002100000000000000080000000120080000002003c0000200000000200002010008300300001001031100100040010420000800000000014000004002000000c040200060000000080000000100000000040a2000001000061000042021080400200000410000404080800014008201000c20100500020011000000030001100100024008c80190400402008000020000c0041104218100000000000000002000800000", "miner": "0x4e65fda2159562a496f9f3522f89122a3088497a", "mixHash": "0x99e9d85137db46ef1e85fff042bb15a7b6f46618b7f600b0b4e7fb52fceafc3a", "nonce": "0xfcf4db6d9bce1b8b", "number": "0x1b4", "parentHash": "0xa057c32b6ed8eb5e006cadfad55c7e635549c6e2135c4e6c3a9d5a6a80f72c3", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0x1a7e46b37b26e0c3f67ed4de3b5d3b1ff84a2e0a5e2dcf4d4b0d34b5a22b6e3", "timestamp": "0x55ba467c", "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` # eth_getUncleByBlockNumberAndIndex Source: https://docs.moralis.com/rpc-nodes/base/eth-get-uncle-by-block-number-and-index Returns information about an uncle of a block by number and uncle index position. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* A block number, or the string "earliest", "latest" or "pending" **index** `string` *required* The uncle's index position #### Example request `params` ```javascript theme={null} [ "0x29c", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/base/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["0x29c", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x027f07", "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000", "gasLimit": "0x9f759", "gasUsed": "0x9f759", "hash": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331", "logsBloom": "0x1a060020000015554c000200000003050000200017041014032020801000056020000001000a00d0020204040020012150010010000000280005000c00000000000020c0000000024008104011000080020020000001006100900000024208002000020002100000000000000080000000120080000002003c0000200000000200002010008300300001001031100100040010420000800000000014000004002000000c040200060000000080000000100000000040a2000001000061000042021080400200000410000404080800014008201000c20100500020011000000030001100100024008c80190400402008000020000c0041104218100000000000000002000800000", "miner": "0x4e65fda2159562a496f9f3522f89122a3088497a", "mixHash": "0x99e9d85137db46ef1e85fff042bb15a7b6f46618b7f600b0b4e7fb52fceafc3a", "nonce": "0xfcf4db6d9bce1b8b", "number": "0x29c", "parentHash": "0xa057c32b6ed8eb5e006cadfad55c7e635549c6e2135c4e6c3a9d5a6a80f72c3", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0x1a7e46b37b26e0c3f67ed4de3b5d3b1ff84a2e0a5e2dcf4d4b0d34b5a22b6e3", "timestamp": "0x55ba467c", "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` # eth_getUncleCountByBlockHash Source: https://docs.moralis.com/rpc-nodes/base/eth-get-uncle-count-by-block-hash Returns the number of uncles in a block from a block matching the given block hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block #### Example request `params` ```javascript theme={null} [ "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/base/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` # eth_getUncleCountByBlockNumber Source: https://docs.moralis.com/rpc-nodes/base/eth-get-uncle-count-by-block-number Returns the number of uncles in a block from a block matching the given block number. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" #### Example request `params` ```javascript theme={null} [ "0x5BAE9E" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/base/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["0x5BAE9E"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` # eth_maxPriorityFeePerGas Source: https://docs.moralis.com/rpc-nodes/base/eth-max-priority-fee-per-gas Returns a suggestion for the max priority fee per gas for dynamic fee transactions in wei. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/base/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_maxPriorityFeePerGas", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x59682f00" } ``` # eth_sendRawTransaction Source: https://docs.moralis.com/rpc-nodes/base/eth-send-raw-transaction Submits a pre-signed transaction for broadcast to the network. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **data** `string` *required* The signed transaction data #### Example request `params` ```javascript theme={null} [ "0xf869808504e3b2928082520894f0109fc8df283027b6285cc889f5aa624eac1f55843b9aca008025a0c9cf86333bcb065d140032ecaab5d9281bde80f21b9687b3e94161de42d51895a0727a108a0b8d101465414033c3f705a9c7b826e596766046ee1183dbc8aeaa68" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/base/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["0xf869808504e3b2928082520894f0109fc8df283027b6285cc889f5aa624eac1f55843b9aca008025a0c9cf86333bcb065d140032ecaab5d9281bde80f21b9687b3e94161de42d51895a0727a108a0b8d101465414033c3f705a9c7b826e596766046ee1183dbc8aeaa68"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" } ``` # Overview Source: https://docs.moralis.com/rpc-nodes/base/overview Explore Base JSON-RPC methods ## Introduction Base is an Ethereum Layer 2 (L2) network that offers high-speed, low-cost transactions with the security of Ethereum. It leverages the Optimism rollup technology to process transactions off-chain, reducing fees and improving throughput. Base is designed to bring the power of Ethereum to more developers and users, enabling a more scalable decentralized finance (DeFi) ecosystem, NFTs, and other dApps. ## Supported Networks The Base RPC API is available for the following networks: 1. **Base Mainnet** 2. **Base Sepolia Testnet** ## Network Details | **Network** | **Chain ID** | **Path Parameter** | | :- | :- | :- | | **Base Mainnet** | 0x2105 (8453) | `base` | | **Base Sepolia** | 0x14a34 (84532) | `base-sepolia` | ## Supported RPC Methods * [eth\_blockNumber](/rpc-nodes/base/eth-blockNumber) * [eth\_call](/rpc-nodes/base/eth-call) * [eth\_chainId](/rpc-nodes/base/eth-chain-id) * [eth\_createAccessList](/rpc-nodes/base/eth-create-access-list) * [eth\_estimateGas](/rpc-nodes/base/eth-estimate-gas) * [eth\_feeHistory](/rpc-nodes/base/eth-fee-history) * [eth\_gasPrice](/rpc-nodes/base/eth-gas-price) * [eth\_getBalance](/rpc-nodes/base/eth-get-balance) * [eth\_getBlockByHash](/rpc-nodes/base/eth-get-block-by-hash) * [eth\_getBlockByNumber](/rpc-nodes/base/eth-get-block-by-number) * [eth\_getBlockTransactionCountByHash](/rpc-nodes/base/eth-get-block-transaction-count-by-hash) * [eth\_getBlockTransactionCountByNumber](/rpc-nodes/base/eth-get-block-transaction-count-by-number) * [eth\_getBlockReceipts](/rpc-nodes/base/eth-get-block-receipts) * [eth\_getCode](/rpc-nodes/base/eth-get-code) * [eth\_getLogs](/streams/api-reference/history/get-logs) * [eth\_getProof](/rpc-nodes/base/eth-get-proof) * [eth\_getStorageAt](/rpc-nodes/base/eth-get-storage-at) * [eth\_getTransactionByHash](/rpc-nodes/base/eth-get-transaction-by-hash) * [eth\_getTransactionByBlockHashAndIndex](/rpc-nodes/base/eth-get-transaction-by-block-hash-and-index) * [eth\_getTransactionByBlockNumberAndIndex](/rpc-nodes/base/eth-get-transaction-by-block-number-and-index) * [eth\_getTransactionCount](/rpc-nodes/base/eth-get-transaction-count) * [eth\_getTransactionReceipt](/rpc-nodes/base/eth-get-transaction-receipt) * [eth\_getUncleByBlockHashAndIndex](/rpc-nodes/base/eth-get-uncle-by-block-hash-and-index) * [eth\_getUncleByBlockNumberAndIndex](/rpc-nodes/base/eth-get-uncle-by-block-number-and-index) * [eth\_getUncleCountByBlockHash](/rpc-nodes/base/eth-get-uncle-count-by-block-hash) * [eth\_getUncleCountByBlockNumber](/rpc-nodes/base/eth-get-uncle-count-by-block-number) * [eth\_maxPriorityFeePerGas](/rpc-nodes/base/eth-max-priority-fee-per-gas) * [eth\_sendRawTransaction](/rpc-nodes/base/eth-send-raw-transaction) # eth_blockNumber Source: https://docs.moralis.com/rpc-nodes/blast/eth-blockNumber Returns the number of most recent block. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request body No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/blast/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x4b7" } ``` # eth_call Source: https://docs.moralis.com/rpc-nodes/blast/eth-call Executes a new message call immediately without creating a transaction on the blockchain. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **from** `string` The address the transaction is sent from **to** `string` *required* The address the transaction is directed to **gas** `string` Integer of the gas provided for the transaction execution **gasPrice** `string` Integer of the gasPrice used for each paid gas **value** `string` Integer of the value sent with this transaction **data** `string` Hash of the method signature and encoded parameters **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ { "from": "0x0000000000000000000000000000000000000000", "to": "0x0000000000000000000000000000000000000000", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0x" }, "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/blast/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_call", "params": [{"from": "0xb60e8dd61c5d32be8058bb8eb970870f07233155", "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"}, "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x15536ee" } ``` # eth_chainId Source: https://docs.moralis.com/rpc-nodes/blast/eth-chain-id Returns the chain ID of the current connected node as described in EIP-695. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request body No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/blast/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_chainId", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` # eth_createAccessList Source: https://docs.moralis.com/rpc-nodes/blast/eth-create-access-list Creates an access list that you can include in a transaction. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **from** `string` The address the transaction is sent from **to** `string` The address the transaction is directed to **gas** `string` Integer of the gas provided for the transaction execution **gasPrice** `string` Integer of the gasPrice used for each paid gas **maxPriorityFeePerGas** `string` Maximum fee per gas the sender is willing to pay to miners **maxFeePerGas** `string` Maximum total fee per gas the sender is willing to pay **value** `string` Integer of the value sent with this transaction **data** `string` Hash of the method signature and encoded parameters **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ { "from": "0x8ba1f109551bd432803012645haca66c9834d7c6", "to": "0x6b175474e89094c44da98b954eedeac495271d0f", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0xa9059cbb0000000000000000000000008ba1f109551bd432803012645haca66c9834d7c60000000000000000000000000000000000000000000000000de0b6b3a7640000" }, "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/blast/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_createAccessList", "params": [{"from": "0x8ba1f109551bd432803012645haca66c9834d7c6", "to": "0x6b175474e89094c44da98b954eedeac495271d0f", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0xa9059cbb0000000000000000000000008ba1f109551bd432803012645haca66c9834d7c60000000000000000000000000000000000000000000000000de0b6b3a7640000"}, "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "accessList": [ { "address": "0x6b175474e89094c44da98b954eedeac495271d0f", "storageKeys": [ "0x0000000000000000000000000000000000000000000000000000000000000000" ] } ], "gasUsed": "0x7671" } } ``` # eth_estimateGas Source: https://docs.moralis.com/rpc-nodes/blast/eth-estimate-gas Generates and returns an estimate of how much gas is necessary to allow the transaction to complete. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **from** `string` The address the transaction is sent from **to** `string` The address the transaction is directed to **gas** `string` Integer of the gas provided for the transaction execution **gasPrice** `string` Integer of the gasPrice used for each paid gas **value** `string` Integer of the value sent with this transaction **data** `string` Hash of the method signature and encoded parameters **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ { "from": "0x8D97689C9818892B700e27F316cc3E41e17fBeb9", "to": "0xd3CdA913deB6f67967B99D67aCDFa1712C293601", "value": "0x186a0" }, "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/blast/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_estimateGas", "params": [{"from": "0x8D97689C9818892B700e27F316cc3E41e17fBeb9", "to": "0xd3CdA913deB6f67967B99D67aCDFa1712C293601", "value": "0x186a0"}, "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x5208" } ``` # eth_feeHistory Source: https://docs.moralis.com/rpc-nodes/blast/eth-fee-history Returns historical gas information for a range of blocks. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockCount** `string` *required* Number of blocks in the requested range **newestBlock** `string` *required* Highest number block of the requested range **rewardPercentiles** `array` Array of percentile values to sample from each block's effective priority fees per gas #### Example request `params` ```javascript theme={null} [ "0x4", "latest", [25, 75] ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/blast/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_feeHistory", "params": ["0x4", "latest", [25, 75]], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": [ "0x7", "0x7", "0x7", "0x7", "0x7" ], "gasUsedRatio": [ 0.026089875, 0.406803, 0.010817, 0.5 ], "baseFeePerBlobGas": [ "0x3319eb", "0x350c54", "0x364072", "0x364072", "0x32279d" ], "blobGasUsedRatio": [ 0.47619047619047616, 0.2857142857142857, 0, 0.3333333333333333 ], "oldestBlock": "0x11b9231", "reward": [ ["0x4a817c800", "0x4a817c800"], ["0x773593c0", "0x773593c0"], ["0x0", "0x0"], ["0x0", "0x0"] ] } } ``` # eth_gasPrice Source: https://docs.moralis.com/rpc-nodes/blast/eth-gas-price Returns the current price per gas in wei. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/blast/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x09184e72a000" } ``` # eth_getBalance Source: https://docs.moralis.com/rpc-nodes/blast/eth-get-balance Returns the balance of the account of given address. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address to check for balance **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/blast/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0234c8a3397aab58" } ``` # eth_getBlockByHash Source: https://docs.moralis.com/rpc-nodes/blast/eth-get-block-by-hash Returns information about a block by hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block **fullTransactionObjects** `boolean` *required* If true it returns the full transaction objects, if false only the hashes of the transactions #### Example request `params` ```javascript theme={null} [ "0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c", false ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/blast/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c", false], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x3319bb0", "blobGasUsed": "0x120000", "difficulty": "0x0", "excessBlobGas": "0xa576243", "extraData": "0xe29ca82051756173617220287175617361722e77696e2920e29ca8", "gasLimit": "0x3938700", "gasUsed": "0x2965eaa", "hash": "0xc319ec0da50d354ce425b63fb6914a42aafdb9ee9807518edd595809e25fbe38", "logsBloom": "0x7feeeb37793b4fdfff7ab7aefde2d7fdfff9575bfef5bdff3fb97bfef7bcddbbdf9d55e77fdf7ead7b98ffd9bb6fefff7e77b163bf9eeebdddd1ffbf376cfbeb7efffef83ffbe9eb7ff7776ab3dcf8bfee7ebaddfffdf7fe3fffdf6ed3f7dff77cf2fd7efffff7a19ef7ffbbe3e8befdb7fff76b6ed6e7ffceeb99ff7eeb5efebfff3fff7da1fb39f9fff3fd7f3f77b6dd0bed39f5fff3bfa7fbbce7f9f6ec6e0fff50bfe7f9f79efff35ff6d93fecfefbffdaf7b7eff35ec6ff42fe7e6f77f7deff7eff57f6aafa597feebdffff7bbd677e27ffbfadfdf57f7e7d2aeeffffff6676ffa7f3f375eb95eecf9ffa235cbfcdefafbf8feed9dc7b56ff2fdfedfefe", "miner": "0x396343362be2a4da1ce0c1c210945346fb82aa49", "mixHash": "0x07444bb5750f746e200e1dcd8d83221b26576d3357b833cc1e434e7966d0e774", "nonce": "0x0000000000000000", "number": "0x1736791", "parentBeaconBlockRoot": "0x2759f248e2d1cb1a2f5c2657c4efcc623dd8ea7f23e8700162e7fccdacedfd5d", "parentHash": "0xdf0e4dee910167d7b1687a6cb677983ce7ed351ae78ab7e2c5ba39d793c80391", "receiptsRoot": "0x5f1c58e498161509245daad0f60319d9abab7f04d2ca60e99a3674cfdc9b8327", "requestsHash": "0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x1ef1e", "stateRoot": "0x728c7e38107037b573d719e67b6872ee3ca4e01b47818598316cd696bfe24f2c", "timestamp": "0x697b4bcb", "transactions": [ "0xbf7bd0cf98c3b65525f1f7267b1d02e7ccd7cd133b137f46723a91cf187616d5", "0x06ac9281da76d530aa19600e2c34aae7564a78702d3eb52b1fb363985473e296" ], "transactionsRoot": "0xa8c680f6ad8ccc7a49db5ab76cbd9194c88e16dbcfa440104f7787e5ba815c4f", "uncles": [], "withdrawals": [ { "index": "0x6f78bfb", "validatorIndex": "0x955f5", "address": "0x5d3ca1842d0988816434ea51ca420182f3f1e31a", "amount": "0x102d2f1" } ], "withdrawalsRoot": "0x9b7ecf1ba575fc02e4b4c14bd65d5ca95c0e066adaae3fc2ef16f5acd90214d8" } } ``` # eth_getBlockByNumber Source: https://docs.moralis.com/rpc-nodes/blast/eth-get-block-by-number Returns information about a block by block number. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" **fullTransactionObjects** `boolean` *required* If true it returns the full transaction objects, if false only the hashes of the transactions #### Example request `params` ```javascript theme={null} [ "0x1b4", true ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/blast/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["0x1b4", true], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x3319bb0", "blobGasUsed": "0x120000", "difficulty": "0x0", "excessBlobGas": "0xa576243", "extraData": "0xe29ca82051756173617220287175617361722e77696e2920e29ca8", "gasLimit": "0x3938700", "gasUsed": "0x2965eaa", "hash": "0xc319ec0da50d354ce425b63fb6914a42aafdb9ee9807518edd595809e25fbe38", "logsBloom": "0x7feeeb37793b4fdfff7ab7aefde2d7fdfff9575bfef5bdff3fb97bfef7bcddbbdf9d55e77fdf7ead7b98ffd9bb6fefff7e77b163bf9eeebdddd1ffbf376cfbeb7efffef83ffbe9eb7ff7776ab3dcf8bfee7ebaddfffdf7fe3fffdf6ed3f7dff77cf2fd7efffff7a19ef7ffbbe3e8befdb7fff76b6ed6e7ffceeb99ff7eeb5efebfff3fff7da1fb39f9fff3fd7f3f77b6dd0bed39f5fff3bfa7fbbce7f9f6ec6e0fff50bfe7f9f79efff35ff6d93fecfefbffdaf7b7eff35ec6ff42fe7e6f77f7deff7eff57f6aafa597feebdffff7bbd677e27ffbfadfdf57f7e7d2aeeffffff6676ffa7f3f375eb95eecf9ffa235cbfcdefafbf8feed9dc7b56ff2fdfedfefe", "miner": "0x396343362be2a4da1ce0c1c210945346fb82aa49", "mixHash": "0x07444bb5750f746e200e1dcd8d83221b26576d3357b833cc1e434e7966d0e774", "nonce": "0x0000000000000000", "number": "0x1736791", "parentBeaconBlockRoot": "0x2759f248e2d1cb1a2f5c2657c4efcc623dd8ea7f23e8700162e7fccdacedfd5d", "parentHash": "0xdf0e4dee910167d7b1687a6cb677983ce7ed351ae78ab7e2c5ba39d793c80391", "receiptsRoot": "0x5f1c58e498161509245daad0f60319d9abab7f04d2ca60e99a3674cfdc9b8327", "requestsHash": "0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x1ef1e", "stateRoot": "0x728c7e38107037b573d719e67b6872ee3ca4e01b47818598316cd696bfe24f2c", "timestamp": "0x697b4bcb", "transactions": [ "0xbf7bd0cf98c3b65525f1f7267b1d02e7ccd7cd133b137f46723a91cf187616d5", "0x06ac9281da76d530aa19600e2c34aae7564a78702d3eb52b1fb363985473e296" ], "transactionsRoot": "0xa8c680f6ad8ccc7a49db5ab76cbd9194c88e16dbcfa440104f7787e5ba815c4f", "uncles": [], "withdrawals": [ { "index": "0x6f78bfb", "validatorIndex": "0x955f5", "address": "0x5d3ca1842d0988816434ea51ca420182f3f1e31a", "amount": "0x102d2f1" } ], "withdrawalsRoot": "0x9b7ecf1ba575fc02e4b4c14bd65d5ca95c0e066adaae3fc2ef16f5acd90214d8" } } ``` # eth_getBlockReceipts Source: https://docs.moralis.com/rpc-nodes/blast/eth-get-block-receipts Returns all transaction receipts for a given block. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" #### Example request `params` ```javascript theme={null} [ "0xf21d9c" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/blast/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockReceipts", "params": ["0xf21d9c"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": [ { "blockHash": "0x8243343df08b9751f5ca0c5f8c9c0460d8a9b6351066fae0acbd4d3e776de8bb", "blockNumber": "0xf21d9c", "contractAddress": null, "cumulativeGasUsed": "0x5208", "effectiveGasPrice": "0x1dcd6500", "from": "0x8ba1f109551bd432803012645haca66c9834d7c6", "gasUsed": "0x5208", "logs": [], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "status": "0x1", "to": "0x95cED938F7991cd0dFcb48F0a06a40FA1aF46EBC", "transactionHash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "transactionIndex": "0x0", "type": "0x2" } ] } ``` # eth_getBlockTransactionCountByHash Source: https://docs.moralis.com/rpc-nodes/blast/eth-get-block-transaction-count-by-hash Returns the number of transactions in a block from a block matching the given block hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block #### Example request `params` ```javascript theme={null} [ "0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/blast/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` # eth_getBlockTransactionCountByNumber Source: https://docs.moralis.com/rpc-nodes/blast/eth-get-block-transaction-count-by-number Returns the number of transactions in a block matching the given block number. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" #### Example request `params` ```javascript theme={null} [ "0xe8" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/blast/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["0xe8"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` # eth_getCode Source: https://docs.moralis.com/rpc-nodes/blast/eth-get-code Returns code at a given address. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address to get the code from **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x2" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/blast/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getCode", "params": ["0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x2"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x600160008035811a818181146012578301005b601b6001356025565b8060005260206000f25b600060078202905091905056" } ``` # eth_getLogs Source: https://docs.moralis.com/rpc-nodes/blast/eth-get-logs Returns an array of all logs matching a given filter object. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **fromBlock** `string` Integer block number, or "latest" for the last mined block or "pending", "earliest" for not yet mined transactions **toBlock** `string` Integer block number, or "latest" for the last mined block or "pending", "earliest" for not yet mined transactions **address** `string` Contract address or a list of addresses from which logs should originate **topics** `array` Array of 32 Bytes DATA topics. Topics are order-dependent **blockhash** `string` Using blockhash is equivalent to fromBlock = toBlock = the block number with hash blockhash #### Example request `params` ```javascript theme={null} [ { "fromBlock": "0x1", "toBlock": "0x2", "address": "0x8888f1f195afa192cfee860698584c030f4c9db1", "topics": [ "0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", null, [ "0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x0000000000000000000000000aff3454fce5edbc8cca8697c15331677e6ebccc" ] ] } ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/blast/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getLogs", "params": [{"fromBlock": "0x1", "toBlock": "0x2", "address": "0x8888f1f195afa192cfee860698584c030f4c9db1", "topics": ["0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", null, ["0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x0000000000000000000000000aff3454fce5edbc8cca8697c15331677e6ebccc"]]}], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": [ { "logIndex": "0x1", "blockNumber": "0x1b4", "blockHash": "0x8216c5785ac562ff41e2dcfdf5785ac562ff41e2dcfdf829c5a142f1fccd7d", "transactionHash": "0xdf829c5a142f1fccd7d8216c5785ac562ff41e2dcfdf5785ac562ff41e2dcf", "transactionIndex": "0x0", "address": "0x16c5785ac562ff41e2dcfdf829c5a142f1fccd7d", "data": "0x0000000000000000000000000000000000000000000000000000000000000000", "topics": [ "0x59ebeb90bc63057b6515673c3ecf9438e5058bca0f92585014eced636878c9a5" ] } ] } ``` # eth_getProof Source: https://docs.moralis.com/rpc-nodes/blast/eth-get-proof Returns the account and storage values of the specified account including the Merkle-proof. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address of the account or contract **storageKeys** `array` *required* Array of storage-keys which should be proofed and included **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842", [ "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421" ], "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/blast/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getProof", "params": ["0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842", ["0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"], "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "address": "0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842", "accountProof": [ "0xf90211a090dcaf88c40c7bbc95a912cbdde67c175767b31173df9ee4b0d733bfdd511c43a0babe369f6b12092f49181ae04ca173fb68d1a5456f18d20fa32cba73954052bda0473ecf8a7e36a829e75039a3b055e51b8332cbf03324ab4af2066bbd6fbf0021fa0bbda34753d7aa6c38e603f360244e8f59611921d9e1f128372fec0d586d4f9e0a04e44caecff45c9891f74f6a2156735886eedf6f1a733628ebc802ec79d844648a0a5f3f2f7542148c973977c8a1e154c4300fec92f755f7846f1b734d3ab1d90e7a0e823850f50bf72baae9d1733a36a444ab65d0a6faaba404f0583ce0ca4dad92da0f7a00cbe7d4b30b11faea3ae61b7f1f2b315017e79a3de5ab2dc8bb46a59fdb37a09b3b8d0e0e4c1e3b2d3e8f7c6e5d4c3b2a1e0f9e8d7c6b5a4e3f2e1d0c9b8a7a0b1f8e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0a0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0a0d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a08080" ], "balance": "0x0", "codeHash": "0x5e61b0f7919ab4e6fc7cfa6f3f5f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f", "nonce": "0x0", "storageHash": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "storageProof": [ { "key": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "value": "0x1", "proof": [ "0xf90211a090dcaf88c40c7bbc95a912cbdde67c175767b31173df9ee4b0d733bfdd511c43a0babe369f6b12092f49181ae04ca173fb68d1a5456f18d20fa32cba73954052bda0473ecf8a7e36a829e75039a3b055e51b8332cbf03324ab4af2066bbd6fbf0021fa0bbda34753d7aa6c38e603f360244e8f59611921d9e1f128372fec0d586d4f9e0a04e44caecff45c9891f74f6a2156735886eedf6f1a733628ebc802ec79d844648a0a5f3f2f7542148c973977c8a1e154c4300fec92f755f7846f1b734d3ab1d90e7a0e823850f50bf72baae9d1733a36a444ab65d0a6faaba404f0583ce0ca4dad92da0f7a00cbe7d4b30b11faea3ae61b7f1f2b315017e79a3de5ab2dc8bb46a59fdb37a09b3b8d0e0e4c1e3b2d3e8f7c6e5d4c3b2a1e0f9e8d7c6b5a4e3f2e1d0c9b8a7a0b1f8e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0a0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0a0d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a08080" ] } ] } } ``` # eth_getStorageAt Source: https://docs.moralis.com/rpc-nodes/blast/eth-get-storage-at Returns the value from a storage position at a given address. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address of the storage **position** `string` *required* Integer of the position in the storage **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x0", "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/blast/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x0", "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x00000000000000000000000000000000000000000000000000000000000004d2" } ``` # eth_getTransactionByBlockHashAndIndex Source: https://docs.moralis.com/rpc-nodes/blast/eth-get-transaction-by-block-hash-and-index Returns information about a transaction by block hash and transaction index position. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block **index** `string` *required* Integer of the transaction index position #### Example request `params` ```javascript theme={null} [ "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/blast/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5daf3b", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "gas": "0xc350", "gasPrice": "0x4a817c800", "hash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "input": "0x68656c6c6f21", "nonce": "0x15", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "transactionIndex": "0x0", "value": "0xf3dbb76162000", "v": "0x25", "r": "0x1b5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5", "s": "0x5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5c5" } } ``` # eth_getTransactionByBlockNumberAndIndex Source: https://docs.moralis.com/rpc-nodes/blast/eth-get-transaction-by-block-number-and-index Returns information about a transaction by block number and transaction index position. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* A block number, or the string "earliest", "latest" or "pending" **index** `string` *required* The transaction index position #### Example request `params` ```javascript theme={null} [ "0x5BAE9E", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/blast/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["0x5BAE9E", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5BAE9E", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "gas": "0xc350", "gasPrice": "0x4a817c800", "hash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "input": "0x68656c6c6f21", "nonce": "0x15", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "transactionIndex": "0x0", "value": "0xf3dbb76162000", "v": "0x25", "r": "0x1b5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5", "s": "0x5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5c5" } } ``` # eth_getTransactionByHash Source: https://docs.moralis.com/rpc-nodes/blast/eth-get-transaction-by-hash Returns the information about a transaction requested by transaction hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a transaction #### Example request `params` ```javascript theme={null} [ "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/blast/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5daf3b", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "gas": "0xc350", "gasPrice": "0x4a817c800", "hash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "input": "0x68656c6c6f21", "nonce": "0x15", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "transactionIndex": "0x41", "value": "0xf3dbb76162000", "v": "0x25", "r": "0x1b5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5", "s": "0x5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5c5" } } ``` # eth_getTransactionCount Source: https://docs.moralis.com/rpc-nodes/blast/eth-get-transaction-count Returns the number of transactions sent from an address. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address to get transaction count for **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/blast/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` # eth_getTransactionReceipt Source: https://docs.moralis.com/rpc-nodes/blast/eth-get-transaction-receipt Returns the receipt of a transaction by transaction hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a transaction #### Example request `params` ```javascript theme={null} [ "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/blast/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "transactionHash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "transactionIndex": "0x41", "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5daf3b", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "cumulativeGasUsed": "0x33bc", "gasUsed": "0x4dc", "contractAddress": null, "logs": [], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "status": "0x1" } } ``` # eth_getUncleByBlockHashAndIndex Source: https://docs.moralis.com/rpc-nodes/blast/eth-get-uncle-by-block-hash-and-index Returns information about an uncle of a block by hash and uncle index position. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block **index** `string` *required* The uncle's index position #### Example request `params` ```javascript theme={null} [ "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/blast/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x027f07", "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000", "gasLimit": "0x9f759", "gasUsed": "0x9f759", "hash": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331", "logsBloom": "0x1a060020000015554c000200000003050000200017041014032020801000056020000001000a00d0020204040020012150010010000000280005000c00000000000020c0000000024008104011000080020020000001006100900000024208002000020002100000000000000080000000120080000002003c0000200000000200002010008300300001001031100100040010420000800000000014000004002000000c040200060000000080000000100000000040a2000001000061000042021080400200000410000404080800014008201000c20100500020011000000030001100100024008c80190400402008000020000c0041104218100000000000000002000800000", "miner": "0x4e65fda2159562a496f9f3522f89122a3088497a", "mixHash": "0x99e9d85137db46ef1e85fff042bb15a7b6f46618b7f600b0b4e7fb52fceafc3a", "nonce": "0xfcf4db6d9bce1b8b", "number": "0x1b4", "parentHash": "0xa057c32b6ed8eb5e006cadfad55c7e635549c6e2135c4e6c3a9d5a6a80f72c3", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0x1a7e46b37b26e0c3f67ed4de3b5d3b1ff84a2e0a5e2dcf4d4b0d34b5a22b6e3", "timestamp": "0x55ba467c", "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` # eth_getUncleByBlockNumberAndIndex Source: https://docs.moralis.com/rpc-nodes/blast/eth-get-uncle-by-block-number-and-index Returns information about an uncle of a block by number and uncle index position. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* A block number, or the string "earliest", "latest" or "pending" **index** `string` *required* The uncle's index position #### Example request `params` ```javascript theme={null} [ "0x29c", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/blast/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["0x29c", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x027f07", "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000", "gasLimit": "0x9f759", "gasUsed": "0x9f759", "hash": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331", "logsBloom": "0x1a060020000015554c000200000003050000200017041014032020801000056020000001000a00d0020204040020012150010010000000280005000c00000000000020c0000000024008104011000080020020000001006100900000024208002000020002100000000000000080000000120080000002003c0000200000000200002010008300300001001031100100040010420000800000000014000004002000000c040200060000000080000000100000000040a2000001000061000042021080400200000410000404080800014008201000c20100500020011000000030001100100024008c80190400402008000020000c0041104218100000000000000002000800000", "miner": "0x4e65fda2159562a496f9f3522f89122a3088497a", "mixHash": "0x99e9d85137db46ef1e85fff042bb15a7b6f46618b7f600b0b4e7fb52fceafc3a", "nonce": "0xfcf4db6d9bce1b8b", "number": "0x29c", "parentHash": "0xa057c32b6ed8eb5e006cadfad55c7e635549c6e2135c4e6c3a9d5a6a80f72c3", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0x1a7e46b37b26e0c3f67ed4de3b5d3b1ff84a2e0a5e2dcf4d4b0d34b5a22b6e3", "timestamp": "0x55ba467c", "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` # eth_getUncleCountByBlockHash Source: https://docs.moralis.com/rpc-nodes/blast/eth-get-uncle-count-by-block-hash Returns the number of uncles in a block from a block matching the given block hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block #### Example request `params` ```javascript theme={null} [ "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/blast/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` # eth_getUncleCountByBlockNumber Source: https://docs.moralis.com/rpc-nodes/blast/eth-get-uncle-count-by-block-number Returns the number of uncles in a block from a block matching the given block number. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" #### Example request `params` ```javascript theme={null} [ "0x5BAE9E" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/blast/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["0x5BAE9E"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` # eth_maxPriorityFeePerGas Source: https://docs.moralis.com/rpc-nodes/blast/eth-max-priority-fee-per-gas Returns a suggestion for the max priority fee per gas for dynamic fee transactions in wei. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/blast/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_maxPriorityFeePerGas", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x59682f00" } ``` # eth_sendRawTransaction Source: https://docs.moralis.com/rpc-nodes/blast/eth-send-raw-transaction Submits a pre-signed transaction for broadcast to the network. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **data** `string` *required* The signed transaction data #### Example request `params` ```javascript theme={null} [ "0xf869808504e3b2928082520894f0109fc8df283027b6285cc889f5aa624eac1f55843b9aca008025a0c9cf86333bcb065d140032ecaab5d9281bde80f21b9687b3e94161de42d51895a0727a108a0b8d101465414033c3f705a9c7b826e596766046ee1183dbc8aeaa68" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/blast/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["0xf869808504e3b2928082520894f0109fc8df283027b6285cc889f5aa624eac1f55843b9aca008025a0c9cf86333bcb065d140032ecaab5d9281bde80f21b9687b3e94161de42d51895a0727a108a0b8d101465414033c3f705a9c7b826e596766046ee1183dbc8aeaa68"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" } ``` # Overview Source: https://docs.moralis.com/rpc-nodes/blast/overview Explore Blast JSON-RPC methods ## Introduction Blast is a high-performance blockchain network designed for scalable decentralized applications (dApps) and digital assets. With its robust infrastructure, Blast aims to offer fast finality, low transaction fees, and high throughput, making it ideal for developers building decentralized finance (DeFi) applications, gaming platforms, and NFTs. Its architecture ensures seamless compatibility with Ethereum, offering developers an easy path to migrate or build on Blast. ## Supported Networks The Blast RPC API is available for the following networks: 1. **Blast Mainnet** 2. **Blast Sepolia Testnet** ## Network Details | **Network** | **Chain ID** | **Path Parameter** | | :- | :- | :- | | **Blast Mainnet** | 0x13e31 (81457) | `blast` | | **Blast Sepolia** | 0xa0c71fd (168587773) | `blast-sepolia` | ## Supported RPC Methods * [eth\_blockNumber](/rpc-nodes/blast/eth-blockNumber) * [eth\_call](/rpc-nodes/blast/eth-call) * [eth\_chainId](/rpc-nodes/blast/eth-chain-id) * [eth\_createAccessList](/rpc-nodes/blast/eth-create-access-list) * [eth\_estimateGas](/rpc-nodes/blast/eth-estimate-gas) * [eth\_feeHistory](/rpc-nodes/blast/eth-fee-history) * [eth\_gasPrice](/rpc-nodes/blast/eth-gas-price) * [eth\_getBalance](/rpc-nodes/blast/eth-get-balance) * [eth\_getBlockByHash](/rpc-nodes/blast/eth-get-block-by-hash) * [eth\_getBlockByNumber](/rpc-nodes/blast/eth-get-block-by-number) * [eth\_getBlockTransactionCountByHash](/rpc-nodes/blast/eth-get-block-transaction-count-by-hash) * [eth\_getBlockTransactionCountByNumber](/rpc-nodes/blast/eth-get-block-transaction-count-by-number) * [eth\_getBlockReceipts](/rpc-nodes/blast/eth-get-block-receipts) * [eth\_getCode](/rpc-nodes/blast/eth-get-code) * [eth\_getLogs](/streams/api-reference/history/get-logs) * [eth\_getProof](/rpc-nodes/blast/eth-get-proof) * [eth\_getStorageAt](/rpc-nodes/blast/eth-get-storage-at) * [eth\_getTransactionByHash](/rpc-nodes/blast/eth-get-transaction-by-hash) * [eth\_getTransactionByBlockHashAndIndex](/rpc-nodes/blast/eth-get-transaction-by-block-hash-and-index) * [eth\_getTransactionByBlockNumberAndIndex](/rpc-nodes/blast/eth-get-transaction-by-block-number-and-index) * [eth\_getTransactionCount](/rpc-nodes/blast/eth-get-transaction-count) * [eth\_getTransactionReceipt](/rpc-nodes/blast/eth-get-transaction-receipt) * [eth\_getUncleByBlockHashAndIndex](/rpc-nodes/blast/eth-get-uncle-by-block-hash-and-index) * [eth\_getUncleByBlockNumberAndIndex](/rpc-nodes/blast/eth-get-uncle-by-block-number-and-index) * [eth\_getUncleCountByBlockHash](/rpc-nodes/blast/eth-get-uncle-count-by-block-hash) * [eth\_getUncleCountByBlockNumber](/rpc-nodes/blast/eth-get-uncle-count-by-block-number) * [eth\_maxPriorityFeePerGas](/rpc-nodes/blast/eth-max-priority-fee-per-gas) * [eth\_sendRawTransaction](/rpc-nodes/blast/eth-send-raw-transaction) # eth_blockNumber Source: https://docs.moralis.com/rpc-nodes/bsc/eth-blockNumber Returns the number of most recent block. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request body No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/bsc/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x4b7" } ``` # eth_call Source: https://docs.moralis.com/rpc-nodes/bsc/eth-call Executes a new message call immediately without creating a transaction on the blockchain. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **from** `string` The address the transaction is sent from **to** `string` *required* The address the transaction is directed to **gas** `string` Integer of the gas provided for the transaction execution **gasPrice** `string` Integer of the gasPrice used for each paid gas **value** `string` Integer of the value sent with this transaction **data** `string` Hash of the method signature and encoded parameters **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ { "from": "0x0000000000000000000000000000000000000000", "to": "0x0000000000000000000000000000000000000000", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0x" }, "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/bsc/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_call", "params": [{"from": "0xb60e8dd61c5d32be8058bb8eb970870f07233155", "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"}, "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x15536ee" } ``` # eth_chainId Source: https://docs.moralis.com/rpc-nodes/bsc/eth-chain-id Returns the chain ID of the current connected node as described in EIP-695. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request body No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/bsc/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_chainId", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` # eth_createAccessList Source: https://docs.moralis.com/rpc-nodes/bsc/eth-create-access-list Creates an access list that you can include in a transaction. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **from** `string` The address the transaction is sent from **to** `string` The address the transaction is directed to **gas** `string` Integer of the gas provided for the transaction execution **gasPrice** `string` Integer of the gasPrice used for each paid gas **maxPriorityFeePerGas** `string` Maximum fee per gas the sender is willing to pay to miners **maxFeePerGas** `string` Maximum total fee per gas the sender is willing to pay **value** `string` Integer of the value sent with this transaction **data** `string` Hash of the method signature and encoded parameters **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ { "from": "0x8ba1f109551bd432803012645haca66c9834d7c6", "to": "0x6b175474e89094c44da98b954eedeac495271d0f", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0xa9059cbb0000000000000000000000008ba1f109551bd432803012645haca66c9834d7c60000000000000000000000000000000000000000000000000de0b6b3a7640000" }, "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/bsc/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_createAccessList", "params": [{"from": "0x8ba1f109551bd432803012645haca66c9834d7c6", "to": "0x6b175474e89094c44da98b954eedeac495271d0f", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0xa9059cbb0000000000000000000000008ba1f109551bd432803012645haca66c9834d7c60000000000000000000000000000000000000000000000000de0b6b3a7640000"}, "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "accessList": [ { "address": "0x6b175474e89094c44da98b954eedeac495271d0f", "storageKeys": [ "0x0000000000000000000000000000000000000000000000000000000000000000" ] } ], "gasUsed": "0x7671" } } ``` # eth_estimateGas Source: https://docs.moralis.com/rpc-nodes/bsc/eth-estimate-gas Generates and returns an estimate of how much gas is necessary to allow the transaction to complete. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **from** `string` The address the transaction is sent from **to** `string` The address the transaction is directed to **gas** `string` Integer of the gas provided for the transaction execution **gasPrice** `string` Integer of the gasPrice used for each paid gas **value** `string` Integer of the value sent with this transaction **data** `string` Hash of the method signature and encoded parameters **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ { "from": "0x8D97689C9818892B700e27F316cc3E41e17fBeb9", "to": "0xd3CdA913deB6f67967B99D67aCDFa1712C293601", "value": "0x186a0" }, "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/bsc/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_estimateGas", "params": [{"from": "0x8D97689C9818892B700e27F316cc3E41e17fBeb9", "to": "0xd3CdA913deB6f67967B99D67aCDFa1712C293601", "value": "0x186a0"}, "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x5208" } ``` # eth_feeHistory Source: https://docs.moralis.com/rpc-nodes/bsc/eth-fee-history Returns historical gas information for a range of blocks. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockCount** `string` *required* Number of blocks in the requested range **newestBlock** `string` *required* Highest number block of the requested range **rewardPercentiles** `array` Array of percentile values to sample from each block's effective priority fees per gas #### Example request `params` ```javascript theme={null} [ "0x4", "latest", [25, 75] ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/bsc/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_feeHistory", "params": ["0x4", "latest", [25, 75]], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": [ "0x7", "0x7", "0x7", "0x7", "0x7" ], "gasUsedRatio": [ 0.026089875, 0.406803, 0.010817, 0.5 ], "baseFeePerBlobGas": [ "0x3319eb", "0x350c54", "0x364072", "0x364072", "0x32279d" ], "blobGasUsedRatio": [ 0.47619047619047616, 0.2857142857142857, 0, 0.3333333333333333 ], "oldestBlock": "0x11b9231", "reward": [ ["0x4a817c800", "0x4a817c800"], ["0x773593c0", "0x773593c0"], ["0x0", "0x0"], ["0x0", "0x0"] ] } } ``` # eth_gasPrice Source: https://docs.moralis.com/rpc-nodes/bsc/eth-gas-price Returns the current price per gas in wei. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/bsc/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x09184e72a000" } ``` # eth_getBalance Source: https://docs.moralis.com/rpc-nodes/bsc/eth-get-balance Returns the balance of the account of given address. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address to check for balance **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/bsc/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0234c8a3397aab58" } ``` # eth_getBlockByHash Source: https://docs.moralis.com/rpc-nodes/bsc/eth-get-block-by-hash Returns information about a block by hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block **fullTransactionObjects** `boolean` *required* If true it returns the full transaction objects, if false only the hashes of the transactions #### Example request `params` ```javascript theme={null} [ "0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c", false ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/bsc/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c", false], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x3319bb0", "blobGasUsed": "0x120000", "difficulty": "0x0", "excessBlobGas": "0xa576243", "extraData": "0xe29ca82051756173617220287175617361722e77696e2920e29ca8", "gasLimit": "0x3938700", "gasUsed": "0x2965eaa", "hash": "0xc319ec0da50d354ce425b63fb6914a42aafdb9ee9807518edd595809e25fbe38", "logsBloom": "0x7feeeb37793b4fdfff7ab7aefde2d7fdfff9575bfef5bdff3fb97bfef7bcddbbdf9d55e77fdf7ead7b98ffd9bb6fefff7e77b163bf9eeebdddd1ffbf376cfbeb7efffef83ffbe9eb7ff7776ab3dcf8bfee7ebaddfffdf7fe3fffdf6ed3f7dff77cf2fd7efffff7a19ef7ffbbe3e8befdb7fff76b6ed6e7ffceeb99ff7eeb5efebfff3fff7da1fb39f9fff3fd7f3f77b6dd0bed39f5fff3bfa7fbbce7f9f6ec6e0fff50bfe7f9f79efff35ff6d93fecfefbffdaf7b7eff35ec6ff42fe7e6f77f7deff7eff57f6aafa597feebdffff7bbd677e27ffbfadfdf57f7e7d2aeeffffff6676ffa7f3f375eb95eecf9ffa235cbfcdefafbf8feed9dc7b56ff2fdfedfefe", "miner": "0x396343362be2a4da1ce0c1c210945346fb82aa49", "mixHash": "0x07444bb5750f746e200e1dcd8d83221b26576d3357b833cc1e434e7966d0e774", "nonce": "0x0000000000000000", "number": "0x1736791", "parentBeaconBlockRoot": "0x2759f248e2d1cb1a2f5c2657c4efcc623dd8ea7f23e8700162e7fccdacedfd5d", "parentHash": "0xdf0e4dee910167d7b1687a6cb677983ce7ed351ae78ab7e2c5ba39d793c80391", "receiptsRoot": "0x5f1c58e498161509245daad0f60319d9abab7f04d2ca60e99a3674cfdc9b8327", "requestsHash": "0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x1ef1e", "stateRoot": "0x728c7e38107037b573d719e67b6872ee3ca4e01b47818598316cd696bfe24f2c", "timestamp": "0x697b4bcb", "transactions": [ "0xbf7bd0cf98c3b65525f1f7267b1d02e7ccd7cd133b137f46723a91cf187616d5", "0x06ac9281da76d530aa19600e2c34aae7564a78702d3eb52b1fb363985473e296" ], "transactionsRoot": "0xa8c680f6ad8ccc7a49db5ab76cbd9194c88e16dbcfa440104f7787e5ba815c4f", "uncles": [], "withdrawals": [ { "index": "0x6f78bfb", "validatorIndex": "0x955f5", "address": "0x5d3ca1842d0988816434ea51ca420182f3f1e31a", "amount": "0x102d2f1" } ], "withdrawalsRoot": "0x9b7ecf1ba575fc02e4b4c14bd65d5ca95c0e066adaae3fc2ef16f5acd90214d8" } } ``` # eth_getBlockByNumber Source: https://docs.moralis.com/rpc-nodes/bsc/eth-get-block-by-number Returns information about a block by block number. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" **fullTransactionObjects** `boolean` *required* If true it returns the full transaction objects, if false only the hashes of the transactions #### Example request `params` ```javascript theme={null} [ "0x1b4", true ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/bsc/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["0x1b4", true], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x3319bb0", "blobGasUsed": "0x120000", "difficulty": "0x0", "excessBlobGas": "0xa576243", "extraData": "0xe29ca82051756173617220287175617361722e77696e2920e29ca8", "gasLimit": "0x3938700", "gasUsed": "0x2965eaa", "hash": "0xc319ec0da50d354ce425b63fb6914a42aafdb9ee9807518edd595809e25fbe38", "logsBloom": "0x7feeeb37793b4fdfff7ab7aefde2d7fdfff9575bfef5bdff3fb97bfef7bcddbbdf9d55e77fdf7ead7b98ffd9bb6fefff7e77b163bf9eeebdddd1ffbf376cfbeb7efffef83ffbe9eb7ff7776ab3dcf8bfee7ebaddfffdf7fe3fffdf6ed3f7dff77cf2fd7efffff7a19ef7ffbbe3e8befdb7fff76b6ed6e7ffceeb99ff7eeb5efebfff3fff7da1fb39f9fff3fd7f3f77b6dd0bed39f5fff3bfa7fbbce7f9f6ec6e0fff50bfe7f9f79efff35ff6d93fecfefbffdaf7b7eff35ec6ff42fe7e6f77f7deff7eff57f6aafa597feebdffff7bbd677e27ffbfadfdf57f7e7d2aeeffffff6676ffa7f3f375eb95eecf9ffa235cbfcdefafbf8feed9dc7b56ff2fdfedfefe", "miner": "0x396343362be2a4da1ce0c1c210945346fb82aa49", "mixHash": "0x07444bb5750f746e200e1dcd8d83221b26576d3357b833cc1e434e7966d0e774", "nonce": "0x0000000000000000", "number": "0x1736791", "parentBeaconBlockRoot": "0x2759f248e2d1cb1a2f5c2657c4efcc623dd8ea7f23e8700162e7fccdacedfd5d", "parentHash": "0xdf0e4dee910167d7b1687a6cb677983ce7ed351ae78ab7e2c5ba39d793c80391", "receiptsRoot": "0x5f1c58e498161509245daad0f60319d9abab7f04d2ca60e99a3674cfdc9b8327", "requestsHash": "0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x1ef1e", "stateRoot": "0x728c7e38107037b573d719e67b6872ee3ca4e01b47818598316cd696bfe24f2c", "timestamp": "0x697b4bcb", "transactions": [ "0xbf7bd0cf98c3b65525f1f7267b1d02e7ccd7cd133b137f46723a91cf187616d5", "0x06ac9281da76d530aa19600e2c34aae7564a78702d3eb52b1fb363985473e296" ], "transactionsRoot": "0xa8c680f6ad8ccc7a49db5ab76cbd9194c88e16dbcfa440104f7787e5ba815c4f", "uncles": [], "withdrawals": [ { "index": "0x6f78bfb", "validatorIndex": "0x955f5", "address": "0x5d3ca1842d0988816434ea51ca420182f3f1e31a", "amount": "0x102d2f1" } ], "withdrawalsRoot": "0x9b7ecf1ba575fc02e4b4c14bd65d5ca95c0e066adaae3fc2ef16f5acd90214d8" } } ``` # eth_getBlockReceipts Source: https://docs.moralis.com/rpc-nodes/bsc/eth-get-block-receipts Returns all transaction receipts for a given block. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" #### Example request `params` ```javascript theme={null} [ "0xf21d9c" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/bsc/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockReceipts", "params": ["0xf21d9c"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": [ { "blockHash": "0x8243343df08b9751f5ca0c5f8c9c0460d8a9b6351066fae0acbd4d3e776de8bb", "blockNumber": "0xf21d9c", "contractAddress": null, "cumulativeGasUsed": "0x5208", "effectiveGasPrice": "0x1dcd6500", "from": "0x8ba1f109551bd432803012645haca66c9834d7c6", "gasUsed": "0x5208", "logs": [], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "status": "0x1", "to": "0x95cED938F7991cd0dFcb48F0a06a40FA1aF46EBC", "transactionHash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "transactionIndex": "0x0", "type": "0x2" } ] } ``` # eth_getBlockTransactionCountByHash Source: https://docs.moralis.com/rpc-nodes/bsc/eth-get-block-transaction-count-by-hash Returns the number of transactions in a block from a block matching the given block hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block #### Example request `params` ```javascript theme={null} [ "0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/bsc/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` # eth_getBlockTransactionCountByNumber Source: https://docs.moralis.com/rpc-nodes/bsc/eth-get-block-transaction-count-by-number Returns the number of transactions in a block matching the given block number. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" #### Example request `params` ```javascript theme={null} [ "0xe8" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/bsc/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["0xe8"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` # eth_getCode Source: https://docs.moralis.com/rpc-nodes/bsc/eth-get-code Returns code at a given address. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address to get the code from **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x2" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/bsc/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getCode", "params": ["0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x2"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x600160008035811a818181146012578301005b601b6001356025565b8060005260206000f25b600060078202905091905056" } ``` # eth_getLogs Source: https://docs.moralis.com/rpc-nodes/bsc/eth-get-logs Returns an array of all logs matching a given filter object. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **fromBlock** `string` Integer block number, or "latest" for the last mined block or "pending", "earliest" for not yet mined transactions **toBlock** `string` Integer block number, or "latest" for the last mined block or "pending", "earliest" for not yet mined transactions **address** `string` Contract address or a list of addresses from which logs should originate **topics** `array` Array of 32 Bytes DATA topics. Topics are order-dependent **blockhash** `string` Using blockhash is equivalent to fromBlock = toBlock = the block number with hash blockhash #### Example request `params` ```javascript theme={null} [ { "fromBlock": "0x1", "toBlock": "0x2", "address": "0x8888f1f195afa192cfee860698584c030f4c9db1", "topics": [ "0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", null, [ "0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x0000000000000000000000000aff3454fce5edbc8cca8697c15331677e6ebccc" ] ] } ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/bsc/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getLogs", "params": [{"fromBlock": "0x1", "toBlock": "0x2", "address": "0x8888f1f195afa192cfee860698584c030f4c9db1", "topics": ["0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", null, ["0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x0000000000000000000000000aff3454fce5edbc8cca8697c15331677e6ebccc"]]}], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": [ { "logIndex": "0x1", "blockNumber": "0x1b4", "blockHash": "0x8216c5785ac562ff41e2dcfdf5785ac562ff41e2dcfdf829c5a142f1fccd7d", "transactionHash": "0xdf829c5a142f1fccd7d8216c5785ac562ff41e2dcfdf5785ac562ff41e2dcf", "transactionIndex": "0x0", "address": "0x16c5785ac562ff41e2dcfdf829c5a142f1fccd7d", "data": "0x0000000000000000000000000000000000000000000000000000000000000000", "topics": [ "0x59ebeb90bc63057b6515673c3ecf9438e5058bca0f92585014eced636878c9a5" ] } ] } ``` # eth_getProof Source: https://docs.moralis.com/rpc-nodes/bsc/eth-get-proof Returns the account and storage values of the specified account including the Merkle-proof. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address of the account or contract **storageKeys** `array` *required* Array of storage-keys which should be proofed and included **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842", [ "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421" ], "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/bsc/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getProof", "params": ["0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842", ["0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"], "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "address": "0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842", "accountProof": [ "0xf90211a090dcaf88c40c7bbc95a912cbdde67c175767b31173df9ee4b0d733bfdd511c43a0babe369f6b12092f49181ae04ca173fb68d1a5456f18d20fa32cba73954052bda0473ecf8a7e36a829e75039a3b055e51b8332cbf03324ab4af2066bbd6fbf0021fa0bbda34753d7aa6c38e603f360244e8f59611921d9e1f128372fec0d586d4f9e0a04e44caecff45c9891f74f6a2156735886eedf6f1a733628ebc802ec79d844648a0a5f3f2f7542148c973977c8a1e154c4300fec92f755f7846f1b734d3ab1d90e7a0e823850f50bf72baae9d1733a36a444ab65d0a6faaba404f0583ce0ca4dad92da0f7a00cbe7d4b30b11faea3ae61b7f1f2b315017e79a3de5ab2dc8bb46a59fdb37a09b3b8d0e0e4c1e3b2d3e8f7c6e5d4c3b2a1e0f9e8d7c6b5a4e3f2e1d0c9b8a7a0b1f8e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0a0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0a0d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a08080" ], "balance": "0x0", "codeHash": "0x5e61b0f7919ab4e6fc7cfa6f3f5f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f", "nonce": "0x0", "storageHash": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "storageProof": [ { "key": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "value": "0x1", "proof": [ "0xf90211a090dcaf88c40c7bbc95a912cbdde67c175767b31173df9ee4b0d733bfdd511c43a0babe369f6b12092f49181ae04ca173fb68d1a5456f18d20fa32cba73954052bda0473ecf8a7e36a829e75039a3b055e51b8332cbf03324ab4af2066bbd6fbf0021fa0bbda34753d7aa6c38e603f360244e8f59611921d9e1f128372fec0d586d4f9e0a04e44caecff45c9891f74f6a2156735886eedf6f1a733628ebc802ec79d844648a0a5f3f2f7542148c973977c8a1e154c4300fec92f755f7846f1b734d3ab1d90e7a0e823850f50bf72baae9d1733a36a444ab65d0a6faaba404f0583ce0ca4dad92da0f7a00cbe7d4b30b11faea3ae61b7f1f2b315017e79a3de5ab2dc8bb46a59fdb37a09b3b8d0e0e4c1e3b2d3e8f7c6e5d4c3b2a1e0f9e8d7c6b5a4e3f2e1d0c9b8a7a0b1f8e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0a0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0a0d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a08080" ] } ] } } ``` # eth_getStorageAt Source: https://docs.moralis.com/rpc-nodes/bsc/eth-get-storage-at Returns the value from a storage position at a given address. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address of the storage **position** `string` *required* Integer of the position in the storage **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x0", "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/bsc/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x0", "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x00000000000000000000000000000000000000000000000000000000000004d2" } ``` # eth_getTransactionByBlockHashAndIndex Source: https://docs.moralis.com/rpc-nodes/bsc/eth-get-transaction-by-block-hash-and-index Returns information about a transaction by block hash and transaction index position. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block **index** `string` *required* Integer of the transaction index position #### Example request `params` ```javascript theme={null} [ "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/bsc/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5daf3b", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "gas": "0xc350", "gasPrice": "0x4a817c800", "hash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "input": "0x68656c6c6f21", "nonce": "0x15", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "transactionIndex": "0x0", "value": "0xf3dbb76162000", "v": "0x25", "r": "0x1b5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5", "s": "0x5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5c5" } } ``` # eth_getTransactionByBlockNumberAndIndex Source: https://docs.moralis.com/rpc-nodes/bsc/eth-get-transaction-by-block-number-and-index Returns information about a transaction by block number and transaction index position. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* A block number, or the string "earliest", "latest" or "pending" **index** `string` *required* The transaction index position #### Example request `params` ```javascript theme={null} [ "0x5BAE9E", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/bsc/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["0x5BAE9E", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5BAE9E", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "gas": "0xc350", "gasPrice": "0x4a817c800", "hash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "input": "0x68656c6c6f21", "nonce": "0x15", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "transactionIndex": "0x0", "value": "0xf3dbb76162000", "v": "0x25", "r": "0x1b5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5", "s": "0x5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5c5" } } ``` # eth_getTransactionByHash Source: https://docs.moralis.com/rpc-nodes/bsc/eth-get-transaction-by-hash Returns the information about a transaction requested by transaction hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a transaction #### Example request `params` ```javascript theme={null} [ "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/bsc/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5daf3b", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "gas": "0xc350", "gasPrice": "0x4a817c800", "hash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "input": "0x68656c6c6f21", "nonce": "0x15", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "transactionIndex": "0x41", "value": "0xf3dbb76162000", "v": "0x25", "r": "0x1b5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5", "s": "0x5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5c5" } } ``` # eth_getTransactionCount Source: https://docs.moralis.com/rpc-nodes/bsc/eth-get-transaction-count Returns the number of transactions sent from an address. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address to get transaction count for **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/bsc/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` # eth_getTransactionReceipt Source: https://docs.moralis.com/rpc-nodes/bsc/eth-get-transaction-receipt Returns the receipt of a transaction by transaction hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a transaction #### Example request `params` ```javascript theme={null} [ "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/bsc/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "transactionHash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "transactionIndex": "0x41", "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5daf3b", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "cumulativeGasUsed": "0x33bc", "gasUsed": "0x4dc", "contractAddress": null, "logs": [], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "status": "0x1" } } ``` # eth_getUncleByBlockHashAndIndex Source: https://docs.moralis.com/rpc-nodes/bsc/eth-get-uncle-by-block-hash-and-index Returns information about an uncle of a block by hash and uncle index position. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block **index** `string` *required* The uncle's index position #### Example request `params` ```javascript theme={null} [ "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/bsc/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x027f07", "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000", "gasLimit": "0x9f759", "gasUsed": "0x9f759", "hash": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331", "logsBloom": "0x1a060020000015554c000200000003050000200017041014032020801000056020000001000a00d0020204040020012150010010000000280005000c00000000000020c0000000024008104011000080020020000001006100900000024208002000020002100000000000000080000000120080000002003c0000200000000200002010008300300001001031100100040010420000800000000014000004002000000c040200060000000080000000100000000040a2000001000061000042021080400200000410000404080800014008201000c20100500020011000000030001100100024008c80190400402008000020000c0041104218100000000000000002000800000", "miner": "0x4e65fda2159562a496f9f3522f89122a3088497a", "mixHash": "0x99e9d85137db46ef1e85fff042bb15a7b6f46618b7f600b0b4e7fb52fceafc3a", "nonce": "0xfcf4db6d9bce1b8b", "number": "0x1b4", "parentHash": "0xa057c32b6ed8eb5e006cadfad55c7e635549c6e2135c4e6c3a9d5a6a80f72c3", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0x1a7e46b37b26e0c3f67ed4de3b5d3b1ff84a2e0a5e2dcf4d4b0d34b5a22b6e3", "timestamp": "0x55ba467c", "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` # eth_getUncleByBlockNumberAndIndex Source: https://docs.moralis.com/rpc-nodes/bsc/eth-get-uncle-by-block-number-and-index Returns information about an uncle of a block by number and uncle index position. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* A block number, or the string "earliest", "latest" or "pending" **index** `string` *required* The uncle's index position #### Example request `params` ```javascript theme={null} [ "0x29c", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/bsc/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["0x29c", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x027f07", "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000", "gasLimit": "0x9f759", "gasUsed": "0x9f759", "hash": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331", "logsBloom": "0x1a060020000015554c000200000003050000200017041014032020801000056020000001000a00d0020204040020012150010010000000280005000c00000000000020c0000000024008104011000080020020000001006100900000024208002000020002100000000000000080000000120080000002003c0000200000000200002010008300300001001031100100040010420000800000000014000004002000000c040200060000000080000000100000000040a2000001000061000042021080400200000410000404080800014008201000c20100500020011000000030001100100024008c80190400402008000020000c0041104218100000000000000002000800000", "miner": "0x4e65fda2159562a496f9f3522f89122a3088497a", "mixHash": "0x99e9d85137db46ef1e85fff042bb15a7b6f46618b7f600b0b4e7fb52fceafc3a", "nonce": "0xfcf4db6d9bce1b8b", "number": "0x29c", "parentHash": "0xa057c32b6ed8eb5e006cadfad55c7e635549c6e2135c4e6c3a9d5a6a80f72c3", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0x1a7e46b37b26e0c3f67ed4de3b5d3b1ff84a2e0a5e2dcf4d4b0d34b5a22b6e3", "timestamp": "0x55ba467c", "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` # eth_getUncleCountByBlockHash Source: https://docs.moralis.com/rpc-nodes/bsc/eth-get-uncle-count-by-block-hash Returns the number of uncles in a block from a block matching the given block hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block #### Example request `params` ```javascript theme={null} [ "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/bsc/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` # eth_getUncleCountByBlockNumber Source: https://docs.moralis.com/rpc-nodes/bsc/eth-get-uncle-count-by-block-number Returns the number of uncles in a block from a block matching the given block number. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" #### Example request `params` ```javascript theme={null} [ "0x5BAE9E" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/bsc/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["0x5BAE9E"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` # eth_maxPriorityFeePerGas Source: https://docs.moralis.com/rpc-nodes/bsc/eth-max-priority-fee-per-gas Returns a suggestion for the max priority fee per gas for dynamic fee transactions in wei. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/bsc/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_maxPriorityFeePerGas", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x59682f00" } ``` # eth_sendRawTransaction Source: https://docs.moralis.com/rpc-nodes/bsc/eth-send-raw-transaction Submits a pre-signed transaction for broadcast to the network. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **data** `string` *required* The signed transaction data #### Example request `params` ```javascript theme={null} [ "0xf869808504e3b2928082520894f0109fc8df283027b6285cc889f5aa624eac1f55843b9aca008025a0c9cf86333bcb065d140032ecaab5d9281bde80f21b9687b3e94161de42d51895a0727a108a0b8d101465414033c3f705a9c7b826e596766046ee1183dbc8aeaa68" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/bsc/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["0xf869808504e3b2928082520894f0109fc8df283027b6285cc889f5aa624eac1f55843b9aca008025a0c9cf86333bcb065d140032ecaab5d9281bde80f21b9687b3e94161de42d51895a0727a108a0b8d101465414033c3f705a9c7b826e596766046ee1183dbc8aeaa68"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" } ``` # Overview Source: https://docs.moralis.com/rpc-nodes/bsc/overview Explore BNB Smart Chain JSON-RPC methods ## Introduction Binance Smart Chain (BSC) is a blockchain network built for running smart contract–based applications. BSC is compatible with the Ethereum Virtual Machine (EVM), which allows Ethereum dApps and tools to be easily ported over. The network is known for its fast transactions and low fees, making it ideal for decentralized finance (DeFi), decentralized exchanges (DEXs), and other blockchain applications. ## Supported Networks The Binance Smart Chain RPC API is available for the following networks: 1. **Binance Smart Chain Mainnet** 2. **Binance Smart Chain Testnet** ## Network Details | **Network** | **Chain ID** | **Path Parameter** | | :- | :- | :- | | **BNB Smart Chain Mainnet** | 0x38 (56) | `bsc` | | **BNB Smart Chain Testnet** | 0x61 (97) | `bsc-tesnet` | ## Supported RPC Methods * [eth\_blockNumber](/rpc-nodes/bsc/eth-blockNumber) * [eth\_call](/rpc-nodes/bsc/eth-call) * [eth\_chainId](/rpc-nodes/bsc/eth-chain-id) * [eth\_createAccessList](/rpc-nodes/bsc/eth-create-access-list) * [eth\_estimateGas](/rpc-nodes/bsc/eth-estimate-gas) * [eth\_feeHistory](/rpc-nodes/bsc/eth-fee-history) * [eth\_gasPrice](/rpc-nodes/bsc/eth-gas-price) * [eth\_getBalance](/rpc-nodes/bsc/eth-get-balance) * [eth\_getBlockByHash](/rpc-nodes/bsc/eth-get-block-by-hash) * [eth\_getBlockByNumber](/rpc-nodes/bsc/eth-get-block-by-number) * [eth\_getBlockTransactionCountByHash](/rpc-nodes/bsc/eth-get-block-transaction-count-by-hash) * [eth\_getBlockTransactionCountByNumber](/rpc-nodes/bsc/eth-get-block-transaction-count-by-number) * [eth\_getBlockReceipts](/rpc-nodes/bsc/eth-get-block-receipts) * [eth\_getCode](/rpc-nodes/bsc/eth-get-code) * [eth\_getLogs](/streams/api-reference/history/get-logs) * [eth\_getProof](/rpc-nodes/bsc/eth-get-proof) * [eth\_getStorageAt](/rpc-nodes/bsc/eth-get-storage-at) * [eth\_getTransactionByHash](/rpc-nodes/bsc/eth-get-transaction-by-hash) * [eth\_getTransactionByBlockHashAndIndex](/rpc-nodes/bsc/eth-get-transaction-by-block-hash-and-index) * [eth\_getTransactionByBlockNumberAndIndex](/rpc-nodes/bsc/eth-get-transaction-by-block-number-and-index) * [eth\_getTransactionCount](/rpc-nodes/bsc/eth-get-transaction-count) * [eth\_getTransactionReceipt](/rpc-nodes/bsc/eth-get-transaction-receipt) * [eth\_getUncleByBlockHashAndIndex](/rpc-nodes/bsc/eth-get-uncle-by-block-hash-and-index) * [eth\_getUncleByBlockNumberAndIndex](/rpc-nodes/bsc/eth-get-uncle-by-block-number-and-index) * [eth\_getUncleCountByBlockHash](/rpc-nodes/bsc/eth-get-uncle-count-by-block-hash) * [eth\_getUncleCountByBlockNumber](/rpc-nodes/bsc/eth-get-uncle-count-by-block-number) * [eth\_maxPriorityFeePerGas](/rpc-nodes/bsc/eth-max-priority-fee-per-gas) * [eth\_sendRawTransaction](/rpc-nodes/bsc/eth-send-raw-transaction) # eth_blockNumber Source: https://docs.moralis.com/rpc-nodes/ethereum/eth-blockNumber Returns the number of most recent block. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request body No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/eth/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x4b7" } ``` # eth_call Source: https://docs.moralis.com/rpc-nodes/ethereum/eth-call Executes a new message call immediately without creating a transaction on the blockchain. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **from** `string` The address the transaction is sent from **to** `string` *required* The address the transaction is directed to **gas** `string` Integer of the gas provided for the transaction execution **gasPrice** `string` Integer of the gasPrice used for each paid gas **value** `string` Integer of the value sent with this transaction **data** `string` Hash of the method signature and encoded parameters **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ { "from": "0x0000000000000000000000000000000000000000", "to": "0x0000000000000000000000000000000000000000", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0x" }, "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/eth/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_call", "params": [{"from": "0xb60e8dd61c5d32be8058bb8eb970870f07233155", "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"}, "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x15536ee" } ``` # eth_chainId Source: https://docs.moralis.com/rpc-nodes/ethereum/eth-chain-id Returns the chain ID of the current connected node as described in EIP-695. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request body No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/eth/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_chainId", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` # eth_createAccessList Source: https://docs.moralis.com/rpc-nodes/ethereum/eth-create-access-list Creates an access list that you can include in a transaction. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **from** `string` The address the transaction is sent from **to** `string` The address the transaction is directed to **gas** `string` Integer of the gas provided for the transaction execution **gasPrice** `string` Integer of the gasPrice used for each paid gas **maxPriorityFeePerGas** `string` Maximum fee per gas the sender is willing to pay to miners **maxFeePerGas** `string` Maximum total fee per gas the sender is willing to pay **value** `string` Integer of the value sent with this transaction **data** `string` Hash of the method signature and encoded parameters **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ { "from": "0x8ba1f109551bd432803012645haca66c9834d7c6", "to": "0x6b175474e89094c44da98b954eedeac495271d0f", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0xa9059cbb0000000000000000000000008ba1f109551bd432803012645haca66c9834d7c60000000000000000000000000000000000000000000000000de0b6b3a7640000" }, "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/eth/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_createAccessList", "params": [{"from": "0x8ba1f109551bd432803012645haca66c9834d7c6", "to": "0x6b175474e89094c44da98b954eedeac495271d0f", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0xa9059cbb0000000000000000000000008ba1f109551bd432803012645haca66c9834d7c60000000000000000000000000000000000000000000000000de0b6b3a7640000"}, "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "accessList": [ { "address": "0x6b175474e89094c44da98b954eedeac495271d0f", "storageKeys": [ "0x0000000000000000000000000000000000000000000000000000000000000000" ] } ], "gasUsed": "0x7671" } } ``` # eth_estimateGas Source: https://docs.moralis.com/rpc-nodes/ethereum/eth-estimate-gas Generates and returns an estimate of how much gas is necessary to allow the transaction to complete. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **from** `string` The address the transaction is sent from **to** `string` The address the transaction is directed to **gas** `string` Integer of the gas provided for the transaction execution **gasPrice** `string` Integer of the gasPrice used for each paid gas **value** `string` Integer of the value sent with this transaction **data** `string` Hash of the method signature and encoded parameters **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ { "from": "0x8D97689C9818892B700e27F316cc3E41e17fBeb9", "to": "0xd3CdA913deB6f67967B99D67aCDFa1712C293601", "value": "0x186a0" }, "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/eth/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_estimateGas", "params": [{"from": "0x8D97689C9818892B700e27F316cc3E41e17fBeb9", "to": "0xd3CdA913deB6f67967B99D67aCDFa1712C293601", "value": "0x186a0"}, "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x5208" } ``` # eth_feeHistory Source: https://docs.moralis.com/rpc-nodes/ethereum/eth-fee-history Returns historical gas information for a range of blocks. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockCount** `string` *required* Number of blocks in the requested range **newestBlock** `string` *required* Highest number block of the requested range **rewardPercentiles** `array` Array of percentile values to sample from each block's effective priority fees per gas #### Example request `params` ```javascript theme={null} [ "0x4", "latest", [25, 75] ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/eth/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_feeHistory", "params": ["0x4", "latest", [25, 75]], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": [ "0x7", "0x7", "0x7", "0x7", "0x7" ], "gasUsedRatio": [ 0.026089875, 0.406803, 0.010817, 0.5 ], "baseFeePerBlobGas": [ "0x3319eb", "0x350c54", "0x364072", "0x364072", "0x32279d" ], "blobGasUsedRatio": [ 0.47619047619047616, 0.2857142857142857, 0, 0.3333333333333333 ], "oldestBlock": "0x11b9231", "reward": [ ["0x4a817c800", "0x4a817c800"], ["0x773593c0", "0x773593c0"], ["0x0", "0x0"], ["0x0", "0x0"] ] } } ``` # eth_gasPrice Source: https://docs.moralis.com/rpc-nodes/ethereum/eth-gas-price Returns the current price per gas in wei. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/eth/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x09184e72a000" } ``` # eth_getBalance Source: https://docs.moralis.com/rpc-nodes/ethereum/eth-get-balance Returns the balance of the account of given address. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address to check for balance **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/eth/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0234c8a3397aab58" } ``` # eth_getBlockByHash Source: https://docs.moralis.com/rpc-nodes/ethereum/eth-get-block-by-hash Returns information about a block by hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block **fullTransactionObjects** `boolean` *required* If true it returns the full transaction objects, if false only the hashes of the transactions #### Example request `params` ```javascript theme={null} [ "0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c", false ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/eth/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c", false], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x3319bb0", "blobGasUsed": "0x120000", "difficulty": "0x0", "excessBlobGas": "0xa576243", "extraData": "0xe29ca82051756173617220287175617361722e77696e2920e29ca8", "gasLimit": "0x3938700", "gasUsed": "0x2965eaa", "hash": "0xc319ec0da50d354ce425b63fb6914a42aafdb9ee9807518edd595809e25fbe38", "logsBloom": "0x7feeeb37793b4fdfff7ab7aefde2d7fdfff9575bfef5bdff3fb97bfef7bcddbbdf9d55e77fdf7ead7b98ffd9bb6fefff7e77b163bf9eeebdddd1ffbf376cfbeb7efffef83ffbe9eb7ff7776ab3dcf8bfee7ebaddfffdf7fe3fffdf6ed3f7dff77cf2fd7efffff7a19ef7ffbbe3e8befdb7fff76b6ed6e7ffceeb99ff7eeb5efebfff3fff7da1fb39f9fff3fd7f3f77b6dd0bed39f5fff3bfa7fbbce7f9f6ec6e0fff50bfe7f9f79efff35ff6d93fecfefbffdaf7b7eff35ec6ff42fe7e6f77f7deff7eff57f6aafa597feebdffff7bbd677e27ffbfadfdf57f7e7d2aeeffffff6676ffa7f3f375eb95eecf9ffa235cbfcdefafbf8feed9dc7b56ff2fdfedfefe", "miner": "0x396343362be2a4da1ce0c1c210945346fb82aa49", "mixHash": "0x07444bb5750f746e200e1dcd8d83221b26576d3357b833cc1e434e7966d0e774", "nonce": "0x0000000000000000", "number": "0x1736791", "parentBeaconBlockRoot": "0x2759f248e2d1cb1a2f5c2657c4efcc623dd8ea7f23e8700162e7fccdacedfd5d", "parentHash": "0xdf0e4dee910167d7b1687a6cb677983ce7ed351ae78ab7e2c5ba39d793c80391", "receiptsRoot": "0x5f1c58e498161509245daad0f60319d9abab7f04d2ca60e99a3674cfdc9b8327", "requestsHash": "0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x1ef1e", "stateRoot": "0x728c7e38107037b573d719e67b6872ee3ca4e01b47818598316cd696bfe24f2c", "timestamp": "0x697b4bcb", "transactions": [ "0xbf7bd0cf98c3b65525f1f7267b1d02e7ccd7cd133b137f46723a91cf187616d5", "0x06ac9281da76d530aa19600e2c34aae7564a78702d3eb52b1fb363985473e296" ], "transactionsRoot": "0xa8c680f6ad8ccc7a49db5ab76cbd9194c88e16dbcfa440104f7787e5ba815c4f", "uncles": [], "withdrawals": [ { "index": "0x6f78bfb", "validatorIndex": "0x955f5", "address": "0x5d3ca1842d0988816434ea51ca420182f3f1e31a", "amount": "0x102d2f1" } ], "withdrawalsRoot": "0x9b7ecf1ba575fc02e4b4c14bd65d5ca95c0e066adaae3fc2ef16f5acd90214d8" } } ``` # eth_getBlockByNumber Source: https://docs.moralis.com/rpc-nodes/ethereum/eth-get-block-by-number Returns information about a block by block number. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" **fullTransactionObjects** `boolean` *required* If true it returns the full transaction objects, if false only the hashes of the transactions #### Example request `params` ```javascript theme={null} [ "0x1b4", true ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/eth/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["0x1b4", true], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x3319bb0", "blobGasUsed": "0x120000", "difficulty": "0x0", "excessBlobGas": "0xa576243", "extraData": "0xe29ca82051756173617220287175617361722e77696e2920e29ca8", "gasLimit": "0x3938700", "gasUsed": "0x2965eaa", "hash": "0xc319ec0da50d354ce425b63fb6914a42aafdb9ee9807518edd595809e25fbe38", "logsBloom": "0x7feeeb37793b4fdfff7ab7aefde2d7fdfff9575bfef5bdff3fb97bfef7bcddbbdf9d55e77fdf7ead7b98ffd9bb6fefff7e77b163bf9eeebdddd1ffbf376cfbeb7efffef83ffbe9eb7ff7776ab3dcf8bfee7ebaddfffdf7fe3fffdf6ed3f7dff77cf2fd7efffff7a19ef7ffbbe3e8befdb7fff76b6ed6e7ffceeb99ff7eeb5efebfff3fff7da1fb39f9fff3fd7f3f77b6dd0bed39f5fff3bfa7fbbce7f9f6ec6e0fff50bfe7f9f79efff35ff6d93fecfefbffdaf7b7eff35ec6ff42fe7e6f77f7deff7eff57f6aafa597feebdffff7bbd677e27ffbfadfdf57f7e7d2aeeffffff6676ffa7f3f375eb95eecf9ffa235cbfcdefafbf8feed9dc7b56ff2fdfedfefe", "miner": "0x396343362be2a4da1ce0c1c210945346fb82aa49", "mixHash": "0x07444bb5750f746e200e1dcd8d83221b26576d3357b833cc1e434e7966d0e774", "nonce": "0x0000000000000000", "number": "0x1736791", "parentBeaconBlockRoot": "0x2759f248e2d1cb1a2f5c2657c4efcc623dd8ea7f23e8700162e7fccdacedfd5d", "parentHash": "0xdf0e4dee910167d7b1687a6cb677983ce7ed351ae78ab7e2c5ba39d793c80391", "receiptsRoot": "0x5f1c58e498161509245daad0f60319d9abab7f04d2ca60e99a3674cfdc9b8327", "requestsHash": "0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x1ef1e", "stateRoot": "0x728c7e38107037b573d719e67b6872ee3ca4e01b47818598316cd696bfe24f2c", "timestamp": "0x697b4bcb", "transactions": [ "0xbf7bd0cf98c3b65525f1f7267b1d02e7ccd7cd133b137f46723a91cf187616d5", "0x06ac9281da76d530aa19600e2c34aae7564a78702d3eb52b1fb363985473e296" ], "transactionsRoot": "0xa8c680f6ad8ccc7a49db5ab76cbd9194c88e16dbcfa440104f7787e5ba815c4f", "uncles": [], "withdrawals": [ { "index": "0x6f78bfb", "validatorIndex": "0x955f5", "address": "0x5d3ca1842d0988816434ea51ca420182f3f1e31a", "amount": "0x102d2f1" } ], "withdrawalsRoot": "0x9b7ecf1ba575fc02e4b4c14bd65d5ca95c0e066adaae3fc2ef16f5acd90214d8" } } ``` # eth_getBlockReceipts Source: https://docs.moralis.com/rpc-nodes/ethereum/eth-get-block-receipts Returns all transaction receipts for a given block. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" #### Example request `params` ```javascript theme={null} [ "0xf21d9c" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/eth/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockReceipts", "params": ["0xf21d9c"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": [ { "blockHash": "0x8243343df08b9751f5ca0c5f8c9c0460d8a9b6351066fae0acbd4d3e776de8bb", "blockNumber": "0xf21d9c", "contractAddress": null, "cumulativeGasUsed": "0x5208", "effectiveGasPrice": "0x1dcd6500", "from": "0x8ba1f109551bd432803012645haca66c9834d7c6", "gasUsed": "0x5208", "logs": [], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "status": "0x1", "to": "0x95cED938F7991cd0dFcb48F0a06a40FA1aF46EBC", "transactionHash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "transactionIndex": "0x0", "type": "0x2" } ] } ``` # eth_getBlockTransactionCountByHash Source: https://docs.moralis.com/rpc-nodes/ethereum/eth-get-block-transaction-count-by-hash Returns the number of transactions in a block from a block matching the given block hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block #### Example request `params` ```javascript theme={null} [ "0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/eth/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` # eth_getBlockTransactionCountByNumber Source: https://docs.moralis.com/rpc-nodes/ethereum/eth-get-block-transaction-count-by-number Returns the number of transactions in a block matching the given block number. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" #### Example request `params` ```javascript theme={null} [ "0xe8" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/eth/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["0xe8"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` # eth_getCode Source: https://docs.moralis.com/rpc-nodes/ethereum/eth-get-code Returns code at a given address. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address to get the code from **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x2" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/eth/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getCode", "params": ["0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x2"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x600160008035811a818181146012578301005b601b6001356025565b8060005260206000f25b600060078202905091905056" } ``` # eth_getLogs Source: https://docs.moralis.com/rpc-nodes/ethereum/eth-get-logs Returns an array of all logs matching a given filter object. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **fromBlock** `string` Integer block number, or "latest" for the last mined block or "pending", "earliest" for not yet mined transactions **toBlock** `string` Integer block number, or "latest" for the last mined block or "pending", "earliest" for not yet mined transactions **address** `string` Contract address or a list of addresses from which logs should originate **topics** `array` Array of 32 Bytes DATA topics. Topics are order-dependent **blockhash** `string` Using blockhash is equivalent to fromBlock = toBlock = the block number with hash blockhash #### Example request `params` ```javascript theme={null} [ { "fromBlock": "0x1", "toBlock": "0x2", "address": "0x8888f1f195afa192cfee860698584c030f4c9db1", "topics": [ "0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", null, [ "0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x0000000000000000000000000aff3454fce5edbc8cca8697c15331677e6ebccc" ] ] } ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/eth/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getLogs", "params": [{"fromBlock": "0x1", "toBlock": "0x2", "address": "0x8888f1f195afa192cfee860698584c030f4c9db1", "topics": ["0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", null, ["0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x0000000000000000000000000aff3454fce5edbc8cca8697c15331677e6ebccc"]]}], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": [ { "logIndex": "0x1", "blockNumber": "0x1b4", "blockHash": "0x8216c5785ac562ff41e2dcfdf5785ac562ff41e2dcfdf829c5a142f1fccd7d", "transactionHash": "0xdf829c5a142f1fccd7d8216c5785ac562ff41e2dcfdf5785ac562ff41e2dcf", "transactionIndex": "0x0", "address": "0x16c5785ac562ff41e2dcfdf829c5a142f1fccd7d", "data": "0x0000000000000000000000000000000000000000000000000000000000000000", "topics": [ "0x59ebeb90bc63057b6515673c3ecf9438e5058bca0f92585014eced636878c9a5" ] } ] } ``` # eth_getProof Source: https://docs.moralis.com/rpc-nodes/ethereum/eth-get-proof Returns the account and storage values of the specified account including the Merkle-proof. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address of the account or contract **storageKeys** `array` *required* Array of storage-keys which should be proofed and included **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842", [ "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421" ], "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/eth/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getProof", "params": ["0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842", ["0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"], "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "address": "0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842", "accountProof": [ "0xf90211a090dcaf88c40c7bbc95a912cbdde67c175767b31173df9ee4b0d733bfdd511c43a0babe369f6b12092f49181ae04ca173fb68d1a5456f18d20fa32cba73954052bda0473ecf8a7e36a829e75039a3b055e51b8332cbf03324ab4af2066bbd6fbf0021fa0bbda34753d7aa6c38e603f360244e8f59611921d9e1f128372fec0d586d4f9e0a04e44caecff45c9891f74f6a2156735886eedf6f1a733628ebc802ec79d844648a0a5f3f2f7542148c973977c8a1e154c4300fec92f755f7846f1b734d3ab1d90e7a0e823850f50bf72baae9d1733a36a444ab65d0a6faaba404f0583ce0ca4dad92da0f7a00cbe7d4b30b11faea3ae61b7f1f2b315017e79a3de5ab2dc8bb46a59fdb37a09b3b8d0e0e4c1e3b2d3e8f7c6e5d4c3b2a1e0f9e8d7c6b5a4e3f2e1d0c9b8a7a0b1f8e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0a0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0a0d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a08080" ], "balance": "0x0", "codeHash": "0x5e61b0f7919ab4e6fc7cfa6f3f5f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f", "nonce": "0x0", "storageHash": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "storageProof": [ { "key": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "value": "0x1", "proof": [ "0xf90211a090dcaf88c40c7bbc95a912cbdde67c175767b31173df9ee4b0d733bfdd511c43a0babe369f6b12092f49181ae04ca173fb68d1a5456f18d20fa32cba73954052bda0473ecf8a7e36a829e75039a3b055e51b8332cbf03324ab4af2066bbd6fbf0021fa0bbda34753d7aa6c38e603f360244e8f59611921d9e1f128372fec0d586d4f9e0a04e44caecff45c9891f74f6a2156735886eedf6f1a733628ebc802ec79d844648a0a5f3f2f7542148c973977c8a1e154c4300fec92f755f7846f1b734d3ab1d90e7a0e823850f50bf72baae9d1733a36a444ab65d0a6faaba404f0583ce0ca4dad92da0f7a00cbe7d4b30b11faea3ae61b7f1f2b315017e79a3de5ab2dc8bb46a59fdb37a09b3b8d0e0e4c1e3b2d3e8f7c6e5d4c3b2a1e0f9e8d7c6b5a4e3f2e1d0c9b8a7a0b1f8e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0a0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0a0d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a08080" ] } ] } } ``` # eth_getStorageAt Source: https://docs.moralis.com/rpc-nodes/ethereum/eth-get-storage-at Returns the value from a storage position at a given address. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address of the storage **position** `string` *required* Integer of the position in the storage **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x0", "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/eth/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x0", "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x00000000000000000000000000000000000000000000000000000000000004d2" } ``` # eth_getTransactionByBlockHashAndIndex Source: https://docs.moralis.com/rpc-nodes/ethereum/eth-get-transaction-by-block-hash-and-index Returns information about a transaction by block hash and transaction index position. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block **index** `string` *required* Integer of the transaction index position #### Example request `params` ```javascript theme={null} [ "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/eth/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5daf3b", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "gas": "0xc350", "gasPrice": "0x4a817c800", "hash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "input": "0x68656c6c6f21", "nonce": "0x15", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "transactionIndex": "0x0", "value": "0xf3dbb76162000", "v": "0x25", "r": "0x1b5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5", "s": "0x5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5c5" } } ``` # eth_getTransactionByBlockNumberAndIndex Source: https://docs.moralis.com/rpc-nodes/ethereum/eth-get-transaction-by-block-number-and-index Returns information about a transaction by block number and transaction index position. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* A block number, or the string "earliest", "latest" or "pending" **index** `string` *required* The transaction index position #### Example request `params` ```javascript theme={null} [ "0x5BAE9E", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/eth/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["0x5BAE9E", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5BAE9E", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "gas": "0xc350", "gasPrice": "0x4a817c800", "hash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "input": "0x68656c6c6f21", "nonce": "0x15", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "transactionIndex": "0x0", "value": "0xf3dbb76162000", "v": "0x25", "r": "0x1b5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5", "s": "0x5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5c5" } } ``` # eth_getTransactionByHash Source: https://docs.moralis.com/rpc-nodes/ethereum/eth-get-transaction-by-hash Returns the information about a transaction requested by transaction hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a transaction #### Example request `params` ```javascript theme={null} [ "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/eth/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5daf3b", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "gas": "0xc350", "gasPrice": "0x4a817c800", "hash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "input": "0x68656c6c6f21", "nonce": "0x15", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "transactionIndex": "0x41", "value": "0xf3dbb76162000", "v": "0x25", "r": "0x1b5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5", "s": "0x5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5c5" } } ``` # eth_getTransactionCount Source: https://docs.moralis.com/rpc-nodes/ethereum/eth-get-transaction-count Returns the number of transactions sent from an address. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address to get transaction count for **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/eth/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` # eth_getTransactionReceipt Source: https://docs.moralis.com/rpc-nodes/ethereum/eth-get-transaction-receipt Returns the receipt of a transaction by transaction hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a transaction #### Example request `params` ```javascript theme={null} [ "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/eth/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "transactionHash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "transactionIndex": "0x41", "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5daf3b", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "cumulativeGasUsed": "0x33bc", "gasUsed": "0x4dc", "contractAddress": null, "logs": [], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "status": "0x1" } } ``` # eth_getUncleByBlockHashAndIndex Source: https://docs.moralis.com/rpc-nodes/ethereum/eth-get-uncle-by-block-hash-and-index Returns information about an uncle of a block by hash and uncle index position. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block **index** `string` *required* The uncle's index position #### Example request `params` ```javascript theme={null} [ "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/eth/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x027f07", "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000", "gasLimit": "0x9f759", "gasUsed": "0x9f759", "hash": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331", "logsBloom": "0x1a060020000015554c000200000003050000200017041014032020801000056020000001000a00d0020204040020012150010010000000280005000c00000000000020c0000000024008104011000080020020000001006100900000024208002000020002100000000000000080000000120080000002003c0000200000000200002010008300300001001031100100040010420000800000000014000004002000000c040200060000000080000000100000000040a2000001000061000042021080400200000410000404080800014008201000c20100500020011000000030001100100024008c80190400402008000020000c0041104218100000000000000002000800000", "miner": "0x4e65fda2159562a496f9f3522f89122a3088497a", "mixHash": "0x99e9d85137db46ef1e85fff042bb15a7b6f46618b7f600b0b4e7fb52fceafc3a", "nonce": "0xfcf4db6d9bce1b8b", "number": "0x1b4", "parentHash": "0xa057c32b6ed8eb5e006cadfad55c7e635549c6e2135c4e6c3a9d5a6a80f72c3", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0x1a7e46b37b26e0c3f67ed4de3b5d3b1ff84a2e0a5e2dcf4d4b0d34b5a22b6e3", "timestamp": "0x55ba467c", "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` # eth_getUncleByBlockNumberAndIndex Source: https://docs.moralis.com/rpc-nodes/ethereum/eth-get-uncle-by-block-number-and-index Returns information about an uncle of a block by number and uncle index position. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* A block number, or the string "earliest", "latest" or "pending" **index** `string` *required* The uncle's index position #### Example request `params` ```javascript theme={null} [ "0x29c", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/eth/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["0x29c", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x027f07", "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000", "gasLimit": "0x9f759", "gasUsed": "0x9f759", "hash": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331", "logsBloom": "0x1a060020000015554c000200000003050000200017041014032020801000056020000001000a00d0020204040020012150010010000000280005000c00000000000020c0000000024008104011000080020020000001006100900000024208002000020002100000000000000080000000120080000002003c0000200000000200002010008300300001001031100100040010420000800000000014000004002000000c040200060000000080000000100000000040a2000001000061000042021080400200000410000404080800014008201000c20100500020011000000030001100100024008c80190400402008000020000c0041104218100000000000000002000800000", "miner": "0x4e65fda2159562a496f9f3522f89122a3088497a", "mixHash": "0x99e9d85137db46ef1e85fff042bb15a7b6f46618b7f600b0b4e7fb52fceafc3a", "nonce": "0xfcf4db6d9bce1b8b", "number": "0x29c", "parentHash": "0xa057c32b6ed8eb5e006cadfad55c7e635549c6e2135c4e6c3a9d5a6a80f72c3", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0x1a7e46b37b26e0c3f67ed4de3b5d3b1ff84a2e0a5e2dcf4d4b0d34b5a22b6e3", "timestamp": "0x55ba467c", "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` # eth_getUncleCountByBlockHash Source: https://docs.moralis.com/rpc-nodes/ethereum/eth-get-uncle-count-by-block-hash Returns the number of uncles in a block from a block matching the given block hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block #### Example request `params` ```javascript theme={null} [ "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/eth/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` # eth_getUncleCountByBlockNumber Source: https://docs.moralis.com/rpc-nodes/ethereum/eth-get-uncle-count-by-block-number Returns the number of uncles in a block from a block matching the given block number. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" #### Example request `params` ```javascript theme={null} [ "0x5BAE9E" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/eth/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["0x5BAE9E"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` # eth_maxPriorityFeePerGas Source: https://docs.moralis.com/rpc-nodes/ethereum/eth-max-priority-fee-per-gas Returns a suggestion for the max priority fee per gas for dynamic fee transactions in wei. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/eth/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_maxPriorityFeePerGas", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x59682f00" } ``` # eth_sendRawTransaction Source: https://docs.moralis.com/rpc-nodes/ethereum/eth-send-raw-transaction Submits a pre-signed transaction for broadcast to the network. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **data** `string` *required* The signed transaction data #### Example request `params` ```javascript theme={null} [ "0xf869808504e3b2928082520894f0109fc8df283027b6285cc889f5aa624eac1f55843b9aca008025a0c9cf86333bcb065d140032ecaab5d9281bde80f21b9687b3e94161de42d51895a0727a108a0b8d101465414033c3f705a9c7b826e596766046ee1183dbc8aeaa68" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/eth/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["0xf869808504e3b2928082520894f0109fc8df283027b6285cc889f5aa624eac1f55843b9aca008025a0c9cf86333bcb065d140032ecaab5d9281bde80f21b9687b3e94161de42d51895a0727a108a0b8d101465414033c3f705a9c7b826e596766046ee1183dbc8aeaa68"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" } ``` # Overview Source: https://docs.moralis.com/rpc-nodes/ethereum/overview Explore Ethereum JSON-RPC methods ## Introduction Ethereum is the pioneering smart contract platform that enables developers to build decentralized applications (dApps) on a permissionless blockchain. It supports smart contracts, decentralized finance (DeFi), and a broad array of token standards, including ERC-20 and ERC-721. Ethereum’s consensus mechanism transitioned from Proof of Work (PoW) to Proof of Stake (PoS) with the Ethereum 2.0 upgrade, making it more energy-efficient. As the largest smart contract platform by market capitalization and developer activity, Ethereum remains a leader in the blockchain space. ## Supported Networks The Ethereum RPC API is available for the following networks: 1. **Ethereum Mainnet** 2. **Ethereum Sepolia Testnet** ## Network Details | **Network** | **Chain ID** | **Path Parameter** | | :- | :- | :- | | **Ethereum Mainnet** | 0x1 (1) | `eth` | | **Ethereum Sepolia** | 0xaa36a7 (11155111) | `sepolia` | ## Supported RPC Methods * [eth\_blockNumber](/rpc-nodes/ethereum/eth-blockNumber) * [eth\_call](/rpc-nodes/ethereum/eth-call) * [eth\_chainId](/rpc-nodes/ethereum/eth-chain-id) * [eth\_createAccessList](/rpc-nodes/ethereum/eth-create-access-list) * [eth\_estimateGas](/rpc-nodes/ethereum/eth-estimate-gas) * [eth\_feeHistory](/rpc-nodes/ethereum/eth-fee-history) * [eth\_gasPrice](/rpc-nodes/ethereum/eth-gas-price) * [eth\_getBalance](/rpc-nodes/ethereum/eth-get-balance) * [eth\_getBlockByHash](/rpc-nodes/ethereum/eth-get-block-by-hash) * [eth\_getBlockByNumber](/rpc-nodes/ethereum/eth-get-block-by-number) * [eth\_getBlockTransactionCountByHash](/rpc-nodes/ethereum/eth-get-block-transaction-count-by-hash) * [eth\_getBlockTransactionCountByNumber](/rpc-nodes/ethereum/eth-get-block-transaction-count-by-number) * [eth\_getBlockReceipts](/rpc-nodes/ethereum/eth-get-block-receipts) * [eth\_getCode](/rpc-nodes/ethereum/eth-get-code) * [eth\_getLogs](/streams/api-reference/history/get-logs) * [eth\_getProof](/rpc-nodes/ethereum/eth-get-proof) * [eth\_getStorageAt](/rpc-nodes/ethereum/eth-get-storage-at) * [eth\_getTransactionByHash](/rpc-nodes/ethereum/eth-get-transaction-by-hash) * [eth\_getTransactionByBlockHashAndIndex](/rpc-nodes/ethereum/eth-get-transaction-by-block-hash-and-index) * [eth\_getTransactionByBlockNumberAndIndex](/rpc-nodes/ethereum/eth-get-transaction-by-block-number-and-index) * [eth\_getTransactionCount](/rpc-nodes/ethereum/eth-get-transaction-count) * [eth\_getTransactionReceipt](/rpc-nodes/ethereum/eth-get-transaction-receipt) * [eth\_getUncleByBlockHashAndIndex](/rpc-nodes/ethereum/eth-get-uncle-by-block-hash-and-index) * [eth\_getUncleByBlockNumberAndIndex](/rpc-nodes/ethereum/eth-get-uncle-by-block-number-and-index) * [eth\_getUncleCountByBlockHash](/rpc-nodes/ethereum/eth-get-uncle-count-by-block-hash) * [eth\_getUncleCountByBlockNumber](/rpc-nodes/ethereum/eth-get-uncle-count-by-block-number) * [eth\_maxPriorityFeePerGas](/rpc-nodes/ethereum/eth-max-priority-fee-per-gas) * [eth\_sendRawTransaction](/rpc-nodes/ethereum/eth-send-raw-transaction) # eth_blockNumber Source: https://docs.moralis.com/rpc-nodes/flow/eth-blockNumber Returns the number of most recent block. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request body No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/flow/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x4b7" } ``` # eth_call Source: https://docs.moralis.com/rpc-nodes/flow/eth-call Executes a new message call immediately without creating a transaction on the blockchain. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **from** `string` The address the transaction is sent from **to** `string` *required* The address the transaction is directed to **gas** `string` Integer of the gas provided for the transaction execution **gasPrice** `string` Integer of the gasPrice used for each paid gas **value** `string` Integer of the value sent with this transaction **data** `string` Hash of the method signature and encoded parameters **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ { "from": "0x0000000000000000000000000000000000000000", "to": "0x0000000000000000000000000000000000000000", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0x" }, "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/flow/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_call", "params": [{"from": "0xb60e8dd61c5d32be8058bb8eb970870f07233155", "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"}, "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x15536ee" } ``` # eth_chainId Source: https://docs.moralis.com/rpc-nodes/flow/eth-chain-id Returns the chain ID of the current connected node as described in EIP-695. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request body No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/flow/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_chainId", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` # eth_createAccessList Source: https://docs.moralis.com/rpc-nodes/flow/eth-create-access-list Creates an access list that you can include in a transaction. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **from** `string` The address the transaction is sent from **to** `string` The address the transaction is directed to **gas** `string` Integer of the gas provided for the transaction execution **gasPrice** `string` Integer of the gasPrice used for each paid gas **maxPriorityFeePerGas** `string` Maximum fee per gas the sender is willing to pay to miners **maxFeePerGas** `string` Maximum total fee per gas the sender is willing to pay **value** `string` Integer of the value sent with this transaction **data** `string` Hash of the method signature and encoded parameters **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ { "from": "0x8ba1f109551bd432803012645haca66c9834d7c6", "to": "0x6b175474e89094c44da98b954eedeac495271d0f", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0xa9059cbb0000000000000000000000008ba1f109551bd432803012645haca66c9834d7c60000000000000000000000000000000000000000000000000de0b6b3a7640000" }, "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/flow/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_createAccessList", "params": [{"from": "0x8ba1f109551bd432803012645haca66c9834d7c6", "to": "0x6b175474e89094c44da98b954eedeac495271d0f", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0xa9059cbb0000000000000000000000008ba1f109551bd432803012645haca66c9834d7c60000000000000000000000000000000000000000000000000de0b6b3a7640000"}, "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "accessList": [ { "address": "0x6b175474e89094c44da98b954eedeac495271d0f", "storageKeys": [ "0x0000000000000000000000000000000000000000000000000000000000000000" ] } ], "gasUsed": "0x7671" } } ``` # eth_estimateGas Source: https://docs.moralis.com/rpc-nodes/flow/eth-estimate-gas Generates and returns an estimate of how much gas is necessary to allow the transaction to complete. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **from** `string` The address the transaction is sent from **to** `string` The address the transaction is directed to **gas** `string` Integer of the gas provided for the transaction execution **gasPrice** `string` Integer of the gasPrice used for each paid gas **value** `string` Integer of the value sent with this transaction **data** `string` Hash of the method signature and encoded parameters **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ { "from": "0x8D97689C9818892B700e27F316cc3E41e17fBeb9", "to": "0xd3CdA913deB6f67967B99D67aCDFa1712C293601", "value": "0x186a0" }, "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/flow/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_estimateGas", "params": [{"from": "0x8D97689C9818892B700e27F316cc3E41e17fBeb9", "to": "0xd3CdA913deB6f67967B99D67aCDFa1712C293601", "value": "0x186a0"}, "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x5208" } ``` # eth_feeHistory Source: https://docs.moralis.com/rpc-nodes/flow/eth-fee-history Returns historical gas information for a range of blocks. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockCount** `string` *required* Number of blocks in the requested range **newestBlock** `string` *required* Highest number block of the requested range **rewardPercentiles** `array` Array of percentile values to sample from each block's effective priority fees per gas #### Example request `params` ```javascript theme={null} [ "0x4", "latest", [25, 75] ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/flow/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_feeHistory", "params": ["0x4", "latest", [25, 75]], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": [ "0x7", "0x7", "0x7", "0x7", "0x7" ], "gasUsedRatio": [ 0.026089875, 0.406803, 0.010817, 0.5 ], "baseFeePerBlobGas": [ "0x3319eb", "0x350c54", "0x364072", "0x364072", "0x32279d" ], "blobGasUsedRatio": [ 0.47619047619047616, 0.2857142857142857, 0, 0.3333333333333333 ], "oldestBlock": "0x11b9231", "reward": [ ["0x4a817c800", "0x4a817c800"], ["0x773593c0", "0x773593c0"], ["0x0", "0x0"], ["0x0", "0x0"] ] } } ``` # eth_gasPrice Source: https://docs.moralis.com/rpc-nodes/flow/eth-gas-price Returns the current price per gas in wei. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/flow/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x09184e72a000" } ``` # eth_getBalance Source: https://docs.moralis.com/rpc-nodes/flow/eth-get-balance Returns the balance of the account of given address. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address to check for balance **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/flow/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0234c8a3397aab58" } ``` # eth_getBlockByHash Source: https://docs.moralis.com/rpc-nodes/flow/eth-get-block-by-hash Returns information about a block by hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block **fullTransactionObjects** `boolean` *required* If true it returns the full transaction objects, if false only the hashes of the transactions #### Example request `params` ```javascript theme={null} [ "0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c", false ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/flow/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c", false], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x3319bb0", "blobGasUsed": "0x120000", "difficulty": "0x0", "excessBlobGas": "0xa576243", "extraData": "0xe29ca82051756173617220287175617361722e77696e2920e29ca8", "gasLimit": "0x3938700", "gasUsed": "0x2965eaa", "hash": "0xc319ec0da50d354ce425b63fb6914a42aafdb9ee9807518edd595809e25fbe38", "logsBloom": "0x7feeeb37793b4fdfff7ab7aefde2d7fdfff9575bfef5bdff3fb97bfef7bcddbbdf9d55e77fdf7ead7b98ffd9bb6fefff7e77b163bf9eeebdddd1ffbf376cfbeb7efffef83ffbe9eb7ff7776ab3dcf8bfee7ebaddfffdf7fe3fffdf6ed3f7dff77cf2fd7efffff7a19ef7ffbbe3e8befdb7fff76b6ed6e7ffceeb99ff7eeb5efebfff3fff7da1fb39f9fff3fd7f3f77b6dd0bed39f5fff3bfa7fbbce7f9f6ec6e0fff50bfe7f9f79efff35ff6d93fecfefbffdaf7b7eff35ec6ff42fe7e6f77f7deff7eff57f6aafa597feebdffff7bbd677e27ffbfadfdf57f7e7d2aeeffffff6676ffa7f3f375eb95eecf9ffa235cbfcdefafbf8feed9dc7b56ff2fdfedfefe", "miner": "0x396343362be2a4da1ce0c1c210945346fb82aa49", "mixHash": "0x07444bb5750f746e200e1dcd8d83221b26576d3357b833cc1e434e7966d0e774", "nonce": "0x0000000000000000", "number": "0x1736791", "parentBeaconBlockRoot": "0x2759f248e2d1cb1a2f5c2657c4efcc623dd8ea7f23e8700162e7fccdacedfd5d", "parentHash": "0xdf0e4dee910167d7b1687a6cb677983ce7ed351ae78ab7e2c5ba39d793c80391", "receiptsRoot": "0x5f1c58e498161509245daad0f60319d9abab7f04d2ca60e99a3674cfdc9b8327", "requestsHash": "0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x1ef1e", "stateRoot": "0x728c7e38107037b573d719e67b6872ee3ca4e01b47818598316cd696bfe24f2c", "timestamp": "0x697b4bcb", "transactions": [ "0xbf7bd0cf98c3b65525f1f7267b1d02e7ccd7cd133b137f46723a91cf187616d5", "0x06ac9281da76d530aa19600e2c34aae7564a78702d3eb52b1fb363985473e296" ], "transactionsRoot": "0xa8c680f6ad8ccc7a49db5ab76cbd9194c88e16dbcfa440104f7787e5ba815c4f", "uncles": [], "withdrawals": [ { "index": "0x6f78bfb", "validatorIndex": "0x955f5", "address": "0x5d3ca1842d0988816434ea51ca420182f3f1e31a", "amount": "0x102d2f1" } ], "withdrawalsRoot": "0x9b7ecf1ba575fc02e4b4c14bd65d5ca95c0e066adaae3fc2ef16f5acd90214d8" } } ``` # eth_getBlockByNumber Source: https://docs.moralis.com/rpc-nodes/flow/eth-get-block-by-number Returns information about a block by block number. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" **fullTransactionObjects** `boolean` *required* If true it returns the full transaction objects, if false only the hashes of the transactions #### Example request `params` ```javascript theme={null} [ "0x1b4", true ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/flow/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["0x1b4", true], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x3319bb0", "blobGasUsed": "0x120000", "difficulty": "0x0", "excessBlobGas": "0xa576243", "extraData": "0xe29ca82051756173617220287175617361722e77696e2920e29ca8", "gasLimit": "0x3938700", "gasUsed": "0x2965eaa", "hash": "0xc319ec0da50d354ce425b63fb6914a42aafdb9ee9807518edd595809e25fbe38", "logsBloom": "0x7feeeb37793b4fdfff7ab7aefde2d7fdfff9575bfef5bdff3fb97bfef7bcddbbdf9d55e77fdf7ead7b98ffd9bb6fefff7e77b163bf9eeebdddd1ffbf376cfbeb7efffef83ffbe9eb7ff7776ab3dcf8bfee7ebaddfffdf7fe3fffdf6ed3f7dff77cf2fd7efffff7a19ef7ffbbe3e8befdb7fff76b6ed6e7ffceeb99ff7eeb5efebfff3fff7da1fb39f9fff3fd7f3f77b6dd0bed39f5fff3bfa7fbbce7f9f6ec6e0fff50bfe7f9f79efff35ff6d93fecfefbffdaf7b7eff35ec6ff42fe7e6f77f7deff7eff57f6aafa597feebdffff7bbd677e27ffbfadfdf57f7e7d2aeeffffff6676ffa7f3f375eb95eecf9ffa235cbfcdefafbf8feed9dc7b56ff2fdfedfefe", "miner": "0x396343362be2a4da1ce0c1c210945346fb82aa49", "mixHash": "0x07444bb5750f746e200e1dcd8d83221b26576d3357b833cc1e434e7966d0e774", "nonce": "0x0000000000000000", "number": "0x1736791", "parentBeaconBlockRoot": "0x2759f248e2d1cb1a2f5c2657c4efcc623dd8ea7f23e8700162e7fccdacedfd5d", "parentHash": "0xdf0e4dee910167d7b1687a6cb677983ce7ed351ae78ab7e2c5ba39d793c80391", "receiptsRoot": "0x5f1c58e498161509245daad0f60319d9abab7f04d2ca60e99a3674cfdc9b8327", "requestsHash": "0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x1ef1e", "stateRoot": "0x728c7e38107037b573d719e67b6872ee3ca4e01b47818598316cd696bfe24f2c", "timestamp": "0x697b4bcb", "transactions": [ "0xbf7bd0cf98c3b65525f1f7267b1d02e7ccd7cd133b137f46723a91cf187616d5", "0x06ac9281da76d530aa19600e2c34aae7564a78702d3eb52b1fb363985473e296" ], "transactionsRoot": "0xa8c680f6ad8ccc7a49db5ab76cbd9194c88e16dbcfa440104f7787e5ba815c4f", "uncles": [], "withdrawals": [ { "index": "0x6f78bfb", "validatorIndex": "0x955f5", "address": "0x5d3ca1842d0988816434ea51ca420182f3f1e31a", "amount": "0x102d2f1" } ], "withdrawalsRoot": "0x9b7ecf1ba575fc02e4b4c14bd65d5ca95c0e066adaae3fc2ef16f5acd90214d8" } } ``` # eth_getBlockReceipts Source: https://docs.moralis.com/rpc-nodes/flow/eth-get-block-receipts Returns all transaction receipts for a given block. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" #### Example request `params` ```javascript theme={null} [ "0xf21d9c" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/flow/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockReceipts", "params": ["0xf21d9c"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": [ { "blockHash": "0x8243343df08b9751f5ca0c5f8c9c0460d8a9b6351066fae0acbd4d3e776de8bb", "blockNumber": "0xf21d9c", "contractAddress": null, "cumulativeGasUsed": "0x5208", "effectiveGasPrice": "0x1dcd6500", "from": "0x8ba1f109551bd432803012645haca66c9834d7c6", "gasUsed": "0x5208", "logs": [], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "status": "0x1", "to": "0x95cED938F7991cd0dFcb48F0a06a40FA1aF46EBC", "transactionHash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "transactionIndex": "0x0", "type": "0x2" } ] } ``` # eth_getBlockTransactionCountByHash Source: https://docs.moralis.com/rpc-nodes/flow/eth-get-block-transaction-count-by-hash Returns the number of transactions in a block from a block matching the given block hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block #### Example request `params` ```javascript theme={null} [ "0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/flow/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` # eth_getBlockTransactionCountByNumber Source: https://docs.moralis.com/rpc-nodes/flow/eth-get-block-transaction-count-by-number Returns the number of transactions in a block matching the given block number. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" #### Example request `params` ```javascript theme={null} [ "0xe8" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/flow/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["0xe8"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` # eth_getCode Source: https://docs.moralis.com/rpc-nodes/flow/eth-get-code Returns code at a given address. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address to get the code from **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x2" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/flow/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getCode", "params": ["0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x2"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x600160008035811a818181146012578301005b601b6001356025565b8060005260206000f25b600060078202905091905056" } ``` # eth_getLogs Source: https://docs.moralis.com/rpc-nodes/flow/eth-get-logs Returns an array of all logs matching a given filter object. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **fromBlock** `string` Integer block number, or "latest" for the last mined block or "pending", "earliest" for not yet mined transactions **toBlock** `string` Integer block number, or "latest" for the last mined block or "pending", "earliest" for not yet mined transactions **address** `string` Contract address or a list of addresses from which logs should originate **topics** `array` Array of 32 Bytes DATA topics. Topics are order-dependent **blockhash** `string` Using blockhash is equivalent to fromBlock = toBlock = the block number with hash blockhash #### Example request `params` ```javascript theme={null} [ { "fromBlock": "0x1", "toBlock": "0x2", "address": "0x8888f1f195afa192cfee860698584c030f4c9db1", "topics": [ "0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", null, [ "0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x0000000000000000000000000aff3454fce5edbc8cca8697c15331677e6ebccc" ] ] } ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/flow/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getLogs", "params": [{"fromBlock": "0x1", "toBlock": "0x2", "address": "0x8888f1f195afa192cfee860698584c030f4c9db1", "topics": ["0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", null, ["0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x0000000000000000000000000aff3454fce5edbc8cca8697c15331677e6ebccc"]]}], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": [ { "logIndex": "0x1", "blockNumber": "0x1b4", "blockHash": "0x8216c5785ac562ff41e2dcfdf5785ac562ff41e2dcfdf829c5a142f1fccd7d", "transactionHash": "0xdf829c5a142f1fccd7d8216c5785ac562ff41e2dcfdf5785ac562ff41e2dcf", "transactionIndex": "0x0", "address": "0x16c5785ac562ff41e2dcfdf829c5a142f1fccd7d", "data": "0x0000000000000000000000000000000000000000000000000000000000000000", "topics": [ "0x59ebeb90bc63057b6515673c3ecf9438e5058bca0f92585014eced636878c9a5" ] } ] } ``` # eth_getProof Source: https://docs.moralis.com/rpc-nodes/flow/eth-get-proof Returns the account and storage values of the specified account including the Merkle-proof. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address of the account or contract **storageKeys** `array` *required* Array of storage-keys which should be proofed and included **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842", [ "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421" ], "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/flow/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getProof", "params": ["0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842", ["0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"], "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "address": "0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842", "accountProof": [ "0xf90211a090dcaf88c40c7bbc95a912cbdde67c175767b31173df9ee4b0d733bfdd511c43a0babe369f6b12092f49181ae04ca173fb68d1a5456f18d20fa32cba73954052bda0473ecf8a7e36a829e75039a3b055e51b8332cbf03324ab4af2066bbd6fbf0021fa0bbda34753d7aa6c38e603f360244e8f59611921d9e1f128372fec0d586d4f9e0a04e44caecff45c9891f74f6a2156735886eedf6f1a733628ebc802ec79d844648a0a5f3f2f7542148c973977c8a1e154c4300fec92f755f7846f1b734d3ab1d90e7a0e823850f50bf72baae9d1733a36a444ab65d0a6faaba404f0583ce0ca4dad92da0f7a00cbe7d4b30b11faea3ae61b7f1f2b315017e79a3de5ab2dc8bb46a59fdb37a09b3b8d0e0e4c1e3b2d3e8f7c6e5d4c3b2a1e0f9e8d7c6b5a4e3f2e1d0c9b8a7a0b1f8e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0a0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0a0d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a08080" ], "balance": "0x0", "codeHash": "0x5e61b0f7919ab4e6fc7cfa6f3f5f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f", "nonce": "0x0", "storageHash": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "storageProof": [ { "key": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "value": "0x1", "proof": [ "0xf90211a090dcaf88c40c7bbc95a912cbdde67c175767b31173df9ee4b0d733bfdd511c43a0babe369f6b12092f49181ae04ca173fb68d1a5456f18d20fa32cba73954052bda0473ecf8a7e36a829e75039a3b055e51b8332cbf03324ab4af2066bbd6fbf0021fa0bbda34753d7aa6c38e603f360244e8f59611921d9e1f128372fec0d586d4f9e0a04e44caecff45c9891f74f6a2156735886eedf6f1a733628ebc802ec79d844648a0a5f3f2f7542148c973977c8a1e154c4300fec92f755f7846f1b734d3ab1d90e7a0e823850f50bf72baae9d1733a36a444ab65d0a6faaba404f0583ce0ca4dad92da0f7a00cbe7d4b30b11faea3ae61b7f1f2b315017e79a3de5ab2dc8bb46a59fdb37a09b3b8d0e0e4c1e3b2d3e8f7c6e5d4c3b2a1e0f9e8d7c6b5a4e3f2e1d0c9b8a7a0b1f8e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0a0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0a0d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a08080" ] } ] } } ``` # eth_getStorageAt Source: https://docs.moralis.com/rpc-nodes/flow/eth-get-storage-at Returns the value from a storage position at a given address. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address of the storage **position** `string` *required* Integer of the position in the storage **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x0", "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/flow/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x0", "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x00000000000000000000000000000000000000000000000000000000000004d2" } ``` # eth_getTransactionByBlockHashAndIndex Source: https://docs.moralis.com/rpc-nodes/flow/eth-get-transaction-by-block-hash-and-index Returns information about a transaction by block hash and transaction index position. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block **index** `string` *required* Integer of the transaction index position #### Example request `params` ```javascript theme={null} [ "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/flow/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5daf3b", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "gas": "0xc350", "gasPrice": "0x4a817c800", "hash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "input": "0x68656c6c6f21", "nonce": "0x15", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "transactionIndex": "0x0", "value": "0xf3dbb76162000", "v": "0x25", "r": "0x1b5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5", "s": "0x5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5c5" } } ``` # eth_getTransactionByBlockNumberAndIndex Source: https://docs.moralis.com/rpc-nodes/flow/eth-get-transaction-by-block-number-and-index Returns information about a transaction by block number and transaction index position. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* A block number, or the string "earliest", "latest" or "pending" **index** `string` *required* The transaction index position #### Example request `params` ```javascript theme={null} [ "0x5BAE9E", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/flow/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["0x5BAE9E", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5BAE9E", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "gas": "0xc350", "gasPrice": "0x4a817c800", "hash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "input": "0x68656c6c6f21", "nonce": "0x15", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "transactionIndex": "0x0", "value": "0xf3dbb76162000", "v": "0x25", "r": "0x1b5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5", "s": "0x5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5c5" } } ``` # eth_getTransactionByHash Source: https://docs.moralis.com/rpc-nodes/flow/eth-get-transaction-by-hash Returns the information about a transaction requested by transaction hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a transaction #### Example request `params` ```javascript theme={null} [ "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/flow/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5daf3b", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "gas": "0xc350", "gasPrice": "0x4a817c800", "hash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "input": "0x68656c6c6f21", "nonce": "0x15", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "transactionIndex": "0x41", "value": "0xf3dbb76162000", "v": "0x25", "r": "0x1b5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5", "s": "0x5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5c5" } } ``` # eth_getTransactionCount Source: https://docs.moralis.com/rpc-nodes/flow/eth-get-transaction-count Returns the number of transactions sent from an address. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address to get transaction count for **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/flow/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` # eth_getTransactionReceipt Source: https://docs.moralis.com/rpc-nodes/flow/eth-get-transaction-receipt Returns the receipt of a transaction by transaction hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a transaction #### Example request `params` ```javascript theme={null} [ "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/flow/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "transactionHash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "transactionIndex": "0x41", "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5daf3b", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "cumulativeGasUsed": "0x33bc", "gasUsed": "0x4dc", "contractAddress": null, "logs": [], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "status": "0x1" } } ``` # eth_getUncleByBlockHashAndIndex Source: https://docs.moralis.com/rpc-nodes/flow/eth-get-uncle-by-block-hash-and-index Returns information about an uncle of a block by hash and uncle index position. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block **index** `string` *required* The uncle's index position #### Example request `params` ```javascript theme={null} [ "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/flow/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x027f07", "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000", "gasLimit": "0x9f759", "gasUsed": "0x9f759", "hash": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331", "logsBloom": "0x1a060020000015554c000200000003050000200017041014032020801000056020000001000a00d0020204040020012150010010000000280005000c00000000000020c0000000024008104011000080020020000001006100900000024208002000020002100000000000000080000000120080000002003c0000200000000200002010008300300001001031100100040010420000800000000014000004002000000c040200060000000080000000100000000040a2000001000061000042021080400200000410000404080800014008201000c20100500020011000000030001100100024008c80190400402008000020000c0041104218100000000000000002000800000", "miner": "0x4e65fda2159562a496f9f3522f89122a3088497a", "mixHash": "0x99e9d85137db46ef1e85fff042bb15a7b6f46618b7f600b0b4e7fb52fceafc3a", "nonce": "0xfcf4db6d9bce1b8b", "number": "0x1b4", "parentHash": "0xa057c32b6ed8eb5e006cadfad55c7e635549c6e2135c4e6c3a9d5a6a80f72c3", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0x1a7e46b37b26e0c3f67ed4de3b5d3b1ff84a2e0a5e2dcf4d4b0d34b5a22b6e3", "timestamp": "0x55ba467c", "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` # eth_getUncleByBlockNumberAndIndex Source: https://docs.moralis.com/rpc-nodes/flow/eth-get-uncle-by-block-number-and-index Returns information about an uncle of a block by number and uncle index position. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* A block number, or the string "earliest", "latest" or "pending" **index** `string` *required* The uncle's index position #### Example request `params` ```javascript theme={null} [ "0x29c", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/flow/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["0x29c", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x027f07", "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000", "gasLimit": "0x9f759", "gasUsed": "0x9f759", "hash": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331", "logsBloom": "0x1a060020000015554c000200000003050000200017041014032020801000056020000001000a00d0020204040020012150010010000000280005000c00000000000020c0000000024008104011000080020020000001006100900000024208002000020002100000000000000080000000120080000002003c0000200000000200002010008300300001001031100100040010420000800000000014000004002000000c040200060000000080000000100000000040a2000001000061000042021080400200000410000404080800014008201000c20100500020011000000030001100100024008c80190400402008000020000c0041104218100000000000000002000800000", "miner": "0x4e65fda2159562a496f9f3522f89122a3088497a", "mixHash": "0x99e9d85137db46ef1e85fff042bb15a7b6f46618b7f600b0b4e7fb52fceafc3a", "nonce": "0xfcf4db6d9bce1b8b", "number": "0x29c", "parentHash": "0xa057c32b6ed8eb5e006cadfad55c7e635549c6e2135c4e6c3a9d5a6a80f72c3", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0x1a7e46b37b26e0c3f67ed4de3b5d3b1ff84a2e0a5e2dcf4d4b0d34b5a22b6e3", "timestamp": "0x55ba467c", "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` # eth_getUncleCountByBlockHash Source: https://docs.moralis.com/rpc-nodes/flow/eth-get-uncle-count-by-block-hash Returns the number of uncles in a block from a block matching the given block hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block #### Example request `params` ```javascript theme={null} [ "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/flow/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` # eth_getUncleCountByBlockNumber Source: https://docs.moralis.com/rpc-nodes/flow/eth-get-uncle-count-by-block-number Returns the number of uncles in a block from a block matching the given block number. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" #### Example request `params` ```javascript theme={null} [ "0x5BAE9E" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/flow/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["0x5BAE9E"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` # eth_maxPriorityFeePerGas Source: https://docs.moralis.com/rpc-nodes/flow/eth-max-priority-fee-per-gas Returns a suggestion for the max priority fee per gas for dynamic fee transactions in wei. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/flow/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_maxPriorityFeePerGas", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x59682f00" } ``` # eth_sendRawTransaction Source: https://docs.moralis.com/rpc-nodes/flow/eth-send-raw-transaction Submits a pre-signed transaction for broadcast to the network. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **data** `string` *required* The signed transaction data #### Example request `params` ```javascript theme={null} [ "0xf869808504e3b2928082520894f0109fc8df283027b6285cc889f5aa624eac1f55843b9aca008025a0c9cf86333bcb065d140032ecaab5d9281bde80f21b9687b3e94161de42d51895a0727a108a0b8d101465414033c3f705a9c7b826e596766046ee1183dbc8aeaa68" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/flow/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["0xf869808504e3b2928082520894f0109fc8df283027b6285cc889f5aa624eac1f55843b9aca008025a0c9cf86333bcb065d140032ecaab5d9281bde80f21b9687b3e94161de42d51895a0727a108a0b8d101465414033c3f705a9c7b826e596766046ee1183dbc8aeaa68"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" } ``` # Overview Source: https://docs.moralis.com/rpc-nodes/flow/overview Explore Flow JSON-RPC methods ## Introduction Flow is a fast, decentralized, and developer-friendly blockchain designed to support the next generation of digital assets and applications. It is built to scale without sharding, providing a great developer experience and making it easier to build dApps, NFTs, and games with real-world usability. Flow enables the seamless creation of decentralized applications that prioritize security, scalability, and ease of use. ## Supported Networks The Flow RPC API is available for the following networks: 1. **Flow Mainnet** 2. **Flow Testnet** ## Network Details | **Network** | **Chain ID** | **Path Parameter** | | :- | :- | :- | | **Flow Mainnet** | 0x2eb (747) | `flow` | | **Flow Testnet** | 0x221 (545) | `flow-testnet` | ## Supported RPC Methods * [eth\_blockNumber](/rpc-nodes/flow/eth-blockNumber) * [eth\_call](/rpc-nodes/flow/eth-call) * [eth\_chainId](/rpc-nodes/flow/eth-chain-id) * [eth\_createAccessList](/rpc-nodes/flow/eth-create-access-list) * [eth\_estimateGas](/rpc-nodes/flow/eth-estimate-gas) * [eth\_feeHistory](/rpc-nodes/flow/eth-fee-history) * [eth\_gasPrice](/rpc-nodes/flow/eth-gas-price) * [eth\_getBalance](/rpc-nodes/flow/eth-get-balance) * [eth\_getBlockByHash](/rpc-nodes/flow/eth-get-block-by-hash) * [eth\_getBlockByNumber](/rpc-nodes/flow/eth-get-block-by-number) * [eth\_getBlockTransactionCountByHash](/rpc-nodes/flow/eth-get-block-transaction-count-by-hash) * [eth\_getBlockTransactionCountByNumber](/rpc-nodes/flow/eth-get-block-transaction-count-by-number) * [eth\_getBlockReceipts](/rpc-nodes/flow/eth-get-block-receipts) * [eth\_getCode](/rpc-nodes/flow/eth-get-code) * [eth\_getLogs](/streams/api-reference/history/get-logs) * [eth\_getProof](/rpc-nodes/flow/eth-get-proof) * [eth\_getStorageAt](/rpc-nodes/flow/eth-get-storage-at) * [eth\_getTransactionByHash](/rpc-nodes/flow/eth-get-transaction-by-hash) * [eth\_getTransactionByBlockHashAndIndex](/rpc-nodes/flow/eth-get-transaction-by-block-hash-and-index) * [eth\_getTransactionByBlockNumberAndIndex](/rpc-nodes/flow/eth-get-transaction-by-block-number-and-index) * [eth\_getTransactionCount](/rpc-nodes/flow/eth-get-transaction-count) * [eth\_getTransactionReceipt](/rpc-nodes/flow/eth-get-transaction-receipt) * [eth\_getUncleByBlockHashAndIndex](/rpc-nodes/flow/eth-get-uncle-by-block-hash-and-index) * [eth\_getUncleByBlockNumberAndIndex](/rpc-nodes/flow/eth-get-uncle-by-block-number-and-index) * [eth\_getUncleCountByBlockHash](/rpc-nodes/flow/eth-get-uncle-count-by-block-hash) * [eth\_getUncleCountByBlockNumber](/rpc-nodes/flow/eth-get-uncle-count-by-block-number) * [eth\_maxPriorityFeePerGas](/rpc-nodes/flow/eth-max-priority-fee-per-gas) * [eth\_sendRawTransaction](/rpc-nodes/flow/eth-send-raw-transaction) # eth_blockNumber Source: https://docs.moralis.com/rpc-nodes/gnosis/eth-blockNumber Returns the number of most recent block. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request body No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/gnosis/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x4b7" } ``` # eth_call Source: https://docs.moralis.com/rpc-nodes/gnosis/eth-call Executes a new message call immediately without creating a transaction on the blockchain. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **from** `string` The address the transaction is sent from **to** `string` *required* The address the transaction is directed to **gas** `string` Integer of the gas provided for the transaction execution **gasPrice** `string` Integer of the gasPrice used for each paid gas **value** `string` Integer of the value sent with this transaction **data** `string` Hash of the method signature and encoded parameters **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ { "from": "0x0000000000000000000000000000000000000000", "to": "0x0000000000000000000000000000000000000000", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0x" }, "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/gnosis/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_call", "params": [{"from": "0xb60e8dd61c5d32be8058bb8eb970870f07233155", "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"}, "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x15536ee" } ``` # eth_chainId Source: https://docs.moralis.com/rpc-nodes/gnosis/eth-chain-id Returns the chain ID of the current connected node as described in EIP-695. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request body No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/gnosis/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_chainId", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` # eth_createAccessList Source: https://docs.moralis.com/rpc-nodes/gnosis/eth-create-access-list Creates an access list that you can include in a transaction. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **from** `string` The address the transaction is sent from **to** `string` The address the transaction is directed to **gas** `string` Integer of the gas provided for the transaction execution **gasPrice** `string` Integer of the gasPrice used for each paid gas **maxPriorityFeePerGas** `string` Maximum fee per gas the sender is willing to pay to miners **maxFeePerGas** `string` Maximum total fee per gas the sender is willing to pay **value** `string` Integer of the value sent with this transaction **data** `string` Hash of the method signature and encoded parameters **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ { "from": "0x8ba1f109551bd432803012645haca66c9834d7c6", "to": "0x6b175474e89094c44da98b954eedeac495271d0f", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0xa9059cbb0000000000000000000000008ba1f109551bd432803012645haca66c9834d7c60000000000000000000000000000000000000000000000000de0b6b3a7640000" }, "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/gnosis/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_createAccessList", "params": [{"from": "0x8ba1f109551bd432803012645haca66c9834d7c6", "to": "0x6b175474e89094c44da98b954eedeac495271d0f", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0xa9059cbb0000000000000000000000008ba1f109551bd432803012645haca66c9834d7c60000000000000000000000000000000000000000000000000de0b6b3a7640000"}, "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "accessList": [ { "address": "0x6b175474e89094c44da98b954eedeac495271d0f", "storageKeys": [ "0x0000000000000000000000000000000000000000000000000000000000000000" ] } ], "gasUsed": "0x7671" } } ``` # eth_estimateGas Source: https://docs.moralis.com/rpc-nodes/gnosis/eth-estimate-gas Generates and returns an estimate of how much gas is necessary to allow the transaction to complete. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **from** `string` The address the transaction is sent from **to** `string` The address the transaction is directed to **gas** `string` Integer of the gas provided for the transaction execution **gasPrice** `string` Integer of the gasPrice used for each paid gas **value** `string` Integer of the value sent with this transaction **data** `string` Hash of the method signature and encoded parameters **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ { "from": "0x8D97689C9818892B700e27F316cc3E41e17fBeb9", "to": "0xd3CdA913deB6f67967B99D67aCDFa1712C293601", "value": "0x186a0" }, "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/gnosis/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_estimateGas", "params": [{"from": "0x8D97689C9818892B700e27F316cc3E41e17fBeb9", "to": "0xd3CdA913deB6f67967B99D67aCDFa1712C293601", "value": "0x186a0"}, "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x5208" } ``` # eth_feeHistory Source: https://docs.moralis.com/rpc-nodes/gnosis/eth-fee-history Returns historical gas information for a range of blocks. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockCount** `string` *required* Number of blocks in the requested range **newestBlock** `string` *required* Highest number block of the requested range **rewardPercentiles** `array` Array of percentile values to sample from each block's effective priority fees per gas #### Example request `params` ```javascript theme={null} [ "0x4", "latest", [25, 75] ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/gnosis/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_feeHistory", "params": ["0x4", "latest", [25, 75]], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": [ "0x7", "0x7", "0x7", "0x7", "0x7" ], "gasUsedRatio": [ 0.026089875, 0.406803, 0.010817, 0.5 ], "baseFeePerBlobGas": [ "0x3319eb", "0x350c54", "0x364072", "0x364072", "0x32279d" ], "blobGasUsedRatio": [ 0.47619047619047616, 0.2857142857142857, 0, 0.3333333333333333 ], "oldestBlock": "0x11b9231", "reward": [ ["0x4a817c800", "0x4a817c800"], ["0x773593c0", "0x773593c0"], ["0x0", "0x0"], ["0x0", "0x0"] ] } } ``` # eth_gasPrice Source: https://docs.moralis.com/rpc-nodes/gnosis/eth-gas-price Returns the current price per gas in wei. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/gnosis/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x09184e72a000" } ``` # eth_getBalance Source: https://docs.moralis.com/rpc-nodes/gnosis/eth-get-balance Returns the balance of the account of given address. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address to check for balance **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/gnosis/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0234c8a3397aab58" } ``` # eth_getBlockByHash Source: https://docs.moralis.com/rpc-nodes/gnosis/eth-get-block-by-hash Returns information about a block by hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block **fullTransactionObjects** `boolean` *required* If true it returns the full transaction objects, if false only the hashes of the transactions #### Example request `params` ```javascript theme={null} [ "0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c", false ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/gnosis/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c", false], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x3319bb0", "blobGasUsed": "0x120000", "difficulty": "0x0", "excessBlobGas": "0xa576243", "extraData": "0xe29ca82051756173617220287175617361722e77696e2920e29ca8", "gasLimit": "0x3938700", "gasUsed": "0x2965eaa", "hash": "0xc319ec0da50d354ce425b63fb6914a42aafdb9ee9807518edd595809e25fbe38", "logsBloom": "0x7feeeb37793b4fdfff7ab7aefde2d7fdfff9575bfef5bdff3fb97bfef7bcddbbdf9d55e77fdf7ead7b98ffd9bb6fefff7e77b163bf9eeebdddd1ffbf376cfbeb7efffef83ffbe9eb7ff7776ab3dcf8bfee7ebaddfffdf7fe3fffdf6ed3f7dff77cf2fd7efffff7a19ef7ffbbe3e8befdb7fff76b6ed6e7ffceeb99ff7eeb5efebfff3fff7da1fb39f9fff3fd7f3f77b6dd0bed39f5fff3bfa7fbbce7f9f6ec6e0fff50bfe7f9f79efff35ff6d93fecfefbffdaf7b7eff35ec6ff42fe7e6f77f7deff7eff57f6aafa597feebdffff7bbd677e27ffbfadfdf57f7e7d2aeeffffff6676ffa7f3f375eb95eecf9ffa235cbfcdefafbf8feed9dc7b56ff2fdfedfefe", "miner": "0x396343362be2a4da1ce0c1c210945346fb82aa49", "mixHash": "0x07444bb5750f746e200e1dcd8d83221b26576d3357b833cc1e434e7966d0e774", "nonce": "0x0000000000000000", "number": "0x1736791", "parentBeaconBlockRoot": "0x2759f248e2d1cb1a2f5c2657c4efcc623dd8ea7f23e8700162e7fccdacedfd5d", "parentHash": "0xdf0e4dee910167d7b1687a6cb677983ce7ed351ae78ab7e2c5ba39d793c80391", "receiptsRoot": "0x5f1c58e498161509245daad0f60319d9abab7f04d2ca60e99a3674cfdc9b8327", "requestsHash": "0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x1ef1e", "stateRoot": "0x728c7e38107037b573d719e67b6872ee3ca4e01b47818598316cd696bfe24f2c", "timestamp": "0x697b4bcb", "transactions": [ "0xbf7bd0cf98c3b65525f1f7267b1d02e7ccd7cd133b137f46723a91cf187616d5", "0x06ac9281da76d530aa19600e2c34aae7564a78702d3eb52b1fb363985473e296" ], "transactionsRoot": "0xa8c680f6ad8ccc7a49db5ab76cbd9194c88e16dbcfa440104f7787e5ba815c4f", "uncles": [], "withdrawals": [ { "index": "0x6f78bfb", "validatorIndex": "0x955f5", "address": "0x5d3ca1842d0988816434ea51ca420182f3f1e31a", "amount": "0x102d2f1" } ], "withdrawalsRoot": "0x9b7ecf1ba575fc02e4b4c14bd65d5ca95c0e066adaae3fc2ef16f5acd90214d8" } } ``` # eth_getBlockByNumber Source: https://docs.moralis.com/rpc-nodes/gnosis/eth-get-block-by-number Returns information about a block by block number. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" **fullTransactionObjects** `boolean` *required* If true it returns the full transaction objects, if false only the hashes of the transactions #### Example request `params` ```javascript theme={null} [ "0x1b4", true ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/gnosis/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["0x1b4", true], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x3319bb0", "blobGasUsed": "0x120000", "difficulty": "0x0", "excessBlobGas": "0xa576243", "extraData": "0xe29ca82051756173617220287175617361722e77696e2920e29ca8", "gasLimit": "0x3938700", "gasUsed": "0x2965eaa", "hash": "0xc319ec0da50d354ce425b63fb6914a42aafdb9ee9807518edd595809e25fbe38", "logsBloom": "0x7feeeb37793b4fdfff7ab7aefde2d7fdfff9575bfef5bdff3fb97bfef7bcddbbdf9d55e77fdf7ead7b98ffd9bb6fefff7e77b163bf9eeebdddd1ffbf376cfbeb7efffef83ffbe9eb7ff7776ab3dcf8bfee7ebaddfffdf7fe3fffdf6ed3f7dff77cf2fd7efffff7a19ef7ffbbe3e8befdb7fff76b6ed6e7ffceeb99ff7eeb5efebfff3fff7da1fb39f9fff3fd7f3f77b6dd0bed39f5fff3bfa7fbbce7f9f6ec6e0fff50bfe7f9f79efff35ff6d93fecfefbffdaf7b7eff35ec6ff42fe7e6f77f7deff7eff57f6aafa597feebdffff7bbd677e27ffbfadfdf57f7e7d2aeeffffff6676ffa7f3f375eb95eecf9ffa235cbfcdefafbf8feed9dc7b56ff2fdfedfefe", "miner": "0x396343362be2a4da1ce0c1c210945346fb82aa49", "mixHash": "0x07444bb5750f746e200e1dcd8d83221b26576d3357b833cc1e434e7966d0e774", "nonce": "0x0000000000000000", "number": "0x1736791", "parentBeaconBlockRoot": "0x2759f248e2d1cb1a2f5c2657c4efcc623dd8ea7f23e8700162e7fccdacedfd5d", "parentHash": "0xdf0e4dee910167d7b1687a6cb677983ce7ed351ae78ab7e2c5ba39d793c80391", "receiptsRoot": "0x5f1c58e498161509245daad0f60319d9abab7f04d2ca60e99a3674cfdc9b8327", "requestsHash": "0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x1ef1e", "stateRoot": "0x728c7e38107037b573d719e67b6872ee3ca4e01b47818598316cd696bfe24f2c", "timestamp": "0x697b4bcb", "transactions": [ "0xbf7bd0cf98c3b65525f1f7267b1d02e7ccd7cd133b137f46723a91cf187616d5", "0x06ac9281da76d530aa19600e2c34aae7564a78702d3eb52b1fb363985473e296" ], "transactionsRoot": "0xa8c680f6ad8ccc7a49db5ab76cbd9194c88e16dbcfa440104f7787e5ba815c4f", "uncles": [], "withdrawals": [ { "index": "0x6f78bfb", "validatorIndex": "0x955f5", "address": "0x5d3ca1842d0988816434ea51ca420182f3f1e31a", "amount": "0x102d2f1" } ], "withdrawalsRoot": "0x9b7ecf1ba575fc02e4b4c14bd65d5ca95c0e066adaae3fc2ef16f5acd90214d8" } } ``` # eth_getBlockReceipts Source: https://docs.moralis.com/rpc-nodes/gnosis/eth-get-block-receipts Returns all transaction receipts for a given block. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" #### Example request `params` ```javascript theme={null} [ "0xf21d9c" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/gnosis/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockReceipts", "params": ["0xf21d9c"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": [ { "blockHash": "0x8243343df08b9751f5ca0c5f8c9c0460d8a9b6351066fae0acbd4d3e776de8bb", "blockNumber": "0xf21d9c", "contractAddress": null, "cumulativeGasUsed": "0x5208", "effectiveGasPrice": "0x1dcd6500", "from": "0x8ba1f109551bd432803012645haca66c9834d7c6", "gasUsed": "0x5208", "logs": [], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "status": "0x1", "to": "0x95cED938F7991cd0dFcb48F0a06a40FA1aF46EBC", "transactionHash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "transactionIndex": "0x0", "type": "0x2" } ] } ``` # eth_getBlockTransactionCountByHash Source: https://docs.moralis.com/rpc-nodes/gnosis/eth-get-block-transaction-count-by-hash Returns the number of transactions in a block from a block matching the given block hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block #### Example request `params` ```javascript theme={null} [ "0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/gnosis/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` # eth_getBlockTransactionCountByNumber Source: https://docs.moralis.com/rpc-nodes/gnosis/eth-get-block-transaction-count-by-number Returns the number of transactions in a block matching the given block number. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" #### Example request `params` ```javascript theme={null} [ "0xe8" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/gnosis/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["0xe8"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` # eth_getCode Source: https://docs.moralis.com/rpc-nodes/gnosis/eth-get-code Returns code at a given address. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address to get the code from **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x2" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/gnosis/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getCode", "params": ["0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x2"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x600160008035811a818181146012578301005b601b6001356025565b8060005260206000f25b600060078202905091905056" } ``` # eth_getLogs Source: https://docs.moralis.com/rpc-nodes/gnosis/eth-get-logs Returns an array of all logs matching a given filter object. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **fromBlock** `string` Integer block number, or "latest" for the last mined block or "pending", "earliest" for not yet mined transactions **toBlock** `string` Integer block number, or "latest" for the last mined block or "pending", "earliest" for not yet mined transactions **address** `string` Contract address or a list of addresses from which logs should originate **topics** `array` Array of 32 Bytes DATA topics. Topics are order-dependent **blockhash** `string` Using blockhash is equivalent to fromBlock = toBlock = the block number with hash blockhash #### Example request `params` ```javascript theme={null} [ { "fromBlock": "0x1", "toBlock": "0x2", "address": "0x8888f1f195afa192cfee860698584c030f4c9db1", "topics": [ "0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", null, [ "0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x0000000000000000000000000aff3454fce5edbc8cca8697c15331677e6ebccc" ] ] } ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/gnosis/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getLogs", "params": [{"fromBlock": "0x1", "toBlock": "0x2", "address": "0x8888f1f195afa192cfee860698584c030f4c9db1", "topics": ["0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", null, ["0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x0000000000000000000000000aff3454fce5edbc8cca8697c15331677e6ebccc"]]}], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": [ { "logIndex": "0x1", "blockNumber": "0x1b4", "blockHash": "0x8216c5785ac562ff41e2dcfdf5785ac562ff41e2dcfdf829c5a142f1fccd7d", "transactionHash": "0xdf829c5a142f1fccd7d8216c5785ac562ff41e2dcfdf5785ac562ff41e2dcf", "transactionIndex": "0x0", "address": "0x16c5785ac562ff41e2dcfdf829c5a142f1fccd7d", "data": "0x0000000000000000000000000000000000000000000000000000000000000000", "topics": [ "0x59ebeb90bc63057b6515673c3ecf9438e5058bca0f92585014eced636878c9a5" ] } ] } ``` # eth_getProof Source: https://docs.moralis.com/rpc-nodes/gnosis/eth-get-proof Returns the account and storage values of the specified account including the Merkle-proof. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address of the account or contract **storageKeys** `array` *required* Array of storage-keys which should be proofed and included **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842", [ "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421" ], "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/gnosis/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getProof", "params": ["0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842", ["0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"], "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "address": "0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842", "accountProof": [ "0xf90211a090dcaf88c40c7bbc95a912cbdde67c175767b31173df9ee4b0d733bfdd511c43a0babe369f6b12092f49181ae04ca173fb68d1a5456f18d20fa32cba73954052bda0473ecf8a7e36a829e75039a3b055e51b8332cbf03324ab4af2066bbd6fbf0021fa0bbda34753d7aa6c38e603f360244e8f59611921d9e1f128372fec0d586d4f9e0a04e44caecff45c9891f74f6a2156735886eedf6f1a733628ebc802ec79d844648a0a5f3f2f7542148c973977c8a1e154c4300fec92f755f7846f1b734d3ab1d90e7a0e823850f50bf72baae9d1733a36a444ab65d0a6faaba404f0583ce0ca4dad92da0f7a00cbe7d4b30b11faea3ae61b7f1f2b315017e79a3de5ab2dc8bb46a59fdb37a09b3b8d0e0e4c1e3b2d3e8f7c6e5d4c3b2a1e0f9e8d7c6b5a4e3f2e1d0c9b8a7a0b1f8e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0a0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0a0d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a08080" ], "balance": "0x0", "codeHash": "0x5e61b0f7919ab4e6fc7cfa6f3f5f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f", "nonce": "0x0", "storageHash": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "storageProof": [ { "key": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "value": "0x1", "proof": [ "0xf90211a090dcaf88c40c7bbc95a912cbdde67c175767b31173df9ee4b0d733bfdd511c43a0babe369f6b12092f49181ae04ca173fb68d1a5456f18d20fa32cba73954052bda0473ecf8a7e36a829e75039a3b055e51b8332cbf03324ab4af2066bbd6fbf0021fa0bbda34753d7aa6c38e603f360244e8f59611921d9e1f128372fec0d586d4f9e0a04e44caecff45c9891f74f6a2156735886eedf6f1a733628ebc802ec79d844648a0a5f3f2f7542148c973977c8a1e154c4300fec92f755f7846f1b734d3ab1d90e7a0e823850f50bf72baae9d1733a36a444ab65d0a6faaba404f0583ce0ca4dad92da0f7a00cbe7d4b30b11faea3ae61b7f1f2b315017e79a3de5ab2dc8bb46a59fdb37a09b3b8d0e0e4c1e3b2d3e8f7c6e5d4c3b2a1e0f9e8d7c6b5a4e3f2e1d0c9b8a7a0b1f8e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0a0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0a0d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a08080" ] } ] } } ``` # eth_getStorageAt Source: https://docs.moralis.com/rpc-nodes/gnosis/eth-get-storage-at Returns the value from a storage position at a given address. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address of the storage **position** `string` *required* Integer of the position in the storage **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x0", "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/gnosis/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x0", "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x00000000000000000000000000000000000000000000000000000000000004d2" } ``` # eth_getTransactionByBlockHashAndIndex Source: https://docs.moralis.com/rpc-nodes/gnosis/eth-get-transaction-by-block-hash-and-index Returns information about a transaction by block hash and transaction index position. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block **index** `string` *required* Integer of the transaction index position #### Example request `params` ```javascript theme={null} [ "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/gnosis/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5daf3b", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "gas": "0xc350", "gasPrice": "0x4a817c800", "hash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "input": "0x68656c6c6f21", "nonce": "0x15", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "transactionIndex": "0x0", "value": "0xf3dbb76162000", "v": "0x25", "r": "0x1b5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5", "s": "0x5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5c5" } } ``` # eth_getTransactionByBlockNumberAndIndex Source: https://docs.moralis.com/rpc-nodes/gnosis/eth-get-transaction-by-block-number-and-index Returns information about a transaction by block number and transaction index position. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* A block number, or the string "earliest", "latest" or "pending" **index** `string` *required* The transaction index position #### Example request `params` ```javascript theme={null} [ "0x5BAE9E", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/gnosis/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["0x5BAE9E", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5BAE9E", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "gas": "0xc350", "gasPrice": "0x4a817c800", "hash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "input": "0x68656c6c6f21", "nonce": "0x15", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "transactionIndex": "0x0", "value": "0xf3dbb76162000", "v": "0x25", "r": "0x1b5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5", "s": "0x5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5c5" } } ``` # eth_getTransactionByHash Source: https://docs.moralis.com/rpc-nodes/gnosis/eth-get-transaction-by-hash Returns the information about a transaction requested by transaction hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a transaction #### Example request `params` ```javascript theme={null} [ "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/gnosis/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5daf3b", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "gas": "0xc350", "gasPrice": "0x4a817c800", "hash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "input": "0x68656c6c6f21", "nonce": "0x15", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "transactionIndex": "0x41", "value": "0xf3dbb76162000", "v": "0x25", "r": "0x1b5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5", "s": "0x5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5c5" } } ``` # eth_getTransactionCount Source: https://docs.moralis.com/rpc-nodes/gnosis/eth-get-transaction-count Returns the number of transactions sent from an address. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address to get transaction count for **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/gnosis/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` # eth_getTransactionReceipt Source: https://docs.moralis.com/rpc-nodes/gnosis/eth-get-transaction-receipt Returns the receipt of a transaction by transaction hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a transaction #### Example request `params` ```javascript theme={null} [ "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/gnosis/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "transactionHash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "transactionIndex": "0x41", "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5daf3b", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "cumulativeGasUsed": "0x33bc", "gasUsed": "0x4dc", "contractAddress": null, "logs": [], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "status": "0x1" } } ``` # eth_getUncleByBlockHashAndIndex Source: https://docs.moralis.com/rpc-nodes/gnosis/eth-get-uncle-by-block-hash-and-index Returns information about an uncle of a block by hash and uncle index position. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block **index** `string` *required* The uncle's index position #### Example request `params` ```javascript theme={null} [ "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/gnosis/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x027f07", "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000", "gasLimit": "0x9f759", "gasUsed": "0x9f759", "hash": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331", "logsBloom": "0x1a060020000015554c000200000003050000200017041014032020801000056020000001000a00d0020204040020012150010010000000280005000c00000000000020c0000000024008104011000080020020000001006100900000024208002000020002100000000000000080000000120080000002003c0000200000000200002010008300300001001031100100040010420000800000000014000004002000000c040200060000000080000000100000000040a2000001000061000042021080400200000410000404080800014008201000c20100500020011000000030001100100024008c80190400402008000020000c0041104218100000000000000002000800000", "miner": "0x4e65fda2159562a496f9f3522f89122a3088497a", "mixHash": "0x99e9d85137db46ef1e85fff042bb15a7b6f46618b7f600b0b4e7fb52fceafc3a", "nonce": "0xfcf4db6d9bce1b8b", "number": "0x1b4", "parentHash": "0xa057c32b6ed8eb5e006cadfad55c7e635549c6e2135c4e6c3a9d5a6a80f72c3", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0x1a7e46b37b26e0c3f67ed4de3b5d3b1ff84a2e0a5e2dcf4d4b0d34b5a22b6e3", "timestamp": "0x55ba467c", "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` # eth_getUncleByBlockNumberAndIndex Source: https://docs.moralis.com/rpc-nodes/gnosis/eth-get-uncle-by-block-number-and-index Returns information about an uncle of a block by number and uncle index position. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* A block number, or the string "earliest", "latest" or "pending" **index** `string` *required* The uncle's index position #### Example request `params` ```javascript theme={null} [ "0x29c", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/gnosis/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["0x29c", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x027f07", "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000", "gasLimit": "0x9f759", "gasUsed": "0x9f759", "hash": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331", "logsBloom": "0x1a060020000015554c000200000003050000200017041014032020801000056020000001000a00d0020204040020012150010010000000280005000c00000000000020c0000000024008104011000080020020000001006100900000024208002000020002100000000000000080000000120080000002003c0000200000000200002010008300300001001031100100040010420000800000000014000004002000000c040200060000000080000000100000000040a2000001000061000042021080400200000410000404080800014008201000c20100500020011000000030001100100024008c80190400402008000020000c0041104218100000000000000002000800000", "miner": "0x4e65fda2159562a496f9f3522f89122a3088497a", "mixHash": "0x99e9d85137db46ef1e85fff042bb15a7b6f46618b7f600b0b4e7fb52fceafc3a", "nonce": "0xfcf4db6d9bce1b8b", "number": "0x29c", "parentHash": "0xa057c32b6ed8eb5e006cadfad55c7e635549c6e2135c4e6c3a9d5a6a80f72c3", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0x1a7e46b37b26e0c3f67ed4de3b5d3b1ff84a2e0a5e2dcf4d4b0d34b5a22b6e3", "timestamp": "0x55ba467c", "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` # eth_getUncleCountByBlockHash Source: https://docs.moralis.com/rpc-nodes/gnosis/eth-get-uncle-count-by-block-hash Returns the number of uncles in a block from a block matching the given block hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block #### Example request `params` ```javascript theme={null} [ "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/gnosis/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` # eth_getUncleCountByBlockNumber Source: https://docs.moralis.com/rpc-nodes/gnosis/eth-get-uncle-count-by-block-number Returns the number of uncles in a block from a block matching the given block number. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" #### Example request `params` ```javascript theme={null} [ "0x5BAE9E" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/gnosis/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["0x5BAE9E"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` # eth_maxPriorityFeePerGas Source: https://docs.moralis.com/rpc-nodes/gnosis/eth-max-priority-fee-per-gas Returns a suggestion for the max priority fee per gas for dynamic fee transactions in wei. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/gnosis/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_maxPriorityFeePerGas", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x59682f00" } ``` # eth_sendRawTransaction Source: https://docs.moralis.com/rpc-nodes/gnosis/eth-send-raw-transaction Submits a pre-signed transaction for broadcast to the network. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **data** `string` *required* The signed transaction data #### Example request `params` ```javascript theme={null} [ "0xf869808504e3b2928082520894f0109fc8df283027b6285cc889f5aa624eac1f55843b9aca008025a0c9cf86333bcb065d140032ecaab5d9281bde80f21b9687b3e94161de42d51895a0727a108a0b8d101465414033c3f705a9c7b826e596766046ee1183dbc8aeaa68" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/gnosis/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["0xf869808504e3b2928082520894f0109fc8df283027b6285cc889f5aa624eac1f55843b9aca008025a0c9cf86333bcb065d140032ecaab5d9281bde80f21b9687b3e94161de42d51895a0727a108a0b8d101465414033c3f705a9c7b826e596766046ee1183dbc8aeaa68"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" } ``` # Overview Source: https://docs.moralis.com/rpc-nodes/gnosis/overview Explore Gnosis JSON-RPC methods ## Introduction Gnosis Chain is an Ethereum Layer 1 network focused on open finance and decentralized governance. It operates in conjunction with Ethereum, leveraging Ethereum’s security while providing faster and cheaper transactions. Gnosis Chain is EVM-compatible, making it easy for Ethereum developers to deploy their decentralized applications (dApps) with minimal changes. It’s widely used for governance, decentralized finance (DeFi), and DAO tooling. ## Supported Networks The Gnosis RPC API is available for the following networks: 1. **Gnosis Mainnet** ## Network Details | **Network** | **Chain ID** | **Path Parameter** | | :- | :- | :- | | **Gnosis Mainnet** | 0x64 (100) | `gnosis` | ## Supported RPC Methods * [eth\_blockNumber](/rpc-nodes/gnosis/eth-blockNumber) * [eth\_call](/rpc-nodes/gnosis/eth-call) * [eth\_chainId](/rpc-nodes/gnosis/eth-chain-id) * [eth\_createAccessList](/rpc-nodes/gnosis/eth-create-access-list) * [eth\_estimateGas](/rpc-nodes/gnosis/eth-estimate-gas) * [eth\_feeHistory](/rpc-nodes/gnosis/eth-fee-history) * [eth\_gasPrice](/rpc-nodes/gnosis/eth-gas-price) * [eth\_getBalance](/rpc-nodes/gnosis/eth-get-balance) * [eth\_getBlockByHash](/rpc-nodes/gnosis/eth-get-block-by-hash) * [eth\_getBlockByNumber](/rpc-nodes/gnosis/eth-get-block-by-number) * [eth\_getBlockTransactionCountByHash](/rpc-nodes/gnosis/eth-get-block-transaction-count-by-hash) * [eth\_getBlockTransactionCountByNumber](/rpc-nodes/gnosis/eth-get-block-transaction-count-by-number) * [eth\_getBlockReceipts](/rpc-nodes/gnosis/eth-get-block-receipts) * [eth\_getCode](/rpc-nodes/gnosis/eth-get-code) * [eth\_getLogs](/streams/api-reference/history/get-logs) * [eth\_getProof](/rpc-nodes/gnosis/eth-get-proof) * [eth\_getStorageAt](/rpc-nodes/gnosis/eth-get-storage-at) * [eth\_getTransactionByHash](/rpc-nodes/gnosis/eth-get-transaction-by-hash) * [eth\_getTransactionByBlockHashAndIndex](/rpc-nodes/gnosis/eth-get-transaction-by-block-hash-and-index) * [eth\_getTransactionByBlockNumberAndIndex](/rpc-nodes/gnosis/eth-get-transaction-by-block-number-and-index) * [eth\_getTransactionCount](/rpc-nodes/gnosis/eth-get-transaction-count) * [eth\_getTransactionReceipt](/rpc-nodes/gnosis/eth-get-transaction-receipt) * [eth\_getUncleByBlockHashAndIndex](/rpc-nodes/gnosis/eth-get-uncle-by-block-hash-and-index) * [eth\_getUncleByBlockNumberAndIndex](/rpc-nodes/gnosis/eth-get-uncle-by-block-number-and-index) * [eth\_getUncleCountByBlockHash](/rpc-nodes/gnosis/eth-get-uncle-count-by-block-hash) * [eth\_getUncleCountByBlockNumber](/rpc-nodes/gnosis/eth-get-uncle-count-by-block-number) * [eth\_maxPriorityFeePerGas](/rpc-nodes/gnosis/eth-max-priority-fee-per-gas) * [eth\_sendRawTransaction](/rpc-nodes/gnosis/eth-send-raw-transaction) # Get Your API Key Source: https://docs.moralis.com/rpc-nodes/introduction/quickstart/get-your-api-key Set up your Moralis RPC node and get your unique Node URL to start interacting with the blockchain. Moralis simplifies the process of accessing blockchain data from nodes across various blockchains. This guide walks you through the steps to set up your Moralis RPC node. ## Step 1: Create a Moralis Account Create your account at the [Moralis Dashboard](https://admin.moralis.com/). ## Step 2: Create a New Node After signing up, generate your unique **Node URL**: 1. Log in to the [Moralis Dashboard](https://admin.moralis.com/). 2. From the sidebar, click on the **Nodes** tab. 3. Click **Create a New Node**. 4. Select the blockchain network you want to connect to (e.g., Ethereum, BNB Chain, Polygon) and choose **mainnet** or **testnet**. 5. Click **Create Node** to generate your node. ## Step 3: Copy Your Node URL Once your node is created, you will be provided with two URLs — one for **Site 1** and another for **Site 2**. Both URLs include your **Node API Key**. Copy one of these URLs. This is your unique **Node URL**, which you will use to interact with the blockchain in your application. > [!WARNING] > > Keep your Node URL safe — it contains your API key, which is essential for connecting to the blockchain. Do not expose it in client-side code or public repositories. ## Next Steps You are now ready to start making RPC calls using your node. * [Make Your First Request](/rpc-nodes/introduction/quickstart/make-your-first-request) — Learn how to make your first JSON-RPC call. * [Supported Chains](/rpc-nodes/supported-chains) — See which blockchains are available. * [Pricing](/rpc-nodes/pricing) — Understand compute unit costs and rate limits. # Make Your First Request Source: https://docs.moralis.com/rpc-nodes/introduction/quickstart/make-your-first-request Learn how to make your first JSON-RPC call using your Moralis Node URL to interact with the blockchain. In this guide, you will make your first JSON-RPC call using your Moralis Node URL. We'll use `ethers.js` to query the Ethereum blockchain, but you can use any JSON-RPC compatible library. ## Prerequisites * **Node.js** installed on your machine. * A **Moralis Node URL**. If you haven't created one yet, see [Get Your API Key](/rpc-nodes/introduction/quickstart/get-your-api-key). ## Step 1: Install Dependencies Create a new project and install the required packages: ```bash theme={null} mkdir my-rpc-project cd my-rpc-project npm init -y npm install ethers dotenv ``` ## Step 2: Set Up Environment Variables Create a `.env` file in your project root and add your Moralis Node URL: ```bash theme={null} MORALIS_NODE_URL=YOUR_URL_FROM_DASHBOARD ``` ## Step 3: Write the Code Create a file called `index.js`: > [tab] ethers.js > > ```javascript theme={null} > require("dotenv").config(); > const { ethers } = require("ethers"); > > async function main() { > const provider = new ethers.JsonRpcProvider(process.env.MORALIS_NODE_URL); > > // Get the latest block number > const blockNumber = await provider.getBlockNumber(); > console.log("Latest block:", blockNumber); > > // Get the balance of an address > const balance = await provider.getBalance( > "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045" > ); > console.log("Balance:", ethers.formatEther(balance), "ETH"); > } > > main(); > ``` > [tab] curl > > ```bash theme={null} > curl -X POST YOUR_MORALIS_NODE_URL \ > -H "Content-Type: application/json" \ > -d '{ > "jsonrpc": "2.0", > "method": "eth_blockNumber", > "params": [], > "id": 1 > }' > ``` > [tab] Python > > ```python theme={null} > import os > import json > import requests > from dotenv import load_dotenv > > load_dotenv() > > node_url = os.getenv("MORALIS_NODE_URL") > > payload = { > "jsonrpc": "2.0", > "method": "eth_blockNumber", > "params": [], > "id": 1, > } > > response = requests.post(node_url, json=payload) > result = response.json() > print("Latest block:", int(result["result"], 16)) > ``` ## Step 4: Run the Script ```bash theme={null} node index.js ``` You should see output like: ``` Latest block: 19234567 Balance: 1.234 ETH ``` ## Using Extended RPC Methods Moralis provides extended RPC methods that offer richer data beyond standard JSON-RPC. These methods map to Moralis API endpoints: | Method | Description | | - | - | | `eth_getTransactions` | Get native transactions by wallet address | | `eth_getDecodedTransactions` | Get decoded wallet history | | `eth_getTokenBalances` | Get ERC20 token balances by wallet | | `eth_getTokenPrice` | Get ERC20 token price | | `eth_getTokenMetadata` | Get ERC20 token metadata | | `eth_getNFTBalances` | Get NFTs by wallet address | | `eth_getNFTCollections` | Get NFT collections by wallet | > [!NOTE] > > Extended RPC methods have higher compute unit costs than standard methods. See [Pricing](/rpc-nodes/pricing) for details. ## Next Steps * [Pricing](/rpc-nodes/pricing) — Understand compute unit costs for each RPC method. * [Batch Requests](/rpc-nodes/introduction/resources/rpc-batch-requests) — Combine multiple requests into a single API call. * [Rate Limits](/rpc-nodes/introduction/resources/rpc-rate-limits) — Learn about throughput limits per plan. # Archive Requests Source: https://docs.moralis.com/rpc-nodes/introduction/resources/archive-requests Understand the difference between full nodes and archive nodes for historical data access ## What Are Archive Requests? Archive requests are RPC calls that query historical blockchain state beyond what a standard full node retains. They allow you to access data from any point in the blockchain's history. ## Full Nodes vs Archive Nodes | Feature | Full Node | Archive Node | | - | - | - | | Recent State | Yes | Yes | | Historical State | Limited (\~128 blocks) | Complete | | Storage Required | \~1 TB | \~15+ TB | | Query Any Block | No | Yes | ## When You Need Archive Access You need an archive node when: * Querying balances at historical block numbers * Reading contract storage from past blocks * Analyzing historical state for analytics * Debugging past transactions with state context ## Archive-Dependent Methods These methods require archive access when querying historical blocks: | Method | Archive Required When | | - | - | | `eth_getBalance` | Block parameter is not `latest` | | `eth_getCode` | Block parameter is not `latest` | | `eth_getStorageAt` | Block parameter is not `latest` | | `eth_call` | Block parameter is not `latest` | ### Example ```json theme={null} // This requires archive access (historical block) { "method": "eth_getBalance", "params": ["0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045", "0xF4240"] } // This works on full nodes (latest block) { "method": "eth_getBalance", "params": ["0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045", "latest"] } ``` ## Archive Support on Moralis Moralis RPC Nodes include archive access on all plans. You can query any historical block without additional configuration. ## Best Practices * Use `latest` when you don't need historical data * Cache historical queries when possible (they're immutable) * Be aware archive queries may have slightly higher latency # JSON-RPC Overview Source: https://docs.moralis.com/rpc-nodes/introduction/resources/json-rpc-overview Learn about JSON-RPC, the protocol used for blockchain communication ## What is JSON-RPC? JSON-RPC is a lightweight, remote procedure call (RPC) protocol that uses JSON to encode messages. It enables applications to invoke methods on remote systems as if they were local. ## Key Characteristics * **Protocol-Agnostic** - Works over HTTP, WebSocket, and other transports * **Stateless** - Each request is independent * **Lightweight** - JSON formatting minimizes overhead while remaining human-readable ## Request Structure A JSON-RPC request contains: | Field | Description | | - | - | | `jsonrpc` | Protocol version (always "2.0") | | `method` | Name of the method to call | | `params` | Method parameters (array or object) | | `id` | Unique request identifier | ### Example Request ```json theme={null} { "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045", "latest"], "id": 1 } ``` ## Response Structure | Field | Description | | - | - | | `jsonrpc` | Protocol version | | `result` | Method result (if successful) | | `error` | Error object (if failed) | | `id` | Matching request identifier | ### Example Response ```json theme={null} { "jsonrpc": "2.0", "result": "0x1234567890abcdef", "id": 1 } ``` ## Common Methods | Method | Description | | - | - | | `eth_blockNumber` | Get the latest block number | | `eth_getBalance` | Get account balance | | `eth_getTransactionByHash` | Get transaction details | | `eth_sendRawTransaction` | Submit a signed transaction | | `eth_call` | Execute a read-only contract call | | `eth_getLogs` | Get event logs | ## Use Cases * **Wallets** - Query balances and submit transactions * **dApps** - Interact with smart contracts * **Indexers** - Fetch and process blockchain data * **Trading Bots** - Monitor state and execute trades # RPC Batch Requests Source: https://docs.moralis.com/rpc-nodes/introduction/resources/rpc-batch-requests Combine multiple RPC requests into a single API call for better performance ## What is Batching? Batching combines multiple RPC requests into a single HTTP call, reducing network overhead and improving performance when you need to make several related queries. ## Benefits * **Reduced Latency** - Single round-trip instead of multiple * **Fewer Connections** - One HTTP request instead of many * **Simpler Code** - Handle related operations together ## Request Format Send an array of JSON-RPC request objects: ```json theme={null} [ { "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }, { "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045", "latest"], "id": 2 }, { "jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 3 } ] ``` ## Response Format Responses are returned as an array in the same order: ```json theme={null} [ { "jsonrpc": "2.0", "result": "0x10d4f", "id": 1 }, { "jsonrpc": "2.0", "result": "0x1234567890abcdef", "id": 2 }, { "jsonrpc": "2.0", "result": "0x3b9aca00", "id": 3 } ] ``` ## Limits | Constraint | Value | | - | - | | Max requests per batch | 20 | ## Important: Compute Units Batching does **not** reduce Compute Unit (CU) consumption. Each request in the batch uses the same CUs as individual requests. Batching optimizes network efficiency, not billing. ## Best Practices * Use unique `id` values to match responses * Handle partial failures (some requests may succeed while others fail) * Group related operations together * Keep batches under the 20 request limit # RPC Rate Limits Source: https://docs.moralis.com/rpc-nodes/introduction/resources/rpc-rate-limits Understand rate limits and Compute Units for Moralis RPC Nodes ## Overview Moralis uses Compute Units (CUs) to track API usage. Rate limits ensure fair usage and system stability across all users. ## Rate Limits by Plan | Plan | CUs Included | API Throughput | Node Throughput | Nodes | | - | - | - | - | - | | Starter | 2,000,000 per month | 40 reqs/s | 100 CU/s | 5 | | Pro | 100,000,000 per month | 80 reqs/s | 100 CU/s | 20 | | Business | 500,000,000 per month | 200 reqs/s | 300 CU/s | Unlimited | | Enterprise | Custom | Custom | Unlimited | Unlimited | All plans include archive request support. For current plan pricing, see [moralis.com/pricing](https://moralis.com/pricing). ## Understanding Throughput * **CUs Included** - Total Compute Units available on your plan before overage applies. CU cost per method is listed on the [RPC Pricing](/rpc-nodes/pricing) page. * **API Throughput** - Maximum requests per second across all your requests, evaluated over a rolling 4-second window. This limit is shared across all Moralis products. See [Rate Limits](/data-api/resources/rate-limits). * **Node Throughput** - Maximum Compute Units per second on each individual RPC node, applied on top of your account-wide request rate. * **Nodes** - Number of dedicated node endpoints available ## Avoiding Rate Limits To stay within limits: 1. Monitor your CU consumption in the [Moralis Dashboard](https://admin.moralis.com/) 2. Keep your request rate below your plan's throughput 3. Implement exponential backoff for retries 4. Cache responses when possible 5. Use batch requests to reduce HTTP overhead (not CU cost) ## Rate Limit Response When rate limited, you'll receive an HTTP 429 response: ```json theme={null} { "jsonrpc": "2.0", "error": { "code": -32005, "message": "Rate limit exceeded" }, "id": 1 } ``` ## Need Higher Limits? Contact Moralis for Enterprise plans with custom limits tailored to your needs. # eth_blockNumber Source: https://docs.moralis.com/rpc-nodes/linea/eth-blockNumber Returns the number of most recent block. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request body No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/linea/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x4b7" } ``` # eth_call Source: https://docs.moralis.com/rpc-nodes/linea/eth-call Executes a new message call immediately without creating a transaction on the blockchain. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **from** `string` The address the transaction is sent from **to** `string` *required* The address the transaction is directed to **gas** `string` Integer of the gas provided for the transaction execution **gasPrice** `string` Integer of the gasPrice used for each paid gas **value** `string` Integer of the value sent with this transaction **data** `string` Hash of the method signature and encoded parameters **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ { "from": "0x0000000000000000000000000000000000000000", "to": "0x0000000000000000000000000000000000000000", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0x" }, "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/linea/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_call", "params": [{"from": "0xb60e8dd61c5d32be8058bb8eb970870f07233155", "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"}, "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x15536ee" } ``` # eth_chainId Source: https://docs.moralis.com/rpc-nodes/linea/eth-chain-id Returns the chain ID of the current connected node as described in EIP-695. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request body No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/linea/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_chainId", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` # eth_createAccessList Source: https://docs.moralis.com/rpc-nodes/linea/eth-create-access-list Creates an access list that you can include in a transaction. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **from** `string` The address the transaction is sent from **to** `string` The address the transaction is directed to **gas** `string` Integer of the gas provided for the transaction execution **gasPrice** `string` Integer of the gasPrice used for each paid gas **maxPriorityFeePerGas** `string` Maximum fee per gas the sender is willing to pay to miners **maxFeePerGas** `string` Maximum total fee per gas the sender is willing to pay **value** `string` Integer of the value sent with this transaction **data** `string` Hash of the method signature and encoded parameters **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ { "from": "0x8ba1f109551bd432803012645haca66c9834d7c6", "to": "0x6b175474e89094c44da98b954eedeac495271d0f", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0xa9059cbb0000000000000000000000008ba1f109551bd432803012645haca66c9834d7c60000000000000000000000000000000000000000000000000de0b6b3a7640000" }, "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/linea/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_createAccessList", "params": [{"from": "0x8ba1f109551bd432803012645haca66c9834d7c6", "to": "0x6b175474e89094c44da98b954eedeac495271d0f", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0xa9059cbb0000000000000000000000008ba1f109551bd432803012645haca66c9834d7c60000000000000000000000000000000000000000000000000de0b6b3a7640000"}, "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "accessList": [ { "address": "0x6b175474e89094c44da98b954eedeac495271d0f", "storageKeys": [ "0x0000000000000000000000000000000000000000000000000000000000000000" ] } ], "gasUsed": "0x7671" } } ``` # eth_estimateGas Source: https://docs.moralis.com/rpc-nodes/linea/eth-estimate-gas Generates and returns an estimate of how much gas is necessary to allow the transaction to complete. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **from** `string` The address the transaction is sent from **to** `string` The address the transaction is directed to **gas** `string` Integer of the gas provided for the transaction execution **gasPrice** `string` Integer of the gasPrice used for each paid gas **value** `string` Integer of the value sent with this transaction **data** `string` Hash of the method signature and encoded parameters **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ { "from": "0x8D97689C9818892B700e27F316cc3E41e17fBeb9", "to": "0xd3CdA913deB6f67967B99D67aCDFa1712C293601", "value": "0x186a0" }, "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/linea/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_estimateGas", "params": [{"from": "0x8D97689C9818892B700e27F316cc3E41e17fBeb9", "to": "0xd3CdA913deB6f67967B99D67aCDFa1712C293601", "value": "0x186a0"}, "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x5208" } ``` # eth_feeHistory Source: https://docs.moralis.com/rpc-nodes/linea/eth-fee-history Returns historical gas information for a range of blocks. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockCount** `string` *required* Number of blocks in the requested range **newestBlock** `string` *required* Highest number block of the requested range **rewardPercentiles** `array` Array of percentile values to sample from each block's effective priority fees per gas #### Example request `params` ```javascript theme={null} [ "0x4", "latest", [25, 75] ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/linea/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_feeHistory", "params": ["0x4", "latest", [25, 75]], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": [ "0x7", "0x7", "0x7", "0x7", "0x7" ], "gasUsedRatio": [ 0.026089875, 0.406803, 0.010817, 0.5 ], "baseFeePerBlobGas": [ "0x3319eb", "0x350c54", "0x364072", "0x364072", "0x32279d" ], "blobGasUsedRatio": [ 0.47619047619047616, 0.2857142857142857, 0, 0.3333333333333333 ], "oldestBlock": "0x11b9231", "reward": [ ["0x4a817c800", "0x4a817c800"], ["0x773593c0", "0x773593c0"], ["0x0", "0x0"], ["0x0", "0x0"] ] } } ``` # eth_gasPrice Source: https://docs.moralis.com/rpc-nodes/linea/eth-gas-price Returns the current price per gas in wei. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/linea/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x09184e72a000" } ``` # eth_getBalance Source: https://docs.moralis.com/rpc-nodes/linea/eth-get-balance Returns the balance of the account of given address. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address to check for balance **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/linea/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0234c8a3397aab58" } ``` # eth_getBlockByHash Source: https://docs.moralis.com/rpc-nodes/linea/eth-get-block-by-hash Returns information about a block by hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block **fullTransactionObjects** `boolean` *required* If true it returns the full transaction objects, if false only the hashes of the transactions #### Example request `params` ```javascript theme={null} [ "0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c", false ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/linea/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c", false], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x3319bb0", "blobGasUsed": "0x120000", "difficulty": "0x0", "excessBlobGas": "0xa576243", "extraData": "0xe29ca82051756173617220287175617361722e77696e2920e29ca8", "gasLimit": "0x3938700", "gasUsed": "0x2965eaa", "hash": "0xc319ec0da50d354ce425b63fb6914a42aafdb9ee9807518edd595809e25fbe38", "logsBloom": "0x7feeeb37793b4fdfff7ab7aefde2d7fdfff9575bfef5bdff3fb97bfef7bcddbbdf9d55e77fdf7ead7b98ffd9bb6fefff7e77b163bf9eeebdddd1ffbf376cfbeb7efffef83ffbe9eb7ff7776ab3dcf8bfee7ebaddfffdf7fe3fffdf6ed3f7dff77cf2fd7efffff7a19ef7ffbbe3e8befdb7fff76b6ed6e7ffceeb99ff7eeb5efebfff3fff7da1fb39f9fff3fd7f3f77b6dd0bed39f5fff3bfa7fbbce7f9f6ec6e0fff50bfe7f9f79efff35ff6d93fecfefbffdaf7b7eff35ec6ff42fe7e6f77f7deff7eff57f6aafa597feebdffff7bbd677e27ffbfadfdf57f7e7d2aeeffffff6676ffa7f3f375eb95eecf9ffa235cbfcdefafbf8feed9dc7b56ff2fdfedfefe", "miner": "0x396343362be2a4da1ce0c1c210945346fb82aa49", "mixHash": "0x07444bb5750f746e200e1dcd8d83221b26576d3357b833cc1e434e7966d0e774", "nonce": "0x0000000000000000", "number": "0x1736791", "parentBeaconBlockRoot": "0x2759f248e2d1cb1a2f5c2657c4efcc623dd8ea7f23e8700162e7fccdacedfd5d", "parentHash": "0xdf0e4dee910167d7b1687a6cb677983ce7ed351ae78ab7e2c5ba39d793c80391", "receiptsRoot": "0x5f1c58e498161509245daad0f60319d9abab7f04d2ca60e99a3674cfdc9b8327", "requestsHash": "0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x1ef1e", "stateRoot": "0x728c7e38107037b573d719e67b6872ee3ca4e01b47818598316cd696bfe24f2c", "timestamp": "0x697b4bcb", "transactions": [ "0xbf7bd0cf98c3b65525f1f7267b1d02e7ccd7cd133b137f46723a91cf187616d5", "0x06ac9281da76d530aa19600e2c34aae7564a78702d3eb52b1fb363985473e296" ], "transactionsRoot": "0xa8c680f6ad8ccc7a49db5ab76cbd9194c88e16dbcfa440104f7787e5ba815c4f", "uncles": [], "withdrawals": [ { "index": "0x6f78bfb", "validatorIndex": "0x955f5", "address": "0x5d3ca1842d0988816434ea51ca420182f3f1e31a", "amount": "0x102d2f1" } ], "withdrawalsRoot": "0x9b7ecf1ba575fc02e4b4c14bd65d5ca95c0e066adaae3fc2ef16f5acd90214d8" } } ``` # eth_getBlockByNumber Source: https://docs.moralis.com/rpc-nodes/linea/eth-get-block-by-number Returns information about a block by block number. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" **fullTransactionObjects** `boolean` *required* If true it returns the full transaction objects, if false only the hashes of the transactions #### Example request `params` ```javascript theme={null} [ "0x1b4", true ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/linea/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["0x1b4", true], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x3319bb0", "blobGasUsed": "0x120000", "difficulty": "0x0", "excessBlobGas": "0xa576243", "extraData": "0xe29ca82051756173617220287175617361722e77696e2920e29ca8", "gasLimit": "0x3938700", "gasUsed": "0x2965eaa", "hash": "0xc319ec0da50d354ce425b63fb6914a42aafdb9ee9807518edd595809e25fbe38", "logsBloom": "0x7feeeb37793b4fdfff7ab7aefde2d7fdfff9575bfef5bdff3fb97bfef7bcddbbdf9d55e77fdf7ead7b98ffd9bb6fefff7e77b163bf9eeebdddd1ffbf376cfbeb7efffef83ffbe9eb7ff7776ab3dcf8bfee7ebaddfffdf7fe3fffdf6ed3f7dff77cf2fd7efffff7a19ef7ffbbe3e8befdb7fff76b6ed6e7ffceeb99ff7eeb5efebfff3fff7da1fb39f9fff3fd7f3f77b6dd0bed39f5fff3bfa7fbbce7f9f6ec6e0fff50bfe7f9f79efff35ff6d93fecfefbffdaf7b7eff35ec6ff42fe7e6f77f7deff7eff57f6aafa597feebdffff7bbd677e27ffbfadfdf57f7e7d2aeeffffff6676ffa7f3f375eb95eecf9ffa235cbfcdefafbf8feed9dc7b56ff2fdfedfefe", "miner": "0x396343362be2a4da1ce0c1c210945346fb82aa49", "mixHash": "0x07444bb5750f746e200e1dcd8d83221b26576d3357b833cc1e434e7966d0e774", "nonce": "0x0000000000000000", "number": "0x1736791", "parentBeaconBlockRoot": "0x2759f248e2d1cb1a2f5c2657c4efcc623dd8ea7f23e8700162e7fccdacedfd5d", "parentHash": "0xdf0e4dee910167d7b1687a6cb677983ce7ed351ae78ab7e2c5ba39d793c80391", "receiptsRoot": "0x5f1c58e498161509245daad0f60319d9abab7f04d2ca60e99a3674cfdc9b8327", "requestsHash": "0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x1ef1e", "stateRoot": "0x728c7e38107037b573d719e67b6872ee3ca4e01b47818598316cd696bfe24f2c", "timestamp": "0x697b4bcb", "transactions": [ "0xbf7bd0cf98c3b65525f1f7267b1d02e7ccd7cd133b137f46723a91cf187616d5", "0x06ac9281da76d530aa19600e2c34aae7564a78702d3eb52b1fb363985473e296" ], "transactionsRoot": "0xa8c680f6ad8ccc7a49db5ab76cbd9194c88e16dbcfa440104f7787e5ba815c4f", "uncles": [], "withdrawals": [ { "index": "0x6f78bfb", "validatorIndex": "0x955f5", "address": "0x5d3ca1842d0988816434ea51ca420182f3f1e31a", "amount": "0x102d2f1" } ], "withdrawalsRoot": "0x9b7ecf1ba575fc02e4b4c14bd65d5ca95c0e066adaae3fc2ef16f5acd90214d8" } } ``` # eth_getBlockReceipts Source: https://docs.moralis.com/rpc-nodes/linea/eth-get-block-receipts Returns all transaction receipts for a given block. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" #### Example request `params` ```javascript theme={null} [ "0xf21d9c" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/linea/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockReceipts", "params": ["0xf21d9c"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": [ { "blockHash": "0x8243343df08b9751f5ca0c5f8c9c0460d8a9b6351066fae0acbd4d3e776de8bb", "blockNumber": "0xf21d9c", "contractAddress": null, "cumulativeGasUsed": "0x5208", "effectiveGasPrice": "0x1dcd6500", "from": "0x8ba1f109551bd432803012645haca66c9834d7c6", "gasUsed": "0x5208", "logs": [], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "status": "0x1", "to": "0x95cED938F7991cd0dFcb48F0a06a40FA1aF46EBC", "transactionHash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "transactionIndex": "0x0", "type": "0x2" } ] } ``` # eth_getBlockTransactionCountByHash Source: https://docs.moralis.com/rpc-nodes/linea/eth-get-block-transaction-count-by-hash Returns the number of transactions in a block from a block matching the given block hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block #### Example request `params` ```javascript theme={null} [ "0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/linea/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` # eth_getBlockTransactionCountByNumber Source: https://docs.moralis.com/rpc-nodes/linea/eth-get-block-transaction-count-by-number Returns the number of transactions in a block matching the given block number. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" #### Example request `params` ```javascript theme={null} [ "0xe8" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/linea/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["0xe8"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` # eth_getCode Source: https://docs.moralis.com/rpc-nodes/linea/eth-get-code Returns code at a given address. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address to get the code from **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x2" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/linea/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getCode", "params": ["0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x2"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x600160008035811a818181146012578301005b601b6001356025565b8060005260206000f25b600060078202905091905056" } ``` # eth_getLogs Source: https://docs.moralis.com/rpc-nodes/linea/eth-get-logs Returns an array of all logs matching a given filter object. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **fromBlock** `string` Integer block number, or "latest" for the last mined block or "pending", "earliest" for not yet mined transactions **toBlock** `string` Integer block number, or "latest" for the last mined block or "pending", "earliest" for not yet mined transactions **address** `string` Contract address or a list of addresses from which logs should originate **topics** `array` Array of 32 Bytes DATA topics. Topics are order-dependent **blockhash** `string` Using blockhash is equivalent to fromBlock = toBlock = the block number with hash blockhash #### Example request `params` ```javascript theme={null} [ { "fromBlock": "0x1", "toBlock": "0x2", "address": "0x8888f1f195afa192cfee860698584c030f4c9db1", "topics": [ "0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", null, [ "0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x0000000000000000000000000aff3454fce5edbc8cca8697c15331677e6ebccc" ] ] } ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/linea/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getLogs", "params": [{"fromBlock": "0x1", "toBlock": "0x2", "address": "0x8888f1f195afa192cfee860698584c030f4c9db1", "topics": ["0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", null, ["0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x0000000000000000000000000aff3454fce5edbc8cca8697c15331677e6ebccc"]]}], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": [ { "logIndex": "0x1", "blockNumber": "0x1b4", "blockHash": "0x8216c5785ac562ff41e2dcfdf5785ac562ff41e2dcfdf829c5a142f1fccd7d", "transactionHash": "0xdf829c5a142f1fccd7d8216c5785ac562ff41e2dcfdf5785ac562ff41e2dcf", "transactionIndex": "0x0", "address": "0x16c5785ac562ff41e2dcfdf829c5a142f1fccd7d", "data": "0x0000000000000000000000000000000000000000000000000000000000000000", "topics": [ "0x59ebeb90bc63057b6515673c3ecf9438e5058bca0f92585014eced636878c9a5" ] } ] } ``` # eth_getProof Source: https://docs.moralis.com/rpc-nodes/linea/eth-get-proof Returns the account and storage values of the specified account including the Merkle-proof. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address of the account or contract **storageKeys** `array` *required* Array of storage-keys which should be proofed and included **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842", [ "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421" ], "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/linea/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getProof", "params": ["0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842", ["0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"], "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "address": "0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842", "accountProof": [ "0xf90211a090dcaf88c40c7bbc95a912cbdde67c175767b31173df9ee4b0d733bfdd511c43a0babe369f6b12092f49181ae04ca173fb68d1a5456f18d20fa32cba73954052bda0473ecf8a7e36a829e75039a3b055e51b8332cbf03324ab4af2066bbd6fbf0021fa0bbda34753d7aa6c38e603f360244e8f59611921d9e1f128372fec0d586d4f9e0a04e44caecff45c9891f74f6a2156735886eedf6f1a733628ebc802ec79d844648a0a5f3f2f7542148c973977c8a1e154c4300fec92f755f7846f1b734d3ab1d90e7a0e823850f50bf72baae9d1733a36a444ab65d0a6faaba404f0583ce0ca4dad92da0f7a00cbe7d4b30b11faea3ae61b7f1f2b315017e79a3de5ab2dc8bb46a59fdb37a09b3b8d0e0e4c1e3b2d3e8f7c6e5d4c3b2a1e0f9e8d7c6b5a4e3f2e1d0c9b8a7a0b1f8e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0a0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0a0d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a08080" ], "balance": "0x0", "codeHash": "0x5e61b0f7919ab4e6fc7cfa6f3f5f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f", "nonce": "0x0", "storageHash": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "storageProof": [ { "key": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "value": "0x1", "proof": [ "0xf90211a090dcaf88c40c7bbc95a912cbdde67c175767b31173df9ee4b0d733bfdd511c43a0babe369f6b12092f49181ae04ca173fb68d1a5456f18d20fa32cba73954052bda0473ecf8a7e36a829e75039a3b055e51b8332cbf03324ab4af2066bbd6fbf0021fa0bbda34753d7aa6c38e603f360244e8f59611921d9e1f128372fec0d586d4f9e0a04e44caecff45c9891f74f6a2156735886eedf6f1a733628ebc802ec79d844648a0a5f3f2f7542148c973977c8a1e154c4300fec92f755f7846f1b734d3ab1d90e7a0e823850f50bf72baae9d1733a36a444ab65d0a6faaba404f0583ce0ca4dad92da0f7a00cbe7d4b30b11faea3ae61b7f1f2b315017e79a3de5ab2dc8bb46a59fdb37a09b3b8d0e0e4c1e3b2d3e8f7c6e5d4c3b2a1e0f9e8d7c6b5a4e3f2e1d0c9b8a7a0b1f8e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0a0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0a0d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a08080" ] } ] } } ``` # eth_getStorageAt Source: https://docs.moralis.com/rpc-nodes/linea/eth-get-storage-at Returns the value from a storage position at a given address. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address of the storage **position** `string` *required* Integer of the position in the storage **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x0", "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/linea/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x0", "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x00000000000000000000000000000000000000000000000000000000000004d2" } ``` # eth_getTransactionByBlockHashAndIndex Source: https://docs.moralis.com/rpc-nodes/linea/eth-get-transaction-by-block-hash-and-index Returns information about a transaction by block hash and transaction index position. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block **index** `string` *required* Integer of the transaction index position #### Example request `params` ```javascript theme={null} [ "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/linea/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5daf3b", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "gas": "0xc350", "gasPrice": "0x4a817c800", "hash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "input": "0x68656c6c6f21", "nonce": "0x15", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "transactionIndex": "0x0", "value": "0xf3dbb76162000", "v": "0x25", "r": "0x1b5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5", "s": "0x5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5c5" } } ``` # eth_getTransactionByBlockNumberAndIndex Source: https://docs.moralis.com/rpc-nodes/linea/eth-get-transaction-by-block-number-and-index Returns information about a transaction by block number and transaction index position. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* A block number, or the string "earliest", "latest" or "pending" **index** `string` *required* The transaction index position #### Example request `params` ```javascript theme={null} [ "0x5BAE9E", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/linea/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["0x5BAE9E", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5BAE9E", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "gas": "0xc350", "gasPrice": "0x4a817c800", "hash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "input": "0x68656c6c6f21", "nonce": "0x15", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "transactionIndex": "0x0", "value": "0xf3dbb76162000", "v": "0x25", "r": "0x1b5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5", "s": "0x5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5c5" } } ``` # eth_getTransactionByHash Source: https://docs.moralis.com/rpc-nodes/linea/eth-get-transaction-by-hash Returns the information about a transaction requested by transaction hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a transaction #### Example request `params` ```javascript theme={null} [ "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/linea/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5daf3b", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "gas": "0xc350", "gasPrice": "0x4a817c800", "hash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "input": "0x68656c6c6f21", "nonce": "0x15", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "transactionIndex": "0x41", "value": "0xf3dbb76162000", "v": "0x25", "r": "0x1b5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5", "s": "0x5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5c5" } } ``` # eth_getTransactionCount Source: https://docs.moralis.com/rpc-nodes/linea/eth-get-transaction-count Returns the number of transactions sent from an address. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address to get transaction count for **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/linea/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` # eth_getTransactionReceipt Source: https://docs.moralis.com/rpc-nodes/linea/eth-get-transaction-receipt Returns the receipt of a transaction by transaction hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a transaction #### Example request `params` ```javascript theme={null} [ "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/linea/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "transactionHash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "transactionIndex": "0x41", "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5daf3b", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "cumulativeGasUsed": "0x33bc", "gasUsed": "0x4dc", "contractAddress": null, "logs": [], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "status": "0x1" } } ``` # eth_getUncleByBlockHashAndIndex Source: https://docs.moralis.com/rpc-nodes/linea/eth-get-uncle-by-block-hash-and-index Returns information about an uncle of a block by hash and uncle index position. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block **index** `string` *required* The uncle's index position #### Example request `params` ```javascript theme={null} [ "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/linea/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x027f07", "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000", "gasLimit": "0x9f759", "gasUsed": "0x9f759", "hash": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331", "logsBloom": "0x1a060020000015554c000200000003050000200017041014032020801000056020000001000a00d0020204040020012150010010000000280005000c00000000000020c0000000024008104011000080020020000001006100900000024208002000020002100000000000000080000000120080000002003c0000200000000200002010008300300001001031100100040010420000800000000014000004002000000c040200060000000080000000100000000040a2000001000061000042021080400200000410000404080800014008201000c20100500020011000000030001100100024008c80190400402008000020000c0041104218100000000000000002000800000", "miner": "0x4e65fda2159562a496f9f3522f89122a3088497a", "mixHash": "0x99e9d85137db46ef1e85fff042bb15a7b6f46618b7f600b0b4e7fb52fceafc3a", "nonce": "0xfcf4db6d9bce1b8b", "number": "0x1b4", "parentHash": "0xa057c32b6ed8eb5e006cadfad55c7e635549c6e2135c4e6c3a9d5a6a80f72c3", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0x1a7e46b37b26e0c3f67ed4de3b5d3b1ff84a2e0a5e2dcf4d4b0d34b5a22b6e3", "timestamp": "0x55ba467c", "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` # eth_getUncleByBlockNumberAndIndex Source: https://docs.moralis.com/rpc-nodes/linea/eth-get-uncle-by-block-number-and-index Returns information about an uncle of a block by number and uncle index position. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* A block number, or the string "earliest", "latest" or "pending" **index** `string` *required* The uncle's index position #### Example request `params` ```javascript theme={null} [ "0x29c", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/linea/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["0x29c", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x027f07", "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000", "gasLimit": "0x9f759", "gasUsed": "0x9f759", "hash": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331", "logsBloom": "0x1a060020000015554c000200000003050000200017041014032020801000056020000001000a00d0020204040020012150010010000000280005000c00000000000020c0000000024008104011000080020020000001006100900000024208002000020002100000000000000080000000120080000002003c0000200000000200002010008300300001001031100100040010420000800000000014000004002000000c040200060000000080000000100000000040a2000001000061000042021080400200000410000404080800014008201000c20100500020011000000030001100100024008c80190400402008000020000c0041104218100000000000000002000800000", "miner": "0x4e65fda2159562a496f9f3522f89122a3088497a", "mixHash": "0x99e9d85137db46ef1e85fff042bb15a7b6f46618b7f600b0b4e7fb52fceafc3a", "nonce": "0xfcf4db6d9bce1b8b", "number": "0x29c", "parentHash": "0xa057c32b6ed8eb5e006cadfad55c7e635549c6e2135c4e6c3a9d5a6a80f72c3", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0x1a7e46b37b26e0c3f67ed4de3b5d3b1ff84a2e0a5e2dcf4d4b0d34b5a22b6e3", "timestamp": "0x55ba467c", "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` # eth_getUncleCountByBlockHash Source: https://docs.moralis.com/rpc-nodes/linea/eth-get-uncle-count-by-block-hash Returns the number of uncles in a block from a block matching the given block hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block #### Example request `params` ```javascript theme={null} [ "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/linea/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` # eth_getUncleCountByBlockNumber Source: https://docs.moralis.com/rpc-nodes/linea/eth-get-uncle-count-by-block-number Returns the number of uncles in a block from a block matching the given block number. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" #### Example request `params` ```javascript theme={null} [ "0x5BAE9E" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/linea/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["0x5BAE9E"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` # eth_maxPriorityFeePerGas Source: https://docs.moralis.com/rpc-nodes/linea/eth-max-priority-fee-per-gas Returns a suggestion for the max priority fee per gas for dynamic fee transactions in wei. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/linea/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_maxPriorityFeePerGas", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x59682f00" } ``` # eth_sendRawTransaction Source: https://docs.moralis.com/rpc-nodes/linea/eth-send-raw-transaction Submits a pre-signed transaction for broadcast to the network. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **data** `string` *required* The signed transaction data #### Example request `params` ```javascript theme={null} [ "0xf869808504e3b2928082520894f0109fc8df283027b6285cc889f5aa624eac1f55843b9aca008025a0c9cf86333bcb065d140032ecaab5d9281bde80f21b9687b3e94161de42d51895a0727a108a0b8d101465414033c3f705a9c7b826e596766046ee1183dbc8aeaa68" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/linea/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["0xf869808504e3b2928082520894f0109fc8df283027b6285cc889f5aa624eac1f55843b9aca008025a0c9cf86333bcb065d140032ecaab5d9281bde80f21b9687b3e94161de42d51895a0727a108a0b8d101465414033c3f705a9c7b826e596766046ee1183dbc8aeaa68"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" } ``` # Overview Source: https://docs.moralis.com/rpc-nodes/linea/overview Explore Linea JSON-RPC methods ## Introduction Linea is a high-performance Layer 2 solution for Ethereum, designed to provide low-cost and fast transactions while maintaining Ethereum’s security through zk-rollups. Linea’s architecture allows for greater scalability, enabling decentralized applications (dApps) to process more transactions at lower costs, making it ideal for decentralized finance (DeFi), gaming, and NFT ecosystems. ## Supported Networks The Linea RPC API is available for the following networks: 1. **Linea Mainnet** ## Network Details | **Network** | **Chain ID** | **Path Parameter** | | :- | :- | :- | | **Linea Mainnet** | 0xe708 (59144) | `linea` | ## Supported RPC Methods * [eth\_blockNumber](/rpc-nodes/linea/eth-blockNumber) * [eth\_call](/rpc-nodes/linea/eth-call) * [eth\_chainId](/rpc-nodes/linea/eth-chain-id) * [eth\_createAccessList](/rpc-nodes/linea/eth-create-access-list) * [eth\_estimateGas](/rpc-nodes/linea/eth-estimate-gas) * [eth\_feeHistory](/rpc-nodes/linea/eth-fee-history) * [eth\_gasPrice](/rpc-nodes/linea/eth-gas-price) * [eth\_getBalance](/rpc-nodes/linea/eth-get-balance) * [eth\_getBlockByHash](/rpc-nodes/linea/eth-get-block-by-hash) * [eth\_getBlockByNumber](/rpc-nodes/linea/eth-get-block-by-number) * [eth\_getBlockTransactionCountByHash](/rpc-nodes/linea/eth-get-block-transaction-count-by-hash) * [eth\_getBlockTransactionCountByNumber](/rpc-nodes/linea/eth-get-block-transaction-count-by-number) * [eth\_getBlockReceipts](/rpc-nodes/linea/eth-get-block-receipts) * [eth\_getCode](/rpc-nodes/linea/eth-get-code) * [eth\_getLogs](/streams/api-reference/history/get-logs) * [eth\_getProof](/rpc-nodes/linea/eth-get-proof) * [eth\_getStorageAt](/rpc-nodes/linea/eth-get-storage-at) * [eth\_getTransactionByHash](/rpc-nodes/linea/eth-get-transaction-by-hash) * [eth\_getTransactionByBlockHashAndIndex](/rpc-nodes/linea/eth-get-transaction-by-block-hash-and-index) * [eth\_getTransactionByBlockNumberAndIndex](/rpc-nodes/linea/eth-get-transaction-by-block-number-and-index) * [eth\_getTransactionCount](/rpc-nodes/linea/eth-get-transaction-count) * [eth\_getTransactionReceipt](/rpc-nodes/linea/eth-get-transaction-receipt) * [eth\_getUncleByBlockHashAndIndex](/rpc-nodes/linea/eth-get-uncle-by-block-hash-and-index) * [eth\_getUncleByBlockNumberAndIndex](/rpc-nodes/linea/eth-get-uncle-by-block-number-and-index) * [eth\_getUncleCountByBlockHash](/rpc-nodes/linea/eth-get-uncle-count-by-block-hash) * [eth\_getUncleCountByBlockNumber](/rpc-nodes/linea/eth-get-uncle-count-by-block-number) * [eth\_maxPriorityFeePerGas](/rpc-nodes/linea/eth-max-priority-fee-per-gas) * [eth\_sendRawTransaction](/rpc-nodes/linea/eth-send-raw-transaction) # eth_blockNumber Source: https://docs.moralis.com/rpc-nodes/lisk/eth-blockNumber Returns the number of most recent block. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request body No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/lisk/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x4b7" } ``` # eth_call Source: https://docs.moralis.com/rpc-nodes/lisk/eth-call Executes a new message call immediately without creating a transaction on the blockchain. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **from** `string` The address the transaction is sent from **to** `string` *required* The address the transaction is directed to **gas** `string` Integer of the gas provided for the transaction execution **gasPrice** `string` Integer of the gasPrice used for each paid gas **value** `string` Integer of the value sent with this transaction **data** `string` Hash of the method signature and encoded parameters **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ { "from": "0x0000000000000000000000000000000000000000", "to": "0x0000000000000000000000000000000000000000", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0x" }, "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/lisk/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_call", "params": [{"from": "0xb60e8dd61c5d32be8058bb8eb970870f07233155", "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"}, "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x15536ee" } ``` # eth_chainId Source: https://docs.moralis.com/rpc-nodes/lisk/eth-chain-id Returns the chain ID of the current connected node as described in EIP-695. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request body No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/lisk/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_chainId", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` # eth_createAccessList Source: https://docs.moralis.com/rpc-nodes/lisk/eth-create-access-list Creates an access list that you can include in a transaction. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **from** `string` The address the transaction is sent from **to** `string` The address the transaction is directed to **gas** `string` Integer of the gas provided for the transaction execution **gasPrice** `string` Integer of the gasPrice used for each paid gas **maxPriorityFeePerGas** `string` Maximum fee per gas the sender is willing to pay to miners **maxFeePerGas** `string` Maximum total fee per gas the sender is willing to pay **value** `string` Integer of the value sent with this transaction **data** `string` Hash of the method signature and encoded parameters **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ { "from": "0x8ba1f109551bd432803012645haca66c9834d7c6", "to": "0x6b175474e89094c44da98b954eedeac495271d0f", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0xa9059cbb0000000000000000000000008ba1f109551bd432803012645haca66c9834d7c60000000000000000000000000000000000000000000000000de0b6b3a7640000" }, "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/lisk/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_createAccessList", "params": [{"from": "0x8ba1f109551bd432803012645haca66c9834d7c6", "to": "0x6b175474e89094c44da98b954eedeac495271d0f", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0xa9059cbb0000000000000000000000008ba1f109551bd432803012645haca66c9834d7c60000000000000000000000000000000000000000000000000de0b6b3a7640000"}, "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "accessList": [ { "address": "0x6b175474e89094c44da98b954eedeac495271d0f", "storageKeys": [ "0x0000000000000000000000000000000000000000000000000000000000000000" ] } ], "gasUsed": "0x7671" } } ``` # eth_estimateGas Source: https://docs.moralis.com/rpc-nodes/lisk/eth-estimate-gas Generates and returns an estimate of how much gas is necessary to allow the transaction to complete. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **from** `string` The address the transaction is sent from **to** `string` The address the transaction is directed to **gas** `string` Integer of the gas provided for the transaction execution **gasPrice** `string` Integer of the gasPrice used for each paid gas **value** `string` Integer of the value sent with this transaction **data** `string` Hash of the method signature and encoded parameters **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ { "from": "0x8D97689C9818892B700e27F316cc3E41e17fBeb9", "to": "0xd3CdA913deB6f67967B99D67aCDFa1712C293601", "value": "0x186a0" }, "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/lisk/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_estimateGas", "params": [{"from": "0x8D97689C9818892B700e27F316cc3E41e17fBeb9", "to": "0xd3CdA913deB6f67967B99D67aCDFa1712C293601", "value": "0x186a0"}, "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x5208" } ``` # eth_feeHistory Source: https://docs.moralis.com/rpc-nodes/lisk/eth-fee-history Returns historical gas information for a range of blocks. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockCount** `string` *required* Number of blocks in the requested range **newestBlock** `string` *required* Highest number block of the requested range **rewardPercentiles** `array` Array of percentile values to sample from each block's effective priority fees per gas #### Example request `params` ```javascript theme={null} [ "0x4", "latest", [25, 75] ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/lisk/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_feeHistory", "params": ["0x4", "latest", [25, 75]], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": [ "0x7", "0x7", "0x7", "0x7", "0x7" ], "gasUsedRatio": [ 0.026089875, 0.406803, 0.010817, 0.5 ], "baseFeePerBlobGas": [ "0x3319eb", "0x350c54", "0x364072", "0x364072", "0x32279d" ], "blobGasUsedRatio": [ 0.47619047619047616, 0.2857142857142857, 0, 0.3333333333333333 ], "oldestBlock": "0x11b9231", "reward": [ ["0x4a817c800", "0x4a817c800"], ["0x773593c0", "0x773593c0"], ["0x0", "0x0"], ["0x0", "0x0"] ] } } ``` # eth_gasPrice Source: https://docs.moralis.com/rpc-nodes/lisk/eth-gas-price Returns the current price per gas in wei. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/lisk/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x09184e72a000" } ``` # eth_getBalance Source: https://docs.moralis.com/rpc-nodes/lisk/eth-get-balance Returns the balance of the account of given address. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address to check for balance **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/lisk/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0234c8a3397aab58" } ``` # eth_getBlockByHash Source: https://docs.moralis.com/rpc-nodes/lisk/eth-get-block-by-hash Returns information about a block by hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block **fullTransactionObjects** `boolean` *required* If true it returns the full transaction objects, if false only the hashes of the transactions #### Example request `params` ```javascript theme={null} [ "0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c", false ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/lisk/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c", false], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x3319bb0", "blobGasUsed": "0x120000", "difficulty": "0x0", "excessBlobGas": "0xa576243", "extraData": "0xe29ca82051756173617220287175617361722e77696e2920e29ca8", "gasLimit": "0x3938700", "gasUsed": "0x2965eaa", "hash": "0xc319ec0da50d354ce425b63fb6914a42aafdb9ee9807518edd595809e25fbe38", "logsBloom": "0x7feeeb37793b4fdfff7ab7aefde2d7fdfff9575bfef5bdff3fb97bfef7bcddbbdf9d55e77fdf7ead7b98ffd9bb6fefff7e77b163bf9eeebdddd1ffbf376cfbeb7efffef83ffbe9eb7ff7776ab3dcf8bfee7ebaddfffdf7fe3fffdf6ed3f7dff77cf2fd7efffff7a19ef7ffbbe3e8befdb7fff76b6ed6e7ffceeb99ff7eeb5efebfff3fff7da1fb39f9fff3fd7f3f77b6dd0bed39f5fff3bfa7fbbce7f9f6ec6e0fff50bfe7f9f79efff35ff6d93fecfefbffdaf7b7eff35ec6ff42fe7e6f77f7deff7eff57f6aafa597feebdffff7bbd677e27ffbfadfdf57f7e7d2aeeffffff6676ffa7f3f375eb95eecf9ffa235cbfcdefafbf8feed9dc7b56ff2fdfedfefe", "miner": "0x396343362be2a4da1ce0c1c210945346fb82aa49", "mixHash": "0x07444bb5750f746e200e1dcd8d83221b26576d3357b833cc1e434e7966d0e774", "nonce": "0x0000000000000000", "number": "0x1736791", "parentBeaconBlockRoot": "0x2759f248e2d1cb1a2f5c2657c4efcc623dd8ea7f23e8700162e7fccdacedfd5d", "parentHash": "0xdf0e4dee910167d7b1687a6cb677983ce7ed351ae78ab7e2c5ba39d793c80391", "receiptsRoot": "0x5f1c58e498161509245daad0f60319d9abab7f04d2ca60e99a3674cfdc9b8327", "requestsHash": "0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x1ef1e", "stateRoot": "0x728c7e38107037b573d719e67b6872ee3ca4e01b47818598316cd696bfe24f2c", "timestamp": "0x697b4bcb", "transactions": [ "0xbf7bd0cf98c3b65525f1f7267b1d02e7ccd7cd133b137f46723a91cf187616d5", "0x06ac9281da76d530aa19600e2c34aae7564a78702d3eb52b1fb363985473e296" ], "transactionsRoot": "0xa8c680f6ad8ccc7a49db5ab76cbd9194c88e16dbcfa440104f7787e5ba815c4f", "uncles": [], "withdrawals": [ { "index": "0x6f78bfb", "validatorIndex": "0x955f5", "address": "0x5d3ca1842d0988816434ea51ca420182f3f1e31a", "amount": "0x102d2f1" } ], "withdrawalsRoot": "0x9b7ecf1ba575fc02e4b4c14bd65d5ca95c0e066adaae3fc2ef16f5acd90214d8" } } ``` # eth_getBlockByNumber Source: https://docs.moralis.com/rpc-nodes/lisk/eth-get-block-by-number Returns information about a block by block number. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" **fullTransactionObjects** `boolean` *required* If true it returns the full transaction objects, if false only the hashes of the transactions #### Example request `params` ```javascript theme={null} [ "0x1b4", true ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/lisk/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["0x1b4", true], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x3319bb0", "blobGasUsed": "0x120000", "difficulty": "0x0", "excessBlobGas": "0xa576243", "extraData": "0xe29ca82051756173617220287175617361722e77696e2920e29ca8", "gasLimit": "0x3938700", "gasUsed": "0x2965eaa", "hash": "0xc319ec0da50d354ce425b63fb6914a42aafdb9ee9807518edd595809e25fbe38", "logsBloom": "0x7feeeb37793b4fdfff7ab7aefde2d7fdfff9575bfef5bdff3fb97bfef7bcddbbdf9d55e77fdf7ead7b98ffd9bb6fefff7e77b163bf9eeebdddd1ffbf376cfbeb7efffef83ffbe9eb7ff7776ab3dcf8bfee7ebaddfffdf7fe3fffdf6ed3f7dff77cf2fd7efffff7a19ef7ffbbe3e8befdb7fff76b6ed6e7ffceeb99ff7eeb5efebfff3fff7da1fb39f9fff3fd7f3f77b6dd0bed39f5fff3bfa7fbbce7f9f6ec6e0fff50bfe7f9f79efff35ff6d93fecfefbffdaf7b7eff35ec6ff42fe7e6f77f7deff7eff57f6aafa597feebdffff7bbd677e27ffbfadfdf57f7e7d2aeeffffff6676ffa7f3f375eb95eecf9ffa235cbfcdefafbf8feed9dc7b56ff2fdfedfefe", "miner": "0x396343362be2a4da1ce0c1c210945346fb82aa49", "mixHash": "0x07444bb5750f746e200e1dcd8d83221b26576d3357b833cc1e434e7966d0e774", "nonce": "0x0000000000000000", "number": "0x1736791", "parentBeaconBlockRoot": "0x2759f248e2d1cb1a2f5c2657c4efcc623dd8ea7f23e8700162e7fccdacedfd5d", "parentHash": "0xdf0e4dee910167d7b1687a6cb677983ce7ed351ae78ab7e2c5ba39d793c80391", "receiptsRoot": "0x5f1c58e498161509245daad0f60319d9abab7f04d2ca60e99a3674cfdc9b8327", "requestsHash": "0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x1ef1e", "stateRoot": "0x728c7e38107037b573d719e67b6872ee3ca4e01b47818598316cd696bfe24f2c", "timestamp": "0x697b4bcb", "transactions": [ "0xbf7bd0cf98c3b65525f1f7267b1d02e7ccd7cd133b137f46723a91cf187616d5", "0x06ac9281da76d530aa19600e2c34aae7564a78702d3eb52b1fb363985473e296" ], "transactionsRoot": "0xa8c680f6ad8ccc7a49db5ab76cbd9194c88e16dbcfa440104f7787e5ba815c4f", "uncles": [], "withdrawals": [ { "index": "0x6f78bfb", "validatorIndex": "0x955f5", "address": "0x5d3ca1842d0988816434ea51ca420182f3f1e31a", "amount": "0x102d2f1" } ], "withdrawalsRoot": "0x9b7ecf1ba575fc02e4b4c14bd65d5ca95c0e066adaae3fc2ef16f5acd90214d8" } } ``` # eth_getBlockReceipts Source: https://docs.moralis.com/rpc-nodes/lisk/eth-get-block-receipts Returns all transaction receipts for a given block. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" #### Example request `params` ```javascript theme={null} [ "0xf21d9c" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/lisk/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockReceipts", "params": ["0xf21d9c"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": [ { "blockHash": "0x8243343df08b9751f5ca0c5f8c9c0460d8a9b6351066fae0acbd4d3e776de8bb", "blockNumber": "0xf21d9c", "contractAddress": null, "cumulativeGasUsed": "0x5208", "effectiveGasPrice": "0x1dcd6500", "from": "0x8ba1f109551bd432803012645haca66c9834d7c6", "gasUsed": "0x5208", "logs": [], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "status": "0x1", "to": "0x95cED938F7991cd0dFcb48F0a06a40FA1aF46EBC", "transactionHash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "transactionIndex": "0x0", "type": "0x2" } ] } ``` # eth_getBlockTransactionCountByHash Source: https://docs.moralis.com/rpc-nodes/lisk/eth-get-block-transaction-count-by-hash Returns the number of transactions in a block from a block matching the given block hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block #### Example request `params` ```javascript theme={null} [ "0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/lisk/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` # eth_getBlockTransactionCountByNumber Source: https://docs.moralis.com/rpc-nodes/lisk/eth-get-block-transaction-count-by-number Returns the number of transactions in a block matching the given block number. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" #### Example request `params` ```javascript theme={null} [ "0xe8" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/lisk/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["0xe8"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` # eth_getCode Source: https://docs.moralis.com/rpc-nodes/lisk/eth-get-code Returns code at a given address. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address to get the code from **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x2" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/lisk/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getCode", "params": ["0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x2"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x600160008035811a818181146012578301005b601b6001356025565b8060005260206000f25b600060078202905091905056" } ``` # eth_getLogs Source: https://docs.moralis.com/rpc-nodes/lisk/eth-get-logs Returns an array of all logs matching a given filter object. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **fromBlock** `string` Integer block number, or "latest" for the last mined block or "pending", "earliest" for not yet mined transactions **toBlock** `string` Integer block number, or "latest" for the last mined block or "pending", "earliest" for not yet mined transactions **address** `string` Contract address or a list of addresses from which logs should originate **topics** `array` Array of 32 Bytes DATA topics. Topics are order-dependent **blockhash** `string` Using blockhash is equivalent to fromBlock = toBlock = the block number with hash blockhash #### Example request `params` ```javascript theme={null} [ { "fromBlock": "0x1", "toBlock": "0x2", "address": "0x8888f1f195afa192cfee860698584c030f4c9db1", "topics": [ "0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", null, [ "0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x0000000000000000000000000aff3454fce5edbc8cca8697c15331677e6ebccc" ] ] } ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/lisk/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getLogs", "params": [{"fromBlock": "0x1", "toBlock": "0x2", "address": "0x8888f1f195afa192cfee860698584c030f4c9db1", "topics": ["0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", null, ["0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x0000000000000000000000000aff3454fce5edbc8cca8697c15331677e6ebccc"]]}], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": [ { "logIndex": "0x1", "blockNumber": "0x1b4", "blockHash": "0x8216c5785ac562ff41e2dcfdf5785ac562ff41e2dcfdf829c5a142f1fccd7d", "transactionHash": "0xdf829c5a142f1fccd7d8216c5785ac562ff41e2dcfdf5785ac562ff41e2dcf", "transactionIndex": "0x0", "address": "0x16c5785ac562ff41e2dcfdf829c5a142f1fccd7d", "data": "0x0000000000000000000000000000000000000000000000000000000000000000", "topics": [ "0x59ebeb90bc63057b6515673c3ecf9438e5058bca0f92585014eced636878c9a5" ] } ] } ``` # eth_getProof Source: https://docs.moralis.com/rpc-nodes/lisk/eth-get-proof Returns the account and storage values of the specified account including the Merkle-proof. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address of the account or contract **storageKeys** `array` *required* Array of storage-keys which should be proofed and included **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842", [ "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421" ], "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/lisk/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getProof", "params": ["0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842", ["0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"], "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "address": "0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842", "accountProof": [ "0xf90211a090dcaf88c40c7bbc95a912cbdde67c175767b31173df9ee4b0d733bfdd511c43a0babe369f6b12092f49181ae04ca173fb68d1a5456f18d20fa32cba73954052bda0473ecf8a7e36a829e75039a3b055e51b8332cbf03324ab4af2066bbd6fbf0021fa0bbda34753d7aa6c38e603f360244e8f59611921d9e1f128372fec0d586d4f9e0a04e44caecff45c9891f74f6a2156735886eedf6f1a733628ebc802ec79d844648a0a5f3f2f7542148c973977c8a1e154c4300fec92f755f7846f1b734d3ab1d90e7a0e823850f50bf72baae9d1733a36a444ab65d0a6faaba404f0583ce0ca4dad92da0f7a00cbe7d4b30b11faea3ae61b7f1f2b315017e79a3de5ab2dc8bb46a59fdb37a09b3b8d0e0e4c1e3b2d3e8f7c6e5d4c3b2a1e0f9e8d7c6b5a4e3f2e1d0c9b8a7a0b1f8e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0a0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0a0d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a08080" ], "balance": "0x0", "codeHash": "0x5e61b0f7919ab4e6fc7cfa6f3f5f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f", "nonce": "0x0", "storageHash": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "storageProof": [ { "key": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "value": "0x1", "proof": [ "0xf90211a090dcaf88c40c7bbc95a912cbdde67c175767b31173df9ee4b0d733bfdd511c43a0babe369f6b12092f49181ae04ca173fb68d1a5456f18d20fa32cba73954052bda0473ecf8a7e36a829e75039a3b055e51b8332cbf03324ab4af2066bbd6fbf0021fa0bbda34753d7aa6c38e603f360244e8f59611921d9e1f128372fec0d586d4f9e0a04e44caecff45c9891f74f6a2156735886eedf6f1a733628ebc802ec79d844648a0a5f3f2f7542148c973977c8a1e154c4300fec92f755f7846f1b734d3ab1d90e7a0e823850f50bf72baae9d1733a36a444ab65d0a6faaba404f0583ce0ca4dad92da0f7a00cbe7d4b30b11faea3ae61b7f1f2b315017e79a3de5ab2dc8bb46a59fdb37a09b3b8d0e0e4c1e3b2d3e8f7c6e5d4c3b2a1e0f9e8d7c6b5a4e3f2e1d0c9b8a7a0b1f8e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0a0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0a0d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a08080" ] } ] } } ``` # eth_getStorageAt Source: https://docs.moralis.com/rpc-nodes/lisk/eth-get-storage-at Returns the value from a storage position at a given address. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address of the storage **position** `string` *required* Integer of the position in the storage **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x0", "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/lisk/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x0", "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x00000000000000000000000000000000000000000000000000000000000004d2" } ``` # eth_getTransactionByBlockHashAndIndex Source: https://docs.moralis.com/rpc-nodes/lisk/eth-get-transaction-by-block-hash-and-index Returns information about a transaction by block hash and transaction index position. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block **index** `string` *required* Integer of the transaction index position #### Example request `params` ```javascript theme={null} [ "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/lisk/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5daf3b", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "gas": "0xc350", "gasPrice": "0x4a817c800", "hash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "input": "0x68656c6c6f21", "nonce": "0x15", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "transactionIndex": "0x0", "value": "0xf3dbb76162000", "v": "0x25", "r": "0x1b5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5", "s": "0x5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5c5" } } ``` # eth_getTransactionByBlockNumberAndIndex Source: https://docs.moralis.com/rpc-nodes/lisk/eth-get-transaction-by-block-number-and-index Returns information about a transaction by block number and transaction index position. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* A block number, or the string "earliest", "latest" or "pending" **index** `string` *required* The transaction index position #### Example request `params` ```javascript theme={null} [ "0x5BAE9E", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/lisk/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["0x5BAE9E", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5BAE9E", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "gas": "0xc350", "gasPrice": "0x4a817c800", "hash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "input": "0x68656c6c6f21", "nonce": "0x15", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "transactionIndex": "0x0", "value": "0xf3dbb76162000", "v": "0x25", "r": "0x1b5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5", "s": "0x5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5c5" } } ``` # eth_getTransactionByHash Source: https://docs.moralis.com/rpc-nodes/lisk/eth-get-transaction-by-hash Returns the information about a transaction requested by transaction hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a transaction #### Example request `params` ```javascript theme={null} [ "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/lisk/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5daf3b", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "gas": "0xc350", "gasPrice": "0x4a817c800", "hash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "input": "0x68656c6c6f21", "nonce": "0x15", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "transactionIndex": "0x41", "value": "0xf3dbb76162000", "v": "0x25", "r": "0x1b5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5", "s": "0x5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5c5" } } ``` # eth_getTransactionCount Source: https://docs.moralis.com/rpc-nodes/lisk/eth-get-transaction-count Returns the number of transactions sent from an address. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address to get transaction count for **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/lisk/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` # eth_getTransactionReceipt Source: https://docs.moralis.com/rpc-nodes/lisk/eth-get-transaction-receipt Returns the receipt of a transaction by transaction hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a transaction #### Example request `params` ```javascript theme={null} [ "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/lisk/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "transactionHash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "transactionIndex": "0x41", "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5daf3b", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "cumulativeGasUsed": "0x33bc", "gasUsed": "0x4dc", "contractAddress": null, "logs": [], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "status": "0x1" } } ``` # eth_getUncleByBlockHashAndIndex Source: https://docs.moralis.com/rpc-nodes/lisk/eth-get-uncle-by-block-hash-and-index Returns information about an uncle of a block by hash and uncle index position. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block **index** `string` *required* The uncle's index position #### Example request `params` ```javascript theme={null} [ "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/lisk/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x027f07", "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000", "gasLimit": "0x9f759", "gasUsed": "0x9f759", "hash": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331", "logsBloom": "0x1a060020000015554c000200000003050000200017041014032020801000056020000001000a00d0020204040020012150010010000000280005000c00000000000020c0000000024008104011000080020020000001006100900000024208002000020002100000000000000080000000120080000002003c0000200000000200002010008300300001001031100100040010420000800000000014000004002000000c040200060000000080000000100000000040a2000001000061000042021080400200000410000404080800014008201000c20100500020011000000030001100100024008c80190400402008000020000c0041104218100000000000000002000800000", "miner": "0x4e65fda2159562a496f9f3522f89122a3088497a", "mixHash": "0x99e9d85137db46ef1e85fff042bb15a7b6f46618b7f600b0b4e7fb52fceafc3a", "nonce": "0xfcf4db6d9bce1b8b", "number": "0x1b4", "parentHash": "0xa057c32b6ed8eb5e006cadfad55c7e635549c6e2135c4e6c3a9d5a6a80f72c3", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0x1a7e46b37b26e0c3f67ed4de3b5d3b1ff84a2e0a5e2dcf4d4b0d34b5a22b6e3", "timestamp": "0x55ba467c", "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` # eth_getUncleByBlockNumberAndIndex Source: https://docs.moralis.com/rpc-nodes/lisk/eth-get-uncle-by-block-number-and-index Returns information about an uncle of a block by number and uncle index position. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* A block number, or the string "earliest", "latest" or "pending" **index** `string` *required* The uncle's index position #### Example request `params` ```javascript theme={null} [ "0x29c", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/lisk/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["0x29c", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x027f07", "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000", "gasLimit": "0x9f759", "gasUsed": "0x9f759", "hash": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331", "logsBloom": "0x1a060020000015554c000200000003050000200017041014032020801000056020000001000a00d0020204040020012150010010000000280005000c00000000000020c0000000024008104011000080020020000001006100900000024208002000020002100000000000000080000000120080000002003c0000200000000200002010008300300001001031100100040010420000800000000014000004002000000c040200060000000080000000100000000040a2000001000061000042021080400200000410000404080800014008201000c20100500020011000000030001100100024008c80190400402008000020000c0041104218100000000000000002000800000", "miner": "0x4e65fda2159562a496f9f3522f89122a3088497a", "mixHash": "0x99e9d85137db46ef1e85fff042bb15a7b6f46618b7f600b0b4e7fb52fceafc3a", "nonce": "0xfcf4db6d9bce1b8b", "number": "0x29c", "parentHash": "0xa057c32b6ed8eb5e006cadfad55c7e635549c6e2135c4e6c3a9d5a6a80f72c3", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0x1a7e46b37b26e0c3f67ed4de3b5d3b1ff84a2e0a5e2dcf4d4b0d34b5a22b6e3", "timestamp": "0x55ba467c", "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` # eth_getUncleCountByBlockHash Source: https://docs.moralis.com/rpc-nodes/lisk/eth-get-uncle-count-by-block-hash Returns the number of uncles in a block from a block matching the given block hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block #### Example request `params` ```javascript theme={null} [ "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/lisk/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` # eth_getUncleCountByBlockNumber Source: https://docs.moralis.com/rpc-nodes/lisk/eth-get-uncle-count-by-block-number Returns the number of uncles in a block from a block matching the given block number. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" #### Example request `params` ```javascript theme={null} [ "0x5BAE9E" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/lisk/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["0x5BAE9E"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` # eth_maxPriorityFeePerGas Source: https://docs.moralis.com/rpc-nodes/lisk/eth-max-priority-fee-per-gas Returns a suggestion for the max priority fee per gas for dynamic fee transactions in wei. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/lisk/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_maxPriorityFeePerGas", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x59682f00" } ``` # eth_sendRawTransaction Source: https://docs.moralis.com/rpc-nodes/lisk/eth-send-raw-transaction Submits a pre-signed transaction for broadcast to the network. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **data** `string` *required* The signed transaction data #### Example request `params` ```javascript theme={null} [ "0xf869808504e3b2928082520894f0109fc8df283027b6285cc889f5aa624eac1f55843b9aca008025a0c9cf86333bcb065d140032ecaab5d9281bde80f21b9687b3e94161de42d51895a0727a108a0b8d101465414033c3f705a9c7b826e596766046ee1183dbc8aeaa68" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/lisk/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["0xf869808504e3b2928082520894f0109fc8df283027b6285cc889f5aa624eac1f55843b9aca008025a0c9cf86333bcb065d140032ecaab5d9281bde80f21b9687b3e94161de42d51895a0727a108a0b8d101465414033c3f705a9c7b826e596766046ee1183dbc8aeaa68"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" } ``` # Overview Source: https://docs.moralis.com/rpc-nodes/lisk/overview Explore Lisk JSON-RPC methods ⚠️ **Deprecated.** Moralis support for Lisk (`0x46f`) is removed on **September 25, 2026**, ahead of the Lisk Chain wind-down. Export any history you still need before that date, and point your integration at Ethereum (`eth`) or Base (`base`), or at the `https://site1.moralis-nodes.com/eth/` and `https://site1.moralis-nodes.com/base/` RPC paths. See the [deprecation notice](/changelog#moonbeam-moonriver-and-lisk-support-ends-september-25-2026) for the full timeline. ## Introduction Lisk is pioneering a transformative journey by integrating with the Ethereum ecosystem as a Layer-2 (L2) solution. Focused on bringing real-world assets (RWA), off-chain assets (OCA), and decentralized physical infrastructure networks (DePIN) onchain, Lisk empowers developers with a robust, scalable platform designed to enhance the Ethereum network. By leveraging Lisk's L2 architecture, developers can build dApps that bridge the gap between traditional systems and the decentralized future. ## Supported Networks The Lisk RPC API is available for the following networks: 1. **Lisk Mainnet** ## Network Details | **Network** | **Chain ID** | **Path Parameter** | | :- | :- | :- | | **Lisk Mainnet** | 0x46f (1135) | `lisk` | ## Supported RPC Methods * [eth\_blockNumber](/rpc-nodes/lisk/eth-blockNumber) * [eth\_call](/rpc-nodes/lisk/eth-call) * [eth\_chainId](/rpc-nodes/lisk/eth-chain-id) * [eth\_createAccessList](/rpc-nodes/lisk/eth-create-access-list) * [eth\_estimateGas](/rpc-nodes/lisk/eth-estimate-gas) * [eth\_feeHistory](/rpc-nodes/lisk/eth-fee-history) * [eth\_gasPrice](/rpc-nodes/lisk/eth-gas-price) * [eth\_getBalance](/rpc-nodes/lisk/eth-get-balance) * [eth\_getBlockByHash](/rpc-nodes/lisk/eth-get-block-by-hash) * [eth\_getBlockByNumber](/rpc-nodes/lisk/eth-get-block-by-number) * [eth\_getBlockTransactionCountByHash](/rpc-nodes/lisk/eth-get-block-transaction-count-by-hash) * [eth\_getBlockTransactionCountByNumber](/rpc-nodes/lisk/eth-get-block-transaction-count-by-number) * [eth\_getBlockReceipts](/rpc-nodes/lisk/eth-get-block-receipts) * [eth\_getCode](/rpc-nodes/lisk/eth-get-code) * [eth\_getLogs](/streams/api-reference/history/get-logs) * [eth\_getProof](/rpc-nodes/lisk/eth-get-proof) * [eth\_getStorageAt](/rpc-nodes/lisk/eth-get-storage-at) * [eth\_getTransactionByHash](/rpc-nodes/lisk/eth-get-transaction-by-hash) * [eth\_getTransactionByBlockHashAndIndex](/rpc-nodes/lisk/eth-get-transaction-by-block-hash-and-index) * [eth\_getTransactionByBlockNumberAndIndex](/rpc-nodes/lisk/eth-get-transaction-by-block-number-and-index) * [eth\_getTransactionCount](/rpc-nodes/lisk/eth-get-transaction-count) * [eth\_getTransactionReceipt](/rpc-nodes/lisk/eth-get-transaction-receipt) * [eth\_getUncleByBlockHashAndIndex](/rpc-nodes/lisk/eth-get-uncle-by-block-hash-and-index) * [eth\_getUncleByBlockNumberAndIndex](/rpc-nodes/lisk/eth-get-uncle-by-block-number-and-index) * [eth\_getUncleCountByBlockHash](/rpc-nodes/lisk/eth-get-uncle-count-by-block-hash) * [eth\_getUncleCountByBlockNumber](/rpc-nodes/lisk/eth-get-uncle-count-by-block-number) * [eth\_maxPriorityFeePerGas](/rpc-nodes/lisk/eth-max-priority-fee-per-gas) * [eth\_sendRawTransaction](/rpc-nodes/lisk/eth-send-raw-transaction) # eth_blockNumber Source: https://docs.moralis.com/rpc-nodes/mantle/eth-blockNumber Returns the number of most recent block. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request body No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/mantle/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x4b7" } ``` # eth_call Source: https://docs.moralis.com/rpc-nodes/mantle/eth-call Executes a new message call immediately without creating a transaction on the blockchain. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **from** `string` The address the transaction is sent from **to** `string` *required* The address the transaction is directed to **gas** `string` Integer of the gas provided for the transaction execution **gasPrice** `string` Integer of the gasPrice used for each paid gas **value** `string` Integer of the value sent with this transaction **data** `string` Hash of the method signature and encoded parameters **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ { "from": "0x0000000000000000000000000000000000000000", "to": "0x0000000000000000000000000000000000000000", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0x" }, "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/mantle/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_call", "params": [{"from": "0xb60e8dd61c5d32be8058bb8eb970870f07233155", "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"}, "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x15536ee" } ``` # eth_chainId Source: https://docs.moralis.com/rpc-nodes/mantle/eth-chain-id Returns the chain ID of the current connected node as described in EIP-695. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request body No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/mantle/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_chainId", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` # eth_createAccessList Source: https://docs.moralis.com/rpc-nodes/mantle/eth-create-access-list Creates an access list that you can include in a transaction. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **from** `string` The address the transaction is sent from **to** `string` The address the transaction is directed to **gas** `string` Integer of the gas provided for the transaction execution **gasPrice** `string` Integer of the gasPrice used for each paid gas **maxPriorityFeePerGas** `string` Maximum fee per gas the sender is willing to pay to miners **maxFeePerGas** `string` Maximum total fee per gas the sender is willing to pay **value** `string` Integer of the value sent with this transaction **data** `string` Hash of the method signature and encoded parameters **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ { "from": "0x8ba1f109551bd432803012645haca66c9834d7c6", "to": "0x6b175474e89094c44da98b954eedeac495271d0f", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0xa9059cbb0000000000000000000000008ba1f109551bd432803012645haca66c9834d7c60000000000000000000000000000000000000000000000000de0b6b3a7640000" }, "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/mantle/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_createAccessList", "params": [{"from": "0x8ba1f109551bd432803012645haca66c9834d7c6", "to": "0x6b175474e89094c44da98b954eedeac495271d0f", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0xa9059cbb0000000000000000000000008ba1f109551bd432803012645haca66c9834d7c60000000000000000000000000000000000000000000000000de0b6b3a7640000"}, "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "accessList": [ { "address": "0x6b175474e89094c44da98b954eedeac495271d0f", "storageKeys": [ "0x0000000000000000000000000000000000000000000000000000000000000000" ] } ], "gasUsed": "0x7671" } } ``` # eth_estimateGas Source: https://docs.moralis.com/rpc-nodes/mantle/eth-estimate-gas Generates and returns an estimate of how much gas is necessary to allow the transaction to complete. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **from** `string` The address the transaction is sent from **to** `string` The address the transaction is directed to **gas** `string` Integer of the gas provided for the transaction execution **gasPrice** `string` Integer of the gasPrice used for each paid gas **value** `string` Integer of the value sent with this transaction **data** `string` Hash of the method signature and encoded parameters **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ { "from": "0x8D97689C9818892B700e27F316cc3E41e17fBeb9", "to": "0xd3CdA913deB6f67967B99D67aCDFa1712C293601", "value": "0x186a0" }, "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/mantle/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_estimateGas", "params": [{"from": "0x8D97689C9818892B700e27F316cc3E41e17fBeb9", "to": "0xd3CdA913deB6f67967B99D67aCDFa1712C293601", "value": "0x186a0"}, "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x5208" } ``` # eth_feeHistory Source: https://docs.moralis.com/rpc-nodes/mantle/eth-fee-history Returns historical gas information for a range of blocks. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockCount** `string` *required* Number of blocks in the requested range **newestBlock** `string` *required* Highest number block of the requested range **rewardPercentiles** `array` Array of percentile values to sample from each block's effective priority fees per gas #### Example request `params` ```javascript theme={null} [ "0x4", "latest", [25, 75] ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/mantle/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_feeHistory", "params": ["0x4", "latest", [25, 75]], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": [ "0x7", "0x7", "0x7", "0x7", "0x7" ], "gasUsedRatio": [ 0.026089875, 0.406803, 0.010817, 0.5 ], "baseFeePerBlobGas": [ "0x3319eb", "0x350c54", "0x364072", "0x364072", "0x32279d" ], "blobGasUsedRatio": [ 0.47619047619047616, 0.2857142857142857, 0, 0.3333333333333333 ], "oldestBlock": "0x11b9231", "reward": [ ["0x4a817c800", "0x4a817c800"], ["0x773593c0", "0x773593c0"], ["0x0", "0x0"], ["0x0", "0x0"] ] } } ``` # eth_gasPrice Source: https://docs.moralis.com/rpc-nodes/mantle/eth-gas-price Returns the current price per gas in wei. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/mantle/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x09184e72a000" } ``` # eth_getBalance Source: https://docs.moralis.com/rpc-nodes/mantle/eth-get-balance Returns the balance of the account of given address. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address to check for balance **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/mantle/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0234c8a3397aab58" } ``` # eth_getBlockByHash Source: https://docs.moralis.com/rpc-nodes/mantle/eth-get-block-by-hash Returns information about a block by hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block **fullTransactionObjects** `boolean` *required* If true it returns the full transaction objects, if false only the hashes of the transactions #### Example request `params` ```javascript theme={null} [ "0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c", false ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/mantle/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c", false], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x3319bb0", "blobGasUsed": "0x120000", "difficulty": "0x0", "excessBlobGas": "0xa576243", "extraData": "0xe29ca82051756173617220287175617361722e77696e2920e29ca8", "gasLimit": "0x3938700", "gasUsed": "0x2965eaa", "hash": "0xc319ec0da50d354ce425b63fb6914a42aafdb9ee9807518edd595809e25fbe38", "logsBloom": "0x7feeeb37793b4fdfff7ab7aefde2d7fdfff9575bfef5bdff3fb97bfef7bcddbbdf9d55e77fdf7ead7b98ffd9bb6fefff7e77b163bf9eeebdddd1ffbf376cfbeb7efffef83ffbe9eb7ff7776ab3dcf8bfee7ebaddfffdf7fe3fffdf6ed3f7dff77cf2fd7efffff7a19ef7ffbbe3e8befdb7fff76b6ed6e7ffceeb99ff7eeb5efebfff3fff7da1fb39f9fff3fd7f3f77b6dd0bed39f5fff3bfa7fbbce7f9f6ec6e0fff50bfe7f9f79efff35ff6d93fecfefbffdaf7b7eff35ec6ff42fe7e6f77f7deff7eff57f6aafa597feebdffff7bbd677e27ffbfadfdf57f7e7d2aeeffffff6676ffa7f3f375eb95eecf9ffa235cbfcdefafbf8feed9dc7b56ff2fdfedfefe", "miner": "0x396343362be2a4da1ce0c1c210945346fb82aa49", "mixHash": "0x07444bb5750f746e200e1dcd8d83221b26576d3357b833cc1e434e7966d0e774", "nonce": "0x0000000000000000", "number": "0x1736791", "parentBeaconBlockRoot": "0x2759f248e2d1cb1a2f5c2657c4efcc623dd8ea7f23e8700162e7fccdacedfd5d", "parentHash": "0xdf0e4dee910167d7b1687a6cb677983ce7ed351ae78ab7e2c5ba39d793c80391", "receiptsRoot": "0x5f1c58e498161509245daad0f60319d9abab7f04d2ca60e99a3674cfdc9b8327", "requestsHash": "0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x1ef1e", "stateRoot": "0x728c7e38107037b573d719e67b6872ee3ca4e01b47818598316cd696bfe24f2c", "timestamp": "0x697b4bcb", "transactions": [ "0xbf7bd0cf98c3b65525f1f7267b1d02e7ccd7cd133b137f46723a91cf187616d5", "0x06ac9281da76d530aa19600e2c34aae7564a78702d3eb52b1fb363985473e296" ], "transactionsRoot": "0xa8c680f6ad8ccc7a49db5ab76cbd9194c88e16dbcfa440104f7787e5ba815c4f", "uncles": [], "withdrawals": [ { "index": "0x6f78bfb", "validatorIndex": "0x955f5", "address": "0x5d3ca1842d0988816434ea51ca420182f3f1e31a", "amount": "0x102d2f1" } ], "withdrawalsRoot": "0x9b7ecf1ba575fc02e4b4c14bd65d5ca95c0e066adaae3fc2ef16f5acd90214d8" } } ``` # eth_getBlockByNumber Source: https://docs.moralis.com/rpc-nodes/mantle/eth-get-block-by-number Returns information about a block by block number. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" **fullTransactionObjects** `boolean` *required* If true it returns the full transaction objects, if false only the hashes of the transactions #### Example request `params` ```javascript theme={null} [ "0x1b4", true ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/mantle/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["0x1b4", true], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x3319bb0", "blobGasUsed": "0x120000", "difficulty": "0x0", "excessBlobGas": "0xa576243", "extraData": "0xe29ca82051756173617220287175617361722e77696e2920e29ca8", "gasLimit": "0x3938700", "gasUsed": "0x2965eaa", "hash": "0xc319ec0da50d354ce425b63fb6914a42aafdb9ee9807518edd595809e25fbe38", "logsBloom": "0x7feeeb37793b4fdfff7ab7aefde2d7fdfff9575bfef5bdff3fb97bfef7bcddbbdf9d55e77fdf7ead7b98ffd9bb6fefff7e77b163bf9eeebdddd1ffbf376cfbeb7efffef83ffbe9eb7ff7776ab3dcf8bfee7ebaddfffdf7fe3fffdf6ed3f7dff77cf2fd7efffff7a19ef7ffbbe3e8befdb7fff76b6ed6e7ffceeb99ff7eeb5efebfff3fff7da1fb39f9fff3fd7f3f77b6dd0bed39f5fff3bfa7fbbce7f9f6ec6e0fff50bfe7f9f79efff35ff6d93fecfefbffdaf7b7eff35ec6ff42fe7e6f77f7deff7eff57f6aafa597feebdffff7bbd677e27ffbfadfdf57f7e7d2aeeffffff6676ffa7f3f375eb95eecf9ffa235cbfcdefafbf8feed9dc7b56ff2fdfedfefe", "miner": "0x396343362be2a4da1ce0c1c210945346fb82aa49", "mixHash": "0x07444bb5750f746e200e1dcd8d83221b26576d3357b833cc1e434e7966d0e774", "nonce": "0x0000000000000000", "number": "0x1736791", "parentBeaconBlockRoot": "0x2759f248e2d1cb1a2f5c2657c4efcc623dd8ea7f23e8700162e7fccdacedfd5d", "parentHash": "0xdf0e4dee910167d7b1687a6cb677983ce7ed351ae78ab7e2c5ba39d793c80391", "receiptsRoot": "0x5f1c58e498161509245daad0f60319d9abab7f04d2ca60e99a3674cfdc9b8327", "requestsHash": "0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x1ef1e", "stateRoot": "0x728c7e38107037b573d719e67b6872ee3ca4e01b47818598316cd696bfe24f2c", "timestamp": "0x697b4bcb", "transactions": [ "0xbf7bd0cf98c3b65525f1f7267b1d02e7ccd7cd133b137f46723a91cf187616d5", "0x06ac9281da76d530aa19600e2c34aae7564a78702d3eb52b1fb363985473e296" ], "transactionsRoot": "0xa8c680f6ad8ccc7a49db5ab76cbd9194c88e16dbcfa440104f7787e5ba815c4f", "uncles": [], "withdrawals": [ { "index": "0x6f78bfb", "validatorIndex": "0x955f5", "address": "0x5d3ca1842d0988816434ea51ca420182f3f1e31a", "amount": "0x102d2f1" } ], "withdrawalsRoot": "0x9b7ecf1ba575fc02e4b4c14bd65d5ca95c0e066adaae3fc2ef16f5acd90214d8" } } ``` # eth_getBlockReceipts Source: https://docs.moralis.com/rpc-nodes/mantle/eth-get-block-receipts Returns all transaction receipts for a given block. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" #### Example request `params` ```javascript theme={null} [ "0xf21d9c" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/mantle/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockReceipts", "params": ["0xf21d9c"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": [ { "blockHash": "0x8243343df08b9751f5ca0c5f8c9c0460d8a9b6351066fae0acbd4d3e776de8bb", "blockNumber": "0xf21d9c", "contractAddress": null, "cumulativeGasUsed": "0x5208", "effectiveGasPrice": "0x1dcd6500", "from": "0x8ba1f109551bd432803012645haca66c9834d7c6", "gasUsed": "0x5208", "logs": [], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "status": "0x1", "to": "0x95cED938F7991cd0dFcb48F0a06a40FA1aF46EBC", "transactionHash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "transactionIndex": "0x0", "type": "0x2" } ] } ``` # eth_getBlockTransactionCountByHash Source: https://docs.moralis.com/rpc-nodes/mantle/eth-get-block-transaction-count-by-hash Returns the number of transactions in a block from a block matching the given block hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block #### Example request `params` ```javascript theme={null} [ "0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/mantle/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` # eth_getBlockTransactionCountByNumber Source: https://docs.moralis.com/rpc-nodes/mantle/eth-get-block-transaction-count-by-number Returns the number of transactions in a block matching the given block number. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" #### Example request `params` ```javascript theme={null} [ "0xe8" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/mantle/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["0xe8"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` # eth_getCode Source: https://docs.moralis.com/rpc-nodes/mantle/eth-get-code Returns code at a given address. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address to get the code from **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x2" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/mantle/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getCode", "params": ["0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x2"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x600160008035811a818181146012578301005b601b6001356025565b8060005260206000f25b600060078202905091905056" } ``` # eth_getLogs Source: https://docs.moralis.com/rpc-nodes/mantle/eth-get-logs Returns an array of all logs matching a given filter object. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **fromBlock** `string` Integer block number, or "latest" for the last mined block or "pending", "earliest" for not yet mined transactions **toBlock** `string` Integer block number, or "latest" for the last mined block or "pending", "earliest" for not yet mined transactions **address** `string` Contract address or a list of addresses from which logs should originate **topics** `array` Array of 32 Bytes DATA topics. Topics are order-dependent **blockhash** `string` Using blockhash is equivalent to fromBlock = toBlock = the block number with hash blockhash #### Example request `params` ```javascript theme={null} [ { "fromBlock": "0x1", "toBlock": "0x2", "address": "0x8888f1f195afa192cfee860698584c030f4c9db1", "topics": [ "0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", null, [ "0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x0000000000000000000000000aff3454fce5edbc8cca8697c15331677e6ebccc" ] ] } ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/mantle/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getLogs", "params": [{"fromBlock": "0x1", "toBlock": "0x2", "address": "0x8888f1f195afa192cfee860698584c030f4c9db1", "topics": ["0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", null, ["0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x0000000000000000000000000aff3454fce5edbc8cca8697c15331677e6ebccc"]]}], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": [ { "logIndex": "0x1", "blockNumber": "0x1b4", "blockHash": "0x8216c5785ac562ff41e2dcfdf5785ac562ff41e2dcfdf829c5a142f1fccd7d", "transactionHash": "0xdf829c5a142f1fccd7d8216c5785ac562ff41e2dcfdf5785ac562ff41e2dcf", "transactionIndex": "0x0", "address": "0x16c5785ac562ff41e2dcfdf829c5a142f1fccd7d", "data": "0x0000000000000000000000000000000000000000000000000000000000000000", "topics": [ "0x59ebeb90bc63057b6515673c3ecf9438e5058bca0f92585014eced636878c9a5" ] } ] } ``` # eth_getProof Source: https://docs.moralis.com/rpc-nodes/mantle/eth-get-proof Returns the account and storage values of the specified account including the Merkle-proof. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address of the account or contract **storageKeys** `array` *required* Array of storage-keys which should be proofed and included **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842", [ "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421" ], "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/mantle/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getProof", "params": ["0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842", ["0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"], "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "address": "0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842", "accountProof": [ "0xf90211a090dcaf88c40c7bbc95a912cbdde67c175767b31173df9ee4b0d733bfdd511c43a0babe369f6b12092f49181ae04ca173fb68d1a5456f18d20fa32cba73954052bda0473ecf8a7e36a829e75039a3b055e51b8332cbf03324ab4af2066bbd6fbf0021fa0bbda34753d7aa6c38e603f360244e8f59611921d9e1f128372fec0d586d4f9e0a04e44caecff45c9891f74f6a2156735886eedf6f1a733628ebc802ec79d844648a0a5f3f2f7542148c973977c8a1e154c4300fec92f755f7846f1b734d3ab1d90e7a0e823850f50bf72baae9d1733a36a444ab65d0a6faaba404f0583ce0ca4dad92da0f7a00cbe7d4b30b11faea3ae61b7f1f2b315017e79a3de5ab2dc8bb46a59fdb37a09b3b8d0e0e4c1e3b2d3e8f7c6e5d4c3b2a1e0f9e8d7c6b5a4e3f2e1d0c9b8a7a0b1f8e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0a0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0a0d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a08080" ], "balance": "0x0", "codeHash": "0x5e61b0f7919ab4e6fc7cfa6f3f5f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f", "nonce": "0x0", "storageHash": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "storageProof": [ { "key": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "value": "0x1", "proof": [ "0xf90211a090dcaf88c40c7bbc95a912cbdde67c175767b31173df9ee4b0d733bfdd511c43a0babe369f6b12092f49181ae04ca173fb68d1a5456f18d20fa32cba73954052bda0473ecf8a7e36a829e75039a3b055e51b8332cbf03324ab4af2066bbd6fbf0021fa0bbda34753d7aa6c38e603f360244e8f59611921d9e1f128372fec0d586d4f9e0a04e44caecff45c9891f74f6a2156735886eedf6f1a733628ebc802ec79d844648a0a5f3f2f7542148c973977c8a1e154c4300fec92f755f7846f1b734d3ab1d90e7a0e823850f50bf72baae9d1733a36a444ab65d0a6faaba404f0583ce0ca4dad92da0f7a00cbe7d4b30b11faea3ae61b7f1f2b315017e79a3de5ab2dc8bb46a59fdb37a09b3b8d0e0e4c1e3b2d3e8f7c6e5d4c3b2a1e0f9e8d7c6b5a4e3f2e1d0c9b8a7a0b1f8e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0a0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0a0d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a08080" ] } ] } } ``` # eth_getStorageAt Source: https://docs.moralis.com/rpc-nodes/mantle/eth-get-storage-at Returns the value from a storage position at a given address. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address of the storage **position** `string` *required* Integer of the position in the storage **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x0", "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/mantle/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x0", "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x00000000000000000000000000000000000000000000000000000000000004d2" } ``` # eth_getTransactionByBlockHashAndIndex Source: https://docs.moralis.com/rpc-nodes/mantle/eth-get-transaction-by-block-hash-and-index Returns information about a transaction by block hash and transaction index position. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block **index** `string` *required* Integer of the transaction index position #### Example request `params` ```javascript theme={null} [ "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/mantle/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5daf3b", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "gas": "0xc350", "gasPrice": "0x4a817c800", "hash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "input": "0x68656c6c6f21", "nonce": "0x15", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "transactionIndex": "0x0", "value": "0xf3dbb76162000", "v": "0x25", "r": "0x1b5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5", "s": "0x5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5c5" } } ``` # eth_getTransactionByBlockNumberAndIndex Source: https://docs.moralis.com/rpc-nodes/mantle/eth-get-transaction-by-block-number-and-index Returns information about a transaction by block number and transaction index position. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* A block number, or the string "earliest", "latest" or "pending" **index** `string` *required* The transaction index position #### Example request `params` ```javascript theme={null} [ "0x5BAE9E", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/mantle/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["0x5BAE9E", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5BAE9E", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "gas": "0xc350", "gasPrice": "0x4a817c800", "hash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "input": "0x68656c6c6f21", "nonce": "0x15", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "transactionIndex": "0x0", "value": "0xf3dbb76162000", "v": "0x25", "r": "0x1b5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5", "s": "0x5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5c5" } } ``` # eth_getTransactionByHash Source: https://docs.moralis.com/rpc-nodes/mantle/eth-get-transaction-by-hash Returns the information about a transaction requested by transaction hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a transaction #### Example request `params` ```javascript theme={null} [ "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/mantle/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5daf3b", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "gas": "0xc350", "gasPrice": "0x4a817c800", "hash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "input": "0x68656c6c6f21", "nonce": "0x15", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "transactionIndex": "0x41", "value": "0xf3dbb76162000", "v": "0x25", "r": "0x1b5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5", "s": "0x5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5c5" } } ``` # eth_getTransactionCount Source: https://docs.moralis.com/rpc-nodes/mantle/eth-get-transaction-count Returns the number of transactions sent from an address. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address to get transaction count for **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/mantle/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` # eth_getTransactionReceipt Source: https://docs.moralis.com/rpc-nodes/mantle/eth-get-transaction-receipt Returns the receipt of a transaction by transaction hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a transaction #### Example request `params` ```javascript theme={null} [ "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/mantle/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "transactionHash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "transactionIndex": "0x41", "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5daf3b", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "cumulativeGasUsed": "0x33bc", "gasUsed": "0x4dc", "contractAddress": null, "logs": [], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "status": "0x1" } } ``` # eth_getUncleByBlockHashAndIndex Source: https://docs.moralis.com/rpc-nodes/mantle/eth-get-uncle-by-block-hash-and-index Returns information about an uncle of a block by hash and uncle index position. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block **index** `string` *required* The uncle's index position #### Example request `params` ```javascript theme={null} [ "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/mantle/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x027f07", "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000", "gasLimit": "0x9f759", "gasUsed": "0x9f759", "hash": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331", "logsBloom": "0x1a060020000015554c000200000003050000200017041014032020801000056020000001000a00d0020204040020012150010010000000280005000c00000000000020c0000000024008104011000080020020000001006100900000024208002000020002100000000000000080000000120080000002003c0000200000000200002010008300300001001031100100040010420000800000000014000004002000000c040200060000000080000000100000000040a2000001000061000042021080400200000410000404080800014008201000c20100500020011000000030001100100024008c80190400402008000020000c0041104218100000000000000002000800000", "miner": "0x4e65fda2159562a496f9f3522f89122a3088497a", "mixHash": "0x99e9d85137db46ef1e85fff042bb15a7b6f46618b7f600b0b4e7fb52fceafc3a", "nonce": "0xfcf4db6d9bce1b8b", "number": "0x1b4", "parentHash": "0xa057c32b6ed8eb5e006cadfad55c7e635549c6e2135c4e6c3a9d5a6a80f72c3", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0x1a7e46b37b26e0c3f67ed4de3b5d3b1ff84a2e0a5e2dcf4d4b0d34b5a22b6e3", "timestamp": "0x55ba467c", "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` # eth_getUncleByBlockNumberAndIndex Source: https://docs.moralis.com/rpc-nodes/mantle/eth-get-uncle-by-block-number-and-index Returns information about an uncle of a block by number and uncle index position. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* A block number, or the string "earliest", "latest" or "pending" **index** `string` *required* The uncle's index position #### Example request `params` ```javascript theme={null} [ "0x29c", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/mantle/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["0x29c", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x027f07", "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000", "gasLimit": "0x9f759", "gasUsed": "0x9f759", "hash": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331", "logsBloom": "0x1a060020000015554c000200000003050000200017041014032020801000056020000001000a00d0020204040020012150010010000000280005000c00000000000020c0000000024008104011000080020020000001006100900000024208002000020002100000000000000080000000120080000002003c0000200000000200002010008300300001001031100100040010420000800000000014000004002000000c040200060000000080000000100000000040a2000001000061000042021080400200000410000404080800014008201000c20100500020011000000030001100100024008c80190400402008000020000c0041104218100000000000000002000800000", "miner": "0x4e65fda2159562a496f9f3522f89122a3088497a", "mixHash": "0x99e9d85137db46ef1e85fff042bb15a7b6f46618b7f600b0b4e7fb52fceafc3a", "nonce": "0xfcf4db6d9bce1b8b", "number": "0x29c", "parentHash": "0xa057c32b6ed8eb5e006cadfad55c7e635549c6e2135c4e6c3a9d5a6a80f72c3", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0x1a7e46b37b26e0c3f67ed4de3b5d3b1ff84a2e0a5e2dcf4d4b0d34b5a22b6e3", "timestamp": "0x55ba467c", "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` # eth_getUncleCountByBlockHash Source: https://docs.moralis.com/rpc-nodes/mantle/eth-get-uncle-count-by-block-hash Returns the number of uncles in a block from a block matching the given block hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block #### Example request `params` ```javascript theme={null} [ "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/mantle/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` # eth_getUncleCountByBlockNumber Source: https://docs.moralis.com/rpc-nodes/mantle/eth-get-uncle-count-by-block-number Returns the number of uncles in a block from a block matching the given block number. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" #### Example request `params` ```javascript theme={null} [ "0x5BAE9E" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/mantle/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["0x5BAE9E"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` # eth_maxPriorityFeePerGas Source: https://docs.moralis.com/rpc-nodes/mantle/eth-max-priority-fee-per-gas Returns a suggestion for the max priority fee per gas for dynamic fee transactions in wei. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/mantle/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_maxPriorityFeePerGas", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x59682f00" } ``` # eth_sendRawTransaction Source: https://docs.moralis.com/rpc-nodes/mantle/eth-send-raw-transaction Submits a pre-signed transaction for broadcast to the network. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **data** `string` *required* The signed transaction data #### Example request `params` ```javascript theme={null} [ "0xf869808504e3b2928082520894f0109fc8df283027b6285cc889f5aa624eac1f55843b9aca008025a0c9cf86333bcb065d140032ecaab5d9281bde80f21b9687b3e94161de42d51895a0727a108a0b8d101465414033c3f705a9c7b826e596766046ee1183dbc8aeaa68" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/mantle/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["0xf869808504e3b2928082520894f0109fc8df283027b6285cc889f5aa624eac1f55843b9aca008025a0c9cf86333bcb065d140032ecaab5d9281bde80f21b9687b3e94161de42d51895a0727a108a0b8d101465414033c3f705a9c7b826e596766046ee1183dbc8aeaa68"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" } ``` # Overview Source: https://docs.moralis.com/rpc-nodes/mantle/overview Explore Mantle JSON-RPC methods ## Introduction Mantle is a high-performance, scalable Layer 2 blockchain built on Ethereum. By leveraging rollup technology, Mantle provides developers and users with faster and cheaper transactions while maintaining the security of Ethereum. Mantle is ideal for decentralized finance (DeFi), NFTs, and other decentralized applications (dApps) that require low-latency, high-throughput transaction processing. ## Supported Networks The Mantle RPC API is available for the following networks: 1. **Mantle Mainnet** 2. **Mantle Sepolia Testnet** ## Network Details | **Network** | **Chain ID** | **Path Parameter** | | :- | :- | :- | | **Mantle Mainnet** | 0x1388 (5000) | `mantle` | | **Mantle Sepolia** | 0x138b (5003) | `mantle-sepolia` | ## Supported RPC Methods * [eth\_blockNumber](/rpc-nodes/mantle/eth-blockNumber) * [eth\_call](/rpc-nodes/mantle/eth-call) * [eth\_chainId](/rpc-nodes/mantle/eth-chain-id) * [eth\_createAccessList](/rpc-nodes/mantle/eth-create-access-list) * [eth\_estimateGas](/rpc-nodes/mantle/eth-estimate-gas) * [eth\_feeHistory](/rpc-nodes/mantle/eth-fee-history) * [eth\_gasPrice](/rpc-nodes/mantle/eth-gas-price) * [eth\_getBalance](/rpc-nodes/mantle/eth-get-balance) * [eth\_getBlockByHash](/rpc-nodes/mantle/eth-get-block-by-hash) * [eth\_getBlockByNumber](/rpc-nodes/mantle/eth-get-block-by-number) * [eth\_getBlockTransactionCountByHash](/rpc-nodes/mantle/eth-get-block-transaction-count-by-hash) * [eth\_getBlockTransactionCountByNumber](/rpc-nodes/mantle/eth-get-block-transaction-count-by-number) * [eth\_getBlockReceipts](/rpc-nodes/mantle/eth-get-block-receipts) * [eth\_getCode](/rpc-nodes/mantle/eth-get-code) * [eth\_getLogs](/streams/api-reference/history/get-logs) * [eth\_getProof](/rpc-nodes/mantle/eth-get-proof) * [eth\_getStorageAt](/rpc-nodes/mantle/eth-get-storage-at) * [eth\_getTransactionByHash](/rpc-nodes/mantle/eth-get-transaction-by-hash) * [eth\_getTransactionByBlockHashAndIndex](/rpc-nodes/mantle/eth-get-transaction-by-block-hash-and-index) * [eth\_getTransactionByBlockNumberAndIndex](/rpc-nodes/mantle/eth-get-transaction-by-block-number-and-index) * [eth\_getTransactionCount](/rpc-nodes/mantle/eth-get-transaction-count) * [eth\_getTransactionReceipt](/rpc-nodes/mantle/eth-get-transaction-receipt) * [eth\_getUncleByBlockHashAndIndex](/rpc-nodes/mantle/eth-get-uncle-by-block-hash-and-index) * [eth\_getUncleByBlockNumberAndIndex](/rpc-nodes/mantle/eth-get-uncle-by-block-number-and-index) * [eth\_getUncleCountByBlockHash](/rpc-nodes/mantle/eth-get-uncle-count-by-block-hash) * [eth\_getUncleCountByBlockNumber](/rpc-nodes/mantle/eth-get-uncle-count-by-block-number) * [eth\_maxPriorityFeePerGas](/rpc-nodes/mantle/eth-max-priority-fee-per-gas) * [eth\_sendRawTransaction](/rpc-nodes/mantle/eth-send-raw-transaction) # eth_blockNumber Source: https://docs.moralis.com/rpc-nodes/moonbeam/eth-blockNumber Returns the number of most recent block. ⚠️ **Deprecated. Migrate to Base.** Moonbeam (`0x504`) and Moonriver (`0x505`) stopped producing new blocks on August 1, 2026, and Moralis support is removed on **September 25, 2026**. Following Moonbeam's network relaunch on Base, GLMR ( `0xb3846fd356c2149ee8d30b0449088dc74e265459`) and MOVR ( `0x43fEB74608334DDa8c1a6500D185cFC3Ea962B83`) are now ERC-20 tokens on Base. Point your integration at Base by using the `base` chain parameter, or the `https://site1.moralis-nodes.com/base/` RPC path. See the [deprecation notice](/changelog#moonbeam-moonriver-and-lisk-support-ends-september-25-2026) for details. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request body No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/moonbeam/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x4b7" } ``` # eth_call Source: https://docs.moralis.com/rpc-nodes/moonbeam/eth-call Executes a new message call immediately without creating a transaction on the blockchain. ⚠️ **Deprecated. Migrate to Base.** Moonbeam (`0x504`) and Moonriver (`0x505`) stopped producing new blocks on August 1, 2026, and Moralis support is removed on **September 25, 2026**. Following Moonbeam's network relaunch on Base, GLMR ( `0xb3846fd356c2149ee8d30b0449088dc74e265459`) and MOVR ( `0x43fEB74608334DDa8c1a6500D185cFC3Ea962B83`) are now ERC-20 tokens on Base. Point your integration at Base by using the `base` chain parameter, or the `https://site1.moralis-nodes.com/base/` RPC path. See the [deprecation notice](/changelog#moonbeam-moonriver-and-lisk-support-ends-september-25-2026) for details. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **from** `string` The address the transaction is sent from **to** `string` *required* The address the transaction is directed to **gas** `string` Integer of the gas provided for the transaction execution **gasPrice** `string` Integer of the gasPrice used for each paid gas **value** `string` Integer of the value sent with this transaction **data** `string` Hash of the method signature and encoded parameters **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ { "from": "0x0000000000000000000000000000000000000000", "to": "0x0000000000000000000000000000000000000000", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0x" }, "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/moonbeam/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_call", "params": [{"from": "0xb60e8dd61c5d32be8058bb8eb970870f07233155", "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"}, "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x15536ee" } ``` # eth_chainId Source: https://docs.moralis.com/rpc-nodes/moonbeam/eth-chain-id Returns the chain ID of the current connected node as described in EIP-695. ⚠️ **Deprecated. Migrate to Base.** Moonbeam (`0x504`) and Moonriver (`0x505`) stopped producing new blocks on August 1, 2026, and Moralis support is removed on **September 25, 2026**. Following Moonbeam's network relaunch on Base, GLMR ( `0xb3846fd356c2149ee8d30b0449088dc74e265459`) and MOVR ( `0x43fEB74608334DDa8c1a6500D185cFC3Ea962B83`) are now ERC-20 tokens on Base. Point your integration at Base by using the `base` chain parameter, or the `https://site1.moralis-nodes.com/base/` RPC path. See the [deprecation notice](/changelog#moonbeam-moonriver-and-lisk-support-ends-september-25-2026) for details. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request body No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/moonbeam/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_chainId", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` # eth_createAccessList Source: https://docs.moralis.com/rpc-nodes/moonbeam/eth-create-access-list Creates an access list that you can include in a transaction. ⚠️ **Deprecated. Migrate to Base.** Moonbeam (`0x504`) and Moonriver (`0x505`) stopped producing new blocks on August 1, 2026, and Moralis support is removed on **September 25, 2026**. Following Moonbeam's network relaunch on Base, GLMR ( `0xb3846fd356c2149ee8d30b0449088dc74e265459`) and MOVR ( `0x43fEB74608334DDa8c1a6500D185cFC3Ea962B83`) are now ERC-20 tokens on Base. Point your integration at Base by using the `base` chain parameter, or the `https://site1.moralis-nodes.com/base/` RPC path. See the [deprecation notice](/changelog#moonbeam-moonriver-and-lisk-support-ends-september-25-2026) for details. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **from** `string` The address the transaction is sent from **to** `string` The address the transaction is directed to **gas** `string` Integer of the gas provided for the transaction execution **gasPrice** `string` Integer of the gasPrice used for each paid gas **maxPriorityFeePerGas** `string` Maximum fee per gas the sender is willing to pay to miners **maxFeePerGas** `string` Maximum total fee per gas the sender is willing to pay **value** `string` Integer of the value sent with this transaction **data** `string` Hash of the method signature and encoded parameters **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ { "from": "0x8ba1f109551bd432803012645haca66c9834d7c6", "to": "0x6b175474e89094c44da98b954eedeac495271d0f", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0xa9059cbb0000000000000000000000008ba1f109551bd432803012645haca66c9834d7c60000000000000000000000000000000000000000000000000de0b6b3a7640000" }, "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/moonbeam/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_createAccessList", "params": [{"from": "0x8ba1f109551bd432803012645haca66c9834d7c6", "to": "0x6b175474e89094c44da98b954eedeac495271d0f", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0xa9059cbb0000000000000000000000008ba1f109551bd432803012645haca66c9834d7c60000000000000000000000000000000000000000000000000de0b6b3a7640000"}, "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "accessList": [ { "address": "0x6b175474e89094c44da98b954eedeac495271d0f", "storageKeys": [ "0x0000000000000000000000000000000000000000000000000000000000000000" ] } ], "gasUsed": "0x7671" } } ``` # eth_estimateGas Source: https://docs.moralis.com/rpc-nodes/moonbeam/eth-estimate-gas Generates and returns an estimate of how much gas is necessary to allow the transaction to complete. ⚠️ **Deprecated. Migrate to Base.** Moonbeam (`0x504`) and Moonriver (`0x505`) stopped producing new blocks on August 1, 2026, and Moralis support is removed on **September 25, 2026**. Following Moonbeam's network relaunch on Base, GLMR ( `0xb3846fd356c2149ee8d30b0449088dc74e265459`) and MOVR ( `0x43fEB74608334DDa8c1a6500D185cFC3Ea962B83`) are now ERC-20 tokens on Base. Point your integration at Base by using the `base` chain parameter, or the `https://site1.moralis-nodes.com/base/` RPC path. See the [deprecation notice](/changelog#moonbeam-moonriver-and-lisk-support-ends-september-25-2026) for details. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **from** `string` The address the transaction is sent from **to** `string` The address the transaction is directed to **gas** `string` Integer of the gas provided for the transaction execution **gasPrice** `string` Integer of the gasPrice used for each paid gas **value** `string` Integer of the value sent with this transaction **data** `string` Hash of the method signature and encoded parameters **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ { "from": "0x8D97689C9818892B700e27F316cc3E41e17fBeb9", "to": "0xd3CdA913deB6f67967B99D67aCDFa1712C293601", "value": "0x186a0" }, "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/moonbeam/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_estimateGas", "params": [{"from": "0x8D97689C9818892B700e27F316cc3E41e17fBeb9", "to": "0xd3CdA913deB6f67967B99D67aCDFa1712C293601", "value": "0x186a0"}, "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x5208" } ``` # eth_feeHistory Source: https://docs.moralis.com/rpc-nodes/moonbeam/eth-fee-history Returns historical gas information for a range of blocks. ⚠️ **Deprecated. Migrate to Base.** Moonbeam (`0x504`) and Moonriver (`0x505`) stopped producing new blocks on August 1, 2026, and Moralis support is removed on **September 25, 2026**. Following Moonbeam's network relaunch on Base, GLMR ( `0xb3846fd356c2149ee8d30b0449088dc74e265459`) and MOVR ( `0x43fEB74608334DDa8c1a6500D185cFC3Ea962B83`) are now ERC-20 tokens on Base. Point your integration at Base by using the `base` chain parameter, or the `https://site1.moralis-nodes.com/base/` RPC path. See the [deprecation notice](/changelog#moonbeam-moonriver-and-lisk-support-ends-september-25-2026) for details. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockCount** `string` *required* Number of blocks in the requested range **newestBlock** `string` *required* Highest number block of the requested range **rewardPercentiles** `array` Array of percentile values to sample from each block's effective priority fees per gas #### Example request `params` ```javascript theme={null} [ "0x4", "latest", [25, 75] ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/moonbeam/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_feeHistory", "params": ["0x4", "latest", [25, 75]], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": [ "0x7", "0x7", "0x7", "0x7", "0x7" ], "gasUsedRatio": [ 0.026089875, 0.406803, 0.010817, 0.5 ], "baseFeePerBlobGas": [ "0x3319eb", "0x350c54", "0x364072", "0x364072", "0x32279d" ], "blobGasUsedRatio": [ 0.47619047619047616, 0.2857142857142857, 0, 0.3333333333333333 ], "oldestBlock": "0x11b9231", "reward": [ ["0x4a817c800", "0x4a817c800"], ["0x773593c0", "0x773593c0"], ["0x0", "0x0"], ["0x0", "0x0"] ] } } ``` # eth_gasPrice Source: https://docs.moralis.com/rpc-nodes/moonbeam/eth-gas-price Returns the current price per gas in wei. ⚠️ **Deprecated. Migrate to Base.** Moonbeam (`0x504`) and Moonriver (`0x505`) stopped producing new blocks on August 1, 2026, and Moralis support is removed on **September 25, 2026**. Following Moonbeam's network relaunch on Base, GLMR ( `0xb3846fd356c2149ee8d30b0449088dc74e265459`) and MOVR ( `0x43fEB74608334DDa8c1a6500D185cFC3Ea962B83`) are now ERC-20 tokens on Base. Point your integration at Base by using the `base` chain parameter, or the `https://site1.moralis-nodes.com/base/` RPC path. See the [deprecation notice](/changelog#moonbeam-moonriver-and-lisk-support-ends-september-25-2026) for details. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/moonbeam/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x09184e72a000" } ``` # eth_getBalance Source: https://docs.moralis.com/rpc-nodes/moonbeam/eth-get-balance Returns the balance of the account of given address. ⚠️ **Deprecated. Migrate to Base.** Moonbeam (`0x504`) and Moonriver (`0x505`) stopped producing new blocks on August 1, 2026, and Moralis support is removed on **September 25, 2026**. Following Moonbeam's network relaunch on Base, GLMR ( `0xb3846fd356c2149ee8d30b0449088dc74e265459`) and MOVR ( `0x43fEB74608334DDa8c1a6500D185cFC3Ea962B83`) are now ERC-20 tokens on Base. Point your integration at Base by using the `base` chain parameter, or the `https://site1.moralis-nodes.com/base/` RPC path. See the [deprecation notice](/changelog#moonbeam-moonriver-and-lisk-support-ends-september-25-2026) for details. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address to check for balance **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/moonbeam/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0234c8a3397aab58" } ``` # eth_getBlockByHash Source: https://docs.moralis.com/rpc-nodes/moonbeam/eth-get-block-by-hash Returns information about a block by hash. ⚠️ **Deprecated. Migrate to Base.** Moonbeam (`0x504`) and Moonriver (`0x505`) stopped producing new blocks on August 1, 2026, and Moralis support is removed on **September 25, 2026**. Following Moonbeam's network relaunch on Base, GLMR ( `0xb3846fd356c2149ee8d30b0449088dc74e265459`) and MOVR ( `0x43fEB74608334DDa8c1a6500D185cFC3Ea962B83`) are now ERC-20 tokens on Base. Point your integration at Base by using the `base` chain parameter, or the `https://site1.moralis-nodes.com/base/` RPC path. See the [deprecation notice](/changelog#moonbeam-moonriver-and-lisk-support-ends-september-25-2026) for details. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block **fullTransactionObjects** `boolean` *required* If true it returns the full transaction objects, if false only the hashes of the transactions #### Example request `params` ```javascript theme={null} [ "0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c", false ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/moonbeam/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c", false], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x3319bb0", "blobGasUsed": "0x120000", "difficulty": "0x0", "excessBlobGas": "0xa576243", "extraData": "0xe29ca82051756173617220287175617361722e77696e2920e29ca8", "gasLimit": "0x3938700", "gasUsed": "0x2965eaa", "hash": "0xc319ec0da50d354ce425b63fb6914a42aafdb9ee9807518edd595809e25fbe38", "logsBloom": "0x7feeeb37793b4fdfff7ab7aefde2d7fdfff9575bfef5bdff3fb97bfef7bcddbbdf9d55e77fdf7ead7b98ffd9bb6fefff7e77b163bf9eeebdddd1ffbf376cfbeb7efffef83ffbe9eb7ff7776ab3dcf8bfee7ebaddfffdf7fe3fffdf6ed3f7dff77cf2fd7efffff7a19ef7ffbbe3e8befdb7fff76b6ed6e7ffceeb99ff7eeb5efebfff3fff7da1fb39f9fff3fd7f3f77b6dd0bed39f5fff3bfa7fbbce7f9f6ec6e0fff50bfe7f9f79efff35ff6d93fecfefbffdaf7b7eff35ec6ff42fe7e6f77f7deff7eff57f6aafa597feebdffff7bbd677e27ffbfadfdf57f7e7d2aeeffffff6676ffa7f3f375eb95eecf9ffa235cbfcdefafbf8feed9dc7b56ff2fdfedfefe", "miner": "0x396343362be2a4da1ce0c1c210945346fb82aa49", "mixHash": "0x07444bb5750f746e200e1dcd8d83221b26576d3357b833cc1e434e7966d0e774", "nonce": "0x0000000000000000", "number": "0x1736791", "parentBeaconBlockRoot": "0x2759f248e2d1cb1a2f5c2657c4efcc623dd8ea7f23e8700162e7fccdacedfd5d", "parentHash": "0xdf0e4dee910167d7b1687a6cb677983ce7ed351ae78ab7e2c5ba39d793c80391", "receiptsRoot": "0x5f1c58e498161509245daad0f60319d9abab7f04d2ca60e99a3674cfdc9b8327", "requestsHash": "0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x1ef1e", "stateRoot": "0x728c7e38107037b573d719e67b6872ee3ca4e01b47818598316cd696bfe24f2c", "timestamp": "0x697b4bcb", "transactions": [ "0xbf7bd0cf98c3b65525f1f7267b1d02e7ccd7cd133b137f46723a91cf187616d5", "0x06ac9281da76d530aa19600e2c34aae7564a78702d3eb52b1fb363985473e296" ], "transactionsRoot": "0xa8c680f6ad8ccc7a49db5ab76cbd9194c88e16dbcfa440104f7787e5ba815c4f", "uncles": [], "withdrawals": [ { "index": "0x6f78bfb", "validatorIndex": "0x955f5", "address": "0x5d3ca1842d0988816434ea51ca420182f3f1e31a", "amount": "0x102d2f1" } ], "withdrawalsRoot": "0x9b7ecf1ba575fc02e4b4c14bd65d5ca95c0e066adaae3fc2ef16f5acd90214d8" } } ``` # eth_getBlockByNumber Source: https://docs.moralis.com/rpc-nodes/moonbeam/eth-get-block-by-number Returns information about a block by block number. ⚠️ **Deprecated. Migrate to Base.** Moonbeam (`0x504`) and Moonriver (`0x505`) stopped producing new blocks on August 1, 2026, and Moralis support is removed on **September 25, 2026**. Following Moonbeam's network relaunch on Base, GLMR ( `0xb3846fd356c2149ee8d30b0449088dc74e265459`) and MOVR ( `0x43fEB74608334DDa8c1a6500D185cFC3Ea962B83`) are now ERC-20 tokens on Base. Point your integration at Base by using the `base` chain parameter, or the `https://site1.moralis-nodes.com/base/` RPC path. See the [deprecation notice](/changelog#moonbeam-moonriver-and-lisk-support-ends-september-25-2026) for details. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" **fullTransactionObjects** `boolean` *required* If true it returns the full transaction objects, if false only the hashes of the transactions #### Example request `params` ```javascript theme={null} [ "0x1b4", true ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/moonbeam/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["0x1b4", true], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x3319bb0", "blobGasUsed": "0x120000", "difficulty": "0x0", "excessBlobGas": "0xa576243", "extraData": "0xe29ca82051756173617220287175617361722e77696e2920e29ca8", "gasLimit": "0x3938700", "gasUsed": "0x2965eaa", "hash": "0xc319ec0da50d354ce425b63fb6914a42aafdb9ee9807518edd595809e25fbe38", "logsBloom": "0x7feeeb37793b4fdfff7ab7aefde2d7fdfff9575bfef5bdff3fb97bfef7bcddbbdf9d55e77fdf7ead7b98ffd9bb6fefff7e77b163bf9eeebdddd1ffbf376cfbeb7efffef83ffbe9eb7ff7776ab3dcf8bfee7ebaddfffdf7fe3fffdf6ed3f7dff77cf2fd7efffff7a19ef7ffbbe3e8befdb7fff76b6ed6e7ffceeb99ff7eeb5efebfff3fff7da1fb39f9fff3fd7f3f77b6dd0bed39f5fff3bfa7fbbce7f9f6ec6e0fff50bfe7f9f79efff35ff6d93fecfefbffdaf7b7eff35ec6ff42fe7e6f77f7deff7eff57f6aafa597feebdffff7bbd677e27ffbfadfdf57f7e7d2aeeffffff6676ffa7f3f375eb95eecf9ffa235cbfcdefafbf8feed9dc7b56ff2fdfedfefe", "miner": "0x396343362be2a4da1ce0c1c210945346fb82aa49", "mixHash": "0x07444bb5750f746e200e1dcd8d83221b26576d3357b833cc1e434e7966d0e774", "nonce": "0x0000000000000000", "number": "0x1736791", "parentBeaconBlockRoot": "0x2759f248e2d1cb1a2f5c2657c4efcc623dd8ea7f23e8700162e7fccdacedfd5d", "parentHash": "0xdf0e4dee910167d7b1687a6cb677983ce7ed351ae78ab7e2c5ba39d793c80391", "receiptsRoot": "0x5f1c58e498161509245daad0f60319d9abab7f04d2ca60e99a3674cfdc9b8327", "requestsHash": "0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x1ef1e", "stateRoot": "0x728c7e38107037b573d719e67b6872ee3ca4e01b47818598316cd696bfe24f2c", "timestamp": "0x697b4bcb", "transactions": [ "0xbf7bd0cf98c3b65525f1f7267b1d02e7ccd7cd133b137f46723a91cf187616d5", "0x06ac9281da76d530aa19600e2c34aae7564a78702d3eb52b1fb363985473e296" ], "transactionsRoot": "0xa8c680f6ad8ccc7a49db5ab76cbd9194c88e16dbcfa440104f7787e5ba815c4f", "uncles": [], "withdrawals": [ { "index": "0x6f78bfb", "validatorIndex": "0x955f5", "address": "0x5d3ca1842d0988816434ea51ca420182f3f1e31a", "amount": "0x102d2f1" } ], "withdrawalsRoot": "0x9b7ecf1ba575fc02e4b4c14bd65d5ca95c0e066adaae3fc2ef16f5acd90214d8" } } ``` # eth_getBlockReceipts Source: https://docs.moralis.com/rpc-nodes/moonbeam/eth-get-block-receipts Returns all transaction receipts for a given block. ⚠️ **Deprecated. Migrate to Base.** Moonbeam (`0x504`) and Moonriver (`0x505`) stopped producing new blocks on August 1, 2026, and Moralis support is removed on **September 25, 2026**. Following Moonbeam's network relaunch on Base, GLMR ( `0xb3846fd356c2149ee8d30b0449088dc74e265459`) and MOVR ( `0x43fEB74608334DDa8c1a6500D185cFC3Ea962B83`) are now ERC-20 tokens on Base. Point your integration at Base by using the `base` chain parameter, or the `https://site1.moralis-nodes.com/base/` RPC path. See the [deprecation notice](/changelog#moonbeam-moonriver-and-lisk-support-ends-september-25-2026) for details. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" #### Example request `params` ```javascript theme={null} [ "0xf21d9c" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/moonbeam/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockReceipts", "params": ["0xf21d9c"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": [ { "blockHash": "0x8243343df08b9751f5ca0c5f8c9c0460d8a9b6351066fae0acbd4d3e776de8bb", "blockNumber": "0xf21d9c", "contractAddress": null, "cumulativeGasUsed": "0x5208", "effectiveGasPrice": "0x1dcd6500", "from": "0x8ba1f109551bd432803012645haca66c9834d7c6", "gasUsed": "0x5208", "logs": [], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "status": "0x1", "to": "0x95cED938F7991cd0dFcb48F0a06a40FA1aF46EBC", "transactionHash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "transactionIndex": "0x0", "type": "0x2" } ] } ``` # eth_getBlockTransactionCountByHash Source: https://docs.moralis.com/rpc-nodes/moonbeam/eth-get-block-transaction-count-by-hash Returns the number of transactions in a block from a block matching the given block hash. ⚠️ **Deprecated. Migrate to Base.** Moonbeam (`0x504`) and Moonriver (`0x505`) stopped producing new blocks on August 1, 2026, and Moralis support is removed on **September 25, 2026**. Following Moonbeam's network relaunch on Base, GLMR ( `0xb3846fd356c2149ee8d30b0449088dc74e265459`) and MOVR ( `0x43fEB74608334DDa8c1a6500D185cFC3Ea962B83`) are now ERC-20 tokens on Base. Point your integration at Base by using the `base` chain parameter, or the `https://site1.moralis-nodes.com/base/` RPC path. See the [deprecation notice](/changelog#moonbeam-moonriver-and-lisk-support-ends-september-25-2026) for details. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block #### Example request `params` ```javascript theme={null} [ "0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/moonbeam/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` # eth_getBlockTransactionCountByNumber Source: https://docs.moralis.com/rpc-nodes/moonbeam/eth-get-block-transaction-count-by-number Returns the number of transactions in a block matching the given block number. ⚠️ **Deprecated. Migrate to Base.** Moonbeam (`0x504`) and Moonriver (`0x505`) stopped producing new blocks on August 1, 2026, and Moralis support is removed on **September 25, 2026**. Following Moonbeam's network relaunch on Base, GLMR ( `0xb3846fd356c2149ee8d30b0449088dc74e265459`) and MOVR ( `0x43fEB74608334DDa8c1a6500D185cFC3Ea962B83`) are now ERC-20 tokens on Base. Point your integration at Base by using the `base` chain parameter, or the `https://site1.moralis-nodes.com/base/` RPC path. See the [deprecation notice](/changelog#moonbeam-moonriver-and-lisk-support-ends-september-25-2026) for details. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" #### Example request `params` ```javascript theme={null} [ "0xe8" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/moonbeam/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["0xe8"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` # eth_getCode Source: https://docs.moralis.com/rpc-nodes/moonbeam/eth-get-code Returns code at a given address. ⚠️ **Deprecated. Migrate to Base.** Moonbeam (`0x504`) and Moonriver (`0x505`) stopped producing new blocks on August 1, 2026, and Moralis support is removed on **September 25, 2026**. Following Moonbeam's network relaunch on Base, GLMR ( `0xb3846fd356c2149ee8d30b0449088dc74e265459`) and MOVR ( `0x43fEB74608334DDa8c1a6500D185cFC3Ea962B83`) are now ERC-20 tokens on Base. Point your integration at Base by using the `base` chain parameter, or the `https://site1.moralis-nodes.com/base/` RPC path. See the [deprecation notice](/changelog#moonbeam-moonriver-and-lisk-support-ends-september-25-2026) for details. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address to get the code from **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x2" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/moonbeam/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getCode", "params": ["0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x2"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x600160008035811a818181146012578301005b601b6001356025565b8060005260206000f25b600060078202905091905056" } ``` # eth_getLogs Source: https://docs.moralis.com/rpc-nodes/moonbeam/eth-get-logs Returns an array of all logs matching a given filter object. ⚠️ **Deprecated. Migrate to Base.** Moonbeam (`0x504`) and Moonriver (`0x505`) stopped producing new blocks on August 1, 2026, and Moralis support is removed on **September 25, 2026**. Following Moonbeam's network relaunch on Base, GLMR ( `0xb3846fd356c2149ee8d30b0449088dc74e265459`) and MOVR ( `0x43fEB74608334DDa8c1a6500D185cFC3Ea962B83`) are now ERC-20 tokens on Base. Point your integration at Base by using the `base` chain parameter, or the `https://site1.moralis-nodes.com/base/` RPC path. See the [deprecation notice](/changelog#moonbeam-moonriver-and-lisk-support-ends-september-25-2026) for details. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **fromBlock** `string` Integer block number, or "latest" for the last mined block or "pending", "earliest" for not yet mined transactions **toBlock** `string` Integer block number, or "latest" for the last mined block or "pending", "earliest" for not yet mined transactions **address** `string` Contract address or a list of addresses from which logs should originate **topics** `array` Array of 32 Bytes DATA topics. Topics are order-dependent **blockhash** `string` Using blockhash is equivalent to fromBlock = toBlock = the block number with hash blockhash #### Example request `params` ```javascript theme={null} [ { "fromBlock": "0x1", "toBlock": "0x2", "address": "0x8888f1f195afa192cfee860698584c030f4c9db1", "topics": [ "0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", null, [ "0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x0000000000000000000000000aff3454fce5edbc8cca8697c15331677e6ebccc" ] ] } ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/moonbeam/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getLogs", "params": [{"fromBlock": "0x1", "toBlock": "0x2", "address": "0x8888f1f195afa192cfee860698584c030f4c9db1", "topics": ["0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", null, ["0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x0000000000000000000000000aff3454fce5edbc8cca8697c15331677e6ebccc"]]}], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": [ { "logIndex": "0x1", "blockNumber": "0x1b4", "blockHash": "0x8216c5785ac562ff41e2dcfdf5785ac562ff41e2dcfdf829c5a142f1fccd7d", "transactionHash": "0xdf829c5a142f1fccd7d8216c5785ac562ff41e2dcfdf5785ac562ff41e2dcf", "transactionIndex": "0x0", "address": "0x16c5785ac562ff41e2dcfdf829c5a142f1fccd7d", "data": "0x0000000000000000000000000000000000000000000000000000000000000000", "topics": [ "0x59ebeb90bc63057b6515673c3ecf9438e5058bca0f92585014eced636878c9a5" ] } ] } ``` # eth_getProof Source: https://docs.moralis.com/rpc-nodes/moonbeam/eth-get-proof Returns the account and storage values of the specified account including the Merkle-proof. ⚠️ **Deprecated. Migrate to Base.** Moonbeam (`0x504`) and Moonriver (`0x505`) stopped producing new blocks on August 1, 2026, and Moralis support is removed on **September 25, 2026**. Following Moonbeam's network relaunch on Base, GLMR ( `0xb3846fd356c2149ee8d30b0449088dc74e265459`) and MOVR ( `0x43fEB74608334DDa8c1a6500D185cFC3Ea962B83`) are now ERC-20 tokens on Base. Point your integration at Base by using the `base` chain parameter, or the `https://site1.moralis-nodes.com/base/` RPC path. See the [deprecation notice](/changelog#moonbeam-moonriver-and-lisk-support-ends-september-25-2026) for details. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address of the account or contract **storageKeys** `array` *required* Array of storage-keys which should be proofed and included **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842", [ "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421" ], "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/moonbeam/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getProof", "params": ["0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842", ["0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"], "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "address": "0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842", "accountProof": [ "0xf90211a090dcaf88c40c7bbc95a912cbdde67c175767b31173df9ee4b0d733bfdd511c43a0babe369f6b12092f49181ae04ca173fb68d1a5456f18d20fa32cba73954052bda0473ecf8a7e36a829e75039a3b055e51b8332cbf03324ab4af2066bbd6fbf0021fa0bbda34753d7aa6c38e603f360244e8f59611921d9e1f128372fec0d586d4f9e0a04e44caecff45c9891f74f6a2156735886eedf6f1a733628ebc802ec79d844648a0a5f3f2f7542148c973977c8a1e154c4300fec92f755f7846f1b734d3ab1d90e7a0e823850f50bf72baae9d1733a36a444ab65d0a6faaba404f0583ce0ca4dad92da0f7a00cbe7d4b30b11faea3ae61b7f1f2b315017e79a3de5ab2dc8bb46a59fdb37a09b3b8d0e0e4c1e3b2d3e8f7c6e5d4c3b2a1e0f9e8d7c6b5a4e3f2e1d0c9b8a7a0b1f8e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0a0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0a0d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a08080" ], "balance": "0x0", "codeHash": "0x5e61b0f7919ab4e6fc7cfa6f3f5f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f", "nonce": "0x0", "storageHash": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "storageProof": [ { "key": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "value": "0x1", "proof": [ "0xf90211a090dcaf88c40c7bbc95a912cbdde67c175767b31173df9ee4b0d733bfdd511c43a0babe369f6b12092f49181ae04ca173fb68d1a5456f18d20fa32cba73954052bda0473ecf8a7e36a829e75039a3b055e51b8332cbf03324ab4af2066bbd6fbf0021fa0bbda34753d7aa6c38e603f360244e8f59611921d9e1f128372fec0d586d4f9e0a04e44caecff45c9891f74f6a2156735886eedf6f1a733628ebc802ec79d844648a0a5f3f2f7542148c973977c8a1e154c4300fec92f755f7846f1b734d3ab1d90e7a0e823850f50bf72baae9d1733a36a444ab65d0a6faaba404f0583ce0ca4dad92da0f7a00cbe7d4b30b11faea3ae61b7f1f2b315017e79a3de5ab2dc8bb46a59fdb37a09b3b8d0e0e4c1e3b2d3e8f7c6e5d4c3b2a1e0f9e8d7c6b5a4e3f2e1d0c9b8a7a0b1f8e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0a0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0a0d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a08080" ] } ] } } ``` # eth_getStorageAt Source: https://docs.moralis.com/rpc-nodes/moonbeam/eth-get-storage-at Returns the value from a storage position at a given address. ⚠️ **Deprecated. Migrate to Base.** Moonbeam (`0x504`) and Moonriver (`0x505`) stopped producing new blocks on August 1, 2026, and Moralis support is removed on **September 25, 2026**. Following Moonbeam's network relaunch on Base, GLMR ( `0xb3846fd356c2149ee8d30b0449088dc74e265459`) and MOVR ( `0x43fEB74608334DDa8c1a6500D185cFC3Ea962B83`) are now ERC-20 tokens on Base. Point your integration at Base by using the `base` chain parameter, or the `https://site1.moralis-nodes.com/base/` RPC path. See the [deprecation notice](/changelog#moonbeam-moonriver-and-lisk-support-ends-september-25-2026) for details. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address of the storage **position** `string` *required* Integer of the position in the storage **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x0", "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/moonbeam/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x0", "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x00000000000000000000000000000000000000000000000000000000000004d2" } ``` # eth_getTransactionByBlockHashAndIndex Source: https://docs.moralis.com/rpc-nodes/moonbeam/eth-get-transaction-by-block-hash-and-index Returns information about a transaction by block hash and transaction index position. ⚠️ **Deprecated. Migrate to Base.** Moonbeam (`0x504`) and Moonriver (`0x505`) stopped producing new blocks on August 1, 2026, and Moralis support is removed on **September 25, 2026**. Following Moonbeam's network relaunch on Base, GLMR ( `0xb3846fd356c2149ee8d30b0449088dc74e265459`) and MOVR ( `0x43fEB74608334DDa8c1a6500D185cFC3Ea962B83`) are now ERC-20 tokens on Base. Point your integration at Base by using the `base` chain parameter, or the `https://site1.moralis-nodes.com/base/` RPC path. See the [deprecation notice](/changelog#moonbeam-moonriver-and-lisk-support-ends-september-25-2026) for details. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block **index** `string` *required* Integer of the transaction index position #### Example request `params` ```javascript theme={null} [ "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/moonbeam/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5daf3b", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "gas": "0xc350", "gasPrice": "0x4a817c800", "hash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "input": "0x68656c6c6f21", "nonce": "0x15", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "transactionIndex": "0x0", "value": "0xf3dbb76162000", "v": "0x25", "r": "0x1b5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5", "s": "0x5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5c5" } } ``` # eth_getTransactionByBlockNumberAndIndex Source: https://docs.moralis.com/rpc-nodes/moonbeam/eth-get-transaction-by-block-number-and-index Returns information about a transaction by block number and transaction index position. ⚠️ **Deprecated. Migrate to Base.** Moonbeam (`0x504`) and Moonriver (`0x505`) stopped producing new blocks on August 1, 2026, and Moralis support is removed on **September 25, 2026**. Following Moonbeam's network relaunch on Base, GLMR ( `0xb3846fd356c2149ee8d30b0449088dc74e265459`) and MOVR ( `0x43fEB74608334DDa8c1a6500D185cFC3Ea962B83`) are now ERC-20 tokens on Base. Point your integration at Base by using the `base` chain parameter, or the `https://site1.moralis-nodes.com/base/` RPC path. See the [deprecation notice](/changelog#moonbeam-moonriver-and-lisk-support-ends-september-25-2026) for details. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* A block number, or the string "earliest", "latest" or "pending" **index** `string` *required* The transaction index position #### Example request `params` ```javascript theme={null} [ "0x5BAE9E", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/moonbeam/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["0x5BAE9E", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5BAE9E", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "gas": "0xc350", "gasPrice": "0x4a817c800", "hash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "input": "0x68656c6c6f21", "nonce": "0x15", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "transactionIndex": "0x0", "value": "0xf3dbb76162000", "v": "0x25", "r": "0x1b5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5", "s": "0x5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5c5" } } ``` # eth_getTransactionByHash Source: https://docs.moralis.com/rpc-nodes/moonbeam/eth-get-transaction-by-hash Returns the information about a transaction requested by transaction hash. ⚠️ **Deprecated. Migrate to Base.** Moonbeam (`0x504`) and Moonriver (`0x505`) stopped producing new blocks on August 1, 2026, and Moralis support is removed on **September 25, 2026**. Following Moonbeam's network relaunch on Base, GLMR ( `0xb3846fd356c2149ee8d30b0449088dc74e265459`) and MOVR ( `0x43fEB74608334DDa8c1a6500D185cFC3Ea962B83`) are now ERC-20 tokens on Base. Point your integration at Base by using the `base` chain parameter, or the `https://site1.moralis-nodes.com/base/` RPC path. See the [deprecation notice](/changelog#moonbeam-moonriver-and-lisk-support-ends-september-25-2026) for details. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a transaction #### Example request `params` ```javascript theme={null} [ "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/moonbeam/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5daf3b", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "gas": "0xc350", "gasPrice": "0x4a817c800", "hash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "input": "0x68656c6c6f21", "nonce": "0x15", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "transactionIndex": "0x41", "value": "0xf3dbb76162000", "v": "0x25", "r": "0x1b5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5", "s": "0x5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5c5" } } ``` # eth_getTransactionCount Source: https://docs.moralis.com/rpc-nodes/moonbeam/eth-get-transaction-count Returns the number of transactions sent from an address. ⚠️ **Deprecated. Migrate to Base.** Moonbeam (`0x504`) and Moonriver (`0x505`) stopped producing new blocks on August 1, 2026, and Moralis support is removed on **September 25, 2026**. Following Moonbeam's network relaunch on Base, GLMR ( `0xb3846fd356c2149ee8d30b0449088dc74e265459`) and MOVR ( `0x43fEB74608334DDa8c1a6500D185cFC3Ea962B83`) are now ERC-20 tokens on Base. Point your integration at Base by using the `base` chain parameter, or the `https://site1.moralis-nodes.com/base/` RPC path. See the [deprecation notice](/changelog#moonbeam-moonriver-and-lisk-support-ends-september-25-2026) for details. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address to get transaction count for **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/moonbeam/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` # eth_getTransactionReceipt Source: https://docs.moralis.com/rpc-nodes/moonbeam/eth-get-transaction-receipt Returns the receipt of a transaction by transaction hash. ⚠️ **Deprecated. Migrate to Base.** Moonbeam (`0x504`) and Moonriver (`0x505`) stopped producing new blocks on August 1, 2026, and Moralis support is removed on **September 25, 2026**. Following Moonbeam's network relaunch on Base, GLMR ( `0xb3846fd356c2149ee8d30b0449088dc74e265459`) and MOVR ( `0x43fEB74608334DDa8c1a6500D185cFC3Ea962B83`) are now ERC-20 tokens on Base. Point your integration at Base by using the `base` chain parameter, or the `https://site1.moralis-nodes.com/base/` RPC path. See the [deprecation notice](/changelog#moonbeam-moonriver-and-lisk-support-ends-september-25-2026) for details. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a transaction #### Example request `params` ```javascript theme={null} [ "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/moonbeam/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "transactionHash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "transactionIndex": "0x41", "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5daf3b", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "cumulativeGasUsed": "0x33bc", "gasUsed": "0x4dc", "contractAddress": null, "logs": [], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "status": "0x1" } } ``` # eth_getUncleByBlockHashAndIndex Source: https://docs.moralis.com/rpc-nodes/moonbeam/eth-get-uncle-by-block-hash-and-index Returns information about an uncle of a block by hash and uncle index position. ⚠️ **Deprecated. Migrate to Base.** Moonbeam (`0x504`) and Moonriver (`0x505`) stopped producing new blocks on August 1, 2026, and Moralis support is removed on **September 25, 2026**. Following Moonbeam's network relaunch on Base, GLMR ( `0xb3846fd356c2149ee8d30b0449088dc74e265459`) and MOVR ( `0x43fEB74608334DDa8c1a6500D185cFC3Ea962B83`) are now ERC-20 tokens on Base. Point your integration at Base by using the `base` chain parameter, or the `https://site1.moralis-nodes.com/base/` RPC path. See the [deprecation notice](/changelog#moonbeam-moonriver-and-lisk-support-ends-september-25-2026) for details. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block **index** `string` *required* The uncle's index position #### Example request `params` ```javascript theme={null} [ "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/moonbeam/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x027f07", "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000", "gasLimit": "0x9f759", "gasUsed": "0x9f759", "hash": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331", "logsBloom": "0x1a060020000015554c000200000003050000200017041014032020801000056020000001000a00d0020204040020012150010010000000280005000c00000000000020c0000000024008104011000080020020000001006100900000024208002000020002100000000000000080000000120080000002003c0000200000000200002010008300300001001031100100040010420000800000000014000004002000000c040200060000000080000000100000000040a2000001000061000042021080400200000410000404080800014008201000c20100500020011000000030001100100024008c80190400402008000020000c0041104218100000000000000002000800000", "miner": "0x4e65fda2159562a496f9f3522f89122a3088497a", "mixHash": "0x99e9d85137db46ef1e85fff042bb15a7b6f46618b7f600b0b4e7fb52fceafc3a", "nonce": "0xfcf4db6d9bce1b8b", "number": "0x1b4", "parentHash": "0xa057c32b6ed8eb5e006cadfad55c7e635549c6e2135c4e6c3a9d5a6a80f72c3", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0x1a7e46b37b26e0c3f67ed4de3b5d3b1ff84a2e0a5e2dcf4d4b0d34b5a22b6e3", "timestamp": "0x55ba467c", "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` # eth_getUncleByBlockNumberAndIndex Source: https://docs.moralis.com/rpc-nodes/moonbeam/eth-get-uncle-by-block-number-and-index Returns information about an uncle of a block by number and uncle index position. ⚠️ **Deprecated. Migrate to Base.** Moonbeam (`0x504`) and Moonriver (`0x505`) stopped producing new blocks on August 1, 2026, and Moralis support is removed on **September 25, 2026**. Following Moonbeam's network relaunch on Base, GLMR ( `0xb3846fd356c2149ee8d30b0449088dc74e265459`) and MOVR ( `0x43fEB74608334DDa8c1a6500D185cFC3Ea962B83`) are now ERC-20 tokens on Base. Point your integration at Base by using the `base` chain parameter, or the `https://site1.moralis-nodes.com/base/` RPC path. See the [deprecation notice](/changelog#moonbeam-moonriver-and-lisk-support-ends-september-25-2026) for details. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* A block number, or the string "earliest", "latest" or "pending" **index** `string` *required* The uncle's index position #### Example request `params` ```javascript theme={null} [ "0x29c", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/moonbeam/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["0x29c", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x027f07", "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000", "gasLimit": "0x9f759", "gasUsed": "0x9f759", "hash": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331", "logsBloom": "0x1a060020000015554c000200000003050000200017041014032020801000056020000001000a00d0020204040020012150010010000000280005000c00000000000020c0000000024008104011000080020020000001006100900000024208002000020002100000000000000080000000120080000002003c0000200000000200002010008300300001001031100100040010420000800000000014000004002000000c040200060000000080000000100000000040a2000001000061000042021080400200000410000404080800014008201000c20100500020011000000030001100100024008c80190400402008000020000c0041104218100000000000000002000800000", "miner": "0x4e65fda2159562a496f9f3522f89122a3088497a", "mixHash": "0x99e9d85137db46ef1e85fff042bb15a7b6f46618b7f600b0b4e7fb52fceafc3a", "nonce": "0xfcf4db6d9bce1b8b", "number": "0x29c", "parentHash": "0xa057c32b6ed8eb5e006cadfad55c7e635549c6e2135c4e6c3a9d5a6a80f72c3", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0x1a7e46b37b26e0c3f67ed4de3b5d3b1ff84a2e0a5e2dcf4d4b0d34b5a22b6e3", "timestamp": "0x55ba467c", "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` # eth_getUncleCountByBlockHash Source: https://docs.moralis.com/rpc-nodes/moonbeam/eth-get-uncle-count-by-block-hash Returns the number of uncles in a block from a block matching the given block hash. ⚠️ **Deprecated. Migrate to Base.** Moonbeam (`0x504`) and Moonriver (`0x505`) stopped producing new blocks on August 1, 2026, and Moralis support is removed on **September 25, 2026**. Following Moonbeam's network relaunch on Base, GLMR ( `0xb3846fd356c2149ee8d30b0449088dc74e265459`) and MOVR ( `0x43fEB74608334DDa8c1a6500D185cFC3Ea962B83`) are now ERC-20 tokens on Base. Point your integration at Base by using the `base` chain parameter, or the `https://site1.moralis-nodes.com/base/` RPC path. See the [deprecation notice](/changelog#moonbeam-moonriver-and-lisk-support-ends-september-25-2026) for details. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block #### Example request `params` ```javascript theme={null} [ "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/moonbeam/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` # eth_getUncleCountByBlockNumber Source: https://docs.moralis.com/rpc-nodes/moonbeam/eth-get-uncle-count-by-block-number Returns the number of uncles in a block from a block matching the given block number. ⚠️ **Deprecated. Migrate to Base.** Moonbeam (`0x504`) and Moonriver (`0x505`) stopped producing new blocks on August 1, 2026, and Moralis support is removed on **September 25, 2026**. Following Moonbeam's network relaunch on Base, GLMR ( `0xb3846fd356c2149ee8d30b0449088dc74e265459`) and MOVR ( `0x43fEB74608334DDa8c1a6500D185cFC3Ea962B83`) are now ERC-20 tokens on Base. Point your integration at Base by using the `base` chain parameter, or the `https://site1.moralis-nodes.com/base/` RPC path. See the [deprecation notice](/changelog#moonbeam-moonriver-and-lisk-support-ends-september-25-2026) for details. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" #### Example request `params` ```javascript theme={null} [ "0x5BAE9E" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/moonbeam/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["0x5BAE9E"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` # eth_maxPriorityFeePerGas Source: https://docs.moralis.com/rpc-nodes/moonbeam/eth-max-priority-fee-per-gas Returns a suggestion for the max priority fee per gas for dynamic fee transactions in wei. ⚠️ **Deprecated. Migrate to Base.** Moonbeam (`0x504`) and Moonriver (`0x505`) stopped producing new blocks on August 1, 2026, and Moralis support is removed on **September 25, 2026**. Following Moonbeam's network relaunch on Base, GLMR ( `0xb3846fd356c2149ee8d30b0449088dc74e265459`) and MOVR ( `0x43fEB74608334DDa8c1a6500D185cFC3Ea962B83`) are now ERC-20 tokens on Base. Point your integration at Base by using the `base` chain parameter, or the `https://site1.moralis-nodes.com/base/` RPC path. See the [deprecation notice](/changelog#moonbeam-moonriver-and-lisk-support-ends-september-25-2026) for details. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/moonbeam/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_maxPriorityFeePerGas", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x59682f00" } ``` # eth_sendRawTransaction Source: https://docs.moralis.com/rpc-nodes/moonbeam/eth-send-raw-transaction Submits a pre-signed transaction for broadcast to the network. ⚠️ **Deprecated. Migrate to Base.** Moonbeam (`0x504`) and Moonriver (`0x505`) stopped producing new blocks on August 1, 2026, and Moralis support is removed on **September 25, 2026**. Following Moonbeam's network relaunch on Base, GLMR ( `0xb3846fd356c2149ee8d30b0449088dc74e265459`) and MOVR ( `0x43fEB74608334DDa8c1a6500D185cFC3Ea962B83`) are now ERC-20 tokens on Base. Point your integration at Base by using the `base` chain parameter, or the `https://site1.moralis-nodes.com/base/` RPC path. See the [deprecation notice](/changelog#moonbeam-moonriver-and-lisk-support-ends-september-25-2026) for details. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **data** `string` *required* The signed transaction data #### Example request `params` ```javascript theme={null} [ "0xf869808504e3b2928082520894f0109fc8df283027b6285cc889f5aa624eac1f55843b9aca008025a0c9cf86333bcb065d140032ecaab5d9281bde80f21b9687b3e94161de42d51895a0727a108a0b8d101465414033c3f705a9c7b826e596766046ee1183dbc8aeaa68" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/moonbeam/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["0xf869808504e3b2928082520894f0109fc8df283027b6285cc889f5aa624eac1f55843b9aca008025a0c9cf86333bcb065d140032ecaab5d9281bde80f21b9687b3e94161de42d51895a0727a108a0b8d101465414033c3f705a9c7b826e596766046ee1183dbc8aeaa68"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" } ``` # Overview Source: https://docs.moralis.com/rpc-nodes/moonbeam/overview Explore Moonbeam JSON-RPC methods ⚠️ **Deprecated. Migrate to Base.** Moonbeam (`0x504`) and Moonriver (`0x505`) stopped producing new blocks on August 1, 2026, and Moralis support is removed on **September 25, 2026**. Following Moonbeam's network relaunch on Base, GLMR ( `0xb3846fd356c2149ee8d30b0449088dc74e265459`) and MOVR ( `0x43fEB74608334DDa8c1a6500D185cFC3Ea962B83`) are now ERC-20 tokens on Base. Point your integration at Base by using the `base` chain parameter, or the `https://site1.moralis-nodes.com/base/` RPC path. See the [deprecation notice](/changelog#moonbeam-moonriver-and-lisk-support-ends-september-25-2026) for details. ## Introduction Moonbeam is a smart contract platform that makes it easy to build native interoperable applications. It is fully Ethereum-compatible, allowing Ethereum developers to use their existing tools and deploy decentralized applications (dApps) with minimal changes. Moonbeam focuses on providing an Ethereum-like environment on Polkadot, ensuring scalability and low transaction costs while maintaining interoperability with other blockchains. ## **Supported Networks** The Moonbeam RPC API is available for the following networks: 1. **Moonbeam** 2. **Moonriver** ## Network Details | **Network** | **Chain ID** | **Path Parameter** | | :- | :- | :- | | **Moonbeam** | 0x504 (1284) | `moonbeam` | | **Moonriver** | 0x505 (1285) | `moonriver` | ## Supported RPC Methods * [eth\_blockNumber](/rpc-nodes/moonbeam/eth-blockNumber) * [eth\_call](/rpc-nodes/moonbeam/eth-call) * [eth\_chainId](/rpc-nodes/moonbeam/eth-chain-id) * [eth\_createAccessList](/rpc-nodes/moonbeam/eth-create-access-list) * [eth\_estimateGas](/rpc-nodes/moonbeam/eth-estimate-gas) * [eth\_feeHistory](/rpc-nodes/moonbeam/eth-fee-history) * [eth\_gasPrice](/rpc-nodes/moonbeam/eth-gas-price) * [eth\_getBalance](/rpc-nodes/moonbeam/eth-get-balance) * [eth\_getBlockByHash](/rpc-nodes/moonbeam/eth-get-block-by-hash) * [eth\_getBlockByNumber](/rpc-nodes/moonbeam/eth-get-block-by-number) * [eth\_getBlockTransactionCountByHash](/rpc-nodes/moonbeam/eth-get-block-transaction-count-by-hash) * [eth\_getBlockTransactionCountByNumber](/rpc-nodes/moonbeam/eth-get-block-transaction-count-by-number) * [eth\_getBlockReceipts](/rpc-nodes/moonbeam/eth-get-block-receipts) * [eth\_getCode](/rpc-nodes/moonbeam/eth-get-code) * [eth\_getLogs](/streams/api-reference/history/get-logs) * [eth\_getProof](/rpc-nodes/moonbeam/eth-get-proof) * [eth\_getStorageAt](/rpc-nodes/moonbeam/eth-get-storage-at) * [eth\_getTransactionByHash](/rpc-nodes/moonbeam/eth-get-transaction-by-hash) * [eth\_getTransactionByBlockHashAndIndex](/rpc-nodes/moonbeam/eth-get-transaction-by-block-hash-and-index) * [eth\_getTransactionByBlockNumberAndIndex](/rpc-nodes/moonbeam/eth-get-transaction-by-block-number-and-index) * [eth\_getTransactionCount](/rpc-nodes/moonbeam/eth-get-transaction-count) * [eth\_getTransactionReceipt](/rpc-nodes/moonbeam/eth-get-transaction-receipt) * [eth\_getUncleByBlockHashAndIndex](/rpc-nodes/moonbeam/eth-get-uncle-by-block-hash-and-index) * [eth\_getUncleByBlockNumberAndIndex](/rpc-nodes/moonbeam/eth-get-uncle-by-block-number-and-index) * [eth\_getUncleCountByBlockHash](/rpc-nodes/moonbeam/eth-get-uncle-count-by-block-hash) * [eth\_getUncleCountByBlockNumber](/rpc-nodes/moonbeam/eth-get-uncle-count-by-block-number) * [eth\_maxPriorityFeePerGas](/rpc-nodes/moonbeam/eth-max-priority-fee-per-gas) * [eth\_sendRawTransaction](/rpc-nodes/moonbeam/eth-send-raw-transaction) # eth_blockNumber Source: https://docs.moralis.com/rpc-nodes/opbnb/eth-blockNumber Returns the number of most recent block. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request body No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/opbnb/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x4b7" } ``` # eth_call Source: https://docs.moralis.com/rpc-nodes/opbnb/eth-call Executes a new message call immediately without creating a transaction on the blockchain. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **from** `string` The address the transaction is sent from **to** `string` *required* The address the transaction is directed to **gas** `string` Integer of the gas provided for the transaction execution **gasPrice** `string` Integer of the gasPrice used for each paid gas **value** `string` Integer of the value sent with this transaction **data** `string` Hash of the method signature and encoded parameters **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ { "from": "0x0000000000000000000000000000000000000000", "to": "0x0000000000000000000000000000000000000000", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0x" }, "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/opbnb/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_call", "params": [{"from": "0xb60e8dd61c5d32be8058bb8eb970870f07233155", "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"}, "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x15536ee" } ``` # eth_chainId Source: https://docs.moralis.com/rpc-nodes/opbnb/eth-chain-id Returns the chain ID of the current connected node as described in EIP-695. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request body No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/opbnb/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_chainId", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` # eth_createAccessList Source: https://docs.moralis.com/rpc-nodes/opbnb/eth-create-access-list Creates an access list that you can include in a transaction. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **from** `string` The address the transaction is sent from **to** `string` The address the transaction is directed to **gas** `string` Integer of the gas provided for the transaction execution **gasPrice** `string` Integer of the gasPrice used for each paid gas **maxPriorityFeePerGas** `string` Maximum fee per gas the sender is willing to pay to miners **maxFeePerGas** `string` Maximum total fee per gas the sender is willing to pay **value** `string` Integer of the value sent with this transaction **data** `string` Hash of the method signature and encoded parameters **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ { "from": "0x8ba1f109551bd432803012645haca66c9834d7c6", "to": "0x6b175474e89094c44da98b954eedeac495271d0f", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0xa9059cbb0000000000000000000000008ba1f109551bd432803012645haca66c9834d7c60000000000000000000000000000000000000000000000000de0b6b3a7640000" }, "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/opbnb/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_createAccessList", "params": [{"from": "0x8ba1f109551bd432803012645haca66c9834d7c6", "to": "0x6b175474e89094c44da98b954eedeac495271d0f", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0xa9059cbb0000000000000000000000008ba1f109551bd432803012645haca66c9834d7c60000000000000000000000000000000000000000000000000de0b6b3a7640000"}, "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "accessList": [ { "address": "0x6b175474e89094c44da98b954eedeac495271d0f", "storageKeys": [ "0x0000000000000000000000000000000000000000000000000000000000000000" ] } ], "gasUsed": "0x7671" } } ``` # eth_estimateGas Source: https://docs.moralis.com/rpc-nodes/opbnb/eth-estimate-gas Generates and returns an estimate of how much gas is necessary to allow the transaction to complete. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **from** `string` The address the transaction is sent from **to** `string` The address the transaction is directed to **gas** `string` Integer of the gas provided for the transaction execution **gasPrice** `string` Integer of the gasPrice used for each paid gas **value** `string` Integer of the value sent with this transaction **data** `string` Hash of the method signature and encoded parameters **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ { "from": "0x8D97689C9818892B700e27F316cc3E41e17fBeb9", "to": "0xd3CdA913deB6f67967B99D67aCDFa1712C293601", "value": "0x186a0" }, "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/opbnb/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_estimateGas", "params": [{"from": "0x8D97689C9818892B700e27F316cc3E41e17fBeb9", "to": "0xd3CdA913deB6f67967B99D67aCDFa1712C293601", "value": "0x186a0"}, "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x5208" } ``` # eth_feeHistory Source: https://docs.moralis.com/rpc-nodes/opbnb/eth-fee-history Returns historical gas information for a range of blocks. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockCount** `string` *required* Number of blocks in the requested range **newestBlock** `string` *required* Highest number block of the requested range **rewardPercentiles** `array` Array of percentile values to sample from each block's effective priority fees per gas #### Example request `params` ```javascript theme={null} [ "0x4", "latest", [25, 75] ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/opbnb/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_feeHistory", "params": ["0x4", "latest", [25, 75]], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": [ "0x7", "0x7", "0x7", "0x7", "0x7" ], "gasUsedRatio": [ 0.026089875, 0.406803, 0.010817, 0.5 ], "baseFeePerBlobGas": [ "0x3319eb", "0x350c54", "0x364072", "0x364072", "0x32279d" ], "blobGasUsedRatio": [ 0.47619047619047616, 0.2857142857142857, 0, 0.3333333333333333 ], "oldestBlock": "0x11b9231", "reward": [ ["0x4a817c800", "0x4a817c800"], ["0x773593c0", "0x773593c0"], ["0x0", "0x0"], ["0x0", "0x0"] ] } } ``` # eth_gasPrice Source: https://docs.moralis.com/rpc-nodes/opbnb/eth-gas-price Returns the current price per gas in wei. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/opbnb/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x09184e72a000" } ``` # eth_getBalance Source: https://docs.moralis.com/rpc-nodes/opbnb/eth-get-balance Returns the balance of the account of given address. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address to check for balance **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/opbnb/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0234c8a3397aab58" } ``` # eth_getBlockByHash Source: https://docs.moralis.com/rpc-nodes/opbnb/eth-get-block-by-hash Returns information about a block by hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block **fullTransactionObjects** `boolean` *required* If true it returns the full transaction objects, if false only the hashes of the transactions #### Example request `params` ```javascript theme={null} [ "0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c", false ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/opbnb/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c", false], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x3319bb0", "blobGasUsed": "0x120000", "difficulty": "0x0", "excessBlobGas": "0xa576243", "extraData": "0xe29ca82051756173617220287175617361722e77696e2920e29ca8", "gasLimit": "0x3938700", "gasUsed": "0x2965eaa", "hash": "0xc319ec0da50d354ce425b63fb6914a42aafdb9ee9807518edd595809e25fbe38", "logsBloom": "0x7feeeb37793b4fdfff7ab7aefde2d7fdfff9575bfef5bdff3fb97bfef7bcddbbdf9d55e77fdf7ead7b98ffd9bb6fefff7e77b163bf9eeebdddd1ffbf376cfbeb7efffef83ffbe9eb7ff7776ab3dcf8bfee7ebaddfffdf7fe3fffdf6ed3f7dff77cf2fd7efffff7a19ef7ffbbe3e8befdb7fff76b6ed6e7ffceeb99ff7eeb5efebfff3fff7da1fb39f9fff3fd7f3f77b6dd0bed39f5fff3bfa7fbbce7f9f6ec6e0fff50bfe7f9f79efff35ff6d93fecfefbffdaf7b7eff35ec6ff42fe7e6f77f7deff7eff57f6aafa597feebdffff7bbd677e27ffbfadfdf57f7e7d2aeeffffff6676ffa7f3f375eb95eecf9ffa235cbfcdefafbf8feed9dc7b56ff2fdfedfefe", "miner": "0x396343362be2a4da1ce0c1c210945346fb82aa49", "mixHash": "0x07444bb5750f746e200e1dcd8d83221b26576d3357b833cc1e434e7966d0e774", "nonce": "0x0000000000000000", "number": "0x1736791", "parentBeaconBlockRoot": "0x2759f248e2d1cb1a2f5c2657c4efcc623dd8ea7f23e8700162e7fccdacedfd5d", "parentHash": "0xdf0e4dee910167d7b1687a6cb677983ce7ed351ae78ab7e2c5ba39d793c80391", "receiptsRoot": "0x5f1c58e498161509245daad0f60319d9abab7f04d2ca60e99a3674cfdc9b8327", "requestsHash": "0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x1ef1e", "stateRoot": "0x728c7e38107037b573d719e67b6872ee3ca4e01b47818598316cd696bfe24f2c", "timestamp": "0x697b4bcb", "transactions": [ "0xbf7bd0cf98c3b65525f1f7267b1d02e7ccd7cd133b137f46723a91cf187616d5", "0x06ac9281da76d530aa19600e2c34aae7564a78702d3eb52b1fb363985473e296" ], "transactionsRoot": "0xa8c680f6ad8ccc7a49db5ab76cbd9194c88e16dbcfa440104f7787e5ba815c4f", "uncles": [], "withdrawals": [ { "index": "0x6f78bfb", "validatorIndex": "0x955f5", "address": "0x5d3ca1842d0988816434ea51ca420182f3f1e31a", "amount": "0x102d2f1" } ], "withdrawalsRoot": "0x9b7ecf1ba575fc02e4b4c14bd65d5ca95c0e066adaae3fc2ef16f5acd90214d8" } } ``` # eth_getBlockByNumber Source: https://docs.moralis.com/rpc-nodes/opbnb/eth-get-block-by-number Returns information about a block by block number. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" **fullTransactionObjects** `boolean` *required* If true it returns the full transaction objects, if false only the hashes of the transactions #### Example request `params` ```javascript theme={null} [ "0x1b4", true ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/opbnb/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["0x1b4", true], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x3319bb0", "blobGasUsed": "0x120000", "difficulty": "0x0", "excessBlobGas": "0xa576243", "extraData": "0xe29ca82051756173617220287175617361722e77696e2920e29ca8", "gasLimit": "0x3938700", "gasUsed": "0x2965eaa", "hash": "0xc319ec0da50d354ce425b63fb6914a42aafdb9ee9807518edd595809e25fbe38", "logsBloom": "0x7feeeb37793b4fdfff7ab7aefde2d7fdfff9575bfef5bdff3fb97bfef7bcddbbdf9d55e77fdf7ead7b98ffd9bb6fefff7e77b163bf9eeebdddd1ffbf376cfbeb7efffef83ffbe9eb7ff7776ab3dcf8bfee7ebaddfffdf7fe3fffdf6ed3f7dff77cf2fd7efffff7a19ef7ffbbe3e8befdb7fff76b6ed6e7ffceeb99ff7eeb5efebfff3fff7da1fb39f9fff3fd7f3f77b6dd0bed39f5fff3bfa7fbbce7f9f6ec6e0fff50bfe7f9f79efff35ff6d93fecfefbffdaf7b7eff35ec6ff42fe7e6f77f7deff7eff57f6aafa597feebdffff7bbd677e27ffbfadfdf57f7e7d2aeeffffff6676ffa7f3f375eb95eecf9ffa235cbfcdefafbf8feed9dc7b56ff2fdfedfefe", "miner": "0x396343362be2a4da1ce0c1c210945346fb82aa49", "mixHash": "0x07444bb5750f746e200e1dcd8d83221b26576d3357b833cc1e434e7966d0e774", "nonce": "0x0000000000000000", "number": "0x1736791", "parentBeaconBlockRoot": "0x2759f248e2d1cb1a2f5c2657c4efcc623dd8ea7f23e8700162e7fccdacedfd5d", "parentHash": "0xdf0e4dee910167d7b1687a6cb677983ce7ed351ae78ab7e2c5ba39d793c80391", "receiptsRoot": "0x5f1c58e498161509245daad0f60319d9abab7f04d2ca60e99a3674cfdc9b8327", "requestsHash": "0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x1ef1e", "stateRoot": "0x728c7e38107037b573d719e67b6872ee3ca4e01b47818598316cd696bfe24f2c", "timestamp": "0x697b4bcb", "transactions": [ "0xbf7bd0cf98c3b65525f1f7267b1d02e7ccd7cd133b137f46723a91cf187616d5", "0x06ac9281da76d530aa19600e2c34aae7564a78702d3eb52b1fb363985473e296" ], "transactionsRoot": "0xa8c680f6ad8ccc7a49db5ab76cbd9194c88e16dbcfa440104f7787e5ba815c4f", "uncles": [], "withdrawals": [ { "index": "0x6f78bfb", "validatorIndex": "0x955f5", "address": "0x5d3ca1842d0988816434ea51ca420182f3f1e31a", "amount": "0x102d2f1" } ], "withdrawalsRoot": "0x9b7ecf1ba575fc02e4b4c14bd65d5ca95c0e066adaae3fc2ef16f5acd90214d8" } } ``` # eth_getBlockReceipts Source: https://docs.moralis.com/rpc-nodes/opbnb/eth-get-block-receipts Returns all transaction receipts for a given block. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" #### Example request `params` ```javascript theme={null} [ "0xf21d9c" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/opbnb/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockReceipts", "params": ["0xf21d9c"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": [ { "blockHash": "0x8243343df08b9751f5ca0c5f8c9c0460d8a9b6351066fae0acbd4d3e776de8bb", "blockNumber": "0xf21d9c", "contractAddress": null, "cumulativeGasUsed": "0x5208", "effectiveGasPrice": "0x1dcd6500", "from": "0x8ba1f109551bd432803012645haca66c9834d7c6", "gasUsed": "0x5208", "logs": [], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "status": "0x1", "to": "0x95cED938F7991cd0dFcb48F0a06a40FA1aF46EBC", "transactionHash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "transactionIndex": "0x0", "type": "0x2" } ] } ``` # eth_getBlockTransactionCountByHash Source: https://docs.moralis.com/rpc-nodes/opbnb/eth-get-block-transaction-count-by-hash Returns the number of transactions in a block from a block matching the given block hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block #### Example request `params` ```javascript theme={null} [ "0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/opbnb/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` # eth_getBlockTransactionCountByNumber Source: https://docs.moralis.com/rpc-nodes/opbnb/eth-get-block-transaction-count-by-number Returns the number of transactions in a block matching the given block number. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" #### Example request `params` ```javascript theme={null} [ "0xe8" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/opbnb/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["0xe8"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` # eth_getCode Source: https://docs.moralis.com/rpc-nodes/opbnb/eth-get-code Returns code at a given address. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address to get the code from **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x2" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/opbnb/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getCode", "params": ["0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x2"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x600160008035811a818181146012578301005b601b6001356025565b8060005260206000f25b600060078202905091905056" } ``` # eth_getLogs Source: https://docs.moralis.com/rpc-nodes/opbnb/eth-get-logs Returns an array of all logs matching a given filter object. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **fromBlock** `string` Integer block number, or "latest" for the last mined block or "pending", "earliest" for not yet mined transactions **toBlock** `string` Integer block number, or "latest" for the last mined block or "pending", "earliest" for not yet mined transactions **address** `string` Contract address or a list of addresses from which logs should originate **topics** `array` Array of 32 Bytes DATA topics. Topics are order-dependent **blockhash** `string` Using blockhash is equivalent to fromBlock = toBlock = the block number with hash blockhash #### Example request `params` ```javascript theme={null} [ { "fromBlock": "0x1", "toBlock": "0x2", "address": "0x8888f1f195afa192cfee860698584c030f4c9db1", "topics": [ "0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", null, [ "0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x0000000000000000000000000aff3454fce5edbc8cca8697c15331677e6ebccc" ] ] } ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/opbnb/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getLogs", "params": [{"fromBlock": "0x1", "toBlock": "0x2", "address": "0x8888f1f195afa192cfee860698584c030f4c9db1", "topics": ["0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", null, ["0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x0000000000000000000000000aff3454fce5edbc8cca8697c15331677e6ebccc"]]}], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": [ { "logIndex": "0x1", "blockNumber": "0x1b4", "blockHash": "0x8216c5785ac562ff41e2dcfdf5785ac562ff41e2dcfdf829c5a142f1fccd7d", "transactionHash": "0xdf829c5a142f1fccd7d8216c5785ac562ff41e2dcfdf5785ac562ff41e2dcf", "transactionIndex": "0x0", "address": "0x16c5785ac562ff41e2dcfdf829c5a142f1fccd7d", "data": "0x0000000000000000000000000000000000000000000000000000000000000000", "topics": [ "0x59ebeb90bc63057b6515673c3ecf9438e5058bca0f92585014eced636878c9a5" ] } ] } ``` # eth_getProof Source: https://docs.moralis.com/rpc-nodes/opbnb/eth-get-proof Returns the account and storage values of the specified account including the Merkle-proof. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address of the account or contract **storageKeys** `array` *required* Array of storage-keys which should be proofed and included **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842", [ "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421" ], "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/opbnb/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getProof", "params": ["0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842", ["0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"], "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "address": "0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842", "accountProof": [ "0xf90211a090dcaf88c40c7bbc95a912cbdde67c175767b31173df9ee4b0d733bfdd511c43a0babe369f6b12092f49181ae04ca173fb68d1a5456f18d20fa32cba73954052bda0473ecf8a7e36a829e75039a3b055e51b8332cbf03324ab4af2066bbd6fbf0021fa0bbda34753d7aa6c38e603f360244e8f59611921d9e1f128372fec0d586d4f9e0a04e44caecff45c9891f74f6a2156735886eedf6f1a733628ebc802ec79d844648a0a5f3f2f7542148c973977c8a1e154c4300fec92f755f7846f1b734d3ab1d90e7a0e823850f50bf72baae9d1733a36a444ab65d0a6faaba404f0583ce0ca4dad92da0f7a00cbe7d4b30b11faea3ae61b7f1f2b315017e79a3de5ab2dc8bb46a59fdb37a09b3b8d0e0e4c1e3b2d3e8f7c6e5d4c3b2a1e0f9e8d7c6b5a4e3f2e1d0c9b8a7a0b1f8e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0a0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0a0d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a08080" ], "balance": "0x0", "codeHash": "0x5e61b0f7919ab4e6fc7cfa6f3f5f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f", "nonce": "0x0", "storageHash": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "storageProof": [ { "key": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "value": "0x1", "proof": [ "0xf90211a090dcaf88c40c7bbc95a912cbdde67c175767b31173df9ee4b0d733bfdd511c43a0babe369f6b12092f49181ae04ca173fb68d1a5456f18d20fa32cba73954052bda0473ecf8a7e36a829e75039a3b055e51b8332cbf03324ab4af2066bbd6fbf0021fa0bbda34753d7aa6c38e603f360244e8f59611921d9e1f128372fec0d586d4f9e0a04e44caecff45c9891f74f6a2156735886eedf6f1a733628ebc802ec79d844648a0a5f3f2f7542148c973977c8a1e154c4300fec92f755f7846f1b734d3ab1d90e7a0e823850f50bf72baae9d1733a36a444ab65d0a6faaba404f0583ce0ca4dad92da0f7a00cbe7d4b30b11faea3ae61b7f1f2b315017e79a3de5ab2dc8bb46a59fdb37a09b3b8d0e0e4c1e3b2d3e8f7c6e5d4c3b2a1e0f9e8d7c6b5a4e3f2e1d0c9b8a7a0b1f8e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0a0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0a0d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a08080" ] } ] } } ``` # eth_getStorageAt Source: https://docs.moralis.com/rpc-nodes/opbnb/eth-get-storage-at Returns the value from a storage position at a given address. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address of the storage **position** `string` *required* Integer of the position in the storage **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x0", "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/opbnb/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x0", "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x00000000000000000000000000000000000000000000000000000000000004d2" } ``` # eth_getTransactionByBlockHashAndIndex Source: https://docs.moralis.com/rpc-nodes/opbnb/eth-get-transaction-by-block-hash-and-index Returns information about a transaction by block hash and transaction index position. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block **index** `string` *required* Integer of the transaction index position #### Example request `params` ```javascript theme={null} [ "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/opbnb/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5daf3b", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "gas": "0xc350", "gasPrice": "0x4a817c800", "hash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "input": "0x68656c6c6f21", "nonce": "0x15", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "transactionIndex": "0x0", "value": "0xf3dbb76162000", "v": "0x25", "r": "0x1b5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5", "s": "0x5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5c5" } } ``` # eth_getTransactionByBlockNumberAndIndex Source: https://docs.moralis.com/rpc-nodes/opbnb/eth-get-transaction-by-block-number-and-index Returns information about a transaction by block number and transaction index position. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* A block number, or the string "earliest", "latest" or "pending" **index** `string` *required* The transaction index position #### Example request `params` ```javascript theme={null} [ "0x5BAE9E", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/opbnb/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["0x5BAE9E", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5BAE9E", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "gas": "0xc350", "gasPrice": "0x4a817c800", "hash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "input": "0x68656c6c6f21", "nonce": "0x15", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "transactionIndex": "0x0", "value": "0xf3dbb76162000", "v": "0x25", "r": "0x1b5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5", "s": "0x5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5c5" } } ``` # eth_getTransactionByHash Source: https://docs.moralis.com/rpc-nodes/opbnb/eth-get-transaction-by-hash Returns the information about a transaction requested by transaction hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a transaction #### Example request `params` ```javascript theme={null} [ "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/opbnb/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5daf3b", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "gas": "0xc350", "gasPrice": "0x4a817c800", "hash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "input": "0x68656c6c6f21", "nonce": "0x15", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "transactionIndex": "0x41", "value": "0xf3dbb76162000", "v": "0x25", "r": "0x1b5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5", "s": "0x5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5c5" } } ``` # eth_getTransactionCount Source: https://docs.moralis.com/rpc-nodes/opbnb/eth-get-transaction-count Returns the number of transactions sent from an address. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address to get transaction count for **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/opbnb/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` # eth_getTransactionReceipt Source: https://docs.moralis.com/rpc-nodes/opbnb/eth-get-transaction-receipt Returns the receipt of a transaction by transaction hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a transaction #### Example request `params` ```javascript theme={null} [ "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/opbnb/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "transactionHash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "transactionIndex": "0x41", "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5daf3b", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "cumulativeGasUsed": "0x33bc", "gasUsed": "0x4dc", "contractAddress": null, "logs": [], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "status": "0x1" } } ``` # eth_getUncleByBlockHashAndIndex Source: https://docs.moralis.com/rpc-nodes/opbnb/eth-get-uncle-by-block-hash-and-index Returns information about an uncle of a block by hash and uncle index position. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block **index** `string` *required* The uncle's index position #### Example request `params` ```javascript theme={null} [ "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/opbnb/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x027f07", "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000", "gasLimit": "0x9f759", "gasUsed": "0x9f759", "hash": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331", "logsBloom": "0x1a060020000015554c000200000003050000200017041014032020801000056020000001000a00d0020204040020012150010010000000280005000c00000000000020c0000000024008104011000080020020000001006100900000024208002000020002100000000000000080000000120080000002003c0000200000000200002010008300300001001031100100040010420000800000000014000004002000000c040200060000000080000000100000000040a2000001000061000042021080400200000410000404080800014008201000c20100500020011000000030001100100024008c80190400402008000020000c0041104218100000000000000002000800000", "miner": "0x4e65fda2159562a496f9f3522f89122a3088497a", "mixHash": "0x99e9d85137db46ef1e85fff042bb15a7b6f46618b7f600b0b4e7fb52fceafc3a", "nonce": "0xfcf4db6d9bce1b8b", "number": "0x1b4", "parentHash": "0xa057c32b6ed8eb5e006cadfad55c7e635549c6e2135c4e6c3a9d5a6a80f72c3", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0x1a7e46b37b26e0c3f67ed4de3b5d3b1ff84a2e0a5e2dcf4d4b0d34b5a22b6e3", "timestamp": "0x55ba467c", "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` # eth_getUncleByBlockNumberAndIndex Source: https://docs.moralis.com/rpc-nodes/opbnb/eth-get-uncle-by-block-number-and-index Returns information about an uncle of a block by number and uncle index position. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* A block number, or the string "earliest", "latest" or "pending" **index** `string` *required* The uncle's index position #### Example request `params` ```javascript theme={null} [ "0x29c", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/opbnb/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["0x29c", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x027f07", "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000", "gasLimit": "0x9f759", "gasUsed": "0x9f759", "hash": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331", "logsBloom": "0x1a060020000015554c000200000003050000200017041014032020801000056020000001000a00d0020204040020012150010010000000280005000c00000000000020c0000000024008104011000080020020000001006100900000024208002000020002100000000000000080000000120080000002003c0000200000000200002010008300300001001031100100040010420000800000000014000004002000000c040200060000000080000000100000000040a2000001000061000042021080400200000410000404080800014008201000c20100500020011000000030001100100024008c80190400402008000020000c0041104218100000000000000002000800000", "miner": "0x4e65fda2159562a496f9f3522f89122a3088497a", "mixHash": "0x99e9d85137db46ef1e85fff042bb15a7b6f46618b7f600b0b4e7fb52fceafc3a", "nonce": "0xfcf4db6d9bce1b8b", "number": "0x29c", "parentHash": "0xa057c32b6ed8eb5e006cadfad55c7e635549c6e2135c4e6c3a9d5a6a80f72c3", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0x1a7e46b37b26e0c3f67ed4de3b5d3b1ff84a2e0a5e2dcf4d4b0d34b5a22b6e3", "timestamp": "0x55ba467c", "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` # eth_getUncleCountByBlockHash Source: https://docs.moralis.com/rpc-nodes/opbnb/eth-get-uncle-count-by-block-hash Returns the number of uncles in a block from a block matching the given block hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block #### Example request `params` ```javascript theme={null} [ "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/opbnb/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` # eth_getUncleCountByBlockNumber Source: https://docs.moralis.com/rpc-nodes/opbnb/eth-get-uncle-count-by-block-number Returns the number of uncles in a block from a block matching the given block number. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" #### Example request `params` ```javascript theme={null} [ "0x5BAE9E" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/opbnb/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["0x5BAE9E"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` # eth_maxPriorityFeePerGas Source: https://docs.moralis.com/rpc-nodes/opbnb/eth-max-priority-fee-per-gas Returns a suggestion for the max priority fee per gas for dynamic fee transactions in wei. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/opbnb/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_maxPriorityFeePerGas", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x59682f00" } ``` # eth_sendRawTransaction Source: https://docs.moralis.com/rpc-nodes/opbnb/eth-send-raw-transaction Submits a pre-signed transaction for broadcast to the network. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **data** `string` *required* The signed transaction data #### Example request `params` ```javascript theme={null} [ "0xf869808504e3b2928082520894f0109fc8df283027b6285cc889f5aa624eac1f55843b9aca008025a0c9cf86333bcb065d140032ecaab5d9281bde80f21b9687b3e94161de42d51895a0727a108a0b8d101465414033c3f705a9c7b826e596766046ee1183dbc8aeaa68" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/opbnb/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["0xf869808504e3b2928082520894f0109fc8df283027b6285cc889f5aa624eac1f55843b9aca008025a0c9cf86333bcb065d140032ecaab5d9281bde80f21b9687b3e94161de42d51895a0727a108a0b8d101465414033c3f705a9c7b826e596766046ee1183dbc8aeaa68"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" } ``` # Overview Source: https://docs.moralis.com/rpc-nodes/opbnb/overview Explore opBNB JSON-RPC methods ## Introduction opBNB is a Layer 2 scaling solution built on BNB Chain, offering fast and affordable transactions while maintaining compatibility with the Ethereum Virtual Machine (EVM). This makes opBNB a great choice for decentralized applications (dApps) that prioritize performance, including DeFi and NFT ecosystems. ## Supported Networks The opBNB RPC API is available for the following network: 1. **opBNB Mainnet** ## Network Details | **Network** | **Chain ID** | **Path Parameter** | | :- | :- | :- | | **opBNB Mainnet** | 0xcc (204) | `opbnb` | ## Supported RPC Methods * [eth\_blockNumber](/rpc-nodes/opbnb/eth-blockNumber) * [eth\_call](/rpc-nodes/opbnb/eth-call) * [eth\_chainId](/rpc-nodes/opbnb/eth-chain-id) * [eth\_createAccessList](/rpc-nodes/opbnb/eth-create-access-list) * [eth\_estimateGas](/rpc-nodes/opbnb/eth-estimate-gas) * [eth\_feeHistory](/rpc-nodes/opbnb/eth-fee-history) * [eth\_gasPrice](/rpc-nodes/opbnb/eth-gas-price) * [eth\_getBalance](/rpc-nodes/opbnb/eth-get-balance) * [eth\_getBlockByHash](/rpc-nodes/opbnb/eth-get-block-by-hash) * [eth\_getBlockByNumber](/rpc-nodes/opbnb/eth-get-block-by-number) * [eth\_getBlockTransactionCountByHash](/rpc-nodes/opbnb/eth-get-block-transaction-count-by-hash) * [eth\_getBlockTransactionCountByNumber](/rpc-nodes/opbnb/eth-get-block-transaction-count-by-number) * [eth\_getBlockReceipts](/rpc-nodes/opbnb/eth-get-block-receipts) * [eth\_getCode](/rpc-nodes/opbnb/eth-get-code) * [eth\_getLogs](/streams/api-reference/history/get-logs) * [eth\_getProof](/rpc-nodes/opbnb/eth-get-proof) * [eth\_getStorageAt](/rpc-nodes/opbnb/eth-get-storage-at) * [eth\_getTransactionByHash](/rpc-nodes/opbnb/eth-get-transaction-by-hash) * [eth\_getTransactionByBlockHashAndIndex](/rpc-nodes/opbnb/eth-get-transaction-by-block-hash-and-index) * [eth\_getTransactionByBlockNumberAndIndex](/rpc-nodes/opbnb/eth-get-transaction-by-block-number-and-index) * [eth\_getTransactionCount](/rpc-nodes/opbnb/eth-get-transaction-count) * [eth\_getTransactionReceipt](/rpc-nodes/opbnb/eth-get-transaction-receipt) * [eth\_getUncleByBlockHashAndIndex](/rpc-nodes/opbnb/eth-get-uncle-by-block-hash-and-index) * [eth\_getUncleByBlockNumberAndIndex](/rpc-nodes/opbnb/eth-get-uncle-by-block-number-and-index) * [eth\_getUncleCountByBlockHash](/rpc-nodes/opbnb/eth-get-uncle-count-by-block-hash) * [eth\_getUncleCountByBlockNumber](/rpc-nodes/opbnb/eth-get-uncle-count-by-block-number) * [eth\_maxPriorityFeePerGas](/rpc-nodes/opbnb/eth-max-priority-fee-per-gas) * [eth\_sendRawTransaction](/rpc-nodes/opbnb/eth-send-raw-transaction) # eth_blockNumber Source: https://docs.moralis.com/rpc-nodes/optimism/eth-blockNumber Returns the number of most recent block. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request body No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/optimism/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x4b7" } ``` # eth_call Source: https://docs.moralis.com/rpc-nodes/optimism/eth-call Executes a new message call immediately without creating a transaction on the blockchain. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **from** `string` The address the transaction is sent from **to** `string` *required* The address the transaction is directed to **gas** `string` Integer of the gas provided for the transaction execution **gasPrice** `string` Integer of the gasPrice used for each paid gas **value** `string` Integer of the value sent with this transaction **data** `string` Hash of the method signature and encoded parameters **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ { "from": "0x0000000000000000000000000000000000000000", "to": "0x0000000000000000000000000000000000000000", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0x" }, "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/optimism/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_call", "params": [{"from": "0xb60e8dd61c5d32be8058bb8eb970870f07233155", "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"}, "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x15536ee" } ``` # eth_chainId Source: https://docs.moralis.com/rpc-nodes/optimism/eth-chain-id Returns the chain ID of the current connected node as described in EIP-695. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request body No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/optimism/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_chainId", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` # eth_createAccessList Source: https://docs.moralis.com/rpc-nodes/optimism/eth-create-access-list Creates an access list that you can include in a transaction. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **from** `string` The address the transaction is sent from **to** `string` The address the transaction is directed to **gas** `string` Integer of the gas provided for the transaction execution **gasPrice** `string` Integer of the gasPrice used for each paid gas **maxPriorityFeePerGas** `string` Maximum fee per gas the sender is willing to pay to miners **maxFeePerGas** `string` Maximum total fee per gas the sender is willing to pay **value** `string` Integer of the value sent with this transaction **data** `string` Hash of the method signature and encoded parameters **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ { "from": "0x8ba1f109551bd432803012645haca66c9834d7c6", "to": "0x6b175474e89094c44da98b954eedeac495271d0f", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0xa9059cbb0000000000000000000000008ba1f109551bd432803012645haca66c9834d7c60000000000000000000000000000000000000000000000000de0b6b3a7640000" }, "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/optimism/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_createAccessList", "params": [{"from": "0x8ba1f109551bd432803012645haca66c9834d7c6", "to": "0x6b175474e89094c44da98b954eedeac495271d0f", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0xa9059cbb0000000000000000000000008ba1f109551bd432803012645haca66c9834d7c60000000000000000000000000000000000000000000000000de0b6b3a7640000"}, "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "accessList": [ { "address": "0x6b175474e89094c44da98b954eedeac495271d0f", "storageKeys": [ "0x0000000000000000000000000000000000000000000000000000000000000000" ] } ], "gasUsed": "0x7671" } } ``` # eth_estimateGas Source: https://docs.moralis.com/rpc-nodes/optimism/eth-estimate-gas Generates and returns an estimate of how much gas is necessary to allow the transaction to complete. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **from** `string` The address the transaction is sent from **to** `string` The address the transaction is directed to **gas** `string` Integer of the gas provided for the transaction execution **gasPrice** `string` Integer of the gasPrice used for each paid gas **value** `string` Integer of the value sent with this transaction **data** `string` Hash of the method signature and encoded parameters **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ { "from": "0x8D97689C9818892B700e27F316cc3E41e17fBeb9", "to": "0xd3CdA913deB6f67967B99D67aCDFa1712C293601", "value": "0x186a0" }, "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/optimism/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_estimateGas", "params": [{"from": "0x8D97689C9818892B700e27F316cc3E41e17fBeb9", "to": "0xd3CdA913deB6f67967B99D67aCDFa1712C293601", "value": "0x186a0"}, "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x5208" } ``` # eth_feeHistory Source: https://docs.moralis.com/rpc-nodes/optimism/eth-fee-history Returns historical gas information for a range of blocks. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockCount** `string` *required* Number of blocks in the requested range **newestBlock** `string` *required* Highest number block of the requested range **rewardPercentiles** `array` Array of percentile values to sample from each block's effective priority fees per gas #### Example request `params` ```javascript theme={null} [ "0x4", "latest", [25, 75] ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/optimism/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_feeHistory", "params": ["0x4", "latest", [25, 75]], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": [ "0x7", "0x7", "0x7", "0x7", "0x7" ], "gasUsedRatio": [ 0.026089875, 0.406803, 0.010817, 0.5 ], "baseFeePerBlobGas": [ "0x3319eb", "0x350c54", "0x364072", "0x364072", "0x32279d" ], "blobGasUsedRatio": [ 0.47619047619047616, 0.2857142857142857, 0, 0.3333333333333333 ], "oldestBlock": "0x11b9231", "reward": [ ["0x4a817c800", "0x4a817c800"], ["0x773593c0", "0x773593c0"], ["0x0", "0x0"], ["0x0", "0x0"] ] } } ``` # eth_gasPrice Source: https://docs.moralis.com/rpc-nodes/optimism/eth-gas-price Returns the current price per gas in wei. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/optimism/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x09184e72a000" } ``` # eth_getBalance Source: https://docs.moralis.com/rpc-nodes/optimism/eth-get-balance Returns the balance of the account of given address. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address to check for balance **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/optimism/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0234c8a3397aab58" } ``` # eth_getBlockByHash Source: https://docs.moralis.com/rpc-nodes/optimism/eth-get-block-by-hash Returns information about a block by hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block **fullTransactionObjects** `boolean` *required* If true it returns the full transaction objects, if false only the hashes of the transactions #### Example request `params` ```javascript theme={null} [ "0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c", false ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/optimism/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c", false], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x3319bb0", "blobGasUsed": "0x120000", "difficulty": "0x0", "excessBlobGas": "0xa576243", "extraData": "0xe29ca82051756173617220287175617361722e77696e2920e29ca8", "gasLimit": "0x3938700", "gasUsed": "0x2965eaa", "hash": "0xc319ec0da50d354ce425b63fb6914a42aafdb9ee9807518edd595809e25fbe38", "logsBloom": "0x7feeeb37793b4fdfff7ab7aefde2d7fdfff9575bfef5bdff3fb97bfef7bcddbbdf9d55e77fdf7ead7b98ffd9bb6fefff7e77b163bf9eeebdddd1ffbf376cfbeb7efffef83ffbe9eb7ff7776ab3dcf8bfee7ebaddfffdf7fe3fffdf6ed3f7dff77cf2fd7efffff7a19ef7ffbbe3e8befdb7fff76b6ed6e7ffceeb99ff7eeb5efebfff3fff7da1fb39f9fff3fd7f3f77b6dd0bed39f5fff3bfa7fbbce7f9f6ec6e0fff50bfe7f9f79efff35ff6d93fecfefbffdaf7b7eff35ec6ff42fe7e6f77f7deff7eff57f6aafa597feebdffff7bbd677e27ffbfadfdf57f7e7d2aeeffffff6676ffa7f3f375eb95eecf9ffa235cbfcdefafbf8feed9dc7b56ff2fdfedfefe", "miner": "0x396343362be2a4da1ce0c1c210945346fb82aa49", "mixHash": "0x07444bb5750f746e200e1dcd8d83221b26576d3357b833cc1e434e7966d0e774", "nonce": "0x0000000000000000", "number": "0x1736791", "parentBeaconBlockRoot": "0x2759f248e2d1cb1a2f5c2657c4efcc623dd8ea7f23e8700162e7fccdacedfd5d", "parentHash": "0xdf0e4dee910167d7b1687a6cb677983ce7ed351ae78ab7e2c5ba39d793c80391", "receiptsRoot": "0x5f1c58e498161509245daad0f60319d9abab7f04d2ca60e99a3674cfdc9b8327", "requestsHash": "0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x1ef1e", "stateRoot": "0x728c7e38107037b573d719e67b6872ee3ca4e01b47818598316cd696bfe24f2c", "timestamp": "0x697b4bcb", "transactions": [ "0xbf7bd0cf98c3b65525f1f7267b1d02e7ccd7cd133b137f46723a91cf187616d5", "0x06ac9281da76d530aa19600e2c34aae7564a78702d3eb52b1fb363985473e296" ], "transactionsRoot": "0xa8c680f6ad8ccc7a49db5ab76cbd9194c88e16dbcfa440104f7787e5ba815c4f", "uncles": [], "withdrawals": [ { "index": "0x6f78bfb", "validatorIndex": "0x955f5", "address": "0x5d3ca1842d0988816434ea51ca420182f3f1e31a", "amount": "0x102d2f1" } ], "withdrawalsRoot": "0x9b7ecf1ba575fc02e4b4c14bd65d5ca95c0e066adaae3fc2ef16f5acd90214d8" } } ``` # eth_getBlockByNumber Source: https://docs.moralis.com/rpc-nodes/optimism/eth-get-block-by-number Returns information about a block by block number. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" **fullTransactionObjects** `boolean` *required* If true it returns the full transaction objects, if false only the hashes of the transactions #### Example request `params` ```javascript theme={null} [ "0x1b4", true ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/optimism/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["0x1b4", true], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x3319bb0", "blobGasUsed": "0x120000", "difficulty": "0x0", "excessBlobGas": "0xa576243", "extraData": "0xe29ca82051756173617220287175617361722e77696e2920e29ca8", "gasLimit": "0x3938700", "gasUsed": "0x2965eaa", "hash": "0xc319ec0da50d354ce425b63fb6914a42aafdb9ee9807518edd595809e25fbe38", "logsBloom": "0x7feeeb37793b4fdfff7ab7aefde2d7fdfff9575bfef5bdff3fb97bfef7bcddbbdf9d55e77fdf7ead7b98ffd9bb6fefff7e77b163bf9eeebdddd1ffbf376cfbeb7efffef83ffbe9eb7ff7776ab3dcf8bfee7ebaddfffdf7fe3fffdf6ed3f7dff77cf2fd7efffff7a19ef7ffbbe3e8befdb7fff76b6ed6e7ffceeb99ff7eeb5efebfff3fff7da1fb39f9fff3fd7f3f77b6dd0bed39f5fff3bfa7fbbce7f9f6ec6e0fff50bfe7f9f79efff35ff6d93fecfefbffdaf7b7eff35ec6ff42fe7e6f77f7deff7eff57f6aafa597feebdffff7bbd677e27ffbfadfdf57f7e7d2aeeffffff6676ffa7f3f375eb95eecf9ffa235cbfcdefafbf8feed9dc7b56ff2fdfedfefe", "miner": "0x396343362be2a4da1ce0c1c210945346fb82aa49", "mixHash": "0x07444bb5750f746e200e1dcd8d83221b26576d3357b833cc1e434e7966d0e774", "nonce": "0x0000000000000000", "number": "0x1736791", "parentBeaconBlockRoot": "0x2759f248e2d1cb1a2f5c2657c4efcc623dd8ea7f23e8700162e7fccdacedfd5d", "parentHash": "0xdf0e4dee910167d7b1687a6cb677983ce7ed351ae78ab7e2c5ba39d793c80391", "receiptsRoot": "0x5f1c58e498161509245daad0f60319d9abab7f04d2ca60e99a3674cfdc9b8327", "requestsHash": "0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x1ef1e", "stateRoot": "0x728c7e38107037b573d719e67b6872ee3ca4e01b47818598316cd696bfe24f2c", "timestamp": "0x697b4bcb", "transactions": [ "0xbf7bd0cf98c3b65525f1f7267b1d02e7ccd7cd133b137f46723a91cf187616d5", "0x06ac9281da76d530aa19600e2c34aae7564a78702d3eb52b1fb363985473e296" ], "transactionsRoot": "0xa8c680f6ad8ccc7a49db5ab76cbd9194c88e16dbcfa440104f7787e5ba815c4f", "uncles": [], "withdrawals": [ { "index": "0x6f78bfb", "validatorIndex": "0x955f5", "address": "0x5d3ca1842d0988816434ea51ca420182f3f1e31a", "amount": "0x102d2f1" } ], "withdrawalsRoot": "0x9b7ecf1ba575fc02e4b4c14bd65d5ca95c0e066adaae3fc2ef16f5acd90214d8" } } ``` # eth_getBlockReceipts Source: https://docs.moralis.com/rpc-nodes/optimism/eth-get-block-receipts Returns all transaction receipts for a given block. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" #### Example request `params` ```javascript theme={null} [ "0xf21d9c" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/optimism/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockReceipts", "params": ["0xf21d9c"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": [ { "blockHash": "0x8243343df08b9751f5ca0c5f8c9c0460d8a9b6351066fae0acbd4d3e776de8bb", "blockNumber": "0xf21d9c", "contractAddress": null, "cumulativeGasUsed": "0x5208", "effectiveGasPrice": "0x1dcd6500", "from": "0x8ba1f109551bd432803012645haca66c9834d7c6", "gasUsed": "0x5208", "logs": [], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "status": "0x1", "to": "0x95cED938F7991cd0dFcb48F0a06a40FA1aF46EBC", "transactionHash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "transactionIndex": "0x0", "type": "0x2" } ] } ``` # eth_getBlockTransactionCountByHash Source: https://docs.moralis.com/rpc-nodes/optimism/eth-get-block-transaction-count-by-hash Returns the number of transactions in a block from a block matching the given block hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block #### Example request `params` ```javascript theme={null} [ "0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/optimism/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` # eth_getBlockTransactionCountByNumber Source: https://docs.moralis.com/rpc-nodes/optimism/eth-get-block-transaction-count-by-number Returns the number of transactions in a block matching the given block number. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" #### Example request `params` ```javascript theme={null} [ "0xe8" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/optimism/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["0xe8"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` # eth_getCode Source: https://docs.moralis.com/rpc-nodes/optimism/eth-get-code Returns code at a given address. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address to get the code from **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x2" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/optimism/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getCode", "params": ["0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x2"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x600160008035811a818181146012578301005b601b6001356025565b8060005260206000f25b600060078202905091905056" } ``` # eth_getLogs Source: https://docs.moralis.com/rpc-nodes/optimism/eth-get-logs Returns an array of all logs matching a given filter object. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **fromBlock** `string` Integer block number, or "latest" for the last mined block or "pending", "earliest" for not yet mined transactions **toBlock** `string` Integer block number, or "latest" for the last mined block or "pending", "earliest" for not yet mined transactions **address** `string` Contract address or a list of addresses from which logs should originate **topics** `array` Array of 32 Bytes DATA topics. Topics are order-dependent **blockhash** `string` Using blockhash is equivalent to fromBlock = toBlock = the block number with hash blockhash #### Example request `params` ```javascript theme={null} [ { "fromBlock": "0x1", "toBlock": "0x2", "address": "0x8888f1f195afa192cfee860698584c030f4c9db1", "topics": [ "0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", null, [ "0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x0000000000000000000000000aff3454fce5edbc8cca8697c15331677e6ebccc" ] ] } ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/optimism/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getLogs", "params": [{"fromBlock": "0x1", "toBlock": "0x2", "address": "0x8888f1f195afa192cfee860698584c030f4c9db1", "topics": ["0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", null, ["0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x0000000000000000000000000aff3454fce5edbc8cca8697c15331677e6ebccc"]]}], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": [ { "logIndex": "0x1", "blockNumber": "0x1b4", "blockHash": "0x8216c5785ac562ff41e2dcfdf5785ac562ff41e2dcfdf829c5a142f1fccd7d", "transactionHash": "0xdf829c5a142f1fccd7d8216c5785ac562ff41e2dcfdf5785ac562ff41e2dcf", "transactionIndex": "0x0", "address": "0x16c5785ac562ff41e2dcfdf829c5a142f1fccd7d", "data": "0x0000000000000000000000000000000000000000000000000000000000000000", "topics": [ "0x59ebeb90bc63057b6515673c3ecf9438e5058bca0f92585014eced636878c9a5" ] } ] } ``` # eth_getProof Source: https://docs.moralis.com/rpc-nodes/optimism/eth-get-proof Returns the account and storage values of the specified account including the Merkle-proof. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address of the account or contract **storageKeys** `array` *required* Array of storage-keys which should be proofed and included **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842", [ "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421" ], "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/optimism/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getProof", "params": ["0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842", ["0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"], "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "address": "0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842", "accountProof": [ "0xf90211a090dcaf88c40c7bbc95a912cbdde67c175767b31173df9ee4b0d733bfdd511c43a0babe369f6b12092f49181ae04ca173fb68d1a5456f18d20fa32cba73954052bda0473ecf8a7e36a829e75039a3b055e51b8332cbf03324ab4af2066bbd6fbf0021fa0bbda34753d7aa6c38e603f360244e8f59611921d9e1f128372fec0d586d4f9e0a04e44caecff45c9891f74f6a2156735886eedf6f1a733628ebc802ec79d844648a0a5f3f2f7542148c973977c8a1e154c4300fec92f755f7846f1b734d3ab1d90e7a0e823850f50bf72baae9d1733a36a444ab65d0a6faaba404f0583ce0ca4dad92da0f7a00cbe7d4b30b11faea3ae61b7f1f2b315017e79a3de5ab2dc8bb46a59fdb37a09b3b8d0e0e4c1e3b2d3e8f7c6e5d4c3b2a1e0f9e8d7c6b5a4e3f2e1d0c9b8a7a0b1f8e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0a0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0a0d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a08080" ], "balance": "0x0", "codeHash": "0x5e61b0f7919ab4e6fc7cfa6f3f5f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f", "nonce": "0x0", "storageHash": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "storageProof": [ { "key": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "value": "0x1", "proof": [ "0xf90211a090dcaf88c40c7bbc95a912cbdde67c175767b31173df9ee4b0d733bfdd511c43a0babe369f6b12092f49181ae04ca173fb68d1a5456f18d20fa32cba73954052bda0473ecf8a7e36a829e75039a3b055e51b8332cbf03324ab4af2066bbd6fbf0021fa0bbda34753d7aa6c38e603f360244e8f59611921d9e1f128372fec0d586d4f9e0a04e44caecff45c9891f74f6a2156735886eedf6f1a733628ebc802ec79d844648a0a5f3f2f7542148c973977c8a1e154c4300fec92f755f7846f1b734d3ab1d90e7a0e823850f50bf72baae9d1733a36a444ab65d0a6faaba404f0583ce0ca4dad92da0f7a00cbe7d4b30b11faea3ae61b7f1f2b315017e79a3de5ab2dc8bb46a59fdb37a09b3b8d0e0e4c1e3b2d3e8f7c6e5d4c3b2a1e0f9e8d7c6b5a4e3f2e1d0c9b8a7a0b1f8e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0a0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0a0d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a08080" ] } ] } } ``` # eth_getStorageAt Source: https://docs.moralis.com/rpc-nodes/optimism/eth-get-storage-at Returns the value from a storage position at a given address. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address of the storage **position** `string` *required* Integer of the position in the storage **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x0", "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/optimism/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x0", "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x00000000000000000000000000000000000000000000000000000000000004d2" } ``` # eth_getTransactionByBlockHashAndIndex Source: https://docs.moralis.com/rpc-nodes/optimism/eth-get-transaction-by-block-hash-and-index Returns information about a transaction by block hash and transaction index position. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block **index** `string` *required* Integer of the transaction index position #### Example request `params` ```javascript theme={null} [ "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/optimism/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5daf3b", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "gas": "0xc350", "gasPrice": "0x4a817c800", "hash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "input": "0x68656c6c6f21", "nonce": "0x15", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "transactionIndex": "0x0", "value": "0xf3dbb76162000", "v": "0x25", "r": "0x1b5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5", "s": "0x5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5c5" } } ``` # eth_getTransactionByBlockNumberAndIndex Source: https://docs.moralis.com/rpc-nodes/optimism/eth-get-transaction-by-block-number-and-index Returns information about a transaction by block number and transaction index position. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* A block number, or the string "earliest", "latest" or "pending" **index** `string` *required* The transaction index position #### Example request `params` ```javascript theme={null} [ "0x5BAE9E", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/optimism/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["0x5BAE9E", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5BAE9E", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "gas": "0xc350", "gasPrice": "0x4a817c800", "hash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "input": "0x68656c6c6f21", "nonce": "0x15", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "transactionIndex": "0x0", "value": "0xf3dbb76162000", "v": "0x25", "r": "0x1b5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5", "s": "0x5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5c5" } } ``` # eth_getTransactionByHash Source: https://docs.moralis.com/rpc-nodes/optimism/eth-get-transaction-by-hash Returns the information about a transaction requested by transaction hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a transaction #### Example request `params` ```javascript theme={null} [ "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/optimism/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5daf3b", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "gas": "0xc350", "gasPrice": "0x4a817c800", "hash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "input": "0x68656c6c6f21", "nonce": "0x15", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "transactionIndex": "0x41", "value": "0xf3dbb76162000", "v": "0x25", "r": "0x1b5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5", "s": "0x5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5c5" } } ``` # eth_getTransactionCount Source: https://docs.moralis.com/rpc-nodes/optimism/eth-get-transaction-count Returns the number of transactions sent from an address. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address to get transaction count for **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/optimism/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` # eth_getTransactionReceipt Source: https://docs.moralis.com/rpc-nodes/optimism/eth-get-transaction-receipt Returns the receipt of a transaction by transaction hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a transaction #### Example request `params` ```javascript theme={null} [ "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/optimism/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "transactionHash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "transactionIndex": "0x41", "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5daf3b", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "cumulativeGasUsed": "0x33bc", "gasUsed": "0x4dc", "contractAddress": null, "logs": [], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "status": "0x1" } } ``` # eth_getUncleByBlockHashAndIndex Source: https://docs.moralis.com/rpc-nodes/optimism/eth-get-uncle-by-block-hash-and-index Returns information about an uncle of a block by hash and uncle index position. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block **index** `string` *required* The uncle's index position #### Example request `params` ```javascript theme={null} [ "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/optimism/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x027f07", "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000", "gasLimit": "0x9f759", "gasUsed": "0x9f759", "hash": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331", "logsBloom": "0x1a060020000015554c000200000003050000200017041014032020801000056020000001000a00d0020204040020012150010010000000280005000c00000000000020c0000000024008104011000080020020000001006100900000024208002000020002100000000000000080000000120080000002003c0000200000000200002010008300300001001031100100040010420000800000000014000004002000000c040200060000000080000000100000000040a2000001000061000042021080400200000410000404080800014008201000c20100500020011000000030001100100024008c80190400402008000020000c0041104218100000000000000002000800000", "miner": "0x4e65fda2159562a496f9f3522f89122a3088497a", "mixHash": "0x99e9d85137db46ef1e85fff042bb15a7b6f46618b7f600b0b4e7fb52fceafc3a", "nonce": "0xfcf4db6d9bce1b8b", "number": "0x1b4", "parentHash": "0xa057c32b6ed8eb5e006cadfad55c7e635549c6e2135c4e6c3a9d5a6a80f72c3", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0x1a7e46b37b26e0c3f67ed4de3b5d3b1ff84a2e0a5e2dcf4d4b0d34b5a22b6e3", "timestamp": "0x55ba467c", "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` # eth_getUncleByBlockNumberAndIndex Source: https://docs.moralis.com/rpc-nodes/optimism/eth-get-uncle-by-block-number-and-index Returns information about an uncle of a block by number and uncle index position. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* A block number, or the string "earliest", "latest" or "pending" **index** `string` *required* The uncle's index position #### Example request `params` ```javascript theme={null} [ "0x29c", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/optimism/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["0x29c", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x027f07", "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000", "gasLimit": "0x9f759", "gasUsed": "0x9f759", "hash": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331", "logsBloom": "0x1a060020000015554c000200000003050000200017041014032020801000056020000001000a00d0020204040020012150010010000000280005000c00000000000020c0000000024008104011000080020020000001006100900000024208002000020002100000000000000080000000120080000002003c0000200000000200002010008300300001001031100100040010420000800000000014000004002000000c040200060000000080000000100000000040a2000001000061000042021080400200000410000404080800014008201000c20100500020011000000030001100100024008c80190400402008000020000c0041104218100000000000000002000800000", "miner": "0x4e65fda2159562a496f9f3522f89122a3088497a", "mixHash": "0x99e9d85137db46ef1e85fff042bb15a7b6f46618b7f600b0b4e7fb52fceafc3a", "nonce": "0xfcf4db6d9bce1b8b", "number": "0x29c", "parentHash": "0xa057c32b6ed8eb5e006cadfad55c7e635549c6e2135c4e6c3a9d5a6a80f72c3", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0x1a7e46b37b26e0c3f67ed4de3b5d3b1ff84a2e0a5e2dcf4d4b0d34b5a22b6e3", "timestamp": "0x55ba467c", "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` # eth_getUncleCountByBlockHash Source: https://docs.moralis.com/rpc-nodes/optimism/eth-get-uncle-count-by-block-hash Returns the number of uncles in a block from a block matching the given block hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block #### Example request `params` ```javascript theme={null} [ "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/optimism/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` # eth_getUncleCountByBlockNumber Source: https://docs.moralis.com/rpc-nodes/optimism/eth-get-uncle-count-by-block-number Returns the number of uncles in a block from a block matching the given block number. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" #### Example request `params` ```javascript theme={null} [ "0x5BAE9E" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/optimism/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["0x5BAE9E"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` # eth_maxPriorityFeePerGas Source: https://docs.moralis.com/rpc-nodes/optimism/eth-max-priority-fee-per-gas Returns a suggestion for the max priority fee per gas for dynamic fee transactions in wei. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/optimism/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_maxPriorityFeePerGas", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x59682f00" } ``` # eth_sendRawTransaction Source: https://docs.moralis.com/rpc-nodes/optimism/eth-send-raw-transaction Submits a pre-signed transaction for broadcast to the network. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **data** `string` *required* The signed transaction data #### Example request `params` ```javascript theme={null} [ "0xf869808504e3b2928082520894f0109fc8df283027b6285cc889f5aa624eac1f55843b9aca008025a0c9cf86333bcb065d140032ecaab5d9281bde80f21b9687b3e94161de42d51895a0727a108a0b8d101465414033c3f705a9c7b826e596766046ee1183dbc8aeaa68" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/optimism/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["0xf869808504e3b2928082520894f0109fc8df283027b6285cc889f5aa624eac1f55843b9aca008025a0c9cf86333bcb065d140032ecaab5d9281bde80f21b9687b3e94161de42d51895a0727a108a0b8d101465414033c3f705a9c7b826e596766046ee1183dbc8aeaa68"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" } ``` # Overview Source: https://docs.moralis.com/rpc-nodes/optimism/overview Explore Optimism JSON-RPC methods ## Introduction Optimism is a Layer 2 scaling solution built on Ethereum that uses optimistic rollups to bundle transactions, providing faster and cheaper transactions while retaining the security of Ethereum. Optimism focuses on scalability, low gas fees, and maintaining compatibility with the Ethereum ecosystem, making it an ideal platform for decentralized applications (dApps), decentralized finance (DeFi), and NFTs. ## Supported Networks The Optimism RPC API is available for the following networks: 1. **Optimism Mainnet** 2. **Optimism Sepolia Testnet** ## Network Details | **Network** | **Chain ID** | **Path Parameter** | | :- | :- | :- | | **Optimism Mainnet** | 0xa (10) | `optimism` | | **Optimism Sepolia** | 0xaa37dc (11155420) | `optimism-sepolia` | ## Supported RPC Methods * [eth\_blockNumber](/rpc-nodes/optimism/eth-blockNumber) * [eth\_call](/rpc-nodes/optimism/eth-call) * [eth\_chainId](/rpc-nodes/optimism/eth-chain-id) * [eth\_createAccessList](/rpc-nodes/optimism/eth-create-access-list) * [eth\_estimateGas](/rpc-nodes/optimism/eth-estimate-gas) * [eth\_feeHistory](/rpc-nodes/optimism/eth-fee-history) * [eth\_gasPrice](/rpc-nodes/optimism/eth-gas-price) * [eth\_getBalance](/rpc-nodes/optimism/eth-get-balance) * [eth\_getBlockByHash](/rpc-nodes/optimism/eth-get-block-by-hash) * [eth\_getBlockByNumber](/rpc-nodes/optimism/eth-get-block-by-number) * [eth\_getBlockTransactionCountByHash](/rpc-nodes/optimism/eth-get-block-transaction-count-by-hash) * [eth\_getBlockTransactionCountByNumber](/rpc-nodes/optimism/eth-get-block-transaction-count-by-number) * [eth\_getBlockReceipts](/rpc-nodes/optimism/eth-get-block-receipts) * [eth\_getCode](/rpc-nodes/optimism/eth-get-code) * [eth\_getLogs](/streams/api-reference/history/get-logs) * [eth\_getProof](/rpc-nodes/optimism/eth-get-proof) * [eth\_getStorageAt](/rpc-nodes/optimism/eth-get-storage-at) * [eth\_getTransactionByHash](/rpc-nodes/optimism/eth-get-transaction-by-hash) * [eth\_getTransactionByBlockHashAndIndex](/rpc-nodes/optimism/eth-get-transaction-by-block-hash-and-index) * [eth\_getTransactionByBlockNumberAndIndex](/rpc-nodes/optimism/eth-get-transaction-by-block-number-and-index) * [eth\_getTransactionCount](/rpc-nodes/optimism/eth-get-transaction-count) * [eth\_getTransactionReceipt](/rpc-nodes/optimism/eth-get-transaction-receipt) * [eth\_getUncleByBlockHashAndIndex](/rpc-nodes/optimism/eth-get-uncle-by-block-hash-and-index) * [eth\_getUncleByBlockNumberAndIndex](/rpc-nodes/optimism/eth-get-uncle-by-block-number-and-index) * [eth\_getUncleCountByBlockHash](/rpc-nodes/optimism/eth-get-uncle-count-by-block-hash) * [eth\_getUncleCountByBlockNumber](/rpc-nodes/optimism/eth-get-uncle-count-by-block-number) * [eth\_maxPriorityFeePerGas](/rpc-nodes/optimism/eth-max-priority-fee-per-gas) * [eth\_sendRawTransaction](/rpc-nodes/optimism/eth-send-raw-transaction) # RPC Nodes Source: https://docs.moralis.com/rpc-nodes/overview Moralis Nodes give you reliable, low-latency access to blockchain networks for reading data and submitting transactions - ideal for powering wallets, dapps, indexers, bots, and custom infrastructure at scale. ## Overview **Moralis RPC Nodes** provide reliable, low-latency access to blockchain networks for reading on-chain data and submitting transactions. Instead of running your own nodes, Moralis handles the infrastructure so you can focus on building your application. *** ## What Are RPC Nodes? RPC (Remote Procedure Call) nodes are your gateway to blockchain networks. They allow you to: * **Read Data** - Query blockchain state, balances, and transactions * **Submit Transactions** - Send signed transactions to the network * **Subscribe to Events** - Listen for new blocks and contract events * **Access Archives** - Query historical blockchain state *** ## Key Features * **High Availability** - 99.9% uptime SLA * **Low Latency** - Optimized for fast response times * **Multi-Chain** - Support for 20+ blockchain networks * **Archive Access** - Full historical data on supported chains * **WebSocket Support** - Real-time subscriptions and event streaming * **Rate Limits** - Generous limits with burst capacity * **Global Distribution** - Edge nodes for reduced latency *** ## Supported Networks Moralis RPC Nodes support major blockchain networks: * **Ethereum** - Mainnet and testnets * **Polygon** - PoS and zkEVM * **BNB Chain** - BSC and opBNB * **Arbitrum** - One and Nova * **Optimism** - Mainnet * **Base** - Mainnet * **Avalanche** - C-Chain * **And more** - Linea, zkSync, Blast, Mantle, and others *** ## Common Use Cases * **Wallets**\ (query balances and submit transactions) * **dApps**\ (interact with smart contracts) * **Indexers**\ (fetch and process blockchain data) * **Trading Bots**\ (monitor mempool and execute trades) * **Analytics**\ (query historical blockchain state) * **Backend Services**\ (reliable blockchain connectivity) *** ## Get Started Choose a network to get started: * [**Ethereum**](/rpc-nodes/ethereum/overview) * [**Polygon**](/rpc-nodes/polygon/overview) * [**BNB Chain**](/rpc-nodes/bsc/overview) * [**Arbitrum**](/rpc-nodes/arbitrum/overview) * [**Optimism**](/rpc-nodes/optimism/overview) * [**Base**](/rpc-nodes/base/overview) * [**Avalanche**](/rpc-nodes/avalanche/overview) # eth_blockNumber Source: https://docs.moralis.com/rpc-nodes/polygon-zkevm/eth-blockNumber Returns the number of most recent block. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request body No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/polygon-zkevm/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x4b7" } ``` # eth_call Source: https://docs.moralis.com/rpc-nodes/polygon-zkevm/eth-call Executes a new message call immediately without creating a transaction on the blockchain. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **from** `string` The address the transaction is sent from **to** `string` *required* The address the transaction is directed to **gas** `string` Integer of the gas provided for the transaction execution **gasPrice** `string` Integer of the gasPrice used for each paid gas **value** `string` Integer of the value sent with this transaction **data** `string` Hash of the method signature and encoded parameters **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ { "from": "0x0000000000000000000000000000000000000000", "to": "0x0000000000000000000000000000000000000000", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0x" }, "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/polygon-zkevm/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_call", "params": [{"from": "0xb60e8dd61c5d32be8058bb8eb970870f07233155", "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"}, "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x15536ee" } ``` # eth_chainId Source: https://docs.moralis.com/rpc-nodes/polygon-zkevm/eth-chain-id Returns the chain ID of the current connected node as described in EIP-695. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request body No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/polygon-zkevm/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_chainId", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` # eth_createAccessList Source: https://docs.moralis.com/rpc-nodes/polygon-zkevm/eth-create-access-list Creates an access list that you can include in a transaction. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **from** `string` The address the transaction is sent from **to** `string` The address the transaction is directed to **gas** `string` Integer of the gas provided for the transaction execution **gasPrice** `string` Integer of the gasPrice used for each paid gas **maxPriorityFeePerGas** `string` Maximum fee per gas the sender is willing to pay to miners **maxFeePerGas** `string` Maximum total fee per gas the sender is willing to pay **value** `string` Integer of the value sent with this transaction **data** `string` Hash of the method signature and encoded parameters **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ { "from": "0x8ba1f109551bd432803012645haca66c9834d7c6", "to": "0x6b175474e89094c44da98b954eedeac495271d0f", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0xa9059cbb0000000000000000000000008ba1f109551bd432803012645haca66c9834d7c60000000000000000000000000000000000000000000000000de0b6b3a7640000" }, "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/polygon-zkevm/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_createAccessList", "params": [{"from": "0x8ba1f109551bd432803012645haca66c9834d7c6", "to": "0x6b175474e89094c44da98b954eedeac495271d0f", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0xa9059cbb0000000000000000000000008ba1f109551bd432803012645haca66c9834d7c60000000000000000000000000000000000000000000000000de0b6b3a7640000"}, "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "accessList": [ { "address": "0x6b175474e89094c44da98b954eedeac495271d0f", "storageKeys": [ "0x0000000000000000000000000000000000000000000000000000000000000000" ] } ], "gasUsed": "0x7671" } } ``` # eth_estimateGas Source: https://docs.moralis.com/rpc-nodes/polygon-zkevm/eth-estimate-gas Generates and returns an estimate of how much gas is necessary to allow the transaction to complete. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **from** `string` The address the transaction is sent from **to** `string` The address the transaction is directed to **gas** `string` Integer of the gas provided for the transaction execution **gasPrice** `string` Integer of the gasPrice used for each paid gas **value** `string` Integer of the value sent with this transaction **data** `string` Hash of the method signature and encoded parameters **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ { "from": "0x8D97689C9818892B700e27F316cc3E41e17fBeb9", "to": "0xd3CdA913deB6f67967B99D67aCDFa1712C293601", "value": "0x186a0" }, "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/polygon-zkevm/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_estimateGas", "params": [{"from": "0x8D97689C9818892B700e27F316cc3E41e17fBeb9", "to": "0xd3CdA913deB6f67967B99D67aCDFa1712C293601", "value": "0x186a0"}, "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x5208" } ``` # eth_feeHistory Source: https://docs.moralis.com/rpc-nodes/polygon-zkevm/eth-fee-history Returns historical gas information for a range of blocks. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockCount** `string` *required* Number of blocks in the requested range **newestBlock** `string` *required* Highest number block of the requested range **rewardPercentiles** `array` Array of percentile values to sample from each block's effective priority fees per gas #### Example request `params` ```javascript theme={null} [ "0x4", "latest", [25, 75] ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/polygon-zkevm/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_feeHistory", "params": ["0x4", "latest", [25, 75]], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": [ "0x7", "0x7", "0x7", "0x7", "0x7" ], "gasUsedRatio": [ 0.026089875, 0.406803, 0.010817, 0.5 ], "baseFeePerBlobGas": [ "0x3319eb", "0x350c54", "0x364072", "0x364072", "0x32279d" ], "blobGasUsedRatio": [ 0.47619047619047616, 0.2857142857142857, 0, 0.3333333333333333 ], "oldestBlock": "0x11b9231", "reward": [ ["0x4a817c800", "0x4a817c800"], ["0x773593c0", "0x773593c0"], ["0x0", "0x0"], ["0x0", "0x0"] ] } } ``` # eth_gasPrice Source: https://docs.moralis.com/rpc-nodes/polygon-zkevm/eth-gas-price Returns the current price per gas in wei. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/polygon-zkevm/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x09184e72a000" } ``` # eth_getBalance Source: https://docs.moralis.com/rpc-nodes/polygon-zkevm/eth-get-balance Returns the balance of the account of given address. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address to check for balance **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/polygon-zkevm/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0234c8a3397aab58" } ``` # eth_getBlockByHash Source: https://docs.moralis.com/rpc-nodes/polygon-zkevm/eth-get-block-by-hash Returns information about a block by hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block **fullTransactionObjects** `boolean` *required* If true it returns the full transaction objects, if false only the hashes of the transactions #### Example request `params` ```javascript theme={null} [ "0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c", false ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/polygon-zkevm/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c", false], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x3319bb0", "blobGasUsed": "0x120000", "difficulty": "0x0", "excessBlobGas": "0xa576243", "extraData": "0xe29ca82051756173617220287175617361722e77696e2920e29ca8", "gasLimit": "0x3938700", "gasUsed": "0x2965eaa", "hash": "0xc319ec0da50d354ce425b63fb6914a42aafdb9ee9807518edd595809e25fbe38", "logsBloom": "0x7feeeb37793b4fdfff7ab7aefde2d7fdfff9575bfef5bdff3fb97bfef7bcddbbdf9d55e77fdf7ead7b98ffd9bb6fefff7e77b163bf9eeebdddd1ffbf376cfbeb7efffef83ffbe9eb7ff7776ab3dcf8bfee7ebaddfffdf7fe3fffdf6ed3f7dff77cf2fd7efffff7a19ef7ffbbe3e8befdb7fff76b6ed6e7ffceeb99ff7eeb5efebfff3fff7da1fb39f9fff3fd7f3f77b6dd0bed39f5fff3bfa7fbbce7f9f6ec6e0fff50bfe7f9f79efff35ff6d93fecfefbffdaf7b7eff35ec6ff42fe7e6f77f7deff7eff57f6aafa597feebdffff7bbd677e27ffbfadfdf57f7e7d2aeeffffff6676ffa7f3f375eb95eecf9ffa235cbfcdefafbf8feed9dc7b56ff2fdfedfefe", "miner": "0x396343362be2a4da1ce0c1c210945346fb82aa49", "mixHash": "0x07444bb5750f746e200e1dcd8d83221b26576d3357b833cc1e434e7966d0e774", "nonce": "0x0000000000000000", "number": "0x1736791", "parentBeaconBlockRoot": "0x2759f248e2d1cb1a2f5c2657c4efcc623dd8ea7f23e8700162e7fccdacedfd5d", "parentHash": "0xdf0e4dee910167d7b1687a6cb677983ce7ed351ae78ab7e2c5ba39d793c80391", "receiptsRoot": "0x5f1c58e498161509245daad0f60319d9abab7f04d2ca60e99a3674cfdc9b8327", "requestsHash": "0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x1ef1e", "stateRoot": "0x728c7e38107037b573d719e67b6872ee3ca4e01b47818598316cd696bfe24f2c", "timestamp": "0x697b4bcb", "transactions": [ "0xbf7bd0cf98c3b65525f1f7267b1d02e7ccd7cd133b137f46723a91cf187616d5", "0x06ac9281da76d530aa19600e2c34aae7564a78702d3eb52b1fb363985473e296" ], "transactionsRoot": "0xa8c680f6ad8ccc7a49db5ab76cbd9194c88e16dbcfa440104f7787e5ba815c4f", "uncles": [], "withdrawals": [ { "index": "0x6f78bfb", "validatorIndex": "0x955f5", "address": "0x5d3ca1842d0988816434ea51ca420182f3f1e31a", "amount": "0x102d2f1" } ], "withdrawalsRoot": "0x9b7ecf1ba575fc02e4b4c14bd65d5ca95c0e066adaae3fc2ef16f5acd90214d8" } } ``` # eth_getBlockByNumber Source: https://docs.moralis.com/rpc-nodes/polygon-zkevm/eth-get-block-by-number Returns information about a block by block number. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" **fullTransactionObjects** `boolean` *required* If true it returns the full transaction objects, if false only the hashes of the transactions #### Example request `params` ```javascript theme={null} [ "0x1b4", true ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/polygon-zkevm/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["0x1b4", true], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x3319bb0", "blobGasUsed": "0x120000", "difficulty": "0x0", "excessBlobGas": "0xa576243", "extraData": "0xe29ca82051756173617220287175617361722e77696e2920e29ca8", "gasLimit": "0x3938700", "gasUsed": "0x2965eaa", "hash": "0xc319ec0da50d354ce425b63fb6914a42aafdb9ee9807518edd595809e25fbe38", "logsBloom": "0x7feeeb37793b4fdfff7ab7aefde2d7fdfff9575bfef5bdff3fb97bfef7bcddbbdf9d55e77fdf7ead7b98ffd9bb6fefff7e77b163bf9eeebdddd1ffbf376cfbeb7efffef83ffbe9eb7ff7776ab3dcf8bfee7ebaddfffdf7fe3fffdf6ed3f7dff77cf2fd7efffff7a19ef7ffbbe3e8befdb7fff76b6ed6e7ffceeb99ff7eeb5efebfff3fff7da1fb39f9fff3fd7f3f77b6dd0bed39f5fff3bfa7fbbce7f9f6ec6e0fff50bfe7f9f79efff35ff6d93fecfefbffdaf7b7eff35ec6ff42fe7e6f77f7deff7eff57f6aafa597feebdffff7bbd677e27ffbfadfdf57f7e7d2aeeffffff6676ffa7f3f375eb95eecf9ffa235cbfcdefafbf8feed9dc7b56ff2fdfedfefe", "miner": "0x396343362be2a4da1ce0c1c210945346fb82aa49", "mixHash": "0x07444bb5750f746e200e1dcd8d83221b26576d3357b833cc1e434e7966d0e774", "nonce": "0x0000000000000000", "number": "0x1736791", "parentBeaconBlockRoot": "0x2759f248e2d1cb1a2f5c2657c4efcc623dd8ea7f23e8700162e7fccdacedfd5d", "parentHash": "0xdf0e4dee910167d7b1687a6cb677983ce7ed351ae78ab7e2c5ba39d793c80391", "receiptsRoot": "0x5f1c58e498161509245daad0f60319d9abab7f04d2ca60e99a3674cfdc9b8327", "requestsHash": "0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x1ef1e", "stateRoot": "0x728c7e38107037b573d719e67b6872ee3ca4e01b47818598316cd696bfe24f2c", "timestamp": "0x697b4bcb", "transactions": [ "0xbf7bd0cf98c3b65525f1f7267b1d02e7ccd7cd133b137f46723a91cf187616d5", "0x06ac9281da76d530aa19600e2c34aae7564a78702d3eb52b1fb363985473e296" ], "transactionsRoot": "0xa8c680f6ad8ccc7a49db5ab76cbd9194c88e16dbcfa440104f7787e5ba815c4f", "uncles": [], "withdrawals": [ { "index": "0x6f78bfb", "validatorIndex": "0x955f5", "address": "0x5d3ca1842d0988816434ea51ca420182f3f1e31a", "amount": "0x102d2f1" } ], "withdrawalsRoot": "0x9b7ecf1ba575fc02e4b4c14bd65d5ca95c0e066adaae3fc2ef16f5acd90214d8" } } ``` # eth_getBlockReceipts Source: https://docs.moralis.com/rpc-nodes/polygon-zkevm/eth-get-block-receipts Returns all transaction receipts for a given block. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" #### Example request `params` ```javascript theme={null} [ "0xf21d9c" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/polygon-zkevm/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockReceipts", "params": ["0xf21d9c"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": [ { "blockHash": "0x8243343df08b9751f5ca0c5f8c9c0460d8a9b6351066fae0acbd4d3e776de8bb", "blockNumber": "0xf21d9c", "contractAddress": null, "cumulativeGasUsed": "0x5208", "effectiveGasPrice": "0x1dcd6500", "from": "0x8ba1f109551bd432803012645haca66c9834d7c6", "gasUsed": "0x5208", "logs": [], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "status": "0x1", "to": "0x95cED938F7991cd0dFcb48F0a06a40FA1aF46EBC", "transactionHash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "transactionIndex": "0x0", "type": "0x2" } ] } ``` # eth_getBlockTransactionCountByHash Source: https://docs.moralis.com/rpc-nodes/polygon-zkevm/eth-get-block-transaction-count-by-hash Returns the number of transactions in a block from a block matching the given block hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block #### Example request `params` ```javascript theme={null} [ "0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/polygon-zkevm/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` # eth_getBlockTransactionCountByNumber Source: https://docs.moralis.com/rpc-nodes/polygon-zkevm/eth-get-block-transaction-count-by-number Returns the number of transactions in a block matching the given block number. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" #### Example request `params` ```javascript theme={null} [ "0xe8" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/polygon-zkevm/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["0xe8"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` # eth_getCode Source: https://docs.moralis.com/rpc-nodes/polygon-zkevm/eth-get-code Returns code at a given address. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address to get the code from **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x2" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/polygon-zkevm/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getCode", "params": ["0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x2"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x600160008035811a818181146012578301005b601b6001356025565b8060005260206000f25b600060078202905091905056" } ``` # eth_getLogs Source: https://docs.moralis.com/rpc-nodes/polygon-zkevm/eth-get-logs Returns an array of all logs matching a given filter object. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **fromBlock** `string` Integer block number, or "latest" for the last mined block or "pending", "earliest" for not yet mined transactions **toBlock** `string` Integer block number, or "latest" for the last mined block or "pending", "earliest" for not yet mined transactions **address** `string` Contract address or a list of addresses from which logs should originate **topics** `array` Array of 32 Bytes DATA topics. Topics are order-dependent **blockhash** `string` Using blockhash is equivalent to fromBlock = toBlock = the block number with hash blockhash #### Example request `params` ```javascript theme={null} [ { "fromBlock": "0x1", "toBlock": "0x2", "address": "0x8888f1f195afa192cfee860698584c030f4c9db1", "topics": [ "0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", null, [ "0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x0000000000000000000000000aff3454fce5edbc8cca8697c15331677e6ebccc" ] ] } ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/polygon-zkevm/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getLogs", "params": [{"fromBlock": "0x1", "toBlock": "0x2", "address": "0x8888f1f195afa192cfee860698584c030f4c9db1", "topics": ["0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", null, ["0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x0000000000000000000000000aff3454fce5edbc8cca8697c15331677e6ebccc"]]}], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": [ { "logIndex": "0x1", "blockNumber": "0x1b4", "blockHash": "0x8216c5785ac562ff41e2dcfdf5785ac562ff41e2dcfdf829c5a142f1fccd7d", "transactionHash": "0xdf829c5a142f1fccd7d8216c5785ac562ff41e2dcfdf5785ac562ff41e2dcf", "transactionIndex": "0x0", "address": "0x16c5785ac562ff41e2dcfdf829c5a142f1fccd7d", "data": "0x0000000000000000000000000000000000000000000000000000000000000000", "topics": [ "0x59ebeb90bc63057b6515673c3ecf9438e5058bca0f92585014eced636878c9a5" ] } ] } ``` # eth_getProof Source: https://docs.moralis.com/rpc-nodes/polygon-zkevm/eth-get-proof Returns the account and storage values of the specified account including the Merkle-proof. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address of the account or contract **storageKeys** `array` *required* Array of storage-keys which should be proofed and included **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842", [ "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421" ], "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/polygon-zkevm/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getProof", "params": ["0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842", ["0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"], "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "address": "0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842", "accountProof": [ "0xf90211a090dcaf88c40c7bbc95a912cbdde67c175767b31173df9ee4b0d733bfdd511c43a0babe369f6b12092f49181ae04ca173fb68d1a5456f18d20fa32cba73954052bda0473ecf8a7e36a829e75039a3b055e51b8332cbf03324ab4af2066bbd6fbf0021fa0bbda34753d7aa6c38e603f360244e8f59611921d9e1f128372fec0d586d4f9e0a04e44caecff45c9891f74f6a2156735886eedf6f1a733628ebc802ec79d844648a0a5f3f2f7542148c973977c8a1e154c4300fec92f755f7846f1b734d3ab1d90e7a0e823850f50bf72baae9d1733a36a444ab65d0a6faaba404f0583ce0ca4dad92da0f7a00cbe7d4b30b11faea3ae61b7f1f2b315017e79a3de5ab2dc8bb46a59fdb37a09b3b8d0e0e4c1e3b2d3e8f7c6e5d4c3b2a1e0f9e8d7c6b5a4e3f2e1d0c9b8a7a0b1f8e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0a0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0a0d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a08080" ], "balance": "0x0", "codeHash": "0x5e61b0f7919ab4e6fc7cfa6f3f5f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f", "nonce": "0x0", "storageHash": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "storageProof": [ { "key": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "value": "0x1", "proof": [ "0xf90211a090dcaf88c40c7bbc95a912cbdde67c175767b31173df9ee4b0d733bfdd511c43a0babe369f6b12092f49181ae04ca173fb68d1a5456f18d20fa32cba73954052bda0473ecf8a7e36a829e75039a3b055e51b8332cbf03324ab4af2066bbd6fbf0021fa0bbda34753d7aa6c38e603f360244e8f59611921d9e1f128372fec0d586d4f9e0a04e44caecff45c9891f74f6a2156735886eedf6f1a733628ebc802ec79d844648a0a5f3f2f7542148c973977c8a1e154c4300fec92f755f7846f1b734d3ab1d90e7a0e823850f50bf72baae9d1733a36a444ab65d0a6faaba404f0583ce0ca4dad92da0f7a00cbe7d4b30b11faea3ae61b7f1f2b315017e79a3de5ab2dc8bb46a59fdb37a09b3b8d0e0e4c1e3b2d3e8f7c6e5d4c3b2a1e0f9e8d7c6b5a4e3f2e1d0c9b8a7a0b1f8e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0a0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0a0d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a08080" ] } ] } } ``` # eth_getStorageAt Source: https://docs.moralis.com/rpc-nodes/polygon-zkevm/eth-get-storage-at Returns the value from a storage position at a given address. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address of the storage **position** `string` *required* Integer of the position in the storage **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x0", "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/polygon-zkevm/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x0", "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x00000000000000000000000000000000000000000000000000000000000004d2" } ``` # eth_getTransactionByBlockHashAndIndex Source: https://docs.moralis.com/rpc-nodes/polygon-zkevm/eth-get-transaction-by-block-hash-and-index Returns information about a transaction by block hash and transaction index position. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block **index** `string` *required* Integer of the transaction index position #### Example request `params` ```javascript theme={null} [ "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/polygon-zkevm/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5daf3b", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "gas": "0xc350", "gasPrice": "0x4a817c800", "hash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "input": "0x68656c6c6f21", "nonce": "0x15", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "transactionIndex": "0x0", "value": "0xf3dbb76162000", "v": "0x25", "r": "0x1b5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5", "s": "0x5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5c5" } } ``` # eth_getTransactionByBlockNumberAndIndex Source: https://docs.moralis.com/rpc-nodes/polygon-zkevm/eth-get-transaction-by-block-number-and-index Returns information about a transaction by block number and transaction index position. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* A block number, or the string "earliest", "latest" or "pending" **index** `string` *required* The transaction index position #### Example request `params` ```javascript theme={null} [ "0x5BAE9E", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/polygon-zkevm/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["0x5BAE9E", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5BAE9E", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "gas": "0xc350", "gasPrice": "0x4a817c800", "hash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "input": "0x68656c6c6f21", "nonce": "0x15", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "transactionIndex": "0x0", "value": "0xf3dbb76162000", "v": "0x25", "r": "0x1b5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5", "s": "0x5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5c5" } } ``` # eth_getTransactionByHash Source: https://docs.moralis.com/rpc-nodes/polygon-zkevm/eth-get-transaction-by-hash Returns the information about a transaction requested by transaction hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a transaction #### Example request `params` ```javascript theme={null} [ "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/polygon-zkevm/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5daf3b", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "gas": "0xc350", "gasPrice": "0x4a817c800", "hash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "input": "0x68656c6c6f21", "nonce": "0x15", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "transactionIndex": "0x41", "value": "0xf3dbb76162000", "v": "0x25", "r": "0x1b5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5", "s": "0x5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5c5" } } ``` # eth_getTransactionCount Source: https://docs.moralis.com/rpc-nodes/polygon-zkevm/eth-get-transaction-count Returns the number of transactions sent from an address. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address to get transaction count for **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/polygon-zkevm/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` # eth_getTransactionReceipt Source: https://docs.moralis.com/rpc-nodes/polygon-zkevm/eth-get-transaction-receipt Returns the receipt of a transaction by transaction hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a transaction #### Example request `params` ```javascript theme={null} [ "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/polygon-zkevm/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "transactionHash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "transactionIndex": "0x41", "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5daf3b", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "cumulativeGasUsed": "0x33bc", "gasUsed": "0x4dc", "contractAddress": null, "logs": [], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "status": "0x1" } } ``` # eth_getUncleByBlockHashAndIndex Source: https://docs.moralis.com/rpc-nodes/polygon-zkevm/eth-get-uncle-by-block-hash-and-index Returns information about an uncle of a block by hash and uncle index position. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block **index** `string` *required* The uncle's index position #### Example request `params` ```javascript theme={null} [ "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/polygon-zkevm/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x027f07", "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000", "gasLimit": "0x9f759", "gasUsed": "0x9f759", "hash": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331", "logsBloom": "0x1a060020000015554c000200000003050000200017041014032020801000056020000001000a00d0020204040020012150010010000000280005000c00000000000020c0000000024008104011000080020020000001006100900000024208002000020002100000000000000080000000120080000002003c0000200000000200002010008300300001001031100100040010420000800000000014000004002000000c040200060000000080000000100000000040a2000001000061000042021080400200000410000404080800014008201000c20100500020011000000030001100100024008c80190400402008000020000c0041104218100000000000000002000800000", "miner": "0x4e65fda2159562a496f9f3522f89122a3088497a", "mixHash": "0x99e9d85137db46ef1e85fff042bb15a7b6f46618b7f600b0b4e7fb52fceafc3a", "nonce": "0xfcf4db6d9bce1b8b", "number": "0x1b4", "parentHash": "0xa057c32b6ed8eb5e006cadfad55c7e635549c6e2135c4e6c3a9d5a6a80f72c3", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0x1a7e46b37b26e0c3f67ed4de3b5d3b1ff84a2e0a5e2dcf4d4b0d34b5a22b6e3", "timestamp": "0x55ba467c", "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` # eth_getUncleByBlockNumberAndIndex Source: https://docs.moralis.com/rpc-nodes/polygon-zkevm/eth-get-uncle-by-block-number-and-index Returns information about an uncle of a block by number and uncle index position. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* A block number, or the string "earliest", "latest" or "pending" **index** `string` *required* The uncle's index position #### Example request `params` ```javascript theme={null} [ "0x29c", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/polygon-zkevm/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["0x29c", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x027f07", "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000", "gasLimit": "0x9f759", "gasUsed": "0x9f759", "hash": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331", "logsBloom": "0x1a060020000015554c000200000003050000200017041014032020801000056020000001000a00d0020204040020012150010010000000280005000c00000000000020c0000000024008104011000080020020000001006100900000024208002000020002100000000000000080000000120080000002003c0000200000000200002010008300300001001031100100040010420000800000000014000004002000000c040200060000000080000000100000000040a2000001000061000042021080400200000410000404080800014008201000c20100500020011000000030001100100024008c80190400402008000020000c0041104218100000000000000002000800000", "miner": "0x4e65fda2159562a496f9f3522f89122a3088497a", "mixHash": "0x99e9d85137db46ef1e85fff042bb15a7b6f46618b7f600b0b4e7fb52fceafc3a", "nonce": "0xfcf4db6d9bce1b8b", "number": "0x29c", "parentHash": "0xa057c32b6ed8eb5e006cadfad55c7e635549c6e2135c4e6c3a9d5a6a80f72c3", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0x1a7e46b37b26e0c3f67ed4de3b5d3b1ff84a2e0a5e2dcf4d4b0d34b5a22b6e3", "timestamp": "0x55ba467c", "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` # eth_getUncleCountByBlockHash Source: https://docs.moralis.com/rpc-nodes/polygon-zkevm/eth-get-uncle-count-by-block-hash Returns the number of uncles in a block from a block matching the given block hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block #### Example request `params` ```javascript theme={null} [ "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/polygon-zkevm/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` # eth_getUncleCountByBlockNumber Source: https://docs.moralis.com/rpc-nodes/polygon-zkevm/eth-get-uncle-count-by-block-number Returns the number of uncles in a block from a block matching the given block number. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" #### Example request `params` ```javascript theme={null} [ "0x5BAE9E" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/polygon-zkevm/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["0x5BAE9E"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` # eth_maxPriorityFeePerGas Source: https://docs.moralis.com/rpc-nodes/polygon-zkevm/eth-max-priority-fee-per-gas Returns a suggestion for the max priority fee per gas for dynamic fee transactions in wei. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/polygon-zkevm/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_maxPriorityFeePerGas", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x59682f00" } ``` # eth_sendRawTransaction Source: https://docs.moralis.com/rpc-nodes/polygon-zkevm/eth-send-raw-transaction Submits a pre-signed transaction for broadcast to the network. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **data** `string` *required* The signed transaction data #### Example request `params` ```javascript theme={null} [ "0xf869808504e3b2928082520894f0109fc8df283027b6285cc889f5aa624eac1f55843b9aca008025a0c9cf86333bcb065d140032ecaab5d9281bde80f21b9687b3e94161de42d51895a0727a108a0b8d101465414033c3f705a9c7b826e596766046ee1183dbc8aeaa68" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/polygon-zkevm/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["0xf869808504e3b2928082520894f0109fc8df283027b6285cc889f5aa624eac1f55843b9aca008025a0c9cf86333bcb065d140032ecaab5d9281bde80f21b9687b3e94161de42d51895a0727a108a0b8d101465414033c3f705a9c7b826e596766046ee1183dbc8aeaa68"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" } ``` # Overview Source: https://docs.moralis.com/rpc-nodes/polygon-zkevm/overview Explore Polygon zkEVM JSON-RPC methods ## Introduction Polygon zkEVM is a Layer 2 scaling solution that combines the security of Ethereum with the scalability of zero-knowledge rollups. zkEVM allows for fast and low-cost transactions while maintaining compatibility with the Ethereum Virtual Machine (EVM), making it easier for developers to deploy their existing Ethereum applications. Polygon zkEVM is ideal for decentralized finance (DeFi), NFTs, and other decentralized applications requiring high throughput. ## Supported Networks The Polygon zkEVM RPC API is available for the following networks: 1. **Polygon zkEVM Mainnet** 2. **Polygon zkEVM Cardona Testnet** ## Network Details | **Network** | **Chain ID** | **Path Parameter** | | :- | :- | :- | | **Polygon zkEVM Mainnet** | 0x44d (1101) | `polygon-zkevm` | | **Polygon zkEVM Cardona Testnet** | 0x98a (2442) | `polygon-zkevm-cardona` | ## Supported RPC Methods * [eth\_blockNumber](/rpc-nodes/polygon-zkevm/eth-blockNumber) * [eth\_call](/rpc-nodes/polygon-zkevm/eth-call) * [eth\_chainId](/rpc-nodes/polygon-zkevm/eth-chain-id) * [eth\_createAccessList](/rpc-nodes/polygon-zkevm/eth-create-access-list) * [eth\_estimateGas](/rpc-nodes/polygon-zkevm/eth-estimate-gas) * [eth\_feeHistory](/rpc-nodes/polygon-zkevm/eth-fee-history) * [eth\_gasPrice](/rpc-nodes/polygon-zkevm/eth-gas-price) * [eth\_getBalance](/rpc-nodes/polygon-zkevm/eth-get-balance) * [eth\_getBlockByHash](/rpc-nodes/polygon-zkevm/eth-get-block-by-hash) * [eth\_getBlockByNumber](/rpc-nodes/polygon-zkevm/eth-get-block-by-number) * [eth\_getBlockTransactionCountByHash](/rpc-nodes/polygon-zkevm/eth-get-block-transaction-count-by-hash) * [eth\_getBlockTransactionCountByNumber](/rpc-nodes/polygon-zkevm/eth-get-block-transaction-count-by-number) * [eth\_getBlockReceipts](/rpc-nodes/polygon-zkevm/eth-get-block-receipts) * [eth\_getCode](/rpc-nodes/polygon-zkevm/eth-get-code) * [eth\_getLogs](/streams/api-reference/history/get-logs) * [eth\_getProof](/rpc-nodes/polygon-zkevm/eth-get-proof) * [eth\_getStorageAt](/rpc-nodes/polygon-zkevm/eth-get-storage-at) * [eth\_getTransactionByHash](/rpc-nodes/polygon-zkevm/eth-get-transaction-by-hash) * [eth\_getTransactionByBlockHashAndIndex](/rpc-nodes/polygon-zkevm/eth-get-transaction-by-block-hash-and-index) * [eth\_getTransactionByBlockNumberAndIndex](/rpc-nodes/polygon-zkevm/eth-get-transaction-by-block-number-and-index) * [eth\_getTransactionCount](/rpc-nodes/polygon-zkevm/eth-get-transaction-count) * [eth\_getTransactionReceipt](/rpc-nodes/polygon-zkevm/eth-get-transaction-receipt) * [eth\_getUncleByBlockHashAndIndex](/rpc-nodes/polygon-zkevm/eth-get-uncle-by-block-hash-and-index) * [eth\_getUncleByBlockNumberAndIndex](/rpc-nodes/polygon-zkevm/eth-get-uncle-by-block-number-and-index) * [eth\_getUncleCountByBlockHash](/rpc-nodes/polygon-zkevm/eth-get-uncle-count-by-block-hash) * [eth\_getUncleCountByBlockNumber](/rpc-nodes/polygon-zkevm/eth-get-uncle-count-by-block-number) * [eth\_maxPriorityFeePerGas](/rpc-nodes/polygon-zkevm/eth-max-priority-fee-per-gas) * [eth\_sendRawTransaction](/rpc-nodes/polygon-zkevm/eth-send-raw-transaction) # eth_blockNumber Source: https://docs.moralis.com/rpc-nodes/polygon/eth-blockNumber Returns the number of most recent block. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request body No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/polygon/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x4b7" } ``` # eth_call Source: https://docs.moralis.com/rpc-nodes/polygon/eth-call Executes a new message call immediately without creating a transaction on the blockchain. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **from** `string` The address the transaction is sent from **to** `string` *required* The address the transaction is directed to **gas** `string` Integer of the gas provided for the transaction execution **gasPrice** `string` Integer of the gasPrice used for each paid gas **value** `string` Integer of the value sent with this transaction **data** `string` Hash of the method signature and encoded parameters **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ { "from": "0x0000000000000000000000000000000000000000", "to": "0x0000000000000000000000000000000000000000", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0x" }, "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/polygon/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_call", "params": [{"from": "0xb60e8dd61c5d32be8058bb8eb970870f07233155", "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"}, "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x15536ee" } ``` # eth_chainId Source: https://docs.moralis.com/rpc-nodes/polygon/eth-chain-id Returns the chain ID of the current connected node as described in EIP-695. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request body No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/polygon/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_chainId", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` # eth_createAccessList Source: https://docs.moralis.com/rpc-nodes/polygon/eth-create-access-list Creates an access list that you can include in a transaction. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **from** `string` The address the transaction is sent from **to** `string` The address the transaction is directed to **gas** `string` Integer of the gas provided for the transaction execution **gasPrice** `string` Integer of the gasPrice used for each paid gas **maxPriorityFeePerGas** `string` Maximum fee per gas the sender is willing to pay to miners **maxFeePerGas** `string` Maximum total fee per gas the sender is willing to pay **value** `string` Integer of the value sent with this transaction **data** `string` Hash of the method signature and encoded parameters **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ { "from": "0x8ba1f109551bd432803012645haca66c9834d7c6", "to": "0x6b175474e89094c44da98b954eedeac495271d0f", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0xa9059cbb0000000000000000000000008ba1f109551bd432803012645haca66c9834d7c60000000000000000000000000000000000000000000000000de0b6b3a7640000" }, "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/polygon/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_createAccessList", "params": [{"from": "0x8ba1f109551bd432803012645haca66c9834d7c6", "to": "0x6b175474e89094c44da98b954eedeac495271d0f", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0xa9059cbb0000000000000000000000008ba1f109551bd432803012645haca66c9834d7c60000000000000000000000000000000000000000000000000de0b6b3a7640000"}, "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "accessList": [ { "address": "0x6b175474e89094c44da98b954eedeac495271d0f", "storageKeys": [ "0x0000000000000000000000000000000000000000000000000000000000000000" ] } ], "gasUsed": "0x7671" } } ``` # eth_estimateGas Source: https://docs.moralis.com/rpc-nodes/polygon/eth-estimate-gas Generates and returns an estimate of how much gas is necessary to allow the transaction to complete. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **from** `string` The address the transaction is sent from **to** `string` The address the transaction is directed to **gas** `string` Integer of the gas provided for the transaction execution **gasPrice** `string` Integer of the gasPrice used for each paid gas **value** `string` Integer of the value sent with this transaction **data** `string` Hash of the method signature and encoded parameters **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ { "from": "0x8D97689C9818892B700e27F316cc3E41e17fBeb9", "to": "0xd3CdA913deB6f67967B99D67aCDFa1712C293601", "value": "0x186a0" }, "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/polygon/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_estimateGas", "params": [{"from": "0x8D97689C9818892B700e27F316cc3E41e17fBeb9", "to": "0xd3CdA913deB6f67967B99D67aCDFa1712C293601", "value": "0x186a0"}, "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x5208" } ``` # eth_feeHistory Source: https://docs.moralis.com/rpc-nodes/polygon/eth-fee-history Returns historical gas information for a range of blocks. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockCount** `string` *required* Number of blocks in the requested range **newestBlock** `string` *required* Highest number block of the requested range **rewardPercentiles** `array` Array of percentile values to sample from each block's effective priority fees per gas #### Example request `params` ```javascript theme={null} [ "0x4", "latest", [25, 75] ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/polygon/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_feeHistory", "params": ["0x4", "latest", [25, 75]], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": [ "0x7", "0x7", "0x7", "0x7", "0x7" ], "gasUsedRatio": [ 0.026089875, 0.406803, 0.010817, 0.5 ], "baseFeePerBlobGas": [ "0x3319eb", "0x350c54", "0x364072", "0x364072", "0x32279d" ], "blobGasUsedRatio": [ 0.47619047619047616, 0.2857142857142857, 0, 0.3333333333333333 ], "oldestBlock": "0x11b9231", "reward": [ ["0x4a817c800", "0x4a817c800"], ["0x773593c0", "0x773593c0"], ["0x0", "0x0"], ["0x0", "0x0"] ] } } ``` # eth_gasPrice Source: https://docs.moralis.com/rpc-nodes/polygon/eth-gas-price Returns the current price per gas in wei. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/polygon/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x09184e72a000" } ``` # eth_getBalance Source: https://docs.moralis.com/rpc-nodes/polygon/eth-get-balance Returns the balance of the account of given address. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address to check for balance **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/polygon/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0234c8a3397aab58" } ``` # eth_getBlockByHash Source: https://docs.moralis.com/rpc-nodes/polygon/eth-get-block-by-hash Returns information about a block by hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block **fullTransactionObjects** `boolean` *required* If true it returns the full transaction objects, if false only the hashes of the transactions #### Example request `params` ```javascript theme={null} [ "0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c", false ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/polygon/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c", false], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x3319bb0", "blobGasUsed": "0x120000", "difficulty": "0x0", "excessBlobGas": "0xa576243", "extraData": "0xe29ca82051756173617220287175617361722e77696e2920e29ca8", "gasLimit": "0x3938700", "gasUsed": "0x2965eaa", "hash": "0xc319ec0da50d354ce425b63fb6914a42aafdb9ee9807518edd595809e25fbe38", "logsBloom": "0x7feeeb37793b4fdfff7ab7aefde2d7fdfff9575bfef5bdff3fb97bfef7bcddbbdf9d55e77fdf7ead7b98ffd9bb6fefff7e77b163bf9eeebdddd1ffbf376cfbeb7efffef83ffbe9eb7ff7776ab3dcf8bfee7ebaddfffdf7fe3fffdf6ed3f7dff77cf2fd7efffff7a19ef7ffbbe3e8befdb7fff76b6ed6e7ffceeb99ff7eeb5efebfff3fff7da1fb39f9fff3fd7f3f77b6dd0bed39f5fff3bfa7fbbce7f9f6ec6e0fff50bfe7f9f79efff35ff6d93fecfefbffdaf7b7eff35ec6ff42fe7e6f77f7deff7eff57f6aafa597feebdffff7bbd677e27ffbfadfdf57f7e7d2aeeffffff6676ffa7f3f375eb95eecf9ffa235cbfcdefafbf8feed9dc7b56ff2fdfedfefe", "miner": "0x396343362be2a4da1ce0c1c210945346fb82aa49", "mixHash": "0x07444bb5750f746e200e1dcd8d83221b26576d3357b833cc1e434e7966d0e774", "nonce": "0x0000000000000000", "number": "0x1736791", "parentBeaconBlockRoot": "0x2759f248e2d1cb1a2f5c2657c4efcc623dd8ea7f23e8700162e7fccdacedfd5d", "parentHash": "0xdf0e4dee910167d7b1687a6cb677983ce7ed351ae78ab7e2c5ba39d793c80391", "receiptsRoot": "0x5f1c58e498161509245daad0f60319d9abab7f04d2ca60e99a3674cfdc9b8327", "requestsHash": "0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x1ef1e", "stateRoot": "0x728c7e38107037b573d719e67b6872ee3ca4e01b47818598316cd696bfe24f2c", "timestamp": "0x697b4bcb", "transactions": [ "0xbf7bd0cf98c3b65525f1f7267b1d02e7ccd7cd133b137f46723a91cf187616d5", "0x06ac9281da76d530aa19600e2c34aae7564a78702d3eb52b1fb363985473e296" ], "transactionsRoot": "0xa8c680f6ad8ccc7a49db5ab76cbd9194c88e16dbcfa440104f7787e5ba815c4f", "uncles": [], "withdrawals": [ { "index": "0x6f78bfb", "validatorIndex": "0x955f5", "address": "0x5d3ca1842d0988816434ea51ca420182f3f1e31a", "amount": "0x102d2f1" } ], "withdrawalsRoot": "0x9b7ecf1ba575fc02e4b4c14bd65d5ca95c0e066adaae3fc2ef16f5acd90214d8" } } ``` # eth_getBlockByNumber Source: https://docs.moralis.com/rpc-nodes/polygon/eth-get-block-by-number Returns information about a block by block number. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" **fullTransactionObjects** `boolean` *required* If true it returns the full transaction objects, if false only the hashes of the transactions #### Example request `params` ```javascript theme={null} [ "0x1b4", true ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/polygon/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["0x1b4", true], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x3319bb0", "blobGasUsed": "0x120000", "difficulty": "0x0", "excessBlobGas": "0xa576243", "extraData": "0xe29ca82051756173617220287175617361722e77696e2920e29ca8", "gasLimit": "0x3938700", "gasUsed": "0x2965eaa", "hash": "0xc319ec0da50d354ce425b63fb6914a42aafdb9ee9807518edd595809e25fbe38", "logsBloom": "0x7feeeb37793b4fdfff7ab7aefde2d7fdfff9575bfef5bdff3fb97bfef7bcddbbdf9d55e77fdf7ead7b98ffd9bb6fefff7e77b163bf9eeebdddd1ffbf376cfbeb7efffef83ffbe9eb7ff7776ab3dcf8bfee7ebaddfffdf7fe3fffdf6ed3f7dff77cf2fd7efffff7a19ef7ffbbe3e8befdb7fff76b6ed6e7ffceeb99ff7eeb5efebfff3fff7da1fb39f9fff3fd7f3f77b6dd0bed39f5fff3bfa7fbbce7f9f6ec6e0fff50bfe7f9f79efff35ff6d93fecfefbffdaf7b7eff35ec6ff42fe7e6f77f7deff7eff57f6aafa597feebdffff7bbd677e27ffbfadfdf57f7e7d2aeeffffff6676ffa7f3f375eb95eecf9ffa235cbfcdefafbf8feed9dc7b56ff2fdfedfefe", "miner": "0x396343362be2a4da1ce0c1c210945346fb82aa49", "mixHash": "0x07444bb5750f746e200e1dcd8d83221b26576d3357b833cc1e434e7966d0e774", "nonce": "0x0000000000000000", "number": "0x1736791", "parentBeaconBlockRoot": "0x2759f248e2d1cb1a2f5c2657c4efcc623dd8ea7f23e8700162e7fccdacedfd5d", "parentHash": "0xdf0e4dee910167d7b1687a6cb677983ce7ed351ae78ab7e2c5ba39d793c80391", "receiptsRoot": "0x5f1c58e498161509245daad0f60319d9abab7f04d2ca60e99a3674cfdc9b8327", "requestsHash": "0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x1ef1e", "stateRoot": "0x728c7e38107037b573d719e67b6872ee3ca4e01b47818598316cd696bfe24f2c", "timestamp": "0x697b4bcb", "transactions": [ "0xbf7bd0cf98c3b65525f1f7267b1d02e7ccd7cd133b137f46723a91cf187616d5", "0x06ac9281da76d530aa19600e2c34aae7564a78702d3eb52b1fb363985473e296" ], "transactionsRoot": "0xa8c680f6ad8ccc7a49db5ab76cbd9194c88e16dbcfa440104f7787e5ba815c4f", "uncles": [], "withdrawals": [ { "index": "0x6f78bfb", "validatorIndex": "0x955f5", "address": "0x5d3ca1842d0988816434ea51ca420182f3f1e31a", "amount": "0x102d2f1" } ], "withdrawalsRoot": "0x9b7ecf1ba575fc02e4b4c14bd65d5ca95c0e066adaae3fc2ef16f5acd90214d8" } } ``` # eth_getBlockReceipts Source: https://docs.moralis.com/rpc-nodes/polygon/eth-get-block-receipts Returns all transaction receipts for a given block. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" #### Example request `params` ```javascript theme={null} [ "0xf21d9c" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/polygon/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockReceipts", "params": ["0xf21d9c"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": [ { "blockHash": "0x8243343df08b9751f5ca0c5f8c9c0460d8a9b6351066fae0acbd4d3e776de8bb", "blockNumber": "0xf21d9c", "contractAddress": null, "cumulativeGasUsed": "0x5208", "effectiveGasPrice": "0x1dcd6500", "from": "0x8ba1f109551bd432803012645haca66c9834d7c6", "gasUsed": "0x5208", "logs": [], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "status": "0x1", "to": "0x95cED938F7991cd0dFcb48F0a06a40FA1aF46EBC", "transactionHash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "transactionIndex": "0x0", "type": "0x2" } ] } ``` # eth_getBlockTransactionCountByHash Source: https://docs.moralis.com/rpc-nodes/polygon/eth-get-block-transaction-count-by-hash Returns the number of transactions in a block from a block matching the given block hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block #### Example request `params` ```javascript theme={null} [ "0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/polygon/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` # eth_getBlockTransactionCountByNumber Source: https://docs.moralis.com/rpc-nodes/polygon/eth-get-block-transaction-count-by-number Returns the number of transactions in a block matching the given block number. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" #### Example request `params` ```javascript theme={null} [ "0xe8" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/polygon/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["0xe8"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` # eth_getCode Source: https://docs.moralis.com/rpc-nodes/polygon/eth-get-code Returns code at a given address. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address to get the code from **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x2" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/polygon/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getCode", "params": ["0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x2"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x600160008035811a818181146012578301005b601b6001356025565b8060005260206000f25b600060078202905091905056" } ``` # eth_getLogs Source: https://docs.moralis.com/rpc-nodes/polygon/eth-get-logs Returns an array of all logs matching a given filter object. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **fromBlock** `string` Integer block number, or "latest" for the last mined block or "pending", "earliest" for not yet mined transactions **toBlock** `string` Integer block number, or "latest" for the last mined block or "pending", "earliest" for not yet mined transactions **address** `string` Contract address or a list of addresses from which logs should originate **topics** `array` Array of 32 Bytes DATA topics. Topics are order-dependent **blockhash** `string` Using blockhash is equivalent to fromBlock = toBlock = the block number with hash blockhash #### Example request `params` ```javascript theme={null} [ { "fromBlock": "0x1", "toBlock": "0x2", "address": "0x8888f1f195afa192cfee860698584c030f4c9db1", "topics": [ "0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", null, [ "0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x0000000000000000000000000aff3454fce5edbc8cca8697c15331677e6ebccc" ] ] } ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/polygon/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getLogs", "params": [{"fromBlock": "0x1", "toBlock": "0x2", "address": "0x8888f1f195afa192cfee860698584c030f4c9db1", "topics": ["0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", null, ["0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x0000000000000000000000000aff3454fce5edbc8cca8697c15331677e6ebccc"]]}], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": [ { "logIndex": "0x1", "blockNumber": "0x1b4", "blockHash": "0x8216c5785ac562ff41e2dcfdf5785ac562ff41e2dcfdf829c5a142f1fccd7d", "transactionHash": "0xdf829c5a142f1fccd7d8216c5785ac562ff41e2dcfdf5785ac562ff41e2dcf", "transactionIndex": "0x0", "address": "0x16c5785ac562ff41e2dcfdf829c5a142f1fccd7d", "data": "0x0000000000000000000000000000000000000000000000000000000000000000", "topics": [ "0x59ebeb90bc63057b6515673c3ecf9438e5058bca0f92585014eced636878c9a5" ] } ] } ``` # eth_getProof Source: https://docs.moralis.com/rpc-nodes/polygon/eth-get-proof Returns the account and storage values of the specified account including the Merkle-proof. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address of the account or contract **storageKeys** `array` *required* Array of storage-keys which should be proofed and included **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842", [ "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421" ], "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/polygon/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getProof", "params": ["0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842", ["0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"], "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "address": "0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842", "accountProof": [ "0xf90211a090dcaf88c40c7bbc95a912cbdde67c175767b31173df9ee4b0d733bfdd511c43a0babe369f6b12092f49181ae04ca173fb68d1a5456f18d20fa32cba73954052bda0473ecf8a7e36a829e75039a3b055e51b8332cbf03324ab4af2066bbd6fbf0021fa0bbda34753d7aa6c38e603f360244e8f59611921d9e1f128372fec0d586d4f9e0a04e44caecff45c9891f74f6a2156735886eedf6f1a733628ebc802ec79d844648a0a5f3f2f7542148c973977c8a1e154c4300fec92f755f7846f1b734d3ab1d90e7a0e823850f50bf72baae9d1733a36a444ab65d0a6faaba404f0583ce0ca4dad92da0f7a00cbe7d4b30b11faea3ae61b7f1f2b315017e79a3de5ab2dc8bb46a59fdb37a09b3b8d0e0e4c1e3b2d3e8f7c6e5d4c3b2a1e0f9e8d7c6b5a4e3f2e1d0c9b8a7a0b1f8e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0a0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0a0d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a08080" ], "balance": "0x0", "codeHash": "0x5e61b0f7919ab4e6fc7cfa6f3f5f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f", "nonce": "0x0", "storageHash": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "storageProof": [ { "key": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "value": "0x1", "proof": [ "0xf90211a090dcaf88c40c7bbc95a912cbdde67c175767b31173df9ee4b0d733bfdd511c43a0babe369f6b12092f49181ae04ca173fb68d1a5456f18d20fa32cba73954052bda0473ecf8a7e36a829e75039a3b055e51b8332cbf03324ab4af2066bbd6fbf0021fa0bbda34753d7aa6c38e603f360244e8f59611921d9e1f128372fec0d586d4f9e0a04e44caecff45c9891f74f6a2156735886eedf6f1a733628ebc802ec79d844648a0a5f3f2f7542148c973977c8a1e154c4300fec92f755f7846f1b734d3ab1d90e7a0e823850f50bf72baae9d1733a36a444ab65d0a6faaba404f0583ce0ca4dad92da0f7a00cbe7d4b30b11faea3ae61b7f1f2b315017e79a3de5ab2dc8bb46a59fdb37a09b3b8d0e0e4c1e3b2d3e8f7c6e5d4c3b2a1e0f9e8d7c6b5a4e3f2e1d0c9b8a7a0b1f8e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0a0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0a0d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a08080" ] } ] } } ``` # eth_getStorageAt Source: https://docs.moralis.com/rpc-nodes/polygon/eth-get-storage-at Returns the value from a storage position at a given address. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address of the storage **position** `string` *required* Integer of the position in the storage **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x0", "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/polygon/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x0", "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x00000000000000000000000000000000000000000000000000000000000004d2" } ``` # eth_getTransactionByBlockHashAndIndex Source: https://docs.moralis.com/rpc-nodes/polygon/eth-get-transaction-by-block-hash-and-index Returns information about a transaction by block hash and transaction index position. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block **index** `string` *required* Integer of the transaction index position #### Example request `params` ```javascript theme={null} [ "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/polygon/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5daf3b", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "gas": "0xc350", "gasPrice": "0x4a817c800", "hash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "input": "0x68656c6c6f21", "nonce": "0x15", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "transactionIndex": "0x0", "value": "0xf3dbb76162000", "v": "0x25", "r": "0x1b5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5", "s": "0x5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5c5" } } ``` # eth_getTransactionByBlockNumberAndIndex Source: https://docs.moralis.com/rpc-nodes/polygon/eth-get-transaction-by-block-number-and-index Returns information about a transaction by block number and transaction index position. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* A block number, or the string "earliest", "latest" or "pending" **index** `string` *required* The transaction index position #### Example request `params` ```javascript theme={null} [ "0x5BAE9E", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/polygon/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["0x5BAE9E", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5BAE9E", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "gas": "0xc350", "gasPrice": "0x4a817c800", "hash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "input": "0x68656c6c6f21", "nonce": "0x15", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "transactionIndex": "0x0", "value": "0xf3dbb76162000", "v": "0x25", "r": "0x1b5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5", "s": "0x5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5c5" } } ``` # eth_getTransactionByHash Source: https://docs.moralis.com/rpc-nodes/polygon/eth-get-transaction-by-hash Returns the information about a transaction requested by transaction hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a transaction #### Example request `params` ```javascript theme={null} [ "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/polygon/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5daf3b", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "gas": "0xc350", "gasPrice": "0x4a817c800", "hash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "input": "0x68656c6c6f21", "nonce": "0x15", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "transactionIndex": "0x41", "value": "0xf3dbb76162000", "v": "0x25", "r": "0x1b5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5", "s": "0x5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5c5" } } ``` # eth_getTransactionCount Source: https://docs.moralis.com/rpc-nodes/polygon/eth-get-transaction-count Returns the number of transactions sent from an address. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address to get transaction count for **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/polygon/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` # eth_getTransactionReceipt Source: https://docs.moralis.com/rpc-nodes/polygon/eth-get-transaction-receipt Returns the receipt of a transaction by transaction hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a transaction #### Example request `params` ```javascript theme={null} [ "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/polygon/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "transactionHash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "transactionIndex": "0x41", "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5daf3b", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "cumulativeGasUsed": "0x33bc", "gasUsed": "0x4dc", "contractAddress": null, "logs": [], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "status": "0x1" } } ``` # eth_getUncleByBlockHashAndIndex Source: https://docs.moralis.com/rpc-nodes/polygon/eth-get-uncle-by-block-hash-and-index Returns information about an uncle of a block by hash and uncle index position. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block **index** `string` *required* The uncle's index position #### Example request `params` ```javascript theme={null} [ "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/polygon/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x027f07", "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000", "gasLimit": "0x9f759", "gasUsed": "0x9f759", "hash": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331", "logsBloom": "0x1a060020000015554c000200000003050000200017041014032020801000056020000001000a00d0020204040020012150010010000000280005000c00000000000020c0000000024008104011000080020020000001006100900000024208002000020002100000000000000080000000120080000002003c0000200000000200002010008300300001001031100100040010420000800000000014000004002000000c040200060000000080000000100000000040a2000001000061000042021080400200000410000404080800014008201000c20100500020011000000030001100100024008c80190400402008000020000c0041104218100000000000000002000800000", "miner": "0x4e65fda2159562a496f9f3522f89122a3088497a", "mixHash": "0x99e9d85137db46ef1e85fff042bb15a7b6f46618b7f600b0b4e7fb52fceafc3a", "nonce": "0xfcf4db6d9bce1b8b", "number": "0x1b4", "parentHash": "0xa057c32b6ed8eb5e006cadfad55c7e635549c6e2135c4e6c3a9d5a6a80f72c3", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0x1a7e46b37b26e0c3f67ed4de3b5d3b1ff84a2e0a5e2dcf4d4b0d34b5a22b6e3", "timestamp": "0x55ba467c", "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` # eth_getUncleByBlockNumberAndIndex Source: https://docs.moralis.com/rpc-nodes/polygon/eth-get-uncle-by-block-number-and-index Returns information about an uncle of a block by number and uncle index position. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* A block number, or the string "earliest", "latest" or "pending" **index** `string` *required* The uncle's index position #### Example request `params` ```javascript theme={null} [ "0x29c", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/polygon/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["0x29c", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x027f07", "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000", "gasLimit": "0x9f759", "gasUsed": "0x9f759", "hash": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331", "logsBloom": "0x1a060020000015554c000200000003050000200017041014032020801000056020000001000a00d0020204040020012150010010000000280005000c00000000000020c0000000024008104011000080020020000001006100900000024208002000020002100000000000000080000000120080000002003c0000200000000200002010008300300001001031100100040010420000800000000014000004002000000c040200060000000080000000100000000040a2000001000061000042021080400200000410000404080800014008201000c20100500020011000000030001100100024008c80190400402008000020000c0041104218100000000000000002000800000", "miner": "0x4e65fda2159562a496f9f3522f89122a3088497a", "mixHash": "0x99e9d85137db46ef1e85fff042bb15a7b6f46618b7f600b0b4e7fb52fceafc3a", "nonce": "0xfcf4db6d9bce1b8b", "number": "0x29c", "parentHash": "0xa057c32b6ed8eb5e006cadfad55c7e635549c6e2135c4e6c3a9d5a6a80f72c3", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0x1a7e46b37b26e0c3f67ed4de3b5d3b1ff84a2e0a5e2dcf4d4b0d34b5a22b6e3", "timestamp": "0x55ba467c", "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` # eth_getUncleCountByBlockHash Source: https://docs.moralis.com/rpc-nodes/polygon/eth-get-uncle-count-by-block-hash Returns the number of uncles in a block from a block matching the given block hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block #### Example request `params` ```javascript theme={null} [ "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/polygon/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` # eth_getUncleCountByBlockNumber Source: https://docs.moralis.com/rpc-nodes/polygon/eth-get-uncle-count-by-block-number Returns the number of uncles in a block from a block matching the given block number. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" #### Example request `params` ```javascript theme={null} [ "0x5BAE9E" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/polygon/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["0x5BAE9E"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` # eth_maxPriorityFeePerGas Source: https://docs.moralis.com/rpc-nodes/polygon/eth-max-priority-fee-per-gas Returns a suggestion for the max priority fee per gas for dynamic fee transactions in wei. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/polygon/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_maxPriorityFeePerGas", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x59682f00" } ``` # eth_sendRawTransaction Source: https://docs.moralis.com/rpc-nodes/polygon/eth-send-raw-transaction Submits a pre-signed transaction for broadcast to the network. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **data** `string` *required* The signed transaction data #### Example request `params` ```javascript theme={null} [ "0xf869808504e3b2928082520894f0109fc8df283027b6285cc889f5aa624eac1f55843b9aca008025a0c9cf86333bcb065d140032ecaab5d9281bde80f21b9687b3e94161de42d51895a0727a108a0b8d101465414033c3f705a9c7b826e596766046ee1183dbc8aeaa68" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/polygon/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["0xf869808504e3b2928082520894f0109fc8df283027b6285cc889f5aa624eac1f55843b9aca008025a0c9cf86333bcb065d140032ecaab5d9281bde80f21b9687b3e94161de42d51895a0727a108a0b8d101465414033c3f705a9c7b826e596766046ee1183dbc8aeaa68"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" } ``` # Overview Source: https://docs.moralis.com/rpc-nodes/polygon/overview Explore Polygon JSON-RPC methods ## Introduction Polygon (formerly Matic Network) is a protocol and a framework for building and connecting Ethereum-compatible blockchain networks. It offers a highly scalable, low-cost platform for decentralized applications (dApps) without sacrificing security. Polygon is known for its fast finality and low transaction fees, making it ideal for various use cases, including DeFi, NFTs, and gaming. ## Supported Networks The Polygon RPC API is available for the following networks: 1. **Polygon Mainnet** 2. **Polygon Amoy Testnet** ## Network Details | **Network** | **Chain ID** | **Path Parameter** | | :- | :- | :- | | **Polygon Mainnet** | 0x89 (137) | `polygon` | | **Polygon Amoy** | 0x13882 (80002) | `amoy` | ## Supported RPC Methods * [eth\_blockNumber](/rpc-nodes/polygon/eth-blockNumber) * [eth\_call](/rpc-nodes/polygon/eth-call) * [eth\_chainId](/rpc-nodes/polygon/eth-chain-id) * [eth\_createAccessList](/rpc-nodes/polygon/eth-create-access-list) * [eth\_estimateGas](/rpc-nodes/polygon/eth-estimate-gas) * [eth\_feeHistory](/rpc-nodes/polygon/eth-fee-history) * [eth\_gasPrice](/rpc-nodes/polygon/eth-gas-price) * [eth\_getBalance](/rpc-nodes/polygon/eth-get-balance) * [eth\_getBlockByHash](/rpc-nodes/polygon/eth-get-block-by-hash) * [eth\_getBlockByNumber](/rpc-nodes/polygon/eth-get-block-by-number) * [eth\_getBlockTransactionCountByHash](/rpc-nodes/polygon/eth-get-block-transaction-count-by-hash) * [eth\_getBlockTransactionCountByNumber](/rpc-nodes/polygon/eth-get-block-transaction-count-by-number) * [eth\_getBlockReceipts](/rpc-nodes/polygon/eth-get-block-receipts) * [eth\_getCode](/rpc-nodes/polygon/eth-get-code) * [eth\_getLogs](/streams/api-reference/history/get-logs) * [eth\_getProof](/rpc-nodes/polygon/eth-get-proof) * [eth\_getStorageAt](/rpc-nodes/polygon/eth-get-storage-at) * [eth\_getTransactionByHash](/rpc-nodes/polygon/eth-get-transaction-by-hash) * [eth\_getTransactionByBlockHashAndIndex](/rpc-nodes/polygon/eth-get-transaction-by-block-hash-and-index) * [eth\_getTransactionByBlockNumberAndIndex](/rpc-nodes/polygon/eth-get-transaction-by-block-number-and-index) * [eth\_getTransactionCount](/rpc-nodes/polygon/eth-get-transaction-count) * [eth\_getTransactionReceipt](/rpc-nodes/polygon/eth-get-transaction-receipt) * [eth\_getUncleByBlockHashAndIndex](/rpc-nodes/polygon/eth-get-uncle-by-block-hash-and-index) * [eth\_getUncleByBlockNumberAndIndex](/rpc-nodes/polygon/eth-get-uncle-by-block-number-and-index) * [eth\_getUncleCountByBlockHash](/rpc-nodes/polygon/eth-get-uncle-count-by-block-hash) * [eth\_getUncleCountByBlockNumber](/rpc-nodes/polygon/eth-get-uncle-count-by-block-number) * [eth\_maxPriorityFeePerGas](/rpc-nodes/polygon/eth-max-priority-fee-per-gas) * [eth\_sendRawTransaction](/rpc-nodes/polygon/eth-send-raw-transaction) # Pricing Source: https://docs.moralis.com/rpc-nodes/pricing Understand compute unit costs, rate limits, and plan tiers for Moralis RPC Nodes. All [Moralis plans](https://moralis.com/pricing) include generous monthly limits on the number of requests you can make. Some requests are more computationally expensive than others, so heavier requests are assigned higher **Compute Unit (CU) weights**. ## What is a Compute Unit (CU)? A **Compute Unit** is a measure of computational load assigned to each RPC request. Each method has a **CU Weight** that is deducted from your total available CUs. Archive requests (queries to historical data) often have a higher **Archive CU Weight**. ## Plan Tiers | Plan | Price | CUs Included | API Throughput | Node Throughput | RPC Nodes | | - | - | - | - | - | - | | Starter | \$149/mo | 2,000,000/mo | 40 reqs/s | 100 CU/s | 5 | | Pro | \$249/mo | 100,000,000/mo | 80 reqs/s | 100 CU/s | 20 | | Business | \$749/mo | 500,000,000/mo | 200 reqs/s | 300 CU/s | Unlimited | | Enterprise | Custom | Custom | Custom | Unlimited | Unlimited | All plans include full archive data. Prices shown are for monthly billing. Annual billing is also available - see the [pricing page](https://moralis.com/pricing) for current rates. **API Throughput** is shared across all Moralis products and is measured in requests per second, evaluated over a rolling 4-second window. See [Rate Limits](/data-api/resources/rate-limits) for details. **Node Throughput** is a separate per-node cap, measured in Compute Units per second on each individual RPC node. [View all plans](https://moralis.com/pricing) ## Free Trial Moralis doesn't have a self-serve free plan. To try it before you subscribe, request a free trial and the team will reach out. Request a free trial ## Standard RPC Method Costs | RPC Method | CU Weight | Archive CU Weight | | - | - | - | | `eth_blockNumber` | 3 | 3 | | `eth_call` | 3 | 12 | | `eth_chainId` | 3 | 3 | | `eth_createAccessList` | 3 | 3 | | `eth_estimateGas` | 5 | 5 | | `eth_feeHistory` | 3 | 3 | | `eth_gasPrice` | 3 | 3 | | `eth_getBalance` | 3 | 12 | | `eth_getBlockByHash` | 12 | 12 | | `eth_getBlockByNumber` | 3 | 12 | | `eth_getBlockTransactionCountByHash` | 12 | 12 | | `eth_getBlockTransactionCountByNumber` | 3 | 12 | | `eth_getBlockReceipts` | 3 | 12 | | `eth_getCode` | 3 | 12 | | `eth_getLogs` | 12 | 12 | | `eth_getProof` | 3 | 12 | | `eth_getStorageAt` | 3 | 12 | | `eth_getTransactionByHash` | 12 | 12 | | `eth_getTransactionByBlockHashAndIndex` | 12 | 12 | | `eth_getTransactionByBlockNumberAndIndex` | 3 | 12 | | `eth_getTransactionCount` | 2 | 8 | | `eth_getTransactionReceipt` | 8 | 8 | | `eth_getUncleByBlockHashAndIndex` | 8 | 8 | | `eth_getUncleByBlockNumberAndIndex` | 2 | 8 | | `eth_getUncleCountByBlockHash` | 8 | 8 | | `eth_getUncleCountByBlockNumber` | 2 | 8 | | `eth_maxPriorityFeePerGas` | 2 | 2 | | `eth_sendRawTransaction` | 3 | 3 | ## Extended RPC Method Costs Moralis provides extended RPC methods that offer advanced data retrieval. These are more computationally intensive and have higher CU weights. | Method | Description | CU Weight | | - | - | - | | `eth_getTransactions` | Get native transactions by wallet address | 15 | | `eth_getDecodedTransactions` | Get decoded wallet history | 30 | | `eth_getTokenBalances` | Get ERC20 token balances by wallet | 25 | | `eth_getTokenPrice` | Get ERC20 token price by token address | 25 | | `eth_getTokenMetadata` | Get ERC20 token metadata by token address | 8 | | `eth_getNFTBalances` | Get NFTs by wallet address | 20 | | `eth_getNFTCollections` | Get NFT collections by wallet address | 20 | ## Archive Nodes Archive nodes store historical blockchain data beyond the most recent blocks. Because of the additional computational and storage resources required, querying archive nodes comes with a higher CU cost. If your use case involves accessing deep historical data, be mindful of the increased cost shown in the **Archive CU Weight** column above. ## Optimizing CU Usage * **Limit block range** — The default block range for queries is 100 blocks. Requesting larger ranges or querying archive data increases CU consumption. * **Monitor usage** — Track your CU usage in the [Moralis Dashboard](https://admin.moralis.com/) to avoid hitting rate limits. * **Use batch requests** — Combine multiple requests into a single API call. Note that batching does not reduce total CU cost, but it reduces HTTP overhead. Maximum batch size is 20 requests per call. See [Batch Requests](/rpc-nodes/introduction/resources/rpc-batch-requests) for details. ## Need Higher Limits? If your use case requires more CUs than your current plan offers, consider upgrading or reaching out to the Moralis team for custom solutions at [moralis.com/pricing](https://moralis.com/pricing). # eth_blockNumber Source: https://docs.moralis.com/rpc-nodes/pulsechain/eth-blockNumber Returns the number of most recent block. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request body No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/pulse/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x4b7" } ``` # eth_call Source: https://docs.moralis.com/rpc-nodes/pulsechain/eth-call Executes a new message call immediately without creating a transaction on the blockchain. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **from** `string` The address the transaction is sent from **to** `string` *required* The address the transaction is directed to **gas** `string` Integer of the gas provided for the transaction execution **gasPrice** `string` Integer of the gasPrice used for each paid gas **value** `string` Integer of the value sent with this transaction **data** `string` Hash of the method signature and encoded parameters **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ { "from": "0x0000000000000000000000000000000000000000", "to": "0x0000000000000000000000000000000000000000", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0x" }, "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/pulse/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_call", "params": [{"from": "0xb60e8dd61c5d32be8058bb8eb970870f07233155", "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"}, "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x15536ee" } ``` # eth_chainId Source: https://docs.moralis.com/rpc-nodes/pulsechain/eth-chain-id Returns the chain ID of the current connected node as described in EIP-695. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request body No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/pulse/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_chainId", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` # eth_createAccessList Source: https://docs.moralis.com/rpc-nodes/pulsechain/eth-create-access-list Creates an access list that you can include in a transaction. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **from** `string` The address the transaction is sent from **to** `string` The address the transaction is directed to **gas** `string` Integer of the gas provided for the transaction execution **gasPrice** `string` Integer of the gasPrice used for each paid gas **maxPriorityFeePerGas** `string` Maximum fee per gas the sender is willing to pay to miners **maxFeePerGas** `string` Maximum total fee per gas the sender is willing to pay **value** `string` Integer of the value sent with this transaction **data** `string` Hash of the method signature and encoded parameters **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ { "from": "0x8ba1f109551bd432803012645haca66c9834d7c6", "to": "0x6b175474e89094c44da98b954eedeac495271d0f", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0xa9059cbb0000000000000000000000008ba1f109551bd432803012645haca66c9834d7c60000000000000000000000000000000000000000000000000de0b6b3a7640000" }, "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/pulse/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_createAccessList", "params": [{"from": "0x8ba1f109551bd432803012645haca66c9834d7c6", "to": "0x6b175474e89094c44da98b954eedeac495271d0f", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0xa9059cbb0000000000000000000000008ba1f109551bd432803012645haca66c9834d7c60000000000000000000000000000000000000000000000000de0b6b3a7640000"}, "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "accessList": [ { "address": "0x6b175474e89094c44da98b954eedeac495271d0f", "storageKeys": [ "0x0000000000000000000000000000000000000000000000000000000000000000" ] } ], "gasUsed": "0x7671" } } ``` # eth_estimateGas Source: https://docs.moralis.com/rpc-nodes/pulsechain/eth-estimate-gas Generates and returns an estimate of how much gas is necessary to allow the transaction to complete. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **from** `string` The address the transaction is sent from **to** `string` The address the transaction is directed to **gas** `string` Integer of the gas provided for the transaction execution **gasPrice** `string` Integer of the gasPrice used for each paid gas **value** `string` Integer of the value sent with this transaction **data** `string` Hash of the method signature and encoded parameters **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ { "from": "0x8D97689C9818892B700e27F316cc3E41e17fBeb9", "to": "0xd3CdA913deB6f67967B99D67aCDFa1712C293601", "value": "0x186a0" }, "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/pulse/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_estimateGas", "params": [{"from": "0x8D97689C9818892B700e27F316cc3E41e17fBeb9", "to": "0xd3CdA913deB6f67967B99D67aCDFa1712C293601", "value": "0x186a0"}, "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x5208" } ``` # eth_feeHistory Source: https://docs.moralis.com/rpc-nodes/pulsechain/eth-fee-history Returns historical gas information for a range of blocks. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockCount** `string` *required* Number of blocks in the requested range **newestBlock** `string` *required* Highest number block of the requested range **rewardPercentiles** `array` Array of percentile values to sample from each block's effective priority fees per gas #### Example request `params` ```javascript theme={null} [ "0x4", "latest", [25, 75] ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/pulse/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_feeHistory", "params": ["0x4", "latest", [25, 75]], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": [ "0x7", "0x7", "0x7", "0x7", "0x7" ], "gasUsedRatio": [ 0.026089875, 0.406803, 0.010817, 0.5 ], "baseFeePerBlobGas": [ "0x3319eb", "0x350c54", "0x364072", "0x364072", "0x32279d" ], "blobGasUsedRatio": [ 0.47619047619047616, 0.2857142857142857, 0, 0.3333333333333333 ], "oldestBlock": "0x11b9231", "reward": [ ["0x4a817c800", "0x4a817c800"], ["0x773593c0", "0x773593c0"], ["0x0", "0x0"], ["0x0", "0x0"] ] } } ``` # eth_gasPrice Source: https://docs.moralis.com/rpc-nodes/pulsechain/eth-gas-price Returns the current price per gas in wei. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/pulse/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x09184e72a000" } ``` # eth_getBalance Source: https://docs.moralis.com/rpc-nodes/pulsechain/eth-get-balance Returns the balance of the account of given address. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address to check for balance **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/pulse/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0234c8a3397aab58" } ``` # eth_getBlockByHash Source: https://docs.moralis.com/rpc-nodes/pulsechain/eth-get-block-by-hash Returns information about a block by hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block **fullTransactionObjects** `boolean` *required* If true it returns the full transaction objects, if false only the hashes of the transactions #### Example request `params` ```javascript theme={null} [ "0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c", false ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/pulse/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c", false], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x3319bb0", "blobGasUsed": "0x120000", "difficulty": "0x0", "excessBlobGas": "0xa576243", "extraData": "0xe29ca82051756173617220287175617361722e77696e2920e29ca8", "gasLimit": "0x3938700", "gasUsed": "0x2965eaa", "hash": "0xc319ec0da50d354ce425b63fb6914a42aafdb9ee9807518edd595809e25fbe38", "logsBloom": "0x7feeeb37793b4fdfff7ab7aefde2d7fdfff9575bfef5bdff3fb97bfef7bcddbbdf9d55e77fdf7ead7b98ffd9bb6fefff7e77b163bf9eeebdddd1ffbf376cfbeb7efffef83ffbe9eb7ff7776ab3dcf8bfee7ebaddfffdf7fe3fffdf6ed3f7dff77cf2fd7efffff7a19ef7ffbbe3e8befdb7fff76b6ed6e7ffceeb99ff7eeb5efebfff3fff7da1fb39f9fff3fd7f3f77b6dd0bed39f5fff3bfa7fbbce7f9f6ec6e0fff50bfe7f9f79efff35ff6d93fecfefbffdaf7b7eff35ec6ff42fe7e6f77f7deff7eff57f6aafa597feebdffff7bbd677e27ffbfadfdf57f7e7d2aeeffffff6676ffa7f3f375eb95eecf9ffa235cbfcdefafbf8feed9dc7b56ff2fdfedfefe", "miner": "0x396343362be2a4da1ce0c1c210945346fb82aa49", "mixHash": "0x07444bb5750f746e200e1dcd8d83221b26576d3357b833cc1e434e7966d0e774", "nonce": "0x0000000000000000", "number": "0x1736791", "parentBeaconBlockRoot": "0x2759f248e2d1cb1a2f5c2657c4efcc623dd8ea7f23e8700162e7fccdacedfd5d", "parentHash": "0xdf0e4dee910167d7b1687a6cb677983ce7ed351ae78ab7e2c5ba39d793c80391", "receiptsRoot": "0x5f1c58e498161509245daad0f60319d9abab7f04d2ca60e99a3674cfdc9b8327", "requestsHash": "0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x1ef1e", "stateRoot": "0x728c7e38107037b573d719e67b6872ee3ca4e01b47818598316cd696bfe24f2c", "timestamp": "0x697b4bcb", "transactions": [ "0xbf7bd0cf98c3b65525f1f7267b1d02e7ccd7cd133b137f46723a91cf187616d5", "0x06ac9281da76d530aa19600e2c34aae7564a78702d3eb52b1fb363985473e296" ], "transactionsRoot": "0xa8c680f6ad8ccc7a49db5ab76cbd9194c88e16dbcfa440104f7787e5ba815c4f", "uncles": [], "withdrawals": [ { "index": "0x6f78bfb", "validatorIndex": "0x955f5", "address": "0x5d3ca1842d0988816434ea51ca420182f3f1e31a", "amount": "0x102d2f1" } ], "withdrawalsRoot": "0x9b7ecf1ba575fc02e4b4c14bd65d5ca95c0e066adaae3fc2ef16f5acd90214d8" } } ``` # eth_getBlockByNumber Source: https://docs.moralis.com/rpc-nodes/pulsechain/eth-get-block-by-number Returns information about a block by block number. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" **fullTransactionObjects** `boolean` *required* If true it returns the full transaction objects, if false only the hashes of the transactions #### Example request `params` ```javascript theme={null} [ "0x1b4", true ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/pulse/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["0x1b4", true], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x3319bb0", "blobGasUsed": "0x120000", "difficulty": "0x0", "excessBlobGas": "0xa576243", "extraData": "0xe29ca82051756173617220287175617361722e77696e2920e29ca8", "gasLimit": "0x3938700", "gasUsed": "0x2965eaa", "hash": "0xc319ec0da50d354ce425b63fb6914a42aafdb9ee9807518edd595809e25fbe38", "logsBloom": "0x7feeeb37793b4fdfff7ab7aefde2d7fdfff9575bfef5bdff3fb97bfef7bcddbbdf9d55e77fdf7ead7b98ffd9bb6fefff7e77b163bf9eeebdddd1ffbf376cfbeb7efffef83ffbe9eb7ff7776ab3dcf8bfee7ebaddfffdf7fe3fffdf6ed3f7dff77cf2fd7efffff7a19ef7ffbbe3e8befdb7fff76b6ed6e7ffceeb99ff7eeb5efebfff3fff7da1fb39f9fff3fd7f3f77b6dd0bed39f5fff3bfa7fbbce7f9f6ec6e0fff50bfe7f9f79efff35ff6d93fecfefbffdaf7b7eff35ec6ff42fe7e6f77f7deff7eff57f6aafa597feebdffff7bbd677e27ffbfadfdf57f7e7d2aeeffffff6676ffa7f3f375eb95eecf9ffa235cbfcdefafbf8feed9dc7b56ff2fdfedfefe", "miner": "0x396343362be2a4da1ce0c1c210945346fb82aa49", "mixHash": "0x07444bb5750f746e200e1dcd8d83221b26576d3357b833cc1e434e7966d0e774", "nonce": "0x0000000000000000", "number": "0x1736791", "parentBeaconBlockRoot": "0x2759f248e2d1cb1a2f5c2657c4efcc623dd8ea7f23e8700162e7fccdacedfd5d", "parentHash": "0xdf0e4dee910167d7b1687a6cb677983ce7ed351ae78ab7e2c5ba39d793c80391", "receiptsRoot": "0x5f1c58e498161509245daad0f60319d9abab7f04d2ca60e99a3674cfdc9b8327", "requestsHash": "0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x1ef1e", "stateRoot": "0x728c7e38107037b573d719e67b6872ee3ca4e01b47818598316cd696bfe24f2c", "timestamp": "0x697b4bcb", "transactions": [ "0xbf7bd0cf98c3b65525f1f7267b1d02e7ccd7cd133b137f46723a91cf187616d5", "0x06ac9281da76d530aa19600e2c34aae7564a78702d3eb52b1fb363985473e296" ], "transactionsRoot": "0xa8c680f6ad8ccc7a49db5ab76cbd9194c88e16dbcfa440104f7787e5ba815c4f", "uncles": [], "withdrawals": [ { "index": "0x6f78bfb", "validatorIndex": "0x955f5", "address": "0x5d3ca1842d0988816434ea51ca420182f3f1e31a", "amount": "0x102d2f1" } ], "withdrawalsRoot": "0x9b7ecf1ba575fc02e4b4c14bd65d5ca95c0e066adaae3fc2ef16f5acd90214d8" } } ``` # eth_getBlockReceipts Source: https://docs.moralis.com/rpc-nodes/pulsechain/eth-get-block-receipts Returns all transaction receipts for a given block. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" #### Example request `params` ```javascript theme={null} [ "0xf21d9c" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/pulse/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockReceipts", "params": ["0xf21d9c"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": [ { "blockHash": "0x8243343df08b9751f5ca0c5f8c9c0460d8a9b6351066fae0acbd4d3e776de8bb", "blockNumber": "0xf21d9c", "contractAddress": null, "cumulativeGasUsed": "0x5208", "effectiveGasPrice": "0x1dcd6500", "from": "0x8ba1f109551bd432803012645haca66c9834d7c6", "gasUsed": "0x5208", "logs": [], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "status": "0x1", "to": "0x95cED938F7991cd0dFcb48F0a06a40FA1aF46EBC", "transactionHash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "transactionIndex": "0x0", "type": "0x2" } ] } ``` # eth_getBlockTransactionCountByHash Source: https://docs.moralis.com/rpc-nodes/pulsechain/eth-get-block-transaction-count-by-hash Returns the number of transactions in a block from a block matching the given block hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block #### Example request `params` ```javascript theme={null} [ "0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/pulse/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` # eth_getBlockTransactionCountByNumber Source: https://docs.moralis.com/rpc-nodes/pulsechain/eth-get-block-transaction-count-by-number Returns the number of transactions in a block matching the given block number. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" #### Example request `params` ```javascript theme={null} [ "0xe8" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/pulse/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["0xe8"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` # eth_getCode Source: https://docs.moralis.com/rpc-nodes/pulsechain/eth-get-code Returns code at a given address. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address to get the code from **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x2" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/pulse/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getCode", "params": ["0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x2"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x600160008035811a818181146012578301005b601b6001356025565b8060005260206000f25b600060078202905091905056" } ``` # eth_getLogs Source: https://docs.moralis.com/rpc-nodes/pulsechain/eth-get-logs Returns an array of all logs matching a given filter object. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **fromBlock** `string` Integer block number, or "latest" for the last mined block or "pending", "earliest" for not yet mined transactions **toBlock** `string` Integer block number, or "latest" for the last mined block or "pending", "earliest" for not yet mined transactions **address** `string` Contract address or a list of addresses from which logs should originate **topics** `array` Array of 32 Bytes DATA topics. Topics are order-dependent **blockhash** `string` Using blockhash is equivalent to fromBlock = toBlock = the block number with hash blockhash #### Example request `params` ```javascript theme={null} [ { "fromBlock": "0x1", "toBlock": "0x2", "address": "0x8888f1f195afa192cfee860698584c030f4c9db1", "topics": [ "0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", null, [ "0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x0000000000000000000000000aff3454fce5edbc8cca8697c15331677e6ebccc" ] ] } ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/pulse/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getLogs", "params": [{"fromBlock": "0x1", "toBlock": "0x2", "address": "0x8888f1f195afa192cfee860698584c030f4c9db1", "topics": ["0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", null, ["0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x0000000000000000000000000aff3454fce5edbc8cca8697c15331677e6ebccc"]]}], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": [ { "logIndex": "0x1", "blockNumber": "0x1b4", "blockHash": "0x8216c5785ac562ff41e2dcfdf5785ac562ff41e2dcfdf829c5a142f1fccd7d", "transactionHash": "0xdf829c5a142f1fccd7d8216c5785ac562ff41e2dcfdf5785ac562ff41e2dcf", "transactionIndex": "0x0", "address": "0x16c5785ac562ff41e2dcfdf829c5a142f1fccd7d", "data": "0x0000000000000000000000000000000000000000000000000000000000000000", "topics": [ "0x59ebeb90bc63057b6515673c3ecf9438e5058bca0f92585014eced636878c9a5" ] } ] } ``` # eth_getProof Source: https://docs.moralis.com/rpc-nodes/pulsechain/eth-get-proof Returns the account and storage values of the specified account including the Merkle-proof. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address of the account or contract **storageKeys** `array` *required* Array of storage-keys which should be proofed and included **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842", [ "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421" ], "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/pulse/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getProof", "params": ["0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842", ["0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"], "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "address": "0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842", "accountProof": [ "0xf90211a090dcaf88c40c7bbc95a912cbdde67c175767b31173df9ee4b0d733bfdd511c43a0babe369f6b12092f49181ae04ca173fb68d1a5456f18d20fa32cba73954052bda0473ecf8a7e36a829e75039a3b055e51b8332cbf03324ab4af2066bbd6fbf0021fa0bbda34753d7aa6c38e603f360244e8f59611921d9e1f128372fec0d586d4f9e0a04e44caecff45c9891f74f6a2156735886eedf6f1a733628ebc802ec79d844648a0a5f3f2f7542148c973977c8a1e154c4300fec92f755f7846f1b734d3ab1d90e7a0e823850f50bf72baae9d1733a36a444ab65d0a6faaba404f0583ce0ca4dad92da0f7a00cbe7d4b30b11faea3ae61b7f1f2b315017e79a3de5ab2dc8bb46a59fdb37a09b3b8d0e0e4c1e3b2d3e8f7c6e5d4c3b2a1e0f9e8d7c6b5a4e3f2e1d0c9b8a7a0b1f8e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0a0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0a0d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a08080" ], "balance": "0x0", "codeHash": "0x5e61b0f7919ab4e6fc7cfa6f3f5f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f", "nonce": "0x0", "storageHash": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "storageProof": [ { "key": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "value": "0x1", "proof": [ "0xf90211a090dcaf88c40c7bbc95a912cbdde67c175767b31173df9ee4b0d733bfdd511c43a0babe369f6b12092f49181ae04ca173fb68d1a5456f18d20fa32cba73954052bda0473ecf8a7e36a829e75039a3b055e51b8332cbf03324ab4af2066bbd6fbf0021fa0bbda34753d7aa6c38e603f360244e8f59611921d9e1f128372fec0d586d4f9e0a04e44caecff45c9891f74f6a2156735886eedf6f1a733628ebc802ec79d844648a0a5f3f2f7542148c973977c8a1e154c4300fec92f755f7846f1b734d3ab1d90e7a0e823850f50bf72baae9d1733a36a444ab65d0a6faaba404f0583ce0ca4dad92da0f7a00cbe7d4b30b11faea3ae61b7f1f2b315017e79a3de5ab2dc8bb46a59fdb37a09b3b8d0e0e4c1e3b2d3e8f7c6e5d4c3b2a1e0f9e8d7c6b5a4e3f2e1d0c9b8a7a0b1f8e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0a0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0a0d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a08080" ] } ] } } ``` # eth_getStorageAt Source: https://docs.moralis.com/rpc-nodes/pulsechain/eth-get-storage-at Returns the value from a storage position at a given address. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address of the storage **position** `string` *required* Integer of the position in the storage **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x0", "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/pulse/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x0", "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x00000000000000000000000000000000000000000000000000000000000004d2" } ``` # eth_getTransactionByBlockHashAndIndex Source: https://docs.moralis.com/rpc-nodes/pulsechain/eth-get-transaction-by-block-hash-and-index Returns information about a transaction by block hash and transaction index position. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block **index** `string` *required* Integer of the transaction index position #### Example request `params` ```javascript theme={null} [ "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/pulse/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5daf3b", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "gas": "0xc350", "gasPrice": "0x4a817c800", "hash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "input": "0x68656c6c6f21", "nonce": "0x15", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "transactionIndex": "0x0", "value": "0xf3dbb76162000", "v": "0x25", "r": "0x1b5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5", "s": "0x5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5c5" } } ``` # eth_getTransactionByBlockNumberAndIndex Source: https://docs.moralis.com/rpc-nodes/pulsechain/eth-get-transaction-by-block-number-and-index Returns information about a transaction by block number and transaction index position. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* A block number, or the string "earliest", "latest" or "pending" **index** `string` *required* The transaction index position #### Example request `params` ```javascript theme={null} [ "0x5BAE9E", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/pulse/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["0x5BAE9E", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5BAE9E", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "gas": "0xc350", "gasPrice": "0x4a817c800", "hash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "input": "0x68656c6c6f21", "nonce": "0x15", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "transactionIndex": "0x0", "value": "0xf3dbb76162000", "v": "0x25", "r": "0x1b5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5", "s": "0x5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5c5" } } ``` # eth_getTransactionByHash Source: https://docs.moralis.com/rpc-nodes/pulsechain/eth-get-transaction-by-hash Returns the information about a transaction requested by transaction hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a transaction #### Example request `params` ```javascript theme={null} [ "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/pulse/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5daf3b", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "gas": "0xc350", "gasPrice": "0x4a817c800", "hash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "input": "0x68656c6c6f21", "nonce": "0x15", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "transactionIndex": "0x41", "value": "0xf3dbb76162000", "v": "0x25", "r": "0x1b5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5", "s": "0x5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5c5" } } ``` # eth_getTransactionCount Source: https://docs.moralis.com/rpc-nodes/pulsechain/eth-get-transaction-count Returns the number of transactions sent from an address. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address to get transaction count for **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/pulse/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` # eth_getTransactionReceipt Source: https://docs.moralis.com/rpc-nodes/pulsechain/eth-get-transaction-receipt Returns the receipt of a transaction by transaction hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a transaction #### Example request `params` ```javascript theme={null} [ "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/pulse/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "transactionHash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "transactionIndex": "0x41", "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5daf3b", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "cumulativeGasUsed": "0x33bc", "gasUsed": "0x4dc", "contractAddress": null, "logs": [], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "status": "0x1" } } ``` # eth_getUncleByBlockHashAndIndex Source: https://docs.moralis.com/rpc-nodes/pulsechain/eth-get-uncle-by-block-hash-and-index Returns information about an uncle of a block by hash and uncle index position. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block **index** `string` *required* The uncle's index position #### Example request `params` ```javascript theme={null} [ "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/pulse/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x027f07", "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000", "gasLimit": "0x9f759", "gasUsed": "0x9f759", "hash": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331", "logsBloom": "0x1a060020000015554c000200000003050000200017041014032020801000056020000001000a00d0020204040020012150010010000000280005000c00000000000020c0000000024008104011000080020020000001006100900000024208002000020002100000000000000080000000120080000002003c0000200000000200002010008300300001001031100100040010420000800000000014000004002000000c040200060000000080000000100000000040a2000001000061000042021080400200000410000404080800014008201000c20100500020011000000030001100100024008c80190400402008000020000c0041104218100000000000000002000800000", "miner": "0x4e65fda2159562a496f9f3522f89122a3088497a", "mixHash": "0x99e9d85137db46ef1e85fff042bb15a7b6f46618b7f600b0b4e7fb52fceafc3a", "nonce": "0xfcf4db6d9bce1b8b", "number": "0x1b4", "parentHash": "0xa057c32b6ed8eb5e006cadfad55c7e635549c6e2135c4e6c3a9d5a6a80f72c3", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0x1a7e46b37b26e0c3f67ed4de3b5d3b1ff84a2e0a5e2dcf4d4b0d34b5a22b6e3", "timestamp": "0x55ba467c", "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` # eth_getUncleByBlockNumberAndIndex Source: https://docs.moralis.com/rpc-nodes/pulsechain/eth-get-uncle-by-block-number-and-index Returns information about an uncle of a block by number and uncle index position. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* A block number, or the string "earliest", "latest" or "pending" **index** `string` *required* The uncle's index position #### Example request `params` ```javascript theme={null} [ "0x29c", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/pulse/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["0x29c", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x027f07", "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000", "gasLimit": "0x9f759", "gasUsed": "0x9f759", "hash": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331", "logsBloom": "0x1a060020000015554c000200000003050000200017041014032020801000056020000001000a00d0020204040020012150010010000000280005000c00000000000020c0000000024008104011000080020020000001006100900000024208002000020002100000000000000080000000120080000002003c0000200000000200002010008300300001001031100100040010420000800000000014000004002000000c040200060000000080000000100000000040a2000001000061000042021080400200000410000404080800014008201000c20100500020011000000030001100100024008c80190400402008000020000c0041104218100000000000000002000800000", "miner": "0x4e65fda2159562a496f9f3522f89122a3088497a", "mixHash": "0x99e9d85137db46ef1e85fff042bb15a7b6f46618b7f600b0b4e7fb52fceafc3a", "nonce": "0xfcf4db6d9bce1b8b", "number": "0x29c", "parentHash": "0xa057c32b6ed8eb5e006cadfad55c7e635549c6e2135c4e6c3a9d5a6a80f72c3", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0x1a7e46b37b26e0c3f67ed4de3b5d3b1ff84a2e0a5e2dcf4d4b0d34b5a22b6e3", "timestamp": "0x55ba467c", "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` # eth_getUncleCountByBlockHash Source: https://docs.moralis.com/rpc-nodes/pulsechain/eth-get-uncle-count-by-block-hash Returns the number of uncles in a block from a block matching the given block hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block #### Example request `params` ```javascript theme={null} [ "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/pulse/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` # eth_getUncleCountByBlockNumber Source: https://docs.moralis.com/rpc-nodes/pulsechain/eth-get-uncle-count-by-block-number Returns the number of uncles in a block from a block matching the given block number. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" #### Example request `params` ```javascript theme={null} [ "0x5BAE9E" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/pulse/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["0x5BAE9E"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` # eth_maxPriorityFeePerGas Source: https://docs.moralis.com/rpc-nodes/pulsechain/eth-max-priority-fee-per-gas Returns a suggestion for the max priority fee per gas for dynamic fee transactions in wei. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/pulse/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_maxPriorityFeePerGas", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x59682f00" } ``` # eth_sendRawTransaction Source: https://docs.moralis.com/rpc-nodes/pulsechain/eth-send-raw-transaction Submits a pre-signed transaction for broadcast to the network. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **data** `string` *required* The signed transaction data #### Example request `params` ```javascript theme={null} [ "0xf869808504e3b2928082520894f0109fc8df283027b6285cc889f5aa624eac1f55843b9aca008025a0c9cf86333bcb065d140032ecaab5d9281bde80f21b9687b3e94161de42d51895a0727a108a0b8d101465414033c3f705a9c7b826e596766046ee1183dbc8aeaa68" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/pulse/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["0xf869808504e3b2928082520894f0109fc8df283027b6285cc889f5aa624eac1f55843b9aca008025a0c9cf86333bcb065d140032ecaab5d9281bde80f21b9687b3e94161de42d51895a0727a108a0b8d101465414033c3f705a9c7b826e596766046ee1183dbc8aeaa68"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" } ``` # Overview Source: https://docs.moralis.com/rpc-nodes/pulsechain/overview Explore Pulsechain JSON-RPC methods ## Introduction Pulsechain is a high-performance Ethereum-compatible blockchain designed to offer fast and cost-effective transactions. With its focus on scalability and efficiency, Pulsechain is an ideal platform for developers building decentralized applications (dApps), particularly in the DeFi and NFT spaces. ## Supported Networks The Pulsechain RPC API is available for the following networks: 1. **Pulsechain Mainnet** ## Network Details | **Network** | **Chain ID** | **Path Parameter** | | :- | :- | :- | | **Pulsechain Mainnet** | 0x171 (369) | `pulse` | ## Supported RPC Methods * [eth\_blockNumber](/rpc-nodes/pulsechain/eth-blockNumber) * [eth\_call](/rpc-nodes/pulsechain/eth-call) * [eth\_chainId](/rpc-nodes/pulsechain/eth-chain-id) * [eth\_createAccessList](/rpc-nodes/pulsechain/eth-create-access-list) * [eth\_estimateGas](/rpc-nodes/pulsechain/eth-estimate-gas) * [eth\_feeHistory](/rpc-nodes/pulsechain/eth-fee-history) * [eth\_gasPrice](/rpc-nodes/pulsechain/eth-gas-price) * [eth\_getBalance](/rpc-nodes/pulsechain/eth-get-balance) * [eth\_getBlockByHash](/rpc-nodes/pulsechain/eth-get-block-by-hash) * [eth\_getBlockByNumber](/rpc-nodes/pulsechain/eth-get-block-by-number) * [eth\_getBlockTransactionCountByHash](/rpc-nodes/pulsechain/eth-get-block-transaction-count-by-hash) * [eth\_getBlockTransactionCountByNumber](/rpc-nodes/pulsechain/eth-get-block-transaction-count-by-number) * [eth\_getBlockReceipts](/rpc-nodes/pulsechain/eth-get-block-receipts) * [eth\_getCode](/rpc-nodes/pulsechain/eth-get-code) * [eth\_getLogs](/streams/api-reference/history/get-logs) * [eth\_getProof](/rpc-nodes/pulsechain/eth-get-proof) * [eth\_getStorageAt](/rpc-nodes/pulsechain/eth-get-storage-at) * [eth\_getTransactionByHash](/rpc-nodes/pulsechain/eth-get-transaction-by-hash) * [eth\_getTransactionByBlockHashAndIndex](/rpc-nodes/pulsechain/eth-get-transaction-by-block-hash-and-index) * [eth\_getTransactionByBlockNumberAndIndex](/rpc-nodes/pulsechain/eth-get-transaction-by-block-number-and-index) * [eth\_getTransactionCount](/rpc-nodes/pulsechain/eth-get-transaction-count) * [eth\_getTransactionReceipt](/rpc-nodes/pulsechain/eth-get-transaction-receipt) * [eth\_getUncleByBlockHashAndIndex](/rpc-nodes/pulsechain/eth-get-uncle-by-block-hash-and-index) * [eth\_getUncleByBlockNumberAndIndex](/rpc-nodes/pulsechain/eth-get-uncle-by-block-number-and-index) * [eth\_getUncleCountByBlockHash](/rpc-nodes/pulsechain/eth-get-uncle-count-by-block-hash) * [eth\_getUncleCountByBlockNumber](/rpc-nodes/pulsechain/eth-get-uncle-count-by-block-number) * [eth\_maxPriorityFeePerGas](/rpc-nodes/pulsechain/eth-max-priority-fee-per-gas) * [eth\_sendRawTransaction](/rpc-nodes/pulsechain/eth-send-raw-transaction) # eth_blockNumber Source: https://docs.moralis.com/rpc-nodes/ronin/eth-blockNumber Returns the number of most recent block. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request body No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/ronin/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x4b7" } ``` # eth_call Source: https://docs.moralis.com/rpc-nodes/ronin/eth-call Executes a new message call immediately without creating a transaction on the blockchain. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **from** `string` The address the transaction is sent from **to** `string` *required* The address the transaction is directed to **gas** `string` Integer of the gas provided for the transaction execution **gasPrice** `string` Integer of the gasPrice used for each paid gas **value** `string` Integer of the value sent with this transaction **data** `string` Hash of the method signature and encoded parameters **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ { "from": "0x0000000000000000000000000000000000000000", "to": "0x0000000000000000000000000000000000000000", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0x" }, "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/ronin/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_call", "params": [{"from": "0xb60e8dd61c5d32be8058bb8eb970870f07233155", "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"}, "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x15536ee" } ``` # eth_chainId Source: https://docs.moralis.com/rpc-nodes/ronin/eth-chain-id Returns the chain ID of the current connected node as described in EIP-695. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request body No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/ronin/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_chainId", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` # eth_createAccessList Source: https://docs.moralis.com/rpc-nodes/ronin/eth-create-access-list Creates an access list that you can include in a transaction. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **from** `string` The address the transaction is sent from **to** `string` The address the transaction is directed to **gas** `string` Integer of the gas provided for the transaction execution **gasPrice** `string` Integer of the gasPrice used for each paid gas **maxPriorityFeePerGas** `string` Maximum fee per gas the sender is willing to pay to miners **maxFeePerGas** `string` Maximum total fee per gas the sender is willing to pay **value** `string` Integer of the value sent with this transaction **data** `string` Hash of the method signature and encoded parameters **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ { "from": "0x8ba1f109551bd432803012645haca66c9834d7c6", "to": "0x6b175474e89094c44da98b954eedeac495271d0f", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0xa9059cbb0000000000000000000000008ba1f109551bd432803012645haca66c9834d7c60000000000000000000000000000000000000000000000000de0b6b3a7640000" }, "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/ronin/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_createAccessList", "params": [{"from": "0x8ba1f109551bd432803012645haca66c9834d7c6", "to": "0x6b175474e89094c44da98b954eedeac495271d0f", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0xa9059cbb0000000000000000000000008ba1f109551bd432803012645haca66c9834d7c60000000000000000000000000000000000000000000000000de0b6b3a7640000"}, "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "accessList": [ { "address": "0x6b175474e89094c44da98b954eedeac495271d0f", "storageKeys": [ "0x0000000000000000000000000000000000000000000000000000000000000000" ] } ], "gasUsed": "0x7671" } } ``` # eth_estimateGas Source: https://docs.moralis.com/rpc-nodes/ronin/eth-estimate-gas Generates and returns an estimate of how much gas is necessary to allow the transaction to complete. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **from** `string` The address the transaction is sent from **to** `string` The address the transaction is directed to **gas** `string` Integer of the gas provided for the transaction execution **gasPrice** `string` Integer of the gasPrice used for each paid gas **value** `string` Integer of the value sent with this transaction **data** `string` Hash of the method signature and encoded parameters **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ { "from": "0x8D97689C9818892B700e27F316cc3E41e17fBeb9", "to": "0xd3CdA913deB6f67967B99D67aCDFa1712C293601", "value": "0x186a0" }, "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/ronin/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_estimateGas", "params": [{"from": "0x8D97689C9818892B700e27F316cc3E41e17fBeb9", "to": "0xd3CdA913deB6f67967B99D67aCDFa1712C293601", "value": "0x186a0"}, "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x5208" } ``` # eth_feeHistory Source: https://docs.moralis.com/rpc-nodes/ronin/eth-fee-history Returns historical gas information for a range of blocks. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockCount** `string` *required* Number of blocks in the requested range **newestBlock** `string` *required* Highest number block of the requested range **rewardPercentiles** `array` Array of percentile values to sample from each block's effective priority fees per gas #### Example request `params` ```javascript theme={null} [ "0x4", "latest", [25, 75] ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/ronin/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_feeHistory", "params": ["0x4", "latest", [25, 75]], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": [ "0x7", "0x7", "0x7", "0x7", "0x7" ], "gasUsedRatio": [ 0.026089875, 0.406803, 0.010817, 0.5 ], "baseFeePerBlobGas": [ "0x3319eb", "0x350c54", "0x364072", "0x364072", "0x32279d" ], "blobGasUsedRatio": [ 0.47619047619047616, 0.2857142857142857, 0, 0.3333333333333333 ], "oldestBlock": "0x11b9231", "reward": [ ["0x4a817c800", "0x4a817c800"], ["0x773593c0", "0x773593c0"], ["0x0", "0x0"], ["0x0", "0x0"] ] } } ``` # eth_gasPrice Source: https://docs.moralis.com/rpc-nodes/ronin/eth-gas-price Returns the current price per gas in wei. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/ronin/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x09184e72a000" } ``` # eth_getBalance Source: https://docs.moralis.com/rpc-nodes/ronin/eth-get-balance Returns the balance of the account of given address. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address to check for balance **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/ronin/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0234c8a3397aab58" } ``` # eth_getBlockByHash Source: https://docs.moralis.com/rpc-nodes/ronin/eth-get-block-by-hash Returns information about a block by hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block **fullTransactionObjects** `boolean` *required* If true it returns the full transaction objects, if false only the hashes of the transactions #### Example request `params` ```javascript theme={null} [ "0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c", false ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/ronin/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c", false], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x3319bb0", "blobGasUsed": "0x120000", "difficulty": "0x0", "excessBlobGas": "0xa576243", "extraData": "0xe29ca82051756173617220287175617361722e77696e2920e29ca8", "gasLimit": "0x3938700", "gasUsed": "0x2965eaa", "hash": "0xc319ec0da50d354ce425b63fb6914a42aafdb9ee9807518edd595809e25fbe38", "logsBloom": "0x7feeeb37793b4fdfff7ab7aefde2d7fdfff9575bfef5bdff3fb97bfef7bcddbbdf9d55e77fdf7ead7b98ffd9bb6fefff7e77b163bf9eeebdddd1ffbf376cfbeb7efffef83ffbe9eb7ff7776ab3dcf8bfee7ebaddfffdf7fe3fffdf6ed3f7dff77cf2fd7efffff7a19ef7ffbbe3e8befdb7fff76b6ed6e7ffceeb99ff7eeb5efebfff3fff7da1fb39f9fff3fd7f3f77b6dd0bed39f5fff3bfa7fbbce7f9f6ec6e0fff50bfe7f9f79efff35ff6d93fecfefbffdaf7b7eff35ec6ff42fe7e6f77f7deff7eff57f6aafa597feebdffff7bbd677e27ffbfadfdf57f7e7d2aeeffffff6676ffa7f3f375eb95eecf9ffa235cbfcdefafbf8feed9dc7b56ff2fdfedfefe", "miner": "0x396343362be2a4da1ce0c1c210945346fb82aa49", "mixHash": "0x07444bb5750f746e200e1dcd8d83221b26576d3357b833cc1e434e7966d0e774", "nonce": "0x0000000000000000", "number": "0x1736791", "parentBeaconBlockRoot": "0x2759f248e2d1cb1a2f5c2657c4efcc623dd8ea7f23e8700162e7fccdacedfd5d", "parentHash": "0xdf0e4dee910167d7b1687a6cb677983ce7ed351ae78ab7e2c5ba39d793c80391", "receiptsRoot": "0x5f1c58e498161509245daad0f60319d9abab7f04d2ca60e99a3674cfdc9b8327", "requestsHash": "0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x1ef1e", "stateRoot": "0x728c7e38107037b573d719e67b6872ee3ca4e01b47818598316cd696bfe24f2c", "timestamp": "0x697b4bcb", "transactions": [ "0xbf7bd0cf98c3b65525f1f7267b1d02e7ccd7cd133b137f46723a91cf187616d5", "0x06ac9281da76d530aa19600e2c34aae7564a78702d3eb52b1fb363985473e296" ], "transactionsRoot": "0xa8c680f6ad8ccc7a49db5ab76cbd9194c88e16dbcfa440104f7787e5ba815c4f", "uncles": [], "withdrawals": [ { "index": "0x6f78bfb", "validatorIndex": "0x955f5", "address": "0x5d3ca1842d0988816434ea51ca420182f3f1e31a", "amount": "0x102d2f1" } ], "withdrawalsRoot": "0x9b7ecf1ba575fc02e4b4c14bd65d5ca95c0e066adaae3fc2ef16f5acd90214d8" } } ``` # eth_getBlockByNumber Source: https://docs.moralis.com/rpc-nodes/ronin/eth-get-block-by-number Returns information about a block by block number. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" **fullTransactionObjects** `boolean` *required* If true it returns the full transaction objects, if false only the hashes of the transactions #### Example request `params` ```javascript theme={null} [ "0x1b4", true ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/ronin/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["0x1b4", true], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x3319bb0", "blobGasUsed": "0x120000", "difficulty": "0x0", "excessBlobGas": "0xa576243", "extraData": "0xe29ca82051756173617220287175617361722e77696e2920e29ca8", "gasLimit": "0x3938700", "gasUsed": "0x2965eaa", "hash": "0xc319ec0da50d354ce425b63fb6914a42aafdb9ee9807518edd595809e25fbe38", "logsBloom": "0x7feeeb37793b4fdfff7ab7aefde2d7fdfff9575bfef5bdff3fb97bfef7bcddbbdf9d55e77fdf7ead7b98ffd9bb6fefff7e77b163bf9eeebdddd1ffbf376cfbeb7efffef83ffbe9eb7ff7776ab3dcf8bfee7ebaddfffdf7fe3fffdf6ed3f7dff77cf2fd7efffff7a19ef7ffbbe3e8befdb7fff76b6ed6e7ffceeb99ff7eeb5efebfff3fff7da1fb39f9fff3fd7f3f77b6dd0bed39f5fff3bfa7fbbce7f9f6ec6e0fff50bfe7f9f79efff35ff6d93fecfefbffdaf7b7eff35ec6ff42fe7e6f77f7deff7eff57f6aafa597feebdffff7bbd677e27ffbfadfdf57f7e7d2aeeffffff6676ffa7f3f375eb95eecf9ffa235cbfcdefafbf8feed9dc7b56ff2fdfedfefe", "miner": "0x396343362be2a4da1ce0c1c210945346fb82aa49", "mixHash": "0x07444bb5750f746e200e1dcd8d83221b26576d3357b833cc1e434e7966d0e774", "nonce": "0x0000000000000000", "number": "0x1736791", "parentBeaconBlockRoot": "0x2759f248e2d1cb1a2f5c2657c4efcc623dd8ea7f23e8700162e7fccdacedfd5d", "parentHash": "0xdf0e4dee910167d7b1687a6cb677983ce7ed351ae78ab7e2c5ba39d793c80391", "receiptsRoot": "0x5f1c58e498161509245daad0f60319d9abab7f04d2ca60e99a3674cfdc9b8327", "requestsHash": "0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x1ef1e", "stateRoot": "0x728c7e38107037b573d719e67b6872ee3ca4e01b47818598316cd696bfe24f2c", "timestamp": "0x697b4bcb", "transactions": [ "0xbf7bd0cf98c3b65525f1f7267b1d02e7ccd7cd133b137f46723a91cf187616d5", "0x06ac9281da76d530aa19600e2c34aae7564a78702d3eb52b1fb363985473e296" ], "transactionsRoot": "0xa8c680f6ad8ccc7a49db5ab76cbd9194c88e16dbcfa440104f7787e5ba815c4f", "uncles": [], "withdrawals": [ { "index": "0x6f78bfb", "validatorIndex": "0x955f5", "address": "0x5d3ca1842d0988816434ea51ca420182f3f1e31a", "amount": "0x102d2f1" } ], "withdrawalsRoot": "0x9b7ecf1ba575fc02e4b4c14bd65d5ca95c0e066adaae3fc2ef16f5acd90214d8" } } ``` # eth_getBlockReceipts Source: https://docs.moralis.com/rpc-nodes/ronin/eth-get-block-receipts Returns all transaction receipts for a given block. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" #### Example request `params` ```javascript theme={null} [ "0xf21d9c" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/ronin/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockReceipts", "params": ["0xf21d9c"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": [ { "blockHash": "0x8243343df08b9751f5ca0c5f8c9c0460d8a9b6351066fae0acbd4d3e776de8bb", "blockNumber": "0xf21d9c", "contractAddress": null, "cumulativeGasUsed": "0x5208", "effectiveGasPrice": "0x1dcd6500", "from": "0x8ba1f109551bd432803012645haca66c9834d7c6", "gasUsed": "0x5208", "logs": [], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "status": "0x1", "to": "0x95cED938F7991cd0dFcb48F0a06a40FA1aF46EBC", "transactionHash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "transactionIndex": "0x0", "type": "0x2" } ] } ``` # eth_getBlockTransactionCountByHash Source: https://docs.moralis.com/rpc-nodes/ronin/eth-get-block-transaction-count-by-hash Returns the number of transactions in a block from a block matching the given block hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block #### Example request `params` ```javascript theme={null} [ "0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/ronin/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` # eth_getBlockTransactionCountByNumber Source: https://docs.moralis.com/rpc-nodes/ronin/eth-get-block-transaction-count-by-number Returns the number of transactions in a block matching the given block number. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" #### Example request `params` ```javascript theme={null} [ "0xe8" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/ronin/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["0xe8"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` # eth_getCode Source: https://docs.moralis.com/rpc-nodes/ronin/eth-get-code Returns code at a given address. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address to get the code from **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x2" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/ronin/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getCode", "params": ["0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x2"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x600160008035811a818181146012578301005b601b6001356025565b8060005260206000f25b600060078202905091905056" } ``` # eth_getLogs Source: https://docs.moralis.com/rpc-nodes/ronin/eth-get-logs Returns an array of all logs matching a given filter object. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **fromBlock** `string` Integer block number, or "latest" for the last mined block or "pending", "earliest" for not yet mined transactions **toBlock** `string` Integer block number, or "latest" for the last mined block or "pending", "earliest" for not yet mined transactions **address** `string` Contract address or a list of addresses from which logs should originate **topics** `array` Array of 32 Bytes DATA topics. Topics are order-dependent **blockhash** `string` Using blockhash is equivalent to fromBlock = toBlock = the block number with hash blockhash #### Example request `params` ```javascript theme={null} [ { "fromBlock": "0x1", "toBlock": "0x2", "address": "0x8888f1f195afa192cfee860698584c030f4c9db1", "topics": [ "0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", null, [ "0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x0000000000000000000000000aff3454fce5edbc8cca8697c15331677e6ebccc" ] ] } ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/ronin/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getLogs", "params": [{"fromBlock": "0x1", "toBlock": "0x2", "address": "0x8888f1f195afa192cfee860698584c030f4c9db1", "topics": ["0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", null, ["0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x0000000000000000000000000aff3454fce5edbc8cca8697c15331677e6ebccc"]]}], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": [ { "logIndex": "0x1", "blockNumber": "0x1b4", "blockHash": "0x8216c5785ac562ff41e2dcfdf5785ac562ff41e2dcfdf829c5a142f1fccd7d", "transactionHash": "0xdf829c5a142f1fccd7d8216c5785ac562ff41e2dcfdf5785ac562ff41e2dcf", "transactionIndex": "0x0", "address": "0x16c5785ac562ff41e2dcfdf829c5a142f1fccd7d", "data": "0x0000000000000000000000000000000000000000000000000000000000000000", "topics": [ "0x59ebeb90bc63057b6515673c3ecf9438e5058bca0f92585014eced636878c9a5" ] } ] } ``` # eth_getProof Source: https://docs.moralis.com/rpc-nodes/ronin/eth-get-proof Returns the account and storage values of the specified account including the Merkle-proof. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address of the account or contract **storageKeys** `array` *required* Array of storage-keys which should be proofed and included **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842", [ "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421" ], "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/ronin/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getProof", "params": ["0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842", ["0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"], "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "address": "0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842", "accountProof": [ "0xf90211a090dcaf88c40c7bbc95a912cbdde67c175767b31173df9ee4b0d733bfdd511c43a0babe369f6b12092f49181ae04ca173fb68d1a5456f18d20fa32cba73954052bda0473ecf8a7e36a829e75039a3b055e51b8332cbf03324ab4af2066bbd6fbf0021fa0bbda34753d7aa6c38e603f360244e8f59611921d9e1f128372fec0d586d4f9e0a04e44caecff45c9891f74f6a2156735886eedf6f1a733628ebc802ec79d844648a0a5f3f2f7542148c973977c8a1e154c4300fec92f755f7846f1b734d3ab1d90e7a0e823850f50bf72baae9d1733a36a444ab65d0a6faaba404f0583ce0ca4dad92da0f7a00cbe7d4b30b11faea3ae61b7f1f2b315017e79a3de5ab2dc8bb46a59fdb37a09b3b8d0e0e4c1e3b2d3e8f7c6e5d4c3b2a1e0f9e8d7c6b5a4e3f2e1d0c9b8a7a0b1f8e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0a0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0a0d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a08080" ], "balance": "0x0", "codeHash": "0x5e61b0f7919ab4e6fc7cfa6f3f5f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f", "nonce": "0x0", "storageHash": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "storageProof": [ { "key": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "value": "0x1", "proof": [ "0xf90211a090dcaf88c40c7bbc95a912cbdde67c175767b31173df9ee4b0d733bfdd511c43a0babe369f6b12092f49181ae04ca173fb68d1a5456f18d20fa32cba73954052bda0473ecf8a7e36a829e75039a3b055e51b8332cbf03324ab4af2066bbd6fbf0021fa0bbda34753d7aa6c38e603f360244e8f59611921d9e1f128372fec0d586d4f9e0a04e44caecff45c9891f74f6a2156735886eedf6f1a733628ebc802ec79d844648a0a5f3f2f7542148c973977c8a1e154c4300fec92f755f7846f1b734d3ab1d90e7a0e823850f50bf72baae9d1733a36a444ab65d0a6faaba404f0583ce0ca4dad92da0f7a00cbe7d4b30b11faea3ae61b7f1f2b315017e79a3de5ab2dc8bb46a59fdb37a09b3b8d0e0e4c1e3b2d3e8f7c6e5d4c3b2a1e0f9e8d7c6b5a4e3f2e1d0c9b8a7a0b1f8e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0a0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0a0d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a08080" ] } ] } } ``` # eth_getStorageAt Source: https://docs.moralis.com/rpc-nodes/ronin/eth-get-storage-at Returns the value from a storage position at a given address. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address of the storage **position** `string` *required* Integer of the position in the storage **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x0", "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/ronin/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x0", "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x00000000000000000000000000000000000000000000000000000000000004d2" } ``` # eth_getTransactionByBlockHashAndIndex Source: https://docs.moralis.com/rpc-nodes/ronin/eth-get-transaction-by-block-hash-and-index Returns information about a transaction by block hash and transaction index position. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block **index** `string` *required* Integer of the transaction index position #### Example request `params` ```javascript theme={null} [ "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/ronin/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5daf3b", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "gas": "0xc350", "gasPrice": "0x4a817c800", "hash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "input": "0x68656c6c6f21", "nonce": "0x15", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "transactionIndex": "0x0", "value": "0xf3dbb76162000", "v": "0x25", "r": "0x1b5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5", "s": "0x5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5c5" } } ``` # eth_getTransactionByBlockNumberAndIndex Source: https://docs.moralis.com/rpc-nodes/ronin/eth-get-transaction-by-block-number-and-index Returns information about a transaction by block number and transaction index position. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* A block number, or the string "earliest", "latest" or "pending" **index** `string` *required* The transaction index position #### Example request `params` ```javascript theme={null} [ "0x5BAE9E", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/ronin/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["0x5BAE9E", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5BAE9E", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "gas": "0xc350", "gasPrice": "0x4a817c800", "hash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "input": "0x68656c6c6f21", "nonce": "0x15", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "transactionIndex": "0x0", "value": "0xf3dbb76162000", "v": "0x25", "r": "0x1b5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5", "s": "0x5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5c5" } } ``` # eth_getTransactionByHash Source: https://docs.moralis.com/rpc-nodes/ronin/eth-get-transaction-by-hash Returns the information about a transaction requested by transaction hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a transaction #### Example request `params` ```javascript theme={null} [ "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/ronin/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5daf3b", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "gas": "0xc350", "gasPrice": "0x4a817c800", "hash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "input": "0x68656c6c6f21", "nonce": "0x15", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "transactionIndex": "0x41", "value": "0xf3dbb76162000", "v": "0x25", "r": "0x1b5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5", "s": "0x5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5c5" } } ``` # eth_getTransactionCount Source: https://docs.moralis.com/rpc-nodes/ronin/eth-get-transaction-count Returns the number of transactions sent from an address. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address to get transaction count for **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/ronin/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` # eth_getTransactionReceipt Source: https://docs.moralis.com/rpc-nodes/ronin/eth-get-transaction-receipt Returns the receipt of a transaction by transaction hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a transaction #### Example request `params` ```javascript theme={null} [ "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/ronin/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "transactionHash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "transactionIndex": "0x41", "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5daf3b", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "cumulativeGasUsed": "0x33bc", "gasUsed": "0x4dc", "contractAddress": null, "logs": [], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "status": "0x1" } } ``` # eth_getUncleByBlockHashAndIndex Source: https://docs.moralis.com/rpc-nodes/ronin/eth-get-uncle-by-block-hash-and-index Returns information about an uncle of a block by hash and uncle index position. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block **index** `string` *required* The uncle's index position #### Example request `params` ```javascript theme={null} [ "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/ronin/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x027f07", "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000", "gasLimit": "0x9f759", "gasUsed": "0x9f759", "hash": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331", "logsBloom": "0x1a060020000015554c000200000003050000200017041014032020801000056020000001000a00d0020204040020012150010010000000280005000c00000000000020c0000000024008104011000080020020000001006100900000024208002000020002100000000000000080000000120080000002003c0000200000000200002010008300300001001031100100040010420000800000000014000004002000000c040200060000000080000000100000000040a2000001000061000042021080400200000410000404080800014008201000c20100500020011000000030001100100024008c80190400402008000020000c0041104218100000000000000002000800000", "miner": "0x4e65fda2159562a496f9f3522f89122a3088497a", "mixHash": "0x99e9d85137db46ef1e85fff042bb15a7b6f46618b7f600b0b4e7fb52fceafc3a", "nonce": "0xfcf4db6d9bce1b8b", "number": "0x1b4", "parentHash": "0xa057c32b6ed8eb5e006cadfad55c7e635549c6e2135c4e6c3a9d5a6a80f72c3", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0x1a7e46b37b26e0c3f67ed4de3b5d3b1ff84a2e0a5e2dcf4d4b0d34b5a22b6e3", "timestamp": "0x55ba467c", "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` # eth_getUncleByBlockNumberAndIndex Source: https://docs.moralis.com/rpc-nodes/ronin/eth-get-uncle-by-block-number-and-index Returns information about an uncle of a block by number and uncle index position. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* A block number, or the string "earliest", "latest" or "pending" **index** `string` *required* The uncle's index position #### Example request `params` ```javascript theme={null} [ "0x29c", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/ronin/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["0x29c", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x027f07", "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000", "gasLimit": "0x9f759", "gasUsed": "0x9f759", "hash": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331", "logsBloom": "0x1a060020000015554c000200000003050000200017041014032020801000056020000001000a00d0020204040020012150010010000000280005000c00000000000020c0000000024008104011000080020020000001006100900000024208002000020002100000000000000080000000120080000002003c0000200000000200002010008300300001001031100100040010420000800000000014000004002000000c040200060000000080000000100000000040a2000001000061000042021080400200000410000404080800014008201000c20100500020011000000030001100100024008c80190400402008000020000c0041104218100000000000000002000800000", "miner": "0x4e65fda2159562a496f9f3522f89122a3088497a", "mixHash": "0x99e9d85137db46ef1e85fff042bb15a7b6f46618b7f600b0b4e7fb52fceafc3a", "nonce": "0xfcf4db6d9bce1b8b", "number": "0x29c", "parentHash": "0xa057c32b6ed8eb5e006cadfad55c7e635549c6e2135c4e6c3a9d5a6a80f72c3", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0x1a7e46b37b26e0c3f67ed4de3b5d3b1ff84a2e0a5e2dcf4d4b0d34b5a22b6e3", "timestamp": "0x55ba467c", "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` # eth_getUncleCountByBlockHash Source: https://docs.moralis.com/rpc-nodes/ronin/eth-get-uncle-count-by-block-hash Returns the number of uncles in a block from a block matching the given block hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block #### Example request `params` ```javascript theme={null} [ "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/ronin/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` # eth_getUncleCountByBlockNumber Source: https://docs.moralis.com/rpc-nodes/ronin/eth-get-uncle-count-by-block-number Returns the number of uncles in a block from a block matching the given block number. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" #### Example request `params` ```javascript theme={null} [ "0x5BAE9E" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/ronin/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["0x5BAE9E"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` # eth_maxPriorityFeePerGas Source: https://docs.moralis.com/rpc-nodes/ronin/eth-max-priority-fee-per-gas Returns a suggestion for the max priority fee per gas for dynamic fee transactions in wei. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/ronin/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_maxPriorityFeePerGas", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x59682f00" } ``` # eth_sendRawTransaction Source: https://docs.moralis.com/rpc-nodes/ronin/eth-send-raw-transaction Submits a pre-signed transaction for broadcast to the network. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **data** `string` *required* The signed transaction data #### Example request `params` ```javascript theme={null} [ "0xf869808504e3b2928082520894f0109fc8df283027b6285cc889f5aa624eac1f55843b9aca008025a0c9cf86333bcb065d140032ecaab5d9281bde80f21b9687b3e94161de42d51895a0727a108a0b8d101465414033c3f705a9c7b826e596766046ee1183dbc8aeaa68" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/ronin/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["0xf869808504e3b2928082520894f0109fc8df283027b6285cc889f5aa624eac1f55843b9aca008025a0c9cf86333bcb065d140032ecaab5d9281bde80f21b9687b3e94161de42d51895a0727a108a0b8d101465414033c3f705a9c7b826e596766046ee1183dbc8aeaa68"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" } ``` # Overview Source: https://docs.moralis.com/rpc-nodes/ronin/overview Explore Ronin JSON-RPC methods ## Introduction Ronin is a blockchain built by Sky Mavis, designed specifically to power Axie Infinity and other decentralized applications (dApps). It provides an easy-to-use experience with low fees, fast transactions, and high security, making it ideal for gaming and NFT applications. ## Supported Networks The Ronin RPC API is available for the following networks: 1. **Ronin Mainnet** 2. **Ronin Saigon Testnet** ## Network Details | **Network** | **Chain ID** | **Path Parameter** | | :- | :- | :- | | **Ronin Mainnet** | 0x7e4 (2020) | `ronin` | | **Ronin Saigon** | 0x7e5 (2021) | `ronin-testnet` | ## Supported RPC Methods * [eth\_blockNumber](/rpc-nodes/ronin/eth-blockNumber) * [eth\_call](/rpc-nodes/ronin/eth-call) * [eth\_chainId](/rpc-nodes/ronin/eth-chain-id) * [eth\_createAccessList](/rpc-nodes/ronin/eth-create-access-list) * [eth\_estimateGas](/rpc-nodes/ronin/eth-estimate-gas) * [eth\_feeHistory](/rpc-nodes/ronin/eth-fee-history) * [eth\_gasPrice](/rpc-nodes/ronin/eth-gas-price) * [eth\_getBalance](/rpc-nodes/ronin/eth-get-balance) * [eth\_getBlockByHash](/rpc-nodes/ronin/eth-get-block-by-hash) * [eth\_getBlockByNumber](/rpc-nodes/ronin/eth-get-block-by-number) * [eth\_getBlockTransactionCountByHash](/rpc-nodes/ronin/eth-get-block-transaction-count-by-hash) * [eth\_getBlockTransactionCountByNumber](/rpc-nodes/ronin/eth-get-block-transaction-count-by-number) * [eth\_getBlockReceipts](/rpc-nodes/ronin/eth-get-block-receipts) * [eth\_getCode](/rpc-nodes/ronin/eth-get-code) * [eth\_getLogs](/streams/api-reference/history/get-logs) * [eth\_getProof](/rpc-nodes/ronin/eth-get-proof) * [eth\_getStorageAt](/rpc-nodes/ronin/eth-get-storage-at) * [eth\_getTransactionByHash](/rpc-nodes/ronin/eth-get-transaction-by-hash) * [eth\_getTransactionByBlockHashAndIndex](/rpc-nodes/ronin/eth-get-transaction-by-block-hash-and-index) * [eth\_getTransactionByBlockNumberAndIndex](/rpc-nodes/ronin/eth-get-transaction-by-block-number-and-index) * [eth\_getTransactionCount](/rpc-nodes/ronin/eth-get-transaction-count) * [eth\_getTransactionReceipt](/rpc-nodes/ronin/eth-get-transaction-receipt) * [eth\_getUncleByBlockHashAndIndex](/rpc-nodes/ronin/eth-get-uncle-by-block-hash-and-index) * [eth\_getUncleByBlockNumberAndIndex](/rpc-nodes/ronin/eth-get-uncle-by-block-number-and-index) * [eth\_getUncleCountByBlockHash](/rpc-nodes/ronin/eth-get-uncle-count-by-block-hash) * [eth\_getUncleCountByBlockNumber](/rpc-nodes/ronin/eth-get-uncle-count-by-block-number) * [eth\_maxPriorityFeePerGas](/rpc-nodes/ronin/eth-max-priority-fee-per-gas) * [eth\_sendRawTransaction](/rpc-nodes/ronin/eth-send-raw-transaction) # RPC Node Supported Chains Source: https://docs.moralis.com/rpc-nodes/supported-chains Blockchain networks supported by Moralis RPC nodes for direct JSON-RPC access. ### RPC Node Supported Chains Moralis provides managed **RPC node access** for supported blockchains, enabling you to send JSON-RPC requests without operating your own infrastructure. RPC coverage focuses on: * Reliability * Performance * High-availability access to popular chains Use the table below to see which chains are supported by Moralis RPC nodes. ⚠️ **Moonbeam and Moonriver are deprecated.** Both chains stopped producing new blocks on August 1, 2026, and Moralis support is removed on **September 25, 2026**, following Moonbeam's network relaunch on Base. GLMR and MOVR are now ERC-20 tokens on Base, so migrate to the `base` chain parameter and export any history you still need before that date. See the [deprecation notice](/changelog#moonbeam-moonriver-and-lisk-support-ends-september-25-2026) for contract addresses and details. ⚠️ **Lisk is deprecated.** Moralis support for Lisk ( `0x46f`) is removed on **September 25, 2026**, ahead of the Lisk Chain wind-down. Migrate to the `eth` or `base` chain parameter and export any history you still need before that date. See the [deprecation notice](/changelog#moonbeam-moonriver-and-lisk-support-ends-september-25-2026) for the full timeline. | Chain Name | Type | Chain ID | RPC Supported | Path Parameter | | - | - | - | - | - | | Ethereum Mainnet | Mainnet | 0x1 (1) | ✓ | `eth` | | Ethereum Sepolia | Testnet | 0xaa36a7 (11155111) | ✓ | `sepolia` | | Polygon Mainnet | Mainnet | 0x89 (137) | ✓ | `polygon` | | Polygon Amoy | Testnet | 0x13882 (80002) | ✓ | `amoy` | | Binance Smart Chain Mainnet | Mainnet | 0x38 (56) | ✓ | `bsc` | | Binance Smart Chain Testnet | Testnet | 0x61 (97) | ✓ | `bsc-testnet` | | Arbitrum | Mainnet | 0xa4b1 (42161) | ✓ | `arbitrum` | | Arbitrum Sepolia | Testnet | 0x66eee (421614) | ✓ | `arbitrum-sepolia` | | Base | Mainnet | 0x2105 (8453) | ✓ | `base` | | Base Sepolia | Testnet | 0x14a34 (84532) | ✓ | `base-sepolia` | | Optimism | Mainnet | 0xa (10) | ✓ | `optimism` | | Optimism Sepolia | Testnet | 0xaa37dc (11155420) | ✓ | `optimism-sepolia` | | Linea | Mainnet | 0xe708 (59144) | ✓ | `linea` | | Avalanche | Mainnet | 0xa86a (43114) | ✓ | `avalanche` | | Cronos Mainnet | Mainnet | 0x19 (25) | ✗ | N/A | | Gnosis | Mainnet | 0x64 (100) | ✓ | `gnosis` | | Chiliz Mainnet | Mainnet | 0x15b38 (88888) | ✗ | N/A | | Moonbeam (deprecated) | Mainnet | 0x504 (1284) | ✓ | `moonbeam` | | Moonriver (deprecated) | Testnet | 0x505 (1285) | ✓ | `moonriver` | | Blast | Mainnet | 0x13e31 (81457) | ✓ | `blast` | | Blast Sepolia | Testnet | 0xa0c71fd (168587773) | ✓ | `blast-sepolia` | | zkSync | Mainnet | 0x144 (324) | ✓ | `zksync` | | zkSync Sepolia | Testnet | 0x12c (300) | ✓ | `zksync-sepolia` | | Mantle | Mainnet | 0x1388 (5000) | ✓ | `mantle` | | Mantle Sepolia | Testnet | 0x138b (5003) | ✓ | `mantle-sepolia` | | opBNB | Mainnet | 0xcc (204) | ✓ | `opbnb` | | Polygon zkEVM | Mainnet | 0x44d (1101) | ✓ | `polygon-zkevm` | | Polygon zkEVM Cardona | Testnet | 0x98a (2442) | ✓ | `polygon-zkevm-cardona` | | Flow | Mainnet | 0x2eb (747) | ✓ | `flow` | | Flow Testnet | Testnet | 0x221 (545) | ✓ | `flow-testnet` | | Ronin | Mainnet | 0x7e4 (2020) | ✓ | `ronin` | | Ronin Saigon Testnet | Testnet | 0x7e5 (2021) | ✓ | `ronin-testnet` | | Lisk (deprecated) | Mainnet | 0x46f (1135) | ✓ | `lisk` | | Pulsechain | Mainnet | 0x171 (369) | ✓ | `pulse` | | HyperEVM | Mainnet | 0x3e7 (999) | ✗ | N/A | | Sei | Mainnet | 0x531 (1329) | ✗ | N/A | | Monad | Mainnet | 0x8f (143) | ✗ | N/A | # eth_blockNumber Source: https://docs.moralis.com/rpc-nodes/zksync/eth-blockNumber Returns the number of most recent block. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request body No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/zksync/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x4b7" } ``` # eth_call Source: https://docs.moralis.com/rpc-nodes/zksync/eth-call Executes a new message call immediately without creating a transaction on the blockchain. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **from** `string` The address the transaction is sent from **to** `string` *required* The address the transaction is directed to **gas** `string` Integer of the gas provided for the transaction execution **gasPrice** `string` Integer of the gasPrice used for each paid gas **value** `string` Integer of the value sent with this transaction **data** `string` Hash of the method signature and encoded parameters **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ { "from": "0x0000000000000000000000000000000000000000", "to": "0x0000000000000000000000000000000000000000", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0x" }, "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/zksync/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_call", "params": [{"from": "0xb60e8dd61c5d32be8058bb8eb970870f07233155", "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"}, "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x15536ee" } ``` # eth_chainId Source: https://docs.moralis.com/rpc-nodes/zksync/eth-chain-id Returns the chain ID of the current connected node as described in EIP-695. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request body No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/zksync/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_chainId", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` # eth_createAccessList Source: https://docs.moralis.com/rpc-nodes/zksync/eth-create-access-list Creates an access list that you can include in a transaction. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **from** `string` The address the transaction is sent from **to** `string` The address the transaction is directed to **gas** `string` Integer of the gas provided for the transaction execution **gasPrice** `string` Integer of the gasPrice used for each paid gas **maxPriorityFeePerGas** `string` Maximum fee per gas the sender is willing to pay to miners **maxFeePerGas** `string` Maximum total fee per gas the sender is willing to pay **value** `string` Integer of the value sent with this transaction **data** `string` Hash of the method signature and encoded parameters **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ { "from": "0x8ba1f109551bd432803012645haca66c9834d7c6", "to": "0x6b175474e89094c44da98b954eedeac495271d0f", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0xa9059cbb0000000000000000000000008ba1f109551bd432803012645haca66c9834d7c60000000000000000000000000000000000000000000000000de0b6b3a7640000" }, "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/zksync/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_createAccessList", "params": [{"from": "0x8ba1f109551bd432803012645haca66c9834d7c6", "to": "0x6b175474e89094c44da98b954eedeac495271d0f", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0xa9059cbb0000000000000000000000008ba1f109551bd432803012645haca66c9834d7c60000000000000000000000000000000000000000000000000de0b6b3a7640000"}, "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "accessList": [ { "address": "0x6b175474e89094c44da98b954eedeac495271d0f", "storageKeys": [ "0x0000000000000000000000000000000000000000000000000000000000000000" ] } ], "gasUsed": "0x7671" } } ``` # eth_estimateGas Source: https://docs.moralis.com/rpc-nodes/zksync/eth-estimate-gas Generates and returns an estimate of how much gas is necessary to allow the transaction to complete. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **from** `string` The address the transaction is sent from **to** `string` The address the transaction is directed to **gas** `string` Integer of the gas provided for the transaction execution **gasPrice** `string` Integer of the gasPrice used for each paid gas **value** `string` Integer of the value sent with this transaction **data** `string` Hash of the method signature and encoded parameters **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ { "from": "0x8D97689C9818892B700e27F316cc3E41e17fBeb9", "to": "0xd3CdA913deB6f67967B99D67aCDFa1712C293601", "value": "0x186a0" }, "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/zksync/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_estimateGas", "params": [{"from": "0x8D97689C9818892B700e27F316cc3E41e17fBeb9", "to": "0xd3CdA913deB6f67967B99D67aCDFa1712C293601", "value": "0x186a0"}, "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x5208" } ``` # eth_feeHistory Source: https://docs.moralis.com/rpc-nodes/zksync/eth-fee-history Returns historical gas information for a range of blocks. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockCount** `string` *required* Number of blocks in the requested range **newestBlock** `string` *required* Highest number block of the requested range **rewardPercentiles** `array` Array of percentile values to sample from each block's effective priority fees per gas #### Example request `params` ```javascript theme={null} [ "0x4", "latest", [25, 75] ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/zksync/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_feeHistory", "params": ["0x4", "latest", [25, 75]], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": [ "0x7", "0x7", "0x7", "0x7", "0x7" ], "gasUsedRatio": [ 0.026089875, 0.406803, 0.010817, 0.5 ], "baseFeePerBlobGas": [ "0x3319eb", "0x350c54", "0x364072", "0x364072", "0x32279d" ], "blobGasUsedRatio": [ 0.47619047619047616, 0.2857142857142857, 0, 0.3333333333333333 ], "oldestBlock": "0x11b9231", "reward": [ ["0x4a817c800", "0x4a817c800"], ["0x773593c0", "0x773593c0"], ["0x0", "0x0"], ["0x0", "0x0"] ] } } ``` # eth_gasPrice Source: https://docs.moralis.com/rpc-nodes/zksync/eth-gas-price Returns the current price per gas in wei. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/zksync/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x09184e72a000" } ``` # eth_getBalance Source: https://docs.moralis.com/rpc-nodes/zksync/eth-get-balance Returns the balance of the account of given address. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address to check for balance **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/zksync/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0234c8a3397aab58" } ``` # eth_getBlockByHash Source: https://docs.moralis.com/rpc-nodes/zksync/eth-get-block-by-hash Returns information about a block by hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block **fullTransactionObjects** `boolean` *required* If true it returns the full transaction objects, if false only the hashes of the transactions #### Example request `params` ```javascript theme={null} [ "0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c", false ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/zksync/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c", false], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x3319bb0", "blobGasUsed": "0x120000", "difficulty": "0x0", "excessBlobGas": "0xa576243", "extraData": "0xe29ca82051756173617220287175617361722e77696e2920e29ca8", "gasLimit": "0x3938700", "gasUsed": "0x2965eaa", "hash": "0xc319ec0da50d354ce425b63fb6914a42aafdb9ee9807518edd595809e25fbe38", "logsBloom": "0x7feeeb37793b4fdfff7ab7aefde2d7fdfff9575bfef5bdff3fb97bfef7bcddbbdf9d55e77fdf7ead7b98ffd9bb6fefff7e77b163bf9eeebdddd1ffbf376cfbeb7efffef83ffbe9eb7ff7776ab3dcf8bfee7ebaddfffdf7fe3fffdf6ed3f7dff77cf2fd7efffff7a19ef7ffbbe3e8befdb7fff76b6ed6e7ffceeb99ff7eeb5efebfff3fff7da1fb39f9fff3fd7f3f77b6dd0bed39f5fff3bfa7fbbce7f9f6ec6e0fff50bfe7f9f79efff35ff6d93fecfefbffdaf7b7eff35ec6ff42fe7e6f77f7deff7eff57f6aafa597feebdffff7bbd677e27ffbfadfdf57f7e7d2aeeffffff6676ffa7f3f375eb95eecf9ffa235cbfcdefafbf8feed9dc7b56ff2fdfedfefe", "miner": "0x396343362be2a4da1ce0c1c210945346fb82aa49", "mixHash": "0x07444bb5750f746e200e1dcd8d83221b26576d3357b833cc1e434e7966d0e774", "nonce": "0x0000000000000000", "number": "0x1736791", "parentBeaconBlockRoot": "0x2759f248e2d1cb1a2f5c2657c4efcc623dd8ea7f23e8700162e7fccdacedfd5d", "parentHash": "0xdf0e4dee910167d7b1687a6cb677983ce7ed351ae78ab7e2c5ba39d793c80391", "receiptsRoot": "0x5f1c58e498161509245daad0f60319d9abab7f04d2ca60e99a3674cfdc9b8327", "requestsHash": "0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x1ef1e", "stateRoot": "0x728c7e38107037b573d719e67b6872ee3ca4e01b47818598316cd696bfe24f2c", "timestamp": "0x697b4bcb", "transactions": [ "0xbf7bd0cf98c3b65525f1f7267b1d02e7ccd7cd133b137f46723a91cf187616d5", "0x06ac9281da76d530aa19600e2c34aae7564a78702d3eb52b1fb363985473e296" ], "transactionsRoot": "0xa8c680f6ad8ccc7a49db5ab76cbd9194c88e16dbcfa440104f7787e5ba815c4f", "uncles": [], "withdrawals": [ { "index": "0x6f78bfb", "validatorIndex": "0x955f5", "address": "0x5d3ca1842d0988816434ea51ca420182f3f1e31a", "amount": "0x102d2f1" } ], "withdrawalsRoot": "0x9b7ecf1ba575fc02e4b4c14bd65d5ca95c0e066adaae3fc2ef16f5acd90214d8" } } ``` # eth_getBlockByNumber Source: https://docs.moralis.com/rpc-nodes/zksync/eth-get-block-by-number Returns information about a block by block number. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" **fullTransactionObjects** `boolean` *required* If true it returns the full transaction objects, if false only the hashes of the transactions #### Example request `params` ```javascript theme={null} [ "0x1b4", true ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/zksync/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["0x1b4", true], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x3319bb0", "blobGasUsed": "0x120000", "difficulty": "0x0", "excessBlobGas": "0xa576243", "extraData": "0xe29ca82051756173617220287175617361722e77696e2920e29ca8", "gasLimit": "0x3938700", "gasUsed": "0x2965eaa", "hash": "0xc319ec0da50d354ce425b63fb6914a42aafdb9ee9807518edd595809e25fbe38", "logsBloom": "0x7feeeb37793b4fdfff7ab7aefde2d7fdfff9575bfef5bdff3fb97bfef7bcddbbdf9d55e77fdf7ead7b98ffd9bb6fefff7e77b163bf9eeebdddd1ffbf376cfbeb7efffef83ffbe9eb7ff7776ab3dcf8bfee7ebaddfffdf7fe3fffdf6ed3f7dff77cf2fd7efffff7a19ef7ffbbe3e8befdb7fff76b6ed6e7ffceeb99ff7eeb5efebfff3fff7da1fb39f9fff3fd7f3f77b6dd0bed39f5fff3bfa7fbbce7f9f6ec6e0fff50bfe7f9f79efff35ff6d93fecfefbffdaf7b7eff35ec6ff42fe7e6f77f7deff7eff57f6aafa597feebdffff7bbd677e27ffbfadfdf57f7e7d2aeeffffff6676ffa7f3f375eb95eecf9ffa235cbfcdefafbf8feed9dc7b56ff2fdfedfefe", "miner": "0x396343362be2a4da1ce0c1c210945346fb82aa49", "mixHash": "0x07444bb5750f746e200e1dcd8d83221b26576d3357b833cc1e434e7966d0e774", "nonce": "0x0000000000000000", "number": "0x1736791", "parentBeaconBlockRoot": "0x2759f248e2d1cb1a2f5c2657c4efcc623dd8ea7f23e8700162e7fccdacedfd5d", "parentHash": "0xdf0e4dee910167d7b1687a6cb677983ce7ed351ae78ab7e2c5ba39d793c80391", "receiptsRoot": "0x5f1c58e498161509245daad0f60319d9abab7f04d2ca60e99a3674cfdc9b8327", "requestsHash": "0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x1ef1e", "stateRoot": "0x728c7e38107037b573d719e67b6872ee3ca4e01b47818598316cd696bfe24f2c", "timestamp": "0x697b4bcb", "transactions": [ "0xbf7bd0cf98c3b65525f1f7267b1d02e7ccd7cd133b137f46723a91cf187616d5", "0x06ac9281da76d530aa19600e2c34aae7564a78702d3eb52b1fb363985473e296" ], "transactionsRoot": "0xa8c680f6ad8ccc7a49db5ab76cbd9194c88e16dbcfa440104f7787e5ba815c4f", "uncles": [], "withdrawals": [ { "index": "0x6f78bfb", "validatorIndex": "0x955f5", "address": "0x5d3ca1842d0988816434ea51ca420182f3f1e31a", "amount": "0x102d2f1" } ], "withdrawalsRoot": "0x9b7ecf1ba575fc02e4b4c14bd65d5ca95c0e066adaae3fc2ef16f5acd90214d8" } } ``` # eth_getBlockReceipts Source: https://docs.moralis.com/rpc-nodes/zksync/eth-get-block-receipts Returns all transaction receipts for a given block. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" #### Example request `params` ```javascript theme={null} [ "0xf21d9c" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/zksync/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockReceipts", "params": ["0xf21d9c"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": [ { "blockHash": "0x8243343df08b9751f5ca0c5f8c9c0460d8a9b6351066fae0acbd4d3e776de8bb", "blockNumber": "0xf21d9c", "contractAddress": null, "cumulativeGasUsed": "0x5208", "effectiveGasPrice": "0x1dcd6500", "from": "0x8ba1f109551bd432803012645haca66c9834d7c6", "gasUsed": "0x5208", "logs": [], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "status": "0x1", "to": "0x95cED938F7991cd0dFcb48F0a06a40FA1aF46EBC", "transactionHash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "transactionIndex": "0x0", "type": "0x2" } ] } ``` # eth_getBlockTransactionCountByHash Source: https://docs.moralis.com/rpc-nodes/zksync/eth-get-block-transaction-count-by-hash Returns the number of transactions in a block from a block matching the given block hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block #### Example request `params` ```javascript theme={null} [ "0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/zksync/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` # eth_getBlockTransactionCountByNumber Source: https://docs.moralis.com/rpc-nodes/zksync/eth-get-block-transaction-count-by-number Returns the number of transactions in a block matching the given block number. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" #### Example request `params` ```javascript theme={null} [ "0xe8" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/zksync/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["0xe8"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` # eth_getCode Source: https://docs.moralis.com/rpc-nodes/zksync/eth-get-code Returns code at a given address. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address to get the code from **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x2" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/zksync/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getCode", "params": ["0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x2"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x600160008035811a818181146012578301005b601b6001356025565b8060005260206000f25b600060078202905091905056" } ``` # eth_getLogs Source: https://docs.moralis.com/rpc-nodes/zksync/eth-get-logs Returns an array of all logs matching a given filter object. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **fromBlock** `string` Integer block number, or "latest" for the last mined block or "pending", "earliest" for not yet mined transactions **toBlock** `string` Integer block number, or "latest" for the last mined block or "pending", "earliest" for not yet mined transactions **address** `string` Contract address or a list of addresses from which logs should originate **topics** `array` Array of 32 Bytes DATA topics. Topics are order-dependent **blockhash** `string` Using blockhash is equivalent to fromBlock = toBlock = the block number with hash blockhash #### Example request `params` ```javascript theme={null} [ { "fromBlock": "0x1", "toBlock": "0x2", "address": "0x8888f1f195afa192cfee860698584c030f4c9db1", "topics": [ "0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", null, [ "0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x0000000000000000000000000aff3454fce5edbc8cca8697c15331677e6ebccc" ] ] } ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/zksync/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getLogs", "params": [{"fromBlock": "0x1", "toBlock": "0x2", "address": "0x8888f1f195afa192cfee860698584c030f4c9db1", "topics": ["0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", null, ["0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x0000000000000000000000000aff3454fce5edbc8cca8697c15331677e6ebccc"]]}], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": [ { "logIndex": "0x1", "blockNumber": "0x1b4", "blockHash": "0x8216c5785ac562ff41e2dcfdf5785ac562ff41e2dcfdf829c5a142f1fccd7d", "transactionHash": "0xdf829c5a142f1fccd7d8216c5785ac562ff41e2dcfdf5785ac562ff41e2dcf", "transactionIndex": "0x0", "address": "0x16c5785ac562ff41e2dcfdf829c5a142f1fccd7d", "data": "0x0000000000000000000000000000000000000000000000000000000000000000", "topics": [ "0x59ebeb90bc63057b6515673c3ecf9438e5058bca0f92585014eced636878c9a5" ] } ] } ``` # eth_getProof Source: https://docs.moralis.com/rpc-nodes/zksync/eth-get-proof Returns the account and storage values of the specified account including the Merkle-proof. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address of the account or contract **storageKeys** `array` *required* Array of storage-keys which should be proofed and included **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842", [ "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421" ], "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/zksync/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getProof", "params": ["0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842", ["0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"], "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "address": "0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842", "accountProof": [ "0xf90211a090dcaf88c40c7bbc95a912cbdde67c175767b31173df9ee4b0d733bfdd511c43a0babe369f6b12092f49181ae04ca173fb68d1a5456f18d20fa32cba73954052bda0473ecf8a7e36a829e75039a3b055e51b8332cbf03324ab4af2066bbd6fbf0021fa0bbda34753d7aa6c38e603f360244e8f59611921d9e1f128372fec0d586d4f9e0a04e44caecff45c9891f74f6a2156735886eedf6f1a733628ebc802ec79d844648a0a5f3f2f7542148c973977c8a1e154c4300fec92f755f7846f1b734d3ab1d90e7a0e823850f50bf72baae9d1733a36a444ab65d0a6faaba404f0583ce0ca4dad92da0f7a00cbe7d4b30b11faea3ae61b7f1f2b315017e79a3de5ab2dc8bb46a59fdb37a09b3b8d0e0e4c1e3b2d3e8f7c6e5d4c3b2a1e0f9e8d7c6b5a4e3f2e1d0c9b8a7a0b1f8e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0a0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0a0d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a08080" ], "balance": "0x0", "codeHash": "0x5e61b0f7919ab4e6fc7cfa6f3f5f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f", "nonce": "0x0", "storageHash": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "storageProof": [ { "key": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "value": "0x1", "proof": [ "0xf90211a090dcaf88c40c7bbc95a912cbdde67c175767b31173df9ee4b0d733bfdd511c43a0babe369f6b12092f49181ae04ca173fb68d1a5456f18d20fa32cba73954052bda0473ecf8a7e36a829e75039a3b055e51b8332cbf03324ab4af2066bbd6fbf0021fa0bbda34753d7aa6c38e603f360244e8f59611921d9e1f128372fec0d586d4f9e0a04e44caecff45c9891f74f6a2156735886eedf6f1a733628ebc802ec79d844648a0a5f3f2f7542148c973977c8a1e154c4300fec92f755f7846f1b734d3ab1d90e7a0e823850f50bf72baae9d1733a36a444ab65d0a6faaba404f0583ce0ca4dad92da0f7a00cbe7d4b30b11faea3ae61b7f1f2b315017e79a3de5ab2dc8bb46a59fdb37a09b3b8d0e0e4c1e3b2d3e8f7c6e5d4c3b2a1e0f9e8d7c6b5a4e3f2e1d0c9b8a7a0b1f8e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0a0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0a0d7c6b5a4e3f2e1d0c9b8a7a6f5e4d3c2b1a0f9e8d7c6b5a4e3f2e1d0c9b8a7a08080" ] } ] } } ``` # eth_getStorageAt Source: https://docs.moralis.com/rpc-nodes/zksync/eth-get-storage-at Returns the value from a storage position at a given address. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address of the storage **position** `string` *required* Integer of the position in the storage **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x0", "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/zksync/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x0", "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x00000000000000000000000000000000000000000000000000000000000004d2" } ``` # eth_getTransactionByBlockHashAndIndex Source: https://docs.moralis.com/rpc-nodes/zksync/eth-get-transaction-by-block-hash-and-index Returns information about a transaction by block hash and transaction index position. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block **index** `string` *required* Integer of the transaction index position #### Example request `params` ```javascript theme={null} [ "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/zksync/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5daf3b", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "gas": "0xc350", "gasPrice": "0x4a817c800", "hash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "input": "0x68656c6c6f21", "nonce": "0x15", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "transactionIndex": "0x0", "value": "0xf3dbb76162000", "v": "0x25", "r": "0x1b5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5", "s": "0x5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5c5" } } ``` # eth_getTransactionByBlockNumberAndIndex Source: https://docs.moralis.com/rpc-nodes/zksync/eth-get-transaction-by-block-number-and-index Returns information about a transaction by block number and transaction index position. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* A block number, or the string "earliest", "latest" or "pending" **index** `string` *required* The transaction index position #### Example request `params` ```javascript theme={null} [ "0x5BAE9E", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/zksync/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["0x5BAE9E", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5BAE9E", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "gas": "0xc350", "gasPrice": "0x4a817c800", "hash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "input": "0x68656c6c6f21", "nonce": "0x15", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "transactionIndex": "0x0", "value": "0xf3dbb76162000", "v": "0x25", "r": "0x1b5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5", "s": "0x5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5c5" } } ``` # eth_getTransactionByHash Source: https://docs.moralis.com/rpc-nodes/zksync/eth-get-transaction-by-hash Returns the information about a transaction requested by transaction hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a transaction #### Example request `params` ```javascript theme={null} [ "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/zksync/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5daf3b", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "gas": "0xc350", "gasPrice": "0x4a817c800", "hash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "input": "0x68656c6c6f21", "nonce": "0x15", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "transactionIndex": "0x41", "value": "0xf3dbb76162000", "v": "0x25", "r": "0x1b5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5", "s": "0x5e176d927f8b73e1c20c2e8d6f80c5c5e0f2e5c5e0f2e5c5e0f2e5c5e0f2e5c5" } } ``` # eth_getTransactionCount Source: https://docs.moralis.com/rpc-nodes/zksync/eth-get-transaction-count Returns the number of transactions sent from an address. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **address** `string` *required* Address to get transaction count for **tag** `string` Tag for the state ("latest", "earliest", "pending"). Defaults to "latest" if null #### Example request `params` ```javascript theme={null} [ "0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/zksync/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` # eth_getTransactionReceipt Source: https://docs.moralis.com/rpc-nodes/zksync/eth-get-transaction-receipt Returns the receipt of a transaction by transaction hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a transaction #### Example request `params` ```javascript theme={null} [ "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/zksync/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "transactionHash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "transactionIndex": "0x41", "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5daf3b", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "cumulativeGasUsed": "0x33bc", "gasUsed": "0x4dc", "contractAddress": null, "logs": [], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "status": "0x1" } } ``` # eth_getUncleByBlockHashAndIndex Source: https://docs.moralis.com/rpc-nodes/zksync/eth-get-uncle-by-block-hash-and-index Returns information about an uncle of a block by hash and uncle index position. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block **index** `string` *required* The uncle's index position #### Example request `params` ```javascript theme={null} [ "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/zksync/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x027f07", "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000", "gasLimit": "0x9f759", "gasUsed": "0x9f759", "hash": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331", "logsBloom": "0x1a060020000015554c000200000003050000200017041014032020801000056020000001000a00d0020204040020012150010010000000280005000c00000000000020c0000000024008104011000080020020000001006100900000024208002000020002100000000000000080000000120080000002003c0000200000000200002010008300300001001031100100040010420000800000000014000004002000000c040200060000000080000000100000000040a2000001000061000042021080400200000410000404080800014008201000c20100500020011000000030001100100024008c80190400402008000020000c0041104218100000000000000002000800000", "miner": "0x4e65fda2159562a496f9f3522f89122a3088497a", "mixHash": "0x99e9d85137db46ef1e85fff042bb15a7b6f46618b7f600b0b4e7fb52fceafc3a", "nonce": "0xfcf4db6d9bce1b8b", "number": "0x1b4", "parentHash": "0xa057c32b6ed8eb5e006cadfad55c7e635549c6e2135c4e6c3a9d5a6a80f72c3", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0x1a7e46b37b26e0c3f67ed4de3b5d3b1ff84a2e0a5e2dcf4d4b0d34b5a22b6e3", "timestamp": "0x55ba467c", "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` # eth_getUncleByBlockNumberAndIndex Source: https://docs.moralis.com/rpc-nodes/zksync/eth-get-uncle-by-block-number-and-index Returns information about an uncle of a block by number and uncle index position. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* A block number, or the string "earliest", "latest" or "pending" **index** `string` *required* The uncle's index position #### Example request `params` ```javascript theme={null} [ "0x29c", "0x0" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/zksync/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["0x29c", "0x0"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x027f07", "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000", "gasLimit": "0x9f759", "gasUsed": "0x9f759", "hash": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331", "logsBloom": "0x1a060020000015554c000200000003050000200017041014032020801000056020000001000a00d0020204040020012150010010000000280005000c00000000000020c0000000024008104011000080020020000001006100900000024208002000020002100000000000000080000000120080000002003c0000200000000200002010008300300001001031100100040010420000800000000014000004002000000c040200060000000080000000100000000040a2000001000061000042021080400200000410000404080800014008201000c20100500020011000000030001100100024008c80190400402008000020000c0041104218100000000000000002000800000", "miner": "0x4e65fda2159562a496f9f3522f89122a3088497a", "mixHash": "0x99e9d85137db46ef1e85fff042bb15a7b6f46618b7f600b0b4e7fb52fceafc3a", "nonce": "0xfcf4db6d9bce1b8b", "number": "0x29c", "parentHash": "0xa057c32b6ed8eb5e006cadfad55c7e635549c6e2135c4e6c3a9d5a6a80f72c3", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0x1a7e46b37b26e0c3f67ed4de3b5d3b1ff84a2e0a5e2dcf4d4b0d34b5a22b6e3", "timestamp": "0x55ba467c", "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` # eth_getUncleCountByBlockHash Source: https://docs.moralis.com/rpc-nodes/zksync/eth-get-uncle-count-by-block-hash Returns the number of uncles in a block from a block matching the given block hash. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **hash** `string` *required* Hash of a block #### Example request `params` ```javascript theme={null} [ "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/zksync/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` # eth_getUncleCountByBlockNumber Source: https://docs.moralis.com/rpc-nodes/zksync/eth-get-uncle-count-by-block-number Returns the number of uncles in a block from a block matching the given block number. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **blockNumber** `string` *required* Integer of a block number, or the string "earliest", "latest" or "pending" #### Example request `params` ```javascript theme={null} [ "0x5BAE9E" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/zksync/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["0x5BAE9E"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` # eth_maxPriorityFeePerGas Source: https://docs.moralis.com/rpc-nodes/zksync/eth-max-priority-fee-per-gas Returns a suggestion for the max priority fee per gas for dynamic fee transactions in wei. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request No parameters required. ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/zksync/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_maxPriorityFeePerGas", "params": [], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x59682f00" } ``` # eth_sendRawTransaction Source: https://docs.moralis.com/rpc-nodes/zksync/eth-send-raw-transaction Submits a pre-signed transaction for broadcast to the network. #### Path parameters **apiKey** `string` *required* Your API key for authentication #### Request **data** `string` *required* The signed transaction data #### Example request `params` ```javascript theme={null} [ "0xf869808504e3b2928082520894f0109fc8df283027b6285cc889f5aa624eac1f55843b9aca008025a0c9cf86333bcb065d140032ecaab5d9281bde80f21b9687b3e94161de42d51895a0727a108a0b8d101465414033c3f705a9c7b826e596766046ee1183dbc8aeaa68" ] ``` ```shellscript curl theme={null} curl https://site1.moralis-nodes.com/zksync/:apiKey \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["0xf869808504e3b2928082520894f0109fc8df283027b6285cc889f5aa624eac1f55843b9aca008025a0c9cf86333bcb065d140032ecaab5d9281bde80f21b9687b3e94161de42d51895a0727a108a0b8d101465414033c3f705a9c7b826e596766046ee1183dbc8aeaa68"], "id": 1}' ``` ```json JSON theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" } ``` # Overview Source: https://docs.moralis.com/rpc-nodes/zksync/overview Explore zkSync JSON-RPC methods ## Introduction zkSync is a Layer 2 scaling solution for Ethereum that uses zero-knowledge rollups to provide low-cost, high-throughput transactions while maintaining the security of the Ethereum network. It enables developers to build scalable decentralized applications (dApps) with faster transaction finality and lower fees. zkSync’s architecture is ideal for decentralized finance (DeFi), NFTs, and other applications requiring high-speed processing. ## Supported Networks The zkSync RPC API is available for the following networks: 1. **zkSync Mainnet** 2. **zkSync Sepolia Testnet** ## Network Details | **Network** | **Chain ID** | **Path Parameter** | | :- | :- | :- | | **zkSync Mainnet** | 0x144 (324) | `zksync` | | **zkSync Sepolia** | 0x12c (300) | `zksync-sepolia` | ## Supported RPC Methods * [eth\_blockNumber](/rpc-nodes/zksync/eth-blockNumber) * [eth\_call](/rpc-nodes/zksync/eth-call) * [eth\_chainId](/rpc-nodes/zksync/eth-chain-id) * [eth\_createAccessList](/rpc-nodes/zksync/eth-create-access-list) * [eth\_estimateGas](/rpc-nodes/zksync/eth-estimate-gas) * [eth\_feeHistory](/rpc-nodes/zksync/eth-fee-history) * [eth\_gasPrice](/rpc-nodes/zksync/eth-gas-price) * [eth\_getBalance](/rpc-nodes/zksync/eth-get-balance) * [eth\_getBlockByHash](/rpc-nodes/zksync/eth-get-block-by-hash) * [eth\_getBlockByNumber](/rpc-nodes/zksync/eth-get-block-by-number) * [eth\_getBlockTransactionCountByHash](/rpc-nodes/zksync/eth-get-block-transaction-count-by-hash) * [eth\_getBlockTransactionCountByNumber](/rpc-nodes/zksync/eth-get-block-transaction-count-by-number) * [eth\_getBlockReceipts](/rpc-nodes/zksync/eth-get-block-receipts) * [eth\_getCode](/rpc-nodes/zksync/eth-get-code) * [eth\_getLogs](/streams/api-reference/history/get-logs) * [eth\_getProof](/rpc-nodes/zksync/eth-get-proof) * [eth\_getStorageAt](/rpc-nodes/zksync/eth-get-storage-at) * [eth\_getTransactionByHash](/rpc-nodes/zksync/eth-get-transaction-by-hash) * [eth\_getTransactionByBlockHashAndIndex](/rpc-nodes/zksync/eth-get-transaction-by-block-hash-and-index) * [eth\_getTransactionByBlockNumberAndIndex](/rpc-nodes/zksync/eth-get-transaction-by-block-number-and-index) * [eth\_getTransactionCount](/rpc-nodes/zksync/eth-get-transaction-count) * [eth\_getTransactionReceipt](/rpc-nodes/zksync/eth-get-transaction-receipt) * [eth\_getUncleByBlockHashAndIndex](/rpc-nodes/zksync/eth-get-uncle-by-block-hash-and-index) * [eth\_getUncleByBlockNumberAndIndex](/rpc-nodes/zksync/eth-get-uncle-by-block-number-and-index) * [eth\_getUncleCountByBlockHash](/rpc-nodes/zksync/eth-get-uncle-count-by-block-hash) * [eth\_getUncleCountByBlockNumber](/rpc-nodes/zksync/eth-get-uncle-count-by-block-number) * [eth\_maxPriorityFeePerGas](/rpc-nodes/zksync/eth-max-priority-fee-per-gas) * [eth\_sendRawTransaction](/rpc-nodes/zksync/eth-send-raw-transaction) # Streams Tutorials Source: https://docs.moralis.com/streams-tutorials Step-by-step tutorials for building real-time blockchain monitoring with Moralis Streams — wallets, tokens, NFTs, and smart contract events. ## Overview These tutorials show you how to set up real-time blockchain event monitoring using Moralis Streams, with complete code examples for common use cases. *** ### Wallet Monitoring > [card] [Monitor Wallet Activity](/get-started/tutorials/streams/wallet-monitoring/monitor-wallet-activity-in-real-time) > > Monitor wallet transactions in real time with webhooks. > [card] [Listen to All Addresses](/get-started/tutorials/streams/wallet-monitoring/listen-to-all-addresses) > > Stream events for all addresses without specifying contracts. > [card] [Monitor Multiple Addresses](/get-started/tutorials/streams/wallet-monitoring/monitor-multiple-addresses) > > Attach and manage multiple addresses on a single stream. > [card] [Get Native Balances](/get-started/tutorials/streams/wallet-monitoring/get-native-balances) > > Include native token balances in webhook payloads. > [card] [ENS Domain Registrations](/get-started/tutorials/streams/wallet-monitoring/monitor-high-value-ens-domain-registrations) > > Monitor high-value ENS domain registration events. *** ### Token Monitoring > [card] [Track ERC-20 Transfers](/get-started/tutorials/streams/token-monitoring/track-specific-erc-20-token-transfers-from-a-list-of-wallets) > > Track specific ERC-20 token transfers from a list of wallets. > [card] [High-Value ERC-20 Transfers](/get-started/tutorials/streams/token-monitoring/monitor-high-value-erc-20-transfers-in-real-time) > > Monitor ERC-20 transfers over a certain amount. > [card] [Token Mints & Burns](/get-started/tutorials/streams/token-monitoring/track-erc-20-token-mints-and-burns-in-real-time) > > Track ERC-20 token mints and burns in real time. > [card] [New Tokens & Trading Pairs](/get-started/tutorials/streams/token-monitoring/track-new-tokens-and-trading-pairs-in-real-time) > > Track new token and DEX pair creation events. *** ### NFT Monitoring > [card] [Track NFT Transfers](/get-started/tutorials/streams/nft-monitoring/track-nft-transfers-in-real-time) > > Monitor all NFT transfers chain-wide in real time. > [card] [NFT Transfers by Wallet](/get-started/tutorials/streams/nft-monitoring/monitoring-nft-transfers-from-specific-wallet-addresses) > > Filter NFT transfers from specific wallet addresses. > [card] [Track Specific NFTs](/get-started/tutorials/streams/nft-monitoring/track-specific-nfts-or-nft-collections-in-real-time) > > Monitor specific NFTs or collections by token ID. *** ### Smart Contracts & Events > [card] [Track Contract Events](/get-started/tutorials/streams/smart-contracts-and-events/track-smart-contract-events-in-real-time) > > Monitor all events from a contract factory in real time. *** ## Moralis Streams - Realtime Payments [Moralis Streams - Realtime Payments](https://www.youtube.com/embed/g1UmjmstSIA) # Add Address to Stream Source: https://docs.moralis.com/streams/api-reference/bitcoin/address/add-address-to-stream openapi-files/streams-api/streams.yaml POST /streams/bitcoin/{id}/address # Delete Address from Stream Source: https://docs.moralis.com/streams/api-reference/bitcoin/address/delete-address-from-stream openapi-files/streams-api/streams.yaml DELETE /streams/bitcoin/{id}/address # Get Addresses by Stream Source: https://docs.moralis.com/streams/api-reference/bitcoin/address/get-addresses-by-stream openapi-files/streams-api/streams.yaml GET /streams/bitcoin/{id}/address # Create Stream Source: https://docs.moralis.com/streams/api-reference/bitcoin/streams/create-streams openapi-files/streams-api/streams.yaml PUT /streams/bitcoin # Delete Stream Source: https://docs.moralis.com/streams/api-reference/bitcoin/streams/delete-stream openapi-files/streams-api/streams.yaml DELETE /streams/bitcoin/{id} # Get Stream by ID Source: https://docs.moralis.com/streams/api-reference/bitcoin/streams/get-stream-by-id openapi-files/streams-api/streams.yaml GET /streams/bitcoin/{id} # Get Streams Source: https://docs.moralis.com/streams/api-reference/bitcoin/streams/get-streams openapi-files/streams-api/streams.yaml GET /streams/bitcoin # Get Webhook Data by Block Number Source: https://docs.moralis.com/streams/api-reference/bitcoin/streams/get-webhook-data-by-block-number openapi-files/streams-api/streams.yaml POST /streams/bitcoin/{chainId}/block/{blockNumber} # Send Webhook Data by Block Number Source: https://docs.moralis.com/streams/api-reference/bitcoin/streams/send-webhook-data-by-block-number openapi-files/streams-api/streams.yaml POST /streams/bitcoin/{chainId}/block-to-webhook/{blockNumber}/{streamId} # Update Stream Source: https://docs.moralis.com/streams/api-reference/bitcoin/streams/update-stream openapi-files/streams-api/streams.yaml POST /streams/bitcoin/{id} # Update Stream Status Source: https://docs.moralis.com/streams/api-reference/bitcoin/streams/update-stream-status openapi-files/streams-api/streams.yaml POST /streams/bitcoin/{id}/status # Add Xpub to Stream Source: https://docs.moralis.com/streams/api-reference/bitcoin/xpub/add-xpub openapi-files/streams-api/streams.yaml POST /streams/bitcoin/{id}/xpub # Delete Xpub from Stream Source: https://docs.moralis.com/streams/api-reference/bitcoin/xpub/delete-xpub openapi-files/streams-api/streams.yaml DELETE /streams/bitcoin/{id}/xpub/{xpubId} # Get Xpubs by Stream Source: https://docs.moralis.com/streams/api-reference/bitcoin/xpub/get-xpubs openapi-files/streams-api/streams.yaml GET /streams/bitcoin/{id}/xpub # Get History Source: https://docs.moralis.com/streams/api-reference/history/get-history openapi-files/streams-api/streams.yaml GET /history Get all history # Get Logs Source: https://docs.moralis.com/streams/api-reference/history/get-logs openapi-files/streams-api/streams.yaml GET /history/logs Get All logs. # Replay History Source: https://docs.moralis.com/streams/api-reference/history/replay-history openapi-files/streams-api/streams.yaml POST /history/replay/{streamId}/{id} Replay a specific history. # Get Project Settings Source: https://docs.moralis.com/streams/api-reference/project/get-project-settings openapi-files/streams-api/streams.yaml GET /settings Get the settings for the current project based on the project api-key. # Set Project Settings Source: https://docs.moralis.com/streams/api-reference/project/set-project-settings openapi-files/streams-api/streams.yaml POST /settings Set the settings for the current project based on the project api-key. # Add Address to Stream Source: https://docs.moralis.com/streams/api-reference/solana/address/add-address-to-stream openapi-files/streams-api/streams.yaml POST /streams/solana/{id}/address > [!WARNING] > > Solana addresses are base58 and **case-sensitive**. Submit them in their original case — unlike EVM, lowercased addresses will not match. # Delete Address from Stream Source: https://docs.moralis.com/streams/api-reference/solana/address/delete-address-from-stream openapi-files/streams-api/streams.yaml DELETE /streams/solana/{id}/address # Get Addresses by Stream Source: https://docs.moralis.com/streams/api-reference/solana/address/get-addresses-by-stream openapi-files/streams-api/streams.yaml GET /streams/solana/{id}/address # Create Stream Source: https://docs.moralis.com/streams/api-reference/solana/streams/create-streams openapi-files/streams-api/streams.yaml PUT /streams/solana # Delete Stream Source: https://docs.moralis.com/streams/api-reference/solana/streams/delete-stream openapi-files/streams-api/streams.yaml DELETE /streams/solana/{id} # Get Stream by ID Source: https://docs.moralis.com/streams/api-reference/solana/streams/get-stream-by-id openapi-files/streams-api/streams.yaml GET /streams/solana/{id} # Get Streams Source: https://docs.moralis.com/streams/api-reference/solana/streams/get-streams openapi-files/streams-api/streams.yaml GET /streams/solana # Get Webhook Data by Block Number Source: https://docs.moralis.com/streams/api-reference/solana/streams/get-webhook-data-by-block-number openapi-files/streams-api/streams.yaml POST /streams/solana/{chainId}/block/{blockNumber} # Send Webhook Data by Block Number Source: https://docs.moralis.com/streams/api-reference/solana/streams/send-webhook-data-by-block-number openapi-files/streams-api/streams.yaml POST /streams/solana/{chainId}/block-to-webhook/{blockNumber}/{streamId} # Update Stream Source: https://docs.moralis.com/streams/api-reference/solana/streams/update-stream openapi-files/streams-api/streams.yaml POST /streams/solana/{id} # Update Stream Status Source: https://docs.moralis.com/streams/api-reference/solana/streams/update-stream-status openapi-files/streams-api/streams.yaml POST /streams/solana/{id}/status # Get Stats Source: https://docs.moralis.com/streams/api-reference/stats/get-stats openapi-files/streams-api/streams.yaml GET /stats Get the global stats for the account. # Get Stats by Stream Source: https://docs.moralis.com/streams/api-reference/stats/get-stats-by-stream openapi-files/streams-api/streams.yaml GET /stats/{streamId} Get the stats for the streamId specified # Add Address to Stream Source: https://docs.moralis.com/streams/api-reference/streams/add-address-to-stream openapi-files/streams-api/streams.yaml POST /streams/evm/{id}/address Adds an address to a Stream. # Create Stream Source: https://docs.moralis.com/streams/api-reference/streams/create-streams openapi-files/streams-api/streams.yaml PUT /streams/evm Creates a new evm stream. # Delete Address from Stream Source: https://docs.moralis.com/streams/api-reference/streams/delete-address-from-stream openapi-files/streams-api/streams.yaml DELETE /streams/evm/{id}/address Deletes an address from a Stream. # Delete Stream Source: https://docs.moralis.com/streams/api-reference/streams/delete-stream openapi-files/streams-api/streams.yaml DELETE /streams/evm/{id} Delete a specific evm stream. # Duplicate Stream Source: https://docs.moralis.com/streams/api-reference/streams/duplicate-stream openapi-files/streams-api/streams.yaml POST /streams/evm/{id}/duplicate Duplicate a specific evm stream. > [!NOTE] > > This endpoint is **EVM-only**. Bitcoin and Solana streams cannot be duplicated — recreate them via the chain-specific create endpoints ([Bitcoin](/streams/api-reference/bitcoin/streams/create-streams), [Solana](/streams/api-reference/solana/streams/create-streams)). # Get Addresses by Stream Source: https://docs.moralis.com/streams/api-reference/streams/get-addresses-by-stream openapi-files/streams-api/streams.yaml GET /streams/evm/{id}/address Get all addresses associated with a specific stream. # Get Stream by ID Source: https://docs.moralis.com/streams/api-reference/streams/get-stream-by-id openapi-files/streams-api/streams.yaml GET /streams/evm/{id} Get a specific evm stream. # Get All Streams Source: https://docs.moralis.com/streams/api-reference/streams/get-streams openapi-files/streams-api/streams.yaml GET /streams/evm Get all the evm streams for the current project based on the project api-key . # Get Webhook Data by Block Number Source: https://docs.moralis.com/streams/api-reference/streams/get-webhook-data-by-block-number openapi-files/streams-api/streams.yaml POST /streams/evm/{chainId}/block/{blockNumber} Get webhook data returned on the block number with provided stream config. # Replace Address on Stream Source: https://docs.moralis.com/streams/api-reference/streams/replace-address-on-stream openapi-files/streams-api/streams.yaml PATCH /streams/evm/{id}/address Replaces address from a Stream. > [!NOTE] > > This endpoint is **EVM-only**. For Bitcoin and Solana, use the chain-specific add and delete address endpoints ([Bitcoin](/streams/api-reference/bitcoin/address/add-address-to-stream), [Solana](/streams/api-reference/solana/address/add-address-to-stream)). # Send Webhook Data by Block Number Source: https://docs.moralis.com/streams/api-reference/streams/send-webhook-data-by-block-number openapi-files/streams-api/streams.yaml POST /streams/evm/{chainId}/block-to-webhook/{blockNumber}/{streamId} Execute. # Update Stream Source: https://docs.moralis.com/streams/api-reference/streams/update-stream openapi-files/streams-api/streams.yaml POST /streams/evm/{id} Updates a specific evm stream. # Update Stream Status Source: https://docs.moralis.com/streams/api-reference/streams/update-stream-status openapi-files/streams-api/streams.yaml POST /streams/evm/{id}/status Updates the status of specific evm stream. # Bitcoin Streams Source: https://docs.moralis.com/streams/bitcoin-streams Stream real-time Bitcoin transaction data directly to your application with webhooks, no node infrastructure, no polling, no missed blocks. ## Overview **Bitcoin Streams** extends Moralis Streams to the Bitcoin network, delivering real-time transaction data via webhooks. Moralis indexes Bitcoin automatically and pushes structured payloads to your endpoint whenever transactions match your criteria. Webhooks typically arrive within seconds of a block being mined — no node, no polling, no missed blocks. *** ## Key Features * **Real-time delivery:** end-to-end latency is typically under 10 seconds after a block is mined * **Mempool notifications:** unconfirmed transactions fire a webhook the moment they hit the mempool — react before the next block is mined * **Three-phase notifications:** matches can fire up to three times — first when the transaction is broadcast to the mempool (`block.hash: "mempool"`), again when it lands in a block (`confirmed: false`, near the chain tip), and finally after the 2-block confirmation depth (`confirmed: true`, reorg-safe) * **All address formats supported:** P2PKH (legacy, `1...`), P2SH (SegWit-wrapped, `3...`), and Bech32 native SegWit (`bc1q...`) * **Xpub support:** attach an extended public key to a stream and Moralis derives and monitors its addresses automatically — ideal for HD wallets * **Flexible monitoring:** watch specific addresses, attach an xpub, or enable firehose mode with `allAddresses` to receive every Bitcoin transaction * **Automatic retries:** Moralis retries webhook delivery until it receives an HTTP 200 response *** ## How It Works 1. A transaction is broadcast to the Bitcoin mempool. Moralis evaluates every mempool transaction against your registered addresses and xpubs 2. Matching mempool transactions fire a webhook with `confirmed: false` and the sentinel values `block.height: "0"` / `block.hash: "mempool"` — delivered once per stream 3. A new Bitcoin block is produced and Moralis evaluates every transaction in it against your registered addresses 4. Matching block transactions fire a webhook with `confirmed: false` and the real block `height` / `hash` — the block is close to the chain tip and could still be reorged 5. After 2 additional blocks have been mined on top, Moralis re-fetches the block and delivers a third webhook with `confirmed: true` — the transaction is now reorg-safe 6. Your service upserts on `txid` to reconcile the lifecycle, branching on `block.hash === "mempool"` for the mempool stage *** ## Webhook Payload Structure Each Bitcoin webhook payload contains: * **Block metadata** — hash, height, timestamp, difficulty, merkle root, transaction count * **Transaction details** — `txid`, input/output counts, locktime, version, block reference * **Outputs (`vout`)** — value in BTC (not satoshis), script type, recipient address * **Inputs (`vin`)** — structural fields only; `address` and `value` fields remain `null` * **Confirmation status** — `confirmed: false` for the near-tip delivery, `confirmed: true` once the block has cleared the 2-block confirmation depth > [!NOTE] > > Output values are represented as **BTC decimals** (e.g. `3.13258866`). To convert to satoshis, multiply by `1e8`: > > ```js theme={null} > const satoshis = Math.round(btc * 1e8); > ``` *** ## Mempool Notifications Bitcoin Streams emit webhook notifications for **unconfirmed transactions** as soon as they hit the mempool — no need to wait for block inclusion. The payload shape is identical to a confirmed-block webhook, with sentinel fields on the `block` object marking it as mempool: | Field | Mempool value | Confirmed-block value | | - | - | - | | `block.height` | `"0"` | real block height | | `block.hash` | `"mempool"` | real block hash | | `confirmed` | `false` | `false` then `true` | Everything else (`transactions[]`, `vin`, `vout`, addresses, value, fee) is populated normally. ### Example payload ```json theme={null} { "streamId": "cefa6529-e3ec-4ee8-8cbd-206d2e7ce64e", "chainId": "btc-mainnet", "confirmed": false, "block": { "height": "0", "hash": "mempool" }, "retries": 0, "transactions": [ ] } ``` ### Detecting mempool in your handler Branch on either sentinel field — `block.hash` is the most explicit: ```js theme={null} const isMempool = payload.block.hash === "mempool"; ``` ### Behavior * **Delivered at most once per stream** per matching mempool transaction * **No follow-up webhook on confirmation from the mempool delivery itself** — the regular confirmed-block stream handles `confirmed: false` (in-block) and `confirmed: true` (reorg-safe) for the same `txid` * **Mempool transactions are not guaranteed to confirm.** They can be evicted, replaced (RBF), or expire on low fee. Treat them as **pending**, not settled * **Matching covers both sends and receives.** In mempool payloads, `vin` and `vout` addresses are both populated, so a watched address triggers a match whether it is sending or receiving * **Xpub-derived addresses are fully supported** — addresses derived from an attached xpub match against the mempool the same way they do against confirmed blocks ### Getting started No new endpoint, parameter, or schema. Existing Bitcoin streams pick up mempool notifications automatically. Just branch on `block.hash === "mempool"` (or `block.height === "0"`) in your handler to separate mempool events from confirmed-block events. *** ## Configuration Parameters When creating a Bitcoin stream you specify: | Parameter | Description | | - | - | | `webhookUrl` | Public HTTPS endpoint that will receive payloads (required) | | `network` | Must be `["mainnet"]` as an array | | `includeInputs` | Include input structure in the payload | | `includeOutputs` | Include output structure in the payload | | `allAddresses` | Firehose mode — deliver every Bitcoin transaction | | `description` | Human-readable stream description | | `tag` | Identifier for routing / filtering on your side | *** ## API Endpoints All Bitcoin Streams endpoints require the `x-api-key` header. ### Streams | Method | Endpoint | Purpose | | - | - | - | | `PUT` | `/streams/bitcoin` | [Create a stream](/streams/api-reference/bitcoin/streams/create-streams) with a webhook URL and configuration | | `POST` | `/streams/bitcoin/{id}` | [Update a stream's](/streams/api-reference/bitcoin/streams/update-stream) configuration | | `POST` | `/streams/bitcoin/{id}/status` | [Pause or resume a stream](/streams/api-reference/bitcoin/streams/update-stream-status) | | `GET` | `/streams/bitcoin` | [List existing Bitcoin streams](/streams/api-reference/bitcoin/streams/get-streams) | | `GET` | `/streams/bitcoin/{id}` | [Get a stream by ID](/streams/api-reference/bitcoin/streams/get-stream-by-id) | | `DELETE` | `/streams/bitcoin/{id}` | [Remove a stream](/streams/api-reference/bitcoin/streams/delete-stream) | | `POST` | `/streams/bitcoin/{chainId}/block/{blockNumber}` | [Get webhook data for a historical block](/streams/api-reference/bitcoin/streams/get-webhook-data-by-block-number) | | `POST` | `/streams/bitcoin/{chainId}/block-to-webhook/{blockNumber}/{streamId}` | [Replay a historical block](/streams/api-reference/bitcoin/streams/send-webhook-data-by-block-number) for backfilling | ### Addresses | Method | Endpoint | Purpose | | - | - | - | | `GET` | `/streams/bitcoin/{id}/address` | [List addresses](/streams/api-reference/bitcoin/address/get-addresses-by-stream) attached to a stream | | `POST` | `/streams/bitcoin/{id}/address` | [Add an address](/streams/api-reference/bitcoin/address/add-address-to-stream) to monitor (one per request) | | `DELETE` | `/streams/bitcoin/{id}/address` | [Remove an address](/streams/api-reference/bitcoin/address/delete-address-from-stream) from a stream | ### Xpub | Method | Endpoint | Purpose | | - | - | - | | `GET` | `/streams/bitcoin/{id}/xpub` | [List xpubs](/streams/api-reference/bitcoin/xpub/get-xpubs) attached to a stream | | `POST` | `/streams/bitcoin/{id}/xpub` | [Add an xpub](/streams/api-reference/bitcoin/xpub/add-xpub) to derive and monitor addresses from | | `DELETE` | `/streams/bitcoin/{id}/xpub/{xpubId}` | [Remove an xpub](/streams/api-reference/bitcoin/xpub/delete-xpub) from a stream | *** ## Limitations > [!WARNING] > > Bitcoin Streams has a few behaviors that differ from EVM Streams — plan your consumer around them. * **Input data is not populated.** Even with `includeInputs: true`, input `address` and `value` fields return `null`. You can reliably detect **inbound** transfers to watched addresses, not outflows. * **`isCoinbase` is always `false`.** The `isCoinbase` field does not reliably identify coinbase transactions. Detect coinbase transactions using a heuristic: the transaction contains an `OP_RETURN` output **and** has exactly one input. * **Values are BTC decimals.** Output values are not denominated in satoshis. Convert with `Math.round(btc * 1e8)` before feeding integer-based ledger systems. * **Mainnet only.** The `network` parameter must be `["mainnet"]`. *** ## Processing Patterns ### Branching on mempool vs. confirmed block A single `txid` can arrive up to three times: once from the mempool, once on block inclusion, and once on reorg-safe confirmation. Branch on the `block.hash` sentinel before doing any block-specific work: ```js theme={null} if (payload.block.hash === "mempool") { // pending: tx broadcast but not yet mined } else if (payload.confirmed === false) { // included in a block near the chain tip — could still reorg } else { // reorg-safe — safe to persist } ``` ### Deduplication Use the transaction id (`txid`) as your natural deduplication key. Upsert on each delivery, advancing your state machine through `mempool` → `in-block` → `confirmed` as each webhook arrives. Note that the mempool delivery can be **skipped entirely** for transactions Moralis only observes once they are already mined. ### Coinbase detection Since `isCoinbase` is unreliable, detect coinbase transactions like this: ```js theme={null} const isCoinbase = tx.vin.length === 1 && tx.vout.some((out) => out.scriptPubKey?.type === "nulldata"); // OP_RETURN ``` ### Value conversion Store both BTC and satoshi values so downstream services can pick whichever representation fits: ```js theme={null} const btc = vout.value; const satoshis = Math.round(btc * 1e8); ``` *** ## Common Use Cases * **Exchange deposits** — surface deposits the moment they hit the mempool (`block.hash === "mempool"`), mark them `pending` on block inclusion (`confirmed: false`), and `confirmed` on the reorg-safe delivery (`confirmed: true`) * **Pending balances** — show users a pending balance the instant a tx is broadcast, before any block has been mined * **Payment UX** — trigger downstream flows on payment broadcast instead of waiting for confirmation * **Mempool analytics** — RBF detection, fee analytics, and MEV / arbitrage signals against unconfirmed activity * **Cold wallet surveillance** — alert on any inbound transfer to an offline storage address * **Mining pool revenue** — watch payout addresses for both standard payments and coinbase block rewards * **Treasury monitoring** — real-time accounting for corporate or DAO-held BTC addresses *** ## Setup Checklist 1. Generate an API key from [admin.moralis.com](https://admin.moralis.com) 2. Deploy a publicly accessible HTTPS webhook endpoint 3. Create the stream via `PUT /streams/bitcoin` 4. Attach the wallets you want to monitor — either by [registering individual addresses](/streams/api-reference/bitcoin/address/add-address-to-stream) (`POST /streams/bitcoin/{id}/address`) or by [adding an xpub](/streams/api-reference/bitcoin/xpub/add-xpub) (`POST /streams/bitcoin/{id}/xpub`) to auto-derive and watch its addresses 5. Implement the verification handler — respond to the empty-body test `POST` with HTTP `200` 6. Build upsert logic keyed on `txid` to handle the `confirmed: false` → `confirmed: true` transition 7. Always return HTTP `200` from your handler, even when your own processing errors — Moralis retries on non-200 responses # EVM Streams Source: https://docs.moralis.com/streams/evm-streams Stream real-time EVM transaction data, contract events, and token activity directly to your application with webhooks, no node infrastructure, no polling, no missed blocks. ## Overview **EVM Streams** is the original Moralis Streams product, delivering real-time on-chain activity from every supported EVM chain via webhooks. Moralis indexes each chain automatically and pushes structured payloads to your endpoint whenever transactions or contract events match your criteria. Webhooks typically arrive within seconds of a block being mined — no node, no polling, no missed blocks. For a full chain list (Ethereum, Base, Polygon, BNB, Arbitrum, Optimism, Avalanche, and more), see [Supported Chains](/streams/supported-chains). *** ## Key Features * **Real-time delivery:** webhooks arrive within seconds of a block being produced * **Dual-phase notifications:** every match fires twice — once unconfirmed (`confirmed: false`) and again at finality (`confirmed: true`) * **Rich filtering:** watch addresses, contract events (via ABI), specific topics, or apply advanced value/contract conditions * **Included decoded data:** ERC-20 transfers, ERC-20 approvals, NFT transfers (ERC-721 / ERC-1155), and NFT approvals are decoded into clean fields at no extra record cost * **Internal transactions:** opt in to receive value moves that occur inside contract execution * **Triggers:** invoke read-only contract functions as part of event processing — e.g. fetch token balances at the moment of a transfer * **Automatic retries:** Moralis retries webhook delivery until your endpoint returns HTTP `200` *** ## How It Works 1. A new block is produced on a supported EVM chain 2. Moralis evaluates every transaction and log in the block against your stream's filters 3. Matching events fire an **unconfirmed** webhook immediately 4. Once the block reaches the chain's confirmation threshold, a **confirmed** webhook is delivered 5. Your service upserts on `transactionHash` (or `transactionHash + logIndex` for logs) to reconcile the two-phase lifecycle *** ## Webhook Payload Structure Each EVM webhook payload contains: * **Block metadata** — number, hash, timestamp * **`txs`** — native transactions (when `includeNativeTxs` is enabled) * **`txsInternal`** — internal transactions (when `includeInternalTxs` is enabled) * **`logs`** — raw contract event logs (when `includeContractLogs` is enabled) * **`erc20Transfers` / `erc20Approvals`** — automatically decoded from logs, included * **`nftTransfers` / `nftApprovals`** — automatically decoded for ERC-721 and ERC-1155, included * **Confirmation status** — `confirmed: true` / `false` For full schemas and examples, see [Webhook Payload](/streams/webhooks/webhook-payloads). > [!NOTE] > > EVM addresses are hex-encoded (`0x...`) and **case-insensitive**. Comparisons should be done with `toLowerCase()` to avoid false negatives. *** ## Configuration Parameters When creating an EVM stream you specify: | Parameter | Description | | - | - | | `webhookUrl` | Public HTTPS endpoint that will receive payloads (required) | | `chainIds` | Array of hex chain IDs to watch (e.g. `["0x1", "0x2105"]`) | | `includeNativeTxs` | Include native transactions in the payload | | `includeContractLogs` | Include raw contract logs in the payload | | `includeInternalTxs` | Include internal transactions in the payload | | `abi` | ABI fragments used to decode targeted contract events | | `topic0` | Event signature(s) to match (e.g. `Transfer(address,address,uint256)`) | | `advancedOptions` | Per-event value-based filters and aggregations — see [Advanced Options](/streams/streams-concepts/advanced-options) | | `triggers` | Read-only contract calls to execute at match time — see [Triggers](/streams/streams-concepts/triggers) | | `description` | Human-readable stream description | | `tag` | Identifier for routing / filtering on your side | *** ## API Endpoints All EVM Streams endpoints require the `x-api-key` header. ### Streams | Method | Endpoint | Purpose | | - | - | - | | `PUT` | `/streams/evm` | [Create a stream](/streams/api-reference/streams/create-streams) with a webhook URL and configuration | | `POST` | `/streams/evm/{id}` | [Update a stream's](/streams/api-reference/streams/update-stream) configuration | | `POST` | `/streams/evm/{id}/status` | [Pause or resume a stream](/streams/api-reference/streams/update-stream-status) | | `GET` | `/streams/evm` | [List existing EVM streams](/streams/api-reference/streams/get-streams) | | `GET` | `/streams/evm/{id}` | [Get a stream by ID](/streams/api-reference/streams/get-stream-by-id) | | `DELETE` | `/streams/evm/{id}` | [Remove a stream](/streams/api-reference/streams/delete-stream) | | `POST` | `/streams/evm/{id}/duplicate` | [Duplicate a stream](/streams/api-reference/streams/duplicate-stream) | | `POST` | `/streams/evm/{chainId}/block/{blockNumber}` | [Get webhook data for a historical block](/streams/api-reference/streams/get-webhook-data-by-block-number) | | `POST` | `/streams/evm/{chainId}/block-to-webhook/{blockNumber}/{streamId}` | [Replay a historical block](/streams/api-reference/streams/send-webhook-data-by-block-number) for backfilling | ### Addresses | Method | Endpoint | Purpose | | - | - | - | | `GET` | `/streams/evm/{id}/address` | [List addresses](/streams/api-reference/streams/get-addresses-by-stream) attached to a stream | | `POST` | `/streams/evm/{id}/address` | [Add an address](/streams/api-reference/streams/add-address-to-stream) to monitor | | `PATCH` | `/streams/evm/{id}/address` | [Replace an address](/streams/api-reference/streams/replace-address-on-stream) on a stream | | `DELETE` | `/streams/evm/{id}/address` | [Remove an address](/streams/api-reference/streams/delete-address-from-stream) from a stream | *** ## Common Use Cases * **Wallet activity notifications** — alert users on inbound and outbound transfers, swaps, and contract interactions * **Token transfer tracking** — ERC-20 movements (airdrops, payments, vesting) decoded and included * **NFT marketplaces** — mint, transfer, and approval events for ERC-721 and ERC-1155 collections * **DeFi protocol monitoring** — track interactions with specific contracts via ABI events and topics * **Treasury & accounting** — real-time corporate or DAO wallet activity across multiple chains * **AI agents** — react to on-chain events as they happen *** ## Setup Checklist 1. Generate an API key from [admin.moralis.com](https://admin.moralis.com) 2. Deploy a publicly accessible HTTPS webhook endpoint 3. Create the stream via `PUT /streams/evm` 4. Register the addresses you want to monitor (`POST /streams/evm/{id}/address`) 5. Implement the verification handler — respond to the empty-body test `POST` with HTTP `200` 6. Verify the [`x-signature` header](/streams/security-and-reliability/webhook-security) on every delivery 7. Build dedupe logic keyed on `transactionHash` (or `transactionHash + logIndex` for logs) to handle the unconfirmed → confirmed transition 8. Always return HTTP `200` from your handler, even when your own processing errors — Moralis retries on non-200 responses *** ## Monitor Onchain Events [Monitor Onchain Events](https://www.youtube.com/embed/k_hk9Pchjc8) # Streams Source: https://docs.moralis.com/streams/overview Real-time blockchain webhooks across EVM, Bitcoin, and Solana — with guaranteed delivery and flexible filtering. ## Overview Moralis **Streams** lets you receive **real-time blockchain events** directly in your backend via webhooks. Instead of polling APIs or indexing chains yourself, Streams pushes on-chain activity to you the moment it happens — based on rules you define. Streams is available on **EVM**, **Bitcoin**, and **Solana**. *** ## What Is Moralis Streams? Moralis Streams allows you to **listen to blockchain activity in real time**. The product model is the same on every chain — define a stream, set filters, receive webhooks — but each chain exposes activity in its own native shape. What you can listen to depends on the chain: > [tab] EVM > > * Wallet activity (transfers, swaps, contract interactions) > * Contract events via ABI decoding > * ERC-20 / ERC-721 / ERC-1155 transfers and approvals (decoded, included) > * Native and internal transactions > * Custom on-chain conditions using [advanced filters](/streams/streams-concepts/advanced-options) > * Read-only contract calls at match time using [Triggers](/streams/streams-concepts/triggers) > > See [EVM Streams](/streams/evm-streams) for details. > [tab] Bitcoin > > * Inbound transfers to watched addresses (P2PKH, P2SH, Bech32) > * HD wallet monitoring via xpub — Moralis derives addresses automatically > * Two-phase delivery for every matched transaction (`confirmed: false` at first block inclusion, then `confirmed: true` once the block is reorg-safe) > * Firehose mode (`allAddresses`) to receive every Bitcoin transaction > > See [Bitcoin Streams](/streams/bitcoin-streams) for details. > [tab] Solana > > * Wallet activity matched against `accountKeys` > * Program activity (e.g. SPL Token Program) via `programIds` > * SPL token transfers via `mintAddresses` > * Pre / post token balances for instant delta calculation > * Inner instructions for Cross-Program Invocations (CPIs) > * Firehose mode (`allAddresses`) to receive every Solana transaction > > See [Solana Streams](/streams/solana-streams) for details. When a matching event occurs, Moralis delivers a **webhook** to your server with a structured data payload. *** ## How Streams Works At a high level: 1. A new block is produced on-chain (or a slot, on Solana) 2. Moralis processes and evaluates the block 3. Your stream rules are applied 4. Matching events are detected 5. A webhook is delivered to your endpoint All delivery is handled by Moralis — no nodes, polling, or infrastructure required. *** ## Common Use Cases Streams is commonly used for: * **Real-time wallet notifications** (send, receive, swap, stake, burn) * **Asset monitoring** (token or NFT movement, price-sensitive events) * **Exchange & custody flows** (deposit detection, hot/cold wallet surveillance) * **Games & apps** (in-game actions, state changes, achievements) * **Token sales & launches** (participation tracking, contribution thresholds) * **Protocol monitoring** (liquidity events, contract / program interactions) * **AI agents** that react to on-chain events as they happen *** ## Working With Webhooks Streams delivers events via **HTTP webhooks**: * Webhooks are sent using `POST` requests * Payloads include decoded, structured event data ([EVM](/streams/webhooks/webhook-payloads), [Bitcoin](/streams/bitcoin-streams), [Solana](/streams/solana-streams)) * Delivery is retried automatically on failure * Events can be replayed manually if needed To ensure correctness, Moralis sends a **mandatory test webhook** whenever a stream is created or updated. *** ## Reliability & Guarantees Streams is built for production workloads: * Guaranteed webhook delivery with retries * Automatic backoff if your service is unavailable * Manual replay support * Spam detection and filtering (EVM only) * Secure webhook signing on every chain *** ## When to Use Streams Use Streams if you need: * Real-time blockchain events * Push-based architecture * Low-latency notifications * Reliable delivery without running infrastructure If you only need historical data, use the [**Data APIs**](/data-api/overview) instead. *** ## Get Started * **Quickstart** * **Stream Configuration** * **Webhooks** * **Tutorials** *** ## Getting Started with Moralis Streams [Getting Started with Moralis Streams](https://www.youtube.com/embed/lyTMOBW0uaI) # Pricing Source: https://docs.moralis.com/streams/pricing Understand how Streams API usage is calculated using records and compute units across EVM, Bitcoin, and Solana — and learn how to optimize your costs. ## Records Records are the fundamental unit for calculating Streams API usage. **What counts as a record depends on the chain** — see the chain-specific sections below. Each record costs **10 Compute Units (CUs)**. The `x-records-charged` header in webhook responses shows the exact record count for that delivery. > [!NOTE] > > Only webhooks with `confirmed: true` incur charges. Unconfirmed webhooks (`confirmed: false`) have `x-records-charged: 0` and are included. For each match, you receive two webhooks: 1. **Unconfirmed** — sent when the transaction is included in a block. 2. **Confirmed** — sent once the block is considered final (charged). > [!NOTE] > > Across all chains, the unconfirmed (`confirmed: false`) delivery is sent when the matching transaction is first included in a block (or slot, on Solana). The confirmed (`confirmed: true`) delivery is sent after the chain's reorg-safety threshold has passed — see [Supported Chains](/streams/supported-chains). Only the confirmed delivery is charged. *** ## What Counts as a Record > [tab] EVM > > A record on EVM is one of the following: > > * A native transaction (`txs`) > * A log event (`logs`) > * An internal transaction (`txsInternal`) > > The total record count for a webhook equals the sum of all three: **txs + logs + txsInternal**. > > ### Records by transaction type > > The number of records charged varies depending on transaction complexity: > > | Transaction Type | Records Charged | > | - | - | > | Native transfer | 1 record | > | ERC-20 transfer | 2 records | > | Single NFT transfer (ERC-721) | 11 records | > | Batch NFT transfer (ERC-1155) | 2 records | > | ERC-721 minting (100 tokens) | 100 records | > > ### Decoded logs are included > > Moralis automatically decodes standardized contract events at **no additional cost**. These do **not** count as records: > > * `erc20Transfers` > * `erc20Approvals` > * `nftTransfers` > * `nftApprovals` > [tab] Bitcoin > > A record on Bitcoin is a single matched **transaction** (`txs`). Bitcoin payloads do not contain logs or internal transactions, so: > > | Transaction Type | Records Charged | > | - | - | > | Any matched transaction | 1 record | > > Each confirmed delivery charges **1 record (10 CUs) per matched transaction**, regardless of how many `vout` entries match watched addresses. > [tab] Solana > > A record on Solana is a single matched **transaction**. Solana payloads do not contain logs or internal transactions in the EVM sense, so: > > | Transaction Type | Records Charged | > | - | - | > | Any matched transaction | 1 record | > > Each confirmed delivery charges **1 record (10 CUs) per matched transaction**, regardless of how many `accountKeys`, instructions, or token balance changes are included. *** ## Monitoring Your Usage Use the [Get Stats](/streams/api-reference/stats/get-stats) endpoint to track your consumption. > [tab] EVM > > The stats endpoint returns: > > * `totalLogsProcessed` > * `totalTxsProcessed` > * `totalTxsInternalProcessed` > > Sum these values to determine total records consumed during your billing period. > [tab] Bitcoin > > The stats endpoint returns `totalTxsProcessed` for Bitcoin streams. `totalLogsProcessed` and `totalTxsInternalProcessed` are EVM-only counters and are not populated for Bitcoin. > [tab] Solana > > The stats endpoint returns `totalTxsProcessed` for Solana streams. `totalLogsProcessed` and `totalTxsInternalProcessed` are EVM-only counters and are not populated for Solana. *** ## Plan Limits | Plan | Streams per account | Watched addresses per account | | - | - | - | | All plans below Enterprise | 200 | 50,000 | | Enterprise | Custom | Custom, into the millions | See [Rate Limits](/streams/streams-concepts/rate-limits) for limits on how quickly you can add addresses. For CU allocations, throughput limits and plan comparisons, visit the [Moralis Pricing Page](https://moralis.io/pricing). For higher limits, [reach out to the team](https://moralis.com/enterprise/) about an Enterprise plan. ## Free Trial Moralis doesn't have a self-serve free plan. To try it before you subscribe, request a free trial and the team will reach out. Request a free trial # Create Your First Stream Source: https://docs.moralis.com/streams/quickstart/create-your-first-stream Create a new stream on EVM, Bitcoin, or Solana using the Moralis Admin Panel or the API to start monitoring blockchain addresses and receiving webhook data. You can create a stream either through the **Moralis Admin Panel** (no code required) or programmatically via the API. The flow is the same on every chain — define a stream, attach the addresses (or xpub / programs / mints) you care about, and point Moralis at your webhook URL — but the parameters and chain-specific features differ. > [tab] EVM > > ## Option 1: Create via Admin Panel > > ### Getting Started > > 1. Go to [admin.moralis.com/streams](https://admin.moralis.com/streams). > 2. Click on **Create a new Stream**. > 3. Choose one of the EVM templates: > * **Custom Event** — Customizable options for events and filters, allowing precise notifications. > * **Wallet Activity** — Track native transactions and smart contract interactions (transfers, approvals). > * **Contract Activity** — Monitor smart contract events (logs). > > ### Setting Up the Stream > > 1. Name your stream and select the types of events you want to track. > > 2. Set up event filtering. See [Filters](/streams/streams-concepts/filters) for details. > > 3. Add a tag for your stream and choose if you wish to receive additional data. > > 4. Add the addresses you wish to track. > > 5. Pick which EVM chains should be tracked (Ethereum, Base, Polygon, etc.). > > 6. Test your stream (optional). > > 7. Add your webhook URL where the `POST` requests will be sent. > > > [!NOTE] > > > > For testing, you can use a service like [webhook.site](https://webhook.site/) to receive and inspect webhooks. > > 8. Save your configuration. > > ## Option 2: Create via SDK > > > [!NOTE] > > > > Make sure you have a Moralis API key. You can get one from the [Moralis Admin Panel](https://admin.moralis.com/). > > ### Step 1: Create a Stream > > Required parameters: > > * `webhookUrl` — Webhook URL where Moralis will send the `POST` request. > > * `description` — A description for this stream. > > * `tag` — A user-provided tag sent along with the webhook to identify the stream. > > * `chains` — An array of EVM chain IDs to monitor (hex-encoded). > > * At least one of `includeContractLogs`, `includeNativeTxs`, or `includeInternalTxs` must be `true`. > > > [tab] JavaScript > > > > ```javascript theme={null} > > const Moralis = require("moralis").default; > > > > const runApp = async () => { > > await Moralis.start({ > > apiKey: "YOUR_API_KEY", > > }); > > > > const response = await Moralis.Streams.add({ > > webhookUrl: "https://webhook.site/YOUR_WEBHOOK_URL", > > description: "My first stream", > > tag: "my_stream", > > chains: ["0x1"], > > includeNativeTxs: true, > > }); > > > > console.log(response.toJSON().id); // print the stream id > > }; > > > > runApp(); > > ``` > > > [tab] Python > > > > ```python theme={null} > > from moralis import streams > > > > api_key = "YOUR_API_KEY" > > > > stream_body = { > > "webhookUrl": "https://webhook.site/YOUR_WEBHOOK_URL", > > "description": "my first stream", > > "tag": "my_stream", > > "chainIds": ["0x1"], > > "includeNativeTxs": True, > > } > > > > results = streams.evm_streams.create_stream(api_key=api_key, body=stream_body) > > print(results["id"]) # print the stream id > > ``` > > ### Step 2: Add an Address to a Stream > > Now that you have a stream ID, you can add addresses to monitor. You can add individual addresses or a batch. > > > [tab] JavaScript > > > > ```javascript theme={null} > > const Moralis = require("moralis").default; > > > > const runApp = async () => { > > await Moralis.start({ > > apiKey: "YOUR_API_KEY", > > }); > > > > const list = [ > > "0xf3d8d9f1f1ccbc8f7e313b7e7cdaa1d6e5b2c2f2", > > "0x7a250d5630b4cf539739df2c5dacb4c659f2488d", > > ]; > > > > const response = await Moralis.Streams.addAddress({ > > id: "YOUR_STREAM_ID", > > address: list, > > }); > > > > console.log(response.toJSON()); > > }; > > > > runApp(); > > ``` > > > [tab] Python > > > > ```python theme={null} > > from moralis import streams > > > > api_key = "YOUR_API_KEY" > > > > params = {"id": "YOUR_STREAM_ID"} > > > > address_list = [ > > "0xf3d8d9f1f1ccbc8f7e313b7e7cdaa1d6e5b2c2f2", > > "0x7a250d5630b4cf539739df2c5dacb4c659f2488d", > > ] > > stream_body = {"address": address_list} > > > > results = streams.evm_streams.add_address_to_stream( > > api_key=api_key, body=stream_body, params=params > > ) > > print(results) > > ``` > > ### Step 3: Update a Stream (Optional) > > You can update a stream to add contract log monitoring, such as listening for ERC-20 transfers. > > > [tab] JavaScript > > > > ```javascript theme={null} > > const Moralis = require("moralis").default; > > > > const runApp = async () => { > > await Moralis.start({ > > apiKey: "YOUR_API_KEY", > > }); > > > > const ERC20TransferABI = [ > > { > > anonymous: false, > > inputs: [ > > { indexed: true, name: "from", type: "address" }, > > { indexed: true, name: "to", type: "address" }, > > { indexed: false, name: "value", type: "uint256" }, > > ], > > name: "Transfer", > > type: "event", > > }, > > ]; > > > > const response = await Moralis.Streams.update({ > > id: "YOUR_STREAM_ID", > > abi: ERC20TransferABI, > > includeContractLogs: true, > > topic0: ["Transfer(address,address,uint256)"], > > description: "My first stream - with ERC20 transfers", > > }); > > > > console.log(response.toJSON()); > > }; > > > > runApp(); > > ``` > > > [tab] Python > > > > ```python theme={null} > > from moralis import streams > > > > api_key = "YOUR_API_KEY" > > > > erc20_transfer_abi = [ > > { > > "anonymous": False, > > "inputs": [ > > {"indexed": True, "name": "from", "type": "address"}, > > {"indexed": True, "name": "to", "type": "address"}, > > {"indexed": False, "name": "value", "type": "uint256"}, > > ], > > "name": "Transfer", > > "type": "event", > > } > > ] > > > > params = {"id": "YOUR_STREAM_ID"} > > > > stream_body = { > > "abi": erc20_transfer_abi, > > "includeContractLogs": True, > > "topic0": ["Transfer(address,address,uint256)"], > > "description": "my first stream - with ERC20 transfers", > > } > > > > results = streams.evm_streams.update_stream( > > api_key=api_key, body=stream_body, params=params > > ) > > print(results) > > ``` > [tab] Bitcoin > > ## Option 1: Create via Admin Panel > > 1. Go to [admin.moralis.com/streams](https://admin.moralis.com/streams). > 2. Click on **Create a new Stream** and choose the **Bitcoin** stream type. > 3. Name your stream, set a tag, and add your webhook URL. > 4. Choose how to monitor wallets: > * **Individual addresses** — P2PKH (`1...`), P2SH (`3...`), or Bech32 (`bc1q...`) > * **Xpub** — attach an extended public key and Moralis derives addresses for you > * **All addresses** — firehose mode that delivers every Bitcoin transaction > 5. Save your configuration. > > See the [Bitcoin Streams overview](/streams/bitcoin-streams) for the full list of features and limitations. > > ## Option 2: Create via API > > > [!NOTE] > > > > Make sure you have a Moralis API key. You can get one from the [Moralis Admin Panel](https://admin.moralis.com/). > > ### Step 1: Create a Bitcoin stream > > ```bash theme={null} > curl -X PUT "https://api.moralis-streams.com/streams/bitcoin" \ > -H "x-api-key: YOUR_API_KEY" \ > -H "Content-Type: application/json" \ > -d '{ > "webhookUrl": "https://webhook.site/YOUR_WEBHOOK_URL", > "description": "My first Bitcoin stream", > "tag": "btc_deposits", > "network": ["mainnet"], > "includeOutputs": true > }' > ``` > > Required parameters: > > * `webhookUrl` — public HTTPS endpoint to receive payloads > * `description` — human-readable stream description > * `tag` — identifier sent on every webhook for routing on your side > * `network` — must be `["mainnet"]` > > Optional: `includeInputs`, `includeOutputs`, `allAddresses`. See [Create Bitcoin Stream](/streams/api-reference/bitcoin/streams/create-streams). > > ### Step 2: Add an address (or xpub) to monitor > > Add an individual address: > > ```bash theme={null} > curl -X POST "https://api.moralis-streams.com/streams/bitcoin/{streamId}/address" \ > -H "x-api-key: YOUR_API_KEY" \ > -H "Content-Type: application/json" \ > -d '{ "address": "bc1qexampleaddressxxxxxxxxxxxxxxxxxxxxxxxx" }' > ``` > > Or attach an xpub so Moralis derives and monitors HD wallet addresses for you: > > ```bash theme={null} > curl -X POST "https://api.moralis-streams.com/streams/bitcoin/{streamId}/xpub" \ > -H "x-api-key: YOUR_API_KEY" \ > -H "Content-Type: application/json" \ > -d '{ "xpub": "xpub6CUGRUo..." }' > ``` > > See [Add Address](/streams/api-reference/bitcoin/address/add-address-to-stream) and [Add Xpub](/streams/api-reference/bitcoin/xpub/add-xpub) for details. > > > [!NOTE] > > > > Bitcoin Streams delivers each matched transaction **twice** — once at first block inclusion (`confirmed: false`, the block is near the chain tip and could still be reorged) and again after 2 blocks have been mined on top (`confirmed: true`, reorg-safe). Dedupe on `txid` and upsert on the second delivery to flip your local confirmation flag. > [tab] Solana > > ## Option 1: Create via Admin Panel > > 1. Go to [admin.moralis.com/streams](https://admin.moralis.com/streams). > 2. Click on **Create a new Stream** and choose the **Solana** stream type. > 3. Name your stream, set a tag, and add your webhook URL. > 4. Configure your filters — any combination of: > * **Addresses** — match transactions where any `accountKey` matches a watched address > * **Program IDs** — match transactions invoking specific programs (e.g. SPL Token Program) > * **Mint addresses** — match transactions involving specific SPL tokens > * **All addresses** — firehose mode for every Solana transaction > 5. Save your configuration. > > See the [Solana Streams overview](/streams/solana-streams) for how Solana concepts (programs, mints, signatures) map from EVM. > > ## Option 2: Create via API > > > [!NOTE] > > > > Make sure you have a Moralis API key. You can get one from the [Moralis Admin Panel](https://admin.moralis.com/). > > ### Step 1: Create a Solana stream > > ```bash theme={null} > curl -X PUT "https://api.moralis-streams.com/streams/solana" \ > -H "x-api-key: YOUR_API_KEY" \ > -H "Content-Type: application/json" \ > -d '{ > "webhookUrl": "https://webhook.site/YOUR_WEBHOOK_URL", > "description": "My first Solana stream", > "tag": "sol_wallet_activity", > "network": ["mainnet"] > }' > ``` > > Required parameters: > > * `webhookUrl` — public HTTPS endpoint to receive payloads > * `description` — human-readable stream description > * `tag` — identifier sent on every webhook for routing on your side > * `network` — `["mainnet"]` > > See [Create Solana Stream](/streams/api-reference/solana/streams/create-streams) for the full schema. > > ### Step 2: Add addresses, program IDs, or mint addresses > > ```bash theme={null} > curl -X POST "https://api.moralis-streams.com/streams/solana/{streamId}/address" \ > -H "x-api-key: YOUR_API_KEY" \ > -H "Content-Type: application/json" \ > -d '{ "address": "GoSBxCH19sMnZVEifsXeeMdEfkTv6Zh6MWvQFQF3e5m7" }' > ``` > > > [!WARNING] > > > > Solana addresses are base58 and **case-sensitive**. Submit them in their original case — unlike EVM, lowercased addresses will not match. > > See [Add Address](/streams/api-reference/solana/address/add-address-to-stream) for details on attaching addresses, program IDs, and mint addresses. *** ## Next Steps Once your stream is created, you will receive a [mandatory test webhook](/streams/webhooks/test-webhooks) that you must respond to with a `200` status code for the stream to activate. * [Receive Your First Webhook](/streams/quickstart/receive-your-first-webhook) — Learn what to expect when webhooks start arriving. * [Webhook Security](/streams/security-and-reliability/webhook-security) — Verify webhook signatures to ensure data authenticity. * [Filters](/streams/streams-concepts/filters) — Fine-tune which events trigger webhooks. # Receive Your First Webhook Source: https://docs.moralis.com/streams/quickstart/receive-your-first-webhook Understand the webhook lifecycle, payload structure, and how to handle confirmed and unconfirmed webhooks from Moralis Streams. Once your stream is active, Moralis will send webhook `POST` requests to your configured URL whenever monitored addresses are involved in on-chain events. ## Mandatory Test Webhook Whenever you create or update a stream, you will receive a **test webhook**. You must return a `200` status code (or any `2xx` code) for the stream to start delivering real data. The test body looks like this: ```json theme={null} { "abi": {}, "block": { "hash": "", "number": "", "timestamp": "" }, "txs": [], "txsInternal": [], "logs": [], "chainId": "", "tag": "", "streamId": "", "confirmed": true, "retries": 0, "erc20Approvals": [], "erc20Transfers": [], "nftApprovals": [], "nftTransfers": [] } ``` > [!NOTE] > > No response body is required — only the status code matters. See [Test Webhooks](/streams/webhooks/test-webhooks) for more details. ## Two Webhooks Per Event You will receive **two webhooks** for each event: 1. **Unconfirmed** (`confirmed: false`) — Sent as soon as the transaction is included in a block. The block may still be dropped due to a chain reorganization. You are **not charged** for unconfirmed webhooks. 2. **Confirmed** (`confirmed: true`) — Sent once enough blocks have been mined to consider the block final. Only confirmed webhooks count toward your [billing](/streams/pricing). > [!WARNING] > > In rare cases, the confirmed webhook may arrive before the unconfirmed one. Make sure your application handles this scenario. ## Webhook Payload Structure The webhook body contains all the data for the block event. The key fields are: | Field | Description | | - | - | | `chainId` | The chain ID (e.g., `0x1` for Ethereum) | | `block` | Block metadata (number, hash, timestamp) | | `txs` | Array of native transactions | | `txsInternal` | Array of internal transactions | | `logs` | Array of raw event logs | | `erc20Transfers` | Decoded ERC20 transfer events (included) | | `erc20Approvals` | Decoded ERC20 approval events (included) | | `nftTransfers` | Decoded NFT transfer events (included) | | `nftApprovals` | Decoded NFT approval events (included) | | `tag` | Your user-defined stream tag | | `streamId` | The ID of the stream that triggered this webhook | | `confirmed` | Whether the block is confirmed | | `retries` | Number of delivery retries | ## Example: Native Transaction Webhook ```json theme={null} { "confirmed": false, "chainId": "0x1", "abi": [], "streamId": "c28d9e2e-ae9d-4fe6-9fc0-5fcde2dcdd17", "tag": "my_stream", "retries": 0, "block": { "number": "15988759", "hash": "0x3aa07bd98e328db97ec273ce06b3a15fc645931fbd26337fe20c48b274277f76", "timestamp": "1668676247" }, "logs": [], "txs": [ { "hash": "0xd68700a0e2abd9c041eb236812e4194bf91c8182a2b03065887ab0f33d5c2958", "gas": "149200", "gasPrice": "13670412399", "nonce": "57995", "input": "0x...", "transactionIndex": "52", "fromAddress": "0x839d4641f97153b0ff26ab837860c479e2bd0242", "toAddress": "0x1111111254eeb25477b68fb85ed929f73a960582", "value": "0", "type": "2", "receiptCumulativeGasUsed": "3131649", "receiptGasUsed": "113816", "receiptStatus": "1" } ], "txsInternal": [], "erc20Transfers": [], "erc20Approvals": [], "nftApprovals": { "ERC1155": [], "ERC721": [] }, "nftTransfers": [] } ``` ## Verifying Webhook Signatures Every webhook includes an `x-signature` header — a SHA3 hash of the body combined with your API key. Always verify this signature to ensure the webhook is from Moralis. > [tab] JavaScript > > ```javascript theme={null} > import Moralis from "moralis"; > > const { headers, body } = request; > > Moralis.Streams.verifySignature({ > body, > signature: headers["x-signature"], > }); // throws error if not valid > ``` > [tab] Python > > ```python theme={null} > from web3 import Web3 > > def verify_signature(req, secret): > provided_signature = req.headers.get("x-signature") > if not provided_signature: > raise TypeError("Signature not provided") > > data = req.data + secret.encode() > signature = Web3.keccak(text=data.decode()).hex() > > if provided_signature != signature: > raise ValueError("Invalid Signature") > ``` For full details, see [Webhook Security](/streams/security-and-reliability/webhook-security). ## Decoded Data (Included) Moralis automatically decodes standard contract events at no additional cost: * **ERC20 Transfers** — Includes `tokenName`, `tokenSymbol`, `tokenDecimals`, `from`, `to`, `value`, and `contract` address. * **ERC20 Approvals** — Includes `owner`, `spender`, `value`, and token metadata. * **NFT Transfers** — Includes `tokenId`, `tokenName`, `tokenContractType` (ERC721/ERC1155), `from`, `to`, `amount`, and `contract` address. These decoded fields are included in both confirmed and unconfirmed payloads and do **not** count as records for billing purposes. ## Next Steps * [Webhook Payloads](/streams/webhooks/webhook-payloads) — Detailed reference for all payload types. * [Confirmation and Finality](/streams/webhooks/confirmation-and-finality) — How block confirmations work across chains. * [Pricing](/streams/pricing) — Understand how records and compute units are calculated. # Delivery Guarantees Source: https://docs.moralis.com/streams/security-and-reliability/delivery-guarantees Learn how Moralis reliably delivers blockchain data, including retry behavior, durability, and how events are protected from data loss. ## Overview Moralis is built to deliver blockchain data **reliably**, even in the presence of network issues, server downtime, or blockchain reorganizations. This page explains: * What Moralis guarantees * How delivery failures are handled * What you should expect when consuming events at scale *** ## Reliable Event Delivery Moralis ensures that **eligible blockchain events are not silently lost**. If a webhook delivery fails (for example, due to a timeout or server error), Moralis will **automatically retry delivery** until the event is acknowledged or the retry window expires. As a result: * Events are delivered reliably * Temporary failures do not cause data loss * Duplicate deliveries are possible and expected in failure scenarios Delivery mechanics: * [**Webhook Delivery**](/streams/webhooks/webhook-delivery) * [**Retries & Replays**](/streams/webhooks/retries-and-replays) *** ## What This Means in Practice Under normal operation: * Each event is delivered once If delivery fails: * The event is retried automatically * The same payload may be sent again * Your system should handle duplicates safely This design favors **correctness and completeness** over strict delivery assumptions. Guidance on safe handling: * [**Ordering & Idempotency**](/streams/security-and-reliability/ordering-and-idempotency) *** ## Durable Storage & Recovery When delivery issues occur: * Failed webhook deliveries are retained (plan-dependent) * Events can be replayed manually if needed * Delivery resumes automatically once issues are resolved Recovery options: * [**Retries & Replays**](/streams/webhooks/retries-and-replays) * [**Error Handling**](/streams/streams-concepts/error-handling) *** ## Blockchain Reorganization Safety Blockchains are probabilistic systems. Transactions may appear in a block and later be removed due to reorganization. Moralis handles this by: * Delivering provisional events (`confirmed: false`) * Finalizing only confirmed events (`confirmed: true`) * Preventing invalidated data from being treated as final More details: * [**Confirmation & Finality**](/streams/webhooks/confirmation-and-finality) * [**Re-org Handling**](/streams/streams-concepts/re-org-handling) *** ## What Moralis Does *Not* Guarantee ### Strict ordering Events may arrive: * Out of order * With retries interleaved * With confirmed events preceding unconfirmed ones (rare) Ordering is intentionally relaxed to ensure reliability. Ordering strategies: * [**Ordering & Idempotency**](/streams/security-and-reliability/ordering-and-idempotency) *** ### Reliable Delivery with Retries Moralis does not attempt to deliver each event *exactly once*. Exactly-once delivery is not realistically achievable across network boundaries and webhook-based systems. Instead, Moralis guarantees **reliable delivery with retries**, and expects consumers to be idempotent. *** ## Operational Safeguards To protect delivery reliability, Moralis includes: * Automatic retry schedules * Delivery queue limits and backpressure * Stream health monitoring * Error and termination states * Email notifications on critical failures Operational details: * [**Error Handling**](/streams/streams-concepts/error-handling) * [**Stream Lifecycle**](/streams/streams-concepts/stream-lifecycle-and-management) *** ## Best Practices To fully benefit from Moralis’ delivery guarantees: * Make webhook handlers idempotent * Persist state only for confirmed events * Monitor queue size headers * Use replays for recovery, not polling *** ## Related Pages * [**Ordering & Idempotency**](/streams/security-and-reliability/ordering-and-idempotency) * [**Webhook Delivery**](/streams/webhooks/webhook-delivery) * [**Retries & Replays**](/streams/webhooks/retries-and-replays) * [**Error Handling**](/streams/streams-concepts/error-handling) * [**Confirmation & Finality**](/streams/webhooks/confirmation-and-finality) # Ordering & Idempotency Source: https://docs.moralis.com/streams/security-and-reliability/ordering-and-idempotency Learn how Moralis delivers events without strict ordering guarantees, and how to design idempotent consumers that handle retries, duplicates, and replays safely. ## Overview Blockchain data is produced by distributed systems and delivered over networks that can fail, retry, and recover. As a result, Moralis does **not** guarantee strict ordering or single delivery of events. Instead, it prioritizes **reliability and correctness**. This page explains: * Why events may arrive out of order * Why duplicate deliveries are possible * How to process events safely using idempotency *** ## Why Ordering Is Not Guaranteed Events may arrive out of order due to: * Network latency and retries * Automatic retry behavior on delivery failure * Manual replay of historical events * Confirmed and unconfirmed events being delivered separately * Regional delivery differences This behavior is expected and intentional. Delivery mechanics: * [**Webhook Delivery**](/streams/webhooks/webhook-delivery) *** ## What You Can Rely On Instead Every webhook payload includes stable identifiers that allow you to reason about order and uniqueness: * Chain ID * Block number * Transaction hash * Log index (for contract events) * Confirmation state (`confirmed`) Payload reference: * [**Webhook Payload**](/streams/webhooks/webhook-payloads) These fields let you: * Deduplicate events * Sort events deterministically * Reconcile final state safely *** ## What Idempotency Means Idempotent processing means: > Handling the same event multiple times produces the same result as handling it once. This is essential because: * Webhooks may be retried automatically * Replays intentionally resend historical events * Network failures may cause duplicate deliveries Retry and replay behavior: * [**Retries & Replays**](/streams/webhooks/retries-and-replays) *** ## Recommended Idempotency Strategies ### Use deterministic event keys Pick a key that's stable for the chain you're consuming: * **EVM** — `transactionHash`, or `transactionHash + logIndex` for log-level events. `streamId + transactionHash` works when consuming multiple streams. * **Bitcoin** — `txid` (each transaction is delivered twice, once at first block inclusion and once after the 2-block confirmation depth; upsert on the second delivery to flip `confirmed`). * **Solana** — `signature` (the base58 transaction id). Store processed keys and ignore duplicates. *** ### Treat unconfirmed events as provisional * Use `confirmed: false` for real-time UX * Persist state only on `confirmed: true` Confirmation model: * [**Confirmation & Finality**](/streams/webhooks/confirmation-and-finality) *** ### Design replays to be safe Replays should: * Reapply state deterministically * Overwrite or reconcile existing records * Never assume data is “new” Recovery workflows: * [**Retries & Replays**](/streams/webhooks/retries-and-replays) *** ## Common Mistakes to Avoid * Assuming webhook arrival order equals block order * Using arrival timestamps as a source of truth * Mutating permanent state on unconfirmed events * Failing or crashing on duplicate payloads *** ## Relationship to Delivery Guarantees | Topic | Page | | :- | :- | | Reliable delivery | [**Delivery Guarantees**](/streams/security-and-reliability/delivery-guarantees) | | Retry behavior | [**Retries & Replays**](/streams/webhooks/retries-and-replays) | | Confirmation model | [**Confirmation & Finality**](/streams/webhooks/confirmation-and-finality) | | Re-org handling | [**Re-org Handling**](/streams/streams-concepts/re-org-handling) | *** ## Best Practices Summary * Expect duplicates * Do not assume ordering * Persist only confirmed state * Make handlers idempotent by design *** ## Next Steps * Understand delivery mechanics → Explore [Webhook Delivery](/streams/webhooks/webhook-delivery) * Plan recovery flows → Explore [Retries & Replays](/streams/webhooks/retries-and-replays) * Handle confirmations correctly → Explore [Confirmation & Finality](/streams/webhooks/confirmation-and-finality) * Protect against re-orgs → Explore [Re-org Handling](/streams/streams-concepts/re-org-handling) # Spam Detection Source: https://docs.moralis.com/streams/security-and-reliability/spam-detection Learn how Moralis Streams identifies and flags potential spam contracts in webhook payloads, helping you filter or handle suspicious on-chain activity safely. > [!NOTE] > > Spam detection is an **EVM-only** feature. Bitcoin and Solana streams do not include `possibleSpam` flags or spam-based filtering. > [!WARNING] > > Streams currently uses a legacy spam detection system. This will be upgraded to align with the newer Moralis [API Spam Detection](/data-api/resources/spam-filtering) in a future release. Spam detection in Moralis Streams provides an **additional safety signal** that helps you identify contracts associated with spam, phishing, or suspicious activity. This feature allows you to: * Detect potentially malicious contracts in real time * Filter or suppress spam-related events * Warn users about risky interactions *** ## How Spam Detection Works When spam detection is enabled, Streams adds a boolean field called: ```javascript theme={null} possibleSpam ``` This field is attached to the following webhook objects: * `erc20Transfers` * `erc20Approvals` * `nftTransfers` * `nftApprovals` The value indicates whether the contract involved in the event is **potentially associated with spam or malicious behavior**. Example: ```javascript theme={null} { "contract": "0x...", "possibleSpam": true } ``` *** ## How to Use Spam Signals The `possibleSpam` flag is designed as a **signal**, not a hard block. Common usage patterns include: * Hiding spam tokens or NFTs from user interfaces * Suppressing notifications for spam-related activity * Flagging risky activity for manual review * Applying stricter filters to spam-flagged events Filtering options: * [**Filters**](/streams/streams-concepts/filters) *** ## Filtering Out Spam Events You can configure Streams to **exclude spam-related events entirely**. By enabling the `filterPossibleSpamAddresses` option: * Events involving contracts flagged as spam will not trigger webhooks * These events will not consume stream usage This is useful if you want to: * Reduce noise * Avoid processing low-quality or malicious activity Related configuration: * [**Filters**](/streams/streams-concepts/filters) * [**Advanced Options**](/streams/streams-concepts/advanced-options) *** ## How Contracts Are Classified Contracts flagged as spam are evaluated against a set of internal criteria, including: * Compliance with token and NFT standards * Minting and transfer behavior (e.g. honeypot patterns) * Copycat or impersonation signals * Other proprietary heuristics Classification is **continuously updated** as new data becomes available. *** ## Supported Chains Spam detection in Streams is supported on **all EVM-compatible chains**, with the strongest initial coverage on: * Ethereum Mainnet * Polygon Mainnet * BNB Chain *** ## Relationship to API Spam Detection Streams spam detection is **separate from** the newer Moralis API [Spam Filtering](/data-api/resources/spam-filtering) and [Token Safety](/data-api/data-features/token-scores) features. Key differences: * Streams uses a legacy classification system * API spam detection includes richer metadata and filtering * The two systems will be unified in a future update API spam features: * [**Spam Filtering**](/data-api/resources/spam-filtering) * [**Token Scores**](/data-api/data-features/token-scores) *** ## Best Practices * Treat `possibleSpam` as a signal, not absolute truth * Combine spam flags with confirmation state * Avoid persisting spam events unless required * Prefer filtering spam at the stream level when possible *** ## Related Pages * [**Streams Filters**](/streams/streams-concepts/filters) * [**Advanced Options**](/streams/streams-concepts/advanced-options) * [**Webhook Payload**](/streams/webhooks/webhook-payloads) * [**API Spam Filtering**](/data-api/resources/spam-filtering) * [**Delivery Guarantees**](/streams/security-and-reliability/delivery-guarantees) # Webhook Security Source: https://docs.moralis.com/streams/security-and-reliability/webhook-security Learn how Moralis secures webhook delivery using request signatures, and how to verify webhook authenticity in your backend. ## Overview All Moralis webhooks are **cryptographically signed** to ensure authenticity and integrity. By verifying each webhook signature, you can be confident that: * The request was sent by Moralis * The payload was not tampered with * Your application is protected against spoofed requests Signature verification is **strongly recommended** for all production environments. *** ## How Webhook Signing Works Every webhook request includes a signature in the HTTP headers: ```text theme={null} x-signature ``` This signature is generated by: 1. Serializing the webhook payload 2. Appending your account’s secret 3. Computing a Keccak-256 hash (via `web3.utils.sha3`) Conceptually: ```javascript theme={null} signature = sha3(JSON.stringify(body) + secret) ``` The generated signature is then sent with the webhook request. *** ## What Is the Secret Key? The **secret key** is a Streams-specific credential associated with your Moralis account. * It is **not** your API key * It is used **only** for webhook verification * It can be retrieved via the Streams settings endpoint *** ## Verifying Webhook Signatures To verify a webhook: 1. Read the `x-signature` header 2. Recompute the signature using the request body and your secret 3. Compare the two values 4. Reject the request if they do not match Verification should happen **before** processing the payload. *** ## Example: Node.js (Express) ```javascript theme={null} import { Web3 } from "web3"; function verifySignature(req, secret) { const providedSignature = req.headers["x-signature"]; if (!providedSignature) { throw new Error("Missing signature"); } const web3 = new Web3(); const expectedSignature = web3.utils.sha3( JSON.stringify(req.body) + secret ); if (expectedSignature !== providedSignature) { throw new Error("Invalid signature"); } } ``` Use this check at the start of your webhook handler. For handling test webhooks safely, explore [Test Webhooks](/streams/webhooks/test-webhooks). *** ## Security Best Practices ### Always verify signatures Do not trust: * Source IP * User-Agent headers * Payload structure alone *** ### Use HTTPS Webhook endpoints must be served over HTTPS to prevent interception or replay. *** ### Keep handlers lightweight Slow responses can cause retries or queue buildup. Explore [Webhook Delivery](/streams/webhooks/webhook-delivery) to learn how to handle this. *** ### Make handlers idempotent Retries may result in duplicate payloads. Read more about [Retries & Replays](/streams/webhooks/retries-and-replays). *** ## What Happens If Verification Fails? If your endpoint: * Rejects the request (non-2xx) * Throws an error * Times out Then: * The webhook is considered failed * Automatic retries will occur * The stream’s success rate may drop Read [Error Handling](/streams/streams-concepts/error-handling) for more on failure handling. *** ## Relationship to Other Webhook Concepts | Topic | Page | | :- | :- | | Delivery guarantees | [**Webhook Delivery**](/streams/webhooks/webhook-delivery) | | Confirmed vs unconfirmed | [**Confirmation & Finality**](/streams/webhooks/confirmation-and-finality) | | Test requests | [**Test Webhooks**](/streams/webhooks/test-webhooks) | | Retries & recovery | [**Retries & Replays**](/streams/webhooks/retries-and-replays) | | Failure states | [**Error Handling**](/streams/streams-concepts/error-handling) | # Solana Streams Source: https://docs.moralis.com/streams/solana-streams Stream real-time Solana transaction data directly to your application with webhooks, no node infrastructure, no polling, no missed slots. ## Overview **Solana Streams** extends Moralis Streams to Solana mainnet, delivering real-time transaction data via webhooks. Moralis indexes Solana automatically and pushes structured payloads to your endpoint whenever transactions match your criteria. If you've used Moralis Streams on EVM, the developer model is the same: define a stream, set filters, receive webhooks. The differences are in **what you filter on**, because Solana's transaction model is different from EVM's. *** ## Key Features * **Real-time delivery:** webhooks arrive within seconds of a slot being produced * **Flexible filtering:** match by address, program, SPL token mint, or stream every transaction on the network * **Pre / post token balances:** every payload includes SPL balance snapshots so you can compute exact token deltas without replaying instructions * **Inner instructions included:** trace nested behavior across Cross-Program Invocations (CPIs) directly from the payload * **Automatic retries:** Moralis retries webhook delivery until it receives an HTTP 200 response *** ## How It Works 1. A new Solana slot is produced 2. Moralis evaluates every transaction in the resulting block against your registered filters 3. Matching transactions fire a webhook to your endpoint 4. Your service processes the payload, keyed on the transaction `signature` *** ## Available Filters You can combine filters within a stream to narrow down to exactly the activity you care about. | Filter | What it does | EVM analog | | - | - | - | | `addresses` | Match transactions where any `accountKey` in the transaction matches one of the watched addresses | Filtering on `from` / `to` addresses | | `programIds` | Filter to transactions invoking specific Solana programs (e.g., the SPL Token Program) | Filtering on contract address being called | | `mintAddresses` | Filter to transactions involving specific SPL tokens, matched via `pre` / `postTokenBalances` | Filtering on ERC-20 contract address | | `allAddresses` | Receive every transaction on the network (firehose mode, no matching) | Same on EVM | *** ## How Solana Differs From EVM Most developers come to Solana with an EVM mental model. The concepts below bridge the two so you can pick the right filter and parse the payload correctly. ### Account keys vs. from/to On EVM, a transaction has a `from` and (usually) a single `to`. On Solana, a transaction lists **all accounts it touches** in `accountKeys` - signers, recipients, programs, and any account read or written. The `addresses` filter matches against this full list, so a single Solana transaction can match multiple watched addresses. ### Programs vs. smart contracts Solana **programs** are the executable code on-chain - the equivalent of EVM smart contracts. Each program has a `programId` (an address). The most common one developers will care about is the **SPL Token Program** (`TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA`), which handles all standard token transfers - similar to how the ERC-20 standard governs token behavior on EVM, except it's a single shared program rather than per-token contracts. ### Mint addresses vs. token contracts On EVM, every ERC-20 token is its own contract; the contract address **is** the token. On Solana, all SPL tokens are managed by the same Token Program, and each token is identified by its **mint address** (the account that defines that token's supply and metadata). To watch transfers of a specific Solana token, filter by its `mintAddress`. ### Slots, blocks, and signatures * **Slot** - Solana's time unit. Most slots produce a block; some are skipped. * **Block** - what you'd expect, with a `blockHash` and `blockTime`. * **Signature** - Solana's transaction ID is its first signature (base58-encoded), not a hash. This is what you use to look up a transaction. ### Inner instructions A Solana transaction contains top-level **instructions**, and each instruction can trigger **inner instructions** when one program calls another (Cross-Program Invocations, or CPIs). Conceptually similar to internal calls in EVM. The webhook payload includes both, so you can trace nested behavior. ### Pre / post token balances Every Solana transaction webhook includes `preTokenBalances` and `postTokenBalances` - snapshots of SPL token balances for the affected accounts before and after the transaction. This makes it trivial to compute exact token deltas without replaying the instruction logic. *** ## Webhook Payload Each Solana webhook payload contains block metadata, stream identifiers, and a list of matched transactions. ```json theme={null} { "block": { "slot": "410060994", "blockHash": "7xJ9Km3V...", "blockHeight": "389230112", "blockTime": 1743436800, "parentSlot": "410060993", "previousBlockHash": "9aB2cD4e..." }, "chainId": "solana_mainnet", "network": "mainnet", "retries": 0, "streamId": "3f6684f3-2ba4-44d7-af0e-26ee70cab245", "tag": "my-solana-stream", "confirmed": false, "transactions": [ { "signature": "5KtP...signature_base58", "slot": "410060994", "blockTime": 1743436800, "fee": "5000", "err": null, "accountKeys": [ "GoSBxCH19sMnZVEifsXeeMdEfkTv6Zh6MWvQFQF3e5m7", "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", "11111111111111111111111111111111" ], "instructions": [], "innerInstructions": [], "preTokenBalances": [], "postTokenBalances": [] } ] } ``` The fields you'll reach for first: * `signature` - transaction id, base58-encoded * `accountKeys` - every account the transaction touches * `instructions[].programId` - which programs were invoked * `preTokenBalances` / `postTokenBalances` - SPL balance snapshots for delta calculation *** ## Common Use Cases * **Wallet activity notifications** - alert users on inbound and outbound activity for a Solana address * **DEX / DeFi position monitoring** - track interactions with specific protocols by `programId` * **SPL token transfer tracking** - airdrops, payments, and compliance flows filtered by `mintAddress` * **Bot monitoring & MEV detection** - watch high-frequency program activity in real time * **AI agents** - react to on-chain events as they happen If you've built on Streams for EVM, you can stand up a Solana equivalent in minutes. The developer model is identical - only the filters differ. *** ## Setup Checklist 1. Generate an API key from [admin.moralis.com](https://admin.moralis.com) 2. Deploy a publicly accessible HTTPS webhook endpoint 3. Create the stream via `PUT /streams/solana` 4. Register the addresses, program IDs, or mint addresses you want to watch 5. Implement the verification handler — respond to the empty-body test `POST` with HTTP `200` 6. Build dedupe logic keyed on `signature` 7. Always return HTTP `200` from your handler, even when your own processing errors — Moralis retries on non-200 responses *** ## Roadmap More Solana-specific filters and decoded payload options are on the way. If you need a specific protocol or filter prioritized, [reach out to the team](https://moralis.com/enterprise/). # Advanced Options Source: https://docs.moralis.com/streams/streams-concepts/advanced-options Configure advanced Streams options to control which transactions, logs, and events are included in webhook payloads. > [!NOTE] > > Advanced options are an **EVM-only** feature. Bitcoin and Solana streams do not support these settings — see the [Bitcoin Streams](/streams/bitcoin-streams) and [Solana Streams](/streams/solana-streams) pages for their chain-native configuration. ## Overview Streams provides several advanced configuration options that allow you to **fine-tune which on-chain data is included in your webhook payloads**. These options control: * Which transaction types are included * Whether contract logs and internal transactions are captured * How specific events are filtered at a granular level Used correctly, they help reduce noise while ensuring you receive all relevant data. *** ## Global Stream Options These options apply at the **stream level** and affect the overall webhook payload. *** ### Include Contract Logs ```javascript theme={null} includeContractLogs: true ``` When enabled: * All contract logs are included in webhook payloads * Required when monitoring **specific contracts** * Useful when monitoring wallets that interact with contracts If you are only monitoring wallet activity, this can be disabled unless contract interaction details are required. *** ### Include Internal Transactions ```javascript theme={null} includeInternalTxs: true ``` When enabled: * Includes internal transactions (contract-to-contract calls) * Useful for tracing value movement inside smart contracts * Particularly relevant for DeFi protocols and complex contract interactions *** ### Include Native Transactions ```javascript theme={null} includeNativeTxs: true ``` When enabled: * Includes native currency transfers (e.g. ETH, MATIC) * Useful for tracking wallet balance changes or native payments *** ### Include All Transaction Logs ```javascript theme={null} includeAllTxLogs: true ``` When enabled: * Includes **all logs related to a transaction** if *any* log or transaction matches your stream configuration * Expands the webhook payload to include full transaction context **Requirements:** * Must be used together with either: * `includeNativeTxs`, or * `includeContractLogs` **Plan availability:**\ Available on **Pro plans and higher**. *** ## Advanced Options (Per-Event Configuration) The `advancedOptions` field allows you to define **event-specific rules** that override or refine the global stream configuration. Each entry targets a specific event signature and optionally applies filters. *** ### Advanced Option Structure ```javascript theme={null} { "topic0": "string", "filter": { }, "includeNativeTxs": boolean } ``` *** ### Fields Explained #### `topic0` The event signature to listen for (e.g. `Transfer(address,address,uint256)`). * Required * Determines which decoded event the option applies to *** #### `filter` A filter expression applied **only to this event**. * Uses the same filter syntax described in **Filters** * Allows precise inclusion logic per event *** #### `includeNativeTxs` Controls whether native transactions should be included **alongside this specific event**. *** ## Example: Filtered ERC-20 Transfers ```javascript theme={null} { "topic0": "Transfer(address,address,uint256)", "filter": { "and": [ { "eq": ["from", "0x283af0b28c62c092c9727f1ee09c02ca627eb7f5"] }, { "gt": ["amount", "100000000000000000000"] } ] }, "includeNativeTxs": false } ``` This configuration: * Listens only to ERC-20 `Transfer` events * Filters transfers from a specific address * Requires the transferred amount to exceed a threshold * Excludes native transactions > [!NOTE] > > Amounts must be expressed in the token’s base units (e.g. wei). *** ## When to Use Advanced Options Advanced options are useful when you want to: * Apply **different rules per event type** * Reduce webhook payload size * Filter high-value or high-signal events * Track contract activity with precision For simpler use cases, global stream options are usually sufficient. *** ## Best Practices * Start with global options, then refine with `advancedOptions` * Avoid overlapping filters that can be hard to reason about * Keep filters simple where possible * Test changes in a non-production stream first *** ## Summary * Global options control overall stream behaviour * `advancedOptions` enable per-event customization * Filters and advanced options work together * Proper configuration reduces noise and improves reliability # Error Handling Source: https://docs.moralis.com/streams/streams-concepts/error-handling Understand how Streams handles webhook failures, retries, error states, termination, and how to recover from delivery issues safely. ## Overview Streams is designed for **reliable, at-least-once delivery** of webhook events.\ While Moralis handles retries and failure recovery automatically, errors can still occur—most commonly due to webhook endpoint availability or throughput constraints. This page explains: * How delivery failures are handled * When streams enter error or terminated states * How retries, replays, and recovery work * What actions you should take in production *** ## Delivery Guarantees (Important Context) Moralis guarantees **at-least-once delivery** of webhooks while a stream is active. This means: * Webhooks may be retried * Duplicate deliveries are possible * Your webhook handler **must be idempotent** Correctness is prioritised over strict ordering. *** ## Automatic Webhook Retries If a webhook delivery fails (timeout, network error, non-2xx response), Moralis automatically retries delivery using an exponential backoff strategy. ### Retry schedule | Attempt | Interval | | :- | :- | | 0 | 1 minute | | 1 | 10 minutes | | 2 | 1 hour | | 3 | 2 hours | | 4 | 6 hours | | 5 | 12 hours | | 6 | 24 hours | Retries apply only to **delivery failures**.\ They do not reprocess blocks or regenerate events. *** ## Error State A stream may enter the `error` state under the following conditions: ### 1. Low webhook success rate If the webhook success rate for a stream drops **below 70%**, the stream enters the error state. ### 2. Delivery backlog (queue saturation) If your server cannot consume webhooks fast enough: * A delivery queue builds up * The queue reaches its maximum size (10,000 events) * The stream is placed into the error state You can monitor queue pressure using the `x-queue-size` response header. *** ### Behaviour in Error State When a stream is in the `error` state: * Webhook delivery is **paused** * Events are **not delivered** * Blocks are **still evaluated** * Retry scheduling resumes once the stream is reactivated An **email notification** is sent when a stream enters this state. *** ## Terminated State If a stream remains in the `error` state for **24 hours**, it is automatically **terminated**. ### Behaviour in Terminated State A terminated stream: * Does **not** send webhooks * Does **not** process new blocks * Drops all subsequent events permanently * Cannot be resumed An **email notification** is sent when termination occurs. To recover, a **new stream must be created**. *** ## Webhook Success Rate Each stream tracks a webhook success rate per webhook URL: * Starts at **100%** * Each failed delivery reduces the rate by **1%** * Each successful delivery increases the rate by **1%** * Capped between **0% and 100%** If the success rate falls below **70%**, the stream enters the error state. *** ## Viewing Failed Webhooks Failed webhook deliveries are retained for a limited time (plan-dependent, up to 7 days). ### Retrieve failed deliveries ```javascript theme={null} const history = await Moralis.Streams.getHistory({ limit: 100 }); ``` Each failed delivery includes: * Webhook payload * Error message * Stream ID * Timestamp * Unique history ID *** ## Replaying Failed Webhooks Failed webhooks can be replayed manually. ### Replay a failed webhook ```javascript theme={null} await Moralis.Streams.retry({ id: "HISTORY_ID", streamId: "STREAM_ID", }); ``` Replayed webhooks are delivered with the same payload as the original attempt. > [!NOTE] > > Replays do not regenerate events or reprocess blocks. For block-level recovery, use **Replay Block** (see *Retries & Replays*). *** ## Best Practices to Avoid Errors * Ensure webhook endpoints respond quickly and consistently * Treat webhook handling as **idempotent** * Monitor `x-queue-size` headers * Choose a stream region close to your backend * Pause streams during planned outages * Act promptly on error-state email notifications *** ## Summary * Delivery failures trigger automatic retries * Prolonged failures cause streams to enter `error` * Error state pauses delivery but preserves configuration * 24 hours in error results in termination * Failed deliveries can be replayed * Block-level recovery requires replay # Filters Source: https://docs.moralis.com/streams/streams-concepts/filters Control which on-chain events trigger Streams webhooks. Filtering primitives differ by chain — addresses + ABI events on EVM, addresses + xpubs on Bitcoin, addresses + program IDs + mint addresses on Solana. ## Overview Filters let you **control exactly which events trigger webhooks**. Events that don't match your filters are ignored and don't consume usage. Each chain exposes its own filtering primitives, because each chain models on-chain activity differently. *** ## Filtering by Chain > [tab] EVM > > EVM streams support the most filtering options: > > * **Addresses** — match transactions where `from` or `to` is a watched address > * **Contract events (ABI + `topic0`)** — match specific decoded events emitted by smart contracts > * **Advanced JSON filter expressions** — value comparisons, AND/OR logic, special stream variables (see below) > * **`filterPossibleSpamAddresses`** — exclude events involving contracts flagged as spam > > Filters are evaluated **before** webhook delivery and require a **valid ABI** for the event being filtered when used with decoded event data. > > For ergonomic primitives (templates) in the Admin Panel, see [Create Your First Stream](/streams/quickstart/create-your-first-stream). > [tab] Bitcoin > > Bitcoin streams filter on what's natural for the UTXO model: > > * **Addresses** — P2PKH (`1...`), P2SH (`3...`), or Bech32 (`bc1q...`) > * **Xpubs** — attach an extended public key and Moralis derives addresses for HD wallets automatically > * **`allAddresses`** — firehose mode that delivers every Bitcoin transaction > > Bitcoin Streams does not use the EVM JSON filter expression language. Address matching happens at the `vout` recipient level. > > > [!WARNING] > > > > Bitcoin reliably detects **inbound** transfers to watched addresses. Input-side detection is limited because `vin` entries do not include populated `address` or `value` fields. See [Bitcoin Streams](/streams/bitcoin-streams). > [tab] Solana > > Solana streams support filters that map to Solana's transaction model: > > | Filter | What it matches | > | - | - | > | `addresses` | Transactions where any `accountKey` matches a watched address | > | `programIds` | Transactions invoking specific Solana programs (e.g. SPL Token Program) | > | `mintAddresses` | Transactions involving specific SPL tokens, matched via `pre` / `postTokenBalances` | > | `allAddresses` | Firehose mode — receive every Solana transaction | > > A single Solana transaction can match multiple watched addresses because `accountKeys` lists every account it touches. > > Solana Streams does not use the EVM JSON filter expression language. > > > [!WARNING] > > > > Solana addresses are base58 and **case-sensitive**. Submit them in their original case — unlike EVM, lowercased addresses will not match. *** ## Advanced JSON Filter Expressions (EVM) > [!NOTE] > > The JSON filter expression system below is an **EVM-only** feature. It applies to decoded event data and requires a valid ABI for the event being filtered. Bitcoin and Solana streams use the chain-specific primitives above. ### How filters work Filters are defined as a **JSON expression** using logical operators and comparison rules. * Filters apply to **decoded event data** * Filters require a **valid ABI** for the event being filtered * All conditions must resolve to `true` for the event to trigger a webhook ### Supported Operators #### Logical operators | Operator | Description | Notes | Example | | :- | :- | - | - | | `and` | All nested conditions must match | Need at least 2 filters | `{ "or" : [ {..filter1}, {...filter2} ]}` | | `or` | At least one nested condition must match | Need at least 2 filters | `{ "and" : [ {..filter1}, {...filter2} ]} ` | #### Comparison operators | Operator | Description | Notes | Example | | :- | :- | :- | - | | `eq` | Equal to | | `{ "eq": ["value", "1000"] }` | | `ne` | Not equal to | | `{ "ne": ["address", "0x...325"] }` | | `lt` | Less than | Numeric values only | `{ "lt": ["amount", "50"] }` | | `gt` | Greater than | Numeric values only | `{ "gt": ["price", "500000"] }` | | `lte` | Less than or equal | Numeric values only | `{ "lte": ["amount", "100"] }` | | `gte` | Greater than or equal | Numeric values only | `{ "gte": ["amount", "100"] }` | | `in` | Value exists in array | Array required | `{ "in": ["name": ["alice", "bob"]]}` | | `nin` | Value not in array | Array required | `{ "nin": ["name": ["bob", "alice"]]}` | *** ### Special Stream Variables (EVM) Moralis provides special variables that can be used in filters to access stream-level metadata. These are EVM-specific. | Variable | Description | | :- | :- | | `moralis_streams_contract_address` | Contract emitting the event (lowercase) | | `moralis_streams_chain_id` | Chain ID for the event | | `moralis_streams_possibleSpam` | Indicates if the event is flagged as spam | #### Example: filter by contract address ```javascript theme={null} { "eq": ["moralis_streams_contract_address", "0x0000000000000000000000000000000000000000"] } ``` > [!NOTE] > > Note: contract addresses must be lowercase. EVM addresses are case-insensitive, so always `toLowerCase()` for comparison. *** ### Filtering Possible Spam Events (EVM) Some EVM contract addresses are associated with spam, phishing attempts, or other suspicious activity. Moralis identifies these and flags them with `possibleSpam = true`. You can exclude these events entirely by enabling: ```javascript theme={null} "filterPossibleSpamAddresses": true ``` When enabled: * Events involving contracts flagged as possible spam are excluded * No webhook is sent * No usage is consumed By default, `filterPossibleSpamAddresses` is set to `false`. Spam detection is currently EVM-only — see [Spam Detection](/streams/security-and-reliability/spam-detection). *** ### Example: Different Rules per Contract (EVM) You can apply different thresholds depending on which contract emitted the event. ```javascript theme={null} { "or": [ { "and": [ { "eq": ["moralis_streams_contract_address", "0x1"] }, { "gte": ["value", 1000000000] } ] }, { "and": [ { "eq": ["moralis_streams_contract_address", "0x2"] }, { "gte": ["value", 1000000000000000000000] } ] } ] } ``` This is useful when monitoring multiple tokens with different decimals or value semantics. *** ### Example: Filtering by Value Range (EVM) Filter transfers where the amount is between two values: ```javascript theme={null} { "and": [ { "gt": ["value", 5000000000] }, { "lt": ["value", 50000000000] } ] } ``` > Example assumes a token with 6 decimals (e.g. USDC). *** ### Example: Mint and Burn Detection (EVM) A zero address indicates: * **Mint** when used as `from` * **Burn** when used as `to` ```javascript theme={null} { "or": [ { "and": [ { "eq": ["from", "0x0000000000000000000000000000000000000000"] }, { "gte": ["value", 10000000000] } ] }, { "and": [ { "eq": ["to", "0x0000000000000000000000000000000000000000"] }, { "gte": ["value", 10000000000] } ] } ] } ``` *** ### Important Notes (EVM JSON filters) * Filters require a **valid ABI** for the event being filtered * Filters are evaluated **before webhook delivery** * Invalid filters will prevent the stream from working * Filters use **AND / OR logic only** (no implicit precedence) *** ## When to Use Filters Use filters to: * Reduce webhook volume * Exclude spam or low-value events (EVM) * Trigger alerts only for meaningful activity * Apply different logic per contract or chain # Parsed Data Source: https://docs.moralis.com/streams/streams-concepts/parsed-data Learn how to extract typed, decoded data from Streams webhooks across EVM (ERC-20 / NFT transfers, contract events), Bitcoin (UTXO outputs), and Solana (SPL balance snapshots, instructions). ## Overview Moralis Streams makes it easy to work with webhook payloads by providing **parsed, structured data** for common on-chain activity. The data Moralis parses for you depends on the chain. > [tab] EVM > > On EVM, Moralis includes ready-to-use parsed sections such as: > > * **Transactions** (`txs`) > * **Internal transactions** (`txsInternal`) > * **ERC-20 transfers** (`erc20Transfers`) > * **ERC-20 approvals** (`erc20Approvals`) > * **NFT transfers** (`nftTransfers`) > * **NFT approvals** (`nftApprovals`) > * **Custom smart contract events**, decoded using your ABI > > This avoids manually decoding logs and building your own parsing pipeline. > > Example payload shape: > > ```javascript theme={null} > { > "confirmed": false, > "chainId": "0x1", > "streamId": "uuid", > "tag": "string", > "retries": 0, > "block": { }, > "logs": [], > "txs": [], > "txsInternal": [], > "erc20Transfers": [], > "erc20Approvals": [], > "nftTransfers": [], > "nftApprovals": { "ERC721": [], "ERC1155": [] } > } > ``` > > Learn more about [EVM Webhook Payloads](/streams/webhooks/webhook-payloads). > [tab] Bitcoin > > On Bitcoin, each matched transaction comes with parsed UTXO-level fields: > > * **Block metadata** — hash, height, timestamp, difficulty, merkle root, transaction count > * **Transaction details** — `txid`, `version`, `locktime`, input/output counts > * **Outputs (`vout`)** — value in BTC (not satoshis), `scriptPubKey.address` (recipient), `scriptPubKey.type` > * **Inputs (`vin`)** — structural fields only (`address` and `value` are always `null`) > > Output recipient addresses are already parsed and matched against your watched addresses (or addresses derived from a registered xpub) — no additional decoding required. > > > [!WARNING] > > > > `vin` entries do not include populated `address` or `value` fields, even with `includeInputs: true`. You can reliably detect **inbound** transfers; outflows require additional lookup. See [Bitcoin Streams](/streams/bitcoin-streams). > > Output values are BTC decimals — convert to satoshis with `Math.round(btc * 1e8)`. > [tab] Solana > > On Solana, every matched transaction comes with parsed snapshots that make instruction-level replay unnecessary for most use cases: > > * **`accountKeys`** — every account the transaction touches (signers, recipients, programs, reads, writes) > * **`instructions`** — top-level instructions with their `programId` and accounts > * **`innerInstructions`** — nested instructions emitted via Cross-Program Invocations (CPIs) > * **`preTokenBalances` / `postTokenBalances`** — SPL token balance snapshots before and after the transaction > > To compute SPL token deltas, subtract `preTokenBalances` from `postTokenBalances` for the accounts you care about — no instruction replay required. > > > [!WARNING] > > > > Solana addresses are base58 and **case-sensitive**. Submit them in their original case — unlike EVM, lowercased addresses will not match. > > Learn more about [Solana Streams](/streams/solana-streams). *** ## Parsing Smart Contract Events (EVM) > [!NOTE] > > Custom-event ABI decoding is an EVM-only feature. Bitcoin and Solana payloads are pre-parsed into their native shapes and do not require ABI decoding. If you are streaming a smart contract event on EVM, you can decode the logs from the webhook into a typed structure. ```javascript theme={null} import Moralis from "moralis"; import { BigNumber } from "@moralisweb3/core"; interface URI { value: string; id: BigNumber; } const webhookData = { confirmed: true, chainId: "0x1", abi: [ { anonymous: false, inputs: [ { indexed: false, internalType: "string", name: "value", type: "string" }, { indexed: true, internalType: "uint256", name: "id", type: "uint256" }, ], name: "URI", type: "event", }, ], logs: [ { logIndex: "475", transactionHash: "0x55125fa34ce16c295c222d48fc3efe210864dc2fb017f5965b4e3743d72342d5", address: "0x495f947276749ce646f68ac8c248420045cb7b5e", data: "0x0000000000000000000000000000000000000000000000000000000000000020...", topic0: "0x6bb7ff708619ba0610cba295a58592e0451dee2622938c8755667688daf3529b", topic1: "0xab6953e647a36018fc48d6223583597b84c755a0000000000000010000000001", topic2: null, topic3: null, }, ], erc20Transfers: [], erc20Approvals: [], nftApprovals: { ERC1155: [], ERC721: [] }, nftTransfers: [], }; const decodedLogs = Moralis.Streams.parsedLogs(webhookData); console.log(decodedLogs[0].value); console.log(decodedLogs[0].id.toString()); ``` *** ## Notes * On EVM, prefer the dedicated parsed arrays (`erc20Transfers`, `nftTransfers`, etc.) over decoding raw logs yourself. * On EVM, custom-event decoding relies on the ABI you configure for the stream — raw logs remain available in the payload alongside parsed data. * On Bitcoin, output addresses and values are already parsed; no decoding step is needed. * On Solana, account keys, instructions, and SPL balance snapshots are already parsed; subtract pre/post token balances to derive deltas. # Rate Limits Source: https://docs.moralis.com/streams/streams-concepts/rate-limits Understand Streams plan limits on streams and addresses, rate limits on address management, and how stream reloads impact webhook delivery. ## Stream & Address Limits The number of streams you can create, and the total number of addresses you can watch across all of them, depend on your plan: | Plan | Streams per account | Watched addresses per account | | - | - | - | | All plans below Enterprise | 200 | 50,000 | | Enterprise | Custom | Custom, into the millions | The address limit applies to your **whole account**, not to each stream. If you need to watch more than 50,000 addresses, or need more than 200 streams, [reach out to the team](https://moralis.com/enterprise/) about an Enterprise plan. > [!TIP] > > You rarely need one stream per user. Add new addresses to an existing stream instead of creating a new stream for each user or wallet. *** ## Rate Limits & Address Management Streams rate limits primarily apply to **stream configuration changes**, not event delivery. The most important limits to understand relate to **adding addresses to a stream**, as these operations trigger internal reloads that affect when monitoring becomes active. *** ## Address Management & Stream Reloads When you add new addresses to a stream, Moralis must **reload the stream configuration** to include those addresses in monitoring. This reload: * Is asynchronous * Takes longer as the number of addresses increases * Must complete before new blocks are processed for the added addresses During a reload, the stream may temporarily be unable to detect events for newly added addresses. *** ## Rate Limits for Adding Addresses ### Address add rate limit * **Maximum:** 5 requests per 5 minutes * Each request may include **multiple addresses** If you need to add many addresses, always batch them into as few requests as possible. The same rate limit applies on every chain — but what counts as an "address" depends on the chain: * **EVM** — hex-encoded `0x...` addresses, case-insensitive * **Bitcoin** — P2PKH (`1...`), P2SH (`3...`), or Bech32 (`bc1q...`). Adding an [xpub](/streams/api-reference/bitcoin/xpub/add-xpub) is a separate operation that auto-derives addresses for HD wallets and is **not** counted as an address-add against this limit. * **Solana** — base58 addresses, **case-sensitive** (unlike EVM). Programs IDs and mint addresses count toward the same address-add limit when added through the address endpoints. > [!WARNING] > > Solana addresses must be submitted in their original case. Lowercased addresses will not match. *** ## Impact on Webhook Delivery ### Reload timing If an address is added shortly before a block is produced: * The stream may not finish reloading in time * Events involving the new address in that block may be missed * No webhook will be sent for those events This is more likely when: * The stream already contains many addresses * Multiple address updates are submitted close together *** ### Reload loops Submitting many small address-addition requests can: * Trigger repeated reloads * Slow down activation of new addresses * Cause you to hit the rate limit * Delay effective monitoring *** ## Best Practices ### Batch address updates Always batch addresses into a single request when possible.\ This reduces reloads and speeds up activation. *** ### Plan address additions ahead of time If you expect activity on a new address: * Add it **well before** the expected transaction * Avoid last-second updates near block times Streams are not designed for ultra-last-second address registration. *** ## Handling Missed Events If you believe events were missed due to reload timing: ### 1. Verify address addition Confirm the address was successfully added using the **Get Stream Info** endpoint. ### 2. Replay affected blocks Use the **Replay Block** endpoint with: * The affected block number * The relevant stream ID This allows Moralis to reprocess the block and resend applicable webhooks. *** ## What Rate Limits Do *Not* Apply To * Event delivery volume * Number of webhooks received * Number of monitored events per block These are governed by stream configuration and pricing, not per-request rate limits. *** ## Summary * Plans below Enterprise allow 200 streams and 50,000 watched addresses per account; Enterprise limits are custom * Address additions trigger stream reloads * Reloads are not instantaneous * Address add requests are rate limited * Batch updates and planning ahead are essential * Missed events can be recovered using block replay # Re-org Handling Source: https://docs.moralis.com/streams/streams-concepts/re-org-handling Learn how Moralis Streams detects and handles blockchain reorganizations to ensure reliable and consistent event delivery. ### Overview A blockchain reorganization (re-org) occurs when a previously accepted block is replaced by another block at the same height. Re-orgs are a normal part of blockchain operation, especially on: * High-throughput chains * L2s * Testnets Moralis Streams is designed to **handle re-orgs safely and transparently**. *** ### How Streams Handles Re-orgs When a re-org occurs: 1. Streams detects the replaced block 2. Events from the dropped block are invalidated 3. Replacement block events are processed 4. Confirmation logic is recalculated You do **not** need to manually detect or resolve re-orgs. *** ### Impact on Webhooks Re-org handling is reflected through: * `confirmed: false` events that may not be finalized * `confirmed: true` events only sent after finality If a transaction is removed due to a re-org: * It will **not** receive a confirmed webhook * Replacement transactions will be delivered instead See also: * [**Confirmation & Finality**](/streams/webhooks/confirmation-and-finality) * [**Webhook Delivery**](/streams/webhooks/webhook-delivery) *** ### Why This Matters Without re-org handling, applications risk: * Double-counting transactions * Incorrect balances * Invalid ownership state Streams ensures: * Only finalized state is confirmed * Re-orgs do not corrupt downstream systems *** ### Re-org Behavior by Chain * **EVM** — re-orgs are most common on high-throughput chains, L2s, and testnets. Confirmation thresholds vary per chain (see [Supported Chains](/streams/supported-chains)). * **Bitcoin** — re-orgs follow the longest-valid-chain rule and are exponentially less likely with each additional confirmation. * **Solana** — re-orgs are rare and bounded by the network's slot-based finality model. In all cases, the same Streams handling applies: dropped transactions never receive a `confirmed: true` webhook, and replacement transactions are delivered in their place. *** ### Replays & Recovery If your system was offline during a re-org: * You can replay affected blocks * You can replay failed webhooks See also: * [**Retries & Replays**](/streams/webhooks/retries-and-replays) *** ### Best Practices * Treat `confirmed: false` as provisional * Persist only confirmed state * Make handlers idempotent * Use replays for recovery, not polling # Stream Lifecycle Source: https://docs.moralis.com/streams/streams-concepts/stream-lifecycle-and-management Learn how to manage Streams throughout their lifecycle, including monitoring status, updating configuration, changing regions, and pausing or resuming streams. ## Overview Moralis Streams can be **created, monitored, updated, paused, and resumed** at any time - either programmatically or via the Moralis dashboard. This gives you full control over how streams behave in production and allows you to safely manage changes without deleting or recreating streams. *** ## Stream States Each stream has a lifecycle state that indicates whether it is actively delivering events. ### Supported statuses | Status | Description | | :- | :- | | `active` | Stream is live and delivering webhooks | | `paused` | Stream is temporarily disabled | | `error` | Stream encountered a configuration or delivery error | | `terminated` | Stream was automatically stopped after 24 hours in `error` state | The current status is returned when listing or fetching streams. *** ## Listing Streams You can retrieve all streams associated with your account to inspect their configuration and status. ```javascript theme={null} const streams = await Moralis.Streams.getAll({ limit: 100, }); ``` Each stream includes metadata such as: * Webhook URL * Enabled chains * Status * Filters and ABI configuration * Region and delivery settings Streams can also be viewed and managed from the dashboard. *** ## Updating Stream Configuration Streams can be updated at any time to reflect changes such as: * Webhook URL updates * Adding or removing chains * Adjusting filters or ABIs * Changing stream behavior Example: updating a webhook URL ```javascript theme={null} await Moralis.Streams.update({ id: "STREAM_ID", webhook: "https://your-new-webhook-url", }); ``` Updates take effect immediately and do not require stream recreation. *** ## Pausing and Resuming Streams Streams can be paused without deleting them. This is useful for: * Maintenance windows * Incident response * Temporary traffic reduction ### Pause a stream ```javascript theme={null} await Moralis.Streams.updateStatus({ id: "STREAM_ID", status: "paused", }); ``` ### Resume a stream ```javascript theme={null} await Moralis.Streams.updateStatus({ id: "STREAM_ID", status: "active", }); ``` Paused streams do not process events and do not send webhooks. *** ## Stream Regions Each stream runs in a specific region to optimise webhook delivery latency. Available regions include: * `us-east-1` * `us-west-2` * `eu-central-1` You can update the region at any time: ```javascript theme={null} await Moralis.Streams.setSettings({ region: "eu-central-1", }); ``` For best performance, choose the region closest to your backend infrastructure. *** ## Error Handling If a stream enters the `error` state: * The stream stops delivering events * A status message is provided explaining the issue * Configuration must be corrected before resuming Common causes include: * Invalid ABI definitions * Invalid filters * Unreachable webhook endpoints Read more about [Error Handling](/streams/streams-concepts/error-handling). *** ## Terminated State If a stream remains in the `error` state for **24 hours**, it is automatically **terminated**. A terminated stream: * Does **not** send webhooks * Does **not** process new blocks * Drops all events that occur after termination * Cannot be automatically resumed When a stream is terminated, an **email notification** is sent to the account owner. Read more about [Terminated States](/streams/streams-concepts/error-handling). *** ## Best Practices * Pause streams instead of deleting them when troubleshooting * Monitor stream status regularly in production * Keep webhook URLs and regions aligned with your deployment setup * Use descriptive stream tags to identify purpose and ownership # Triggers Source: https://docs.moralis.com/streams/streams-concepts/triggers Run read-only smart contract calls as part of Streams processing and enrich webhook events with on-chain data in real time. > [!NOTE] > > Triggers (read-only contract calls, ERC-20 / NFT transfer ABIs, `topic0`) are an **EVM-only** feature. Bitcoin and Solana streams use chain-native filtering instead — see [Filters](/streams/streams-concepts/filters). ## Overview Triggers allow you to **run read-only smart contract functions** as part of Streams processing and include the results directly in your webhook payloads. This enables powerful real-time enrichment, such as: * Fetching token balances during transfers * Reading contract state when an event fires * Attaching computed on-chain data to each streamed event Triggers are evaluated **at stream time**, without requiring additional API calls from your backend. *** ## How Triggers Work A trigger defines: * **When** it should run (which event type) * **Which contract function** to call * **What inputs** to pass (static values or dynamic selectors) When a matching event occurs: 1. Moralis executes the read-only contract call 2. The result is attached to the corresponding event object 3. The enriched event is delivered in the webhook *** ## Supported Trigger Types Triggers can run against different parts of a webhook payload. | Type | Description | | :- | :- | | `tx` | Run once per transaction | | `log` | Run per decoded contract event | | `erc20transfer` | Run per ERC-20 transfer | | `erc20approval` | Run per ERC-20 approval | | `nfttransfer` | Run per NFT transfer | Additional trigger types may be added over time. *** ## Trigger Definition A trigger is defined using the following structure: ```javascript theme={null} interface Trigger { type: "tx" | "log" | "erc20transfer" | "erc20approval" | "nfttransfer"; contractAddress: string; functionAbi: AbiItem; inputs?: (string | string[])[]; topic0?: string; callFrom?: string; } ``` *** ## Trigger Fields Explained ### `type` Specifies which event type the trigger runs against. Example: ```javascript theme={null} "type": "erc20transfer" ``` *** ### `contractAddress` The address of the contract containing the function to call. * Must be a valid address **or a selector** * Selectors allow dynamic resolution per event *** ### `functionAbi` The ABI of a **single read-only function**. Requirements: * Must be a `view` or `pure` function * Arrays of ABI items are not supported * Selectors are **not** supported inside ABI definitions You may rename output fields in the ABI to control how results appear in the webhook. *** ### `inputs` (optional) Inputs passed to the function call. * Order must match the function ABI * Values can be static or selectors * Structs are supported using arrays Example: ```javascript theme={null} "inputs": ["$from"] ``` *** ### `topic0` (optional) Restricts execution to a specific event signature. * Only valid when `type` is `log` * Requires the event ABI to be present in the stream * Selectors are not allowed *** ### `callFrom` (optional) Overrides `msg.sender` for the contract call. * Must be a valid address or selector * Useful for contracts with access-controlled view functions *** ## Selectors Selectors dynamically reference values from the current webhook event. * Begin with `$` * Must be valid for the trigger type * Validation ensures address selectors resolve to valid addresses ### Common selectors | Selector | Description | | :- | :- | | `$contract` | Contract address for the current event | | `$from` | Sender address | | `$to` | Recipient address | | `$value` | Transfer amount | Invalid selectors will cause stream creation or updates to fail. *** ## Example: Fetch ERC-20 Balances During Transfers This example enriches every ERC-20 transfer with the sender’s and receiver’s balances at the time of the transfer. ### Step 1: Define the ABI ```javascript theme={null} const balanceOfSenderAbi = { name: "balanceOf", type: "function", stateMutability: "view", inputs: [{ name: "owner", type: "address" }], outputs: [{ name: "fromBalance", type: "uint256" }], }; ``` ```javascript theme={null} const balanceOfReceiverAbi = { name: "balanceOf", type: "function", stateMutability: "view", inputs: [{ name: "owner", type: "address" }], outputs: [{ name: "toBalance", type: "uint256" }], }; ``` *** ### Step 2: Create Triggers ```javascript theme={null} const triggers = [ { type: "erc20transfer", contractAddress: "$contract", functionAbi: balanceOfSenderAbi, inputs: ["$from"], }, { type: "erc20transfer", contractAddress: "$contract", functionAbi: balanceOfReceiverAbi, inputs: ["$to"], }, ]; ``` *** ### Step 3: Resulting Webhook Enrichment Each ERC-20 transfer will include trigger results: ```javascript theme={null} "triggers": [ { "name": "fromBalance", "value": "6967063534600021400000" }, { "name": "toBalance", "value": "200000000000000000" } ] ``` Trigger results appear **in the same order** as defined. *** ## Error Handling * Invalid triggers are rejected when creating or updating a stream * Contract existence is not validated ahead of time * If a contract call fails: * The webhook is still delivered * The trigger result includes an error message This ensures Streams remain resilient under partial failures. *** ## Notes on Read-Only Functions Triggers only support **read-only** contract calls: * `stateMutability: view` * `stateMutability: pure` Functions that modify state or require gas are not supported. *** ## When to Use Triggers Triggers are ideal when you want to: * Enrich events with on-chain state * Reduce API calls from your backend * Attach contextual data at event time * Keep webhook payloads self-contained # Streams Supported Chains Source: https://docs.moralis.com/streams/supported-chains Blockchains supported by Moralis Streams for real-time onchain event and activity monitoring. ### Streams Supported Chains Moralis Streams provide **real-time onchain data delivery** via webhooks, allowing you to react to blockchain activity as it happens. Streams support a subset of chains where: * Real-time indexing is available. * Finality and reorg handling meet production requirements. Use the tables below to see which chains are supported for Streams and what types of events can be monitored. ⚠️ **Moonbeam and Moonriver are deprecated.** Both chains stopped producing new blocks on August 1, 2026, and Moralis support is removed on **September 25, 2026**, following Moonbeam's network relaunch on Base. GLMR and MOVR are now ERC-20 tokens on Base, so migrate to the `base` chain parameter and export any history you still need before that date. See the [deprecation notice](/changelog#moonbeam-moonriver-and-lisk-support-ends-september-25-2026) for contract addresses and details. ⚠️ **Lisk is deprecated.** Moralis support for Lisk ( `0x46f`) is removed on **September 25, 2026**, ahead of the Lisk Chain wind-down. Migrate to the `eth` or `base` chain parameter and export any history you still need before that date. See the [deprecation notice](/changelog#moonbeam-moonriver-and-lisk-support-ends-september-25-2026) for the full timeline. ### Non-EVM Chains Bitcoin and Solana streams have their own API groups and chain-specific configuration. See [Bitcoin Streams](/streams/bitcoin-streams) and [Solana Streams](/streams/solana-streams) for details. | Chain Name | Type | Chain ID | Streams Supported | Confirmation Threshold | | - | - | - | - | - | | Bitcoin Mainnet | Mainnet | `btc-mainnet` | ✓ | 2 blocks | | Solana Mainnet | Mainnet | `solana_mainnet` | ✓ | 100 slots | > [!NOTE] > > `Internal Txs` is an EVM-only concept and does not apply to Bitcoin or Solana. On Solana, the time unit is the **slot** rather than the block — most slots produce a block. ### EVM Chains | Chain Name | Type | Chain ID | Streams Supported | Internal Txs | Blocks Until Confirmed | | - | - | - | - | - | - | | Ethereum Mainnet | Mainnet | 0x1 (1) | ✓ | ✓ | 12 | | Ethereum Sepolia | Testnet | 0xaa36a7 (11155111) | ✓ | ✗ | 18 | | Polygon Mainnet | Mainnet | 0x89 (137) | ✓ | ✓ | 100 | | Polygon Amoy | Testnet | 0x13882 (80002) | ✓ | ✗ | 100 | | Binance Smart Chain Mainnet | Mainnet | 0x38 (56) | ✓ | ✓ | 18 | | Binance Smart Chain Testnet | Testnet | 0x61 (97) | ✓ | ✗ | 18 | | Arbitrum | Mainnet | 0xa4b1 (42161) | ✓ | ✓ | 18 | | Arbitrum Sepolia | Testnet | 0x66eee (421614) | ✓ | ✗ | 600 | | Base | Mainnet | 0x2105 (8453) | ✓ | ✓ | 100 | | Base Sepolia | Testnet | 0x14a34 (84532) | ✓ | ✗ | 100 | | Optimism | Mainnet | 0xa (10) | ✓ | ✓ | 500 | | Optimism Sepolia | Testnet | 0xaa37dc (11155420) | ✓ | ✗ | 600 | | Linea | Mainnet | 0xe708 (59144) | ✓ | ✓ | 100 | | Avalanche | Mainnet | 0xa86a (43114) | ✓ | ✓ | 100 | | Cronos Mainnet | Mainnet | 0x19 (25) | ✓ | ✗ | 100 | | Gnosis | Mainnet | 0x64 (100) | ✓ | ✗ | 100 | | Chiliz Mainnet | Mainnet | 0x15b38 (88888) | ✓ | ✓ | 100 | | Moonbeam (deprecated) | Mainnet | 0x504 (1284) | ✓ | ✗ | 100 | | Moonriver (deprecated) | Testnet | 0x505 (1285) | ✓ | ✗ | 100 | | Flow | Mainnet | 0x2eb (747) | ✓ | ✓ | 100 | | Flow Testnet | Testnet | 0x221 (545) | ✓ | ✗ | 100 | | Ronin | Mainnet | 0x7e4 (2020) | ✓ | ✓ | 100 | | Ronin Saigon Testnet | Testnet | 0x7e5 (2021) | ✓ | ✗ | 100 | | Lisk (deprecated) | Mainnet | 0x46f (1135) | ✓ | ✓ | 100 | | Pulsechain | Mainnet | 0x171 (369) | ✓ | ✗ | 100 | | HyperEVM | Mainnet | 0x3e7 (999) | ✓ | ✓ | 100 | | Sei | Mainnet | 0x531 (1329) | ✓ | ✗ | N/A | | Monad | Mainnet | 0x8f (143) | ✓ | ✓ | 100 | | Robinhood Chain | Mainnet | 0x1237 (4663) | ✓ | ✗ | N/A | | Tempo | Mainnet | 0x1079 (4217) | ✓ | ✓ | 30 | > [!NOTE] > > For Robinhood Chain, Streams requires the hex chain ID `0x1237`. Chain aliases such as `robinhood` are not accepted. # Confirmation & Finality Source: https://docs.moralis.com/streams/webhooks/confirmation-and-finality Understand how blockchain confirmations work, how Moralis defines finality, and how confirmed and unconfirmed webhooks should be handled. ### Overview Blockchains are probabilistic systems. A transaction may appear in a block and later be removed due to a chain reorganization (re-org). To handle this safely, Moralis Streams distinguishes between **unconfirmed** and **confirmed** events and delivers both to your backend. This page explains **what confirmation and finality mean**, and how they are exposed through Streams. *** ### What Is Confirmation? When a transaction is included in a newly mined block, it is considered **unconfirmed**. At this stage: * The block may still be replaced * Transactions may be reordered or dropped * State changes are *not final* Streams delivers these events with: ```javascript theme={null} "confirmed": false ``` This enables **low-latency, real-time reactions**. See also: * [**Webhook Delivery**](/streams/webhooks/webhook-delivery) * [**Webhook Payload**](/streams/webhooks/webhook-payloads) *** ### What Is Finality? A transaction becomes **confirmed** once enough blocks have been mined on top of it. At this point: * The risk of re-org is extremely low * State can be safely persisted * Balances and ownership can be finalized Streams delivers a second webhook with: ```javascript theme={null} "confirmed": true ``` Confirmation thresholds vary by chain. See [**Supported Chains**](/streams/supported-chains)**.** *** ### Finality by Chain Each chain has its own finality model, which determines how long it takes for a `confirmed: true` webhook to arrive after the initial unconfirmed delivery: > [tab] EVM > > EVM finality is **probabilistic** and varies per chain. Confirmation thresholds are expressed as a number of blocks that must be mined on top of the block containing the transaction. Ethereum and other EVM chains can experience reorgs up to a chain-specific depth, after which the transaction is treated as final. > > See [Supported Chains](/streams/supported-chains) for the per-chain confirmation block counts. > [tab] Bitcoin > > Bitcoin finality is **proof-of-work based**. Once a transaction is included in a mined block, each subsequent block adds another confirmation. Streams sends up to three deliveries per matching transaction: > > * A **mempool** delivery when the transaction is first broadcast — `confirmed: false`, with sentinel `block.height: "0"` and `block.hash: "mempool"`. Delivered at most once and not guaranteed for every tx > * `confirmed: false` when the transaction is first included in a block — the block is close to the chain tip and could still be reorged > * `confirmed: true` once 2 additional blocks have been mined on top, at which point Moralis re-fetches the block and treats the transaction as reorg-safe > > Bitcoin reorgs follow the longest-valid-chain rule and become exponentially less likely with each additional confirmation. See [Supported Chains](/streams/supported-chains) for the threshold Streams uses, and [Mempool Notifications](/streams/bitcoin-streams#mempool-notifications) for the unconfirmed-delivery behavior. > [tab] Solana > > Solana finality is **slot-based** and typically reached very quickly compared to other chains. The unconfirmed delivery is sent when the slot is produced; the confirmed delivery follows once the slot is finalized. Reorgs are rare and bounded by the network's finality model. > > See [Supported Chains](/streams/supported-chains) for the exact threshold Streams uses. *** ### Why Streams Sends Two Webhooks Streams intentionally sends **both states** so you can: * React instantly (unconfirmed) * Persist safely (confirmed) This avoids the need to: * Poll block explorers * Manually track confirmations * Reconcile state after re-orgs For how Streams handles re-orgs internally: * [**Re-org Handling**](/streams/streams-concepts/re-org-handling) *** ### Ordering & Edge Cases In rare cases: * A `confirmed: true` webhook may arrive before `confirmed: false` This can occur due to: * Network latency * Retry behavior * Regional delivery differences Your system should: * Treat each webhook independently * Use transaction hash + confirmation flag * Be idempotent *** ### Common Patterns **Real-time UX** * Act on `confirmed: false` * Update UI optimistically **Accounting / Persistence** * Only persist on `confirmed: true` **Analytics** * Use both, but deduplicate by transaction hash *** ### Next Steps * How re-orgs are handled internally → Explore [Re-org Handling](/streams/streams-concepts/re-org-handling) * How delivery works end-to-end → Explore [Webhook Delivery](/streams/webhooks/webhook-delivery) * How to replay affected blocks → Explore [Retries & Replays](/streams/webhooks/retries-and-replays) # Retries & Replays Source: https://docs.moralis.com/streams/webhooks/retries-and-replays Recover missed Streams events by replaying blocks and streams, and understand how Moralis handles retries, failures, and recovery scenarios. ## Overview Streams is designed for **reliable, real-time delivery**, but there are situations where events may need to be replayed or recovered. Moralis provides **manual replay mechanisms** to help you recover missed webhooks caused by configuration changes, reload timing, or temporary failures. *** ## When Replays Are Needed You may need to replay events if: * A stream was reloading when a block was produced * Addresses were added shortly before on-chain activity * A webhook endpoint was temporarily unavailable * A stream was paused or in an error state * You are recovering from an incident or deployment issue Replays allow you to **reprocess past blocks** and receive the webhooks that would have been delivered. *** ## Replay Block The **Replay Block** feature reprocesses a specific block for a given stream. When replayed: * The block is re-evaluated against the stream configuration * Matching events trigger webhooks again * Webhooks are delivered as if the block just occurred This is the most precise way to recover missed events. *** ### When to Use Block Replay Use block replay when: * You know the exact block number that was missed * Only a small time window was affected * You want to avoid duplicate data outside that block *** ## Replay Best Practices * Always confirm the stream configuration before replaying * Replays respect the **current** stream configuration * Ensure your webhook handler is **idempotent** * Avoid replaying large numbers of blocks unnecessarily *** ## Webhook Retries vs Replays It’s important to distinguish between **automatic retries** and **manual replays**. ### Automatic retries * Triggered when your webhook endpoint returns an error or times out * Handled automatically by Moralis * Occur shortly after the initial delivery attempt * Do **not** require manual intervention ### Manual replays * Triggered by you * Used to recover missed events * Can replay historical blocks * Useful after configuration changes or outages *** ## Recovery After Stream Reloads When addresses are added to a stream, a reload is required. If activity occurs before the reload completes: * The event may not trigger a webhook * The block can be recovered using replay This is a normal and expected edge case for dynamic address management. *** ## Recovery After Errors or Termination * Streams in the `error` state stop delivering events * Streams in the `terminated` state stop permanently In both cases: * Events occurring during downtime are not queued * Replays can be used to recover missed blocks * Terminated streams require creating a new stream before replaying *** ## Designing for Recovery To make recovery safe and predictable: * Treat webhook processing as **idempotent** * Use transaction hashes + log indexes as unique identifiers * Log replayed events separately if needed * Avoid assuming delivery order Streams prioritises **correctness over ordering**. *** ## What Cannot Be Recovered Replays cannot recover: * Events that occurred before a stream existed * Events filtered out by stream configuration * Events dropped intentionally (e.g. spam filtering) *** ## Summary * Streams delivers events in real time, with retries * Reloads and failures can cause missed events * Block replay allows precise recovery * Recovery is explicit and controlled * Idempotent webhook handling is essential # Test Webhooks Source: https://docs.moralis.com/streams/webhooks/test-webhooks Learn how Moralis uses test webhooks to validate your endpoint when creating or updating a stream, and how to handle them correctly. ## Overview Whenever you **create or update a stream**, Moralis sends a **test webhook** to your configured webhook URL. This test verifies that: * Your endpoint is reachable * Your server responds correctly * Webhook delivery can safely begin If the test webhook is **not acknowledged successfully**, the stream will **not start**. *** ## When Test Webhooks Are Sent A test webhook is sent when you: * Create a new stream * Update an existing stream (e.g. webhook URL, filters, addresses, chains) * Reactivate a paused stream This happens **before** any real on-chain events are delivered. *** ## Required Response To pass the test webhook: * Your server **must return a 2xx HTTP status code** * Common examples: `200`, `201`, `202` Any non-2xx response will cause the test to fail. > [!NOTE] > > No response body is required - only the status code matters. *** ## Test Webhook Payload The test webhook uses the **same payload structure** as real webhooks for that chain, but contains **empty data**. The shape varies by chain — make sure your handler tolerates the right one. > [tab] EVM > > ```javascript theme={null} > { > "confirmed": true, > "chainId": "", > "streamId": "", > "tag": "", > "retries": 0, > "block": { > "number": "", > "hash": "", > "timestamp": "" > }, > "logs": [], > "txs": [], > "txsInternal": [], > "erc20Transfers": [], > "erc20Approvals": [], > "nftTransfers": [], > "nftApprovals": { > "ERC721": [], > "ERC1155": [] > }, > "abi": {} > } > ``` > [tab] Bitcoin > > ```javascript theme={null} > { > "confirmed": true, > "chainId": "btc-mainnet", > "streamId": "", > "tag": "", > "retries": 0, > "block": { > "hash": "", > "height": 0, > "timestamp": 0 > }, > "txs": [] > } > ``` > [tab] Solana > > ```javascript theme={null} > { > "confirmed": true, > "chainId": "solana_mainnet", > "network": "mainnet", > "streamId": "", > "tag": "", > "retries": 0, > "block": { > "slot": "", > "blockHash": "", > "blockHeight": "", > "blockTime": 0 > }, > "transactions": [] > } > ``` Important notes: * No on-chain data is included * No transactions or logs are present * This payload **should not be persisted** For full payload documentation, explore [Webhook Payload](/streams/webhooks/webhook-payloads). *** ## How to Handle Test Webhooks Your webhook handler should: 1. Accept the request 2. Optionally log it 3. Return a 2xx response 4. Skip any application-specific processing A simple approach is to: * Detect empty payloads * Short-circuit processing *** ## Security Considerations Test webhooks: * Include an `x-signature` header * Should be verified the same way as real webhooks For signature verification, explore [**Webhook Security**](/streams/security-and-reliability/webhook-security)**.** *** ## Common Pitfalls ### Stream does not start Usually caused by: * Webhook endpoint returning non-2xx * Endpoint timing out * Server not reachable from the internet ### Test webhook processed as real data Avoid: * Writing empty events to your database * Triggering business logic on test payloads *** ## Relationship to Retries & Replays Test webhooks: * Are **not retried** * Are **not stored in history** * Cannot be replayed [Retries and Replays](/streams/webhooks/retries-and-replays) apply only to **real event webhooks**. *** ## Next Steps * Understand delivery guarantees → Explore [Webhook Delivery](/streams/webhooks/webhook-delivery) * Inspect real payloads → Explore [Webhook Payload](/streams/webhooks/webhook-payloads) * Secure your endpoint → Explore [Webhook Security](/streams/security-and-reliability/webhook-security) * Handle failures and recovery → Explore [Error Handling](/streams/streams-concepts/error-handling) # Webhook Delivery Source: https://docs.moralis.com/streams/webhooks/webhook-delivery Understand how Moralis reliably delivers blockchain events to your backend, including confirmation behavior, retries, ordering guarantees, and failure handling. ## Overview Webhook Delivery explains **how Streams sends events to your backend**, from the moment an on-chain event occurs to when your server successfully processes it. Moralis Streams is designed for **high reliability at scale**, handling retries, reorgs, confirmation logic, and backpressure automatically - so you can focus on building application logic. This page covers *delivery behavior*. For payload structure, configuration, or retries, see the linked pages below. *** ## How Webhook Delivery Works At a high level: 1. A block is produced on-chain 2. Streams detects matching events 3. Moralis sends a webhook to your endpoint 4. Delivery is retried automatically if it fails 5. Events are finalized once the block is confirmed You do **not** need to poll or manage state manually. To get started with creating streams, see: * [**Create Your First Stream**](/streams/quickstart/create-your-first-stream) *** ## Confirmed vs Unconfirmed Webhooks For most blockchain events, Streams delivers **two webhooks**: ### 1. Unconfirmed (`confirmed: false`) * Sent as soon as the block is mined * Low latency * Block may still be reorganized ### 2. Confirmed (`confirmed: true`) * Sent after sufficient confirmations * Safe to persist as final state This approach gives you **real-time responsiveness** without sacrificing correctness. > [!CAUTION] > > Edge case: In rare scenarios, a confirmed webhook may arrive before the unconfirmed one. Your system should handle both cases gracefully. For chain-specific confirmation thresholds, see: * [**Supported Chains**](/streams/supported-chains) For how reorgs are handled internally: * [**Re-org Handling**](/streams/streams-concepts/re-org-handling) *** ## Delivery Guarantees Moralis provides **at-least-once delivery** for all webhooks. This means: * A webhook will be delivered **until your server acknowledges it** * Failed deliveries are retried automatically * Duplicate deliveries are possible (and expected) Your webhook handler **must be idempotent**. Read more about [Delivery Guarantees](/streams/security-and-reliability/delivery-guarantees). *** ## Automatic Retries If your server fails to respond successfully: * Streams retries delivery using an exponential backoff schedule * Retries continue for up to **24 hours** * Retry count is included in the payload Retry behavior is automatic and requires no configuration. Detailed retry schedules and replay options: * [**Retries & Replays**](/streams/webhooks/retries-and-replays) *** ## Queueing & Backpressure To protect system stability, Streams maintains an internal delivery queue per webhook URL. Key points: * If your server processes webhooks too slowly, events queue up * The current queue size is sent in the `x-queue-size` response header * If the queue reaches its limit, the stream may enter an error state To avoid this: * Ensure your webhook endpoint responds quickly * Offload heavy processing to background workers * Deploy streams in a region close to your backend Read more about [Error Handling](/streams/streams-concepts/error-handling). *** ## Ordering Guarantees Webhook delivery is **not strictly ordered**. This can happen due to: * Network retries * Regional failover * Confirmed vs unconfirmed delivery timing You should **not assume ordering** and should always rely on: * Transaction hash * Log index * Block number * Confirmation state Explore [Webhook Payload](/streams/webhooks/webhook-payloads) structure details. *** ## Failure States Streams have multiple operational states: | Status | Description | | :- | :- | | `active` | Stream is live and delivering webhooks | | `paused` | Stream is temporarily disabled | | `error` | Stream encountered a configuration or delivery error | | `terminated` | Stream was automatically stopped after 24 hours in `error` state | Email notifications are sent when: * A stream enters error state * A stream is terminated Read more about [Stream Lifecycle](/streams/streams-concepts/stream-lifecycle-and-management) details. *** ## Security & Verification Every webhook includes an `x-signature` header. You **must verify this signature** to ensure the payload originated from Moralis. Signature verification is covered here [**Webhook Security**](/streams/security-and-reliability/webhook-security)**.** *** ## When to Use Replays If your system was down or missed events: * You can replay individual failed webhooks * You can replay entire blocks for a stream Replay tools are covered in [**Retries & Replays**](/streams/webhooks/retries-and-replays)**.** *** ## Common Next Steps Depending on what you’re building: * Want to understand the payload structure? Explore [Webhook Payload](/streams/webhooks/webhook-payloads) * Need to handle retries or replays? Explore [Retries & Replays](/streams/webhooks/retries-and-replays) * Debugging stream failures? Explore [Error Handling](/streams/streams-concepts/error-handling) * Hardening security? Explore [Webhook Security](/streams/security-and-reliability/webhook-security) # Webhook Payload Source: https://docs.moralis.com/streams/webhooks/webhook-payloads Understand the structure of Streams webhook payloads across EVM, Bitcoin, and Solana — including transactions, transfers, logs, confirmations, retries, and signature verification. ## Overview Every Streams webhook delivers a **JSON payload** containing the on-chain events that match your stream configuration. Payload shape depends on the chain: * **EVM** payloads include native transactions, internal transactions, contract logs, and included decoded ERC-20 / NFT transfers and approvals. * **Bitcoin** payloads include block metadata and matched transactions with output (`vout`) and input (`vin`) details. * **Solana** payloads include slot/block metadata and matched transactions with `accountKeys`, instructions, inner instructions, and pre/post token balances. The exact contents within each chain depend on the options enabled when the stream was created. *** ## Top-Level Payload Structure > [tab] EVM > > ```javascript theme={null} > { > "confirmed": false, > "chainId": "0x1", > "streamId": "uuid", > "tag": "string", > "retries": 0, > "block": { }, > "logs": [], > "txs": [], > "txsInternal": [], > "erc20Transfers": [], > "erc20Approvals": [], > "nftTransfers": [], > "nftApprovals": { "ERC721": [], "ERC1155": [] } > } > ``` > > | Field | Description | > | :- | :- | > | `confirmed` | Whether the block is finalized | > | `chainId` | Hex-encoded EVM chain ID | > | `streamId` | Unique stream identifier | > | `tag` | Optional stream tag | > | `retries` | Number of delivery attempts | > | `block` | Block metadata | > | `logs` | Raw smart contract logs | > | `txs` | Native transactions | > | `txsInternal` | Internal (contract) transactions | > [tab] Bitcoin > > ```javascript theme={null} > { > "confirmed": false, > "chainId": "btc-mainnet", > "streamId": "uuid", > "tag": "string", > "retries": 0, > "block": { > "hash": "00000000000000000003c4...", > "height": 832150, > "timestamp": 1709120448, > "difficulty": "...", > "merkleRoot": "...", > "txCount": 3214 > }, > "txs": [ > { > "txid": "abc...", > "version": 2, > "locktime": 0, > "vin": [ > { "txid": "prev...", "vout": 0, "address": null, "value": null } > ], > "vout": [ > { > "n": 0, > "value": 3.13258866, > "scriptPubKey": { > "address": "bc1q...", > "type": "witness_v0_keyhash" > } > } > ] > } > ] > } > ``` > > | Field | Description | > | :- | :- | > | `confirmed` | `false` for the near-tip delivery (block could still be reorged), `true` once it has cleared the 2-block confirmation depth | > | `chainId` | `btc-mainnet` | > | `streamId` | Unique stream identifier | > | `tag` | Optional stream tag | > | `retries` | Number of delivery attempts | > | `block` | Block metadata: hash, height, timestamp, difficulty, merkle root, tx count | > | `txs` | Matched transactions with `txid`, `vin`, `vout` | > > > [!NOTE] > > > > Output values are represented as **BTC decimals** (e.g. `3.13258866`), not satoshis. Convert with `Math.round(btc * 1e8)` for integer ledgers. > > > [!NOTE] > > > > **Mempool deliveries** use the same payload shape with sentinel values: `block.height: "0"` and `block.hash: "mempool"`. Branch on `block.hash === "mempool"` to separate pre-confirmation events from in-block events. See [Mempool Notifications](/streams/bitcoin-streams#mempool-notifications). > > > [!WARNING] > > > > For confirmed-block deliveries, input `address` and `value` fields return `null` even with `includeInputs: true` — Bitcoin Streams reliably detects **inbound** transfers to watched addresses, not outflows. Mempool deliveries populate both `vin` and `vout` addresses, so sends and receives both match. See [Bitcoin Streams](/streams/bitcoin-streams) for the full list of behaviors. > [tab] Solana > > ```javascript theme={null} > { > "block": { > "slot": "410060994", > "blockHash": "7xJ9Km3V...", > "blockHeight": "389230112", > "blockTime": 1743436800, > "parentSlot": "410060993", > "previousBlockHash": "9aB2cD4e..." > }, > "chainId": "solana_mainnet", > "network": "mainnet", > "retries": 0, > "streamId": "3f6684f3-2ba4-44d7-af0e-26ee70cab245", > "tag": "my-solana-stream", > "confirmed": false, > "transactions": [ > { > "signature": "5KtP...signature_base58", > "slot": "410060994", > "blockTime": 1743436800, > "fee": "5000", > "err": null, > "accountKeys": [ > "GoSBxCH19sMnZVEifsXeeMdEfkTv6Zh6MWvQFQF3e5m7", > "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", > "11111111111111111111111111111111" > ], > "instructions": [], > "innerInstructions": [], > "preTokenBalances": [], > "postTokenBalances": [] > } > ] > } > ``` > > | Field | Description | > | :- | :- | > | `confirmed` | Whether the block is finalized | > | `chainId` | `solana_mainnet` | > | `network` | `mainnet` | > | `streamId` | Unique stream identifier | > | `tag` | Optional stream tag | > | `retries` | Number of delivery attempts | > | `block` | Slot, block hash, block height, block time, parent slot | > | `transactions` | Matched transactions with `signature`, `accountKeys`, instructions, etc. | > > > [!WARNING] > > > > Solana addresses are base58 and **case-sensitive**. Submit them in their original case — unlike EVM, lowercased addresses will not match. > > The Solana fields you'll reach for first: `signature` (transaction id), `accountKeys` (every account the transaction touches), `instructions[].programId` (which programs were invoked), `preTokenBalances` / `postTokenBalances` (SPL balance snapshots for delta calculation). For background on how Solana differs from EVM, see [Solana Streams](/streams/solana-streams). If you're unfamiliar with any of these fields, see [Parsed Data](/streams/streams-concepts/parsed-data) and [Advanced Options](/streams/streams-concepts/advanced-options) (EVM-only). *** ## Confirmed vs Unconfirmed Events Streams sends **two webhook payloads per match**: 1. **Unconfirmed (`confirmed: false`)** — sent as soon as the matching transaction is included in a block (or slot, on Solana). The block is close to the chain tip and could still be reorged. 2. **Confirmed (`confirmed: true`)** — sent after the chain's reorg-safety threshold has passed and the same block has been re-fetched. This design lets you react instantly to on-chain activity, then safely update state once finality is guaranteed. > [!NOTE] > > For chain-specific confirmation rules and finality models, see [Supported Chains](/streams/supported-chains) and [Confirmation & Finality](/streams/webhooks/confirmation-and-finality). > > For how reorgs are handled, see [Re-org Handling](/streams/streams-concepts/re-org-handling). *** ## Verifying Webhook Authenticity Every webhook includes an `x-signature` header. You **must verify this signature** to ensure the payload originated from Moralis. Verification is identical for EVM, Bitcoin, and Solana payloads. Basic flow: 1. Read the raw request body 2. Hash it together with your Streams secret 3. Compare against `x-signature` See [Webhook Security](/streams/security-and-reliability/webhook-security) for full details. *** ## Detailed Payload Contents > [tab] EVM > > ### Native Transactions (`txs`) > > Included when `includeNativeTxs` is enabled. Native transactions include sender and recipient, value transferred, gas usage, and receipt fields. > > ```javascript expandable theme={null} > { > "confirmed": false, > "chainId": "0x1", > "abi": [], > "streamId": "c28d9e2e-ae9d-4fe6-9fc0-5fcde2dcdd17", > "tag": "native_transactions", > "retries": 0, > "block": { > "number": "15988759", > "hash": "0x3aa07bd98e328db97ec273ce06b3a15fc645931fbd26337fe20c48b274277f76", > "timestamp": "1668676247" > }, > "logs": [], > "txs": [ > { > "hash": "0xd68700a0e2abd9c041eb236812e4194bf91c8182a2b03065887ab0f33d5c2958", > "gas": "149200", > "gasPrice": "13670412399", > "nonce": "57995", > "input": "0xf78dc253...", > "transactionIndex": "52", > "fromAddress": "0x839d4641f97153b0ff26ab837860c479e2bd0242", > "toAddress": "0x1111111254eeb25477b68fb85ed929f73a960582", > "value": "0", > "type": "2", > "v": "1", > "r": "...", > "s": "...", > "receiptCumulativeGasUsed": "3131649", > "receiptGasUsed": "113816", > "receiptContractAddress": null, > "receiptRoot": null, > "receiptStatus": "1" > } > ], > "txsInternal": [], > "erc20Transfers": [], > "erc20Approvals": [], > "nftApprovals": { "ERC1155": [], "ERC721": [] }, > "nftTransfers": [] > } > ``` > > ### Contract Logs (`logs`) > > Included when `includeContractLogs` is enabled. Logs contain raw topics and data, the emitting contract address, the transaction hash, and a log index. Logs are automatically decoded into higher-level objects when applicable (see below). > > ```javascript expandable theme={null} > { > "confirmed": false, > "chainId": "0x1", > "abi": [ > { > "anonymous": false, > "inputs": [ > { "indexed": false, "name": "reserve0", "type": "uint112" }, > { "indexed": false, "name": "reserve1", "type": "uint112" } > ], > "name": "Sync", > "type": "event" > } > ], > "streamId": "6378fe38-54c7-4816-8d61-fca8e128e260", > "tag": "test_events", > "retries": 1, > "block": { > "number": "15984246", > "hash": "0x7f8d8285b572a60f6a14d5f1dcbd40e487ccffd9ec78f8dfbccb49aa191fbb95", > "timestamp": "1668621827" > }, > "logs": [ > { > "logIndex": "320", > "transactionHash": "0xf1682fa49b83689093b467ac6937785102895fc3ba418624c28d04f9af6e5e2b", > "address": "0x4cd36d6f32586177e36179a810595a33163a20bf", > "data": "0x00000000000000000000000000000000000000000000944ad388817e590ab607...", > "topic0": "0x1c411e9a96e071241c2f21f7726b17ae89e3cab4c78be50e062b03a9fffbbad1", > "topic1": null, > "topic2": null, > "topic3": null > } > ], > "txs": [], > "txsInternal": [], > "erc20Transfers": [], > "erc20Approvals": [], > "nftApprovals": { "ERC1155": [], "ERC721": [] }, > "nftTransfers": [] > } > ``` > > ### ERC-20 Transfers > > ERC-20 transfers are **automatically decoded** from logs and included at no additional cost. Each transfer includes `from`, `to`, `value`, token metadata (`name`, `symbol`, `decimals`), and a human-readable `valueWithDecimals`. Transfers appear in both confirmed and unconfirmed payloads. > > ```javascript expandable theme={null} > { > "confirmed": false, > "chainId": "0x5", > "streamId": "c4cf9b1a-0cb3-4c79-9ca3-04f11856c555", > "tag": "ChrisWallet", > "retries": 0, > "block": { > "number": "8037952", > "hash": "0x607ff512f17f890bf9ee6206e2029cd8530819ab72b2b9161f9b90d18ece8e03", > "timestamp": "1669667244" > }, > "logs": [ /* ... raw Transfer log ... */ ], > "txs": [ /* ... underlying tx ... */ ], > "txsInternal": [], > "erc20Transfers": [ > { > "transactionHash": "0x1642a3b9b39e63d7fe571e7c22b80a5b059d2647fe4866d3f7105630f822d833", > "logIndex": "132", > "contract": "0x0041ebd11f598305d401cc1052df49219630ab79", > "from": "0x0a46413965858a6ac4ed5184d7643dc055a4fea3", > "to": "0xe496601436da37a045d8e88bbd6b2c2e17d8fe33", > "value": "499999000000000000000000", > "tokenName": "Example Token", > "tokenSymbol": "Token", > "tokenDecimals": "18", > "possibleSpam": false, > "valueWithDecimals": "499999" > } > ], > "erc20Approvals": [], > "nftApprovals": { "ERC1155": [], "ERC721": [] }, > "nftTransfers": [] > } > ``` > > ### ERC-20 Approvals > > ERC-20 approvals are also automatically decoded and include owner and spender, approved amount, and token metadata. > > ```javascript expandable theme={null} > { > "erc20Approvals": [ > { > "transactionHash": "0x59cd370a41c699bdb77a020b3a27735bb7442ace68ec8313040b8b9ee2672244", > "logIndex": "135", > "contract": "0x96beaa1316f85fd679ec49e5a63dacc293b044be", > "owner": "0x1748789703159580520cc2ce6d1ba01e7359c44c", > "spender": "0x1111111254eeb25477b68fb85ed929f73a960582", > "value": "115792089237316195423570985008687907853269984665640564039457584007913129639935", > "tokenName": "This Is Not Alpha", > "tokenSymbol": "TINA", > "tokenDecimals": "18", > "valueWithDecimals": "1.15792...e+59" > } > ] > } > ``` > > ### NFT Transfers > > NFT transfers are automatically decoded for both ERC-721 and ERC-1155 tokens. Each NFT transfer includes: > > * `tokenName`: the name of the NFT > * `tokenSymbol`: the symbol of the NFT (only for [ERC721](https://eips.ethereum.org/EIPS/eip-721)) > * `tokenContractType`: the type of the NFT (either [ERC721](https://eips.ethereum.org/EIPS/eip-721) or [ERC1155](https://eips.ethereum.org/EIPS/eip-1155)) > * `to`: the receiver address of the NFT transfer > * `from`: the sender address of the NFT transfer > * `amount`: the amount of NFT transferred (`1` for ERC-721) > * `transactionHash`: the transaction hash of the NFT transfer > * `tokenId`: the token ID of the NFT transferred > * `operator`: a third-party address approved to manage NFTs owned by `from` (see [EIP-1155](https://eips.ethereum.org/EIPS/eip-1155)) > * `contract`: the contract address of the NFT transferred > > ```javascript expandable theme={null} > { > "nftTransfers": [ > { > "operator": null, > "from": "0x74f64bebb1a9615fc7c2ead9c894b6ffd1803582", > "to": "0xe496601436da37a045d8e88bbd6b2c2e17d8fe33", > "tokenId": "0", > "amount": "1", > "transactionHash": "0x5ecd6b57593ab2f4f3e39fbb3318a3933e2cf9fdcf5b7ca671fb0fc2ce9dc4b5", > "logIndex": "72", > "contract": "0x26b4e79bca1a550ab26a8e533be97c40973b2671", > "possibleSpam": false, > "tokenName": "Test", > "tokenSymbol": "SYMBOL", > "tokenContractType": "ERC721" > } > ] > } > ``` > > ### NFT Approvals > > Approval events for ERC-721 and ERC-1155 tokens are grouped under `nftApprovals` and decoded automatically. > > ### Smart Contract Events Only > > If you configure a stream to listen only to specific contract events: > > * Only `logs` will be populated > * ABI decoding is applied using the ABI you provide > * No token or transaction arrays are included unless explicitly enabled > > ```javascript expandable theme={null} > { > "confirmed": false, > "chainId": "0x1", > "abi": [ > { > "anonymous": false, > "inputs": [ > { "indexed": false, "name": "reserve0", "type": "uint112" }, > { "indexed": false, "name": "reserve1", "type": "uint112" } > ], > "name": "Sync", > "type": "event" > } > ], > "streamId": "6378fe38-54c7-4816-8d61-fca8e128e260", > "tag": "test_events", > "retries": 1, > "block": { /* ... */ }, > "logs": [ /* ... matching Sync logs ... */ ], > "txs": [], > "txsInternal": [], > "erc20Transfers": [], > "erc20Approvals": [], > "nftApprovals": { "ERC1155": [], "ERC721": [] }, > "nftTransfers": [] > } > ``` > > ### Internal Transactions (`txsInternal`) > > Internal transactions represent value transfers occurring **inside contract execution**. Included when `includeInternalTxs` is enabled. Useful for DeFi protocol tracing, internal fund movement, and advanced analytics. > > ```javascript expandable theme={null} > { > "txsInternal": [ > { > "from": "0x1111111254eeb25477b68fb85ed929f73a960582", > "to": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", > "value": "11000000000000000", > "gas": "117885", > "transactionHash": "0x0e5c3114c0ee7d29cca17aa0b8e790c4d7d25b4789bd14150f113956b5ce94de" > } > ] > } > ``` > [tab] Bitcoin > > ### Block metadata > > Each Bitcoin payload begins with the block the matched transaction was included in: > > * `hash` — block hash > * `height` — block height > * `timestamp` — Unix timestamp > * `difficulty` — block difficulty > * `merkleRoot` — merkle root of transactions in the block > * `txCount` — number of transactions in the block > > ### Matched transactions (`txs`) > > Each matched transaction includes: > > * `txid` — Bitcoin transaction id (the natural deduplication key) > * `version` — transaction version > * `locktime` — earliest time the transaction can be mined > * `vin` — array of inputs (structural fields only — see warning below) > * `vout` — array of outputs > > Each `vout` entry has: > > * `n` — output index > > * `value` — output value as a **BTC decimal** (e.g. `3.13258866`) > > * `scriptPubKey.address` — recipient address (P2PKH `1...`, P2SH `3...`, or Bech32 `bc1q...`) > > * `scriptPubKey.type` — script type (e.g. `witness_v0_keyhash`) > > > [!WARNING] > > > > Even with `includeInputs: true`, the `address` and `value` fields on `vin` entries return `null`. You can reliably detect **inbound** activity to watched addresses, not outflows. > > ### Confirmation phases > > A matched transaction generates **two** webhook deliveries: > > 1. **First delivery (near-tip)** — `confirmed: false`, sent when the matching transaction is included in a block. The block is close to the chain tip and could still be reorged. > 2. **Second delivery (reorg-safe)** — `confirmed: true`, sent after 2 additional blocks have been mined on top. Moralis re-fetches the block and treats the transaction as final. > > Use `txid` as your dedupe key and upsert on the second delivery to flip your local confirmation flag. > > ### Coinbase detection > > `isCoinbase` is unreliable. Detect coinbase transactions with this heuristic: > > ```js theme={null} > const isCoinbase = > tx.vin.length === 1 && > tx.vout.some((out) => out.scriptPubKey?.type === "nulldata"); // OP_RETURN > ``` > > ### Value conversion > > Convert BTC decimals to satoshis before feeding integer-based ledgers: > > ```js theme={null} > const btc = vout.value; > const satoshis = Math.round(btc * 1e8); > ``` > > For full background, see [Bitcoin Streams](/streams/bitcoin-streams). > [tab] Solana > > ### Block metadata > > Each Solana payload begins with the block the matched transaction belongs to: > > * `slot` — Solana's time unit (most slots produce a block; some are skipped) > * `blockHash` — base58 block hash > * `blockHeight` — block height > * `blockTime` — Unix timestamp > * `parentSlot`, `previousBlockHash` — chain links > > ### Matched transactions (`transactions`) > > Each matched transaction includes: > > * `signature` — base58-encoded transaction id (used to look up the transaction) > > * `slot` — slot the transaction was processed in > > * `blockTime` — Unix timestamp > > * `fee` — fee in lamports > > * `err` — `null` on success, error object otherwise > > * `accountKeys` — every account the transaction touches (signers, recipients, programs, reads, writes) > > * `instructions` — top-level instructions > > * `innerInstructions` — nested instructions emitted via Cross-Program Invocations (CPIs) > > * `preTokenBalances` / `postTokenBalances` — SPL balance snapshots for the affected accounts before and after the transaction > > > [!WARNING] > > > > Solana addresses are base58 and **case-sensitive**. Submit them in their original case — unlike EVM, lowercased addresses will not match. > > ### How filters interact with the payload > > * `addresses` matches against `accountKeys` — a single Solana transaction can match multiple watched addresses. > * `programIds` matches against the program invoked by an instruction. > * `mintAddresses` matches via `pre` / `postTokenBalances`. > > ### Computing token deltas > > Subtract `preTokenBalances` from `postTokenBalances` for the accounts you care about — no instruction replay required. > > ### Inner instructions > > Each top-level instruction can trigger inner instructions when one program calls another (CPIs). The webhook includes both, so you can trace nested behavior directly. > > For full background and the bridge from EVM concepts (smart contracts, ERC-20, transaction hash) to Solana concepts (programs, mint addresses, signature), see [Solana Streams](/streams/solana-streams). *** ## Retry Metadata If a webhook delivery fails: * `retries` increments * The event is retried automatically * Failed deliveries are retained for replay (plan-dependent) See [Retries & Replays](/streams/webhooks/retries-and-replays) for full recovery behavior. *** ## Common Next Steps Depending on what you're building: * Need cleaner decoded data? Explore [Parsed Data](/streams/streams-concepts/parsed-data) * Need fine-grained filtering? Explore [Filters](/streams/streams-concepts/filters) * Need on-chain lookups inside webhooks (EVM only)? Explore [Triggers](/streams/streams-concepts/triggers) * Handling high throughput? Explore [Rate Limits](/streams/streams-concepts/rate-limits)