Skip to content

suix_queryEvents ​

Extended API

Return list of events for a specified query criteria.

Parameters ​

  • query · EventFilter · requiredThe event query criteria. See Event filter documentation for examples.

    • All · any[] Return all events.
    • Any · EventFilter[] Return events that match any of the given filters. Only supported on event subscriptions.
    • Sender · SuiAddressQuery by sender address.
    • Transaction · TransactionDigestReturn events emitted by the given transaction.
    • MoveModule · objectReturn events emitted in a specified Move module. If the event is defined in Module A but emitted in a tx with Module B, query MoveModule by module B returns the event. Query MoveEventModule by module A returns the event too.
    • MoveEventType · stringReturn events with the given Move event struct name (struct tag). For example, if the event is defined in 0xabcd::MyModule, and named Foo, then the struct tag is 0xabcd::MyModule::Foo.
    • MoveEventModule · objectReturn events with the given Move module name where the event struct is defined. If the event is defined in Module A but emitted in a tx with Module B, query MoveEventModule by module A returns the event. Query MoveModule by module B returns the event too.
    • TimeRange · objectReturn events emitted in [start_time, end_time] interval
  • cursor · EventID · optionaloptional paging cursor

  • limit · integer (uint) · optionalmaximum number of items per page, default to [QUERY_MAX_RESULT_LIMIT] if not specified.

  • descending_order · boolean · optionalquery result ordering, default to false (ascending order), oldest record first.

Result ​

Example ​

Request ​

bash
curl https://mainnet-api.inodra.com/v1/jsonrpc \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: YOUR_API_KEY' \
  -d '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "suix_queryEvents",
  "params": [
    {
      "MoveModule": {
        "package": "0xa395759ca37c6e1ffc179184e98a6f9a2da5d78f6e34b0e5044ed52a6bc0a1bc",
        "module": "test"
      }
    },
    {
      "txDigest": "Eg3ynETJfTfPKyvJzq3VLG6MngURYHPMjjUJ3Xt1t7tf",
      "eventSeq": "1"
    },
    100,
    false
  ]
}'

Response ​

json
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "data": [
      {
        "id": {
          "txDigest": "FFwCMgC7FHBLEwfL9JeSeR2EhMAZMykUPVW1kE3HgTMe",
          "eventSeq": "1"
        },
        "packageId": "0xb2fd632992b01aa25900867288b63d6255ff8223c12b0fd985c49d5777a0d65a",
        "transactionModule": "test",
        "sender": "0xcceee09f44d558691334ec0aff47af033f57162a2f33056e2585e2c46863ac02",
        "type": "0x3::test::Test<0x3::test::Test>",
        "parsedJson": "some_value",
        "bcsEncoding": "base64",
        "bcs": ""
      },
      {
        "id": {
          "txDigest": "FUMhRSj76es8MYeaRYeaBnppk56cuEehKwL2CiU82U7B",
          "eventSeq": "1"
        },
        "packageId": "0xb2fd632992b01aa25900867288b63d6255ff8223c12b0fd985c49d5777a0d65a",
        "transactionModule": "test",
        "sender": "0x84bd999f9ff7a1804872957fafa528628a24386298faa98850887f64da841b87",
        "type": "0x3::test::Test<0x3::test::Test>",
        "parsedJson": "some_value",
        "bcsEncoding": "base64",
        "bcs": ""
      },
      {
        "id": {
          "txDigest": "CkEYWW2zxTCGBLvUcTARhyX92fu2uc7cnCUXfCiqAypp",
          "eventSeq": "1"
        },
        "packageId": "0xb2fd632992b01aa25900867288b63d6255ff8223c12b0fd985c49d5777a0d65a",
        "transactionModule": "test",
        "sender": "0x279efd098d59a66a3d9adc87cce81fe9ec69dc8105b2b60140589ec8be44c29f",
        "type": "0x3::test::Test<0x3::test::Test>",
        "parsedJson": "some_value",
        "bcsEncoding": "base64",
        "bcs": ""
      },
      {
        "id": {
          "txDigest": "Eg3ynETJfTfPKyvJzq3VLG6MngURYHPMjjUJ3Xt1t7tf",
          "eventSeq": "1"
        },
        "packageId": "0xb2fd632992b01aa25900867288b63d6255ff8223c12b0fd985c49d5777a0d65a",
        "transactionModule": "test",
        "sender": "0x289be027d2a94f744b4c59fda7b528f9c59f430eaba84b8bee9b43a30f9cc83f",
        "type": "0x3::test::Test<0x3::test::Test>",
        "parsedJson": "some_value",
        "bcsEncoding": "base64",
        "bcs": ""
      }
    ],
    "nextCursor": {
      "txDigest": "Eg3ynETJfTfPKyvJzq3VLG6MngURYHPMjjUJ3Xt1t7tf",
      "eventSeq": "1"
    },
    "hasNextPage": false
  }
}

The full-stack Sui data layer.