Overview
A JavaScript or Typescript developer can use the Fireblocks API in 2 different ways:- The Fireblocks JavaScript SDK.
- A standard HTTP library, such as Axios.
web3.js or ethers.js - Fireblocks is well intergrated into these libraries as described in the Ethereum Development.
Using the Fireblocks SDK
Install Node v16 or newer
The Fireblocks JavaScript SDK requires Node v16 or newer. You can check which version of Node you already have installed by running the following command.node -v
Learn how to install or update Node to a newer version.
Install fireblocks-sdk
The Fireblocks JavaScript SDK is open-source and hosted on both GitHub and PIP, the official package repository.- Source code: https://github.com/fireblocks/fireblocks-sdk-js
- JavaScript Package: https://www.npmjs.com/package/fireblocks-sdk
npm:
npm install fireblocks-sdk
Your First Fireblocks JavaScript script!
Now that you’re set-up, run a quick check for the API. The script will query existing vaults, create a new vault and then query again to see that the vaults were created. This Axios-based implementation will require some library dependencies:Use the correct API Base URLIn the following script, make sure you’re using the correct value for
baseUrl for your environment:- For Sandbox workspaces:
https://sandbox-api.fireblocks.io - For Mainnet or Testnet workspaces:
https://api.fireblocks.io