---
# System prepended metadata

title: Txn Event Search

---

# Txn Event Search



Findora transactions have metadata called events which have a field `type` and a list of attributes for e.g.
```
{
  "type": "tx",
  "attributes": [
    {
      "key": "cHJlaGFzaA==",
      "value": "ODNjMmVjNjc1YTI0MGJmMDBkMTQ5ZTA2ZjkxMTM3YzRjNzEzMjkwZGVjMDEzYmEyODI3MWRiMWU0ZTlmNDBjYg=="
    },
    {
      "key": "dGltZXN0YW1w",
      "value": "MTY1MzYwNzY0MA=="
    }
  ]
}
```

Wallet wants an api to query the events base on the event type and its attributes.

For example the search query would be like

    type = commitment.created 
    has_attribute = G96MKTtr5pQ1ou6iRgvHPqLELtgrYHai89HAnvfubNdd=y
    

which would return all matching txns like 

```
{
  "jsonrpc": "2.0",
  "id": -1,
  "result": {
    "txs": [
      {
        "hash": "FFA644AD03F82D60D037C1AF07311988475D90A0EB20892601690447D009A1F1",
        "height": "78",
        "index": 0,
        "tx_result": {
          "code": 0,
          "data": null,
          "log": "",
          "info": "",
          "gasWanted": "0",
          "gasUsed": "0",
          "events": [
            {
              "type": "tx",
              "attributes": [
                {
                  "key": "cHJlaGFzaA==",
                  "value": "ODNjMmVjNjc1YTI0MGJmMDBkMTQ5ZTA2ZjkxMTM3YzRjNzEzMjkwZGVjMDEzYmEyODI3MWRiMWU0ZTlmNDBjYg=="
                },
                {
                  "key": "dGltZXN0YW1w",
                  "value": "MTY1MzYwNzY0MA=="
                }
              ]
            },
            {
              "type": "addr",
              "attributes": [
                {
                  "key": "ZnJvbQ==",
                  "value": "W10="
                },
                {
                  "key": "dG8=",
                  "value": "W10="
                }
              ]
            },
            {
              "type": "nullifier.used",
              "attributes": [
                {
                  "key": "SjQ0QXNObXFoZm9QYUxGU1A1a1lCbkN3eDdqZ0pWZTNMWDVGNEN3S2djY1I=",
                  "value": "eQ=="
                },
                {
                  "key": "NWFIQ3JQRHNrbTZQaTRNbnJWa1FVaHo5cDZvTVl2cmdSd3AzQjcxclZUZUo=",
                  "value": "eQ=="
                },
                {
                  "key": "MmpGYlJqOXBCTm1aOWtWQlRnaTdoWThOTWs5SnJuS1U5Y2JWV3BEM01yYU0=",
                  "value": "eQ=="
                }
              ]
            },
            {
              "type": "commitment.created",
              "attributes": [
                {
                  "key": "Rzk2TUtUdHI1cFExb3U2aVJndkhQcUxFTHRncllIYWk4OUhBbnZmdWJOZGQ=",
                  "value": "eQ=="
                },
                {
                  "key": "RnFTcnQ2Vm1RN2FUdzVCNkh5NlFTSHVxV1MyaVFlSmFLWnA5NE5QZXlxeXM=",
                  "value": "eQ=="
                },
                {
                  "key": "N3NnRHRZWWRxbUZDRE14R2NmRFQ2RTVTU3JaMlBENlpVQmtDRGI2dVROYUI=",
                  "value": "eQ=="
                },
                {
                  "key": "NVFydEtiRHBEWEdpY0VMWEdOTExXTTFIenBaaHpFUXI0Q0d4NHhvWlZtd3g=",
                  "value": "eQ=="
                },
                {
                  "key": "SHdzdHhFZlhpaFhiMzRVZFF5Q2hVZ2ZzdHV0YUFlaTVkdHF6dnpKSGdDNnA=",
                  "value": "eQ=="
                },
                {
                  "key": "MjltdkZqMmIyaldhRDhDeFRlUVVRWnM3dHhEUTdQQWt6OVVzNjVlVGFUbWM=",
                  "value": "eQ=="
                }
              ]
            }
          ],
          "codespace": ""
        },
        "tx": "eyJib2R5Ijp7Im5vX3JlcGxheV90b2tlbiI6W1s1MywxNDQsMjExLDE3OCwyMzAsMTEyLDIwMSw2OV0sMjJdLCJvcGVyYXRpb25zIjpbeyJUcmFuc2ZlckFub25Bc3NldCI6eyJub3RlIjp7ImJvZHkiOnsiaW5wdXRzIjpbIl9WOEJNakhCeTRjdGVOdkZhSUVoaVhEbVpEUXhRSk8xay1XN3ZlS0R0U289IiwiUV9VOG1MSVB5WlRTbDNjYzVONTNFOGdGUTJaR1NaVDM3enlHeV91Uk9Rcz0iLCJHYTZVOXhmM2h3dS03bUVkdHBtcF8yUkp3ZWtHRjkzdHlSOTY5VXc1ZG5JPSJdLCJvdXRwdXRzIjpbeyJjb21taXR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LCJzaWdtYV9ldmFsX2dfYmV0YSI6IjRYWlVoOE1ueTlpNXZaSDR5YlU0YkJ0N3lLVmxLY0xqbFU5WmFZQlptMWs9IiwicGVybXNfZXZhbF9iZXRhIjpbIlpDa2R5bTR0NzhndWh3a0pCMEExTEdBUS1JNEplSktjcXN3eEpoVnJrMU09IiwibnZ5QnVfQ1lpUXZPOTFDQm9pODhJV3BtMTJrQkNXM0ZkU196a3BIZmtUVT0iLCJfdWhWZ3kzLWUteTIxRkE1cWJLcWwtV3ljQVh5ZnVQXzJ0QWp3eFV3eGo4PSIsIlB2U1pCYkw1TjNCbEtTdUlOVUV5ODNpVFBxazBHNlV2X0hhZlR5YUp3RFU9Il0sImxfZXZhbF9iZXRhIjoiOUZ2ZlN1dzVEM0daSmZERHFkZWtEQWhKcC1qbGV0TGpRM3RXMmpibVFBYz0iLCJiYXRjaF9ldmFsX3Byb29mIjp7ImNvbW1pdG1lbnQiOnsidmFsdWUiOiJub0tzZTd5OEZjRnJhVkhydndzZFhJTlNGN1NRS05yYVRPX1VibXRlbGJYdi1Jc2tIUkt3d2ZTdFk5MElUTEFTIn0sImV2YWxfcHJvb2YiOiJ0ckg0V2h4NzB4ZEh5cUhydDBnY0h1SkJQMlp0clpvcnhKZjRsUUYyRnZzQWNPNEdudVIxRUJRdGxGTndRVVlXIn19LCJub25fbWFsbGVhYmlsaXR5X3RhZyI6InU1NlhhMHNWdVEwQ0o1WXpNbTVYbVdfaGNub05fXzRnYVNXQlV3am1kMEE9In0sIm5vbmNlIjpbWzUzLDE0NCwyMTEsMTc4LDIzMCwxMTIsMjAxLDY5XSwyMl19fV19fQ=="
      }
    ],
    "total_count": "1"
  }
}
```

NOTE: Tendermint saves the attributes key as base64 encoded, so the result JSON currently has it in base64 form. FS API can return it as the original string if it saved as such.

Here for example, "`G96MKTtr5pQ1ou6iRgvHPqLELtgrYHai89HAnvfubNdd`"  and "`y`"  are shown as "`Rzk2TUtUdHI1cFExb3U2aVJndkhQcUxFTHRncllIYWk4OUhBbnZmdWJOZGQ`=" and "`eQ==`" in the above response.

Also we need the API to query by multiple attributes of same event type

    type = commitment.created 
    has_attribute = G96MKTtr5pQ1ou6iRgvHPqLELtgrYHai89HAnvfubNdd='y' or HwstxEfXihXb34UdQyChUgfstutaAei5dtqzvzJHgC6p='y'
    
A search API needs to support only one event-type at a time.
    

The API should support pagination.

The current event-types of interest are 
- `addr.from`
- `addr.to`
- `nullifier.used`
- `commitment.created`