Skip to content

Commit 8128c74

Browse files
fix(build,api-refernce): fix erros in RPC API for the zks namespace (#143)
# Description Fix errors in RPC API for the `zks` namespace.
1 parent 4c706f7 commit 8128c74

File tree

1 file changed

+145
-143
lines changed

1 file changed

+145
-143
lines changed

content/00.build/70.api-reference/20.zks-rpc.md

Lines changed: 145 additions & 143 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,6 @@ curl --request POST \
106106

107107
---
108108

109-
<!-- // TODO: @dutterbutter
110-
// Return to this method once its live in next upgrade. -->
111109
## `zks_getBridgehubContract`
112110

113111
Retrieves the bridge hub contract address.
@@ -139,7 +137,7 @@ curl --request POST \
139137
```json
140138
{
141139
"jsonrpc": "2.0",
142-
"result": null,
140+
"result": "0x303a465b659cbb0ab36ee643ea362c509eeb5213",
143141
"id": 1
144142
}
145143
```
@@ -355,7 +353,7 @@ position in an alphabetically sorted array of tokens.
355353
#### Parameters
356354

357355
1. **uint32** - token id from which to start.
358-
1. **uint8** - maximum number of tokens to list.
356+
2. **uint8** - maximum number of tokens to list.
359357

360358
#### Returns
361359

@@ -468,9 +466,9 @@ Retrieves the proof for an L2 to L1 message.
468466
#### Parameters
469467

470468
1. **uint32** - L2 block number.
471-
1. **DATA, 20 bytes** - sender's address.
472-
1. **DATA, 32 bytes** - message hash.
473-
1. **number** - Optional. The log position in L2.
469+
2. **DATA, 20 bytes** - sender's address.
470+
3. **DATA, 32 bytes** - message hash.
471+
4. **number** - Optional. The log position in L2.
474472

475473
#### Example Request
476474

@@ -501,7 +499,7 @@ Retrieves the log proof for an L2 to L1 transaction.
501499
#### Parameters
502500

503501
1. **DATA, 32 bytes** - transaction hash.
504-
1. **integer** - Optional. Index of the log.
502+
2. **integer** - Optional. Index of the log.
505503

506504
#### Returns
507505

@@ -1091,7 +1089,7 @@ Object
10911089
- **version_id**: uint16 - protocol version ID.
10921090
- **timestamp**: uint64 - Unix timestamp of the version's activation.
10931091
- **verification_keys_hashes**: Object - Contains the hashes of various verification keys used in the protocol.
1094-
- **base_system_contracts**: Object - Addresses of the base system contracts, like the bootloader and default account abstraction (AA).
1092+
- **base_system_contracts**: Object - Hashes of the base system contracts, like the bootloader and default account abstraction (AA).
10951093
- **l2_system_upgrade_tx_hash**: DATA, 32 bytes - hash of the transaction used for the system upgrade, if any.
10961094

10971095
#### Example Request
@@ -1168,8 +1166,8 @@ without tags: `blake2s256(left_child_hash ++ right_child_hash)`
11681166
#### Parameters
11691167

11701168
1. **DATA, 20 bytes** - account address to fetch storage values and proofs for.
1171-
1. **Array of Data, 32 bytes** - the keys in the account.
1172-
1. **uint32** - Number of the L1 batch specifying the point in time at which the requested values are returned.
1169+
2. **Array of Data, 32 bytes** - the keys in the account.
1170+
3. **uint32** - Number of the L1 batch specifying the point in time at which the requested values are returned.
11731171

11741172
#### Returns
11751173

@@ -1189,7 +1187,7 @@ The method returns an object containing the account details and proofs for stora
11891187
are omitted starting from the end of the Merkle path.
11901188
For instance, if there are 255 hashes in the `proof`,
11911189
the single omitted hash is the hash of an empty subtree (`empty_value_hash = blake2s256([0_u8; 40])`).
1192-
Further omitted hashes are calculated progressively as hashes of the concatenated pair of the previous level's omitted hash
1190+
Further, omitted hashes are calculated progressively as hashes of the concatenated pair of the previous level's omitted hash
11931191
(e.g., `blake2s256(empty_value_hash ++ empty_value_hash)`), and so on, indicating progressively higher levels of empty subtrees in the Merkle tree.
11941192

11951193
Using the information in each `storageProof`, one can reconstruct the Merkle tree's root hash
@@ -1269,136 +1267,140 @@ curl -X POST -H "Content-Type: application/json" \
12691267

12701268
```json
12711269
{
1272-
"transactionHash": "0xd586a9381ac33a70d1c34704664209242ee90316878fc1695aa8e4cf553c8595",
1273-
"storageLogs": [
1274-
{
1275-
"address": "0x000000000000000000000000000000000000800b",
1276-
"key": "0x7",
1277-
"writtenValue": "0x40000000000000000000000006641f961"
1278-
},
1279-
{
1280-
"address": "0x000000000000000000000000000000000000800b",
1281-
"key": "0x6",
1282-
"writtenValue": "0x5f5e100"
1283-
},
1284-
{
1285-
"address": "0x000000000000000000000000000000000000800b",
1286-
"key": "0x9",
1287-
"writtenValue": "0xc0000000000000000000000006641f961"
1288-
},
1289-
{
1290-
"address": "0x000000000000000000000000000000000000800b",
1291-
"key": "0x16",
1292-
"writtenValue": "0xe1ef29fc6c51f74bbdef5bc1406e3c9925d89c5b1f79215648b82ac15419bcbe"
1293-
},
1294-
{
1295-
"address": "0x000000000000000000000000000000000000800b",
1296-
"key": "0xa",
1297-
"writtenValue": "0x0"
1298-
},
1299-
{
1300-
"address": "0x000000000000000000000000000000000000800b",
1301-
"key": "0x10c",
1302-
"writtenValue": "0xc0000000000000000000000006641f961"
1303-
},
1304-
{
1305-
"address": "0x000000000000000000000000000000000000800b",
1306-
"key": "0xa",
1307-
"writtenValue": "0xe3ed371c32f62f3b3a28d51b909b2668e293c6cbfa4b4fd549c8f00a9a93a296"
1308-
},
1309-
{
1310-
"address": "0x000000000000000000000000000000000000800b",
1311-
"key": "0x110",
1312-
"writtenValue": "0x0"
1313-
},
1314-
{
1315-
"address": "0x000000000000000000000000000000000000800b",
1316-
"key": "0x10f",
1317-
"writtenValue": "0x88"
1318-
},
1319-
{
1320-
"address": "0x000000000000000000000000000000000000800b",
1321-
"key": "0x1",
1322-
"writtenValue": "0x8001"
1323-
},
1324-
{
1325-
"address": "0x000000000000000000000000000000000000800b",
1326-
"key": "0x2",
1327-
"writtenValue": "0x5f5e100"
1328-
},
1329-
{
1330-
"address": "0x0000000000000000000000000000000000008003",
1331-
"key": "0xeaa2b2fbf0b42c559059e5e9510edc15755f1c1883f0e41d5ba5f9aea4ac201a",
1332-
"writtenValue": "0x4"
1333-
},
1334-
{
1335-
"address": "0x000000000000000000000000000000000000800a",
1336-
"key": "0xeaa2b2fbf0b42c559059e5e9510edc15755f1c1883f0e41d5ba5f9aea4ac201a",
1337-
"writtenValue": "0x55ce6fa97340"
1338-
},
1339-
{
1340-
"address": "0x000000000000000000000000000000000000800a",
1341-
"key": "0x31b66141c575a054316a84da9cf4aa6fe0abd373cab1bf4ac029ffc061aae0da",
1342-
"writtenValue": "0xb9b031bf400"
1343-
},
1344-
{
1345-
"address": "0x000000000000000000000000000000000000800b",
1346-
"key": "0x1",
1347-
"writtenValue": "0x36615cf349d7f6344891b1e7ca7c72883f5dc049"
1348-
},
1349-
{
1350-
"address": "0x000000000000000000000000000000000000800b",
1351-
"key": "0x1",
1352-
"writtenValue": "0x8001"
1353-
},
1354-
{
1355-
"address": "0x000000000000000000000000000000000000800a",
1356-
"key": "0x31b66141c575a054316a84da9cf4aa6fe0abd373cab1bf4ac029ffc061aae0da",
1357-
"writtenValue": "0xa7557c54f00"
1358-
},
1359-
{
1360-
"address": "0x000000000000000000000000000000000000800a",
1361-
"key": "0xeaa2b2fbf0b42c559059e5e9510edc15755f1c1883f0e41d5ba5f9aea4ac201a",
1362-
"writtenValue": "0x56f41b001840"
1363-
}
1364-
],
1365-
"events": [
1366-
{
1367-
"address": "0x000000000000000000000000000000000000800a",
1368-
"topics": [
1369-
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
1370-
"0x00000000000000000000000036615cf349d7f6344891b1e7ca7c72883f5dc049",
1371-
"0x0000000000000000000000000000000000000000000000000000000000008001"
1372-
],
1373-
"data": "0x00000000000000000000000000000000000000000000000000000b9b031bf400",
1374-
"blockHash": null,
1375-
"blockNumber": null,
1376-
"l1BatchNumber": "0x4",
1377-
"transactionHash": "0xd586a9381ac33a70d1c34704664209242ee90316878fc1695aa8e4cf553c8595",
1378-
"transactionIndex": "0x0",
1379-
"logIndex": null,
1380-
"transactionLogIndex": null,
1381-
"logType": null,
1382-
"removed": false
1383-
},
1384-
{
1385-
"address": "0x000000000000000000000000000000000000800a",
1386-
"topics": [
1387-
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
1388-
"0x0000000000000000000000000000000000000000000000000000000000008001",
1389-
"0x00000000000000000000000036615cf349d7f6344891b1e7ca7c72883f5dc049"
1390-
],
1391-
"data": "0x00000000000000000000000000000000000000000000000000000125ab56a500",
1392-
"blockHash": null,
1393-
"blockNumber": null,
1394-
"l1BatchNumber": "0x4",
1395-
"transactionHash": "0xd586a9381ac33a70d1c34704664209242ee90316878fc1695aa8e4cf553c8595",
1396-
"transactionIndex": "0x0",
1397-
"logIndex": null,
1398-
"transactionLogIndex": null,
1399-
"logType": null,
1400-
"removed": false
1401-
}
1402-
]
1270+
"jsonrpc": "2.0",
1271+
"result": {
1272+
"transactionHash": "0xd586a9381ac33a70d1c34704664209242ee90316878fc1695aa8e4cf553c8595",
1273+
"storageLogs": [
1274+
{
1275+
"address": "0x000000000000000000000000000000000000800b",
1276+
"key": "0x7",
1277+
"writtenValue": "0x40000000000000000000000006641f961"
1278+
},
1279+
{
1280+
"address": "0x000000000000000000000000000000000000800b",
1281+
"key": "0x6",
1282+
"writtenValue": "0x5f5e100"
1283+
},
1284+
{
1285+
"address": "0x000000000000000000000000000000000000800b",
1286+
"key": "0x9",
1287+
"writtenValue": "0xc0000000000000000000000006641f961"
1288+
},
1289+
{
1290+
"address": "0x000000000000000000000000000000000000800b",
1291+
"key": "0x16",
1292+
"writtenValue": "0xe1ef29fc6c51f74bbdef5bc1406e3c9925d89c5b1f79215648b82ac15419bcbe"
1293+
},
1294+
{
1295+
"address": "0x000000000000000000000000000000000000800b",
1296+
"key": "0xa",
1297+
"writtenValue": "0x0"
1298+
},
1299+
{
1300+
"address": "0x000000000000000000000000000000000000800b",
1301+
"key": "0x10c",
1302+
"writtenValue": "0xc0000000000000000000000006641f961"
1303+
},
1304+
{
1305+
"address": "0x000000000000000000000000000000000000800b",
1306+
"key": "0xa",
1307+
"writtenValue": "0xe3ed371c32f62f3b3a28d51b909b2668e293c6cbfa4b4fd549c8f00a9a93a296"
1308+
},
1309+
{
1310+
"address": "0x000000000000000000000000000000000000800b",
1311+
"key": "0x110",
1312+
"writtenValue": "0x0"
1313+
},
1314+
{
1315+
"address": "0x000000000000000000000000000000000000800b",
1316+
"key": "0x10f",
1317+
"writtenValue": "0x88"
1318+
},
1319+
{
1320+
"address": "0x000000000000000000000000000000000000800b",
1321+
"key": "0x1",
1322+
"writtenValue": "0x8001"
1323+
},
1324+
{
1325+
"address": "0x000000000000000000000000000000000000800b",
1326+
"key": "0x2",
1327+
"writtenValue": "0x5f5e100"
1328+
},
1329+
{
1330+
"address": "0x0000000000000000000000000000000000008003",
1331+
"key": "0xeaa2b2fbf0b42c559059e5e9510edc15755f1c1883f0e41d5ba5f9aea4ac201a",
1332+
"writtenValue": "0x4"
1333+
},
1334+
{
1335+
"address": "0x000000000000000000000000000000000000800a",
1336+
"key": "0xeaa2b2fbf0b42c559059e5e9510edc15755f1c1883f0e41d5ba5f9aea4ac201a",
1337+
"writtenValue": "0x55ce6fa97340"
1338+
},
1339+
{
1340+
"address": "0x000000000000000000000000000000000000800a",
1341+
"key": "0x31b66141c575a054316a84da9cf4aa6fe0abd373cab1bf4ac029ffc061aae0da",
1342+
"writtenValue": "0xb9b031bf400"
1343+
},
1344+
{
1345+
"address": "0x000000000000000000000000000000000000800b",
1346+
"key": "0x1",
1347+
"writtenValue": "0x36615cf349d7f6344891b1e7ca7c72883f5dc049"
1348+
},
1349+
{
1350+
"address": "0x000000000000000000000000000000000000800b",
1351+
"key": "0x1",
1352+
"writtenValue": "0x8001"
1353+
},
1354+
{
1355+
"address": "0x000000000000000000000000000000000000800a",
1356+
"key": "0x31b66141c575a054316a84da9cf4aa6fe0abd373cab1bf4ac029ffc061aae0da",
1357+
"writtenValue": "0xa7557c54f00"
1358+
},
1359+
{
1360+
"address": "0x000000000000000000000000000000000000800a",
1361+
"key": "0xeaa2b2fbf0b42c559059e5e9510edc15755f1c1883f0e41d5ba5f9aea4ac201a",
1362+
"writtenValue": "0x56f41b001840"
1363+
}
1364+
],
1365+
"events": [
1366+
{
1367+
"address": "0x000000000000000000000000000000000000800a",
1368+
"topics": [
1369+
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
1370+
"0x00000000000000000000000036615cf349d7f6344891b1e7ca7c72883f5dc049",
1371+
"0x0000000000000000000000000000000000000000000000000000000000008001"
1372+
],
1373+
"data": "0x00000000000000000000000000000000000000000000000000000b9b031bf400",
1374+
"blockHash": null,
1375+
"blockNumber": null,
1376+
"l1BatchNumber": "0x4",
1377+
"transactionHash": "0xd586a9381ac33a70d1c34704664209242ee90316878fc1695aa8e4cf553c8595",
1378+
"transactionIndex": "0x0",
1379+
"logIndex": null,
1380+
"transactionLogIndex": null,
1381+
"logType": null,
1382+
"removed": false
1383+
},
1384+
{
1385+
"address": "0x000000000000000000000000000000000000800a",
1386+
"topics": [
1387+
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
1388+
"0x0000000000000000000000000000000000000000000000000000000000008001",
1389+
"0x00000000000000000000000036615cf349d7f6344891b1e7ca7c72883f5dc049"
1390+
],
1391+
"data": "0x00000000000000000000000000000000000000000000000000000125ab56a500",
1392+
"blockHash": null,
1393+
"blockNumber": null,
1394+
"l1BatchNumber": "0x4",
1395+
"transactionHash": "0xd586a9381ac33a70d1c34704664209242ee90316878fc1695aa8e4cf553c8595",
1396+
"transactionIndex": "0x0",
1397+
"logIndex": null,
1398+
"transactionLogIndex": null,
1399+
"logType": null,
1400+
"removed": false
1401+
}
1402+
]
1403+
},
1404+
"id": 1
14031405
}
14041406
```

0 commit comments

Comments
 (0)