Skip to content

Commit

Permalink
Merge pull request #96 from fireblocks/collateral-api-add-generated
Browse files Browse the repository at this point in the history
Regenerate client and models to include collateral API
  • Loading branch information
yanivmo authored Nov 21, 2024
2 parents 15a2763 + 2d3cd23 commit 9d0aa72
Show file tree
Hide file tree
Showing 36 changed files with 1,601 additions and 2 deletions.
2 changes: 1 addition & 1 deletion v2/api-validator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"server": "NODE_ENV=development ts-node src/server/server.ts | pino-pretty; [ \"${PIPESTATUS[0]}\" -ne 0 ] && (echo \"\\nServer execution failed. There should be an error log above ^\"; exit 1)",
"lint": "eslint src tests",
"lint:fix": "eslint src tests --fix",
"test": "NODE_ENV=test jest --verbose --json --outputFile=test-results.json",
"test": "NODE_ENV=test jest --testTimeout=30000 --verbose --json --outputFile=test-results.json",
"test:watch": "npm run test -- --watch",
"test:sanity": "npm run test -- --config=jest.sanity.config.ts tests/sanity-tests",
"test:sanity:watch": "npm run test:sanity -- --watch",
Expand Down
3 changes: 3 additions & 0 deletions v2/api-validator/src/client/generated/ApiClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { AxiosHttpRequest } from './core/AxiosHttpRequest';
import { AccountsService } from './services/AccountsService';
import { BalancesService } from './services/BalancesService';
import { CapabilitiesService } from './services/CapabilitiesService';
import { CollateralService } from './services/CollateralService';
import { HistoricBalancesService } from './services/HistoricBalancesService';
import { LiquidityService } from './services/LiquidityService';
import { TradingService } from './services/TradingService';
Expand All @@ -25,6 +26,7 @@ export class ApiClient {
public readonly accounts: AccountsService;
public readonly balances: BalancesService;
public readonly capabilities: CapabilitiesService;
public readonly collateral: CollateralService;
public readonly historicBalances: HistoricBalancesService;
public readonly liquidity: LiquidityService;
public readonly trading: TradingService;
Expand Down Expand Up @@ -52,6 +54,7 @@ export class ApiClient {
this.accounts = new AccountsService(this.request);
this.balances = new BalancesService(this.request);
this.capabilities = new CapabilitiesService(this.request);
this.collateral = new CollateralService(this.request);
this.historicBalances = new HistoricBalancesService(this.request);
this.liquidity = new LiquidityService(this.request);
this.trading = new TradingService(this.request);
Expand Down
31 changes: 31 additions & 0 deletions v2/api-validator/src/client/generated/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export { AccountStatus } from './models/AccountStatus';
export type { ApiComponents } from './models/ApiComponents';
export type { AssetBalance } from './models/AssetBalance';
export type { AssetCommonProperties } from './models/AssetCommonProperties';
export type { AssetCreditBalance } from './models/AssetCreditBalance';
export type { AssetDefinition } from './models/AssetDefinition';
export type { AssetIdQueryParam } from './models/AssetIdQueryParam';
export type { AssetReference } from './models/AssetReference';
Expand All @@ -31,6 +32,23 @@ export type { BlockchainWithdrawal } from './models/BlockchainWithdrawal';
export type { BlockchainWithdrawalRequest } from './models/BlockchainWithdrawalRequest';
export { BucketAsset } from './models/BucketAsset';
export type { Capabilities } from './models/Capabilities';
export type { CollateralAccount } from './models/CollateralAccount';
export type { CollateralAccountLink } from './models/CollateralAccountLink';
export type { CollateralAddress } from './models/CollateralAddress';
export type { CollateralAsset } from './models/CollateralAsset';
export type { CollateralAssetAddress } from './models/CollateralAssetAddress';
export type { CollateralAssetMapping } from './models/CollateralAssetMapping';
export type { CollateralDepositAddresses } from './models/CollateralDepositAddresses';
export type { CollateralDepositTransaction } from './models/CollateralDepositTransaction';
export { CollateralDepositTransactionStatus } from './models/CollateralDepositTransactionStatus';
export type { CollateralId } from './models/CollateralId';
export type { CollateralIdPathParam } from './models/CollateralIdPathParam';
export { CollateralLinkStatus } from './models/CollateralLinkStatus';
export type { CollateralSignerId } from './models/CollateralSignerId';
export type { CollateralTxIdPathParam } from './models/CollateralTxIdPathParam';
export type { CollateralWithdrawalTransaction } from './models/CollateralWithdrawalTransaction';
export type { CollateralWithdrawalTransactionRequest } from './models/CollateralWithdrawalTransactionRequest';
export { CollateralWithdrawalTransactionStatus } from './models/CollateralWithdrawalTransactionStatus';
export type { CryptocurrencyReference } from './models/CryptocurrencyReference';
export { CryptocurrencySymbol } from './models/CryptocurrencySymbol';
export type { CryptocurrencySymbolQueryParam } from './models/CryptocurrencySymbolQueryParam';
Expand All @@ -43,11 +61,13 @@ export type { DepositCapability } from './models/DepositCapability';
export type { DepositDestination } from './models/DepositDestination';
export { DepositStatus } from './models/DepositStatus';
export type { EntityIdPathParam } from './models/EntityIdPathParam';
export { Environment } from './models/Environment';
export { Erc20Token } from './models/Erc20Token';
export type { FiatTransfer } from './models/FiatTransfer';
export type { FiatTransferDestination } from './models/FiatTransferDestination';
export type { FiatWithdrawal } from './models/FiatWithdrawal';
export type { FiatWithdrawalRequest } from './models/FiatWithdrawalRequest';
export type { FireblocksAssetIdPathParam } from './models/FireblocksAssetIdPathParam';
export { GeneralError } from './models/GeneralError';
export type { Iban } from './models/Iban';
export type { IbanAddress } from './models/IbanAddress';
Expand Down Expand Up @@ -102,6 +122,15 @@ export type { QuoteCapability } from './models/QuoteCapability';
export type { QuoteRequest } from './models/QuoteRequest';
export { QuoteStatus } from './models/QuoteStatus';
export { RequestPart } from './models/RequestPart';
export type { SettlementDepositInstruction } from './models/SettlementDepositInstruction';
export type { SettlementDepositTransaction } from './models/SettlementDepositTransaction';
export type { SettlementInstructions } from './models/SettlementInstructions';
export type { SettlementRequest } from './models/SettlementRequest';
export { SettlementState } from './models/SettlementState';
export { SettlementTransactionStatus } from './models/SettlementTransactionStatus';
export type { SettlementVersionPathParam } from './models/SettlementVersionPathParam';
export type { SettlementWithdrawInstruction } from './models/SettlementWithdrawInstruction';
export type { SettlementWithdrawTransaction } from './models/SettlementWithdrawTransaction';
export { StellarToken } from './models/StellarToken';
export type { SubAccountIdPathParam } from './models/SubAccountIdPathParam';
export type { SwiftAddress } from './models/SwiftAddress';
Expand All @@ -118,6 +147,7 @@ export type { WithdrawalCommonProperties } from './models/WithdrawalCommonProper
export type { WithdrawalEvent } from './models/WithdrawalEvent';
export type { WithdrawalRequestCommonProperties } from './models/WithdrawalRequestCommonProperties';
export { WithdrawalStatus } from './models/WithdrawalStatus';
export type { X_FB_PLATFORM_SIGNATURE } from './models/X_FB_PLATFORM_SIGNATURE';
export type { X_FBAPI_KEY } from './models/X_FBAPI_KEY';
export type { X_FBAPI_NONCE } from './models/X_FBAPI_NONCE';
export type { X_FBAPI_SIGNATURE } from './models/X_FBAPI_SIGNATURE';
Expand All @@ -126,6 +156,7 @@ export type { X_FBAPI_TIMESTAMP } from './models/X_FBAPI_TIMESTAMP';
export { AccountsService } from './services/AccountsService';
export { BalancesService } from './services/BalancesService';
export { CapabilitiesService } from './services/CapabilitiesService';
export { CollateralService } from './services/CollateralService';
export { HistoricBalancesService } from './services/HistoricBalancesService';
export { LiquidityService } from './services/LiquidityService';
export { TradingService } from './services/TradingService';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@ export type ApiComponents = {
transfersInternal?: AccountsSet;
trading?: AccountsSet;
liquidity?: AccountsSet;
collateral?: AccountsSet;
};

12 changes: 12 additions & 0 deletions v2/api-validator/src/client/generated/models/AssetCreditBalance.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/* generated using openapi-typescript-codegen -- do no edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */

import type { AssetBalance } from './AssetBalance';
import type { PositiveAmount } from './PositiveAmount';

export type AssetCreditBalance = (AssetBalance & {
creditAmount: PositiveAmount;
});

3 changes: 2 additions & 1 deletion v2/api-validator/src/client/generated/models/Balances.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
/* eslint-disable */

import type { AssetBalance } from './AssetBalance';
import type { AssetCreditBalance } from './AssetCreditBalance';

/**
* Maps balance assets to their balances.
*/
export type Balances = Array<AssetBalance>;
export type Balances = Array<(AssetBalance | AssetCreditBalance)>;
15 changes: 15 additions & 0 deletions v2/api-validator/src/client/generated/models/CollateralAccount.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/* generated using openapi-typescript-codegen -- do no edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */

import type { CollateralId } from './CollateralId';
import type { CollateralSignerId } from './CollateralSignerId';
import type { Environment } from './Environment';

export type CollateralAccount = {
collateralId: CollateralId;
collateralSigners: Array<CollateralSignerId>;
env: Environment;
};

Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/* generated using openapi-typescript-codegen -- do no edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */

import type { CollateralAccount } from './CollateralAccount';
import type { CollateralAsset } from './CollateralAsset';
import type { CollateralLinkStatus } from './CollateralLinkStatus';

export type CollateralAccountLink = (CollateralAccount & {
status: CollateralLinkStatus;
eligibleCollateralAssets: Array<CollateralAsset>;
rejectionReason?: string;
});

15 changes: 15 additions & 0 deletions v2/api-validator/src/client/generated/models/CollateralAddress.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/* generated using openapi-typescript-codegen -- do no edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */

import type { PublicBlockchainAddress } from './PublicBlockchainAddress';

export type CollateralAddress = {
address: PublicBlockchainAddress;
/**
* An account ID used when recovering the assets of an off-exchange client
*/
recoveryAccountId: string;
};

10 changes: 10 additions & 0 deletions v2/api-validator/src/client/generated/models/CollateralAsset.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/* generated using openapi-typescript-codegen -- do no edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */

import type { NativeCryptocurrency } from './NativeCryptocurrency';
import type { OtherAssetReference } from './OtherAssetReference';

export type CollateralAsset = (NativeCryptocurrency | OtherAssetReference);

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/* generated using openapi-typescript-codegen -- do no edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */

import type { CollateralAddress } from './CollateralAddress';
import type { CollateralAssetMapping } from './CollateralAssetMapping';

export type CollateralAssetAddress = (CollateralAddress & CollateralAssetMapping);

Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/* generated using openapi-typescript-codegen -- do no edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */

import type { CollateralAsset } from './CollateralAsset';

export type CollateralAssetMapping = {
asset: CollateralAsset;
fireblocksAssetId: string;
};

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/* generated using openapi-typescript-codegen -- do no edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */

import type { CollateralAssetAddress } from './CollateralAssetAddress';

export type CollateralDepositAddresses = {
addresses: Array<CollateralAssetAddress>;
};

Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/* generated using openapi-typescript-codegen -- do no edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */

import type { CollateralDepositTransactionStatus } from './CollateralDepositTransactionStatus';
import type { PositiveAmount } from './PositiveAmount';

export type CollateralDepositTransaction = {
/**
* A unique identifier of the transaction to track. This field will contain information to help the provider poll the status of the transaction from Fireblocks.
*
*/
collateralTxId: string;
/**
* ID of the Fireblocks asset
*/
fireblocksAssetId: string;
amount?: PositiveAmount;
status?: CollateralDepositTransactionStatus;
};

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/* generated using openapi-typescript-codegen -- do no edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */

/**
* - **Pending** - The transaction is pending and has not been credited to the provider's account yet
* - **Credited** - The transaction has been completed successfully and the account has been credited
* - **Rejected** - The transaction has been rejected and the account has not been credited
*
*/
export enum CollateralDepositTransactionStatus {
PENDING = 'Pending',
CREDITED = 'Credited',
REJECTED = 'Rejected',
}
9 changes: 9 additions & 0 deletions v2/api-validator/src/client/generated/models/CollateralId.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/* generated using openapi-typescript-codegen -- do no edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */

/**
* Unique string representing the collateral account Id (<cvaTenantId>.<accountId>.<tenantId>)
*/
export type CollateralId = string;
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/* generated using openapi-typescript-codegen -- do no edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */

/**
* ID of a collateral account
*/
export type CollateralIdPathParam = string;
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/* generated using openapi-typescript-codegen -- do no edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */

/**
* - **Eligible** - The provider account is eligible for linking to a collateral account
* - **Linked** - The provider account is linked to a collateral account
* - **Disabled** - The link is disabled at the moment, but can be re-enabled
* - **Failed** - The link creation failed
*
*/
export enum CollateralLinkStatus {
ELIGIBLE = 'Eligible',
LINKED = 'Linked',
DISABLED = 'Disabled',
FAILED = 'Failed',
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/* generated using openapi-typescript-codegen -- do no edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */

/**
* Unique Id of the collateral signer
*/
export type CollateralSignerId = string;
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/* generated using openapi-typescript-codegen -- do no edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */

/**
* A Fireblocks' ID of a collateral transaction
*/
export type CollateralTxIdPathParam = string;
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/* generated using openapi-typescript-codegen -- do no edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */

import type { CollateralWithdrawalTransactionStatus } from './CollateralWithdrawalTransactionStatus';

export type CollateralWithdrawalTransaction = {
/**
* A unique identifier of the transaction to track. This field will contain information to help Fireblocks poll the status of the transaction from the provider.
*
*/
collateralTxId: string;
status: CollateralWithdrawalTransactionStatus;
withdrawalTxBlockchainId?: string;
rejectionReason?: string | null;
};

Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/* generated using openapi-typescript-codegen -- do no edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */

import type { PositiveAmount } from './PositiveAmount';
import type { PublicBlockchainAddress } from './PublicBlockchainAddress';

export type CollateralWithdrawalTransactionRequest = {
/**
* ID of the Fireblocks asset
*/
fireblocksAssetId: string;
amount: PositiveAmount;
destinationAddress: PublicBlockchainAddress;
};

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/* generated using openapi-typescript-codegen -- do no edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */

/**
* - **Pending** - The withdrawal transaction is pending the provider's approval
* - **Approved** - The withdrawal transaction has been approved and it is in progress
* - **Rejected** - The withdrawal transaction has been rejected
*
*/
export enum CollateralWithdrawalTransactionStatus {
PENDING = 'Pending',
APPROVED = 'Approved',
REJECTED = 'Rejected',
}
Loading

0 comments on commit 9d0aa72

Please sign in to comment.