Skip to content

Latest commit

 

History

History
43 lines (34 loc) · 1.13 KB

node-api.md

File metadata and controls

43 lines (34 loc) · 1.13 KB

Node API

Node provides REST API to access the current blockchain status.

Get the events generated by program

You can get the generated events by name and the address of the program where they were generated.

Request

GET api/events?address=<hex formatted address>&name=<name of event>[&offset=<integer>&count=<integer>]

Response

The list of data from events with given name at the given address:

[
    {
        "data": "<some data from the first event>",
        "offset": 0
    },
    {
        "data": "<some data from the second event>",
        "offset": 1
    }
    ...
]

Examples

curl <api url>/api/events?address=e1941077e00b3cf81a8275788334292d9b2e2f0002bd622444cb37fa5e4d08a0&name=myevent

will return all events for give address and name

curl <api url>/api/events?address=e1941077e00b3cf81a8275788334292d9b2e2f0002bd622444cb37fa5e4d08a0&name=myevent&offset=10

will return all events starting from offset 10

curl <api url>/api/events?address=e1941077e00b3cf81a8275788334292d9b2e2f0002bd622444cb37fa5e4d08a0&name=myevent&offset=10&count=20

will return only first 20 events from offset 10