Skip to content
This repository has been archived by the owner on Oct 10, 2023. It is now read-only.

Upgrade types / endpoints to latest THORNode@1.100.0 #2468

Merged
merged 3 commits into from
Dec 1, 2022
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"generate:types": "yarn generate:types:midgard && yarn generate:types:thornode",
"generate:types:midgard": "yarn clean:types:midgard && TS_POST_PROCESS_FILE=./node_modules/.bin/prettier openapi-generator-cli generate -i https://midgard.ninerealms.com/v2/swagger.json -g typescript-rxjs -o ./src/renderer/types/generated/midgard --reserved-words-mappings in=in --enable-post-process-file",
"clean:types:midgard": "rimraf ./src/renderer/types/generated/midgard",
"generate:types:thornode": "yarn clean:types:thornode && TS_POST_PROCESS_FILE=./node_modules/.bin/prettier openapi-generator-cli generate -i https://gitlab.com/thorchain/thornode/-/raw/release-1.97.2/openapi/openapi.yaml -g typescript-rxjs -o ./src/renderer/types/generated/thornode --enable-post-process-file --skip-validate-spec",
"generate:types:thornode": "yarn clean:types:thornode && TS_POST_PROCESS_FILE=./node_modules/.bin/prettier openapi-generator-cli generate -i https://gitlab.com/thorchain/thornode/-/raw/6e10252deb6d65775c484b9fe8c5814195be44be/openapi/openapi.yaml -g typescript-rxjs -o ./src/renderer/types/generated/thornode --enable-post-process-file --skip-validate-spec",
"clean:types:thornode": "rimraf ./src/renderer/types/generated/thornode",
"storybook": "sb dev -p 9009 --no-manager-cache",
"build-storybook": "sb build",
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/services/thorchain/thornode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,8 @@ export const createThornodeService$ = (network$: Network$, clientUrl$: ClientUrl
liveData.map<Node[], NodeInfos>((nodes) =>
FP.pipe(
nodes,
A.map(({ bond, current_award, status, node_address }) => ({
bond: baseAmount(bond, THORCHAIN_DECIMAL),
A.map(({ total_bond, current_award, status, node_address }) => ({
bond: baseAmount(total_bond, THORCHAIN_DECIMAL),
award: baseAmount(current_award, THORCHAIN_DECIMAL),
status,
address: node_address
Expand Down
67 changes: 0 additions & 67 deletions src/renderer/types/generated/thornode/apis/BucketsApi.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/renderer/types/generated/thornode/apis/HealthApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Thornode API
* Thornode REST API.
*
* The version of the OpenAPI document: 1.97.2
* The version of the OpenAPI document: 1.100.0
* Contact: devs@thorchain.org
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Thornode API
* Thornode REST API.
*
* The version of the OpenAPI document: 1.97.2
* The version of the OpenAPI document: 1.100.0
* Contact: devs@thorchain.org
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/types/generated/thornode/apis/MimirApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Thornode API
* Thornode REST API.
*
* The version of the OpenAPI document: 1.97.2
* The version of the OpenAPI document: 1.100.0
* Contact: devs@thorchain.org
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/types/generated/thornode/apis/NetworkApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Thornode API
* Thornode REST API.
*
* The version of the OpenAPI document: 1.97.2
* The version of the OpenAPI document: 1.100.0
* Contact: devs@thorchain.org
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/types/generated/thornode/apis/NodesApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Thornode API
* Thornode REST API.
*
* The version of the OpenAPI document: 1.97.2
* The version of the OpenAPI document: 1.100.0
* Contact: devs@thorchain.org
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/types/generated/thornode/apis/POLApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Thornode API
* Thornode REST API.
*
* The version of the OpenAPI document: 1.97.2
* The version of the OpenAPI document: 1.100.0
* Contact: devs@thorchain.org
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/types/generated/thornode/apis/PoolsApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Thornode API
* Thornode REST API.
*
* The version of the OpenAPI document: 1.97.2
* The version of the OpenAPI document: 1.100.0
* Contact: devs@thorchain.org
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/types/generated/thornode/apis/QueueApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Thornode API
* Thornode REST API.
*
* The version of the OpenAPI document: 1.97.2
* The version of the OpenAPI document: 1.100.0
* Contact: devs@thorchain.org
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down
111 changes: 111 additions & 0 deletions src/renderer/types/generated/thornode/apis/QuoteApi.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
// tslint:disable
/**
* Thornode API
* Thornode REST API.
*
* The version of the OpenAPI document: 1.100.0
* Contact: devs@thorchain.org
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/

import { Observable } from 'rxjs';
import { BaseAPI, HttpQuery } from '../runtime';
import {
QuoteSaverDepositResponse,
QuoteSaverWithdrawResponse,
QuoteSwapResponse,
} from '../models';

export interface QuotesaverdepositRequest {
height?: number;
asset?: string;
amount?: number;
}

export interface QuotesaverwithdrawRequest {
height?: number;
asset?: string;
address?: string;
withdrawBps?: number;
}

export interface QuoteswapRequest {
height?: number;
fromAsset?: string;
toAsset?: string;
amount?: number;
destination?: string;
toleranceBps?: number;
affiliateBps?: number;
affiliate?: string;
}

/**
* no description
*/
export class QuoteApi extends BaseAPI {

/**
* Provide a quote estimate for the provided saver deposit.
*/
quotesaverdeposit = ({ height, asset, amount }: QuotesaverdepositRequest): Observable<QuoteSaverDepositResponse> => {

const query: HttpQuery = {};

if (height != null) { query['height'] = height; }
if (asset != null) { query['asset'] = asset; }
if (amount != null) { query['amount'] = amount; }

return this.request<QuoteSaverDepositResponse>({
path: '/thorchain/quote/saver/deposit',
method: 'GET',
query,
});
};

/**
* Provide a quote estimate for the provided saver withdraw.
*/
quotesaverwithdraw = ({ height, asset, address, withdrawBps }: QuotesaverwithdrawRequest): Observable<QuoteSaverWithdrawResponse> => {

const query: HttpQuery = {};

if (height != null) { query['height'] = height; }
if (asset != null) { query['asset'] = asset; }
if (address != null) { query['address'] = address; }
if (withdrawBps != null) { query['withdraw_bps'] = withdrawBps; }

return this.request<QuoteSaverWithdrawResponse>({
path: '/thorchain/quote/saver/withdraw',
method: 'GET',
query,
});
};

/**
* Provide a quote estimate for the provided swap.
*/
quoteswap = ({ height, fromAsset, toAsset, amount, destination, toleranceBps, affiliateBps, affiliate }: QuoteswapRequest): Observable<QuoteSwapResponse> => {

const query: HttpQuery = {};

if (height != null) { query['height'] = height; }
if (fromAsset != null) { query['from_asset'] = fromAsset; }
if (toAsset != null) { query['to_asset'] = toAsset; }
if (amount != null) { query['amount'] = amount; }
if (destination != null) { query['destination'] = destination; }
if (toleranceBps != null) { query['tolerance_bps'] = toleranceBps; }
if (affiliateBps != null) { query['affiliate_bps'] = affiliateBps; }
if (affiliate != null) { query['affiliate'] = affiliate; }

return this.request<QuoteSwapResponse>({
path: '/thorchain/quote/swap',
method: 'GET',
query,
});
};

}
71 changes: 71 additions & 0 deletions src/renderer/types/generated/thornode/apis/SaversApi.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
// tslint:disable
/**
* Thornode API
* Thornode REST API.
*
* The version of the OpenAPI document: 1.100.0
* Contact: devs@thorchain.org
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/

import { Observable } from 'rxjs';
import { BaseAPI, HttpQuery, throwIfNullOrUndefined, encodeURI } from '../runtime';
import {
LiquidityProvider,
} from '../models';

export interface SaverRequest {
asset: string;
address: string;
height?: number;
}

export interface SaversRequest {
asset: string;
height?: number;
}

/**
* no description
*/
export class SaversApi extends BaseAPI {

/**
* Returns the saver position given then savers pool and address.
*/
saver = ({ asset, address, height }: SaverRequest): Observable<Array<LiquidityProvider>> => {
throwIfNullOrUndefined(asset, 'saver');
throwIfNullOrUndefined(address, 'saver');

const query: HttpQuery = {};

if (height != null) { query['height'] = height; }

return this.request<Array<LiquidityProvider>>({
path: '/thorchain/pool/{asset}/saver/{address}'.replace('{asset}', encodeURI(asset)).replace('{address}', encodeURI(address)),
method: 'GET',
query,
});
};

/**
* Returns all savers for the savers pool.
*/
savers = ({ asset, height }: SaversRequest): Observable<Array<LiquidityProvider>> => {
throwIfNullOrUndefined(asset, 'savers');

const query: HttpQuery = {};

if (height != null) { query['height'] = height; }

return this.request<Array<LiquidityProvider>>({
path: '/thorchain/pool/{asset}/savers'.replace('{asset}', encodeURI(asset)),
method: 'GET',
query,
});
};

}
2 changes: 1 addition & 1 deletion src/renderer/types/generated/thornode/apis/TSSApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Thornode API
* Thornode REST API.
*
* The version of the OpenAPI document: 1.97.2
* The version of the OpenAPI document: 1.100.0
* Contact: devs@thorchain.org
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/types/generated/thornode/apis/ThornamesApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Thornode API
* Thornode REST API.
*
* The version of the OpenAPI document: 1.97.2
* The version of the OpenAPI document: 1.100.0
* Contact: devs@thorchain.org
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Thornode API
* Thornode REST API.
*
* The version of the OpenAPI document: 1.97.2
* The version of the OpenAPI document: 1.100.0
* Contact: devs@thorchain.org
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/types/generated/thornode/apis/VaultsApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Thornode API
* Thornode REST API.
*
* The version of the OpenAPI document: 1.97.2
* The version of the OpenAPI document: 1.100.0
* Contact: devs@thorchain.org
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down
3 changes: 2 additions & 1 deletion src/renderer/types/generated/thornode/apis/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export * from './BucketsApi';
export * from './HealthApi';
export * from './LiquidityProvidersApi';
export * from './MimirApi';
Expand All @@ -7,6 +6,8 @@ export * from './NodesApi';
export * from './POLApi';
export * from './PoolsApi';
export * from './QueueApi';
export * from './QuoteApi';
export * from './SaversApi';
export * from './TSSApi';
export * from './ThornamesApi';
export * from './TransactionsApi';
Expand Down
Loading