diff --git a/developer-tools/dashboard/how-to/credit-usage.md b/developer-tools/dashboard/how-to/credit-usage.md index cfb6c1298f..343fe351cd 100644 --- a/developer-tools/dashboard/how-to/credit-usage.md +++ b/developer-tools/dashboard/how-to/credit-usage.md @@ -6,7 +6,7 @@ description: View your Infura credit usage stats. :::info -The [credit pricing model](../api/learn/pricing/) replaces request-based billing for free-tier (Core) +The [credit pricing model](/services/get-started/pricing) replaces request-based billing for free-tier (Core) customers. Customers on Developer and Team plans will be transitioned to the credit model on September 30, 2024. diff --git a/docs/whats-new.md b/docs/whats-new.md index 75e5e38654..0b36b955ec 100644 --- a/docs/whats-new.md +++ b/docs/whats-new.md @@ -11,6 +11,12 @@ of the [MetaMask developer page](https://metamask.io/developer/). ## September 2024 +- Updated [Services credit cost](/services/get-started/pricing/credit-cost/#ethereum) for `eth_sendRawTransaction`. + ([#1581](https://github.com/MetaMask/metamask-docs/pull/1581)) +- Documented WebSocket support for [Base](/services/reference/base), + [Blast](/services/reference/blast), [Celo](/services/reference/celo), + [Ethereum Holesky](/services/reference/ethereum), and [Mantle](/services/reference/mantle). + ([#1552](https://github.com/MetaMask/metamask-docs/pull/1552)) - Documented new [Snaps custom UI JSX components](/snaps/features/custom-ui) for Flask version 12.4, and removed documentation for deprecated function-based library. ([#1540](https://github.com/MetaMask/metamask-docs/pull/1540)) diff --git a/services/get-started/endpoints.md b/services/get-started/endpoints.md index 181bc5f03e..9927dee3ba 100644 --- a/services/get-started/endpoints.md +++ b/services/get-started/endpoints.md @@ -8,74 +8,71 @@ toc_max_heading_level: 3 The following lists all the network endpoints supported by Infura. -Ensure that you replace `` with an API key from your [Infura dashboard](../../../developer-tools/dashboard/). +Ensure that you replace `` with an API key from your [Infura dashboard](../../../developer-tools/dashboard/). ## Arbitrum | Network | Description | URL | | ----------------- | ----------------------- | -------------------------------------------------- | -| Mainnet | JSON-RPC over HTTPS | `https://arbitrum-mainnet.infura.io/v3/` | -| Mainnet | JSON-RPC over Websocket | `wss://arbitrum-mainnet.io/ws/v3/` | -| Testnet (Sepolia) | JSON-RPC over HTTPS | `https://arbitrum-sepolia.infura.io/v3/` | -| Testnet (Sepolia) | JSON-RPC over WebSocket | `wss://arbitrum-sepolia.infura.io/ws/v3/` | +| Mainnet | JSON-RPC over HTTPS | `https://arbitrum-mainnet.infura.io/v3/` | +| Mainnet | JSON-RPC over Websocket | `wss://arbitrum-mainnet.io/ws/v3/` | +| Testnet (Sepolia) | JSON-RPC over HTTPS | `https://arbitrum-sepolia.infura.io/v3/` | +| Testnet (Sepolia) | JSON-RPC over WebSocket | `wss://arbitrum-sepolia.infura.io/ws/v3/` | ## Avalanche (C-Chain) | Network | Description | URL | | -------------- | ----------------------- | -------------------------------------------------- | -| Mainnet | JSON-RPC over HTTPS | `https://avalanche-mainnet.infura.io/v3/` | -| Mainnet | JSON-RPC over Websocket | `wss://avalanche-mainnet.io/ws/v3/` | -| Testnet (Fuji) | JSON-RPC over HTTPS | `https://avalanche-fuji.infura.io/v3/` | -| Testnet (Fuji) | JSON-RPC over WebSocket | `wss://avalanche-fuji.infura.io/ws/v3/` | +| Mainnet | JSON-RPC over HTTPS | `https://avalanche-mainnet.infura.io/v3/` | +| Mainnet | JSON-RPC over Websocket | `wss://avalanche-mainnet.io/ws/v3/` | +| Testnet (Fuji) | JSON-RPC over HTTPS | `https://avalanche-fuji.infura.io/v3/` | +| Testnet (Fuji) | JSON-RPC over WebSocket | `wss://avalanche-fuji.infura.io/ws/v3/` | ## Base -:::caution Limited access -Base is currently only available to a limited number of customers. If you would like access, please submit a -request to `support@infura.io` and we will assess if your request can be accommodated at this time. -::: - -| Network | Description | URL | -| ----------------- | ------------------- | --------------------------------------------- | -| Mainnet | JSON-RPC over HTTPS | `https://base-mainnet.infura.io/v3/` | -| Testnet (Sepolia) | JSON-RPC over HTTPS | `https://base-sepolia.infura.io/v3/` | +| Network | Transport type | URL | +|-------------------|-------------------------|-----------------------------------------------------| +| Mainnet | JSON-RPC over HTTPS | `https://base-mainnet.infura.io/v3/` | +| Mainnet | JSON-RPC over WebSocket | `wss://base-mainnet.infura.io/ws/v3/` | +| Testnet (Sepolia) | JSON-RPC over HTTPS | `https://base-sepolia.infura.io/v3/` | +| Testnet (Sepolia) | JSON-RPC over WebSocket | `wss://base-sepolia.infura.io/ws/v3/` | ## Blast | Network | Description | URL | |-------------------|-------------------------|----------------------------------------------------| -| Mainnet | JSON-RPC over HTTPS | `https://blast-mainnet.infura.io/v3/` | -| Mainnet | JSON-RPC over WebSocket | `wss://blast-mainnet.infura.io/ws/v3/` | -| Testnet (Sepolia) | JSON-RPC over HTTPS | `https://blast-sepolia.infura.io/v3/` | -| Testnet (Sepolia) | JSON-RPC over WebSocket | `wss://blast-sepolia.infura.io/ws/v3/` | +| Mainnet | JSON-RPC over HTTPS | `https://blast-mainnet.infura.io/v3/` | +| Mainnet | JSON-RPC over WebSocket | `wss://blast-mainnet.infura.io/ws/v3/` | +| Testnet (Sepolia) | JSON-RPC over HTTPS | `https://blast-sepolia.infura.io/v3/` | +| Testnet (Sepolia) | JSON-RPC over WebSocket | `wss://blast-sepolia.infura.io/ws/v3/` | ## Binance Smart Chain -| Network | Transport type | URL | -|-------------------|-------------------------|-----------------------------------------------| -| Mainnet | JSON-RPC over HTTPS | `https://bsc-mainnet.infura.io/v3/` | -| Mainnet | JSON-RPC over WebSocket | `wss://bsc-mainnet.infura.io/ws/v3/` | -| Testnet | JSON-RPC over HTTPS | `https://bsc-testnet.infura.io/v3/` | +| Network | Transport type | URL | +|---------|-------------------------|----------------------------------------------------| +| Mainnet | JSON-RPC over HTTPS | `https://bsc-mainnet.infura.io/v3/` | +| Mainnet | JSON-RPC over WebSocket | `wss://bsc-mainnet.infura.io/ws/v3/` | +| Testnet | JSON-RPC over HTTPS | `https://bsc-testnet.infura.io/v3/` | ## Celo | Network | Description | URL | |---------------------|-------------------------|--------------------------------------------------| -| Mainnet | JSON-RPC over HTTPS | `https://celo-mainnet.infura.io/v3/` | -| Mainnet | JSON-RPC over WebSocket | `wss://celo-mainnet.infura.io/ws/v3/` | -| Testnet (Alfajores) | JSON-RPC over HTTPS | `https://celo-alfajores.infura.io/v3/` | -| Testnet (Alfajores) | JSON-RPC over WebSocket | `wss://celo-alfajores.infura.io/ws/v3/` | +| Mainnet | JSON-RPC over HTTPS | `https://celo-mainnet.infura.io/v3/` | +| Mainnet | JSON-RPC over WebSocket | `wss://celo-mainnet.infura.io/ws/v3/` | +| Testnet (Alfajores) | JSON-RPC over HTTPS | `https://celo-alfajores.infura.io/v3/` | +| Testnet (Alfajores) | JSON-RPC over WebSocket | `wss://celo-alfajores.infura.io/ws/v3/` | ## Ethereum -| Network | Description | URL | -| ----------------- | ----------------------- | ----------------------------------------- | -| Mainnet | JSON-RPC over HTTPS | `https://mainnet.infura.io/v3/` | -| Mainnet | JSON-RPC over WebSocket | `wss://mainnet.infura.io/ws/v3/` | -| Testnet (Holesky) | JSON-RPC over HTTPS | `https://holesky.infura.io/v3/` | -| Holesky | JSON-RPC over WebSocket | `wss://holesky.infura.io/ws/v3/` | -| Testnet (Sepolia) | JSON-RPC over HTTPS | `https://sepolia.infura.io/v3/` | -| Testnet (Sepolia) | JSON-RPC over WebSocket | `wss://sepolia.infura.io/ws/v3/` | +| Network | Description | URL | +|-------------------| ----------------------- |------------------------------------------------| +| Mainnet | JSON-RPC over HTTPS | `https://mainnet.infura.io/v3/` | +| Mainnet | JSON-RPC over WebSocket | `wss://mainnet.infura.io/ws/v3/` | +| Testnet (Holesky) | JSON-RPC over HTTPS | `https://holesky.infura.io/v3/` | +| Testnet (Holesky) | JSON-RPC over WebSocket | `wss://holesky.infura.io/ws/v3/` | +| Testnet (Sepolia) | JSON-RPC over HTTPS | `https://sepolia.infura.io/v3/` | +| Testnet (Sepolia) | JSON-RPC over WebSocket | `wss://sepolia.infura.io/ws/v3/` | ## IPFS @@ -97,69 +94,61 @@ Include your authentication details when [making IPFS requests](/reference/ipfs/ ## Linea -:::caution deprecation notice - -Linea Goerli is being deprecated. We discourage new development with this testnet and recommend using -Sepolia instead. - -::: | Network | Description | URL | |-------------------|-------------------------|-------------------------------------------------| -| Mainnet | JSON-RPC over HTTPS | `https://linea-mainnet.infura.io/v3/` | -| Mainnet | JSON-RPC over WebSocket | `wss://linea-mainnet.infura.io/ws/v3/` | -| Testnet (Goerli) | JSON-RPC over HTTPS | `https://linea-goerli.infura.io/v3/` | -| Testnet (Goerli) | JSON-RPC over WebSocket | `wss://linea-goerli.infura.io/ws/v3/` | -| Testnet (Sepolia) | JSON-RPC over HTTPS | `https://linea-sepolia.infura.io/v3/` | -| Testnet (Sepolia) | JSON-RPC over WebSocket | `wss://linea-sepolia.infura.io/ws/v3/` | +| Mainnet | JSON-RPC over HTTPS | `https://linea-mainnet.infura.io/v3/` | +| Mainnet | JSON-RPC over WebSocket | `wss://linea-mainnet.infura.io/ws/v3/` | +| Testnet (Sepolia) | JSON-RPC over HTTPS | `https://linea-sepolia.infura.io/v3/` | +| Testnet (Sepolia) | JSON-RPC over WebSocket | `wss://linea-sepolia.infura.io/ws/v3/` | ## Mantle | Network | Description | URL | |-------------------|-------------------------|--------------------------------------------------| -| Mainnet | JSON-RPC over HTTPS | `https://mantle-mainnet.infura.io/v3/` | -| Mainnet | JSON-RPC over WebSocket | `wss://mantle-mainnet.infura.io/ws/v3/` | -| Testnet (Sepolia) | JSON-RPC over HTTPS | `https://mantle-sepolia.infura.io/v3/` | -| Testnet (Sepolia) | JSON-RPC over WebSocket | `wss://mantle-sepolia.infura.io/ws/v3/` | +| Mainnet | JSON-RPC over HTTPS | `https://mantle-mainnet.infura.io/v3/` | +| Mainnet | JSON-RPC over WebSocket | `wss://mantle-mainnet.infura.io/ws/v3/` | +| Testnet (Sepolia) | JSON-RPC over HTTPS | `https://mantle-sepolia.infura.io/v3/` | +| Testnet (Sepolia) | JSON-RPC over WebSocket | `wss://mantle-sepolia.infura.io/ws/v3/` | ## opBNB | Network | Transport type | URL | |-------------------|-------------------------|-------------------------------------------------| -| Mainnet | JSON-RPC over HTTPS | `https://opbnb-mainnet.infura.io/v3/` | -| Mainnet | JSON-RPC over WebSocket | `wss://opbnb-mainnet.infura.io/ws/v3/` | -| Testnet | JSON-RPC over HTTPS | `https://opbnb-testnet.infura.io/v3/` | +| Mainnet | JSON-RPC over HTTPS | `https://opbnb-mainnet.infura.io/v3/` | +| Mainnet | JSON-RPC over WebSocket | `wss://opbnb-mainnet.infura.io/ws/v3/` | +| Testnet | JSON-RPC over HTTPS | `https://opbnb-testnet.infura.io/v3/` | ## Optimism | Network | Transport type | URL | | ----------------- | ----------------------- | -------------------------------------------------- | -| Mainnet | JSON-RPC over HTTPS | `https://optimism-mainnet.infura.io/v3/` | -| Mainnet | JSON-RPC over WebSocket | `wss://optimism-mainnet.infura.io/ws/v3/` | -| Testnet (Sepolia) | JSON-RPC over HTTPS | `https://optimism-sepolia.infura.io/v3/` | -| Testnet (Sepolia) | JSON-RPC over WebSocket | `wss://optimism-sepolia.infura.io/ws/v3/` | +| Mainnet | JSON-RPC over HTTPS | `https://optimism-mainnet.infura.io/v3/` | +| Mainnet | JSON-RPC over WebSocket | `wss://optimism-mainnet.infura.io/ws/v3/` | +| Testnet (Sepolia) | JSON-RPC over HTTPS | `https://optimism-sepolia.infura.io/v3/` | +| Testnet (Sepolia) | JSON-RPC over WebSocket | `wss://optimism-sepolia.infura.io/ws/v3/` | ## Palm | Network | Description | URL | | ------- | ------------------- | --------------------------------------------- | -| Mainnet | JSON-RPC over HTTPS | `https://palm-mainnet.infura.io/v3/` | -| Testnet | JSON-RPC over HTTPS | `https://palm-testnet.infura.io/v3/` | +| Mainnet | JSON-RPC over HTTPS | `https://palm-mainnet.infura.io/v3/` | +| Testnet | JSON-RPC over HTTPS | `https://palm-testnet.infura.io/v3/` | ## Polygon PoS | Network | Description | URL | | -------------- | ----------------------- | ------------------------------------------------- | -| Mainnet | JSON-RPC over HTTPS | `https://polygon-mainnet.infura.io/v3/` | -| Mainnet | JSON-RPC over WebSocket | `wss://polygon-mainnet.infura.io/ws/v3/` | -| Testnet (Amoy) | JSON-RPC over HTTPS | `https://polygon-amoy.infura.io/v3/` | -| Testnet (Amoy) | JSON-RPC over WebSocket | `wss://polygon-amoy.infura.io/ws/v3/` | +| Mainnet | JSON-RPC over HTTPS | `https://polygon-mainnet.infura.io/v3/` | +| Mainnet | JSON-RPC over WebSocket | `wss://polygon-mainnet.infura.io/ws/v3/` | +| Testnet (Amoy) | JSON-RPC over HTTPS | `https://polygon-amoy.infura.io/v3/` | +| Testnet (Amoy) | JSON-RPC over WebSocket | `wss://polygon-amoy.infura.io/ws/v3/` | ## Starknet | Network | Description | URL | | ----------------- | ------------------- | ------------------------------------------------- | -| Mainnet | JSON-RPC over HTTPS | `https://starknet-mainnet.infura.io/v3/` | -| Testnet (Sepolia) | JSON-RPC over HTTPS | `https://starknet-sepolia.infura.io/v3/` | +| Mainnet | JSON-RPC over HTTPS | `https://starknet-mainnet.infura.io/v3/` | +| Testnet (Sepolia) | JSON-RPC over HTTPS | `https://starknet-sepolia.infura.io/v3/` | ## ZKsync Era @@ -171,9 +160,9 @@ ZKsync Era WebSockets are supported on Mainnet only. | Network | Description | URL | |-------------------|-------------------------|--------------------------------------------------| -| Mainnet | JSON-RPC over HTTPS | `https://zksync-mainnet.infura.io/v3/` | -| Mainnet | JSON-RPC over WebSocket | `wss://zksync-mainnet.infura.io/ws/v3/` | -| Testnet (Sepolia) | JSON-RPC over HTTPS | `https://zksync-sepolia.infura.io/v3/` | +| Mainnet | JSON-RPC over HTTPS | `https://zksync-mainnet.infura.io/v3/` | +| Mainnet | JSON-RPC over WebSocket | `wss://zksync-mainnet.infura.io/ws/v3/` | +| Testnet (Sepolia) | JSON-RPC over HTTPS | `https://zksync-sepolia.infura.io/v3/` | ## Gas API @@ -216,9 +205,9 @@ Specify the chain ID in your request to interact with the relevant network. #### Ethereum | Network | Chain ID | -| ------- | -------- | +|---------|----------| | Mainnet | 1 | -| Goerli | 5 | +| Holeksy | 17000 | | Sepolia | 11155111 | #### Fantom diff --git a/services/get-started/pricing/credit-cost.md b/services/get-started/pricing/credit-cost.md index 2c7e43c11e..8a01bd7ea3 100644 --- a/services/get-started/pricing/credit-cost.md +++ b/services/get-started/pricing/credit-cost.md @@ -80,7 +80,7 @@ a specific network, then use the default Ethereum method's credit cost. | `eth_maxPriorityFeePerGas` | 80 | | `eth_mining` | 5 | | `eth_protocolVersion` | 5 | -| `eth_sendRawTransaction` | 720 | +| `eth_sendRawTransaction` | 80 | | `eth_sign` | 80 | | `eth_submitWork` | 80 | | `eth_subscribe` | 5 | diff --git a/services/how-to/javascript-dotenv.md b/services/how-to/javascript-dotenv.md index 4720a05fd5..2ea927fd3e 100644 --- a/services/how-to/javascript-dotenv.md +++ b/services/how-to/javascript-dotenv.md @@ -37,8 +37,8 @@ You can create a `package.json` file by running a CLI questionnaire, or by creat At the root of your project directory, create a file named `.env` containing environment variables for sensitive information that shouldn't be shared, such as an Infura API key, Ethereum private key, or MetaMask secret recovery phrase: ```bash -INFURA_API_KEY = "https://goerli.infura.io/v3/" -PRIVATE_KEY = "" +INFURA_API_KEY = "" +PRIVATE_KEY = "" ``` :::danger @@ -55,7 +55,7 @@ Give your project access to the `.env` information by including the following li require("dotenv").config() ``` -Access the environment variables using `process.env.`. For example, the following is a `hardhat.config.js` file for a Hardhat project: +Access the environment variables using `process.env.`. For example, the following is a `hardhat.config.js` file for a Hardhat project: ```javascript require("@nomiclabs/hardhat-waffle") diff --git a/services/how-to/json-web-token-jwt.md b/services/how-to/json-web-token-jwt.md index 5049236469..b4937a78eb 100644 --- a/services/how-to/json-web-token-jwt.md +++ b/services/how-to/json-web-token-jwt.md @@ -126,7 +126,7 @@ If JWTs are required for all requests, the following fails with an `invalid JWT` curl -X POST \ -H "Content-Type: application/json" \ --data '{"jsonrpc": "2.0", "id": 1, "method": "eth_blockNumber", "params": []}' \ - "https://optimism-sepolia.infura.io/v3/" + "https://optimism-sepolia.infura.io/v3/" ``` To get the request to pass, generate a JWT, and add it to the request. @@ -160,7 +160,7 @@ curl -X POST \ -H "Content-Type: application/json" \ -H "Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IjQyZjUxODRlMzE1ZTQwZDRiNzkzMjU3Nzg2OTEwOTNhIn0.eyJleHAiOjE4OTM0NTI0MDAsImF1ZCI6ImluZnVyYS5pbyJ9.rIBKHmxDsSEiiqEcbWPWkN6F28R95a0beGdnVgVQnnD7ESOKGosr2t9iQ7QyGvNO8-74gaPy_DqVn4sy1FvnullrWQc8Tmf5PrrX2ULiGfSUATvr-JPOga-KAgS6ftcStoACNmcN7QI-n7Gv7NqZC3zWMGzK_1SvYcSodXzoWwtkWmrMW9uPiu4MvROQH0sK7MJ4WHBIHii-x4wogH4PHEdGi_vFZohq2bRaaDKXBeJK7Tkke2whcydTHGuiAPQvRiHu5_wVptgDbTbKIQ28ZFQ4LpYStXE9Bck4JoVDeRQezWJN8Dx9ThU7j1xhWQqxQFWw3SPHry-cIejAWEfDTQ" \ --data '{"jsonrpc": "2.0", "id": 1, "method": "eth_blockNumber", "params": []}' \ - "https://mainnet.infura.io/v3/" + "https://mainnet.infura.io/v3/" ``` ```bash @@ -214,7 +214,7 @@ curl -X POST \ -H "Content-Type: application/json" \ -H "Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IjQyZjUxODRlMzE1ZTQwZDRiNzkzMjU3Nzg2OTEwOTNhIn0.eyJleHAiOjE4OTM0NTI0MDAsImF1ZCI6ImluZnVyYS5pbyIsImFkZHJlc3NlcyI6WyIweDE5MzdjNWM1MTUwNTc1NTNjY2JkNDZkNTg2NjQ1NWNlNjYyOTAyODQiXSwibWV0aG9kcyI6WyJldGhfZ2V0QmFsYW5jZSJdfQ.SwonSCVgybdT_GPQXe5SfhujmyzG-qpgH6zzVEzLZbZpZKsVQzOzFu3X1zHydvITzl3WhKXq5q8acHdMEO8y2TpUeyeLB25A-bnSZj8YlxacQvsnSNzm4ySJrTglmjD9rsr6JzKfgub03RuHuz0AWWO4omD6UrPcfcpxUF9YXEcT98SIsodPP_41WPrRvBuo8kLhmByr2Qs-XQRCDzxHxHb5jXI5RzoxLeEjTU_3GfWqgqgh4XHogcK43_VFGz9gv8QEoUiPnySafV6H80WXo12XwTeF-lr2cy_q79ZOvSp0WC4_j8dQMhNwj2dhZv1VPsViZMeHjBAJwK5mzIxBlQ" \ --data '{"jsonrpc": "2.0", "id": 1, "method": "eth_getBalance", "params": [ "0x1937c5c515057553ccbd46d5866455ce66290284", "latest"]}' \ - "https://mainnet.infura.io/v3/" + "https://mainnet.infura.io/v3/" ``` ```bash diff --git a/services/how-to/make-batch-requests.md b/services/how-to/make-batch-requests.md index 700dd41d93..9bdb20e005 100644 --- a/services/how-to/make-batch-requests.md +++ b/services/how-to/make-batch-requests.md @@ -26,7 +26,7 @@ Example batch request (containing 30 requests plus the batch request itself): ```json curl --request POST \ - --url https://mainnet.infura.io/v3/ \ + --url https://mainnet.infura.io/v3/ \ --header "Content-Type: application/json" \ --data '[ {"jsonrpc": "2.0", "id": 1, "method": "eth_blockNumber", "params": []}, diff --git a/services/how-to/trace-transactions.md b/services/how-to/trace-transactions.md index 4115f23517..ceb47105cc 100644 --- a/services/how-to/trace-transactions.md +++ b/services/how-to/trace-transactions.md @@ -67,7 +67,7 @@ This example represents a call to the `transfer` function of an ERC-20 token con ```bash -curl https://mainnet.infura.io/v3/ \ +curl https://mainnet.infura.io/v3/ \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "trace_transaction", "params": ["0x1e404c4bf580688c5527df2ce5aceb3db5de49479ab7dd321dd4615e4f5a7a5c"], "id": 1}' diff --git a/services/reference/_partials/_eth_sendrawtransaction-response.mdx b/services/reference/_partials/_eth_sendrawtransaction-response.mdx index ae1d961246..0192cee878 100644 --- a/services/reference/_partials/_eth_sendrawtransaction-response.mdx +++ b/services/reference/_partials/_eth_sendrawtransaction-response.mdx @@ -17,7 +17,7 @@ import TabItem from "@theme/TabItem" ## Error response -On Mainnet and Goerli, if this call causes the EVM to execute a `REVERT` operation, an error response of the following form is returned, with the revert reason pre-decoded as a string: +If this call causes the EVM to execute a `REVERT` operation, an error response of the following form is returned, with the revert reason pre-decoded as a string: ```json { diff --git a/services/reference/_partials/subscription-methods/_eth_subscribe-parameters.mdx b/services/reference/_partials/subscription-methods/_eth_subscribe-parameters.mdx index bee50cb8c0..7a9bda76b3 100644 --- a/services/reference/_partials/subscription-methods/_eth_subscribe-parameters.mdx +++ b/services/reference/_partials/subscription-methods/_eth_subscribe-parameters.mdx @@ -1,17 +1,10 @@ Specify one of the following subscription events: - `newHeads`: Subscribing to this returns a notification each time a new header is appended to the chain, including chain reorganizations. In a chain reorganization, the subscription emits all new headers for the new chain. Therefore the subscription can emit multiple headers at the same height. - - `logs`: Returns logs that are included in new imported blocks and match the given filter criteria. In case of a chain reorganization, previously sent logs that are on the old chain are resent with the removed property set to `true`. Logs from transactions that ended up in the new chain are emitted. Therefore a subscription can emit logs for the same transaction multiple times. This parameter has the following fields: - - `address`: (_optional_) Either an address or an array of addresses. Only logs that are created from these addresses are returned. - - `topics`: (_optional_) Only logs that match these specified topics are returned. - :::tip Infura Recommendation - We strongly recommend specifying a filter (`address` or `topics` or both) when subscribing to the `logs` event. - ::: - - `newPendingTransactions`: Returns the hash for all transactions that are added to the pending state and are signed with a key that's available in the node. When a transaction that was previously part of the canonical chain isn't part of the new canonical chain after a reorganization, it's emitted again. diff --git a/services/reference/base/index.md b/services/reference/base/index.md index 8ef4375435..67fa864820 100644 --- a/services/reference/base/index.md +++ b/services/reference/base/index.md @@ -8,12 +8,6 @@ import CardList from '@site/src/components/CardList' Base is an optimistic layer 2 rollup chain built by Coinbase on the MIT-licensed [OP Stack](https://docs.optimism.io/stack/getting-started#the-op-stack-today), in collaboration with [Optimism](../optimism/index.md). -:::caution Limited access -Base is currently only available to a limited number of customers. Production -support is also limited. If you would like access, please submit a request to `support@infura.io` and -we will assess if your request can be accommodated at this time. -::: - The Base network provides seamless Coinbase integrations, easy fiat onramps, and access to more than 100 million users and $100 billion in assets in the Coinbase ecosystem. diff --git a/services/reference/base/json-rpc-methods/_eth_accounts-request.mdx b/services/reference/base/json-rpc-methods/_eth_accounts-request.mdx index 01a315de1f..249764599f 100644 --- a/services/reference/base/json-rpc-methods/_eth_accounts-request.mdx +++ b/services/reference/base/json-rpc-methods/_eth_accounts-request.mdx @@ -11,5 +11,13 @@ curl https://base-mainnet.infura.io/v3/ \ -d '{"jsonrpc": "2.0", "method": "eth_accounts", "params": [], "id": 1}' ``` + + + +```bash +wscat -c wss://base-mainnet.infura.io/ws/v3/ -x '{"jsonrpc": "2.0", "method": "eth_accounts", "params": [], "id": 1}' +``` + + diff --git a/services/reference/base/json-rpc-methods/_eth_blocknumber-request.mdx b/services/reference/base/json-rpc-methods/_eth_blocknumber-request.mdx index 8e47d1b492..1551390508 100644 --- a/services/reference/base/json-rpc-methods/_eth_blocknumber-request.mdx +++ b/services/reference/base/json-rpc-methods/_eth_blocknumber-request.mdx @@ -1,5 +1,5 @@ -import Tabs from "@theme/Tabs" -import TabItem from "@theme/TabItem" +import Tabs from "@theme/Tabs"; +import TabItem from "@theme/TabItem"; @@ -12,4 +12,12 @@ curl https://base-mainnet.infura.io/v3/ \ ``` + + +```bash +wscat -c wss://base-mainnet.infura.io/ws/v3/ -x '{"jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1}' +``` + + + diff --git a/services/reference/base/json-rpc-methods/_eth_call-request.mdx b/services/reference/base/json-rpc-methods/_eth_call-request.mdx index 834286f1bc..c257948d1e 100644 --- a/services/reference/base/json-rpc-methods/_eth_call-request.mdx +++ b/services/reference/base/json-rpc-methods/_eth_call-request.mdx @@ -11,5 +11,12 @@ curl https://base-mainnet.infura.io/v3/ \ -d '{"jsonrpc": "2.0", "method": "eth_call", "params": [{"from": "0xb60e8dd61c5d32be8058bb8eb970870f07233155", "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"}, "latest"], "id": 1}' ``` + + + +```bash +wscat -c wss://base-mainnet.infura.io/ws/v3/ -x '{"jsonrpc": "2.0", "method": "eth_call", "params": [{"from": "0xb60e8dd61c5d32be8058bb8eb970870f07233155", "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"}, "latest"], "id": 1}' +``` + diff --git a/services/reference/base/json-rpc-methods/_eth_chainid-request.mdx b/services/reference/base/json-rpc-methods/_eth_chainid-request.mdx index 26c2f8dd53..8fe92b0f7d 100644 --- a/services/reference/base/json-rpc-methods/_eth_chainid-request.mdx +++ b/services/reference/base/json-rpc-methods/_eth_chainid-request.mdx @@ -11,5 +11,12 @@ curl https://base-mainnet.infura.io/v3/ \ -d '{"jsonrpc": "2.0", "method": "eth_chainId", "params": [], "id": 1}' ``` + + + +```bash +wscat -c wss://base-mainnet.infura.io/ws/v3/ -x '{"jsonrpc": "2.0", "method": "eth_chainId", "params": [], "id": 1}' +``` + diff --git a/services/reference/base/json-rpc-methods/_eth_estimategas-request.mdx b/services/reference/base/json-rpc-methods/_eth_estimategas-request.mdx index a0933a3b9c..ccfd010002 100644 --- a/services/reference/base/json-rpc-methods/_eth_estimategas-request.mdx +++ b/services/reference/base/json-rpc-methods/_eth_estimategas-request.mdx @@ -8,7 +8,14 @@ import TabItem from "@theme/TabItem" curl https://base-mainnet.infura.io/v3/ \ -X POST \ -H "Content-Type: application/json" \ - -d '{"jsonrpc": "2.0", "method": "eth_estimateGas", "params": [{"from": "0x9cE564c7d09f88E7d8233Cdd3A4d7AC42aBFf3aC", "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567", "value": "0x9184e72a"}], "id":1}' + -d '{"jsonrpc": "2.0", "method": "eth_estimateGas", "params": [{"from": "0x9cE564c7d09f88E7d8233Cdd3A4d7AC42aBFf3aC", "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567", "value": "0x9184e72a"}], "id": 1}' +``` + + + + +```bash +wscat -c wss://base-mainnet.infura.io/ws/v3/ -x '{"jsonrpc": "2.0", "method": "eth_estimateGas", "params": [{"from": "0x9cE564c7d09f88E7d8233Cdd3A4d7AC42aBFf3aC", "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567", "value": "0x9184e72a"}], "id": 1}' ``` diff --git a/services/reference/base/json-rpc-methods/_eth_feehistory-request.mdx b/services/reference/base/json-rpc-methods/_eth_feehistory-request.mdx index 70e9844762..df7eee5733 100644 --- a/services/reference/base/json-rpc-methods/_eth_feehistory-request.mdx +++ b/services/reference/base/json-rpc-methods/_eth_feehistory-request.mdx @@ -8,7 +8,14 @@ import TabItem from "@theme/TabItem" curl https://base-mainnet.infura.io/v3/ \ -X POST \ -H "Content-Type: application/json" \ - -d '{"jsonrpc": "2.0", "method": "eth_feeHistory", "params": ["0x5", "latest", [20, 30]], "id": 1}' + -d '{"id": 1, "jsonrpc": "2.0", "method": "eth_feeHistory", "params": ["0x5", "latest", [20,30]] }' +``` + + + + +```bash +wscat -c wss://base-mainnet.infura.io/ws/v3/ -x '{"jsonrpc": "2.0", "method": "eth_feeHistory", "params": ["0x5", "latest", []], "id": 1}' ``` diff --git a/services/reference/base/json-rpc-methods/_eth_gasprice-request.mdx b/services/reference/base/json-rpc-methods/_eth_gasprice-request.mdx index 44ce19e716..b0414515fa 100644 --- a/services/reference/base/json-rpc-methods/_eth_gasprice-request.mdx +++ b/services/reference/base/json-rpc-methods/_eth_gasprice-request.mdx @@ -11,5 +11,12 @@ curl https://base-mainnet.infura.io/v3/ \ -d '{"jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1}' ``` + + + +```bash +wscat -c wss://base-mainnet.infura.io/ws/v3/ -x '{"jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1}' +``` + diff --git a/services/reference/base/json-rpc-methods/_eth_getbalance-request.mdx b/services/reference/base/json-rpc-methods/_eth_getbalance-request.mdx index e8d692bf01..ab38aec9a2 100644 --- a/services/reference/base/json-rpc-methods/_eth_getbalance-request.mdx +++ b/services/reference/base/json-rpc-methods/_eth_getbalance-request.mdx @@ -8,7 +8,14 @@ import TabItem from "@theme/TabItem" curl https://base-mainnet.infura.io/v3/ \ -X POST \ -H "Content-Type: application/json" \ - -d '{"jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0xc94770007dda54cF92009BFF0dE90c06F603a09f", "latest"], "id": 1}' + -d '{"jsonrpc": "2.0","method": "eth_getBalance", "params": ["0xc94770007dda54cF92009BFF0dE90c06F603a09f", "latest"], "id": 1}' +``` + + + + +```bash +wscat -c wss://base-mainnet.infura.io/ws/v3/ -x '{"jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0xc94770007dda54cF92009BFF0dE90c06F603a09f", "latest"], "id": 1}' ``` diff --git a/services/reference/base/json-rpc-methods/_eth_getblockbyhash-request.mdx b/services/reference/base/json-rpc-methods/_eth_getblockbyhash-request.mdx index 79b27b6c00..30f386f5b6 100644 --- a/services/reference/base/json-rpc-methods/_eth_getblockbyhash-request.mdx +++ b/services/reference/base/json-rpc-methods/_eth_getblockbyhash-request.mdx @@ -11,5 +11,12 @@ curl https://base-mainnet.infura.io/v3/ \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35", false], "id": 1}' ``` + + + +```bash +wscat -c wss://base-mainnet.infura.io/ws/v3/ -x '{"jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35", false], "id": 1}' +``` + diff --git a/services/reference/base/json-rpc-methods/_eth_getblockbynumber-request.mdx b/services/reference/base/json-rpc-methods/_eth_getblockbynumber-request.mdx index fe8c26cea3..557a21a0b2 100644 --- a/services/reference/base/json-rpc-methods/_eth_getblockbynumber-request.mdx +++ b/services/reference/base/json-rpc-methods/_eth_getblockbynumber-request.mdx @@ -8,7 +8,14 @@ import TabItem from "@theme/TabItem" curl https://base-mainnet.infura.io/v3/ \ -X POST \ -H "Content-Type: application/json" \ - -d '{"jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params":["0x5BAD55", false], "id": 1}' + -d '{"jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["0x5BAD55",false], "id": 1}' +``` + + + + +```bash +wscat -c wss://base-mainnet.infura.io/ws/v3/ -x '{"jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["0x5BAD55", false], "id": 1}' ``` diff --git a/services/reference/base/json-rpc-methods/_eth_getblocktransactioncountbyhash-request.mdx b/services/reference/base/json-rpc-methods/_eth_getblocktransactioncountbyhash-request.mdx index 4ac6209ad4..58258d4250 100644 --- a/services/reference/base/json-rpc-methods/_eth_getblocktransactioncountbyhash-request.mdx +++ b/services/reference/base/json-rpc-methods/_eth_getblocktransactioncountbyhash-request.mdx @@ -11,5 +11,12 @@ curl https://base-mainnet.infura.io/v3/ \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35"], "id": 1}' ``` + + + +```bash +wscat -c wss://base-mainnet.infura.io/ws/v3/ -x '{"jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35"], "id": 1}' +``` + diff --git a/services/reference/base/json-rpc-methods/_eth_getblocktransactioncountbynumber-request.mdx b/services/reference/base/json-rpc-methods/_eth_getblocktransactioncountbynumber-request.mdx index 05533c1454..6ecd18d6fa 100644 --- a/services/reference/base/json-rpc-methods/_eth_getblocktransactioncountbynumber-request.mdx +++ b/services/reference/base/json-rpc-methods/_eth_getblocktransactioncountbynumber-request.mdx @@ -11,5 +11,12 @@ curl https://base-mainnet.infura.io/v3/ \ -d '{"jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["latest"], "id": 1}' ``` + + + +```bash +wscat -c wss://base-mainnet.infura.io/ws/v3/ -x '{"jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["latest"], "id": 1}' +``` + diff --git a/services/reference/base/json-rpc-methods/_eth_getcode-request.mdx b/services/reference/base/json-rpc-methods/_eth_getcode-request.mdx index f5af98b6a5..c1a9791d92 100644 --- a/services/reference/base/json-rpc-methods/_eth_getcode-request.mdx +++ b/services/reference/base/json-rpc-methods/_eth_getcode-request.mdx @@ -11,5 +11,12 @@ curl https://base-mainnet.infura.io/v3/ \ -d '{"jsonrpc": "2.0", "method": "eth_getCode", "params": ["0x06012c8cf97bead5deae237070f9587f8e7a266d", "0x65a8db"], "id": 1}' ``` + + + +```bash +wscat -c wss://base-mainnet.infura.io/ws/v3/ -x '{"jsonrpc": "2.0", "method": "eth_getCode", "params": ["0x06012c8cf97bead5deae237070f9587f8e7a266d", "0x65a8db"], "id": 1}' +``` + diff --git a/services/reference/base/json-rpc-methods/_eth_getlogs-request.mdx b/services/reference/base/json-rpc-methods/_eth_getlogs-request.mdx index 285463067f..4bd45c1d69 100644 --- a/services/reference/base/json-rpc-methods/_eth_getlogs-request.mdx +++ b/services/reference/base/json-rpc-methods/_eth_getlogs-request.mdx @@ -8,7 +8,14 @@ import TabItem from "@theme/TabItem" curl https://base-mainnet.infura.io/v3/ \ -X POST \ -H "Content-Type: application/json" \ - -d '{"jsonrpc": "2.0", "method": "eth_getLogs", "params": [{"blockHash": "0x7c5a35e9cb3e8ae0e221ab470abae9d446c3a5626ce6689fc777dcffcab52c70", "topics": ["0x241ea03ca20251805084d27d4440371c34a0b85ff108f6bb5611248f73818b80"]}], "id": 1}' + -d '{"jsonrpc": "2.0", "method": "eth_getLogs", "params": [{"blockHash": "0x7c5a35e9cb3e8ae0e221ab470abae9d446c3a5626ce6689fc777dcffcab52c70", "topics":["0x241ea03ca20251805084d27d4440371c34a0b85ff108f6bb5611248f73818b80"]}], "id": 1}' +``` + + + + +```bash +wscat -c wss://base-mainnet.infura.io/ws/v3/ -x '{"jsonrpc": "2.0", "method": "eth_getLogs", "params": [{"blockHash": "0x7c5a35e9cb3e8ae0e221ab470abae9d446c3a5626ce6689fc777dcffcab52c70", "topics":["0x241ea03ca20251805084d27d4440371c34a0b85ff108f6bb5611248f73818b80"]}], "id":1}' ``` diff --git a/services/reference/base/json-rpc-methods/_eth_getproof-request.mdx b/services/reference/base/json-rpc-methods/_eth_getproof-request.mdx index eee150d2af..653f742e81 100644 --- a/services/reference/base/json-rpc-methods/_eth_getproof-request.mdx +++ b/services/reference/base/json-rpc-methods/_eth_getproof-request.mdx @@ -8,7 +8,14 @@ import TabItem from "@theme/TabItem" curl https://base-mainnet.infura.io/v3/ \ -X POST \ -H "Content-Type: application/json" \ - -d '{"jsonrpc": "2.0", "method": "eth_getProof", "params": ["0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842", ["0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"], "latest"], "id": 1}' + -d '{"jsonrpc": "2.0", "method": "eth_getProof", "id": 1, "params": ["0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842", ["0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"], "latest"]}' +``` + + + + +```bash +wscat -c wss://base-mainnet.infura.io/ws/v3/ -x '{"jsonrpc": "2.0", "method": "eth_getProof", "params": ["0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842", ["0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"], "latest"], "id": 1}' ``` diff --git a/services/reference/base/json-rpc-methods/_eth_getstorageat-request.mdx b/services/reference/base/json-rpc-methods/_eth_getstorageat-request.mdx index fe5c8aadfe..1f0dead3e1 100644 --- a/services/reference/base/json-rpc-methods/_eth_getstorageat-request.mdx +++ b/services/reference/base/json-rpc-methods/_eth_getstorageat-request.mdx @@ -11,5 +11,12 @@ curl https://base-mainnet.infura.io/v3/ \ -d '{"jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x6661e9d6d8b923d5bbaab1b96e1dd51ff6ea2a93520fdc9eb75d059238b8c5e9", "0x65a8db"], "id": 1}' ``` + + + +```bash +wscat -c wss://base-mainnet.infura.io/ws/v3/ -x '{"jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x6661e9d6d8b923d5bbaab1b96e1dd51ff6ea2a93520fdc9eb75d059238b8c5e9", "0x65a8db"], "id": 1}' +``` + diff --git a/services/reference/base/json-rpc-methods/_eth_gettransactionbyblockhashandindex-request.mdx b/services/reference/base/json-rpc-methods/_eth_gettransactionbyblockhashandindex-request.mdx index 46a7a5c268..b52f60ea70 100644 --- a/services/reference/base/json-rpc-methods/_eth_gettransactionbyblockhashandindex-request.mdx +++ b/services/reference/base/json-rpc-methods/_eth_gettransactionbyblockhashandindex-request.mdx @@ -11,5 +11,12 @@ curl https://base-mainnet.infura.io/v3/ \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35", "0x0"], "id": 1}' ``` + + + +```bash +wscat -c wss://base-mainnet.infura.io/ws/v3/ -x '{"jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35", "0x0"], "id": 1}' +``` + diff --git a/services/reference/base/json-rpc-methods/_eth_gettransactionbyblocknumberandindex-request.mdx b/services/reference/base/json-rpc-methods/_eth_gettransactionbyblocknumberandindex-request.mdx index 1705763e27..50049d512a 100644 --- a/services/reference/base/json-rpc-methods/_eth_gettransactionbyblocknumberandindex-request.mdx +++ b/services/reference/base/json-rpc-methods/_eth_gettransactionbyblocknumberandindex-request.mdx @@ -11,5 +11,12 @@ curl https://base-mainnet.infura.io/v3/ \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["0x5BAD55", "0x0"], "id": 1}' ``` + + + +```bash +wscat -c wss://base-mainnet.infura.io/ws/v3/ -x '{"jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["0x5BAD55", "0x0"], "id": 1}' +``` + diff --git a/services/reference/base/json-rpc-methods/_eth_gettransactionbyhash-request.mdx b/services/reference/base/json-rpc-methods/_eth_gettransactionbyhash-request.mdx index 1a4e4430a7..aa8d0fa49d 100644 --- a/services/reference/base/json-rpc-methods/_eth_gettransactionbyhash-request.mdx +++ b/services/reference/base/json-rpc-methods/_eth_gettransactionbyhash-request.mdx @@ -11,5 +11,12 @@ curl https://base-mainnet.infura.io/v3/ \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0xbb3a336e3f823ec18197f1e13ee875700f08f03e2cab75f0d0b118dabb44cba0"], "id": 1}' ``` + + + +```bash +wscat -c wss://base-mainnet.infura.io/ws/v3/ -x '{"jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0xbb3a336e3f823ec18197f1e13ee875700f08f03e2cab75f0d0b118dabb44cba0"], "id": 1}' +``` + diff --git a/services/reference/base/json-rpc-methods/_eth_gettransactioncount-request.mdx b/services/reference/base/json-rpc-methods/_eth_gettransactioncount-request.mdx index 5c62bb8340..2c7378b77a 100644 --- a/services/reference/base/json-rpc-methods/_eth_gettransactioncount-request.mdx +++ b/services/reference/base/json-rpc-methods/_eth_gettransactioncount-request.mdx @@ -11,5 +11,12 @@ curl https://base-mainnet.infura.io/v3/ \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0xc94770007dda54cF92009BFF0dE90c06F603a09f", "0x5bad55"], "id": 1}' ``` + + + +```bash +wscat -c wss://base-mainnet.infura.io/ws/v3/ -x '{"jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0xc94770007dda54cF92009BFF0dE90c06F603a09f", "0x5bad55"], "id": 1}' +``` + diff --git a/services/reference/base/json-rpc-methods/_eth_gettransactionreceipt-request.mdx b/services/reference/base/json-rpc-methods/_eth_gettransactionreceipt-request.mdx index 3c4eaba7be..bf3265e941 100644 --- a/services/reference/base/json-rpc-methods/_eth_gettransactionreceipt-request.mdx +++ b/services/reference/base/json-rpc-methods/_eth_gettransactionreceipt-request.mdx @@ -11,5 +11,12 @@ curl https://base-mainnet.infura.io/v3/ \ -d '{"jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0xbb3a336e3f823ec18197f1e13ee875700f08f03e2cab75f0d0b118dabb44cba0"], "id": 1}' ``` + + + +```bash +wscat -c wss://base-mainnet.infura.io/ws/v3/ -x '{"jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0xbb3a336e3f823ec18197f1e13ee875700f08f03e2cab75f0d0b118dabb44cba0"], "id": 1}' +``` + diff --git a/services/reference/base/json-rpc-methods/_eth_getunclebyblockhashandindex-request.mdx b/services/reference/base/json-rpc-methods/_eth_getunclebyblockhashandindex-request.mdx index 76699875db..08f3ee368c 100644 --- a/services/reference/base/json-rpc-methods/_eth_getunclebyblockhashandindex-request.mdx +++ b/services/reference/base/json-rpc-methods/_eth_getunclebyblockhashandindex-request.mdx @@ -11,5 +11,12 @@ curl https://base-mainnet.infura.io/v3/ \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35", "0x0"], "id": 1}' ``` + + + +```bash +wscat -c wss://base-mainnet.infura.io/ws/v3/ -x '{"jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35", "0x0"], "id": 1}' +``` + diff --git a/services/reference/base/json-rpc-methods/_eth_getunclebyblocknumberandindex-request.mdx b/services/reference/base/json-rpc-methods/_eth_getunclebyblocknumberandindex-request.mdx index f97e5c64fa..c590b20d23 100644 --- a/services/reference/base/json-rpc-methods/_eth_getunclebyblocknumberandindex-request.mdx +++ b/services/reference/base/json-rpc-methods/_eth_getunclebyblocknumberandindex-request.mdx @@ -11,5 +11,12 @@ curl https://base-mainnet.infura.io/v3/ \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["0x29c", "0x0"], "id": 1}' ``` + + + +```bash +wscat -c wss://base-mainnet.infura.io/ws/v3/ -x '{"jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["0x29c", "0x0"], "id": 1}' +``` + diff --git a/services/reference/base/json-rpc-methods/_eth_getunclecountbyblockhash-request.mdx b/services/reference/base/json-rpc-methods/_eth_getunclecountbyblockhash-request.mdx index e7a41669ee..26bfd60693 100644 --- a/services/reference/base/json-rpc-methods/_eth_getunclecountbyblockhash-request.mdx +++ b/services/reference/base/json-rpc-methods/_eth_getunclecountbyblockhash-request.mdx @@ -11,5 +11,12 @@ curl https://base-mainnet.infura.io/v3/ \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35"], "id": 1}' ``` + + + +```bash +wscat -c wss://base-mainnet.infura.io/ws/v3/ -x '{"jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35"], "id": 1}' +``` + diff --git a/services/reference/base/json-rpc-methods/_eth_getunclecountbyblocknumber-request.mdx b/services/reference/base/json-rpc-methods/_eth_getunclecountbyblocknumber-request.mdx index 405d236d87..c9c646c266 100644 --- a/services/reference/base/json-rpc-methods/_eth_getunclecountbyblocknumber-request.mdx +++ b/services/reference/base/json-rpc-methods/_eth_getunclecountbyblocknumber-request.mdx @@ -11,5 +11,12 @@ curl https://base-mainnet.infura.io/v3/ \ -d '{"jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["0x5bad55"], "id": 1}' ``` + + + +```bash +wscat -c wss://base-mainnet.infura.io/ws/v3/ -x '{"jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["0x5bad55"], "id": 1}' +``` + diff --git a/services/reference/base/json-rpc-methods/_eth_getwork-request.mdx b/services/reference/base/json-rpc-methods/_eth_getwork-request.mdx index b1df5f3e59..24dbe65cb2 100644 --- a/services/reference/base/json-rpc-methods/_eth_getwork-request.mdx +++ b/services/reference/base/json-rpc-methods/_eth_getwork-request.mdx @@ -5,11 +5,18 @@ import TabItem from "@theme/TabItem" ```bash -curl https://base-base-mainnet.infura.io/v3/ \ +curl https://base-mainnet.infura.io/v3/ \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getWork", "params": [], "id": 1}' ``` + + + +```bash +wscat -c wss://base-mainnet.infura.io/ws/v3/ -x '{"jsonrpc": "2.0", "method": "eth_getWork", "params": [], "id": 1}' +``` + diff --git a/services/reference/base/json-rpc-methods/_eth_hashrate-request.mdx b/services/reference/base/json-rpc-methods/_eth_hashrate-request.mdx index 72b1993a3d..2558d535c2 100644 --- a/services/reference/base/json-rpc-methods/_eth_hashrate-request.mdx +++ b/services/reference/base/json-rpc-methods/_eth_hashrate-request.mdx @@ -5,11 +5,18 @@ import TabItem from "@theme/TabItem" ```bash -curl https://base-base-mainnet.infura.io/v3/ \ +curl https://base-mainnet.infura.io/v3/ \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_hashrate", "params": [], "id": 1}' ``` + + + +```bash +wscat -c wss://base-mainnet.infura.io/ws/v3/ -x '{"jsonrpc": "2.0", "method": "eth_hashrate", "params": [], "id": 1}' +``` + diff --git a/services/reference/base/json-rpc-methods/_eth_maxpriorityfeepergas-request.mdx b/services/reference/base/json-rpc-methods/_eth_maxpriorityfeepergas-request.mdx index 81b9053233..518605c02c 100644 --- a/services/reference/base/json-rpc-methods/_eth_maxpriorityfeepergas-request.mdx +++ b/services/reference/base/json-rpc-methods/_eth_maxpriorityfeepergas-request.mdx @@ -11,5 +11,12 @@ curl https://base-mainnet.infura.io/v3/ \ -d '{"jsonrpc": "2.0", "method": "eth_maxPriorityFeePerGas", "params": [], "id": 1}' ``` + + + +```bash +wscat -c wss://base-mainnet.infura.io/ws/v3/d23391e03c6d40738530a1b4b679e66e -x '{"jsonrpc": "2.0", "method": "eth_maxPriorityFeePerGas", "params": [], "id": 1}' +``` + diff --git a/services/reference/base/json-rpc-methods/_eth_mining-request.mdx b/services/reference/base/json-rpc-methods/_eth_mining-request.mdx index 7de48c29f7..3afb45bd68 100644 --- a/services/reference/base/json-rpc-methods/_eth_mining-request.mdx +++ b/services/reference/base/json-rpc-methods/_eth_mining-request.mdx @@ -5,11 +5,18 @@ import TabItem from "@theme/TabItem" ```bash -curl https://base-base-mainnet.infura.io/v3/ \ +curl https://base-mainnet.infura.io/v3/ \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_mining", "params": [], "id": 1}' ``` + + + +```bash +wscat -c wss://base-mainnet.infura.io/ws/v3/ -x '{"jsonrpc": "2.0", "method": "eth_mining", "params": [], "id": 1}' +``` + diff --git a/services/reference/base/json-rpc-methods/_eth_protocolversion-request.mdx b/services/reference/base/json-rpc-methods/_eth_protocolversion-request.mdx index f87f30fa61..7d523ca79c 100644 --- a/services/reference/base/json-rpc-methods/_eth_protocolversion-request.mdx +++ b/services/reference/base/json-rpc-methods/_eth_protocolversion-request.mdx @@ -11,5 +11,12 @@ curl https://base-mainnet.infura.io/v3/ \ -d '{"jsonrpc": "2.0", "method": "eth_protocolVersion", "params": [], "id": 1}' ``` + + + +```bash +wscat -c wss://base-mainnet.infura.io/ws/v3/ -x '{"jsonrpc": "2.0", "method": "eth_protocolVersion", "params": [], "id": 1}' +``` + diff --git a/services/reference/base/json-rpc-methods/_eth_sendrawtransaction-request.mdx b/services/reference/base/json-rpc-methods/_eth_sendrawtransaction-request.mdx index 9c5e8993dc..3127d66747 100644 --- a/services/reference/base/json-rpc-methods/_eth_sendrawtransaction-request.mdx +++ b/services/reference/base/json-rpc-methods/_eth_sendrawtransaction-request.mdx @@ -11,5 +11,12 @@ curl https://base-mainnet.infura.io/v3/ \ -d '{"jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["0xf869018203e882520894f17f52151ebef6c7334fad080c5704d77216b732881bc16d674ec80000801ba02da1c48b670996dcb1f447ef9ef00b33033c48a4fe938f420bec3e56bfd24071a062e0aa78a81bf0290afbc3a9d8e9a068e6d74caa66c5e0fa8a46deaae96b0833"], "id": 1}' ``` + + + +```bash +wscat -c wss://base-mainnet.infura.io/ws/v3/ -x '{"jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"], "id": 1}' +``` + diff --git a/services/reference/base/json-rpc-methods/_eth_submitwork-request.mdx b/services/reference/base/json-rpc-methods/_eth_submitwork-request.mdx index 094304611f..7e1e367b71 100644 --- a/services/reference/base/json-rpc-methods/_eth_submitwork-request.mdx +++ b/services/reference/base/json-rpc-methods/_eth_submitwork-request.mdx @@ -5,11 +5,18 @@ import TabItem from "@theme/TabItem" ```bash -curl https://base-base-mainnet.infura.io/v3/ \ +curl https://base-mainnet.infura.io/v3/ \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_submitWork", "params": ["0x0000000000000001", "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef", "0xD1FE5700000000000000000000000000D1FE5700000000000000000000000000"], "id": 1}' ``` + + + +```bash +wscat -c wss://base-mainnet.infura.io/ws/v3/ -x '{"jsonrpc": "2.0", "method": "eth_submitWork", "params": ["0x0000000000000001", "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef", "0xD1FE5700000000000000000000000000D1FE5700000000000000000000000000"], "id": 1}' +``` + diff --git a/services/reference/base/json-rpc-methods/_eth_syncing-request.mdx b/services/reference/base/json-rpc-methods/_eth_syncing-request.mdx index 8f93cde545..1bc52d5901 100644 --- a/services/reference/base/json-rpc-methods/_eth_syncing-request.mdx +++ b/services/reference/base/json-rpc-methods/_eth_syncing-request.mdx @@ -11,5 +11,12 @@ curl https://base-mainnet.infura.io/v3/ \ -d '{"jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1}' ``` + + + +```bash +wscat -c wss://base-mainnet.infura.io/ws/v3/ -x '{"jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1}' +``` + diff --git a/services/reference/base/json-rpc-methods/_net_listening-request.mdx b/services/reference/base/json-rpc-methods/_net_listening-request.mdx index ab4acd0b14..a1c7379bc7 100644 --- a/services/reference/base/json-rpc-methods/_net_listening-request.mdx +++ b/services/reference/base/json-rpc-methods/_net_listening-request.mdx @@ -11,5 +11,12 @@ curl https://base-mainnet.infura.io/v3/ \ -d '{"jsonrpc": "2.0", "method": "net_listening", "params": [], "id": 1}' ``` + + + +```bash +wscat -c wss://base-mainnet.infura.io/ws/v3/ -x '{"jsonrpc": "2.0", "method": "net_listening", "params": [], "id": 1}' +``` + diff --git a/services/reference/base/json-rpc-methods/_net_peercount-request.mdx b/services/reference/base/json-rpc-methods/_net_peercount-request.mdx index 50ec3b95df..bea59f752e 100644 --- a/services/reference/base/json-rpc-methods/_net_peercount-request.mdx +++ b/services/reference/base/json-rpc-methods/_net_peercount-request.mdx @@ -11,5 +11,12 @@ curl https://base-mainnet.infura.io/v3/ \ -d '{"jsonrpc": "2.0", "method": "net_peerCount", "params": [], "id": 1}' ``` + + + +```bash +wscat -c wss://base-mainnet.infura.io/ws/v3/ -x '{"jsonrpc": "2.0", "method": "net_peerCount", "params": [], "id": 1}' +``` + diff --git a/services/reference/base/json-rpc-methods/_net_version-request.mdx b/services/reference/base/json-rpc-methods/_net_version-request.mdx index d4c056f8fa..5a910f5653 100644 --- a/services/reference/base/json-rpc-methods/_net_version-request.mdx +++ b/services/reference/base/json-rpc-methods/_net_version-request.mdx @@ -11,5 +11,12 @@ curl https://base-mainnet.infura.io/v3/ \ -d '{"jsonrpc": "2.0", "method": "net_version", "params": [], "id": 1}' ``` + + + +```bash +wscat -c wss://base-mainnet.infura.io/ws/v3/ -x '{"jsonrpc": "2.0", "method": "net_version", "params": [], "id": 1}' +``` + diff --git a/services/reference/base/json-rpc-methods/_web3_clientversion-request.mdx b/services/reference/base/json-rpc-methods/_web3_clientversion-request.mdx index 7eb194a5cd..1bff44a312 100644 --- a/services/reference/base/json-rpc-methods/_web3_clientversion-request.mdx +++ b/services/reference/base/json-rpc-methods/_web3_clientversion-request.mdx @@ -11,5 +11,12 @@ curl https://base-mainnet.infura.io/v3/ \ -d '{"jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1}' ``` + + + +```bash +wscat -c wss://base-mainnet.infura.io/ws/v3/ -x '{"jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1}' +``` + diff --git a/services/reference/gas-api/api-reference/basefeehistory.md b/services/reference/gas-api/api-reference/basefeehistory.md index 011818026c..94022165e6 100644 --- a/services/reference/gas-api/api-reference/basefeehistory.md +++ b/services/reference/gas-api/api-reference/basefeehistory.md @@ -55,8 +55,8 @@ curl -X "GET" \ ```javascript const axios = require("axios") -const apiKey = "" // Replace with your API key. -const apiKeySecret = "" // Replace with your API key secret. +const apiKey = "" // Replace with your API key. +const apiKeySecret = "" // Replace with your API key secret. const Auth = Buffer.from(apiKey + ":" + apiKeySecret).toString("base64") diff --git a/services/reference/gas-api/api-reference/basefeepercentile.md b/services/reference/gas-api/api-reference/basefeepercentile.md index 5366302488..108965fadd 100644 --- a/services/reference/gas-api/api-reference/basefeepercentile.md +++ b/services/reference/gas-api/api-reference/basefeepercentile.md @@ -55,8 +55,8 @@ curl -X "GET" \ ```javascript const axios = require("axios"); -const apiKey = ""; // Replace with your API key. -const apiKeySecret = ""; // Replace with your API key secret. +const apiKey = ""; // Replace with your API key. +const apiKeySecret = ""; // Replace with your API key secret. const Auth = Buffer.from(apiKey + ":" + apiKeySecret).toString("base64"); diff --git a/services/reference/gas-api/api-reference/busythreshold.md b/services/reference/gas-api/api-reference/busythreshold.md index 49895de7c5..f9aa2fec4c 100644 --- a/services/reference/gas-api/api-reference/busythreshold.md +++ b/services/reference/gas-api/api-reference/busythreshold.md @@ -55,8 +55,8 @@ curl -X "GET" \ ```javascript const axios = require("axios"); -const apiKey = ""; // Replace with your API key. -const apiKeySecret = ""; // Replace with your API key secret. +const apiKey = ""; // Replace with your API key. +const apiKeySecret = ""; // Replace with your API key secret. const Auth = Buffer.from(apiKey + ":" + apiKeySecret).toString("base64"); diff --git a/services/reference/gas-api/api-reference/gasprices-type2.md b/services/reference/gas-api/api-reference/gasprices-type2.md index 3b83146bc1..400aa3a438 100644 --- a/services/reference/gas-api/api-reference/gasprices-type2.md +++ b/services/reference/gas-api/api-reference/gasprices-type2.md @@ -54,7 +54,7 @@ instead of using the cURL authentication option (`-u`). ```bash curl -X "GET" \ - -u : \ + -u : \ "https://gas.api.infura.io/networks/1/suggestedGasFees" ``` @@ -64,8 +64,8 @@ curl -X "GET" \ ```javascript const axios = require("axios"); -const apiKey = ""; // Replace with your API key. -const apiKeySecret = ""; // Replace with your API key secret. +const apiKey = ""; // Replace with your API key. +const apiKeySecret = ""; // Replace with your API key secret. const Auth = Buffer.from(apiKey + ":" + apiKeySecret).toString("base64"); diff --git a/services/reference/gas-api/quickstart.md b/services/reference/gas-api/quickstart.md index 69dd4d5bec..76c7e7711e 100644 --- a/services/reference/gas-api/quickstart.md +++ b/services/reference/gas-api/quickstart.md @@ -56,8 +56,8 @@ to prevent accidentally committing the file. ::: ```bash title=".env" -INFURA_API_KEY= -INFURA_API_KEY_SECRET= +INFURA_API_KEY= +INFURA_API_KEY_SECRET= ``` Replace the Infura project credential placeholders with your own. diff --git a/services/reference/linea/json-rpc-methods/_eth_block-address.mdx b/services/reference/linea/json-rpc-methods/_eth_block-address.mdx new file mode 100644 index 0000000000..086a01ece5 --- /dev/null +++ b/services/reference/linea/json-rpc-methods/_eth_block-address.mdx @@ -0,0 +1,7 @@ +- `address`: [_required_] A string representing the address (20 bytes) to check for balance. +- `blockParameter`: (string) [_required_] A hexadecimal block number, or one of the tags `latest`, `earliest`, `pending` or `finalized`. See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block). + :::warning + `safe` isn't supported, use `finalized`. + Learn more about [Linea's layer 2 finalization](https://docs.linea.build/developers/guides/finalized-block). + ::: + diff --git a/services/reference/linea/json-rpc-methods/_eth_block-parameter.mdx b/services/reference/linea/json-rpc-methods/_eth_block-parameter.mdx new file mode 100644 index 0000000000..9e894d7ce0 --- /dev/null +++ b/services/reference/linea/json-rpc-methods/_eth_block-parameter.mdx @@ -0,0 +1,6 @@ +- `blockParameter`: (string) [_required_] A hexadecimal block number, or one of the tags `latest`, `earliest`, `pending` or `finalized`. See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block). + :::warning + `safe` isn't supported, use `finalized`. + Learn more about [Linea's layer 2 finalization](https://docs.linea.build/developers/guides/finalized-block). + ::: + diff --git a/services/reference/linea/json-rpc-methods/_eth_call-parameters.mdx b/services/reference/linea/json-rpc-methods/_eth_call-parameters.mdx new file mode 100644 index 0000000000..0a39434d3b --- /dev/null +++ b/services/reference/linea/json-rpc-methods/_eth_call-parameters.mdx @@ -0,0 +1,13 @@ +- `from`: 20 bytes [_required_] Address the transaction is sent from. +- `to`: 20 bytes - Address the transaction is directed to. +- `gas`: Hexadecimal value of the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. +- `gasPrice`: Hexadecimal value of the `gasPrice` used for each paid gas. +- `maxPriorityFeePerGas`: Maximum fee, in Wei, the sender is willing to pay per gas above the base fee. See [EIP-1559 transactions](../../ethereum/concepts/transaction-types.md#eip-1559-transactions). +- `maxFeePerGas`: Maximum total fee (base fee + priority fee), in Wei, the sender is willing to pay per gas. See [EIP-1559 transactions](../../ethereum/concepts/transaction-types.md#eip-1559-transactions). +- `value`: Hexadecimal of the value sent with this transaction. +- `data`: Hash of the method signature and encoded parameters. See [Ethereum contract ABI specification](https://docs.soliditylang.org/en/latest/abi-spec.html). +- `blockParameter`: (string) [_required_] A hexadecimal block number, or one of the tags `latest`, `earliest`, `pending` or `finalized`. See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block). + :::warning + `safe` isn't supported, use `finalized`. + Learn more about [Linea's layer 2 finalization](https://docs.linea.build/developers/guides/finalized-block). + ::: diff --git a/services/reference/linea/json-rpc-methods/_eth_estimategas-parameters.mdx b/services/reference/linea/json-rpc-methods/_eth_estimategas-parameters.mdx new file mode 100644 index 0000000000..7d3e8f28d7 --- /dev/null +++ b/services/reference/linea/json-rpc-methods/_eth_estimategas-parameters.mdx @@ -0,0 +1,27 @@ +- `TRANSACTION CALL OBJECT` _\[required]_ + - `from`: _\[optional]_ 20 Bytes - The address the transaction is sent from. + - `to`: 20 Bytes - The address the transaction is directed to. + - `gas`: _\[optional]_ Hexadecimal value of the gas provided for the transaction execution. `eth_estimateGas` consumes + zero gas, but this parameter may be needed by some executions. + - `gasPrice`: _\[optional]_ Hexadecimal value of the gas price used for each paid gas. + - `maxPriorityFeePerGas`: _\[optional]_ Maximum fee, in Wei, the sender is willing to pay per gas + above the base fee. + See [EIP-1559 transactions](../../ethereum/concepts/transaction-types.md#eip-1559-transactions). + - `maxFeePerGas`: _\[optional]_ Maximum total fee (base fee + priority fee), in Wei, the sender is + willing to pay per gas. + See [EIP-1559 transactions](../../ethereum/concepts/transaction-types.md#eip-1559-transactions). + - `value`: _\[optional]_ Hexadecimal value of the value sent with this transaction. + - `data`: _\[optional]_ Hash of the method signature and encoded parameters. See the + [Ethereum contract ABI specification](https://docs.soliditylang.org/en/latest/abi-spec.html). + - `blockParameter`: (string) [_required_] A hexadecimal block number, or one of the tags `latest`, + `earliest`, `pending` or `finalized`. See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block). + :::warning + `safe` isn't supported, use `finalized`. + Learn more about [Linea's layer 2 finalization](https://docs.linea.build/developers/guides/finalized-block). + ::: + + +If no gas limit is specified, geth uses the block gas limit from the pending block as an upper bound. +As a result the returned estimate might not be enough to executed the call/transaction when the amount +of gas is higher than the pending block gas limit. + diff --git a/services/reference/linea/json-rpc-methods/_eth_getblockbyhash-request.mdx b/services/reference/linea/json-rpc-methods/_eth_getblockbyhash-request.mdx index 6c7c8e1276..c0817e22f3 100644 --- a/services/reference/linea/json-rpc-methods/_eth_getblockbyhash-request.mdx +++ b/services/reference/linea/json-rpc-methods/_eth_getblockbyhash-request.mdx @@ -6,9 +6,9 @@ import TabItem from "@theme/TabItem" ```bash curl https://linea-mainnet.infura.io/v3/ \ - -X POST \ - -H "Content-Type: application/json" \ - -d '{"jsonrpc":"2.0","method":"eth_getBlockByHash","params": ["0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35",false],"id":1}' + -X POST \ + -H "Content-Type: application/json" \ + -d '{"jsonrpc":"2.0","method":"eth_getBlockByHash","params": ["0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35",false],"id":1}' ``` diff --git a/services/reference/linea/json-rpc-methods/_eth_getblockbynumber-parameters.mdx b/services/reference/linea/json-rpc-methods/_eth_getblockbynumber-parameters.mdx new file mode 100644 index 0000000000..9de12a4aed --- /dev/null +++ b/services/reference/linea/json-rpc-methods/_eth_getblockbynumber-parameters.mdx @@ -0,0 +1,6 @@ +- `blockParameter`: (string) [_required_] A hexadecimal block number, or one of the tags `latest`, `earliest`, `pending` or `finalized`. See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block). + :::warning + `safe` isn't supported, use `finalized`. + Learn more about [Linea's layer 2 finalization](https://docs.linea.build/developers/guides/finalized-block). + ::: +- `show transaction details flag`: [_required_] If set to `true`, returns the full transaction objects. If `false` returns only the hashes of the transactions. diff --git a/services/reference/linea/json-rpc-methods/_eth_getlogs-parameters.mdx b/services/reference/linea/json-rpc-methods/_eth_getlogs-parameters.mdx new file mode 100644 index 0000000000..cf55229aa4 --- /dev/null +++ b/services/reference/linea/json-rpc-methods/_eth_getlogs-parameters.mdx @@ -0,0 +1,12 @@ +A filter object containing the following: + +- `address`: [_optional_] Contract address (20 bytes) or a list of addresses from which logs should originate. +- `fromBlock`: (string) _[optional, default is "latest"]_ A hexadecimal block number, or one of the tags `latest`, `earliest`, `pending`, or `finalized`. See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block). +- `toBlock`: (string) _[optional, default is "latest"]_ A hexadecimal block number, or one of the tags `latest`, `earliest`, `pending`, or `finalized`. See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block). + :::warning + `safe` isn't supported, use `finalized`. + Learn more about [Linea's layer 2 finalization](https://docs.linea.build/developers/guides/finalized-block). + ::: +- `topics`: _[optional]_ Array of 32 bytes DATA topics. Topics are order-dependent. +- `blockhash`: _[optional]_ Restricts the logs returned to the single block referenced in the 32-byte hash `blockHash`. Using `blockHash` is equivalent to setting `fromBlock` and `toBlock` to the block number referenced in the `blockHash`. If `blockHash` is present in in the filter criteria, then neither `fromBlock` nor `toBlock` are allowed. + diff --git a/services/reference/linea/json-rpc-methods/_eth_getproof-parameters.mdx b/services/reference/linea/json-rpc-methods/_eth_getproof-parameters.mdx new file mode 100644 index 0000000000..82fbc6a299 --- /dev/null +++ b/services/reference/linea/json-rpc-methods/_eth_getproof-parameters.mdx @@ -0,0 +1,7 @@ +- `address`: A string representing the address (20 bytes) to check for balance. +- `storageKeys`: An array of 32-byte storage keys to be proofed and included. +- `blockParameter`: (string) A hexadecimal block number, or one of the tags `latest`, `earliest`, `pending` or `finalized`. See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block). + :::warning + `safe` isn't supported, use `finalized`. + Learn more about [Linea's layer 2 finalization](https://docs.linea.build/developers/guides/finalized-block). + ::: diff --git a/services/reference/linea/json-rpc-methods/_eth_getstorageat-parameters.mdx b/services/reference/linea/json-rpc-methods/_eth_getstorageat-parameters.mdx new file mode 100644 index 0000000000..c1d8b6d4cf --- /dev/null +++ b/services/reference/linea/json-rpc-methods/_eth_getstorageat-parameters.mdx @@ -0,0 +1,7 @@ +- `address`: [_required_] A string representing the address (20 bytes) to check for balance. +- `blockParameter`: (string) [_required_] A hexadecimal block number, or one of the tags `latest`, `earliest`, `pending` or `finalized`. See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block). + :::warning + `safe` isn't supported, use `finalized`. + Learn more about [Linea's layer 2 finalization](https://docs.linea.build/developers/guides/finalized-block). + ::: +- `storage position`: [_required_] A hexadecimal code of the position in the storage. \ No newline at end of file diff --git a/services/reference/linea/json-rpc-methods/_eth_gettransactionbyblocknumberandindex-parameters.mdx b/services/reference/linea/json-rpc-methods/_eth_gettransactionbyblocknumberandindex-parameters.mdx new file mode 100644 index 0000000000..495d31d3c1 --- /dev/null +++ b/services/reference/linea/json-rpc-methods/_eth_gettransactionbyblocknumberandindex-parameters.mdx @@ -0,0 +1,6 @@ +- `blockParameter`: (string) [_required_] A hexadecimal block number, or one of the tags `latest`, `earliest`, `pending` or `finalized`. See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block). + :::warning + `safe` isn't supported, use `finalized`. + Learn more about [Linea's layer 2 finalization](https://docs.linea.build/developers/guides/finalized-block). + ::: +- `transaction index position`: [_required_] A hexadecimal of the integer representing the position in the block. diff --git a/services/reference/linea/json-rpc-methods/_eth_getunclebyblocknumberandindex-parameters.mdx b/services/reference/linea/json-rpc-methods/_eth_getunclebyblocknumberandindex-parameters.mdx new file mode 100644 index 0000000000..716efca0b4 --- /dev/null +++ b/services/reference/linea/json-rpc-methods/_eth_getunclebyblocknumberandindex-parameters.mdx @@ -0,0 +1,6 @@ +- `blockParameter`: (string) [_required_] A hexadecimal block number, or one of the tags `latest`, `earliest`, `pending` or `finalized`. See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block). + :::warning + `safe` isn't supported, use `finalized`. + Learn more about [Linea's layer 2 finalization](https://docs.linea.build/developers/guides/finalized-block). + ::: +- `uncle index position`: [_required_] A hexadecimal equivalent of the integer indicating the uncle's index position. diff --git a/services/reference/linea/json-rpc-methods/debug/debug_traceblockbyhash.md b/services/reference/linea/json-rpc-methods/debug/debug_traceblockbyhash.md index d97184d981..664740b3cb 100644 --- a/services/reference/linea/json-rpc-methods/debug/debug_traceblockbyhash.md +++ b/services/reference/linea/json-rpc-methods/debug/debug_traceblockbyhash.md @@ -32,7 +32,7 @@ Depending on the specified tracer type, returns a [`callTracer`](../debug/index. ```bash -curl https://linea-goerli.infura.io/v3/ \ +curl https://linea-mainnet.infura.io/v3/ \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "debug_traceBlockByHash", "params": ["0xcc4e47e5f5e82c12ccd511e97f6994b4c4f95808778323ed5cf0a56640b0a815", {"tracer": "callTracer"}], "id": 1}' @@ -42,7 +42,7 @@ curl https://linea-goerli.infura.io/v3/ \ ```bash -wscat -c wss://linea-goerli.infura.io/ws/v3/ -x '{"jsonrpc": "2.0", "method": "debug_traceBlockByHash","params": ["0xcc4e47e5f5e82c12ccd511e97f6994b4c4f95808778323ed5cf0a56640b0a815", {"tracer": "callTracer"}], "id": 1}' +wscat -c wss://linea-mainnet.infura.io/ws/v3/ -x '{"jsonrpc": "2.0", "method": "debug_traceBlockByHash","params": ["0xcc4e47e5f5e82c12ccd511e97f6994b4c4f95808778323ed5cf0a56640b0a815", {"tracer": "callTracer"}], "id": 1}' ``` diff --git a/services/reference/linea/json-rpc-methods/debug/debug_traceblockbynumber.md b/services/reference/linea/json-rpc-methods/debug/debug_traceblockbynumber.md index a4dc9c0082..440bb5b8b8 100644 --- a/services/reference/linea/json-rpc-methods/debug/debug_traceblockbynumber.md +++ b/services/reference/linea/json-rpc-methods/debug/debug_traceblockbynumber.md @@ -1,9 +1,8 @@ --- description: debug_traceBlockByNumber API method --- - -import Tabs from "@theme/Tabs"; -import TabItem from "@theme/TabItem"; +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; # debug_traceBlockByNumber @@ -11,19 +10,24 @@ Returns tracing results by executing all transactions in the specified block num ## Parameters -- `blockNumber`: (string) _[required]_ block number as a hexidecimal string, or one of the string tags `latest`, `earliest` - , or `pending`, as [described in the default block parameters](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block). +- `blockParameter`: (string) [_required_] A hexadecimal block number, or one of the tags `latest`, `earliest`, `pending` or `finalized`. See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block). + + :::warning + `safe` isn't supported, use `finalized`. + Learn more about [Linea's layer 2 finalization](https://docs.linea.build/developers/guides/finalized-block). + ::: + - Optional tracing options object with the following fields: - - `tracer`: (string) _[optional]_ type of tracer. Supports [`callTracer`](index.md#calltracer) or - [`prestateTracer`](index.md##prestatetracer). - - `tracerConfig`: (object) _[optional]_ tracer configuration options: - - `onlyTopCall`: (boolean) _[optional]_ when `true`, will only trace the primary (top-level) call and not any - sub-calls. It eliminates the additional processing for each call frame. + - `tracer`: (string) _[optional]_ type of tracer. Supports [`callTracer`](../debug/index.md#calltracer) or + [`prestateTracer`](../debug/index.md##prestatetracer). + - `tracerConfig`: (object) _[optional]_ tracer configuration options: + - `onlyTopCall`: (boolean) _[optional]_ when `true`, will only trace the primary (top-level) call and not any + sub-calls. It eliminates the additional processing for each call frame. ## Returns -Depending on the specified tracer type, returns a [`callTracer`](index.md##calltracer) object or -[`prestateTracer`](index.md#prestatetracer) object. +Depending on the specified tracer type, returns a [`callTracer`](../debug/index.md##calltracer) object or +[`prestateTracer`](../debug/index.md#prestatetracer) object. ## Example @@ -36,14 +40,14 @@ Depending on the specified tracer type, returns a [`callTracer`](index.md##callt curl https://linea-mainnet.infura.io/v3/ \ -X POST \ -H "Content-Type: application/json" \ - -d '{"jsonrpc": "2.0", "method": "debug_traceBlockByNumber", "params": ["0x4d0c", {"tracer": "callTracer"}], "id": 1}' + -d '{"method":"debug_traceBlockByNumber","params":["0x4d0c", {"tracer": "callTracer"}],"id":1,"jsonrpc":"2.0"}' ``` - ```bash -wscat -c wss://linea-goerli.infura.io/ws/v3/ -x '{"jsonrpc": "2.0", "method": "debug_traceBlockByNumber", "params": ["0x4d0c", {"tracer": "callTracer"}], "id": 1}' +wscat -c wss://linea-mainnet.infura.io/ws/v3/ \ +-x '{"method":"debug_traceBlockByNumber","params":["0x4d0c", {"tracer": "callTracer"}],"id":1,"jsonrpc":"2.0"}' ``` @@ -77,7 +81,7 @@ wscat -c wss://linea-goerli.infura.io/ws/v3/ -x '{"jsonrpc": "2.0" "type": "CALL", "value": "0x2386f26fc10000" } - } + }, ... ] } diff --git a/services/reference/linea/json-rpc-methods/debug/debug_tracetransaction.md b/services/reference/linea/json-rpc-methods/debug/debug_tracetransaction.md index 4a9dbaa87d..b85b6284d5 100644 --- a/services/reference/linea/json-rpc-methods/debug/debug_tracetransaction.md +++ b/services/reference/linea/json-rpc-methods/debug/debug_tracetransaction.md @@ -44,7 +44,7 @@ curl https://linea-mainnet.infura.io/v3/ \ ```bash -wscat -c wss://linea-goerli.infura.io/ws/v3/ -x '{"jsonrpc": "2.0", "method": "debug_traceTransaction", "params": ["0x5d3faa9b9605a8fb04d989a79bfe6d3b708bdcfc66048d2fe18ed2dda4a8297c", {"tracer": "callTracer"}], "id": 1}' +wscat -c wss://linea-mainnet.infura.io/ws/v3/ -x '{"jsonrpc": "2.0", "method": "debug_traceTransaction", "params": ["0x5d3faa9b9605a8fb04d989a79bfe6d3b708bdcfc66048d2fe18ed2dda4a8297c", {"tracer": "callTracer"}], "id": 1}' ``` diff --git a/services/reference/linea/json-rpc-methods/eth_call.mdx b/services/reference/linea/json-rpc-methods/eth_call.mdx index 5c6ebee7de..fdbfa391e3 100644 --- a/services/reference/linea/json-rpc-methods/eth_call.mdx +++ b/services/reference/linea/json-rpc-methods/eth_call.mdx @@ -2,39 +2,39 @@ title: "eth_call" --- -import Tabs from "@theme/Tabs" -import TabItem from "@theme/TabItem" +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; -import Description from "/services/reference/_partials/_eth_call-description.mdx" +import Description from "/services/reference/_partials/_eth_call-description.mdx"; ## Parameters -import Params from "/services/reference/_partials/_eth_call-parameters.mdx" +import Params from "./_eth_call-parameters.mdx"; ## Returns -import Returns from "/services/reference/_partials/_eth_call-returns.mdx" +import Returns from "/services/reference/_partials/_eth_call-returns.mdx"; ## Example -import Example from "/services/reference/_partials/_eth_call-example.mdx" +import Example from "/services/reference/_partials/_eth_call-example.mdx"; ### Request -import Request from "./_eth_call-request.mdx" +import Request from "./_eth_call-request.mdx"; ### Response -import Response from "/services/reference/_partials/_eth_call-response.mdx" +import Response from "/services/reference/_partials/_eth_call-response.mdx"; diff --git a/services/reference/linea/json-rpc-methods/eth_estimategas.mdx b/services/reference/linea/json-rpc-methods/eth_estimategas.mdx index 47c6b01804..90cbfd5be9 100644 --- a/services/reference/linea/json-rpc-methods/eth_estimategas.mdx +++ b/services/reference/linea/json-rpc-methods/eth_estimategas.mdx @@ -2,39 +2,39 @@ title: "eth_estimateGas" --- -import Tabs from "@theme/Tabs" -import TabItem from "@theme/TabItem" +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; -import Description from "/services/reference/_partials/_eth_estimategas-description.mdx" +import Description from "/services/reference/_partials/_eth_estimategas-description.mdx"; ## Parameters -import Params from "/services/reference/_partials/_eth_estimategas-parameters.mdx" +import Params from "./_eth_estimategas-parameters.mdx"; ## Returns -import Returns from "/services/reference/_partials/_eth_estimategas-returns.mdx" +import Returns from "/services/reference/_partials/_eth_estimategas-returns.mdx"; ## Example -import Example from "/services/reference/_partials/_eth_estimategas-example.mdx" +import Example from "/services/reference/_partials/_eth_estimategas-example.mdx"; ### Request -import Request from "./_eth_estimategas-request.mdx" +import Request from "./_eth_estimategas-request.mdx"; ### Response -import Response from "/services/reference/_partials/_eth_estimategas-response.mdx" +import Response from "/services/reference/_partials/_eth_estimategas-response.mdx"; diff --git a/services/reference/linea/json-rpc-methods/eth_getbalance.mdx b/services/reference/linea/json-rpc-methods/eth_getbalance.mdx index 1ff5a0d31c..c6e92d7d71 100644 --- a/services/reference/linea/json-rpc-methods/eth_getbalance.mdx +++ b/services/reference/linea/json-rpc-methods/eth_getbalance.mdx @@ -2,39 +2,39 @@ title: "eth_getBalance" --- -import Tabs from "@theme/Tabs" -import TabItem from "@theme/TabItem" +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; -import Description from "/services/reference/_partials/_eth_getbalance-description.mdx" +import Description from "/services/reference/_partials/_eth_getbalance-description.mdx"; ## Parameters -import Params from "/services/reference/_partials/_eth_getbalance-parameters.mdx" +import Params from "./_eth_block-address.mdx"; ## Returns -import Returns from "/services/reference/_partials/_eth_getbalance-returns.mdx" +import Returns from "/services/reference/_partials/_eth_getbalance-returns.mdx"; ## Example -import Example from "/services/reference/_partials/_eth_getbalance-example.mdx" +import Example from "/services/reference/_partials/_eth_getbalance-example.mdx"; ### Request -import Request from "./_eth_getbalance-request.mdx" +import Request from "./_eth_getbalance-request.mdx"; ### Response -import Response from "/services/reference/_partials/_eth_getbalance-response.mdx" +import Response from "/services/reference/_partials/_eth_getbalance-response.mdx"; diff --git a/services/reference/linea/json-rpc-methods/eth_getblockbynumber.mdx b/services/reference/linea/json-rpc-methods/eth_getblockbynumber.mdx index f14e34f153..28303823c2 100644 --- a/services/reference/linea/json-rpc-methods/eth_getblockbynumber.mdx +++ b/services/reference/linea/json-rpc-methods/eth_getblockbynumber.mdx @@ -2,39 +2,39 @@ title: "eth_getBlockByNumber" --- -import Tabs from "@theme/Tabs" -import TabItem from "@theme/TabItem" +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; -import Description from "/services/reference/_partials/_eth_getblockbynumber-description.mdx" +import Description from "/services/reference/_partials/_eth_getblockbynumber-description.mdx"; ## Parameters -import Params from "/services/reference/_partials/_eth_getblockbynumber-parameters.mdx" +import Params from "./_eth_getblockbynumber-parameters.mdx"; ## Returns -import Returns from "/services/reference/_partials/_eth_getblockbynumber-returns.mdx" +import Returns from "/services/reference/_partials/_eth_getblockbynumber-returns.mdx"; ## Example -import Example from "/services/reference/_partials/_eth_getblockbynumber-example.mdx" +import Example from "/services/reference/_partials/_eth_getblockbynumber-example.mdx"; ### Request -import Request from "./_eth_getblockbynumber-request.mdx" +import Request from "./_eth_getblockbynumber-request.mdx"; ### Response -import Response from "/services/reference/_partials/_eth_getblockbynumber-response.mdx" +import Response from "/services/reference/_partials/_eth_getblockbynumber-response.mdx"; diff --git a/services/reference/linea/json-rpc-methods/eth_getblockreceipts.mdx b/services/reference/linea/json-rpc-methods/eth_getblockreceipts.mdx index d8cab29515..bb1756ff17 100644 --- a/services/reference/linea/json-rpc-methods/eth_getblockreceipts.mdx +++ b/services/reference/linea/json-rpc-methods/eth_getblockreceipts.mdx @@ -2,8 +2,8 @@ title: "eth_getBlockReceipts" --- -import Tabs from "@theme/Tabs"; -import TabItem from "@theme/TabItem"; +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; import Description from "/services/reference/_partials/_eth_getblockreceipts-description.mdx"; @@ -11,7 +11,7 @@ import Description from "/services/reference/_partials/_eth_getblockreceipts-des ## Parameters -import Params from "/services/reference/_partials/_eth_getblockreceipts-parameters.mdx"; +import Params from "./_eth_block-parameter.mdx"; @@ -37,4 +37,4 @@ import Request from "./_eth_getblockreceipts-request.mdx"; import Response from "/services/reference/_partials/_eth_getblockreceipts-response.mdx"; - \ No newline at end of file + diff --git a/services/reference/linea/json-rpc-methods/eth_getblocktransactioncountbynumber.mdx b/services/reference/linea/json-rpc-methods/eth_getblocktransactioncountbynumber.mdx index c355e33cb5..83249857d0 100644 --- a/services/reference/linea/json-rpc-methods/eth_getblocktransactioncountbynumber.mdx +++ b/services/reference/linea/json-rpc-methods/eth_getblocktransactioncountbynumber.mdx @@ -2,39 +2,39 @@ title: "eth_getBlockTransactionCountByNumber" --- -import Tabs from "@theme/Tabs" -import TabItem from "@theme/TabItem" +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; -import Description from "/services/reference/_partials/_eth_getblocktransactioncountbynumber-description.mdx" +import Description from "/services/reference/_partials/_eth_getblocktransactioncountbynumber-description.mdx"; ## Parameters -import Params from "/services/reference/_partials/_eth_getblocktransactioncountbynumber-parameters.mdx" +import Params from "./_eth_block-parameter.mdx"; ## Returns -import Returns from "/services/reference/_partials/_eth_getblocktransactioncountbynumber-returns.mdx" +import Returns from "/services/reference/_partials/_eth_getblocktransactioncountbynumber-returns.mdx"; ## Example -import Example from "/services/reference/_partials/_eth_getblocktransactioncountbynumber-example.mdx" +import Example from "/services/reference/_partials/_eth_getblocktransactioncountbynumber-example.mdx"; ### Request -import Request from "./_eth_getblocktransactioncountbynumber-request.mdx" +import Request from "./_eth_getblocktransactioncountbynumber-request.mdx"; ### Response -import Response from "/services/reference/_partials/_eth_getblocktransactioncountbynumber-response.mdx" +import Response from "/services/reference/_partials/_eth_getblocktransactioncountbynumber-response.mdx"; diff --git a/services/reference/linea/json-rpc-methods/eth_getcode.mdx b/services/reference/linea/json-rpc-methods/eth_getcode.mdx index ace0da8cb2..e793e17518 100644 --- a/services/reference/linea/json-rpc-methods/eth_getcode.mdx +++ b/services/reference/linea/json-rpc-methods/eth_getcode.mdx @@ -2,39 +2,39 @@ title: "eth_getCode" --- -import Tabs from "@theme/Tabs" -import TabItem from "@theme/TabItem" +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; -import Description from "/services/reference/_partials/_eth_getcode-description.mdx" +import Description from "/services/reference/_partials/_eth_getcode-description.mdx"; ## Parameters -import Params from "/services/reference/_partials/_eth_getcode-parameters.mdx" +import Params from "./_eth_block-address.mdx"; ## Returns -import Returns from "/services/reference/_partials/_eth_getcode-returns.mdx" +import Returns from "/services/reference/_partials/_eth_getcode-returns.mdx"; ## Example -import Example from "/services/reference/_partials/_eth_getcode-example.mdx" +import Example from "/services/reference/_partials/_eth_getcode-example.mdx"; ### Request -import Request from "./_eth_getcode-request.mdx" +import Request from "./_eth_getcode-request.mdx"; ### Response -import Response from "/services/reference/_partials/_eth_getcode-response.mdx" +import Response from "/services/reference/_partials/_eth_getcode-response.mdx"; diff --git a/services/reference/linea/json-rpc-methods/eth_getlogs.mdx b/services/reference/linea/json-rpc-methods/eth_getlogs.mdx index 4a1c1a031c..6a7d5ecc04 100644 --- a/services/reference/linea/json-rpc-methods/eth_getlogs.mdx +++ b/services/reference/linea/json-rpc-methods/eth_getlogs.mdx @@ -2,39 +2,39 @@ title: "eth_getLogs" --- -import Tabs from "@theme/Tabs" -import TabItem from "@theme/TabItem" +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; -import Description from "/services/reference/_partials/_eth_getlogs-description.mdx" +import Description from "/services/reference/_partials/_eth_getlogs-description.mdx"; ## Parameters -import Params from "/services/reference/_partials/_eth_getlogs-parameters.mdx" +import Params from "./_eth_getlogs-parameters.mdx"; ## Returns -import Returns from "/services/reference/_partials/_eth_getlogs-returns.mdx" +import Returns from "/services/reference/_partials/_eth_getlogs-returns.mdx"; ## Example -import Example from "/services/reference/_partials/_eth_getlogs-example.mdx" +import Example from "/services/reference/_partials/_eth_getlogs-example.mdx"; ### Request -import Request from "./_eth_getlogs-request.mdx" +import Request from "./_eth_getlogs-request.mdx"; ### Response -import Response from "/services/reference/_partials/_eth_getlogs-response.mdx" +import Response from "/services/reference/_partials/_eth_getlogs-response.mdx"; diff --git a/services/reference/linea/json-rpc-methods/eth_getproof.mdx b/services/reference/linea/json-rpc-methods/eth_getproof.mdx index 0d7b5743dc..b23755750a 100644 --- a/services/reference/linea/json-rpc-methods/eth_getproof.mdx +++ b/services/reference/linea/json-rpc-methods/eth_getproof.mdx @@ -2,39 +2,39 @@ title: "eth_getProof" --- -import Tabs from "@theme/Tabs" -import TabItem from "@theme/TabItem" +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; -import Description from "/services/reference/_partials/_eth_getproof-description.mdx" +import Description from "/services/reference/_partials/_eth_getproof-description.mdx"; ## Parameters -import Params from "/services/reference/_partials/_eth_getproof-parameters.mdx" +import Params from "./_eth_getproof-parameters.mdx"; ## Returns -import Returns from "/services/reference/_partials/_eth_getproof-returns.mdx" +import Returns from "/services/reference/_partials/_eth_getproof-returns.mdx"; ## Example -import Example from "/services/reference/_partials/_eth_getproof-example.mdx" +import Example from "/services/reference/_partials/_eth_getproof-example.mdx"; ### Request -import Request from "./_eth_getproof-request.mdx" +import Request from "./_eth_getproof-request.mdx"; ### Response -import Response from "/services/reference/_partials/_eth_getproof-response.mdx" +import Response from "/services/reference/_partials/_eth_getproof-response.mdx"; diff --git a/services/reference/linea/json-rpc-methods/eth_getstorageat.mdx b/services/reference/linea/json-rpc-methods/eth_getstorageat.mdx index d91e20b397..e649c38b9c 100644 --- a/services/reference/linea/json-rpc-methods/eth_getstorageat.mdx +++ b/services/reference/linea/json-rpc-methods/eth_getstorageat.mdx @@ -2,39 +2,39 @@ title: "eth_getStorageAt" --- -import Tabs from "@theme/Tabs" -import TabItem from "@theme/TabItem" +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; -import Description from "/services/reference/_partials/_eth_getstorageat-description.mdx" +import Description from "/services/reference/_partials/_eth_getstorageat-description.mdx"; ## Parameters -import Params from "/services/reference/_partials/_eth_getstorageat-parameters.mdx" +import Params from "./_eth_getstorageat-parameters.mdx"; ## Returns -import Returns from "/services/reference/_partials/_eth_getstorageat-returns.mdx" +import Returns from "/services/reference/_partials/_eth_getstorageat-returns.mdx"; ## Example -import Example from "/services/reference/_partials/_eth_getstorageat-example.mdx" +import Example from "/services/reference/_partials/_eth_getstorageat-example.mdx"; ### Request -import Request from "./_eth_getstorageat-request.mdx" +import Request from "./_eth_getstorageat-request.mdx"; ### Response -import Response from "/services/reference/_partials/_eth_getstorageat-response.mdx" +import Response from "/services/reference/_partials/_eth_getstorageat-response.mdx"; diff --git a/services/reference/linea/json-rpc-methods/eth_gettransactionbyblocknumberandindex.mdx b/services/reference/linea/json-rpc-methods/eth_gettransactionbyblocknumberandindex.mdx index 28ba85246a..fc0453d96e 100644 --- a/services/reference/linea/json-rpc-methods/eth_gettransactionbyblocknumberandindex.mdx +++ b/services/reference/linea/json-rpc-methods/eth_gettransactionbyblocknumberandindex.mdx @@ -2,39 +2,39 @@ title: "eth_getTransactionByBlockNumberAndIndex" --- -import Tabs from "@theme/Tabs" -import TabItem from "@theme/TabItem" +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; -import Description from "/services/reference/_partials/_eth_gettransactionbyblocknumberandindex-description.mdx" +import Description from "/services/reference/_partials/_eth_gettransactionbyblocknumberandindex-description.mdx"; ## Parameters -import Params from "/services/reference/_partials/_eth_gettransactionbyblocknumberandindex-parameters.mdx" +import Params from "./_eth_gettransactionbyblocknumberandindex-parameters.mdx"; ## Returns -import Returns from "/services/reference/_partials/_eth_gettransactionbyblocknumberandindex-returns.mdx" +import Returns from "/services/reference/_partials/_eth_gettransactionbyblocknumberandindex-returns.mdx"; ## Example -import Example from "/services/reference/_partials/_eth_gettransactionbyblocknumberandindex-example.mdx" +import Example from "/services/reference/_partials/_eth_gettransactionbyblocknumberandindex-example.mdx"; ### Request -import Request from "./_eth_gettransactionbyblocknumberandindex-request.mdx" +import Request from "./_eth_gettransactionbyblocknumberandindex-request.mdx"; ### Response -import Response from "/services/reference/_partials/_eth_gettransactionbyblocknumberandindex-response.mdx" +import Response from "/services/reference/_partials/_eth_gettransactionbyblocknumberandindex-response.mdx"; diff --git a/services/reference/linea/json-rpc-methods/eth_gettransactioncount.mdx b/services/reference/linea/json-rpc-methods/eth_gettransactioncount.mdx index 9cf5c71e50..c53ef5b53a 100644 --- a/services/reference/linea/json-rpc-methods/eth_gettransactioncount.mdx +++ b/services/reference/linea/json-rpc-methods/eth_gettransactioncount.mdx @@ -2,39 +2,39 @@ title: "eth_getTransactionCount" --- -import Tabs from "@theme/Tabs" -import TabItem from "@theme/TabItem" +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; -import Description from "/services/reference/_partials/_eth_gettransactioncount-description.mdx" +import Description from "/services/reference/_partials/_eth_gettransactioncount-description.mdx"; ## Parameters -import Params from "/services/reference/_partials/_eth_gettransactioncount-parameters.mdx" +import Params from "./_eth_block-address.mdx"; ## Returns -import Returns from "/services/reference/_partials/_eth_gettransactioncount-returns.mdx" +import Returns from "/services/reference/_partials/_eth_gettransactioncount-returns.mdx"; ## Example -import Example from "/services/reference/_partials/_eth_gettransactioncount-example.mdx" +import Example from "/services/reference/_partials/_eth_gettransactioncount-example.mdx"; ### Request -import Request from "./_eth_gettransactioncount-request.mdx" +import Request from "./_eth_gettransactioncount-request.mdx"; ### Response -import Response from "/services/reference/_partials/_eth_gettransactioncount-response.mdx" +import Response from "/services/reference/_partials/_eth_gettransactioncount-response.mdx"; diff --git a/services/reference/linea/json-rpc-methods/eth_getunclebyblocknumberandindex.mdx b/services/reference/linea/json-rpc-methods/eth_getunclebyblocknumberandindex.mdx index 07c458cb7a..c3fa6f8206 100644 --- a/services/reference/linea/json-rpc-methods/eth_getunclebyblocknumberandindex.mdx +++ b/services/reference/linea/json-rpc-methods/eth_getunclebyblocknumberandindex.mdx @@ -2,39 +2,39 @@ title: "eth_getUncleByBlockNumberAndIndex" --- -import Tabs from "@theme/Tabs" -import TabItem from "@theme/TabItem" +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; -import Description from "/services/reference/_partials/_eth_getunclebyblocknumberandindex-description.mdx" +import Description from "/services/reference/_partials/_eth_getunclebyblocknumberandindex-description.mdx"; ## Parameters -import Params from "/services/reference/_partials/_eth_getunclebyblocknumberandindex-parameters.mdx" +import Params from "./_eth_getunclebyblocknumberandindex-parameters.mdx"; ## Returns -import Returns from "/services/reference/_partials/_eth_getunclebyblocknumberandindex-returns.mdx" +import Returns from "/services/reference/_partials/_eth_getunclebyblocknumberandindex-returns.mdx"; ## Example -import Example from "/services/reference/_partials/_eth_getunclebyblocknumberandindex-example.mdx" +import Example from "/services/reference/_partials/_eth_getunclebyblocknumberandindex-example.mdx"; ### Request -import Request from "./_eth_getunclebyblocknumberandindex-request.mdx" +import Request from "./_eth_getunclebyblocknumberandindex-request.mdx"; ### Response -import Response from "/services/reference/_partials/_eth_getunclebyblocknumberandindex-response.mdx" +import Response from "/services/reference/_partials/_eth_getunclebyblocknumberandindex-response.mdx"; diff --git a/services/reference/linea/json-rpc-methods/eth_getunclecountbyblocknumber.mdx b/services/reference/linea/json-rpc-methods/eth_getunclecountbyblocknumber.mdx index 2cc5dbbf75..d4a09b5783 100644 --- a/services/reference/linea/json-rpc-methods/eth_getunclecountbyblocknumber.mdx +++ b/services/reference/linea/json-rpc-methods/eth_getunclecountbyblocknumber.mdx @@ -2,39 +2,39 @@ title: "eth_getUncleCountByBlockNumber" --- -import Tabs from "@theme/Tabs" -import TabItem from "@theme/TabItem" +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; -import Description from "/services/reference/_partials/_eth_getunclecountbyblocknumber-description.mdx" +import Description from "/services/reference/_partials/_eth_getunclecountbyblocknumber-description.mdx"; ## Parameters -import Params from "/services/reference/_partials/_eth_getunclecountbyblocknumber-parameters.mdx" +import Params from "./_eth_block-parameter.mdx"; ## Returns -import Returns from "/services/reference/_partials/_eth_getunclecountbyblocknumber-returns.mdx" +import Returns from "/services/reference/_partials/_eth_getunclecountbyblocknumber-returns.mdx"; ## Example -import Example from "/services/reference/_partials/_eth_getunclecountbyblocknumber-example.mdx" +import Example from "/services/reference/_partials/_eth_getunclecountbyblocknumber-example.mdx"; ### Request -import Request from "./_eth_getunclecountbyblocknumber-request.mdx" +import Request from "./_eth_getunclecountbyblocknumber-request.mdx"; ### Response -import Response from "/services/reference/_partials/_eth_getunclecountbyblocknumber-response.mdx" +import Response from "/services/reference/_partials/_eth_getunclecountbyblocknumber-response.mdx"; diff --git a/services/reference/linea/json-rpc-methods/linea_estimategas.mdx b/services/reference/linea/json-rpc-methods/linea_estimategas.mdx index 9ed3e8106c..68949b92b4 100644 --- a/services/reference/linea/json-rpc-methods/linea_estimategas.mdx +++ b/services/reference/linea/json-rpc-methods/linea_estimategas.mdx @@ -2,8 +2,8 @@ title: "linea_estimateGas" --- -import Tabs from "@theme/Tabs" -import TabItem from "@theme/TabItem" +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; # `linea_estimateGas` @@ -16,7 +16,7 @@ can vary based on the size of the `calldata`. :::info For more information about estimating gas, and how this API formulates the transaction costs, see the -[gas fees topic](https://docs.linea.build/build-on-linea/gas-fees) in the Linea documentation. +[Linea gas fees documentation](https://docs.linea.build/build-on-linea/gas-fees). ::: @@ -34,20 +34,22 @@ We recommend using `linea_estimateGas` for more accurate results. - `from`: _\[optional]_ 20 bytes - The address the transaction is sent from. - `to`: _\[optional]_ 20 bytes - The address the transaction is directed to. - `gas`: _\[optional]_ Hexadecimal value of the gas provided for the transaction execution. `linea_estimateGas` consumes - zero gas, but this parameter may be needed by some executions. + zero gas, but this parameter may be needed by some executions. - `gasPrice`: _\[optional]_ Hexadecimal value of the gas price used for each paid gas. - `maxPriorityFeePerGas`: _\[optional]_ Maximum fee, in wei, the sender is willing to pay per gas above the base fee. - `maxFeePerGas`: _\[optional]_ Maximum total fee (base fee + priority fee), in wei, the sender is willing to pay per gas. - `value`: _\[optional]_ Hexadecimal value of the value sent with this transaction. - `data`: _\[optional]_ Hash of the method signature and encoded parameters. See the - [Ethereum contract ABI specification](https://docs.soliditylang.org/en/latest/abi-spec.html). - - `block number`: _\[optional]_ A string representing a block number, or one of the string tags - `latest`, `earliest`, `pending`, `safe`, or `finalized`. - See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block). + [Ethereum contract ABI specification](https://docs.soliditylang.org/en/latest/abi-spec.html). +- `blockParameter`: (string) [_optional_] A hexadecimal block number, or one of the tags `latest`, `earliest`, `pending` or `finalized`. See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block). + :::warning + `safe` isn't supported, use `finalized`. + Learn more about [Linea's layer 2 finalization](https://docs.linea.build/developers/guides/finalized-block). + ::: ## Returns -Hexidecimal values representing the recommended gas limit, the base fee per gas, and the priority fee per gas. +Hexadecimal values representing the recommended gas limit, the base fee per gas, and the priority fee per gas. ## Example @@ -58,19 +60,19 @@ Replace `` with an API key from your [Infura dashboard](https://in -```bash -curl https://linea-mainnet.infura.io/v3/ \ - -X POST \ - -H "Content-Type: application/json" \ - -d '{"jsonrpc": "2.0", "method": "linea_estimateGas", "params": [{"from": "0x42c27251C710864Cf76f1b9918Ace3E585e6E21b", "value": "0x1", "gasPrice": "0x100000000", "gas": "0x21000"}], "id": 53}' -``` + ```bash + curl https://linea-mainnet.infura.io/v3/ \ + -X POST \ + -H "Content-Type: application/json" \ + -d '{"jsonrpc":"2.0","method":"linea_estimateGas","params":[{"from":"0x42c27251C710864Cf76f1b9918Ace3E585e6E21b","value":"0x1","gasPrice":"0x100000000","gas":"0x21000"}],"id":53}' + ``` -```bash -wscat -c wss://linea-mainnet.infura.io/ws/v3/ -x '{"jsonrpc": "2.0", "method": "linea_estimateGas", "params": [{"from": "0x42c27251C710864Cf76f1b9918Ace3E585e6E21b", "value": "0x1", "gasPrice": "0x100000000", "gas": "0x21000"}], "id": 53}' -``` + ```bash + wscat -c wss://linea-mainnet.infura.io/ws/v3/ -x '{"jsonrpc":"2.0","method":"linea_estimateGas","params":[{"from":"0x42c27251C710864Cf76f1b9918Ace3E585e6E21b","value":"0x1","gasPrice":"0x100000000","gas":"0x21000"}],"id":53}' + ``` @@ -91,6 +93,5 @@ wscat -c wss://linea-mainnet.infura.io/ws/v3/ -x '{"jsonrpc": "2.0 } } ``` - diff --git a/services/reference/linea/json-rpc-methods/trace-methods/trace_block.mdx b/services/reference/linea/json-rpc-methods/trace-methods/trace_block.mdx index 0eb2040e84..bbad00b880 100644 --- a/services/reference/linea/json-rpc-methods/trace-methods/trace_block.mdx +++ b/services/reference/linea/json-rpc-methods/trace-methods/trace_block.mdx @@ -2,39 +2,39 @@ title: "trace_block" --- -import Tabs from "@theme/Tabs" -import TabItem from "@theme/TabItem" +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; -import Description from "/services/reference/_partials/trace-methods/_trace_block-description.mdx" +import Description from "/services/reference/_partials/trace-methods/_trace_block-description.mdx"; ## Parameters -import Params from "/services/reference/_partials/trace-methods/_trace_block-parameters.mdx" +import Params from "../_eth_block-parameter.mdx"; ## Returns -import Returns from "/services/reference/_partials/trace-methods/_trace_block-returns.mdx" +import Returns from "/services/reference/_partials/trace-methods/_trace_block-returns.mdx"; ## Example -import Example from "/services/reference/_partials/trace-methods/_trace_block-example.mdx" +import Example from "/services/reference/_partials/trace-methods/_trace_block-example.mdx"; ### Request -import Request from "./_trace_block-request.mdx" +import Request from "./_trace_block-request.mdx"; ### Response -import Response from "/services/reference/_partials/trace-methods/_trace_block-response.mdx" +import Response from "/services/reference/_partials/trace-methods/_trace_block-response.mdx"; diff --git a/services/reference/opbnb/json-rpc-methods/_eth_getlogs-request.mdx b/services/reference/opbnb/json-rpc-methods/_eth_getlogs-request.mdx index c7b97db03a..780a1ff71f 100644 --- a/services/reference/opbnb/json-rpc-methods/_eth_getlogs-request.mdx +++ b/services/reference/opbnb/json-rpc-methods/_eth_getlogs-request.mdx @@ -5,7 +5,7 @@ import TabItem from "@theme/TabItem" ```bash -curl https://opbnb-mainnet.infura.io/v3/ \ +curl https://opbnb-mainnet.infura.io/v3/ \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_getLogs", "params": [{"blockHash": "0x7c5a35e9cb3e8ae0e221ab470abae9d446c3a5626ce6689fc777dcffcab52c70", "topics":["0x241ea03ca20251805084d27d4440371c34a0b85ff108f6bb5611248f73818b80"]}], "id": 1}' diff --git a/services/reference/opbnb/json-rpc-methods/_eth_maxpriorityfeepergas-request.mdx b/services/reference/opbnb/json-rpc-methods/_eth_maxpriorityfeepergas-request.mdx index a7bbfbe336..e8b7cfacc3 100644 --- a/services/reference/opbnb/json-rpc-methods/_eth_maxpriorityfeepergas-request.mdx +++ b/services/reference/opbnb/json-rpc-methods/_eth_maxpriorityfeepergas-request.mdx @@ -5,7 +5,7 @@ import TabItem from "@theme/TabItem" ```bash -curl https://opbnb-mainnet.infura.io/v3/ \ +curl https://opbnb-mainnet.infura.io/v3/ \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "eth_maxPriorityFeePerGas", "params": [], "id": 1}' diff --git a/services/reference/opbnb/quickstart.md b/services/reference/opbnb/quickstart.md index 2bf59e8dc0..ff1f2b0e8c 100644 --- a/services/reference/opbnb/quickstart.md +++ b/services/reference/opbnb/quickstart.md @@ -48,7 +48,7 @@ In these examples, you'll use [npm](https://docs.npmjs.com/downloading-and-insta ```javascript title="index.js" import fetch from 'node-fetch'; - fetch("https://opbnb-mainnet.infura.io/v3/", { + fetch("https://opbnb-mainnet.infura.io/v3/", { method: "POST", headers: { "Content-Type": "application/json" @@ -91,7 +91,7 @@ In these examples, you'll use [npm](https://docs.npmjs.com/downloading-and-insta ```javascript title="index.js" const axios = require("axios); - axios.post("https://opbnb-mainnet.infura.io/v3/", { + axios.post("https://opbnb-mainnet.infura.io/v3/", { jsonrpc: "2.0", method: "eth_blockNumber", params: [], @@ -125,7 +125,7 @@ In these examples, you'll use [npm](https://docs.npmjs.com/downloading-and-insta ```javascript title="index.js" const ethers = require("ethers"); - const provider = new ethers.providers.JsonRpcProvider("https://opbnb-mainnet.infura.io/v3/"); + const provider = new ethers.providers.JsonRpcProvider("https://opbnb-mainnet.infura.io/v3/"); provider.getBlockNumber() .then(blockNumber => { console.log(blockNumber); @@ -156,7 +156,7 @@ In these examples, you'll use [npm](https://docs.npmjs.com/downloading-and-insta ```python title="index.py" import requests import json - url = "https://opbnb-mainnet.infura.io/v3/" + url = "https://opbnb-mainnet.infura.io/v3/" payload = { "jsonrpc": "2.0", "method": "eth_blockNumber", diff --git a/services/tutorials/ethereum/deploy-a-contract-using-web3.js.md b/services/tutorials/ethereum/deploy-a-contract-using-web3.js.md index 1a7894d15a..6eabf1530a 100644 --- a/services/tutorials/ethereum/deploy-a-contract-using-web3.js.md +++ b/services/tutorials/ethereum/deploy-a-contract-using-web3.js.md @@ -81,13 +81,13 @@ Create a `.env` file in your project directory to store the project and Ethereum ``` ETHEREUM_NETWORK = "sepolia" -INFURA_API_KEY = "" -SIGNER_PRIVATE_KEY = "" +INFURA_API_KEY = "" +SIGNER_PRIVATE_KEY = "" ``` Ensure you replace the following values in the `.env` file: -- `` with the API key of the Ethereum project. +- `` with the API key of the Ethereum project. - `` with the [private key of your Ethereum account](https://metamask.zendesk.com/hc/en-us/articles/360015289632-How-to-Export-an-Account-Private-Key). - If using a network other than Sepolia, ensure you update `ETHEREUM_NETWORK` with the network name. @@ -238,8 +238,8 @@ Update the .`env` file in the working directory to include the contract address. ``` ETHEREUM_NETWORK = "sepolia" -INFURA_API_KEY = "" -SIGNER_PRIVATE_KEY = "" +INFURA_API_KEY = "" +SIGNER_PRIVATE_KEY = "" DEMO_CONTRACT = "" ``` diff --git a/services/tutorials/ethereum/monitor-transfers-using-python.md b/services/tutorials/ethereum/monitor-transfers-using-python.md index 36e965bf71..3f28582e46 100644 --- a/services/tutorials/ethereum/monitor-transfers-using-python.md +++ b/services/tutorials/ethereum/monitor-transfers-using-python.md @@ -52,14 +52,14 @@ import time Connect to the Infura endpoint and the address of the account: ```python -infura_url = "https://mainnet.infura.io/v3/` with your Infura API key and `` with the Ethereum account you want to monitor. +Replace `` with your Infura API key and `` with the Ethereum account you want to monitor. ::: @@ -70,7 +70,7 @@ Create a function to check new transactions for the account defined in [step 3]( ```python def watch(): while True: - block = web3.eth.get_block('latest') + block = web3.eth.get_block("latest") print("Searching in block " + str(block.number)) if block and block.transactions: @@ -83,7 +83,7 @@ def watch(): print({ "hash": tx_hash, "from": tx["from"], - "value": web3.fromWei(tx["value"], 'ether') + "value": web3.fromWei(tx["value"], "ether") }) time.sleep(5) @@ -143,8 +143,8 @@ Transaction found in block 15019035 : from web3 import Web3 import time -infura_url = "https://mainnet.infura.io/v3/" -account = "" +infura_url = "https://mainnet.infura.io/v3/" +account = "" web3 = Web3(Web3.HTTPProvider(infura_url)) def confirmations(tx_hash): diff --git a/services/tutorials/ethereum/retrieve-and-display-erc-721-and-erc-1155-tokens.md b/services/tutorials/ethereum/retrieve-and-display-erc-721-and-erc-1155-tokens.md index 1aeaaea85f..2b3cf67915 100644 --- a/services/tutorials/ethereum/retrieve-and-display-erc-721-and-erc-1155-tokens.md +++ b/services/tutorials/ethereum/retrieve-and-display-erc-721-and-erc-1155-tokens.md @@ -53,11 +53,11 @@ Create a file called `retrieveBalance.js`. At the top of file, add the following const { Web3 } = require("web3") const web3 = new Web3( - new Web3.providers.HttpProvider("https://mainnet.infura.io/v3/") + new Web3.providers.HttpProvider("https://mainnet.infura.io/v3/") ) ``` -Replace `` with your Infura API key. +Replace `` with your Infura API key. ### 4. Set the ABI @@ -274,7 +274,7 @@ const fetch = require("node-fetch") const { Web3 } = require("web3") const web3 = new Web3( - new Web3.providers.HttpProvider("https://mainnet.infura.io/v3/") + new Web3.providers.HttpProvider("https://mainnet.infura.io/v3/") ) const tokenURIABI = [ @@ -337,7 +337,7 @@ function addIPFSProxy(ipfsHash) { const { Web3 } = require("web3") const web3 = new Web3( - new Web3.providers.HttpProvider("https://mainnet.infura.io/v3/") + new Web3.providers.HttpProvider("https://mainnet.infura.io/v3/") ) const uriABI = [ diff --git a/services/tutorials/ethereum/retrieve-the-balance-of-an-erc-20-token.md b/services/tutorials/ethereum/retrieve-the-balance-of-an-erc-20-token.md index 66b9544ea3..584abde288 100644 --- a/services/tutorials/ethereum/retrieve-the-balance-of-an-erc-20-token.md +++ b/services/tutorials/ethereum/retrieve-the-balance-of-an-erc-20-token.md @@ -46,11 +46,11 @@ Create a file called `retrieveBalance.js`. At the top of file, add the following ```javascript const { Web3 } = require("web3") const web3 = new Web3( - new Web3.providers.HttpProvider("https://mainnet.infura.io/v3/") + new Web3.providers.HttpProvider("https://mainnet.infura.io/v3/") ) ``` -Make sure to replace `` with your Infura API key. +Make sure to replace `` with your Infura API key. ### 4. Set the ABI @@ -136,12 +136,12 @@ console.log(formattedResult) #### Complete code -Here is the complete code for `retrieveBalance.js`. Before running it make sure you replace `` with your Infura API key. +Here is the complete code for `retrieveBalance.js`. Before running it make sure you replace `` with your Infura API key. ```javascript const { Web3 } = require("web3") const web3 = new Web3( - new Web3.providers.HttpProvider("https://mainnet.infura.io/v3/") + new Web3.providers.HttpProvider("https://mainnet.infura.io/v3/") ) const balanceOfABI = [ diff --git a/services/tutorials/ethereum/send-a-transaction/send-a-transaction-ethers.md b/services/tutorials/ethereum/send-a-transaction/send-a-transaction-ethers.md index 339fdfe22a..050765408e 100644 --- a/services/tutorials/ethereum/send-a-transaction/send-a-transaction-ethers.md +++ b/services/tutorials/ethereum/send-a-transaction/send-a-transaction-ethers.md @@ -89,7 +89,7 @@ Create a `.env` file in your project directory to store the project and Ethereum ```text title=".env" ETHEREUM_NETWORK = "" -INFURA_API_KEY = "" +INFURA_API_KEY = "" SIGNER_PRIVATE_KEY = "" ``` @@ -108,7 +108,7 @@ SIGNER_PRIVATE_KEY = "0x561...x...61df" Replace the following values in the `.env` file: - `` with `sepolia` or the alternative network you are using. -- `` with your API key of the web3 project. +- `` with your API key of the web3 project. - `` with the [private key of your Ethereum account](https://metamask.zendesk.com/hc/en-us/articles/360015289632-How-to-Export-an-Account-Private-Key). A transaction must be signed with the sender's private key. Make sure that you prefix the `SIGNER_PRIVATE_KEY` value with `0x`. The private key you export from MetaMask isn't prefixed with `0x`. :::danger diff --git a/services/tutorials/ethereum/send-a-transaction/send-a-transaction-py.md b/services/tutorials/ethereum/send-a-transaction/send-a-transaction-py.md index 4a2df5df80..8d99a30380 100644 --- a/services/tutorials/ethereum/send-a-transaction/send-a-transaction-py.md +++ b/services/tutorials/ethereum/send-a-transaction/send-a-transaction-py.md @@ -73,7 +73,7 @@ from web3 import Web3, exceptions load_dotenv() -infura_url = "https://sepolia.infura.io/v3/" +infura_url = "https://sepolia.infura.io/v3/" private_key = os.getenv("PRIVATE_KEY") from_account = "" to_account = "" @@ -109,7 +109,7 @@ print("Transaction hash: " + str(web3.to_hex(tx_hash))) Ensure you replace the following values in the code: -- `` with the API key of the Web3 project. +- `` with the API key of the Web3 project. - `` with the public key associated with the private key you added in the `.env` file. - `` With the public key of the recipient of the transfer. diff --git a/services/tutorials/ethereum/send-a-transaction/use-ethers.js-infuraprovider-or-web3provider.md b/services/tutorials/ethereum/send-a-transaction/use-ethers.js-infuraprovider-or-web3provider.md index 2a1d9130ec..5744316b2b 100644 --- a/services/tutorials/ethereum/send-a-transaction/use-ethers.js-infuraprovider-or-web3provider.md +++ b/services/tutorials/ethereum/send-a-transaction/use-ethers.js-infuraprovider-or-web3provider.md @@ -57,13 +57,13 @@ npm install --save ethers Create a `.env` file in your project directory to store the project and Ethereum account details. ``` -REACT_APP_API_KEY="" +REACT_APP_API_KEY="" REACT_APP_PRIVATE_KEY="" ``` Ensure you replace the following values in the `.env` file: -- `` with the API key of the Ethereum project. +- `` with the API key of the Ethereum project. - `` with the [private key of your Ethereum account](https://metamask.zendesk.com/hc/en-us/articles/360015289632-How-to-Export-an-Account-Private-Key). :::danger @@ -268,7 +268,7 @@ function App() { const API_KEY = process.env.REACT_APP_API_KEY const PRIVATE_KEY = process.env.REACT_APP_PRIVATE_KEY const provider_Metamask = new ethers.providers.Web3Provider(window.ethereum) - const infuraProvider = new ethers.providers.InfuraProvider("goerli", API_KEY) + const infuraProvider = new ethers.providers.InfuraProvider("mainnet", API_KEY) // Use the useState hook function to add state variables to a functional component. const [blockNumber, setBlockNumber] = useState(null) diff --git a/services/tutorials/ethereum/send-a-transaction/use-web3.js.md b/services/tutorials/ethereum/send-a-transaction/use-web3.js.md index 338e58a3b7..734c12ecad 100644 --- a/services/tutorials/ethereum/send-a-transaction/use-web3.js.md +++ b/services/tutorials/ethereum/send-a-transaction/use-web3.js.md @@ -91,7 +91,7 @@ Create a `.env` file in your project directory to store the project and Ethereum ```text title=".env" ETHEREUM_NETWORK = "" -INFURA_API_KEY = "" +INFURA_API_KEY = "" SIGNER_PRIVATE_KEY = "" ``` @@ -110,7 +110,7 @@ SIGNER_PRIVATE_KEY = "0x561...x...61df" Replace the following values in the `.env` file: - `` with `sepolia` or the alternative network you are using. -- `` with your API key of the web3 project. +- `` with your API key of the web3 project. - `` with the [private key of your Ethereum account](https://metamask.zendesk.com/hc/en-us/articles/360015289632-How-to-Export-an-Account-Private-Key). A transaction must be signed with the sender's private key. Make sure that you prefix the `SIGNER_PRIVATE_KEY` value with `0x`. The private key you export from MetaMask isn't prefixed with `0x`. :::danger diff --git a/services/tutorials/ethereum/subscribe-to-pending-transactions.md b/services/tutorials/ethereum/subscribe-to-pending-transactions.md index 501933ed03..2de2cb52d6 100644 --- a/services/tutorials/ethereum/subscribe-to-pending-transactions.md +++ b/services/tutorials/ethereum/subscribe-to-pending-transactions.md @@ -57,14 +57,14 @@ Connect to Infura’s WebSockets endpoint to subscribe to new pending transactio Define the following endpoints in your file: ```python -infura_ws_url = "wss://goerli.infura.io/ws/v3/" -infura_http_url = "https://goerli.infura.io/v3/" +infura_ws_url = "wss://mainnet.infura.io/ws/v3/" +infura_http_url = "https://mainnet.infura.io/v3/" web3 = Web3(Web3.HTTPProvider(infura_http_url)) ``` :::warning -Replace `` with your Infura API key, you can use the same for both endpoints. +Replace `` with your Infura API key, you can use the same for both endpoints. ::: @@ -114,8 +114,8 @@ import requests from web3 import Web3 from websockets import connect -infura_ws_url = "wss://goerli.infura.io/ws/v3/" -infura_http_url = "https://goerli.infura.io/v3/" +infura_ws_url = "wss://mainnet.infura.io/ws/v3/" +infura_http_url = "https://mainnet.infura.io/v3/" web3 = Web3(Web3.HTTPProvider(infura_http_url)) async def get_event(): @@ -189,8 +189,8 @@ import requests from web3 import Web3 from websockets import connect -infura_ws_url = "wss://goerli.infura.io/ws/v3/" -infura_http_url = "https://goerli.infura.io/v3/" +infura_ws_url = "wss://mainnet.infura.io/ws/v3/" +infura_http_url = "https://mainnet.infura.io/v3/" web3 = Web3(Web3.HTTPProvider(infura_http_url)) # Used if you want to monitor ETH transactions to a specific address diff --git a/services/tutorials/ethereum/track-erc-20-token-transfers.md b/services/tutorials/ethereum/track-erc-20-token-transfers.md index 89d39f1783..673711470d 100644 --- a/services/tutorials/ethereum/track-erc-20-token-transfers.md +++ b/services/tutorials/ethereum/track-erc-20-token-transfers.md @@ -53,13 +53,13 @@ Create a file called `trackERC20.js`. At the top of file, add the following line const { Web3 } = require("web3"); async function main(){ - const web3 = new Web3("wss://mainnet.infura.io/ws/v3/"); + const web3 = new Web3("wss://mainnet.infura.io/ws/v3/"); ... } main(); ``` -Make sure to replace `` with your Infura API key. +Make sure to replace `` with your Infura API key. ### 4. Set the ABI @@ -332,7 +332,7 @@ Transfer of 9964.083347473883463154 RIO from 0x5b7E3E37a1aa6369386 const { Web3 } = require("web3") async function main() { - const web3 = new Web3("wss://mainnet.infura.io/ws/v3/") + const web3 = new Web3("wss://mainnet.infura.io/ws/v3/") let options = { topics: [web3.utils.sha3("Transfer(address,address,uint256)")], diff --git a/services/tutorials/ethereum/track-erc-721-and-erc-1155-token-transfers.md b/services/tutorials/ethereum/track-erc-721-and-erc-1155-token-transfers.md index 98cc1b7a7f..1c219c0507 100644 --- a/services/tutorials/ethereum/track-erc-721-and-erc-1155-token-transfers.md +++ b/services/tutorials/ethereum/track-erc-721-and-erc-1155-token-transfers.md @@ -53,13 +53,13 @@ Create a file called `trackERC721.js`. At the top of file, add the following lin const { Web3 } = require("web3"); async function main(){ - const web3 = new Web3("wss://mainnet.infura.io/ws/v3/"); + const web3 = new Web3("wss://mainnet.infura.io/ws/v3/"); ... } main(); ``` -Make sure to replace `` with your Infura API key. +Make sure to replace `` with your Infura API key. ### 4. Subscribe to contract events @@ -317,7 +317,7 @@ value: 1 const { Web3 } = require("web3") async function main() { - const web3 = new Web3("wss://mainnet.infura.io/ws/v3/") + const web3 = new Web3("wss://mainnet.infura.io/ws/v3/") let options721 = { topics: [web3.utils.sha3("Transfer(address,address,uint256)")], diff --git a/services/tutorials/ethereum/use-infura-as-a-reverse-proxy/set-up-a-simple-reverse-proxy.md b/services/tutorials/ethereum/use-infura-as-a-reverse-proxy/set-up-a-simple-reverse-proxy.md index 50891d823c..4d804a5879 100644 --- a/services/tutorials/ethereum/use-infura-as-a-reverse-proxy/set-up-a-simple-reverse-proxy.md +++ b/services/tutorials/ethereum/use-infura-as-a-reverse-proxy/set-up-a-simple-reverse-proxy.md @@ -47,14 +47,15 @@ To create the reverse proxy, create a text file named `Caddyfile` with the follo ``` localhost -reverse_proxy https://goerli.infura.io { +reverse_proxy https://mainnet.infura.io { header_up Host } ``` -Ensure you replace `` with the API key for your Ethereum project. +Ensure you replace `` with the API key for your Ethereum project. -In this example, the reverse proxy retrieves information from the Infura Goerli endpoint, and redirects it to `localhost`. Using `header_up Host` allows you to include your API key to both the Goerli and localhost endpoints. +In this example, the reverse proxy retrieves information from the Infura endpoint, and redirects it to `localhost`. +Using `header_up Host` allows you to include your API key to both the Sepolia and localhost endpoints. ### 4. Run the reverse proxy @@ -72,7 +73,7 @@ In a new terminal window, make a curl request to `localhost`. The following exam ```bash -curl https://localhost/v3/ \ +curl https://localhost/v3/ \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1}' @@ -88,13 +89,13 @@ curl https://localhost/v3/ \ -To ensure that the reverse proxy is working, execute the same request, replacing `localhost` with `goerli.infura.io`. You should get the same result: +To ensure that the reverse proxy is working, execute the same request, replacing `localhost` with `sepolia.infura.io`. You should get the same result: ```bash -curl https://goerli.infura.io/v3/ \ +curl https://sepolia.infura.io/v3/ \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1}' diff --git a/services/tutorials/ethereum/use-infura-as-a-reverse-proxy/use-infura-as-a-backup-for-your-node.md b/services/tutorials/ethereum/use-infura-as-a-reverse-proxy/use-infura-as-a-backup-for-your-node.md index ff7de98287..4c845f5e81 100644 --- a/services/tutorials/ethereum/use-infura-as-a-reverse-proxy/use-infura-as-a-backup-for-your-node.md +++ b/services/tutorials/ethereum/use-infura-as-a-reverse-proxy/use-infura-as-a-backup-for-your-node.md @@ -100,14 +100,16 @@ To create the reverse proxy, create a text file named `Caddyfile` with the follo ``` localhost:3000 -reverse_proxy https://localhost:9000 https://goerli.infura.io { - header_up Host {/v3/} +reverse_proxy https://localhost:9000 https://sepolia.infura.io { + header_up Host {/v3/} } ``` -Ensure you replace `` with the API key for your Ethereum project. +Ensure you replace `` with the API key for your Ethereum project. -In this example, the reverse proxy retrieves information from `localhost:9000`, and redirects it to `localhost:3000`. If `localhost:9000` stops responding, Caddy will move on to retrieve information from the Infura Goerli endpoint. Using `header_up Host` allows you to include your API key to both the Goerli and localhost endpoints. +In this example, the reverse proxy retrieves information from `localhost:9000`, and redirects it to `localhost:3000`. +If `localhost:9000` stops responding, Caddy will move on to retrieve information from the Infura Sepolia endpoint. +Using `header_up Host` allows you to include your API key to both the Sepolia and localhost endpoints. ### 6. Run the reverse proxy @@ -125,7 +127,7 @@ In a new terminal window, make a curl request to `localhost`. The following exam ```bash -curl http://localhost:3000/v3/ \ +curl http://localhost:3000/v3/ \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1}' @@ -143,13 +145,13 @@ Reverse proxy success! The success message from `main.js` should display, because you've asked the reverse proxy to go to `localhost:9000` first. -If you close the Node.js server and send the request again, you should get the result from the Infura Goerli node: +If you close the Node.js server and send the request again, you should get the result from the Infura Sepolia node: ```bash -curl http://localhost:3000/v3/ \ +curl http://localhost:3000/v3/ \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1}' @@ -165,4 +167,4 @@ curl http://localhost:3000/v3/ \ -The reverse proxy ignores the localhost node, since it's not functioning, and defaults to the backup Infura Goerli node! +The reverse proxy ignores the localhost node, since it's not functioning, and falls back to the Infura Sepolia node. diff --git a/services/tutorials/layer-2-networks/send-a-transaction.md b/services/tutorials/layer-2-networks/send-a-transaction.md index 2ecbec185b..b22f500df3 100644 --- a/services/tutorials/layer-2-networks/send-a-transaction.md +++ b/services/tutorials/layer-2-networks/send-a-transaction.md @@ -75,13 +75,13 @@ Create a `.env` file in your project directory to store the project and account ``` POLYGON_NETWORK = "polygon-amoy" -INFURA_API_KEY = "" +INFURA_API_KEY = "" SIGNER_PRIVATE_KEY = "" ``` Ensure you replace the following values in the `.env` file: -- `` with the API key from your [Infura dashboard](https://infura.io/dashboard). +- `` with the API key from your [Infura dashboard](https://infura.io/dashboard). - `` with the [private key of your account](https://metamask.zendesk.com/hc/en-us/articles/360015289632-How-to-Export-an-Account-Private-Key). :::danger