Skip to content

Combined indexer, API & redeeming service for SubscriptionManager Events

Notifications You must be signed in to change notification settings

deluXtreme/subindexer

Repository files navigation

Subindexer API

A Rust API server that exposes redeemable subscription data.

Setup

  1. Create a .env file in the root directory with the content outlined in .env.sample.

  2. Run Indexer Alone

docker-compose up -d

Alternatively make up. See Makefile

  1. Run the API Server & Redeeming Cron Job:
# Local
cargo run

# Docker
docker run --rm --env-file .env ghcr.io/deluXtreme/subindexer

The API server will start on http://localhost:3000/health_check

API Endpoints

GET /redeemable

Returns a list of all redeemable subscriptions.

Response format:

[
  {
    "id": "0x9c4412d30af600c6de7a2c746d92d63d30e67cac94946358f43422c2e08d067d",
    "subscriber": "0xcf6dc192dc292d5f2789da2db02d6dd4f41f4214",
    "recipient": "0x6b69683c8897e3d18e74b1ba117b49f80423da5d",
    "amount": "10000000000000000",
    "periods": 8,
    "category": "trusted",
    "next_redeem_at": 1753139215
  }
]

Local Development

make up

Check for redeemable subscriptions:

curl http://localhost:3030/redeemable | jq
curl http://localhost:3030/subscriptions | jq

Check health

curl http://localhost:3030/health | jq

About

Combined indexer, API & redeeming service for SubscriptionManager Events

Resources

Stars

Watchers

Forks

Packages