{"id":46638301,"url":"https://github.com/tetherto/wdk-indexer-http","last_synced_at":"2026-03-08T02:13:25.172Z","repository":{"id":330915709,"uuid":"1122355504","full_name":"tetherto/wdk-indexer-http","owner":"tetherto","description":null,"archived":false,"fork":false,"pushed_at":"2025-12-29T01:56:59.000Z","size":67,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-31T21:05:35.165Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tetherto.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-24T14:59:13.000Z","updated_at":"2025-12-29T01:57:03.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/tetherto/wdk-indexer-http","commit_stats":null,"previous_names":["tetherto/wdk-indexer-http"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/tetherto/wdk-indexer-http","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tetherto%2Fwdk-indexer-http","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tetherto%2Fwdk-indexer-http/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tetherto%2Fwdk-indexer-http/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tetherto%2Fwdk-indexer-http/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tetherto","download_url":"https://codeload.github.com/tetherto/wdk-indexer-http/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tetherto%2Fwdk-indexer-http/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30242406,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-08T00:58:18.660Z","status":"online","status_checked_at":"2026-03-08T02:00:06.215Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-03-08T02:13:24.476Z","updated_at":"2026-03-08T02:13:25.070Z","avatar_url":"https://github.com/tetherto.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @tetherto/wdk-indexer-http\n\nHTTP client for the Tether WDK Indexer API. Access blockchain token transfers and balances across multiple networks including Ethereum, Tron, Polygon, Arbitrum, TON, Bitcoin, and more.\n\n\u003e **Note:** This package is currently in beta. Test in a dev setup first.\n\n## Getting an API Key\n\nTo use this SDK, you need an API key. Request one at: https://wdk-api.tether.io/register\n\n## Installation\n\n```bash\nnpm install @tetherto/wdk-indexer-http\n```\n\n## Quick Start\n\n```javascript\nimport { WdkIndexerClient } from '@tetherto/wdk-indexer-http'\n\n// Create a client instance\nconst client = new WdkIndexerClient({\n  apiKey: 'your-api-key'\n})\n\n// Check API health\nconst health = await client.health()\nconsole.log(health.status) // \"ok\"\n\n// Get USDt balance on Ethereum\nconst balance = await client.getTokenBalance(\n  'ethereum',\n  'usdt',\n  '0x742d35Cc6634C0532925a3b844Bc9e7595f5aB12'\n)\nconsole.log(`Balance: ${balance.tokenBalance.amount} USDt`)\n\n// Get token transfers\nconst transfers = await client.getTokenTransfers(\n  'ethereum',\n  'usdt',\n  '0x742d35Cc6634C0532925a3b844Bc9e7595f5aB12',\n  { limit: 50 }\n)\nconsole.log(`Found ${transfers.transfers.length} transfers`)\n```\n\n## API\n\n### Configuration\n\n```javascript\nconst client = new WdkIndexerClient({\n  apiKey: 'your-api-key',           // Required: API Key for authentication\n  baseUrl: 'https://...',           // Optional: Custom API URL (default: https://wdk-api.tether.io)\n  timeout: 30000,                   // Optional: Request timeout in ms (default: 30000)\n  fetch: customFetch                // Optional: Custom fetch implementation\n})\n```\n\n### Supported Blockchains\n\n| Blockchain | Description |\n|------------|-------------|\n| `ethereum` | Ethereum Mainnet |\n| `sepolia` | Ethereum Sepolia Testnet |\n| `plasma` | Plasma Network |\n| `arbitrum` | Arbitrum One |\n| `polygon` | Polygon (Matic) |\n| `tron` | TRON Network |\n| `ton` | TON Network |\n| `bitcoin` | Bitcoin Network |\n| `spark` | Spark Network |\n\n### Supported Tokens\n\n| Token | Description | Supported Blockchains |\n|-------|-------------|----------------------|\n| `usdt` | Tether USD | All blockchains |\n| `xaut` | Tether Gold | `ethereum`, `ton` |\n| `btc` | Bitcoin | `bitcoin`, `spark` |\n\n### Methods\n\n#### `health()`\n\nCheck if the API server is running.\n\n```javascript\nconst health = await client.health()\n// { status: \"ok\", timestamp: \"2025-01-15T10:30:00.000Z\" }\n```\n\n#### `getTokenTransfers(blockchain, token, address, options?)`\n\nGet token transfer history for an address.\n\n```javascript\nconst transfers = await client.getTokenTransfers(\n  'ethereum',\n  'usdt',\n  '0x742d35Cc6634C0532925a3b844Bc9e7595f5aB12',\n  {\n    limit: 100,         // Max 1000, default 10\n    fromTs: 1700000000, // Start timestamp (optional)\n    toTs: 1710000000    // End timestamp (optional)\n  }\n)\n\nfor (const transfer of transfers.transfers) {\n  console.log(`${transfer.from} -\u003e ${transfer.to}: ${transfer.amount}`)\n}\n```\n\n#### `getTokenBalance(blockchain, token, address)`\n\nGet current token balance for an address.\n\n```javascript\nconst balance = await client.getTokenBalance(\n  'tron',\n  'usdt',\n  'TN3W4H6rK2ce4vX9YnFQHwKENnHjoxb3m9'\n)\n\nconsole.log(`Balance: ${balance.tokenBalance.amount} ${balance.tokenBalance.token}`)\n```\n\n#### `getBatchTokenTransfers(requests)`\n\nGet token transfers for multiple addresses in one call.\n\n```javascript\nimport { isTokenTransfersResponse } from '@tetherto/wdk-indexer-http'\n\nconst results = await client.getBatchTokenTransfers([\n  { blockchain: 'ethereum', token: 'usdt', address: '0x123...', limit: 50 },\n  { blockchain: 'tron', token: 'usdt', address: 'T123...' },\n  { blockchain: 'ton', token: 'usdt', address: 'EQ...' }\n])\n\nfor (const result of results) {\n  if (isTokenTransfersResponse(result)) {\n    console.log(`Found ${result.transfers.length} transfers`)\n  } else {\n    console.error(`Error: ${result.message}`)\n  }\n}\n```\n\n#### `getBatchTokenBalances(requests)`\n\nGet token balances for multiple addresses in one call.\n\n```javascript\nimport { isTokenBalanceResponse } from '@tetherto/wdk-indexer-http'\n\nconst results = await client.getBatchTokenBalances([\n  { blockchain: 'ethereum', token: 'usdt', address: '0x123...' },\n  { blockchain: 'polygon', token: 'usdt', address: '0x456...' },\n  { blockchain: 'arbitrum', token: 'usdt', address: '0x789...' }\n])\n\nfor (const result of results) {\n  if (isTokenBalanceResponse(result)) {\n    const { blockchain, token, amount } = result.tokenBalance\n    console.log(`${blockchain}: ${amount} ${token}`)\n  } else {\n    console.error(`Error: ${result.message}`)\n  }\n}\n```\n\n## Error Handling\n\nThe SDK provides typed errors for better error handling:\n\n```javascript\nimport {\n  WdkIndexerClient,\n  WdkIndexerError,\n  WdkIndexerApiError,\n  WdkIndexerTimeoutError,\n  WdkIndexerNetworkError,\n  WdkIndexerValidationError\n} from '@tetherto/wdk-indexer-http'\n\ntry {\n  const balance = await client.getTokenBalance('ethereum', 'usdt', '0x...')\n} catch (error) {\n  if (error instanceof WdkIndexerValidationError) {\n    // Invalid parameters (blockchain, token, or batch size limit exceeded)\n    console.error(`Validation error: ${error.message}`)\n  } else if (error instanceof WdkIndexerApiError) {\n    // API returned an error response\n    console.error(`API Error: ${error.message}`)\n    console.error(`Status: ${error.status}`)\n    console.error(`Error Type: ${error.errorType}`)\n  } else if (error instanceof WdkIndexerTimeoutError) {\n    // Request timed out\n    console.error('Request timed out')\n  } else if (error instanceof WdkIndexerNetworkError) {\n    // Network error (connection failed, etc.)\n    console.error(`Network error: ${error.message}`)\n  } else if (error instanceof WdkIndexerError) {\n    // Other SDK error\n    console.error(`SDK error: ${error.message}`)\n  }\n}\n```\n\n## Bare Runtime\n\nFor use with bare runtime:\n\n```javascript\nimport { WdkIndexerClient } from '@tetherto/wdk-indexer-http/bare'\n```\n\n## TypeScript\n\nTypeScript type definitions are included. Import types as needed:\n\n```typescript\nimport type {\n  Blockchain,\n  Token,\n  TokenTransfer,\n  TokenTransfersResponse,\n  TokenBalance,\n  TokenBalanceResponse,\n  GetTokenTransfersOptions,\n  BatchTokenTransfersRequest,\n  BatchTokenBalancesRequest,\n  ApiError,\n  WdkIndexerConfig\n} from '@tetherto/wdk-indexer-http'\n```\n\n### Convenience Constants\n\n```javascript\nimport { BLOCKCHAINS, TOKENS, BATCH_LIMIT } from '@tetherto/wdk-indexer-http'\n\nconsole.log(BLOCKCHAINS)\n// ['ethereum', 'sepolia', 'plasma', 'arbitrum', 'polygon', 'tron', 'ton', 'bitcoin', 'spark']\n\nconsole.log(TOKENS)\n// ['usdt', 'xaut', 'btc']\n\nconsole.log(BATCH_LIMIT)\n// 10\n```\n\n## Development\n\n```bash\n# Install dependencies\nnpm install\n\n# Run tests\nnpm test\n\n# Run integration tests (requires API key)\nWDK_INDEXER_API_KEY=your-api-key npm run test:integration\n\n# Lint\nnpm run lint\n```\n\n## License\n\nApache-2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftetherto%2Fwdk-indexer-http","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftetherto%2Fwdk-indexer-http","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftetherto%2Fwdk-indexer-http/lists"}