Overview

Subscriptions empower developers to receive real-time updates triggered by smart contract events or internal loyalty actions. These notifications can either be sent to a webhook endpoint or used to automatically invoke functions.

Event Types

Blockchain Events

Blockchain events notify you whenever a smart contract emits an event or a function is called. These events track on-chain state with minimal latency (typically one block), making them ideal for real-time applications.

1

Add Contract to Admin Account

Start by adding the desired smart contract to your admin panel.

2

Select Event

Choose “EVENT” from the subscription options. All available events for the contract will be populated automatically.

Blockchain Function Events

The process mirrors blockchain events with a slight variation:

1

Add Contract to Admin Panel

Ensure the contract is registered in your admin panel.

2

Select Function

Choose “FUNCTION” after adding the contract. All smart contract functions will be listed automatically.

Snag Events

Snag events allow subscriptions to internal platform actions. These events relate to loyalty account activities and may have a slight delay (up to 30 seconds) after the action is recorded.

Event Types Reference

LoyaltyTransactionEntry

Triggered when a user’s account balance is updated

UserMetadata

Emitted when a user’s profile is created or updated

UserTokenActivity

Emitted for token-related activities

LoyaltyTransactionEntry

{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "loyaltyAccountId": "account-uuid-001",
  "loyaltyTransactionId": "transaction-uuid-001",
  "loyaltyCurrencyId": "currency-uuid-001",
  "amount": "100.00",
  "direction": "credit",
  "metadata": {},
  "loyaltyAccountStartAmount": "500.00",
  "loyaltyAccountEndAmount": "600.00",
  "loyaltyAccountLockVersion": 1,
  "hideInUi": false,
  "idempotencyKey": "unique-key-001",
  "idempotencyKeyExpiresAt": "2025-03-05T00:00:00Z",
  "dismissedInUi": false,
  "organizationId": "org-uuid-001",
  "websiteId": "website-uuid-001",
  "createdAt": "2025-03-04T12:00:00Z",
  "updatedAt": "2025-03-04T12:00:00Z",
  "loyaltyAccount": {
    "user": {
      "walletAddress": "0x123456789abcdef"
    }
  },
  "loyaltyTransaction": {
    "loyaltyRule": {
      "id": "rule-uuid-001"
    }
  }
}

UserMetadata

{
  "id": "234e4567-e89b-12d3-a456-426614174001",
  "userId": "user-uuid-001",
  "isBlocked": false,
  "websiteId": "website-uuid-001",
  "organizationId": "org-uuid-001",
  "emailAddress": "[email protected]",
  "twitterUser": "userTwitter",
  "twitterUserId": "twitter-001",
  "twitterUserFollowersCount": 150,
  "twitterVerifiedAt": "2025-03-04T10:00:00Z",
  "discordUser": "userDiscord",
  "discordUserId": "discord-001",
  "discordVerifiedAt": "2025-03-04T10:05:00Z",
  "instagramUser": "userInstagram",
  "instagramUserId": "insta-001",
  "instagramVerifiedAt": "2025-03-04T10:10:00Z",
  "logoUrl": "https://example.com/logo.png",
  "displayName": "User Display Name",
  "location": "New York, USA",
  "bio": "Sample bio text.",
  "portfolioUrl": "https://example.com/portfolio",
  "createdAt": "2025-03-04T09:00:00Z",
  "updatedAt": "2025-03-04T11:00:00Z",
  "meta": {}
}

UserTokenActivity

{
  "id": "345e4567-e89b-12d3-a456-426614174002",
  "collectionId": "collection-001",
  "walletAddress": "0xabcdef1234567890",
  "tokenId": "token-001",
  "like": true,
  "views": 1000,
  "createdAt": "2025-03-04T08:00:00Z",
  "updatedAt": "2025-03-04T08:30:00Z",
  "userId": "user-uuid-001",
  "organizationId": "org-uuid-001",
  "websiteId": "website-uuid-001",
  "websiteCollectionId": "website-collection-001"
}