Skip to content
This repository was archived by the owner on Feb 17, 2025. It is now read-only.

Commit e36a65a

Browse files
committed
add fork endpoints doc
1 parent 41be89a commit e36a65a

File tree

1 file changed

+165
-0
lines changed

1 file changed

+165
-0
lines changed

jsonrpc/endpoints_zkevm.openrpc.json

Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -471,6 +471,126 @@
471471
"$ref": "#/components/schemas/Integer"
472472
}
473473
}
474+
},
475+
{
476+
"name": "zkevm_forkId",
477+
"summary": "Returns the network's current fork ID.",
478+
"params": [],
479+
"result": {
480+
"$ref": "#/components/contentDescriptors/ForkID"
481+
},
482+
"examples": [
483+
{
484+
"name": "example",
485+
"description": "",
486+
"params": [],
487+
"result": {
488+
"name": "exampleResult",
489+
"description": "",
490+
"value": "0x1"
491+
}
492+
}
493+
]
494+
},
495+
{
496+
"name": "zkevm_getForkById",
497+
"summary": "returns the network fork ID interval given the provided fork id",
498+
"params": [
499+
{
500+
"$ref": "#/components/contentDescriptors/ForkID"
501+
}
502+
],
503+
"result": {
504+
"$ref": "#/components/contentDescriptors/Fork"
505+
},
506+
"examples": [
507+
{
508+
"name": "example",
509+
"description": "",
510+
"params": [
511+
{
512+
"name": "fork id",
513+
"value": "0x1"
514+
}
515+
],
516+
"result": {
517+
"name": "Fork",
518+
"value": {
519+
"forkId": "0x8",
520+
"fromBatchNumber": "0x1",
521+
"toBatchNumber": "0xffffffffffffffff",
522+
"version": "",
523+
"blockNumber": "0x88"
524+
}
525+
}
526+
}
527+
]
528+
},
529+
{
530+
"name": "zkevm_getForkIdByBatchNumber",
531+
"summary": "returns the fork ID given the provided batch number",
532+
"params": [
533+
{
534+
"$ref": "#/components/contentDescriptors/BatchNumber"
535+
}
536+
],
537+
"result": {
538+
"$ref": "#/components/contentDescriptors/ForkID"
539+
},
540+
"examples": [
541+
{
542+
"name": "example",
543+
"description": "",
544+
"params": [],
545+
"result": {
546+
"name": "exampleResult",
547+
"description": "",
548+
"value": "0x1"
549+
}
550+
}
551+
]
552+
},
553+
{
554+
"name": "zkevm_getForks",
555+
"summary": "returns the network fork ID interval given the provided fork id",
556+
"params": [],
557+
"result": {
558+
"name": "result",
559+
"schema": {
560+
"description": "Array of forks",
561+
"type": "array",
562+
"items": {
563+
"title": "fork",
564+
"$ref": "#/components/contentDescriptors/Fork"
565+
}
566+
}
567+
},
568+
"examples": [
569+
{
570+
"name": "example",
571+
"description": "",
572+
"params": [],
573+
"result": {
574+
"name": "Fork",
575+
"value": [
576+
{
577+
"forkId": "0x8",
578+
"fromBatchNumber": "0x1",
579+
"toBatchNumber": "0xa",
580+
"version": "",
581+
"blockNumber": "0x88"
582+
},
583+
{
584+
"forkId": "0x9",
585+
"fromBatchNumber": "0xb",
586+
"toBatchNumber": "0xffffffffffffffff",
587+
"version": "",
588+
"blockNumber": "0x188"
589+
}
590+
]
591+
}
592+
}
593+
]
474594
}
475595
],
476596
"components": {
@@ -520,6 +640,14 @@
520640
"$ref": "#/components/schemas/Block"
521641
}
522642
},
643+
"Fork": {
644+
"name": "fork",
645+
"description": "fork",
646+
"required": true,
647+
"schema": {
648+
"$ref": "#/components/schemas/Fork"
649+
}
650+
},
523651
"Transaction": {
524652
"required": true,
525653
"name": "transaction",
@@ -548,6 +676,13 @@
548676
}
549677
]
550678
}
679+
},
680+
"ForkID": {
681+
"name": "forkID",
682+
"required": true,
683+
"schema": {
684+
"$ref": "#/components/schemas/ForkID"
685+
}
551686
}
552687
},
553688
"schemas": {
@@ -1437,6 +1572,36 @@
14371572
"$ref": "#/components/schemas/Integer"
14381573
}
14391574
}
1575+
},
1576+
"ForkID": {
1577+
"title": "forkID",
1578+
"type": "string",
1579+
"description": "The hex representation of the fork's id",
1580+
"$ref": "#/components/schemas/Integer"
1581+
},
1582+
"Fork": {
1583+
"title": "Fork",
1584+
"type": "object",
1585+
"readOnly": true,
1586+
"properties": {
1587+
"forkId": {
1588+
"$ref": "#/components/schemas/ForkID"
1589+
},
1590+
"fromBatchNumber": {
1591+
"$ref": "#/components/schemas/BatchNumber"
1592+
},
1593+
"toBatchNumber": {
1594+
"$ref": "#/components/schemas/BatchNumber"
1595+
},
1596+
"Version": {
1597+
"title": "batchNumberTag",
1598+
"type": "string",
1599+
"description": "fork version"
1600+
},
1601+
"BlockNumber": {
1602+
"$ref": "#/components/schemas/BlockNumber"
1603+
}
1604+
}
14401605
}
14411606
}
14421607
}

0 commit comments

Comments
 (0)