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

@polygonlabs/api-gateway-client

Package Overview
Dependencies
Maintainers
7
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@polygonlabs/api-gateway-client

Type-safe REST client for the Polygon API Gateway

latest
Source
npmnpm
Version
2.1.3
Version published
Weekly downloads
291
315.71%
Maintainers
7
Weekly downloads
 
Created
Source

@polygonlabs/api-gateway-client

Type-safe REST client for the Polygon API Gateway, generated with hey-api from the gateway's committed OpenAPI spec. Every response is validated at runtime with the same Zod schemas the server enforces.

Why this package exists

The client is generated from the same schema registry the gateway routes and validates with (via @polygonlabs/api-gateway-schemas), so an API shape change ships as a new package version instead of a silent break — and a response that doesn't match its schema fails loudly at the validation boundary rather than corrupting state downstream.

Install

pnpm add @polygonlabs/api-gateway-client

Usage

import { client, screenAddress } from '@polygonlabs/api-gateway-client';

client.setConfig({ baseUrl: 'https://api-gateway.polygon.technology' });

const { data } = await screenAddress({
  path: { address: '0x1f9090aaE28b8a3dCeaDf281B0F12828e676c326' },
});
// data: { address, blocked, source: 'blocklist' | 'risk' }

The screening endpoint accepts EVM (0x-hex), Solana (Base58), and Tron (Base58Check) addresses.

Entry points

  • @polygonlabs/api-gateway-client — the fetch-based SDK: one function per API operation, the configurable client singleton, and the error-narrowing helpers (isResponseValidationError, isTransportError, isWrapperError).
  • @polygonlabs/api-gateway-client/react — TanStack Query options factories for React apps. Requires the optional react and @tanstack/react-query peer dependencies; the main entry works without them.
  • @polygonlabs/api-gateway-client/factory — the underlying hey-api client factory, for constructing independently-configured client instances.

FAQs

Package last updated on 05 Nov 2026

Related posts