Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into ncw-unspent-inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
yuval-fireblocks committed Apr 2, 2024
2 parents ac12750 + ac9fe07 commit 08235ce
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 5 deletions.
15 changes: 14 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,25 @@

All notable changes to this project will be documented in this file. Dates are displayed in UTC.

#### [v5.23.0](https://github.com/fireblocks/fireblocks-sdk-js/compare/v5.21.0...v5.23.0)
#### [v5.24.0](https://github.com/fireblocks/fireblocks-sdk-js/compare/v5.23.0...v5.24.0)

> 1 April 2024
- Add registerNewAsset function [`#264`](https://github.com/fireblocks/fireblocks-sdk-js/pull/264)

#### [v5.23.0](https://github.com/fireblocks/fireblocks-sdk-js/compare/v5.22.0...v5.23.0)

> 14 March 2024
- Tokenization - Add displayName [`#262`](https://github.com/fireblocks/fireblocks-sdk-js/pull/262)

#### [v5.22.0](https://github.com/fireblocks/fireblocks-sdk-js/compare/v5.21.0...v5.22.0)

> 12 March 2024
- Remove colon from supported screening URL [`#265`](https://github.com/fireblocks/fireblocks-sdk-js/pull/265)
- Add supported screening assets route [`#259`](https://github.com/fireblocks/fireblocks-sdk-js/pull/259)

#### [v5.21.0](https://github.com/fireblocks/fireblocks-sdk-js/compare/v5.20.0...v5.21.0)

> 28 February 2024
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fireblocks-sdk",
"version": "5.23.0",
"version": "5.24.0",
"main": "dist/src/fireblocks-sdk.js",
"types": "dist/src/fireblocks-sdk.d.ts",
"scripts": {
Expand Down
17 changes: 16 additions & 1 deletion src/fireblocks-sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,11 @@ import {
TokenLinkStatus,
SupportedContractTemplateType,
AbiFunction,
TokenOwnershipSpamUpdatePayload, ScreeningSupportedAssetResponse, ScreeningSupportedProviders, UnspentInputsResponse,
TokenOwnershipSpamUpdatePayload,
ScreeningSupportedAssetResponse,
ScreeningSupportedProviders,
RegisterAssetResponse,
UnspentInputsResponse,
} from "./types";
import { AxiosProxyConfig, AxiosResponse, InternalAxiosRequestConfig } from "axios";
import { PIIEncryption } from "./pii-client";
Expand Down Expand Up @@ -859,6 +863,17 @@ export class FireblocksSDK {
return await this.apiClient.issuePostRequest(`/v1/vault/accounts/${vaultAccountId}/${assetId}`, {}, requestOptions);
}

/**
* Registers new asset
* @param blockchainId Native asset of blockchain
* @param address Asset contract address
* @param symbol Asset symbol
* @param requestOptions
*/
public async registerNewAsset(blockchainId: string, address: string, symbol?: string, requestOptions?: RequestOptions): Promise<RegisterAssetResponse> {
return await this.apiClient.issuePostRequest(`/v1/assets`, { blockchainId, address, symbol }, requestOptions);
}

/**
* Retry to create a vault asset for a vault asset that failed
* @param vaultAccountId The vault account ID
Expand Down
32 changes: 32 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,38 @@ export interface UnfreezeTransactionResponse {
success: boolean;
}

export interface RegisterAssetResponse {
legacyId: string;
assetClass: AssetClass;
onchain: OnchainAsset;
metadata: AssetMetadata;
}

export enum AssetClass {
NATIVE = "NATIVE",
FT = "FT",
NFT = "NFT",
SFT = "SFT",
}

export interface OnchainAsset {
symbol: string;
name: string;
address?: string;
decimals: number;
standard: string;
}

export interface AssetMetadata {
scope: AssetScope;
deprecated: boolean;
}

export enum AssetScope {
GLOBAL = "Global",
LOCAL = "Local",
}

export interface VaultAssetResponse {
id: string;
address: string;
Expand Down

0 comments on commit 08235ce

Please sign in to comment.