Skip to content

Commit

Permalink
changed return type to pending instead of TokenLink (#188)
Browse files Browse the repository at this point in the history
* changed return type to pending instead of TokenLink

* fixed request object

* Update src/fireblocks-sdk.ts

Co-authored-by: Idan Yael <idanya@users.noreply.github.com>

---------

Co-authored-by: Ami Magid <amagid@fireblocks.com>
Co-authored-by: Idan Yael <idanya@users.noreply.github.com>
  • Loading branch information
3 people authored Aug 10, 2023
1 parent e73c859 commit 8c4a3bc
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 5 deletions.
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18
6 changes: 3 additions & 3 deletions src/fireblocks-sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ import {
SmartTransfersTicketTermPayload,
SmartTransfersTicketTermFundPayload,
SmartTransfersTicketTermResponse,
UsersGroup,
UsersGroup, PendingTokenLinkDto,
} from "./types";
import { AxiosProxyConfig, AxiosResponse } from "axios";
import { PIIEncryption } from "./pii-client";
Expand Down Expand Up @@ -1495,8 +1495,8 @@ export class FireblocksSDK {
* Issue a new token and link it to the tenant
* @param request
*/
public async issueNewToken(request: IssueTokenRequest): Promise<TokenLink> {
return await this.apiClient.issuePostRequest(`/v1/tokenization/tokens/`, request);
public async issueNewToken(request: IssueTokenRequest): Promise<PendingTokenLinkDto> {
return await this.apiClient.issuePostRequest(`/v1/tokenization/tokens`, request);
}

/**
Expand Down
28 changes: 26 additions & 2 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1391,14 +1391,38 @@ export interface TokenLink {
assetMetadata?: LinkedTokenMetadata;
permissions: TokenLinkPermissionEntry[];
}
export interface PendingTokenLinkDto {
id: number;
txId?: string;
name?: string;
symbol?: string;
vaultAccountId?: string;
blockchainId?: string;
}


export interface IssueTokenRequest {
symbol: string;
name: string;
blockchainId: string;
ethContractAddress?: string;
vaultAccountId: string;
createParams: CreateTokenParams;
}
type CreateTokenParams = EVMTokenCreateParamsDto | StellarRippleCreateParamsDto;
interface StellarRippleCreateParamsDto {
issuerAddress?: string;
decimals: number;
}
interface ParameterWithValue {
internalType: string;
name: string;
type: string;
description?: string;
value: any;
}

interface EVMTokenCreateParamsDto {
contractId: string;
constructorParams?: Array<ParameterWithValue>;
}

export enum SmartTransfersTicketDirection {
Expand Down

0 comments on commit 8c4a3bc

Please sign in to comment.