5.25.1 • Published 24 days ago

fireblocks-sdk v5.25.1

Weekly downloads
940
License
MIT
Repository
github
Last release
24 days ago

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
5.25.1

24 days ago

5.25.0

30 days ago

5.24.0

1 month ago

5.23.0

2 months ago

5.22.0

2 months ago

5.21.0

2 months ago

5.20.0

3 months ago

5.19.0

3 months ago

5.18.1

3 months ago

5.18.0

4 months ago

5.17.0

4 months ago

5.16.0

4 months ago

5.15.0

5 months ago

5.15.1

5 months ago

5.14.0

5 months ago

5.13.0

5 months ago

5.11.0

6 months ago

5.12.0

5 months ago

5.9.0

7 months ago

5.10.0

6 months ago

5.8.0

7 months ago

5.6.1

8 months ago

5.7.0

8 months ago

5.4.0

9 months ago

5.5.1

9 months ago

5.5.0

9 months ago

5.6.0

9 months ago

5.3.1

9 months ago

5.3.0

10 months ago

5.2.0

10 months ago

5.1.4

11 months ago

5.1.3

11 months ago

5.1.2

12 months ago

5.1.1

12 months ago

5.1.0

1 year ago

4.2.0

1 year ago

5.0.1

1 year ago

5.0.0

1 year ago

4.1.0

1 year ago

4.0.0

1 year ago

3.0.1

1 year ago

3.1.3

1 year ago

3.1.2

1 year ago

3.1.1

1 year ago

3.1.0

1 year ago

3.1.4

1 year ago

2.4.1

1 year ago

2.4.0

2 years ago

2.4.2

1 year ago

3.0.0

1 year ago

2.5.0

1 year ago

2.5.2

1 year ago

2.5.1

1 year ago

2.5.4

1 year ago

2.5.3

1 year ago

2.3.0

2 years ago

2.3.2

2 years ago

2.3.1

2 years ago

2.2.0

2 years ago

2.1.0

2 years ago

1.14.0

2 years ago

2.0.0

2 years ago

1.12.0

2 years ago

1.11.0

2 years ago

1.13.0

2 years ago

1.11.1

2 years ago

1.9.0

2 years ago

1.10.0

2 years ago

1.8.2

2 years ago

1.8.1

2 years ago

1.8.0

2 years ago

1.7.3

2 years ago

1.7.2

3 years ago

1.7.1

3 years ago

1.7.0

3 years ago

1.6.4

3 years ago

1.6.3

3 years ago

1.6.2

3 years ago

1.6.1

3 years ago

1.6.0

3 years ago

1.5.22

3 years ago

1.5.18

3 years ago

1.5.19

3 years ago

1.5.21

3 years ago

1.5.20

3 years ago

1.5.17

3 years ago

1.5.16

3 years ago

1.5.15

3 years ago

1.5.14

3 years ago

1.5.13

3 years ago

1.5.12

3 years ago

1.5.11

3 years ago

1.5.10

3 years ago

1.5.9

3 years ago

1.5.8

3 years ago

1.5.7

3 years ago

1.5.6

4 years ago

1.5.5

4 years ago

1.5.4

4 years ago

1.5.3

4 years ago

1.5.2

4 years ago

1.5.1

4 years ago

1.5.0

4 years ago

1.4.6

4 years ago

1.4.5

4 years ago

1.4.3

4 years ago

1.4.2

4 years ago

1.4.1

4 years ago

1.4.0

4 years ago

1.2.5

4 years ago

1.2.4

4 years ago

1.2.3

4 years ago

1.2.2

4 years ago

1.2.0

4 years ago

1.2.1

4 years ago

1.0.13

4 years ago

1.0.12

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.2

5 years ago

1.0.0

5 years ago