github.com/0xPolygon/supernets2-node@v0.0.0-20230711153321-2fe574524eaa/jsonrpc/endpoints_zkevm.openrpc.json (about)

     1  {
     2    "openrpc": "1.0.0-rc1",
     3    "info": {
     4      "title": "zkEVM Endpoints",
     5      "version": "2.0.0"
     6    },
     7    "methods": [
     8      {
     9        "name": "zkevm_consolidatedBlockNumber",
    10        "summary": "Returns the latest block number that is connected to the latest batch verified.",
    11        "params": [],
    12        "result": {
    13          "$ref": "#/components/contentDescriptors/BlockNumber"
    14        },
    15        "examples": [
    16          {
    17            "name": "example",
    18            "description": "",
    19            "params": [],
    20            "result": {
    21              "name": "exampleResult",
    22              "description": "",
    23              "value": "0x1"
    24            }
    25          }
    26        ]
    27      },
    28      {
    29        "name": "zkevm_isBlockVirtualized",
    30        "summary": "Returns true if the provided block number is already connected to a batch that was already virtualized, otherwise false.",
    31        "params": [
    32          {
    33            "name": "blockNumber",
    34            "schema": {
    35              "$ref": "#/components/contentDescriptors/BlockNumber"
    36            }
    37          }
    38        ],
    39        "result": {
    40          "name": "result",
    41          "schema": {
    42            "type": "boolean"
    43          }
    44        },
    45        "examples": [
    46          {
    47            "name": "example",
    48            "description": "",
    49            "params": [],
    50            "result": {
    51              "name": "exampleResult",
    52              "description": "",
    53              "value": true
    54            }
    55          }
    56        ]
    57      },
    58      {
    59        "name": "zkevm_isBlockConsolidated",
    60        "summary": "Returns true if the provided block number is already connected to a batch that was already verified, otherwise false.",
    61        "params": [
    62          {
    63            "$ref": "#/components/contentDescriptors/BlockNumber"
    64          }
    65        ],
    66        "result": {
    67          "name": "result",
    68          "schema": {
    69            "type": "boolean"
    70          }
    71        },
    72        "examples": [
    73          {
    74            "name": "example",
    75            "description": "",
    76            "params": [],
    77            "result": {
    78              "name": "exampleResult",
    79              "description": "",
    80              "value": true
    81            }
    82          }
    83        ]
    84      },
    85      {
    86        "name": "zkevm_batchNumber",
    87        "summary": "Returns the latest batch number.",
    88        "params": [],
    89        "result": {
    90          "$ref": "#/components/contentDescriptors/BatchNumber"
    91        },
    92        "examples": [
    93          {
    94            "name": "example",
    95            "description": "",
    96            "params": [],
    97            "result": {
    98              "name": "exampleResult",
    99              "description": "",
   100              "value": "0x1"
   101            }
   102          }
   103        ]
   104      },
   105      {
   106        "name": "zkevm_virtualBatchNumber",
   107        "summary": "Returns the latest virtual batch number.",
   108        "params": [],
   109        "result": {
   110          "$ref": "#/components/contentDescriptors/BatchNumber"
   111        },
   112        "examples": [
   113          {
   114            "name": "example",
   115            "description": "",
   116            "params": [],
   117            "result": {
   118              "name": "exampleResult",
   119              "description": "",
   120              "value": "0x1"
   121            }
   122          }
   123        ]
   124      },
   125      {
   126        "name": "zkevm_verifiedBatchNumber",
   127        "summary": "Returns the latest verified batch number.",
   128        "params": [],
   129        "result": {
   130          "$ref": "#/components/contentDescriptors/BatchNumber"
   131        },
   132        "examples": [
   133          {
   134            "name": "example",
   135            "description": "",
   136            "params": [],
   137            "result": {
   138              "name": "exampleResult",
   139              "description": "",
   140              "value": "0x1"
   141            }
   142          }
   143        ]
   144      },
   145      {
   146        "name": "zkevm_batchNumberByBlockNumber",
   147        "summary": "Returns the batch number of the batch connected to the block.",
   148        "params": [
   149          {
   150            "$ref": "#/components/contentDescriptors/BlockNumber"
   151          }
   152        ],
   153        "result": {
   154          "$ref": "#/components/contentDescriptors/BatchNumber"
   155        },
   156        "examples": [
   157          {
   158            "name": "example",
   159            "description": "",
   160            "params": [],
   161            "result": {
   162              "name": "exampleResult",
   163              "description": "",
   164              "value": "0x1"
   165            }
   166          }
   167        ]
   168      },
   169      {
   170        "name": "zkevm_getBatchByNumber",
   171        "summary": "Gets a batch for a given number",
   172        "params": [
   173          {
   174            "$ref": "#/components/contentDescriptors/BatchNumberOrTag"
   175          },
   176          {
   177            "name": "includeTransactions",
   178            "description": "If `true` it returns the full transaction objects, if `false` only the hashes of the transactions.",
   179            "required": true,
   180            "schema": {
   181              "title": "isTransactionsIncluded",
   182              "type": "boolean"
   183            }
   184          }
   185        ],
   186        "result": {
   187          "$ref": "#/components/contentDescriptors/Batch"
   188        },
   189        "examples": [
   190          {
   191            "name": "batch without tx details",
   192            "description": "Batch without transaction details",
   193            "params": [
   194              {
   195                "name": "batch number",
   196                "value": "0x1"
   197              },
   198              {
   199                "name": "include txs",
   200                "value": "false"
   201              }
   202            ],
   203            "result": {
   204              "name": "Batch",
   205              "value": {
   206                "number": "0x1",
   207                "coinbase": "0x0000000000000000000000000000000000000001",
   208                "stateRoot": "0x0000000000000000000000000000000000000000000000000000000000000001",
   209                "globalExitRoot": "0x0000000000000000000000000000000000000000000000000000000000000002",
   210                "mainnetExitRoot": "0x0000000000000000000000000000000000000000000000000000000000000003",
   211                "rollupExitRoot": "0x0000000000000000000000000000000000000000000000000000000000000004",
   212                "localExitRoot": "0x0000000000000000000000000000000000000000000000000000000000000005",
   213                "accInputHash": "0x0000000000000000000000000000000000000000000000000000000000000006",
   214                "timestamp": "0x642af31f",
   215                "sendSequencesTxHash": "0x0000000000000000000000000000000000000000000000000000000000000007",
   216                "verifyBatchTxHash": "0x0000000000000000000000000000000000000000000000000000000000000008",
   217                "transactions": [
   218                  "0x0000000000000000000000000000000000000000000000000000000000000009",
   219                  "0x0000000000000000000000000000000000000000000000000000000000000010",
   220                  "0x0000000000000000000000000000000000000000000000000000000000000011"
   221                ]
   222              }
   223            }
   224          },
   225          {
   226            "name": "batch with tx detail",
   227            "description": "Batch with transaction details",
   228            "params": [
   229              {
   230                "name": "batch number",
   231                "value": "0x1"
   232              },
   233              {
   234                "name": "include txs",
   235                "value": "true"
   236              }
   237            ],
   238            "result": {
   239              "name": "Batch",
   240              "value": {
   241                "number": "0x1",
   242                "coinbase": "0x0000000000000000000000000000000000000001",
   243                "stateRoot": "0x0000000000000000000000000000000000000000000000000000000000000001",
   244                "globalExitRoot": "0x0000000000000000000000000000000000000000000000000000000000000002",
   245                "mainnetExitRoot": "0x0000000000000000000000000000000000000000000000000000000000000003",
   246                "rollupExitRoot": "0x0000000000000000000000000000000000000000000000000000000000000004",
   247                "localExitRoot": "0x0000000000000000000000000000000000000000000000000000000000000005",
   248                "accInputHash": "0x0000000000000000000000000000000000000000000000000000000000000006",
   249                "timestamp": "0x642af31f",
   250                "sendSequencesTxHash": "0x0000000000000000000000000000000000000000000000000000000000000007",
   251                "verifyBatchTxHash": "0x0000000000000000000000000000000000000000000000000000000000000008",
   252                "transactions": [
   253                  {
   254                    "nonce": "0x1",
   255                    "gasPrice": "0x123456",
   256                    "gas": "0x59D8",
   257                    "to": "0x0000000000000000000000000000000000000002",
   258                    "value": "0x1",
   259                    "input": "0x",
   260                    "v": "0xAAA",
   261                    "r": "0x0000000000000000000000000000000000000000000000000000000000000010",
   262                    "s": "0x0000000000000000000000000000000000000000000000000000000000000011",
   263                    "hash": "0x0000000000000000000000000000000000000000000000000000000000000012",
   264                    "from": "0x0000000000000000000000000000000000000003",
   265                    "blockHash": "0x0000000000000000000000000000000000000000000000000000000000000013",
   266                    "blockNumber": "0x1",
   267                    "transactionIndex": "0x0",
   268                    "chainId": "0x539",
   269                    "type": "0x0"
   270                  }
   271                ]
   272              }
   273            }
   274          }
   275        ]
   276      }
   277    ],
   278    "components": {
   279      "contentDescriptors": {
   280        "BlockNumber": {
   281          "name": "blockNumber",
   282          "required": true,
   283          "schema": {
   284            "$ref": "#/components/schemas/BlockNumber"
   285          }
   286        },
   287        "BatchNumber": {
   288          "name": "batchNumber",
   289          "required": true,
   290          "schema": {
   291            "$ref": "#/components/schemas/BatchNumber"
   292          }
   293        },
   294        "BatchNumberOrTag": {
   295          "name": "batchNumberOrTag",
   296          "required": true,
   297          "schema": {
   298            "title": "batchNumberOrTag",
   299            "oneOf": [
   300              {
   301                "$ref": "#/components/schemas/BatchNumber"
   302              },
   303              {
   304                "$ref": "#/components/schemas/BatchNumberTag"
   305              }
   306            ]
   307          }
   308        },
   309        "Batch": {
   310          "name": "batch",
   311          "description": "batch",
   312          "required": true,
   313          "schema": {
   314            "$ref": "#/components/schemas/Batch"
   315          }
   316        }
   317      },
   318      "schemas": {
   319        "Null": {
   320          "title": "null",
   321          "type": "null",
   322          "description": "Null"
   323        },
   324        "BatchNumberTag": {
   325          "title": "batchNumberTag",
   326          "type": "string",
   327          "description": "The optional batch height description",
   328          "enum": [
   329            "earliest",
   330            "latest"
   331          ]
   332        },
   333        "Integer": {
   334          "title": "integer",
   335          "type": "string",
   336          "pattern": "^0x[a-fA-F0-9]+$",
   337          "description": "Hex representation of the integer"
   338        },
   339        "Keccak": {
   340          "title": "keccak",
   341          "type": "string",
   342          "description": "Hex representation of a Keccak 256 hash",
   343          "pattern": "^0x[a-fA-F\\d]{64}$"
   344        },
   345        "Address": {
   346          "title": "address",
   347          "type": "string",
   348          "pattern": "^0x[a-fA-F\\d]{40}$"
   349        },
   350        "BlockNumber": {
   351          "title": "blockNumber",
   352          "type": "string",
   353          "description": "The hex representation of the block's height",
   354          "$ref": "#/components/schemas/Integer"
   355        },
   356        "BatchNumber": {
   357          "title": "batchNumber",
   358          "type": "string",
   359          "description": "The hex representation of the batch's height",
   360          "$ref": "#/components/schemas/Integer"
   361        },
   362        "TransactionHash": {
   363          "title": "transactionHash",
   364          "type": "string",
   365          "description": "Keccak 256 Hash of the RLP encoding of a transaction",
   366          "$ref": "#/components/schemas/Keccak"
   367        },
   368        "Nonce": {
   369          "title": "nonce",
   370          "description": "A number only to be used once",
   371          "$ref": "#/components/schemas/Integer"
   372        },
   373        "From": {
   374          "title": "From",
   375          "description": "The sender of the transaction",
   376          "$ref": "#/components/schemas/Address"
   377        },
   378        "BlockNumberOrNull": {
   379          "title": "blockNumberOrNull",
   380          "description": "The block number or null when its the pending block",
   381          "oneOf": [
   382            {
   383              "$ref": "#/components/schemas/BlockNumber"
   384            },
   385            {
   386              "$ref": "#/components/schemas/Null"
   387            }
   388          ]
   389        },
   390        "IntegerOrNull": {
   391          "title": "integerOrNull",
   392          "oneOf": [
   393            {
   394              "$ref": "#/components/schemas/Integer"
   395            },
   396            {
   397              "$ref": "#/components/schemas/Null"
   398            }
   399          ]
   400        },
   401        "KeccakOrPending": {
   402          "title": "keccakOrPending",
   403          "oneOf": [
   404            {
   405              "$ref": "#/components/schemas/Keccak"
   406            },
   407            {
   408              "$ref": "#/components/schemas/Null"
   409            }
   410          ]
   411        },
   412        "To": {
   413          "title": "To",
   414          "description": "Destination address of the transaction. Null if it was a contract create.",
   415          "oneOf": [
   416            {
   417              "$ref": "#/components/schemas/Address"
   418            },
   419            {
   420              "$ref": "#/components/schemas/Null"
   421            }
   422          ]
   423        },
   424        "BlockHashOrNull": {
   425          "title": "blockHashOrNull",
   426          "description": "The block hash or null when its the pending block",
   427          "$ref": "#/components/schemas/KeccakOrPending"
   428        },
   429        "TransactionIndex": {
   430          "title": "transactionIndex",
   431          "description": "The index of the transaction. null when its pending",
   432          "$ref": "#/components/schemas/IntegerOrNull"
   433        },
   434        "Batch": {
   435          "title": "Batch",
   436          "type": "object",
   437          "readOnly": true,
   438          "properties": {
   439            "number": {
   440              "$ref": "#/components/schemas/BlockNumber"
   441            },
   442            "transactions": {
   443              "title": "transactionsOrHashes",
   444              "description": "Array of transaction objects, or 32 Bytes transaction hashes depending on the last given parameter",
   445              "type": "array",
   446              "items": {
   447                "title": "transactionOrTransactionHash",
   448                "oneOf": [
   449                  {
   450                    "$ref": "#/components/schemas/Transaction"
   451                  },
   452                  {
   453                    "$ref": "#/components/schemas/TransactionHash"
   454                  }
   455                ]
   456              }
   457            },
   458            "globalExitRoot": {
   459              "$ref": "#/components/schemas/Keccak"
   460            },
   461            "mainnetExitRoot": {
   462              "$ref": "#/components/schemas/Keccak"
   463            },
   464            "rollupExitRoot": {
   465              "$ref": "#/components/schemas/Keccak"
   466            },
   467            "accInputHash": {
   468              "$ref": "#/components/schemas/Keccak"
   469            },
   470            "timestamp": {
   471              "$ref": "#/components/schemas/Integer"
   472            },
   473            "sendSequencesTxHash": {
   474              "$ref": "#/components/schemas/TransactionHash"
   475            },
   476            "verifyBatchTxHash": {
   477              "$ref": "#/components/schemas/TransactionHash"
   478            },
   479            "stateRoot": {
   480              "$ref": "#/components/schemas/Keccak"
   481            },
   482            "coinbase": {
   483              "$ref": "#/components/schemas/Address"
   484            }
   485          }
   486        },
   487        "Transaction": {
   488          "title": "transaction",
   489          "type": "object",
   490          "required": [
   491            "gas",
   492            "gasPrice",
   493            "nonce"
   494          ],
   495          "properties": {
   496            "blockHash": {
   497              "$ref": "#/components/schemas/BlockHashOrNull"
   498            },
   499            "blockNumber": {
   500              "$ref": "#/components/schemas/BlockNumberOrNull"
   501            },
   502            "from": {
   503              "$ref": "#/components/schemas/From"
   504            },
   505            "gas": {
   506              "title": "transactionGas",
   507              "type": "string",
   508              "description": "The gas limit provided by the sender in Wei"
   509            },
   510            "gasPrice": {
   511              "title": "transactionGasPrice",
   512              "type": "string",
   513              "description": "The gas price willing to be paid by the sender in Wei"
   514            },
   515            "hash": {
   516              "$ref": "#/components/schemas/TransactionHash"
   517            },
   518            "input": {
   519              "title": "transactionInput",
   520              "type": "string",
   521              "description": "The data field sent with the transaction"
   522            },
   523            "nonce": {
   524              "title": "transactionNonce",
   525              "description": "The total number of prior transactions made by the sender",
   526              "$ref": "#/components/schemas/Nonce"
   527            },
   528            "to": {
   529              "$ref": "#/components/schemas/To"
   530            },
   531            "transactionIndex": {
   532              "$ref": "#/components/schemas/TransactionIndex"
   533            },
   534            "value": {
   535              "title": "transactionValue",
   536              "description": "Value of Ether being transferred in Wei",
   537              "$ref": "#/components/schemas/Keccak"
   538            },
   539            "v": {
   540              "title": "transactionSigV",
   541              "type": "string",
   542              "description": "ECDSA recovery id"
   543            },
   544            "r": {
   545              "title": "transactionSigR",
   546              "type": "string",
   547              "description": "ECDSA signature r"
   548            },
   549            "s": {
   550              "title": "transactionSigS",
   551              "type": "string",
   552              "description": "ECDSA signature s"
   553            }
   554          }
   555        },
   556        "Transactions": {
   557          "title": "transactions",
   558          "description": "An array of transactions",
   559          "type": "array",
   560          "items": {
   561            "$ref": "#/components/schemas/Transaction"
   562          }
   563        }
   564      }
   565    }
   566  }