Skip to content

Commit eb2d2f9

Browse files
authored
Add documentation for get_addresses_datastore_keys (#441)
Signed-off-by: Jean-François <jfm@laposte.net>
1 parent 29b688d commit eb2d2f9

1 file changed

Lines changed: 100 additions & 0 deletions

File tree

docs/build/api/jsonrpc.mdx

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,106 @@ curl --location --request POST 'https://buildnet.massa.net/api/v2' \
399399
</p>
400400
</details>
401401

402+
### get_addresses_datastore_keys
403+
404+
**Available from versions MAIN.3.0 for Mainnet / DEVN.28.14 for Buildnet.**
405+
406+
Retrieve datastore keys for given addresses.
407+
408+
#### Parameters
409+
410+
| Field | Type | Mandatory | Default | Description |
411+
|-----------------------|-------------------|-----------|---------|-----------------------------------------------------------------------------|
412+
| `address` | `string` | Yes | N/A | The blockchain address for which to retrieve datastore keys. |
413+
| `prefix` | `array<integer>` | Yes | `[]` | A prefix to filter the datastore keys (bytes represented as array of integers). |
414+
| `is_final` | `boolean` | Yes | `true` | Whether to retrieve keys from the final state of the blockchain. |
415+
| `start_key` | `array<integer>` | No | `null` | The key to start filtering from (inclusive by default). Bytes as array of integers. |
416+
| `inclusive_start_key` | `boolean` | No | `true` | Include or exclude the start_key. |
417+
| `end_key` | `array<integer>` | No | `null` | The key to end filtering at (inclusive by default). Bytes as array of integers. |
418+
| `inclusive_end_key` | `boolean` | No | `true` | Include or exclude the end_key. |
419+
| `count` | `integer` | No | `500` | The maximum number of keys to retrieve (Max: 500). |
420+
421+
<Tabs>
422+
<TabItem value="json (Mainnet)" label="cURL (Mainnet)" default>
423+
424+
```shell
425+
curl --location --request POST 'https://mainnet.massa.net/api/v2' \
426+
--header 'Content-Type: application/json' \
427+
--data-raw '{
428+
"jsonrpc": "2.0",
429+
"id": 1,
430+
"method": "get_addresses_datastore_keys",
431+
"params": [
432+
[
433+
{
434+
"address": "AS1iBwn89sM1GsTRu7PCK1DuYqZ7ckuF7M9gM1Ybx7rpzMw2tKc1",
435+
"prefix": [107],
436+
"is_final": true,
437+
"start_key": [107,101,121,49],
438+
"inclusive_start_key": true,
439+
"end_key": [107,101,121,51],
440+
"inclusive_end_key": false,
441+
"count": 10
442+
}
443+
]
444+
]
445+
}'
446+
```
447+
448+
</TabItem>
449+
<TabItem value="json (Buildnet)" label="cURL (Buildnet)">
450+
451+
```shell
452+
curl --location --request POST 'https://buildnet.massa.net/api/v2' \
453+
--header 'Content-Type: application/json' \
454+
--data-raw '{
455+
"jsonrpc": "2.0",
456+
"id": 1,
457+
"method": "get_addresses_datastore_keys",
458+
"params": [
459+
[
460+
{
461+
"address": "AS1iBwn89sM1GsTRu7PCK1DuYqZ7ckuF7M9gM1Ybx7rpzMw2tKc1",
462+
"prefix": [107],
463+
"is_final": true,
464+
"start_key": [107,101,121,49],
465+
"inclusive_start_key": true,
466+
"end_key": [107,101,121,51],
467+
"inclusive_end_key": false,
468+
"count": 10
469+
}
470+
]
471+
]
472+
}'
473+
```
474+
475+
</TabItem>
476+
</Tabs>
477+
478+
<details>
479+
<summary>Example response: </summary>
480+
<p>
481+
482+
```json
483+
{
484+
"jsonrpc": "2.0",
485+
"result": [
486+
{
487+
"address": "AS12KMSMMARaHNZYkWeUSBE9JrjBPSQr6q7NXHGDoGweCrdNkHELj",
488+
"is_final": true,
489+
"keys": [
490+
[107,101,121,49],
491+
[107,101,121,50]
492+
]
493+
}
494+
],
495+
"id": 1
496+
}
497+
```
498+
499+
</p>
500+
</details>
501+
402502
### get_graph_interval
403503

404504
Get information about block graph

0 commit comments

Comments
 (0)