Skip to content

Latest commit

 

History

History
515 lines (335 loc) · 18.4 KB

ExternalWalletsApi.md

File metadata and controls

515 lines (335 loc) · 18.4 KB

ExternalWalletsApi

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

Method HTTP request Description
addAssetToExternalWallet POST /external_wallets/{walletId}/{assetId} Add an asset to an external wallet.
createExternalWallet POST /external_wallets Create an external wallet
deleteExternalWallet DELETE /external_wallets/{walletId} Delete an external wallet
getExternalWallet GET /external_wallets/{walletId} Find an external wallet
getExternalWalletAsset GET /external_wallets/{walletId}/{assetId} Get an asset from an external wallet
getExternalWallets GET /external_wallets List external wallets
removeAssetFromExternalWallet DELETE /external_wallets/{walletId}/{assetId} Delete an asset from an external wallet
setExternalWalletCustomerRefId POST /external_wallets/{walletId}/set_customer_ref_id Set an AML customer reference ID for an external wallet

addAssetToExternalWallet

ExternalWalletAsset addAssetToExternalWallet()

Adds an asset to an existing external wallet.

Example

import { readFileSync } from 'fs';
import { Fireblocks, BasePath } from '@fireblocks/ts-sdk';
import type { FireblocksResponse, ExternalWalletsApiAddAssetToExternalWalletRequest, ExternalWalletAsset } 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: ExternalWalletsApiAddAssetToExternalWalletRequest = {
  // string | The ID of the wallet
  walletId: walletId_example,
  // string | The ID of the asset to add
  assetId: assetId_example,
  // AddAssetToExternalWalletRequest (optional)
  addAssetToExternalWalletRequest: 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.externalWallets.addAssetToExternalWallet(body).then((res: FireblocksResponse<ExternalWalletAsset>) => {
  console.log('API called successfully. Returned data: ' + JSON.stringify(res, null, 2));
}).catch((error:any) => console.error(error));

Parameters

Name Type Description Notes
addAssetToExternalWalletRequest AddAssetToExternalWalletRequest
walletId [string] The ID of the wallet defaults to undefined
assetId [string] The ID of the asset to add defaults to undefined
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

ExternalWalletAsset

Authorization

No authorization required

HTTP request headers

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

HTTP response details

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

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

createExternalWallet

UnmanagedWallet createExternalWallet()

Creates a new external wallet with the requested name.

Example

import { readFileSync } from 'fs';
import { Fireblocks, BasePath } from '@fireblocks/ts-sdk';
import type { FireblocksResponse, ExternalWalletsApiCreateExternalWalletRequest, UnmanagedWallet } 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: ExternalWalletsApiCreateExternalWalletRequest = {
  // CreateWalletRequest (optional)
  createWalletRequest: 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.externalWallets.createExternalWallet(body).then((res: FireblocksResponse<UnmanagedWallet>) => {
  console.log('API called successfully. Returned data: ' + JSON.stringify(res, null, 2));
}).catch((error:any) => console.error(error));

Parameters

Name Type Description Notes
createWalletRequest CreateWalletRequest
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

UnmanagedWallet

Authorization

No authorization required

HTTP request headers

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

HTTP response details

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

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

deleteExternalWallet

deleteExternalWallet()

Deletes an external wallet by ID.

Example

import { readFileSync } from 'fs';
import { Fireblocks, BasePath } from '@fireblocks/ts-sdk';
import type { FireblocksResponse, ExternalWalletsApiDeleteExternalWalletRequest } 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: ExternalWalletsApiDeleteExternalWalletRequest = {
  // string | The ID of the wallet to delete
  walletId: walletId_example,
};

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

Parameters

Name Type Description Notes
walletId [string] The ID of the wallet to delete defaults to undefined

Return type

void (empty response body)

Authorization

No authorization required

HTTP request headers

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

HTTP response details

Status code Description Response headers
201 OK * X-Request-ID -
0 Error Response * X-Request-ID -

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

getExternalWallet

UnmanagedWallet getExternalWallet()

Returns an external wallet by ID.

Example

import { readFileSync } from 'fs';
import { Fireblocks, BasePath } from '@fireblocks/ts-sdk';
import type { FireblocksResponse, ExternalWalletsApiGetExternalWalletRequest, UnmanagedWallet } 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: ExternalWalletsApiGetExternalWalletRequest = {
  // string | The ID of the wallet to return
  walletId: walletId_example,
};

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

Parameters

Name Type Description Notes
walletId [string] The ID of the wallet to return defaults to undefined

Return type

UnmanagedWallet

Authorization

No authorization required

HTTP request headers

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

HTTP response details

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

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

getExternalWalletAsset

ExternalWalletAsset getExternalWalletAsset()

Returns an external wallet by wallet ID and asset ID.

Example

import { readFileSync } from 'fs';
import { Fireblocks, BasePath } from '@fireblocks/ts-sdk';
import type { FireblocksResponse, ExternalWalletsApiGetExternalWalletAssetRequest, ExternalWalletAsset } 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: ExternalWalletsApiGetExternalWalletAssetRequest = {
  // string | The ID of the wallet
  walletId: walletId_example,
  // string | The ID of the asset to return
  assetId: assetId_example,
};

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

Parameters

Name Type Description Notes
walletId [string] The ID of the wallet defaults to undefined
assetId [string] The ID of the asset to return defaults to undefined

Return type

ExternalWalletAsset

Authorization

No authorization required

HTTP request headers

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

HTTP response details

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

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

getExternalWallets

GetExternalWalletsResponse getExternalWallets()

Gets a list of external wallets under the workspace.

Example

import { readFileSync } from 'fs';
import { Fireblocks, BasePath } from '@fireblocks/ts-sdk';
import type { FireblocksResponse, GetExternalWalletsResponse } 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.externalWallets.getExternalWallets(body).then((res: FireblocksResponse<GetExternalWalletsResponse>) => {
  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

GetExternalWalletsResponse

Authorization

No authorization required

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 A list of external wallets * X-Request-ID -
0 Error Response * X-Request-ID -

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

removeAssetFromExternalWallet

removeAssetFromExternalWallet()

Deletes an external wallet asset by ID.

Example

import { readFileSync } from 'fs';
import { Fireblocks, BasePath } from '@fireblocks/ts-sdk';
import type { FireblocksResponse, ExternalWalletsApiRemoveAssetFromExternalWalletRequest } 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: ExternalWalletsApiRemoveAssetFromExternalWalletRequest = {
  // string | The ID of the wallet
  walletId: walletId_example,
  // string | The ID of the asset to delete
  assetId: assetId_example,
};

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

Parameters

Name Type Description Notes
walletId [string] The ID of the wallet defaults to undefined
assetId [string] The ID of the asset to delete defaults to undefined

Return type

void (empty response body)

Authorization

No authorization required

HTTP request headers

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

HTTP response details

Status code Description Response headers
201 OK * X-Request-ID -
0 Error Response * X-Request-ID -

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

setExternalWalletCustomerRefId

setExternalWalletCustomerRefId(setCustomerRefIdRequest, )

Sets an AML/KYT customer reference ID for the specific external wallet.

Example

import { readFileSync } from 'fs';
import { Fireblocks, BasePath } from '@fireblocks/ts-sdk';
import type { FireblocksResponse, ExternalWalletsApiSetExternalWalletCustomerRefIdRequest } 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: ExternalWalletsApiSetExternalWalletCustomerRefIdRequest = {
  // SetCustomerRefIdRequest
  setCustomerRefIdRequest: param_value,
  // string | The wallet ID
  walletId: walletId_example,
  // 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.externalWallets.setExternalWalletCustomerRefId(body).then((res: FireblocksResponse<any>) => {
  console.log('API called successfully. Returned data: ' + JSON.stringify(res, null, 2));
}).catch((error:any) => console.error(error));

Parameters

Name Type Description Notes
setCustomerRefIdRequest SetCustomerRefIdRequest
walletId [string] The wallet ID defaults to undefined
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

void (empty response body)

Authorization

No authorization required

HTTP request headers

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

HTTP response details

Status code Description Response headers
201 OK * X-Request-ID -
0 Error Response * X-Request-ID -

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