How to get events? (WIP)

  • getEvents

This function is used to Get events from the L1X Core blockchain based on the provided criteria.

import { L1XProvider, GetEventsArg } from "@l1x/l1x-wallet-sdk";

let l1xProvider = new L1XProvider({
  clusterType: "mainnet",
  endpoint: "https://v2-mainnet-rpc.l1x.foundation",
});

const eventCriteria: GetEventsArg = {
  tx_hash: "1f1796e1af9a252f324fc895d0767e0656577f05e8c096fdcd91fa3acbec3af0",
  timestamp: 1692705981,
};

l1xProvider.core
  .getEvents(eventCriteria)
  .then((response) => console.log(response)) // log response
  .catch((err) => console.error(err)); // log error

Parameters:

Event query criteria.

{
    "tx_hash": "1f1796e1af9a252f324fc895d0767e0656577f05e8c096fdcd91fa3acbec3af0",
    "timestamp": 1692705981
}

Returns:

A promise that resolves with the retrieved events.

{
    "events_data": []
}

Last updated