Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
tdroxler committed Dec 18, 2023
1 parent d44a6f2 commit dcc5c0c
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/web3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"author": "Alephium dev <dev@alephium.org>",
"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",
Expand Down
85 changes: 85 additions & 0 deletions packages/web3/src/api/api-explorer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -1635,6 +1658,68 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
...params
}).then(convertHttpResponse)
}
market = {
/**
* No description
*
* @tags Market
* @name GetMarketPrices
* @request GET:/market/prices
*/
getMarketPrices: (
query: {
ids?: string[]
currency: string
},
params: RequestParams = {}
) =>
this.request<Price[], BadRequest | Unauthorized | NotFound | InternalServerError | ServiceUnavailable>({
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<Tuple2LongDouble[], BadRequest | Unauthorized | NotFound | InternalServerError | ServiceUnavailable>(
{
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<ExchangeRate[], BadRequest | Unauthorized | NotFound | InternalServerError | ServiceUnavailable>({
path: `/market/exchange-rates`,
method: 'GET',
format: 'json',
...params
}).then(convertHttpResponse)
}
utils = {
/**
* @description Perform a sanity check
Expand Down

0 comments on commit dcc5c0c

Please sign in to comment.