diff --git a/README.md b/README.md index 3c7f525..21b023d 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,16 @@ ## The Official Javascript & Typescript SDK for Fireblocks API [![npm version](https://badge.fury.io/js/fireblocks-sdk.svg)](https://badge.fury.io/js/fireblocks-sdk) +> **⚠️ This package is deprecated.** +> +> `fireblocks-sdk` is deprecated and reaches **end-of-life on November 1, 2026** — no further updates or fixes will be released after that date. +> +> Existing installs continue to work, and this package will never be unpublished. +> +> Migrate to [`@fireblocks/ts-sdk`](https://www.npmjs.com/package/@fireblocks/ts-sdk) — see the [SDK Migration Guide](https://developers.fireblocks.com/reference/sdk-migration-guide). +> +> To silence the startup warning, set `FIREBLOCKS_SDK_SUPPRESS_DEPRECATION_WARNING=1`. + > The current version of the SDK has changed the minimum supported Node.js version from v12 to v16. > > Versions older than v16 are no longer maintained by the Node.js community and are considered EOL. diff --git a/src/fireblocks-sdk.ts b/src/fireblocks-sdk.ts index 138cb70..f9dee71 100644 --- a/src/fireblocks-sdk.ts +++ b/src/fireblocks-sdk.ts @@ -225,6 +225,11 @@ export interface SDKOptions { const DEFAULT_MAX_PAGE_SIZE = 100; +const DEPRECATION_WARNING = "fireblocks-sdk is deprecated and reaches end-of-life on November 1, 2026: no further updates or fixes after that date. " + + "Existing installs continue to work. Migrate to @fireblocks/ts-sdk: https://developers.fireblocks.com/reference/sdk-migration-guide " + + "(set FIREBLOCKS_SDK_SUPPRESS_DEPRECATION_WARNING=1 to silence this warning)"; +let deprecationWarningShown = false; + export class FireblocksSDK { private readonly authProvider: IAuthProvider; private readonly apiBaseUrl: string; @@ -243,6 +248,11 @@ export class FireblocksSDK { * @param sdkOptions */ constructor(privateKey: string, apiKey: string, apiBaseUrl: string = "https://api.fireblocks.io", authProvider: IAuthProvider = undefined, sdkOptions?: SDKOptions) { + if (!deprecationWarningShown && !process.env.FIREBLOCKS_SDK_SUPPRESS_DEPRECATION_WARNING) { + deprecationWarningShown = true; + console.warn(DEPRECATION_WARNING); + } + this.authProvider = !!authProvider ? authProvider : new ApiTokenProvider(privateKey, apiKey); if (!!apiBaseUrl) {