Skip to content

Latest commit

 

History

History
783 lines (514 loc) · 28.8 KB

TokenizationApi.md

File metadata and controls

783 lines (514 loc) · 28.8 KB

TokenizationApi

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

Method HTTP request Description
burnCollectionToken POST /tokenization/collections/{id}/tokens/burn Burn tokens
createNewCollection POST /tokenization/collections Create a new collection
fetchCollectionTokenDetails GET /tokenization/collections/{id}/tokens/{tokenId} Get collection token details
getCollectionById GET /tokenization/collections/{id} Get a collection by id
getLinkedCollections GET /tokenization/collections Get collections
getLinkedToken GET /tokenization/tokens/{id} Return a linked token
getLinkedTokens GET /tokenization/tokens List all linked tokens
issueNewToken POST /tokenization/tokens Issue a new token
link POST /tokenization/tokens/link Link a contract
mintCollectionToken POST /tokenization/collections/{id}/tokens/mint Mint tokens
unlink DELETE /tokenization/tokens/{id} Unlink a token
unlinkCollection DELETE /tokenization/collections/{id} Delete a collection link

burnCollectionToken

CollectionBurnResponseDto burnCollectionToken(collectionBurnRequestDto, )

Burn tokens in a collection

Example

import { readFileSync } from 'fs';
import { Fireblocks, BasePath } from '@fireblocks/ts-sdk';
import type { FireblocksResponse, TokenizationApiBurnCollectionTokenRequest, CollectionBurnResponseDto } 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: TokenizationApiBurnCollectionTokenRequest = {
  // CollectionBurnRequestDto
  collectionBurnRequestDto: param_value,
  // string | The collection link id
  id: fbfbfbfb-fbfb-fbfb-fbfb-fbfbfbfbfbfb,
  // 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.tokenization.burnCollectionToken(body).then((res: FireblocksResponse<CollectionBurnResponseDto>) => {
  console.log('API called successfully. Returned data: ' + JSON.stringify(res, null, 2));
}).catch((error:any) => console.error(error));

Parameters

Name Type Description Notes
collectionBurnRequestDto CollectionBurnRequestDto
id [string] The collection link 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

CollectionBurnResponseDto

Authorization

No authorization required

HTTP request headers

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

HTTP response details

Status code Description Response headers
202 Tokens burned successfully -
0 Error Response * X-Request-ID -

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

createNewCollection

CollectionLinkDto createNewCollection(collectionDeployRequestDto)

Create a new collection and link it as a token

Example

import { readFileSync } from 'fs';
import { Fireblocks, BasePath } from '@fireblocks/ts-sdk';
import type { FireblocksResponse, TokenizationApiCreateNewCollectionRequest, CollectionLinkDto } 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: TokenizationApiCreateNewCollectionRequest = {
  // CollectionDeployRequestDto
  collectionDeployRequestDto: 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.tokenization.createNewCollection(body).then((res: FireblocksResponse<CollectionLinkDto>) => {
  console.log('API called successfully. Returned data: ' + JSON.stringify(res, null, 2));
}).catch((error:any) => console.error(error));

Parameters

Name Type Description Notes
collectionDeployRequestDto CollectionDeployRequestDto
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

CollectionLinkDto

Authorization

No authorization required

HTTP request headers

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

HTTP response details

Status code Description Response headers
201 Collection was created successfully -
0 Error Response * X-Request-ID -

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

fetchCollectionTokenDetails

CollectionLinkDto fetchCollectionTokenDetails()

Get collection token details by id

Example

import { readFileSync } from 'fs';
import { Fireblocks, BasePath } from '@fireblocks/ts-sdk';
import type { FireblocksResponse, TokenizationApiFetchCollectionTokenDetailsRequest, CollectionLinkDto } 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: TokenizationApiFetchCollectionTokenDetailsRequest = {
  // string | The collection link id
  id: fbfbfbfb-fbfb-fbfb-fbfb-fbfbfbfbfbfb,
  // string | The tokenId as it appears on the blockchain
  tokenId: 1,
};

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

Parameters

Name Type Description Notes
id [string] The collection link id defaults to undefined
tokenId [string] The tokenId as it appears on the blockchain defaults to undefined

Return type

CollectionLinkDto

Authorization

No authorization required

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Collection token details were fetched successfully -
0 Error Response * X-Request-ID -

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

getCollectionById

CollectionLinkDto getCollectionById()

Get a collection by id

Example

import { readFileSync } from 'fs';
import { Fireblocks, BasePath } from '@fireblocks/ts-sdk';
import type { FireblocksResponse, TokenizationApiGetCollectionByIdRequest, CollectionLinkDto } 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: TokenizationApiGetCollectionByIdRequest = {
  // string | The token link id
  id: fbfbfbfb-fbfb-fbfb-fbfb-fbfbfbfbfbfb,
};

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

Parameters

Name Type Description Notes
id [string] The token link id defaults to undefined

Return type

CollectionLinkDto

Authorization

No authorization required

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Collection fetched successfully -
0 Error Response * X-Request-ID -

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

getLinkedCollections

GetLinkedCollectionsPaginatedResponse getLinkedCollections()

Get collections (paginated)

Example

import { readFileSync } from 'fs';
import { Fireblocks, BasePath } from '@fireblocks/ts-sdk';
import type { FireblocksResponse, TokenizationApiGetLinkedCollectionsRequest, GetLinkedCollectionsPaginatedResponse } 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: TokenizationApiGetLinkedCollectionsRequest = {
  // string | Page cursor to get the next page, for example - \"MjAyMy0xMi0xMyAyMDozNjowOC4zMDI=:MTEwMA==\" (optional)
  pageCursor: pageCursor_example,
  // number | Number of items per page (max 100), requesting more then 100 will return 100 items (optional)
  pageSize: 10,
  // any | A comma separated list of statuses to filter. Default is \"COMPLETED\" (optional)
  status: COMPLETED,
};

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

Parameters

Name Type Description Notes
pageCursor [string] Page cursor to get the next page, for example - &quot;MjAyMy0xMi0xMyAyMDozNjowOC4zMDI=:MTEwMA==&quot; (optional) defaults to undefined
pageSize [number] Number of items per page (max 100), requesting more then 100 will return 100 items (optional) defaults to 100
status any A comma separated list of statuses to filter. Default is &quot;COMPLETED&quot; (optional) defaults to undefined

Return type

GetLinkedCollectionsPaginatedResponse

Authorization

No authorization required

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Collection fetched successfully -
0 Error Response * X-Request-ID -

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

getLinkedToken

TokenLinkDto getLinkedToken()

Return a linked token, with its status and metadata.

Example

import { readFileSync } from 'fs';
import { Fireblocks, BasePath } from '@fireblocks/ts-sdk';
import type { FireblocksResponse, TokenizationApiGetLinkedTokenRequest, TokenLinkDto } 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: TokenizationApiGetLinkedTokenRequest = {
  // string | The token link id
  id: fbfbfbfb-fbfb-fbfb-fbfb-fbfbfbfbfbfb,
};

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

Parameters

Name Type Description Notes
id [string] The token link id defaults to undefined

Return type

TokenLinkDto

Authorization

No authorization required

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Token fetched successfully -
0 Error Response * X-Request-ID -

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

getLinkedTokens

TokensPaginatedResponse getLinkedTokens()

Return all linked tokens (paginated)

Example

import { readFileSync } from 'fs';
import { Fireblocks, BasePath } from '@fireblocks/ts-sdk';
import type { FireblocksResponse, TokenizationApiGetLinkedTokensRequest, TokensPaginatedResponse } 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: TokenizationApiGetLinkedTokensRequest = {
  // string | Page cursor to get the next page (optional)
  pageCursor: MjAyMy0xMi0xMyAyMDozNjowOC4zMDI=:MTEwMA==,
  // number | Number of items per page, requesting more then max will return max items (optional)
  pageSize: 10,
  // any | A comma separated list of statuses to filter. Default is \"COMPLETED\" (optional)
  status: COMPLETED,
};

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

Parameters

Name Type Description Notes
pageCursor [string] Page cursor to get the next page (optional) defaults to undefined
pageSize [number] Number of items per page, requesting more then max will return max items (optional) defaults to undefined
status any A comma separated list of statuses to filter. Default is &quot;COMPLETED&quot; (optional) defaults to undefined

Return type

TokensPaginatedResponse

Authorization

No authorization required

HTTP request headers

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

HTTP response details

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

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

issueNewToken

TokenLinkDto issueNewToken(createTokenRequestDto)

Facilitates the creation of a new token, supporting both EVM-based and Stellar/Ripple platforms. For EVM, it deploys the corresponding contract template to the blockchain and links the token to the workspace. For Stellar/Ripple, it links a newly created token directly to the workspace without deploying a contract. Returns the token link with status "PENDING" until the token is deployed or "SUCCESS" if no deployment is needed.

Example

import { readFileSync } from 'fs';
import { Fireblocks, BasePath } from '@fireblocks/ts-sdk';
import type { FireblocksResponse, TokenizationApiIssueNewTokenRequest, TokenLinkDto } 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: TokenizationApiIssueNewTokenRequest = {
  // CreateTokenRequestDto
  createTokenRequestDto: 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.tokenization.issueNewToken(body).then((res: FireblocksResponse<TokenLinkDto>) => {
  console.log('API called successfully. Returned data: ' + JSON.stringify(res, null, 2));
}).catch((error:any) => console.error(error));

Parameters

Name Type Description Notes
createTokenRequestDto CreateTokenRequestDto
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

TokenLinkDto

Authorization

No authorization required

HTTP request headers

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

HTTP response details

Status code Description Response headers
201 Token was created successfully -
409 Asset already exists -

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

link

TokenLinkDto link(tokenLinkRequestDto)

Link an a contract

Example

import { readFileSync } from 'fs';
import { Fireblocks, BasePath } from '@fireblocks/ts-sdk';
import type { FireblocksResponse, TokenizationApiLinkRequest, TokenLinkDto } 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: TokenizationApiLinkRequest = {
  // TokenLinkRequestDto
  tokenLinkRequestDto: 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.tokenization.link(body).then((res: FireblocksResponse<TokenLinkDto>) => {
  console.log('API called successfully. Returned data: ' + JSON.stringify(res, null, 2));
}).catch((error:any) => console.error(error));

Parameters

Name Type Description Notes
tokenLinkRequestDto TokenLinkRequestDto
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

TokenLinkDto

Authorization

No authorization required

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Token linked successfully -
201 -
404 Could not find the underlying contract to link to -
409 Token link for {refId} already exists -
0 Error Response * X-Request-ID -

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

mintCollectionToken

CollectionMintResponseDto mintCollectionToken(collectionMintRequestDto, )

Mint tokens and upload metadata

Example

import { readFileSync } from 'fs';
import { Fireblocks, BasePath } from '@fireblocks/ts-sdk';
import type { FireblocksResponse, TokenizationApiMintCollectionTokenRequest, CollectionMintResponseDto } 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: TokenizationApiMintCollectionTokenRequest = {
  // CollectionMintRequestDto
  collectionMintRequestDto: param_value,
  // string | The collection link id
  id: fbfbfbfb-fbfb-fbfb-fbfb-fbfbfbfbfbfb,
  // 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.tokenization.mintCollectionToken(body).then((res: FireblocksResponse<CollectionMintResponseDto>) => {
  console.log('API called successfully. Returned data: ' + JSON.stringify(res, null, 2));
}).catch((error:any) => console.error(error));

Parameters

Name Type Description Notes
collectionMintRequestDto CollectionMintRequestDto
id [string] The collection link 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

CollectionMintResponseDto

Authorization

No authorization required

HTTP request headers

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

HTTP response details

Status code Description Response headers
202 Tokens minted successfully -
0 Error Response * X-Request-ID -

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

unlink

unlink()

Unlink a token. The token will be unlinked from the workspace. The token will not be deleted on chain nor the refId, only the link to the workspace will be removed.

Example

import { readFileSync } from 'fs';
import { Fireblocks, BasePath } from '@fireblocks/ts-sdk';
import type { FireblocksResponse, TokenizationApiUnlinkRequest } 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: TokenizationApiUnlinkRequest = {
  // string | The token link id
  id: fbfbfbfb-fbfb-fbfb-fbfb-fbfbfbfbfbfb,
};

fireblocks.tokenization.unlink(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
id [string] The token link id 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
200 Token unlinked successfully -
204 -
404 Link did not exist -
0 Error Response * X-Request-ID -

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

unlinkCollection

unlinkCollection()

Delete a collection link

Example

import { readFileSync } from 'fs';
import { Fireblocks, BasePath } from '@fireblocks/ts-sdk';
import type { FireblocksResponse, TokenizationApiUnlinkCollectionRequest } 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: TokenizationApiUnlinkCollectionRequest = {
  // string | The token link id
  id: fbfbfbfb-fbfb-fbfb-fbfb-fbfbfbfbfbfb,
};

fireblocks.tokenization.unlinkCollection(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
id [string] The token link id 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
204 Collection unlinked successfully -
404 Link for collection does not exist -
0 Error Response * X-Request-ID -

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