This package, `symbol-openapi-typescript-fetch-client` (version 1.0.3, last published in November 2021), provides a generated OpenAPI client for the Symbol blockchain. It is built using `symbol-openapi-generator` and designed to interact with Symbol nodes via the standard `fetch` API. It ships with TypeScript types, offering type-safe access to Symbol's REST API endpoints as defined by its OpenAPI specification at the time of its generation. However, it's crucial to note that this package is essentially an artifact generated from an older specification and generator. The README itself points users to `symbol-sdk-typescript-javascript`, which has since been deprecated (as of January 2022). For current Symbol blockchain development, the actively maintained `@symbol/symbol-sdk` package should be used instead, as this generated client is not regularly updated and reflects an outdated state of the Symbol ecosystem.
npm install symbol-openapi-typescript-fetch-clientVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to initialize the generated Symbol OpenAPI client and fetch basic information about a Symbol node, including its health status and general details.
Migrate to the actively maintained `@symbol/symbol-sdk` package for interacting with the Symbol blockchain. If a generated client is strictly required, explore more recent OpenAPI client generators or a more up-to-date generated Symbol client if available.
Disregard the README's recommendation to use `symbol-sdk-typescript-javascript`. Instead, use `@symbol/symbol-sdk` which is the current, actively supported SDK for Symbol.
For complex Symbol application development requiring more than raw API calls, always prefer the `@symbol/symbol-sdk` package. Use this generated client only if you specifically need a minimalistic fetch-based client for an older API version and understand its limitations.
For Node.js environments older than 18, install `node-fetch` (e.g., `npm install node-fetch`) and polyfill `globalThis.fetch` before making any API calls: ```typescript import fetch from 'node-fetch'; globalThis.fetch = fetch as any; // ... then use the generated client ```
For Node.js environments, upgrade to Node.js 18 or newer, or install `node-fetch` and polyfill `globalThis.fetch`: ```typescript import fetch from 'node-fetch'; globalThis.fetch = fetch as any; ```
For development, you can temporarily disable certificate verification by setting the `NODE_TLS_REJECT_UNAUTHORIZED='0'` environment variable (not recommended for production). Alternatively, configure your environment to trust the certificate or use an HTTP endpoint if available and appropriate for your security model.