From d46eb3379438cabbe55d62862ae49086b03c7bfc Mon Sep 17 00:00:00 2001 From: Michal Zielenkiewicz Date: Wed, 23 Oct 2024 11:44:29 +0200 Subject: [PATCH 01/14] Setup Oasis Scan API v2 --- .../oasisscan-v2/.openapi-generator-ignore | 23 + .../oasisscan-v2/.openapi-generator/FILES | 101 + .../oasisscan-v2/.openapi-generator/VERSION | 1 + src/vendors/oasisscan-v2/README.md | 38 + src/vendors/oasisscan-v2/apis/AccountApi.ts | 411 ++ src/vendors/oasisscan-v2/apis/ChainApi.ts | 334 ++ src/vendors/oasisscan-v2/apis/CommonApi.ts | 103 + .../oasisscan-v2/apis/GovernanceApi.ts | 149 + src/vendors/oasisscan-v2/apis/MarketApi.ts | 79 + src/vendors/oasisscan-v2/apis/RuntimeApi.ts | 316 ++ src/vendors/oasisscan-v2/apis/ValidatorApi.ts | 343 ++ src/vendors/oasisscan-v2/apis/index.ts | 7 + src/vendors/oasisscan-v2/index.ts | 3 + .../oasisscan-v2/models/AccountAllowance.ts | 65 + .../models/AccountDebondingInfo.ts | 97 + .../models/AccountDebondingRequest.ts | 73 + .../models/AccountDebondingResponse.ts | 96 + .../models/AccountDelegationsInfo.ts | 105 + .../models/AccountDelegationsRequest.ts | 81 + .../models/AccountDelegationsResponse.ts | 96 + .../models/AccountInfoResponse.ts | 112 + .../models/AccountRewardExportRequest.ts | 57 + .../oasisscan-v2/models/AccountRewardInfo.ts | 97 + .../models/AccountRewardRequest.ts | 73 + .../models/AccountRewardResponse.ts | 96 + .../models/AccountRewardStatsInfo.ts | 80 + .../models/AccountRewardStatsItem.ts | 65 + .../models/AccountRewardStatsRequest.ts | 57 + .../models/AccountRewardStatsResponse.ts | 72 + .../models/AccountStakingEventsInfo.ts | 81 + .../models/AccountStakingEventsInfoRequest.ts | 57 + .../AccountStakingEventsInfoResponse.ts | 113 + .../models/AccountStakingEventsRequest.ts | 73 + .../models/AccountStakingEventsResponse.ts | 96 + src/vendors/oasisscan-v2/models/Bound.ts | 73 + .../oasisscan-v2/models/ChainBlockInfo.ts | 113 + .../models/ChainBlockInfoResponse.ts | 113 + .../oasisscan-v2/models/ChainBlocksRequest.ts | 65 + .../models/ChainBlocksResponse.ts | 96 + .../models/ChainMethodsResponse.ts | 57 + .../models/ChainProposedBlocksRequest.ts | 73 + .../models/ChainProposedBlocksResponse.ts | 96 + .../oasisscan-v2/models/ChainSearchRequest.ts | 57 + .../models/ChainSearchResponse.ts | 73 + .../models/ChainTransactionInfoResponse.ts | 153 + .../models/ChainTransactionListInfo.ts | 193 + .../models/ChainTransactionsRequest.ts | 97 + .../models/ChainTransactionsResponse.ts | 96 + src/vendors/oasisscan-v2/models/Chart.ts | 65 + .../oasisscan-v2/models/DelegatorsInfo.ts | 89 + .../oasisscan-v2/models/DelegatorsRequest.ts | 73 + .../oasisscan-v2/models/DelegatorsResponse.ts | 96 + .../oasisscan-v2/models/EscrowStatus.ts | 73 + .../models/GovernanceProposalInfo.ts | 129 + .../models/GovernanceProposalListResponse.ts | 64 + .../GovernanceProposalWithVotesRequest.ts | 57 + .../GovernanceProposalWithVotesResponse.ts | 76 + .../models/GovernanceVotesRequest.ts | 81 + .../models/GovernanceVotesResponse.ts | 96 + .../models/MarketChartResponse.ts | 80 + .../oasisscan-v2/models/MarketInfoResponse.ts | 105 + .../models/NetworkStatusResponse.ts | 97 + .../models/NetworkTrendResponse.ts | 72 + src/vendors/oasisscan-v2/models/Page.ts | 81 + .../oasisscan-v2/models/ProposalOption.ts | 73 + .../oasisscan-v2/models/ProposalVote.ts | 113 + src/vendors/oasisscan-v2/models/Rate.ts | 65 + .../oasisscan-v2/models/RuntimeListInfo.ts | 65 + .../models/RuntimeListResponse.ts | 64 + .../oasisscan-v2/models/RuntimeRoundInfo.ts | 137 + .../models/RuntimeRoundInfoRequest.ts | 65 + .../models/RuntimeRoundInfoResponse.ts | 137 + .../models/RuntimeRoundListRequest.ts | 73 + .../models/RuntimeRoundListResponse.ts | 96 + .../oasisscan-v2/models/RuntimeStatsInfo.ts | 112 + .../oasisscan-v2/models/RuntimeStatsItem.ts | 81 + .../models/RuntimeStatsRequest.ts | 57 + .../models/RuntimeStatsResponse.ts | 80 + .../models/RuntimeTransactionConsensusTx.ts | 89 + .../models/RuntimeTransactionEventError.ts | 65 + .../models/RuntimeTransactionEvmTx.ts | 113 + .../models/RuntimeTransactionInfoRequest.ts | 73 + .../models/RuntimeTransactionInfoResponse.ts | 148 + .../models/RuntimeTransactionListInfo.ts | 97 + .../models/RuntimeTransactionListRequest.ts | 89 + .../models/RuntimeTransactionListResponse.ts | 96 + .../models/ValidatorBlocksStatsInfo.ts | 65 + .../models/ValidatorBlocksStatsRequest.ts | 57 + .../models/ValidatorBlocksStatsResponse.ts | 72 + .../models/ValidatorEscrowEventRequest.ts | 73 + .../models/ValidatorEscrowEventResponse.ts | 96 + .../models/ValidatorEscrowStatsInfo.ts | 65 + .../models/ValidatorEscrowStatsRequest.ts | 57 + .../models/ValidatorEscrowStatsResponse.ts | 64 + .../oasisscan-v2/models/ValidatorInfo.ts | 332 ++ .../models/ValidatorInfoRequest.ts | 57 + .../models/ValidatorInfoResponse.ts | 332 ++ .../models/ValidatorListRequest.ts | 65 + .../models/ValidatorListResponse.ts | 88 + .../oasisscan-v2/models/ValidatorRuntime.ts | 73 + .../models/ValidatorSignStatsInfo.ts | 73 + .../models/ValidatorSignStatsRequest.ts | 57 + .../models/ValidatorSignStatsResponse.ts | 72 + src/vendors/oasisscan-v2/models/index.ts | 90 + src/vendors/oasisscan-v2/openapitools.json | 7 + src/vendors/oasisscan-v2/runtime.ts | 319 ++ src/vendors/oasisscan-v2/swagger.json | 3463 +++++++++++++++++ 107 files changed, 13904 insertions(+) create mode 100644 src/vendors/oasisscan-v2/.openapi-generator-ignore create mode 100644 src/vendors/oasisscan-v2/.openapi-generator/FILES create mode 100644 src/vendors/oasisscan-v2/.openapi-generator/VERSION create mode 100644 src/vendors/oasisscan-v2/README.md create mode 100644 src/vendors/oasisscan-v2/apis/AccountApi.ts create mode 100644 src/vendors/oasisscan-v2/apis/ChainApi.ts create mode 100644 src/vendors/oasisscan-v2/apis/CommonApi.ts create mode 100644 src/vendors/oasisscan-v2/apis/GovernanceApi.ts create mode 100644 src/vendors/oasisscan-v2/apis/MarketApi.ts create mode 100644 src/vendors/oasisscan-v2/apis/RuntimeApi.ts create mode 100644 src/vendors/oasisscan-v2/apis/ValidatorApi.ts create mode 100644 src/vendors/oasisscan-v2/apis/index.ts create mode 100644 src/vendors/oasisscan-v2/index.ts create mode 100644 src/vendors/oasisscan-v2/models/AccountAllowance.ts create mode 100644 src/vendors/oasisscan-v2/models/AccountDebondingInfo.ts create mode 100644 src/vendors/oasisscan-v2/models/AccountDebondingRequest.ts create mode 100644 src/vendors/oasisscan-v2/models/AccountDebondingResponse.ts create mode 100644 src/vendors/oasisscan-v2/models/AccountDelegationsInfo.ts create mode 100644 src/vendors/oasisscan-v2/models/AccountDelegationsRequest.ts create mode 100644 src/vendors/oasisscan-v2/models/AccountDelegationsResponse.ts create mode 100644 src/vendors/oasisscan-v2/models/AccountInfoResponse.ts create mode 100644 src/vendors/oasisscan-v2/models/AccountRewardExportRequest.ts create mode 100644 src/vendors/oasisscan-v2/models/AccountRewardInfo.ts create mode 100644 src/vendors/oasisscan-v2/models/AccountRewardRequest.ts create mode 100644 src/vendors/oasisscan-v2/models/AccountRewardResponse.ts create mode 100644 src/vendors/oasisscan-v2/models/AccountRewardStatsInfo.ts create mode 100644 src/vendors/oasisscan-v2/models/AccountRewardStatsItem.ts create mode 100644 src/vendors/oasisscan-v2/models/AccountRewardStatsRequest.ts create mode 100644 src/vendors/oasisscan-v2/models/AccountRewardStatsResponse.ts create mode 100644 src/vendors/oasisscan-v2/models/AccountStakingEventsInfo.ts create mode 100644 src/vendors/oasisscan-v2/models/AccountStakingEventsInfoRequest.ts create mode 100644 src/vendors/oasisscan-v2/models/AccountStakingEventsInfoResponse.ts create mode 100644 src/vendors/oasisscan-v2/models/AccountStakingEventsRequest.ts create mode 100644 src/vendors/oasisscan-v2/models/AccountStakingEventsResponse.ts create mode 100644 src/vendors/oasisscan-v2/models/Bound.ts create mode 100644 src/vendors/oasisscan-v2/models/ChainBlockInfo.ts create mode 100644 src/vendors/oasisscan-v2/models/ChainBlockInfoResponse.ts create mode 100644 src/vendors/oasisscan-v2/models/ChainBlocksRequest.ts create mode 100644 src/vendors/oasisscan-v2/models/ChainBlocksResponse.ts create mode 100644 src/vendors/oasisscan-v2/models/ChainMethodsResponse.ts create mode 100644 src/vendors/oasisscan-v2/models/ChainProposedBlocksRequest.ts create mode 100644 src/vendors/oasisscan-v2/models/ChainProposedBlocksResponse.ts create mode 100644 src/vendors/oasisscan-v2/models/ChainSearchRequest.ts create mode 100644 src/vendors/oasisscan-v2/models/ChainSearchResponse.ts create mode 100644 src/vendors/oasisscan-v2/models/ChainTransactionInfoResponse.ts create mode 100644 src/vendors/oasisscan-v2/models/ChainTransactionListInfo.ts create mode 100644 src/vendors/oasisscan-v2/models/ChainTransactionsRequest.ts create mode 100644 src/vendors/oasisscan-v2/models/ChainTransactionsResponse.ts create mode 100644 src/vendors/oasisscan-v2/models/Chart.ts create mode 100644 src/vendors/oasisscan-v2/models/DelegatorsInfo.ts create mode 100644 src/vendors/oasisscan-v2/models/DelegatorsRequest.ts create mode 100644 src/vendors/oasisscan-v2/models/DelegatorsResponse.ts create mode 100644 src/vendors/oasisscan-v2/models/EscrowStatus.ts create mode 100644 src/vendors/oasisscan-v2/models/GovernanceProposalInfo.ts create mode 100644 src/vendors/oasisscan-v2/models/GovernanceProposalListResponse.ts create mode 100644 src/vendors/oasisscan-v2/models/GovernanceProposalWithVotesRequest.ts create mode 100644 src/vendors/oasisscan-v2/models/GovernanceProposalWithVotesResponse.ts create mode 100644 src/vendors/oasisscan-v2/models/GovernanceVotesRequest.ts create mode 100644 src/vendors/oasisscan-v2/models/GovernanceVotesResponse.ts create mode 100644 src/vendors/oasisscan-v2/models/MarketChartResponse.ts create mode 100644 src/vendors/oasisscan-v2/models/MarketInfoResponse.ts create mode 100644 src/vendors/oasisscan-v2/models/NetworkStatusResponse.ts create mode 100644 src/vendors/oasisscan-v2/models/NetworkTrendResponse.ts create mode 100644 src/vendors/oasisscan-v2/models/Page.ts create mode 100644 src/vendors/oasisscan-v2/models/ProposalOption.ts create mode 100644 src/vendors/oasisscan-v2/models/ProposalVote.ts create mode 100644 src/vendors/oasisscan-v2/models/Rate.ts create mode 100644 src/vendors/oasisscan-v2/models/RuntimeListInfo.ts create mode 100644 src/vendors/oasisscan-v2/models/RuntimeListResponse.ts create mode 100644 src/vendors/oasisscan-v2/models/RuntimeRoundInfo.ts create mode 100644 src/vendors/oasisscan-v2/models/RuntimeRoundInfoRequest.ts create mode 100644 src/vendors/oasisscan-v2/models/RuntimeRoundInfoResponse.ts create mode 100644 src/vendors/oasisscan-v2/models/RuntimeRoundListRequest.ts create mode 100644 src/vendors/oasisscan-v2/models/RuntimeRoundListResponse.ts create mode 100644 src/vendors/oasisscan-v2/models/RuntimeStatsInfo.ts create mode 100644 src/vendors/oasisscan-v2/models/RuntimeStatsItem.ts create mode 100644 src/vendors/oasisscan-v2/models/RuntimeStatsRequest.ts create mode 100644 src/vendors/oasisscan-v2/models/RuntimeStatsResponse.ts create mode 100644 src/vendors/oasisscan-v2/models/RuntimeTransactionConsensusTx.ts create mode 100644 src/vendors/oasisscan-v2/models/RuntimeTransactionEventError.ts create mode 100644 src/vendors/oasisscan-v2/models/RuntimeTransactionEvmTx.ts create mode 100644 src/vendors/oasisscan-v2/models/RuntimeTransactionInfoRequest.ts create mode 100644 src/vendors/oasisscan-v2/models/RuntimeTransactionInfoResponse.ts create mode 100644 src/vendors/oasisscan-v2/models/RuntimeTransactionListInfo.ts create mode 100644 src/vendors/oasisscan-v2/models/RuntimeTransactionListRequest.ts create mode 100644 src/vendors/oasisscan-v2/models/RuntimeTransactionListResponse.ts create mode 100644 src/vendors/oasisscan-v2/models/ValidatorBlocksStatsInfo.ts create mode 100644 src/vendors/oasisscan-v2/models/ValidatorBlocksStatsRequest.ts create mode 100644 src/vendors/oasisscan-v2/models/ValidatorBlocksStatsResponse.ts create mode 100644 src/vendors/oasisscan-v2/models/ValidatorEscrowEventRequest.ts create mode 100644 src/vendors/oasisscan-v2/models/ValidatorEscrowEventResponse.ts create mode 100644 src/vendors/oasisscan-v2/models/ValidatorEscrowStatsInfo.ts create mode 100644 src/vendors/oasisscan-v2/models/ValidatorEscrowStatsRequest.ts create mode 100644 src/vendors/oasisscan-v2/models/ValidatorEscrowStatsResponse.ts create mode 100644 src/vendors/oasisscan-v2/models/ValidatorInfo.ts create mode 100644 src/vendors/oasisscan-v2/models/ValidatorInfoRequest.ts create mode 100644 src/vendors/oasisscan-v2/models/ValidatorInfoResponse.ts create mode 100644 src/vendors/oasisscan-v2/models/ValidatorListRequest.ts create mode 100644 src/vendors/oasisscan-v2/models/ValidatorListResponse.ts create mode 100644 src/vendors/oasisscan-v2/models/ValidatorRuntime.ts create mode 100644 src/vendors/oasisscan-v2/models/ValidatorSignStatsInfo.ts create mode 100644 src/vendors/oasisscan-v2/models/ValidatorSignStatsRequest.ts create mode 100644 src/vendors/oasisscan-v2/models/ValidatorSignStatsResponse.ts create mode 100644 src/vendors/oasisscan-v2/models/index.ts create mode 100644 src/vendors/oasisscan-v2/openapitools.json create mode 100644 src/vendors/oasisscan-v2/runtime.ts create mode 100644 src/vendors/oasisscan-v2/swagger.json diff --git a/src/vendors/oasisscan-v2/.openapi-generator-ignore b/src/vendors/oasisscan-v2/.openapi-generator-ignore new file mode 100644 index 0000000000..7484ee590a --- /dev/null +++ b/src/vendors/oasisscan-v2/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/src/vendors/oasisscan-v2/.openapi-generator/FILES b/src/vendors/oasisscan-v2/.openapi-generator/FILES new file mode 100644 index 0000000000..3a0e80d7f3 --- /dev/null +++ b/src/vendors/oasisscan-v2/.openapi-generator/FILES @@ -0,0 +1,101 @@ +apis/AccountApi.ts +apis/ChainApi.ts +apis/CommonApi.ts +apis/GovernanceApi.ts +apis/MarketApi.ts +apis/RuntimeApi.ts +apis/ValidatorApi.ts +apis/index.ts +index.ts +models/AccountAllowance.ts +models/AccountDebondingInfo.ts +models/AccountDebondingRequest.ts +models/AccountDebondingResponse.ts +models/AccountDelegationsInfo.ts +models/AccountDelegationsRequest.ts +models/AccountDelegationsResponse.ts +models/AccountInfoResponse.ts +models/AccountRewardExportRequest.ts +models/AccountRewardInfo.ts +models/AccountRewardRequest.ts +models/AccountRewardResponse.ts +models/AccountRewardStatsInfo.ts +models/AccountRewardStatsItem.ts +models/AccountRewardStatsRequest.ts +models/AccountRewardStatsResponse.ts +models/AccountStakingEventsInfo.ts +models/AccountStakingEventsInfoRequest.ts +models/AccountStakingEventsInfoResponse.ts +models/AccountStakingEventsRequest.ts +models/AccountStakingEventsResponse.ts +models/Bound.ts +models/ChainBlockInfo.ts +models/ChainBlockInfoResponse.ts +models/ChainBlocksRequest.ts +models/ChainBlocksResponse.ts +models/ChainMethodsResponse.ts +models/ChainProposedBlocksRequest.ts +models/ChainProposedBlocksResponse.ts +models/ChainSearchRequest.ts +models/ChainSearchResponse.ts +models/ChainTransactionInfoResponse.ts +models/ChainTransactionListInfo.ts +models/ChainTransactionsRequest.ts +models/ChainTransactionsResponse.ts +models/Chart.ts +models/DelegatorsInfo.ts +models/DelegatorsRequest.ts +models/DelegatorsResponse.ts +models/EscrowStatus.ts +models/GovernanceProposalInfo.ts +models/GovernanceProposalListResponse.ts +models/GovernanceProposalWithVotesRequest.ts +models/GovernanceProposalWithVotesResponse.ts +models/GovernanceVotesRequest.ts +models/GovernanceVotesResponse.ts +models/MarketChartResponse.ts +models/MarketInfoResponse.ts +models/NetworkStatusResponse.ts +models/NetworkTrendResponse.ts +models/Page.ts +models/ProposalOption.ts +models/ProposalVote.ts +models/Rate.ts +models/RuntimeListInfo.ts +models/RuntimeListResponse.ts +models/RuntimeRoundInfo.ts +models/RuntimeRoundInfoRequest.ts +models/RuntimeRoundInfoResponse.ts +models/RuntimeRoundListRequest.ts +models/RuntimeRoundListResponse.ts +models/RuntimeStatsInfo.ts +models/RuntimeStatsItem.ts +models/RuntimeStatsRequest.ts +models/RuntimeStatsResponse.ts +models/RuntimeTransactionConsensusTx.ts +models/RuntimeTransactionEventError.ts +models/RuntimeTransactionEvmTx.ts +models/RuntimeTransactionInfoRequest.ts +models/RuntimeTransactionInfoResponse.ts +models/RuntimeTransactionListInfo.ts +models/RuntimeTransactionListRequest.ts +models/RuntimeTransactionListResponse.ts +models/ValidatorBlocksStatsInfo.ts +models/ValidatorBlocksStatsRequest.ts +models/ValidatorBlocksStatsResponse.ts +models/ValidatorEscrowEventRequest.ts +models/ValidatorEscrowEventResponse.ts +models/ValidatorEscrowStatsInfo.ts +models/ValidatorEscrowStatsRequest.ts +models/ValidatorEscrowStatsResponse.ts +models/ValidatorInfo.ts +models/ValidatorInfoRequest.ts +models/ValidatorInfoResponse.ts +models/ValidatorListRequest.ts +models/ValidatorListResponse.ts +models/ValidatorRuntime.ts +models/ValidatorSignStatsInfo.ts +models/ValidatorSignStatsRequest.ts +models/ValidatorSignStatsResponse.ts +models/index.ts +runtime.ts diff --git a/src/vendors/oasisscan-v2/.openapi-generator/VERSION b/src/vendors/oasisscan-v2/.openapi-generator/VERSION new file mode 100644 index 0000000000..acf69b48b8 --- /dev/null +++ b/src/vendors/oasisscan-v2/.openapi-generator/VERSION @@ -0,0 +1 @@ +5.1.0 \ No newline at end of file diff --git a/src/vendors/oasisscan-v2/README.md b/src/vendors/oasisscan-v2/README.md new file mode 100644 index 0000000000..85da59ac00 --- /dev/null +++ b/src/vendors/oasisscan-v2/README.md @@ -0,0 +1,38 @@ +# Typescript bindings for Oasis Scan v2 + +This folder contains generated typescript bindings for OasisScan v2. + +To update the bindings: + +1. Update swagger.json based on + - + - + +2. Generate the bindings: + + ```sh + npx @openapitools/openapi-generator-cli generate \ + -i swagger.json \ + -g typescript-fetch \ + -o . \ + --additional-properties=modelPropertyNaming=original,typescriptThreePlus=true + ``` + + or + + ```sh + docker run --rm --user "${UID}:${GID}" \ + -v ${PWD}:/local \ + --workdir /local \ + openapitools/openapi-generator-cli:v5.1.0 generate \ + -i swagger.json \ + -g typescript-fetch \ + -o . \ + --additional-properties=modelPropertyNaming=original,typescriptThreePlus=true + ``` + +3. Lint: + + ```sh + yarn lint:fix + ``` diff --git a/src/vendors/oasisscan-v2/apis/AccountApi.ts b/src/vendors/oasisscan-v2/apis/AccountApi.ts new file mode 100644 index 0000000000..bf7a0de4af --- /dev/null +++ b/src/vendors/oasisscan-v2/apis/AccountApi.ts @@ -0,0 +1,411 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import { + AccountDebondingResponse, + AccountDebondingResponseFromJSON, + AccountDebondingResponseToJSON, + AccountDelegationsResponse, + AccountDelegationsResponseFromJSON, + AccountDelegationsResponseToJSON, + AccountInfoResponse, + AccountInfoResponseFromJSON, + AccountInfoResponseToJSON, + AccountRewardResponse, + AccountRewardResponseFromJSON, + AccountRewardResponseToJSON, + AccountRewardStatsResponse, + AccountRewardStatsResponseFromJSON, + AccountRewardStatsResponseToJSON, + AccountStakingEventsInfoResponse, + AccountStakingEventsInfoResponseFromJSON, + AccountStakingEventsInfoResponseToJSON, + AccountStakingEventsResponse, + AccountStakingEventsResponseFromJSON, + AccountStakingEventsResponseToJSON, +} from '../models'; + +export interface AccountDebondingHandlerRequest { + address: string; + page: number; + size: number; +} + +export interface AccountDelegationsHandlerRequest { + address: string; + all: boolean; + page: number; + size: number; +} + +export interface AccountInfoHandlerRequest { + address: string; +} + +export interface AccountRewardExportHandlerRequest { + account: string; +} + +export interface AccountRewardHandlerRequest { + account: string; + page: number; + size: number; +} + +export interface AccountRewardStatsHandlerRequest { + account: string; +} + +export interface AccountStakingEventsHandlerRequest { + address: string; + page: number; + size: number; +} + +export interface AccountStakingEventsInfoHandlerRequest { + id: string; +} + +/** + * + */ +export class AccountApi extends runtime.BaseAPI { + + /** + */ + async accountDebondingHandlerRaw(requestParameters: AccountDebondingHandlerRequest): Promise> { + if (requestParameters.address === null || requestParameters.address === undefined) { + throw new runtime.RequiredError('address','Required parameter requestParameters.address was null or undefined when calling accountDebondingHandler.'); + } + + if (requestParameters.page === null || requestParameters.page === undefined) { + throw new runtime.RequiredError('page','Required parameter requestParameters.page was null or undefined when calling accountDebondingHandler.'); + } + + if (requestParameters.size === null || requestParameters.size === undefined) { + throw new runtime.RequiredError('size','Required parameter requestParameters.size was null or undefined when calling accountDebondingHandler.'); + } + + const queryParameters: any = {}; + + if (requestParameters.address !== undefined) { + queryParameters['address'] = requestParameters.address; + } + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + if (requestParameters.size !== undefined) { + queryParameters['size'] = requestParameters.size; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/account/debonding`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => AccountDebondingResponseFromJSON(jsonValue)); + } + + /** + */ + async accountDebondingHandler(requestParameters: AccountDebondingHandlerRequest): Promise { + const response = await this.accountDebondingHandlerRaw(requestParameters); + return await response.value(); + } + + /** + */ + async accountDelegationsHandlerRaw(requestParameters: AccountDelegationsHandlerRequest): Promise> { + if (requestParameters.address === null || requestParameters.address === undefined) { + throw new runtime.RequiredError('address','Required parameter requestParameters.address was null or undefined when calling accountDelegationsHandler.'); + } + + if (requestParameters.all === null || requestParameters.all === undefined) { + throw new runtime.RequiredError('all','Required parameter requestParameters.all was null or undefined when calling accountDelegationsHandler.'); + } + + if (requestParameters.page === null || requestParameters.page === undefined) { + throw new runtime.RequiredError('page','Required parameter requestParameters.page was null or undefined when calling accountDelegationsHandler.'); + } + + if (requestParameters.size === null || requestParameters.size === undefined) { + throw new runtime.RequiredError('size','Required parameter requestParameters.size was null or undefined when calling accountDelegationsHandler.'); + } + + const queryParameters: any = {}; + + if (requestParameters.address !== undefined) { + queryParameters['address'] = requestParameters.address; + } + + if (requestParameters.all !== undefined) { + queryParameters['all'] = requestParameters.all; + } + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + if (requestParameters.size !== undefined) { + queryParameters['size'] = requestParameters.size; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/account/delegations`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => AccountDelegationsResponseFromJSON(jsonValue)); + } + + /** + */ + async accountDelegationsHandler(requestParameters: AccountDelegationsHandlerRequest): Promise { + const response = await this.accountDelegationsHandlerRaw(requestParameters); + return await response.value(); + } + + /** + */ + async accountInfoHandlerRaw(requestParameters: AccountInfoHandlerRequest): Promise> { + if (requestParameters.address === null || requestParameters.address === undefined) { + throw new runtime.RequiredError('address','Required parameter requestParameters.address was null or undefined when calling accountInfoHandler.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/account/info/{address}`.replace(`{${"address"}}`, encodeURIComponent(String(requestParameters.address))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => AccountInfoResponseFromJSON(jsonValue)); + } + + /** + */ + async accountInfoHandler(requestParameters: AccountInfoHandlerRequest): Promise { + const response = await this.accountInfoHandlerRaw(requestParameters); + return await response.value(); + } + + /** + */ + async accountRewardExportHandlerRaw(requestParameters: AccountRewardExportHandlerRequest): Promise> { + if (requestParameters.account === null || requestParameters.account === undefined) { + throw new runtime.RequiredError('account','Required parameter requestParameters.account was null or undefined when calling accountRewardExportHandler.'); + } + + const queryParameters: any = {}; + + if (requestParameters.account !== undefined) { + queryParameters['account'] = requestParameters.account; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/account/reward/export`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response); + } + + /** + */ + async accountRewardExportHandler(requestParameters: AccountRewardExportHandlerRequest): Promise { + const response = await this.accountRewardExportHandlerRaw(requestParameters); + return await response.value(); + } + + /** + */ + async accountRewardHandlerRaw(requestParameters: AccountRewardHandlerRequest): Promise> { + if (requestParameters.account === null || requestParameters.account === undefined) { + throw new runtime.RequiredError('account','Required parameter requestParameters.account was null or undefined when calling accountRewardHandler.'); + } + + if (requestParameters.page === null || requestParameters.page === undefined) { + throw new runtime.RequiredError('page','Required parameter requestParameters.page was null or undefined when calling accountRewardHandler.'); + } + + if (requestParameters.size === null || requestParameters.size === undefined) { + throw new runtime.RequiredError('size','Required parameter requestParameters.size was null or undefined when calling accountRewardHandler.'); + } + + const queryParameters: any = {}; + + if (requestParameters.account !== undefined) { + queryParameters['account'] = requestParameters.account; + } + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + if (requestParameters.size !== undefined) { + queryParameters['size'] = requestParameters.size; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/account/reward/list`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => AccountRewardResponseFromJSON(jsonValue)); + } + + /** + */ + async accountRewardHandler(requestParameters: AccountRewardHandlerRequest): Promise { + const response = await this.accountRewardHandlerRaw(requestParameters); + return await response.value(); + } + + /** + */ + async accountRewardStatsHandlerRaw(requestParameters: AccountRewardStatsHandlerRequest): Promise> { + if (requestParameters.account === null || requestParameters.account === undefined) { + throw new runtime.RequiredError('account','Required parameter requestParameters.account was null or undefined when calling accountRewardStatsHandler.'); + } + + const queryParameters: any = {}; + + if (requestParameters.account !== undefined) { + queryParameters['account'] = requestParameters.account; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/account/reward/stats`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => AccountRewardStatsResponseFromJSON(jsonValue)); + } + + /** + */ + async accountRewardStatsHandler(requestParameters: AccountRewardStatsHandlerRequest): Promise { + const response = await this.accountRewardStatsHandlerRaw(requestParameters); + return await response.value(); + } + + /** + */ + async accountStakingEventsHandlerRaw(requestParameters: AccountStakingEventsHandlerRequest): Promise> { + if (requestParameters.address === null || requestParameters.address === undefined) { + throw new runtime.RequiredError('address','Required parameter requestParameters.address was null or undefined when calling accountStakingEventsHandler.'); + } + + if (requestParameters.page === null || requestParameters.page === undefined) { + throw new runtime.RequiredError('page','Required parameter requestParameters.page was null or undefined when calling accountStakingEventsHandler.'); + } + + if (requestParameters.size === null || requestParameters.size === undefined) { + throw new runtime.RequiredError('size','Required parameter requestParameters.size was null or undefined when calling accountStakingEventsHandler.'); + } + + const queryParameters: any = {}; + + if (requestParameters.address !== undefined) { + queryParameters['address'] = requestParameters.address; + } + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + if (requestParameters.size !== undefined) { + queryParameters['size'] = requestParameters.size; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/account/staking/events`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => AccountStakingEventsResponseFromJSON(jsonValue)); + } + + /** + */ + async accountStakingEventsHandler(requestParameters: AccountStakingEventsHandlerRequest): Promise { + const response = await this.accountStakingEventsHandlerRaw(requestParameters); + return await response.value(); + } + + /** + */ + async accountStakingEventsInfoHandlerRaw(requestParameters: AccountStakingEventsInfoHandlerRequest): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling accountStakingEventsInfoHandler.'); + } + + const queryParameters: any = {}; + + if (requestParameters.id !== undefined) { + queryParameters['id'] = requestParameters.id; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/account/staking/events/info`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => AccountStakingEventsInfoResponseFromJSON(jsonValue)); + } + + /** + */ + async accountStakingEventsInfoHandler(requestParameters: AccountStakingEventsInfoHandlerRequest): Promise { + const response = await this.accountStakingEventsInfoHandlerRaw(requestParameters); + return await response.value(); + } + +} diff --git a/src/vendors/oasisscan-v2/apis/ChainApi.ts b/src/vendors/oasisscan-v2/apis/ChainApi.ts new file mode 100644 index 0000000000..a948321186 --- /dev/null +++ b/src/vendors/oasisscan-v2/apis/ChainApi.ts @@ -0,0 +1,334 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import { + ChainBlockInfoResponse, + ChainBlockInfoResponseFromJSON, + ChainBlockInfoResponseToJSON, + ChainBlocksResponse, + ChainBlocksResponseFromJSON, + ChainBlocksResponseToJSON, + ChainMethodsResponse, + ChainMethodsResponseFromJSON, + ChainMethodsResponseToJSON, + ChainProposedBlocksResponse, + ChainProposedBlocksResponseFromJSON, + ChainProposedBlocksResponseToJSON, + ChainSearchResponse, + ChainSearchResponseFromJSON, + ChainSearchResponseToJSON, + ChainTransactionInfoResponse, + ChainTransactionInfoResponseFromJSON, + ChainTransactionInfoResponseToJSON, + ChainTransactionsResponse, + ChainTransactionsResponseFromJSON, + ChainTransactionsResponseToJSON, +} from '../models'; + +export interface ChainBlockInfoHandlerRequest { + height: string; +} + +export interface ChainBlocksHandlerRequest { + page: number; + size: number; +} + +export interface ChainProposedBlocksHandlerRequest { + page: number; + size: number; + address?: string; +} + +export interface ChainSearchHandlerRequest { + key: string; +} + +export interface ChainTransactionInfoHandlerRequest { + hash: string; +} + +export interface ChainTransactionsHandlerRequest { + runtime: boolean; + page: number; + size: number; + height?: number; + address?: string; + method?: string; +} + +/** + * + */ +export class ChainApi extends runtime.BaseAPI { + + /** + */ + async chainBlockInfoHandlerRaw(requestParameters: ChainBlockInfoHandlerRequest): Promise> { + if (requestParameters.height === null || requestParameters.height === undefined) { + throw new runtime.RequiredError('height','Required parameter requestParameters.height was null or undefined when calling chainBlockInfoHandler.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/chain/block/{height}`.replace(`{${"height"}}`, encodeURIComponent(String(requestParameters.height))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => ChainBlockInfoResponseFromJSON(jsonValue)); + } + + /** + */ + async chainBlockInfoHandler(requestParameters: ChainBlockInfoHandlerRequest): Promise { + const response = await this.chainBlockInfoHandlerRaw(requestParameters); + return await response.value(); + } + + /** + */ + async chainBlocksHandlerRaw(requestParameters: ChainBlocksHandlerRequest): Promise> { + if (requestParameters.page === null || requestParameters.page === undefined) { + throw new runtime.RequiredError('page','Required parameter requestParameters.page was null or undefined when calling chainBlocksHandler.'); + } + + if (requestParameters.size === null || requestParameters.size === undefined) { + throw new runtime.RequiredError('size','Required parameter requestParameters.size was null or undefined when calling chainBlocksHandler.'); + } + + const queryParameters: any = {}; + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + if (requestParameters.size !== undefined) { + queryParameters['size'] = requestParameters.size; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/chain/blocks`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => ChainBlocksResponseFromJSON(jsonValue)); + } + + /** + */ + async chainBlocksHandler(requestParameters: ChainBlocksHandlerRequest): Promise { + const response = await this.chainBlocksHandlerRaw(requestParameters); + return await response.value(); + } + + /** + */ + async chainMethodsHandlerRaw(): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/chain/methods`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => ChainMethodsResponseFromJSON(jsonValue)); + } + + /** + */ + async chainMethodsHandler(): Promise { + const response = await this.chainMethodsHandlerRaw(); + return await response.value(); + } + + /** + */ + async chainProposedBlocksHandlerRaw(requestParameters: ChainProposedBlocksHandlerRequest): Promise> { + if (requestParameters.page === null || requestParameters.page === undefined) { + throw new runtime.RequiredError('page','Required parameter requestParameters.page was null or undefined when calling chainProposedBlocksHandler.'); + } + + if (requestParameters.size === null || requestParameters.size === undefined) { + throw new runtime.RequiredError('size','Required parameter requestParameters.size was null or undefined when calling chainProposedBlocksHandler.'); + } + + const queryParameters: any = {}; + + if (requestParameters.address !== undefined) { + queryParameters['address'] = requestParameters.address; + } + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + if (requestParameters.size !== undefined) { + queryParameters['size'] = requestParameters.size; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/chain/proposedblocks`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => ChainProposedBlocksResponseFromJSON(jsonValue)); + } + + /** + */ + async chainProposedBlocksHandler(requestParameters: ChainProposedBlocksHandlerRequest): Promise { + const response = await this.chainProposedBlocksHandlerRaw(requestParameters); + return await response.value(); + } + + /** + */ + async chainSearchHandlerRaw(requestParameters: ChainSearchHandlerRequest): Promise> { + if (requestParameters.key === null || requestParameters.key === undefined) { + throw new runtime.RequiredError('key','Required parameter requestParameters.key was null or undefined when calling chainSearchHandler.'); + } + + const queryParameters: any = {}; + + if (requestParameters.key !== undefined) { + queryParameters['key'] = requestParameters.key; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/chain/search`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => ChainSearchResponseFromJSON(jsonValue)); + } + + /** + */ + async chainSearchHandler(requestParameters: ChainSearchHandlerRequest): Promise { + const response = await this.chainSearchHandlerRaw(requestParameters); + return await response.value(); + } + + /** + */ + async chainTransactionInfoHandlerRaw(requestParameters: ChainTransactionInfoHandlerRequest): Promise> { + if (requestParameters.hash === null || requestParameters.hash === undefined) { + throw new runtime.RequiredError('hash','Required parameter requestParameters.hash was null or undefined when calling chainTransactionInfoHandler.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/chain/transaction/{hash}`.replace(`{${"hash"}}`, encodeURIComponent(String(requestParameters.hash))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => ChainTransactionInfoResponseFromJSON(jsonValue)); + } + + /** + */ + async chainTransactionInfoHandler(requestParameters: ChainTransactionInfoHandlerRequest): Promise { + const response = await this.chainTransactionInfoHandlerRaw(requestParameters); + return await response.value(); + } + + /** + */ + async chainTransactionsHandlerRaw(requestParameters: ChainTransactionsHandlerRequest): Promise> { + if (requestParameters.runtime === null || requestParameters.runtime === undefined) { + throw new runtime.RequiredError('runtime','Required parameter requestParameters.runtime was null or undefined when calling chainTransactionsHandler.'); + } + + if (requestParameters.page === null || requestParameters.page === undefined) { + throw new runtime.RequiredError('page','Required parameter requestParameters.page was null or undefined when calling chainTransactionsHandler.'); + } + + if (requestParameters.size === null || requestParameters.size === undefined) { + throw new runtime.RequiredError('size','Required parameter requestParameters.size was null or undefined when calling chainTransactionsHandler.'); + } + + const queryParameters: any = {}; + + if (requestParameters.height !== undefined) { + queryParameters['height'] = requestParameters.height; + } + + if (requestParameters.address !== undefined) { + queryParameters['address'] = requestParameters.address; + } + + if (requestParameters.method !== undefined) { + queryParameters['method'] = requestParameters.method; + } + + if (requestParameters.runtime !== undefined) { + queryParameters['runtime'] = requestParameters.runtime; + } + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + if (requestParameters.size !== undefined) { + queryParameters['size'] = requestParameters.size; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/chain/transactions`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => ChainTransactionsResponseFromJSON(jsonValue)); + } + + /** + */ + async chainTransactionsHandler(requestParameters: ChainTransactionsHandlerRequest): Promise { + const response = await this.chainTransactionsHandlerRaw(requestParameters); + return await response.value(); + } + +} diff --git a/src/vendors/oasisscan-v2/apis/CommonApi.ts b/src/vendors/oasisscan-v2/apis/CommonApi.ts new file mode 100644 index 0000000000..a764467b0a --- /dev/null +++ b/src/vendors/oasisscan-v2/apis/CommonApi.ts @@ -0,0 +1,103 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import { + NetworkStatusResponse, + NetworkStatusResponseFromJSON, + NetworkStatusResponseToJSON, + NetworkTrendResponse, + NetworkTrendResponseFromJSON, + NetworkTrendResponseToJSON, +} from '../models'; + +/** + * + */ +export class CommonApi extends runtime.BaseAPI { + + /** + */ + async healthHandlerRaw(): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/health`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response); + } + + /** + */ + async healthHandler(): Promise { + const response = await this.healthHandlerRaw(); + return await response.value(); + } + + /** + */ + async networkStatusHandlerRaw(): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/network/status`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => NetworkStatusResponseFromJSON(jsonValue)); + } + + /** + */ + async networkStatusHandler(): Promise { + const response = await this.networkStatusHandlerRaw(); + return await response.value(); + } + + /** + */ + async networkTrendHandlerRaw(): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/trend`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => NetworkTrendResponseFromJSON(jsonValue)); + } + + /** + */ + async networkTrendHandler(): Promise { + const response = await this.networkTrendHandlerRaw(); + return await response.value(); + } + +} diff --git a/src/vendors/oasisscan-v2/apis/GovernanceApi.ts b/src/vendors/oasisscan-v2/apis/GovernanceApi.ts new file mode 100644 index 0000000000..db4f1cc94c --- /dev/null +++ b/src/vendors/oasisscan-v2/apis/GovernanceApi.ts @@ -0,0 +1,149 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import { + GovernanceProposalListResponse, + GovernanceProposalListResponseFromJSON, + GovernanceProposalListResponseToJSON, + GovernanceProposalWithVotesResponse, + GovernanceProposalWithVotesResponseFromJSON, + GovernanceProposalWithVotesResponseToJSON, + GovernanceVotesResponse, + GovernanceVotesResponseFromJSON, + GovernanceVotesResponseToJSON, +} from '../models'; + +export interface GovernanceProposalWithVotesHandlerRequest { + id: number; +} + +export interface GovernanceVotesHandlerRequest { + page: number; + size: number; + proposalId?: number; + validator?: string; +} + +/** + * + */ +export class GovernanceApi extends runtime.BaseAPI { + + /** + */ + async governanceProposalListHandlerRaw(): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/governance/proposallist`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => GovernanceProposalListResponseFromJSON(jsonValue)); + } + + /** + */ + async governanceProposalListHandler(): Promise { + const response = await this.governanceProposalListHandlerRaw(); + return await response.value(); + } + + /** + */ + async governanceProposalWithVotesHandlerRaw(requestParameters: GovernanceProposalWithVotesHandlerRequest): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling governanceProposalWithVotesHandler.'); + } + + const queryParameters: any = {}; + + if (requestParameters.id !== undefined) { + queryParameters['id'] = requestParameters.id; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/governance/proposalwithvotes`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => GovernanceProposalWithVotesResponseFromJSON(jsonValue)); + } + + /** + */ + async governanceProposalWithVotesHandler(requestParameters: GovernanceProposalWithVotesHandlerRequest): Promise { + const response = await this.governanceProposalWithVotesHandlerRaw(requestParameters); + return await response.value(); + } + + /** + */ + async governanceVotesHandlerRaw(requestParameters: GovernanceVotesHandlerRequest): Promise> { + if (requestParameters.page === null || requestParameters.page === undefined) { + throw new runtime.RequiredError('page','Required parameter requestParameters.page was null or undefined when calling governanceVotesHandler.'); + } + + if (requestParameters.size === null || requestParameters.size === undefined) { + throw new runtime.RequiredError('size','Required parameter requestParameters.size was null or undefined when calling governanceVotesHandler.'); + } + + const queryParameters: any = {}; + + if (requestParameters.proposalId !== undefined) { + queryParameters['proposalId'] = requestParameters.proposalId; + } + + if (requestParameters.validator !== undefined) { + queryParameters['validator'] = requestParameters.validator; + } + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + if (requestParameters.size !== undefined) { + queryParameters['size'] = requestParameters.size; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/governance/votes`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => GovernanceVotesResponseFromJSON(jsonValue)); + } + + /** + */ + async governanceVotesHandler(requestParameters: GovernanceVotesHandlerRequest): Promise { + const response = await this.governanceVotesHandlerRaw(requestParameters); + return await response.value(); + } + +} diff --git a/src/vendors/oasisscan-v2/apis/MarketApi.ts b/src/vendors/oasisscan-v2/apis/MarketApi.ts new file mode 100644 index 0000000000..7019a1fc8f --- /dev/null +++ b/src/vendors/oasisscan-v2/apis/MarketApi.ts @@ -0,0 +1,79 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import { + MarketChartResponse, + MarketChartResponseFromJSON, + MarketChartResponseToJSON, + MarketInfoResponse, + MarketInfoResponseFromJSON, + MarketInfoResponseToJSON, +} from '../models'; + +/** + * + */ +export class MarketApi extends runtime.BaseAPI { + + /** + */ + async marketChartHandlerRaw(): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/market/chart`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => MarketChartResponseFromJSON(jsonValue)); + } + + /** + */ + async marketChartHandler(): Promise { + const response = await this.marketChartHandlerRaw(); + return await response.value(); + } + + /** + */ + async marketInfoHandlerRaw(): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/market/info`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => MarketInfoResponseFromJSON(jsonValue)); + } + + /** + */ + async marketInfoHandler(): Promise { + const response = await this.marketInfoHandlerRaw(); + return await response.value(); + } + +} diff --git a/src/vendors/oasisscan-v2/apis/RuntimeApi.ts b/src/vendors/oasisscan-v2/apis/RuntimeApi.ts new file mode 100644 index 0000000000..db8319e185 --- /dev/null +++ b/src/vendors/oasisscan-v2/apis/RuntimeApi.ts @@ -0,0 +1,316 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import { + RuntimeListResponse, + RuntimeListResponseFromJSON, + RuntimeListResponseToJSON, + RuntimeRoundInfoResponse, + RuntimeRoundInfoResponseFromJSON, + RuntimeRoundInfoResponseToJSON, + RuntimeRoundListResponse, + RuntimeRoundListResponseFromJSON, + RuntimeRoundListResponseToJSON, + RuntimeStatsResponse, + RuntimeStatsResponseFromJSON, + RuntimeStatsResponseToJSON, + RuntimeTransactionInfoResponse, + RuntimeTransactionInfoResponseFromJSON, + RuntimeTransactionInfoResponseToJSON, + RuntimeTransactionListResponse, + RuntimeTransactionListResponseFromJSON, + RuntimeTransactionListResponseToJSON, +} from '../models'; + +export interface RuntimeRoundInfoHandlerRequest { + id: string; + round: number; +} + +export interface RuntimeRoundListHandlerRequest { + id: string; + page: number; + size: number; +} + +export interface RuntimeStatsHandlerRequest { + id: string; +} + +export interface RuntimeTransactionInfoHandlerRequest { + id: string; + round: number; + hash: string; +} + +export interface RuntimeTransactionListHandlerRequest { + page: number; + size: number; + id?: string; + address?: string; + round?: number; +} + +/** + * + */ +export class RuntimeApi extends runtime.BaseAPI { + + /** + */ + async runtimeListHandlerRaw(): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/runtime/list`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => RuntimeListResponseFromJSON(jsonValue)); + } + + /** + */ + async runtimeListHandler(): Promise { + const response = await this.runtimeListHandlerRaw(); + return await response.value(); + } + + /** + */ + async runtimeRoundInfoHandlerRaw(requestParameters: RuntimeRoundInfoHandlerRequest): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling runtimeRoundInfoHandler.'); + } + + if (requestParameters.round === null || requestParameters.round === undefined) { + throw new runtime.RequiredError('round','Required parameter requestParameters.round was null or undefined when calling runtimeRoundInfoHandler.'); + } + + const queryParameters: any = {}; + + if (requestParameters.id !== undefined) { + queryParameters['id'] = requestParameters.id; + } + + if (requestParameters.round !== undefined) { + queryParameters['round'] = requestParameters.round; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/runtime/round/info`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => RuntimeRoundInfoResponseFromJSON(jsonValue)); + } + + /** + */ + async runtimeRoundInfoHandler(requestParameters: RuntimeRoundInfoHandlerRequest): Promise { + const response = await this.runtimeRoundInfoHandlerRaw(requestParameters); + return await response.value(); + } + + /** + */ + async runtimeRoundListHandlerRaw(requestParameters: RuntimeRoundListHandlerRequest): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling runtimeRoundListHandler.'); + } + + if (requestParameters.page === null || requestParameters.page === undefined) { + throw new runtime.RequiredError('page','Required parameter requestParameters.page was null or undefined when calling runtimeRoundListHandler.'); + } + + if (requestParameters.size === null || requestParameters.size === undefined) { + throw new runtime.RequiredError('size','Required parameter requestParameters.size was null or undefined when calling runtimeRoundListHandler.'); + } + + const queryParameters: any = {}; + + if (requestParameters.id !== undefined) { + queryParameters['id'] = requestParameters.id; + } + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + if (requestParameters.size !== undefined) { + queryParameters['size'] = requestParameters.size; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/runtime/round/list`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => RuntimeRoundListResponseFromJSON(jsonValue)); + } + + /** + */ + async runtimeRoundListHandler(requestParameters: RuntimeRoundListHandlerRequest): Promise { + const response = await this.runtimeRoundListHandlerRaw(requestParameters); + return await response.value(); + } + + /** + */ + async runtimeStatsHandlerRaw(requestParameters: RuntimeStatsHandlerRequest): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling runtimeStatsHandler.'); + } + + const queryParameters: any = {}; + + if (requestParameters.id !== undefined) { + queryParameters['id'] = requestParameters.id; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/runtime/stats`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => RuntimeStatsResponseFromJSON(jsonValue)); + } + + /** + */ + async runtimeStatsHandler(requestParameters: RuntimeStatsHandlerRequest): Promise { + const response = await this.runtimeStatsHandlerRaw(requestParameters); + return await response.value(); + } + + /** + */ + async runtimeTransactionInfoHandlerRaw(requestParameters: RuntimeTransactionInfoHandlerRequest): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling runtimeTransactionInfoHandler.'); + } + + if (requestParameters.round === null || requestParameters.round === undefined) { + throw new runtime.RequiredError('round','Required parameter requestParameters.round was null or undefined when calling runtimeTransactionInfoHandler.'); + } + + if (requestParameters.hash === null || requestParameters.hash === undefined) { + throw new runtime.RequiredError('hash','Required parameter requestParameters.hash was null or undefined when calling runtimeTransactionInfoHandler.'); + } + + const queryParameters: any = {}; + + if (requestParameters.id !== undefined) { + queryParameters['id'] = requestParameters.id; + } + + if (requestParameters.round !== undefined) { + queryParameters['round'] = requestParameters.round; + } + + if (requestParameters.hash !== undefined) { + queryParameters['hash'] = requestParameters.hash; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/runtime/transaction/info`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => RuntimeTransactionInfoResponseFromJSON(jsonValue)); + } + + /** + */ + async runtimeTransactionInfoHandler(requestParameters: RuntimeTransactionInfoHandlerRequest): Promise { + const response = await this.runtimeTransactionInfoHandlerRaw(requestParameters); + return await response.value(); + } + + /** + */ + async runtimeTransactionListHandlerRaw(requestParameters: RuntimeTransactionListHandlerRequest): Promise> { + if (requestParameters.page === null || requestParameters.page === undefined) { + throw new runtime.RequiredError('page','Required parameter requestParameters.page was null or undefined when calling runtimeTransactionListHandler.'); + } + + if (requestParameters.size === null || requestParameters.size === undefined) { + throw new runtime.RequiredError('size','Required parameter requestParameters.size was null or undefined when calling runtimeTransactionListHandler.'); + } + + const queryParameters: any = {}; + + if (requestParameters.id !== undefined) { + queryParameters['id'] = requestParameters.id; + } + + if (requestParameters.address !== undefined) { + queryParameters['address'] = requestParameters.address; + } + + if (requestParameters.round !== undefined) { + queryParameters['round'] = requestParameters.round; + } + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + if (requestParameters.size !== undefined) { + queryParameters['size'] = requestParameters.size; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/runtime/transaction/list`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => RuntimeTransactionListResponseFromJSON(jsonValue)); + } + + /** + */ + async runtimeTransactionListHandler(requestParameters: RuntimeTransactionListHandlerRequest): Promise { + const response = await this.runtimeTransactionListHandlerRaw(requestParameters); + return await response.value(); + } + +} diff --git a/src/vendors/oasisscan-v2/apis/ValidatorApi.ts b/src/vendors/oasisscan-v2/apis/ValidatorApi.ts new file mode 100644 index 0000000000..1032c2ebac --- /dev/null +++ b/src/vendors/oasisscan-v2/apis/ValidatorApi.ts @@ -0,0 +1,343 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import { + DelegatorsResponse, + DelegatorsResponseFromJSON, + DelegatorsResponseToJSON, + ValidatorBlocksStatsResponse, + ValidatorBlocksStatsResponseFromJSON, + ValidatorBlocksStatsResponseToJSON, + ValidatorEscrowEventResponse, + ValidatorEscrowEventResponseFromJSON, + ValidatorEscrowEventResponseToJSON, + ValidatorEscrowStatsResponse, + ValidatorEscrowStatsResponseFromJSON, + ValidatorEscrowStatsResponseToJSON, + ValidatorInfoResponse, + ValidatorInfoResponseFromJSON, + ValidatorInfoResponseToJSON, + ValidatorListResponse, + ValidatorListResponseFromJSON, + ValidatorListResponseToJSON, + ValidatorSignStatsResponse, + ValidatorSignStatsResponseFromJSON, + ValidatorSignStatsResponseToJSON, +} from '../models'; + +export interface DelegatorsHandlerRequest { + address: string; + page: number; + size: number; +} + +export interface ValidatorBlocksStatsHandlerRequest { + address: string; +} + +export interface ValidatorEscrowEventHandlerRequest { + address: string; + page: number; + size: number; +} + +export interface ValidatorEscrowStatsHandlerRequest { + address: string; +} + +export interface ValidatorInfoHandlerRequest { + address: string; +} + +export interface ValidatorListHandlerRequest { + orderBy: string; + sort: string; +} + +export interface ValidatorSignStatsHandlerRequest { + address: string; +} + +/** + * + */ +export class ValidatorApi extends runtime.BaseAPI { + + /** + */ + async delegatorsHandlerRaw(requestParameters: DelegatorsHandlerRequest): Promise> { + if (requestParameters.address === null || requestParameters.address === undefined) { + throw new runtime.RequiredError('address','Required parameter requestParameters.address was null or undefined when calling delegatorsHandler.'); + } + + if (requestParameters.page === null || requestParameters.page === undefined) { + throw new runtime.RequiredError('page','Required parameter requestParameters.page was null or undefined when calling delegatorsHandler.'); + } + + if (requestParameters.size === null || requestParameters.size === undefined) { + throw new runtime.RequiredError('size','Required parameter requestParameters.size was null or undefined when calling delegatorsHandler.'); + } + + const queryParameters: any = {}; + + if (requestParameters.address !== undefined) { + queryParameters['address'] = requestParameters.address; + } + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + if (requestParameters.size !== undefined) { + queryParameters['size'] = requestParameters.size; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/validator/delegators`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => DelegatorsResponseFromJSON(jsonValue)); + } + + /** + */ + async delegatorsHandler(requestParameters: DelegatorsHandlerRequest): Promise { + const response = await this.delegatorsHandlerRaw(requestParameters); + return await response.value(); + } + + /** + */ + async validatorBlocksStatsHandlerRaw(requestParameters: ValidatorBlocksStatsHandlerRequest): Promise> { + if (requestParameters.address === null || requestParameters.address === undefined) { + throw new runtime.RequiredError('address','Required parameter requestParameters.address was null or undefined when calling validatorBlocksStatsHandler.'); + } + + const queryParameters: any = {}; + + if (requestParameters.address !== undefined) { + queryParameters['address'] = requestParameters.address; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/validator/blocksstats`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => ValidatorBlocksStatsResponseFromJSON(jsonValue)); + } + + /** + */ + async validatorBlocksStatsHandler(requestParameters: ValidatorBlocksStatsHandlerRequest): Promise { + const response = await this.validatorBlocksStatsHandlerRaw(requestParameters); + return await response.value(); + } + + /** + */ + async validatorEscrowEventHandlerRaw(requestParameters: ValidatorEscrowEventHandlerRequest): Promise> { + if (requestParameters.address === null || requestParameters.address === undefined) { + throw new runtime.RequiredError('address','Required parameter requestParameters.address was null or undefined when calling validatorEscrowEventHandler.'); + } + + if (requestParameters.page === null || requestParameters.page === undefined) { + throw new runtime.RequiredError('page','Required parameter requestParameters.page was null or undefined when calling validatorEscrowEventHandler.'); + } + + if (requestParameters.size === null || requestParameters.size === undefined) { + throw new runtime.RequiredError('size','Required parameter requestParameters.size was null or undefined when calling validatorEscrowEventHandler.'); + } + + const queryParameters: any = {}; + + if (requestParameters.address !== undefined) { + queryParameters['address'] = requestParameters.address; + } + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + if (requestParameters.size !== undefined) { + queryParameters['size'] = requestParameters.size; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/validator/escrowevent`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => ValidatorEscrowEventResponseFromJSON(jsonValue)); + } + + /** + */ + async validatorEscrowEventHandler(requestParameters: ValidatorEscrowEventHandlerRequest): Promise { + const response = await this.validatorEscrowEventHandlerRaw(requestParameters); + return await response.value(); + } + + /** + */ + async validatorEscrowStatsHandlerRaw(requestParameters: ValidatorEscrowStatsHandlerRequest): Promise> { + if (requestParameters.address === null || requestParameters.address === undefined) { + throw new runtime.RequiredError('address','Required parameter requestParameters.address was null or undefined when calling validatorEscrowStatsHandler.'); + } + + const queryParameters: any = {}; + + if (requestParameters.address !== undefined) { + queryParameters['address'] = requestParameters.address; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/validator/escrowstats`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => ValidatorEscrowStatsResponseFromJSON(jsonValue)); + } + + /** + */ + async validatorEscrowStatsHandler(requestParameters: ValidatorEscrowStatsHandlerRequest): Promise { + const response = await this.validatorEscrowStatsHandlerRaw(requestParameters); + return await response.value(); + } + + /** + */ + async validatorInfoHandlerRaw(requestParameters: ValidatorInfoHandlerRequest): Promise> { + if (requestParameters.address === null || requestParameters.address === undefined) { + throw new runtime.RequiredError('address','Required parameter requestParameters.address was null or undefined when calling validatorInfoHandler.'); + } + + const queryParameters: any = {}; + + if (requestParameters.address !== undefined) { + queryParameters['address'] = requestParameters.address; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/validator/info`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => ValidatorInfoResponseFromJSON(jsonValue)); + } + + /** + */ + async validatorInfoHandler(requestParameters: ValidatorInfoHandlerRequest): Promise { + const response = await this.validatorInfoHandlerRaw(requestParameters); + return await response.value(); + } + + /** + */ + async validatorListHandlerRaw(requestParameters: ValidatorListHandlerRequest): Promise> { + if (requestParameters.orderBy === null || requestParameters.orderBy === undefined) { + throw new runtime.RequiredError('orderBy','Required parameter requestParameters.orderBy was null or undefined when calling validatorListHandler.'); + } + + if (requestParameters.sort === null || requestParameters.sort === undefined) { + throw new runtime.RequiredError('sort','Required parameter requestParameters.sort was null or undefined when calling validatorListHandler.'); + } + + const queryParameters: any = {}; + + if (requestParameters.orderBy !== undefined) { + queryParameters['orderBy'] = requestParameters.orderBy; + } + + if (requestParameters.sort !== undefined) { + queryParameters['sort'] = requestParameters.sort; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/validator/list`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => ValidatorListResponseFromJSON(jsonValue)); + } + + /** + */ + async validatorListHandler(requestParameters: ValidatorListHandlerRequest): Promise { + const response = await this.validatorListHandlerRaw(requestParameters); + return await response.value(); + } + + /** + */ + async validatorSignStatsHandlerRaw(requestParameters: ValidatorSignStatsHandlerRequest): Promise> { + if (requestParameters.address === null || requestParameters.address === undefined) { + throw new runtime.RequiredError('address','Required parameter requestParameters.address was null or undefined when calling validatorSignStatsHandler.'); + } + + const queryParameters: any = {}; + + if (requestParameters.address !== undefined) { + queryParameters['address'] = requestParameters.address; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/validator/signstats`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => ValidatorSignStatsResponseFromJSON(jsonValue)); + } + + /** + */ + async validatorSignStatsHandler(requestParameters: ValidatorSignStatsHandlerRequest): Promise { + const response = await this.validatorSignStatsHandlerRaw(requestParameters); + return await response.value(); + } + +} diff --git a/src/vendors/oasisscan-v2/apis/index.ts b/src/vendors/oasisscan-v2/apis/index.ts new file mode 100644 index 0000000000..219edf41ac --- /dev/null +++ b/src/vendors/oasisscan-v2/apis/index.ts @@ -0,0 +1,7 @@ +export * from './AccountApi' +export * from './ChainApi' +export * from './CommonApi' +export * from './GovernanceApi' +export * from './MarketApi' +export * from './RuntimeApi' +export * from './ValidatorApi' diff --git a/src/vendors/oasisscan-v2/index.ts b/src/vendors/oasisscan-v2/index.ts new file mode 100644 index 0000000000..36e2d32324 --- /dev/null +++ b/src/vendors/oasisscan-v2/index.ts @@ -0,0 +1,3 @@ +export * from './runtime' +export * from './apis' +export * from './models' diff --git a/src/vendors/oasisscan-v2/models/AccountAllowance.ts b/src/vendors/oasisscan-v2/models/AccountAllowance.ts new file mode 100644 index 0000000000..3c0118dcc0 --- /dev/null +++ b/src/vendors/oasisscan-v2/models/AccountAllowance.ts @@ -0,0 +1,65 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface AccountAllowance + */ +export interface AccountAllowance { + /** + * + * @type {string} + * @memberof AccountAllowance + */ + address: string; + /** + * + * @type {string} + * @memberof AccountAllowance + */ + amount: string; +} + +export function AccountAllowanceFromJSON(json: any): AccountAllowance { + return AccountAllowanceFromJSONTyped(json, false); +} + +export function AccountAllowanceFromJSONTyped(json: any, ignoreDiscriminator: boolean): AccountAllowance { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'address': json['address'], + 'amount': json['amount'], + }; +} + +export function AccountAllowanceToJSON(value?: AccountAllowance | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'address': value.address, + 'amount': value.amount, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/AccountDebondingInfo.ts b/src/vendors/oasisscan-v2/models/AccountDebondingInfo.ts new file mode 100644 index 0000000000..b232efc843 --- /dev/null +++ b/src/vendors/oasisscan-v2/models/AccountDebondingInfo.ts @@ -0,0 +1,97 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface AccountDebondingInfo + */ +export interface AccountDebondingInfo { + /** + * + * @type {string} + * @memberof AccountDebondingInfo + */ + validatorAddress: string; + /** + * + * @type {string} + * @memberof AccountDebondingInfo + */ + validatorName: string; + /** + * + * @type {string} + * @memberof AccountDebondingInfo + */ + icon: string; + /** + * + * @type {string} + * @memberof AccountDebondingInfo + */ + shares: string; + /** + * + * @type {number} + * @memberof AccountDebondingInfo + */ + debondEnd: number; + /** + * + * @type {number} + * @memberof AccountDebondingInfo + */ + epochLeft: number; +} + +export function AccountDebondingInfoFromJSON(json: any): AccountDebondingInfo { + return AccountDebondingInfoFromJSONTyped(json, false); +} + +export function AccountDebondingInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean): AccountDebondingInfo { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'validatorAddress': json['validatorAddress'], + 'validatorName': json['validatorName'], + 'icon': json['icon'], + 'shares': json['shares'], + 'debondEnd': json['debondEnd'], + 'epochLeft': json['epochLeft'], + }; +} + +export function AccountDebondingInfoToJSON(value?: AccountDebondingInfo | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'validatorAddress': value.validatorAddress, + 'validatorName': value.validatorName, + 'icon': value.icon, + 'shares': value.shares, + 'debondEnd': value.debondEnd, + 'epochLeft': value.epochLeft, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/AccountDebondingRequest.ts b/src/vendors/oasisscan-v2/models/AccountDebondingRequest.ts new file mode 100644 index 0000000000..66ef8ec1f7 --- /dev/null +++ b/src/vendors/oasisscan-v2/models/AccountDebondingRequest.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface AccountDebondingRequest + */ +export interface AccountDebondingRequest { + /** + * + * @type {string} + * @memberof AccountDebondingRequest + */ + address: string; + /** + * + * @type {number} + * @memberof AccountDebondingRequest + */ + page: number; + /** + * + * @type {number} + * @memberof AccountDebondingRequest + */ + size: number; +} + +export function AccountDebondingRequestFromJSON(json: any): AccountDebondingRequest { + return AccountDebondingRequestFromJSONTyped(json, false); +} + +export function AccountDebondingRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): AccountDebondingRequest { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'address': json['address'], + 'page': json['page'], + 'size': json['size'], + }; +} + +export function AccountDebondingRequestToJSON(value?: AccountDebondingRequest | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'address': value.address, + 'page': value.page, + 'size': value.size, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/AccountDebondingResponse.ts b/src/vendors/oasisscan-v2/models/AccountDebondingResponse.ts new file mode 100644 index 0000000000..2af15a3ead --- /dev/null +++ b/src/vendors/oasisscan-v2/models/AccountDebondingResponse.ts @@ -0,0 +1,96 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import { + AccountDebondingInfo, + AccountDebondingInfoFromJSON, + AccountDebondingInfoFromJSONTyped, + AccountDebondingInfoToJSON, +} from './'; + +/** + * + * @export + * @interface AccountDebondingResponse + */ +export interface AccountDebondingResponse { + /** + * + * @type {Array} + * @memberof AccountDebondingResponse + */ + list: Array; + /** + * + * @type {number} + * @memberof AccountDebondingResponse + */ + page?: number; + /** + * + * @type {number} + * @memberof AccountDebondingResponse + */ + size?: number; + /** + * + * @type {number} + * @memberof AccountDebondingResponse + */ + maxPage?: number; + /** + * + * @type {number} + * @memberof AccountDebondingResponse + */ + totalSize?: number; +} + +export function AccountDebondingResponseFromJSON(json: any): AccountDebondingResponse { + return AccountDebondingResponseFromJSONTyped(json, false); +} + +export function AccountDebondingResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): AccountDebondingResponse { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'list': ((json['list'] as Array).map(AccountDebondingInfoFromJSON)), + 'page': !exists(json, 'page') ? undefined : json['page'], + 'size': !exists(json, 'size') ? undefined : json['size'], + 'maxPage': !exists(json, 'maxPage') ? undefined : json['maxPage'], + 'totalSize': !exists(json, 'totalSize') ? undefined : json['totalSize'], + }; +} + +export function AccountDebondingResponseToJSON(value?: AccountDebondingResponse | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'list': ((value.list as Array).map(AccountDebondingInfoToJSON)), + 'page': value.page, + 'size': value.size, + 'maxPage': value.maxPage, + 'totalSize': value.totalSize, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/AccountDelegationsInfo.ts b/src/vendors/oasisscan-v2/models/AccountDelegationsInfo.ts new file mode 100644 index 0000000000..261d532552 --- /dev/null +++ b/src/vendors/oasisscan-v2/models/AccountDelegationsInfo.ts @@ -0,0 +1,105 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface AccountDelegationsInfo + */ +export interface AccountDelegationsInfo { + /** + * + * @type {string} + * @memberof AccountDelegationsInfo + */ + validatorAddress: string; + /** + * + * @type {string} + * @memberof AccountDelegationsInfo + */ + validatorName: string; + /** + * + * @type {string} + * @memberof AccountDelegationsInfo + */ + icon: string; + /** + * + * @type {string} + * @memberof AccountDelegationsInfo + */ + entityAddress: string; + /** + * + * @type {string} + * @memberof AccountDelegationsInfo + */ + shares: string; + /** + * + * @type {string} + * @memberof AccountDelegationsInfo + */ + amount: string; + /** + * + * @type {boolean} + * @memberof AccountDelegationsInfo + */ + active: boolean; +} + +export function AccountDelegationsInfoFromJSON(json: any): AccountDelegationsInfo { + return AccountDelegationsInfoFromJSONTyped(json, false); +} + +export function AccountDelegationsInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean): AccountDelegationsInfo { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'validatorAddress': json['validatorAddress'], + 'validatorName': json['validatorName'], + 'icon': json['icon'], + 'entityAddress': json['entityAddress'], + 'shares': json['shares'], + 'amount': json['amount'], + 'active': json['active'], + }; +} + +export function AccountDelegationsInfoToJSON(value?: AccountDelegationsInfo | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'validatorAddress': value.validatorAddress, + 'validatorName': value.validatorName, + 'icon': value.icon, + 'entityAddress': value.entityAddress, + 'shares': value.shares, + 'amount': value.amount, + 'active': value.active, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/AccountDelegationsRequest.ts b/src/vendors/oasisscan-v2/models/AccountDelegationsRequest.ts new file mode 100644 index 0000000000..c6ae94d0ad --- /dev/null +++ b/src/vendors/oasisscan-v2/models/AccountDelegationsRequest.ts @@ -0,0 +1,81 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface AccountDelegationsRequest + */ +export interface AccountDelegationsRequest { + /** + * + * @type {string} + * @memberof AccountDelegationsRequest + */ + address: string; + /** + * + * @type {boolean} + * @memberof AccountDelegationsRequest + */ + all: boolean; + /** + * + * @type {number} + * @memberof AccountDelegationsRequest + */ + page: number; + /** + * + * @type {number} + * @memberof AccountDelegationsRequest + */ + size: number; +} + +export function AccountDelegationsRequestFromJSON(json: any): AccountDelegationsRequest { + return AccountDelegationsRequestFromJSONTyped(json, false); +} + +export function AccountDelegationsRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): AccountDelegationsRequest { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'address': json['address'], + 'all': json['all'], + 'page': json['page'], + 'size': json['size'], + }; +} + +export function AccountDelegationsRequestToJSON(value?: AccountDelegationsRequest | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'address': value.address, + 'all': value.all, + 'page': value.page, + 'size': value.size, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/AccountDelegationsResponse.ts b/src/vendors/oasisscan-v2/models/AccountDelegationsResponse.ts new file mode 100644 index 0000000000..0b37ea0378 --- /dev/null +++ b/src/vendors/oasisscan-v2/models/AccountDelegationsResponse.ts @@ -0,0 +1,96 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import { + AccountDelegationsInfo, + AccountDelegationsInfoFromJSON, + AccountDelegationsInfoFromJSONTyped, + AccountDelegationsInfoToJSON, +} from './'; + +/** + * + * @export + * @interface AccountDelegationsResponse + */ +export interface AccountDelegationsResponse { + /** + * + * @type {Array} + * @memberof AccountDelegationsResponse + */ + list: Array; + /** + * + * @type {number} + * @memberof AccountDelegationsResponse + */ + page?: number; + /** + * + * @type {number} + * @memberof AccountDelegationsResponse + */ + size?: number; + /** + * + * @type {number} + * @memberof AccountDelegationsResponse + */ + maxPage?: number; + /** + * + * @type {number} + * @memberof AccountDelegationsResponse + */ + totalSize?: number; +} + +export function AccountDelegationsResponseFromJSON(json: any): AccountDelegationsResponse { + return AccountDelegationsResponseFromJSONTyped(json, false); +} + +export function AccountDelegationsResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): AccountDelegationsResponse { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'list': ((json['list'] as Array).map(AccountDelegationsInfoFromJSON)), + 'page': !exists(json, 'page') ? undefined : json['page'], + 'size': !exists(json, 'size') ? undefined : json['size'], + 'maxPage': !exists(json, 'maxPage') ? undefined : json['maxPage'], + 'totalSize': !exists(json, 'totalSize') ? undefined : json['totalSize'], + }; +} + +export function AccountDelegationsResponseToJSON(value?: AccountDelegationsResponse | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'list': ((value.list as Array).map(AccountDelegationsInfoToJSON)), + 'page': value.page, + 'size': value.size, + 'maxPage': value.maxPage, + 'totalSize': value.totalSize, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/AccountInfoResponse.ts b/src/vendors/oasisscan-v2/models/AccountInfoResponse.ts new file mode 100644 index 0000000000..f34f9052b4 --- /dev/null +++ b/src/vendors/oasisscan-v2/models/AccountInfoResponse.ts @@ -0,0 +1,112 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import { + AccountAllowance, + AccountAllowanceFromJSON, + AccountAllowanceFromJSONTyped, + AccountAllowanceToJSON, +} from './'; + +/** + * + * @export + * @interface AccountInfoResponse + */ +export interface AccountInfoResponse { + /** + * + * @type {string} + * @memberof AccountInfoResponse + */ + address: string; + /** + * + * @type {string} + * @memberof AccountInfoResponse + */ + available: string; + /** + * + * @type {string} + * @memberof AccountInfoResponse + */ + escrow: string; + /** + * + * @type {string} + * @memberof AccountInfoResponse + */ + debonding: string; + /** + * + * @type {string} + * @memberof AccountInfoResponse + */ + total: string; + /** + * + * @type {number} + * @memberof AccountInfoResponse + */ + nonce: number; + /** + * + * @type {Array} + * @memberof AccountInfoResponse + */ + allowances: Array; +} + +export function AccountInfoResponseFromJSON(json: any): AccountInfoResponse { + return AccountInfoResponseFromJSONTyped(json, false); +} + +export function AccountInfoResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): AccountInfoResponse { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'address': json['address'], + 'available': json['available'], + 'escrow': json['escrow'], + 'debonding': json['debonding'], + 'total': json['total'], + 'nonce': json['nonce'], + 'allowances': ((json['allowances'] as Array).map(AccountAllowanceFromJSON)), + }; +} + +export function AccountInfoResponseToJSON(value?: AccountInfoResponse | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'address': value.address, + 'available': value.available, + 'escrow': value.escrow, + 'debonding': value.debonding, + 'total': value.total, + 'nonce': value.nonce, + 'allowances': ((value.allowances as Array).map(AccountAllowanceToJSON)), + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/AccountRewardExportRequest.ts b/src/vendors/oasisscan-v2/models/AccountRewardExportRequest.ts new file mode 100644 index 0000000000..6952dc81ae --- /dev/null +++ b/src/vendors/oasisscan-v2/models/AccountRewardExportRequest.ts @@ -0,0 +1,57 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface AccountRewardExportRequest + */ +export interface AccountRewardExportRequest { + /** + * + * @type {string} + * @memberof AccountRewardExportRequest + */ + account: string; +} + +export function AccountRewardExportRequestFromJSON(json: any): AccountRewardExportRequest { + return AccountRewardExportRequestFromJSONTyped(json, false); +} + +export function AccountRewardExportRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): AccountRewardExportRequest { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'account': json['account'], + }; +} + +export function AccountRewardExportRequestToJSON(value?: AccountRewardExportRequest | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'account': value.account, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/AccountRewardInfo.ts b/src/vendors/oasisscan-v2/models/AccountRewardInfo.ts new file mode 100644 index 0000000000..90c629ad06 --- /dev/null +++ b/src/vendors/oasisscan-v2/models/AccountRewardInfo.ts @@ -0,0 +1,97 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface AccountRewardInfo + */ +export interface AccountRewardInfo { + /** + * + * @type {string} + * @memberof AccountRewardInfo + */ + validatorAddress: string; + /** + * + * @type {string} + * @memberof AccountRewardInfo + */ + validatorName: string; + /** + * + * @type {string} + * @memberof AccountRewardInfo + */ + validatorIcon: string; + /** + * + * @type {number} + * @memberof AccountRewardInfo + */ + epoch: number; + /** + * + * @type {number} + * @memberof AccountRewardInfo + */ + timestamp: number; + /** + * + * @type {string} + * @memberof AccountRewardInfo + */ + reward: string; +} + +export function AccountRewardInfoFromJSON(json: any): AccountRewardInfo { + return AccountRewardInfoFromJSONTyped(json, false); +} + +export function AccountRewardInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean): AccountRewardInfo { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'validatorAddress': json['validatorAddress'], + 'validatorName': json['validatorName'], + 'validatorIcon': json['validatorIcon'], + 'epoch': json['epoch'], + 'timestamp': json['timestamp'], + 'reward': json['reward'], + }; +} + +export function AccountRewardInfoToJSON(value?: AccountRewardInfo | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'validatorAddress': value.validatorAddress, + 'validatorName': value.validatorName, + 'validatorIcon': value.validatorIcon, + 'epoch': value.epoch, + 'timestamp': value.timestamp, + 'reward': value.reward, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/AccountRewardRequest.ts b/src/vendors/oasisscan-v2/models/AccountRewardRequest.ts new file mode 100644 index 0000000000..35459f9542 --- /dev/null +++ b/src/vendors/oasisscan-v2/models/AccountRewardRequest.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface AccountRewardRequest + */ +export interface AccountRewardRequest { + /** + * + * @type {string} + * @memberof AccountRewardRequest + */ + account: string; + /** + * + * @type {number} + * @memberof AccountRewardRequest + */ + page: number; + /** + * + * @type {number} + * @memberof AccountRewardRequest + */ + size: number; +} + +export function AccountRewardRequestFromJSON(json: any): AccountRewardRequest { + return AccountRewardRequestFromJSONTyped(json, false); +} + +export function AccountRewardRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): AccountRewardRequest { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'account': json['account'], + 'page': json['page'], + 'size': json['size'], + }; +} + +export function AccountRewardRequestToJSON(value?: AccountRewardRequest | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'account': value.account, + 'page': value.page, + 'size': value.size, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/AccountRewardResponse.ts b/src/vendors/oasisscan-v2/models/AccountRewardResponse.ts new file mode 100644 index 0000000000..ead75a12a3 --- /dev/null +++ b/src/vendors/oasisscan-v2/models/AccountRewardResponse.ts @@ -0,0 +1,96 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import { + AccountRewardInfo, + AccountRewardInfoFromJSON, + AccountRewardInfoFromJSONTyped, + AccountRewardInfoToJSON, +} from './'; + +/** + * + * @export + * @interface AccountRewardResponse + */ +export interface AccountRewardResponse { + /** + * + * @type {Array} + * @memberof AccountRewardResponse + */ + list: Array; + /** + * + * @type {number} + * @memberof AccountRewardResponse + */ + page?: number; + /** + * + * @type {number} + * @memberof AccountRewardResponse + */ + size?: number; + /** + * + * @type {number} + * @memberof AccountRewardResponse + */ + maxPage?: number; + /** + * + * @type {number} + * @memberof AccountRewardResponse + */ + totalSize?: number; +} + +export function AccountRewardResponseFromJSON(json: any): AccountRewardResponse { + return AccountRewardResponseFromJSONTyped(json, false); +} + +export function AccountRewardResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): AccountRewardResponse { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'list': ((json['list'] as Array).map(AccountRewardInfoFromJSON)), + 'page': !exists(json, 'page') ? undefined : json['page'], + 'size': !exists(json, 'size') ? undefined : json['size'], + 'maxPage': !exists(json, 'maxPage') ? undefined : json['maxPage'], + 'totalSize': !exists(json, 'totalSize') ? undefined : json['totalSize'], + }; +} + +export function AccountRewardResponseToJSON(value?: AccountRewardResponse | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'list': ((value.list as Array).map(AccountRewardInfoToJSON)), + 'page': value.page, + 'size': value.size, + 'maxPage': value.maxPage, + 'totalSize': value.totalSize, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/AccountRewardStatsInfo.ts b/src/vendors/oasisscan-v2/models/AccountRewardStatsInfo.ts new file mode 100644 index 0000000000..cd1dab6723 --- /dev/null +++ b/src/vendors/oasisscan-v2/models/AccountRewardStatsInfo.ts @@ -0,0 +1,80 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import { + AccountRewardStatsItem, + AccountRewardStatsItemFromJSON, + AccountRewardStatsItemFromJSONTyped, + AccountRewardStatsItemToJSON, +} from './'; + +/** + * + * @export + * @interface AccountRewardStatsInfo + */ +export interface AccountRewardStatsInfo { + /** + * + * @type {string} + * @memberof AccountRewardStatsInfo + */ + validatorName: string; + /** + * + * @type {Array} + * @memberof AccountRewardStatsInfo + */ + rewardList: Array; + /** + * + * @type {string} + * @memberof AccountRewardStatsInfo + */ + total: string; +} + +export function AccountRewardStatsInfoFromJSON(json: any): AccountRewardStatsInfo { + return AccountRewardStatsInfoFromJSONTyped(json, false); +} + +export function AccountRewardStatsInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean): AccountRewardStatsInfo { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'validatorName': json['validatorName'], + 'rewardList': ((json['rewardList'] as Array).map(AccountRewardStatsItemFromJSON)), + 'total': json['total'], + }; +} + +export function AccountRewardStatsInfoToJSON(value?: AccountRewardStatsInfo | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'validatorName': value.validatorName, + 'rewardList': ((value.rewardList as Array).map(AccountRewardStatsItemToJSON)), + 'total': value.total, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/AccountRewardStatsItem.ts b/src/vendors/oasisscan-v2/models/AccountRewardStatsItem.ts new file mode 100644 index 0000000000..9450b2a728 --- /dev/null +++ b/src/vendors/oasisscan-v2/models/AccountRewardStatsItem.ts @@ -0,0 +1,65 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface AccountRewardStatsItem + */ +export interface AccountRewardStatsItem { + /** + * + * @type {number} + * @memberof AccountRewardStatsItem + */ + dateTime: number; + /** + * + * @type {string} + * @memberof AccountRewardStatsItem + */ + reward: string; +} + +export function AccountRewardStatsItemFromJSON(json: any): AccountRewardStatsItem { + return AccountRewardStatsItemFromJSONTyped(json, false); +} + +export function AccountRewardStatsItemFromJSONTyped(json: any, ignoreDiscriminator: boolean): AccountRewardStatsItem { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'dateTime': json['dateTime'], + 'reward': json['reward'], + }; +} + +export function AccountRewardStatsItemToJSON(value?: AccountRewardStatsItem | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'dateTime': value.dateTime, + 'reward': value.reward, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/AccountRewardStatsRequest.ts b/src/vendors/oasisscan-v2/models/AccountRewardStatsRequest.ts new file mode 100644 index 0000000000..8a3bf980cb --- /dev/null +++ b/src/vendors/oasisscan-v2/models/AccountRewardStatsRequest.ts @@ -0,0 +1,57 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface AccountRewardStatsRequest + */ +export interface AccountRewardStatsRequest { + /** + * + * @type {string} + * @memberof AccountRewardStatsRequest + */ + account: string; +} + +export function AccountRewardStatsRequestFromJSON(json: any): AccountRewardStatsRequest { + return AccountRewardStatsRequestFromJSONTyped(json, false); +} + +export function AccountRewardStatsRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): AccountRewardStatsRequest { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'account': json['account'], + }; +} + +export function AccountRewardStatsRequestToJSON(value?: AccountRewardStatsRequest | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'account': value.account, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/AccountRewardStatsResponse.ts b/src/vendors/oasisscan-v2/models/AccountRewardStatsResponse.ts new file mode 100644 index 0000000000..b06087e0da --- /dev/null +++ b/src/vendors/oasisscan-v2/models/AccountRewardStatsResponse.ts @@ -0,0 +1,72 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import { + AccountRewardStatsInfo, + AccountRewardStatsInfoFromJSON, + AccountRewardStatsInfoFromJSONTyped, + AccountRewardStatsInfoToJSON, +} from './'; + +/** + * + * @export + * @interface AccountRewardStatsResponse + */ +export interface AccountRewardStatsResponse { + /** + * + * @type {{ [key: string]: AccountRewardStatsInfo; }} + * @memberof AccountRewardStatsResponse + */ + stats: { [key: string]: AccountRewardStatsInfo; }; + /** + * + * @type {Array} + * @memberof AccountRewardStatsResponse + */ + time: Array; +} + +export function AccountRewardStatsResponseFromJSON(json: any): AccountRewardStatsResponse { + return AccountRewardStatsResponseFromJSONTyped(json, false); +} + +export function AccountRewardStatsResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): AccountRewardStatsResponse { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'stats': (mapValues(json['stats'], AccountRewardStatsInfoFromJSON)), + 'time': json['time'], + }; +} + +export function AccountRewardStatsResponseToJSON(value?: AccountRewardStatsResponse | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'stats': (mapValues(value.stats, AccountRewardStatsInfoToJSON)), + 'time': value.time, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/AccountStakingEventsInfo.ts b/src/vendors/oasisscan-v2/models/AccountStakingEventsInfo.ts new file mode 100644 index 0000000000..e0c444438a --- /dev/null +++ b/src/vendors/oasisscan-v2/models/AccountStakingEventsInfo.ts @@ -0,0 +1,81 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface AccountStakingEventsInfo + */ +export interface AccountStakingEventsInfo { + /** + * + * @type {string} + * @memberof AccountStakingEventsInfo + */ + id: string; + /** + * + * @type {number} + * @memberof AccountStakingEventsInfo + */ + height: number; + /** + * + * @type {string} + * @memberof AccountStakingEventsInfo + */ + txHash: string; + /** + * + * @type {string} + * @memberof AccountStakingEventsInfo + */ + kind: string; +} + +export function AccountStakingEventsInfoFromJSON(json: any): AccountStakingEventsInfo { + return AccountStakingEventsInfoFromJSONTyped(json, false); +} + +export function AccountStakingEventsInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean): AccountStakingEventsInfo { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'id': json['id'], + 'height': json['height'], + 'txHash': json['txHash'], + 'kind': json['kind'], + }; +} + +export function AccountStakingEventsInfoToJSON(value?: AccountStakingEventsInfo | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'id': value.id, + 'height': value.height, + 'txHash': value.txHash, + 'kind': value.kind, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/AccountStakingEventsInfoRequest.ts b/src/vendors/oasisscan-v2/models/AccountStakingEventsInfoRequest.ts new file mode 100644 index 0000000000..bdf3134b94 --- /dev/null +++ b/src/vendors/oasisscan-v2/models/AccountStakingEventsInfoRequest.ts @@ -0,0 +1,57 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface AccountStakingEventsInfoRequest + */ +export interface AccountStakingEventsInfoRequest { + /** + * + * @type {string} + * @memberof AccountStakingEventsInfoRequest + */ + id: string; +} + +export function AccountStakingEventsInfoRequestFromJSON(json: any): AccountStakingEventsInfoRequest { + return AccountStakingEventsInfoRequestFromJSONTyped(json, false); +} + +export function AccountStakingEventsInfoRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): AccountStakingEventsInfoRequest { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'id': json['id'], + }; +} + +export function AccountStakingEventsInfoRequestToJSON(value?: AccountStakingEventsInfoRequest | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'id': value.id, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/AccountStakingEventsInfoResponse.ts b/src/vendors/oasisscan-v2/models/AccountStakingEventsInfoResponse.ts new file mode 100644 index 0000000000..12a3179b33 --- /dev/null +++ b/src/vendors/oasisscan-v2/models/AccountStakingEventsInfoResponse.ts @@ -0,0 +1,113 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface AccountStakingEventsInfoResponse + */ +export interface AccountStakingEventsInfoResponse { + /** + * + * @type {number} + * @memberof AccountStakingEventsInfoResponse + */ + height: number; + /** + * + * @type {string} + * @memberof AccountStakingEventsInfoResponse + */ + txHash: string; + /** + * + * @type {string} + * @memberof AccountStakingEventsInfoResponse + */ + kind: string; + /** + * + * @type {number} + * @memberof AccountStakingEventsInfoResponse + */ + timestamp: number; + /** + * + * @type {object} + * @memberof AccountStakingEventsInfoResponse + */ + transafer?: object; + /** + * + * @type {object} + * @memberof AccountStakingEventsInfoResponse + */ + burn?: object; + /** + * + * @type {object} + * @memberof AccountStakingEventsInfoResponse + */ + escrow?: object; + /** + * + * @type {object} + * @memberof AccountStakingEventsInfoResponse + */ + allowanceChange?: object; +} + +export function AccountStakingEventsInfoResponseFromJSON(json: any): AccountStakingEventsInfoResponse { + return AccountStakingEventsInfoResponseFromJSONTyped(json, false); +} + +export function AccountStakingEventsInfoResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): AccountStakingEventsInfoResponse { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'height': json['height'], + 'txHash': json['txHash'], + 'kind': json['kind'], + 'timestamp': json['timestamp'], + 'transafer': !exists(json, 'transafer') ? undefined : json['transafer'], + 'burn': !exists(json, 'burn') ? undefined : json['burn'], + 'escrow': !exists(json, 'escrow') ? undefined : json['escrow'], + 'allowanceChange': !exists(json, 'allowanceChange') ? undefined : json['allowanceChange'], + }; +} + +export function AccountStakingEventsInfoResponseToJSON(value?: AccountStakingEventsInfoResponse | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'height': value.height, + 'txHash': value.txHash, + 'kind': value.kind, + 'timestamp': value.timestamp, + 'transafer': value.transafer, + 'burn': value.burn, + 'escrow': value.escrow, + 'allowanceChange': value.allowanceChange, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/AccountStakingEventsRequest.ts b/src/vendors/oasisscan-v2/models/AccountStakingEventsRequest.ts new file mode 100644 index 0000000000..c6d194a345 --- /dev/null +++ b/src/vendors/oasisscan-v2/models/AccountStakingEventsRequest.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface AccountStakingEventsRequest + */ +export interface AccountStakingEventsRequest { + /** + * + * @type {string} + * @memberof AccountStakingEventsRequest + */ + address: string; + /** + * + * @type {number} + * @memberof AccountStakingEventsRequest + */ + page: number; + /** + * + * @type {number} + * @memberof AccountStakingEventsRequest + */ + size: number; +} + +export function AccountStakingEventsRequestFromJSON(json: any): AccountStakingEventsRequest { + return AccountStakingEventsRequestFromJSONTyped(json, false); +} + +export function AccountStakingEventsRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): AccountStakingEventsRequest { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'address': json['address'], + 'page': json['page'], + 'size': json['size'], + }; +} + +export function AccountStakingEventsRequestToJSON(value?: AccountStakingEventsRequest | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'address': value.address, + 'page': value.page, + 'size': value.size, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/AccountStakingEventsResponse.ts b/src/vendors/oasisscan-v2/models/AccountStakingEventsResponse.ts new file mode 100644 index 0000000000..ce4e87f0f4 --- /dev/null +++ b/src/vendors/oasisscan-v2/models/AccountStakingEventsResponse.ts @@ -0,0 +1,96 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import { + AccountStakingEventsInfo, + AccountStakingEventsInfoFromJSON, + AccountStakingEventsInfoFromJSONTyped, + AccountStakingEventsInfoToJSON, +} from './'; + +/** + * + * @export + * @interface AccountStakingEventsResponse + */ +export interface AccountStakingEventsResponse { + /** + * + * @type {Array} + * @memberof AccountStakingEventsResponse + */ + list: Array; + /** + * + * @type {number} + * @memberof AccountStakingEventsResponse + */ + page?: number; + /** + * + * @type {number} + * @memberof AccountStakingEventsResponse + */ + size?: number; + /** + * + * @type {number} + * @memberof AccountStakingEventsResponse + */ + maxPage?: number; + /** + * + * @type {number} + * @memberof AccountStakingEventsResponse + */ + totalSize?: number; +} + +export function AccountStakingEventsResponseFromJSON(json: any): AccountStakingEventsResponse { + return AccountStakingEventsResponseFromJSONTyped(json, false); +} + +export function AccountStakingEventsResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): AccountStakingEventsResponse { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'list': ((json['list'] as Array).map(AccountStakingEventsInfoFromJSON)), + 'page': !exists(json, 'page') ? undefined : json['page'], + 'size': !exists(json, 'size') ? undefined : json['size'], + 'maxPage': !exists(json, 'maxPage') ? undefined : json['maxPage'], + 'totalSize': !exists(json, 'totalSize') ? undefined : json['totalSize'], + }; +} + +export function AccountStakingEventsResponseToJSON(value?: AccountStakingEventsResponse | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'list': ((value.list as Array).map(AccountStakingEventsInfoToJSON)), + 'page': value.page, + 'size': value.size, + 'maxPage': value.maxPage, + 'totalSize': value.totalSize, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/Bound.ts b/src/vendors/oasisscan-v2/models/Bound.ts new file mode 100644 index 0000000000..4139bfeb77 --- /dev/null +++ b/src/vendors/oasisscan-v2/models/Bound.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface Bound + */ +export interface Bound { + /** + * + * @type {number} + * @memberof Bound + */ + start: number; + /** + * + * @type {number} + * @memberof Bound + */ + min: number; + /** + * + * @type {number} + * @memberof Bound + */ + max: number; +} + +export function BoundFromJSON(json: any): Bound { + return BoundFromJSONTyped(json, false); +} + +export function BoundFromJSONTyped(json: any, ignoreDiscriminator: boolean): Bound { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'start': json['start'], + 'min': json['min'], + 'max': json['max'], + }; +} + +export function BoundToJSON(value?: Bound | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'start': value.start, + 'min': value.min, + 'max': value.max, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/ChainBlockInfo.ts b/src/vendors/oasisscan-v2/models/ChainBlockInfo.ts new file mode 100644 index 0000000000..d833582ce1 --- /dev/null +++ b/src/vendors/oasisscan-v2/models/ChainBlockInfo.ts @@ -0,0 +1,113 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface ChainBlockInfo + */ +export interface ChainBlockInfo { + /** + * + * @type {number} + * @memberof ChainBlockInfo + */ + height: number; + /** + * + * @type {number} + * @memberof ChainBlockInfo + */ + epoch: number; + /** + * + * @type {number} + * @memberof ChainBlockInfo + */ + timestamp: number; + /** + * + * @type {number} + * @memberof ChainBlockInfo + */ + time: number; + /** + * + * @type {string} + * @memberof ChainBlockInfo + */ + hash: string; + /** + * + * @type {number} + * @memberof ChainBlockInfo + */ + txs: number; + /** + * + * @type {string} + * @memberof ChainBlockInfo + */ + entityAddress: string; + /** + * + * @type {string} + * @memberof ChainBlockInfo + */ + name: string; +} + +export function ChainBlockInfoFromJSON(json: any): ChainBlockInfo { + return ChainBlockInfoFromJSONTyped(json, false); +} + +export function ChainBlockInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean): ChainBlockInfo { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'height': json['height'], + 'epoch': json['epoch'], + 'timestamp': json['timestamp'], + 'time': json['time'], + 'hash': json['hash'], + 'txs': json['txs'], + 'entityAddress': json['entityAddress'], + 'name': json['name'], + }; +} + +export function ChainBlockInfoToJSON(value?: ChainBlockInfo | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'height': value.height, + 'epoch': value.epoch, + 'timestamp': value.timestamp, + 'time': value.time, + 'hash': value.hash, + 'txs': value.txs, + 'entityAddress': value.entityAddress, + 'name': value.name, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/ChainBlockInfoResponse.ts b/src/vendors/oasisscan-v2/models/ChainBlockInfoResponse.ts new file mode 100644 index 0000000000..ae3657d542 --- /dev/null +++ b/src/vendors/oasisscan-v2/models/ChainBlockInfoResponse.ts @@ -0,0 +1,113 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface ChainBlockInfoResponse + */ +export interface ChainBlockInfoResponse { + /** + * + * @type {number} + * @memberof ChainBlockInfoResponse + */ + height?: number; + /** + * + * @type {number} + * @memberof ChainBlockInfoResponse + */ + epoch?: number; + /** + * + * @type {number} + * @memberof ChainBlockInfoResponse + */ + timestamp?: number; + /** + * + * @type {number} + * @memberof ChainBlockInfoResponse + */ + time?: number; + /** + * + * @type {string} + * @memberof ChainBlockInfoResponse + */ + hash?: string; + /** + * + * @type {number} + * @memberof ChainBlockInfoResponse + */ + txs?: number; + /** + * + * @type {string} + * @memberof ChainBlockInfoResponse + */ + entityAddress?: string; + /** + * + * @type {string} + * @memberof ChainBlockInfoResponse + */ + name?: string; +} + +export function ChainBlockInfoResponseFromJSON(json: any): ChainBlockInfoResponse { + return ChainBlockInfoResponseFromJSONTyped(json, false); +} + +export function ChainBlockInfoResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ChainBlockInfoResponse { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'height': !exists(json, 'height') ? undefined : json['height'], + 'epoch': !exists(json, 'epoch') ? undefined : json['epoch'], + 'timestamp': !exists(json, 'timestamp') ? undefined : json['timestamp'], + 'time': !exists(json, 'time') ? undefined : json['time'], + 'hash': !exists(json, 'hash') ? undefined : json['hash'], + 'txs': !exists(json, 'txs') ? undefined : json['txs'], + 'entityAddress': !exists(json, 'entityAddress') ? undefined : json['entityAddress'], + 'name': !exists(json, 'name') ? undefined : json['name'], + }; +} + +export function ChainBlockInfoResponseToJSON(value?: ChainBlockInfoResponse | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'height': value.height, + 'epoch': value.epoch, + 'timestamp': value.timestamp, + 'time': value.time, + 'hash': value.hash, + 'txs': value.txs, + 'entityAddress': value.entityAddress, + 'name': value.name, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/ChainBlocksRequest.ts b/src/vendors/oasisscan-v2/models/ChainBlocksRequest.ts new file mode 100644 index 0000000000..653745c958 --- /dev/null +++ b/src/vendors/oasisscan-v2/models/ChainBlocksRequest.ts @@ -0,0 +1,65 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface ChainBlocksRequest + */ +export interface ChainBlocksRequest { + /** + * + * @type {number} + * @memberof ChainBlocksRequest + */ + page: number; + /** + * + * @type {number} + * @memberof ChainBlocksRequest + */ + size: number; +} + +export function ChainBlocksRequestFromJSON(json: any): ChainBlocksRequest { + return ChainBlocksRequestFromJSONTyped(json, false); +} + +export function ChainBlocksRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): ChainBlocksRequest { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'page': json['page'], + 'size': json['size'], + }; +} + +export function ChainBlocksRequestToJSON(value?: ChainBlocksRequest | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'page': value.page, + 'size': value.size, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/ChainBlocksResponse.ts b/src/vendors/oasisscan-v2/models/ChainBlocksResponse.ts new file mode 100644 index 0000000000..095066d9d6 --- /dev/null +++ b/src/vendors/oasisscan-v2/models/ChainBlocksResponse.ts @@ -0,0 +1,96 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import { + ChainBlockInfo, + ChainBlockInfoFromJSON, + ChainBlockInfoFromJSONTyped, + ChainBlockInfoToJSON, +} from './'; + +/** + * + * @export + * @interface ChainBlocksResponse + */ +export interface ChainBlocksResponse { + /** + * + * @type {Array} + * @memberof ChainBlocksResponse + */ + list: Array; + /** + * + * @type {number} + * @memberof ChainBlocksResponse + */ + page?: number; + /** + * + * @type {number} + * @memberof ChainBlocksResponse + */ + size?: number; + /** + * + * @type {number} + * @memberof ChainBlocksResponse + */ + maxPage?: number; + /** + * + * @type {number} + * @memberof ChainBlocksResponse + */ + totalSize?: number; +} + +export function ChainBlocksResponseFromJSON(json: any): ChainBlocksResponse { + return ChainBlocksResponseFromJSONTyped(json, false); +} + +export function ChainBlocksResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ChainBlocksResponse { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'list': ((json['list'] as Array).map(ChainBlockInfoFromJSON)), + 'page': !exists(json, 'page') ? undefined : json['page'], + 'size': !exists(json, 'size') ? undefined : json['size'], + 'maxPage': !exists(json, 'maxPage') ? undefined : json['maxPage'], + 'totalSize': !exists(json, 'totalSize') ? undefined : json['totalSize'], + }; +} + +export function ChainBlocksResponseToJSON(value?: ChainBlocksResponse | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'list': ((value.list as Array).map(ChainBlockInfoToJSON)), + 'page': value.page, + 'size': value.size, + 'maxPage': value.maxPage, + 'totalSize': value.totalSize, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/ChainMethodsResponse.ts b/src/vendors/oasisscan-v2/models/ChainMethodsResponse.ts new file mode 100644 index 0000000000..de18a2545e --- /dev/null +++ b/src/vendors/oasisscan-v2/models/ChainMethodsResponse.ts @@ -0,0 +1,57 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface ChainMethodsResponse + */ +export interface ChainMethodsResponse { + /** + * + * @type {Array} + * @memberof ChainMethodsResponse + */ + list: Array; +} + +export function ChainMethodsResponseFromJSON(json: any): ChainMethodsResponse { + return ChainMethodsResponseFromJSONTyped(json, false); +} + +export function ChainMethodsResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ChainMethodsResponse { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'list': json['list'], + }; +} + +export function ChainMethodsResponseToJSON(value?: ChainMethodsResponse | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'list': value.list, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/ChainProposedBlocksRequest.ts b/src/vendors/oasisscan-v2/models/ChainProposedBlocksRequest.ts new file mode 100644 index 0000000000..293b54b798 --- /dev/null +++ b/src/vendors/oasisscan-v2/models/ChainProposedBlocksRequest.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface ChainProposedBlocksRequest + */ +export interface ChainProposedBlocksRequest { + /** + * + * @type {string} + * @memberof ChainProposedBlocksRequest + */ + address?: string; + /** + * + * @type {number} + * @memberof ChainProposedBlocksRequest + */ + page: number; + /** + * + * @type {number} + * @memberof ChainProposedBlocksRequest + */ + size: number; +} + +export function ChainProposedBlocksRequestFromJSON(json: any): ChainProposedBlocksRequest { + return ChainProposedBlocksRequestFromJSONTyped(json, false); +} + +export function ChainProposedBlocksRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): ChainProposedBlocksRequest { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'address': !exists(json, 'address') ? undefined : json['address'], + 'page': json['page'], + 'size': json['size'], + }; +} + +export function ChainProposedBlocksRequestToJSON(value?: ChainProposedBlocksRequest | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'address': value.address, + 'page': value.page, + 'size': value.size, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/ChainProposedBlocksResponse.ts b/src/vendors/oasisscan-v2/models/ChainProposedBlocksResponse.ts new file mode 100644 index 0000000000..7644297144 --- /dev/null +++ b/src/vendors/oasisscan-v2/models/ChainProposedBlocksResponse.ts @@ -0,0 +1,96 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import { + ChainBlockInfo, + ChainBlockInfoFromJSON, + ChainBlockInfoFromJSONTyped, + ChainBlockInfoToJSON, +} from './'; + +/** + * + * @export + * @interface ChainProposedBlocksResponse + */ +export interface ChainProposedBlocksResponse { + /** + * + * @type {Array} + * @memberof ChainProposedBlocksResponse + */ + list: Array; + /** + * + * @type {number} + * @memberof ChainProposedBlocksResponse + */ + page?: number; + /** + * + * @type {number} + * @memberof ChainProposedBlocksResponse + */ + size?: number; + /** + * + * @type {number} + * @memberof ChainProposedBlocksResponse + */ + maxPage?: number; + /** + * + * @type {number} + * @memberof ChainProposedBlocksResponse + */ + totalSize?: number; +} + +export function ChainProposedBlocksResponseFromJSON(json: any): ChainProposedBlocksResponse { + return ChainProposedBlocksResponseFromJSONTyped(json, false); +} + +export function ChainProposedBlocksResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ChainProposedBlocksResponse { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'list': ((json['list'] as Array).map(ChainBlockInfoFromJSON)), + 'page': !exists(json, 'page') ? undefined : json['page'], + 'size': !exists(json, 'size') ? undefined : json['size'], + 'maxPage': !exists(json, 'maxPage') ? undefined : json['maxPage'], + 'totalSize': !exists(json, 'totalSize') ? undefined : json['totalSize'], + }; +} + +export function ChainProposedBlocksResponseToJSON(value?: ChainProposedBlocksResponse | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'list': ((value.list as Array).map(ChainBlockInfoToJSON)), + 'page': value.page, + 'size': value.size, + 'maxPage': value.maxPage, + 'totalSize': value.totalSize, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/ChainSearchRequest.ts b/src/vendors/oasisscan-v2/models/ChainSearchRequest.ts new file mode 100644 index 0000000000..deccbc949f --- /dev/null +++ b/src/vendors/oasisscan-v2/models/ChainSearchRequest.ts @@ -0,0 +1,57 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface ChainSearchRequest + */ +export interface ChainSearchRequest { + /** + * + * @type {string} + * @memberof ChainSearchRequest + */ + key: string; +} + +export function ChainSearchRequestFromJSON(json: any): ChainSearchRequest { + return ChainSearchRequestFromJSONTyped(json, false); +} + +export function ChainSearchRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): ChainSearchRequest { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'key': json['key'], + }; +} + +export function ChainSearchRequestToJSON(value?: ChainSearchRequest | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'key': value.key, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/ChainSearchResponse.ts b/src/vendors/oasisscan-v2/models/ChainSearchResponse.ts new file mode 100644 index 0000000000..f3f34b656c --- /dev/null +++ b/src/vendors/oasisscan-v2/models/ChainSearchResponse.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface ChainSearchResponse + */ +export interface ChainSearchResponse { + /** + * + * @type {string} + * @memberof ChainSearchResponse + */ + key: string; + /** + * + * @type {string} + * @memberof ChainSearchResponse + */ + type: string; + /** + * + * @type {string} + * @memberof ChainSearchResponse + */ + result: string; +} + +export function ChainSearchResponseFromJSON(json: any): ChainSearchResponse { + return ChainSearchResponseFromJSONTyped(json, false); +} + +export function ChainSearchResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ChainSearchResponse { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'key': json['key'], + 'type': json['type'], + 'result': json['result'], + }; +} + +export function ChainSearchResponseToJSON(value?: ChainSearchResponse | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'key': value.key, + 'type': value.type, + 'result': value.result, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/ChainTransactionInfoResponse.ts b/src/vendors/oasisscan-v2/models/ChainTransactionInfoResponse.ts new file mode 100644 index 0000000000..620e0026de --- /dev/null +++ b/src/vendors/oasisscan-v2/models/ChainTransactionInfoResponse.ts @@ -0,0 +1,153 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface ChainTransactionInfoResponse + */ +export interface ChainTransactionInfoResponse { + /** + * + * @type {string} + * @memberof ChainTransactionInfoResponse + */ + txHash: string; + /** + * + * @type {number} + * @memberof ChainTransactionInfoResponse + */ + timestamp: number; + /** + * + * @type {number} + * @memberof ChainTransactionInfoResponse + */ + time: number; + /** + * + * @type {number} + * @memberof ChainTransactionInfoResponse + */ + height: number; + /** + * + * @type {string} + * @memberof ChainTransactionInfoResponse + */ + fee: string; + /** + * + * @type {number} + * @memberof ChainTransactionInfoResponse + */ + nonce: number; + /** + * + * @type {string} + * @memberof ChainTransactionInfoResponse + */ + method: string; + /** + * + * @type {string} + * @memberof ChainTransactionInfoResponse + */ + from: string; + /** + * + * @type {string} + * @memberof ChainTransactionInfoResponse + */ + to: string; + /** + * + * @type {string} + * @memberof ChainTransactionInfoResponse + */ + amount: string; + /** + * + * @type {string} + * @memberof ChainTransactionInfoResponse + */ + raw: string; + /** + * + * @type {boolean} + * @memberof ChainTransactionInfoResponse + */ + status: boolean; + /** + * + * @type {string} + * @memberof ChainTransactionInfoResponse + */ + errorMessage: string; +} + +export function ChainTransactionInfoResponseFromJSON(json: any): ChainTransactionInfoResponse { + return ChainTransactionInfoResponseFromJSONTyped(json, false); +} + +export function ChainTransactionInfoResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ChainTransactionInfoResponse { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'txHash': json['txHash'], + 'timestamp': json['timestamp'], + 'time': json['time'], + 'height': json['height'], + 'fee': json['fee'], + 'nonce': json['nonce'], + 'method': json['method'], + 'from': json['from'], + 'to': json['to'], + 'amount': json['amount'], + 'raw': json['raw'], + 'status': json['status'], + 'errorMessage': json['errorMessage'], + }; +} + +export function ChainTransactionInfoResponseToJSON(value?: ChainTransactionInfoResponse | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'txHash': value.txHash, + 'timestamp': value.timestamp, + 'time': value.time, + 'height': value.height, + 'fee': value.fee, + 'nonce': value.nonce, + 'method': value.method, + 'from': value.from, + 'to': value.to, + 'amount': value.amount, + 'raw': value.raw, + 'status': value.status, + 'errorMessage': value.errorMessage, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/ChainTransactionListInfo.ts b/src/vendors/oasisscan-v2/models/ChainTransactionListInfo.ts new file mode 100644 index 0000000000..49656b2233 --- /dev/null +++ b/src/vendors/oasisscan-v2/models/ChainTransactionListInfo.ts @@ -0,0 +1,193 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface ChainTransactionListInfo + */ +export interface ChainTransactionListInfo { + /** + * + * @type {string} + * @memberof ChainTransactionListInfo + */ + txType: string; + /** + * + * @type {string} + * @memberof ChainTransactionListInfo + */ + txHash?: string; + /** + * + * @type {number} + * @memberof ChainTransactionListInfo + */ + height?: number; + /** + * + * @type {string} + * @memberof ChainTransactionListInfo + */ + method?: string; + /** + * + * @type {string} + * @memberof ChainTransactionListInfo + */ + fee?: string; + /** + * + * @type {string} + * @memberof ChainTransactionListInfo + */ + amount?: string; + /** + * + * @type {string} + * @memberof ChainTransactionListInfo + */ + shares?: string; + /** + * + * @type {boolean} + * @memberof ChainTransactionListInfo + */ + add?: boolean; + /** + * + * @type {number} + * @memberof ChainTransactionListInfo + */ + timestamp?: number; + /** + * + * @type {number} + * @memberof ChainTransactionListInfo + */ + time?: number; + /** + * + * @type {boolean} + * @memberof ChainTransactionListInfo + */ + status?: boolean; + /** + * + * @type {string} + * @memberof ChainTransactionListInfo + */ + from?: string; + /** + * + * @type {string} + * @memberof ChainTransactionListInfo + */ + to?: string; + /** + * + * @type {string} + * @memberof ChainTransactionListInfo + */ + runtimeId?: string; + /** + * + * @type {string} + * @memberof ChainTransactionListInfo + */ + runtimeName?: string; + /** + * + * @type {number} + * @memberof ChainTransactionListInfo + */ + round?: number; + /** + * + * @type {boolean} + * @memberof ChainTransactionListInfo + */ + result?: boolean; + /** + * + * @type {string} + * @memberof ChainTransactionListInfo + */ + type?: string; +} + +export function ChainTransactionListInfoFromJSON(json: any): ChainTransactionListInfo { + return ChainTransactionListInfoFromJSONTyped(json, false); +} + +export function ChainTransactionListInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean): ChainTransactionListInfo { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'txType': json['txType'], + 'txHash': !exists(json, 'txHash') ? undefined : json['txHash'], + 'height': !exists(json, 'height') ? undefined : json['height'], + 'method': !exists(json, 'method') ? undefined : json['method'], + 'fee': !exists(json, 'fee') ? undefined : json['fee'], + 'amount': !exists(json, 'amount') ? undefined : json['amount'], + 'shares': !exists(json, 'shares') ? undefined : json['shares'], + 'add': !exists(json, 'add') ? undefined : json['add'], + 'timestamp': !exists(json, 'timestamp') ? undefined : json['timestamp'], + 'time': !exists(json, 'time') ? undefined : json['time'], + 'status': !exists(json, 'status') ? undefined : json['status'], + 'from': !exists(json, 'from') ? undefined : json['from'], + 'to': !exists(json, 'to') ? undefined : json['to'], + 'runtimeId': !exists(json, 'runtimeId') ? undefined : json['runtimeId'], + 'runtimeName': !exists(json, 'runtimeName') ? undefined : json['runtimeName'], + 'round': !exists(json, 'round') ? undefined : json['round'], + 'result': !exists(json, 'result') ? undefined : json['result'], + 'type': !exists(json, 'type') ? undefined : json['type'], + }; +} + +export function ChainTransactionListInfoToJSON(value?: ChainTransactionListInfo | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'txType': value.txType, + 'txHash': value.txHash, + 'height': value.height, + 'method': value.method, + 'fee': value.fee, + 'amount': value.amount, + 'shares': value.shares, + 'add': value.add, + 'timestamp': value.timestamp, + 'time': value.time, + 'status': value.status, + 'from': value.from, + 'to': value.to, + 'runtimeId': value.runtimeId, + 'runtimeName': value.runtimeName, + 'round': value.round, + 'result': value.result, + 'type': value.type, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/ChainTransactionsRequest.ts b/src/vendors/oasisscan-v2/models/ChainTransactionsRequest.ts new file mode 100644 index 0000000000..d3127e3db2 --- /dev/null +++ b/src/vendors/oasisscan-v2/models/ChainTransactionsRequest.ts @@ -0,0 +1,97 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface ChainTransactionsRequest + */ +export interface ChainTransactionsRequest { + /** + * + * @type {number} + * @memberof ChainTransactionsRequest + */ + height?: number; + /** + * + * @type {string} + * @memberof ChainTransactionsRequest + */ + address?: string; + /** + * + * @type {string} + * @memberof ChainTransactionsRequest + */ + method?: string; + /** + * + * @type {boolean} + * @memberof ChainTransactionsRequest + */ + runtime: boolean; + /** + * + * @type {number} + * @memberof ChainTransactionsRequest + */ + page: number; + /** + * + * @type {number} + * @memberof ChainTransactionsRequest + */ + size: number; +} + +export function ChainTransactionsRequestFromJSON(json: any): ChainTransactionsRequest { + return ChainTransactionsRequestFromJSONTyped(json, false); +} + +export function ChainTransactionsRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): ChainTransactionsRequest { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'height': !exists(json, 'height') ? undefined : json['height'], + 'address': !exists(json, 'address') ? undefined : json['address'], + 'method': !exists(json, 'method') ? undefined : json['method'], + 'runtime': json['runtime'], + 'page': json['page'], + 'size': json['size'], + }; +} + +export function ChainTransactionsRequestToJSON(value?: ChainTransactionsRequest | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'height': value.height, + 'address': value.address, + 'method': value.method, + 'runtime': value.runtime, + 'page': value.page, + 'size': value.size, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/ChainTransactionsResponse.ts b/src/vendors/oasisscan-v2/models/ChainTransactionsResponse.ts new file mode 100644 index 0000000000..49cb5756e1 --- /dev/null +++ b/src/vendors/oasisscan-v2/models/ChainTransactionsResponse.ts @@ -0,0 +1,96 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import { + ChainTransactionListInfo, + ChainTransactionListInfoFromJSON, + ChainTransactionListInfoFromJSONTyped, + ChainTransactionListInfoToJSON, +} from './'; + +/** + * + * @export + * @interface ChainTransactionsResponse + */ +export interface ChainTransactionsResponse { + /** + * + * @type {Array} + * @memberof ChainTransactionsResponse + */ + list: Array; + /** + * + * @type {number} + * @memberof ChainTransactionsResponse + */ + page?: number; + /** + * + * @type {number} + * @memberof ChainTransactionsResponse + */ + size?: number; + /** + * + * @type {number} + * @memberof ChainTransactionsResponse + */ + maxPage?: number; + /** + * + * @type {number} + * @memberof ChainTransactionsResponse + */ + totalSize?: number; +} + +export function ChainTransactionsResponseFromJSON(json: any): ChainTransactionsResponse { + return ChainTransactionsResponseFromJSONTyped(json, false); +} + +export function ChainTransactionsResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ChainTransactionsResponse { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'list': ((json['list'] as Array).map(ChainTransactionListInfoFromJSON)), + 'page': !exists(json, 'page') ? undefined : json['page'], + 'size': !exists(json, 'size') ? undefined : json['size'], + 'maxPage': !exists(json, 'maxPage') ? undefined : json['maxPage'], + 'totalSize': !exists(json, 'totalSize') ? undefined : json['totalSize'], + }; +} + +export function ChainTransactionsResponseToJSON(value?: ChainTransactionsResponse | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'list': ((value.list as Array).map(ChainTransactionListInfoToJSON)), + 'page': value.page, + 'size': value.size, + 'maxPage': value.maxPage, + 'totalSize': value.totalSize, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/Chart.ts b/src/vendors/oasisscan-v2/models/Chart.ts new file mode 100644 index 0000000000..3d29b89362 --- /dev/null +++ b/src/vendors/oasisscan-v2/models/Chart.ts @@ -0,0 +1,65 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface Chart + */ +export interface Chart { + /** + * + * @type {string} + * @memberof Chart + */ + key: string; + /** + * + * @type {string} + * @memberof Chart + */ + value: string; +} + +export function ChartFromJSON(json: any): Chart { + return ChartFromJSONTyped(json, false); +} + +export function ChartFromJSONTyped(json: any, ignoreDiscriminator: boolean): Chart { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'key': json['key'], + 'value': json['value'], + }; +} + +export function ChartToJSON(value?: Chart | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'key': value.key, + 'value': value.value, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/DelegatorsInfo.ts b/src/vendors/oasisscan-v2/models/DelegatorsInfo.ts new file mode 100644 index 0000000000..5df716a1fa --- /dev/null +++ b/src/vendors/oasisscan-v2/models/DelegatorsInfo.ts @@ -0,0 +1,89 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface DelegatorsInfo + */ +export interface DelegatorsInfo { + /** + * + * @type {string} + * @memberof DelegatorsInfo + */ + address: string; + /** + * + * @type {string} + * @memberof DelegatorsInfo + */ + amount: string; + /** + * + * @type {string} + * @memberof DelegatorsInfo + */ + shares: string; + /** + * + * @type {number} + * @memberof DelegatorsInfo + */ + percent: number; + /** + * + * @type {boolean} + * @memberof DelegatorsInfo + */ + self: boolean; +} + +export function DelegatorsInfoFromJSON(json: any): DelegatorsInfo { + return DelegatorsInfoFromJSONTyped(json, false); +} + +export function DelegatorsInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean): DelegatorsInfo { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'address': json['address'], + 'amount': json['amount'], + 'shares': json['shares'], + 'percent': json['percent'], + 'self': json['self'], + }; +} + +export function DelegatorsInfoToJSON(value?: DelegatorsInfo | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'address': value.address, + 'amount': value.amount, + 'shares': value.shares, + 'percent': value.percent, + 'self': value.self, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/DelegatorsRequest.ts b/src/vendors/oasisscan-v2/models/DelegatorsRequest.ts new file mode 100644 index 0000000000..a4f6dcae32 --- /dev/null +++ b/src/vendors/oasisscan-v2/models/DelegatorsRequest.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface DelegatorsRequest + */ +export interface DelegatorsRequest { + /** + * + * @type {string} + * @memberof DelegatorsRequest + */ + address: string; + /** + * + * @type {number} + * @memberof DelegatorsRequest + */ + page: number; + /** + * + * @type {number} + * @memberof DelegatorsRequest + */ + size: number; +} + +export function DelegatorsRequestFromJSON(json: any): DelegatorsRequest { + return DelegatorsRequestFromJSONTyped(json, false); +} + +export function DelegatorsRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): DelegatorsRequest { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'address': json['address'], + 'page': json['page'], + 'size': json['size'], + }; +} + +export function DelegatorsRequestToJSON(value?: DelegatorsRequest | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'address': value.address, + 'page': value.page, + 'size': value.size, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/DelegatorsResponse.ts b/src/vendors/oasisscan-v2/models/DelegatorsResponse.ts new file mode 100644 index 0000000000..92e65ce9f0 --- /dev/null +++ b/src/vendors/oasisscan-v2/models/DelegatorsResponse.ts @@ -0,0 +1,96 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import { + DelegatorsInfo, + DelegatorsInfoFromJSON, + DelegatorsInfoFromJSONTyped, + DelegatorsInfoToJSON, +} from './'; + +/** + * + * @export + * @interface DelegatorsResponse + */ +export interface DelegatorsResponse { + /** + * + * @type {Array} + * @memberof DelegatorsResponse + */ + list: Array; + /** + * + * @type {number} + * @memberof DelegatorsResponse + */ + page?: number; + /** + * + * @type {number} + * @memberof DelegatorsResponse + */ + size?: number; + /** + * + * @type {number} + * @memberof DelegatorsResponse + */ + maxPage?: number; + /** + * + * @type {number} + * @memberof DelegatorsResponse + */ + totalSize?: number; +} + +export function DelegatorsResponseFromJSON(json: any): DelegatorsResponse { + return DelegatorsResponseFromJSONTyped(json, false); +} + +export function DelegatorsResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): DelegatorsResponse { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'list': ((json['list'] as Array).map(DelegatorsInfoFromJSON)), + 'page': !exists(json, 'page') ? undefined : json['page'], + 'size': !exists(json, 'size') ? undefined : json['size'], + 'maxPage': !exists(json, 'maxPage') ? undefined : json['maxPage'], + 'totalSize': !exists(json, 'totalSize') ? undefined : json['totalSize'], + }; +} + +export function DelegatorsResponseToJSON(value?: DelegatorsResponse | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'list': ((value.list as Array).map(DelegatorsInfoToJSON)), + 'page': value.page, + 'size': value.size, + 'maxPage': value.maxPage, + 'totalSize': value.totalSize, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/EscrowStatus.ts b/src/vendors/oasisscan-v2/models/EscrowStatus.ts new file mode 100644 index 0000000000..b9c0d0cf1b --- /dev/null +++ b/src/vendors/oasisscan-v2/models/EscrowStatus.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface EscrowStatus + */ +export interface EscrowStatus { + /** + * + * @type {string} + * @memberof EscrowStatus + */ + self: string; + /** + * + * @type {string} + * @memberof EscrowStatus + */ + other: string; + /** + * + * @type {string} + * @memberof EscrowStatus + */ + total: string; +} + +export function EscrowStatusFromJSON(json: any): EscrowStatus { + return EscrowStatusFromJSONTyped(json, false); +} + +export function EscrowStatusFromJSONTyped(json: any, ignoreDiscriminator: boolean): EscrowStatus { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'self': json['self'], + 'other': json['other'], + 'total': json['total'], + }; +} + +export function EscrowStatusToJSON(value?: EscrowStatus | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'self': value.self, + 'other': value.other, + 'total': value.total, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/GovernanceProposalInfo.ts b/src/vendors/oasisscan-v2/models/GovernanceProposalInfo.ts new file mode 100644 index 0000000000..db69f4ca03 --- /dev/null +++ b/src/vendors/oasisscan-v2/models/GovernanceProposalInfo.ts @@ -0,0 +1,129 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface GovernanceProposalInfo + */ +export interface GovernanceProposalInfo { + /** + * + * @type {number} + * @memberof GovernanceProposalInfo + */ + id: number; + /** + * + * @type {string} + * @memberof GovernanceProposalInfo + */ + title: string; + /** + * + * @type {string} + * @memberof GovernanceProposalInfo + */ + type: string; + /** + * + * @type {string} + * @memberof GovernanceProposalInfo + */ + submitter: string; + /** + * + * @type {string} + * @memberof GovernanceProposalInfo + */ + state: string; + /** + * + * @type {string} + * @memberof GovernanceProposalInfo + */ + deposit: string; + /** + * + * @type {number} + * @memberof GovernanceProposalInfo + */ + created_at: number; + /** + * + * @type {number} + * @memberof GovernanceProposalInfo + */ + closed_at: number; + /** + * + * @type {number} + * @memberof GovernanceProposalInfo + */ + created_time: number; + /** + * + * @type {number} + * @memberof GovernanceProposalInfo + */ + closed_time: number; +} + +export function GovernanceProposalInfoFromJSON(json: any): GovernanceProposalInfo { + return GovernanceProposalInfoFromJSONTyped(json, false); +} + +export function GovernanceProposalInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean): GovernanceProposalInfo { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'id': json['id'], + 'title': json['title'], + 'type': json['type'], + 'submitter': json['submitter'], + 'state': json['state'], + 'deposit': json['deposit'], + 'created_at': json['created_at'], + 'closed_at': json['closed_at'], + 'created_time': json['created_time'], + 'closed_time': json['closed_time'], + }; +} + +export function GovernanceProposalInfoToJSON(value?: GovernanceProposalInfo | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'id': value.id, + 'title': value.title, + 'type': value.type, + 'submitter': value.submitter, + 'state': value.state, + 'deposit': value.deposit, + 'created_at': value.created_at, + 'closed_at': value.closed_at, + 'created_time': value.created_time, + 'closed_time': value.closed_time, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/GovernanceProposalListResponse.ts b/src/vendors/oasisscan-v2/models/GovernanceProposalListResponse.ts new file mode 100644 index 0000000000..3d8ee50ac2 --- /dev/null +++ b/src/vendors/oasisscan-v2/models/GovernanceProposalListResponse.ts @@ -0,0 +1,64 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import { + GovernanceProposalInfo, + GovernanceProposalInfoFromJSON, + GovernanceProposalInfoFromJSONTyped, + GovernanceProposalInfoToJSON, +} from './'; + +/** + * + * @export + * @interface GovernanceProposalListResponse + */ +export interface GovernanceProposalListResponse { + /** + * + * @type {Array} + * @memberof GovernanceProposalListResponse + */ + list: Array; +} + +export function GovernanceProposalListResponseFromJSON(json: any): GovernanceProposalListResponse { + return GovernanceProposalListResponseFromJSONTyped(json, false); +} + +export function GovernanceProposalListResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): GovernanceProposalListResponse { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'list': ((json['list'] as Array).map(GovernanceProposalInfoFromJSON)), + }; +} + +export function GovernanceProposalListResponseToJSON(value?: GovernanceProposalListResponse | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'list': ((value.list as Array).map(GovernanceProposalInfoToJSON)), + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/GovernanceProposalWithVotesRequest.ts b/src/vendors/oasisscan-v2/models/GovernanceProposalWithVotesRequest.ts new file mode 100644 index 0000000000..429a376058 --- /dev/null +++ b/src/vendors/oasisscan-v2/models/GovernanceProposalWithVotesRequest.ts @@ -0,0 +1,57 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface GovernanceProposalWithVotesRequest + */ +export interface GovernanceProposalWithVotesRequest { + /** + * + * @type {number} + * @memberof GovernanceProposalWithVotesRequest + */ + id: number; +} + +export function GovernanceProposalWithVotesRequestFromJSON(json: any): GovernanceProposalWithVotesRequest { + return GovernanceProposalWithVotesRequestFromJSONTyped(json, false); +} + +export function GovernanceProposalWithVotesRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): GovernanceProposalWithVotesRequest { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'id': json['id'], + }; +} + +export function GovernanceProposalWithVotesRequestToJSON(value?: GovernanceProposalWithVotesRequest | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'id': value.id, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/GovernanceProposalWithVotesResponse.ts b/src/vendors/oasisscan-v2/models/GovernanceProposalWithVotesResponse.ts new file mode 100644 index 0000000000..5799b053fc --- /dev/null +++ b/src/vendors/oasisscan-v2/models/GovernanceProposalWithVotesResponse.ts @@ -0,0 +1,76 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import { + ProposalOption, + ProposalOptionFromJSON, + ProposalOptionFromJSONTyped, + ProposalOptionToJSON, + ProposalVote, + ProposalVoteFromJSON, + ProposalVoteFromJSONTyped, + ProposalVoteToJSON, +} from './'; + +/** + * + * @export + * @interface GovernanceProposalWithVotesResponse + */ +export interface GovernanceProposalWithVotesResponse { + /** + * + * @type {Array} + * @memberof GovernanceProposalWithVotesResponse + */ + options: Array; + /** + * + * @type {Array} + * @memberof GovernanceProposalWithVotesResponse + */ + votes: Array; +} + +export function GovernanceProposalWithVotesResponseFromJSON(json: any): GovernanceProposalWithVotesResponse { + return GovernanceProposalWithVotesResponseFromJSONTyped(json, false); +} + +export function GovernanceProposalWithVotesResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): GovernanceProposalWithVotesResponse { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'options': ((json['options'] as Array).map(ProposalOptionFromJSON)), + 'votes': ((json['votes'] as Array).map(ProposalVoteFromJSON)), + }; +} + +export function GovernanceProposalWithVotesResponseToJSON(value?: GovernanceProposalWithVotesResponse | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'options': ((value.options as Array).map(ProposalOptionToJSON)), + 'votes': ((value.votes as Array).map(ProposalVoteToJSON)), + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/GovernanceVotesRequest.ts b/src/vendors/oasisscan-v2/models/GovernanceVotesRequest.ts new file mode 100644 index 0000000000..0cdf032901 --- /dev/null +++ b/src/vendors/oasisscan-v2/models/GovernanceVotesRequest.ts @@ -0,0 +1,81 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface GovernanceVotesRequest + */ +export interface GovernanceVotesRequest { + /** + * + * @type {number} + * @memberof GovernanceVotesRequest + */ + proposalId?: number; + /** + * + * @type {string} + * @memberof GovernanceVotesRequest + */ + validator?: string; + /** + * + * @type {number} + * @memberof GovernanceVotesRequest + */ + page: number; + /** + * + * @type {number} + * @memberof GovernanceVotesRequest + */ + size: number; +} + +export function GovernanceVotesRequestFromJSON(json: any): GovernanceVotesRequest { + return GovernanceVotesRequestFromJSONTyped(json, false); +} + +export function GovernanceVotesRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): GovernanceVotesRequest { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'proposalId': !exists(json, 'proposalId') ? undefined : json['proposalId'], + 'validator': !exists(json, 'validator') ? undefined : json['validator'], + 'page': json['page'], + 'size': json['size'], + }; +} + +export function GovernanceVotesRequestToJSON(value?: GovernanceVotesRequest | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'proposalId': value.proposalId, + 'validator': value.validator, + 'page': value.page, + 'size': value.size, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/GovernanceVotesResponse.ts b/src/vendors/oasisscan-v2/models/GovernanceVotesResponse.ts new file mode 100644 index 0000000000..9e16f55278 --- /dev/null +++ b/src/vendors/oasisscan-v2/models/GovernanceVotesResponse.ts @@ -0,0 +1,96 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import { + ProposalVote, + ProposalVoteFromJSON, + ProposalVoteFromJSONTyped, + ProposalVoteToJSON, +} from './'; + +/** + * + * @export + * @interface GovernanceVotesResponse + */ +export interface GovernanceVotesResponse { + /** + * + * @type {Array} + * @memberof GovernanceVotesResponse + */ + list: Array; + /** + * + * @type {number} + * @memberof GovernanceVotesResponse + */ + page?: number; + /** + * + * @type {number} + * @memberof GovernanceVotesResponse + */ + size?: number; + /** + * + * @type {number} + * @memberof GovernanceVotesResponse + */ + maxPage?: number; + /** + * + * @type {number} + * @memberof GovernanceVotesResponse + */ + totalSize?: number; +} + +export function GovernanceVotesResponseFromJSON(json: any): GovernanceVotesResponse { + return GovernanceVotesResponseFromJSONTyped(json, false); +} + +export function GovernanceVotesResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): GovernanceVotesResponse { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'list': ((json['list'] as Array).map(ProposalVoteFromJSON)), + 'page': !exists(json, 'page') ? undefined : json['page'], + 'size': !exists(json, 'size') ? undefined : json['size'], + 'maxPage': !exists(json, 'maxPage') ? undefined : json['maxPage'], + 'totalSize': !exists(json, 'totalSize') ? undefined : json['totalSize'], + }; +} + +export function GovernanceVotesResponseToJSON(value?: GovernanceVotesResponse | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'list': ((value.list as Array).map(ProposalVoteToJSON)), + 'page': value.page, + 'size': value.size, + 'maxPage': value.maxPage, + 'totalSize': value.totalSize, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/MarketChartResponse.ts b/src/vendors/oasisscan-v2/models/MarketChartResponse.ts new file mode 100644 index 0000000000..340dfb6c56 --- /dev/null +++ b/src/vendors/oasisscan-v2/models/MarketChartResponse.ts @@ -0,0 +1,80 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import { + Chart, + ChartFromJSON, + ChartFromJSONTyped, + ChartToJSON, +} from './'; + +/** + * + * @export + * @interface MarketChartResponse + */ +export interface MarketChartResponse { + /** + * + * @type {Array} + * @memberof MarketChartResponse + */ + price: Array; + /** + * + * @type {Array} + * @memberof MarketChartResponse + */ + marketCap: Array; + /** + * + * @type {Array} + * @memberof MarketChartResponse + */ + volume: Array; +} + +export function MarketChartResponseFromJSON(json: any): MarketChartResponse { + return MarketChartResponseFromJSONTyped(json, false); +} + +export function MarketChartResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): MarketChartResponse { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'price': ((json['price'] as Array).map(ChartFromJSON)), + 'marketCap': ((json['marketCap'] as Array).map(ChartFromJSON)), + 'volume': ((json['volume'] as Array).map(ChartFromJSON)), + }; +} + +export function MarketChartResponseToJSON(value?: MarketChartResponse | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'price': ((value.price as Array).map(ChartToJSON)), + 'marketCap': ((value.marketCap as Array).map(ChartToJSON)), + 'volume': ((value.volume as Array).map(ChartToJSON)), + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/MarketInfoResponse.ts b/src/vendors/oasisscan-v2/models/MarketInfoResponse.ts new file mode 100644 index 0000000000..97707d4943 --- /dev/null +++ b/src/vendors/oasisscan-v2/models/MarketInfoResponse.ts @@ -0,0 +1,105 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface MarketInfoResponse + */ +export interface MarketInfoResponse { + /** + * + * @type {number} + * @memberof MarketInfoResponse + */ + price: number; + /** + * + * @type {number} + * @memberof MarketInfoResponse + */ + priceChangePct24h: number; + /** + * + * @type {number} + * @memberof MarketInfoResponse + */ + rank: number; + /** + * + * @type {number} + * @memberof MarketInfoResponse + */ + marketCap: number; + /** + * + * @type {number} + * @memberof MarketInfoResponse + */ + marketCapChangePct24h: number; + /** + * + * @type {number} + * @memberof MarketInfoResponse + */ + volume: number; + /** + * + * @type {number} + * @memberof MarketInfoResponse + */ + volumeChangePct24h: number; +} + +export function MarketInfoResponseFromJSON(json: any): MarketInfoResponse { + return MarketInfoResponseFromJSONTyped(json, false); +} + +export function MarketInfoResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): MarketInfoResponse { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'price': json['price'], + 'priceChangePct24h': json['priceChangePct24h'], + 'rank': json['rank'], + 'marketCap': json['marketCap'], + 'marketCapChangePct24h': json['marketCapChangePct24h'], + 'volume': json['volume'], + 'volumeChangePct24h': json['volumeChangePct24h'], + }; +} + +export function MarketInfoResponseToJSON(value?: MarketInfoResponse | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'price': value.price, + 'priceChangePct24h': value.priceChangePct24h, + 'rank': value.rank, + 'marketCap': value.marketCap, + 'marketCapChangePct24h': value.marketCapChangePct24h, + 'volume': value.volume, + 'volumeChangePct24h': value.volumeChangePct24h, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/NetworkStatusResponse.ts b/src/vendors/oasisscan-v2/models/NetworkStatusResponse.ts new file mode 100644 index 0000000000..a530de7943 --- /dev/null +++ b/src/vendors/oasisscan-v2/models/NetworkStatusResponse.ts @@ -0,0 +1,97 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface NetworkStatusResponse + */ +export interface NetworkStatusResponse { + /** + * + * @type {number} + * @memberof NetworkStatusResponse + */ + curHeight: number; + /** + * + * @type {number} + * @memberof NetworkStatusResponse + */ + curEpoch: number; + /** + * + * @type {number} + * @memberof NetworkStatusResponse + */ + totalTxs: number; + /** + * + * @type {string} + * @memberof NetworkStatusResponse + */ + totalEscrow: string; + /** + * + * @type {number} + * @memberof NetworkStatusResponse + */ + activeValidator: number; + /** + * + * @type {number} + * @memberof NetworkStatusResponse + */ + totalDelegator: number; +} + +export function NetworkStatusResponseFromJSON(json: any): NetworkStatusResponse { + return NetworkStatusResponseFromJSONTyped(json, false); +} + +export function NetworkStatusResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): NetworkStatusResponse { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'curHeight': json['curHeight'], + 'curEpoch': json['curEpoch'], + 'totalTxs': json['totalTxs'], + 'totalEscrow': json['totalEscrow'], + 'activeValidator': json['activeValidator'], + 'totalDelegator': json['totalDelegator'], + }; +} + +export function NetworkStatusResponseToJSON(value?: NetworkStatusResponse | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'curHeight': value.curHeight, + 'curEpoch': value.curEpoch, + 'totalTxs': value.totalTxs, + 'totalEscrow': value.totalEscrow, + 'activeValidator': value.activeValidator, + 'totalDelegator': value.totalDelegator, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/NetworkTrendResponse.ts b/src/vendors/oasisscan-v2/models/NetworkTrendResponse.ts new file mode 100644 index 0000000000..60ca7d8d65 --- /dev/null +++ b/src/vendors/oasisscan-v2/models/NetworkTrendResponse.ts @@ -0,0 +1,72 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import { + Chart, + ChartFromJSON, + ChartFromJSONTyped, + ChartToJSON, +} from './'; + +/** + * + * @export + * @interface NetworkTrendResponse + */ +export interface NetworkTrendResponse { + /** + * + * @type {Array} + * @memberof NetworkTrendResponse + */ + tx: Array; + /** + * + * @type {Array} + * @memberof NetworkTrendResponse + */ + escrow: Array; +} + +export function NetworkTrendResponseFromJSON(json: any): NetworkTrendResponse { + return NetworkTrendResponseFromJSONTyped(json, false); +} + +export function NetworkTrendResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): NetworkTrendResponse { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'tx': ((json['tx'] as Array).map(ChartFromJSON)), + 'escrow': ((json['escrow'] as Array).map(ChartFromJSON)), + }; +} + +export function NetworkTrendResponseToJSON(value?: NetworkTrendResponse | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'tx': ((value.tx as Array).map(ChartToJSON)), + 'escrow': ((value.escrow as Array).map(ChartToJSON)), + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/Page.ts b/src/vendors/oasisscan-v2/models/Page.ts new file mode 100644 index 0000000000..2898bcab0a --- /dev/null +++ b/src/vendors/oasisscan-v2/models/Page.ts @@ -0,0 +1,81 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface Page + */ +export interface Page { + /** + * + * @type {number} + * @memberof Page + */ + page: number; + /** + * + * @type {number} + * @memberof Page + */ + size: number; + /** + * + * @type {number} + * @memberof Page + */ + maxPage: number; + /** + * + * @type {number} + * @memberof Page + */ + totalSize: number; +} + +export function PageFromJSON(json: any): Page { + return PageFromJSONTyped(json, false); +} + +export function PageFromJSONTyped(json: any, ignoreDiscriminator: boolean): Page { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'page': json['page'], + 'size': json['size'], + 'maxPage': json['maxPage'], + 'totalSize': json['totalSize'], + }; +} + +export function PageToJSON(value?: Page | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'page': value.page, + 'size': value.size, + 'maxPage': value.maxPage, + 'totalSize': value.totalSize, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/ProposalOption.ts b/src/vendors/oasisscan-v2/models/ProposalOption.ts new file mode 100644 index 0000000000..ee72301dd7 --- /dev/null +++ b/src/vendors/oasisscan-v2/models/ProposalOption.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface ProposalOption + */ +export interface ProposalOption { + /** + * + * @type {string} + * @memberof ProposalOption + */ + name: string; + /** + * + * @type {string} + * @memberof ProposalOption + */ + amount: string; + /** + * + * @type {number} + * @memberof ProposalOption + */ + percent: number; +} + +export function ProposalOptionFromJSON(json: any): ProposalOption { + return ProposalOptionFromJSONTyped(json, false); +} + +export function ProposalOptionFromJSONTyped(json: any, ignoreDiscriminator: boolean): ProposalOption { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'name': json['name'], + 'amount': json['amount'], + 'percent': json['percent'], + }; +} + +export function ProposalOptionToJSON(value?: ProposalOption | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'name': value.name, + 'amount': value.amount, + 'percent': value.percent, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/ProposalVote.ts b/src/vendors/oasisscan-v2/models/ProposalVote.ts new file mode 100644 index 0000000000..547a814ab9 --- /dev/null +++ b/src/vendors/oasisscan-v2/models/ProposalVote.ts @@ -0,0 +1,113 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface ProposalVote + */ +export interface ProposalVote { + /** + * + * @type {number} + * @memberof ProposalVote + */ + proposalId: number; + /** + * + * @type {string} + * @memberof ProposalVote + */ + title: string; + /** + * + * @type {string} + * @memberof ProposalVote + */ + name: string; + /** + * + * @type {string} + * @memberof ProposalVote + */ + icon: string; + /** + * + * @type {string} + * @memberof ProposalVote + */ + address: string; + /** + * + * @type {string} + * @memberof ProposalVote + */ + vote: string; + /** + * + * @type {string} + * @memberof ProposalVote + */ + amount: string; + /** + * + * @type {number} + * @memberof ProposalVote + */ + percent: number; +} + +export function ProposalVoteFromJSON(json: any): ProposalVote { + return ProposalVoteFromJSONTyped(json, false); +} + +export function ProposalVoteFromJSONTyped(json: any, ignoreDiscriminator: boolean): ProposalVote { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'proposalId': json['proposalId'], + 'title': json['title'], + 'name': json['name'], + 'icon': json['icon'], + 'address': json['address'], + 'vote': json['vote'], + 'amount': json['amount'], + 'percent': json['percent'], + }; +} + +export function ProposalVoteToJSON(value?: ProposalVote | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'proposalId': value.proposalId, + 'title': value.title, + 'name': value.name, + 'icon': value.icon, + 'address': value.address, + 'vote': value.vote, + 'amount': value.amount, + 'percent': value.percent, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/Rate.ts b/src/vendors/oasisscan-v2/models/Rate.ts new file mode 100644 index 0000000000..82a40c7b5a --- /dev/null +++ b/src/vendors/oasisscan-v2/models/Rate.ts @@ -0,0 +1,65 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface Rate + */ +export interface Rate { + /** + * + * @type {number} + * @memberof Rate + */ + start: number; + /** + * + * @type {number} + * @memberof Rate + */ + rate: number; +} + +export function RateFromJSON(json: any): Rate { + return RateFromJSONTyped(json, false); +} + +export function RateFromJSONTyped(json: any, ignoreDiscriminator: boolean): Rate { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'start': json['start'], + 'rate': json['rate'], + }; +} + +export function RateToJSON(value?: Rate | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'start': value.start, + 'rate': value.rate, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/RuntimeListInfo.ts b/src/vendors/oasisscan-v2/models/RuntimeListInfo.ts new file mode 100644 index 0000000000..a187d77a20 --- /dev/null +++ b/src/vendors/oasisscan-v2/models/RuntimeListInfo.ts @@ -0,0 +1,65 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface RuntimeListInfo + */ +export interface RuntimeListInfo { + /** + * + * @type {string} + * @memberof RuntimeListInfo + */ + runtimeId: string; + /** + * + * @type {string} + * @memberof RuntimeListInfo + */ + name: string; +} + +export function RuntimeListInfoFromJSON(json: any): RuntimeListInfo { + return RuntimeListInfoFromJSONTyped(json, false); +} + +export function RuntimeListInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean): RuntimeListInfo { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'runtimeId': json['runtimeId'], + 'name': json['name'], + }; +} + +export function RuntimeListInfoToJSON(value?: RuntimeListInfo | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'runtimeId': value.runtimeId, + 'name': value.name, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/RuntimeListResponse.ts b/src/vendors/oasisscan-v2/models/RuntimeListResponse.ts new file mode 100644 index 0000000000..b46ed10e24 --- /dev/null +++ b/src/vendors/oasisscan-v2/models/RuntimeListResponse.ts @@ -0,0 +1,64 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import { + RuntimeListInfo, + RuntimeListInfoFromJSON, + RuntimeListInfoFromJSONTyped, + RuntimeListInfoToJSON, +} from './'; + +/** + * + * @export + * @interface RuntimeListResponse + */ +export interface RuntimeListResponse { + /** + * + * @type {Array} + * @memberof RuntimeListResponse + */ + list: Array; +} + +export function RuntimeListResponseFromJSON(json: any): RuntimeListResponse { + return RuntimeListResponseFromJSONTyped(json, false); +} + +export function RuntimeListResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): RuntimeListResponse { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'list': ((json['list'] as Array).map(RuntimeListInfoFromJSON)), + }; +} + +export function RuntimeListResponseToJSON(value?: RuntimeListResponse | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'list': ((value.list as Array).map(RuntimeListInfoToJSON)), + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/RuntimeRoundInfo.ts b/src/vendors/oasisscan-v2/models/RuntimeRoundInfo.ts new file mode 100644 index 0000000000..0569d9f2b4 --- /dev/null +++ b/src/vendors/oasisscan-v2/models/RuntimeRoundInfo.ts @@ -0,0 +1,137 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface RuntimeRoundInfo + */ +export interface RuntimeRoundInfo { + /** + * + * @type {number} + * @memberof RuntimeRoundInfo + */ + version: number; + /** + * + * @type {string} + * @memberof RuntimeRoundInfo + */ + runtimeId: string; + /** + * + * @type {string} + * @memberof RuntimeRoundInfo + */ + runtimeName: string; + /** + * + * @type {number} + * @memberof RuntimeRoundInfo + */ + round: number; + /** + * + * @type {number} + * @memberof RuntimeRoundInfo + */ + timestamp: number; + /** + * + * @type {number} + * @memberof RuntimeRoundInfo + */ + header_type: number; + /** + * + * @type {string} + * @memberof RuntimeRoundInfo + */ + previous_hash: string; + /** + * + * @type {string} + * @memberof RuntimeRoundInfo + */ + io_root: string; + /** + * + * @type {string} + * @memberof RuntimeRoundInfo + */ + state_root: string; + /** + * + * @type {string} + * @memberof RuntimeRoundInfo + */ + messages_hash: string; + /** + * + * @type {boolean} + * @memberof RuntimeRoundInfo + */ + next: boolean; +} + +export function RuntimeRoundInfoFromJSON(json: any): RuntimeRoundInfo { + return RuntimeRoundInfoFromJSONTyped(json, false); +} + +export function RuntimeRoundInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean): RuntimeRoundInfo { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'version': json['version'], + 'runtimeId': json['runtimeId'], + 'runtimeName': json['runtimeName'], + 'round': json['round'], + 'timestamp': json['timestamp'], + 'header_type': json['header_type'], + 'previous_hash': json['previous_hash'], + 'io_root': json['io_root'], + 'state_root': json['state_root'], + 'messages_hash': json['messages_hash'], + 'next': json['next'], + }; +} + +export function RuntimeRoundInfoToJSON(value?: RuntimeRoundInfo | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'version': value.version, + 'runtimeId': value.runtimeId, + 'runtimeName': value.runtimeName, + 'round': value.round, + 'timestamp': value.timestamp, + 'header_type': value.header_type, + 'previous_hash': value.previous_hash, + 'io_root': value.io_root, + 'state_root': value.state_root, + 'messages_hash': value.messages_hash, + 'next': value.next, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/RuntimeRoundInfoRequest.ts b/src/vendors/oasisscan-v2/models/RuntimeRoundInfoRequest.ts new file mode 100644 index 0000000000..6eea0a08cf --- /dev/null +++ b/src/vendors/oasisscan-v2/models/RuntimeRoundInfoRequest.ts @@ -0,0 +1,65 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface RuntimeRoundInfoRequest + */ +export interface RuntimeRoundInfoRequest { + /** + * + * @type {string} + * @memberof RuntimeRoundInfoRequest + */ + id: string; + /** + * + * @type {number} + * @memberof RuntimeRoundInfoRequest + */ + round: number; +} + +export function RuntimeRoundInfoRequestFromJSON(json: any): RuntimeRoundInfoRequest { + return RuntimeRoundInfoRequestFromJSONTyped(json, false); +} + +export function RuntimeRoundInfoRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): RuntimeRoundInfoRequest { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'id': json['id'], + 'round': json['round'], + }; +} + +export function RuntimeRoundInfoRequestToJSON(value?: RuntimeRoundInfoRequest | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'id': value.id, + 'round': value.round, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/RuntimeRoundInfoResponse.ts b/src/vendors/oasisscan-v2/models/RuntimeRoundInfoResponse.ts new file mode 100644 index 0000000000..38b766adef --- /dev/null +++ b/src/vendors/oasisscan-v2/models/RuntimeRoundInfoResponse.ts @@ -0,0 +1,137 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface RuntimeRoundInfoResponse + */ +export interface RuntimeRoundInfoResponse { + /** + * + * @type {number} + * @memberof RuntimeRoundInfoResponse + */ + version?: number; + /** + * + * @type {string} + * @memberof RuntimeRoundInfoResponse + */ + runtimeId?: string; + /** + * + * @type {string} + * @memberof RuntimeRoundInfoResponse + */ + runtimeName?: string; + /** + * + * @type {number} + * @memberof RuntimeRoundInfoResponse + */ + round?: number; + /** + * + * @type {number} + * @memberof RuntimeRoundInfoResponse + */ + timestamp?: number; + /** + * + * @type {number} + * @memberof RuntimeRoundInfoResponse + */ + header_type?: number; + /** + * + * @type {string} + * @memberof RuntimeRoundInfoResponse + */ + previous_hash?: string; + /** + * + * @type {string} + * @memberof RuntimeRoundInfoResponse + */ + io_root?: string; + /** + * + * @type {string} + * @memberof RuntimeRoundInfoResponse + */ + state_root?: string; + /** + * + * @type {string} + * @memberof RuntimeRoundInfoResponse + */ + messages_hash?: string; + /** + * + * @type {boolean} + * @memberof RuntimeRoundInfoResponse + */ + next?: boolean; +} + +export function RuntimeRoundInfoResponseFromJSON(json: any): RuntimeRoundInfoResponse { + return RuntimeRoundInfoResponseFromJSONTyped(json, false); +} + +export function RuntimeRoundInfoResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): RuntimeRoundInfoResponse { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'version': !exists(json, 'version') ? undefined : json['version'], + 'runtimeId': !exists(json, 'runtimeId') ? undefined : json['runtimeId'], + 'runtimeName': !exists(json, 'runtimeName') ? undefined : json['runtimeName'], + 'round': !exists(json, 'round') ? undefined : json['round'], + 'timestamp': !exists(json, 'timestamp') ? undefined : json['timestamp'], + 'header_type': !exists(json, 'header_type') ? undefined : json['header_type'], + 'previous_hash': !exists(json, 'previous_hash') ? undefined : json['previous_hash'], + 'io_root': !exists(json, 'io_root') ? undefined : json['io_root'], + 'state_root': !exists(json, 'state_root') ? undefined : json['state_root'], + 'messages_hash': !exists(json, 'messages_hash') ? undefined : json['messages_hash'], + 'next': !exists(json, 'next') ? undefined : json['next'], + }; +} + +export function RuntimeRoundInfoResponseToJSON(value?: RuntimeRoundInfoResponse | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'version': value.version, + 'runtimeId': value.runtimeId, + 'runtimeName': value.runtimeName, + 'round': value.round, + 'timestamp': value.timestamp, + 'header_type': value.header_type, + 'previous_hash': value.previous_hash, + 'io_root': value.io_root, + 'state_root': value.state_root, + 'messages_hash': value.messages_hash, + 'next': value.next, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/RuntimeRoundListRequest.ts b/src/vendors/oasisscan-v2/models/RuntimeRoundListRequest.ts new file mode 100644 index 0000000000..14f4ba7795 --- /dev/null +++ b/src/vendors/oasisscan-v2/models/RuntimeRoundListRequest.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface RuntimeRoundListRequest + */ +export interface RuntimeRoundListRequest { + /** + * + * @type {string} + * @memberof RuntimeRoundListRequest + */ + id: string; + /** + * + * @type {number} + * @memberof RuntimeRoundListRequest + */ + page: number; + /** + * + * @type {number} + * @memberof RuntimeRoundListRequest + */ + size: number; +} + +export function RuntimeRoundListRequestFromJSON(json: any): RuntimeRoundListRequest { + return RuntimeRoundListRequestFromJSONTyped(json, false); +} + +export function RuntimeRoundListRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): RuntimeRoundListRequest { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'id': json['id'], + 'page': json['page'], + 'size': json['size'], + }; +} + +export function RuntimeRoundListRequestToJSON(value?: RuntimeRoundListRequest | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'id': value.id, + 'page': value.page, + 'size': value.size, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/RuntimeRoundListResponse.ts b/src/vendors/oasisscan-v2/models/RuntimeRoundListResponse.ts new file mode 100644 index 0000000000..5a91653f86 --- /dev/null +++ b/src/vendors/oasisscan-v2/models/RuntimeRoundListResponse.ts @@ -0,0 +1,96 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import { + RuntimeRoundInfo, + RuntimeRoundInfoFromJSON, + RuntimeRoundInfoFromJSONTyped, + RuntimeRoundInfoToJSON, +} from './'; + +/** + * + * @export + * @interface RuntimeRoundListResponse + */ +export interface RuntimeRoundListResponse { + /** + * + * @type {Array} + * @memberof RuntimeRoundListResponse + */ + list: Array; + /** + * + * @type {number} + * @memberof RuntimeRoundListResponse + */ + page?: number; + /** + * + * @type {number} + * @memberof RuntimeRoundListResponse + */ + size?: number; + /** + * + * @type {number} + * @memberof RuntimeRoundListResponse + */ + maxPage?: number; + /** + * + * @type {number} + * @memberof RuntimeRoundListResponse + */ + totalSize?: number; +} + +export function RuntimeRoundListResponseFromJSON(json: any): RuntimeRoundListResponse { + return RuntimeRoundListResponseFromJSONTyped(json, false); +} + +export function RuntimeRoundListResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): RuntimeRoundListResponse { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'list': ((json['list'] as Array).map(RuntimeRoundInfoFromJSON)), + 'page': !exists(json, 'page') ? undefined : json['page'], + 'size': !exists(json, 'size') ? undefined : json['size'], + 'maxPage': !exists(json, 'maxPage') ? undefined : json['maxPage'], + 'totalSize': !exists(json, 'totalSize') ? undefined : json['totalSize'], + }; +} + +export function RuntimeRoundListResponseToJSON(value?: RuntimeRoundListResponse | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'list': ((value.list as Array).map(RuntimeRoundInfoToJSON)), + 'page': value.page, + 'size': value.size, + 'maxPage': value.maxPage, + 'totalSize': value.totalSize, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/RuntimeStatsInfo.ts b/src/vendors/oasisscan-v2/models/RuntimeStatsInfo.ts new file mode 100644 index 0000000000..3481203d6e --- /dev/null +++ b/src/vendors/oasisscan-v2/models/RuntimeStatsInfo.ts @@ -0,0 +1,112 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import { + RuntimeStatsItem, + RuntimeStatsItemFromJSON, + RuntimeStatsItemFromJSONTyped, + RuntimeStatsItemToJSON, +} from './'; + +/** + * + * @export + * @interface RuntimeStatsInfo + */ +export interface RuntimeStatsInfo { + /** + * + * @type {string} + * @memberof RuntimeStatsInfo + */ + entityId: string; + /** + * + * @type {string} + * @memberof RuntimeStatsInfo + */ + name: string; + /** + * + * @type {string} + * @memberof RuntimeStatsInfo + */ + address: string; + /** + * + * @type {boolean} + * @memberof RuntimeStatsInfo + */ + validator: boolean; + /** + * + * @type {string} + * @memberof RuntimeStatsInfo + */ + icon: string; + /** + * + * @type {boolean} + * @memberof RuntimeStatsInfo + */ + status: boolean; + /** + * + * @type {RuntimeStatsItem} + * @memberof RuntimeStatsInfo + */ + stats: RuntimeStatsItem; +} + +export function RuntimeStatsInfoFromJSON(json: any): RuntimeStatsInfo { + return RuntimeStatsInfoFromJSONTyped(json, false); +} + +export function RuntimeStatsInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean): RuntimeStatsInfo { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'entityId': json['entityId'], + 'name': json['name'], + 'address': json['address'], + 'validator': json['validator'], + 'icon': json['icon'], + 'status': json['status'], + 'stats': RuntimeStatsItemFromJSON(json['stats']), + }; +} + +export function RuntimeStatsInfoToJSON(value?: RuntimeStatsInfo | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'entityId': value.entityId, + 'name': value.name, + 'address': value.address, + 'validator': value.validator, + 'icon': value.icon, + 'status': value.status, + 'stats': RuntimeStatsItemToJSON(value.stats), + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/RuntimeStatsItem.ts b/src/vendors/oasisscan-v2/models/RuntimeStatsItem.ts new file mode 100644 index 0000000000..2c92756a5a --- /dev/null +++ b/src/vendors/oasisscan-v2/models/RuntimeStatsItem.ts @@ -0,0 +1,81 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface RuntimeStatsItem + */ +export interface RuntimeStatsItem { + /** + * + * @type {number} + * @memberof RuntimeStatsItem + */ + elected: number; + /** + * + * @type {number} + * @memberof RuntimeStatsItem + */ + primary: number; + /** + * + * @type {number} + * @memberof RuntimeStatsItem + */ + backup: number; + /** + * + * @type {number} + * @memberof RuntimeStatsItem + */ + proposer: number; +} + +export function RuntimeStatsItemFromJSON(json: any): RuntimeStatsItem { + return RuntimeStatsItemFromJSONTyped(json, false); +} + +export function RuntimeStatsItemFromJSONTyped(json: any, ignoreDiscriminator: boolean): RuntimeStatsItem { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'elected': json['elected'], + 'primary': json['primary'], + 'backup': json['backup'], + 'proposer': json['proposer'], + }; +} + +export function RuntimeStatsItemToJSON(value?: RuntimeStatsItem | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'elected': value.elected, + 'primary': value.primary, + 'backup': value.backup, + 'proposer': value.proposer, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/RuntimeStatsRequest.ts b/src/vendors/oasisscan-v2/models/RuntimeStatsRequest.ts new file mode 100644 index 0000000000..477810c1a7 --- /dev/null +++ b/src/vendors/oasisscan-v2/models/RuntimeStatsRequest.ts @@ -0,0 +1,57 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface RuntimeStatsRequest + */ +export interface RuntimeStatsRequest { + /** + * + * @type {string} + * @memberof RuntimeStatsRequest + */ + id: string; +} + +export function RuntimeStatsRequestFromJSON(json: any): RuntimeStatsRequest { + return RuntimeStatsRequestFromJSONTyped(json, false); +} + +export function RuntimeStatsRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): RuntimeStatsRequest { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'id': json['id'], + }; +} + +export function RuntimeStatsRequestToJSON(value?: RuntimeStatsRequest | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'id': value.id, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/RuntimeStatsResponse.ts b/src/vendors/oasisscan-v2/models/RuntimeStatsResponse.ts new file mode 100644 index 0000000000..8774752bec --- /dev/null +++ b/src/vendors/oasisscan-v2/models/RuntimeStatsResponse.ts @@ -0,0 +1,80 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import { + RuntimeStatsInfo, + RuntimeStatsInfoFromJSON, + RuntimeStatsInfoFromJSONTyped, + RuntimeStatsInfoToJSON, +} from './'; + +/** + * + * @export + * @interface RuntimeStatsResponse + */ +export interface RuntimeStatsResponse { + /** + * + * @type {number} + * @memberof RuntimeStatsResponse + */ + online: number; + /** + * + * @type {number} + * @memberof RuntimeStatsResponse + */ + offline: number; + /** + * + * @type {Array} + * @memberof RuntimeStatsResponse + */ + list: Array; +} + +export function RuntimeStatsResponseFromJSON(json: any): RuntimeStatsResponse { + return RuntimeStatsResponseFromJSONTyped(json, false); +} + +export function RuntimeStatsResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): RuntimeStatsResponse { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'online': json['online'], + 'offline': json['offline'], + 'list': ((json['list'] as Array).map(RuntimeStatsInfoFromJSON)), + }; +} + +export function RuntimeStatsResponseToJSON(value?: RuntimeStatsResponse | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'online': value.online, + 'offline': value.offline, + 'list': ((value.list as Array).map(RuntimeStatsInfoToJSON)), + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/RuntimeTransactionConsensusTx.ts b/src/vendors/oasisscan-v2/models/RuntimeTransactionConsensusTx.ts new file mode 100644 index 0000000000..e915c2f592 --- /dev/null +++ b/src/vendors/oasisscan-v2/models/RuntimeTransactionConsensusTx.ts @@ -0,0 +1,89 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface RuntimeTransactionConsensusTx + */ +export interface RuntimeTransactionConsensusTx { + /** + * + * @type {string} + * @memberof RuntimeTransactionConsensusTx + */ + method: string; + /** + * + * @type {string} + * @memberof RuntimeTransactionConsensusTx + */ + from: string; + /** + * + * @type {string} + * @memberof RuntimeTransactionConsensusTx + */ + to: string; + /** + * + * @type {string} + * @memberof RuntimeTransactionConsensusTx + */ + amount: string; + /** + * + * @type {number} + * @memberof RuntimeTransactionConsensusTx + */ + nonce: number; +} + +export function RuntimeTransactionConsensusTxFromJSON(json: any): RuntimeTransactionConsensusTx { + return RuntimeTransactionConsensusTxFromJSONTyped(json, false); +} + +export function RuntimeTransactionConsensusTxFromJSONTyped(json: any, ignoreDiscriminator: boolean): RuntimeTransactionConsensusTx { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'method': json['method'], + 'from': json['from'], + 'to': json['to'], + 'amount': json['amount'], + 'nonce': json['nonce'], + }; +} + +export function RuntimeTransactionConsensusTxToJSON(value?: RuntimeTransactionConsensusTx | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'method': value.method, + 'from': value.from, + 'to': value.to, + 'amount': value.amount, + 'nonce': value.nonce, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/RuntimeTransactionEventError.ts b/src/vendors/oasisscan-v2/models/RuntimeTransactionEventError.ts new file mode 100644 index 0000000000..0cc64dd5fc --- /dev/null +++ b/src/vendors/oasisscan-v2/models/RuntimeTransactionEventError.ts @@ -0,0 +1,65 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface RuntimeTransactionEventError + */ +export interface RuntimeTransactionEventError { + /** + * + * @type {number} + * @memberof RuntimeTransactionEventError + */ + code: number; + /** + * + * @type {string} + * @memberof RuntimeTransactionEventError + */ + module: string; +} + +export function RuntimeTransactionEventErrorFromJSON(json: any): RuntimeTransactionEventError { + return RuntimeTransactionEventErrorFromJSONTyped(json, false); +} + +export function RuntimeTransactionEventErrorFromJSONTyped(json: any, ignoreDiscriminator: boolean): RuntimeTransactionEventError { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'code': json['code'], + 'module': json['module'], + }; +} + +export function RuntimeTransactionEventErrorToJSON(value?: RuntimeTransactionEventError | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'code': value.code, + 'module': value.module, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/RuntimeTransactionEvmTx.ts b/src/vendors/oasisscan-v2/models/RuntimeTransactionEvmTx.ts new file mode 100644 index 0000000000..77a2945cf8 --- /dev/null +++ b/src/vendors/oasisscan-v2/models/RuntimeTransactionEvmTx.ts @@ -0,0 +1,113 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface RuntimeTransactionEvmTx + */ +export interface RuntimeTransactionEvmTx { + /** + * + * @type {string} + * @memberof RuntimeTransactionEvmTx + */ + hash: string; + /** + * + * @type {string} + * @memberof RuntimeTransactionEvmTx + */ + from: string; + /** + * + * @type {string} + * @memberof RuntimeTransactionEvmTx + */ + to: string; + /** + * + * @type {number} + * @memberof RuntimeTransactionEvmTx + */ + nonce: number; + /** + * + * @type {number} + * @memberof RuntimeTransactionEvmTx + */ + gasPrice: number; + /** + * + * @type {number} + * @memberof RuntimeTransactionEvmTx + */ + gasLimit: number; + /** + * + * @type {string} + * @memberof RuntimeTransactionEvmTx + */ + data: string; + /** + * + * @type {string} + * @memberof RuntimeTransactionEvmTx + */ + value: string; +} + +export function RuntimeTransactionEvmTxFromJSON(json: any): RuntimeTransactionEvmTx { + return RuntimeTransactionEvmTxFromJSONTyped(json, false); +} + +export function RuntimeTransactionEvmTxFromJSONTyped(json: any, ignoreDiscriminator: boolean): RuntimeTransactionEvmTx { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'hash': json['hash'], + 'from': json['from'], + 'to': json['to'], + 'nonce': json['nonce'], + 'gasPrice': json['gasPrice'], + 'gasLimit': json['gasLimit'], + 'data': json['data'], + 'value': json['value'], + }; +} + +export function RuntimeTransactionEvmTxToJSON(value?: RuntimeTransactionEvmTx | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'hash': value.hash, + 'from': value.from, + 'to': value.to, + 'nonce': value.nonce, + 'gasPrice': value.gasPrice, + 'gasLimit': value.gasLimit, + 'data': value.data, + 'value': value.value, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/RuntimeTransactionInfoRequest.ts b/src/vendors/oasisscan-v2/models/RuntimeTransactionInfoRequest.ts new file mode 100644 index 0000000000..0aa1bb5adf --- /dev/null +++ b/src/vendors/oasisscan-v2/models/RuntimeTransactionInfoRequest.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface RuntimeTransactionInfoRequest + */ +export interface RuntimeTransactionInfoRequest { + /** + * + * @type {string} + * @memberof RuntimeTransactionInfoRequest + */ + id: string; + /** + * + * @type {number} + * @memberof RuntimeTransactionInfoRequest + */ + round: number; + /** + * + * @type {string} + * @memberof RuntimeTransactionInfoRequest + */ + hash: string; +} + +export function RuntimeTransactionInfoRequestFromJSON(json: any): RuntimeTransactionInfoRequest { + return RuntimeTransactionInfoRequestFromJSONTyped(json, false); +} + +export function RuntimeTransactionInfoRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): RuntimeTransactionInfoRequest { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'id': json['id'], + 'round': json['round'], + 'hash': json['hash'], + }; +} + +export function RuntimeTransactionInfoRequestToJSON(value?: RuntimeTransactionInfoRequest | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'id': value.id, + 'round': value.round, + 'hash': value.hash, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/RuntimeTransactionInfoResponse.ts b/src/vendors/oasisscan-v2/models/RuntimeTransactionInfoResponse.ts new file mode 100644 index 0000000000..f5cab002a6 --- /dev/null +++ b/src/vendors/oasisscan-v2/models/RuntimeTransactionInfoResponse.ts @@ -0,0 +1,148 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import { + RuntimeTransactionConsensusTx, + RuntimeTransactionConsensusTxFromJSON, + RuntimeTransactionConsensusTxFromJSONTyped, + RuntimeTransactionConsensusTxToJSON, + RuntimeTransactionEvmTx, + RuntimeTransactionEvmTxFromJSON, + RuntimeTransactionEvmTxFromJSONTyped, + RuntimeTransactionEvmTxToJSON, +} from './'; + +/** + * + * @export + * @interface RuntimeTransactionInfoResponse + */ +export interface RuntimeTransactionInfoResponse { + /** + * + * @type {string} + * @memberof RuntimeTransactionInfoResponse + */ + runtimeId: string; + /** + * + * @type {string} + * @memberof RuntimeTransactionInfoResponse + */ + runtimeName: string; + /** + * + * @type {string} + * @memberof RuntimeTransactionInfoResponse + */ + txHash: string; + /** + * + * @type {number} + * @memberof RuntimeTransactionInfoResponse + */ + round: number; + /** + * + * @type {boolean} + * @memberof RuntimeTransactionInfoResponse + */ + result: boolean; + /** + * + * @type {string} + * @memberof RuntimeTransactionInfoResponse + */ + message: string; + /** + * + * @type {number} + * @memberof RuntimeTransactionInfoResponse + */ + timestamp: number; + /** + * + * @type {string} + * @memberof RuntimeTransactionInfoResponse + */ + type: string; + /** + * + * @type {RuntimeTransactionConsensusTx} + * @memberof RuntimeTransactionInfoResponse + */ + ctx: RuntimeTransactionConsensusTx; + /** + * + * @type {RuntimeTransactionEvmTx} + * @memberof RuntimeTransactionInfoResponse + */ + etx: RuntimeTransactionEvmTx; + /** + * + * @type {object} + * @memberof RuntimeTransactionInfoResponse + */ + events: object; +} + +export function RuntimeTransactionInfoResponseFromJSON(json: any): RuntimeTransactionInfoResponse { + return RuntimeTransactionInfoResponseFromJSONTyped(json, false); +} + +export function RuntimeTransactionInfoResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): RuntimeTransactionInfoResponse { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'runtimeId': json['runtimeId'], + 'runtimeName': json['runtimeName'], + 'txHash': json['txHash'], + 'round': json['round'], + 'result': json['result'], + 'message': json['message'], + 'timestamp': json['timestamp'], + 'type': json['type'], + 'ctx': RuntimeTransactionConsensusTxFromJSON(json['ctx']), + 'etx': RuntimeTransactionEvmTxFromJSON(json['etx']), + 'events': json['events'], + }; +} + +export function RuntimeTransactionInfoResponseToJSON(value?: RuntimeTransactionInfoResponse | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'runtimeId': value.runtimeId, + 'runtimeName': value.runtimeName, + 'txHash': value.txHash, + 'round': value.round, + 'result': value.result, + 'message': value.message, + 'timestamp': value.timestamp, + 'type': value.type, + 'ctx': RuntimeTransactionConsensusTxToJSON(value.ctx), + 'etx': RuntimeTransactionEvmTxToJSON(value.etx), + 'events': value.events, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/RuntimeTransactionListInfo.ts b/src/vendors/oasisscan-v2/models/RuntimeTransactionListInfo.ts new file mode 100644 index 0000000000..5a1f8577e4 --- /dev/null +++ b/src/vendors/oasisscan-v2/models/RuntimeTransactionListInfo.ts @@ -0,0 +1,97 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface RuntimeTransactionListInfo + */ +export interface RuntimeTransactionListInfo { + /** + * + * @type {string} + * @memberof RuntimeTransactionListInfo + */ + runtimeId: string; + /** + * + * @type {string} + * @memberof RuntimeTransactionListInfo + */ + txHash: string; + /** + * + * @type {number} + * @memberof RuntimeTransactionListInfo + */ + round: number; + /** + * + * @type {boolean} + * @memberof RuntimeTransactionListInfo + */ + result: boolean; + /** + * + * @type {number} + * @memberof RuntimeTransactionListInfo + */ + timestamp: number; + /** + * + * @type {string} + * @memberof RuntimeTransactionListInfo + */ + type: string; +} + +export function RuntimeTransactionListInfoFromJSON(json: any): RuntimeTransactionListInfo { + return RuntimeTransactionListInfoFromJSONTyped(json, false); +} + +export function RuntimeTransactionListInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean): RuntimeTransactionListInfo { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'runtimeId': json['runtimeId'], + 'txHash': json['txHash'], + 'round': json['round'], + 'result': json['result'], + 'timestamp': json['timestamp'], + 'type': json['type'], + }; +} + +export function RuntimeTransactionListInfoToJSON(value?: RuntimeTransactionListInfo | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'runtimeId': value.runtimeId, + 'txHash': value.txHash, + 'round': value.round, + 'result': value.result, + 'timestamp': value.timestamp, + 'type': value.type, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/RuntimeTransactionListRequest.ts b/src/vendors/oasisscan-v2/models/RuntimeTransactionListRequest.ts new file mode 100644 index 0000000000..966891a1ad --- /dev/null +++ b/src/vendors/oasisscan-v2/models/RuntimeTransactionListRequest.ts @@ -0,0 +1,89 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface RuntimeTransactionListRequest + */ +export interface RuntimeTransactionListRequest { + /** + * + * @type {string} + * @memberof RuntimeTransactionListRequest + */ + id?: string; + /** + * + * @type {string} + * @memberof RuntimeTransactionListRequest + */ + address?: string; + /** + * + * @type {number} + * @memberof RuntimeTransactionListRequest + */ + round?: number; + /** + * + * @type {number} + * @memberof RuntimeTransactionListRequest + */ + page: number; + /** + * + * @type {number} + * @memberof RuntimeTransactionListRequest + */ + size: number; +} + +export function RuntimeTransactionListRequestFromJSON(json: any): RuntimeTransactionListRequest { + return RuntimeTransactionListRequestFromJSONTyped(json, false); +} + +export function RuntimeTransactionListRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): RuntimeTransactionListRequest { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'id': !exists(json, 'id') ? undefined : json['id'], + 'address': !exists(json, 'address') ? undefined : json['address'], + 'round': !exists(json, 'round') ? undefined : json['round'], + 'page': json['page'], + 'size': json['size'], + }; +} + +export function RuntimeTransactionListRequestToJSON(value?: RuntimeTransactionListRequest | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'id': value.id, + 'address': value.address, + 'round': value.round, + 'page': value.page, + 'size': value.size, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/RuntimeTransactionListResponse.ts b/src/vendors/oasisscan-v2/models/RuntimeTransactionListResponse.ts new file mode 100644 index 0000000000..69d5d25277 --- /dev/null +++ b/src/vendors/oasisscan-v2/models/RuntimeTransactionListResponse.ts @@ -0,0 +1,96 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import { + RuntimeTransactionListInfo, + RuntimeTransactionListInfoFromJSON, + RuntimeTransactionListInfoFromJSONTyped, + RuntimeTransactionListInfoToJSON, +} from './'; + +/** + * + * @export + * @interface RuntimeTransactionListResponse + */ +export interface RuntimeTransactionListResponse { + /** + * + * @type {Array} + * @memberof RuntimeTransactionListResponse + */ + list: Array; + /** + * + * @type {number} + * @memberof RuntimeTransactionListResponse + */ + page?: number; + /** + * + * @type {number} + * @memberof RuntimeTransactionListResponse + */ + size?: number; + /** + * + * @type {number} + * @memberof RuntimeTransactionListResponse + */ + maxPage?: number; + /** + * + * @type {number} + * @memberof RuntimeTransactionListResponse + */ + totalSize?: number; +} + +export function RuntimeTransactionListResponseFromJSON(json: any): RuntimeTransactionListResponse { + return RuntimeTransactionListResponseFromJSONTyped(json, false); +} + +export function RuntimeTransactionListResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): RuntimeTransactionListResponse { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'list': ((json['list'] as Array).map(RuntimeTransactionListInfoFromJSON)), + 'page': !exists(json, 'page') ? undefined : json['page'], + 'size': !exists(json, 'size') ? undefined : json['size'], + 'maxPage': !exists(json, 'maxPage') ? undefined : json['maxPage'], + 'totalSize': !exists(json, 'totalSize') ? undefined : json['totalSize'], + }; +} + +export function RuntimeTransactionListResponseToJSON(value?: RuntimeTransactionListResponse | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'list': ((value.list as Array).map(RuntimeTransactionListInfoToJSON)), + 'page': value.page, + 'size': value.size, + 'maxPage': value.maxPage, + 'totalSize': value.totalSize, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/ValidatorBlocksStatsInfo.ts b/src/vendors/oasisscan-v2/models/ValidatorBlocksStatsInfo.ts new file mode 100644 index 0000000000..5b7a8dfc3a --- /dev/null +++ b/src/vendors/oasisscan-v2/models/ValidatorBlocksStatsInfo.ts @@ -0,0 +1,65 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface ValidatorBlocksStatsInfo + */ +export interface ValidatorBlocksStatsInfo { + /** + * + * @type {number} + * @memberof ValidatorBlocksStatsInfo + */ + height: number; + /** + * + * @type {boolean} + * @memberof ValidatorBlocksStatsInfo + */ + block: boolean; +} + +export function ValidatorBlocksStatsInfoFromJSON(json: any): ValidatorBlocksStatsInfo { + return ValidatorBlocksStatsInfoFromJSONTyped(json, false); +} + +export function ValidatorBlocksStatsInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean): ValidatorBlocksStatsInfo { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'height': json['height'], + 'block': json['block'], + }; +} + +export function ValidatorBlocksStatsInfoToJSON(value?: ValidatorBlocksStatsInfo | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'height': value.height, + 'block': value.block, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/ValidatorBlocksStatsRequest.ts b/src/vendors/oasisscan-v2/models/ValidatorBlocksStatsRequest.ts new file mode 100644 index 0000000000..6c44070b2f --- /dev/null +++ b/src/vendors/oasisscan-v2/models/ValidatorBlocksStatsRequest.ts @@ -0,0 +1,57 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface ValidatorBlocksStatsRequest + */ +export interface ValidatorBlocksStatsRequest { + /** + * + * @type {string} + * @memberof ValidatorBlocksStatsRequest + */ + address: string; +} + +export function ValidatorBlocksStatsRequestFromJSON(json: any): ValidatorBlocksStatsRequest { + return ValidatorBlocksStatsRequestFromJSONTyped(json, false); +} + +export function ValidatorBlocksStatsRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): ValidatorBlocksStatsRequest { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'address': json['address'], + }; +} + +export function ValidatorBlocksStatsRequestToJSON(value?: ValidatorBlocksStatsRequest | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'address': value.address, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/ValidatorBlocksStatsResponse.ts b/src/vendors/oasisscan-v2/models/ValidatorBlocksStatsResponse.ts new file mode 100644 index 0000000000..06199e2ba2 --- /dev/null +++ b/src/vendors/oasisscan-v2/models/ValidatorBlocksStatsResponse.ts @@ -0,0 +1,72 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import { + ValidatorBlocksStatsInfo, + ValidatorBlocksStatsInfoFromJSON, + ValidatorBlocksStatsInfoFromJSONTyped, + ValidatorBlocksStatsInfoToJSON, +} from './'; + +/** + * + * @export + * @interface ValidatorBlocksStatsResponse + */ +export interface ValidatorBlocksStatsResponse { + /** + * + * @type {Array} + * @memberof ValidatorBlocksStatsResponse + */ + signs: Array; + /** + * + * @type {Array} + * @memberof ValidatorBlocksStatsResponse + */ + proposals: Array; +} + +export function ValidatorBlocksStatsResponseFromJSON(json: any): ValidatorBlocksStatsResponse { + return ValidatorBlocksStatsResponseFromJSONTyped(json, false); +} + +export function ValidatorBlocksStatsResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ValidatorBlocksStatsResponse { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'signs': ((json['signs'] as Array).map(ValidatorBlocksStatsInfoFromJSON)), + 'proposals': ((json['proposals'] as Array).map(ValidatorBlocksStatsInfoFromJSON)), + }; +} + +export function ValidatorBlocksStatsResponseToJSON(value?: ValidatorBlocksStatsResponse | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'signs': ((value.signs as Array).map(ValidatorBlocksStatsInfoToJSON)), + 'proposals': ((value.proposals as Array).map(ValidatorBlocksStatsInfoToJSON)), + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/ValidatorEscrowEventRequest.ts b/src/vendors/oasisscan-v2/models/ValidatorEscrowEventRequest.ts new file mode 100644 index 0000000000..77a533f1f4 --- /dev/null +++ b/src/vendors/oasisscan-v2/models/ValidatorEscrowEventRequest.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface ValidatorEscrowEventRequest + */ +export interface ValidatorEscrowEventRequest { + /** + * + * @type {string} + * @memberof ValidatorEscrowEventRequest + */ + address: string; + /** + * + * @type {number} + * @memberof ValidatorEscrowEventRequest + */ + page: number; + /** + * + * @type {number} + * @memberof ValidatorEscrowEventRequest + */ + size: number; +} + +export function ValidatorEscrowEventRequestFromJSON(json: any): ValidatorEscrowEventRequest { + return ValidatorEscrowEventRequestFromJSONTyped(json, false); +} + +export function ValidatorEscrowEventRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): ValidatorEscrowEventRequest { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'address': json['address'], + 'page': json['page'], + 'size': json['size'], + }; +} + +export function ValidatorEscrowEventRequestToJSON(value?: ValidatorEscrowEventRequest | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'address': value.address, + 'page': value.page, + 'size': value.size, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/ValidatorEscrowEventResponse.ts b/src/vendors/oasisscan-v2/models/ValidatorEscrowEventResponse.ts new file mode 100644 index 0000000000..94a0ff6044 --- /dev/null +++ b/src/vendors/oasisscan-v2/models/ValidatorEscrowEventResponse.ts @@ -0,0 +1,96 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import { + ChainTransactionListInfo, + ChainTransactionListInfoFromJSON, + ChainTransactionListInfoFromJSONTyped, + ChainTransactionListInfoToJSON, +} from './'; + +/** + * + * @export + * @interface ValidatorEscrowEventResponse + */ +export interface ValidatorEscrowEventResponse { + /** + * + * @type {Array} + * @memberof ValidatorEscrowEventResponse + */ + list: Array; + /** + * + * @type {number} + * @memberof ValidatorEscrowEventResponse + */ + page?: number; + /** + * + * @type {number} + * @memberof ValidatorEscrowEventResponse + */ + size?: number; + /** + * + * @type {number} + * @memberof ValidatorEscrowEventResponse + */ + maxPage?: number; + /** + * + * @type {number} + * @memberof ValidatorEscrowEventResponse + */ + totalSize?: number; +} + +export function ValidatorEscrowEventResponseFromJSON(json: any): ValidatorEscrowEventResponse { + return ValidatorEscrowEventResponseFromJSONTyped(json, false); +} + +export function ValidatorEscrowEventResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ValidatorEscrowEventResponse { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'list': ((json['list'] as Array).map(ChainTransactionListInfoFromJSON)), + 'page': !exists(json, 'page') ? undefined : json['page'], + 'size': !exists(json, 'size') ? undefined : json['size'], + 'maxPage': !exists(json, 'maxPage') ? undefined : json['maxPage'], + 'totalSize': !exists(json, 'totalSize') ? undefined : json['totalSize'], + }; +} + +export function ValidatorEscrowEventResponseToJSON(value?: ValidatorEscrowEventResponse | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'list': ((value.list as Array).map(ChainTransactionListInfoToJSON)), + 'page': value.page, + 'size': value.size, + 'maxPage': value.maxPage, + 'totalSize': value.totalSize, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/ValidatorEscrowStatsInfo.ts b/src/vendors/oasisscan-v2/models/ValidatorEscrowStatsInfo.ts new file mode 100644 index 0000000000..f282cd2023 --- /dev/null +++ b/src/vendors/oasisscan-v2/models/ValidatorEscrowStatsInfo.ts @@ -0,0 +1,65 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface ValidatorEscrowStatsInfo + */ +export interface ValidatorEscrowStatsInfo { + /** + * + * @type {number} + * @memberof ValidatorEscrowStatsInfo + */ + timestamp: number; + /** + * + * @type {string} + * @memberof ValidatorEscrowStatsInfo + */ + escrow: string; +} + +export function ValidatorEscrowStatsInfoFromJSON(json: any): ValidatorEscrowStatsInfo { + return ValidatorEscrowStatsInfoFromJSONTyped(json, false); +} + +export function ValidatorEscrowStatsInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean): ValidatorEscrowStatsInfo { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'timestamp': json['timestamp'], + 'escrow': json['escrow'], + }; +} + +export function ValidatorEscrowStatsInfoToJSON(value?: ValidatorEscrowStatsInfo | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'timestamp': value.timestamp, + 'escrow': value.escrow, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/ValidatorEscrowStatsRequest.ts b/src/vendors/oasisscan-v2/models/ValidatorEscrowStatsRequest.ts new file mode 100644 index 0000000000..4c678eb73c --- /dev/null +++ b/src/vendors/oasisscan-v2/models/ValidatorEscrowStatsRequest.ts @@ -0,0 +1,57 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface ValidatorEscrowStatsRequest + */ +export interface ValidatorEscrowStatsRequest { + /** + * + * @type {string} + * @memberof ValidatorEscrowStatsRequest + */ + address: string; +} + +export function ValidatorEscrowStatsRequestFromJSON(json: any): ValidatorEscrowStatsRequest { + return ValidatorEscrowStatsRequestFromJSONTyped(json, false); +} + +export function ValidatorEscrowStatsRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): ValidatorEscrowStatsRequest { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'address': json['address'], + }; +} + +export function ValidatorEscrowStatsRequestToJSON(value?: ValidatorEscrowStatsRequest | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'address': value.address, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/ValidatorEscrowStatsResponse.ts b/src/vendors/oasisscan-v2/models/ValidatorEscrowStatsResponse.ts new file mode 100644 index 0000000000..c65402fa35 --- /dev/null +++ b/src/vendors/oasisscan-v2/models/ValidatorEscrowStatsResponse.ts @@ -0,0 +1,64 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import { + ValidatorEscrowStatsInfo, + ValidatorEscrowStatsInfoFromJSON, + ValidatorEscrowStatsInfoFromJSONTyped, + ValidatorEscrowStatsInfoToJSON, +} from './'; + +/** + * + * @export + * @interface ValidatorEscrowStatsResponse + */ +export interface ValidatorEscrowStatsResponse { + /** + * + * @type {Array} + * @memberof ValidatorEscrowStatsResponse + */ + list: Array; +} + +export function ValidatorEscrowStatsResponseFromJSON(json: any): ValidatorEscrowStatsResponse { + return ValidatorEscrowStatsResponseFromJSONTyped(json, false); +} + +export function ValidatorEscrowStatsResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ValidatorEscrowStatsResponse { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'list': ((json['list'] as Array).map(ValidatorEscrowStatsInfoFromJSON)), + }; +} + +export function ValidatorEscrowStatsResponseToJSON(value?: ValidatorEscrowStatsResponse | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'list': ((value.list as Array).map(ValidatorEscrowStatsInfoToJSON)), + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/ValidatorInfo.ts b/src/vendors/oasisscan-v2/models/ValidatorInfo.ts new file mode 100644 index 0000000000..441123934f --- /dev/null +++ b/src/vendors/oasisscan-v2/models/ValidatorInfo.ts @@ -0,0 +1,332 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import { + Bound, + BoundFromJSON, + BoundFromJSONTyped, + BoundToJSON, + EscrowStatus, + EscrowStatusFromJSON, + EscrowStatusFromJSONTyped, + EscrowStatusToJSON, + Rate, + RateFromJSON, + RateFromJSONTyped, + RateToJSON, + ValidatorRuntime, + ValidatorRuntimeFromJSON, + ValidatorRuntimeFromJSONTyped, + ValidatorRuntimeToJSON, +} from './'; + +/** + * + * @export + * @interface ValidatorInfo + */ +export interface ValidatorInfo { + /** + * + * @type {number} + * @memberof ValidatorInfo + */ + rank: number; + /** + * + * @type {string} + * @memberof ValidatorInfo + */ + entityId: string; + /** + * + * @type {string} + * @memberof ValidatorInfo + */ + entityAddress: string; + /** + * + * @type {string} + * @memberof ValidatorInfo + */ + nodeId: string; + /** + * + * @type {string} + * @memberof ValidatorInfo + */ + nodeAddress: string; + /** + * + * @type {string} + * @memberof ValidatorInfo + */ + name: string; + /** + * + * @type {string} + * @memberof ValidatorInfo + */ + icon: string; + /** + * + * @type {string} + * @memberof ValidatorInfo + */ + website: string; + /** + * + * @type {string} + * @memberof ValidatorInfo + */ + twitter: string; + /** + * + * @type {string} + * @memberof ValidatorInfo + */ + keybase: string; + /** + * + * @type {string} + * @memberof ValidatorInfo + */ + email: string; + /** + * + * @type {string} + * @memberof ValidatorInfo + */ + description: string; + /** + * + * @type {string} + * @memberof ValidatorInfo + */ + escrow: string; + /** + * + * @type {string} + * @memberof ValidatorInfo + */ + escrowChange24: string; + /** + * + * @type {number} + * @memberof ValidatorInfo + */ + escrowPercent: number; + /** + * + * @type {string} + * @memberof ValidatorInfo + */ + balance: string; + /** + * + * @type {string} + * @memberof ValidatorInfo + */ + totalShares: string; + /** + * + * @type {number} + * @memberof ValidatorInfo + */ + signs: number; + /** + * + * @type {number} + * @memberof ValidatorInfo + */ + proposals: number; + /** + * + * @type {number} + * @memberof ValidatorInfo + */ + nonce: number; + /** + * + * @type {number} + * @memberof ValidatorInfo + */ + score: number; + /** + * + * @type {number} + * @memberof ValidatorInfo + */ + delegators: number; + /** + * + * @type {Array} + * @memberof ValidatorInfo + */ + nodes?: Array; + /** + * + * @type {string} + * @memberof ValidatorInfo + */ + uptime: string; + /** + * + * @type {boolean} + * @memberof ValidatorInfo + */ + active: boolean; + /** + * + * @type {number} + * @memberof ValidatorInfo + */ + commission: number; + /** + * + * @type {Bound} + * @memberof ValidatorInfo + */ + bound?: Bound; + /** + * + * @type {Array} + * @memberof ValidatorInfo + */ + rates: Array; + /** + * + * @type {Array} + * @memberof ValidatorInfo + */ + bounds: Array; + /** + * + * @type {EscrowStatus} + * @memberof ValidatorInfo + */ + escrowSharesStatus?: EscrowStatus; + /** + * + * @type {EscrowStatus} + * @memberof ValidatorInfo + */ + escrowAmountStatus?: EscrowStatus; + /** + * + * @type {Array} + * @memberof ValidatorInfo + */ + runtimes?: Array; + /** + * + * @type {boolean} + * @memberof ValidatorInfo + */ + status: boolean; +} + +export function ValidatorInfoFromJSON(json: any): ValidatorInfo { + return ValidatorInfoFromJSONTyped(json, false); +} + +export function ValidatorInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean): ValidatorInfo { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'rank': json['rank'], + 'entityId': json['entityId'], + 'entityAddress': json['entityAddress'], + 'nodeId': json['nodeId'], + 'nodeAddress': json['nodeAddress'], + 'name': json['name'], + 'icon': json['icon'], + 'website': json['website'], + 'twitter': json['twitter'], + 'keybase': json['keybase'], + 'email': json['email'], + 'description': json['description'], + 'escrow': json['escrow'], + 'escrowChange24': json['escrowChange24'], + 'escrowPercent': json['escrowPercent'], + 'balance': json['balance'], + 'totalShares': json['totalShares'], + 'signs': json['signs'], + 'proposals': json['proposals'], + 'nonce': json['nonce'], + 'score': json['score'], + 'delegators': json['delegators'], + 'nodes': !exists(json, 'nodes') ? undefined : json['nodes'], + 'uptime': json['uptime'], + 'active': json['active'], + 'commission': json['commission'], + 'bound': !exists(json, 'bound') ? undefined : BoundFromJSON(json['bound']), + 'rates': ((json['rates'] as Array).map(RateFromJSON)), + 'bounds': ((json['bounds'] as Array).map(BoundFromJSON)), + 'escrowSharesStatus': !exists(json, 'escrowSharesStatus') ? undefined : EscrowStatusFromJSON(json['escrowSharesStatus']), + 'escrowAmountStatus': !exists(json, 'escrowAmountStatus') ? undefined : EscrowStatusFromJSON(json['escrowAmountStatus']), + 'runtimes': !exists(json, 'runtimes') ? undefined : ((json['runtimes'] as Array).map(ValidatorRuntimeFromJSON)), + 'status': json['status'], + }; +} + +export function ValidatorInfoToJSON(value?: ValidatorInfo | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'rank': value.rank, + 'entityId': value.entityId, + 'entityAddress': value.entityAddress, + 'nodeId': value.nodeId, + 'nodeAddress': value.nodeAddress, + 'name': value.name, + 'icon': value.icon, + 'website': value.website, + 'twitter': value.twitter, + 'keybase': value.keybase, + 'email': value.email, + 'description': value.description, + 'escrow': value.escrow, + 'escrowChange24': value.escrowChange24, + 'escrowPercent': value.escrowPercent, + 'balance': value.balance, + 'totalShares': value.totalShares, + 'signs': value.signs, + 'proposals': value.proposals, + 'nonce': value.nonce, + 'score': value.score, + 'delegators': value.delegators, + 'nodes': value.nodes, + 'uptime': value.uptime, + 'active': value.active, + 'commission': value.commission, + 'bound': BoundToJSON(value.bound), + 'rates': ((value.rates as Array).map(RateToJSON)), + 'bounds': ((value.bounds as Array).map(BoundToJSON)), + 'escrowSharesStatus': EscrowStatusToJSON(value.escrowSharesStatus), + 'escrowAmountStatus': EscrowStatusToJSON(value.escrowAmountStatus), + 'runtimes': value.runtimes === undefined ? undefined : ((value.runtimes as Array).map(ValidatorRuntimeToJSON)), + 'status': value.status, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/ValidatorInfoRequest.ts b/src/vendors/oasisscan-v2/models/ValidatorInfoRequest.ts new file mode 100644 index 0000000000..6555ce7c7b --- /dev/null +++ b/src/vendors/oasisscan-v2/models/ValidatorInfoRequest.ts @@ -0,0 +1,57 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface ValidatorInfoRequest + */ +export interface ValidatorInfoRequest { + /** + * + * @type {string} + * @memberof ValidatorInfoRequest + */ + address: string; +} + +export function ValidatorInfoRequestFromJSON(json: any): ValidatorInfoRequest { + return ValidatorInfoRequestFromJSONTyped(json, false); +} + +export function ValidatorInfoRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): ValidatorInfoRequest { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'address': json['address'], + }; +} + +export function ValidatorInfoRequestToJSON(value?: ValidatorInfoRequest | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'address': value.address, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/ValidatorInfoResponse.ts b/src/vendors/oasisscan-v2/models/ValidatorInfoResponse.ts new file mode 100644 index 0000000000..b366566887 --- /dev/null +++ b/src/vendors/oasisscan-v2/models/ValidatorInfoResponse.ts @@ -0,0 +1,332 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import { + Bound, + BoundFromJSON, + BoundFromJSONTyped, + BoundToJSON, + EscrowStatus, + EscrowStatusFromJSON, + EscrowStatusFromJSONTyped, + EscrowStatusToJSON, + Rate, + RateFromJSON, + RateFromJSONTyped, + RateToJSON, + ValidatorRuntime, + ValidatorRuntimeFromJSON, + ValidatorRuntimeFromJSONTyped, + ValidatorRuntimeToJSON, +} from './'; + +/** + * + * @export + * @interface ValidatorInfoResponse + */ +export interface ValidatorInfoResponse { + /** + * + * @type {number} + * @memberof ValidatorInfoResponse + */ + rank?: number; + /** + * + * @type {string} + * @memberof ValidatorInfoResponse + */ + entityId?: string; + /** + * + * @type {string} + * @memberof ValidatorInfoResponse + */ + entityAddress?: string; + /** + * + * @type {string} + * @memberof ValidatorInfoResponse + */ + nodeId?: string; + /** + * + * @type {string} + * @memberof ValidatorInfoResponse + */ + nodeAddress?: string; + /** + * + * @type {string} + * @memberof ValidatorInfoResponse + */ + name?: string; + /** + * + * @type {string} + * @memberof ValidatorInfoResponse + */ + icon?: string; + /** + * + * @type {string} + * @memberof ValidatorInfoResponse + */ + website?: string; + /** + * + * @type {string} + * @memberof ValidatorInfoResponse + */ + twitter?: string; + /** + * + * @type {string} + * @memberof ValidatorInfoResponse + */ + keybase?: string; + /** + * + * @type {string} + * @memberof ValidatorInfoResponse + */ + email?: string; + /** + * + * @type {string} + * @memberof ValidatorInfoResponse + */ + description?: string; + /** + * + * @type {string} + * @memberof ValidatorInfoResponse + */ + escrow?: string; + /** + * + * @type {string} + * @memberof ValidatorInfoResponse + */ + escrowChange24?: string; + /** + * + * @type {number} + * @memberof ValidatorInfoResponse + */ + escrowPercent?: number; + /** + * + * @type {string} + * @memberof ValidatorInfoResponse + */ + balance?: string; + /** + * + * @type {string} + * @memberof ValidatorInfoResponse + */ + totalShares?: string; + /** + * + * @type {number} + * @memberof ValidatorInfoResponse + */ + signs?: number; + /** + * + * @type {number} + * @memberof ValidatorInfoResponse + */ + proposals?: number; + /** + * + * @type {number} + * @memberof ValidatorInfoResponse + */ + nonce?: number; + /** + * + * @type {number} + * @memberof ValidatorInfoResponse + */ + score?: number; + /** + * + * @type {number} + * @memberof ValidatorInfoResponse + */ + delegators?: number; + /** + * + * @type {Array} + * @memberof ValidatorInfoResponse + */ + nodes?: Array; + /** + * + * @type {string} + * @memberof ValidatorInfoResponse + */ + uptime?: string; + /** + * + * @type {boolean} + * @memberof ValidatorInfoResponse + */ + active?: boolean; + /** + * + * @type {number} + * @memberof ValidatorInfoResponse + */ + commission?: number; + /** + * + * @type {Bound} + * @memberof ValidatorInfoResponse + */ + bound?: Bound; + /** + * + * @type {Array} + * @memberof ValidatorInfoResponse + */ + rates?: Array; + /** + * + * @type {Array} + * @memberof ValidatorInfoResponse + */ + bounds?: Array; + /** + * + * @type {EscrowStatus} + * @memberof ValidatorInfoResponse + */ + escrowSharesStatus?: EscrowStatus; + /** + * + * @type {EscrowStatus} + * @memberof ValidatorInfoResponse + */ + escrowAmountStatus?: EscrowStatus; + /** + * + * @type {Array} + * @memberof ValidatorInfoResponse + */ + runtimes?: Array; + /** + * + * @type {boolean} + * @memberof ValidatorInfoResponse + */ + status?: boolean; +} + +export function ValidatorInfoResponseFromJSON(json: any): ValidatorInfoResponse { + return ValidatorInfoResponseFromJSONTyped(json, false); +} + +export function ValidatorInfoResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ValidatorInfoResponse { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'rank': !exists(json, 'rank') ? undefined : json['rank'], + 'entityId': !exists(json, 'entityId') ? undefined : json['entityId'], + 'entityAddress': !exists(json, 'entityAddress') ? undefined : json['entityAddress'], + 'nodeId': !exists(json, 'nodeId') ? undefined : json['nodeId'], + 'nodeAddress': !exists(json, 'nodeAddress') ? undefined : json['nodeAddress'], + 'name': !exists(json, 'name') ? undefined : json['name'], + 'icon': !exists(json, 'icon') ? undefined : json['icon'], + 'website': !exists(json, 'website') ? undefined : json['website'], + 'twitter': !exists(json, 'twitter') ? undefined : json['twitter'], + 'keybase': !exists(json, 'keybase') ? undefined : json['keybase'], + 'email': !exists(json, 'email') ? undefined : json['email'], + 'description': !exists(json, 'description') ? undefined : json['description'], + 'escrow': !exists(json, 'escrow') ? undefined : json['escrow'], + 'escrowChange24': !exists(json, 'escrowChange24') ? undefined : json['escrowChange24'], + 'escrowPercent': !exists(json, 'escrowPercent') ? undefined : json['escrowPercent'], + 'balance': !exists(json, 'balance') ? undefined : json['balance'], + 'totalShares': !exists(json, 'totalShares') ? undefined : json['totalShares'], + 'signs': !exists(json, 'signs') ? undefined : json['signs'], + 'proposals': !exists(json, 'proposals') ? undefined : json['proposals'], + 'nonce': !exists(json, 'nonce') ? undefined : json['nonce'], + 'score': !exists(json, 'score') ? undefined : json['score'], + 'delegators': !exists(json, 'delegators') ? undefined : json['delegators'], + 'nodes': !exists(json, 'nodes') ? undefined : json['nodes'], + 'uptime': !exists(json, 'uptime') ? undefined : json['uptime'], + 'active': !exists(json, 'active') ? undefined : json['active'], + 'commission': !exists(json, 'commission') ? undefined : json['commission'], + 'bound': !exists(json, 'bound') ? undefined : BoundFromJSON(json['bound']), + 'rates': !exists(json, 'rates') ? undefined : ((json['rates'] as Array).map(RateFromJSON)), + 'bounds': !exists(json, 'bounds') ? undefined : ((json['bounds'] as Array).map(BoundFromJSON)), + 'escrowSharesStatus': !exists(json, 'escrowSharesStatus') ? undefined : EscrowStatusFromJSON(json['escrowSharesStatus']), + 'escrowAmountStatus': !exists(json, 'escrowAmountStatus') ? undefined : EscrowStatusFromJSON(json['escrowAmountStatus']), + 'runtimes': !exists(json, 'runtimes') ? undefined : ((json['runtimes'] as Array).map(ValidatorRuntimeFromJSON)), + 'status': !exists(json, 'status') ? undefined : json['status'], + }; +} + +export function ValidatorInfoResponseToJSON(value?: ValidatorInfoResponse | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'rank': value.rank, + 'entityId': value.entityId, + 'entityAddress': value.entityAddress, + 'nodeId': value.nodeId, + 'nodeAddress': value.nodeAddress, + 'name': value.name, + 'icon': value.icon, + 'website': value.website, + 'twitter': value.twitter, + 'keybase': value.keybase, + 'email': value.email, + 'description': value.description, + 'escrow': value.escrow, + 'escrowChange24': value.escrowChange24, + 'escrowPercent': value.escrowPercent, + 'balance': value.balance, + 'totalShares': value.totalShares, + 'signs': value.signs, + 'proposals': value.proposals, + 'nonce': value.nonce, + 'score': value.score, + 'delegators': value.delegators, + 'nodes': value.nodes, + 'uptime': value.uptime, + 'active': value.active, + 'commission': value.commission, + 'bound': BoundToJSON(value.bound), + 'rates': value.rates === undefined ? undefined : ((value.rates as Array).map(RateToJSON)), + 'bounds': value.bounds === undefined ? undefined : ((value.bounds as Array).map(BoundToJSON)), + 'escrowSharesStatus': EscrowStatusToJSON(value.escrowSharesStatus), + 'escrowAmountStatus': EscrowStatusToJSON(value.escrowAmountStatus), + 'runtimes': value.runtimes === undefined ? undefined : ((value.runtimes as Array).map(ValidatorRuntimeToJSON)), + 'status': value.status, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/ValidatorListRequest.ts b/src/vendors/oasisscan-v2/models/ValidatorListRequest.ts new file mode 100644 index 0000000000..8a720a5b6e --- /dev/null +++ b/src/vendors/oasisscan-v2/models/ValidatorListRequest.ts @@ -0,0 +1,65 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface ValidatorListRequest + */ +export interface ValidatorListRequest { + /** + * + * @type {string} + * @memberof ValidatorListRequest + */ + orderBy: string; + /** + * + * @type {string} + * @memberof ValidatorListRequest + */ + sort: string; +} + +export function ValidatorListRequestFromJSON(json: any): ValidatorListRequest { + return ValidatorListRequestFromJSONTyped(json, false); +} + +export function ValidatorListRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): ValidatorListRequest { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'orderBy': json['orderBy'], + 'sort': json['sort'], + }; +} + +export function ValidatorListRequestToJSON(value?: ValidatorListRequest | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'orderBy': value.orderBy, + 'sort': value.sort, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/ValidatorListResponse.ts b/src/vendors/oasisscan-v2/models/ValidatorListResponse.ts new file mode 100644 index 0000000000..2c11368a99 --- /dev/null +++ b/src/vendors/oasisscan-v2/models/ValidatorListResponse.ts @@ -0,0 +1,88 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import { + ValidatorInfo, + ValidatorInfoFromJSON, + ValidatorInfoFromJSONTyped, + ValidatorInfoToJSON, +} from './'; + +/** + * + * @export + * @interface ValidatorListResponse + */ +export interface ValidatorListResponse { + /** + * + * @type {Array} + * @memberof ValidatorListResponse + */ + list: Array; + /** + * + * @type {number} + * @memberof ValidatorListResponse + */ + active: number; + /** + * + * @type {number} + * @memberof ValidatorListResponse + */ + inactive: number; + /** + * + * @type {number} + * @memberof ValidatorListResponse + */ + delegators: number; +} + +export function ValidatorListResponseFromJSON(json: any): ValidatorListResponse { + return ValidatorListResponseFromJSONTyped(json, false); +} + +export function ValidatorListResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ValidatorListResponse { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'list': ((json['list'] as Array).map(ValidatorInfoFromJSON)), + 'active': json['active'], + 'inactive': json['inactive'], + 'delegators': json['delegators'], + }; +} + +export function ValidatorListResponseToJSON(value?: ValidatorListResponse | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'list': ((value.list as Array).map(ValidatorInfoToJSON)), + 'active': value.active, + 'inactive': value.inactive, + 'delegators': value.delegators, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/ValidatorRuntime.ts b/src/vendors/oasisscan-v2/models/ValidatorRuntime.ts new file mode 100644 index 0000000000..eb3ef899a2 --- /dev/null +++ b/src/vendors/oasisscan-v2/models/ValidatorRuntime.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface ValidatorRuntime + */ +export interface ValidatorRuntime { + /** + * + * @type {string} + * @memberof ValidatorRuntime + */ + name: string; + /** + * + * @type {string} + * @memberof ValidatorRuntime + */ + id: string; + /** + * + * @type {boolean} + * @memberof ValidatorRuntime + */ + online: boolean; +} + +export function ValidatorRuntimeFromJSON(json: any): ValidatorRuntime { + return ValidatorRuntimeFromJSONTyped(json, false); +} + +export function ValidatorRuntimeFromJSONTyped(json: any, ignoreDiscriminator: boolean): ValidatorRuntime { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'name': json['name'], + 'id': json['id'], + 'online': json['online'], + }; +} + +export function ValidatorRuntimeToJSON(value?: ValidatorRuntime | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'name': value.name, + 'id': value.id, + 'online': value.online, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/ValidatorSignStatsInfo.ts b/src/vendors/oasisscan-v2/models/ValidatorSignStatsInfo.ts new file mode 100644 index 0000000000..adfd280eee --- /dev/null +++ b/src/vendors/oasisscan-v2/models/ValidatorSignStatsInfo.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface ValidatorSignStatsInfo + */ +export interface ValidatorSignStatsInfo { + /** + * + * @type {number} + * @memberof ValidatorSignStatsInfo + */ + dateTime: number; + /** + * + * @type {number} + * @memberof ValidatorSignStatsInfo + */ + expected: number; + /** + * + * @type {number} + * @memberof ValidatorSignStatsInfo + */ + actual: number; +} + +export function ValidatorSignStatsInfoFromJSON(json: any): ValidatorSignStatsInfo { + return ValidatorSignStatsInfoFromJSONTyped(json, false); +} + +export function ValidatorSignStatsInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean): ValidatorSignStatsInfo { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'dateTime': json['dateTime'], + 'expected': json['expected'], + 'actual': json['actual'], + }; +} + +export function ValidatorSignStatsInfoToJSON(value?: ValidatorSignStatsInfo | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'dateTime': value.dateTime, + 'expected': value.expected, + 'actual': value.actual, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/ValidatorSignStatsRequest.ts b/src/vendors/oasisscan-v2/models/ValidatorSignStatsRequest.ts new file mode 100644 index 0000000000..988b1ef083 --- /dev/null +++ b/src/vendors/oasisscan-v2/models/ValidatorSignStatsRequest.ts @@ -0,0 +1,57 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface ValidatorSignStatsRequest + */ +export interface ValidatorSignStatsRequest { + /** + * + * @type {string} + * @memberof ValidatorSignStatsRequest + */ + address: string; +} + +export function ValidatorSignStatsRequestFromJSON(json: any): ValidatorSignStatsRequest { + return ValidatorSignStatsRequestFromJSONTyped(json, false); +} + +export function ValidatorSignStatsRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): ValidatorSignStatsRequest { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'address': json['address'], + }; +} + +export function ValidatorSignStatsRequestToJSON(value?: ValidatorSignStatsRequest | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'address': value.address, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/ValidatorSignStatsResponse.ts b/src/vendors/oasisscan-v2/models/ValidatorSignStatsResponse.ts new file mode 100644 index 0000000000..c9bb34a76f --- /dev/null +++ b/src/vendors/oasisscan-v2/models/ValidatorSignStatsResponse.ts @@ -0,0 +1,72 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import { + ValidatorSignStatsInfo, + ValidatorSignStatsInfoFromJSON, + ValidatorSignStatsInfoFromJSONTyped, + ValidatorSignStatsInfoToJSON, +} from './'; + +/** + * + * @export + * @interface ValidatorSignStatsResponse + */ +export interface ValidatorSignStatsResponse { + /** + * + * @type {Array} + * @memberof ValidatorSignStatsResponse + */ + stats: Array; + /** + * + * @type {Array} + * @memberof ValidatorSignStatsResponse + */ + time: Array; +} + +export function ValidatorSignStatsResponseFromJSON(json: any): ValidatorSignStatsResponse { + return ValidatorSignStatsResponseFromJSONTyped(json, false); +} + +export function ValidatorSignStatsResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ValidatorSignStatsResponse { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'stats': ((json['stats'] as Array).map(ValidatorSignStatsInfoFromJSON)), + 'time': json['time'], + }; +} + +export function ValidatorSignStatsResponseToJSON(value?: ValidatorSignStatsResponse | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'stats': ((value.stats as Array).map(ValidatorSignStatsInfoToJSON)), + 'time': value.time, + }; +} + + diff --git a/src/vendors/oasisscan-v2/models/index.ts b/src/vendors/oasisscan-v2/models/index.ts new file mode 100644 index 0000000000..e149a56152 --- /dev/null +++ b/src/vendors/oasisscan-v2/models/index.ts @@ -0,0 +1,90 @@ +export * from './AccountAllowance' +export * from './AccountDebondingInfo' +export * from './AccountDebondingRequest' +export * from './AccountDebondingResponse' +export * from './AccountDelegationsInfo' +export * from './AccountDelegationsRequest' +export * from './AccountDelegationsResponse' +export * from './AccountInfoResponse' +export * from './AccountRewardExportRequest' +export * from './AccountRewardInfo' +export * from './AccountRewardRequest' +export * from './AccountRewardResponse' +export * from './AccountRewardStatsInfo' +export * from './AccountRewardStatsItem' +export * from './AccountRewardStatsRequest' +export * from './AccountRewardStatsResponse' +export * from './AccountStakingEventsInfo' +export * from './AccountStakingEventsInfoRequest' +export * from './AccountStakingEventsInfoResponse' +export * from './AccountStakingEventsRequest' +export * from './AccountStakingEventsResponse' +export * from './Bound' +export * from './ChainBlockInfo' +export * from './ChainBlockInfoResponse' +export * from './ChainBlocksRequest' +export * from './ChainBlocksResponse' +export * from './ChainMethodsResponse' +export * from './ChainProposedBlocksRequest' +export * from './ChainProposedBlocksResponse' +export * from './ChainSearchRequest' +export * from './ChainSearchResponse' +export * from './ChainTransactionInfoResponse' +export * from './ChainTransactionListInfo' +export * from './ChainTransactionsRequest' +export * from './ChainTransactionsResponse' +export * from './Chart' +export * from './DelegatorsInfo' +export * from './DelegatorsRequest' +export * from './DelegatorsResponse' +export * from './EscrowStatus' +export * from './GovernanceProposalInfo' +export * from './GovernanceProposalListResponse' +export * from './GovernanceProposalWithVotesRequest' +export * from './GovernanceProposalWithVotesResponse' +export * from './GovernanceVotesRequest' +export * from './GovernanceVotesResponse' +export * from './MarketChartResponse' +export * from './MarketInfoResponse' +export * from './NetworkStatusResponse' +export * from './NetworkTrendResponse' +export * from './Page' +export * from './ProposalOption' +export * from './ProposalVote' +export * from './Rate' +export * from './RuntimeListInfo' +export * from './RuntimeListResponse' +export * from './RuntimeRoundInfo' +export * from './RuntimeRoundInfoRequest' +export * from './RuntimeRoundInfoResponse' +export * from './RuntimeRoundListRequest' +export * from './RuntimeRoundListResponse' +export * from './RuntimeStatsInfo' +export * from './RuntimeStatsItem' +export * from './RuntimeStatsRequest' +export * from './RuntimeStatsResponse' +export * from './RuntimeTransactionConsensusTx' +export * from './RuntimeTransactionEventError' +export * from './RuntimeTransactionEvmTx' +export * from './RuntimeTransactionInfoRequest' +export * from './RuntimeTransactionInfoResponse' +export * from './RuntimeTransactionListInfo' +export * from './RuntimeTransactionListRequest' +export * from './RuntimeTransactionListResponse' +export * from './ValidatorBlocksStatsInfo' +export * from './ValidatorBlocksStatsRequest' +export * from './ValidatorBlocksStatsResponse' +export * from './ValidatorEscrowEventRequest' +export * from './ValidatorEscrowEventResponse' +export * from './ValidatorEscrowStatsInfo' +export * from './ValidatorEscrowStatsRequest' +export * from './ValidatorEscrowStatsResponse' +export * from './ValidatorInfo' +export * from './ValidatorInfoRequest' +export * from './ValidatorInfoResponse' +export * from './ValidatorListRequest' +export * from './ValidatorListResponse' +export * from './ValidatorRuntime' +export * from './ValidatorSignStatsInfo' +export * from './ValidatorSignStatsRequest' +export * from './ValidatorSignStatsResponse' diff --git a/src/vendors/oasisscan-v2/openapitools.json b/src/vendors/oasisscan-v2/openapitools.json new file mode 100644 index 0000000000..86ee945ba6 --- /dev/null +++ b/src/vendors/oasisscan-v2/openapitools.json @@ -0,0 +1,7 @@ +{ + "$schema": "https://raw.githubusercontent.com/OpenAPITools/openapi-generator-cli/v2.5.1/apps/generator-cli/src/config.schema.json", + "spaces": 2, + "generator-cli": { + "version": "5.1.0" + } +} diff --git a/src/vendors/oasisscan-v2/runtime.ts b/src/vendors/oasisscan-v2/runtime.ts new file mode 100644 index 0000000000..997e482d3e --- /dev/null +++ b/src/vendors/oasisscan-v2/runtime.ts @@ -0,0 +1,319 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export const BASE_PATH = "https://api.oasisscan.com/v2/mainnet".replace(/\/+$/, ""); + +const isBlob = (value: any) => typeof Blob !== 'undefined' && value instanceof Blob; + +/** + * This is the base class for all generated API classes. + */ +export class BaseAPI { + + private middleware: Middleware[]; + + constructor(protected configuration = new Configuration()) { + this.middleware = configuration.middleware; + } + + withMiddleware(this: T, ...middlewares: Middleware[]) { + const next = this.clone(); + next.middleware = next.middleware.concat(...middlewares); + return next; + } + + withPreMiddleware(this: T, ...preMiddlewares: Array) { + const middlewares = preMiddlewares.map((pre) => ({ pre })); + return this.withMiddleware(...middlewares); + } + + withPostMiddleware(this: T, ...postMiddlewares: Array) { + const middlewares = postMiddlewares.map((post) => ({ post })); + return this.withMiddleware(...middlewares); + } + + protected async request(context: RequestOpts): Promise { + const { url, init } = this.createFetchParams(context); + const response = await this.fetchApi(url, init); + if (response.status >= 200 && response.status < 300) { + return response; + } + throw response; + } + + private createFetchParams(context: RequestOpts) { + let url = this.configuration.basePath + context.path; + if (context.query !== undefined && Object.keys(context.query).length !== 0) { + // only add the querystring to the URL if there are query parameters. + // this is done to avoid urls ending with a "?" character which buggy webservers + // do not handle correctly sometimes. + url += '?' + this.configuration.queryParamsStringify(context.query); + } + const body = ((typeof FormData !== "undefined" && context.body instanceof FormData) || context.body instanceof URLSearchParams || isBlob(context.body)) + ? context.body + : JSON.stringify(context.body); + + const headers = Object.assign({}, this.configuration.headers, context.headers); + const init = { + method: context.method, + headers: headers, + body, + credentials: this.configuration.credentials + }; + return { url, init }; + } + + private fetchApi = async (url: string, init: RequestInit) => { + let fetchParams = { url, init }; + for (const middleware of this.middleware) { + if (middleware.pre) { + fetchParams = await middleware.pre({ + fetch: this.fetchApi, + ...fetchParams, + }) || fetchParams; + } + } + let response = await this.configuration.fetchApi(fetchParams.url, fetchParams.init); + for (const middleware of this.middleware) { + if (middleware.post) { + response = await middleware.post({ + fetch: this.fetchApi, + url, + init, + response: response.clone(), + }) || response; + } + } + return response; + } + + /** + * Create a shallow clone of `this` by constructing a new instance + * and then shallow cloning data members. + */ + private clone(this: T): T { + const constructor = this.constructor as any; + const next = new constructor(this.configuration); + next.middleware = this.middleware.slice(); + return next; + } +}; + +export class RequiredError extends Error { + name: "RequiredError" = "RequiredError"; + constructor(public field: string, msg?: string) { + super(msg); + } +} + +export const COLLECTION_FORMATS = { + csv: ",", + ssv: " ", + tsv: "\t", + pipes: "|", +}; + +export type FetchAPI = WindowOrWorkerGlobalScope['fetch']; + +export interface ConfigurationParameters { + basePath?: string; // override base path + fetchApi?: FetchAPI; // override for fetch implementation + middleware?: Middleware[]; // middleware to apply before/after fetch requests + queryParamsStringify?: (params: HTTPQuery) => string; // stringify function for query strings + username?: string; // parameter for basic security + password?: string; // parameter for basic security + apiKey?: string | ((name: string) => string); // parameter for apiKey security + accessToken?: string | ((name?: string, scopes?: string[]) => string); // parameter for oauth2 security + headers?: HTTPHeaders; //header params we want to use on every request + credentials?: RequestCredentials; //value for the credentials param we want to use on each request +} + +export class Configuration { + constructor(private configuration: ConfigurationParameters = {}) {} + + get basePath(): string { + return this.configuration.basePath != null ? this.configuration.basePath : BASE_PATH; + } + + get fetchApi(): FetchAPI { + return this.configuration.fetchApi || window.fetch.bind(window); + } + + get middleware(): Middleware[] { + return this.configuration.middleware || []; + } + + get queryParamsStringify(): (params: HTTPQuery) => string { + return this.configuration.queryParamsStringify || querystring; + } + + get username(): string | undefined { + return this.configuration.username; + } + + get password(): string | undefined { + return this.configuration.password; + } + + get apiKey(): ((name: string) => string) | undefined { + const apiKey = this.configuration.apiKey; + if (apiKey) { + return typeof apiKey === 'function' ? apiKey : () => apiKey; + } + return undefined; + } + + get accessToken(): ((name: string, scopes?: string[]) => string) | undefined { + const accessToken = this.configuration.accessToken; + if (accessToken) { + return typeof accessToken === 'function' ? accessToken : () => accessToken; + } + return undefined; + } + + get headers(): HTTPHeaders | undefined { + return this.configuration.headers; + } + + get credentials(): RequestCredentials | undefined { + return this.configuration.credentials; + } +} + +export type Json = any; +export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD'; +export type HTTPHeaders = { [key: string]: string }; +export type HTTPQuery = { [key: string]: string | number | null | boolean | Array | HTTPQuery }; +export type HTTPBody = Json | FormData | URLSearchParams; +export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original'; + +export interface FetchParams { + url: string; + init: RequestInit; +} + +export interface RequestOpts { + path: string; + method: HTTPMethod; + headers: HTTPHeaders; + query?: HTTPQuery; + body?: HTTPBody; +} + +export function exists(json: any, key: string) { + const value = json[key]; + return value !== null && value !== undefined; +} + +export function querystring(params: HTTPQuery, prefix: string = ''): string { + return Object.keys(params) + .map((key) => { + const fullKey = prefix + (prefix.length ? `[${key}]` : key); + const value = params[key]; + if (value instanceof Array) { + const multiValue = value.map(singleValue => encodeURIComponent(String(singleValue))) + .join(`&${encodeURIComponent(fullKey)}=`); + return `${encodeURIComponent(fullKey)}=${multiValue}`; + } + if (value instanceof Date) { + return `${encodeURIComponent(fullKey)}=${encodeURIComponent(value.toISOString())}`; + } + if (value instanceof Object) { + return querystring(value as HTTPQuery, fullKey); + } + return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`; + }) + .filter(part => part.length > 0) + .join('&'); +} + +export function mapValues(data: any, fn: (item: any) => any) { + return Object.keys(data).reduce( + (acc, key) => ({ ...acc, [key]: fn(data[key]) }), + {} + ); +} + +export function canConsumeForm(consumes: Consume[]): boolean { + for (const consume of consumes) { + if ('multipart/form-data' === consume.contentType) { + return true; + } + } + return false; +} + +export interface Consume { + contentType: string +} + +export interface RequestContext { + fetch: FetchAPI; + url: string; + init: RequestInit; +} + +export interface ResponseContext { + fetch: FetchAPI; + url: string; + init: RequestInit; + response: Response; +} + +export interface Middleware { + pre?(context: RequestContext): Promise; + post?(context: ResponseContext): Promise; +} + +export interface ApiResponse { + raw: Response; + value(): Promise; +} + +export interface ResponseTransformer { + (json: any): T; +} + +export class JSONApiResponse { + constructor(public raw: Response, private transformer: ResponseTransformer = (jsonValue: any) => jsonValue) {} + + async value(): Promise { + return this.transformer(await this.raw.json()); + } +} + +export class VoidApiResponse { + constructor(public raw: Response) {} + + async value(): Promise { + return undefined; + } +} + +export class BlobApiResponse { + constructor(public raw: Response) {} + + async value(): Promise { + return await this.raw.blob(); + }; +} + +export class TextApiResponse { + constructor(public raw: Response) {} + + async value(): Promise { + return await this.raw.text(); + }; +} diff --git a/src/vendors/oasisscan-v2/swagger.json b/src/vendors/oasisscan-v2/swagger.json new file mode 100644 index 0000000000..3f7446f49e --- /dev/null +++ b/src/vendors/oasisscan-v2/swagger.json @@ -0,0 +1,3463 @@ +{ + "swagger": "2.0", + "info": { + "title": "", + "description": "This api document example is the Mainnet document, and the Testnet base URL is api.oasisscan.com/v2/testnet", + "version": "" + }, + "host": "api.oasisscan.com/v2/mainnet", + "schemes": ["https"], + "consumes": ["application/json"], + "produces": ["application/json"], + "paths": { + "/account/debonding": { + "get": { + "operationId": "AccountDebondingHandler", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/AccountDebondingResponse" + } + } + }, + "parameters": [ + { + "name": "address", + "in": "query", + "required": true, + "type": "string" + }, + { + "name": "page", + "in": "query", + "required": true, + "type": "integer", + "format": "int64", + "default": "1" + }, + { + "name": "size", + "in": "query", + "required": true, + "type": "integer", + "format": "int64", + "default": "5" + } + ], + "tags": ["account"], + "consumes": ["multipart/form-data"] + } + }, + "/account/delegations": { + "get": { + "operationId": "AccountDelegationsHandler", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/AccountDelegationsResponse" + } + } + }, + "parameters": [ + { + "name": "address", + "in": "query", + "required": true, + "type": "string" + }, + { + "name": "all", + "in": "query", + "required": true, + "type": "boolean", + "format": "boolean", + "default": "false" + }, + { + "name": "page", + "in": "query", + "required": true, + "type": "integer", + "format": "int64", + "default": "1" + }, + { + "name": "size", + "in": "query", + "required": true, + "type": "integer", + "format": "int64", + "default": "5" + } + ], + "tags": ["account"], + "consumes": ["multipart/form-data"] + } + }, + "/account/info/{address}": { + "get": { + "operationId": "AccountInfoHandler", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/AccountInfoResponse" + } + } + }, + "parameters": [ + { + "name": "address", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": ["account"] + } + }, + "/account/reward/export": { + "get": { + "operationId": "AccountRewardExportHandler", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/AccountRewardExportResponse" + } + } + }, + "parameters": [ + { + "name": "account", + "in": "query", + "required": true, + "type": "string" + } + ], + "tags": ["account"], + "consumes": ["multipart/form-data"] + } + }, + "/account/reward/list": { + "get": { + "operationId": "AccountRewardHandler", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/AccountRewardResponse" + } + } + }, + "parameters": [ + { + "name": "account", + "in": "query", + "required": true, + "type": "string" + }, + { + "name": "page", + "in": "query", + "required": true, + "type": "integer", + "format": "int64", + "default": "1" + }, + { + "name": "size", + "in": "query", + "required": true, + "type": "integer", + "format": "int64", + "default": "5" + } + ], + "tags": ["account"], + "consumes": ["multipart/form-data"] + } + }, + "/account/reward/stats": { + "get": { + "operationId": "AccountRewardStatsHandler", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/AccountRewardStatsResponse" + } + } + }, + "parameters": [ + { + "name": "account", + "in": "query", + "required": true, + "type": "string" + } + ], + "tags": ["account"], + "consumes": ["multipart/form-data"] + } + }, + "/account/staking/events": { + "get": { + "operationId": "AccountStakingEventsHandler", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/AccountStakingEventsResponse" + } + } + }, + "parameters": [ + { + "name": "address", + "in": "query", + "required": true, + "type": "string" + }, + { + "name": "page", + "in": "query", + "required": true, + "type": "integer", + "format": "int64", + "default": "1" + }, + { + "name": "size", + "in": "query", + "required": true, + "type": "integer", + "format": "int64", + "default": "5" + } + ], + "tags": ["account"], + "consumes": ["multipart/form-data"] + } + }, + "/account/staking/events/info": { + "get": { + "operationId": "AccountStakingEventsInfoHandler", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/AccountStakingEventsInfoResponse" + } + } + }, + "parameters": [ + { + "name": "id", + "in": "query", + "required": true, + "type": "string" + } + ], + "tags": ["account"], + "consumes": ["multipart/form-data"] + } + }, + "/chain/block/{height}": { + "get": { + "operationId": "ChainBlockInfoHandler", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/ChainBlockInfoResponse" + } + } + }, + "parameters": [ + { + "name": "height", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": ["chain"] + } + }, + "/chain/blocks": { + "get": { + "operationId": "ChainBlocksHandler", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/ChainBlocksResponse" + } + } + }, + "parameters": [ + { + "name": "page", + "in": "query", + "required": true, + "type": "integer", + "format": "int64", + "default": "1" + }, + { + "name": "size", + "in": "query", + "required": true, + "type": "integer", + "format": "int64", + "default": "10" + } + ], + "tags": ["chain"], + "consumes": ["multipart/form-data"] + } + }, + "/chain/methods": { + "get": { + "operationId": "ChainMethodsHandler", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/ChainMethodsResponse" + } + } + }, + "tags": ["chain"] + } + }, + "/chain/proposedblocks": { + "get": { + "operationId": "ChainProposedBlocksHandler", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/ChainProposedBlocksResponse" + } + } + }, + "parameters": [ + { + "name": "address", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "page", + "in": "query", + "required": true, + "type": "integer", + "format": "int64", + "default": "1" + }, + { + "name": "size", + "in": "query", + "required": true, + "type": "integer", + "format": "int64", + "default": "5" + } + ], + "tags": ["chain"], + "consumes": ["multipart/form-data"] + } + }, + "/chain/search": { + "get": { + "operationId": "ChainSearchHandler", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/ChainSearchResponse" + } + } + }, + "parameters": [ + { + "name": "key", + "in": "query", + "required": true, + "type": "string" + } + ], + "tags": ["chain"], + "consumes": ["multipart/form-data"] + } + }, + "/chain/transaction/{hash}": { + "get": { + "operationId": "ChainTransactionInfoHandler", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/ChainTransactionInfoResponse" + } + } + }, + "parameters": [ + { + "name": "hash", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": ["chain"] + } + }, + "/chain/transactions": { + "get": { + "operationId": "ChainTransactionsHandler", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/ChainTransactionsResponse" + } + } + }, + "parameters": [ + { + "name": "height", + "in": "query", + "required": false, + "type": "integer", + "format": "int64" + }, + { + "name": "address", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "method", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "runtime", + "in": "query", + "required": true, + "type": "boolean", + "format": "boolean", + "default": "false" + }, + { + "name": "page", + "in": "query", + "required": true, + "type": "integer", + "format": "int64", + "default": "1" + }, + { + "name": "size", + "in": "query", + "required": true, + "type": "integer", + "format": "int64", + "default": "10" + } + ], + "tags": ["chain"], + "consumes": ["multipart/form-data"] + } + }, + "/governance/proposallist": { + "get": { + "operationId": "GovernanceProposalListHandler", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/GovernanceProposalListResponse" + } + } + }, + "tags": ["governance"] + } + }, + "/governance/proposalwithvotes": { + "get": { + "operationId": "GovernanceProposalWithVotesHandler", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/GovernanceProposalWithVotesResponse" + } + } + }, + "parameters": [ + { + "name": "id", + "in": "query", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "tags": ["governance"], + "consumes": ["multipart/form-data"] + } + }, + "/governance/votes": { + "get": { + "operationId": "GovernanceVotesHandler", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/GovernanceVotesResponse" + } + } + }, + "parameters": [ + { + "name": "proposalId", + "in": "query", + "required": false, + "type": "integer", + "format": "int64" + }, + { + "name": "validator", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "page", + "in": "query", + "required": true, + "type": "integer", + "format": "int64", + "default": "1" + }, + { + "name": "size", + "in": "query", + "required": true, + "type": "integer", + "format": "int64", + "default": "5" + } + ], + "tags": ["governance"], + "consumes": ["multipart/form-data"] + } + }, + "/health": { + "get": { + "operationId": "HealthHandler", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/HealthResponse" + } + } + }, + "tags": ["common"] + } + }, + "/market/chart": { + "get": { + "operationId": "MarketChartHandler", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/MarketChartResponse" + } + } + }, + "tags": ["market"] + } + }, + "/market/info": { + "get": { + "operationId": "MarketInfoHandler", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/MarketInfoResponse" + } + } + }, + "tags": ["market"] + } + }, + "/network/status": { + "get": { + "operationId": "NetworkStatusHandler", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/NetworkStatusResponse" + } + } + }, + "tags": ["common"] + } + }, + "/runtime/list": { + "get": { + "operationId": "RuntimeListHandler", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/RuntimeListResponse" + } + } + }, + "tags": ["runtime"] + } + }, + "/runtime/round/info": { + "get": { + "operationId": "RuntimeRoundInfoHandler", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/RuntimeRoundInfoResponse" + } + } + }, + "parameters": [ + { + "name": "id", + "in": "query", + "required": true, + "type": "string" + }, + { + "name": "round", + "in": "query", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "tags": ["runtime"], + "consumes": ["multipart/form-data"] + } + }, + "/runtime/round/list": { + "get": { + "operationId": "RuntimeRoundListHandler", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/RuntimeRoundListResponse" + } + } + }, + "parameters": [ + { + "name": "id", + "in": "query", + "required": true, + "type": "string" + }, + { + "name": "page", + "in": "query", + "required": true, + "type": "integer", + "format": "int64", + "default": "1" + }, + { + "name": "size", + "in": "query", + "required": true, + "type": "integer", + "format": "int64", + "default": "10" + } + ], + "tags": ["runtime"], + "consumes": ["multipart/form-data"] + } + }, + "/runtime/stats": { + "get": { + "operationId": "RuntimeStatsHandler", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/RuntimeStatsResponse" + } + } + }, + "parameters": [ + { + "name": "id", + "in": "query", + "required": true, + "type": "string" + } + ], + "tags": ["runtime"], + "consumes": ["multipart/form-data"] + } + }, + "/runtime/transaction/info": { + "get": { + "operationId": "RuntimeTransactionInfoHandler", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/RuntimeTransactionInfoResponse" + } + } + }, + "parameters": [ + { + "name": "id", + "in": "query", + "required": true, + "type": "string" + }, + { + "name": "round", + "in": "query", + "required": true, + "type": "integer", + "format": "int64" + }, + { + "name": "hash", + "in": "query", + "required": true, + "type": "string" + } + ], + "tags": ["runtime"], + "consumes": ["multipart/form-data"] + } + }, + "/runtime/transaction/list": { + "get": { + "operationId": "RuntimeTransactionListHandler", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/RuntimeTransactionListResponse" + } + } + }, + "parameters": [ + { + "name": "id", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "address", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "round", + "in": "query", + "required": false, + "type": "integer", + "format": "int64" + }, + { + "name": "page", + "in": "query", + "required": true, + "type": "integer", + "format": "int64", + "default": "1" + }, + { + "name": "size", + "in": "query", + "required": true, + "type": "integer", + "format": "int64", + "default": "10" + } + ], + "tags": ["runtime"], + "consumes": ["multipart/form-data"] + } + }, + "/trend": { + "get": { + "operationId": "NetworkTrendHandler", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/NetworkTrendResponse" + } + } + }, + "tags": ["common"] + } + }, + "/validator/blocksstats": { + "get": { + "operationId": "ValidatorBlocksStatsHandler", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/ValidatorBlocksStatsResponse" + } + } + }, + "parameters": [ + { + "name": "address", + "in": "query", + "required": true, + "type": "string" + } + ], + "tags": ["validator"], + "consumes": ["multipart/form-data"] + } + }, + "/validator/delegators": { + "get": { + "operationId": "DelegatorsHandler", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/DelegatorsResponse" + } + } + }, + "parameters": [ + { + "name": "address", + "in": "query", + "required": true, + "type": "string" + }, + { + "name": "page", + "in": "query", + "required": true, + "type": "integer", + "format": "int64", + "default": "1" + }, + { + "name": "size", + "in": "query", + "required": true, + "type": "integer", + "format": "int64", + "default": "5" + } + ], + "tags": ["validator"], + "consumes": ["multipart/form-data"] + } + }, + "/validator/escrowevent": { + "get": { + "operationId": "ValidatorEscrowEventHandler", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/ValidatorEscrowEventResponse" + } + } + }, + "parameters": [ + { + "name": "address", + "in": "query", + "required": true, + "type": "string" + }, + { + "name": "page", + "in": "query", + "required": true, + "type": "integer", + "format": "int64", + "default": "1" + }, + { + "name": "size", + "in": "query", + "required": true, + "type": "integer", + "format": "int64", + "default": "10" + } + ], + "tags": ["validator"], + "consumes": ["multipart/form-data"] + } + }, + "/validator/escrowstats": { + "get": { + "operationId": "ValidatorEscrowStatsHandler", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/ValidatorEscrowStatsResponse" + } + } + }, + "parameters": [ + { + "name": "address", + "in": "query", + "required": true, + "type": "string" + } + ], + "tags": ["validator"], + "consumes": ["multipart/form-data"] + } + }, + "/validator/info": { + "get": { + "operationId": "ValidatorInfoHandler", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/ValidatorInfoResponse" + } + } + }, + "parameters": [ + { + "name": "address", + "in": "query", + "required": true, + "type": "string" + } + ], + "tags": ["validator"], + "consumes": ["multipart/form-data"] + } + }, + "/validator/list": { + "get": { + "operationId": "ValidatorListHandler", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/ValidatorListResponse" + } + } + }, + "parameters": [ + { + "name": "orderBy", + "in": "query", + "required": true, + "type": "string", + "default": "escrow" + }, + { + "name": "sort", + "in": "query", + "required": true, + "type": "string", + "default": "desc" + } + ], + "tags": ["validator"], + "consumes": ["multipart/form-data"] + } + }, + "/validator/signstats": { + "get": { + "operationId": "ValidatorSignStatsHandler", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/ValidatorSignStatsResponse" + } + } + }, + "parameters": [ + { + "name": "address", + "in": "query", + "required": true, + "type": "string" + } + ], + "tags": ["validator"], + "consumes": ["multipart/form-data"] + } + } + }, + "definitions": { + "AccountAllowance": { + "type": "object", + "properties": { + "address": { + "type": "string" + }, + "amount": { + "type": "string" + } + }, + "title": "AccountAllowance", + "required": ["address", "amount"] + }, + "AccountDebondingInfo": { + "type": "object", + "properties": { + "validatorAddress": { + "type": "string" + }, + "validatorName": { + "type": "string" + }, + "icon": { + "type": "string" + }, + "shares": { + "type": "string" + }, + "debondEnd": { + "type": "integer", + "format": "int64" + }, + "epochLeft": { + "type": "integer", + "format": "int64" + } + }, + "title": "AccountDebondingInfo", + "required": ["validatorAddress", "validatorName", "icon", "shares", "debondEnd", "epochLeft"] + }, + "AccountDebondingRequest": { + "type": "object", + "properties": { + "address": { + "type": "string" + }, + "page": { + "type": "integer", + "format": "int64", + "default": "1" + }, + "size": { + "type": "integer", + "format": "int64", + "default": "5" + } + }, + "title": "AccountDebondingRequest", + "required": ["address", "page", "size"] + }, + "AccountDebondingResponse": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/AccountDebondingInfo" + } + }, + "page": { + "type": "integer", + "format": "int64" + }, + "size": { + "type": "integer", + "format": "int64" + }, + "maxPage": { + "type": "integer", + "format": "int64" + }, + "totalSize": { + "type": "integer", + "format": "int64" + } + }, + "title": "AccountDebondingResponse", + "required": ["list"] + }, + "AccountDelegationsInfo": { + "type": "object", + "properties": { + "validatorAddress": { + "type": "string" + }, + "validatorName": { + "type": "string" + }, + "icon": { + "type": "string" + }, + "entityAddress": { + "type": "string" + }, + "shares": { + "type": "string" + }, + "amount": { + "type": "string" + }, + "active": { + "type": "boolean", + "format": "boolean" + } + }, + "title": "AccountDelegationsInfo", + "required": ["validatorAddress", "validatorName", "icon", "entityAddress", "shares", "amount", "active"] + }, + "AccountDelegationsRequest": { + "type": "object", + "properties": { + "address": { + "type": "string" + }, + "all": { + "type": "boolean", + "format": "boolean", + "default": "false" + }, + "page": { + "type": "integer", + "format": "int64", + "default": "1" + }, + "size": { + "type": "integer", + "format": "int64", + "default": "5" + } + }, + "title": "AccountDelegationsRequest", + "required": ["address", "all", "page", "size"] + }, + "AccountDelegationsResponse": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/AccountDelegationsInfo" + } + }, + "page": { + "type": "integer", + "format": "int64" + }, + "size": { + "type": "integer", + "format": "int64" + }, + "maxPage": { + "type": "integer", + "format": "int64" + }, + "totalSize": { + "type": "integer", + "format": "int64" + } + }, + "title": "AccountDelegationsResponse", + "required": ["list"] + }, + "AccountInfoRequest": { + "type": "object", + "title": "AccountInfoRequest" + }, + "AccountInfoResponse": { + "type": "object", + "properties": { + "address": { + "type": "string" + }, + "available": { + "type": "string" + }, + "escrow": { + "type": "string" + }, + "debonding": { + "type": "string" + }, + "total": { + "type": "string" + }, + "nonce": { + "type": "integer", + "format": "int64" + }, + "allowances": { + "type": "array", + "items": { + "$ref": "#/definitions/AccountAllowance" + } + } + }, + "title": "AccountInfoResponse", + "required": ["address", "available", "escrow", "debonding", "total", "nonce", "allowances"] + }, + "AccountRewardExportRequest": { + "type": "object", + "properties": { + "account": { + "type": "string" + } + }, + "title": "AccountRewardExportRequest", + "required": ["account"] + }, + "AccountRewardExportResponse": { + "type": "object", + "title": "AccountRewardExportResponse" + }, + "AccountRewardInfo": { + "type": "object", + "properties": { + "validatorAddress": { + "type": "string" + }, + "validatorName": { + "type": "string" + }, + "validatorIcon": { + "type": "string" + }, + "epoch": { + "type": "integer", + "format": "int64" + }, + "timestamp": { + "type": "integer", + "format": "int64" + }, + "reward": { + "type": "string" + } + }, + "title": "AccountRewardInfo", + "required": ["validatorAddress", "validatorName", "validatorIcon", "epoch", "timestamp", "reward"] + }, + "AccountRewardRequest": { + "type": "object", + "properties": { + "account": { + "type": "string" + }, + "page": { + "type": "integer", + "format": "int64", + "default": "1" + }, + "size": { + "type": "integer", + "format": "int64", + "default": "5" + } + }, + "title": "AccountRewardRequest", + "required": ["account", "page", "size"] + }, + "AccountRewardResponse": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/AccountRewardInfo" + } + }, + "page": { + "type": "integer", + "format": "int64" + }, + "size": { + "type": "integer", + "format": "int64" + }, + "maxPage": { + "type": "integer", + "format": "int64" + }, + "totalSize": { + "type": "integer", + "format": "int64" + } + }, + "title": "AccountRewardResponse", + "required": ["list"] + }, + "AccountRewardStatsInfo": { + "type": "object", + "properties": { + "validatorName": { + "type": "string" + }, + "rewardList": { + "type": "array", + "items": { + "$ref": "#/definitions/AccountRewardStatsItem" + } + }, + "total": { + "type": "string" + } + }, + "title": "AccountRewardStatsInfo", + "required": ["validatorName", "rewardList", "total"] + }, + "AccountRewardStatsItem": { + "type": "object", + "properties": { + "dateTime": { + "type": "integer", + "format": "int64" + }, + "reward": { + "type": "string" + } + }, + "title": "AccountRewardStatsItem", + "required": ["dateTime", "reward"] + }, + "AccountRewardStatsRequest": { + "type": "object", + "properties": { + "account": { + "type": "string" + } + }, + "title": "AccountRewardStatsRequest", + "required": ["account"] + }, + "AccountRewardStatsResponse": { + "type": "object", + "properties": { + "stats": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/AccountRewardStatsInfo" + } + }, + "time": { + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + } + }, + "title": "AccountRewardStatsResponse", + "required": ["stats", "time"] + }, + "AccountStakingEventsInfo": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "height": { + "type": "integer", + "format": "int64" + }, + "txHash": { + "type": "string" + }, + "kind": { + "type": "string" + } + }, + "title": "AccountStakingEventsInfo", + "required": ["id", "height", "txHash", "kind"] + }, + "AccountStakingEventsInfoRequest": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + }, + "title": "AccountStakingEventsInfoRequest", + "required": ["id"] + }, + "AccountStakingEventsInfoResponse": { + "type": "object", + "properties": { + "height": { + "type": "integer", + "format": "int64" + }, + "txHash": { + "type": "string" + }, + "kind": { + "type": "string" + }, + "timestamp": { + "type": "integer", + "format": "int64" + }, + "transafer": { + "type": "object" + }, + "burn": { + "type": "object" + }, + "escrow": { + "type": "object" + }, + "allowanceChange": { + "type": "object" + } + }, + "title": "AccountStakingEventsInfoResponse", + "required": ["height", "txHash", "kind", "timestamp"] + }, + "AccountStakingEventsRequest": { + "type": "object", + "properties": { + "address": { + "type": "string" + }, + "page": { + "type": "integer", + "format": "int64", + "default": "1" + }, + "size": { + "type": "integer", + "format": "int64", + "default": "5" + } + }, + "title": "AccountStakingEventsRequest", + "required": ["address", "page", "size"] + }, + "AccountStakingEventsResponse": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/AccountStakingEventsInfo" + } + }, + "page": { + "type": "integer", + "format": "int64" + }, + "size": { + "type": "integer", + "format": "int64" + }, + "maxPage": { + "type": "integer", + "format": "int64" + }, + "totalSize": { + "type": "integer", + "format": "int64" + } + }, + "title": "AccountStakingEventsResponse", + "required": ["list"] + }, + "Bound": { + "type": "object", + "properties": { + "start": { + "type": "integer", + "format": "int64" + }, + "min": { + "type": "number", + "format": "double" + }, + "max": { + "type": "number", + "format": "double" + } + }, + "title": "Bound", + "required": ["start", "min", "max"] + }, + "ChainBlockInfo": { + "type": "object", + "properties": { + "height": { + "type": "integer", + "format": "int64" + }, + "epoch": { + "type": "integer", + "format": "int64" + }, + "timestamp": { + "type": "integer", + "format": "int64" + }, + "time": { + "type": "integer", + "format": "int64" + }, + "hash": { + "type": "string" + }, + "txs": { + "type": "integer", + "format": "int64" + }, + "entityAddress": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "title": "ChainBlockInfo", + "required": ["height", "epoch", "timestamp", "time", "hash", "txs", "entityAddress", "name"] + }, + "ChainBlockInfoRequest": { + "type": "object", + "title": "ChainBlockInfoRequest" + }, + "ChainBlockInfoResponse": { + "type": "object", + "properties": { + "height": { + "type": "integer", + "format": "int64" + }, + "epoch": { + "type": "integer", + "format": "int64" + }, + "timestamp": { + "type": "integer", + "format": "int64" + }, + "time": { + "type": "integer", + "format": "int64" + }, + "hash": { + "type": "string" + }, + "txs": { + "type": "integer", + "format": "int64" + }, + "entityAddress": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "title": "ChainBlockInfoResponse" + }, + "ChainBlocksRequest": { + "type": "object", + "properties": { + "page": { + "type": "integer", + "format": "int64", + "default": "1" + }, + "size": { + "type": "integer", + "format": "int64", + "default": "10" + } + }, + "title": "ChainBlocksRequest", + "required": ["page", "size"] + }, + "ChainBlocksResponse": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/ChainBlockInfo" + } + }, + "page": { + "type": "integer", + "format": "int64" + }, + "size": { + "type": "integer", + "format": "int64" + }, + "maxPage": { + "type": "integer", + "format": "int64" + }, + "totalSize": { + "type": "integer", + "format": "int64" + } + }, + "title": "ChainBlocksResponse", + "required": ["list"] + }, + "ChainMethodsRequest": { + "type": "object", + "title": "ChainMethodsRequest" + }, + "ChainMethodsResponse": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "title": "ChainMethodsResponse", + "required": ["list"] + }, + "ChainProposedBlocksRequest": { + "type": "object", + "properties": { + "address": { + "type": "string" + }, + "page": { + "type": "integer", + "format": "int64", + "default": "1" + }, + "size": { + "type": "integer", + "format": "int64", + "default": "5" + } + }, + "title": "ChainProposedBlocksRequest", + "required": ["page", "size"] + }, + "ChainProposedBlocksResponse": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/ChainBlockInfo" + } + }, + "page": { + "type": "integer", + "format": "int64" + }, + "size": { + "type": "integer", + "format": "int64" + }, + "maxPage": { + "type": "integer", + "format": "int64" + }, + "totalSize": { + "type": "integer", + "format": "int64" + } + }, + "title": "ChainProposedBlocksResponse", + "required": ["list"] + }, + "ChainSearchRequest": { + "type": "object", + "properties": { + "key": { + "type": "string" + } + }, + "title": "ChainSearchRequest", + "required": ["key"] + }, + "ChainSearchResponse": { + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "type": { + "type": "string" + }, + "result": { + "type": "string" + } + }, + "title": "ChainSearchResponse", + "required": ["key", "type", "result"] + }, + "ChainTransactionInfoRequest": { + "type": "object", + "title": "ChainTransactionInfoRequest" + }, + "ChainTransactionInfoResponse": { + "type": "object", + "properties": { + "txHash": { + "type": "string" + }, + "timestamp": { + "type": "integer", + "format": "int64" + }, + "time": { + "type": "integer", + "format": "int64" + }, + "height": { + "type": "integer", + "format": "int64" + }, + "fee": { + "type": "string" + }, + "nonce": { + "type": "integer", + "format": "int64" + }, + "method": { + "type": "string" + }, + "from": { + "type": "string" + }, + "to": { + "type": "string" + }, + "amount": { + "type": "string" + }, + "raw": { + "type": "string" + }, + "status": { + "type": "boolean", + "format": "boolean" + }, + "errorMessage": { + "type": "string" + } + }, + "title": "ChainTransactionInfoResponse", + "required": [ + "txHash", + "timestamp", + "time", + "height", + "fee", + "nonce", + "method", + "from", + "to", + "amount", + "raw", + "status", + "errorMessage" + ] + }, + "ChainTransactionListInfo": { + "type": "object", + "properties": { + "txType": { + "type": "string" + }, + "txHash": { + "type": "string" + }, + "height": { + "type": "integer", + "format": "int64" + }, + "method": { + "type": "string" + }, + "fee": { + "type": "string" + }, + "amount": { + "type": "string" + }, + "shares": { + "type": "string" + }, + "add": { + "type": "boolean", + "format": "boolean" + }, + "timestamp": { + "type": "integer", + "format": "int64" + }, + "time": { + "type": "integer", + "format": "int64" + }, + "status": { + "type": "boolean", + "format": "boolean" + }, + "from": { + "type": "string" + }, + "to": { + "type": "string" + }, + "runtimeId": { + "type": "string" + }, + "runtimeName": { + "type": "string" + }, + "round": { + "type": "integer", + "format": "int64" + }, + "result": { + "type": "boolean", + "format": "boolean" + }, + "type": { + "type": "string" + } + }, + "title": "ChainTransactionListInfo", + "required": ["txType"] + }, + "ChainTransactionsRequest": { + "type": "object", + "properties": { + "height": { + "type": "integer", + "format": "int64" + }, + "address": { + "type": "string" + }, + "method": { + "type": "string" + }, + "runtime": { + "type": "boolean", + "format": "boolean", + "default": "false" + }, + "page": { + "type": "integer", + "format": "int64", + "default": "1" + }, + "size": { + "type": "integer", + "format": "int64", + "default": "10" + } + }, + "title": "ChainTransactionsRequest", + "required": ["runtime", "page", "size"] + }, + "ChainTransactionsResponse": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/ChainTransactionListInfo" + } + }, + "page": { + "type": "integer", + "format": "int64" + }, + "size": { + "type": "integer", + "format": "int64" + }, + "maxPage": { + "type": "integer", + "format": "int64" + }, + "totalSize": { + "type": "integer", + "format": "int64" + } + }, + "title": "ChainTransactionsResponse", + "required": ["list"] + }, + "Chart": { + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "title": "Chart", + "required": ["key", "value"] + }, + "DelegatorsInfo": { + "type": "object", + "properties": { + "address": { + "type": "string" + }, + "amount": { + "type": "string" + }, + "shares": { + "type": "string" + }, + "percent": { + "type": "number", + "format": "double" + }, + "self": { + "type": "boolean", + "format": "boolean" + } + }, + "title": "DelegatorsInfo", + "required": ["address", "amount", "shares", "percent", "self"] + }, + "DelegatorsRequest": { + "type": "object", + "properties": { + "address": { + "type": "string" + }, + "page": { + "type": "integer", + "format": "int64", + "default": "1" + }, + "size": { + "type": "integer", + "format": "int64", + "default": "5" + } + }, + "title": "DelegatorsRequest", + "required": ["address", "page", "size"] + }, + "DelegatorsResponse": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/DelegatorsInfo" + } + }, + "page": { + "type": "integer", + "format": "int64" + }, + "size": { + "type": "integer", + "format": "int64" + }, + "maxPage": { + "type": "integer", + "format": "int64" + }, + "totalSize": { + "type": "integer", + "format": "int64" + } + }, + "title": "DelegatorsResponse", + "required": ["list"] + }, + "EscrowStatus": { + "type": "object", + "properties": { + "self": { + "type": "string" + }, + "other": { + "type": "string" + }, + "total": { + "type": "string" + } + }, + "title": "EscrowStatus", + "required": ["self", "other", "total"] + }, + "GovernanceProposalInfo": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "title": { + "type": "string" + }, + "type": { + "type": "string" + }, + "submitter": { + "type": "string" + }, + "state": { + "type": "string" + }, + "deposit": { + "type": "string" + }, + "created_at": { + "type": "integer", + "format": "int64" + }, + "closed_at": { + "type": "integer", + "format": "int64" + }, + "created_time": { + "type": "integer", + "format": "int64" + }, + "closed_time": { + "type": "integer", + "format": "int64" + } + }, + "title": "GovernanceProposalInfo", + "required": [ + "id", + "title", + "type", + "submitter", + "state", + "deposit", + "created_at", + "closed_at", + "created_time", + "closed_time" + ] + }, + "GovernanceProposalListRequest": { + "type": "object", + "title": "GovernanceProposalListRequest" + }, + "GovernanceProposalListResponse": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/GovernanceProposalInfo" + } + } + }, + "title": "GovernanceProposalListResponse", + "required": ["list"] + }, + "GovernanceProposalWithVotesRequest": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + } + }, + "title": "GovernanceProposalWithVotesRequest", + "required": ["id"] + }, + "GovernanceProposalWithVotesResponse": { + "type": "object", + "properties": { + "options": { + "type": "array", + "items": { + "$ref": "#/definitions/ProposalOption" + } + }, + "votes": { + "type": "array", + "items": { + "$ref": "#/definitions/ProposalVote" + } + } + }, + "title": "GovernanceProposalWithVotesResponse", + "required": ["options", "votes"] + }, + "GovernanceVotesRequest": { + "type": "object", + "properties": { + "proposalId": { + "type": "integer", + "format": "int64" + }, + "validator": { + "type": "string" + }, + "page": { + "type": "integer", + "format": "int64", + "default": "1" + }, + "size": { + "type": "integer", + "format": "int64", + "default": "5" + } + }, + "title": "GovernanceVotesRequest", + "required": ["page", "size"] + }, + "GovernanceVotesResponse": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/ProposalVote" + } + }, + "page": { + "type": "integer", + "format": "int64" + }, + "size": { + "type": "integer", + "format": "int64" + }, + "maxPage": { + "type": "integer", + "format": "int64" + }, + "totalSize": { + "type": "integer", + "format": "int64" + } + }, + "title": "GovernanceVotesResponse", + "required": ["list"] + }, + "HealthRequest": { + "type": "object", + "title": "HealthRequest" + }, + "HealthResponse": { + "type": "object", + "title": "HealthResponse" + }, + "MarketChartRequest": { + "type": "object", + "title": "MarketChartRequest" + }, + "MarketChartResponse": { + "type": "object", + "properties": { + "price": { + "type": "array", + "items": { + "$ref": "#/definitions/Chart" + } + }, + "marketCap": { + "type": "array", + "items": { + "$ref": "#/definitions/Chart" + } + }, + "volume": { + "type": "array", + "items": { + "$ref": "#/definitions/Chart" + } + } + }, + "title": "MarketChartResponse", + "required": ["price", "marketCap", "volume"] + }, + "MarketInfoRequest": { + "type": "object", + "title": "MarketInfoRequest" + }, + "MarketInfoResponse": { + "type": "object", + "properties": { + "price": { + "type": "number", + "format": "double" + }, + "priceChangePct24h": { + "type": "number", + "format": "double" + }, + "rank": { + "type": "integer", + "format": "int64" + }, + "marketCap": { + "type": "integer", + "format": "int64" + }, + "marketCapChangePct24h": { + "type": "number", + "format": "double" + }, + "volume": { + "type": "integer", + "format": "int64" + }, + "volumeChangePct24h": { + "type": "number", + "format": "double" + } + }, + "title": "MarketInfoResponse", + "required": [ + "price", + "priceChangePct24h", + "rank", + "marketCap", + "marketCapChangePct24h", + "volume", + "volumeChangePct24h" + ] + }, + "NetworkStatusRequest": { + "type": "object", + "title": "NetworkStatusRequest" + }, + "NetworkStatusResponse": { + "type": "object", + "properties": { + "curHeight": { + "type": "integer", + "format": "int64" + }, + "curEpoch": { + "type": "integer", + "format": "int64" + }, + "totalTxs": { + "type": "integer", + "format": "int64" + }, + "totalEscrow": { + "type": "string" + }, + "activeValidator": { + "type": "integer", + "format": "int64" + }, + "totalDelegator": { + "type": "integer", + "format": "int64" + } + }, + "title": "NetworkStatusResponse", + "required": ["curHeight", "curEpoch", "totalTxs", "totalEscrow", "activeValidator", "totalDelegator"] + }, + "NetworkTrendRequest": { + "type": "object", + "title": "NetworkTrendRequest" + }, + "NetworkTrendResponse": { + "type": "object", + "properties": { + "tx": { + "type": "array", + "items": { + "$ref": "#/definitions/Chart" + } + }, + "escrow": { + "type": "array", + "items": { + "$ref": "#/definitions/Chart" + } + } + }, + "title": "NetworkTrendResponse", + "required": ["tx", "escrow"] + }, + "Page": { + "type": "object", + "properties": { + "page": { + "type": "integer", + "format": "int64" + }, + "size": { + "type": "integer", + "format": "int64" + }, + "maxPage": { + "type": "integer", + "format": "int64" + }, + "totalSize": { + "type": "integer", + "format": "int64" + } + }, + "title": "Page", + "required": ["page", "size", "maxPage", "totalSize"] + }, + "ProposalOption": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "amount": { + "type": "string" + }, + "percent": { + "type": "number", + "format": "double" + } + }, + "title": "ProposalOption", + "required": ["name", "amount", "percent"] + }, + "ProposalVote": { + "type": "object", + "properties": { + "proposalId": { + "type": "integer", + "format": "int64" + }, + "title": { + "type": "string" + }, + "name": { + "type": "string" + }, + "icon": { + "type": "string" + }, + "address": { + "type": "string" + }, + "vote": { + "type": "string" + }, + "amount": { + "type": "string" + }, + "percent": { + "type": "number", + "format": "double" + } + }, + "title": "ProposalVote", + "required": ["proposalId", "title", "name", "icon", "address", "vote", "amount", "percent"] + }, + "Rate": { + "type": "object", + "properties": { + "start": { + "type": "integer", + "format": "int64" + }, + "rate": { + "type": "number", + "format": "double" + } + }, + "title": "Rate", + "required": ["start", "rate"] + }, + "RuntimeListInfo": { + "type": "object", + "properties": { + "runtimeId": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "title": "RuntimeListInfo", + "required": ["runtimeId", "name"] + }, + "RuntimeListRequest": { + "type": "object", + "title": "RuntimeListRequest" + }, + "RuntimeListResponse": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/RuntimeListInfo" + } + } + }, + "title": "RuntimeListResponse", + "required": ["list"] + }, + "RuntimeRoundInfo": { + "type": "object", + "properties": { + "version": { + "type": "integer", + "format": "int64" + }, + "runtimeId": { + "type": "string" + }, + "runtimeName": { + "type": "string" + }, + "round": { + "type": "integer", + "format": "int64" + }, + "timestamp": { + "type": "integer", + "format": "int64" + }, + "header_type": { + "type": "integer", + "format": "int64" + }, + "previous_hash": { + "type": "string" + }, + "io_root": { + "type": "string" + }, + "state_root": { + "type": "string" + }, + "messages_hash": { + "type": "string" + }, + "next": { + "type": "boolean", + "format": "boolean" + } + }, + "title": "RuntimeRoundInfo", + "required": [ + "version", + "runtimeId", + "runtimeName", + "round", + "timestamp", + "header_type", + "previous_hash", + "io_root", + "state_root", + "messages_hash", + "next" + ] + }, + "RuntimeRoundInfoRequest": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "round": { + "type": "integer", + "format": "int64" + } + }, + "title": "RuntimeRoundInfoRequest", + "required": ["id", "round"] + }, + "RuntimeRoundInfoResponse": { + "type": "object", + "properties": { + "version": { + "type": "integer", + "format": "int64" + }, + "runtimeId": { + "type": "string" + }, + "runtimeName": { + "type": "string" + }, + "round": { + "type": "integer", + "format": "int64" + }, + "timestamp": { + "type": "integer", + "format": "int64" + }, + "header_type": { + "type": "integer", + "format": "int64" + }, + "previous_hash": { + "type": "string" + }, + "io_root": { + "type": "string" + }, + "state_root": { + "type": "string" + }, + "messages_hash": { + "type": "string" + }, + "next": { + "type": "boolean", + "format": "boolean" + } + }, + "title": "RuntimeRoundInfoResponse" + }, + "RuntimeRoundListRequest": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "page": { + "type": "integer", + "format": "int64", + "default": "1" + }, + "size": { + "type": "integer", + "format": "int64", + "default": "10" + } + }, + "title": "RuntimeRoundListRequest", + "required": ["id", "page", "size"] + }, + "RuntimeRoundListResponse": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/RuntimeRoundInfo" + } + }, + "page": { + "type": "integer", + "format": "int64" + }, + "size": { + "type": "integer", + "format": "int64" + }, + "maxPage": { + "type": "integer", + "format": "int64" + }, + "totalSize": { + "type": "integer", + "format": "int64" + } + }, + "title": "RuntimeRoundListResponse", + "required": ["list"] + }, + "RuntimeStatsInfo": { + "type": "object", + "properties": { + "entityId": { + "type": "string" + }, + "name": { + "type": "string" + }, + "address": { + "type": "string" + }, + "validator": { + "type": "boolean", + "format": "boolean" + }, + "icon": { + "type": "string" + }, + "status": { + "type": "boolean", + "format": "boolean" + }, + "stats": { + "$ref": "#/definitions/RuntimeStatsItem" + } + }, + "title": "RuntimeStatsInfo", + "required": ["entityId", "name", "address", "validator", "icon", "status", "stats"] + }, + "RuntimeStatsItem": { + "type": "object", + "properties": { + "elected": { + "type": "integer", + "format": "int64" + }, + "primary": { + "type": "integer", + "format": "int64" + }, + "backup": { + "type": "integer", + "format": "int64" + }, + "proposer": { + "type": "integer", + "format": "int64" + } + }, + "title": "RuntimeStatsItem", + "required": ["elected", "primary", "backup", "proposer"] + }, + "RuntimeStatsRequest": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + }, + "title": "RuntimeStatsRequest", + "required": ["id"] + }, + "RuntimeStatsResponse": { + "type": "object", + "properties": { + "online": { + "type": "integer", + "format": "int64" + }, + "offline": { + "type": "integer", + "format": "int64" + }, + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/RuntimeStatsInfo" + } + } + }, + "title": "RuntimeStatsResponse", + "required": ["online", "offline", "list"] + }, + "RuntimeTransactionConsensusTx": { + "type": "object", + "properties": { + "method": { + "type": "string" + }, + "from": { + "type": "string" + }, + "to": { + "type": "string" + }, + "amount": { + "type": "string" + }, + "nonce": { + "type": "integer", + "format": "int64" + } + }, + "title": "RuntimeTransactionConsensusTx", + "required": ["method", "from", "to", "amount", "nonce"] + }, + "RuntimeTransactionEventError": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int64" + }, + "module": { + "type": "string" + } + }, + "title": "RuntimeTransactionEventError", + "required": ["code", "module"] + }, + "RuntimeTransactionEvmTx": { + "type": "object", + "properties": { + "hash": { + "type": "string" + }, + "from": { + "type": "string" + }, + "to": { + "type": "string" + }, + "nonce": { + "type": "integer", + "format": "int64" + }, + "gasPrice": { + "type": "integer", + "format": "int64" + }, + "gasLimit": { + "type": "integer", + "format": "int64" + }, + "data": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "title": "RuntimeTransactionEvmTx", + "required": ["hash", "from", "to", "nonce", "gasPrice", "gasLimit", "data", "value"] + }, + "RuntimeTransactionInfoRequest": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "round": { + "type": "integer", + "format": "int64" + }, + "hash": { + "type": "string" + } + }, + "title": "RuntimeTransactionInfoRequest", + "required": ["id", "round", "hash"] + }, + "RuntimeTransactionInfoResponse": { + "type": "object", + "properties": { + "runtimeId": { + "type": "string" + }, + "runtimeName": { + "type": "string" + }, + "txHash": { + "type": "string" + }, + "round": { + "type": "integer", + "format": "int64" + }, + "result": { + "type": "boolean", + "format": "boolean" + }, + "message": { + "type": "string" + }, + "timestamp": { + "type": "integer", + "format": "int64" + }, + "type": { + "type": "string" + }, + "ctx": { + "$ref": "#/definitions/RuntimeTransactionConsensusTx" + }, + "etx": { + "$ref": "#/definitions/RuntimeTransactionEvmTx" + }, + "events": { + "type": "object" + } + }, + "title": "RuntimeTransactionInfoResponse", + "required": [ + "runtimeId", + "runtimeName", + "txHash", + "round", + "result", + "message", + "timestamp", + "type", + "ctx", + "etx", + "events" + ] + }, + "RuntimeTransactionListInfo": { + "type": "object", + "properties": { + "runtimeId": { + "type": "string" + }, + "txHash": { + "type": "string" + }, + "round": { + "type": "integer", + "format": "int64" + }, + "result": { + "type": "boolean", + "format": "boolean" + }, + "timestamp": { + "type": "integer", + "format": "int64" + }, + "type": { + "type": "string" + } + }, + "title": "RuntimeTransactionListInfo", + "required": ["runtimeId", "txHash", "round", "result", "timestamp", "type"] + }, + "RuntimeTransactionListRequest": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "address": { + "type": "string" + }, + "round": { + "type": "integer", + "format": "int64" + }, + "page": { + "type": "integer", + "format": "int64", + "default": "1" + }, + "size": { + "type": "integer", + "format": "int64", + "default": "10" + } + }, + "title": "RuntimeTransactionListRequest", + "required": ["page", "size"] + }, + "RuntimeTransactionListResponse": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/RuntimeTransactionListInfo" + } + }, + "page": { + "type": "integer", + "format": "int64" + }, + "size": { + "type": "integer", + "format": "int64" + }, + "maxPage": { + "type": "integer", + "format": "int64" + }, + "totalSize": { + "type": "integer", + "format": "int64" + } + }, + "title": "RuntimeTransactionListResponse", + "required": ["list"] + }, + "ValidatorBlocksStatsInfo": { + "type": "object", + "properties": { + "height": { + "type": "integer", + "format": "int64" + }, + "block": { + "type": "boolean", + "format": "boolean" + } + }, + "title": "ValidatorBlocksStatsInfo", + "required": ["height", "block"] + }, + "ValidatorBlocksStatsRequest": { + "type": "object", + "properties": { + "address": { + "type": "string" + } + }, + "title": "ValidatorBlocksStatsRequest", + "required": ["address"] + }, + "ValidatorBlocksStatsResponse": { + "type": "object", + "properties": { + "signs": { + "type": "array", + "items": { + "$ref": "#/definitions/ValidatorBlocksStatsInfo" + } + }, + "proposals": { + "type": "array", + "items": { + "$ref": "#/definitions/ValidatorBlocksStatsInfo" + } + } + }, + "title": "ValidatorBlocksStatsResponse", + "required": ["signs", "proposals"] + }, + "ValidatorEscrowEventRequest": { + "type": "object", + "properties": { + "address": { + "type": "string" + }, + "page": { + "type": "integer", + "format": "int64", + "default": "1" + }, + "size": { + "type": "integer", + "format": "int64", + "default": "10" + } + }, + "title": "ValidatorEscrowEventRequest", + "required": ["address", "page", "size"] + }, + "ValidatorEscrowEventResponse": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/ChainTransactionListInfo" + } + }, + "page": { + "type": "integer", + "format": "int64" + }, + "size": { + "type": "integer", + "format": "int64" + }, + "maxPage": { + "type": "integer", + "format": "int64" + }, + "totalSize": { + "type": "integer", + "format": "int64" + } + }, + "title": "ValidatorEscrowEventResponse", + "required": ["list"] + }, + "ValidatorEscrowStatsInfo": { + "type": "object", + "properties": { + "timestamp": { + "type": "integer", + "format": "int64" + }, + "escrow": { + "type": "string" + } + }, + "title": "ValidatorEscrowStatsInfo", + "required": ["timestamp", "escrow"] + }, + "ValidatorEscrowStatsRequest": { + "type": "object", + "properties": { + "address": { + "type": "string" + } + }, + "title": "ValidatorEscrowStatsRequest", + "required": ["address"] + }, + "ValidatorEscrowStatsResponse": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/ValidatorEscrowStatsInfo" + } + } + }, + "title": "ValidatorEscrowStatsResponse", + "required": ["list"] + }, + "ValidatorInfo": { + "type": "object", + "properties": { + "rank": { + "type": "integer", + "format": "int32" + }, + "entityId": { + "type": "string" + }, + "entityAddress": { + "type": "string" + }, + "nodeId": { + "type": "string" + }, + "nodeAddress": { + "type": "string" + }, + "name": { + "type": "string" + }, + "icon": { + "type": "string" + }, + "website": { + "type": "string" + }, + "twitter": { + "type": "string" + }, + "keybase": { + "type": "string" + }, + "email": { + "type": "string" + }, + "description": { + "type": "string" + }, + "escrow": { + "type": "string" + }, + "escrowChange24": { + "type": "string" + }, + "escrowPercent": { + "type": "number", + "format": "double" + }, + "balance": { + "type": "string" + }, + "totalShares": { + "type": "string" + }, + "signs": { + "type": "integer", + "format": "int64" + }, + "proposals": { + "type": "integer", + "format": "int64" + }, + "nonce": { + "type": "integer", + "format": "int64" + }, + "score": { + "type": "integer", + "format": "int64" + }, + "delegators": { + "type": "integer", + "format": "int64" + }, + "nodes": { + "type": "array", + "items": { + "type": "string" + } + }, + "uptime": { + "type": "string" + }, + "active": { + "type": "boolean", + "format": "boolean" + }, + "commission": { + "type": "number", + "format": "double" + }, + "bound": { + "$ref": "#/definitions/Bound" + }, + "rates": { + "type": "array", + "items": { + "$ref": "#/definitions/Rate" + } + }, + "bounds": { + "type": "array", + "items": { + "$ref": "#/definitions/Bound" + } + }, + "escrowSharesStatus": { + "$ref": "#/definitions/EscrowStatus" + }, + "escrowAmountStatus": { + "$ref": "#/definitions/EscrowStatus" + }, + "runtimes": { + "type": "array", + "items": { + "$ref": "#/definitions/ValidatorRuntime" + } + }, + "status": { + "type": "boolean", + "format": "boolean" + } + }, + "title": "ValidatorInfo", + "required": [ + "rank", + "entityId", + "entityAddress", + "nodeId", + "nodeAddress", + "name", + "icon", + "website", + "twitter", + "keybase", + "email", + "description", + "escrow", + "escrowChange24", + "escrowPercent", + "balance", + "totalShares", + "signs", + "proposals", + "nonce", + "score", + "delegators", + "uptime", + "active", + "commission", + "rates", + "bounds", + "status" + ] + }, + "ValidatorInfoRequest": { + "type": "object", + "properties": { + "address": { + "type": "string" + } + }, + "title": "ValidatorInfoRequest", + "required": ["address"] + }, + "ValidatorInfoResponse": { + "type": "object", + "properties": { + "rank": { + "type": "integer", + "format": "int32" + }, + "entityId": { + "type": "string" + }, + "entityAddress": { + "type": "string" + }, + "nodeId": { + "type": "string" + }, + "nodeAddress": { + "type": "string" + }, + "name": { + "type": "string" + }, + "icon": { + "type": "string" + }, + "website": { + "type": "string" + }, + "twitter": { + "type": "string" + }, + "keybase": { + "type": "string" + }, + "email": { + "type": "string" + }, + "description": { + "type": "string" + }, + "escrow": { + "type": "string" + }, + "escrowChange24": { + "type": "string" + }, + "escrowPercent": { + "type": "number", + "format": "double" + }, + "balance": { + "type": "string" + }, + "totalShares": { + "type": "string" + }, + "signs": { + "type": "integer", + "format": "int64" + }, + "proposals": { + "type": "integer", + "format": "int64" + }, + "nonce": { + "type": "integer", + "format": "int64" + }, + "score": { + "type": "integer", + "format": "int64" + }, + "delegators": { + "type": "integer", + "format": "int64" + }, + "nodes": { + "type": "array", + "items": { + "type": "string" + } + }, + "uptime": { + "type": "string" + }, + "active": { + "type": "boolean", + "format": "boolean" + }, + "commission": { + "type": "number", + "format": "double" + }, + "bound": { + "$ref": "#/definitions/Bound" + }, + "rates": { + "type": "array", + "items": { + "$ref": "#/definitions/Rate" + } + }, + "bounds": { + "type": "array", + "items": { + "$ref": "#/definitions/Bound" + } + }, + "escrowSharesStatus": { + "$ref": "#/definitions/EscrowStatus" + }, + "escrowAmountStatus": { + "$ref": "#/definitions/EscrowStatus" + }, + "runtimes": { + "type": "array", + "items": { + "$ref": "#/definitions/ValidatorRuntime" + } + }, + "status": { + "type": "boolean", + "format": "boolean" + } + }, + "title": "ValidatorInfoResponse" + }, + "ValidatorListRequest": { + "type": "object", + "properties": { + "orderBy": { + "type": "string", + "default": "escrow" + }, + "sort": { + "type": "string", + "default": "desc" + } + }, + "title": "ValidatorListRequest", + "required": ["orderBy", "sort"] + }, + "ValidatorListResponse": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/ValidatorInfo" + } + }, + "active": { + "type": "integer", + "format": "int64" + }, + "inactive": { + "type": "integer", + "format": "int64" + }, + "delegators": { + "type": "integer", + "format": "int64" + } + }, + "title": "ValidatorListResponse", + "required": ["list", "active", "inactive", "delegators"] + }, + "ValidatorRuntime": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "string" + }, + "online": { + "type": "boolean", + "format": "boolean" + } + }, + "title": "ValidatorRuntime", + "required": ["name", "id", "online"] + }, + "ValidatorSignStatsInfo": { + "type": "object", + "properties": { + "dateTime": { + "type": "integer", + "format": "int64" + }, + "expected": { + "type": "integer", + "format": "int64" + }, + "actual": { + "type": "integer", + "format": "int64" + } + }, + "title": "ValidatorSignStatsInfo", + "required": ["dateTime", "expected", "actual"] + }, + "ValidatorSignStatsRequest": { + "type": "object", + "properties": { + "address": { + "type": "string" + } + }, + "title": "ValidatorSignStatsRequest", + "required": ["address"] + }, + "ValidatorSignStatsResponse": { + "type": "object", + "properties": { + "stats": { + "type": "array", + "items": { + "$ref": "#/definitions/ValidatorSignStatsInfo" + } + }, + "time": { + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + } + }, + "title": "ValidatorSignStatsResponse", + "required": ["stats", "time"] + } + }, + "securityDefinitions": { + "apiKey": { + "type": "apiKey", + "description": "Enter JWT Bearer token **_only_**", + "name": "Authorization", + "in": "header" + } + } +} From 2fa6cb0a28bcff528b5bc21388d35eccf11f335a Mon Sep 17 00:00:00 2001 From: Michal Zielenkiewicz Date: Wed, 23 Oct 2024 13:01:11 +0200 Subject: [PATCH 02/14] Define new APi backend --- src/app/components/ErrorFormatter/index.tsx | 1 + src/app/components/Footer/index.tsx | 1 + src/config.ts | 22 +++++++++++++++++++++ src/locales/en/translation.json | 2 ++ src/types/env.d.ts | 2 +- src/vendors/backend.ts | 2 ++ src/vendors/oasisscan-v2.ts | 12 +++++++++++ 7 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 src/vendors/oasisscan-v2.ts diff --git a/src/app/components/ErrorFormatter/index.tsx b/src/app/components/ErrorFormatter/index.tsx index 93c11501d0..037d78a5cd 100644 --- a/src/app/components/ErrorFormatter/index.tsx +++ b/src/app/components/ErrorFormatter/index.tsx @@ -22,6 +22,7 @@ export function ErrorFormatter(props: Props) { const backendToLabel = { [BackendAPIs.OasisMonitor]: t('backends.oasismonitor', 'Oasis Monitor API'), [BackendAPIs.OasisScan]: t('backends.oasisscan', 'Oasis Scan API'), + [BackendAPIs.OasisScanV2]: t('backends.oasisscanV2', 'Oasis Scan API v2'), [BackendAPIs.Nexus]: t('backends.nexus', 'Nexus API'), } diff --git a/src/app/components/Footer/index.tsx b/src/app/components/Footer/index.tsx index 81260eb030..f418aa9fde 100644 --- a/src/app/components/Footer/index.tsx +++ b/src/app/components/Footer/index.tsx @@ -27,6 +27,7 @@ export const Footer = memo(() => { const backendToLabel = { [BackendAPIs.OasisMonitor]: t('footer.poweredBy.oasismonitor', 'Oasis Monitor API & Oasis gRPC'), [BackendAPIs.OasisScan]: t('footer.poweredBy.oasisscan', 'Oasis Scan API & Oasis gRPC'), + [BackendAPIs.OasisScanV2]: t('footer.poweredBy.oasisscanV2', 'Oasis Scan API v2 & Oasis gRPC'), [BackendAPIs.Nexus]: t('footer.poweredBy.nexus', 'Nexus API & Oasis gRPC'), } const poweredByLabel = backendToLabel[backend()] diff --git a/src/config.ts b/src/config.ts index e76ba72b89..80252d3892 100644 --- a/src/config.ts +++ b/src/config.ts @@ -8,6 +8,7 @@ export const consensusDecimals = 9 export enum BackendAPIs { OasisMonitor = 'oasismonitor', OasisScan = 'oasisscan', + OasisScanV2 = 'oasisscanV2', Nexus = 'nexus', } @@ -24,6 +25,7 @@ type BackendProviders = { min_delegation: number // from nic.stakingConsensusParameters().min_delegation [BackendAPIs.OasisMonitor]: BackendApiUrls [BackendAPIs.OasisScan]: BackendApiUrls + [BackendAPIs.OasisScanV2]: BackendApiUrls [BackendAPIs.Nexus]: BackendApiUrls } @@ -46,6 +48,12 @@ export const config: BackendConfig = { blockExplorerParatimes: 'https://oasisscan.com/paratimes/transactions/{{txHash}}?runtime={{runtimeId}}', blockExplorerAccount: 'https://www.oasisscan.com/accounts/detail/{{address}}', }, + [BackendAPIs.OasisScanV2]: { + explorer: 'https://api.oasisscan.com/v2/mainnet', + blockExplorer: 'https://oasisscan.com/transactions/{{txHash}}', + blockExplorerParatimes: 'https://oasisscan.com/paratimes/transactions/{{txHash}}?runtime={{runtimeId}}', + blockExplorerAccount: 'https://www.oasisscan.com/accounts/detail/{{address}}', + }, [BackendAPIs.Nexus]: { explorer: 'https://nexus.oasis.io/v1', blockExplorer: 'https://oasisscan.com/transactions/{{txHash}}', @@ -67,6 +75,13 @@ export const config: BackendConfig = { blockExplorerParatimes: 'https://testnet.oasisscan.com/paratimes/tx/{{txHash}}', blockExplorerAccount: 'https://testnet.oasisscan.com/accounts/detail/{{address}}', }, + [BackendAPIs.OasisScanV2]: { + explorer: 'https://api.oasisscan.com/testnet', + blockExplorer: 'https://testnet.oasisscan.com/transactions/{{txHash}}', + blockExplorerParatimes: + 'https://testnet.oasisscan.com/paratimes/transactions/{{txHash}}?runtime={{runtimeId}}', + blockExplorerAccount: 'https://testnet.oasisscan.com/accounts/detail/{{address}}', + }, [BackendAPIs.Nexus]: { explorer: 'https://testnet.nexus.oasis.io/v1', blockExplorer: 'https://testnet.oasisscan.com/transactions/{{txHash}}', @@ -89,6 +104,13 @@ export const config: BackendConfig = { 'http://localhost:9001/data/paratimes/transactions/{{txHash}}?runtime={{runtimeId}}', blockExplorerAccount: 'http://localhost:9001/data/accounts/detail/{{address}}', }, + [BackendAPIs.OasisScanV2]: { + explorer: 'http://localhost:9001', + blockExplorer: 'http://localhost:9001/data/transactions?operation_id={{txHash}}', + blockExplorerParatimes: + 'http://localhost:9001/data/paratimes/transactions/{{txHash}}?runtime={{runtimeId}}', + blockExplorerAccount: 'http://localhost:9001/data/accounts/detail/{{address}}', + }, [BackendAPIs.Nexus]: { explorer: 'http://localhost:9001', blockExplorer: 'http://localhost:9001/data/transactions?operation_id={{txHash}}', diff --git a/src/locales/en/translation.json b/src/locales/en/translation.json index a9c2fb1619..b9ca2ea74f 100644 --- a/src/locales/en/translation.json +++ b/src/locales/en/translation.json @@ -108,6 +108,7 @@ "backends": { "oasismonitor": "Oasis Monitor API", "oasisscan": "Oasis Scan API", + "oasisscanV2": "Oasis Scan API v2", "nexus": "Nexus API" }, "banner": { @@ -200,6 +201,7 @@ "poweredBy": { "oasismonitor": "Oasis Monitor API & Oasis gRPC", "oasisscan": "Oasis Scan API & Oasis gRPC", + "oasisscanV2": "Oasis Scan API v2 & Oasis gRPC", "nexus": "Nexus API & Oasis gRPC" }, "terms": "Terms and Conditions", diff --git a/src/types/env.d.ts b/src/types/env.d.ts index de0c18ab2a..2729c5c38e 100644 --- a/src/types/env.d.ts +++ b/src/types/env.d.ts @@ -1,6 +1,6 @@ declare namespace NodeJS { export interface ProcessEnv { - REACT_APP_BACKEND: 'oasismonitor' | 'oasisscan' | 'nexus' + REACT_APP_BACKEND: 'oasismonitor' | 'oasisscan' | 'oasisscanV2' | 'nexus' REACT_APP_TRANSAK_URL: string REACT_APP_TRANSAK_PARTNER_ID: string REACT_APP_LOCALNET: '1' | undefined diff --git a/src/vendors/backend.ts b/src/vendors/backend.ts index cad79ba741..f1501dff56 100644 --- a/src/vendors/backend.ts +++ b/src/vendors/backend.ts @@ -1,11 +1,13 @@ import { getMonitorAPIs } from 'vendors/monitor' import { getOasisscanAPIs } from 'vendors/oasisscan' +import { getOasisscanV2APIs } from 'vendors/oasisscan-v2' import { getNexusAPIs } from 'vendors/nexus' import { BackendAPIs } from 'config' const backendNameToApi = { [BackendAPIs.OasisMonitor]: getMonitorAPIs, [BackendAPIs.OasisScan]: getOasisscanAPIs, + [BackendAPIs.OasisScanV2]: getOasisscanV2APIs, [BackendAPIs.Nexus]: getNexusAPIs, } diff --git a/src/vendors/oasisscan-v2.ts b/src/vendors/oasisscan-v2.ts new file mode 100644 index 0000000000..ae1101a46c --- /dev/null +++ b/src/vendors/oasisscan-v2.ts @@ -0,0 +1,12 @@ +import { Configuration } from 'vendors/oasisscan-v2/index' + +import { throwAPIErrors } from './helpers' + +export function getOasisscanV2APIs(url: string | 'https://api.oasisscan.com/v2/mainnet') { + const explorerConfig = new Configuration({ + basePath: url, + ...throwAPIErrors, + }) + + return {} +} From c96f4cf9a46aba806ecf244ece6162aaab345997 Mon Sep 17 00:00:00 2001 From: Michal Zielenkiewicz Date: Wed, 23 Oct 2024 13:02:52 +0200 Subject: [PATCH 03/14] Add Oasis Scan V2 validators list API --- src/vendors/oasisscan-v2.ts | 42 +++++++++++++++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 2 deletions(-) diff --git a/src/vendors/oasisscan-v2.ts b/src/vendors/oasisscan-v2.ts index ae1101a46c..eb74b52b6c 100644 --- a/src/vendors/oasisscan-v2.ts +++ b/src/vendors/oasisscan-v2.ts @@ -1,4 +1,6 @@ -import { Configuration } from 'vendors/oasisscan-v2/index' +import { Validator } from 'app/state/staking/types' +import { parseRoseStringToBaseUnitString } from 'app/lib/helpers' +import { Configuration, ValidatorApi, ValidatorInfo } from 'vendors/oasisscan-v2/index' import { throwAPIErrors } from './helpers' @@ -8,5 +10,41 @@ export function getOasisscanV2APIs(url: string | 'https://api.oasisscan.com/v2/m ...throwAPIErrors, }) - return {} + const validatorApi = new ValidatorApi(explorerConfig) + + async function getAllValidators(): Promise { + const validators = await validatorApi.validatorListHandler({ orderBy: 'escrow', sort: 'desc' }) + if (!validators) throw new Error('Wrong response code') + + return parseValidatorsList(validators.list) + } + + async function getTransactionsList(params: { accountId: string; limit: number }) { + return [] + } + + return { + getAllValidators, + getTransactionsList, + } +} + +function parseValidatorsList(validators: ValidatorInfo[]): Validator[] { + return validators.map(v => { + const parsed: Validator = { + address: v.entityAddress, + name: v.name ?? undefined, + escrow: parseRoseStringToBaseUnitString(v.escrow), + current_rate: v.commission, + status: v.status ? 'active' : 'inactive', + media: { + email_address: v.email ?? undefined, + logotype: v.icon ?? undefined, + twitter_acc: v.twitter ?? undefined, + website_link: v.website ?? undefined, + }, + rank: v.rank, + } + return parsed + }) } From 5c6c03df6cf9b15516fa83f0ef9612d97c5b791b Mon Sep 17 00:00:00 2001 From: Michal Zielenkiewicz Date: Wed, 23 Oct 2024 14:43:02 +0200 Subject: [PATCH 04/14] Add Oasis Scan V2 delegations API --- src/vendors/oasisscan-v2.ts | 62 +++++++++++++++++++++++++++++++++++-- 1 file changed, 60 insertions(+), 2 deletions(-) diff --git a/src/vendors/oasisscan-v2.ts b/src/vendors/oasisscan-v2.ts index eb74b52b6c..a984582986 100644 --- a/src/vendors/oasisscan-v2.ts +++ b/src/vendors/oasisscan-v2.ts @@ -1,6 +1,14 @@ -import { Validator } from 'app/state/staking/types' +import * as oasis from '@oasisprotocol/client' +import { DebondingDelegation, Delegation, Validator } from 'app/state/staking/types' import { parseRoseStringToBaseUnitString } from 'app/lib/helpers' -import { Configuration, ValidatorApi, ValidatorInfo } from 'vendors/oasisscan-v2/index' +import { + AccountApi, + AccountDebondingInfo, + AccountDelegationsInfo, + Configuration, + ValidatorApi, + ValidatorInfo, +} from 'vendors/oasisscan-v2/index' import { throwAPIErrors } from './helpers' @@ -10,6 +18,7 @@ export function getOasisscanV2APIs(url: string | 'https://api.oasisscan.com/v2/m ...throwAPIErrors, }) + const accountApi = new AccountApi(explorerConfig) const validatorApi = new ValidatorApi(explorerConfig) async function getAllValidators(): Promise { @@ -23,9 +32,34 @@ export function getOasisscanV2APIs(url: string | 'https://api.oasisscan.com/v2/m return [] } + async function getDelegations(params: { accountId: string; nic: oasis.client.NodeInternal }): Promise<{ + delegations: Delegation[] + debonding: DebondingDelegation[] + }> { + const delegations = await accountApi.accountDelegationsHandler({ + all: true, + address: params.accountId, + page: 1, + size: 500, + }) + const debonding = await accountApi.accountDebondingHandler({ + address: params.accountId, + page: 1, + size: 500, + }) + if (!delegations) throw new Error('Wrong response code') + if (!debonding) throw new Error('Wrong response code') + + return { + delegations: parseDelegations(delegations.list), + debonding: parseDebonding(debonding.list), + } + } + return { getAllValidators, getTransactionsList, + getDelegations, } } @@ -48,3 +82,27 @@ function parseValidatorsList(validators: ValidatorInfo[]): Validator[] { return parsed }) } + +export function parseDelegations(delegations: AccountDelegationsInfo[]): Delegation[] { + return delegations.map(delegation => { + const parsed: Delegation = { + amount: parseRoseStringToBaseUnitString(delegation.amount), + shares: parseRoseStringToBaseUnitString(delegation.shares), + validatorAddress: delegation.validatorAddress ?? delegation.entityAddress, + } + return parsed + }) +} +export function parseDebonding(debonding: AccountDebondingInfo[]): DebondingDelegation[] { + return debonding.map(debonding => { + const parsed: DebondingDelegation = { + // TODO: use amount field, or share price when it is available. Until then, + // using shares is inaccurate if debonding pool gets slashed. + amount: parseRoseStringToBaseUnitString(debonding.shares), + shares: parseRoseStringToBaseUnitString(debonding.shares), + validatorAddress: debonding.validatorAddress, + epoch: debonding.debondEnd, + } + return parsed + }) +} From 3f728f133726a56bc7ff66d30524d42065794b7a Mon Sep 17 00:00:00 2001 From: Michal Zielenkiewicz Date: Wed, 23 Oct 2024 15:12:43 +0200 Subject: [PATCH 05/14] Add Oasis Scan V2 account info API --- src/vendors/oasisscan-v2.ts | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/vendors/oasisscan-v2.ts b/src/vendors/oasisscan-v2.ts index a984582986..6b190da1f5 100644 --- a/src/vendors/oasisscan-v2.ts +++ b/src/vendors/oasisscan-v2.ts @@ -1,10 +1,12 @@ import * as oasis from '@oasisprotocol/client' +import { Account } from 'app/state/account/types' import { DebondingDelegation, Delegation, Validator } from 'app/state/staking/types' import { parseRoseStringToBaseUnitString } from 'app/lib/helpers' import { AccountApi, AccountDebondingInfo, AccountDelegationsInfo, + AccountInfoResponse, Configuration, ValidatorApi, ValidatorInfo, @@ -21,6 +23,13 @@ export function getOasisscanV2APIs(url: string | 'https://api.oasisscan.com/v2/m const accountApi = new AccountApi(explorerConfig) const validatorApi = new ValidatorApi(explorerConfig) + async function getAccount(address: string): Promise { + const account = await accountApi.accountInfoHandler({ address }) + if (!account) throw new Error('Wrong response code') + + return parseAccount(account) + } + async function getAllValidators(): Promise { const validators = await validatorApi.validatorListHandler({ orderBy: 'escrow', sort: 'desc' }) if (!validators) throw new Error('Wrong response code') @@ -57,12 +66,28 @@ export function getOasisscanV2APIs(url: string | 'https://api.oasisscan.com/v2/m } return { + getAccount, getAllValidators, getTransactionsList, getDelegations, } } +function parseAccount(account: AccountInfoResponse): Account { + return { + address: account.address, + allowances: account.allowances.map(allowance => ({ + address: allowance.address, + amount: parseRoseStringToBaseUnitString(allowance.amount), + })), + available: parseRoseStringToBaseUnitString(account.available), + delegations: parseRoseStringToBaseUnitString(account.escrow), + debonding: parseRoseStringToBaseUnitString(account.debonding), + total: parseRoseStringToBaseUnitString(account.total), + nonce: BigInt(account.nonce ?? 0).toString(), + } +} + function parseValidatorsList(validators: ValidatorInfo[]): Validator[] { return validators.map(v => { const parsed: Validator = { From e2ca4b4fba957378be35cb2d3e504f4ca9f15e8d Mon Sep 17 00:00:00 2001 From: Michal Zielenkiewicz Date: Wed, 23 Oct 2024 16:21:48 +0200 Subject: [PATCH 06/14] Add Oasis Scan V2 transaction API --- src/vendors/oasisscan-v2.ts | 65 ++++++++++++++++++++++++++++++++++++- 1 file changed, 64 insertions(+), 1 deletion(-) diff --git a/src/vendors/oasisscan-v2.ts b/src/vendors/oasisscan-v2.ts index 6b190da1f5..550d5bf15a 100644 --- a/src/vendors/oasisscan-v2.ts +++ b/src/vendors/oasisscan-v2.ts @@ -1,5 +1,6 @@ import * as oasis from '@oasisprotocol/client' import { Account } from 'app/state/account/types' +import { Transaction, TransactionStatus, TransactionType } from 'app/state/transaction/types' import { DebondingDelegation, Delegation, Validator } from 'app/state/staking/types' import { parseRoseStringToBaseUnitString } from 'app/lib/helpers' import { @@ -7,6 +8,9 @@ import { AccountDebondingInfo, AccountDelegationsInfo, AccountInfoResponse, + ChainApi, + ChainTransactionInfoResponse, + ChainTransactionListInfo, Configuration, ValidatorApi, ValidatorInfo, @@ -14,6 +18,8 @@ import { import { throwAPIErrors } from './helpers' +const getTransactionCacheMap: Record = {} + export function getOasisscanV2APIs(url: string | 'https://api.oasisscan.com/v2/mainnet') { const explorerConfig = new Configuration({ basePath: url, @@ -21,6 +27,7 @@ export function getOasisscanV2APIs(url: string | 'https://api.oasisscan.com/v2/m }) const accountApi = new AccountApi(explorerConfig) + const chainApi = new ChainApi(explorerConfig) const validatorApi = new ValidatorApi(explorerConfig) async function getAccount(address: string): Promise { @@ -37,8 +44,43 @@ export function getOasisscanV2APIs(url: string | 'https://api.oasisscan.com/v2/m return parseValidatorsList(validators.list) } + function getTransactionUrl({ hash }: { hash: string }) { + return `${url}/chain/transaction/${hash}` + } + + async function getTransaction({ hash }: { hash: string }) { + const cacheId = getTransactionUrl({ hash }) + + if (cacheId in getTransactionCacheMap) { + return getTransactionCacheMap[cacheId] + } + + const transaction = await chainApi.chainTransactionInfoHandler({ + hash, + }) + + if (transaction) { + getTransactionCacheMap[cacheId] = transaction + } + + return transaction + } + async function getTransactionsList(params: { accountId: string; limit: number }) { - return [] + const transactionsList = await chainApi.chainTransactionsHandler({ + address: params.accountId, + size: params.limit, + page: 1, + }) + if (!transactionsList) throw new Error('Wrong response code') + const list = await Promise.all( + transactionsList.list.map(async tx => { + const { nonce } = await getTransaction({ hash: tx.txHash! }) + return { ...tx, nonce } + }), + ) + + return parseTransactionsList(list) } async function getDelegations(params: { accountId: string; nic: oasis.client.NodeInternal }): Promise<{ @@ -108,6 +150,27 @@ function parseValidatorsList(validators: ValidatorInfo[]): Validator[] { }) } +function parseTransactionsList(list: ChainTransactionListInfo[]): Transaction[] { + return list.map(t => { + const parsed: Transaction = { + amount: t.amount == null ? undefined : parseRoseStringToBaseUnitString(t.amount), + fee: t.fee ? parseRoseStringToBaseUnitString(t.fee) : undefined, + from: t.from, + hash: t.txHash!, + level: t.height, + status: t.status ? TransactionStatus.Successful : TransactionStatus.Failed, + timestamp: t.timestamp ? t.timestamp * 1000 : undefined, + to: t.to ?? undefined, + type: t.method as TransactionType, + runtimeName: undefined, + runtimeId: undefined, + round: undefined, + nonce: undefined, + } + return parsed + }) +} + export function parseDelegations(delegations: AccountDelegationsInfo[]): Delegation[] { return delegations.map(delegation => { const parsed: Delegation = { From aa3d6bc2befcb7f5f15b167949fc53d73c860f53 Mon Sep 17 00:00:00 2001 From: Michal Zielenkiewicz Date: Wed, 23 Oct 2024 18:08:52 +0200 Subject: [PATCH 07/14] Sync settings.json --- .vscode/settings.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.vscode/settings.json b/.vscode/settings.json index b63cf3a847..54de90e236 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -39,6 +39,12 @@ "src/vendors/oasisscan/.openapi-generator-ignore": true, "src/vendors/oasisscan/runtime.ts": true, "src/vendors/oasisscan/index.ts": true, + "src/vendors/oasisscan-v2/apis": true, + "src/vendors/oasisscan-v2/models": true, + "src/vendors/oasisscan-v2/.openapi-generator": true, + "src/vendors/oasisscan-v2/.openapi-generator-ignore": true, + "src/vendors/oasisscan-v2/runtime.ts": true, + "src/vendors/oasisscan-v2/index.ts": true, "src/vendors/nexus/apis": true, "src/vendors/nexus/models": true, "src/vendors/nexus/.openapi-generator": true, From 1e3a34d3655a598ae512eb537f6c5e44e42f2b31 Mon Sep 17 00:00:00 2001 From: Michal Zielenkiewicz Date: Wed, 23 Oct 2024 18:09:05 +0200 Subject: [PATCH 08/14] Add changelog --- .changelog/2075.feature.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 .changelog/2075.feature.md diff --git a/.changelog/2075.feature.md b/.changelog/2075.feature.md new file mode 100644 index 0000000000..9abc00110f --- /dev/null +++ b/.changelog/2075.feature.md @@ -0,0 +1 @@ +Add support for Oasis Scan API v2 as a backend option for Wallet From e37a9bc4a8e22ecb9584f1e65be326644be473d9 Mon Sep 17 00:00:00 2001 From: Michal Zielenkiewicz Date: Tue, 5 Nov 2024 11:26:40 +0100 Subject: [PATCH 09/14] Add Oasis Scan V2 runtime transaction API --- src/vendors/oasisscan-v2.ts | 94 ++++++++++++++++++++++++++++++------- 1 file changed, 76 insertions(+), 18 deletions(-) diff --git a/src/vendors/oasisscan-v2.ts b/src/vendors/oasisscan-v2.ts index 550d5bf15a..5ff86c8e5e 100644 --- a/src/vendors/oasisscan-v2.ts +++ b/src/vendors/oasisscan-v2.ts @@ -12,6 +12,8 @@ import { ChainTransactionInfoResponse, ChainTransactionListInfo, Configuration, + RuntimeApi, + RuntimeTransactionInfoResponse, ValidatorApi, ValidatorInfo, } from 'vendors/oasisscan-v2/index' @@ -19,6 +21,7 @@ import { import { throwAPIErrors } from './helpers' const getTransactionCacheMap: Record = {} +const getRuntimeTransactionInfoCacheMap: Record = {} export function getOasisscanV2APIs(url: string | 'https://api.oasisscan.com/v2/mainnet') { const explorerConfig = new Configuration({ @@ -29,6 +32,7 @@ export function getOasisscanV2APIs(url: string | 'https://api.oasisscan.com/v2/m const accountApi = new AccountApi(explorerConfig) const chainApi = new ChainApi(explorerConfig) const validatorApi = new ValidatorApi(explorerConfig) + const runtimeApi = new RuntimeApi(explorerConfig) async function getAccount(address: string): Promise { const account = await accountApi.accountInfoHandler({ address }) @@ -44,6 +48,32 @@ export function getOasisscanV2APIs(url: string | 'https://api.oasisscan.com/v2/m return parseValidatorsList(validators.list) } + function getRuntimeTransactionInfoUrl(filter: { id: string; hash: string }) { + const searchParams = new URLSearchParams(filter) + searchParams.sort() + return `${url}/runtime/transaction/info?${searchParams.toString()}` + } + + async function getRuntimeTransactionInfo(tx: ChainTransactionListInfo) { + const cacheId = getRuntimeTransactionInfoUrl({ id: tx.runtimeId!, hash: tx.txHash! }) + + if (cacheId in getRuntimeTransactionInfoCacheMap) { + return getRuntimeTransactionInfoCacheMap[cacheId] + } + + const runtimeTransaction = await runtimeApi.runtimeTransactionInfoHandler({ + id: tx.runtimeId!, + hash: tx.txHash!, + round: tx.round!, + }) + + if (runtimeTransaction) { + getRuntimeTransactionInfoCacheMap[cacheId] = runtimeTransaction + } + + return runtimeTransaction + } + function getTransactionUrl({ hash }: { hash: string }) { return `${url}/chain/transaction/${hash}` } @@ -71,12 +101,18 @@ export function getOasisscanV2APIs(url: string | 'https://api.oasisscan.com/v2/m address: params.accountId, size: params.limit, page: 1, + runtime: true, }) if (!transactionsList) throw new Error('Wrong response code') + const list = await Promise.all( transactionsList.list.map(async tx => { - const { nonce } = await getTransaction({ hash: tx.txHash! }) - return { ...tx, nonce } + if (tx.txType === 'runtime') { + return await getRuntimeTransactionInfo(tx) + } else { + const { nonce } = await getTransaction({ hash: tx.txHash! }) + return { ...tx, nonce } + } }), ) @@ -150,24 +186,46 @@ function parseValidatorsList(validators: ValidatorInfo[]): Validator[] { }) } -function parseTransactionsList(list: ChainTransactionListInfo[]): Transaction[] { +function parseTransactionsList( + list: (ChainTransactionListInfo | RuntimeTransactionInfoResponse)[], +): Transaction[] { return list.map(t => { - const parsed: Transaction = { - amount: t.amount == null ? undefined : parseRoseStringToBaseUnitString(t.amount), - fee: t.fee ? parseRoseStringToBaseUnitString(t.fee) : undefined, - from: t.from, - hash: t.txHash!, - level: t.height, - status: t.status ? TransactionStatus.Successful : TransactionStatus.Failed, - timestamp: t.timestamp ? t.timestamp * 1000 : undefined, - to: t.to ?? undefined, - type: t.method as TransactionType, - runtimeName: undefined, - runtimeId: undefined, - round: undefined, - nonce: undefined, + if ('ctx' in t) { + const parsed: Transaction = { + amount: t.ctx.amount == null ? undefined : parseRoseStringToBaseUnitString(t.ctx.amount), + fee: undefined, + from: t.ctx.from, + hash: t.txHash, + level: undefined, + status: t.result ? TransactionStatus.Successful : TransactionStatus.Failed, + timestamp: t.timestamp * 1000, + to: t.ctx.to ?? undefined, + type: t.ctx.method as TransactionType, + runtimeName: t.runtimeName, + runtimeId: t.runtimeId, + round: t.round, + nonce: + t.ctx?.nonce ?? t.etx?.nonce != null ? BigInt(t.ctx?.nonce ?? t.etx?.nonce).toString() : undefined, + } + return parsed + } else { + const parsed: Transaction = { + amount: t.amount == null ? undefined : parseRoseStringToBaseUnitString(t.amount), + fee: t.fee ? parseRoseStringToBaseUnitString(t.fee) : undefined, + from: t.from, + hash: t.txHash!, + level: t.height, + status: t.status ? TransactionStatus.Successful : TransactionStatus.Failed, + timestamp: t.timestamp ? t.timestamp * 1000 : undefined, + to: t.to ?? undefined, + type: t.method as TransactionType, + runtimeName: undefined, + runtimeId: undefined, + round: undefined, + nonce: undefined, + } + return parsed } - return parsed }) } From cf02d4416e2063b20aab9b4cb918dc1e00cfa598 Mon Sep 17 00:00:00 2001 From: Michal Zielenkiewicz Date: Tue, 5 Nov 2024 20:56:24 +0100 Subject: [PATCH 10/14] Fix auto-generated files --- src/vendors/oasisscan-v2/apis/AccountApi.ts | 6 +++--- src/vendors/oasisscan-v2/apis/ChainApi.ts | 4 ++-- src/vendors/oasisscan-v2/apis/RuntimeApi.ts | 2 +- src/vendors/oasisscan-v2/apis/ValidatorApi.ts | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/vendors/oasisscan-v2/apis/AccountApi.ts b/src/vendors/oasisscan-v2/apis/AccountApi.ts index bf7a0de4af..687a4a0fdc 100644 --- a/src/vendors/oasisscan-v2/apis/AccountApi.ts +++ b/src/vendors/oasisscan-v2/apis/AccountApi.ts @@ -122,7 +122,7 @@ export class AccountApi extends runtime.BaseAPI { query: queryParameters, }); - return new runtime.JSONApiResponse(response, (jsonValue) => AccountDebondingResponseFromJSON(jsonValue)); + return new runtime.JSONApiResponse(response, (jsonValue) => AccountDebondingResponseFromJSON(jsonValue.data)); } /** @@ -178,7 +178,7 @@ export class AccountApi extends runtime.BaseAPI { query: queryParameters, }); - return new runtime.JSONApiResponse(response, (jsonValue) => AccountDelegationsResponseFromJSON(jsonValue)); + return new runtime.JSONApiResponse(response, (jsonValue) => AccountDelegationsResponseFromJSON(jsonValue.data)); } /** @@ -206,7 +206,7 @@ export class AccountApi extends runtime.BaseAPI { query: queryParameters, }); - return new runtime.JSONApiResponse(response, (jsonValue) => AccountInfoResponseFromJSON(jsonValue)); + return new runtime.JSONApiResponse(response, (jsonValue) => AccountInfoResponseFromJSON(jsonValue.data)); } /** diff --git a/src/vendors/oasisscan-v2/apis/ChainApi.ts b/src/vendors/oasisscan-v2/apis/ChainApi.ts index a948321186..e282b7e086 100644 --- a/src/vendors/oasisscan-v2/apis/ChainApi.ts +++ b/src/vendors/oasisscan-v2/apis/ChainApi.ts @@ -261,7 +261,7 @@ export class ChainApi extends runtime.BaseAPI { query: queryParameters, }); - return new runtime.JSONApiResponse(response, (jsonValue) => ChainTransactionInfoResponseFromJSON(jsonValue)); + return new runtime.JSONApiResponse(response, (jsonValue) => ChainTransactionInfoResponseFromJSON(jsonValue.data)); } /** @@ -321,7 +321,7 @@ export class ChainApi extends runtime.BaseAPI { query: queryParameters, }); - return new runtime.JSONApiResponse(response, (jsonValue) => ChainTransactionsResponseFromJSON(jsonValue)); + return new runtime.JSONApiResponse(response, (jsonValue) => ChainTransactionsResponseFromJSON(jsonValue.data)); } /** diff --git a/src/vendors/oasisscan-v2/apis/RuntimeApi.ts b/src/vendors/oasisscan-v2/apis/RuntimeApi.ts index db8319e185..441db273cc 100644 --- a/src/vendors/oasisscan-v2/apis/RuntimeApi.ts +++ b/src/vendors/oasisscan-v2/apis/RuntimeApi.ts @@ -251,7 +251,7 @@ export class RuntimeApi extends runtime.BaseAPI { query: queryParameters, }); - return new runtime.JSONApiResponse(response, (jsonValue) => RuntimeTransactionInfoResponseFromJSON(jsonValue)); + return new runtime.JSONApiResponse(response, (jsonValue) => RuntimeTransactionInfoResponseFromJSON(jsonValue.data)); } /** diff --git a/src/vendors/oasisscan-v2/apis/ValidatorApi.ts b/src/vendors/oasisscan-v2/apis/ValidatorApi.ts index 1032c2ebac..f26b374a2d 100644 --- a/src/vendors/oasisscan-v2/apis/ValidatorApi.ts +++ b/src/vendors/oasisscan-v2/apis/ValidatorApi.ts @@ -298,7 +298,7 @@ export class ValidatorApi extends runtime.BaseAPI { query: queryParameters, }); - return new runtime.JSONApiResponse(response, (jsonValue) => ValidatorListResponseFromJSON(jsonValue)); + return new runtime.JSONApiResponse(response, (jsonValue) => ValidatorListResponseFromJSON(jsonValue.data)); } /** From 3fb6c86106d0d483a55bdfbeccfe8ed8f3555243 Mon Sep 17 00:00:00 2001 From: Michal Zielenkiewicz Date: Tue, 5 Nov 2024 12:56:20 +0100 Subject: [PATCH 11/14] Add note about Oasis Scan v2 missing data --- .../AccountPage/Features/TransactionHistory/index.tsx | 8 +++++++- src/locales/en/translation.json | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/app/pages/AccountPage/Features/TransactionHistory/index.tsx b/src/app/pages/AccountPage/Features/TransactionHistory/index.tsx index 3098659b09..329e62ac13 100644 --- a/src/app/pages/AccountPage/Features/TransactionHistory/index.tsx +++ b/src/app/pages/AccountPage/Features/TransactionHistory/index.tsx @@ -115,7 +115,13 @@ export function TransactionHistory() { background="background-front" pad="large" > - {t('account.summary.noTransactionFound', 'No transactions found.')} + {process.env.REACT_APP_BACKEND === 'oasisscanV2' ? ( + + {t('account.summary.noTransactionFoundOasisscanV2', 'No transactions since November 29, 2023.')} + + ) : ( + {t('account.summary.noTransactionFound', 'No transactions found.')} + )} )} diff --git a/src/locales/en/translation.json b/src/locales/en/translation.json index b9ca2ea74f..5c8eb8b324 100644 --- a/src/locales/en/translation.json +++ b/src/locales/en/translation.json @@ -49,6 +49,7 @@ "total": "Total" }, "noTransactionFound": "No transactions found.", + "noTransactionFoundOasisscanV2": "No transactions since November 29, 2023.", "noWalletIsOpen": "To send, receive, stake and swap {{ticker}} tokens, open your wallet.", "notYourAccount": "This is not your account.", "pendingTransactions": "Pending transactions", From 581b763a92b5f5290a5194ca662209f4daaa53c3 Mon Sep 17 00:00:00 2001 From: Michal Zielenkiewicz Date: Tue, 5 Nov 2024 16:24:10 +0100 Subject: [PATCH 12/14] Hide pending transactions for accounts with missing historical txs --- src/app/state/account/selectors.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/app/state/account/selectors.ts b/src/app/state/account/selectors.ts index f4f429c5d0..d4bd684a64 100644 --- a/src/app/state/account/selectors.ts +++ b/src/app/state/account/selectors.ts @@ -26,6 +26,11 @@ export const selectPendingTransactionForAccount = createSelector( export const hasAccountUnknownPendingTransactions = createSelector( [selectAccountNonce, selectTransactions, selectAccountAddress], (accountNonce, transactions, accountAddress) => { + if (!transactions.length && accountNonce && process.env.REACT_APP_BACKEND === 'oasisscanV2') { + // Don't bother when tx list is empty in this case. Oasis Scan v2 API is missing historical data. + // Account have nonce and 0 transactions due to last correctly indexed block 16817956 (2023-11-29) + return false + } const noncesFromTxs = transactions .filter(tx => !tx.runtimeId) .filter(tx => tx.from !== undefined) @@ -36,6 +41,8 @@ export const hasAccountUnknownPendingTransactions = createSelector( if (noncesFromTxs.length <= 0) { // TODO: last transaction that affected nonce is not in the initial page of account's transactions if (transactions.length >= TRANSACTIONS_LIMIT) return false + // if we cannot find any noncesFromTxs this probably means that account is missing some part of historical data + if (!noncesFromTxs.length && process.env.REACT_APP_BACKEND === 'oasisscanV2') return false // Waiting for first transactions return BigInt(accountNonce) > 0n } From bb5e6a875ae8d87d09a3bcb083ec61da69af1bf2 Mon Sep 17 00:00:00 2001 From: Michal Zielenkiewicz Date: Wed, 13 Nov 2024 10:51:42 +0100 Subject: [PATCH 13/14] Add unit test for Oasis Scan v2 empty tx list --- .../TransactionHistory/__tests__/index.test.tsx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/app/pages/AccountPage/Features/TransactionHistory/__tests__/index.test.tsx b/src/app/pages/AccountPage/Features/TransactionHistory/__tests__/index.test.tsx index 65523a5ffc..1ae9349f68 100644 --- a/src/app/pages/AccountPage/Features/TransactionHistory/__tests__/index.test.tsx +++ b/src/app/pages/AccountPage/Features/TransactionHistory/__tests__/index.test.tsx @@ -81,11 +81,16 @@ const getState = ({ } describe('', () => { + const originalEnv = process.env.REACT_APP_BACKEND beforeEach(() => { // Ignore dispatches to fetch account from AccountPage jest.mocked(useDispatch).mockImplementation(() => jest.fn()) }) + afterEach(() => { + process.env.REACT_APP_BACKEND = originalEnv + }) + it('should not display any pending or completed txs', async () => { renderCmp(getState()) @@ -110,6 +115,13 @@ describe('', () => { ) }) + it('should display different no transactions message for Oasis Scan v2', async () => { + process.env.REACT_APP_BACKEND = 'oasisscanV2' + renderCmp(getState({ accountNonce: 1n })) + + expect(await screen.findByText('account.summary.noTransactionFoundOasisscanV2')).toBeInTheDocument() + }) + it('should display pending txs alert with single pending tx and no completed transactions', async () => { renderCmp(getState({ accountNonce: 0n, pendingLocalTxs: [getPendingTx('txHash1')] })) From 52e8cbd17e18d1672057bb4a6170b0cb727fc086 Mon Sep 17 00:00:00 2001 From: Michal Zielenkiewicz Date: Wed, 13 Nov 2024 11:03:13 +0100 Subject: [PATCH 14/14] Check Oasis Scan V2 missing data in e2e tests --- playwright/tests/oasis-scan-v2.spec.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 playwright/tests/oasis-scan-v2.spec.ts diff --git a/playwright/tests/oasis-scan-v2.spec.ts b/playwright/tests/oasis-scan-v2.spec.ts new file mode 100644 index 0000000000..5a839218a2 --- /dev/null +++ b/playwright/tests/oasis-scan-v2.spec.ts @@ -0,0 +1,17 @@ +import { test, expect } from '@playwright/test' + +test('validate if API is missing historical data', async ({ request }) => { + const expectedResponse = { + code: 0, + message: 'OK', + data: null, + } + + const response = await request.get('https://www.oasisscan.com/v2/mainnet/chain/block/16817955') + if (response.status() === 200) { + const jsonResponse = await response.json() + expect(jsonResponse).toEqual(expectedResponse) + } else { + console.warn(`Skipping V2 test due to API issues: ${response.status()}`) + } +})