New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

@sudobility/indexer_client

Package Overview
Dependencies
Maintainers
1
Versions
123
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Malware was recently detected in this package.

Affected versions:

0.0.146

@sudobility/indexer_client

React and React Native compatible client library for blockchain mail indexer API with TypeScript support

latest
Source
npmnpm
Version
0.0.144
Version published
Weekly downloads
370
1133.33%
Maintainers
1
Weekly downloads
 
Created
Source

@sudobility/indexer_client

TypeScript client library for the 0xMail blockchain indexer REST and GraphQL APIs. Provides an IndexerClient class, TanStack React Query hooks, GraphQL/admin/webhook helpers, and a business service layer. Works cross-platform on React and React Native via an injected NetworkClient interface.

Installation

bun add @sudobility/indexer_client

Peer dependencies: react (>=18), @tanstack/react-query (>=5), @sudobility/di, @sudobility/types, @sudobility/mail_box_types, @sudobility/configs.

Usage

import { IndexerClient } from '@sudobility/indexer_client';

// Core client (uses injected NetworkClient for cross-platform HTTP)
const client = new IndexerClient(endpointUrl, networkClient, dev);
const accounts = await client.getWalletAccounts(walletAddress, auth);
const points = await client.getPointsBalance(walletAddress, auth);

React Hooks

import {
  useIndexerGetWalletAccounts,
  useIndexerPointsInfo,
  useIndexerPointsLeaderboard,
  useIndexerGetDelegatedTo,
  useWalletNames,
  useResolveNameToAddress,
  useIndexerMailTemplates,
  useIndexerMailWebhooks,
  useIndexerReferralCode,
} from '@sudobility/indexer_client';

// Public endpoints (no auth)
const { data } = useIndexerPointsInfo(networkClient, endpointUrl, dev);
const { data } = useResolveNameToAddress(networkClient, endpointUrl, dev, 'vitalik.eth');

// Authenticated endpoints (wallet signature required)
const { data } = useIndexerGetWalletAccounts(networkClient, endpointUrl, dev, walletAddress, auth);

Utility Helpers

import { createIndexerHelpers } from '@sudobility/indexer_client';

const { admin, graphql, webhook } = createIndexerHelpers(config, networkClient);

// Admin: campaigns, points awards, user flags
// GraphQL: mails, delegations, statistics
// Webhook: email-sent, login, referral events

API

ExportDescription
IndexerClientCore REST API client (~40 endpoints)
IndexerServiceSingleton with 5-min in-memory cache (public endpoints)
useIndexer* hooks18 individual TanStack React Query hooks
IndexerMockDataStatic mock factories for all response types
IndexerAdminHelperAdmin API helper (campaigns, points, flags)
IndexerGraphQLHelperGraphQL query helper (mails, delegations, stats)
IndexerWebhookHelperWebhook processing helper
createAuthHeadersBuild signature auth headers (x-signature, x-message, x-signer)

Development

bun install
bun run check-all          # lint + typecheck + test:run
bun run build              # TypeScript compilation
bun run test               # Vitest (watch mode)
bun run test:run           # Single run
bun run test:coverage      # Coverage (70% threshold)
bun run test:integration   # Integration tests (requires live indexer)
bun run typecheck          # tsc --noEmit
bun run lint               # ESLint
  • @0xmail/indexer -- the backend this client connects to
  • @sudobility/di -- provides NetworkClient interface
  • @sudobility/mail_box_types -- shared API response types
  • @sudobility/types -- core types (ChainType, Optional)
  • @sudobility/configs -- application configuration

License

BUSL-1.1

Keywords

indexer

FAQs

Package last updated on 17 Oct 2026

Related posts