Skip to content

Latest commit

 

History

History
132 lines (84 loc) · 5.1 KB

BlockchainsAssetsApi.md

File metadata and controls

132 lines (84 loc) · 5.1 KB

BlockchainsAssetsApi

All URIs are relative to https://developers.fireblocks.com/reference/

Method HTTP request Description
getSupportedAssets GET /supported_assets List all asset types supported by Fireblocks
registerNewAsset POST /assets Register an asset

getSupportedAssets

GetSupportedAssetsResponse getSupportedAssets()

Returns all asset types supported by Fireblocks.

Example

import { readFileSync } from 'fs';
import { Fireblocks, BasePath } from '@fireblocks/ts-sdk';
import type { FireblocksResponse, GetSupportedAssetsResponse } from '@fireblocks/ts-sdk';

// Set the environment variables for authentication
process.env.FIREBLOCKS_BASE_PATH = BasePath.Sandbox; // or assign directly to "https://sandbox-api.fireblocks.io/v1"
process.env.FIREBLOCKS_API_KEY = "my-api-key";
process.env.FIREBLOCKS_SECRET_KEY = readFileSync("./fireblocks_secret.key", "utf8");

const fireblocks = new Fireblocks();

let body:any = {};

fireblocks.blockchainsAssets.getSupportedAssets(body).then((res: FireblocksResponse<GetSupportedAssetsResponse>) => {
  console.log('API called successfully. Returned data: ' + JSON.stringify(res, null, 2));
}).catch((error:any) => console.error(error));

Parameters

This endpoint does not need any parameter.

Return type

GetSupportedAssetsResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 A Transaction object * X-Request-ID -
0 Error Response * X-Request-ID -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

registerNewAsset

AssetResponse registerNewAsset()

Register a new asset to a workspace and return the newly created asset's details. Currently supported for EVM based chains only.

Example

import { readFileSync } from 'fs';
import { Fireblocks, BasePath } from '@fireblocks/ts-sdk';
import type { FireblocksResponse, BlockchainsAssetsApiRegisterNewAssetRequest, AssetResponse } from '@fireblocks/ts-sdk';

// Set the environment variables for authentication
process.env.FIREBLOCKS_BASE_PATH = BasePath.Sandbox; // or assign directly to "https://sandbox-api.fireblocks.io/v1"
process.env.FIREBLOCKS_API_KEY = "my-api-key";
process.env.FIREBLOCKS_SECRET_KEY = readFileSync("./fireblocks_secret.key", "utf8");

const fireblocks = new Fireblocks();

let body: BlockchainsAssetsApiRegisterNewAssetRequest = {
  // RegisterNewAssetRequest (optional)
  registerNewAssetRequest: param_value,
  // string | A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. (optional)
  idempotencyKey: idempotencyKey_example,
};

fireblocks.blockchainsAssets.registerNewAsset(body).then((res: FireblocksResponse<AssetResponse>) => {
  console.log('API called successfully. Returned data: ' + JSON.stringify(res, null, 2));
}).catch((error:any) => console.error(error));

Parameters

Name Type Description Notes
registerNewAssetRequest RegisterNewAssetRequest
idempotencyKey [string] A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. (optional) defaults to undefined

Return type

AssetResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 A new asset has been created successfully -
400 - Listing an asset on the requested blockchain is not supported. Error code: 1000 - The asset address is invalid. Error code: 1003 - Self serve listing an asset on the requested blockchain is currently not supported, please contact support. Error code: 1004 -
403 - The asset creation quota reached. Error code: 1005 -
404 - Invalid address, could not get asset information. Error code 1003 -
409 - The asset is already supported globally. Error code: 1001 - The asset has already been added to this workspace. Error code: 1002 -
500 Failed to create asset -

[Back to top] [Back to API list] [Back to Model list] [Back to README]