From dcc5c0cb89dd5120acf1c9920c4a8ebdf7567e8a Mon Sep 17 00:00:00 2001 From: Thomas Droxler Date: Mon, 18 Dec 2023 11:08:53 +0100 Subject: [PATCH] WIP --- packages/web3/package.json | 2 +- packages/web3/src/api/api-explorer.ts | 85 +++++++++++++++++++++++++++ 2 files changed, 86 insertions(+), 1 deletion(-) diff --git a/packages/web3/package.json b/packages/web3/package.json index dc4355b3d..c854f535c 100644 --- a/packages/web3/package.json +++ b/packages/web3/package.json @@ -28,7 +28,7 @@ "author": "Alephium dev ", "config": { "alephium_version": "2.5.5", - "explorer_backend_version": "1.16.0" + "explorer_backend_version": "1.16.1-rc0" }, "scripts": { "build": "rm -rf dist/* && npx tsc --build . && webpack", diff --git a/packages/web3/src/api/api-explorer.ts b/packages/web3/src/api/api-explorer.ts index f3dc10d40..0a7a39cd8 100644 --- a/packages/web3/src/api/api-explorer.ts +++ b/packages/web3/src/api/api-explorer.ts @@ -127,6 +127,14 @@ export interface Event { fields?: Val[] } +export interface ExchangeRate { + currency: string + name: string + unit: string + /** @format double */ + value: number +} + export interface ExplorerInfo { releaseVersion: string commit: string @@ -287,6 +295,14 @@ export interface PerChainTimedCount { totalCountPerChain?: PerChainCount[] } +export interface Price { + id: string + name: string + /** @format double */ + price: number + currency: string +} + export interface ServiceUnavailable { detail: string } @@ -356,6 +372,13 @@ export interface Transaction { export type TransactionLike = AcceptedTransaction | PendingTransaction +export interface Tuple2LongDouble { + /** @format int64 */ + _1: number + /** @format double */ + _2: number +} + export interface Unauthorized { detail: string } @@ -1635,6 +1658,68 @@ export class Api extends HttpClient + this.request({ + path: `/market/prices`, + method: 'GET', + query: query, + format: 'json', + ...params + }).then(convertHttpResponse), + + /** + * No description + * + * @tags Market + * @name GetMarketPricesIdCharts + * @request GET:/market/prices/{id}/charts + */ + getMarketPricesIdCharts: ( + id: string, + query: { + currency: string + }, + params: RequestParams = {} + ) => + this.request( + { + path: `/market/prices/${id}/charts`, + method: 'GET', + query: query, + format: 'json', + ...params + } + ).then(convertHttpResponse), + + /** + * No description + * + * @tags Market + * @name GetMarketExchangeRates + * @request GET:/market/exchange-rates + */ + getMarketExchangeRates: (params: RequestParams = {}) => + this.request({ + path: `/market/exchange-rates`, + method: 'GET', + format: 'json', + ...params + }).then(convertHttpResponse) + } utils = { /** * @description Perform a sanity check