Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove old api endpoint; implement "internal_transfer" #219

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 11 additions & 26 deletions src/fireblocks-sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -510,39 +510,24 @@ export class FireblocksSDK {
}

/**
* Transfer from a main exchange account to a subaccount
* Internal Transfer from a main exchange account to a subaccount
* @param exchangeAccountId The exchange ID in Fireblocks
* @param subaccountId The ID of the subaccount in the exchange
* @param assetId The asset to transfer
* @param amount The amount to transfer
* @param note A description of the transfer
* @param requestOptions
*/
public async transferToSubaccount(exchangeAccountId: string, subaccountId: string, assetId: string, amount: number, requestOptions?: RequestOptions): Promise<OperationSuccessResponse> {
const body = {
subaccountId,
amount
};

return await this.apiClient.issuePostRequest(`/v1/exchange_accounts/${exchangeAccountId}/${assetId}/transfer_to_subaccount`, body, requestOptions);
}

/**
* Transfer from a subaccount to a main exchange account
* @param exchangeAccountId The exchange ID in Fireblocks
* @param subaccountId The ID of the subaccount in the exchange
* @param assetId The asset to transfer
* @param amount The amount to transfer
* @param requestOptions
*/
public async transferFromSubaccount(exchangeAccountId: string, subaccountId: string, assetId: string, amount: number, requestOptions?: RequestOptions): Promise<OperationSuccessResponse> {
const body = {
subaccountId,
amount
};

return await this.apiClient.issuePostRequest(`/v1/exchange_accounts/${exchangeAccountId}/${assetId}/transfer_from_subaccount`, body, requestOptions);
}
public async internalTransfer(exchangeAccountId: string, subaccountId: string, assetId: string, amount: number, note: string, requestOptions?: RequestOptions): Promise<OperationSuccessResponse> {
const body = {
subaccountId,
assetId,
amount,
note
};

return await this.apiClient.issuePostRequest(`/v1/exchange_accounts/${exchangeAccountId}/internal_transfer`, body, requestOptions);
}
/**
* Gets all fiat accounts for your tenant
*/
Expand Down