Get contract events

Retrieves a list of events that have been triggered by a given smart contract.


GET
/extended/v1/contract/{contract_id}/events

Path Parameters

contract_idstring

Contract identifier formatted as <contract_address>.<contract_name>

Query Parameters

limit?Limit

max number of events to fetch

Default20
Rangevalue <= 50
offset?Offset

Result offset

Default0

Response Body

curl -X GET "https://api.hiro.so/extended/v1/contract/SP6P4EJF0VG8V0RB3TQQKJBHDQKEF6NVRD1KZE3C.satoshibles/events?limit=20"
fetch("https://api.hiro.so/extended/v1/contract/SP6P4EJF0VG8V0RB3TQQKJBHDQKEF6NVRD1KZE3C.satoshibles/events?limit=20")
package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {
  url := "https://api.hiro.so/extended/v1/contract/SP6P4EJF0VG8V0RB3TQQKJBHDQKEF6NVRD1KZE3C.satoshibles/events?limit=20"

  req, _ := http.NewRequest("GET", url, nil)
  
  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))
}
import requests

url = "https://api.hiro.so/extended/v1/contract/SP6P4EJF0VG8V0RB3TQQKJBHDQKEF6NVRD1KZE3C.satoshibles/events?limit=20"

response = requests.request("GET", url)

print(response.text)
{
  "limit": 0,
  "offset": 0,
  "results": [
    {
      "event_index": 0,
      "event_type": "smart_contract_log",
      "tx_id": "string",
      "contract_log": {
        "contract_id": "string",
        "topic": "string",
        "value": {
          "hex": "string",
          "repr": "string"
        }
      }
    }
  ]
}
{
  "error": "string",
  "message": "string"
}