const apiSecret = fs.readFileSync(path.resolve("./path_to_key"), "utf8");
// Choose the right api url for your workspace type
const baseUrl = "https://sandbox-api.fireblocks.io";
const fs = require('fs');
const path = require('path');
const { FireblocksSDK } = require('fireblocks-sdk');
const { exit } = require('process');
const { inspect } = require('util');
const apiKey = "api_key"
// Choose the right api url for your workspace type
const fireblocks = new FireblocksSDK(apiSecret, apiKey, baseUrl);
(async () => {
// Print vaults before creation
let vaultAccounts = await fireblocks.getVaultAccountsWithPageInfo({});
console.log(inspect(vaultAccounts, false, null, true));
// Create vault account
const vaultCreation = await fireblocks.createVaultAccount("QuickStart_Vault");
console.log(inspect(vaultCreation, false, null, true));
// Print vaults after creation
vaultAccounts = await fireblocks.getVaultAccountsWithPageInfo({});
console.log(inspect(vaultAccounts, false, null, true));
})().catch((e)=>{
console.error(`Failed: ${e}`);
exit(-1);
})
Using the above code all I get is axios 401 error