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

Upgrade to latest Midgard@2.11.0 #2467

Merged
merged 2 commits into from
Nov 29, 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
5 changes: 4 additions & 1 deletion src/renderer/components/pool/PoolDetails.helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,10 @@ export const getEmptyPoolDetail = (): PoolDetail => ({
liquidityUnits: '0',
synthUnits: '0',
synthSupply: '0',
annualPercentageRate: '0'
annualPercentageRate: '0',
nativeDecimal: '0',
saversDepth: '0',
saversUnits: '0'
})

export const getEmptyPoolStatsDetail = (): PoolStatsDetail => ({
Expand Down
5 changes: 4 additions & 1 deletion src/renderer/helpers/poolHelper.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ describe('helpers/poolHelper/', () => {
liquidityUnits: '0',
synthUnits: '0',
synthSupply: '0',
annualPercentageRate: '0'
annualPercentageRate: '0',
nativeDecimal: '0',
saversDepth: '0',
saversUnits: '0'
}
const pool1: PoolDetail = { ...mockPoolDetail, status: GetPoolsStatusEnum.Staged, runeDepth: '1000' }
const pool2: PoolDetail = { ...mockPoolDetail, status: GetPoolsStatusEnum.Available, runeDepth: '2000' }
Expand Down
5 changes: 3 additions & 2 deletions src/renderer/services/thorchain/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { assetIO } from '../../../shared/api/io'
import { HDMode, WalletType } from '../../../shared/wallet/types'
import { LiveData } from '../../helpers/rx/liveData'
import { AssetsWithAmount1e8, AssetWithAmount1e8 } from '../../types/asgardex'
import * as TN from '../../types/generated/thornode'
import type * as TN from '../../types/generated/thornode'
import { ConstantsResponse } from '../../types/generated/thornode'
import * as C from '../clients'
import { TxHashLD, TxHashRD } from '../wallet/types'
Expand All @@ -33,7 +33,8 @@ export type InboundAddressesLD = LiveData<Error, InboundAddresses>
export type ThorchainConstantsRD = RD.RemoteData<Error, ConstantsResponse>
export type ThorchainConstantsLD = LiveData<Error, ConstantsResponse>

export type LastblockItems = TN.LastBlock[]
export type LastblockItem = TN.LastBlock
export type LastblockItems = LastblockItem[]
export type ThorchainLastblockRD = RD.RemoteData<Error, LastblockItems>
export type ThorchainLastblockLD = LiveData<Error, LastblockItems>

Expand Down
96 changes: 41 additions & 55 deletions src/renderer/types/generated/midgard/apis/DefaultApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Midgard Public API
* The Midgard Public API queries THORChain and any chains linked via the Bifröst and prepares information about the network to be readily available for public users. The API parses transaction event data from THORChain and stores them in a time-series database to make time-dependent queries easy. Midgard does not hold critical information. To interact with BEPSwap and Asgardex, users should query THORChain directly.
*
* The version of the OpenAPI document: 2.9.4
* The version of the OpenAPI document: 2.11.0
* Contact: devs@thorchain.org
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand All @@ -16,21 +16,17 @@ import { BaseAPI, HttpQuery, throwIfNullOrUndefined, encodeURI } from '../runtim
import {
Balance,
ChurnItem,
Constants,
DepthHistory,
EarningsHistory,
Health,
InboundAddressesItem,
InlineResponse200,
LastblockItem,
LiquidityHistory,
MemberDetails,
Network,
Node,
PoolDetail,
PoolStatsDetail,
ProxiedNode,
Queue,
SaverDetails,
StatsData,
SwapHistory,
THORNameDetails,
Expand Down Expand Up @@ -78,6 +74,7 @@ export interface GetLiquidityHistoryRequest {

export interface GetMemberDetailRequest {
address: string;
showSavers?: boolean;
}

export interface GetMembersAdressesRequest {
Expand All @@ -99,6 +96,10 @@ export interface GetPoolsRequest {
period?: GetPoolsPeriodEnum;
}

export interface GetSaverDetailRequest {
address: string;
}

export interface GetSwapHistoryRequest {
pool?: string;
interval?: GetSwapHistoryIntervalEnum;
Expand Down Expand Up @@ -236,6 +237,17 @@ export class DefaultApi extends BaseAPI {
});
};

/**
* Returns an object with known pools and their statuses
* Known Pools List
*/
getKnownPools = (): Observable<{ [key: string]: string; }> => {
return this.request<{ [key: string]: string; }>({
path: '/v2/knownpools',
method: 'GET',
});
};

/**
* Returns withdrawals and deposits for given time interval. If pool is not specified returns for all pools History endpoint has two modes: * With Interval parameter it returns a series of time buckets. From and To dates will be rounded to the Interval boundaries. * Without Interval parameter a single From..To search is performed with exact timestamps. * Interval: possible values: 5min, hour, day, week, month, quarter, year. * count: [1..400]. Defines number of intervals. Don\'t provide if Interval is missing. * from/to: optional int, unix second. Possible usages with interval. * last 10 days: `?interval=day&count=10` * last 10 days before to: `?interval=day&count=10&to=1608825600` * next 10 days after from: `?interval=day&count=10&from=1606780800` * Days between from and to. From defaults to start of chain, to defaults to now. Only the first 400 intervals are returned: `interval=day&from=1606780800&to=1608825600` Pagination is possible with from&count and then using the returned meta.endTime as the From parameter of the next query. Possible configurations without interval: * exact search for one time frame: `?from=1606780899&to=1608825600` * one time frame until now: `?from=1606780899` * from chain start until now: no query parameters
* Liquidity Changes History
Expand All @@ -261,12 +273,17 @@ export class DefaultApi extends BaseAPI {
* Returns an array of statistics for all the liquidity providers associated with a given member address.
* Member Details
*/
getMemberDetail = ({ address }: GetMemberDetailRequest): Observable<MemberDetails> => {
getMemberDetail = ({ address, showSavers }: GetMemberDetailRequest): Observable<MemberDetails> => {
throwIfNullOrUndefined(address, 'getMemberDetail');

const query: HttpQuery = {};

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

return this.request<MemberDetails>({
path: '/v2/member/{address}'.replace('{address}', encodeURI(address)),
method: 'GET',
query,
});
};

Expand Down Expand Up @@ -364,56 +381,14 @@ export class DefaultApi extends BaseAPI {
};

/**
* Constant values used by THORChain , some of the values can be overrided by mimir
* Proxied THORChain Constants
*/
getProxiedConstants = (): Observable<Constants> => {
return this.request<Constants>({
path: '/v2/thorchain/constants',
method: 'GET',
});
};

/**
* Inbound addresses will return a list of address , one per chain. The address might change frequently if THORChain has multiple asgards.
* Proxied THORChain Inbound Addresses
*/
getProxiedInboundAddresses = (): Observable<Array<InboundAddressesItem>> => {
return this.request<Array<InboundAddressesItem>>({
path: '/v2/thorchain/inbound_addresses',
method: 'GET',
});
};

/**
* Retrieve lastest block infomation across all chains.
* Proxied THORChain Lastblock
* Returns an array of statistics for all the savers associated with a given member address. Query can also be multiple addresses should be seperated by comma (\',\')
* Saver Details
*/
getProxiedLastblock = (): Observable<Array<LastblockItem>> => {
return this.request<Array<LastblockItem>>({
path: '/v2/thorchain/lastblock',
method: 'GET',
});
};
getSaverDetail = ({ address }: GetSaverDetailRequest): Observable<SaverDetails> => {
throwIfNullOrUndefined(address, 'getSaverDetail');

/**
* Returns the proxied nodes endpoint from thornode
* Proxied THORChain Nodes
*/
getProxiedNodes = (): Observable<Array<ProxiedNode>> => {
return this.request<Array<ProxiedNode>>({
path: '/v2/thorchain/nodes',
method: 'GET',
});
};

/**
* Returns the proxied queue endpoint from thornode
* Proxied THORChain Queue
*/
getProxiedQueue = (): Observable<Queue> => {
return this.request<Queue>({
path: '/v2/thorchain/queue',
return this.request<SaverDetails>({
path: '/v2/saver/{address}'.replace('{address}', encodeURI(address)),
method: 'GET',
});
};
Expand Down Expand Up @@ -509,6 +484,17 @@ export class DefaultApi extends BaseAPI {
});
};

/**
* Historically Midgard acted as a caching proxy for a subset of the Thornode API endpoints. This functionality has been deprecated since the default configuration for fullnodes has been extended to support caching on these endpoints at the gateway NGINX directly. These endpoints will remain available in Midgard for the time being to facilitate a smooth transition for clients, but please take steps to migrate any client code to reference these directly from the Thornode API https://thornode.ninerealms.com/thorchain/doc/#/.
* [Deprecated] Thornode Proxied Endpoints
*/
getThornodeProxiedEndpoints = (): Observable<void> => {
return this.request<void>({
path: '/v2/thorchain',
method: 'GET',
});
};

}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Midgard Public API
* The Midgard Public API queries THORChain and any chains linked via the Bifröst and prepares information about the network to be readily available for public users. The API parses transaction event data from THORChain and stores them in a time-series database to make time-dependent queries easy. Midgard does not hold critical information. To interact with BEPSwap and Asgardex, users should query THORChain directly.
*
* The version of the OpenAPI document: 2.9.4
* The version of the OpenAPI document: 2.11.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/midgard/models/Action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Midgard Public API
* The Midgard Public API queries THORChain and any chains linked via the Bifröst and prepares information about the network to be readily available for public users. The API parses transaction event data from THORChain and stores them in a time-series database to make time-dependent queries easy. Midgard does not hold critical information. To interact with BEPSwap and Asgardex, users should query THORChain directly.
*
* The version of the OpenAPI document: 2.9.4
* The version of the OpenAPI document: 2.11.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 @@
* Midgard Public API
* The Midgard Public API queries THORChain and any chains linked via the Bifröst and prepares information about the network to be readily available for public users. The API parses transaction event data from THORChain and stores them in a time-series database to make time-dependent queries easy. Midgard does not hold critical information. To interact with BEPSwap and Asgardex, users should query THORChain directly.
*
* The version of the OpenAPI document: 2.9.4
* The version of the OpenAPI document: 2.11.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/midgard/models/Balance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Midgard Public API
* The Midgard Public API queries THORChain and any chains linked via the Bifröst and prepares information about the network to be readily available for public users. The API parses transaction event data from THORChain and stores them in a time-series database to make time-dependent queries easy. Midgard does not hold critical information. To interact with BEPSwap and Asgardex, users should query THORChain directly.
*
* The version of the OpenAPI document: 2.9.4
* The version of the OpenAPI document: 2.11.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 @@
* Midgard Public API
* The Midgard Public API queries THORChain and any chains linked via the Bifröst and prepares information about the network to be readily available for public users. The API parses transaction event data from THORChain and stores them in a time-series database to make time-dependent queries easy. Midgard does not hold critical information. To interact with BEPSwap and Asgardex, users should query THORChain directly.
*
* The version of the OpenAPI document: 2.9.4
* The version of the OpenAPI document: 2.11.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/midgard/models/BondMetrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Midgard Public API
* The Midgard Public API queries THORChain and any chains linked via the Bifröst and prepares information about the network to be readily available for public users. The API parses transaction event data from THORChain and stores them in a time-series database to make time-dependent queries easy. Midgard does not hold critical information. To interact with BEPSwap and Asgardex, users should query THORChain directly.
*
* The version of the OpenAPI document: 2.9.4
* The version of the OpenAPI document: 2.11.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/midgard/models/ChurnItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Midgard Public API
* The Midgard Public API queries THORChain and any chains linked via the Bifröst and prepares information about the network to be readily available for public users. The API parses transaction event data from THORChain and stores them in a time-series database to make time-dependent queries easy. Midgard does not hold critical information. To interact with BEPSwap and Asgardex, users should query THORChain directly.
*
* The version of the OpenAPI document: 2.9.4
* The version of the OpenAPI document: 2.11.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/midgard/models/Coin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Midgard Public API
* The Midgard Public API queries THORChain and any chains linked via the Bifröst and prepares information about the network to be readily available for public users. The API parses transaction event data from THORChain and stores them in a time-series database to make time-dependent queries easy. Midgard does not hold critical information. To interact with BEPSwap and Asgardex, users should query THORChain directly.
*
* The version of the OpenAPI document: 2.9.4
* The version of the OpenAPI document: 2.11.0
* Contact: devs@thorchain.org
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down
40 changes: 0 additions & 40 deletions src/renderer/types/generated/midgard/models/Constants.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Midgard Public API
* The Midgard Public API queries THORChain and any chains linked via the Bifröst and prepares information about the network to be readily available for public users. The API parses transaction event data from THORChain and stores them in a time-series database to make time-dependent queries easy. Midgard does not hold critical information. To interact with BEPSwap and Asgardex, users should query THORChain directly.
*
* The version of the OpenAPI document: 2.9.4
* The version of the OpenAPI document: 2.11.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 @@
* Midgard Public API
* The Midgard Public API queries THORChain and any chains linked via the Bifröst and prepares information about the network to be readily available for public users. The API parses transaction event data from THORChain and stores them in a time-series database to make time-dependent queries easy. Midgard does not hold critical information. To interact with BEPSwap and Asgardex, users should query THORChain directly.
*
* The version of the OpenAPI document: 2.9.4
* The version of the OpenAPI document: 2.11.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 @@
* Midgard Public API
* The Midgard Public API queries THORChain and any chains linked via the Bifröst and prepares information about the network to be readily available for public users. The API parses transaction event data from THORChain and stores them in a time-series database to make time-dependent queries easy. Midgard does not hold critical information. To interact with BEPSwap and Asgardex, users should query THORChain directly.
*
* The version of the OpenAPI document: 2.9.4
* The version of the OpenAPI document: 2.11.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 @@
* Midgard Public API
* The Midgard Public API queries THORChain and any chains linked via the Bifröst and prepares information about the network to be readily available for public users. The API parses transaction event data from THORChain and stores them in a time-series database to make time-dependent queries easy. Midgard does not hold critical information. To interact with BEPSwap and Asgardex, users should query THORChain directly.
*
* The version of the OpenAPI document: 2.9.4
* The version of the OpenAPI document: 2.11.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 @@
* Midgard Public API
* The Midgard Public API queries THORChain and any chains linked via the Bifröst and prepares information about the network to be readily available for public users. The API parses transaction event data from THORChain and stores them in a time-series database to make time-dependent queries easy. Midgard does not hold critical information. To interact with BEPSwap and Asgardex, users should query THORChain directly.
*
* The version of the OpenAPI document: 2.9.4
* The version of the OpenAPI document: 2.11.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 @@
* Midgard Public API
* The Midgard Public API queries THORChain and any chains linked via the Bifröst and prepares information about the network to be readily available for public users. The API parses transaction event data from THORChain and stores them in a time-series database to make time-dependent queries easy. Midgard does not hold critical information. To interact with BEPSwap and Asgardex, users should query THORChain directly.
*
* The version of the OpenAPI document: 2.9.4
* The version of the OpenAPI document: 2.11.0
* Contact: devs@thorchain.org
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down
Loading