Domain Events
Raw contract events associated with a domain's registry records. Terminal window Terminal window Terminal window
Run in ENSAdmin
Open an interactive playground to execute this example on our alpha
ENSNode instance.
GraphQL
query DomainEvents($name: InterpretedName!) { domain(by: {name: $name}) { events { totalCount edges { node { from to topics data timestamp transactionHash } } } }} Variables
{ "name": "newowner.eth"} Output
{ "data": { "domain": { "events": { "edges": [ { "node": { "from": "0x44c1e4088ee00dcc9a51310179cb30b8598ea911", "to": "0x283af0b28c62c092c9727f1ee09c02ca627eb7f5", "topics": [ "0xce0457fe73731f824cc272376169235128c118b49d344817417c6d108d155e82", "0x93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae", "0xe3003dfeb2ac3be456b350a17617c2c06302e6cbbacbb99f009579c9167dfba3" ], "data": "0x000000000000000000000000283af0b28c62c092c9727f1ee09c02ca627eb7f5", "timestamp": "1656395408", "transactionHash": "0x5010048015b739d47dfad0b864d210e59167b0be86a4f2b47cb446075f9b8e56" } }, { "node": { "from": "0x44c1e4088ee00dcc9a51310179cb30b8598ea911", "to": "0x283af0b28c62c092c9727f1ee09c02ca627eb7f5", "topics": [ "0xb3d987963d01b2f68493b4bdb130988f157ea43070d4ad840fee0466ed9370d9", "0xe3003dfeb2ac3be456b350a17617c2c06302e6cbbacbb99f009579c9167dfba3", "0x000000000000000000000000283af0b28c62c092c9727f1ee09c02ca627eb7f5" ], "data": "0x000000000000000000000000000000000000000000000000000000006c223148", "timestamp": "1656395408", "transactionHash": "0x5010048015b739d47dfad0b864d210e59167b0be86a4f2b47cb446075f9b8e56" } }, { "node": { "from": "0x44c1e4088ee00dcc9a51310179cb30b8598ea911", "to": "0x283af0b28c62c092c9727f1ee09c02ca627eb7f5", "topics": [ "0x335721b01866dc23fbee8b6b2c7b1e14d6f05c28cd35a2c934239f94095602a0", "0x78e108e8bae87f1fcc8f64c4e7b53f2b590c9ca2c0183423938079a771d1a17c" ], "data": "0x0000000000000000000000004976fb03c32e5b8cfe2b6ccb31c09ba78ebaba41", "timestamp": "1656395408", "transactionHash": "0x5010048015b739d47dfad0b864d210e59167b0be86a4f2b47cb446075f9b8e56" } }, { "node": { "from": "0x44c1e4088ee00dcc9a51310179cb30b8598ea911", "to": "0x283af0b28c62c092c9727f1ee09c02ca627eb7f5", "topics": [ "0xce0457fe73731f824cc272376169235128c118b49d344817417c6d108d155e82", "0x93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae", "0xe3003dfeb2ac3be456b350a17617c2c06302e6cbbacbb99f009579c9167dfba3" ], "data": "0x00000000000000000000000044c1e4088ee00dcc9a51310179cb30b8598ea911", "timestamp": "1656395408", "transactionHash": "0x5010048015b739d47dfad0b864d210e59167b0be86a4f2b47cb446075f9b8e56" } }, { "node": { "from": "0x44c1e4088ee00dcc9a51310179cb30b8598ea911", "to": "0x283af0b28c62c092c9727f1ee09c02ca627eb7f5", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x000000000000000000000000283af0b28c62c092c9727f1ee09c02ca627eb7f5", "0x00000000000000000000000044c1e4088ee00dcc9a51310179cb30b8598ea911", "0xe3003dfeb2ac3be456b350a17617c2c06302e6cbbacbb99f009579c9167dfba3" ], "data": "0x", "timestamp": "1656395408", "transactionHash": "0x5010048015b739d47dfad0b864d210e59167b0be86a4f2b47cb446075f9b8e56" } }, { "node": { "from": "0x44c1e4088ee00dcc9a51310179cb30b8598ea911", "to": "0x283af0b28c62c092c9727f1ee09c02ca627eb7f5", "topics": [ "0xca6abbe9d7f11422cb6ca7629fbf6fe9efb1c621f71ce8f02b9f2a230097404f", "0xe3003dfeb2ac3be456b350a17617c2c06302e6cbbacbb99f009579c9167dfba3", "0x00000000000000000000000044c1e4088ee00dcc9a51310179cb30b8598ea911" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000004afb3036d1db2d000000000000000000000000000000000000000000000000000000006c22314800000000000000000000000000000000000000000000000000000000000000086e65776f776e6572000000000000000000000000000000000000000000000000", "timestamp": "1656395408", "transactionHash": "0x5010048015b739d47dfad0b864d210e59167b0be86a4f2b47cb446075f9b8e56" } } ], "totalCount": 6 } } }}Output matches a GraphQL Response from alpha ; live output depends on your ENSNode instance.
Opens an editable StackBlitz project with this snippet.
TypeScript
import { createEnsNodeClient } from "enssdk/core";import { asInterpretedName } from "enssdk";import { graphql, omnigraph } from "enssdk/omnigraph";
const client = createEnsNodeClient({ url: process.env.ENSNODE_URL || "https://api.alpha.ensnode.io"}).extend(omnigraph);
const DomainEventsQuery = graphql(` query DomainEvents($name: InterpretedName!) { domain(by: {name: $name}) { events { totalCount edges { node { from to topics data timestamp transactionHash } } } } }`);
const result = await client.omnigraph.query({ query: DomainEventsQuery, variables: { name: asInterpretedName("newowner.eth"), },});
if (result.errors) throw new Error(JSON.stringify(result.errors));console.log(JSON.stringify(result.data, null, 2)); Output
{ "data": { "domain": { "events": { "edges": [ { "node": { "from": "0x44c1e4088ee00dcc9a51310179cb30b8598ea911", "to": "0x283af0b28c62c092c9727f1ee09c02ca627eb7f5", "topics": [ "0xce0457fe73731f824cc272376169235128c118b49d344817417c6d108d155e82", "0x93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae", "0xe3003dfeb2ac3be456b350a17617c2c06302e6cbbacbb99f009579c9167dfba3" ], "data": "0x000000000000000000000000283af0b28c62c092c9727f1ee09c02ca627eb7f5", "timestamp": "1656395408", "transactionHash": "0x5010048015b739d47dfad0b864d210e59167b0be86a4f2b47cb446075f9b8e56" } }, { "node": { "from": "0x44c1e4088ee00dcc9a51310179cb30b8598ea911", "to": "0x283af0b28c62c092c9727f1ee09c02ca627eb7f5", "topics": [ "0xb3d987963d01b2f68493b4bdb130988f157ea43070d4ad840fee0466ed9370d9", "0xe3003dfeb2ac3be456b350a17617c2c06302e6cbbacbb99f009579c9167dfba3", "0x000000000000000000000000283af0b28c62c092c9727f1ee09c02ca627eb7f5" ], "data": "0x000000000000000000000000000000000000000000000000000000006c223148", "timestamp": "1656395408", "transactionHash": "0x5010048015b739d47dfad0b864d210e59167b0be86a4f2b47cb446075f9b8e56" } }, { "node": { "from": "0x44c1e4088ee00dcc9a51310179cb30b8598ea911", "to": "0x283af0b28c62c092c9727f1ee09c02ca627eb7f5", "topics": [ "0x335721b01866dc23fbee8b6b2c7b1e14d6f05c28cd35a2c934239f94095602a0", "0x78e108e8bae87f1fcc8f64c4e7b53f2b590c9ca2c0183423938079a771d1a17c" ], "data": "0x0000000000000000000000004976fb03c32e5b8cfe2b6ccb31c09ba78ebaba41", "timestamp": "1656395408", "transactionHash": "0x5010048015b739d47dfad0b864d210e59167b0be86a4f2b47cb446075f9b8e56" } }, { "node": { "from": "0x44c1e4088ee00dcc9a51310179cb30b8598ea911", "to": "0x283af0b28c62c092c9727f1ee09c02ca627eb7f5", "topics": [ "0xce0457fe73731f824cc272376169235128c118b49d344817417c6d108d155e82", "0x93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae", "0xe3003dfeb2ac3be456b350a17617c2c06302e6cbbacbb99f009579c9167dfba3" ], "data": "0x00000000000000000000000044c1e4088ee00dcc9a51310179cb30b8598ea911", "timestamp": "1656395408", "transactionHash": "0x5010048015b739d47dfad0b864d210e59167b0be86a4f2b47cb446075f9b8e56" } }, { "node": { "from": "0x44c1e4088ee00dcc9a51310179cb30b8598ea911", "to": "0x283af0b28c62c092c9727f1ee09c02ca627eb7f5", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x000000000000000000000000283af0b28c62c092c9727f1ee09c02ca627eb7f5", "0x00000000000000000000000044c1e4088ee00dcc9a51310179cb30b8598ea911", "0xe3003dfeb2ac3be456b350a17617c2c06302e6cbbacbb99f009579c9167dfba3" ], "data": "0x", "timestamp": "1656395408", "transactionHash": "0x5010048015b739d47dfad0b864d210e59167b0be86a4f2b47cb446075f9b8e56" } }, { "node": { "from": "0x44c1e4088ee00dcc9a51310179cb30b8598ea911", "to": "0x283af0b28c62c092c9727f1ee09c02ca627eb7f5", "topics": [ "0xca6abbe9d7f11422cb6ca7629fbf6fe9efb1c621f71ce8f02b9f2a230097404f", "0xe3003dfeb2ac3be456b350a17617c2c06302e6cbbacbb99f009579c9167dfba3", "0x00000000000000000000000044c1e4088ee00dcc9a51310179cb30b8598ea911" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000004afb3036d1db2d000000000000000000000000000000000000000000000000000000006c22314800000000000000000000000000000000000000000000000000000000000000086e65776f776e6572000000000000000000000000000000000000000000000000", "timestamp": "1656395408", "transactionHash": "0x5010048015b739d47dfad0b864d210e59167b0be86a4f2b47cb446075f9b8e56" } } ], "totalCount": 6 } } }}Output matches a GraphQL Response from alpha ; live output depends on your ENSNode instance.
enssdk package manager setup
# 1. Create projectmkdir -p my-ens-script/src && cd my-ens-scriptnpm init -y && touch src/index.tsnpm pkg set type=module scripts.start="tsx src/index.ts"# 2. Install dependenciesnpm install enssdk@1.15.1 && npm install -D tsx typescript @types/node# 3. Paste the TypeScript snippet above into src/index.ts# 4. RunENSNODE_URL=https://api.alpha.ensnode.io npm startSee the enssdk docs for gql.tada plugin and tsconfig setup.
Opens an editable StackBlitz project with this snippet.
TSX (React)
import { OmnigraphProvider, useOmnigraphQuery, graphql } from "enskit/react/omnigraph";import { createEnsNodeClient } from "enssdk/core";import { asInterpretedName } from "enssdk";import { omnigraph } from "enssdk/omnigraph";
const client = createEnsNodeClient({ url: import.meta.env.VITE_ENSNODE_URL || "https://api.alpha.ensnode.io"}).extend(omnigraph);
const DomainEventsQuery = graphql(` query DomainEvents($name: InterpretedName!) { domain(by: {name: $name}) { events { totalCount edges { node { from to topics data timestamp transactionHash } } } } }`);
function DomainEventsResult() { const [result] = useOmnigraphQuery({ query: DomainEventsQuery, variables: { name: asInterpretedName("newowner.eth"), }, }); const { data, fetching, error } = result; if (!data && fetching) return <p>Loading…</p>; if (error) return <p>Error: {error.message}</p>; if (!data) return <p>No data returned.</p>; const formatted = JSON.stringify( data, (_, value) => (typeof value === "bigint" ? value.toString() : value), 2, ); return <code>{formatted}</code>;}
export default function App() { return ( <OmnigraphProvider client={client}> <DomainEventsResult /> </OmnigraphProvider> );} Output
{ "data": { "domain": { "events": { "edges": [ { "node": { "from": "0x44c1e4088ee00dcc9a51310179cb30b8598ea911", "to": "0x283af0b28c62c092c9727f1ee09c02ca627eb7f5", "topics": [ "0xce0457fe73731f824cc272376169235128c118b49d344817417c6d108d155e82", "0x93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae", "0xe3003dfeb2ac3be456b350a17617c2c06302e6cbbacbb99f009579c9167dfba3" ], "data": "0x000000000000000000000000283af0b28c62c092c9727f1ee09c02ca627eb7f5", "timestamp": "1656395408", "transactionHash": "0x5010048015b739d47dfad0b864d210e59167b0be86a4f2b47cb446075f9b8e56" } }, { "node": { "from": "0x44c1e4088ee00dcc9a51310179cb30b8598ea911", "to": "0x283af0b28c62c092c9727f1ee09c02ca627eb7f5", "topics": [ "0xb3d987963d01b2f68493b4bdb130988f157ea43070d4ad840fee0466ed9370d9", "0xe3003dfeb2ac3be456b350a17617c2c06302e6cbbacbb99f009579c9167dfba3", "0x000000000000000000000000283af0b28c62c092c9727f1ee09c02ca627eb7f5" ], "data": "0x000000000000000000000000000000000000000000000000000000006c223148", "timestamp": "1656395408", "transactionHash": "0x5010048015b739d47dfad0b864d210e59167b0be86a4f2b47cb446075f9b8e56" } }, { "node": { "from": "0x44c1e4088ee00dcc9a51310179cb30b8598ea911", "to": "0x283af0b28c62c092c9727f1ee09c02ca627eb7f5", "topics": [ "0x335721b01866dc23fbee8b6b2c7b1e14d6f05c28cd35a2c934239f94095602a0", "0x78e108e8bae87f1fcc8f64c4e7b53f2b590c9ca2c0183423938079a771d1a17c" ], "data": "0x0000000000000000000000004976fb03c32e5b8cfe2b6ccb31c09ba78ebaba41", "timestamp": "1656395408", "transactionHash": "0x5010048015b739d47dfad0b864d210e59167b0be86a4f2b47cb446075f9b8e56" } }, { "node": { "from": "0x44c1e4088ee00dcc9a51310179cb30b8598ea911", "to": "0x283af0b28c62c092c9727f1ee09c02ca627eb7f5", "topics": [ "0xce0457fe73731f824cc272376169235128c118b49d344817417c6d108d155e82", "0x93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae", "0xe3003dfeb2ac3be456b350a17617c2c06302e6cbbacbb99f009579c9167dfba3" ], "data": "0x00000000000000000000000044c1e4088ee00dcc9a51310179cb30b8598ea911", "timestamp": "1656395408", "transactionHash": "0x5010048015b739d47dfad0b864d210e59167b0be86a4f2b47cb446075f9b8e56" } }, { "node": { "from": "0x44c1e4088ee00dcc9a51310179cb30b8598ea911", "to": "0x283af0b28c62c092c9727f1ee09c02ca627eb7f5", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x000000000000000000000000283af0b28c62c092c9727f1ee09c02ca627eb7f5", "0x00000000000000000000000044c1e4088ee00dcc9a51310179cb30b8598ea911", "0xe3003dfeb2ac3be456b350a17617c2c06302e6cbbacbb99f009579c9167dfba3" ], "data": "0x", "timestamp": "1656395408", "transactionHash": "0x5010048015b739d47dfad0b864d210e59167b0be86a4f2b47cb446075f9b8e56" } }, { "node": { "from": "0x44c1e4088ee00dcc9a51310179cb30b8598ea911", "to": "0x283af0b28c62c092c9727f1ee09c02ca627eb7f5", "topics": [ "0xca6abbe9d7f11422cb6ca7629fbf6fe9efb1c621f71ce8f02b9f2a230097404f", "0xe3003dfeb2ac3be456b350a17617c2c06302e6cbbacbb99f009579c9167dfba3", "0x00000000000000000000000044c1e4088ee00dcc9a51310179cb30b8598ea911" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000004afb3036d1db2d000000000000000000000000000000000000000000000000000000006c22314800000000000000000000000000000000000000000000000000000000000000086e65776f776e6572000000000000000000000000000000000000000000000000", "timestamp": "1656395408", "transactionHash": "0x5010048015b739d47dfad0b864d210e59167b0be86a4f2b47cb446075f9b8e56" } } ], "totalCount": 6 } } }}Output matches a GraphQL Response from alpha ; live output depends on your ENSNode instance.
enskit package manager setup
# 1. Create projectnpm create vite@latest my-ens-app -- --template react-ts --no-interactive --no-immediatecd my-ens-app# 2. Install dependenciesnpm installnpm install enskit@1.15.1 enssdk@1.15.1# 3. Copy the TSX snippet above into src/App.tsx# 4. RunVITE_ENSNODE_URL=https://api.alpha.ensnode.io npm run devSee the enskit docs for gql.tada plugin and provider setup.
cURL
# POST JSON to your ENSNode Omnigraph endpoint (same path enssdk uses).curl -sS -X POST "https://api.alpha.ensnode.io/api/omnigraph" \ -H "Content-Type: application/json" \ -d '{ "query": "query DomainEvents($name: InterpretedName!) { domain(by: {name: $name}) { events { totalCount edges { node { from to topics data timestamp transactionHash } } } } }", "variables": {"name":"newowner.eth"}}' Response
{ "data": { "domain": { "events": { "edges": [ { "node": { "from": "0x44c1e4088ee00dcc9a51310179cb30b8598ea911", "to": "0x283af0b28c62c092c9727f1ee09c02ca627eb7f5", "topics": [ "0xce0457fe73731f824cc272376169235128c118b49d344817417c6d108d155e82", "0x93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae", "0xe3003dfeb2ac3be456b350a17617c2c06302e6cbbacbb99f009579c9167dfba3" ], "data": "0x000000000000000000000000283af0b28c62c092c9727f1ee09c02ca627eb7f5", "timestamp": "1656395408", "transactionHash": "0x5010048015b739d47dfad0b864d210e59167b0be86a4f2b47cb446075f9b8e56" } }, { "node": { "from": "0x44c1e4088ee00dcc9a51310179cb30b8598ea911", "to": "0x283af0b28c62c092c9727f1ee09c02ca627eb7f5", "topics": [ "0xb3d987963d01b2f68493b4bdb130988f157ea43070d4ad840fee0466ed9370d9", "0xe3003dfeb2ac3be456b350a17617c2c06302e6cbbacbb99f009579c9167dfba3", "0x000000000000000000000000283af0b28c62c092c9727f1ee09c02ca627eb7f5" ], "data": "0x000000000000000000000000000000000000000000000000000000006c223148", "timestamp": "1656395408", "transactionHash": "0x5010048015b739d47dfad0b864d210e59167b0be86a4f2b47cb446075f9b8e56" } }, { "node": { "from": "0x44c1e4088ee00dcc9a51310179cb30b8598ea911", "to": "0x283af0b28c62c092c9727f1ee09c02ca627eb7f5", "topics": [ "0x335721b01866dc23fbee8b6b2c7b1e14d6f05c28cd35a2c934239f94095602a0", "0x78e108e8bae87f1fcc8f64c4e7b53f2b590c9ca2c0183423938079a771d1a17c" ], "data": "0x0000000000000000000000004976fb03c32e5b8cfe2b6ccb31c09ba78ebaba41", "timestamp": "1656395408", "transactionHash": "0x5010048015b739d47dfad0b864d210e59167b0be86a4f2b47cb446075f9b8e56" } }, { "node": { "from": "0x44c1e4088ee00dcc9a51310179cb30b8598ea911", "to": "0x283af0b28c62c092c9727f1ee09c02ca627eb7f5", "topics": [ "0xce0457fe73731f824cc272376169235128c118b49d344817417c6d108d155e82", "0x93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae", "0xe3003dfeb2ac3be456b350a17617c2c06302e6cbbacbb99f009579c9167dfba3" ], "data": "0x00000000000000000000000044c1e4088ee00dcc9a51310179cb30b8598ea911", "timestamp": "1656395408", "transactionHash": "0x5010048015b739d47dfad0b864d210e59167b0be86a4f2b47cb446075f9b8e56" } }, { "node": { "from": "0x44c1e4088ee00dcc9a51310179cb30b8598ea911", "to": "0x283af0b28c62c092c9727f1ee09c02ca627eb7f5", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x000000000000000000000000283af0b28c62c092c9727f1ee09c02ca627eb7f5", "0x00000000000000000000000044c1e4088ee00dcc9a51310179cb30b8598ea911", "0xe3003dfeb2ac3be456b350a17617c2c06302e6cbbacbb99f009579c9167dfba3" ], "data": "0x", "timestamp": "1656395408", "transactionHash": "0x5010048015b739d47dfad0b864d210e59167b0be86a4f2b47cb446075f9b8e56" } }, { "node": { "from": "0x44c1e4088ee00dcc9a51310179cb30b8598ea911", "to": "0x283af0b28c62c092c9727f1ee09c02ca627eb7f5", "topics": [ "0xca6abbe9d7f11422cb6ca7629fbf6fe9efb1c621f71ce8f02b9f2a230097404f", "0xe3003dfeb2ac3be456b350a17617c2c06302e6cbbacbb99f009579c9167dfba3", "0x00000000000000000000000044c1e4088ee00dcc9a51310179cb30b8598ea911" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000004afb3036d1db2d000000000000000000000000000000000000000000000000000000006c22314800000000000000000000000000000000000000000000000000000000000000086e65776f776e6572000000000000000000000000000000000000000000000000", "timestamp": "1656395408", "transactionHash": "0x5010048015b739d47dfad0b864d210e59167b0be86a4f2b47cb446075f9b8e56" } } ], "totalCount": 6 } } }}Output matches a GraphQL Response from alpha ; live output depends on your ENSNode instance.
Back to Examples