All URIs are relative to https://developers.fireblocks.com/reference/
Method | HTTP request | Description |
---|---|---|
addContractAsset | POST /contracts/{contractId}/{assetId} | Add an asset to a contract |
createContract | POST /contracts | Create a contract |
deleteContract | DELETE /contracts/{contractId} | Delete a contract |
deleteContractAsset | DELETE /contracts/{contractId}/{assetId} | Delete a contract asset |
getContract | GET /contracts/{contractId} | Find a specific contract |
getContractAsset | GET /contracts/{contractId}/{assetId} | Find a contract asset |
getContracts | GET /contracts | List contracts |
ExternalWalletAsset addContractAsset()
Adds an asset to an existing contract.
import { readFileSync } from 'fs';
import { Fireblocks, BasePath } from '@fireblocks/ts-sdk';
import type { FireblocksResponse, ContractsApiAddContractAssetRequest, 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: ContractsApiAddContractAssetRequest = {
// string | The ID of the contract
contractId: contractId_example,
// string | The ID of the asset to add
assetId: assetId_example,
// AddContractAssetRequest (optional)
addContractAssetRequest: 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.contracts.addContractAsset(body).then((res: FireblocksResponse<ExternalWalletAsset>) => {
console.log('API called successfully. Returned data: ' + JSON.stringify(res, null, 2));
}).catch((error:any) => console.error(error));
Name | Type | Description | Notes |
---|---|---|---|
addContractAssetRequest | AddContractAssetRequest | ||
contractId | [string] | The ID of the contract | 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 |
No authorization required
- Content-Type: application/json
- Accept: application/json
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]
UnmanagedWallet createContract()
Creates a new contract.
import { readFileSync } from 'fs';
import { Fireblocks, BasePath } from '@fireblocks/ts-sdk';
import type { FireblocksResponse, ContractsApiCreateContractRequest, 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: ContractsApiCreateContractRequest = {
// CreateContractRequest (optional)
createContractRequest: 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.contracts.createContract(body).then((res: FireblocksResponse<UnmanagedWallet>) => {
console.log('API called successfully. Returned data: ' + JSON.stringify(res, null, 2));
}).catch((error:any) => console.error(error));
Name | Type | Description | Notes |
---|---|---|---|
createContractRequest | CreateContractRequest | ||
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 |
No authorization required
- Content-Type: application/json
- Accept: application/json
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]
deleteContract()
Deletes a contract by ID.
import { readFileSync } from 'fs';
import { Fireblocks, BasePath } from '@fireblocks/ts-sdk';
import type { FireblocksResponse, ContractsApiDeleteContractRequest } 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: ContractsApiDeleteContractRequest = {
// string | The ID of the contract to delete
contractId: contractId_example,
};
fireblocks.contracts.deleteContract(body).then((res: FireblocksResponse<any>) => {
console.log('API called successfully. Returned data: ' + JSON.stringify(res, null, 2));
}).catch((error:any) => console.error(error));
Name | Type | Description | Notes |
---|---|---|---|
contractId | [string] | The ID of the contract to delete | defaults to undefined |
void (empty response body)
No authorization required
- Content-Type: Not defined
- Accept: application/json
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]
deleteContractAsset()
Deletes a contract asset by ID.
import { readFileSync } from 'fs';
import { Fireblocks, BasePath } from '@fireblocks/ts-sdk';
import type { FireblocksResponse, ContractsApiDeleteContractAssetRequest } 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: ContractsApiDeleteContractAssetRequest = {
// string | The ID of the contract
contractId: contractId_example,
// string | The ID of the asset to delete
assetId: assetId_example,
};
fireblocks.contracts.deleteContractAsset(body).then((res: FireblocksResponse<any>) => {
console.log('API called successfully. Returned data: ' + JSON.stringify(res, null, 2));
}).catch((error:any) => console.error(error));
Name | Type | Description | Notes |
---|---|---|---|
contractId | [string] | The ID of the contract | defaults to undefined |
assetId | [string] | The ID of the asset to delete | defaults to undefined |
void (empty response body)
No authorization required
- Content-Type: Not defined
- Accept: application/json
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]
UnmanagedWallet getContract()
Returns a contract by ID.
import { readFileSync } from 'fs';
import { Fireblocks, BasePath } from '@fireblocks/ts-sdk';
import type { FireblocksResponse, ContractsApiGetContractRequest, 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: ContractsApiGetContractRequest = {
// string | The ID of the contract to return
contractId: contractId_example,
};
fireblocks.contracts.getContract(body).then((res: FireblocksResponse<UnmanagedWallet>) => {
console.log('API called successfully. Returned data: ' + JSON.stringify(res, null, 2));
}).catch((error:any) => console.error(error));
Name | Type | Description | Notes |
---|---|---|---|
contractId | [string] | The ID of the contract to return | defaults to undefined |
No authorization required
- Content-Type: Not defined
- Accept: application/json
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]
ExternalWalletAsset getContractAsset()
Returns a contract asset by ID.
import { readFileSync } from 'fs';
import { Fireblocks, BasePath } from '@fireblocks/ts-sdk';
import type { FireblocksResponse, ContractsApiGetContractAssetRequest, 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: ContractsApiGetContractAssetRequest = {
// string | The ID of the contract
contractId: contractId_example,
// string | The ID of the asset to return
assetId: assetId_example,
};
fireblocks.contracts.getContractAsset(body).then((res: FireblocksResponse<ExternalWalletAsset>) => {
console.log('API called successfully. Returned data: ' + JSON.stringify(res, null, 2));
}).catch((error:any) => console.error(error));
Name | Type | Description | Notes |
---|---|---|---|
contractId | [string] | The ID of the contract | defaults to undefined |
assetId | [string] | The ID of the asset to return | defaults to undefined |
No authorization required
- Content-Type: Not defined
- Accept: application/json
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]
GetContractsResponse getContracts()
Gets a list of contracts.
import { readFileSync } from 'fs';
import { Fireblocks, BasePath } from '@fireblocks/ts-sdk';
import type { FireblocksResponse, GetContractsResponse } 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.contracts.getContracts(body).then((res: FireblocksResponse<GetContractsResponse>) => {
console.log('API called successfully. Returned data: ' + JSON.stringify(res, null, 2));
}).catch((error:any) => console.error(error));
This endpoint does not need any parameter.
No authorization required
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | A list of contracts | * X-Request-ID - |
0 | Error Response | * X-Request-ID - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]