Skip to content

Commit

Permalink
Merge pull request #99 from fireblocks/PIK-7082-update-collateral-ope…
Browse files Browse the repository at this point in the history
…nApi-structure-v2

PIK-7082 updated deposit and settlement openApi
  • Loading branch information
OzBalasFB authored Dec 24, 2024
2 parents c6738c8 + d5bd499 commit f2f5ec4
Show file tree
Hide file tree
Showing 10 changed files with 37 additions and 33 deletions.
2 changes: 1 addition & 1 deletion v2/api-validator/src/client/generated/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ export type { CollateralAccountLink } from './models/CollateralAccountLink';
export type { CollateralAddress } from './models/CollateralAddress';
export type { CollateralAssetAddress } from './models/CollateralAssetAddress';
export type { CollateralDepositAddresses } from './models/CollateralDepositAddresses';
export type { CollateralDepositTransaction } from './models/CollateralDepositTransaction';
export type { CollateralDepositTransactionRequest } from './models/CollateralDepositTransactionRequest';
export type { CollateralDepositTransactionResponse } from './models/CollateralDepositTransactionResponse';
export type { CollateralDepositTransactionsResponse } from './models/CollateralDepositTransactionsResponse';
export { CollateralDepositTransactionStatus } from './models/CollateralDepositTransactionStatus';
export type { CollateralId } from './models/CollateralId';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
/* tslint:disable */
/* eslint-disable */

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

export type CollateralDepositTransactionRequest = {
Expand All @@ -13,6 +12,5 @@ export type CollateralDepositTransactionRequest = {
*/
collateralTxId: string;
amount?: PositiveAmount;
status?: CollateralDepositTransactionStatus;
};

Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
/* eslint-disable */

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

export type CollateralDepositTransaction = ({
export type CollateralDepositTransactionResponse = ({
id: string;
status: CollateralDepositTransactionStatus;
} & CollateralDepositTransactionRequest);

Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
/* tslint:disable */
/* eslint-disable */

import type { CollateralDepositTransaction } from './CollateralDepositTransaction';
import type { CollateralDepositTransactionResponse } from './CollateralDepositTransactionResponse';

export type CollateralDepositTransactionsResponse = {
transactions: Array<CollateralDepositTransaction>;
transactions: Array<CollateralDepositTransactionResponse>;
};

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type { SettlementDepositInstruction } from './SettlementDepositInstructio
import type { SettlementWithdrawInstruction } from './SettlementWithdrawInstruction';

export type SettlementInstructions = {
settlementVersion?: string;
settlementVersion: string;
withdrawInstructions: Array<SettlementWithdrawInstruction>;
depositInstructions: Array<SettlementDepositInstruction>;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ export type SettlementRequest = {
* A unique identifier of the settlement state version. This field is optional and can be used to indicate the version of the settlement state the client is referring to.
*
*/
settlementVersion?: string;
settlementVersion: string;
};

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type { SettlementDepositTransaction } from './SettlementDepositTransactio
import type { SettlementWithdrawTransaction } from './SettlementWithdrawTransaction';

export type SettlementState = {
settlementVersion?: string;
settlementVersion: string;
withdrawTransactions?: Array<SettlementWithdrawTransaction>;
depositTransactions?: Array<SettlementDepositTransaction>;
/**
Expand All @@ -18,7 +18,7 @@ export type SettlementState = {
* - **Failed** - The settlement has failed
*
*/
status?: SettlementState.status;
status: SettlementState.status;
};

export namespace SettlementState {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import type { CollateralAccountLink } from '../models/CollateralAccountLink';
import type { CollateralAddress } from '../models/CollateralAddress';
import type { CollateralAssetAddress } from '../models/CollateralAssetAddress';
import type { CollateralDepositAddresses } from '../models/CollateralDepositAddresses';
import type { CollateralDepositTransaction } from '../models/CollateralDepositTransaction';
import type { CollateralDepositTransactionRequest } from '../models/CollateralDepositTransactionRequest';
import type { CollateralDepositTransactionResponse } from '../models/CollateralDepositTransactionResponse';
import type { CollateralDepositTransactionsResponse } from '../models/CollateralDepositTransactionsResponse';
import type { CollateralWithdrawalTransaction } from '../models/CollateralWithdrawalTransaction';
import type { CollateralWithdrawalTransactionRequest } from '../models/CollateralWithdrawalTransactionRequest';
Expand Down Expand Up @@ -423,7 +423,7 @@ export class CollateralService {
* Register a collateral deposit transaction
* Notifies the provider to have start listening to a new collateral deposit transaction. The provider is expected to listen to this address and credit the account accordingly
*
* @returns CollateralDepositTransaction Successful Operation
* @returns CollateralDepositTransactionResponse Successful Operation
* @throws ApiError
*/
public registerCollateralDepositTransaction({
Expand Down Expand Up @@ -469,7 +469,7 @@ export class CollateralService {
* Collateral deposit transaction details
*/
requestBody: CollateralDepositTransactionRequest,
}): CancelablePromise<CollateralDepositTransaction> {
}): CancelablePromise<CollateralDepositTransactionResponse> {
return this.httpRequest.request({
method: 'POST',
url: '/accounts/{accountId}/collateral/{collateralId}/deposits',
Expand Down Expand Up @@ -583,7 +583,7 @@ export class CollateralService {

/**
* Get a collateral account deposit transaction details
* @returns CollateralDepositTransaction A collateral deposit transaction details
* @returns CollateralDepositTransactionResponse A collateral deposit transaction details
* @throws ApiError
*/
public getCollateralDepositTransactionDetails({
Expand Down Expand Up @@ -629,7 +629,7 @@ export class CollateralService {
* A Fireblocks' ID of a collateral transaction
*/
collateralTxId: string,
}): CancelablePromise<CollateralDepositTransaction> {
}): CancelablePromise<CollateralDepositTransactionResponse> {
return this.httpRequest.request({
method: 'GET',
url: '/accounts/{accountId}/collateral/{collateralId}/deposits/{collateralTxId}',
Expand Down
22 changes: 10 additions & 12 deletions v2/openapi/fb-provider-collateral-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/CollateralDepositTransaction'
$ref: '#/components/schemas/CollateralDepositTransactionResponse'
'400':
description: Return Bad Request.
'401':
Expand Down Expand Up @@ -357,7 +357,7 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/CollateralDepositTransaction'
$ref: '#/components/schemas/CollateralDepositTransactionResponse'
'400':
$ref: '#/x-responses/BadRequestResponse'
'401':
Expand Down Expand Up @@ -732,17 +732,15 @@ components:
example: "0.8e4cfce8-0182-4c6d-b9dd-a291c105e1d2.0.5a814998-ec0f-4f1c-92bf-fb5f7dc09ea2"
amount:
$ref: '#/x-schemas/PositiveAmount'
status:
$ref: '#/components/schemas/CollateralDepositTransactionStatus'

CollateralDepositTransaction:
CollateralDepositTransactionResponse:
allOf:
- type: object
required:
- id
required: [id, status]
properties:
id:
type: string
status:
$ref: '#/components/schemas/CollateralDepositTransactionStatus'
- $ref: '#/components/schemas/CollateralDepositTransactionRequest'
CollateralDepositTransactionsResponse:
type: object
Expand All @@ -752,7 +750,7 @@ components:
transactions:
type: array
items:
$ref: '#/components/schemas/CollateralDepositTransaction'
$ref: '#/components/schemas/CollateralDepositTransactionResponse'
CollateralWithdrawalTransactionStatus:
type: string
enum:
Expand Down Expand Up @@ -872,7 +870,7 @@ components:
nullable: true
SettlementInstructions:
type: object
required: [ withdrawInstructions, depositInstructions ]
required: [ settlementVersion, withdrawInstructions, depositInstructions ]
properties:
settlementVersion:
type: string
Expand All @@ -886,6 +884,7 @@ components:
$ref: '#/components/schemas/SettlementDepositInstruction'
SettlementState:
type: object
required: [ settlementVersion, status ]
properties:
settlementVersion:
type: string
Expand Down Expand Up @@ -919,8 +918,7 @@ components:
SettlementRequest:
type: object
description: Settlement to be created
required:
- settlementId
required: [ settlementId, settlementVersion ]
properties:
settlementId:
type: string
Expand Down
18 changes: 12 additions & 6 deletions v2/openapi/fb-unified-openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1934,7 +1934,7 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/CollateralDepositTransaction'
$ref: '#/components/schemas/CollateralDepositTransactionResponse'
'400':
description: Return Bad Request.
'401':
Expand Down Expand Up @@ -2003,7 +2003,7 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/CollateralDepositTransaction'
$ref: '#/components/schemas/CollateralDepositTransactionResponse'
'400':
$ref: '#/components/responses/BadRequestResponse'
'401':
Expand Down Expand Up @@ -4050,16 +4050,17 @@ components:
example: 0.8e4cfce8-0182-4c6d-b9dd-a291c105e1d2.0.5a814998-ec0f-4f1c-92bf-fb5f7dc09ea2
amount:
$ref: '#/components/schemas/PositiveAmount'
status:
$ref: '#/components/schemas/CollateralDepositTransactionStatus'
CollateralDepositTransaction:
CollateralDepositTransactionResponse:
allOf:
- type: object
required:
- id
- status
properties:
id:
type: string
status:
$ref: '#/components/schemas/CollateralDepositTransactionStatus'
- $ref: '#/components/schemas/CollateralDepositTransactionRequest'
CollateralDepositTransactionsResponse:
type: object
Expand All @@ -4069,7 +4070,7 @@ components:
transactions:
type: array
items:
$ref: '#/components/schemas/CollateralDepositTransaction'
$ref: '#/components/schemas/CollateralDepositTransactionResponse'
CollateralWithdrawalTransactionStatus:
type: string
enum:
Expand Down Expand Up @@ -4189,6 +4190,7 @@ components:
SettlementInstructions:
type: object
required:
- settlementVersion
- withdrawInstructions
- depositInstructions
properties:
Expand All @@ -4204,6 +4206,9 @@ components:
$ref: '#/components/schemas/SettlementDepositInstruction'
SettlementState:
type: object
required:
- settlementVersion
- status
properties:
settlementVersion:
type: string
Expand Down Expand Up @@ -4234,6 +4239,7 @@ components:
description: Settlement to be created
required:
- settlementId
- settlementVersion
properties:
settlementId:
type: string
Expand Down

0 comments on commit f2f5ec4

Please sign in to comment.