Skip to content

Commit

Permalink
Merge pull request #26 from fireblocks/off-exchange
Browse files Browse the repository at this point in the history
Off exchange
  • Loading branch information
tomervil authored Apr 26, 2021
2 parents ef873d6 + 44e90e8 commit c3b9965
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 3 deletions.
28 changes: 26 additions & 2 deletions src/fireblocks-sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ import {
GasStationInfo,
MaxSpendableAmountResponse,
VaultAccountsFilter,
RequestOptions,
VaultBalancesFilter,
ValidateAddressResponse,
CreateVaultAssetResponse
CreateVaultAssetResponse,
RequestOptions, AllocateFundsRequest, DeallocateFundsRequest
} from "./types";

export * from "./types";
Expand Down Expand Up @@ -640,6 +640,30 @@ export class FireblocksSDK {
return await this.apiClient.issueGetRequest(url);
}

/**
* allocate funds from you default balance to a private ledger
* @param vaultAccountId
* @param asset
* @param vaultAccountId
* @param asset
* @param args
*/
public async allocateFundsToPrivateLedger(vaultAccountId: string, asset: string, args: AllocateFundsRequest) {
const url = `/v1/vault/accounts/${vaultAccountId}/${asset}/lock_allocation`;
return await this.apiClient.issuePostRequest(url, args);
}

/**
* deallocate funds from a private ledger to your default balance
* @param vaultAccountId
* @param asset
* @param args
*/
public async deallocateFundsFromPrivateLedger(vaultAccountId: string, asset: string, args: DeallocateFundsRequest) {
const url = `/v1/vault/accounts/${vaultAccountId}/${asset}/release_allocation`;
return await this.apiClient.issuePostRequest(url, args);
}

/**
* Get the public key information for a vault account
* @param args
Expand Down
21 changes: 20 additions & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,16 @@ export interface EstimatedTransactionFee {
export interface TransferPeerPath {
type?: PeerType;
id?: string;
virtualId?: string;
virtualType?: VirtualType;
address?: string;
}

interface DestinationTransferPeerPath {
type: PeerType;
id: string;
virtualId?: string;
virtualType?: VirtualType;
oneTimeAddress?: IOneTimeAddress;
}

Expand Down Expand Up @@ -324,14 +328,29 @@ export enum PeerType {
ONE_TIME_ADDRESS = "ONE_TIME_ADDRESS"
}

export enum VirtualType {
OFF_EXCHANGE = "OFF_EXCHANGE",
DEFAULT = "DEFAULT"
}

export enum TransactionOperation {
TRANSFER = "TRANSFER",
MINT = "MINT",
BURN = "BURN",
SUPPLY_TO_COMPOUND = "SUPPLY_TO_COMPOUND",
REDEEM_FROM_COMPOUND = "REDEEM_FROM_COMPOUND",
RAW = "RAW",
CONTRACT_CALL = "CONTRACT_CALL"
CONTRACT_CALL = "CONTRACT_CALL",
}

export interface AllocateFundsRequest {
allocationId: string;
amount: string;
}

export interface DeallocateFundsRequest {
allocationId: string;
amount: string;
}

export interface CreateTransferTicketArgs {
Expand Down

0 comments on commit c3b9965

Please sign in to comment.