diff --git a/openrpc.json b/openrpc.json new file mode 100644 index 00000000000..81e8b0d6341 --- /dev/null +++ b/openrpc.json @@ -0,0 +1,5603 @@ +{ + "openrpc": "1.2.4", + "info": { + "title": "JSON-RPC API", + "version": "1.0.0", + "description": "This section provides an interactive reference for MetaMask's Wallet JSON-RPC API. The API builds on a set of standard Ethereum methods with MetaMask-specific enhancements, and is designed for seamless integration into dapps." + }, + "methods": [ + { + "name": "wallet_addEthereumChain", + "tags": [ + { + "$ref": "#/components/tags/MetaMask" + }, + { + "$ref": "#/components/tags/Multichain" + } + ], + "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. Specified by [EIP-3085](https://eips.ethereum.org/EIPS/eip-3085).", + "params": [ + { + "name": "Chain", + "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": "Null response", + "description": "This method returns `null` if the chain is added.", + "schema": { + "type": "null" + } + }, + "examples": [ + { + "name": "wallet_addEthereumChain example", + "params": [ + { + "name": "Chain", + "value": { + "chainId": "0x64", + "chainName": "Gnosis", + "rpcUrls": ["https://rpc.gnosischain.com"], + "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": "Null response", + "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. Specified by [EIP-3326](https://eips.ethereum.org/EIPS/eip-3326).", + "params": [ + { + "name": "Chain", + "schema": { + "title": "Chain", + "description": "Object containing the chain ID to switch to.", + "type": "object", + "required": ["chainId"], + "properties": { + "chainId": { + "description": "The chain ID as a `0x`-prefixed hexadecimal string, as returned by the `eth_chainId` method.", + "type": "string" + } + } + } + } + ], + "result": { + "name": "Null response", + "description": "This method returns `null` if the active chain is switched.", + "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": "Chain", + "value": { + "chainId": "0x64" + } + } + ], + "result": { + "name": "Null response", + "value": "null" + } + } + ] + }, + { + "name": "wallet_getPermissions", + "tags": [ + { + "$ref": "#/components/tags/MetaMask" + } + ], + "summary": "Gets the user's permissions.", + "description": "Gets the user's permissions. Specified by [EIP-2255](https://eips.ethereum.org/EIPS/eip-2255).", + "params": [], + "result": { + "name": "Permissions list", + "schema": { + "$ref": "#/components/schemas/PermissionsList" + } + }, + "examples": [ + { + "name": "wallet_getPermissions example", + "params": [], + "result": { + "name": "Permission list", + "value": { + "eth_accounts": {} + } + } + } + ] + }, + { + "name": "wallet_requestPermissions", + "tags": [ + { + "$ref": "#/components/tags/MetaMask" + } + ], + "summary": "Requests additional permissions.", + "description": "This method requests additional permissions from the user. This method accepts a single permission per call. Specified by [EIP-2255](https://eips.ethereum.org/EIPS/eip-2255).", + "params": [ + { + "name": "Permission", + "required": true, + "schema": { + "title": "Permission", + "description": "Object containing the permission to request.", + "type": "object", + "patternProperties": { + "^\\S+$": { + "type": "object", + "description": "The permission object. The property name is the permission identifier (e.g., 'eth_accounts', 'endowment:xyz').", + "additionalProperties": true + } + } + } + } + ], + "result": { + "name": "Permissions list", + "schema": { + "$ref": "#/components/schemas/PermissionsList" + } + }, + "examples": [ + { + "name": "wallet_requestPermissions example", + "params": [ + { + "name": "Permission", + "value": { + "eth_accounts": {} + } + } + ], + "result": { + "name": "Permission list", + "value": { + "eth_accounts": {} + } + } + } + ], + "errors": [ + { + "$ref": "#/components/errors/UserRejected" + } + ] + }, + { + "name": "wallet_revokePermissions", + "tags": [ + { + "$ref": "#/components/tags/MetaMask" + }, + { + "$ref": "#/components/tags/Experimental" + } + ], + "summary": "Revokes the current dapp permissions.", + "description": "Revokes previously granted permissions for the current dapp identified by its origin. This method accepts a single permission per call. Specified by [MIP-2](https://github.com/MetaMask/metamask-improvement-proposals/blob/main/MIPs/mip-2.md) and only available for the MetaMask browser extension.", + "params": [ + { + "name": "Permission", + "required": true, + "schema": { + "title": "Permission", + "description": "Object containing the permission to revoke.", + "type": "object", + "patternProperties": { + "^\\S+$": { + "type": "object", + "description": "The permission object. The property name is the permission identifier (e.g., 'eth_accounts', 'endowment:xyz').", + "additionalProperties": true + } + } + } + } + ], + "result": { + "name": "Null response", + "description": "This method returns `null` if the permission is revoked.", + "schema": { + "type": "null" + } + }, + "errors": [], + "examples": [ + { + "name": "wallet_revokePermissions example", + "params": [ + { + "name": "Permission", + "value": { + "eth_accounts": {} + } + } + ], + "result": { + "name": "Null response", + "value": "null" + } + } + ] + }, + { + "name": "personal_sign", + "tags": [ + { + "$ref": "#/components/tags/MetaMask" + }, + { + "$ref": "#/components/tags/Restricted" + }, + { + "$ref": "#/components/tags/Multichain" + } + ], + "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. Prepends a safe prefix to the signed message to prevent the challenge tricking users into signing a financial transaction.

MetaMask implements `personal_sign` similarly to the Go Ethereum client's `eth_sign` implementation. MetaMask's `personal_sign` doesn't accept a password.

This method requires that the user has granted permission to interact with their account first, so make sure to call `eth_requestAccounts` (recommended) or `wallet_requestPermissions` 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": { + "type": "string", + "pattern": "^0x[0-9a-fA-F]{40}$" + } + } + ], + "result": { + "name": "Signature", + "description": "A hex-encoded signature.", + "schema": { + "type": "string", + "pattern": "^0x[0-9a-f]*$" + } + }, + "examples": [ + { + "name": "personal_sign example", + "params": [ + { + "name": "Challenge", + "value": "0x506c65617365207369676e2074686973206d65737361676520746f20636f6e6669726d20796f7572206964656e746974792e" + }, + { + "name": "Address", + "value": "0x4B0897b0513FdBeEc7C469D9aF4fA6C0752aBea7" + } + ], + "result": { + "name": "Signature", + "value": "0x43d7215ebe96c09a5adac69fc76dea5647286b501954ea273e417cf65e6c80e1db4891826375a7de02467a3e01caf125f64c851a8e9ee9467fd6f7e83523b2115bed8e79d527a85e28a36807d79b85fc551b5c15c1ead2e43456c31f565219203db2aed86cb3601b33ec3b410836d4be7718c6148dc9ac82ecc0a04c5edecd8914" + } + } + ] + }, + { + "name": "eth_signTypedData_v4", + "tags": [ + { + "$ref": "#/components/tags/MetaMask" + }, + { + "$ref": "#/components/tags/Restricted" + }, + { + "$ref": "#/components/tags/Multichain" + } + ], + "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). This method requires that the user has granted permission to interact with their account first, so make sure to call `eth_requestAccounts` (recommended) or `wallet_requestPermissions` first.", + "params": [ + { + "name": "Address", + "required": true, + "description": "The address of the requested signing account.", + "schema": { + "type": "string", + "pattern": "^0x[0-9a-fA-F]{40}$" + } + }, + { + "name": "Typed data", + "required": true, + "schema": { + "$ref": "#/components/schemas/TypedData" + } + } + ], + "result": { + "name": "Signature", + "description": "A hex-encoded signature.", + "schema": { + "type": "string", + "pattern": "^0x[0-9a-f]*$" + } + }, + "examples": [ + { + "name": "eth_SignTypedData_v4 example", + "params": [ + { + "name": "Address", + "value": "0x0000000000000000000000000000000000000000" + }, + { + "name": "Typed data", + "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": "wallet_registerOnboarding", + "tags": [ + { + "$ref": "#/components/tags/MetaMask" + }, + { + "$ref": "#/components/tags/Multichain" + } + ], + "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 the request 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": "Registered", + "description": "`true` if the request was successful, `false` otherwise.", + "schema": { + "type": "boolean" + } + }, + "examples": [ + { + "name": "wallet_registerOnboarding example", + "params": [], + "result": { + "name": "Registered", + "value": true + } + } + ] + }, + { + "name": "wallet_watchAsset", + "tags": [ + { + "$ref": "#/components/tags/MetaMask" + }, + { + "$ref": "#/components/tags/Experimental" + }, + { + "$ref": "#/components/tags/Multichain" + } + ], + "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).", + "paramStructure": "by-name", + "params": [ + { + "name": "type", + "schema": { + "type": "string", + "description": "The token type (`ERC20`, `ERC721`, or `ERC1155`). Support for ERC-721 and ERC-1155 tokens is experimental and currently only available on the extension (not on mobile). See [MIP-1](https://github.com/MetaMask/metamask-improvement-proposals/blob/main/MIPs/mip-1.md) and the [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": { + "description": "An object containing information about the token.", + "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": "Added", + "description": "`true` if the token was added, `false` otherwise.", + "schema": { + "type": "boolean" + } + }, + "examples": [ + { + "name": "wallet_watchAsset ERC-20 example", + "params": [ + { + "name": "type", + "value": "ERC20" + }, + { + "name": "options", + "value": { + "address": "0xb60e8dd61c5d32be8058bb8eb970870f07233155", + "symbol": "FOO", + "decimals": 18, + "image": "https://foo.io/token-image.svg" + } + } + ], + "result": { + "name": "Added", + "value": true + } + }, + { + "name": "wallet_watchAsset ERC-721 example", + "params": [ + { + "name": "type", + "value": "ERC721" + }, + { + "name": "options", + "value": { + "address": "0x123456789abcdef0123456789abcdef01234567", + "tokenId": "42" + } + } + ], + "result": { + "name": "Added", + "value": true + } + }, + { + "name": "wallet_watchAsset ERC-1155 example", + "params": [ + { + "name": "type", + "value": "ERC1155" + }, + { + "name": "options", + "value": { + "address": "0xabcdef0123456789abcdef0123456789abcdef01", + "tokenId": "1337" + } + } + ], + "result": { + "name": "Added", + "value": true + } + } + ] + }, + { + "name": "wallet_scanQRCode", + "tags": [ + { + "$ref": "#/components/tags/MetaMask" + }, + { + "$ref": "#/components/tags/Mobile" + }, + { + "$ref": "#/components/tags/Multichain" + } + ], + "summary": "Requests that the user scan a QR code.", + "description": "Requests that the user scan a QR code using their device camera. Introduced by [EIP-945](https://github.com/ethereum/EIPs/issues/945).", + "params": [ + { + "name": "Regex", + "required": false, + "description": "A regular expression (regex) string for matching arbitrary QR code strings.", + "schema": { + "type": "string", + "title": "regex" + } + } + ], + "result": { + "name": "QR code string", + "description": "A string corresponding to the scanned QR code. If a regex string is provided, the resulting string matches it. If no regex string is provided, the resulting string matches an Ethereum address. If neither condition is met, the method returns an error.", + "schema": { + "type": "string", + "title": "QR code string" + } + } + }, + { + "name": "wallet_sendCalls", + "tags": [ + { + "$ref": "#/components/tags/MetaMask" + } + ], + "summary": "Sends a batch of calls.", + "description": "Requests that the wallet submits a batch of calls. Specified by [EIP-5792](https://eips.ethereum.org/EIPS/eip-5792).", + "params": [ + { + "name": "Calls", + "required": true, + "schema": { + "$ref": "#/components/schemas/SendCallsParameter" + } + } + ], + "result": { + "name": "Batch result", + "schema": { + "description": "An object containing information about the sent batch.", + "type": "object", + "properties": { + "id": { + "description": "The ID of the batch of calls.", + "type": "string" + }, + "capabilities": { + "description": "Wallets can use this object to attach capability-specific metadata.", + "type": "object" + } + } + } + }, + "errors": [ + { + "$ref": "#/components/errors/InvalidParams" + }, + { + "code": -32000, + "message": "Version not supported." + }, + { + "$ref": "#/components/errors/UserRejected" + }, + { + "$ref": "#/components/errors/Unauthorized" + }, + { + "code": 5700, + "message": "The wallet does not support a capability that was not marked as optional." + }, + { + "code": 5710, + "message": "EIP-7702 not supported on the specified chain ID." + }, + { + "code": 5720, + "message": "There is already a batch submitted with the specified batch ID." + }, + { + "code": 5740, + "message": "The batch is too large for the wallet to process." + }, + { + "code": 5750, + "message": "EIP-7702 upgrade rejected for this chain and account." + } + ], + "examples": [ + { + "name": "wallet_sendCalls example", + "params": [ + { + "name": "Calls", + "value": { + "version": "2.0.0", + "from": "0xd46e8dd67c5d32be8058bb8eb970870f07244567", + "chainId": "0xaa36a7", + "atomicRequired": true, + "calls": [ + { + "to": "0x54f1C1965B355e1AB9ec3465616136be35bb5Ff7", + "value": "0x0" + }, + { + "to": "0x2D48e6f5Ae053e4E918d2be53570961D880905F2", + "value": "0x0" + } + ] + } + } + ], + "result": { + "name": "Batch result", + "value": { + "id": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" + } + } + } + ] + }, + { + "name": "wallet_getCallsStatus", + "tags": [ + { + "$ref": "#/components/tags/MetaMask" + } + ], + "summary": "Gets the status of a call batch.", + "description": "Gets the status of a batch of calls that was previously sent using `wallet_sendCalls`. Specified by [EIP-5792](https://eips.ethereum.org/EIPS/eip-5792).", + "params": [ + { + "name": "Batch ID", + "required": true, + "description": "The ID of a batch of calls (the `id` value returned by `wallet_sendCalls`).", + "schema": { + "type": "string" + } + } + ], + "result": { + "name": "Batch status", + "schema": { + "description": "An object containing status information of the batch of calls.", + "type": "object", + "properties": { + "version": { + "description": "The version of the API format.", + "type": "string" + }, + "id": { + "description": "The ID of the batch of calls.", + "$ref": "#/components/schemas/uint" + }, + "chainId": { + "description": "The chain ID of the calls.", + "$ref": "#/components/schemas/uint" + }, + "status": { + "description": "The status code of the batch of calls. Possible values are:
", + "type": "number" + }, + "atomic": { + "description": "`true` if the wallet executed the calls atomically. `false` if the wallet executed the calls non-atomically.", + "type": "boolean" + }, + "receipts": { + "description": "An array of transaction receipts. If the wallet executed the calls atomically, a single receipt or an array of receipts may be returned, corresponding to how the batch of calls were included onchain.", + "type": "array", + "items": { + "title": "Receipt", + "description": "A transaction receipt object.", + "type": "object", + "properties": { + "logs": { + "description": "An array of log objects.", + "type": "array", + "items": { + "title": "Log", + "description": "An object containing information about the log.", + "type": "object", + "properties": { + "address": { + "description": "The address that generated the log.", + "type": "string", + "pattern": "^0x[0-9a-fA-F]{40}$" + }, + "data": { + "description": "The data of the log.", + "type": "string", + "pattern": "^0x[0-9a-f]*$" + }, + "topics": { + "description": "An array of log topics.", + "type": "array", + "items": { + "title": "Topic", + "description": "A log topic.", + "type": "string", + "pattern": "^0x[0-9a-f]*$" + } + } + } + } + }, + "status": { + "description": "The status of the transaction. `0x1` indicates success, and `0x0` indicates failure.", + "type": "string", + "pattern": "^0x[0-1]$" + }, + "blockHash": { + "description": "The hash of the block containing the transaction.", + "type": "string", + "pattern": "^0x[0-9a-f]{64}$" + }, + "blockNumber": { + "description": "The number of the block containing the transaction.", + "type": "string", + "pattern": "^0x([1-9a-f]+[0-9a-f]*|0)$" + }, + "gasUsed": { + "description": "The amount of gas used by the transaction.", + "type": "string", + "pattern": "^0x([1-9a-f]+[0-9a-f]*|0)$" + }, + "transactionHash": { + "description": "The hash of the transaction.", + "type": "string", + "pattern": "^0x[0-9a-f]{64}$" + } + }, + "additionalProperties": true + } + }, + "capabilities": { + "description": "Capabilities associated with the batch of calls.", + "type": "object", + "additionalProperties": true + } + } + } + }, + "errors": [ + { + "$ref": "#/components/errors/InvalidParams" + }, + { + "$ref": "#/components/errors/Unauthorized" + }, + { + "code": 5730, + "message": "No matching bundle found." + } + ], + "examples": [ + { + "name": "wallet_getCallsStatus example", + "params": [ + { + "name": "Batch ID", + "value": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" + } + ], + "result": { + "name": "Batch status", + "value": { + "version": "2.0.0", + "chainId": "0xaa36a7", + "id": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331", + "status": 200, + "atomic": true, + "receipts": [ + { + "logs": [ + { + "address": "0xa922b54716264130634d6ff183747a8ead91a40b", + "topics": [ + "0x5a2a90727cc9d000dd060b1132a5c977c9702bb3a52afe360c9c22f0e9451a68" + ], + "data": "0xabcd" + } + ], + "status": "0x1", + "blockHash": "0xf19bbafd9fd0124ec110b848e8de4ab4f62bf60c189524e54213285e7f540d4a", + "blockNumber": "0xabcd", + "gasUsed": "0xdef", + "transactionHash": "0x9b7bb827c2e5e3c1a0a44dc53e573aa0b3af3bd1f9f5ed03071b100bb039eaff" + } + ] + } + } + } + ] + }, + { + "name": "wallet_getCapabilities", + "tags": [ + { + "$ref": "#/components/tags/MetaMask" + } + ], + "summary": "Gets the capabilities of the wallet.", + "description": "Returns information about the wallet's support for the `atomic` capability. The `atomic` capability specifies how the wallet will execute batches of transactions sent using `wallet_sendCalls`. `wallet_getCapabilities` is specified by [EIP-5792](https://eips.ethereum.org/EIPS/eip-5792).", + "params": [ + { + "name": "Address", + "description": "A wallet address.", + "required": true, + "schema": { + "type": "string", + "pattern": "^0x[0-9a-fA-F]{40}$" + } + }, + { + "name": "Chain IDs", + "description": "An array of chain IDs to get capabilities for.", + "schema": { + "type": "array", + "items": { + "title": "Chain ID", + "description": "An [EIP-155](https://eips.ethereum.org/EIPS/eip-155) chain ID in hexadecimal format.", + "$ref": "#/components/schemas/uint" + } + } + } + ], + "result": { + "name": "Capabilities", + "schema": { + "description": "An object specifying the status of the `atomic` capability for specific [EIP-155](https://eips.ethereum.org/EIPS/eip-155) chain IDs. For each chain, the `atomic` capability can have a `status` of:
If the `atomic` capability is not `supported` or `ready` for a specified chain ID, the wallet will not return anything for that chain ID.", + "type": "object" + } + }, + "errors": [ + { + "$ref": "#/components/errors/InvalidParams" + }, + { + "$ref": "#/components/errors/Unauthorized" + } + ], + "examples": [ + { + "name": "wallet_getCapabilities example", + "params": [ + { + "name": "Address", + "value": "0xd46e8dd67c5d32be8058bb8eb970870f07244567" + }, + { + "name": "Chain IDs", + "value": ["0xaa36a7"] + } + ], + "result": { + "name": "Capabilities", + "value": { + "0xaa36a7": { + "atomic": { + "status": "ready" + } + } + } + } + } + ] + }, + { + "name": "eth_requestAccounts", + "tags": [ + { + "$ref": "#/components/tags/MetaMask" + } + ], + "description": "Requests that the user provide access to one or more Ethereum addresses. 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 access to addresses.", + "params": [], + "result": { + "name": "Address list", + "schema": { + "type": "array", + "description": "An array of Ethereum addresses that the user has authorized the dapp to access.", + "items": { + "title": "Address", + "description": "A hex-encoded address.", + "type": "string", + "pattern": "^0x[0-9a-fA-F]{40}$" + } + } + }, + "errors": [ + { + "$ref": "#/components/errors/UserRejected" + } + ], + "examples": [ + { + "name": "eth_requestAccounts example", + "params": [], + "result": { + "name": "Address list", + "value": ["0xa77392123a1085f75e62eec7dea7e0e1e5142d5f"] + } + } + ] + }, + { + "name": "eth_accounts", + "tags": [ + { + "$ref": "#/components/tags/MetaMask" + }, + { + "$ref": "#/components/tags/Restricted" + } + ], + "description": "Returns a list of addresses that the user has authorized the dapp to access. This method requires calling `wallet_requestPermissions` for permission. We recommend using `eth_requestAccounts`, which internally calls `wallet_requestPermission`.", + "summary": "Gets a list of authorized addresses.", + "params": [], + "result": { + "name": "Address list", + "schema": { + "type": "array", + "description": "An array of Ethereum addresses that the user has authorized the dapp to access.", + "items": { + "title": "Address", + "description": "A hex-encoded address.", + "type": "string", + "pattern": "^0x[0-9a-fA-F]{40}$" + } + } + }, + "examples": [ + { + "name": "eth_accounts example", + "params": [], + "result": { + "name": "Address list", + "value": ["0xa77392123a1085f75e62eec7dea7e0e1e5142d5f"] + } + } + ] + }, + { + "name": "eth_sendTransaction", + "tags": [ + { + "$ref": "#/components/tags/MetaMask" + }, + { + "$ref": "#/components/tags/Restricted" + }, + { + "$ref": "#/components/tags/Multichain" + } + ], + "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` (recommended) 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, the transaction is assumed to be a contract creation transaction, and the `data` field is 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": { + "description": "The recipient's address.", + "$ref": "#/components/schemas/address" + }, + "from": { + "description": "The sender's address.", + "$ref": "#/components/schemas/address" + }, + "gas": { + "description": "The maximum amount of gas the transaction is allowed to use.", + "$ref": "#/components/schemas/uint" + }, + "value": { + "description": "The amount to transfer in wei.", + "$ref": "#/components/schemas/uint" + }, + "data": { + "description": "The data to include in the transaction. Used for contract creation transactions.", + "$ref": "#/components/schemas/bytes" + }, + "gasPrice": { + "description": "The gas price the sender is willing to pay to miners in wei. Used in pre-1559 transactions.", + "$ref": "#/components/schemas/uint" + }, + "maxPriorityFeePerGas": { + "description": "Maximum fee per gas the sender is willing to pay to miners in wei. Used in 1559 transactions.", + "$ref": "#/components/schemas/uint" + }, + "maxFeePerGas": { + "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": "Transaction hash", + "description": "The transaction hash of the sent transaction.", + "schema": { + "type": "string", + "pattern": "^0x[0-9a-f]{64}$" + } + }, + "errors": [ + { + "code": 4100, + "message": "The requested account and/or method has not been authorized by the user." + } + ], + "examples": [ + { + "name": "sendTransaction", + "params": [ + { + "name": "Transaction", + "value": { + "to": "0x4B0897b0513FdBeEc7C469D9aF4fA6C0752aBea7", + "from": "0xDeaDbeefdEAdbeefdEadbEEFdeadbeefDEADbEEF", + "gas": "0x76c0", + "value": "0x8ac7230489e80000", + "data": "0x", + "gasPrice": "0x4a817c800" + } + } + ], + "result": { + "name": "eth_sendTransactionExampleResult", + "value": "0x4e306b5a5a37532e1734503f7d2427a86f2c992fbe471f5be403b9f734e667c8" + } + } + ] + }, + { + "name": "eth_decrypt", + "tags": [ + { + "$ref": "#/components/tags/MetaMask" + }, + { + "$ref": "#/components/tags/Restricted" + }, + { + "$ref": "#/components/tags/Deprecated" + } + ], + "summary": "Decrypts an encrypted message.", + "description": "This method is deprecated and may be removed in the future.\n\n Requests that MetaMask decrypt the specified encrypted message.\n The message must have been encrypted using the public encryption key of the specified Ethereum address.\n 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" + } + }, + "errors": [ + { + "code": 4100, + "message": "The requested account and/or method has not been authorized by the user." + } + ], + "examples": [ + { + "name": "decryptExample", + "params": [ + { + "name": "EncryptedMessage", + "value": "0x7b2276657273696f6e223a227832353531392d7873616c736132302d706f6c7931333035222c226e6f6e6365223a2243533967507076467071765358704655416679726a7179774e35302b7a747766222c22657068656d5075626c69634b6579223a224372774b61456d2f4b356d6d714239764c376f5872636d6441417757764479324f784c3333527135576e553d222c2263697068657274657874223a2248347a65336e7177572b753174663956343945506167454e343872774f766b6952676244566e47587a38493d227d" + }, + { + "name": "Address", + "value": "0xD1F5279BE4B4dD94133A23deE1B23F5bfC0Db1d0" + } + ], + "result": { + "name": "eth_decryptExampleResult", + "value": "Hello, Ethereum!" + } + } + ] + }, + { + "name": "eth_getEncryptionPublicKey", + "tags": [ + { + "$ref": "#/components/tags/MetaMask" + }, + { + "$ref": "#/components/tags/Restricted" + }, + { + "$ref": "#/components/tags/Deprecated" + } + ], + "summary": "Gets a public key used for encryption.", + "description": "This method is deprecated and may be removed in the future.\n\n Requests that the user share their public encryption key.\n Returns a public encryption key, or rejects if the user denies the request.\n 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" + } + }, + "examples": [ + { + "name": "eth_getEncryptionPublicKey", + "params": [ + { + "name": "Address", + "value": "0x4B0897b0513FdBeEc7C469D9aF4fA6C0752aBea7" + } + ], + "result": { + "name": "eth_getEncryptionPublicKeyExampleResult", + "value": "0x04bfcab3b7ca7e8b3f3b62b2f7f77e9e4b68080bbf8f0f4a1c8f890864d2c7c1d3c45d8b2e3f5f1c27dfeea4c2f5733e90bfc7484e2a690aa9b8ac4559d2e6a8d7" + } + } + ] + }, + { + "name": "web3_clientVersion", + "tags": [ + { + "$ref": "#/components/tags/Ethereum" + }, + { + "$ref": "#/components/tags/Multichain" + } + ], + "description": "Returns the current MetaMask client version. This differs slightly per client. For example, the browser extension returns a string like `MetaMask/v10.33.1`, while the mobile app returns a string like `MetaMask/8.1.2/Mobile`.", + "summary": "Current client version.", + "params": [], + "examples": [ + { + "name": "MetaMaskClientVersionExample", + "description": "Example version response from MetaMask.", + "params": [], + "result": { + "name": "MetaMaskClientVersion", + "description": "The current client version.", + "value": "MetaMask/v10.33.1" + } + }, + { + "name": "MetaMaskMobileClientVersionExample", + "description": "Example version response from MetaMask Mobile.", + "params": [], + "result": { + "name": "MetaMaskClientVersion", + "description": "The current client version.", + "value": "MetaMask/8.1.2/Mobile" + } + } + ], + "result": { + "name": "CurrentVersion", + "description": "The current client version.", + "schema": { + "title": "CurrentClientVersion", + "type": "string" + } + } + }, + { + "name": "eth_subscribe", + "tags": [ + { + "$ref": "#/components/tags/Ethereum" + }, + { + "$ref": "#/components/tags/Multichain" + } + ], + "summary": "Subscribes to specific Ethereum events, returning a subscription ID used to receive notifications.", + "description": "Subscribes to specific events on the Ethereum network, such as new blocks, or logs. When an event occurs, a notification is sent to the client with the corresponding data. To stop receiving notifications, the client can unsubscribe using `eth_unsubscribe`.", + "params": [ + { + "name": "subscriptionType", + "required": true, + "schema": { + "title": "subscriptionType", + "type": "string", + "enum": ["newHeads", "logs"], + "description": "The type of subscription to create. Must be one of the following:\n1. `newHeads` - New block headers.\n2. `logs` - Logs matching a filter object." + } + }, + { + "name": "filterOptions", + "required": false, + "schema": { + "title": "filterOptions", + "type": "object", + "description": "(Optional) An object containing filter options specific to the subscription type. Only applicable for the `logs` subscription type.", + "required": ["topics"], + "properties": { + "address": { + "type": "string", + "description": "(Optional) A single address or an array of addresses to filter the logs by." + }, + "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", + "tags": [ + { + "$ref": "#/components/tags/Ethereum" + }, + { + "$ref": "#/components/tags/Multichain" + } + ], + "summary": "Unsubscribes from a specific Ethereum event, using the subscription ID provided by `eth_subscribe`.", + "description": "Unsubscribes from specific events on the Ethereum network, to which the client has been previously subscribed using `eth_subscribe`. The client must 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 `eth_subscribe`, 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": "eth_blockNumber", + "summary": "Returns the number of most recent block.", + "params": [], + "result": { + "name": "Block number", + "schema": { + "$ref": "#/components/schemas/uint" + } + }, + "examples": [ + { + "name": "eth_blockNumber example", + "params": [], + "result": { + "name": "Block number", + "value": "0x2377" + } + } + ], + "tags": [ + { + "name": "Ethereum API", + "description": "Ethereum Node JSON-RPC method" + }, + { + "name": "Multichain API", + "description": "Multichain 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" + } + }, + "examples": [ + { + "name": "eth_call example", + "params": [ + { + "name": "Transaction", + "value": { + "to": "0x69498dd54bd25aa0c886cf1f8b8ae0856d55ff13", + "value": "0x1" + } + }, + { + "name": "Block", + "value": "latest" + } + ], + "result": { + "name": "Return data", + "value": "0x" + } + } + ], + "tags": [ + { + "name": "Ethereum API", + "description": "Ethereum Node JSON-RPC method" + }, + { + "name": "Multichain API", + "description": "Multichain 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" + } + }, + "examples": [ + { + "name": "eth_chainId example", + "params": [], + "result": { + "name": "Chain ID", + "value": "0x1" + } + } + ], + "tags": [ + { + "name": "Ethereum API", + "description": "Ethereum Node JSON-RPC method" + }, + { + "name": "Multichain API", + "description": "Multichain JSON-RPC method" + } + ] + }, + { + "name": "eth_coinbase", + "summary": "Returns the client coinbase address.", + "params": [], + "result": { + "name": "Coinbase address", + "schema": { + "$ref": "#/components/schemas/address" + } + }, + "examples": [ + { + "name": "eth_coinbase example", + "params": [], + "result": { + "name": "Coinbase address", + "value": "0xfe3b557e8fb62b89f4916b721be55ceb828dbd73" + } + } + ], + "tags": [ + { + "name": "Ethereum API", + "description": "Ethereum Node JSON-RPC method" + }, + { + "name": "Multichain API", + "description": "Multichain 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" + } + }, + "examples": [ + { + "name": "eth_estimateGas example", + "params": [ + { + "name": "Transaction", + "value": { + "from": "0xfe3b557e8fb62b89f4916b721be55ceb828dbd73", + "to": "0x44aa93095d6749a706051658b970b941c72c1d53", + "value": "0x1" + } + } + ], + "result": { + "name": "Gas used", + "value": "0x5208" + } + } + ], + "tags": [ + { + "name": "Ethereum API", + "description": "Ethereum Node JSON-RPC method" + }, + { + "name": "Multichain API", + "description": "Multichain 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": "Fee history result", + "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" + } + }, + "baseFeePerBlobGas": { + "title": "baseFeePerBlobGasArray", + "description": "An array of block base fees per blob 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-4844 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" + } + }, + "blobGasUsedRatio": { + "title": "blobGasUsedRatio", + "description": "An array of block blob gas used ratios. These are calculated as the ratio of blobGasUsed and the max blob gas per block.", + "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" + } + } + } + } + } + }, + "examples": [ + { + "name": "eth_feeHistory example", + "params": [ + { + "name": "blockCount", + "value": "0x5" + }, + { + "name": "newestblock", + "value": "latest" + }, + { + "name": "rewardPercentiles", + "value": [20, 30] + } + ], + "result": { + "name": "Fee history result", + "value": { + "oldestblock": "0x10b52f", + "baseFeePerGas": [ + "0x3fa63a3f", + "0x37f999ee", + "0x3e36f20a", + "0x4099f79a", + "0x430d532d", + "0x46fcd4a4" + ], + "baseFeePerBlobGas": [ + "0x7b7609c19", + "0x6dbe41789", + "0x7223341d4", + "0x6574a002c", + "0x7223341d4", + "0x6574a002c" + ], + "gasUsedRatio": [ + 0.017712333333333333, 0.9458865666666667, 0.6534561, 0.6517375666666667, + 0.7347769666666667 + ], + "blobGasUsedRatio": [0, 0.6666666666666666, 0, 1, 0], + "reward": [ + ["0x3b9aca00", "0x59682f00"], + ["0x3a13012", "0x3a13012"], + ["0x3a13012", "0x3a13012"], + ["0xf4240", "0xf4240"], + ["0xf4240", "0xf4240"] + ] + } + } + } + ], + "tags": [ + { + "name": "Ethereum API", + "description": "Ethereum Node JSON-RPC method" + }, + { + "name": "Multichain API", + "description": "Multichain 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" + } + }, + "examples": [ + { + "name": "eth_gasPrice example", + "params": [], + "result": { + "name": "Gas price", + "value": "0x3e8" + } + } + ], + "tags": [ + { + "name": "Ethereum API", + "description": "Ethereum Node JSON-RPC method" + }, + { + "name": "Multichain API", + "description": "Multichain 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": true, + "schema": { + "$ref": "#/components/schemas/BlockNumberOrTagOrHash" + } + } + ], + "result": { + "name": "Balance", + "schema": { + "$ref": "#/components/schemas/uint" + } + }, + "examples": [ + { + "name": "eth_getBalance example", + "params": [ + { + "name": "Address", + "value": "0xfe3b557e8fb62b89f4916b721be55ceb828dbd73" + }, + { + "name": "Block", + "value": "latest" + } + ], + "result": { + "name": "Balance", + "value": "0x1cfe56f3795885980000" + } + } + ], + "tags": [ + { + "name": "Ethereum API", + "description": "Ethereum Node JSON-RPC method" + }, + { + "name": "Multichain API", + "description": "Multichain 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" + } + ] + } + }, + "examples": [ + { + "name": "eth_getBlockByHash example", + "params": [ + { + "name": "Block hash", + "value": "0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c" + }, + { + "name": "Hydrated transactions", + "value": false + } + ], + "result": { + "name": "Block information", + "value": { + "number": "0x68b3", + "hash": "0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c", + "mixHash": "0x24900fb3da77674a861c428429dce0762707ecb6052325bbd9b3c64e74b5af9d", + "parentHash": "0x1f68ac259155e2f38211ddad0f0a15394d55417b185a93923e2abe71bb7a4d6d", + "nonce": "0x378da40ff335b070", + "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "logsBloom": "0x00000000000000100000004080000000000500000000000000020000100000000800001000000004000001000000000000000800040010000020100000000400000010000000000000000040000000000000040000000000000000000000000000000400002400000000000000000000000000000004000004000000000000840000000800000080010004000000001000000800000000000000000000000000000000000800000000000040000000020000000000000000000800000400000000000000000000000600000400000000002000000000000000000000004000000000000000100000000000000000000000000000000000040000900010000000", + "transactionsRoot": "0x4d0c8e91e16bdff538c03211c5c73632ed054d00a7e210c0eb25146c20048126", + "stateRoot": "0x91309efa7e42c1f137f31fe9edbe88ae087e6620d0d59031324da3e2f4f93233", + "receiptsRoot": "0x68461ab700003503a305083630a8fb8d14927238f0bc8b6b3d246c0c64f21f4a", + "miner": "0xb42b6c4a95406c78ff892d270ad20b22642e102d", + "difficulty": "0x66e619a", + "totalDifficulty": "0x1e875d746ae", + "extraData": "0xd583010502846765746885676f312e37856c696e7578", + "size": "0x334", + "gasLimit": "0x47e7c4", + "gasUsed": "0x37993", + "timestamp": "0x5835c54d", + "uncles": [], + "transactions": [ + "0xa0807e117a8dd124ab949f460f08c36c72b710188f01609595223b325e58e0fc", + "0xeae6d797af50cb62a596ec3939114d63967c374fa57de9bc0f4e2b576ed6639d" + ], + "baseFeePerGas": "0x7", + "withdrawalsRoot": "0x7a4ecf19774d15cf9c15adf0dd8e8a250c128b26c9e2ab2a08d6c9c8ffbd104f", + "withdrawals": [ + { + "index": "0x0", + "validatorIndex": "0x9d8c0", + "address": "0xb9d7934878b5fb9610b3fe8a5e441e8fad7e293f", + "amount": "0x11a33e3760" + } + ], + "blobGasUsed": "0x0", + "excessBlobGas": "0x0", + "parentBeaconBlockRoot": "0x95c4dbd5b19f6fe3cbc3183be85ff4e85ebe75c5b4fc911f1c91e5b7a554a685" + } + } + } + ], + "tags": [ + { + "name": "Ethereum API", + "description": "Ethereum Node JSON-RPC method" + }, + { + "name": "Multichain API", + "description": "Multichain 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" + } + ] + } + }, + "examples": [ + { + "name": "eth_getBlockByNumber example", + "params": [ + { + "name": "block", + "value": "0x68b3" + }, + { + "name": "Hydrated transactions", + "value": false + } + ], + "result": { + "name": "Block information", + "value": { + "number": "0x68b3", + "hash": "0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c", + "mixHash": "0x24900fb3da77674a861c428429dce0762707ecb6052325bbd9b3c64e74b5af9d", + "parentHash": "0x1f68ac259155e2f38211ddad0f0a15394d55417b185a93923e2abe71bb7a4d6d", + "nonce": "0x378da40ff335b070", + "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "logsBloom": "0x00000000000000100000004080000000000500000000000000020000100000000800001000000004000001000000000000000800040010000020100000000400000010000000000000000040000000000000040000000000000000000000000000000400002400000000000000000000000000000004000004000000000000840000000800000080010004000000001000000800000000000000000000000000000000000800000000000040000000020000000000000000000800000400000000000000000000000600000400000000002000000000000000000000004000000000000000100000000000000000000000000000000000040000900010000000", + "transactionsRoot": "0x4d0c8e91e16bdff538c03211c5c73632ed054d00a7e210c0eb25146c20048126", + "stateRoot": "0x91309efa7e42c1f137f31fe9edbe88ae087e6620d0d59031324da3e2f4f93233", + "receiptsRoot": "0x68461ab700003503a305083630a8fb8d14927238f0bc8b6b3d246c0c64f21f4a", + "miner": "0xb42b6c4a95406c78ff892d270ad20b22642e102d", + "difficulty": "0x66e619a", + "totalDifficulty": "0x1e875d746ae", + "extraData": "0xd583010502846765746885676f312e37856c696e7578", + "size": "0x334", + "gasLimit": "0x47e7c4", + "gasUsed": "0x37993", + "timestamp": "0x5835c54d", + "uncles": [], + "transactions": [ + "0xa0807e117a8dd124ab949f460f08c36c72b710188f01609595223b325e58e0fc", + "0xeae6d797af50cb62a596ec3939114d63967c374fa57de9bc0f4e2b576ed6639d" + ], + "baseFeePerGas": "0x7", + "withdrawalsRoot": "0x7a4ecf19774d15cf9c15adf0dd8e8a250c128b26c9e2ab2a08d6c9c8ffbd104f", + "withdrawals": [ + { + "index": "0x0", + "validatorIndex": "0x9d8c0", + "address": "0xb9d7934878b5fb9610b3fe8a5e441e8fad7e293f", + "amount": "0x11a33e3760" + } + ], + "blobGasUsed": "0x0", + "excessBlobGas": "0x0", + "parentBeaconBlockRoot": "0x95c4dbd5b19f6fe3cbc3183be85ff4e85ebe75c5b4fc911f1c91e5b7a554a685" + } + } + } + ], + "tags": [ + { + "name": "Ethereum API", + "description": "Ethereum Node JSON-RPC method" + }, + { + "name": "Multichain API", + "description": "Multichain 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" + } + ] + } + }, + "examples": [ + { + "name": "eth_getBlockTransactionCountByHash example", + "params": [ + { + "name": "Block hash", + "value": "0xb903239f8543d04b5dc1ba6579132b143087c68db1b2168786408fcbce568238" + } + ], + "result": { + "name": "Transaction count", + "value": "0x8" + } + } + ], + "tags": [ + { + "name": "Ethereum API", + "description": "Ethereum Node JSON-RPC method" + }, + { + "name": "Multichain API", + "description": "Multichain 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" + } + ] + } + }, + "examples": [ + { + "name": "eth_getBlockTransactionCountByNumber example", + "params": [ + { + "name": "Block", + "value": "0xe8" + } + ], + "result": { + "name": "Transaction count", + "value": "0x8" + } + } + ], + "tags": [ + { + "name": "Ethereum API", + "description": "Ethereum Node JSON-RPC method" + }, + { + "name": "Multichain API", + "description": "Multichain 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": true, + "schema": { + "$ref": "#/components/schemas/BlockNumberOrTagOrHash" + } + } + ], + "result": { + "name": "Bytecode", + "schema": { + "$ref": "#/components/schemas/bytes" + } + }, + "examples": [ + { + "name": "eth_getCode example", + "params": [ + { + "name": "Address", + "value": "0xa50a51c09a5c451c52bb714527e1974b686d8e77" + }, + { + "name": "Block", + "value": "latest" + } + ], + "result": { + "name": "Bytecode", + "value": "0x60806040526004361060485763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416633fa4f2458114604d57806355241077146071575b600080fd5b348015605857600080fd5b50605f6088565b60408051918252519081900360200190f35b348015607c57600080fd5b506086600435608e565b005b60005481565b60008190556040805182815290517f199cd93e851e4c78c437891155e2112093f8f15394aa89dab09e38d6ca0727879181900360200190a1505600a165627a7a723058209d8929142720a69bde2ab3bfa2da6217674b984899b62753979743c0470a2ea70029" + } + } + ], + "tags": [ + { + "name": "Ethereum API", + "description": "Ethereum Node JSON-RPC method" + }, + { + "name": "Multichain API", + "description": "Multichain JSON-RPC method" + } + ] + }, + { + "name": "eth_getFilterChanges", + "summary": "Polling method for the filter with the given ID (created using `eth_newFilter`). 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" + } + }, + "examples": [ + { + "name": "eth_getFilterChanges example", + "params": [ + { + "name": "Filter identifier", + "value": "0x01" + } + ], + "result": { + "name": "Log objects", + "value": [ + { + "logIndex": "0x0", + "removed": false, + "blockNumber": "0x233", + "blockHash": "0xfc139f5e2edee9e9c888d8df9a2d2226133a9bd87c88ccbd9c930d3d4c9f9ef5", + "transactionHash": "0x66e7a140c8fa27fe98fde923defea7562c3ca2d6bb89798aabec65782c08f63d", + "transactionIndex": "0x0", + "address": "0x42699a7612a82f1d9c36148af9c77354759b210b", + "data": "0x0000000000000000000000000000000000000000000000000000000000000004", + "topics": ["0x04474795f5b996ff80cb47c148d4c5ccdbe09ef27551820caa9c2f8ed149cce3"] + }, + { + "logIndex": "0x0", + "removed": false, + "blockNumber": "0x238", + "blockHash": "0x98b0ec0f9fea0018a644959accbe69cd046a8582e89402e1ab0ada91cad644ed", + "transactionHash": "0xdb17aa1c2ce609132f599155d384c0bc5334c988a6c368056d7e167e23eee058", + "transactionIndex": "0x0", + "address": "0x42699a7612a82f1d9c36148af9c77354759b210b", + "data": "0x0000000000000000000000000000000000000000000000000000000000000007", + "topics": ["0x04474795f5b996ff80cb47c148d4c5ccdbe09ef27551820caa9c2f8ed149cce3"] + } + ] + } + } + ], + "tags": [ + { + "name": "Ethereum API", + "description": "Ethereum Node JSON-RPC method" + }, + { + "name": "Multichain API", + "description": "Multichain JSON-RPC method" + } + ] + }, + { + "name": "eth_getFilterLogs", + "summary": "Returns an array of all logs matching the filter with the given ID (created using `eth_newFilter`).", + "params": [ + { + "name": "Filter identifier", + "schema": { + "$ref": "#/components/schemas/uint" + } + } + ], + "result": { + "name": "Log objects", + "schema": { + "$ref": "#/components/schemas/FilterResults" + } + }, + "examples": [ + { + "name": "eth_getFilterLogs example", + "params": [ + { + "name": "Filter identifier", + "value": "0x01" + } + ], + "result": { + "name": "Log objects", + "value": [ + { + "logIndex": "0x0", + "removed": false, + "blockNumber": "0x233", + "blockHash": "0xfc139f5e2edee9e9c888d8df9a2d2226133a9bd87c88ccbd9c930d3d4c9f9ef5", + "transactionHash": "0x66e7a140c8fa27fe98fde923defea7562c3ca2d6bb89798aabec65782c08f63d", + "transactionIndex": "0x0", + "address": "0x42699a7612a82f1d9c36148af9c77354759b210b", + "data": "0x0000000000000000000000000000000000000000000000000000000000000004", + "topics": ["0x04474795f5b996ff80cb47c148d4c5ccdbe09ef27551820caa9c2f8ed149cce3"] + }, + { + "logIndex": "0x0", + "removed": false, + "blockNumber": "0x238", + "blockHash": "0x98b0ec0f9fea0018a644959accbe69cd046a8582e89402e1ab0ada91cad644ed", + "transactionHash": "0xdb17aa1c2ce609132f599155d384c0bc5334c988a6c368056d7e167e23eee058", + "transactionIndex": "0x0", + "address": "0x42699a7612a82f1d9c36148af9c77354759b210b", + "data": "0x0000000000000000000000000000000000000000000000000000000000000007", + "topics": ["0x04474795f5b996ff80cb47c148d4c5ccdbe09ef27551820caa9c2f8ed149cce3"] + } + ] + } + } + ], + "tags": [ + { + "name": "Ethereum API", + "description": "Ethereum Node JSON-RPC method" + }, + { + "name": "Multichain API", + "description": "Multichain JSON-RPC method" + } + ] + }, + { + "name": "eth_getLogs", + "summary": "Returns an array of all logs matching the specified filter.", + "params": [ + { + "name": "Filter", + "schema": { + "$ref": "#/components/schemas/Filter" + } + } + ], + "result": { + "name": "Log objects", + "schema": { + "$ref": "#/components/schemas/FilterResults" + } + }, + "examples": [ + { + "name": "eth_getLogs example", + "params": [ + { + "name": "Filter", + "value": { + "fromBlock": "0x137d3c2", + "toBlock": "0x137d3c3", + "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", + "topics": [] + } + } + ], + "result": { + "name": "Log objects", + "value": [ + { + "logIndex": "0x0", + "removed": false, + "blockNumber": "0x233", + "blockHash": "0xfc139f5e2edee9e9c888d8df9a2d2226133a9bd87c88ccbd9c930d3d4c9f9ef5", + "transactionHash": "0x66e7a140c8fa27fe98fde923defea7562c3ca2d6bb89798aabec65782c08f63d", + "transactionIndex": "0x0", + "address": "0x42699a7612a82f1d9c36148af9c77354759b210b", + "data": "0x0000000000000000000000000000000000000000000000000000000000000004", + "topics": ["0x04474795f5b996ff80cb47c148d4c5ccdbe09ef27551820caa9c2f8ed149cce3"] + }, + { + "logIndex": "0x0", + "removed": false, + "blockNumber": "0x238", + "blockHash": "0x98b0ec0f9fea0018a644959accbe69cd046a8582e89402e1ab0ada91cad644ed", + "transactionHash": "0xdb17aa1c2ce609132f599155d384c0bc5334c988a6c368056d7e167e23eee058", + "transactionIndex": "0x0", + "address": "0x42699a7612a82f1d9c36148af9c77354759b210b", + "data": "0x0000000000000000000000000000000000000000000000000000000000000007", + "topics": ["0x04474795f5b996ff80cb47c148d4c5ccdbe09ef27551820caa9c2f8ed149cce3"] + } + ] + } + } + ], + "tags": [ + { + "name": "Ethereum API", + "description": "Ethereum Node JSON-RPC method" + }, + { + "name": "Multichain API", + "description": "Multichain 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" + } + }, + "examples": [ + { + "name": "eth_getProof example", + "params": [ + { + "name": "Address", + "value": "0xe5cB067E90D5Cd1F8052B83562Ae670bA4A211a8" + }, + { + "name": "StorageKeys", + "value": [ + "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "0x283s34c8e2b1456f09832c71e5d6a0b4f8c9e1d3a2b5c7f0e6d4a8b2c1f3e5d7" + ] + }, + { + "name": "Block", + "value": "latest" + } + ], + "result": { + "name": "Account", + "value": { + "accountProof": [ + "0xf90211a06a718c2c9da77c253b12d7b2569657901e37bb691718f5dda1b86157ab1dd5eda0e7f19ed5e21bccc8d3260236b24f80ad88b3634f5d005f37b838881f0e12f1bda0abb301291704e4d92686c0f5f8ebb1734185321559b8d717ffdca95c99591976a0d0c2026bfab65c3b95276bfa82af9dec860b485f8857f293c148d63a2182128fa0c98044ec9a1273a218bed58b478277dd39173ad7b8edb95c200423a6bc8fc25fa056e5a55d9ddccdbf49362857200bbb1f042d61187c9f5f9ddcff5d2f1fc984a2a02a5b7200af424114f99a4b5f0a21c19aac82209e431ed80bfde177adb1004bdfa0026e4374f0518ff44a80fa374838ecb86cc64ac93bb710fea6dff4198f947b27a03fea341d87984673ad523177ed52f278bf4d8f97e6531c8ece932aeede4802f4a0bfe2f4a7fcb78f7e9f080dea7b6977fb1d88c441696e4456dad92b9d34ff0f43a02a3eb5c0edb14626c9c629601027bd60178bb2b688a67cea4d179fc432436615a0747355b8e02f3b884b4ffe5cea1619e32515fea064cca98208591af8c744e894a0874253737bae37f020ad3bb7e3292c7c4a63cdc158af6b33aaa4deaef016dccba03d8192bc1fc6aa1548912e763a0b5013a94399cefad7b47cf388873b2b794068a09b67f9737c6028d796bfd1c5da57a6f45824dc891f848ea0e1f8019d1fb5fba8a0aa871f9de8da85960fcd8a22cdf21c27f11e3966c14a6737ffd414b98dda00b280", + "0xf90211a0d360be1e1da1a0c32bc4c105833bd531e59d110684007b7c50fb2709002973eca0cf6dd1e350a7031b4e2ab49c899fd8bd47551c8565d8fd8d1d7796c83820c3b1a0eb0a88c29bb33989a589156f7bf07d9efc74034dd9d3f5b73385c3b45c3249bea02783c25f97a6ddb8dc07adf4b176991836d39184b1f678adeda832fff15e3664a00a4e288060045e587774d8a64993a7add73068b16863145e1e8eeb4602e18e19a0340851f4046ad1298962d6e47d05c66329549c839c158748aaad7ae00b943aefa085b127bc2a3bd17604283de21b2b3c9aa8f1d4b7b85c94d8105a46fe32c77688a00f531d62b3c5435324c01009c284fe31277e8d38302b75ea01be89f09e205969a00011c8351c0e3d639ac54b9d3a59de630b16a67de8270d7d6064d0a67e93f9cca048780d32b7f2db88650b51c46f46fd0a68795edee1fd5ecee6eb3595741d9669a0c91afd74eaf8e08a997061a62b354e2516fdc494e8e26cc50ceeb8f4a175608ba0e2c07f1b48fab80eecb340f5882e8c7b32ee416e4045c61f1df646a133487303a01a1eff78435a7a29a29463bdc3486ae81364b00bea82ba0fdf67a110770f2261a04f2eb440ba71c72da5fd7f0e439018d6671dc809f747213a1ea755848124e994a074ff9f37fce99daa3ed01dd763076450022996fc729be2cc43c61ec5182c2366a0b80b36b7b621112592f52390b89748d422e9b1517c4b0203b8176a53f89d4a6680", + "0xf90211a0b25f283bd01a8c8b2418049f9585bc37ff2c1e2e12eab4b7f64ae1f26647389aa02ad96c150d7c3c9c194d30315456852cf6a0a940e0191ae5d04007454823d4e9a0b220cf7a855e2dbcc0b973134e2e119b982d7d40dbb1b27d99816c41f40e829aa049224431da84cbf1b7ae813abcc9ef4c1dfc1760f6ddc5d57f7354bf3cbf6cc4a015191f879ac115b362f0257fd3eedb789537e836574a5b1abf1c9982ebe3bdfea07913c1b6e7282569d2d421e9fa2257f5d1698e93303bc49b941704287d7aaefea0a526576981ce6fd9f2bd48dd2ca6d5272f2fbdc85f0ee35a295f6ccd97ae8765a0313fad407f0c737c29024c02a890c4ecc12d7771c05ab7b435e5087a7cdef4d9a0d2044603cba9d4afdaf6fd2470e729ef3a65242de71276f20d59accfa6b53a7ca0457caacb9370c09b15f7d904adefd2308be94e23669ba5f43241ffff5f438a0aa09fb2dd45a383a0cc088a72b14117e1e9b7d6889218f3ac7631e8de644c5cb76da0c675dcd4d3fb692b514851c6106e2b09e6f5661d56a0a32ae02e2efc1515c235a074949a59ff1bdba87548510d6e404ec4532f4456dfdec8e753d92fda11a3088ba0a328c6ab1ab8f70db4d23e95bb163c13ba0c508f063a5b1393a4efd7ff375f05a0c722fe3ce796998269373cbb2fc229b2bdf2c43c6c2df003309422e043ce6c03a024e69343286eec44fa4744f6907209116e5383cff3fa98fe81ba06e7e8d4366680", + "0xf90211a00e99ba2198124b8241ea304551fe973215829e2fbc0438d67922707a2a847432a0bb9ce24fd527879c5fe6dbbec1ef5a05ed9d1ca88e921d140bafbec1112f6a6aa099787fd6c7a1989229c4291ef5267335e66152ce417daea46e66d19cb6f81d1ca0e430ff4b8d5621baa5978673344e78b4d8b4df51431b6e63785267c98a24ce18a0bb3e91a825fe3d42ed270a93e9ad1aabd566c40cb28e622f7f1d7ee967c8afd6a0aa364b0056870c6507bc3262a5f851ecb13684088bdb13996d3cb2db401ce3ffa0a3732eba4c7a6e062665ab5be08acb986c3db87556fb138548cc900ff1e56995a026b088e90c9738b8ce16e853107a937a50d52726a24f9f6ce60f587762eb45a2a006c9d5bc3c064b5c1fb565bff91cace9161c64ae653a329610c1dcf34d434429a06c16df2edc70656d322d0c2403bad7d45bc790ffc3e7adeef856d98ea6afc91ba0ae05ed5d6c34b5da29c2e94d7880aeba0906f95f4ec10b132a1d4766a0701c98a01470a86aa350d1ada0c082eac75de828a851f9c8c7c4aa49b1556fe3a5574966a0334eef025100a6da1033710dd98e0475f29d3d7e397caf618ca71c336c5f4f49a0ef0b3abbebcff34d6a8a8f5cdbfbd154ab3452b58dcb09de58ec983644963675a041857e865ec38e200a13bc1a3cb71c7d69aeef7ffdee8be515c9a5b691ce091fa059edd0eb3bbec36bbf38a19802d4646c00ba821ab55fdeea12e15bab62c4e1e580", + "0xf90211a0af0c7fa65ffcb84c31e68c1cf00e1a20bf8bb497c39883e19b66a99975b03431a0c492cab3623eb7926069794c3c718733e16c5fd0d4a13fb7c752ee9809aac7ada05003cea7132aa70d6f36731d60640a90bcd8f4fd493e4540d5ab1b4943679c0ca0fd700683405b1d2306b586dd3b5b2f92f1692fae20d17cd8b8e59d09b9c6670da01db8683910e46e56e8afeb9fe2b7c35382e5a0914d7b0dd8f0e8cb9981ba7435a0fa7f75d73aa73c35824387bec81388315caa4aee3f4f5562f971beb256c62d49a0ee478e420d83f413e8568dacfd5d83f83a5dd7c45f494b504828e5dc962f0e3ea094b95444a917ac94a675681f6bf851172ad0969801a783a63a71edafed45e7a7a0a0c46586e109abe80fe50361dd582e3f143cb416828239faa43bb2b890869501a0ae051d5d43634c68bf9c97823256cc68580f194dfdbd0c301140c7ca5853430ca0660b9365bb77ec9cdc6eb95516c162dca20727c6f828dbbeb1ae110dde4d3134a09feb1b75e84ff6722e4d837bfb6d207b6ee3b21b86844a01140ce293813b49a1a0ed58a70b04efa3bdc0babe2abfa20824a75d61d52291bfdb5cf08597800764d6a020a2d5d3a83f9e35ad9fd1c448626d90af0eb3efefaa4f2f93207b4096ef5507a0fc8efc4484dcf0a54f0574de9aaade0dcff6ec3599edb9f82efb26b6566dcaeaa032f7e79856db3fd984f72bb2c93d4dab328198d355a61c975fab1f08bdb2046580" + ], + "balance": "0x0", + "codeHash": "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470", + "nonce": "0x0", + "storageHash": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "storageProof": [ + { + "key": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "proof": [ + "0xf90211a0c87222cccea2bf32759fcee9dbaacbe3ea4165dd6184af6773651c5e00e34a8ba0be90e6e5d1a67ab5587779c60ac136d6a96db62b84c04998a5f03a367346abd6a05344aa1c9ca2e3e56bf98fd718ec43728578d148e1967fbaf8bf17a2a073a0bda011a2f9312c3308640a0d6ceeae218747290f23806067456da1d444c65abae437a0b3097a108bfce79af6699da4ae3003cd4929f0b4576aad655c31cb725bde84c7a0c133d3c637e174f36a73c22b1039eb003da6374bc0929321241badb3efa3c4a9a0f13059f2301ad9862ce02e3f7f3f2c9ab78eb30583764d73654f7f1f8b1e86fda06544e3915748b18204e09df75ff20d2fa6bd8121e2e669699012d54590383d6fa070e3a8e093691581d58fadb560b510262a758037632cd8670d3a36df828976b7a062a88a2900544dc76a32255a6b2b2a2eef8fa68279700c00adc7508286702552a0a474aeebd5603dfce46a6ecd1ecd519068dc034a544fde03ac42d4018e60a334a0b7d528fc41c8fdc8ea18c6e7d0099270c777ec1403cf879d1f5134bdc12a6c6ca04440f1242e42c5bfa7c536591ab89c8e84bea417435871c32eef1e25295b20daa06a5dcfe3cc84cff9d3e3c3ae868cfba8f0dd111a90c3f85869dab5b893f96643a026b2fb9dd7d08b0ed2f1c44fbf875011412a384f86f751c92e1013248d4aa371a0c75597b2b789fc4e939b71937390ce9d7d53159431328ac52180eef08ef200f280", + "0xf90191a0f0c5b800b542001597f2b7a8e106ac0e2849d2cc1df1727ac35c4ea3965f1c9180a08537f2e248702a6ae2a57e9110a5740f5772c876389739ac90debd6a0692713ea00b3a26a05b5494fb3ff6f0b3897688a5581066b20b07ebab9252d169d928717fa0a9a54d84976d134d6dba06a65064c7f3a964a75947d452db6f6bb4b6c47b43aaa01e2a1ed3d1572b872bbf09ee44d2ed737da31f01de3c0f4b4e1f046740066461a076f251d160b9a02eb0b5c1d83b61c9cdd4f37361705e79a45529bf49801fb824a0774a01a624cb14a50d17f2fe4b7ae6af8a67bbb029177ccc3dd729a734484d3ea05921b8a19aebe4fff5a36071e311778f9b93459183fdf7f6d870b401fa25dcbba0c8d71dd13d2806e2865a5c2cfa447f626471bf0b66182a8fd07230434e1cad2680a0e9864fdfaf3693b2602f56cd938ccd494b8634b1f91800ef02203a3609ca4c21a0c69d174ad6b6e58b0bd05914352839ec60915cd066dd2bee2a48016139687f21a0513dd5514fd6bad56871711441d38de2821cc6913cb192416b0385f025650731808080" + ], + "value": "0x1" + } + ] + } + } + } + ], + "tags": [ + { + "name": "Ethereum API", + "description": "Ethereum Node JSON-RPC method" + }, + { + "name": "Multichain API", + "description": "Multichain 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": true, + "schema": { + "$ref": "#/components/schemas/BlockNumberOrTagOrHash" + } + } + ], + "result": { + "name": "Value", + "schema": { + "$ref": "#/components/schemas/bytes" + } + }, + "examples": [ + { + "name": "eth_getStorageAt example", + "params": [ + { + "name": "Address", + "value": "0xfe3b557e8fb62b89f4916b721be55ceb828dbd73" + }, + { + "name": "Storage slot", + "value": "0x0" + }, + { + "name": "Block", + "value": "latest" + } + ], + "result": { + "name": "Value", + "value": "0x0000000000000000000000000000000000000000000000000000000000000000" + } + } + ], + "tags": [ + { + "name": "Ethereum API", + "description": "Ethereum Node JSON-RPC method" + }, + { + "name": "Multichain API", + "description": "Multichain 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" + } + ] + } + }, + "examples": [ + { + "name": "eth_getTransactionByBlockHashAndIndex example", + "params": [ + { + "name": "Block hash", + "value": "0xbf137c3a7a1ebdfac21252765e5d7f40d115c2757e4a4abee929be88c624fdb7" + }, + { + "name": "Transaction index", + "value": "0x2" + } + ], + "result": { + "name": "Transaction information", + "value": { + "blockHash": "0x510efccf44a192e6e34bcb439a1947e24b86244280762cbb006858c237093fda", + "blockNumber": "0x422", + "chainId": 2018, + "from": "0xfe3b557e8fb62b89f4916b721be55ceb828dbd73", + "gas": "0x5208", + "gasPrice": "0x3b9aca00", + "hash": "0xa52be92809541220ee0aaaede6047d9a6c5d0cd96a517c854d944ee70a0ebb44", + "input": "0x", + "nonce": "0x1", + "to": "0x627306090abab3a6e1400e9345bc60c78a8bef57", + "transactionIndex": "0x0", + "value": "0x4e1003b28d9280000", + "v": "0xfe7", + "r": "0x84caf09aefbd5e539295acc67217563438a4efb224879b6855f56857fa2037d3", + "s": "0x5e863be3829812c81439f0ae9d8ecb832b531d651fb234c848d1bf45e62be8b9" + } + } + } + ], + "tags": [ + { + "name": "Ethereum API", + "description": "Ethereum Node JSON-RPC method" + }, + { + "name": "Multichain API", + "description": "Multichain 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" + } + ] + } + }, + "examples": [ + { + "name": "eth_getTransactionByBlockNumberAndIndex example", + "params": [ + { + "name": "Block", + "value": "0x1442e" + }, + { + "name": "Transaction index", + "value": "0x2" + } + ], + "result": { + "name": "Transaction information", + "value": { + "blockHash": "0x510efccf44a192e6e34bcb439a1947e24b86244280762cbb006858c237093fda", + "blockNumber": "0x422", + "chainId": 2018, + "from": "0xfe3b557e8fb62b89f4916b721be55ceb828dbd73", + "gas": "0x5208", + "gasPrice": "0x3b9aca00", + "hash": "0xa52be92809541220ee0aaaede6047d9a6c5d0cd96a517c854d944ee70a0ebb44", + "input": "0x", + "nonce": "0x1", + "to": "0x627306090abab3a6e1400e9345bc60c78a8bef57", + "transactionIndex": "0x0", + "value": "0x4e1003b28d9280000", + "v": "0xfe7", + "r": "0x84caf09aefbd5e539295acc67217563438a4efb224879b6855f56857fa2037d3", + "s": "0x5e863be3829812c81439f0ae9d8ecb832b531d651fb234c848d1bf45e62be8b9" + } + } + } + ], + "tags": [ + { + "name": "Ethereum API", + "description": "Ethereum Node JSON-RPC method" + }, + { + "name": "Multichain API", + "description": "Multichain 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" + } + ] + } + }, + "examples": [ + { + "name": "eth_getTransactionByHash example", + "params": [ + { + "name": "Transaction hash", + "value": "0xa52be92809541220ee0aaaede6047d9a6c5d0cd96a517c854d944ee70a0ebb44" + } + ], + "result": { + "name": "Transaction information", + "value": { + "blockHash": "0x510efccf44a192e6e34bcb439a1947e24b86244280762cbb006858c237093fda", + "blockNumber": "0x422", + "chainId": 2018, + "from": "0xfe3b557e8fb62b89f4916b721be55ceb828dbd73", + "gas": "0x5208", + "gasPrice": "0x3b9aca00", + "hash": "0xa52be92809541220ee0aaaede6047d9a6c5d0cd96a517c854d944ee70a0ebb44", + "input": "0x", + "nonce": "0x1", + "to": "0x627306090abab3a6e1400e9345bc60c78a8bef57", + "transactionIndex": "0x0", + "value": "0x4e1003b28d9280000", + "v": "0xfe7", + "r": "0x84caf09aefbd5e539295acc67217563438a4efb224879b6855f56857fa2037d3", + "s": "0x5e863be3829812c81439f0ae9d8ecb832b531d651fb234c848d1bf45e62be8b9" + } + } + } + ], + "tags": [ + { + "name": "Ethereum API", + "description": "Ethereum Node JSON-RPC method" + }, + { + "name": "Multichain API", + "description": "Multichain 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": true, + "schema": { + "$ref": "#/components/schemas/BlockNumberOrTagOrHash" + } + } + ], + "result": { + "name": "Transaction count", + "schema": { + "$ref": "#/components/schemas/uint" + } + }, + "examples": [ + { + "name": "eth_getTransactionCount example", + "params": [ + { + "name": "Address", + "value": "0xc94770007dda54cF92009BFF0dE90c06F603a09f" + }, + { + "name": "Block", + "value": "latest" + } + ], + "result": { + "name": "Transaction count", + "value": "0x1" + } + } + ], + "tags": [ + { + "name": "Ethereum API", + "description": "Ethereum Node JSON-RPC method" + }, + { + "name": "Multichain API", + "description": "Multichain 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" + } + ] + } + }, + "examples": [ + { + "name": "eth_getTransactionReceipt example", + "params": [ + { + "name": "Transaction hash", + "value": "0x504ce587a65bdbdb6414a0c6c16d86a04dd79bfcc4f2950eec9634b30ce5370f" + } + ], + "result": { + "name": "Receipt information", + "value": { + "blockHash": "0xe7212a92cfb9b06addc80dec2a0dfae9ea94fd344efeb157c41e12994fcad60a", + "blockNumber": "0x50", + "contractAddress": null, + "cumulativeGasUsed": "0x5208", + "from": "0x627306090abab3a6e1400e9345bc60c78a8bef57", + "gasUsed": "0x5208", + "blobGasUsed": "0x20000", + "effectiveGasPrice": "0x1", + "blobGasPrice": "0x3", + "logs": [], + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "status": "0x1", + "to": "0xf17f52151ebef6c7334fad080c5704d77216b732", + "transactionHash": "0xc00e97af59c6f88de163306935f7682af1a34c67245e414537d02e422815efc3", + "transactionIndex": "0x0" + } + } + } + ], + "tags": [ + { + "name": "Ethereum API", + "description": "Ethereum Node JSON-RPC method" + }, + { + "name": "Multichain API", + "description": "Multichain 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" + } + ] + } + }, + "examples": [ + { + "name": "eth_getUncleCountByBlockHash example", + "params": [ + { + "name": "Block hash", + "value": "0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35" + } + ], + "result": { + "name": "Uncle count", + "value": "0x1" + } + } + ], + "tags": [ + { + "name": "Ethereum API", + "description": "Ethereum Node JSON-RPC method" + }, + { + "name": "Multichain API", + "description": "Multichain JSON-RPC method" + } + ] + }, + { + "name": "eth_getUncleCountByBlockNumber", + "summary": "Returns the number of transactions in a block matching the given block number.", + "params": [ + { + "name": "Block", + "schema": { + "$ref": "#/components/schemas/BlockNumberOrTag" + } + } + ], + "result": { + "name": "Uncle count", + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/notFound" + }, + { + "title": "Uncle count", + "$ref": "#/components/schemas/uint" + } + ] + } + }, + "examples": [ + { + "name": "eth_getUncleCountByBlockNumber example", + "params": [ + { + "name": "Block", + "value": "0xe8" + } + ], + "result": { + "name": "Uncle count", + "value": "0x1" + } + } + ], + "tags": [ + { + "name": "Ethereum API", + "description": "Ethereum Node JSON-RPC method" + }, + { + "name": "Multichain API", + "description": "Multichain JSON-RPC method" + } + ] + }, + { + "name": "eth_newBlockFilter", + "summary": "Creates a filter in the node, to notify when a new block arrives.", + "params": [], + "result": { + "name": "Filter identifier", + "schema": { + "$ref": "#/components/schemas/uint" + } + }, + "examples": [ + { + "name": "eth_newBlockFilter example", + "params": [], + "result": { + "name": "Filter identifier", + "value": "0x01" + } + } + ], + "tags": [ + { + "name": "Ethereum API", + "description": "Ethereum Node JSON-RPC method" + }, + { + "name": "Multichain API", + "description": "Multichain JSON-RPC method" + } + ] + }, + { + "name": "eth_newFilter", + "summary": "Creates a filter object, based on filter options, to notify when the state changes (logs).", + "params": [ + { + "name": "Filter", + "schema": { + "$ref": "#/components/schemas/Filter" + } + } + ], + "result": { + "name": "Filter identifier", + "schema": { + "$ref": "#/components/schemas/uint" + } + }, + "examples": [ + { + "name": "eth_newFilter example", + "params": [ + { + "name": "Filter", + "value": { + "fromBlock": "0x137d3c2", + "toBlock": "0x137d3c3", + "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", + "topics": [] + } + } + ], + "result": { + "name": "Filter identifier", + "value": "0x01" + } + } + ], + "tags": [ + { + "name": "Ethereum API", + "description": "Ethereum Node JSON-RPC method" + }, + { + "name": "Multichain API", + "description": "Multichain JSON-RPC method" + } + ] + }, + { + "name": "eth_newPendingTransactionFilter", + "summary": "Creates a filter in the node, to notify when new pending transactions arrive.", + "params": [], + "result": { + "name": "Filter identifier", + "schema": { + "$ref": "#/components/schemas/uint" + } + }, + "examples": [ + { + "name": "eth_newPendingTransactionFilter example", + "params": [], + "result": { + "name": "Filter identifier", + "value": "0x01" + } + } + ], + "tags": [ + { + "name": "Ethereum API", + "description": "Ethereum Node JSON-RPC method" + }, + { + "name": "Multichain API", + "description": "Multichain JSON-RPC method" + } + ] + }, + { + "name": "eth_sendRawTransaction", + "summary": "Submits a raw transaction. You can create and sign a transaction externally using a library such as [web3.js](https://web3js.readthedocs.io/) or [ethers.js](https://docs.ethers.org/). For [EIP-4844](https://eips.ethereum.org/EIPS/eip-4844) transactions, the raw form must be the network form. This means it includes the blobs, KZG commitments, and KZG proofs.", + "params": [ + { + "name": "Transaction", + "required": true, + "schema": { + "$ref": "#/components/schemas/bytes" + } + } + ], + "result": { + "name": "Transaction hash", + "schema": { + "$ref": "#/components/schemas/hash32" + } + }, + "examples": [ + { + "name": "eth_sendRawTransaction example", + "params": [ + { + "name": "Transaction", + "value": "0xf869018203e882520894f17f52151ebef6c7334fad080c5704d77216b732881bc16d674ec80000801ba02da1c48b670996dcb1f447ef9ef00b33033c48a4fe938f420bec3e56bfd24071a062e0aa78a81bf0290afbc3a9d8e9a068e6d74caa66c5e0fa8a46deaae96b0833" + } + ], + "result": { + "name": "Transaction hash", + "value": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" + } + } + ], + "tags": [ + { + "name": "Ethereum API", + "description": "Ethereum Node JSON-RPC method" + }, + { + "name": "Multichain API", + "description": "Multichain JSON-RPC method" + } + ] + }, + { + "name": "eth_syncing", + "summary": "Returns an object with data about the sync status or false.", + "params": [], + "result": { + "name": "Syncing status", + "schema": { + "$ref": "#/components/schemas/SyncingStatus" + } + }, + "examples": [ + { + "name": "eth_syncing example", + "params": [], + "result": { + "name": "Syncing status", + "value": { + "startingBlock": "0x0", + "currentBlock": "0x1518", + "highestBlock": "0x9567a3" + } + } + } + ], + "tags": [ + { + "name": "Ethereum API", + "description": "Ethereum Node JSON-RPC method" + }, + { + "name": "Multichain API", + "description": "Multichain JSON-RPC method" + } + ] + }, + { + "name": "eth_uninstallFilter", + "summary": "Uninstalls a filter with given id.", + "params": [ + { + "name": "Filter identifier", + "schema": { + "$ref": "#/components/schemas/uint" + } + } + ], + "result": { + "name": "Success", + "schema": { + "type": "boolean" + } + }, + "examples": [ + { + "name": "eth_uninstallFilter example", + "params": [ + { + "name": "Filter identifier", + "value": "0x01" + } + ], + "result": { + "name": "Success", + "value": true + } + } + ], + "tags": [ + { + "name": "Ethereum API", + "description": "Ethereum Node JSON-RPC method" + }, + { + "name": "Multichain API", + "description": "Multichain JSON-RPC method" + } + ] + } + ], + "components": { + "errors": { + "UserRejected": { + "code": 4001, + "message": "User rejected the request." + }, + "InvalidParams": { + "code": -32602, + "message": "The wallet cannot parse the request." + }, + "Unauthorized": { + "code": 4100, + "message": "The requested account and/or method has not been authorized by the user." + } + }, + "schemas": { + "TypedData": { + "title": "Typed data", + "description": "Object containing information about the typed data to sign.", + "type": "object", + "required": ["types", "primaryType", "domain", "message"], + "properties": { + "types": { + "type": "object", + "description": "Object containing type information.", + "required": ["EIP712Domain"], + "properties": { + "EIP712Domain": { + "type": "array", + "items": { + "type": "object", + "title": "Domain separator value", + "description": "Object containing information about the domain separator value.", + "properties": { + "name": { + "type": "string", + "description": "Name of the domain separator value." + }, + "type": { + "type": "string", + "description": "Data type of the domain separator value." + } + } + }, + "description": "An array specifying one or more of the following domain separator values:

" + } + }, + "additionalProperties": { + "type": "array", + "required": ["name", "type"], + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "type": { + "type": "string" + } + } + } + } + }, + "domain": { + "type": "object", + "description": "Object containing the domain separator values specified in the `EIP712Domain` type." + }, + "primaryType": { + "type": "string", + "description": "The primary type of the message." + }, + "message": { + "type": "object", + "description": "The message you're proposing the user to sign." + } + } + }, + "SendCallsParameter": { + "title": "Calls", + "description": "An object containing information about a batch of calls.", + "type": "object", + "required": ["version", "from", "chainId", "atomicRequired", "calls"], + "properties": { + "version": { + "description": "The version of the API format. This must be `2.0.0`.", + "type": "string" + }, + "id": { + "description": "The ID of the batch of calls.", + "type": "string" + }, + "from": { + "description": "The sender's address.", + "type": "string", + "pattern": "^0x[0-9a-fA-F]{40}$" + }, + "chainId": { + "description": "The [EIP-155](https://eips.ethereum.org/EIPS/eip-155) chain ID of the calls. This must match the currently selected network in the wallet.", + "type": "string", + "pattern": "^0x([1-9a-f]+[0-9a-f]*|0)$" + }, + "atomicRequired": { + "description": "`true` if the wallet must execute all calls atomically. If `false`, the wallet may execute the calls sequentially without atomicity. If `false` and the wallet is capable of executing the calls atomically, it may do so.", + "type": "boolean" + }, + "calls": { + "type": "array", + "description": "An array of call objects.", + "items": { + "title": "Call", + "description": "An object containing information about the call.", + "type": "object", + "properties": { + "to": { + "description": "The address of the call's recipient.", + "type": "string", + "pattern": "^0x[0-9a-fA-F]{40}$" + }, + "data": { + "description": "The data to send with the call.", + "type": "string", + "pattern": "^0x[0-9a-f]*$" + }, + "value": { + "description": "The value to send with the call.", + "type": "string", + "pattern": "^0x([1-9a-f]+[0-9a-f]*|0)$" + }, + "capabilities": { + "description": "Dapps can use this object to communicate with the wallet about supported capabilities.", + "type": "object" + } + } + } + }, + "capabilities": { + "description": "Dapps can use this object to communicate with the wallet about supported capabilities.", + "type": "object" + } + } + }, + "AddEthereumChainParameter": { + "title": "Chain", + "description": "Object containing information about the chain to add.", + "type": "object", + "required": ["chainId", "chainName", "nativeCurrency", "rpcUrls"], + "properties": { + "chainId": { + "description": "The chain ID as a `0x`-prefixed hexadecimal string, per the `eth_chainId` method. MetaMask compares this chain ID value with the `eth_chainId` return value. If these values aren't identical, MetaMask rejects the request.", + "type": "string" + }, + "blockExplorerUrls": { + "description": "(Optional) An array of one or more URLs pointing to block explorer sites for the chain.", + "type": "array", + "items": { + "type": "string", + "description": "Block explorer URL." + } + }, + "chainName": { + "description": "A human-readable name for the chain.", + "type": "string" + }, + "iconUrls": { + "description": "(Optional) An array of one or more URLs pointing to icons that can be used to visually identify the chain. Note: MetaMask will not currently display these icons. You can still include icon URLs so they are used if MetaMask incorporates them into the display of custom networks in the future.", + "type": "array", + "items": { + "format": "uri", + "type": "string", + "description": "Icon URL." + } + }, + "nativeCurrency": { + "$ref": "#/components/schemas/NativeCurrency" + }, + "rpcUrls": { + "description": "An array of one or more URLs pointing to RPC endpoints that can be used to communicate with the chain. At least one item is required, and only the first item is used.", + "type": "array", + "minItems": 1, + "items": { + "format": "uri", + "type": "string", + "description": "RPC URL." + } + } + } + }, + "NativeCurrency": { + "title": "NativeCurrency", + "type": "object", + "description": "An object containing information about the native currency of the chain.", + "required": ["decimals", "symbol"], + "properties": { + "decimals": { + "description": "A non-negative integer representing the number of decimals the native currency uses.", + "minimum": 0, + "type": "integer" + }, + "name": { + "description": "A human-readable name of the native currency.", + "type": "string" + }, + "symbol": { + "description": "A human-readable symbol of the native currency.", + "type": "string" + } + } + }, + "Caveats": { + "title": "Caveats", + "description": "An array of caveats that specify restrictions on the permission.", + "type": "array", + "items": { + "title": "Caveat", + "description": "Object containing information about the caveat.", + "type": "object", + "properties": { + "type": { + "title": "Type", + "type": "string", + "description": "Type of caveat." + }, + "value": { + "title": "CaveatValue", + "description": "Value of the caveat." + }, + "name": { + "title": "Name", + "type": "string", + "description": "Name of the caveat." + } + } + } + }, + "Permission": { + "title": "Permission", + "description": "Object containing information about the permission.", + "type": "object", + "properties": { + "id": { + "description": "The permission ID.", + "type": "string" + }, + "parentCapability": { + "description": "The name of the permission being granted. For example, `eth_accounts` or `endowment:permitted-chains`.", + "type": "string" + }, + "invoker": { + "description": "The URI of the dapp being granted this permission.", + "type": "string" + }, + "caveats": { + "$ref": "#/components/schemas/Caveats" + }, + "date": { + "description": "The timestamp of the permission request.", + "type": "number" + } + } + }, + "PermissionsList": { + "title": "Permissions list", + "description": "An array of the user's permissions.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Permission" + } + }, + "address": { + "title": "hex encoded address", + "type": "string", + "pattern": "^0x[0-9a-fA-F]{40}$" + }, + "addresses": { + "title": "hex encoded address", + "type": "array", + "items": { + "$ref": "#/components/schemas/address" + } + }, + "byte": { + "title": "hex encoded byte", + "type": "string", + "pattern": "^0x([0-9a-fA-F]?){1,2}$" + }, + "bytes": { + "title": "hex encoded bytes", + "type": "string", + "pattern": "^0x[0-9a-f]*$" + }, + "bytesMax32": { + "title": "32 hex encoded bytes", + "type": "string", + "pattern": "^0x[0-9a-f]{0,64}$" + }, + "bytes8": { + "title": "8 hex encoded bytes", + "type": "string", + "pattern": "^0x[0-9a-f]{16}$" + }, + "bytes32": { + "title": "32 hex encoded bytes", + "type": "string", + "pattern": "^0x[0-9a-f]{64}$" + }, + "bytes48": { + "title": "48 hex encoded bytes", + "type": "string", + "pattern": "^0x[0-9a-f]{96}$" + }, + "bytes96": { + "title": "96 hex encoded bytes", + "type": "string", + "pattern": "^0x[0-9a-f]{192}$" + }, + "bytes256": { + "title": "256 hex encoded bytes", + "type": "string", + "pattern": "^0x[0-9a-f]{512}$" + }, + "bytes65": { + "title": "65 hex encoded bytes", + "type": "string", + "pattern": "^0x[0-9a-f]{130}$" + }, + "ratio": { + "title": "normalized ratio", + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "uint": { + "title": "hex encoded unsigned integer", + "type": "string", + "pattern": "^0x([1-9a-f]+[0-9a-f]*|0)$" + }, + "uint64": { + "title": "hex encoded 64 bit unsigned integer", + "type": "string", + "pattern": "^0x([1-9a-f]+[0-9a-f]{0,15})|0$" + }, + "uint256": { + "title": "hex encoded 256 bit unsigned integer", + "type": "string", + "pattern": "^0x([1-9a-f]+[0-9a-f]{0,31})|0$" + }, + "hash32": { + "title": "32 byte hex value", + "type": "string", + "pattern": "^0x[0-9a-f]{64}$" + }, + "notFound": { + "title": "Not Found (null)", + "type": "null" + }, + "Block": { + "title": "Block object", + "type": "object", + "required": [ + "hash", + "parentHash", + "sha3Uncles", + "miner", + "stateRoot", + "transactionsRoot", + "receiptsRoot", + "logsBloom", + "number", + "gasLimit", + "gasUsed", + "timestamp", + "extraData", + "mixHash", + "nonce", + "size", + "transactions", + "uncles" + ], + "additionalProperties": false, + "properties": { + "hash": { + "title": "Hash", + "$ref": "#/components/schemas/hash32" + }, + "parentHash": { + "title": "Parent block hash", + "$ref": "#/components/schemas/hash32" + }, + "sha3Uncles": { + "title": "Ommers hash", + "$ref": "#/components/schemas/hash32" + }, + "miner": { + "title": "Coinbase", + "$ref": "#/components/schemas/address" + }, + "stateRoot": { + "title": "State root", + "$ref": "#/components/schemas/hash32" + }, + "transactionsRoot": { + "title": "Transactions root", + "$ref": "#/components/schemas/hash32" + }, + "receiptsRoot": { + "title": "Receipts root", + "$ref": "#/components/schemas/hash32" + }, + "logsBloom": { + "title": "Bloom filter", + "$ref": "#/components/schemas/bytes256" + }, + "difficulty": { + "title": "Difficulty", + "$ref": "#/components/schemas/uint" + }, + "number": { + "title": "Number", + "$ref": "#/components/schemas/uint" + }, + "gasLimit": { + "title": "Gas limit", + "$ref": "#/components/schemas/uint" + }, + "gasUsed": { + "title": "Gas used", + "$ref": "#/components/schemas/uint" + }, + "timestamp": { + "title": "Timestamp", + "$ref": "#/components/schemas/uint" + }, + "extraData": { + "title": "Extra data", + "$ref": "#/components/schemas/bytes" + }, + "mixHash": { + "title": "Mix hash", + "$ref": "#/components/schemas/hash32" + }, + "nonce": { + "title": "Nonce", + "$ref": "#/components/schemas/bytes8" + }, + "baseFeePerGas": { + "title": "Base fee per gas", + "$ref": "#/components/schemas/uint" + }, + "withdrawalsRoot": { + "title": "Withdrawals root", + "$ref": "#/components/schemas/hash32" + }, + "blobGasUsed": { + "title": "Blob gas used", + "$ref": "#/components/schemas/uint" + }, + "excessBlobGas": { + "title": "Excess blob gas", + "$ref": "#/components/schemas/uint" + }, + "parentBeaconBlockRoot": { + "title": "Parent Beacon Block Root", + "$ref": "#/components/schemas/hash32" + }, + "size": { + "title": "Block size", + "$ref": "#/components/schemas/uint" + }, + "transactions": { + "anyOf": [ + { + "title": "Transaction hashes", + "type": "array", + "items": { + "$ref": "#/components/schemas/hash32" + } + }, + { + "title": "Full transactions", + "type": "array", + "items": { + "$ref": "#/components/schemas/TransactionInfo" + } + } + ] + }, + "withdrawals": { + "title": "Withdrawals", + "type": "array", + "items": { + "$ref": "#/components/schemas/Withdrawal" + } + }, + "uncles": { + "title": "Uncles", + "type": "array", + "items": { + "$ref": "#/components/schemas/hash32" + } + } + } + }, + "BlockTag": { + "title": "Block tag", + "type": "string", + "enum": ["earliest", "finalized", "safe", "latest", "pending"], + "description": "`earliest`: The lowest numbered block the client has available; `finalized`: The most recent crypto-economically secure block, cannot be re-orged outside of manual intervention driven by community coordination; `safe`: The most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions; `latest`: The most recent block in the canonical chain observed by the client, this block may be re-orged out of the canonical chain even under healthy/normal conditions; `pending`: A sample next block built by the client on top of `latest` and containing the set of transactions usually taken from local mempool. Before the merge transition is finalized, any call querying for `finalized` or `safe` block MUST be responded to with `-39001: Unknown block` error" + }, + "BlockNumberOrTag": { + "title": "Block number or tag", + "oneOf": [ + { + "title": "Block number", + "$ref": "#/components/schemas/uint" + }, + { + "title": "Block tag", + "$ref": "#/components/schemas/BlockTag" + } + ] + }, + "BlockNumberOrTagOrHash": { + "title": "Block number, tag, or block hash", + "anyOf": [ + { + "title": "Block number", + "$ref": "#/components/schemas/uint" + }, + { + "title": "Block tag", + "$ref": "#/components/schemas/BlockTag" + }, + { + "title": "Block hash", + "$ref": "#/components/schemas/hash32" + } + ] + }, + "BadBlock": { + "title": "Bad block", + "type": "object", + "required": ["block", "hash", "rlp"], + "additionalProperties": false, + "properties": { + "block": { + "title": "Block", + "$ref": "#/components/schemas/Block" + }, + "hash": { + "title": "Hash", + "$ref": "#/components/schemas/hash32" + }, + "rlp": { + "title": "RLP", + "$ref": "#/components/schemas/bytes" + } + } + }, + "SyncingStatus": { + "title": "Syncing status", + "oneOf": [ + { + "title": "Syncing progress", + "type": "object", + "additionalProperties": false, + "properties": { + "startingBlock": { + "title": "Starting block", + "$ref": "#/components/schemas/uint" + }, + "currentBlock": { + "title": "Current block", + "$ref": "#/components/schemas/uint" + }, + "highestBlock": { + "title": "Highest block", + "$ref": "#/components/schemas/uint" + } + } + }, + { + "title": "Not syncing", + "description": "Should always return false if not syncing.", + "type": "boolean" + } + ] + }, + "FilterResults": { + "title": "Filter results", + "oneOf": [ + { + "title": "new block or transaction hashes", + "type": "array", + "items": { + "$ref": "#/components/schemas/hash32" + } + }, + { + "title": "new logs", + "type": "array", + "items": { + "$ref": "#/components/schemas/Log" + } + } + ] + }, + "Filter": { + "title": "filter", + "type": "object", + "additionalProperties": false, + "properties": { + "fromBlock": { + "title": "from block", + "$ref": "#/components/schemas/uint" + }, + "toBlock": { + "title": "to block", + "$ref": "#/components/schemas/uint" + }, + "address": { + "title": "Address(es)", + "oneOf": [ + { + "title": "Any Address", + "type": "null" + }, + { + "title": "Address", + "$ref": "#/components/schemas/address" + }, + { + "title": "Addresses", + "$ref": "#/components/schemas/addresses" + } + ] + }, + "topics": { + "title": "Topics", + "$ref": "#/components/schemas/FilterTopics" + } + } + }, + "FilterTopics": { + "title": "Filter Topics", + "oneOf": [ + { + "title": "Any Topic Match", + "type": "null" + }, + { + "title": "Specified Filter Topics", + "type": "array", + "items": { + "$ref": "#/components/schemas/FilterTopic" + } + } + ] + }, + "FilterTopic": { + "title": "Filter Topic List Entry", + "oneOf": [ + { + "title": "Single Topic Match", + "$ref": "#/components/schemas/bytes32" + }, + { + "title": "Multiple Topic Match", + "type": "array", + "items": { + "$ref": "#/components/schemas/bytes32" + } + } + ] + }, + "Log": { + "title": "log", + "type": "object", + "required": ["transactionHash"], + "additionalProperties": false, + "properties": { + "removed": { + "title": "removed", + "type": "boolean" + }, + "logIndex": { + "title": "log index", + "$ref": "#/components/schemas/uint" + }, + "transactionIndex": { + "title": "transaction index", + "$ref": "#/components/schemas/uint" + }, + "transactionHash": { + "title": "transaction hash", + "$ref": "#/components/schemas/hash32" + }, + "blockHash": { + "title": "block hash", + "$ref": "#/components/schemas/hash32" + }, + "blockNumber": { + "title": "block number", + "$ref": "#/components/schemas/uint" + }, + "address": { + "title": "address", + "$ref": "#/components/schemas/address" + }, + "data": { + "title": "data", + "$ref": "#/components/schemas/bytes" + }, + "topics": { + "title": "topics", + "type": "array", + "items": { + "$ref": "#/components/schemas/bytes32" + } + } + } + }, + "ReceiptInfo": { + "type": "object", + "title": "Receipt information", + "required": [ + "blockHash", + "blockNumber", + "from", + "cumulativeGasUsed", + "gasUsed", + "logs", + "logsBloom", + "transactionHash", + "transactionIndex", + "effectiveGasPrice" + ], + "additionalProperties": false, + "properties": { + "type": { + "title": "type", + "$ref": "#/components/schemas/byte" + }, + "transactionHash": { + "title": "transaction hash", + "$ref": "#/components/schemas/hash32" + }, + "transactionIndex": { + "title": "transaction index", + "$ref": "#/components/schemas/uint" + }, + "blockHash": { + "title": "block hash", + "$ref": "#/components/schemas/hash32" + }, + "blockNumber": { + "title": "block number", + "$ref": "#/components/schemas/uint" + }, + "from": { + "title": "from", + "$ref": "#/components/schemas/address" + }, + "to": { + "title": "to", + "description": "Address of the receiver or null in a contract creation transaction.", + "oneOf": [ + { + "title": "Contract Creation (null)", + "type": "null" + }, + { + "title": "Recipient Address", + "$ref": "#/components/schemas/address" + } + ] + }, + "cumulativeGasUsed": { + "title": "cumulative gas used", + "description": "The sum of gas used by this transaction and all preceding transactions in the same block.", + "$ref": "#/components/schemas/uint" + }, + "gasUsed": { + "title": "gas used", + "description": "The amount of gas used for this specific transaction alone.", + "$ref": "#/components/schemas/uint" + }, + "blobGasUsed": { + "title": "blob gas used", + "description": "The amount of blob gas used for this specific transaction. Only specified for blob transactions as defined by EIP-4844.", + "$ref": "#/components/schemas/uint" + }, + "contractAddress": { + "title": "contract address", + "description": "The contract address created, if the transaction was a contract creation, otherwise null.", + "oneOf": [ + { + "$ref": "#/components/schemas/address" + }, + { + "title": "Null", + "type": "null" + } + ] + }, + "logs": { + "title": "logs", + "type": "array", + "items": { + "$ref": "#/components/schemas/Log" + } + }, + "logsBloom": { + "title": "logs bloom", + "$ref": "#/components/schemas/bytes256" + }, + "root": { + "title": "state root", + "description": "The post-transaction state root. Only specified for transactions included before the Byzantium upgrade.", + "$ref": "#/components/schemas/hash32" + }, + "status": { + "title": "status", + "description": "Either 1 (success) or 0 (failure). Only specified for transactions included after the Byzantium upgrade.", + "$ref": "#/components/schemas/uint" + }, + "effectiveGasPrice": { + "title": "effective gas price", + "description": "The actual value per gas deducted from the sender's account. Before EIP-1559, this is equal to the transaction's gas price. After, it is equal to baseFeePerGas + min(maxFeePerGas - baseFeePerGas, maxPriorityFeePerGas).", + "$ref": "#/components/schemas/uint" + }, + "blobGasPrice": { + "title": "blob gas price", + "description": "The actual value per gas deducted from the sender's account for blob gas. Only specified for blob transactions as defined by EIP-4844.", + "$ref": "#/components/schemas/uint" + } + } + }, + "AccountProof": { + "title": "Account proof", + "type": "object", + "required": [ + "address", + "accountProof", + "balance", + "codeHash", + "nonce", + "storageHash", + "storageProof" + ], + "additionalProperties": false, + "properties": { + "address": { + "title": "address", + "$ref": "#/components/schemas/address" + }, + "accountProof": { + "title": "accountProof", + "type": "array", + "items": { + "$ref": "#/components/schemas/bytes" + } + }, + "balance": { + "title": "balance", + "$ref": "#/components/schemas/uint256" + }, + "codeHash": { + "title": "codeHash", + "$ref": "#/components/schemas/hash32" + }, + "nonce": { + "title": "nonce", + "$ref": "#/components/schemas/uint64" + }, + "storageHash": { + "title": "storageHash", + "$ref": "#/components/schemas/hash32" + }, + "storageProof": { + "title": "Storage proofs", + "type": "array", + "items": { + "$ref": "#/components/schemas/StorageProof" + } + } + } + }, + "StorageProof": { + "title": "Storage proof", + "type": "object", + "required": ["key", "value", "proof"], + "additionalProperties": false, + "properties": { + "key": { + "title": "key", + "$ref": "#/components/schemas/bytesMax32" + }, + "value": { + "title": "value", + "$ref": "#/components/schemas/uint256" + }, + "proof": { + "title": "proof", + "type": "array", + "items": { + "$ref": "#/components/schemas/bytes" + } + } + } + }, + "Transaction4844Unsigned": { + "type": "object", + "title": "EIP-4844 transaction.", + "required": [ + "type", + "nonce", + "to", + "gas", + "value", + "input", + "maxPriorityFeePerGas", + "maxFeePerGas", + "maxFeePerBlobGas", + "accessList", + "blobVersionedHashes", + "chainId" + ], + "properties": { + "type": { + "title": "type", + "$ref": "#/components/schemas/byte" + }, + "nonce": { + "title": "nonce", + "$ref": "#/components/schemas/uint" + }, + "to": { + "title": "to address", + "$ref": "#/components/schemas/address" + }, + "gas": { + "title": "gas limit", + "$ref": "#/components/schemas/uint" + }, + "value": { + "title": "value", + "$ref": "#/components/schemas/uint" + }, + "input": { + "title": "input data", + "$ref": "#/components/schemas/bytes" + }, + "maxPriorityFeePerGas": { + "title": "max priority fee per gas", + "description": "Maximum fee per gas the sender is willing to pay to miners in wei", + "$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", + "$ref": "#/components/schemas/uint" + }, + "maxFeePerBlobGas": { + "title": "max fee per blob gas", + "description": "The maximum total fee per gas the sender is willing to pay for blob gas in wei", + "$ref": "#/components/schemas/uint" + }, + "accessList": { + "title": "accessList", + "description": "EIP-2930 access list", + "$ref": "#/components/schemas/AccessList" + }, + "blobVersionedHashes": { + "title": "blobVersionedHashes", + "description": "List of versioned blob hashes associated with the transaction's EIP-4844 data blobs.", + "type": "array", + "items": { + "$ref": "#/components/schemas/hash32" + } + }, + "chainId": { + "title": "chainId", + "description": "Chain ID that this transaction is valid on.", + "$ref": "#/components/schemas/uint" + } + } + }, + "AccessListEntry": { + "title": "Access list entry", + "type": "object", + "additionalProperties": false, + "properties": { + "address": { + "$ref": "#/components/schemas/address" + }, + "storageKeys": { + "type": "array", + "items": { + "$ref": "#/components/schemas/hash32" + } + } + } + }, + "AccessList": { + "title": "Access list", + "type": "array", + "items": { + "$ref": "#/components/schemas/AccessListEntry" + } + }, + "Transaction1559Unsigned": { + "type": "object", + "title": "EIP-1559 transaction.", + "required": [ + "type", + "nonce", + "gas", + "value", + "input", + "maxFeePerGas", + "maxPriorityFeePerGas", + "gasPrice", + "chainId", + "accessList" + ], + "properties": { + "type": { + "title": "type", + "type": "string", + "pattern": "^0x2$" + }, + "nonce": { + "title": "nonce", + "$ref": "#/components/schemas/uint" + }, + "to": { + "title": "to address", + "oneOf": [ + { + "title": "Contract Creation (null)", + "type": "null" + }, + { + "title": "Address", + "$ref": "#/components/schemas/address" + } + ] + }, + "gas": { + "title": "gas limit", + "$ref": "#/components/schemas/uint" + }, + "value": { + "title": "value", + "$ref": "#/components/schemas/uint" + }, + "input": { + "title": "input data", + "$ref": "#/components/schemas/bytes" + }, + "maxPriorityFeePerGas": { + "title": "max priority fee per gas", + "description": "Maximum fee per gas the sender is willing to pay to miners in wei", + "$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", + "$ref": "#/components/schemas/uint" + }, + "gasPrice": { + "title": "gas price", + "description": "The effective gas price paid by the sender in wei. For transactions not yet included in a block, this value should be set equal to the max fee per gas. This field is DEPRECATED, please transition to using effectiveGasPrice in the receipt object going forward.", + "$ref": "#/components/schemas/uint" + }, + "accessList": { + "title": "accessList", + "description": "EIP-2930 access list", + "$ref": "#/components/schemas/AccessList" + }, + "chainId": { + "title": "chainId", + "description": "Chain ID that this transaction is valid on.", + "$ref": "#/components/schemas/uint" + } + } + }, + "Transaction2930Unsigned": { + "type": "object", + "title": "EIP-2930 transaction.", + "required": ["type", "nonce", "gas", "value", "input", "gasPrice", "chainId", "accessList"], + "properties": { + "type": { + "title": "type", + "type": "string", + "pattern": "^0x1$" + }, + "nonce": { + "title": "nonce", + "$ref": "#/components/schemas/uint" + }, + "to": { + "title": "to address", + "oneOf": [ + { + "title": "Contract Creation (null)", + "type": "null" + }, + { + "title": "Address", + "$ref": "#/components/schemas/address" + } + ] + }, + "gas": { + "title": "gas limit", + "$ref": "#/components/schemas/uint" + }, + "value": { + "title": "value", + "$ref": "#/components/schemas/uint" + }, + "input": { + "title": "input data", + "$ref": "#/components/schemas/bytes" + }, + "gasPrice": { + "title": "gas price", + "description": "The gas price willing to be paid by the sender in wei", + "$ref": "#/components/schemas/uint" + }, + "accessList": { + "title": "accessList", + "description": "EIP-2930 access list", + "$ref": "#/components/schemas/AccessList" + }, + "chainId": { + "title": "chainId", + "description": "Chain ID that this transaction is valid on.", + "$ref": "#/components/schemas/uint" + } + } + }, + "TransactionLegacyUnsigned": { + "type": "object", + "title": "Legacy transaction.", + "required": ["type", "nonce", "gas", "value", "input", "gasPrice"], + "properties": { + "type": { + "title": "type", + "type": "string", + "pattern": "^0x0$" + }, + "nonce": { + "title": "nonce", + "$ref": "#/components/schemas/uint" + }, + "to": { + "title": "to address", + "oneOf": [ + { + "title": "Contract Creation (null)", + "type": "null" + }, + { + "title": "Address", + "$ref": "#/components/schemas/address" + } + ] + }, + "gas": { + "title": "gas limit", + "$ref": "#/components/schemas/uint" + }, + "value": { + "title": "value", + "$ref": "#/components/schemas/uint" + }, + "input": { + "title": "input data", + "$ref": "#/components/schemas/bytes" + }, + "gasPrice": { + "title": "gas price", + "description": "The gas price willing to be paid by the sender in wei", + "$ref": "#/components/schemas/uint" + }, + "chainId": { + "title": "chainId", + "description": "Chain ID that this transaction is valid on.", + "$ref": "#/components/schemas/uint" + } + } + }, + "TransactionUnsigned": { + "oneOf": [ + { + "$ref": "#/components/schemas/Transaction4844Unsigned" + }, + { + "$ref": "#/components/schemas/Transaction1559Unsigned" + }, + { + "$ref": "#/components/schemas/Transaction2930Unsigned" + }, + { + "$ref": "#/components/schemas/TransactionLegacyUnsigned" + } + ] + }, + "Transaction4844Signed": { + "title": "Signed 4844 Transaction", + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/Transaction4844Unsigned" + }, + { + "title": "EIP-4844 transaction signature properties.", + "required": ["yParity", "r", "s"], + "properties": { + "yParity": { + "title": "yParity", + "description": "The parity (0 for even, 1 for odd) of the y-value of the secp256k1 signature.", + "$ref": "#/components/schemas/uint" + }, + "r": { + "title": "r", + "$ref": "#/components/schemas/uint" + }, + "s": { + "title": "s", + "$ref": "#/components/schemas/uint" + } + } + } + ] + }, + "Transaction1559Signed": { + "title": "Signed 1559 Transaction", + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/Transaction1559Unsigned" + }, + { + "title": "EIP-1559 transaction signature properties.", + "required": ["yParity", "r", "s"], + "properties": { + "yParity": { + "title": "yParity", + "description": "The parity (0 for even, 1 for odd) of the y-value of the secp256k1 signature.", + "$ref": "#/components/schemas/uint" + }, + "v": { + "title": "v", + "description": "For backwards compatibility, `v` is optionally provided as an alternative to `yParity`. This field is DEPRECATED and all use of it should migrate to `yParity`.", + "$ref": "#/components/schemas/uint" + }, + "r": { + "title": "r", + "$ref": "#/components/schemas/uint" + }, + "s": { + "title": "s", + "$ref": "#/components/schemas/uint" + } + } + } + ] + }, + "Transaction2930Signed": { + "title": "Signed 2930 Transaction", + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/Transaction2930Unsigned" + }, + { + "title": "EIP-2930 transaction signature properties.", + "required": ["yParity", "r", "s"], + "properties": { + "yParity": { + "title": "yParity", + "description": "The parity (0 for even, 1 for odd) of the y-value of the secp256k1 signature.", + "$ref": "#/components/schemas/uint" + }, + "v": { + "title": "v", + "description": "For backwards compatibility, `v` is optionally provided as an alternative to `yParity`. This field is DEPRECATED and all use of it should migrate to `yParity`.", + "$ref": "#/components/schemas/uint" + }, + "r": { + "title": "r", + "$ref": "#/components/schemas/uint" + }, + "s": { + "title": "s", + "$ref": "#/components/schemas/uint" + } + } + } + ] + }, + "TransactionLegacySigned": { + "title": "Signed Legacy Transaction", + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/TransactionLegacyUnsigned" + }, + { + "title": "Legacy transaction signature properties.", + "required": ["v", "r", "s"], + "properties": { + "v": { + "title": "v", + "$ref": "#/components/schemas/uint" + }, + "r": { + "title": "r", + "$ref": "#/components/schemas/uint" + }, + "s": { + "title": "s", + "$ref": "#/components/schemas/uint" + } + } + } + ] + }, + "TransactionSigned": { + "oneOf": [ + { + "$ref": "#/components/schemas/Transaction4844Signed" + }, + { + "$ref": "#/components/schemas/Transaction1559Signed" + }, + { + "$ref": "#/components/schemas/Transaction2930Signed" + }, + { + "$ref": "#/components/schemas/TransactionLegacySigned" + } + ] + }, + "TransactionInfo": { + "type": "object", + "title": "Transaction information", + "allOf": [ + { + "title": "Contextual information", + "required": ["blockHash", "blockNumber", "from", "hash", "transactionIndex"], + "unevaluatedProperties": false, + "properties": { + "blockHash": { + "title": "block hash", + "$ref": "#/components/schemas/hash32" + }, + "blockNumber": { + "title": "block number", + "$ref": "#/components/schemas/uint" + }, + "from": { + "title": "from address", + "$ref": "#/components/schemas/address" + }, + "hash": { + "title": "transaction hash", + "$ref": "#/components/schemas/hash32" + }, + "transactionIndex": { + "title": "transaction index", + "$ref": "#/components/schemas/uint" + } + } + }, + { + "$ref": "#/components/schemas/TransactionSigned" + } + ] + }, + "GenericTransaction": { + "type": "object", + "title": "Transaction object generic to all types", + "additionalProperties": false, + "properties": { + "type": { + "title": "type", + "$ref": "#/components/schemas/byte" + }, + "nonce": { + "title": "nonce", + "$ref": "#/components/schemas/uint" + }, + "to": { + "title": "to address", + "oneOf": [ + { + "title": "Contract Creation (null)", + "type": "null" + }, + { + "title": "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" + }, + "input": { + "title": "input data", + "$ref": "#/components/schemas/bytes" + }, + "gasPrice": { + "title": "gas price", + "description": "The gas price willing to be paid by the sender in wei", + "$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", + "$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", + "$ref": "#/components/schemas/uint" + }, + "maxFeePerBlobGas": { + "title": "max fee per blob gas", + "description": "The maximum total fee per gas the sender is willing to pay for blob gas in wei", + "$ref": "#/components/schemas/uint" + }, + "accessList": { + "title": "accessList", + "description": "EIP-2930 access list", + "$ref": "#/components/schemas/AccessList" + }, + "blobVersionedHashes": { + "title": "blobVersionedHashes", + "description": "List of versioned blob hashes associated with the transaction's EIP-4844 data blobs.", + "type": "array", + "items": { + "$ref": "#/components/schemas/hash32" + } + }, + "blobs": { + "title": "blobs", + "description": "Raw blob data.", + "type": "array", + "items": { + "$ref": "#/components/schemas/bytes" + } + }, + "chainId": { + "title": "chainId", + "description": "Chain ID that this transaction is valid on.", + "$ref": "#/components/schemas/uint" + } + } + }, + "Withdrawal": { + "type": "object", + "title": "Validator withdrawal", + "required": ["index", "validatorIndex", "address", "amount"], + "additionalProperties": false, + "properties": { + "index": { + "title": "index of withdrawal", + "$ref": "#/components/schemas/uint64" + }, + "validatorIndex": { + "title": "index of validator that generated withdrawal", + "$ref": "#/components/schemas/uint64" + }, + "address": { + "title": "recipient address for withdrawal value", + "$ref": "#/components/schemas/address" + }, + "amount": { + "title": "value contained in withdrawal", + "$ref": "#/components/schemas/uint256" + } + } + }, + "ForkchoiceStateV1": { + "title": "Forkchoice state object V1", + "type": "object", + "required": ["headBlockHash", "safeBlockHash", "finalizedBlockHash"], + "properties": { + "headBlockHash": { + "title": "Head block hash", + "$ref": "#/components/schemas/hash32" + }, + "safeBlockHash": { + "title": "Safe block hash", + "$ref": "#/components/schemas/hash32" + }, + "finalizedBlockHash": { + "title": "Finalized block hash", + "$ref": "#/components/schemas/hash32" + } + } + }, + "ForkchoiceUpdatedResponseV1": { + "title": "Forkchoice updated response", + "type": "object", + "required": ["payloadStatus"], + "properties": { + "payloadStatus": { + "title": "Payload status", + "$ref": "#/components/schemas/RestrictedPayloadStatusV1" + }, + "payloadId": { + "title": "Payload id", + "$ref": "#/components/schemas/bytes8" + } + } + }, + "PayloadAttributesV1": { + "title": "Payload attributes object V1", + "type": "object", + "required": ["timestamp", "prevRandao", "suggestedFeeRecipient"], + "properties": { + "timestamp": { + "title": "Timestamp", + "$ref": "#/components/schemas/uint64" + }, + "prevRandao": { + "title": "Previous randao value", + "$ref": "#/components/schemas/bytes32" + }, + "suggestedFeeRecipient": { + "title": "Suggested fee recipient", + "$ref": "#/components/schemas/address" + } + } + }, + "PayloadAttributesV2": { + "title": "Payload attributes object V2", + "type": "object", + "required": ["timestamp", "prevRandao", "suggestedFeeRecipient", "withdrawals"], + "properties": { + "timestamp": { + "$ref": "#/components/schemas/PayloadAttributesV1/properties/timestamp" + }, + "prevRandao": { + "$ref": "#/components/schemas/PayloadAttributesV1/properties/prevRandao" + }, + "suggestedFeeRecipient": { + "$ref": "#/components/schemas/PayloadAttributesV1/properties/suggestedFeeRecipient" + }, + "withdrawals": { + "title": "Withdrawals", + "type": "array", + "items": { + "$ref": "#/components/schemas/WithdrawalV1" + } + } + } + }, + "PayloadAttributesV3": { + "title": "Payload attributes object V3", + "type": "object", + "required": [ + "timestamp", + "prevRandao", + "suggestedFeeRecipient", + "withdrawals", + "parentBeaconBlockRoot" + ], + "properties": { + "timestamp": { + "$ref": "#/components/schemas/PayloadAttributesV2/properties/timestamp" + }, + "prevRandao": { + "$ref": "#/components/schemas/PayloadAttributesV2/properties/prevRandao" + }, + "suggestedFeeRecipient": { + "$ref": "#/components/schemas/PayloadAttributesV2/properties/suggestedFeeRecipient" + }, + "withdrawals": { + "$ref": "#/components/schemas/PayloadAttributesV2/properties/withdrawals" + }, + "parentBeaconBlockRoot": { + "title": "Parent beacon block root", + "$ref": "#/components/schemas/hash32" + } + } + }, + "PayloadStatusV1": { + "title": "Payload status object V1", + "type": "object", + "required": ["status"], + "properties": { + "status": { + "title": "Payload validation status", + "type": "string", + "enum": ["VALID", "INVALID", "SYNCING", "ACCEPTED", "INVALID_BLOCK_HASH"] + }, + "latestValidHash": { + "title": "The hash of the most recent valid block", + "$ref": "#/components/schemas/hash32" + }, + "validationError": { + "title": "Validation error message", + "type": "string" + } + } + }, + "RestrictedPayloadStatusV1": { + "$ref": "#/components/schemas/PayloadStatusV1", + "properties": { + "status": { + "$ref": "#/components/schemas/PayloadStatusV1/properties/status", + "description": "Set of possible values is restricted to VALID, INVALID, SYNCING", + "enum": ["VALID", "INVALID", "SYNCING"] + }, + "latestValidHash": { + "$ref": "#/components/schemas/PayloadStatusV1/properties/latestValidHash" + }, + "validationError": { + "$ref": "#/components/schemas/PayloadStatusV1/properties/validationError" + } + } + }, + "PayloadStatusNoInvalidBlockHash": { + "$ref": "#/components/schemas/PayloadStatusV1", + "title": "Payload status object deprecating INVALID_BLOCK_HASH status", + "properties": { + "status": { + "$ref": "#/components/schemas/PayloadStatusV1/properties/status", + "enum": ["VALID", "INVALID", "SYNCING", "ACCEPTED"] + }, + "latestValidHash": { + "$ref": "#/components/schemas/PayloadStatusV1/properties/latestValidHash" + }, + "validationError": { + "$ref": "#/components/schemas/PayloadStatusV1/properties/validationError" + } + } + }, + "ExecutionPayloadV1": { + "title": "Execution payload object V1", + "type": "object", + "required": [ + "parentHash", + "feeRecipient", + "stateRoot", + "receiptsRoot", + "logsBloom", + "prevRandao", + "blockNumber", + "gasLimit", + "gasUsed", + "timestamp", + "extraData", + "baseFeePerGas", + "blockHash", + "transactions" + ], + "properties": { + "parentHash": { + "title": "Parent block hash", + "$ref": "#/components/schemas/hash32" + }, + "feeRecipient": { + "title": "Recipient of transaction priority fees", + "$ref": "#/components/schemas/address" + }, + "stateRoot": { + "title": "State root", + "$ref": "#/components/schemas/hash32" + }, + "receiptsRoot": { + "title": "Receipts root", + "$ref": "#/components/schemas/hash32" + }, + "logsBloom": { + "title": "Bloom filter", + "$ref": "#/components/schemas/bytes256" + }, + "prevRandao": { + "title": "Previous randao value", + "$ref": "#/components/schemas/bytes32" + }, + "blockNumber": { + "title": "Block number", + "$ref": "#/components/schemas/uint64" + }, + "gasLimit": { + "title": "Gas limit", + "$ref": "#/components/schemas/uint64" + }, + "gasUsed": { + "title": "Gas used", + "$ref": "#/components/schemas/uint64" + }, + "timestamp": { + "title": "Timestamp", + "$ref": "#/components/schemas/uint64" + }, + "extraData": { + "title": "Extra data", + "$ref": "#/components/schemas/bytesMax32" + }, + "baseFeePerGas": { + "title": "Base fee per gas", + "$ref": "#/components/schemas/uint256" + }, + "blockHash": { + "title": "Block hash", + "$ref": "#/components/schemas/hash32" + }, + "transactions": { + "title": "Transactions", + "type": "array", + "items": { + "$ref": "#/components/schemas/bytes" + } + } + } + }, + "WithdrawalV1": { + "title": "Withdrawal object V1", + "type": "object", + "required": ["index", "validatorIndex", "address", "amount"], + "properties": { + "index": { + "title": "Withdrawal index", + "$ref": "#/components/schemas/uint64" + }, + "validatorIndex": { + "title": "Validator index", + "$ref": "#/components/schemas/uint64" + }, + "address": { + "title": "Withdrawal address", + "$ref": "#/components/schemas/address" + }, + "amount": { + "title": "Withdrawal amount", + "$ref": "#/components/schemas/uint64" + } + } + }, + "ExecutionPayloadV2": { + "title": "Execution payload object V2", + "type": "object", + "required": [ + "parentHash", + "feeRecipient", + "stateRoot", + "receiptsRoot", + "logsBloom", + "prevRandao", + "blockNumber", + "gasLimit", + "gasUsed", + "timestamp", + "extraData", + "baseFeePerGas", + "blockHash", + "transactions", + "withdrawals" + ], + "properties": { + "parentHash": { + "$ref": "#/components/schemas/ExecutionPayloadV1/properties/parentHash" + }, + "feeRecipient": { + "$ref": "#/components/schemas/ExecutionPayloadV1/properties/feeRecipient" + }, + "stateRoot": { + "$ref": "#/components/schemas/ExecutionPayloadV1/properties/stateRoot" + }, + "receiptsRoot": { + "$ref": "#/components/schemas/ExecutionPayloadV1/properties/receiptsRoot" + }, + "logsBloom": { + "$ref": "#/components/schemas/ExecutionPayloadV1/properties/logsBloom" + }, + "prevRandao": { + "$ref": "#/components/schemas/ExecutionPayloadV1/properties/prevRandao" + }, + "blockNumber": { + "$ref": "#/components/schemas/ExecutionPayloadV1/properties/blockNumber" + }, + "gasLimit": { + "$ref": "#/components/schemas/ExecutionPayloadV1/properties/gasLimit" + }, + "gasUsed": { + "$ref": "#/components/schemas/ExecutionPayloadV1/properties/gasUsed" + }, + "timestamp": { + "$ref": "#/components/schemas/ExecutionPayloadV1/properties/timestamp" + }, + "extraData": { + "$ref": "#/components/schemas/ExecutionPayloadV1/properties/extraData" + }, + "baseFeePerGas": { + "$ref": "#/components/schemas/ExecutionPayloadV1/properties/baseFeePerGas" + }, + "blockHash": { + "$ref": "#/components/schemas/ExecutionPayloadV1/properties/blockHash" + }, + "transactions": { + "$ref": "#/components/schemas/ExecutionPayloadV1/properties/transactions" + }, + "withdrawals": { + "title": "Withdrawals", + "type": "array", + "items": { + "$ref": "#/components/schemas/WithdrawalV1" + } + } + } + }, + "ExecutionPayloadV3": { + "title": "Execution payload object V3", + "type": "object", + "required": [ + "parentHash", + "feeRecipient", + "stateRoot", + "receiptsRoot", + "logsBloom", + "prevRandao", + "blockNumber", + "gasLimit", + "gasUsed", + "timestamp", + "extraData", + "baseFeePerGas", + "blockHash", + "transactions", + "withdrawals", + "blobGasUsed", + "excessBlobGas" + ], + "properties": { + "parentHash": { + "$ref": "#/components/schemas/ExecutionPayloadV2/properties/parentHash" + }, + "feeRecipient": { + "$ref": "#/components/schemas/ExecutionPayloadV2/properties/feeRecipient" + }, + "stateRoot": { + "$ref": "#/components/schemas/ExecutionPayloadV2/properties/stateRoot" + }, + "receiptsRoot": { + "$ref": "#/components/schemas/ExecutionPayloadV2/properties/receiptsRoot" + }, + "logsBloom": { + "$ref": "#/components/schemas/ExecutionPayloadV2/properties/logsBloom" + }, + "prevRandao": { + "$ref": "#/components/schemas/ExecutionPayloadV2/properties/prevRandao" + }, + "blockNumber": { + "$ref": "#/components/schemas/ExecutionPayloadV2/properties/blockNumber" + }, + "gasLimit": { + "$ref": "#/components/schemas/ExecutionPayloadV2/properties/gasLimit" + }, + "gasUsed": { + "$ref": "#/components/schemas/ExecutionPayloadV2/properties/gasUsed" + }, + "timestamp": { + "$ref": "#/components/schemas/ExecutionPayloadV2/properties/timestamp" + }, + "extraData": { + "$ref": "#/components/schemas/ExecutionPayloadV2/properties/extraData" + }, + "baseFeePerGas": { + "$ref": "#/components/schemas/ExecutionPayloadV2/properties/baseFeePerGas" + }, + "blockHash": { + "$ref": "#/components/schemas/ExecutionPayloadV2/properties/blockHash" + }, + "transactions": { + "$ref": "#/components/schemas/ExecutionPayloadV2/properties/transactions" + }, + "withdrawals": { + "$ref": "#/components/schemas/ExecutionPayloadV2/properties/withdrawals" + }, + "blobGasUsed": { + "title": "Blob gas used", + "$ref": "#/components/schemas/uint64" + }, + "excessBlobGas": { + "title": "Excess blob gas", + "$ref": "#/components/schemas/uint64" + } + } + }, + "ExecutionPayloadV4": { + "title": "Execution payload object V4", + "type": "object", + "required": [ + "parentHash", + "feeRecipient", + "stateRoot", + "receiptsRoot", + "logsBloom", + "prevRandao", + "blockNumber", + "gasLimit", + "gasUsed", + "timestamp", + "extraData", + "baseFeePerGas", + "blockHash", + "transactions", + "withdrawals", + "blobGasUsed", + "excessBlobGas", + "depositRequests", + "withdrawalRequests", + "consolidationRequests" + ], + "properties": { + "parentHash": { + "$ref": "#/components/schemas/ExecutionPayloadV3/properties/parentHash" + }, + "feeRecipient": { + "$ref": "#/components/schemas/ExecutionPayloadV3/properties/feeRecipient" + }, + "stateRoot": { + "$ref": "#/components/schemas/ExecutionPayloadV3/properties/stateRoot" + }, + "receiptsRoot": { + "$ref": "#/components/schemas/ExecutionPayloadV3/properties/receiptsRoot" + }, + "logsBloom": { + "$ref": "#/components/schemas/ExecutionPayloadV3/properties/logsBloom" + }, + "prevRandao": { + "$ref": "#/components/schemas/ExecutionPayloadV3/properties/prevRandao" + }, + "blockNumber": { + "$ref": "#/components/schemas/ExecutionPayloadV3/properties/blockNumber" + }, + "gasLimit": { + "$ref": "#/components/schemas/ExecutionPayloadV3/properties/gasLimit" + }, + "gasUsed": { + "$ref": "#/components/schemas/ExecutionPayloadV3/properties/gasUsed" + }, + "timestamp": { + "$ref": "#/components/schemas/ExecutionPayloadV3/properties/timestamp" + }, + "extraData": { + "$ref": "#/components/schemas/ExecutionPayloadV3/properties/extraData" + }, + "baseFeePerGas": { + "$ref": "#/components/schemas/ExecutionPayloadV3/properties/baseFeePerGas" + }, + "blockHash": { + "$ref": "#/components/schemas/ExecutionPayloadV3/properties/blockHash" + }, + "transactions": { + "$ref": "#/components/schemas/ExecutionPayloadV3/properties/transactions" + }, + "withdrawals": { + "$ref": "#/components/schemas/ExecutionPayloadV3/properties/withdrawals" + }, + "blobGasUsed": { + "$ref": "#/components/schemas/ExecutionPayloadV3/properties/blobGasUsed" + }, + "excessBlobGas": { + "$ref": "#/components/schemas/ExecutionPayloadV3/properties/excessBlobGas" + }, + "depositRequests": { + "title": "Deposit requests", + "type": "array", + "items": { + "$ref": "#/components/schemas/DepositRequestV1" + } + }, + "withdrawalRequests": { + "title": "Withdrawals requests", + "type": "array", + "items": { + "$ref": "#/components/schemas/WithdrawalRequestV1" + } + }, + "consolidationRequests": { + "title": "Consolidation requests", + "type": "array", + "items": { + "$ref": "#/components/schemas/ConsolidationRequestV1" + } + } + } + }, + "ExecutionPayloadBodyV1": { + "title": "Execution payload body object V1", + "type": "object", + "required": ["transactions"], + "properties": { + "transactions": { + "$ref": "#/components/schemas/ExecutionPayloadV1/properties/transactions" + }, + "withdrawals": { + "title": "Withdrawals", + "type": ["array", "null"], + "items": { + "$ref": "#/components/schemas/WithdrawalV1" + } + } + } + }, + "ExecutionPayloadBodyV2": { + "title": "Execution payload body object V2", + "type": "object", + "required": ["transactions"], + "properties": { + "transactions": { + "title": "Transactions", + "type": "array", + "items": { + "$ref": "#/components/schemas/bytes" + } + }, + "withdrawals": { + "title": "Withdrawals", + "type": ["array", "null"], + "items": { + "$ref": "#/components/schemas/WithdrawalV1" + } + }, + "depositRequests": { + "title": "Deposit requests", + "type": ["array", "null"], + "items": { + "$ref": "#/components/schemas/DepositRequestV1" + } + }, + "withdrawalRequests": { + "title": "Withdrawals requests", + "type": ["array", "null"], + "items": { + "$ref": "#/components/schemas/WithdrawalRequestV1" + } + }, + "consolidationRequests": { + "title": "Consolidation requests - array - 'null'", + "items": { + "$ref": "#/components/schemas/ConsolidationRequestV1" + } + } + } + }, + "BlobsBundleV1": { + "title": "Blobs bundle object V1", + "type": "object", + "required": ["commitments", "proofs", "blobs"], + "properties": { + "commitments": { + "title": "Commitments", + "type": "array", + "items": { + "$ref": "#/components/schemas/bytes48" + } + }, + "proofs": { + "title": "Proofs", + "type": "array", + "items": { + "$ref": "#/components/schemas/bytes48" + } + }, + "blobs": { + "title": "Blobs", + "type": "array", + "items": { + "$ref": "#/components/schemas/bytes" + } + } + } + }, + "DepositRequestV1": { + "title": "Deposit request object V1", + "type": "object", + "required": ["pubkey", "withdrawalCredentials", "amount", "signature", "index"], + "properties": { + "pubkey": { + "title": "Public key", + "$ref": "#/components/schemas/bytes48" + }, + "withdrawalCredentials": { + "title": "Withdrawal credentials", + "$ref": "#/components/schemas/bytes32" + }, + "amount": { + "title": "Deposit amount", + "$ref": "#/components/schemas/uint64" + }, + "signature": { + "title": "Deposit signature", + "$ref": "#/components/schemas/bytes96" + }, + "index": { + "title": "Deposit index", + "$ref": "#/components/schemas/uint64" + } + } + }, + "WithdrawalRequestV1": { + "title": "Withdrawal request object V1", + "type": "object", + "required": ["sourceAddress", "validatorPubkey", "amount"], + "properties": { + "sourceAddress": { + "title": "Source address", + "$ref": "#/components/schemas/address" + }, + "validatorPubkey": { + "title": "Validator public key", + "$ref": "#/components/schemas/bytes48" + }, + "amount": { + "title": "Withdraw amount", + "$ref": "#/components/schemas/uint64" + } + } + }, + "ConsolidationRequestV1": { + "title": "Consolidation request object V1", + "type": "object", + "required": ["sourceAddress", "sourcePubkey", "targetPubkey"], + "properties": { + "sourceAddress": { + "title": "Source address", + "$ref": "#/components/schemas/address" + }, + "sourcePubkey": { + "title": "Source validator public key", + "$ref": "#/components/schemas/bytes48" + }, + "targetPubkey": { + "title": "Target validator public key", + "$ref": "#/components/schemas/bytes48" + } + } + }, + "TransitionConfigurationV1": { + "title": "Transition configuration object", + "type": "object", + "required": ["terminalTotalDifficulty", "terminalBlockHash", "terminalBlockNumber"], + "properties": { + "terminalTotalDifficulty": { + "title": "Terminal total difficulty", + "$ref": "#/components/schemas/uint256" + }, + "terminalBlockHash": { + "title": "Terminal block hash", + "$ref": "#/components/schemas/hash32" + }, + "terminalBlockNumber": { + "title": "Terminal block number", + "$ref": "#/components/schemas/uint64" + } + } + } + }, + "tags": { + "MetaMask": { + "name": "MetaMask", + "description": "MetaMask-specific methods." + }, + "Restricted": { + "name": "Restricted", + "description": "Restricted methods. If a method is restricted, the caller must have the corresponding permission via `wallet_requestPermissions` in order to call it." + }, + "Mobile": { + "name": "Mobile", + "description": "Mobile-specific methods." + }, + "Experimental": { + "name": "Experimental", + "description": "Experimental methods." + }, + "Deprecated": { + "name": "Deprecated", + "description": "Deprecated methods." + }, + "Ethereum": { + "name": "Ethereum API", + "description": "Ethereum execution API methods." + }, + "Multichain": { + "name": "Multichain API", + "description": "Multichain API methods." + } + }, + "contentDescriptors": {}, + "examplePairings": {}, + "links": {}, + "examples": {} + } +} diff --git a/package-lock.json b/package-lock.json index 27271971311..d1ee26ecc22 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,8 +23,8 @@ "@metamask/profile-sync-controller": "^16.0.0", "@metamask/sdk": "^0.32.0", "@rjsf/core": "^5.24.10", - "@rjsf/utils": "^5.24.8", - "@rjsf/validator-ajv8": "^5.24.8", + "@rjsf/utils": "^5.24.12", + "@rjsf/validator-ajv8": "^5.24.12", "@sentry/browser": "^8.51.0", "@types/react": "^18.3.3", "clsx": "^2.1.1", @@ -8123,7 +8123,9 @@ } }, "node_modules/@rjsf/utils": { - "version": "5.24.8", + "version": "5.24.12", + "resolved": "https://registry.npmjs.org/@rjsf/utils/-/utils-5.24.12.tgz", + "integrity": "sha512-fDwQB0XkjZjpdFUz5UAnuZj8nnbxDbX5tp+jTOjjJKw2TMQ9gFFYCQ12lSpdhezA2YgEGZfxyYTGW0DKDL5Drg==", "license": "Apache-2.0", "dependencies": { "json-schema-merge-allof": "^0.8.1", @@ -8140,7 +8142,9 @@ } }, "node_modules/@rjsf/validator-ajv8": { - "version": "5.24.8", + "version": "5.24.12", + "resolved": "https://registry.npmjs.org/@rjsf/validator-ajv8/-/validator-ajv8-5.24.12.tgz", + "integrity": "sha512-IMXdCjvDNdvb+mDgZC3AlAtr0pjYKq5s0GcLECjG5PuiX7Ib4JaDQHZY5ZJdKblMfgzhsn8AAOi573jXAt7BHQ==", "license": "Apache-2.0", "dependencies": { "ajv": "^8.12.0", diff --git a/package.json b/package.json index a374cc7baaa..424340f6b3a 100644 --- a/package.json +++ b/package.json @@ -42,8 +42,8 @@ "@metamask/profile-sync-controller": "^16.0.0", "@metamask/sdk": "^0.32.0", "@rjsf/core": "^5.24.10", - "@rjsf/utils": "^5.24.8", - "@rjsf/validator-ajv8": "^5.24.8", + "@rjsf/utils": "^5.24.12", + "@rjsf/validator-ajv8": "^5.24.12", "@sentry/browser": "^8.51.0", "@types/react": "^18.3.3", "clsx": "^2.1.1", diff --git a/src/components/ParserOpenRPC/InteractiveBox/index.tsx b/src/components/ParserOpenRPC/InteractiveBox/index.tsx index 84e07e4de78..78d17949817 100644 --- a/src/components/ParserOpenRPC/InteractiveBox/index.tsx +++ b/src/components/ParserOpenRPC/InteractiveBox/index.tsx @@ -14,7 +14,6 @@ import global from '../global.module.scss' import { BaseInputTemplate } from '@site/src/components/ParserOpenRPC/InteractiveBox/templates/BaseInputTemplate' import { ArrayFieldTemplate } from '@site/src/components/ParserOpenRPC/InteractiveBox/templates/ArrayFieldTemplate' import { ObjectFieldTemplate } from '@site/src/components/ParserOpenRPC/InteractiveBox/templates/ObjectFieldTemplate' -import { WrapIfAdditionalTemplate } from '@site/src/components/ParserOpenRPC/InteractiveBox/templates/WrapIfAdditionalTemplate' import { ConditionalField } from '@site/src/components/ParserOpenRPC/InteractiveBox/fields/ConditionalField' import { DropdownWidget } from '@site/src/components/ParserOpenRPC/InteractiveBox/widgets/DropdownWidget' import { SelectWidget } from '@site/src/components/ParserOpenRPC/InteractiveBox/widgets/SelectWidget' @@ -29,6 +28,7 @@ import { AddButton } from '@site/src/components/ParserOpenRPC/InteractiveBox/but import ClearIcon from '@site/static/img/icons/clear-icon.svg' import ResetIcon from '@site/static/img/icons/reset-icon.svg' import SubmitIcon from '@site/static/img/icons/submit-icon.svg' +import { WrapIfAdditionalTemplate } from '@site/src/components/ParserOpenRPC/InteractiveBox/templates/WrapIfAdditionalTemplate' interface InteractiveBoxProps { params: MethodParam[] @@ -161,14 +161,35 @@ export default function InteractiveBox({ } }, [examples, metaMaskAccount]) + // ---------------- CHECKPOINT 1 ---------------- + // Build the schema that will be supplied to RJSF. + // If a parameter schema contains `patternProperties` but does not explicitly + // allow additional properties, we inject `additionalProperties: true` so that + // RJSF`s `canExpand` helper recognises it as dynamic and enables the "Add" UI. const schema: RJSFSchema = { components: { schemas: components, }, type: 'object', - // @ts-ignore - properties: Object.fromEntries(params.map(({ name, schema }) => [name, schema])), + // @ts-ignore – the OpenRPC param list isn't strictly typed for RJSF here. + properties: Object.fromEntries( + params.map(({ name, schema }) => { + let patchedSchema: any = { ...schema } + if (patchedSchema.patternProperties && patchedSchema.additionalProperties === undefined) { + // Attempt to infer a sensible schema for additional properties. If the + // sole patternProperty specifies an object, default to object {}; otherwise fallback to string. + let inferredAdditional: any = { type: 'string', default: 'New Value' } + const singlePattern: any = Object.values(patchedSchema.patternProperties)[0] + if (singlePattern && singlePattern.type === 'object') { + inferredAdditional = { type: 'object', default: {} } + } + patchedSchema = { ...patchedSchema, additionalProperties: inferredAdditional } + } + return [name, patchedSchema] + }) + ), } + const uiSchema: UiSchema = { 'ui:globalOptions': { label: false, @@ -221,7 +242,8 @@ export default function InteractiveBox({ const dereferenceSchema = async () => { try { if (schema) { - setParsedSchema((await $RefParser.dereference(schema)) as RJSFSchema) + const deref = (await $RefParser.dereference(schema)) as RJSFSchema + setParsedSchema(deref) } } catch (error) { console.error('Error of parsing schema:', error) @@ -231,11 +253,13 @@ export default function InteractiveBox({ }, []) const onChangeHandler = data => { - const validData = removeEmptyArrays(data, params) - if (isOpen) { - setCurrentFormData(validData) - onParamChange(validData) - } + setCurrentFormData(data.formData) + } + + const handleBlur = () => { + const cleaned = removeEmptyArrays(currentFormData, params) + setCurrentFormData(cleaned) + onParamChange(cleaned) } const cloneAndSetNullIfExists = (obj, key) => { @@ -320,10 +344,8 @@ export default function InteractiveBox({ validator={validator} liveValidate={isOpen} noHtml5Validate - onChange={data => { - const orderData = sortObjectKeysByArray(data.formData, params) - onChangeHandler(orderData) - }} + onChange={onChangeHandler} + onBlur={handleBlur} templates={templates} uiSchema={uiSchema} widgets={widgets} @@ -364,7 +386,7 @@ export default function InteractiveBox({ diff --git a/src/components/ParserOpenRPC/InteractiveBox/templates/BaseInputTemplate.tsx b/src/components/ParserOpenRPC/InteractiveBox/templates/BaseInputTemplate.tsx index 577ab2949dc..5eaf6231f70 100644 --- a/src/components/ParserOpenRPC/InteractiveBox/templates/BaseInputTemplate.tsx +++ b/src/components/ParserOpenRPC/InteractiveBox/templates/BaseInputTemplate.tsx @@ -6,8 +6,10 @@ import { Tooltip } from '@site/src/components/Tooltip' import debounce from 'lodash.debounce' import { ParserOpenRPCContext } from '@site/src/components/ParserOpenRPC' -interface ExtendedInputProps extends BaseInputTemplateProps { +interface ExtendedInputProps extends Omit { isArray?: boolean + onBlur?: (id: string, value: any) => void + [key: string]: any } export const BaseInputTemplate = ({ @@ -17,11 +19,13 @@ export const BaseInputTemplate = ({ value = '', disabled, onChange, + onBlur, rawErrors, hideError, required, formContext, isArray, + ...rest }: ExtendedInputProps) => { const isNumber = schema.type === 'number' || schema.type === 'integer' const [isFocused, setIsFocused] = useState(false) @@ -54,6 +58,11 @@ export const BaseInputTemplate = ({ } }, [value, isFormReseted, currentFormData]) + // RJSF uses lowercase "autofocus"; React expects camelCase "autoFocus". + // Extract it so we can map correctly and avoid passing an invalid DOM prop. + // eslint-disable-next-line @typescript-eslint/no-unused-vars + const { autofocus, ...inputRest } = rest + return (
{!isArray && ( @@ -91,9 +100,12 @@ export const BaseInputTemplate = ({ onFocus={() => { setIsFocused(true) }} - onBlur={() => { + onBlur={_e => { setIsFocused(false) + onBlur?.(id, inputValue) }} + autoFocus={autofocus} + {...inputRest} /> {schema.type} diff --git a/src/components/ParserOpenRPC/InteractiveBox/templates/ObjectFieldTemplate.tsx b/src/components/ParserOpenRPC/InteractiveBox/templates/ObjectFieldTemplate.tsx index 600cb5a983c..de76bbc03c8 100644 --- a/src/components/ParserOpenRPC/InteractiveBox/templates/ObjectFieldTemplate.tsx +++ b/src/components/ParserOpenRPC/InteractiveBox/templates/ObjectFieldTemplate.tsx @@ -1,76 +1,77 @@ -import React, { useContext, useState } from "react"; -import { canExpand } from '@rjsf/utils'; -import { AddButton } from "@site/src/components/ParserOpenRPC/InteractiveBox/buttonTemplates/AddButton"; -import styles from "@site/src/components/ParserOpenRPC/InteractiveBox/styles.module.scss"; -import clsx from "clsx"; -import { ParserOpenRPCContext } from "@site/src/components/ParserOpenRPC"; -import { BaseInputTemplate } from "@site/src/components/ParserOpenRPC/InteractiveBox/templates/BaseInputTemplate"; +import React, { useContext, useState } from 'react' +import { canExpand } from '@rjsf/utils' +import { AddButton } from '@site/src/components/ParserOpenRPC/InteractiveBox/buttonTemplates/AddButton' +import styles from '@site/src/components/ParserOpenRPC/InteractiveBox/styles.module.scss' +import clsx from 'clsx' +import { ParserOpenRPCContext } from '@site/src/components/ParserOpenRPC' +import { BaseInputTemplate } from '@site/src/components/ParserOpenRPC/InteractiveBox/templates/BaseInputTemplate' - -export const ObjectFieldTemplate = (props) => { - const { - formData, - formContext, - idSchema, - onAddClick, - properties, - schema, - uiSchema, - } = props; - const [customFormData, setCustomFormData] = useState(formData); - const objectSchemaIds = ["root_requestPermissionsObject", "root_revokePermissionObject", "eth_signTypedData_v4"] - const { isComplexTypeView, drawerLabel, setDrawerLabel, setIsComplexTypeView } = useContext(ParserOpenRPCContext); +export const ObjectFieldTemplate = props => { + const { formData, formContext, idSchema, onAddClick, properties, schema, uiSchema } = props + const [customFormData, setCustomFormData] = useState(formData) + // Detect "dynamic" objects (patternProperties + additionalProperties) at runtime instead of relying on hard-coded IDs + const isDynamicObject = schema?.additionalProperties === true + const { isComplexTypeView, drawerLabel, setDrawerLabel, setIsComplexTypeView } = + useContext(ParserOpenRPCContext) const { - currentSchemaId, - setCurrentSchemaId, - setObjectPropertyBeforeEdit, - setObjectValueBeforeEdit, - currentFormData, - setCurrentFormData, - onParamChange - } = formContext; + currentSchemaId, + setCurrentSchemaId, + setObjectPropertyBeforeEdit, + setObjectValueBeforeEdit, + currentFormData, + setCurrentFormData, + onParamChange, + } = formContext const addNewObject = (name, schemaId) => { - setIsComplexTypeView(true); - setDrawerLabel(name); - setCurrentSchemaId(schemaId); - setObjectPropertyBeforeEdit(name); - setObjectValueBeforeEdit(formData); - }; + setIsComplexTypeView(true) + setDrawerLabel(name) + setCurrentSchemaId(schemaId) + setObjectPropertyBeforeEdit(name) + setObjectValueBeforeEdit(formData) + } - if (isComplexTypeView && idSchema?.$id === currentSchemaId && currentSchemaId.includes("root_TypedData_")) { - const objectEntries = Object.entries(formData); + if ( + isComplexTypeView && + idSchema?.$id === currentSchemaId && + currentSchemaId.includes('root_TypedData_') && + true + ) { + const objectEntries = Object.entries(formData) return ( <> {objectEntries.map(array => { - const name = array[0]; - const value = array[1]; - if (typeof(value) === "string" || typeof(value) === "number") { + const name = array[0] + const value = array[1] + if (typeof value === 'string' || typeof value === 'number') { const baseInputProps = { ...props, name, value, schema: { - type: typeof(value) - } - }; + type: typeof value, + }, + } return ( - { - const newData = { + onChange={(val: number | string) => { + const newData = { ...currentFormData, - TypedData: {...currentFormData.TypedData, [`${drawerLabel}`]: {...formData, [`${name}`]: val}} - }; - setCustomFormData({...formData, [`${name}`]: val}); - setCurrentFormData(newData); - onParamChange(newData); + TypedData: { + ...currentFormData.TypedData, + [`${drawerLabel}`]: { ...formData, [`${name}`]: val }, + }, + } + setCustomFormData({ ...formData, [`${name}`]: val }) + setCurrentFormData(newData) + onParamChange(newData) }} /> ) } - if (typeof(value) === "object") { + if (typeof value === 'object') { return (
@@ -81,24 +82,34 @@ export const ObjectFieldTemplate = (props) => {
- {formData ? - JSON.stringify(Object.fromEntries(Object.entries(formData).filter(([key]) => key.includes(name))), null, " ") : - "" - } + {formData + ? JSON.stringify( + Object.fromEntries( + Object.entries(formData).filter(([key]) => key.includes(name)) + ), + null, + ' ' + ) + : ''}
addNewObject(name, idSchema?.$id)} - > - - {schema.type} - - + onClick={() => addNewObject(name, idSchema?.$id)}> + + {schema.type} + +
- ); + ) } })} @@ -111,7 +122,7 @@ export const ObjectFieldTemplate = (props) => { if (content.props.schema.type === 'object') { return (
- {!isComplexTypeView && idSchema?.$id !== "root" ? + {!isComplexTypeView && idSchema?.$id !== 'root' ? (
: - null - } +
+ ) : null} {content}
) } - return !isComplexTypeView && content?.key !== "EIP712Domain" || !currentSchemaId.includes("root_TypedData_") ? content : null; + return (!isComplexTypeView && content?.key !== 'EIP712Domain') || + !currentSchemaId.includes('root_TypedData_') + ? content + : null })} - { - ( - (isComplexTypeView && idSchema?.$id === currentSchemaId) || - !isComplexTypeView && objectSchemaIds.includes(idSchema?.$id) - ) && canExpand(schema, uiSchema, formData) ? - : - null - } + {(() => { + const canAdd = canExpand(schema, uiSchema, formData) + const inScope = isComplexTypeView ? idSchema?.$id === currentSchemaId : true // root view – always allow + const shouldShow = canAdd && inScope && (isDynamicObject || schema?.type === 'object') + + return shouldShow ? : null + })()} ) } diff --git a/src/components/ParserOpenRPC/InteractiveBox/templates/WrapIfAdditionalTemplate.tsx b/src/components/ParserOpenRPC/InteractiveBox/templates/WrapIfAdditionalTemplate.tsx index 7b459857f32..df9f29a39ec 100644 --- a/src/components/ParserOpenRPC/InteractiveBox/templates/WrapIfAdditionalTemplate.tsx +++ b/src/components/ParserOpenRPC/InteractiveBox/templates/WrapIfAdditionalTemplate.tsx @@ -1,10 +1,10 @@ -import { useContext, useEffect } from "react"; -import { ADDITIONAL_PROPERTY_FLAG } from "@rjsf/utils"; -import { BaseInputTemplate } from "@site/src/components/ParserOpenRPC/InteractiveBox/templates/BaseInputTemplate"; -import { ParserOpenRPCContext } from "@site/src/components/ParserOpenRPC"; -import * as isPlainObject from "lodash.isplainobject" +import { useContext, useEffect, useState } from 'react' +import { ADDITIONAL_PROPERTY_FLAG } from '@rjsf/utils' +import { BaseInputTemplate } from '@site/src/components/ParserOpenRPC/InteractiveBox/templates/BaseInputTemplate' +import { ParserOpenRPCContext } from '@site/src/components/ParserOpenRPC' +import * as isPlainObject from 'lodash.isplainobject' -export const WrapIfAdditionalTemplate = (props) => { +export const WrapIfAdditionalTemplate = props => { const { id, classNames, @@ -19,43 +19,48 @@ export const WrapIfAdditionalTemplate = (props) => { registry, formContext, formData, - } = props; - const { templates } = registry; - const { RemoveButton } = templates.ButtonTemplates; - const additional = ADDITIONAL_PROPERTY_FLAG in schema; - const { - drawerLabel, - isComplexTypeView, - setIsComplexTypeView, - setDrawerLabel, - } = useContext(ParserOpenRPCContext); - const { currentSchemaId, setCurrentSchemaId } = formContext; + } = props + const { templates } = registry + const { RemoveButton } = templates.ButtonTemplates + const additional = ADDITIONAL_PROPERTY_FLAG in schema + const { drawerLabel, isComplexTypeView, setIsComplexTypeView, setDrawerLabel } = + useContext(ParserOpenRPCContext) + + // Local copy of the key being edited; prevents RJSF from renaming the + // property on every keystroke (which causes remounts). + const [pendingKey, setPendingKey] = useState(label) + const onRemoveButtonClick = () => { if (isPlainObject(formData) && Object.keys(formData).length === 0) { - setIsComplexTypeView(false); - setDrawerLabel(null); + setIsComplexTypeView(false) + setDrawerLabel(null) } - }; + } if (!additional) { return (
{children}
- ); + ) } - useEffect(() => { - if (!id.includes("_newKey")) { - setCurrentSchemaId(id); - } - }, []); + // No-op useEffect now; kept to satisfy linter but does nothing. + useEffect(() => {}, []) + + // In non-complex view we still want to show the additional rows so users can + // edit the newly-added key/value immediately. Editing the *key* itself should + // remain within the complex view flow. - if (!id.includes(currentSchemaId)) { - return null; + if (!isComplexTypeView) { + return ( +
+ {children} +
+ ) } - return isComplexTypeView ? ( + return (
{drawerLabel === label && (
@@ -69,17 +74,24 @@ export const WrapIfAdditionalTemplate = (props) => { {/* @ts-ignore */} { - onKeyChange(target); - setDrawerLabel(target); + value={pendingKey} + onChange={(val: string) => { + setPendingKey(val) + }} + onBlur={() => { + if (pendingKey !== label) { + // Delegate renaming to RJSF, which will update formData and invoke onChange. + onKeyChange(pendingKey) + // Keep the drawer open but update its label to the new key. + setDrawerLabel(pendingKey) + } }} - schema={{ ...schema, ...{ type: "string" } }} + schema={{ ...schema, type: 'string' }} formContext={formContext} - value={label} />
)}
{children}
- ) : null; -}; + ) +} diff --git a/src/components/ParserOpenRPC/index.tsx b/src/components/ParserOpenRPC/index.tsx index c9b253814a1..354cfa15ea4 100644 --- a/src/components/ParserOpenRPC/index.tsx +++ b/src/components/ParserOpenRPC/index.tsx @@ -41,6 +41,23 @@ export default function ParserOpenRPC({ network, method, extraContent }: ParserP return null } if (!method || !network) return null + + // Retrieve spec data for all networks from plugin-json-rpc + const { netData } = usePluginData('plugin-json-rpc') as { netData?: ResponseItem[] } + + // Locate the current network and method – wrapped in useMemo to avoid + // recomputation on minor state changes. + const currentNetwork = useMemo( + () => netData?.find(net => net.name === network), + [netData, network] + ) + const currentMethod = useMemo( + () => currentNetwork?.data?.methods?.find(met => met.name === method), + [currentNetwork, method] + ) + + const dataReady = currentNetwork && currentMethod + const [isModalOpen, setModalOpen] = useState(false) const [reqResult, setReqResult] = useState(undefined) const [paramsData, setParamsData] = useState([]) @@ -76,13 +93,6 @@ export default function ParserOpenRPC({ network, method, extraContent }: ParserP } const closeModal = () => setModalOpen(false) - const { netData } = usePluginData('plugin-json-rpc') as { - netData?: ResponseItem[] - } - const currentNetwork = netData?.find(net => net.name === network) - - if (!currentNetwork && currentNetwork.error) return null - const currentMethodData = useMemo(() => { const findReferencedItem = (items, refPath, componentType) => { return ( @@ -99,9 +109,6 @@ export default function ParserOpenRPC({ network, method, extraContent }: ParserP ) } - const currentMethod = currentNetwork.data.methods?.find(met => met.name === method) - if (!currentMethod) return null - const errors = findReferencedItem(currentMethod.errors, '#/components/errors/', 'errors') const tags = findReferencedItem(currentMethod.tags, '#/components/tags/', 'tags') @@ -136,9 +143,11 @@ export default function ParserOpenRPC({ network, method, extraContent }: ParserP tags, servers: currentNetwork.data?.servers?.[0]?.url || null, } - }, [currentNetwork, method]) + }, [currentNetwork, method, currentMethod, userEncPublicKey]) - if (currentMethodData === null) return null + if (!dataReady || currentMethodData === null) { + return null + } const isMetamaskNetwork = network === NETWORK_NAMES.metamask diff --git a/src/components/SidebarVersionDropdown/SidebarVersionDropdown.module.css b/src/components/SidebarVersionDropdown/SidebarVersionDropdown.module.css index 04ec3acb23e..ccb7d601d4b 100644 --- a/src/components/SidebarVersionDropdown/SidebarVersionDropdown.module.css +++ b/src/components/SidebarVersionDropdown/SidebarVersionDropdown.module.css @@ -39,7 +39,7 @@ background: var(--general-white); border: 1px solid var(--general-gray-light); border-radius: 4px; - box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1); + box-shadow: 0 6px 16px rgb(0 0 0 / 10%); margin-top: 0.3rem; padding-bottom: 1rem; z-index: 100; diff --git a/src/plugins/plugin-json-rpc.ts b/src/plugins/plugin-json-rpc.ts index 36c5a225656..8cd9974fa30 100644 --- a/src/plugins/plugin-json-rpc.ts +++ b/src/plugins/plugin-json-rpc.ts @@ -1,10 +1,10 @@ -import NodePolyfillPlugin from "node-polyfill-webpack-plugin"; -import * as path from "path"; +import NodePolyfillPlugin from 'node-polyfill-webpack-plugin' +import * as path from 'path' export interface ResponseItem { - name: string; - data: any | null; - error: Error | null | boolean; + name: string + data: any | null + error: Error | null | boolean } interface MethodItem { @@ -52,29 +52,29 @@ const sortMethods = (items: MethodItem[], sortConfig = METHOD_SORT_CONFIG) => { async function fetchData(url: string, name: string): Promise { try { - const response = await fetch(url, { method: "GET" }); - const data = await response.json(); - return { name, data, error: false }; + const response = await fetch(url, { method: 'GET' }) + const data = await response.json() + return { name, data, error: false } } catch (error) { - return { name, data: null, error: true }; + return { name, data: null, error: true } } } async function fetchMultipleData( requests: { url: string; name: string }[] ): Promise { - const promises = requests.map(({ url, name }) => fetchData(url, name)); - const responses = await Promise.all(promises); - return responses; + const promises = requests.map(({ url, name }) => fetchData(url, name)) + const responses = await Promise.all(promises) + return responses } -export const RPC_NETWORK_URL = "https://sot-network-methods.vercel.app/specs"; -export const MM_RPC_URL = "https://metamask.github.io/api-specs/latest/openrpc.json"; -export const MM_REF_PATH = "wallet/reference/json-rpc-methods"; +export const RPC_NETWORK_URL = 'https://sot-network-methods.vercel.app/specs' +export const MM_RPC_URL = 'https://metamask.github.io/api-specs/latest/openrpc.json' +export const MM_REF_PATH = 'wallet/reference/json-rpc-methods' export enum NETWORK_NAMES { - linea = "linea", - metamask = "metamask", + linea = 'linea', + metamask = 'metamask', } const requests = [ @@ -86,7 +86,7 @@ const requests = [ url: MM_RPC_URL, name: NETWORK_NAMES.metamask, }, -]; +] export const prepareLinkItems = ( items: MethodItem[], @@ -109,27 +109,27 @@ export const fetchAndGenerateDynamicSidebarItems = async ( ) => { const dynamicRefItems = await fetchData(url, network); if (dynamicRefItems.data && !dynamicRefItems.error) { - return prepareLinkItems(dynamicRefItems.data.methods, refPath); + return prepareLinkItems(dynamicRefItems.data.methods, refPath) } return []; }; export default function useNetworksMethodPlugin() { return { - name: "plugin-json-rpc", + name: 'plugin-json-rpc', async loadContent() { return await fetchMultipleData(requests) .then(responseArray => { return responseArray; }) .catch(() => { - return []; - }); + return [] + }) }, async contentLoaded({ content, actions }) { - const { addRoute, createData, setGlobalData } = actions; - setGlobalData({ netData: content }); - const dynamicRoutes = content.find(item => item.name === NETWORK_NAMES.metamask); + const { addRoute, createData, setGlobalData } = actions + setGlobalData({ netData: content }) + const dynamicRoutes = content.find(item => item.name === NETWORK_NAMES.metamask) if (dynamicRoutes) { const methodsData = await createData( "methodsData.json", @@ -138,7 +138,7 @@ export default function useNetworksMethodPlugin() { for (const method of dynamicRoutes.data.methods) { await addRoute({ path: `/${MM_REF_PATH}/${method.name.toLowerCase()}`, - component: require.resolve("../components/CustomReferencePage/index.tsx"), + component: require.resolve('../components/CustomReferencePage/index.tsx'), modules: { methodsData: methodsData, }, @@ -165,5 +165,5 @@ export default function useNetworksMethodPlugin() { }, }; }, - }; + } } diff --git a/src/theme/DocSidebar/Desktop/styles.module.css b/src/theme/DocSidebar/Desktop/styles.module.css index c5d5e50e16f..5bfec7f123d 100644 --- a/src/theme/DocSidebar/Desktop/styles.module.css +++ b/src/theme/DocSidebar/Desktop/styles.module.css @@ -1,4 +1,4 @@ -@media (min-width: 997px) { +@media (width >= 997px) { .sidebar { display: flex; flex-direction: column; diff --git a/src/theme/DocSidebarItem/index.module.css b/src/theme/DocSidebarItem/index.module.css index 923aee15d34..2b7a4003d09 100644 --- a/src/theme/DocSidebarItem/index.module.css +++ b/src/theme/DocSidebarItem/index.module.css @@ -1,8 +1,6 @@ .flaskOnly :global(a.menu__link::after), .flaskOnly :global(.menu__list-item-collapsible a.menu__link::after) { content: 'Flask'; - margin-left: 0.5em; - background-color: var(--mm-flask-background-color); color: var(--mm-flask-color); border-radius: 0; margin-left: 1rem; diff --git a/src/theme/Navbar/Content/styles.module.css b/src/theme/Navbar/Content/styles.module.css index 7745043b99e..80e09deefe8 100644 --- a/src/theme/Navbar/Content/styles.module.css +++ b/src/theme/Navbar/Content/styles.module.css @@ -1,7 +1,7 @@ /* Hide color mode toggle in small viewports */ -@media (max-width: 1196px) { +@media (width <= 1196px) { .colorModeToggle { display: none; }