fireblocks-sdk
TypeScript icon, indicating that this package has built-in type declarations

5.35.0 • Public • Published

The Official Javascript & Typescript SDK for Fireblocks API

npm version

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.

About

This repository contains the official Javascript & Typescript SDK for Fireblocks API. For the complete API reference, go to API reference.

v4 Migration

Please read the following guide for migration.

Usage

Before You Begin

Make sure you have the credentials for Fireblocks API Services. Otherwise, please contact Fireblocks support for further instructions on how to obtain your API credentials.

Requirements

Installation

npm install fireblocks-sdk --save

or

yarn add fireblocks-sdk

Importing Fireblocks SDK

JavaScript:

const FireblocksSDK = require("fireblocks-sdk").FireblocksSDK;
const fireblocks = new FireblocksSDK(privateKey, apiKey);

TypeScript:

import { FireblocksSDK } from "fireblocks-sdk";
const fireblocks = new FireblocksSDK(privateKey, apiKey);

You can also pass additional options:

const baseUrl = "https://api.fireblocks.io";
const authProvider: IAuthProvider = { /* Custom implementation */ };
const fireblocks = new FireblocksSDK(privateKey, apiKey, baseUrl, authProvider, options);

The options argument has the following structure:

interface SDKOptions {
    /** HTTP request timeout */
    timeoutInMs?: number;

    /** Proxy configurations */
    proxy?: AxiosProxyConfig | false;

    /** Whether to remove platform from User-Agent header */
    anonymousPlatform?: boolean;
    
    /** Additional product identifier to be prepended to the User-Agent header */
    userAgent?: string;

    /** TravelRule Provider options to initialize PII Client for PII encryption */
    travelRuleOptions?: TravelRuleOptions;
}

Axios Interceptor

You can provide the sdk options with an axios response interceptor:

new FireblocksSDK(privateKey, userId, serverAddress, undefined, {
    customAxiosOptions: {
        interceptors: {
            response: {
                onFulfilled: (response) => {
                    console.log(`Request ID: ${response.headers["x-request-id"]}`);
                    return response;
                },
                onRejected: (error) => {
                    console.log(`Request ID: ${error.response.headers["x-request-id"]}`);
                    throw error;
                }
            }
        }
    }
});

Error Handling

The SDK throws AxiosError upon http errors for API requests.

You can read more about axios error handling here.

You can get more data on the Fireblocks error using the following fields:

  • error.response.data.code: The Fireblocks error code, should be provided on support tickets
  • error.response.data.message: Explanation of the Fireblocks error
  • error.response.headers['x-request-id']: The request ID correlated to the API request, should be provided on support tickets / Github issues

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
5.35.02,089latest

Version History

VersionDownloads (Last 7 Days)Published
5.35.02,089
5.34.01,602
5.33.0954
5.32.0205
5.31.212,035
5.29.0188
5.28.1212
5.28.013
5.27.2470
5.27.12
5.27.0132
5.26.0270
5.25.15,551
5.25.0390
5.24.03,303
5.23.0113
5.22.028
5.21.02,247
5.20.0767
5.19.00
5.18.10
5.18.04
5.17.0302
5.16.06
5.15.18
5.15.01,297
5.14.0141
5.13.01
5.12.033
5.11.0171
5.10.00
5.9.032
5.8.06
5.7.00
5.6.116
5.6.05
5.5.10
5.5.00
5.4.00
5.3.10
5.3.04
5.2.03
5.1.40
5.1.30
5.1.225
5.1.10
5.1.02,305
5.0.10
5.0.00
4.2.0780
4.1.06
4.0.0144
3.1.4969
3.1.337
3.1.211
3.1.10
3.0.10
3.0.0133
2.5.4354
2.5.348
2.5.20
2.5.10
2.5.00
2.4.27
2.4.14
2.4.01
2.3.23
2.3.11
2.3.00
2.2.02
2.1.00
2.0.09
1.14.0117
1.13.00
1.12.02
1.11.11
1.11.01
1.10.00
1.9.00
1.8.20
1.7.30
1.7.20
1.7.10
1.7.00
1.6.40
1.6.30
1.6.20
1.6.10
1.6.01
1.5.220
1.5.211
1.5.200
1.5.190
1.5.180
1.5.170
1.5.163
1.5.150
1.5.140
1.5.130
1.5.120
1.5.110
1.5.100
1.5.90
1.5.80
1.5.70
1.5.60
1.5.50
1.5.43
1.5.31
1.5.20
1.5.10
1.5.00
1.4.60
1.4.50
1.4.30
1.4.20
1.4.10
1.4.00
1.2.50
1.2.40
1.2.30
1.2.21
1.2.10
1.0.131
1.0.120
1.0.110
1.0.100
1.0.80
1.0.70
1.0.61
1.0.51
1.0.41
1.0.21
1.0.01

Package Sidebar

Install

npm i fireblocks-sdk

Weekly Downloads

37,577

Version

5.35.0

License

MIT

Unpacked Size

377 kB

Total Files

43

Last publish

Collaborators

  • idan-fb
  • yarinfb
  • arikblocks
  • orenyomtov
  • dx_fireblocks
  • ylfbks
  • slavaserebrianniy
  • fb_alongo
  • vladkucherov
  • yuval-fireblocks