Skip to content

Commit 16d7c0e

Browse files
committed
EIP 1474 -> OpenRPC
1 parent c2ae255 commit 16d7c0e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+1873
-1218
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules/
2+
build/
3+
**\.DS_Store

build.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
const RefParser = require("@apidevtools/json-schema-ref-parser");
2+
const fs = require("fs");
3+
4+
const _parse = async (_schema) => {
5+
try {
6+
let schema = await RefParser.dereference(_schema);
7+
if (!fs.existsSync("./build")){
8+
fs.mkdirSync("./build");
9+
}
10+
fs.writeFileSync("./build/__openrpc__.json", JSON.stringify(schema))
11+
}
12+
catch(err) {
13+
console.error(err);
14+
}
15+
}
16+
17+
_parse(require("./openrpc.json"))

components/AccessList.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"Definition": {
3+
"title": "Access list",
4+
"type": "object",
5+
"items": {
6+
"$ref": "#/Entry"
7+
}
8+
},
9+
"Entry": {
10+
"title": "Access list entry",
11+
"type": "object",
12+
"properties": {
13+
"address": {
14+
"$ref": "../schemas/address.json"
15+
},
16+
"storageKeys": {
17+
"type": "array",
18+
"items": {
19+
"$ref": "../schemas/hash32.json"
20+
}
21+
}
22+
}
23+
}
24+
}

components/Address.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"Definition": {
3+
"Singular": {
4+
"name": "address",
5+
"required": true,
6+
"schema": {
7+
"$ref": "../schemas/address.json"
8+
}
9+
},
10+
"Plural": {
11+
"name": "addresses",
12+
"required": true,
13+
"items": [
14+
{
15+
"$ref": "../schemas/address.json"
16+
}
17+
]
18+
}
19+
},
20+
"orNull": {
21+
"title": "addressOrNull",
22+
"oneOf": [
23+
{
24+
"$ref": "#/Definition/Singular"
25+
},
26+
{
27+
"$ref": "../schemas/null.json"
28+
}
29+
]
30+
}
31+
}

components/Block.json

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
{
2+
"Definition": {
3+
"title": "Block object",
4+
"type": "object",
5+
"required": [
6+
"transactions",
7+
"uncles"
8+
],
9+
"allOf": [
10+
{
11+
"$ref": "./Header.json"
12+
},
13+
{
14+
"$ref": "#/Transactions/Hash"
15+
},
16+
{
17+
"$ref": "#/Uncles"
18+
}
19+
]
20+
},
21+
"Number": {
22+
"name": "blockNumber",
23+
"title": "Block Number",
24+
"summary": "The number of blocks in the best chain",
25+
"schema": {
26+
"$ref": "../schemas/uint.json"
27+
}
28+
},
29+
"Latest": {
30+
"name": "latestBlockNumber",
31+
"summary": "the most recent block seen by this client",
32+
"required": true,
33+
"schema": {
34+
"$ref": "../schemas/uint.json"
35+
}
36+
},
37+
"Transactions": {
38+
"Count": {
39+
"name": "Transaction count",
40+
"schema": {
41+
"title": "Transaction count",
42+
"type": "array",
43+
"items": {
44+
"$ref": "../schemas/uint.json"
45+
}
46+
}
47+
},
48+
"Hash": {
49+
"title": "transactions",
50+
"type": "array",
51+
"items": {
52+
"$ref": "../schemas/hash32.json"
53+
}
54+
}
55+
},
56+
"Uncles": {
57+
"title": "uncles",
58+
"type": "array",
59+
"items": {
60+
"$ref": "../schemas/hash32.json"
61+
}
62+
},
63+
"OrNull": {
64+
"title": "blockOrNull",
65+
"oneOf": [
66+
{
67+
"$ref": "#/Definition"
68+
},
69+
{
70+
"$ref": "../schemas/null.json"
71+
}
72+
]
73+
},
74+
"NumberOrNull": {
75+
"title": "blockNumberOrNull",
76+
"description": "The block number. Note: if the block number is the pending block this will be Null",
77+
"oneOf": [
78+
{
79+
"$ref": "#/Number"
80+
},
81+
{
82+
"$ref": "../schemas/null.json"
83+
}
84+
]
85+
},
86+
"NumberOrTag": {
87+
"name": "blockNumberOrTag",
88+
"title": "Block number or tag",
89+
"required": true,
90+
"oneOf": [
91+
{
92+
"$ref": "#/Number"
93+
},
94+
{
95+
"$ref": "../schemas/blockTag.json"
96+
}
97+
]
98+
},
99+
"HashOrNull": {
100+
"title": "blockHashOrNull",
101+
"description": "The block hash. Note: if the block number is the pending block this will be Null",
102+
"oneOf": [
103+
{
104+
"$ref": "#/Hash"
105+
},
106+
{
107+
"$ref": "../schemas/null.json"
108+
}
109+
]
110+
},
111+
"Hash": {
112+
"name": "Block hash",
113+
"required": true,
114+
"schema": {
115+
"$ref": "../schemas/hash32.json"
116+
}
117+
},
118+
"NumberOrTagOrHash": {
119+
"name": "blockNumberOrIdentifierOrHash",
120+
"summary": "The desired block number, its hash, or a block tag",
121+
"schema": {
122+
"title": "blockNumberOrTagOrHash",
123+
"oneOf": [
124+
{
125+
"$ref": "#/Number"
126+
},
127+
{
128+
"$ref": "../schemas/blockTag.json"
129+
},
130+
{
131+
"$ref": "#/Hash"
132+
}
133+
]
134+
}
135+
}
136+
}

components/Bytecode.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"name": "Bytecode",
3+
"schema": {
4+
"$ref": "../schemas/bytes.json"
5+
}
6+
}

components/Data.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"Bytes": { "$ref": "../schemas/bytes.json"}
3+
}

components/EIPs/1559.json

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"Parameters": {
3+
"title": "EIP-1559 fee market parameters",
4+
"type": "object",
5+
"description": "EIP-1559 dynamic fee transactions have two fee parameters.",
6+
"required": [
7+
"maxFeePerGas",
8+
"maxPriorityFeePerGas"
9+
],
10+
"properties": {
11+
"maxPriorityFeePerGas": {
12+
"title": "max priority fee per gas",
13+
"description": "Maximum fee per gas the sender is willing to pay to miners in wei",
14+
"$ref": "../../schemas/uint.json"
15+
},
16+
"maxFeePerGas": {
17+
"title": "max fee per gas",
18+
"description": "The maximum total fee per gas the sender is willing to pay (includes the network / base fee and miner / priority fee) in wei",
19+
"$ref": "../../schemas/uint.json"
20+
}
21+
}
22+
},
23+
"LegacyParameters": {
24+
"title": "Legacy fee market parameters",
25+
"type": "object",
26+
"description": "Legacy transactions and EIP-2930 access list transaction include this parameter.",
27+
"required": [
28+
"gasPrice"
29+
],
30+
"properties": {
31+
"gasPrice": {
32+
"title": "gas price",
33+
"description": "The gas price willing to be paid by the sender in wei",
34+
"$ref": "../../schemas/uint.json"
35+
}
36+
}
37+
}
38+
}

components/Filter.json

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
{
2+
"Definition": {
3+
"title": "filter",
4+
"type": "object",
5+
"properties": {
6+
"fromBlock": {
7+
"title": "from block",
8+
"$ref": "../schemas/uint.json"
9+
},
10+
"toBlock": {
11+
"title": "to block",
12+
"$ref": "../schemas/uint.json"
13+
},
14+
"address": {
15+
"title": "Address(es)",
16+
"oneOf": [
17+
{
18+
"title": "Address",
19+
"$ref": "../schemas/address.json"
20+
},
21+
{
22+
"title": "Addresses",
23+
"$ref": "../schemas/addresses.json"
24+
}
25+
]
26+
},
27+
"topics": {
28+
"title": "Topics",
29+
"$ref": "./Topics.json"
30+
}
31+
}
32+
},
33+
"Results": {
34+
"title": "filter results",
35+
"oneOf": [
36+
{"$ref": "#/BlockHashes"},
37+
{"$ref": "#/TransactionHashes"},
38+
{"$ref": "#/Logs"}
39+
]
40+
},
41+
"BlockHashes": {
42+
"title": "new block hashes",
43+
"type": "array",
44+
"items": {
45+
"$ref": "../schemas/hash32.json"
46+
}
47+
},
48+
"TransactionHashes": {
49+
"title": "new transaction hashes",
50+
"type": "array",
51+
"items": {
52+
"$ref": "../schemas/hash32.json"
53+
}
54+
},
55+
"Logs": {
56+
"title": "new logs",
57+
"type": "array",
58+
"items": {
59+
"$ref": "./Logs.json#/Logs"
60+
}
61+
},
62+
"Identifier": {
63+
"name": "Filter Identifier",
64+
"schema": {
65+
"$ref": "../schemas/uint.json"
66+
}
67+
}
68+
}

components/From.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"title": "From",
3+
"description": "The transaction sender's address",
4+
"$ref": "../schemas/address.json"
5+
}

0 commit comments

Comments
 (0)