0xweb
Version:
Contract package manager and other web3 tools
1,640 lines (1,639 loc) • 112 kB
JSON
{
"openrpc": "1.2.4",
"info": {
"title": "MetaMask JSON-RPC API Reference",
"version": "1.0.0"
},
"methods": [
{
"name": "eth_subscribe",
"summary": "Subscribes to specific Ethereum events, returning a subscription ID used to receive notifications.",
"description": "The eth_subscribe method allows clients to subscribe to specific events on the Ethereum network, such as new blocks, new pending transactions, or changes in the state of an account. When an event occurs, a notification is sent to the client with the corresponding data. To stop receiving notifications, the client can unsubscribe using the eth_unsubscribe method.",
"params": [
{
"name": "subscriptionType",
"required": true,
"schema": {
"title": "subscriptionType",
"type": "string",
"enum": [
"newHeads",
"logs",
"newPendingTransactions",
"syncing"
],
"description": "The type of subscription to create. Must be one of:`newHeads`: new block headers - `logs`: logs matching a filter object - `newPendingTransactions`: new pending transactions - `syncing`: changes in syncing status"
}
},
{
"name": "filterOptions",
"schema": {
"title": "filterOptions",
"type": "object",
"description": "An optional object containing filter options specific to the subscription type. Only applicable for 'logs' subscription type.",
"properties": {
"address": {
"type": "string",
"description": "A single address or an array of addresses to filter the logs by. Optional."
},
"topics": {
"type": "array",
"description": "An array of topics to filter the logs by.",
"items": {
"type": "string"
}
}
}
}
}
],
"result": {
"name": "subscriptionId",
"schema": {
"type": "string"
},
"description": "A unique subscription ID that can be used to unsubscribe or identify incoming notifications."
},
"examples": [
{
"name": "eth_subscribe example",
"params": [
{
"name": "subscriptionType",
"value": "newHeads"
}
],
"result": {
"name": "eth_subscribeExampleResult",
"value": "0x1b84f2cdf29a204b79e450c1939b30c1"
}
}
]
},
{
"name": "eth_unsubscribe",
"summary": "Unsubscribes from a specific Ethereum event, using the subscription ID provided by eth_subscribe.",
"description": "The eth_unsubscribe method allows clients to unsubscribe from specific events on the Ethereum network, to which they have previously subscribed using the eth_subscribe method. The client needs to provide the subscription ID obtained from eth_subscribe to stop receiving notifications for the corresponding event.",
"params": [
{
"name": "subscriptionId",
"required": true,
"schema": {
"type": "string",
"description": "The unique subscription ID obtained from the eth_subscribe method, used to identify the subscription to be unsubscribed."
}
}
],
"result": {
"name": "unsubscribed",
"schema": {
"type": "boolean"
},
"description": "A boolean value indicating whether the unsubscription was successful."
},
"examples": [
{
"name": "eth_unsubscribe example",
"params": [
{
"name": "subscriptionId",
"value": "0x1b84f2cdf29a204b79e450c1939b30c1"
}
],
"result": {
"name": "eth_unsubscribeExampleResult",
"value": true
}
}
]
},
{
"name": "wallet_addEthereumChain",
"tags": [
{
"$ref": "#/components/tags/MetaMask"
}
],
"summary": "Adds an Ethereum chain to the wallet.",
"description": "Creates a confirmation asking the user to add the specified chain to the wallet application. The caller must specify a chain ID and some chain metadata. The wallet application may refuse or accept the request. `null` is returned if the chain is added, and an error otherwise. Introduced by [EIP 3085](https://eips.ethereum.org/EIPS/eip-3085).",
"params": [
{
"name": "AddEthereumChainParameter",
"schema": {
"$ref": "#/components/schemas/AddEthereumChainParameter"
}
}
],
"errors": [
{
"code": -32602,
"message": "Expected null or array with at least one valid string HTTPS URL 'blockExplorerUrl'. Received: ${blockExplorerUrls}"
},
{
"code": -32602,
"message": "Expected 0x-prefixed, unpadded, non-zero hexadecimal string 'chainId'. Received:\n${chainId}"
},
{
"code": -32602,
"message": "Invalid chain ID \"${_chainId}\": numerical value greater than max safe value. Received:\n${chainId}"
},
{
"code": -32602,
"message": "May not specify default MetaMask chain."
},
{
"code": -32602,
"message": "Expected 2-6 character string 'nativeCurrency.symbol'. Received:\n${ticker}"
},
{
"code": -32602,
"message": "nativeCurrency.symbol does not match currency symbol for a network the user already has added with the same chainId. Received:\n${ticker}"
}
],
"result": {
"name": "AddEthereumChainResult",
"schema": {
"type": "null"
}
},
"examples": [
{
"name": "wallet_addEthereumChain example",
"params": [
{
"name": "AddEthereumChainParameter",
"value": {
"chainId": "0x64",
"chainName": "Gnosis",
"rpcUrls": [
"https://rpc.ankr.com/gnosis"
],
"iconUrls": [
"https://xdaichain.com/fake/example/url/xdai.svg",
"https://xdaichain.com/fake/example/url/xdai.png"
],
"nativeCurrency": {
"name": "xDAI",
"symbol": "xDAI",
"decimals": 18
},
"blockExplorerUrls": [
"https://blockscout.com/poa/xdai/"
]
}
}
],
"result": {
"name": "wallet_addEthereumChainExampleResult",
"value": "null"
}
}
]
},
{
"name": "wallet_switchEthereumChain",
"tags": [
{
"$ref": "#/components/tags/MetaMask"
}
],
"summary": "Switches the wallet's active Ethereum chain.",
"description": "Requests that the wallet switches its active Ethereum chain. Introduced by [EIP 3326](https://ethereum-magicians.org/t/eip-3326-wallet-switchethereumchain).",
"params": [
{
"name": "SwitchEthereumChainParameter",
"schema": {
"title": "SwitchEthereumChainParameter",
"type": "object",
"required": [
"chainId"
],
"properties": {
"chainId": {
"description": "MUST specify the integer ID of the chain as a hexadecimal string, per the eth_chainId Ethereum RPC method.",
"type": "string"
}
}
}
}
],
"result": {
"name": "SwitchEthereumChainResult",
"schema": {
"type": "null"
}
},
"errors": [
{
"code": 4902,
"message": "Unrecognized chain ID. Try adding the chain using `wallet_addEthereumChain` first."
}
],
"examples": [
{
"name": "wallet_switchEthereumChain example",
"params": [
{
"name": "SwitchEthereumChainParameter",
"value": {
"chainId": "0x64"
}
}
],
"result": {
"name": "wallet_switchEthereumChainExampleResult",
"value": "null"
}
}
]
},
{
"name": "wallet_requestPermissions",
"tags": [
{
"$ref": "#/components/tags/MetaMask"
}
],
"summary": "Requests additional permissions.",
"description": "Requests additional permissions from the user. Introduced by [EIP-2255](https://eips.ethereum.org/EIPS/eip-2255).",
"params": [
{
"name": "requestPermissionsObject",
"required": true,
"schema": {
"title": "requestPermissionObject",
"type": "object",
"additionalProperties": {
"type": "object",
"additionalProperties": true
},
"properties": {
"eth_accounts": {
"type": "object",
"additionalProperties": true
}
}
}
}
],
"result": {
"name": "PermissionsList",
"schema": {
"$ref": "#/components/schemas/PermissionsList"
}
},
"examples": [
{
"name": "wallet_requestPermissions example",
"params": [
{
"name": "requestPermissionObject",
"value": {
"eth_accounts": {}
}
}
],
"result": {
"name": "permissionList",
"value": {}
}
}
],
"errors": [
{
"$ref": "#/components/errors/UserRejected"
}
]
},
{
"tags": [
{
"$ref": "#/components/tags/MetaMask"
}
],
"name": "wallet_getPermissions",
"summary": "Gets the user's permissions.",
"description": "Gets the user's permissions. Introduced by [EIP-2255](https://eips.ethereum.org/EIPS/eip-2255).",
"params": [],
"result": {
"name": "PermissionsList",
"schema": {
"$ref": "#/components/schemas/PermissionsList"
}
}
},
{
"tags": [
{
"$ref": "#/components/tags/MetaMask"
}
],
"name": "wallet_registerOnboarding",
"summary": "Redirects the user back to the site after onboarding.",
"description": "Registers the requesting site with MetaMask as the initiator of onboarding, enabling MetaMask to redirect the user back to the site after onboarding. Returns a promise that resolves to `true`, or rejects if there's an error. Instead of calling this method directly, you should use the [`@metamask/onboarding`](https://github.com/MetaMask/metamask-onboarding) library.",
"params": [],
"result": {
"name": "RegisterOnboardingResult",
"description": "`true` if the request was successful, `false` otherwise.",
"schema": {
"type": "boolean"
}
}
},
{
"name": "wallet_watchAsset",
"tags": [
{
"$ref": "#/components/tags/MetaMask"
}
],
"summary": "Tracks a token in MetaMask.",
"description": "Requests that the user track the specified token in MetaMask. Returns a boolean indicating if the token was successfully added. Once added, the token is indistinguishable from those added using legacy methods, such as a centralized registry. Introduced by [EIP-747](https://eips.ethereum.org/EIPS/eip-747). Currently support for ERC721 and ERC1155 tokens is limited to the extension (not on mobile) and is considered experimental. See [MIP-1](https://github.com/MetaMask/metamask-improvement-proposals/blob/main/MIPs/mip-1.md) and [MIP proposal lifecycle](https://github.com/MetaMask/metamask-improvement-proposals/blob/main/PROCESS-GUIDE.md#proposal-lifecycle) for more information.",
"paramStructure": "by-name",
"params": [
{
"name": "type",
"schema": {
"type": "string",
"description": "Supports ERC-20, ERC-721, and ERC-1155 tokens. Currently support for ERC721 and ERC1155 tokens is limited to the extension (not on mobile) and is considered experimental. See [MIP-1](https://github.com/MetaMask/metamask-improvement-proposals/blob/main/MIPs/mip-1.md) and [MIP proposal lifecycle](https://github.com/MetaMask/metamask-improvement-proposals/blob/main/PROCESS-GUIDE.md#proposal-lifecycle) for more information.",
"enum": [
"ERC20",
"ERC721",
"ERC1155"
]
},
"required": true
},
{
"name": "options",
"schema": {
"title": "WatchAssetOptions",
"type": "object",
"required": [
"address"
],
"properties": {
"address": {
"description": "The address of the token contract.",
"type": "string"
},
"symbol": {
"description": "A ticker symbol or shorthand, up to 11 characters (optional for ERC-20 tokens).",
"minLength": 2,
"maxLength": 11,
"type": "string"
},
"decimals": {
"description": "The number of token decimals (optional for ERC-20 tokens).",
"type": "number"
},
"image": {
"description": "A string URL of the token logo (optional for ERC-20 tokens).",
"type": "string"
},
"tokenId": {
"description": "The unique identifier of the NFT (required for ERC-721 and ERC-1155 tokens).",
"type": "string"
}
}
}
}
],
"errors": [
{
"code": -32602,
"message": "Must specify address, symbol, and decimals."
},
{
"code": -32602,
"message": "Invalid symbol: not a string."
},
{
"code": -32602,
"message": "Invalid symbol '${symbol}': longer than 11 characters."
},
{
"code": -32602,
"message": "Invalid decimals '${decimals}': must be 0 <= 36."
},
{
"code": -32602,
"message": "Invalid address '${address}'."
},
{
"code": -32602,
"message": "Asset type is required"
},
{
"code": -32602,
"message": "Both address and tokenId are required"
},
{
"code": -32602,
"message": "Invalid address"
},
{
"code": -32000,
"message": "Suggested NFT is not owned by the selected account."
},
{
"code": -32000,
"message": "Suggested NFT of type ${standard} does not match received type ${type}"
},
{
"code": -32002,
"message": "Unable to verify ownership. Possibly because the standard is not supported or the user's currently selected network does not match the chain of the asset in question."
}
],
"result": {
"name": "WatchAssetResult",
"description": "`true` if the token was added, `false` otherwise.",
"schema": {
"type": "boolean"
}
},
"examples": [
{
"name": "wallet_watchAsset_ERC20_example",
"params": [
{
"name": "type",
"value": "ERC20"
},
{
"name": "options",
"value": {
"address": "0xb60e8dd61c5d32be8058bb8eb970870f07233155",
"symbol": "FOO",
"decimals": 18,
"image": "https://foo.io/token-image.svg"
}
}
],
"result": {
"name": "wallet_watchAssetExampleResult",
"value": true
}
},
{
"name": "wallet_watchAsset_ERC721_example",
"params": [
{
"name": "type",
"value": "ERC721"
},
{
"name": "options",
"value": {
"address": "0x123456789abcdef0123456789abcdef01234567",
"tokenId": "42"
}
}
],
"result": {
"name": "wallet_watchAssetERC721ExampleResult",
"value": true
}
},
{
"name": "wallet_watchAsset_ERC1155_example",
"params": [
{
"name": "type",
"value": "ERC1155"
},
{
"name": "options",
"value": {
"address": "0xabcdef0123456789abcdef0123456789abcdef01",
"tokenId": "1337"
}
}
],
"result": {
"name": "wallet_watchAssetERC1155ExampleResult",
"value": true
}
}
]
},
{
"name": "eth_decrypt",
"tags": [
{
"$ref": "#/components/tags/MetaMask"
}
],
"summary": "Decrypts an encrypted message.",
"description": "Requests that MetaMask decrypt the specified encrypted message. The message must have been encrypted using the public encryption key of the specified Ethereum address. Returns a promise that resolves to the decrypted message, or rejects if the decryption attempt fails.",
"params": [
{
"name": "EncryptedMessage",
"required": true,
"description": "The encrypted message to decrypt.",
"schema": {
"type": "string"
}
},
{
"name": "Address",
"required": true,
"description": "The address of the Ethereum account that can decrypt the message.",
"schema": {
"$ref": "#/components/schemas/address"
}
}
],
"result": {
"name": "PermissionsList",
"schema": {
"$ref": "#/components/schemas/PermissionsList"
}
}
},
{
"tags": [
{
"$ref": "#/components/tags/MetaMask"
}
],
"name": "eth_getEncryptionPublicKey",
"summary": "Gets a public key used for encryption.",
"description": "Requests that the user share their public encryption key. Returns a public encryption key, or rejects if the user denies the request. The public key is computed from entropy associated with the specified user account, using the NaCl implementation of the `X25519_XSalsa20_Poly1305` algorithm.",
"params": [
{
"name": "Address",
"required": true,
"description": "The address of the Ethereum account that can decrypt the message.",
"schema": {
"$ref": "#/components/schemas/address"
}
}
],
"result": {
"name": "EncryptionKey",
"schema": {
"type": "string"
}
}
},
{
"tags": [
{
"$ref": "#/components/tags/MetaMask"
}
],
"name": "eth_requestAccounts",
"description": "Requests that the user provide an Ethereum address to be identified by. This method is specified by [EIP-1102](https://eips.ethereum.org/EIPS/eip-1102). Internally, this method calls `wallet_requestPermissions` for permission to call `eth_accounts`.",
"summary": "Requests that the user provide an Ethereum address.",
"params": [],
"result": {
"name": "AddressList",
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/address"
}
}
},
"errors": [
{
"$ref": "#/components/errors/UserRejected"
}
]
},
{
"tags": [
{
"$ref": "#/components/tags/MetaMask"
},
{
"$ref": "#/components/tags/Restricted"
}
],
"name": "eth_accounts",
"description": "Returns a list of addresses for the accounts owned by the user.",
"summary": "Gets a list of addresses for the user's accounts.",
"params": [],
"result": {
"name": "AddressList",
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/address"
}
}
}
},
{
"name": "eth_signTypedData_v4",
"tags": [
{
"$ref": "#/components/tags/MetaMask"
}
],
"summary": "Presents a structured data message for the user to sign.",
"description": "Presents a data message for the user to sign in a structured and readable format and returns the signed response. Introduced By [EIP-712](https://eips.ethereum.org/EIPS/eip-712).",
"params": [
{
"name": "Address",
"required": true,
"description": "The address of the requested signing account.",
"schema": {
"$ref": "#/components/schemas/address"
}
},
{
"name": "TypedData",
"required": true,
"schema": {
"$ref": "#/components/schemas/TypedData"
}
}
],
"result": {
"name": "Signature",
"schema": {
"$ref": "#/components/schemas/bytes"
}
},
"examples": [
{
"name": "eth_SignTypedData_v4 example",
"params": [
{
"name": "Address",
"value": "0x0000000000000000000000000000000000000000"
},
{
"name": "TypedData",
"value": {
"types": {
"EIP712Domain": [
{
"name": "name",
"type": "string"
},
{
"name": "version",
"type": "string"
},
{
"name": "chainId",
"type": "uint256"
},
{
"name": "verifyingContract",
"type": "address"
}
],
"Person": [
{
"name": "name",
"type": "string"
},
{
"name": "wallet",
"type": "address"
}
],
"Mail": [
{
"name": "from",
"type": "Person"
},
{
"name": "to",
"type": "Person"
},
{
"name": "contents",
"type": "string"
}
]
},
"primaryType": "Mail",
"domain": {
"name": "Ether Mail",
"version": "1",
"chainId": 1,
"verifyingContract": "0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC"
},
"message": {
"from": {
"name": "Cow",
"wallet": "0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826"
},
"to": {
"name": "Bob",
"wallet": "0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB"
},
"contents": "Hello, Bob!"
}
}
}
],
"result": {
"name": "Signature",
"value": "0x4355c47d63924e8a72e509b65029052eb6c299d53a04e167c5775fd466751c9d07299936d304c153f6443dfa05f40ff007d72911b6f72307f996231605b915621c"
}
}
]
},
{
"name": "personal_sign",
"summary": "Presents a plain text signature challenge to the user.",
"description": "Presents a plain text signature challenge to the user and returns the signed response. Equivalent to `eth_sign` on some other wallets, and prepends a safe prefix to the signed message to prevent the challenge tricking users into signing a financial transaction. This method requires that the user has granted permission to interact with their account first, so make sure to call `eth_requestAccounts` first.",
"deprecated": false,
"params": [
{
"name": "Challenge",
"required": true,
"description": "A hex-encoded UTF-8 string to present to the user. See how to encode a string like this in the [`browser-string-hexer`](https://github.com/danfinlay/browser-string-hexer) module.",
"schema": {
"type": "string",
"pattern": "^0x[a-fA-F\\d]+$"
}
},
{
"name": "Address",
"required": true,
"description": "The address of the requested signing account.",
"schema": {
"$ref": "#/components/schemas/address"
}
}
],
"result": {
"name": "Signature",
"description": "A hex-encoded 129-byte array starting with `0x`.",
"schema": {
"$ref": "#/components/schemas/bytes"
}
}
},
{
"name": "eth_sendTransaction",
"description": "Creates a new wallet confirmation to make an ethereum transaction from the user's account. This method requires that the user has granted permission to interact with their account first, so make sure to call `eth_requestAccounts` or `wallet_requestPermissions` first.",
"summary": "Initiates a new transaction.",
"params": [
{
"name": "Transaction",
"required": true,
"description": "The transaction object to sign and send.",
"schema": {
"type": "object",
"title": "Transaction",
"description": "The parameters to customize a transaction. If a `to` address is not provided. It will be assumed that the transaction is a contract creation transaction, and the `data` field of the transaction will be used as the contract initialization code. `gasPrice` cannot be used together with `maxPriorityFeePerGas` and `maxFeePerGas`.",
"required": [
"from"
],
"if": {
"properties": {
"to": {
"not": {
"type": "string"
}
}
}
},
"then": {
"required": [
"data"
]
},
"properties": {
"to": {
"title": "to address",
"$ref": "#/components/schemas/address"
},
"from": {
"title": "from address",
"$ref": "#/components/schemas/address"
},
"gas": {
"title": "gas limit",
"$ref": "#/components/schemas/uint"
},
"value": {
"title": "value",
"$ref": "#/components/schemas/uint"
},
"data": {
"title": "data",
"$ref": "#/components/schemas/bytes"
},
"gasPrice": {
"title": "gas price",
"description": "The gas price willing to be paid by the sender in wei. Used in pre-1559 transactions.",
"$ref": "#/components/schemas/uint"
},
"maxPriorityFeePerGas": {
"title": "max priority fee per gas",
"description": "Maximum fee per gas the sender is willing to pay to miners in wei. Used in 1559 transactions.",
"$ref": "#/components/schemas/uint"
},
"maxFeePerGas": {
"title": "max fee per gas",
"description": "The maximum total fee per gas the sender is willing to pay (includes the network / base fee and miner / priority fee) in wei. Used in 1559 transactions.",
"$ref": "#/components/schemas/uint"
}
}
}
}
],
"result": {
"name": "TransactionHash",
"description": "The transaction hash of the sent transaction.",
"schema": {
"$ref": "#/components/schemas/bytes32"
}
}
},
{
"name": "eth_blockNumber",
"summary": "Returns the number of most recent block.",
"params": [],
"result": {
"name": "Block number",
"schema": {
"$ref": "#/components/schemas/uint"
}
},
"tags": [
{
"name": "Ethereum API",
"description": "Ethereum Node JSON-RPC method"
}
]
},
{
"name": "eth_call",
"summary": "Executes a new message call immediately without creating a transaction on the block chain.",
"params": [
{
"name": "Transaction",
"required": true,
"schema": {
"$ref": "#/components/schemas/GenericTransaction"
}
},
{
"name": "Block",
"required": false,
"schema": {
"$ref": "#/components/schemas/BlockNumberOrTagOrHash"
}
}
],
"result": {
"name": "Return data",
"schema": {
"$ref": "#/components/schemas/bytes"
}
},
"tags": [
{
"name": "Ethereum API",
"description": "Ethereum Node JSON-RPC method"
}
]
},
{
"name": "eth_chainId",
"summary": "Returns the chain ID of the current network.",
"params": [],
"result": {
"name": "Chain ID",
"schema": {
"$ref": "#/components/schemas/uint"
}
},
"tags": [
{
"name": "Ethereum API",
"description": "Ethereum Node JSON-RPC method"
}
]
},
{
"name": "eth_coinbase",
"summary": "Returns the client coinbase address.",
"params": [],
"result": {
"name": "Coinbase address",
"schema": {
"$ref": "#/components/schemas/address"
}
},
"tags": [
{
"name": "Ethereum API",
"description": "Ethereum Node JSON-RPC method"
}
]
},
{
"name": "eth_estimateGas",
"summary": "Generates and returns an estimate of how much gas is necessary to allow the transaction to complete.",
"params": [
{
"name": "Transaction",
"required": true,
"schema": {
"$ref": "#/components/schemas/GenericTransaction"
}
},
{
"name": "Block",
"required": false,
"schema": {
"$ref": "#/components/schemas/BlockNumberOrTag"
}
}
],
"result": {
"name": "Gas used",
"schema": {
"$ref": "#/components/schemas/uint"
}
},
"tags": [
{
"name": "Ethereum API",
"description": "Ethereum Node JSON-RPC method"
}
]
},
{
"name": "eth_feeHistory",
"summary": "Transaction fee history",
"description": "Returns transaction base fee per gas and effective priority fee per gas for the requested/supported block range.",
"params": [
{
"name": "blockCount",
"description": "Requested range of blocks. Clients will return less than the requested range if not all blocks are available.",
"required": true,
"schema": {
"$ref": "#/components/schemas/uint"
}
},
{
"name": "newestBlock",
"description": "Highest block of the requested range.",
"required": true,
"schema": {
"$ref": "#/components/schemas/BlockNumberOrTag"
}
},
{
"name": "rewardPercentiles",
"description": "A monotonically increasing list of percentile values. For each block in the requested range, the transactions will be sorted in ascending order by effective tip per gas and the coresponding effective tip for the percentile will be determined, accounting for gas consumed.",
"required": true,
"schema": {
"title": "rewardPercentiles",
"type": "array",
"items": {
"title": "rewardPercentile",
"description": "Floating point value between 0 and 100.",
"type": "number"
}
}
}
],
"result": {
"name": "feeHistoryResult",
"description": "Fee history for the returned block range. This can be a subsection of the requested range if not all blocks are available.",
"schema": {
"title": "feeHistoryResults",
"description": "Fee history results.",
"type": "object",
"required": [
"oldestBlock",
"baseFeePerGas",
"gasUsedRatio"
],
"additionalProperties": false,
"properties": {
"oldestBlock": {
"title": "oldestBlock",
"description": "Lowest number block of returned range.",
"$ref": "#/components/schemas/uint"
},
"baseFeePerGas": {
"title": "baseFeePerGasArray",
"description": "An array of block base fees per gas. This includes the next block after the newest of the returned range, because this value can be derived from the newest block. Zeroes are returned for pre-EIP-1559 blocks.",
"type": "array",
"items": {
"$ref": "#/components/schemas/uint"
}
},
"gasUsedRatio": {
"title": "gasUsedRatio",
"description": "An array of block gas used ratios. These are calculated as the ratio of gasUsed and gasLimit.",
"type": "array",
"items": {
"$ref": "#/components/schemas/ratio"
}
},
"reward": {
"title": "rewardArray",
"description": "A two-dimensional array of effective priority fees per gas at the requested block percentiles.",
"type": "array",
"items": {
"title": "rewardPercentile",
"description": "An array of effective priority fee per gas data points from a single block. All zeroes are returned if the block is empty.",
"type": "array",
"items": {
"title": "rewardPercentile",
"description": "A given percentile sample of effective priority fees per gas from a single block in ascending order, weighted by gas used. Zeroes are returned if the block is empty.",
"$ref": "#/components/schemas/uint"
}
}
}
}
}
},
"tags": [
{
"name": "Ethereum API",
"description": "Ethereum Node JSON-RPC method"
}
]
},
{
"name": "eth_gasPrice",
"summary": "Returns the current price per gas in wei.",
"params": [],
"result": {
"name": "Gas price",
"schema": {
"title": "Gas price",
"$ref": "#/components/schemas/uint"
}
},
"tags": [
{
"name": "Ethereum API",
"description": "Ethereum Node JSON-RPC method"
}
]
},
{
"name": "eth_getBalance",
"summary": "Returns the balance of the account of given address.",
"params": [
{
"name": "Address",
"required": true,
"schema": {
"$ref": "#/components/schemas/address"
}
},
{
"name": "Block",
"required": false,
"schema": {
"$ref": "#/components/schemas/BlockNumberOrTagOrHash"
}
}
],
"result": {
"name": "Balance",
"schema": {
"$ref": "#/components/schemas/uint"
}
},
"tags": [
{
"name": "Ethereum API",
"description": "Ethereum Node JSON-RPC method"
}
]
},
{
"name": "eth_getBlockByHash",
"summary": "Returns information about a block by hash.",
"params": [
{
"name": "Block hash",
"required": true,
"schema": {
"$ref": "#/components/schemas/hash32"
}
},
{
"name": "Hydrated transactions",
"required": true,
"schema": {
"title": "hydrated",
"type": "boolean"
}
}
],
"result": {
"name": "Block information",
"schema": {
"oneOf": [
{
"$ref": "#/components/schemas/notFound"
},
{
"$ref": "#/components/schemas/Block"
}
]
}
},
"tags": [
{
"name": "Ethereum API",
"description": "Ethereum Node JSON-RPC method"
}
]
},
{
"name": "eth_getBlockByNumber",
"summary": "Returns information about a block by number.",
"params": [
{
"name": "Block",
"required": true,
"schema": {
"$ref": "#/components/schemas/BlockNumberOrTag"
}
},
{
"name": "Hydrated transactions",
"required": true,
"schema": {
"title": "hydrated",
"type": "boolean"
}
}
],
"result": {
"name": "Block information",
"schema": {
"oneOf": [
{
"$ref": "#/components/schemas/notFound"
},
{
"$ref": "#/components/schemas/Block"
}
]
}
},
"tags": [
{
"name": "Ethereum API",
"description": "Ethereum Node JSON-RPC method"
}
]
},
{
"name": "eth_getBlockTransactionCountByHash",
"summary": "Returns the number of transactions in a block from a block matching the given block hash.",
"params": [
{
"name": "Block hash",
"schema": {
"$ref": "#/components/schemas/hash32"
}
}
],
"result": {
"name": "Transaction count",
"schema": {
"oneOf": [
{
"$ref": "#/components/schemas/notFound"
},
{
"title": "Transaction count",
"$ref": "#/components/schemas/uint"
}
]
}
},
"tags": [
{
"name": "Ethereum API",
"description": "Ethereum Node JSON-RPC method"
}
]
},
{
"name": "eth_getBlockTransactionCountByNumber",
"summary": "Returns the number of transactions in a block matching the given block number.",
"params": [
{
"name": "Block",
"schema": {
"$ref": "#/components/schemas/BlockNumberOrTag"
}
}
],
"result": {
"name": "Transaction count",
"schema": {
"oneOf": [
{
"$ref": "#/components/schemas/notFound"
},
{
"title": "Transaction count",
"$ref": "#/components/schemas/uint"
}
]
}
},
"tags": [
{
"name": "Ethereum API",
"description": "Ethereum Node JSON-RPC method"
}
]
},
{
"name": "eth_getCode",
"summary": "Returns code at a given address.",
"params": [
{
"name": "Address",
"required": true,
"schema": {
"$ref": "#/components/schemas/address"
}
},
{
"name": "Block",
"required": false,
"schema": {
"$ref": "#/components/schemas/BlockNumberOrTagOrHash"
}
}
],
"result": {
"name": "Bytecode",
"schema": {
"$ref": "#/components/schemas/bytes"
}
},
"tags": [
{
"name": "Ethereum API",
"description": "Ethereum Node JSON-RPC method"
}
]
},
{
"name": "eth_getFilterChanges",
"summary": "Polling method for a filter, which returns an array of logs which occurred since last poll.",
"params": [
{
"name": "Filter Identifier",
"schema": {
"$ref": "#/components/schemas/uint"
}
}
],
"result": {
"name": "Log objects",
"schema": {
"$ref": "#/components/schemas/FilterResults"
}
},
"tags": [
{
"name": "Ethereum API",
"description": "Ethereum Node JSON-RPC method"
}
]
},
{
"name": "eth_getFilterLogs",
"summary": "Returns an array of all logs matching filter with given id.",
"params": [
{
"name": "Filter Identifier",
"schema": {
"$ref": "#/components/schemas/uint"
}
}
],
"result": {
"name": "Log objects",
"schema": {
"$ref": "#/components/schemas/FilterResults"
}
},
"tags": [
{
"name": "Ethereum API",
"description": "Ethereum Node JSON-RPC method"
}
]
},
{
"name": "eth_getLogs",
"summary": "Returns an array of all logs matching filter with given id.",
"params": [
{
"name": "Filter",
"schema": {
"$ref": "#/components/schemas/Filter"
}
}
],
"result": {
"name": "Log objects",
"schema": {
"$ref": "#/components/schemas/FilterResults"
}
},
"tags": [
{
"name": "Ethereum API",
"description": "Ethereum Node JSON-RPC method"
}
]
},
{
"name": "eth_getProof",
"summary": "Returns the merkle proof for a given account and optionally some storage keys.",
"params": [
{
"name": "Address",
"required": true,
"schema": {
"$ref": "#/components/schemas/address"
}
},
{
"name": "StorageKeys",
"required": true,
"schema": {
"title": "Storage keys",
"type": "array",
"items": {
"$ref": "#/components/schemas/bytesMax32"
}
}
},
{
"name": "Block",
"required": true,
"schema": {
"$ref": "#/components/schemas/BlockNumberOrTagOrHash"
}
}
],
"result": {
"name": "Account",
"schema": {
"$ref": "#/components/schemas/AccountProof"
}
},
"tags": [
{
"name": "Ethereum API",
"description": "Ethereum Node JSON-RPC method"
}
]
},
{
"name": "eth_getStorageAt",
"summary": "Returns the value from a storage position at a given address.",
"params": [
{
"name": "Address",
"required": true,
"schema": {
"$ref": "#/components/schemas/address"
}
},
{
"name": "Storage slot",
"required": true,
"schema": {
"$ref": "#/components/schemas/uint256"
}
},
{
"name": "Block",
"required": false,
"schema": {
"$ref": "#/components/schemas/BlockNumberOrTagOrHash"
}
}
],
"result": {
"name": "Value",
"schema": {
"$ref": "#/components/schemas/bytes"
}
},
"tags": [
{
"name": "Ethereum API",
"description": "Ethereum Node JSON-RPC method"
}
]
},
{
"name": "eth_getTransactionByBlockHashAndIndex",
"summary": "Returns information about a transaction by block hash and transaction index position.",
"params": [
{
"name": "Block hash",
"required": true,
"schema": {
"$ref": "#/components/schemas/hash32"
}
},
{
"name": "Transaction index",
"required": true,
"schema": {
"$ref": "#/components/schemas/uint"
}
}
],
"result": {
"name": "Transaction information",
"schema": {
"oneOf": [
{
"$ref": "#/components/schemas/notFound"
},
{
"$ref": "#/components/schemas/TransactionInfo"
}
]
}
},
"tags": [
{
"name": "Ethereum API",
"description": "Ethereum Node JSON-RPC method"
}
]
},
{
"name": "eth_getTransactionByBlockNumberAndIndex",
"summary": "Returns information about a transaction by block number and transaction index position.",
"params": [
{
"name": "Block",
"required": true,
"schema": {
"$ref": "#/components/schemas/BlockNumberOrTag"
}
},
{
"name": "Transaction index",
"required": true,
"schema": {
"$ref": "#/components/schemas/uint"
}
}
],
"result": {
"name": "Transaction information",
"schema": {
"oneOf": [
{
"$ref": "#/components/schemas/notFound"
},
{
"$ref": "#/components/schemas/TransactionInfo"
}
]
}
},
"tags": [
{
"name": "Ethereum API",
"description": "Ethereum Node JSON-RPC method"
}
]
},
{
"name": "eth_getTransactionByHash",
"summary": "Returns the information about a transaction requested by transaction hash.",
"params": [
{
"name": "Transaction hash",
"required": true,
"schema": {
"$ref": "#/components/schemas/hash32"
}
}
],
"result": {
"name": "Transaction information",
"schema": {
"oneOf": [
{
"$ref": "#/components/schemas/notFound"
},
{
"$ref": "#/components/schemas/TransactionInfo"
}
]
}
},
"tags": [
{
"name": "Ethereum API",
"description": "Ethereum Node JSON-RPC method"
}
]
},
{
"name": "eth_getTransactionCount",
"summary": "Returns the number of transactions sent from an address.",
"params": [
{
"name": "Address",
"required": true,
"schema": {
"$ref": "#/components/schemas/address"
}
},
{
"name": "Block",
"required": false,
"schema": {
"$ref": "#/components/schemas/BlockNumberOrTagOrHash"
}
}
],
"result": {
"name": "Transaction count",
"schema": {
"$ref": "#/components/schemas/uint"
}
},
"tags": [
{
"name": "Ethereum API",
"description": "Ethereum Node JSON-RPC method"
}
]
},
{
"name": "eth_getTransactionReceipt",
"summary": "Returns the receipt of a transaction by transaction hash.",
"params": [
{
"name": "Transaction hash",
"required": true,
"schema": {
"$ref": "#/components/schemas/hash32"
}
}
],
"result": {
"name": "Receipt information",
"schema": {
"oneOf": [
{
"$ref": "#/components/schemas/notFound"
},
{
"$ref": "#/components/schemas/ReceiptInfo"
}
]
}
},
"tags": [
{
"name": "Ethereum API",
"description": "Ethereum Node JSON-RPC method"
}
]
},
{
"name": "eth_getUncleCountByBlockHash",
"summary": "Returns the number of uncles in a block from a block matching the given block hash.",
"params": [
{
"name": "Block hash",
"schema": {
"$ref": "#/components/schemas/hash32"
}
}
],
"result": {
"name": "Uncle count",
"schema": {
"oneOf": [
{
"$ref": "#/components/schemas/notFound"
},
{
"title": "Uncle count",
"$ref": "#/components/schemas/uint"
}