diff --git a/.changelog/2076.feature.md b/.changelog/2076.feature.md new file mode 100644 index 0000000000..78d22c3c44 --- /dev/null +++ b/.changelog/2076.feature.md @@ -0,0 +1 @@ +Add support for Nexus API as a backend option for Wallet diff --git a/.vscode/settings.json b/.vscode/settings.json index c6a8945730..b63cf3a847 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -38,6 +38,12 @@ "src/vendors/oasisscan/.openapi-generator": true, "src/vendors/oasisscan/.openapi-generator-ignore": true, "src/vendors/oasisscan/runtime.ts": true, - "src/vendors/oasisscan/index.ts": true + "src/vendors/oasisscan/index.ts": true, + "src/vendors/nexus/apis": true, + "src/vendors/nexus/models": true, + "src/vendors/nexus/.openapi-generator": true, + "src/vendors/nexus/.openapi-generator-ignore": true, + "src/vendors/nexus/runtime.ts": true, + "src/vendors/nexus/index.ts": true } } diff --git a/internals/getSecurityHeaders.js b/internals/getSecurityHeaders.js index 500a7f5cf2..38c88dda0b 100644 --- a/internals/getSecurityHeaders.js +++ b/internals/getSecurityHeaders.js @@ -48,6 +48,8 @@ const getCsp = ({ isExtension, isDev }) => https://grpc.oasis.io https://testnet.grpc.oasis.io https://api.oasisscan.com + https://nexus.oasis.io + https://testnet.nexus.oasis.io ${isDev ? localnet : ''} ${isDev ? hmr : ''} ; diff --git a/src/app/components/ErrorFormatter/index.tsx b/src/app/components/ErrorFormatter/index.tsx index 7ed7c11ebe..93c11501d0 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.Nexus]: t('backends.nexus', 'Nexus API'), } const errorMap: { [code in WalletErrors]: string | React.ReactElement } = { diff --git a/src/app/components/Footer/index.tsx b/src/app/components/Footer/index.tsx index c35507f80d..81260eb030 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.Nexus]: t('footer.poweredBy.nexus', 'Nexus API & Oasis gRPC'), } const poweredByLabel = backendToLabel[backend()] diff --git a/src/app/lib/helpers.ts b/src/app/lib/helpers.ts index 46c81c1955..cafafb7336 100644 --- a/src/app/lib/helpers.ts +++ b/src/app/lib/helpers.ts @@ -119,3 +119,8 @@ export const getDefaultFeeAmount = (isDepositing: boolean, paraTimeConfig: ParaT export function parseConsensusToLayerBaseUnit(feeAmount: string, decimals: number): BigNumber { return new BigNumber(feeAmount).shiftedBy(decimals).shiftedBy(-consensusDecimals) } + +export function removeTrailingZeros(value: string, zeros: number): string { + const bigValue = new BigNumber(value) + return bigValue.dividedBy(new BigNumber(10).pow(zeros)).toFixed() +} diff --git a/src/config.ts b/src/config.ts index d36d2d8e83..e76ba72b89 100644 --- a/src/config.ts +++ b/src/config.ts @@ -8,6 +8,7 @@ export const consensusDecimals = 9 export enum BackendAPIs { OasisMonitor = 'oasismonitor', OasisScan = 'oasisscan', + Nexus = 'nexus', } type BackendApiUrls = { @@ -23,6 +24,7 @@ type BackendProviders = { min_delegation: number // from nic.stakingConsensusParameters().min_delegation [BackendAPIs.OasisMonitor]: BackendApiUrls [BackendAPIs.OasisScan]: BackendApiUrls + [BackendAPIs.Nexus]: BackendApiUrls } type BackendConfig = { @@ -44,6 +46,12 @@ export const config: BackendConfig = { 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}}', + blockExplorerParatimes: 'https://explorer.oasis.io/mainnet/{{runtimeId}}/tx/{{txHash}}', + blockExplorerAccount: 'https://www.oasisscan.com/accounts/detail/{{address}}', + }, }, testnet: { grpc: 'https://testnet.grpc.oasis.io', @@ -56,8 +64,13 @@ export const config: BackendConfig = { [BackendAPIs.OasisScan]: { explorer: 'https://api.oasisscan.com/testnet', blockExplorer: 'https://testnet.oasisscan.com/transactions/{{txHash}}', - blockExplorerParatimes: - 'https://testnet.oasisscan.com/paratimes/transactions/{{txHash}}?runtime={{runtimeId}}', + blockExplorerParatimes: 'https://testnet.oasisscan.com/paratimes/tx/{{txHash}}', + blockExplorerAccount: 'https://testnet.oasisscan.com/accounts/detail/{{address}}', + }, + [BackendAPIs.Nexus]: { + explorer: 'https://testnet.nexus.oasis.io/v1', + blockExplorer: 'https://testnet.oasisscan.com/transactions/{{txHash}}', + blockExplorerParatimes: 'https://explorer.oasis.io/testnet/{{runtimeId}}/transactions/{{txHash}}', blockExplorerAccount: 'https://testnet.oasisscan.com/accounts/detail/{{address}}', }, }, @@ -76,6 +89,13 @@ export const config: BackendConfig = { '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}}', + blockExplorerParatimes: + 'http://localhost:9001/data/paratimes/transactions/{{txHash}}?runtime={{runtimeId}}', + blockExplorerAccount: 'http://localhost:9001/data/accounts/detail/{{address}}', + }, }, } diff --git a/src/locales/en/translation.json b/src/locales/en/translation.json index ae27373430..a9c2fb1619 100644 --- a/src/locales/en/translation.json +++ b/src/locales/en/translation.json @@ -107,7 +107,8 @@ "appTitle": "ROSE Wallet", "backends": { "oasismonitor": "Oasis Monitor API", - "oasisscan": "Oasis Scan API" + "oasisscan": "Oasis Scan API", + "nexus": "Nexus API" }, "banner": { "buildPreview": "Please note this is an experimental build of ROSE Wallet and your secrets are not safe. ONLY USE IT FOR TESTING.", @@ -198,7 +199,8 @@ "github": "ROSE Wallet is open source and powered by", "poweredBy": { "oasismonitor": "Oasis Monitor API & Oasis gRPC", - "oasisscan": "Oasis Scan API & Oasis gRPC" + "oasisscan": "Oasis Scan API & Oasis gRPC", + "nexus": "Nexus API & Oasis gRPC" }, "terms": "Terms and Conditions", "version": "Version: (commit: ) built at {{buildTime}}" diff --git a/src/types/env.d.ts b/src/types/env.d.ts index 2abfeed6b6..de0c18ab2a 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' + REACT_APP_BACKEND: 'oasismonitor' | 'oasisscan' | '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 91deb4d8ca..cad79ba741 100644 --- a/src/vendors/backend.ts +++ b/src/vendors/backend.ts @@ -1,10 +1,12 @@ import { getMonitorAPIs } from 'vendors/monitor' import { getOasisscanAPIs } from 'vendors/oasisscan' +import { getNexusAPIs } from 'vendors/nexus' import { BackendAPIs } from 'config' const backendNameToApi = { [BackendAPIs.OasisMonitor]: getMonitorAPIs, [BackendAPIs.OasisScan]: getOasisscanAPIs, + [BackendAPIs.Nexus]: getNexusAPIs, } export const backend = () => process.env.REACT_APP_BACKEND || BackendAPIs.OasisMonitor diff --git a/src/vendors/nexus.ts b/src/vendors/nexus.ts new file mode 100644 index 0000000000..e2ebd82df8 --- /dev/null +++ b/src/vendors/nexus.ts @@ -0,0 +1,315 @@ +import * as oasis from '@oasisprotocol/client' +import { + Configuration, + Account as NexusAccount, + Delegation as NexusDelegation, + DebondingDelegation as NexusDebondingDelegation, + DefaultApi as NexusApi, + Transaction as NexusTransaction, + RuntimeTransaction as NexusRuntimeTransaction, + Validator as NexusValidator, + ConsensusTxMethod, + Runtime, + RuntimeTransaction, + ConsensusEventType, +} from 'vendors/nexus/index' +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 { StringifiedBigInt } from 'types/StringifiedBigInt' +import { throwAPIErrors } from './helpers' +import { removeTrailingZeros } from 'app/lib/helpers' +import { consensusDecimals, paraTimesConfig } from '../config' + +export interface ExtendedRuntimeTransaction extends NexusRuntimeTransaction { + decimals: number + runtimeId: Runtime + runtimeName: string +} + +export function getNexusAPIs(url: string | 'https://nexus.oasis.io/v1/') { + const explorerConfig = new Configuration({ + basePath: url, + ...throwAPIErrors, + }) + + const api = new NexusApi(explorerConfig) + + async function getAccount(address: string): Promise { + const account = await api.consensusAccountsAddressGet({ address }) + if (!account) throw new Error('Wrong response code') + + return parseAccount(account) + } + + async function getAllValidators(): Promise { + const validatorsResponse = await api.consensusValidatorsGet({}) + if (!validatorsResponse) throw new Error('Wrong response code') + + return parseValidatorsList(validatorsResponse.validators) + } + + function extendRuntimeTransaction( + runtime: Runtime, + runtimeTransaction: RuntimeTransaction, + ): ExtendedRuntimeTransaction { + const config = + runtime === Runtime.Sapphire + ? paraTimesConfig.sapphire + : runtime === Runtime.Emerald + ? paraTimesConfig.emerald + : undefined + + return { + ...runtimeTransaction, + decimals: config?.decimals || consensusDecimals, + runtimeId: runtime, + runtimeName: runtime.charAt(0).toUpperCase() + runtime.slice(1), + } + } + + function mergeTransactions( + limit: number, + ...responses: (NexusTransaction | ExtendedRuntimeTransaction)[][] + ): (NexusTransaction | ExtendedRuntimeTransaction)[] { + const mergedList = responses.flat() + mergedList.sort((a, b) => new Date(b.timestamp).getTime() - new Date(a.timestamp).getTime()) + + return mergedList.slice(0, limit) + } + + async function getTransactionsList(params: { accountId: string; limit: number }) { + try { + const [consensusResponse, sapphireResponse, emeraldResponse] = await Promise.all([ + api.consensusTransactionsGet({ + rel: params.accountId, + limit: params.limit, + }), + api.runtimeTransactionsGet({ + runtime: Runtime.Sapphire, + rel: params.accountId, + limit: params.limit, + }), + api.runtimeTransactionsGet({ + runtime: Runtime.Emerald, + rel: params.accountId, + limit: params.limit, + }), + ]) + const extendedSapphireResponse = sapphireResponse.transactions.map(runtimeTransaction => + extendRuntimeTransaction(Runtime.Sapphire, runtimeTransaction), + ) + const extendedEmeraldResponse = emeraldResponse.transactions.map(runtimeTransaction => + extendRuntimeTransaction(Runtime.Emerald, runtimeTransaction), + ) + const mergedTransactions = mergeTransactions( + params.limit, + consensusResponse.transactions, + extendedSapphireResponse, + extendedEmeraldResponse, + ) + + // Temporary workaround for missing amount in staking.ReclaimEscrow + const transactionsWithFixedAmount = await Promise.all( + mergedTransactions.map(async transaction => { + if (transaction.method === ConsensusTxMethod.StakingReclaimEscrow) { + const eventsResponse = await api.consensusEventsGet({ + limit: 1, + txHash: transaction.hash, + type: ConsensusEventType.StakingEscrowDebondingStart, + }) + const amount = (eventsResponse.events[0].body as { amount?: number })?.amount + return { + ...transaction, + body: { + ...transaction.body, + amount, + }, + } + } + return { ...transaction } + }), + ) + + return parseTransactionsList(transactionsWithFixedAmount) + } catch (error) { + console.error('Could not fetch Nexus', error) + throw error + } + } + + async function getDelegations(params: { accountId: string; nic: oasis.client.NodeInternal }): Promise<{ + delegations: Delegation[] + debonding: DebondingDelegation[] + }> { + const delegations = await api.consensusAccountsAddressDelegationsGet({ + address: params.accountId, + }) + const debonding = await api.consensusAccountsAddressDebondingDelegationsGet({ + address: params.accountId, + }) + if (!delegations) throw new Error('Wrong response code') + if (!debonding) throw new Error('Wrong response code') + + return { + delegations: parseDelegations(delegations.delegations), + debonding: parseDebonding(debonding.debonding_delegations), + } + } + + return { + getAccount, + getAllValidators, + getTransactionsList, + getDelegations, + } +} + +function parseAccount(account: NexusAccount): Account { + const total = ( + BigInt(account.available) + + BigInt(account.delegations_balance) + + BigInt(account.debonding_delegations_balance) + ).toString() + + return { + address: account.address, + allowances: account.allowances.map(allowance => ({ + address: allowance.address, + amount: allowance.amount, + })), + available: account.available, + delegations: account.delegations_balance, + debonding: account.debonding_delegations_balance, + total, + nonce: BigInt(account.nonce ?? 0).toString(), + } +} + +function parseValidatorsList(validators: NexusValidator[]): Validator[] { + return validators.map(v => { + const parsed: Validator = { + address: v.entity_address, + name: v.media?.name ?? undefined, + escrow: v.escrow.active_balance as StringifiedBigInt, + current_rate: v.current_rate / 100000, + status: v.active ? 'active' : 'inactive', + media: { + email_address: v.media?.email ?? undefined, + logotype: v.media?.logoUrl ?? undefined, + twitter_acc: v.media?.twitter ?? undefined, + website_link: v.media?.url ?? undefined, + }, + rank: v.rank, + } + return parsed + }) +} + +export function parseDelegations(delegations: NexusDelegation[]): Delegation[] { + return delegations.map(delegation => { + const parsed: Delegation = { + amount: delegation.amount, + shares: delegation.shares, + validatorAddress: delegation.validator, + } + return parsed + }) +} + +function getTransactionType(method: string | undefined): TransactionType { + const type = transactionMethodMap[method as keyof typeof transactionMethodMap] + // Not handled mappings are rendered as unrecognizedTransaction + return type ?? (method as TransactionType) +} + +export const transactionMethodMap: Partial<{ + [k in ConsensusTxMethod]: TransactionType +}> = { + [ConsensusTxMethod.StakingTransfer]: TransactionType.StakingTransfer, + [ConsensusTxMethod.StakingAddEscrow]: TransactionType.StakingAddEscrow, + [ConsensusTxMethod.StakingReclaimEscrow]: TransactionType.StakingReclaimEscrow, + [ConsensusTxMethod.StakingAmendCommissionSchedule]: TransactionType.StakingAmendCommissionSchedule, + [ConsensusTxMethod.StakingAllow]: TransactionType.StakingAllow, + [ConsensusTxMethod.StakingWithdraw]: TransactionType.StakingWithdraw, + [ConsensusTxMethod.StakingBurn]: TransactionType.StakingBurn, + [ConsensusTxMethod.RoothashExecutorCommit]: TransactionType.RoothashExecutorCommit, + [ConsensusTxMethod.RoothashExecutorProposerTimeout]: TransactionType.RoothashExecutorProposerTimeout, + [ConsensusTxMethod.RoothashSubmitMsg]: TransactionType.RoothashSubmitMsg, + [ConsensusTxMethod.RegistryDeregisterEntity]: TransactionType.RegistryDeregisterEntity, + [ConsensusTxMethod.RegistryRegisterEntity]: TransactionType.RegistryRegisterEntity, + [ConsensusTxMethod.RegistryRegisterNode]: TransactionType.RegistryRegisterNode, + [ConsensusTxMethod.RegistryRegisterRuntime]: TransactionType.RegistryRegisterRuntime, + [ConsensusTxMethod.RegistryUnfreezeNode]: TransactionType.RegistryUnfreezeNode, + [ConsensusTxMethod.GovernanceCastVote]: TransactionType.GovernanceCastVote, + [ConsensusTxMethod.GovernanceSubmitProposal]: TransactionType.GovernanceSubmitProposal, + [ConsensusTxMethod.BeaconPvssCommit]: TransactionType.BeaconPvssCommit, + [ConsensusTxMethod.BeaconPvssReveal]: TransactionType.BeaconPvssReveal, + [ConsensusTxMethod.BeaconVrfProve]: TransactionType.BeaconVrfProve, + [ConsensusTxMethod.ConsensusMeta]: TransactionType.ConsensusMeta, + [ConsensusTxMethod.VaultCreate]: TransactionType.VaultCreate, +} + +function parseTransactionsList(list: (NexusTransaction | ExtendedRuntimeTransaction)[]): Transaction[] { + return list.map(t => { + if ('round' in t) { + const transactionDate = new Date(t.timestamp) + const parsed: Transaction = { + amount: t.amount ? removeTrailingZeros(t.amount, t.decimals - consensusDecimals) : undefined, + fee: t.fee ? removeTrailingZeros(t.fee, t.decimals - consensusDecimals) : undefined, + from: t.sender_0_eth || t.sender_0, + hash: t.hash, + level: undefined, + status: t.success ? TransactionStatus.Successful : TransactionStatus.Failed, + timestamp: transactionDate.getTime(), + to: (t.body as { to?: string }).to ?? undefined, + type: getTransactionType(t.method), + runtimeName: t.runtimeName, + runtimeId: t.runtimeId, + round: t.round, + nonce: BigInt(t.nonce_0).toString(), + } + return parsed + } else { + const transactionDate = new Date(t.timestamp) + const parsed: Transaction = { + amount: + (t.body as { amount?: StringifiedBigInt })?.amount || + ((t.body as { amount_change?: StringifiedBigInt })?.amount_change && + ((t.body as { negative?: boolean })?.negative + ? `-${(t.body as { amount_change?: StringifiedBigInt }).amount_change}` + : (t.body as { amount_change?: StringifiedBigInt }).amount_change)) || + undefined, + fee: t.fee, + from: t.sender, + hash: t.hash, + level: t.block, + status: t.success ? TransactionStatus.Successful : TransactionStatus.Failed, + timestamp: transactionDate.getTime(), + to: + (t.body as { to?: StringifiedBigInt })?.to || + (t.body as { beneficiary?: StringifiedBigInt })?.beneficiary || + (t.body as { account?: StringifiedBigInt })?.account || + undefined, + type: getTransactionType(t.method), + runtimeName: undefined, + runtimeId: undefined, + round: undefined, + nonce: BigInt(t.nonce).toString(), + } + return parsed + } + }) +} + +export function parseDebonding(debonding: NexusDebondingDelegation[]): DebondingDelegation[] { + return debonding.map(debonding => { + const parsed: DebondingDelegation = { + amount: debonding.shares, + shares: debonding.shares, + validatorAddress: debonding.validator, + epoch: debonding.debond_end, + } + return parsed + }) +} diff --git a/src/vendors/nexus/.openapi-generator-ignore b/src/vendors/nexus/.openapi-generator-ignore new file mode 100644 index 0000000000..7484ee590a --- /dev/null +++ b/src/vendors/nexus/.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/nexus/.openapi-generator/FILES b/src/vendors/nexus/.openapi-generator/FILES new file mode 100644 index 0000000000..ee68eb3ded --- /dev/null +++ b/src/vendors/nexus/.openapi-generator/FILES @@ -0,0 +1,102 @@ +.openapi-generator-ignore +apis/DefaultApi.ts +apis/index.ts +index.ts +models/Account.ts +models/AccountList.ts +models/AccountListAllOf.ts +models/AccountStats.ts +models/ActiveAccounts.ts +models/ActiveAccountsList.ts +models/AddressDerivationContext.ts +models/AddressPreimage.ts +models/Allowance.ts +models/BareTokenHolder.ts +models/Block.ts +models/BlockList.ts +models/BlockListAllOf.ts +models/ConsensusEvent.ts +models/ConsensusEventList.ts +models/ConsensusEventListAllOf.ts +models/ConsensusEventType.ts +models/ConsensusTxMethod.ts +models/DebondingDelegation.ts +models/DebondingDelegationList.ts +models/DebondingDelegationListAllOf.ts +models/Delegation.ts +models/DelegationList.ts +models/DelegationListAllOf.ts +models/Entity.ts +models/EntityList.ts +models/EntityListAllOf.ts +models/Epoch.ts +models/EpochList.ts +models/EpochListAllOf.ts +models/Escrow.ts +models/EvmAbiParam.ts +models/EvmEventToken.ts +models/EvmNft.ts +models/EvmNftList.ts +models/EvmNftListAllOf.ts +models/EvmToken.ts +models/EvmTokenList.ts +models/EvmTokenListAllOf.ts +models/EvmTokenType.ts +models/InlineResponse400.ts +models/Layer.ts +models/List.ts +models/Node.ts +models/NodeList.ts +models/NodeListAllOf.ts +models/Proposal.ts +models/ProposalList.ts +models/ProposalListAllOf.ts +models/ProposalState.ts +models/ProposalTarget.ts +models/ProposalVote.ts +models/ProposalVotes.ts +models/ProposalVotesAllOf.ts +models/RoothashMessage.ts +models/RoothashMessageList.ts +models/RoothashMessageListAllOf.ts +models/RoothashMessageType.ts +models/Runtime.ts +models/RuntimeAccount.ts +models/RuntimeBlock.ts +models/RuntimeBlockList.ts +models/RuntimeBlockListAllOf.ts +models/RuntimeEvent.ts +models/RuntimeEventList.ts +models/RuntimeEventListAllOf.ts +models/RuntimeEventType.ts +models/RuntimeEvmBalance.ts +models/RuntimeEvmContract.ts +models/RuntimeEvmContractVerification.ts +models/RuntimeSdkBalance.ts +models/RuntimeStatus.ts +models/RuntimeTransaction.ts +models/RuntimeTransactionEncryptionEnvelope.ts +models/RuntimeTransactionList.ts +models/RuntimeTransactionListAllOf.ts +models/Status.ts +models/TokenHolderList.ts +models/TokenHolderListAllOf.ts +models/Transaction.ts +models/TransactionList.ts +models/TransactionListAllOf.ts +models/TxError.ts +models/TxVolume.ts +models/TxVolumeList.ts +models/Validator.ts +models/ValidatorAggStats.ts +models/ValidatorCommissionBound.ts +models/ValidatorHistory.ts +models/ValidatorHistoryAllOf.ts +models/ValidatorHistoryPoint.ts +models/ValidatorList.ts +models/ValidatorListAllOf.ts +models/ValidatorMedia.ts +models/ValidatorsResponse.ts +models/VerificationLevel.ts +models/index.ts +runtime.ts diff --git a/src/vendors/nexus/.openapi-generator/VERSION b/src/vendors/nexus/.openapi-generator/VERSION new file mode 100644 index 0000000000..acf69b48b8 --- /dev/null +++ b/src/vendors/nexus/.openapi-generator/VERSION @@ -0,0 +1 @@ +5.1.0 \ No newline at end of file diff --git a/src/vendors/nexus/README.md b/src/vendors/nexus/README.md new file mode 100644 index 0000000000..38c3e6b938 --- /dev/null +++ b/src/vendors/nexus/README.md @@ -0,0 +1,37 @@ +# Typescript bindings for Nexus + +This folder contains generated typescript bindings for Nexus. + +To update the bindings: + +1. Update openapi.json based on + - + +2. Generate the bindings: + + ```sh + npx @openapitools/openapi-generator-cli generate \ + -i openapi.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 openapi.json \ + -g typescript-fetch \ + -o . \ + --additional-properties=modelPropertyNaming=original,typescriptThreePlus=true + ``` + +3. Lint: + + ```sh + yarn lint:fix + ``` diff --git a/src/vendors/nexus/apis/DefaultApi.ts b/src/vendors/nexus/apis/DefaultApi.ts new file mode 100644 index 0000000000..9ca668b489 --- /dev/null +++ b/src/vendors/nexus/apis/DefaultApi.ts @@ -0,0 +1,1956 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 { + Account, + AccountFromJSON, + AccountToJSON, + AccountList, + AccountListFromJSON, + AccountListToJSON, + ActiveAccountsList, + ActiveAccountsListFromJSON, + ActiveAccountsListToJSON, + Block, + BlockFromJSON, + BlockToJSON, + BlockList, + BlockListFromJSON, + BlockListToJSON, + ConsensusEventList, + ConsensusEventListFromJSON, + ConsensusEventListToJSON, + ConsensusEventType, + ConsensusEventTypeFromJSON, + ConsensusEventTypeToJSON, + ConsensusTxMethod, + ConsensusTxMethodFromJSON, + ConsensusTxMethodToJSON, + DebondingDelegationList, + DebondingDelegationListFromJSON, + DebondingDelegationListToJSON, + DelegationList, + DelegationListFromJSON, + DelegationListToJSON, + Entity, + EntityFromJSON, + EntityToJSON, + EntityList, + EntityListFromJSON, + EntityListToJSON, + Epoch, + EpochFromJSON, + EpochToJSON, + EpochList, + EpochListFromJSON, + EpochListToJSON, + EvmNft, + EvmNftFromJSON, + EvmNftToJSON, + EvmNftList, + EvmNftListFromJSON, + EvmNftListToJSON, + EvmToken, + EvmTokenFromJSON, + EvmTokenToJSON, + EvmTokenList, + EvmTokenListFromJSON, + EvmTokenListToJSON, + InlineResponse400, + InlineResponse400FromJSON, + InlineResponse400ToJSON, + Layer, + LayerFromJSON, + LayerToJSON, + Node, + NodeFromJSON, + NodeToJSON, + NodeList, + NodeListFromJSON, + NodeListToJSON, + Proposal, + ProposalFromJSON, + ProposalToJSON, + ProposalList, + ProposalListFromJSON, + ProposalListToJSON, + ProposalState, + ProposalStateFromJSON, + ProposalStateToJSON, + ProposalVotes, + ProposalVotesFromJSON, + ProposalVotesToJSON, + RoothashMessageList, + RoothashMessageListFromJSON, + RoothashMessageListToJSON, + RoothashMessageType, + RoothashMessageTypeFromJSON, + RoothashMessageTypeToJSON, + Runtime, + RuntimeFromJSON, + RuntimeToJSON, + RuntimeAccount, + RuntimeAccountFromJSON, + RuntimeAccountToJSON, + RuntimeBlockList, + RuntimeBlockListFromJSON, + RuntimeBlockListToJSON, + RuntimeEventList, + RuntimeEventListFromJSON, + RuntimeEventListToJSON, + RuntimeEventType, + RuntimeEventTypeFromJSON, + RuntimeEventTypeToJSON, + RuntimeStatus, + RuntimeStatusFromJSON, + RuntimeStatusToJSON, + RuntimeTransactionList, + RuntimeTransactionListFromJSON, + RuntimeTransactionListToJSON, + Status, + StatusFromJSON, + StatusToJSON, + TokenHolderList, + TokenHolderListFromJSON, + TokenHolderListToJSON, + Transaction, + TransactionFromJSON, + TransactionToJSON, + TransactionList, + TransactionListFromJSON, + TransactionListToJSON, + TxVolumeList, + TxVolumeListFromJSON, + TxVolumeListToJSON, + ValidatorHistory, + ValidatorHistoryFromJSON, + ValidatorHistoryToJSON, + ValidatorList, + ValidatorListFromJSON, + ValidatorListToJSON, +} from '../models'; + +export interface ConsensusAccountsAddressDebondingDelegationsGetRequest { + address: string; + limit?: number; + offset?: number; +} + +export interface ConsensusAccountsAddressDebondingDelegationsToGetRequest { + address: string; + limit?: number; + offset?: number; +} + +export interface ConsensusAccountsAddressDelegationsGetRequest { + address: string; + limit?: number; + offset?: number; +} + +export interface ConsensusAccountsAddressDelegationsToGetRequest { + address: string; + limit?: number; + offset?: number; +} + +export interface ConsensusAccountsAddressGetRequest { + address: string; +} + +export interface ConsensusAccountsGetRequest { + limit?: number; + offset?: number; +} + +export interface ConsensusBlocksGetRequest { + limit?: number; + offset?: number; + from?: number; + to?: number; + after?: Date; + before?: Date; + hash?: string; +} + +export interface ConsensusBlocksHeightGetRequest { + height: number; +} + +export interface ConsensusEntitiesAddressGetRequest { + address: string; +} + +export interface ConsensusEntitiesAddressNodesGetRequest { + address: string; + limit?: number; + offset?: number; +} + +export interface ConsensusEntitiesAddressNodesNodeIdGetRequest { + address: string; + nodeId: string; +} + +export interface ConsensusEntitiesGetRequest { + limit?: number; + offset?: number; +} + +export interface ConsensusEpochsEpochGetRequest { + epoch: number; +} + +export interface ConsensusEpochsGetRequest { + limit?: number; + offset?: number; +} + +export interface ConsensusEventsGetRequest { + limit?: number; + offset?: number; + block?: number; + txIndex?: number; + txHash?: string; + rel?: string; + type?: ConsensusEventType; +} + +export interface ConsensusProposalsGetRequest { + limit?: number; + offset?: number; + submitter?: string; + state?: ProposalState; +} + +export interface ConsensusProposalsProposalIdGetRequest { + proposalId: number; +} + +export interface ConsensusProposalsProposalIdVotesGetRequest { + proposalId: number; + limit?: number; + offset?: number; +} + +export interface ConsensusRoothashMessagesGetRequest { + runtime: Runtime; + limit?: number; + offset?: number; + round?: number; + type?: RoothashMessageType; + rel?: string; +} + +export interface ConsensusTransactionsGetRequest { + limit?: number; + offset?: number; + block?: number; + method?: ConsensusTxMethod; + sender?: string; + rel?: string; + after?: Date; + before?: Date; +} + +export interface ConsensusTransactionsTxHashGetRequest { + txHash: string; +} + +export interface ConsensusValidatorsAddressGetRequest { + address: string; +} + +export interface ConsensusValidatorsAddressHistoryGetRequest { + address: string; + limit?: number; + offset?: number; + from?: number; + to?: number; +} + +export interface ConsensusValidatorsGetRequest { + limit?: number; + offset?: number; + name?: string; +} + +export interface LayerStatsActiveAccountsGetRequest { + layer: Layer; + limit?: number; + offset?: number; + windowStepSeconds?: number; +} + +export interface LayerStatsTxVolumeGetRequest { + layer: Layer; + limit?: number; + offset?: number; + windowSizeSeconds?: number; + windowStepSeconds?: number; +} + +export interface RuntimeAccountsAddressGetRequest { + runtime: Runtime; + address: string; +} + +export interface RuntimeAccountsAddressNftsGetRequest { + runtime: Runtime; + address: string; + limit?: number; + offset?: number; + tokenAddress?: string; +} + +export interface RuntimeBlocksGetRequest { + runtime: Runtime; + limit?: number; + offset?: number; + from?: number; + to?: number; + after?: Date; + before?: Date; + hash?: string; +} + +export interface RuntimeEventsGetRequest { + runtime: Runtime; + limit?: number; + offset?: number; + block?: number; + txIndex?: number; + txHash?: string; + type?: RuntimeEventType; + rel?: string; + evmLogSignature?: string; + contractAddress?: string; + nftId?: string; +} + +export interface RuntimeEvmTokensAddressGetRequest { + runtime: Runtime; + address: string; +} + +export interface RuntimeEvmTokensAddressHoldersGetRequest { + runtime: Runtime; + address: string; + limit?: number; + offset?: number; +} + +export interface RuntimeEvmTokensAddressNftsGetRequest { + runtime: Runtime; + address: string; + limit?: number; + offset?: number; +} + +export interface RuntimeEvmTokensAddressNftsIdGetRequest { + runtime: Runtime; + address: string; + id: string; +} + +export interface RuntimeEvmTokensGetRequest { + runtime: Runtime; + limit?: number; + offset?: number; + name?: string; +} + +export interface RuntimeStatusGetRequest { + runtime: Runtime; +} + +export interface RuntimeTransactionsGetRequest { + runtime: Runtime; + limit?: number; + offset?: number; + block?: number; + after?: Date; + before?: Date; + rel?: string; +} + +export interface RuntimeTransactionsTxHashGetRequest { + runtime: Runtime; + txHash: string; +} + +/** + * + */ +export class DefaultApi extends runtime.BaseAPI { + + /** + * Returns an account\'s debonding delegations. + */ + async consensusAccountsAddressDebondingDelegationsGetRaw(requestParameters: ConsensusAccountsAddressDebondingDelegationsGetRequest): Promise> { + if (requestParameters.address === null || requestParameters.address === undefined) { + throw new runtime.RequiredError('address','Required parameter requestParameters.address was null or undefined when calling consensusAccountsAddressDebondingDelegationsGet.'); + } + + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.offset !== undefined) { + queryParameters['offset'] = requestParameters.offset; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/consensus/accounts/{address}/debonding_delegations`.replace(`{${"address"}}`, encodeURIComponent(String(requestParameters.address))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => DebondingDelegationListFromJSON(jsonValue)); + } + + /** + * Returns an account\'s debonding delegations. + */ + async consensusAccountsAddressDebondingDelegationsGet(requestParameters: ConsensusAccountsAddressDebondingDelegationsGetRequest): Promise { + const response = await this.consensusAccountsAddressDebondingDelegationsGetRaw(requestParameters); + return await response.value(); + } + + /** + * Returns a list of debonding delegations to an account. + */ + async consensusAccountsAddressDebondingDelegationsToGetRaw(requestParameters: ConsensusAccountsAddressDebondingDelegationsToGetRequest): Promise> { + if (requestParameters.address === null || requestParameters.address === undefined) { + throw new runtime.RequiredError('address','Required parameter requestParameters.address was null or undefined when calling consensusAccountsAddressDebondingDelegationsToGet.'); + } + + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.offset !== undefined) { + queryParameters['offset'] = requestParameters.offset; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/consensus/accounts/{address}/debonding_delegations_to`.replace(`{${"address"}}`, encodeURIComponent(String(requestParameters.address))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => DebondingDelegationListFromJSON(jsonValue)); + } + + /** + * Returns a list of debonding delegations to an account. + */ + async consensusAccountsAddressDebondingDelegationsToGet(requestParameters: ConsensusAccountsAddressDebondingDelegationsToGetRequest): Promise { + const response = await this.consensusAccountsAddressDebondingDelegationsToGetRaw(requestParameters); + return await response.value(); + } + + /** + * Returns an account\'s delegations. + */ + async consensusAccountsAddressDelegationsGetRaw(requestParameters: ConsensusAccountsAddressDelegationsGetRequest): Promise> { + if (requestParameters.address === null || requestParameters.address === undefined) { + throw new runtime.RequiredError('address','Required parameter requestParameters.address was null or undefined when calling consensusAccountsAddressDelegationsGet.'); + } + + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.offset !== undefined) { + queryParameters['offset'] = requestParameters.offset; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/consensus/accounts/{address}/delegations`.replace(`{${"address"}}`, encodeURIComponent(String(requestParameters.address))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => DelegationListFromJSON(jsonValue)); + } + + /** + * Returns an account\'s delegations. + */ + async consensusAccountsAddressDelegationsGet(requestParameters: ConsensusAccountsAddressDelegationsGetRequest): Promise { + const response = await this.consensusAccountsAddressDelegationsGetRaw(requestParameters); + return await response.value(); + } + + /** + * Returns a list of delegations to an account. + */ + async consensusAccountsAddressDelegationsToGetRaw(requestParameters: ConsensusAccountsAddressDelegationsToGetRequest): Promise> { + if (requestParameters.address === null || requestParameters.address === undefined) { + throw new runtime.RequiredError('address','Required parameter requestParameters.address was null or undefined when calling consensusAccountsAddressDelegationsToGet.'); + } + + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.offset !== undefined) { + queryParameters['offset'] = requestParameters.offset; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/consensus/accounts/{address}/delegations_to`.replace(`{${"address"}}`, encodeURIComponent(String(requestParameters.address))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => DelegationListFromJSON(jsonValue)); + } + + /** + * Returns a list of delegations to an account. + */ + async consensusAccountsAddressDelegationsToGet(requestParameters: ConsensusAccountsAddressDelegationsToGetRequest): Promise { + const response = await this.consensusAccountsAddressDelegationsToGetRaw(requestParameters); + return await response.value(); + } + + /** + * Returns a consensus layer account. + */ + async consensusAccountsAddressGetRaw(requestParameters: ConsensusAccountsAddressGetRequest): Promise> { + if (requestParameters.address === null || requestParameters.address === undefined) { + throw new runtime.RequiredError('address','Required parameter requestParameters.address was null or undefined when calling consensusAccountsAddressGet.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/consensus/accounts/{address}`.replace(`{${"address"}}`, encodeURIComponent(String(requestParameters.address))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => AccountFromJSON(jsonValue)); + } + + /** + * Returns a consensus layer account. + */ + async consensusAccountsAddressGet(requestParameters: ConsensusAccountsAddressGetRequest): Promise { + const response = await this.consensusAccountsAddressGetRaw(requestParameters); + return await response.value(); + } + + /** + * Returns a list of consensus layer accounts. Note that for performance reasons, the info returned by this endpoint may be slightly stale (<2 minutes). For the most up-to-date account state, query the single-account endpoint. + */ + async consensusAccountsGetRaw(requestParameters: ConsensusAccountsGetRequest): Promise> { + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.offset !== undefined) { + queryParameters['offset'] = requestParameters.offset; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/consensus/accounts`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => AccountListFromJSON(jsonValue)); + } + + /** + * Returns a list of consensus layer accounts. Note that for performance reasons, the info returned by this endpoint may be slightly stale (<2 minutes). For the most up-to-date account state, query the single-account endpoint. + */ + async consensusAccountsGet(requestParameters: ConsensusAccountsGetRequest): Promise { + const response = await this.consensusAccountsGetRaw(requestParameters); + return await response.value(); + } + + /** + * Returns a list of consensus blocks, sorted from most to least recent. + */ + async consensusBlocksGetRaw(requestParameters: ConsensusBlocksGetRequest): Promise> { + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.offset !== undefined) { + queryParameters['offset'] = requestParameters.offset; + } + + if (requestParameters.from !== undefined) { + queryParameters['from'] = requestParameters.from; + } + + if (requestParameters.to !== undefined) { + queryParameters['to'] = requestParameters.to; + } + + if (requestParameters.after !== undefined) { + queryParameters['after'] = (requestParameters.after as any).toISOString(); + } + + if (requestParameters.before !== undefined) { + queryParameters['before'] = (requestParameters.before as any).toISOString(); + } + + if (requestParameters.hash !== undefined) { + queryParameters['hash'] = requestParameters.hash; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/consensus/blocks`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => BlockListFromJSON(jsonValue)); + } + + /** + * Returns a list of consensus blocks, sorted from most to least recent. + */ + async consensusBlocksGet(requestParameters: ConsensusBlocksGetRequest): Promise { + const response = await this.consensusBlocksGetRaw(requestParameters); + return await response.value(); + } + + /** + * Returns a consensus block. + */ + async consensusBlocksHeightGetRaw(requestParameters: ConsensusBlocksHeightGetRequest): Promise> { + if (requestParameters.height === null || requestParameters.height === undefined) { + throw new runtime.RequiredError('height','Required parameter requestParameters.height was null or undefined when calling consensusBlocksHeightGet.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/consensus/blocks/{height}`.replace(`{${"height"}}`, encodeURIComponent(String(requestParameters.height))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => BlockFromJSON(jsonValue)); + } + + /** + * Returns a consensus block. + */ + async consensusBlocksHeightGet(requestParameters: ConsensusBlocksHeightGetRequest): Promise { + const response = await this.consensusBlocksHeightGetRaw(requestParameters); + return await response.value(); + } + + /** + * Returns an entity registered at the consensus layer. + */ + async consensusEntitiesAddressGetRaw(requestParameters: ConsensusEntitiesAddressGetRequest): Promise> { + if (requestParameters.address === null || requestParameters.address === undefined) { + throw new runtime.RequiredError('address','Required parameter requestParameters.address was null or undefined when calling consensusEntitiesAddressGet.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/consensus/entities/{address}`.replace(`{${"address"}}`, encodeURIComponent(String(requestParameters.address))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => EntityFromJSON(jsonValue)); + } + + /** + * Returns an entity registered at the consensus layer. + */ + async consensusEntitiesAddressGet(requestParameters: ConsensusEntitiesAddressGetRequest): Promise { + const response = await this.consensusEntitiesAddressGetRaw(requestParameters); + return await response.value(); + } + + /** + * Returns a list of nodes registered at the consensus layer. + */ + async consensusEntitiesAddressNodesGetRaw(requestParameters: ConsensusEntitiesAddressNodesGetRequest): Promise> { + if (requestParameters.address === null || requestParameters.address === undefined) { + throw new runtime.RequiredError('address','Required parameter requestParameters.address was null or undefined when calling consensusEntitiesAddressNodesGet.'); + } + + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.offset !== undefined) { + queryParameters['offset'] = requestParameters.offset; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/consensus/entities/{address}/nodes`.replace(`{${"address"}}`, encodeURIComponent(String(requestParameters.address))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => NodeListFromJSON(jsonValue)); + } + + /** + * Returns a list of nodes registered at the consensus layer. + */ + async consensusEntitiesAddressNodesGet(requestParameters: ConsensusEntitiesAddressNodesGetRequest): Promise { + const response = await this.consensusEntitiesAddressNodesGetRaw(requestParameters); + return await response.value(); + } + + /** + * Returns a node registered at the consensus layer. + */ + async consensusEntitiesAddressNodesNodeIdGetRaw(requestParameters: ConsensusEntitiesAddressNodesNodeIdGetRequest): Promise> { + if (requestParameters.address === null || requestParameters.address === undefined) { + throw new runtime.RequiredError('address','Required parameter requestParameters.address was null or undefined when calling consensusEntitiesAddressNodesNodeIdGet.'); + } + + if (requestParameters.nodeId === null || requestParameters.nodeId === undefined) { + throw new runtime.RequiredError('nodeId','Required parameter requestParameters.nodeId was null or undefined when calling consensusEntitiesAddressNodesNodeIdGet.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/consensus/entities/{address}/nodes/{node_id}`.replace(`{${"address"}}`, encodeURIComponent(String(requestParameters.address))).replace(`{${"node_id"}}`, encodeURIComponent(String(requestParameters.nodeId))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => NodeFromJSON(jsonValue)); + } + + /** + * Returns a node registered at the consensus layer. + */ + async consensusEntitiesAddressNodesNodeIdGet(requestParameters: ConsensusEntitiesAddressNodesNodeIdGetRequest): Promise { + const response = await this.consensusEntitiesAddressNodesNodeIdGetRaw(requestParameters); + return await response.value(); + } + + /** + * Returns a list of entities registered at the consensus layer. + */ + async consensusEntitiesGetRaw(requestParameters: ConsensusEntitiesGetRequest): Promise> { + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.offset !== undefined) { + queryParameters['offset'] = requestParameters.offset; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/consensus/entities`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => EntityListFromJSON(jsonValue)); + } + + /** + * Returns a list of entities registered at the consensus layer. + */ + async consensusEntitiesGet(requestParameters: ConsensusEntitiesGetRequest): Promise { + const response = await this.consensusEntitiesGetRaw(requestParameters); + return await response.value(); + } + + /** + * Returns a consensus epoch. + */ + async consensusEpochsEpochGetRaw(requestParameters: ConsensusEpochsEpochGetRequest): Promise> { + if (requestParameters.epoch === null || requestParameters.epoch === undefined) { + throw new runtime.RequiredError('epoch','Required parameter requestParameters.epoch was null or undefined when calling consensusEpochsEpochGet.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/consensus/epochs/{epoch}`.replace(`{${"epoch"}}`, encodeURIComponent(String(requestParameters.epoch))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => EpochFromJSON(jsonValue)); + } + + /** + * Returns a consensus epoch. + */ + async consensusEpochsEpochGet(requestParameters: ConsensusEpochsEpochGetRequest): Promise { + const response = await this.consensusEpochsEpochGetRaw(requestParameters); + return await response.value(); + } + + /** + * Returns a list of consensus epochs. + */ + async consensusEpochsGetRaw(requestParameters: ConsensusEpochsGetRequest): Promise> { + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.offset !== undefined) { + queryParameters['offset'] = requestParameters.offset; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/consensus/epochs`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => EpochListFromJSON(jsonValue)); + } + + /** + * Returns a list of consensus epochs. + */ + async consensusEpochsGet(requestParameters: ConsensusEpochsGetRequest): Promise { + const response = await this.consensusEpochsGetRaw(requestParameters); + return await response.value(); + } + + /** + * Returns a list of consensus events. + */ + async consensusEventsGetRaw(requestParameters: ConsensusEventsGetRequest): Promise> { + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.offset !== undefined) { + queryParameters['offset'] = requestParameters.offset; + } + + if (requestParameters.block !== undefined) { + queryParameters['block'] = requestParameters.block; + } + + if (requestParameters.txIndex !== undefined) { + queryParameters['tx_index'] = requestParameters.txIndex; + } + + if (requestParameters.txHash !== undefined) { + queryParameters['tx_hash'] = requestParameters.txHash; + } + + if (requestParameters.rel !== undefined) { + queryParameters['rel'] = requestParameters.rel; + } + + if (requestParameters.type !== undefined) { + queryParameters['type'] = requestParameters.type; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/consensus/events`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => ConsensusEventListFromJSON(jsonValue)); + } + + /** + * Returns a list of consensus events. + */ + async consensusEventsGet(requestParameters: ConsensusEventsGetRequest): Promise { + const response = await this.consensusEventsGetRaw(requestParameters); + return await response.value(); + } + + /** + * Returns a list of governance proposals. + */ + async consensusProposalsGetRaw(requestParameters: ConsensusProposalsGetRequest): Promise> { + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.offset !== undefined) { + queryParameters['offset'] = requestParameters.offset; + } + + if (requestParameters.submitter !== undefined) { + queryParameters['submitter'] = requestParameters.submitter; + } + + if (requestParameters.state !== undefined) { + queryParameters['state'] = requestParameters.state; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/consensus/proposals`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => ProposalListFromJSON(jsonValue)); + } + + /** + * Returns a list of governance proposals. + */ + async consensusProposalsGet(requestParameters: ConsensusProposalsGetRequest): Promise { + const response = await this.consensusProposalsGetRaw(requestParameters); + return await response.value(); + } + + /** + * Returns a governance proposal. + */ + async consensusProposalsProposalIdGetRaw(requestParameters: ConsensusProposalsProposalIdGetRequest): Promise> { + if (requestParameters.proposalId === null || requestParameters.proposalId === undefined) { + throw new runtime.RequiredError('proposalId','Required parameter requestParameters.proposalId was null or undefined when calling consensusProposalsProposalIdGet.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/consensus/proposals/{proposal_id}`.replace(`{${"proposal_id"}}`, encodeURIComponent(String(requestParameters.proposalId))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => ProposalFromJSON(jsonValue)); + } + + /** + * Returns a governance proposal. + */ + async consensusProposalsProposalIdGet(requestParameters: ConsensusProposalsProposalIdGetRequest): Promise { + const response = await this.consensusProposalsProposalIdGetRaw(requestParameters); + return await response.value(); + } + + /** + * Returns a list of votes for a governance proposal. + */ + async consensusProposalsProposalIdVotesGetRaw(requestParameters: ConsensusProposalsProposalIdVotesGetRequest): Promise> { + if (requestParameters.proposalId === null || requestParameters.proposalId === undefined) { + throw new runtime.RequiredError('proposalId','Required parameter requestParameters.proposalId was null or undefined when calling consensusProposalsProposalIdVotesGet.'); + } + + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.offset !== undefined) { + queryParameters['offset'] = requestParameters.offset; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/consensus/proposals/{proposal_id}/votes`.replace(`{${"proposal_id"}}`, encodeURIComponent(String(requestParameters.proposalId))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => ProposalVotesFromJSON(jsonValue)); + } + + /** + * Returns a list of votes for a governance proposal. + */ + async consensusProposalsProposalIdVotesGet(requestParameters: ConsensusProposalsProposalIdVotesGetRequest): Promise { + const response = await this.consensusProposalsProposalIdVotesGetRaw(requestParameters); + return await response.value(); + } + + /** + */ + async consensusRoothashMessagesGetRaw(requestParameters: ConsensusRoothashMessagesGetRequest): Promise> { + if (requestParameters.runtime === null || requestParameters.runtime === undefined) { + throw new runtime.RequiredError('runtime','Required parameter requestParameters.runtime was null or undefined when calling consensusRoothashMessagesGet.'); + } + + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.offset !== undefined) { + queryParameters['offset'] = requestParameters.offset; + } + + if (requestParameters.runtime !== undefined) { + queryParameters['runtime'] = requestParameters.runtime; + } + + if (requestParameters.round !== undefined) { + queryParameters['round'] = requestParameters.round; + } + + if (requestParameters.type !== undefined) { + queryParameters['type'] = requestParameters.type; + } + + if (requestParameters.rel !== undefined) { + queryParameters['rel'] = requestParameters.rel; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/consensus/roothash_messages`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => RoothashMessageListFromJSON(jsonValue)); + } + + /** + */ + async consensusRoothashMessagesGet(requestParameters: ConsensusRoothashMessagesGetRequest): Promise { + const response = await this.consensusRoothashMessagesGetRaw(requestParameters); + return await response.value(); + } + + /** + * Returns a list of consensus transactions. + */ + async consensusTransactionsGetRaw(requestParameters: ConsensusTransactionsGetRequest): Promise> { + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.offset !== undefined) { + queryParameters['offset'] = requestParameters.offset; + } + + if (requestParameters.block !== undefined) { + queryParameters['block'] = requestParameters.block; + } + + if (requestParameters.method !== undefined) { + queryParameters['method'] = requestParameters.method; + } + + if (requestParameters.sender !== undefined) { + queryParameters['sender'] = requestParameters.sender; + } + + if (requestParameters.rel !== undefined) { + queryParameters['rel'] = requestParameters.rel; + } + + if (requestParameters.after !== undefined) { + queryParameters['after'] = (requestParameters.after as any).toISOString(); + } + + if (requestParameters.before !== undefined) { + queryParameters['before'] = (requestParameters.before as any).toISOString(); + } + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/consensus/transactions`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => TransactionListFromJSON(jsonValue)); + } + + /** + * Returns a list of consensus transactions. + */ + async consensusTransactionsGet(requestParameters: ConsensusTransactionsGetRequest): Promise { + const response = await this.consensusTransactionsGetRaw(requestParameters); + return await response.value(); + } + + /** + * Returns a consensus transaction. + */ + async consensusTransactionsTxHashGetRaw(requestParameters: ConsensusTransactionsTxHashGetRequest): Promise> { + if (requestParameters.txHash === null || requestParameters.txHash === undefined) { + throw new runtime.RequiredError('txHash','Required parameter requestParameters.txHash was null or undefined when calling consensusTransactionsTxHashGet.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/consensus/transactions/{tx_hash}`.replace(`{${"tx_hash"}}`, encodeURIComponent(String(requestParameters.txHash))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => TransactionFromJSON(jsonValue)); + } + + /** + * Returns a consensus transaction. + */ + async consensusTransactionsTxHashGet(requestParameters: ConsensusTransactionsTxHashGetRequest): Promise { + const response = await this.consensusTransactionsTxHashGetRaw(requestParameters); + return await response.value(); + } + + /** + * Returns a validator registered at the consensus layer. + */ + async consensusValidatorsAddressGetRaw(requestParameters: ConsensusValidatorsAddressGetRequest): Promise> { + if (requestParameters.address === null || requestParameters.address === undefined) { + throw new runtime.RequiredError('address','Required parameter requestParameters.address was null or undefined when calling consensusValidatorsAddressGet.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/consensus/validators/{address}`.replace(`{${"address"}}`, encodeURIComponent(String(requestParameters.address))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => ValidatorListFromJSON(jsonValue)); + } + + /** + * Returns a validator registered at the consensus layer. + */ + async consensusValidatorsAddressGet(requestParameters: ConsensusValidatorsAddressGetRequest): Promise { + const response = await this.consensusValidatorsAddressGetRaw(requestParameters); + return await response.value(); + } + + /** + * Returns historical information for a single validator. + */ + async consensusValidatorsAddressHistoryGetRaw(requestParameters: ConsensusValidatorsAddressHistoryGetRequest): Promise> { + if (requestParameters.address === null || requestParameters.address === undefined) { + throw new runtime.RequiredError('address','Required parameter requestParameters.address was null or undefined when calling consensusValidatorsAddressHistoryGet.'); + } + + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.offset !== undefined) { + queryParameters['offset'] = requestParameters.offset; + } + + if (requestParameters.from !== undefined) { + queryParameters['from'] = requestParameters.from; + } + + if (requestParameters.to !== undefined) { + queryParameters['to'] = requestParameters.to; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/consensus/validators/{address}/history`.replace(`{${"address"}}`, encodeURIComponent(String(requestParameters.address))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => ValidatorHistoryFromJSON(jsonValue)); + } + + /** + * Returns historical information for a single validator. + */ + async consensusValidatorsAddressHistoryGet(requestParameters: ConsensusValidatorsAddressHistoryGetRequest): Promise { + const response = await this.consensusValidatorsAddressHistoryGetRaw(requestParameters); + return await response.value(); + } + + /** + * Returns a list of validators registered at the consensus layer (the list includes all registered entities, even those without a currently active validator node). + */ + async consensusValidatorsGetRaw(requestParameters: ConsensusValidatorsGetRequest): Promise> { + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.offset !== undefined) { + queryParameters['offset'] = requestParameters.offset; + } + + if (requestParameters.name !== undefined) { + queryParameters['name'] = requestParameters.name; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/consensus/validators`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => ValidatorListFromJSON(jsonValue)); + } + + /** + * Returns a list of validators registered at the consensus layer (the list includes all registered entities, even those without a currently active validator node). + */ + async consensusValidatorsGet(requestParameters: ConsensusValidatorsGetRequest): Promise { + const response = await this.consensusValidatorsGetRaw(requestParameters); + return await response.value(); + } + + /** + * Returns the status of indexing. + */ + async getStatusRaw(): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => StatusFromJSON(jsonValue)); + } + + /** + * Returns the status of indexing. + */ + async getStatus(): Promise { + const response = await this.getStatusRaw(); + return await response.value(); + } + + /** + * Returns a (sliding) timeline of the recorded daily unique active accounts for either consensus or one of the paratimes. + */ + async layerStatsActiveAccountsGetRaw(requestParameters: LayerStatsActiveAccountsGetRequest): Promise> { + if (requestParameters.layer === null || requestParameters.layer === undefined) { + throw new runtime.RequiredError('layer','Required parameter requestParameters.layer was null or undefined when calling layerStatsActiveAccountsGet.'); + } + + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.offset !== undefined) { + queryParameters['offset'] = requestParameters.offset; + } + + if (requestParameters.windowStepSeconds !== undefined) { + queryParameters['window_step_seconds'] = requestParameters.windowStepSeconds; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/{layer}/stats/active_accounts`.replace(`{${"layer"}}`, encodeURIComponent(String(requestParameters.layer))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => ActiveAccountsListFromJSON(jsonValue)); + } + + /** + * Returns a (sliding) timeline of the recorded daily unique active accounts for either consensus or one of the paratimes. + */ + async layerStatsActiveAccountsGet(requestParameters: LayerStatsActiveAccountsGetRequest): Promise { + const response = await this.layerStatsActiveAccountsGetRaw(requestParameters); + return await response.value(); + } + + /** + * Returns a timeline of the transaction volume at the chosen granularity, for either consensus or one of the paratimes. + */ + async layerStatsTxVolumeGetRaw(requestParameters: LayerStatsTxVolumeGetRequest): Promise> { + if (requestParameters.layer === null || requestParameters.layer === undefined) { + throw new runtime.RequiredError('layer','Required parameter requestParameters.layer was null or undefined when calling layerStatsTxVolumeGet.'); + } + + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.offset !== undefined) { + queryParameters['offset'] = requestParameters.offset; + } + + if (requestParameters.windowSizeSeconds !== undefined) { + queryParameters['window_size_seconds'] = requestParameters.windowSizeSeconds; + } + + if (requestParameters.windowStepSeconds !== undefined) { + queryParameters['window_step_seconds'] = requestParameters.windowStepSeconds; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/{layer}/stats/tx_volume`.replace(`{${"layer"}}`, encodeURIComponent(String(requestParameters.layer))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => TxVolumeListFromJSON(jsonValue)); + } + + /** + * Returns a timeline of the transaction volume at the chosen granularity, for either consensus or one of the paratimes. + */ + async layerStatsTxVolumeGet(requestParameters: LayerStatsTxVolumeGetRequest): Promise { + const response = await this.layerStatsTxVolumeGetRaw(requestParameters); + return await response.value(); + } + + /** + * Returns a runtime account. + */ + async runtimeAccountsAddressGetRaw(requestParameters: RuntimeAccountsAddressGetRequest): Promise> { + if (requestParameters.runtime === null || requestParameters.runtime === undefined) { + throw new runtime.RequiredError('runtime','Required parameter requestParameters.runtime was null or undefined when calling runtimeAccountsAddressGet.'); + } + + if (requestParameters.address === null || requestParameters.address === undefined) { + throw new runtime.RequiredError('address','Required parameter requestParameters.address was null or undefined when calling runtimeAccountsAddressGet.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/{runtime}/accounts/{address}`.replace(`{${"runtime"}}`, encodeURIComponent(String(requestParameters.runtime))).replace(`{${"address"}}`, encodeURIComponent(String(requestParameters.address))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => RuntimeAccountFromJSON(jsonValue)); + } + + /** + * Returns a runtime account. + */ + async runtimeAccountsAddressGet(requestParameters: RuntimeAccountsAddressGetRequest): Promise { + const response = await this.runtimeAccountsAddressGetRaw(requestParameters); + return await response.value(); + } + + /** + * Returns the list of non-fungible token (NFT) instances owned by an account. + */ + async runtimeAccountsAddressNftsGetRaw(requestParameters: RuntimeAccountsAddressNftsGetRequest): Promise> { + if (requestParameters.runtime === null || requestParameters.runtime === undefined) { + throw new runtime.RequiredError('runtime','Required parameter requestParameters.runtime was null or undefined when calling runtimeAccountsAddressNftsGet.'); + } + + if (requestParameters.address === null || requestParameters.address === undefined) { + throw new runtime.RequiredError('address','Required parameter requestParameters.address was null or undefined when calling runtimeAccountsAddressNftsGet.'); + } + + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.offset !== undefined) { + queryParameters['offset'] = requestParameters.offset; + } + + if (requestParameters.tokenAddress !== undefined) { + queryParameters['token_address'] = requestParameters.tokenAddress; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/{runtime}/accounts/{address}/nfts`.replace(`{${"runtime"}}`, encodeURIComponent(String(requestParameters.runtime))).replace(`{${"address"}}`, encodeURIComponent(String(requestParameters.address))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => EvmNftListFromJSON(jsonValue)); + } + + /** + * Returns the list of non-fungible token (NFT) instances owned by an account. + */ + async runtimeAccountsAddressNftsGet(requestParameters: RuntimeAccountsAddressNftsGetRequest): Promise { + const response = await this.runtimeAccountsAddressNftsGetRaw(requestParameters); + return await response.value(); + } + + /** + * Returns a list of Runtime blocks. + */ + async runtimeBlocksGetRaw(requestParameters: RuntimeBlocksGetRequest): Promise> { + if (requestParameters.runtime === null || requestParameters.runtime === undefined) { + throw new runtime.RequiredError('runtime','Required parameter requestParameters.runtime was null or undefined when calling runtimeBlocksGet.'); + } + + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.offset !== undefined) { + queryParameters['offset'] = requestParameters.offset; + } + + if (requestParameters.from !== undefined) { + queryParameters['from'] = requestParameters.from; + } + + if (requestParameters.to !== undefined) { + queryParameters['to'] = requestParameters.to; + } + + if (requestParameters.after !== undefined) { + queryParameters['after'] = (requestParameters.after as any).toISOString(); + } + + if (requestParameters.before !== undefined) { + queryParameters['before'] = (requestParameters.before as any).toISOString(); + } + + if (requestParameters.hash !== undefined) { + queryParameters['hash'] = requestParameters.hash; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/{runtime}/blocks`.replace(`{${"runtime"}}`, encodeURIComponent(String(requestParameters.runtime))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => RuntimeBlockListFromJSON(jsonValue)); + } + + /** + * Returns a list of Runtime blocks. + */ + async runtimeBlocksGet(requestParameters: RuntimeBlocksGetRequest): Promise { + const response = await this.runtimeBlocksGetRaw(requestParameters); + return await response.value(); + } + + /** + * Returns a list of runtime events. + */ + async runtimeEventsGetRaw(requestParameters: RuntimeEventsGetRequest): Promise> { + if (requestParameters.runtime === null || requestParameters.runtime === undefined) { + throw new runtime.RequiredError('runtime','Required parameter requestParameters.runtime was null or undefined when calling runtimeEventsGet.'); + } + + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.offset !== undefined) { + queryParameters['offset'] = requestParameters.offset; + } + + if (requestParameters.block !== undefined) { + queryParameters['block'] = requestParameters.block; + } + + if (requestParameters.txIndex !== undefined) { + queryParameters['tx_index'] = requestParameters.txIndex; + } + + if (requestParameters.txHash !== undefined) { + queryParameters['tx_hash'] = requestParameters.txHash; + } + + if (requestParameters.type !== undefined) { + queryParameters['type'] = requestParameters.type; + } + + if (requestParameters.rel !== undefined) { + queryParameters['rel'] = requestParameters.rel; + } + + if (requestParameters.evmLogSignature !== undefined) { + queryParameters['evm_log_signature'] = requestParameters.evmLogSignature; + } + + if (requestParameters.contractAddress !== undefined) { + queryParameters['contract_address'] = requestParameters.contractAddress; + } + + if (requestParameters.nftId !== undefined) { + queryParameters['nft_id'] = requestParameters.nftId; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/{runtime}/events`.replace(`{${"runtime"}}`, encodeURIComponent(String(requestParameters.runtime))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => RuntimeEventListFromJSON(jsonValue)); + } + + /** + * Returns a list of runtime events. + */ + async runtimeEventsGet(requestParameters: RuntimeEventsGetRequest): Promise { + const response = await this.runtimeEventsGetRaw(requestParameters); + return await response.value(); + } + + /** + * Returns info on an EVM (ERC-20, ...) token on the runtime. + */ + async runtimeEvmTokensAddressGetRaw(requestParameters: RuntimeEvmTokensAddressGetRequest): Promise> { + if (requestParameters.runtime === null || requestParameters.runtime === undefined) { + throw new runtime.RequiredError('runtime','Required parameter requestParameters.runtime was null or undefined when calling runtimeEvmTokensAddressGet.'); + } + + if (requestParameters.address === null || requestParameters.address === undefined) { + throw new runtime.RequiredError('address','Required parameter requestParameters.address was null or undefined when calling runtimeEvmTokensAddressGet.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/{runtime}/evm_tokens/{address}`.replace(`{${"runtime"}}`, encodeURIComponent(String(requestParameters.runtime))).replace(`{${"address"}}`, encodeURIComponent(String(requestParameters.address))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => EvmTokenFromJSON(jsonValue)); + } + + /** + * Returns info on an EVM (ERC-20, ...) token on the runtime. + */ + async runtimeEvmTokensAddressGet(requestParameters: RuntimeEvmTokensAddressGetRequest): Promise { + const response = await this.runtimeEvmTokensAddressGetRaw(requestParameters); + return await response.value(); + } + + /** + * Returns the list of holders of an EVM (ERC-20, ...) token. This endpoint does not verify that `address` is actually an EVM token; if it is not, it will simply return an empty list. + */ + async runtimeEvmTokensAddressHoldersGetRaw(requestParameters: RuntimeEvmTokensAddressHoldersGetRequest): Promise> { + if (requestParameters.runtime === null || requestParameters.runtime === undefined) { + throw new runtime.RequiredError('runtime','Required parameter requestParameters.runtime was null or undefined when calling runtimeEvmTokensAddressHoldersGet.'); + } + + if (requestParameters.address === null || requestParameters.address === undefined) { + throw new runtime.RequiredError('address','Required parameter requestParameters.address was null or undefined when calling runtimeEvmTokensAddressHoldersGet.'); + } + + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.offset !== undefined) { + queryParameters['offset'] = requestParameters.offset; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/{runtime}/evm_tokens/{address}/holders`.replace(`{${"runtime"}}`, encodeURIComponent(String(requestParameters.runtime))).replace(`{${"address"}}`, encodeURIComponent(String(requestParameters.address))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => TokenHolderListFromJSON(jsonValue)); + } + + /** + * Returns the list of holders of an EVM (ERC-20, ...) token. This endpoint does not verify that `address` is actually an EVM token; if it is not, it will simply return an empty list. + */ + async runtimeEvmTokensAddressHoldersGet(requestParameters: RuntimeEvmTokensAddressHoldersGetRequest): Promise { + const response = await this.runtimeEvmTokensAddressHoldersGetRaw(requestParameters); + return await response.value(); + } + + /** + * Returns the list of non-fungible token (NFT) instances of an EVM (ERC-721, ...) token. This endpoint does not verify that `address` is actually an EVM token; if it is not, it will simply return an empty list. + */ + async runtimeEvmTokensAddressNftsGetRaw(requestParameters: RuntimeEvmTokensAddressNftsGetRequest): Promise> { + if (requestParameters.runtime === null || requestParameters.runtime === undefined) { + throw new runtime.RequiredError('runtime','Required parameter requestParameters.runtime was null or undefined when calling runtimeEvmTokensAddressNftsGet.'); + } + + if (requestParameters.address === null || requestParameters.address === undefined) { + throw new runtime.RequiredError('address','Required parameter requestParameters.address was null or undefined when calling runtimeEvmTokensAddressNftsGet.'); + } + + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.offset !== undefined) { + queryParameters['offset'] = requestParameters.offset; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/{runtime}/evm_tokens/{address}/nfts`.replace(`{${"runtime"}}`, encodeURIComponent(String(requestParameters.runtime))).replace(`{${"address"}}`, encodeURIComponent(String(requestParameters.address))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => EvmNftListFromJSON(jsonValue)); + } + + /** + * Returns the list of non-fungible token (NFT) instances of an EVM (ERC-721, ...) token. This endpoint does not verify that `address` is actually an EVM token; if it is not, it will simply return an empty list. + */ + async runtimeEvmTokensAddressNftsGet(requestParameters: RuntimeEvmTokensAddressNftsGetRequest): Promise { + const response = await this.runtimeEvmTokensAddressNftsGetRaw(requestParameters); + return await response.value(); + } + + /** + * Returns the non-fungible token (NFT) instance of an EVM (ERC-721, ...) token. + */ + async runtimeEvmTokensAddressNftsIdGetRaw(requestParameters: RuntimeEvmTokensAddressNftsIdGetRequest): Promise> { + if (requestParameters.runtime === null || requestParameters.runtime === undefined) { + throw new runtime.RequiredError('runtime','Required parameter requestParameters.runtime was null or undefined when calling runtimeEvmTokensAddressNftsIdGet.'); + } + + if (requestParameters.address === null || requestParameters.address === undefined) { + throw new runtime.RequiredError('address','Required parameter requestParameters.address was null or undefined when calling runtimeEvmTokensAddressNftsIdGet.'); + } + + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling runtimeEvmTokensAddressNftsIdGet.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/{runtime}/evm_tokens/{address}/nfts/{id}`.replace(`{${"runtime"}}`, encodeURIComponent(String(requestParameters.runtime))).replace(`{${"address"}}`, encodeURIComponent(String(requestParameters.address))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => EvmNftFromJSON(jsonValue)); + } + + /** + * Returns the non-fungible token (NFT) instance of an EVM (ERC-721, ...) token. + */ + async runtimeEvmTokensAddressNftsIdGet(requestParameters: RuntimeEvmTokensAddressNftsIdGetRequest): Promise { + const response = await this.runtimeEvmTokensAddressNftsIdGetRaw(requestParameters); + return await response.value(); + } + + /** + * Returns a list of EVM (ERC-20, ...) tokens on the runtime. + */ + async runtimeEvmTokensGetRaw(requestParameters: RuntimeEvmTokensGetRequest): Promise> { + if (requestParameters.runtime === null || requestParameters.runtime === undefined) { + throw new runtime.RequiredError('runtime','Required parameter requestParameters.runtime was null or undefined when calling runtimeEvmTokensGet.'); + } + + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.offset !== undefined) { + queryParameters['offset'] = requestParameters.offset; + } + + if (requestParameters.name !== undefined) { + queryParameters['name'] = requestParameters.name; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/{runtime}/evm_tokens`.replace(`{${"runtime"}}`, encodeURIComponent(String(requestParameters.runtime))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => EvmTokenListFromJSON(jsonValue)); + } + + /** + * Returns a list of EVM (ERC-20, ...) tokens on the runtime. + */ + async runtimeEvmTokensGet(requestParameters: RuntimeEvmTokensGetRequest): Promise { + const response = await this.runtimeEvmTokensGetRaw(requestParameters); + return await response.value(); + } + + /** + * Returns the runtime status. + */ + async runtimeStatusGetRaw(requestParameters: RuntimeStatusGetRequest): Promise> { + if (requestParameters.runtime === null || requestParameters.runtime === undefined) { + throw new runtime.RequiredError('runtime','Required parameter requestParameters.runtime was null or undefined when calling runtimeStatusGet.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/{runtime}/status`.replace(`{${"runtime"}}`, encodeURIComponent(String(requestParameters.runtime))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => RuntimeStatusFromJSON(jsonValue)); + } + + /** + * Returns the runtime status. + */ + async runtimeStatusGet(requestParameters: RuntimeStatusGetRequest): Promise { + const response = await this.runtimeStatusGetRaw(requestParameters); + return await response.value(); + } + + /** + * Returns a list of Runtime transactions. + */ + async runtimeTransactionsGetRaw(requestParameters: RuntimeTransactionsGetRequest): Promise> { + if (requestParameters.runtime === null || requestParameters.runtime === undefined) { + throw new runtime.RequiredError('runtime','Required parameter requestParameters.runtime was null or undefined when calling runtimeTransactionsGet.'); + } + + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.offset !== undefined) { + queryParameters['offset'] = requestParameters.offset; + } + + if (requestParameters.block !== undefined) { + queryParameters['block'] = requestParameters.block; + } + + if (requestParameters.after !== undefined) { + queryParameters['after'] = (requestParameters.after as any).toISOString(); + } + + if (requestParameters.before !== undefined) { + queryParameters['before'] = (requestParameters.before as any).toISOString(); + } + + if (requestParameters.rel !== undefined) { + queryParameters['rel'] = requestParameters.rel; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/{runtime}/transactions`.replace(`{${"runtime"}}`, encodeURIComponent(String(requestParameters.runtime))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => RuntimeTransactionListFromJSON(jsonValue)); + } + + /** + * Returns a list of Runtime transactions. + */ + async runtimeTransactionsGet(requestParameters: RuntimeTransactionsGetRequest): Promise { + const response = await this.runtimeTransactionsGetRaw(requestParameters); + return await response.value(); + } + + /** + * Returns runtime transactions with the given transaction hash. + */ + async runtimeTransactionsTxHashGetRaw(requestParameters: RuntimeTransactionsTxHashGetRequest): Promise> { + if (requestParameters.runtime === null || requestParameters.runtime === undefined) { + throw new runtime.RequiredError('runtime','Required parameter requestParameters.runtime was null or undefined when calling runtimeTransactionsTxHashGet.'); + } + + if (requestParameters.txHash === null || requestParameters.txHash === undefined) { + throw new runtime.RequiredError('txHash','Required parameter requestParameters.txHash was null or undefined when calling runtimeTransactionsTxHashGet.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/{runtime}/transactions/{tx_hash}`.replace(`{${"runtime"}}`, encodeURIComponent(String(requestParameters.runtime))).replace(`{${"tx_hash"}}`, encodeURIComponent(String(requestParameters.txHash))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => RuntimeTransactionListFromJSON(jsonValue)); + } + + /** + * Returns runtime transactions with the given transaction hash. + */ + async runtimeTransactionsTxHashGet(requestParameters: RuntimeTransactionsTxHashGetRequest): Promise { + const response = await this.runtimeTransactionsTxHashGetRaw(requestParameters); + return await response.value(); + } + +} diff --git a/src/vendors/nexus/apis/index.ts b/src/vendors/nexus/apis/index.ts new file mode 100644 index 0000000000..20eda2ab0a --- /dev/null +++ b/src/vendors/nexus/apis/index.ts @@ -0,0 +1 @@ +export * from './DefaultApi' diff --git a/src/vendors/nexus/index.ts b/src/vendors/nexus/index.ts new file mode 100644 index 0000000000..36e2d32324 --- /dev/null +++ b/src/vendors/nexus/index.ts @@ -0,0 +1,3 @@ +export * from './runtime' +export * from './apis' +export * from './models' diff --git a/src/vendors/nexus/models/Account.ts b/src/vendors/nexus/models/Account.ts new file mode 100644 index 0000000000..777086ff74 --- /dev/null +++ b/src/vendors/nexus/models/Account.ts @@ -0,0 +1,142 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 { + AccountStats, + AccountStatsFromJSON, + AccountStatsFromJSONTyped, + AccountStatsToJSON, + Allowance, + AllowanceFromJSON, + AllowanceFromJSONTyped, + AllowanceToJSON, +} from './'; + +/** + * A consensus layer account. + * @export + * @interface Account + */ +export interface Account { + /** + * The staking address for this account. + * @type {string} + * @memberof Account + */ + address: string; + /** + * The expected nonce for the next transaction (= last used nonce + 1) + * @type {number} + * @memberof Account + */ + nonce: number; + /** + * The available balance, in base units. + * @type {string} + * @memberof Account + */ + available: string; + /** + * The active escrow balance, in base units. + * @type {string} + * @memberof Account + */ + escrow: string; + /** + * The debonding escrow balance, in base units. + * @type {string} + * @memberof Account + */ + debonding: string; + /** + * The balance of this accounts' (outgoing) delegations, in base units. + * @type {string} + * @memberof Account + */ + delegations_balance: string; + /** + * The balance of this accounts' (outgoing) debonding delegations, in base units. + * @type {string} + * @memberof Account + */ + debonding_delegations_balance: string; + /** + * The second-granular consensus time of the block in which this account was first active. + * Dates before Cobalt (2021-04-28) are approximate. + * @type {Date} + * @memberof Account + */ + first_activity?: Date; + /** + * The allowances made by this account. + * This field is omitted when listing multiple accounts. + * @type {Array} + * @memberof Account + */ + allowances: Array; + /** + * + * @type {AccountStats} + * @memberof Account + */ + stats: AccountStats; +} + +export function AccountFromJSON(json: any): Account { + return AccountFromJSONTyped(json, false); +} + +export function AccountFromJSONTyped(json: any, ignoreDiscriminator: boolean): Account { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'address': json['address'], + 'nonce': json['nonce'], + 'available': json['available'], + 'escrow': json['escrow'], + 'debonding': json['debonding'], + 'delegations_balance': json['delegations_balance'], + 'debonding_delegations_balance': json['debonding_delegations_balance'], + 'first_activity': !exists(json, 'first_activity') ? undefined : (new Date(json['first_activity'])), + 'allowances': ((json['allowances'] as Array).map(AllowanceFromJSON)), + 'stats': AccountStatsFromJSON(json['stats']), + }; +} + +export function AccountToJSON(value?: Account | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'address': value.address, + 'nonce': value.nonce, + 'available': value.available, + 'escrow': value.escrow, + 'debonding': value.debonding, + 'delegations_balance': value.delegations_balance, + 'debonding_delegations_balance': value.debonding_delegations_balance, + 'first_activity': value.first_activity === undefined ? undefined : (value.first_activity.toISOString()), + 'allowances': ((value.allowances as Array).map(AllowanceToJSON)), + 'stats': AccountStatsToJSON(value.stats), + }; +} + + diff --git a/src/vendors/nexus/models/AccountList.ts b/src/vendors/nexus/models/AccountList.ts new file mode 100644 index 0000000000..d68b71113a --- /dev/null +++ b/src/vendors/nexus/models/AccountList.ts @@ -0,0 +1,89 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 { + Account, + AccountFromJSON, + AccountFromJSONTyped, + AccountToJSON, + AccountListAllOf, + AccountListAllOfFromJSON, + AccountListAllOfFromJSONTyped, + AccountListAllOfToJSON, + List, + ListFromJSON, + ListFromJSONTyped, + ListToJSON, +} from './'; + +/** + * + * @export + * @interface AccountList + */ +export interface AccountList { + /** + * The total number of records that match the query, i.e. the number of records + * the query would return with limit=infinity. + * @type {number} + * @memberof AccountList + */ + total_count: number; + /** + * Whether total_count is clipped for performance reasons. + * @type {boolean} + * @memberof AccountList + */ + is_total_count_clipped: boolean; + /** + * + * @type {Array} + * @memberof AccountList + */ + accounts: Array; +} + +export function AccountListFromJSON(json: any): AccountList { + return AccountListFromJSONTyped(json, false); +} + +export function AccountListFromJSONTyped(json: any, ignoreDiscriminator: boolean): AccountList { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'total_count': json['total_count'], + 'is_total_count_clipped': json['is_total_count_clipped'], + 'accounts': ((json['accounts'] as Array).map(AccountFromJSON)), + }; +} + +export function AccountListToJSON(value?: AccountList | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'total_count': value.total_count, + 'is_total_count_clipped': value.is_total_count_clipped, + 'accounts': ((value.accounts as Array).map(AccountToJSON)), + }; +} + + diff --git a/src/vendors/nexus/models/AccountListAllOf.ts b/src/vendors/nexus/models/AccountListAllOf.ts new file mode 100644 index 0000000000..595d1a40e6 --- /dev/null +++ b/src/vendors/nexus/models/AccountListAllOf.ts @@ -0,0 +1,64 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 { + Account, + AccountFromJSON, + AccountFromJSONTyped, + AccountToJSON, +} from './'; + +/** + * A list of consensus layer accounts. + * @export + * @interface AccountListAllOf + */ +export interface AccountListAllOf { + /** + * + * @type {Array} + * @memberof AccountListAllOf + */ + accounts: Array; +} + +export function AccountListAllOfFromJSON(json: any): AccountListAllOf { + return AccountListAllOfFromJSONTyped(json, false); +} + +export function AccountListAllOfFromJSONTyped(json: any, ignoreDiscriminator: boolean): AccountListAllOf { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'accounts': ((json['accounts'] as Array).map(AccountFromJSON)), + }; +} + +export function AccountListAllOfToJSON(value?: AccountListAllOf | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'accounts': ((value.accounts as Array).map(AccountToJSON)), + }; +} + + diff --git a/src/vendors/nexus/models/AccountStats.ts b/src/vendors/nexus/models/AccountStats.ts new file mode 100644 index 0000000000..16cefdc71f --- /dev/null +++ b/src/vendors/nexus/models/AccountStats.ts @@ -0,0 +1,77 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 AccountStats + */ +export interface AccountStats { + /** + * The total amount of native tokens sent, in base units. + * DEPRECATED: This field might be inaccurate. Nexus is currently not able to track + * certain actions which subtract/add tokens. + * @type {string} + * @memberof AccountStats + */ + total_sent?: string; + /** + * The total amount of native tokens received, in base units. + * DEPRECATED: This field might be inaccurate. Nexus is currently not able to track + * certain actions which subtract/add tokens. + * @type {string} + * @memberof AccountStats + */ + total_received?: string; + /** + * The total number of transactions this account was involved with. + * @type {number} + * @memberof AccountStats + */ + num_txns: number; +} + +export function AccountStatsFromJSON(json: any): AccountStats { + return AccountStatsFromJSONTyped(json, false); +} + +export function AccountStatsFromJSONTyped(json: any, ignoreDiscriminator: boolean): AccountStats { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'total_sent': !exists(json, 'total_sent') ? undefined : json['total_sent'], + 'total_received': !exists(json, 'total_received') ? undefined : json['total_received'], + 'num_txns': json['num_txns'], + }; +} + +export function AccountStatsToJSON(value?: AccountStats | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'total_sent': value.total_sent, + 'total_received': value.total_received, + 'num_txns': value.num_txns, + }; +} + + diff --git a/src/vendors/nexus/models/ActiveAccounts.ts b/src/vendors/nexus/models/ActiveAccounts.ts new file mode 100644 index 0000000000..871ca6e275 --- /dev/null +++ b/src/vendors/nexus/models/ActiveAccounts.ts @@ -0,0 +1,65 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 ActiveAccounts + */ +export interface ActiveAccounts { + /** + * The date for the end of the daily active accounts measurement window. + * @type {Date} + * @memberof ActiveAccounts + */ + window_end: Date; + /** + * The number of active accounts for the 24hour window ending at window_end. + * @type {number} + * @memberof ActiveAccounts + */ + active_accounts: number; +} + +export function ActiveAccountsFromJSON(json: any): ActiveAccounts { + return ActiveAccountsFromJSONTyped(json, false); +} + +export function ActiveAccountsFromJSONTyped(json: any, ignoreDiscriminator: boolean): ActiveAccounts { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'window_end': (new Date(json['window_end'])), + 'active_accounts': json['active_accounts'], + }; +} + +export function ActiveAccountsToJSON(value?: ActiveAccounts | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'window_end': (value.window_end.toISOString()), + 'active_accounts': value.active_accounts, + }; +} + + diff --git a/src/vendors/nexus/models/ActiveAccountsList.ts b/src/vendors/nexus/models/ActiveAccountsList.ts new file mode 100644 index 0000000000..e683d41990 --- /dev/null +++ b/src/vendors/nexus/models/ActiveAccountsList.ts @@ -0,0 +1,72 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 { + ActiveAccounts, + ActiveAccountsFromJSON, + ActiveAccountsFromJSONTyped, + ActiveAccountsToJSON, +} from './'; + +/** + * A list of daily unique active account windows. + * @export + * @interface ActiveAccountsList + */ +export interface ActiveAccountsList { + /** + * + * @type {number} + * @memberof ActiveAccountsList + */ + window_size_seconds: number; + /** + * The list of daily unique active account windows. + * @type {Array} + * @memberof ActiveAccountsList + */ + windows: Array; +} + +export function ActiveAccountsListFromJSON(json: any): ActiveAccountsList { + return ActiveAccountsListFromJSONTyped(json, false); +} + +export function ActiveAccountsListFromJSONTyped(json: any, ignoreDiscriminator: boolean): ActiveAccountsList { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'window_size_seconds': json['window_size_seconds'], + 'windows': ((json['windows'] as Array).map(ActiveAccountsFromJSON)), + }; +} + +export function ActiveAccountsListToJSON(value?: ActiveAccountsList | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'window_size_seconds': value.window_size_seconds, + 'windows': ((value.windows as Array).map(ActiveAccountsToJSON)), + }; +} + + diff --git a/src/vendors/nexus/models/AddressDerivationContext.ts b/src/vendors/nexus/models/AddressDerivationContext.ts new file mode 100644 index 0000000000..7c170b6d80 --- /dev/null +++ b/src/vendors/nexus/models/AddressDerivationContext.ts @@ -0,0 +1,40 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * + * @export + * @enum {string} + */ +export enum AddressDerivationContext { + CoreAddressStaking = 'oasis-core/address: staking', + RuntimeSdkAddressSecp256k1eth = 'oasis-runtime-sdk/address: secp256k1eth', + RuntimeSdkAddressSr25519 = 'oasis-runtime-sdk/address: sr25519', + RuntimeSdkAddressMultisig = 'oasis-runtime-sdk/address: multisig', + RuntimeSdkAddressModule = 'oasis-runtime-sdk/address: module', + RuntimeSdkAddressRuntime = 'oasis-runtime-sdk/address: runtime' +} + +export function AddressDerivationContextFromJSON(json: any): AddressDerivationContext { + return AddressDerivationContextFromJSONTyped(json, false); +} + +export function AddressDerivationContextFromJSONTyped(json: any, ignoreDiscriminator: boolean): AddressDerivationContext { + return json as AddressDerivationContext; +} + +export function AddressDerivationContextToJSON(value?: AddressDerivationContext | null): any { + return value as any; +} + diff --git a/src/vendors/nexus/models/AddressPreimage.ts b/src/vendors/nexus/models/AddressPreimage.ts new file mode 100644 index 0000000000..2d8c9a45b7 --- /dev/null +++ b/src/vendors/nexus/models/AddressPreimage.ts @@ -0,0 +1,96 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 { + AddressDerivationContext, + AddressDerivationContextFromJSON, + AddressDerivationContextFromJSONTyped, + AddressDerivationContextToJSON, +} from './'; + +/** + * The data from which a consensus-style address (`oasis1...`) + * was derived. Notably, for EVM runtimes like Sapphire, + * this links the Oasis address and the Ethereum address. + * + * Oasis addresses are derived from a piece of data, such as an ed25519 + * public key or an Ethereum address. For example, [this](https://github.com/oasisprotocol/oasis-sdk/blob/b37e6da699df331f5a2ac62793f8be099c68469c/client-sdk/go/helpers/address.go#L90-L91) + * is how an Ethereum is converted to an Oasis address. The type of underlying data usually also + * determines how the signatuers for this address are verified. + * + * Consensus supports only "staking addresses" (`context="oasis-core/address: staking"` + * below; always ed25519-backed). + * Runtimes support all types. This means that every consensus address is also + * valid in every runtime. For example, in EVM runtimes, you can use staking + * addresses, but only with Oasis tools (e.g. a wallet); EVM contracts such as + * ERC20 tokens or tools such as Metamask cannot interact with staking addresses. + * @export + * @interface AddressPreimage + */ +export interface AddressPreimage { + /** + * The method by which the Oasis address was derived from `address_data`. + * @type {AddressDerivationContext} + * @memberof AddressPreimage + */ + context: AddressDerivationContext; + /** + * Version of the `context`. + * @type {number} + * @memberof AddressPreimage + */ + context_version?: number; + /** + * The base64-encoded data from which the Oasis address was derived. + * When `context = "oasis-runtime-sdk/address: secp256k1eth"`, this + * is the Ethereum address (in base64, not hex!). + * @type {string} + * @memberof AddressPreimage + */ + address_data: string; +} + +export function AddressPreimageFromJSON(json: any): AddressPreimage { + return AddressPreimageFromJSONTyped(json, false); +} + +export function AddressPreimageFromJSONTyped(json: any, ignoreDiscriminator: boolean): AddressPreimage { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'context': AddressDerivationContextFromJSON(json['context']), + 'context_version': !exists(json, 'context_version') ? undefined : json['context_version'], + 'address_data': json['address_data'], + }; +} + +export function AddressPreimageToJSON(value?: AddressPreimage | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'context': AddressDerivationContextToJSON(value.context), + 'context_version': value.context_version, + 'address_data': value.address_data, + }; +} + + diff --git a/src/vendors/nexus/models/Allowance.ts b/src/vendors/nexus/models/Allowance.ts new file mode 100644 index 0000000000..a6b20a6c98 --- /dev/null +++ b/src/vendors/nexus/models/Allowance.ts @@ -0,0 +1,66 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 Allowance + */ +export interface Allowance { + /** + * The allowed account. + * @type {string} + * @memberof Allowance + */ + address: string; + /** + * The amount allowed for the allowed account. + * This field is omitted when listing multiple accounts. + * @type {string} + * @memberof Allowance + */ + amount: string; +} + +export function AllowanceFromJSON(json: any): Allowance { + return AllowanceFromJSONTyped(json, false); +} + +export function AllowanceFromJSONTyped(json: any, ignoreDiscriminator: boolean): Allowance { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'address': json['address'], + 'amount': json['amount'], + }; +} + +export function AllowanceToJSON(value?: Allowance | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'address': value.address, + 'amount': value.amount, + }; +} + + diff --git a/src/vendors/nexus/models/BareTokenHolder.ts b/src/vendors/nexus/models/BareTokenHolder.ts new file mode 100644 index 0000000000..9a131341cc --- /dev/null +++ b/src/vendors/nexus/models/BareTokenHolder.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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'; +/** + * Balance of an account for a specific (implied) runtime and token. + * @export + * @interface BareTokenHolder + */ +export interface BareTokenHolder { + /** + * The Oasis address of the account holder. + * @type {string} + * @memberof BareTokenHolder + */ + holder_address: string; + /** + * The Ethereum address of the same account holder, if meaningfully defined. + * @type {string} + * @memberof BareTokenHolder + */ + eth_holder_address?: string; + /** + * Number of tokens held, in base units. + * @type {string} + * @memberof BareTokenHolder + */ + balance: string; +} + +export function BareTokenHolderFromJSON(json: any): BareTokenHolder { + return BareTokenHolderFromJSONTyped(json, false); +} + +export function BareTokenHolderFromJSONTyped(json: any, ignoreDiscriminator: boolean): BareTokenHolder { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'holder_address': json['holder_address'], + 'eth_holder_address': !exists(json, 'eth_holder_address') ? undefined : json['eth_holder_address'], + 'balance': json['balance'], + }; +} + +export function BareTokenHolderToJSON(value?: BareTokenHolder | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'holder_address': value.holder_address, + 'eth_holder_address': value.eth_holder_address, + 'balance': value.balance, + }; +} + + diff --git a/src/vendors/nexus/models/Block.ts b/src/vendors/nexus/models/Block.ts new file mode 100644 index 0000000000..2062bbade2 --- /dev/null +++ b/src/vendors/nexus/models/Block.ts @@ -0,0 +1,115 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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'; +/** + * A consensus block. + * @export + * @interface Block + */ +export interface Block { + /** + * The block height. + * @type {number} + * @memberof Block + */ + height: number; + /** + * The block header hash. + * @type {string} + * @memberof Block + */ + hash: string; + /** + * The second-granular consensus time. + * @type {Date} + * @memberof Block + */ + timestamp: Date; + /** + * Number of transactions in the block. + * @type {number} + * @memberof Block + */ + num_transactions: number; + /** + * The gas limit for the block. A gas limit 0 means that the max block gas was unlimited. + * Blocks from Cobalt, Damask, and early Eden had no gas limit as their sizes were only + * restricted by byte size until an upgrade during Eden introduced a gas limit. + * @type {string} + * @memberof Block + */ + gas_limit: string; + /** + * The size limit for the block in bytes. + * @type {string} + * @memberof Block + */ + size_limit?: string; + /** + * The epoch number of the epoch in which the block was produced. + * @type {number} + * @memberof Block + */ + epoch: number; + /** + * The Merkle root of the state tree after applying the block. + * @type {string} + * @memberof Block + */ + state_root: string; +} + +export function BlockFromJSON(json: any): Block { + return BlockFromJSONTyped(json, false); +} + +export function BlockFromJSONTyped(json: any, ignoreDiscriminator: boolean): Block { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'height': json['height'], + 'hash': json['hash'], + 'timestamp': (new Date(json['timestamp'])), + 'num_transactions': json['num_transactions'], + 'gas_limit': json['gas_limit'], + 'size_limit': !exists(json, 'size_limit') ? undefined : json['size_limit'], + 'epoch': json['epoch'], + 'state_root': json['state_root'], + }; +} + +export function BlockToJSON(value?: Block | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'height': value.height, + 'hash': value.hash, + 'timestamp': (value.timestamp.toISOString()), + 'num_transactions': value.num_transactions, + 'gas_limit': value.gas_limit, + 'size_limit': value.size_limit, + 'epoch': value.epoch, + 'state_root': value.state_root, + }; +} + + diff --git a/src/vendors/nexus/models/BlockList.ts b/src/vendors/nexus/models/BlockList.ts new file mode 100644 index 0000000000..cd635765d2 --- /dev/null +++ b/src/vendors/nexus/models/BlockList.ts @@ -0,0 +1,89 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 { + Block, + BlockFromJSON, + BlockFromJSONTyped, + BlockToJSON, + BlockListAllOf, + BlockListAllOfFromJSON, + BlockListAllOfFromJSONTyped, + BlockListAllOfToJSON, + List, + ListFromJSON, + ListFromJSONTyped, + ListToJSON, +} from './'; + +/** + * A list of consensus blocks. + * @export + * @interface BlockList + */ +export interface BlockList { + /** + * The total number of records that match the query, i.e. the number of records + * the query would return with limit=infinity. + * @type {number} + * @memberof BlockList + */ + total_count: number; + /** + * Whether total_count is clipped for performance reasons. + * @type {boolean} + * @memberof BlockList + */ + is_total_count_clipped: boolean; + /** + * + * @type {Array} + * @memberof BlockList + */ + blocks: Array; +} + +export function BlockListFromJSON(json: any): BlockList { + return BlockListFromJSONTyped(json, false); +} + +export function BlockListFromJSONTyped(json: any, ignoreDiscriminator: boolean): BlockList { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'total_count': json['total_count'], + 'is_total_count_clipped': json['is_total_count_clipped'], + 'blocks': ((json['blocks'] as Array).map(BlockFromJSON)), + }; +} + +export function BlockListToJSON(value?: BlockList | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'total_count': value.total_count, + 'is_total_count_clipped': value.is_total_count_clipped, + 'blocks': ((value.blocks as Array).map(BlockToJSON)), + }; +} + + diff --git a/src/vendors/nexus/models/BlockListAllOf.ts b/src/vendors/nexus/models/BlockListAllOf.ts new file mode 100644 index 0000000000..955e51c76b --- /dev/null +++ b/src/vendors/nexus/models/BlockListAllOf.ts @@ -0,0 +1,64 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 { + Block, + BlockFromJSON, + BlockFromJSONTyped, + BlockToJSON, +} from './'; + +/** + * + * @export + * @interface BlockListAllOf + */ +export interface BlockListAllOf { + /** + * + * @type {Array} + * @memberof BlockListAllOf + */ + blocks: Array; +} + +export function BlockListAllOfFromJSON(json: any): BlockListAllOf { + return BlockListAllOfFromJSONTyped(json, false); +} + +export function BlockListAllOfFromJSONTyped(json: any, ignoreDiscriminator: boolean): BlockListAllOf { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'blocks': ((json['blocks'] as Array).map(BlockFromJSON)), + }; +} + +export function BlockListAllOfToJSON(value?: BlockListAllOf | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'blocks': ((value.blocks as Array).map(BlockToJSON)), + }; +} + + diff --git a/src/vendors/nexus/models/ConsensusEvent.ts b/src/vendors/nexus/models/ConsensusEvent.ts new file mode 100644 index 0000000000..262ddea624 --- /dev/null +++ b/src/vendors/nexus/models/ConsensusEvent.ts @@ -0,0 +1,134 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 { + ConsensusEventType, + ConsensusEventTypeFromJSON, + ConsensusEventTypeFromJSONTyped, + ConsensusEventTypeToJSON, + Runtime, + RuntimeFromJSON, + RuntimeFromJSONTyped, + RuntimeToJSON, +} from './'; + +/** + * An event emitted by the consensus layer. + * @export + * @interface ConsensusEvent + */ +export interface ConsensusEvent { + /** + * The block height at which this event was generated. + * @type {number} + * @memberof ConsensusEvent + */ + block: number; + /** + * 0-based index of this event's originating transaction within its block. + * Absent if the event did not originate from a transaction. + * @type {number} + * @memberof ConsensusEvent + */ + tx_index?: number; + /** + * Hash of this event's originating transaction. + * Absent if the event did not originate from a transaction. + * @type {string} + * @memberof ConsensusEvent + */ + tx_hash?: string; + /** + * The ID of the runtime to which the event relates, encoded in hex. + * Present only for events of type `roothash.*`. + * @type {string} + * @memberof ConsensusEvent + */ + roothash_runtime_id?: string; + /** + * The runtime to which the event relates. + * Present only for events of type `roothash.*`. + * @type {Runtime} + * @memberof ConsensusEvent + */ + roothash_runtime?: Runtime; + /** + * When applicable, the round in the runtime to which this event + * relates. + * Present only for events of type `roothash.*` except for + * `roothash.execution_discrepancy` before Eden. + * @type {number} + * @memberof ConsensusEvent + */ + roothash_runtime_round?: number; + /** + * The type of the event. + * @type {ConsensusEventType} + * @memberof ConsensusEvent + */ + type: ConsensusEventType; + /** + * The event contents. This spec does not encode the many possible types; + * instead, see [the Go API](https://pkg.go.dev/github.com/oasisprotocol/oasis-core/go/consensus/api/transaction/results#Event) of oasis-core. + * This object will conform to one of the `*Event` types two levels down + * the hierarchy, e.g. `TransferEvent` from `Event > staking.Event > TransferEvent` + * @type {object} + * @memberof ConsensusEvent + */ + body: object; +} + +export function ConsensusEventFromJSON(json: any): ConsensusEvent { + return ConsensusEventFromJSONTyped(json, false); +} + +export function ConsensusEventFromJSONTyped(json: any, ignoreDiscriminator: boolean): ConsensusEvent { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'block': json['block'], + 'tx_index': !exists(json, 'tx_index') ? undefined : json['tx_index'], + 'tx_hash': !exists(json, 'tx_hash') ? undefined : json['tx_hash'], + 'roothash_runtime_id': !exists(json, 'roothash_runtime_id') ? undefined : json['roothash_runtime_id'], + 'roothash_runtime': !exists(json, 'roothash_runtime') ? undefined : RuntimeFromJSON(json['roothash_runtime']), + 'roothash_runtime_round': !exists(json, 'roothash_runtime_round') ? undefined : json['roothash_runtime_round'], + 'type': ConsensusEventTypeFromJSON(json['type']), + 'body': json['body'], + }; +} + +export function ConsensusEventToJSON(value?: ConsensusEvent | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'block': value.block, + 'tx_index': value.tx_index, + 'tx_hash': value.tx_hash, + 'roothash_runtime_id': value.roothash_runtime_id, + 'roothash_runtime': RuntimeToJSON(value.roothash_runtime), + 'roothash_runtime_round': value.roothash_runtime_round, + 'type': ConsensusEventTypeToJSON(value.type), + 'body': value.body, + }; +} + + diff --git a/src/vendors/nexus/models/ConsensusEventList.ts b/src/vendors/nexus/models/ConsensusEventList.ts new file mode 100644 index 0000000000..2a9af56962 --- /dev/null +++ b/src/vendors/nexus/models/ConsensusEventList.ts @@ -0,0 +1,89 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 { + ConsensusEvent, + ConsensusEventFromJSON, + ConsensusEventFromJSONTyped, + ConsensusEventToJSON, + ConsensusEventListAllOf, + ConsensusEventListAllOfFromJSON, + ConsensusEventListAllOfFromJSONTyped, + ConsensusEventListAllOfToJSON, + List, + ListFromJSON, + ListFromJSONTyped, + ListToJSON, +} from './'; + +/** + * + * @export + * @interface ConsensusEventList + */ +export interface ConsensusEventList { + /** + * The total number of records that match the query, i.e. the number of records + * the query would return with limit=infinity. + * @type {number} + * @memberof ConsensusEventList + */ + total_count: number; + /** + * Whether total_count is clipped for performance reasons. + * @type {boolean} + * @memberof ConsensusEventList + */ + is_total_count_clipped: boolean; + /** + * + * @type {Array} + * @memberof ConsensusEventList + */ + events: Array; +} + +export function ConsensusEventListFromJSON(json: any): ConsensusEventList { + return ConsensusEventListFromJSONTyped(json, false); +} + +export function ConsensusEventListFromJSONTyped(json: any, ignoreDiscriminator: boolean): ConsensusEventList { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'total_count': json['total_count'], + 'is_total_count_clipped': json['is_total_count_clipped'], + 'events': ((json['events'] as Array).map(ConsensusEventFromJSON)), + }; +} + +export function ConsensusEventListToJSON(value?: ConsensusEventList | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'total_count': value.total_count, + 'is_total_count_clipped': value.is_total_count_clipped, + 'events': ((value.events as Array).map(ConsensusEventToJSON)), + }; +} + + diff --git a/src/vendors/nexus/models/ConsensusEventListAllOf.ts b/src/vendors/nexus/models/ConsensusEventListAllOf.ts new file mode 100644 index 0000000000..0fa9963a8f --- /dev/null +++ b/src/vendors/nexus/models/ConsensusEventListAllOf.ts @@ -0,0 +1,64 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 { + ConsensusEvent, + ConsensusEventFromJSON, + ConsensusEventFromJSONTyped, + ConsensusEventToJSON, +} from './'; + +/** + * A list of consensus events. + * @export + * @interface ConsensusEventListAllOf + */ +export interface ConsensusEventListAllOf { + /** + * + * @type {Array} + * @memberof ConsensusEventListAllOf + */ + events: Array; +} + +export function ConsensusEventListAllOfFromJSON(json: any): ConsensusEventListAllOf { + return ConsensusEventListAllOfFromJSONTyped(json, false); +} + +export function ConsensusEventListAllOfFromJSONTyped(json: any, ignoreDiscriminator: boolean): ConsensusEventListAllOf { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'events': ((json['events'] as Array).map(ConsensusEventFromJSON)), + }; +} + +export function ConsensusEventListAllOfToJSON(value?: ConsensusEventListAllOf | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'events': ((value.events as Array).map(ConsensusEventToJSON)), + }; +} + + diff --git a/src/vendors/nexus/models/ConsensusEventType.ts b/src/vendors/nexus/models/ConsensusEventType.ts new file mode 100644 index 0000000000..8a43288428 --- /dev/null +++ b/src/vendors/nexus/models/ConsensusEventType.ts @@ -0,0 +1,55 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * + * @export + * @enum {string} + */ +export enum ConsensusEventType { + GovernanceProposalExecuted = 'governance.proposal_executed', + GovernanceProposalFinalized = 'governance.proposal_finalized', + GovernanceProposalSubmitted = 'governance.proposal_submitted', + GovernanceVote = 'governance.vote', + RegistryEntity = 'registry.entity', + RegistryNodeUnfrozen = 'registry.node_unfrozen', + RegistryNode = 'registry.node', + RegistryRuntime = 'registry.runtime', + RegistryRuntimeSuspended = 'registry.runtime_suspended', + RoothashExecutionDiscrepancy = 'roothash.execution_discrepancy', + RoothashExecutorCommitted = 'roothash.executor_committed', + RoothashFinalized = 'roothash.finalized', + RoothashMessage = 'roothash.message', + RoothashInMsgProcessed = 'roothash.in_msg_processed', + StakingAllowanceChange = 'staking.allowance_change', + StakingBurn = 'staking.burn', + StakingEscrowAdd = 'staking.escrow.add', + StakingEscrowDebondingStart = 'staking.escrow.debonding_start', + StakingEscrowReclaim = 'staking.escrow.reclaim', + StakingEscrowTake = 'staking.escrow.take', + StakingTransfer = 'staking.transfer' +} + +export function ConsensusEventTypeFromJSON(json: any): ConsensusEventType { + return ConsensusEventTypeFromJSONTyped(json, false); +} + +export function ConsensusEventTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): ConsensusEventType { + return json as ConsensusEventType; +} + +export function ConsensusEventTypeToJSON(value?: ConsensusEventType | null): any { + return value as any; +} + diff --git a/src/vendors/nexus/models/ConsensusTxMethod.ts b/src/vendors/nexus/models/ConsensusTxMethod.ts new file mode 100644 index 0000000000..f4efa18f43 --- /dev/null +++ b/src/vendors/nexus/models/ConsensusTxMethod.ts @@ -0,0 +1,67 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * + * @export + * @enum {string} + */ +export enum ConsensusTxMethod { + BeaconPvssCommit = 'beacon.PVSSCommit', + BeaconPvssReveal = 'beacon.PVSSReveal', + BeaconVrfProve = 'beacon.VRFProve', + ConsensusMeta = 'consensus.Meta', + GovernanceCastVote = 'governance.CastVote', + GovernanceSubmitProposal = 'governance.SubmitProposal', + KeymanagerPublishEphemeralSecret = 'keymanager.PublishEphemeralSecret', + KeymanagerPublishMasterSecret = 'keymanager.PublishMasterSecret', + KeymanagerUpdatePolicy = 'keymanager.UpdatePolicy', + RegistryDeregisterEntity = 'registry.DeregisterEntity', + RegistryProveFreshness = 'registry.ProveFreshness', + RegistryRegisterEntity = 'registry.RegisterEntity', + RegistryRegisterNode = 'registry.RegisterNode', + RegistryRegisterRuntime = 'registry.RegisterRuntime', + RegistryUnfreezeNode = 'registry.UnfreezeNode', + RoothashEvidence = 'roothash.Evidence', + RoothashExecutorCommit = 'roothash.ExecutorCommit', + RoothashExecutorProposerTimeout = 'roothash.ExecutorProposerTimeout', + RoothashSubmitMsg = 'roothash.SubmitMsg', + StakingAddEscrow = 'staking.AddEscrow', + StakingAllow = 'staking.Allow', + StakingAmendCommissionSchedule = 'staking.AmendCommissionSchedule', + StakingBurn = 'staking.Burn', + StakingReclaimEscrow = 'staking.ReclaimEscrow', + StakingTransfer = 'staking.Transfer', + StakingWithdraw = 'staking.Withdraw', + KeymanagerChurpApply = 'keymanager/churp.Apply', + KeymanagerChurpConfirm = 'keymanager/churp.Confirm', + KeymanagerChurpCreate = 'keymanager/churp.Create', + KeymanagerChurpUpdate = 'keymanager/churp.Update', + VaultAuthorizeAction = 'vault.AuthorizeAction', + VaultCancelAction = 'vault.CancelAction', + VaultCreate = 'vault.Create' +} + +export function ConsensusTxMethodFromJSON(json: any): ConsensusTxMethod { + return ConsensusTxMethodFromJSONTyped(json, false); +} + +export function ConsensusTxMethodFromJSONTyped(json: any, ignoreDiscriminator: boolean): ConsensusTxMethod { + return json as ConsensusTxMethod; +} + +export function ConsensusTxMethodToJSON(value?: ConsensusTxMethod | null): any { + return value as any; +} + diff --git a/src/vendors/nexus/models/DebondingDelegation.ts b/src/vendors/nexus/models/DebondingDelegation.ts new file mode 100644 index 0000000000..7db4a2312a --- /dev/null +++ b/src/vendors/nexus/models/DebondingDelegation.ts @@ -0,0 +1,89 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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'; +/** + * A debonding delegation. + * @export + * @interface DebondingDelegation + */ +export interface DebondingDelegation { + /** + * The amount of tokens delegated in base units. + * @type {string} + * @memberof DebondingDelegation + */ + amount: string; + /** + * The shares of tokens delegated. + * @type {string} + * @memberof DebondingDelegation + */ + shares: string; + /** + * The delegatee (validator) address. + * @type {string} + * @memberof DebondingDelegation + */ + validator: string; + /** + * The delegator address. + * @type {string} + * @memberof DebondingDelegation + */ + delegator: string; + /** + * The epoch at which the debonding ends. + * @type {number} + * @memberof DebondingDelegation + */ + debond_end: number; +} + +export function DebondingDelegationFromJSON(json: any): DebondingDelegation { + return DebondingDelegationFromJSONTyped(json, false); +} + +export function DebondingDelegationFromJSONTyped(json: any, ignoreDiscriminator: boolean): DebondingDelegation { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'amount': json['amount'], + 'shares': json['shares'], + 'validator': json['validator'], + 'delegator': json['delegator'], + 'debond_end': json['debond_end'], + }; +} + +export function DebondingDelegationToJSON(value?: DebondingDelegation | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'amount': value.amount, + 'shares': value.shares, + 'validator': value.validator, + 'delegator': value.delegator, + 'debond_end': value.debond_end, + }; +} + + diff --git a/src/vendors/nexus/models/DebondingDelegationList.ts b/src/vendors/nexus/models/DebondingDelegationList.ts new file mode 100644 index 0000000000..322921946f --- /dev/null +++ b/src/vendors/nexus/models/DebondingDelegationList.ts @@ -0,0 +1,89 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 { + DebondingDelegation, + DebondingDelegationFromJSON, + DebondingDelegationFromJSONTyped, + DebondingDelegationToJSON, + DebondingDelegationListAllOf, + DebondingDelegationListAllOfFromJSON, + DebondingDelegationListAllOfFromJSONTyped, + DebondingDelegationListAllOfToJSON, + List, + ListFromJSON, + ListFromJSONTyped, + ListToJSON, +} from './'; + +/** + * + * @export + * @interface DebondingDelegationList + */ +export interface DebondingDelegationList { + /** + * The total number of records that match the query, i.e. the number of records + * the query would return with limit=infinity. + * @type {number} + * @memberof DebondingDelegationList + */ + total_count: number; + /** + * Whether total_count is clipped for performance reasons. + * @type {boolean} + * @memberof DebondingDelegationList + */ + is_total_count_clipped: boolean; + /** + * + * @type {Array} + * @memberof DebondingDelegationList + */ + debonding_delegations: Array; +} + +export function DebondingDelegationListFromJSON(json: any): DebondingDelegationList { + return DebondingDelegationListFromJSONTyped(json, false); +} + +export function DebondingDelegationListFromJSONTyped(json: any, ignoreDiscriminator: boolean): DebondingDelegationList { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'total_count': json['total_count'], + 'is_total_count_clipped': json['is_total_count_clipped'], + 'debonding_delegations': ((json['debonding_delegations'] as Array).map(DebondingDelegationFromJSON)), + }; +} + +export function DebondingDelegationListToJSON(value?: DebondingDelegationList | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'total_count': value.total_count, + 'is_total_count_clipped': value.is_total_count_clipped, + 'debonding_delegations': ((value.debonding_delegations as Array).map(DebondingDelegationToJSON)), + }; +} + + diff --git a/src/vendors/nexus/models/DebondingDelegationListAllOf.ts b/src/vendors/nexus/models/DebondingDelegationListAllOf.ts new file mode 100644 index 0000000000..e639245477 --- /dev/null +++ b/src/vendors/nexus/models/DebondingDelegationListAllOf.ts @@ -0,0 +1,64 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 { + DebondingDelegation, + DebondingDelegationFromJSON, + DebondingDelegationFromJSONTyped, + DebondingDelegationToJSON, +} from './'; + +/** + * A list of debonding delegations. + * @export + * @interface DebondingDelegationListAllOf + */ +export interface DebondingDelegationListAllOf { + /** + * + * @type {Array} + * @memberof DebondingDelegationListAllOf + */ + debonding_delegations: Array; +} + +export function DebondingDelegationListAllOfFromJSON(json: any): DebondingDelegationListAllOf { + return DebondingDelegationListAllOfFromJSONTyped(json, false); +} + +export function DebondingDelegationListAllOfFromJSONTyped(json: any, ignoreDiscriminator: boolean): DebondingDelegationListAllOf { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'debonding_delegations': ((json['debonding_delegations'] as Array).map(DebondingDelegationFromJSON)), + }; +} + +export function DebondingDelegationListAllOfToJSON(value?: DebondingDelegationListAllOf | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'debonding_delegations': ((value.debonding_delegations as Array).map(DebondingDelegationToJSON)), + }; +} + + diff --git a/src/vendors/nexus/models/Delegation.ts b/src/vendors/nexus/models/Delegation.ts new file mode 100644 index 0000000000..ebeef29277 --- /dev/null +++ b/src/vendors/nexus/models/Delegation.ts @@ -0,0 +1,81 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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'; +/** + * A delegation. + * @export + * @interface Delegation + */ +export interface Delegation { + /** + * The amount of tokens delegated in base units. + * @type {string} + * @memberof Delegation + */ + amount: string; + /** + * The shares of tokens delegated. + * @type {string} + * @memberof Delegation + */ + shares: string; + /** + * The delegatee (validator) address. + * @type {string} + * @memberof Delegation + */ + validator: string; + /** + * The delegator address. + * @type {string} + * @memberof Delegation + */ + delegator: string; +} + +export function DelegationFromJSON(json: any): Delegation { + return DelegationFromJSONTyped(json, false); +} + +export function DelegationFromJSONTyped(json: any, ignoreDiscriminator: boolean): Delegation { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'amount': json['amount'], + 'shares': json['shares'], + 'validator': json['validator'], + 'delegator': json['delegator'], + }; +} + +export function DelegationToJSON(value?: Delegation | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'amount': value.amount, + 'shares': value.shares, + 'validator': value.validator, + 'delegator': value.delegator, + }; +} + + diff --git a/src/vendors/nexus/models/DelegationList.ts b/src/vendors/nexus/models/DelegationList.ts new file mode 100644 index 0000000000..18a49c9264 --- /dev/null +++ b/src/vendors/nexus/models/DelegationList.ts @@ -0,0 +1,89 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 { + Delegation, + DelegationFromJSON, + DelegationFromJSONTyped, + DelegationToJSON, + DelegationListAllOf, + DelegationListAllOfFromJSON, + DelegationListAllOfFromJSONTyped, + DelegationListAllOfToJSON, + List, + ListFromJSON, + ListFromJSONTyped, + ListToJSON, +} from './'; + +/** + * + * @export + * @interface DelegationList + */ +export interface DelegationList { + /** + * The total number of records that match the query, i.e. the number of records + * the query would return with limit=infinity. + * @type {number} + * @memberof DelegationList + */ + total_count: number; + /** + * Whether total_count is clipped for performance reasons. + * @type {boolean} + * @memberof DelegationList + */ + is_total_count_clipped: boolean; + /** + * + * @type {Array} + * @memberof DelegationList + */ + delegations: Array; +} + +export function DelegationListFromJSON(json: any): DelegationList { + return DelegationListFromJSONTyped(json, false); +} + +export function DelegationListFromJSONTyped(json: any, ignoreDiscriminator: boolean): DelegationList { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'total_count': json['total_count'], + 'is_total_count_clipped': json['is_total_count_clipped'], + 'delegations': ((json['delegations'] as Array).map(DelegationFromJSON)), + }; +} + +export function DelegationListToJSON(value?: DelegationList | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'total_count': value.total_count, + 'is_total_count_clipped': value.is_total_count_clipped, + 'delegations': ((value.delegations as Array).map(DelegationToJSON)), + }; +} + + diff --git a/src/vendors/nexus/models/DelegationListAllOf.ts b/src/vendors/nexus/models/DelegationListAllOf.ts new file mode 100644 index 0000000000..52440c9627 --- /dev/null +++ b/src/vendors/nexus/models/DelegationListAllOf.ts @@ -0,0 +1,64 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 { + Delegation, + DelegationFromJSON, + DelegationFromJSONTyped, + DelegationToJSON, +} from './'; + +/** + * A list of delegations. + * @export + * @interface DelegationListAllOf + */ +export interface DelegationListAllOf { + /** + * + * @type {Array} + * @memberof DelegationListAllOf + */ + delegations: Array; +} + +export function DelegationListAllOfFromJSON(json: any): DelegationListAllOf { + return DelegationListAllOfFromJSONTyped(json, false); +} + +export function DelegationListAllOfFromJSONTyped(json: any, ignoreDiscriminator: boolean): DelegationListAllOf { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'delegations': ((json['delegations'] as Array).map(DelegationFromJSON)), + }; +} + +export function DelegationListAllOfToJSON(value?: DelegationListAllOf | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'delegations': ((value.delegations as Array).map(DelegationToJSON)), + }; +} + + diff --git a/src/vendors/nexus/models/Entity.ts b/src/vendors/nexus/models/Entity.ts new file mode 100644 index 0000000000..02a283c994 --- /dev/null +++ b/src/vendors/nexus/models/Entity.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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'; +/** + * An entity registered at the consensus layer. + * @export + * @interface Entity + */ +export interface Entity { + /** + * The public key identifying this entity. + * @type {string} + * @memberof Entity + */ + id: string; + /** + * The staking address belonging to this entity; derived from the entity's public key. + * @type {string} + * @memberof Entity + */ + address: string; + /** + * The vector of nodes owned by this entity. + * @type {Array} + * @memberof Entity + */ + nodes: Array; +} + +export function EntityFromJSON(json: any): Entity { + return EntityFromJSONTyped(json, false); +} + +export function EntityFromJSONTyped(json: any, ignoreDiscriminator: boolean): Entity { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'id': json['id'], + 'address': json['address'], + 'nodes': json['nodes'], + }; +} + +export function EntityToJSON(value?: Entity | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'id': value.id, + 'address': value.address, + 'nodes': value.nodes, + }; +} + + diff --git a/src/vendors/nexus/models/EntityList.ts b/src/vendors/nexus/models/EntityList.ts new file mode 100644 index 0000000000..c4fb7de4ce --- /dev/null +++ b/src/vendors/nexus/models/EntityList.ts @@ -0,0 +1,89 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 { + Entity, + EntityFromJSON, + EntityFromJSONTyped, + EntityToJSON, + EntityListAllOf, + EntityListAllOfFromJSON, + EntityListAllOfFromJSONTyped, + EntityListAllOfToJSON, + List, + ListFromJSON, + ListFromJSONTyped, + ListToJSON, +} from './'; + +/** + * + * @export + * @interface EntityList + */ +export interface EntityList { + /** + * The total number of records that match the query, i.e. the number of records + * the query would return with limit=infinity. + * @type {number} + * @memberof EntityList + */ + total_count: number; + /** + * Whether total_count is clipped for performance reasons. + * @type {boolean} + * @memberof EntityList + */ + is_total_count_clipped: boolean; + /** + * + * @type {Array} + * @memberof EntityList + */ + entities: Array; +} + +export function EntityListFromJSON(json: any): EntityList { + return EntityListFromJSONTyped(json, false); +} + +export function EntityListFromJSONTyped(json: any, ignoreDiscriminator: boolean): EntityList { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'total_count': json['total_count'], + 'is_total_count_clipped': json['is_total_count_clipped'], + 'entities': ((json['entities'] as Array).map(EntityFromJSON)), + }; +} + +export function EntityListToJSON(value?: EntityList | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'total_count': value.total_count, + 'is_total_count_clipped': value.is_total_count_clipped, + 'entities': ((value.entities as Array).map(EntityToJSON)), + }; +} + + diff --git a/src/vendors/nexus/models/EntityListAllOf.ts b/src/vendors/nexus/models/EntityListAllOf.ts new file mode 100644 index 0000000000..55e23300f8 --- /dev/null +++ b/src/vendors/nexus/models/EntityListAllOf.ts @@ -0,0 +1,64 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 { + Entity, + EntityFromJSON, + EntityFromJSONTyped, + EntityToJSON, +} from './'; + +/** + * A list of entities registered at the consensus layer. + * @export + * @interface EntityListAllOf + */ +export interface EntityListAllOf { + /** + * + * @type {Array} + * @memberof EntityListAllOf + */ + entities: Array; +} + +export function EntityListAllOfFromJSON(json: any): EntityListAllOf { + return EntityListAllOfFromJSONTyped(json, false); +} + +export function EntityListAllOfFromJSONTyped(json: any, ignoreDiscriminator: boolean): EntityListAllOf { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'entities': ((json['entities'] as Array).map(EntityFromJSON)), + }; +} + +export function EntityListAllOfToJSON(value?: EntityListAllOf | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'entities': ((value.entities as Array).map(EntityToJSON)), + }; +} + + diff --git a/src/vendors/nexus/models/Epoch.ts b/src/vendors/nexus/models/Epoch.ts new file mode 100644 index 0000000000..8de6da612c --- /dev/null +++ b/src/vendors/nexus/models/Epoch.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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'; +/** + * A consensus epoch. + * @export + * @interface Epoch + */ +export interface Epoch { + /** + * The epoch number. + * @type {number} + * @memberof Epoch + */ + id: number; + /** + * The (inclusive) height at which this epoch started. + * @type {number} + * @memberof Epoch + */ + start_height: number; + /** + * The (inclusive) height at which this epoch ended. Omitted if the epoch is still active. + * @type {number} + * @memberof Epoch + */ + end_height?: number; +} + +export function EpochFromJSON(json: any): Epoch { + return EpochFromJSONTyped(json, false); +} + +export function EpochFromJSONTyped(json: any, ignoreDiscriminator: boolean): Epoch { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'id': json['id'], + 'start_height': json['start_height'], + 'end_height': !exists(json, 'end_height') ? undefined : json['end_height'], + }; +} + +export function EpochToJSON(value?: Epoch | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'id': value.id, + 'start_height': value.start_height, + 'end_height': value.end_height, + }; +} + + diff --git a/src/vendors/nexus/models/EpochList.ts b/src/vendors/nexus/models/EpochList.ts new file mode 100644 index 0000000000..b4de01d371 --- /dev/null +++ b/src/vendors/nexus/models/EpochList.ts @@ -0,0 +1,89 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 { + Epoch, + EpochFromJSON, + EpochFromJSONTyped, + EpochToJSON, + EpochListAllOf, + EpochListAllOfFromJSON, + EpochListAllOfFromJSONTyped, + EpochListAllOfToJSON, + List, + ListFromJSON, + ListFromJSONTyped, + ListToJSON, +} from './'; + +/** + * + * @export + * @interface EpochList + */ +export interface EpochList { + /** + * The total number of records that match the query, i.e. the number of records + * the query would return with limit=infinity. + * @type {number} + * @memberof EpochList + */ + total_count: number; + /** + * Whether total_count is clipped for performance reasons. + * @type {boolean} + * @memberof EpochList + */ + is_total_count_clipped: boolean; + /** + * + * @type {Array} + * @memberof EpochList + */ + epochs: Array; +} + +export function EpochListFromJSON(json: any): EpochList { + return EpochListFromJSONTyped(json, false); +} + +export function EpochListFromJSONTyped(json: any, ignoreDiscriminator: boolean): EpochList { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'total_count': json['total_count'], + 'is_total_count_clipped': json['is_total_count_clipped'], + 'epochs': ((json['epochs'] as Array).map(EpochFromJSON)), + }; +} + +export function EpochListToJSON(value?: EpochList | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'total_count': value.total_count, + 'is_total_count_clipped': value.is_total_count_clipped, + 'epochs': ((value.epochs as Array).map(EpochToJSON)), + }; +} + + diff --git a/src/vendors/nexus/models/EpochListAllOf.ts b/src/vendors/nexus/models/EpochListAllOf.ts new file mode 100644 index 0000000000..eb04e9008b --- /dev/null +++ b/src/vendors/nexus/models/EpochListAllOf.ts @@ -0,0 +1,64 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 { + Epoch, + EpochFromJSON, + EpochFromJSONTyped, + EpochToJSON, +} from './'; + +/** + * A list of consensus epochs. + * @export + * @interface EpochListAllOf + */ +export interface EpochListAllOf { + /** + * + * @type {Array} + * @memberof EpochListAllOf + */ + epochs: Array; +} + +export function EpochListAllOfFromJSON(json: any): EpochListAllOf { + return EpochListAllOfFromJSONTyped(json, false); +} + +export function EpochListAllOfFromJSONTyped(json: any, ignoreDiscriminator: boolean): EpochListAllOf { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'epochs': ((json['epochs'] as Array).map(EpochFromJSON)), + }; +} + +export function EpochListAllOfToJSON(value?: EpochListAllOf | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'epochs': ((value.epochs as Array).map(EpochToJSON)), + }; +} + + diff --git a/src/vendors/nexus/models/Escrow.ts b/src/vendors/nexus/models/Escrow.ts new file mode 100644 index 0000000000..c60d139e4f --- /dev/null +++ b/src/vendors/nexus/models/Escrow.ts @@ -0,0 +1,113 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 Escrow + */ +export interface Escrow { + /** + * The amount of tokens that are delegated to this validator account, and are NOT in the process of debonding. + * @type {string} + * @memberof Escrow + */ + active_balance?: string; + /** + * The shares of tokens that are delegated to this validator account, and are NOT in the process of debonding. + * @type {string} + * @memberof Escrow + */ + active_shares?: string; + /** + * The amount of tokens that are delegated to this validator account, but are also in the process of debonding (i.e. they will be unstaked within ~2 weeks). + * @type {string} + * @memberof Escrow + */ + debonding_balance?: string; + /** + * The shares of tokens that are delegated to this validator account, but are also in the process of debonding (i.e. they will be unstaked within ~2 weeks). + * @type {string} + * @memberof Escrow + */ + debonding_shares?: string; + /** + * The amount of token this validator has delegated to itself, and are NOT in the process of debonding. + * @type {string} + * @memberof Escrow + */ + self_delegation_balance?: string; + /** + * The shares of tokens this validator has delegated to itself, and are NOT in the process of debonding. + * @type {string} + * @memberof Escrow + */ + self_delegation_shares?: string; + /** + * The active_balance of this validator account 24 hours ago. + * @type {string} + * @memberof Escrow + */ + active_balance_24?: string; + /** + * The number of accounts that have delegated token to this account. + * @type {number} + * @memberof Escrow + */ + num_delegators?: number; +} + +export function EscrowFromJSON(json: any): Escrow { + return EscrowFromJSONTyped(json, false); +} + +export function EscrowFromJSONTyped(json: any, ignoreDiscriminator: boolean): Escrow { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'active_balance': !exists(json, 'active_balance') ? undefined : json['active_balance'], + 'active_shares': !exists(json, 'active_shares') ? undefined : json['active_shares'], + 'debonding_balance': !exists(json, 'debonding_balance') ? undefined : json['debonding_balance'], + 'debonding_shares': !exists(json, 'debonding_shares') ? undefined : json['debonding_shares'], + 'self_delegation_balance': !exists(json, 'self_delegation_balance') ? undefined : json['self_delegation_balance'], + 'self_delegation_shares': !exists(json, 'self_delegation_shares') ? undefined : json['self_delegation_shares'], + 'active_balance_24': !exists(json, 'active_balance_24') ? undefined : json['active_balance_24'], + 'num_delegators': !exists(json, 'num_delegators') ? undefined : json['num_delegators'], + }; +} + +export function EscrowToJSON(value?: Escrow | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'active_balance': value.active_balance, + 'active_shares': value.active_shares, + 'debonding_balance': value.debonding_balance, + 'debonding_shares': value.debonding_shares, + 'self_delegation_balance': value.self_delegation_balance, + 'self_delegation_shares': value.self_delegation_shares, + 'active_balance_24': value.active_balance_24, + 'num_delegators': value.num_delegators, + }; +} + + diff --git a/src/vendors/nexus/models/EvmAbiParam.ts b/src/vendors/nexus/models/EvmAbiParam.ts new file mode 100644 index 0000000000..4dafa034fa --- /dev/null +++ b/src/vendors/nexus/models/EvmAbiParam.ts @@ -0,0 +1,77 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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'; +/** + * A decoded parameter of an event or error emitted from an EVM runtime. + * Values of EVM type `int128`, `uint128`, `int256`, `uint256`, `fixed`, and `ufixed` are represented as strings. + * Values of EVM type `address` and `address payable` are represented as lowercase hex strings with a "0x" prefix. + * Values of EVM type `bytes` and `bytes` are represented as base64 strings. + * Values of other EVM types (integer types, strings, arrays, etc.) are represented as their JSON counterpart. + * @export + * @interface EvmAbiParam + */ +export interface EvmAbiParam { + /** + * The parameter name. + * @type {string} + * @memberof EvmAbiParam + */ + name: string; + /** + * The solidity type of the parameter. + * @type {string} + * @memberof EvmAbiParam + */ + evm_type: string; + /** + * The parameter value. + * @type {any} + * @memberof EvmAbiParam + */ + value: any | null; +} + +export function EvmAbiParamFromJSON(json: any): EvmAbiParam { + return EvmAbiParamFromJSONTyped(json, false); +} + +export function EvmAbiParamFromJSONTyped(json: any, ignoreDiscriminator: boolean): EvmAbiParam { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'name': json['name'], + 'evm_type': json['evm_type'], + 'value': json['value'], + }; +} + +export function EvmAbiParamToJSON(value?: EvmAbiParam | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'name': value.name, + 'evm_type': value.evm_type, + 'value': value.value, + }; +} + + diff --git a/src/vendors/nexus/models/EvmEventToken.ts b/src/vendors/nexus/models/EvmEventToken.ts new file mode 100644 index 0000000000..2cd0094c9f --- /dev/null +++ b/src/vendors/nexus/models/EvmEventToken.ts @@ -0,0 +1,82 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 { + EvmTokenType, + EvmTokenTypeFromJSON, + EvmTokenTypeFromJSONTyped, + EvmTokenTypeToJSON, +} from './'; + +/** + * Details about the EVM token involved in the event, if any. + * @export + * @interface EvmEventToken + */ +export interface EvmEventToken { + /** + * + * @type {EvmTokenType} + * @memberof EvmEventToken + */ + type?: EvmTokenType; + /** + * Symbol of the token, as provided by token contract's `symbol()` method. + * @type {string} + * @memberof EvmEventToken + */ + symbol?: string; + /** + * The number of least significant digits in base units that should be displayed as + * decimals when displaying tokens. `tokens = base_units / (10**decimals)`. + * Affects display only. Often equals 18, to match ETH. + * @type {number} + * @memberof EvmEventToken + */ + decimals?: number; +} + +export function EvmEventTokenFromJSON(json: any): EvmEventToken { + return EvmEventTokenFromJSONTyped(json, false); +} + +export function EvmEventTokenFromJSONTyped(json: any, ignoreDiscriminator: boolean): EvmEventToken { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'type': !exists(json, 'type') ? undefined : EvmTokenTypeFromJSON(json['type']), + 'symbol': !exists(json, 'symbol') ? undefined : json['symbol'], + 'decimals': !exists(json, 'decimals') ? undefined : json['decimals'], + }; +} + +export function EvmEventTokenToJSON(value?: EvmEventToken | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'type': EvmTokenTypeToJSON(value.type), + 'symbol': value.symbol, + 'decimals': value.decimals, + }; +} + + diff --git a/src/vendors/nexus/models/EvmNft.ts b/src/vendors/nexus/models/EvmNft.ts new file mode 100644 index 0000000000..471a2419f6 --- /dev/null +++ b/src/vendors/nexus/models/EvmNft.ts @@ -0,0 +1,147 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 { + EvmToken, + EvmTokenFromJSON, + EvmTokenFromJSONTyped, + EvmTokenToJSON, +} from './'; + +/** + * + * @export + * @interface EvmNft + */ +export interface EvmNft { + /** + * + * @type {EvmToken} + * @memberof EvmNft + */ + token: EvmToken; + /** + * The instance ID of this NFT within the collection represented by `token`. + * @type {string} + * @memberof EvmNft + */ + id: string; + /** + * The Oasis address of this NFT instance's owner. + * @type {string} + * @memberof EvmNft + */ + owner?: string; + /** + * The Ethereum address of this NFT instance's owner. + * @type {string} + * @memberof EvmNft + */ + owner_eth?: string; + /** + * The total number of transfers of this NFT instance. + * @type {number} + * @memberof EvmNft + */ + num_transfers?: number; + /** + * + * @type {string} + * @memberof EvmNft + */ + metadata_uri?: string; + /** + * + * @type {string} + * @memberof EvmNft + */ + metadata_accessed?: string; + /** + * A metadata document for this NFT instance. + * Currently only ERC-721 is supported, where the document is an Asset Metadata from the ERC721 Metadata JSON Schema. + * @type {any} + * @memberof EvmNft + */ + metadata?: any | null; + /** + * Identifies the asset which this NFT represents + * @type {string} + * @memberof EvmNft + */ + name?: string; + /** + * Describes the asset which this NFT represents + * @type {string} + * @memberof EvmNft + */ + description?: string; + /** + * A URI pointing to a resource with mime type image/* representing + * the asset which this NFT represents. (Additional + * non-descriptive text from ERC-721 omitted.) + * @type {string} + * @memberof EvmNft + */ + image?: string; +} + +export function EvmNftFromJSON(json: any): EvmNft { + return EvmNftFromJSONTyped(json, false); +} + +export function EvmNftFromJSONTyped(json: any, ignoreDiscriminator: boolean): EvmNft { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'token': EvmTokenFromJSON(json['token']), + 'id': json['id'], + 'owner': !exists(json, 'owner') ? undefined : json['owner'], + 'owner_eth': !exists(json, 'owner_eth') ? undefined : json['owner_eth'], + 'num_transfers': !exists(json, 'num_transfers') ? undefined : json['num_transfers'], + 'metadata_uri': !exists(json, 'metadata_uri') ? undefined : json['metadata_uri'], + 'metadata_accessed': !exists(json, 'metadata_accessed') ? undefined : json['metadata_accessed'], + 'metadata': !exists(json, 'metadata') ? undefined : json['metadata'], + 'name': !exists(json, 'name') ? undefined : json['name'], + 'description': !exists(json, 'description') ? undefined : json['description'], + 'image': !exists(json, 'image') ? undefined : json['image'], + }; +} + +export function EvmNftToJSON(value?: EvmNft | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'token': EvmTokenToJSON(value.token), + 'id': value.id, + 'owner': value.owner, + 'owner_eth': value.owner_eth, + 'num_transfers': value.num_transfers, + 'metadata_uri': value.metadata_uri, + 'metadata_accessed': value.metadata_accessed, + 'metadata': value.metadata, + 'name': value.name, + 'description': value.description, + 'image': value.image, + }; +} + + diff --git a/src/vendors/nexus/models/EvmNftList.ts b/src/vendors/nexus/models/EvmNftList.ts new file mode 100644 index 0000000000..9ad1406434 --- /dev/null +++ b/src/vendors/nexus/models/EvmNftList.ts @@ -0,0 +1,89 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 { + EvmNft, + EvmNftFromJSON, + EvmNftFromJSONTyped, + EvmNftToJSON, + EvmNftListAllOf, + EvmNftListAllOfFromJSON, + EvmNftListAllOfFromJSONTyped, + EvmNftListAllOfToJSON, + List, + ListFromJSON, + ListFromJSONTyped, + ListToJSON, +} from './'; + +/** + * + * @export + * @interface EvmNftList + */ +export interface EvmNftList { + /** + * The total number of records that match the query, i.e. the number of records + * the query would return with limit=infinity. + * @type {number} + * @memberof EvmNftList + */ + total_count: number; + /** + * Whether total_count is clipped for performance reasons. + * @type {boolean} + * @memberof EvmNftList + */ + is_total_count_clipped: boolean; + /** + * A list of L2 EVM NFT (ERC-721, ...) instances. + * @type {Array} + * @memberof EvmNftList + */ + evm_nfts: Array; +} + +export function EvmNftListFromJSON(json: any): EvmNftList { + return EvmNftListFromJSONTyped(json, false); +} + +export function EvmNftListFromJSONTyped(json: any, ignoreDiscriminator: boolean): EvmNftList { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'total_count': json['total_count'], + 'is_total_count_clipped': json['is_total_count_clipped'], + 'evm_nfts': ((json['evm_nfts'] as Array).map(EvmNftFromJSON)), + }; +} + +export function EvmNftListToJSON(value?: EvmNftList | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'total_count': value.total_count, + 'is_total_count_clipped': value.is_total_count_clipped, + 'evm_nfts': ((value.evm_nfts as Array).map(EvmNftToJSON)), + }; +} + + diff --git a/src/vendors/nexus/models/EvmNftListAllOf.ts b/src/vendors/nexus/models/EvmNftListAllOf.ts new file mode 100644 index 0000000000..6ef40a51c5 --- /dev/null +++ b/src/vendors/nexus/models/EvmNftListAllOf.ts @@ -0,0 +1,64 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 { + EvmNft, + EvmNftFromJSON, + EvmNftFromJSONTyped, + EvmNftToJSON, +} from './'; + +/** + * A list of NFT instances. + * @export + * @interface EvmNftListAllOf + */ +export interface EvmNftListAllOf { + /** + * A list of L2 EVM NFT (ERC-721, ...) instances. + * @type {Array} + * @memberof EvmNftListAllOf + */ + evm_nfts: Array; +} + +export function EvmNftListAllOfFromJSON(json: any): EvmNftListAllOf { + return EvmNftListAllOfFromJSONTyped(json, false); +} + +export function EvmNftListAllOfFromJSONTyped(json: any, ignoreDiscriminator: boolean): EvmNftListAllOf { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'evm_nfts': ((json['evm_nfts'] as Array).map(EvmNftFromJSON)), + }; +} + +export function EvmNftListAllOfToJSON(value?: EvmNftListAllOf | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'evm_nfts': ((value.evm_nfts as Array).map(EvmNftToJSON)), + }; +} + + diff --git a/src/vendors/nexus/models/EvmToken.ts b/src/vendors/nexus/models/EvmToken.ts new file mode 100644 index 0000000000..de87571cb0 --- /dev/null +++ b/src/vendors/nexus/models/EvmToken.ts @@ -0,0 +1,156 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 { + EvmTokenType, + EvmTokenTypeFromJSON, + EvmTokenTypeFromJSONTyped, + EvmTokenTypeToJSON, + VerificationLevel, + VerificationLevelFromJSON, + VerificationLevelFromJSONTyped, + VerificationLevelToJSON, +} from './'; + +/** + * + * @export + * @interface EvmToken + */ +export interface EvmToken { + /** + * The Oasis address of this token's contract. + * @type {string} + * @memberof EvmToken + */ + contract_addr: string; + /** + * The Ethereum address of this token's contract. + * @type {string} + * @memberof EvmToken + */ + eth_contract_addr: string; + /** + * Name of the token, as provided by token contract's `name()` method. + * @type {string} + * @memberof EvmToken + */ + name?: string; + /** + * Symbol of the token, as provided by token contract's `symbol()` method. + * @type {string} + * @memberof EvmToken + */ + symbol?: string; + /** + * The number of least significant digits in base units that should be displayed as + * decimals when displaying tokens. `tokens = base_units / (10**decimals)`. + * Affects display only. Often equals 18, to match ETH. + * @type {number} + * @memberof EvmToken + */ + decimals?: number; + /** + * The heuristically determined interface that the token contract implements. + * A less specialized variant of the token might be detected; for example, an + * ERC-1363 token might be labeled as ERC-20 here. If the type cannot be + * detected or is not supported, this field will be null/absent. + * @type {EvmTokenType} + * @memberof EvmToken + */ + type: EvmTokenType; + /** + * The total number of base units available. + * @type {string} + * @memberof EvmToken + */ + total_supply?: string; + /** + * The total number of transfers of this token. + * @type {number} + * @memberof EvmToken + */ + num_transfers?: number; + /** + * The number of addresses that have a nonzero balance of this token. + * @type {number} + * @memberof EvmToken + */ + num_holders: number; + /** + * Whether the contract has been successfully verified by Sourcify. + * Additional information on verified contracts is available via + * the `/{runtime}/accounts/{address}` endpoint. + * DEPRECATED: This field will be removed in the future in favor of verification_level + * @type {boolean} + * @memberof EvmToken + */ + is_verified: boolean; + /** + * + * @type {VerificationLevel} + * @memberof EvmToken + */ + verification_level?: VerificationLevel; +} + +export function EvmTokenFromJSON(json: any): EvmToken { + return EvmTokenFromJSONTyped(json, false); +} + +export function EvmTokenFromJSONTyped(json: any, ignoreDiscriminator: boolean): EvmToken { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'contract_addr': json['contract_addr'], + 'eth_contract_addr': json['eth_contract_addr'], + 'name': !exists(json, 'name') ? undefined : json['name'], + 'symbol': !exists(json, 'symbol') ? undefined : json['symbol'], + 'decimals': !exists(json, 'decimals') ? undefined : json['decimals'], + 'type': EvmTokenTypeFromJSON(json['type']), + 'total_supply': !exists(json, 'total_supply') ? undefined : json['total_supply'], + 'num_transfers': !exists(json, 'num_transfers') ? undefined : json['num_transfers'], + 'num_holders': json['num_holders'], + 'is_verified': json['is_verified'], + 'verification_level': !exists(json, 'verification_level') ? undefined : VerificationLevelFromJSON(json['verification_level']), + }; +} + +export function EvmTokenToJSON(value?: EvmToken | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'contract_addr': value.contract_addr, + 'eth_contract_addr': value.eth_contract_addr, + 'name': value.name, + 'symbol': value.symbol, + 'decimals': value.decimals, + 'type': EvmTokenTypeToJSON(value.type), + 'total_supply': value.total_supply, + 'num_transfers': value.num_transfers, + 'num_holders': value.num_holders, + 'is_verified': value.is_verified, + 'verification_level': VerificationLevelToJSON(value.verification_level), + }; +} + + diff --git a/src/vendors/nexus/models/EvmTokenList.ts b/src/vendors/nexus/models/EvmTokenList.ts new file mode 100644 index 0000000000..ecf18d026c --- /dev/null +++ b/src/vendors/nexus/models/EvmTokenList.ts @@ -0,0 +1,89 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 { + EvmToken, + EvmTokenFromJSON, + EvmTokenFromJSONTyped, + EvmTokenToJSON, + EvmTokenListAllOf, + EvmTokenListAllOfFromJSON, + EvmTokenListAllOfFromJSONTyped, + EvmTokenListAllOfToJSON, + List, + ListFromJSON, + ListFromJSONTyped, + ListToJSON, +} from './'; + +/** + * + * @export + * @interface EvmTokenList + */ +export interface EvmTokenList { + /** + * The total number of records that match the query, i.e. the number of records + * the query would return with limit=infinity. + * @type {number} + * @memberof EvmTokenList + */ + total_count: number; + /** + * Whether total_count is clipped for performance reasons. + * @type {boolean} + * @memberof EvmTokenList + */ + is_total_count_clipped: boolean; + /** + * A list of L2 EVM tokens (ERC-20, ERC-721, ...). + * @type {Array} + * @memberof EvmTokenList + */ + evm_tokens: Array; +} + +export function EvmTokenListFromJSON(json: any): EvmTokenList { + return EvmTokenListFromJSONTyped(json, false); +} + +export function EvmTokenListFromJSONTyped(json: any, ignoreDiscriminator: boolean): EvmTokenList { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'total_count': json['total_count'], + 'is_total_count_clipped': json['is_total_count_clipped'], + 'evm_tokens': ((json['evm_tokens'] as Array).map(EvmTokenFromJSON)), + }; +} + +export function EvmTokenListToJSON(value?: EvmTokenList | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'total_count': value.total_count, + 'is_total_count_clipped': value.is_total_count_clipped, + 'evm_tokens': ((value.evm_tokens as Array).map(EvmTokenToJSON)), + }; +} + + diff --git a/src/vendors/nexus/models/EvmTokenListAllOf.ts b/src/vendors/nexus/models/EvmTokenListAllOf.ts new file mode 100644 index 0000000000..78d64187bc --- /dev/null +++ b/src/vendors/nexus/models/EvmTokenListAllOf.ts @@ -0,0 +1,64 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 { + EvmToken, + EvmTokenFromJSON, + EvmTokenFromJSONTyped, + EvmTokenToJSON, +} from './'; + +/** + * A list of tokens in a runtime. + * @export + * @interface EvmTokenListAllOf + */ +export interface EvmTokenListAllOf { + /** + * A list of L2 EVM tokens (ERC-20, ERC-721, ...). + * @type {Array} + * @memberof EvmTokenListAllOf + */ + evm_tokens: Array; +} + +export function EvmTokenListAllOfFromJSON(json: any): EvmTokenListAllOf { + return EvmTokenListAllOfFromJSONTyped(json, false); +} + +export function EvmTokenListAllOfFromJSONTyped(json: any, ignoreDiscriminator: boolean): EvmTokenListAllOf { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'evm_tokens': ((json['evm_tokens'] as Array).map(EvmTokenFromJSON)), + }; +} + +export function EvmTokenListAllOfToJSON(value?: EvmTokenListAllOf | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'evm_tokens': ((value.evm_tokens as Array).map(EvmTokenToJSON)), + }; +} + + diff --git a/src/vendors/nexus/models/EvmTokenType.ts b/src/vendors/nexus/models/EvmTokenType.ts new file mode 100644 index 0000000000..5e25f44f47 --- /dev/null +++ b/src/vendors/nexus/models/EvmTokenType.ts @@ -0,0 +1,36 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * The type of a EVM token. + * @export + * @enum {string} + */ +export enum EvmTokenType { + Erc20 = 'ERC20', + Erc721 = 'ERC721' +} + +export function EvmTokenTypeFromJSON(json: any): EvmTokenType { + return EvmTokenTypeFromJSONTyped(json, false); +} + +export function EvmTokenTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): EvmTokenType { + return json as EvmTokenType; +} + +export function EvmTokenTypeToJSON(value?: EvmTokenType | null): any { + return value as any; +} + diff --git a/src/vendors/nexus/models/InlineResponse400.ts b/src/vendors/nexus/models/InlineResponse400.ts new file mode 100644 index 0000000000..52f078c7a3 --- /dev/null +++ b/src/vendors/nexus/models/InlineResponse400.ts @@ -0,0 +1,57 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 InlineResponse400 + */ +export interface InlineResponse400 { + /** + * An error message. + * @type {string} + * @memberof InlineResponse400 + */ + msg: string; +} + +export function InlineResponse400FromJSON(json: any): InlineResponse400 { + return InlineResponse400FromJSONTyped(json, false); +} + +export function InlineResponse400FromJSONTyped(json: any, ignoreDiscriminator: boolean): InlineResponse400 { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'msg': json['msg'], + }; +} + +export function InlineResponse400ToJSON(value?: InlineResponse400 | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'msg': value.msg, + }; +} + + diff --git a/src/vendors/nexus/models/Layer.ts b/src/vendors/nexus/models/Layer.ts new file mode 100644 index 0000000000..80bde82fc8 --- /dev/null +++ b/src/vendors/nexus/models/Layer.ts @@ -0,0 +1,40 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * + * @export + * @enum {string} + */ +export enum Layer { + Emerald = 'emerald', + Sapphire = 'sapphire', + Pontusxtest = 'pontusxtest', + Pontusxdev = 'pontusxdev', + Cipher = 'cipher', + Consensus = 'consensus' +} + +export function LayerFromJSON(json: any): Layer { + return LayerFromJSONTyped(json, false); +} + +export function LayerFromJSONTyped(json: any, ignoreDiscriminator: boolean): Layer { + return json as Layer; +} + +export function LayerToJSON(value?: Layer | null): any { + return value as any; +} + diff --git a/src/vendors/nexus/models/List.ts b/src/vendors/nexus/models/List.ts new file mode 100644 index 0000000000..06aadf1156 --- /dev/null +++ b/src/vendors/nexus/models/List.ts @@ -0,0 +1,66 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 List + */ +export interface List { + /** + * The total number of records that match the query, i.e. the number of records + * the query would return with limit=infinity. + * @type {number} + * @memberof List + */ + total_count: number; + /** + * Whether total_count is clipped for performance reasons. + * @type {boolean} + * @memberof List + */ + is_total_count_clipped: boolean; +} + +export function ListFromJSON(json: any): List { + return ListFromJSONTyped(json, false); +} + +export function ListFromJSONTyped(json: any, ignoreDiscriminator: boolean): List { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'total_count': json['total_count'], + 'is_total_count_clipped': json['is_total_count_clipped'], + }; +} + +export function ListToJSON(value?: List | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'total_count': value.total_count, + 'is_total_count_clipped': value.is_total_count_clipped, + }; +} + + diff --git a/src/vendors/nexus/models/Node.ts b/src/vendors/nexus/models/Node.ts new file mode 100644 index 0000000000..4d00181fd0 --- /dev/null +++ b/src/vendors/nexus/models/Node.ts @@ -0,0 +1,114 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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'; +/** + * A node registered at the consensus layer. + * @export + * @interface Node + */ +export interface Node { + /** + * The public key identifying this node. + * @type {string} + * @memberof Node + */ + id: string; + /** + * The public key identifying the entity controlling this node. + * @type {string} + * @memberof Node + */ + entity_id: string; + /** + * The epoch in which this node's commitment expires. + * @type {number} + * @memberof Node + */ + expiration: number; + /** + * The public key used for establishing TLS connections. + * @type {string} + * @memberof Node + */ + tls_pubkey: string; + /** + * The public key that will be used for establishing TLS connections + * upon rotation. + * @type {string} + * @memberof Node + */ + tls_next_pubkey: string; + /** + * The unique identifier of this node on the P2P transport. + * @type {string} + * @memberof Node + */ + p2p_pubkey: string; + /** + * The unique identifier of this node as a consensus member + * @type {string} + * @memberof Node + */ + consensus_pubkey: string; + /** + * A bitmask representing this node's roles. + * @type {string} + * @memberof Node + */ + roles: string; +} + +export function NodeFromJSON(json: any): Node { + return NodeFromJSONTyped(json, false); +} + +export function NodeFromJSONTyped(json: any, ignoreDiscriminator: boolean): Node { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'id': json['id'], + 'entity_id': json['entity_id'], + 'expiration': json['expiration'], + 'tls_pubkey': json['tls_pubkey'], + 'tls_next_pubkey': json['tls_next_pubkey'], + 'p2p_pubkey': json['p2p_pubkey'], + 'consensus_pubkey': json['consensus_pubkey'], + 'roles': json['roles'], + }; +} + +export function NodeToJSON(value?: Node | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'id': value.id, + 'entity_id': value.entity_id, + 'expiration': value.expiration, + 'tls_pubkey': value.tls_pubkey, + 'tls_next_pubkey': value.tls_next_pubkey, + 'p2p_pubkey': value.p2p_pubkey, + 'consensus_pubkey': value.consensus_pubkey, + 'roles': value.roles, + }; +} + + diff --git a/src/vendors/nexus/models/NodeList.ts b/src/vendors/nexus/models/NodeList.ts new file mode 100644 index 0000000000..b6b5e82bd1 --- /dev/null +++ b/src/vendors/nexus/models/NodeList.ts @@ -0,0 +1,97 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 { + List, + ListFromJSON, + ListFromJSONTyped, + ListToJSON, + Node, + NodeFromJSON, + NodeFromJSONTyped, + NodeToJSON, + NodeListAllOf, + NodeListAllOfFromJSON, + NodeListAllOfFromJSONTyped, + NodeListAllOfToJSON, +} from './'; + +/** + * + * @export + * @interface NodeList + */ +export interface NodeList { + /** + * The total number of records that match the query, i.e. the number of records + * the query would return with limit=infinity. + * @type {number} + * @memberof NodeList + */ + total_count: number; + /** + * Whether total_count is clipped for performance reasons. + * @type {boolean} + * @memberof NodeList + */ + is_total_count_clipped: boolean; + /** + * + * @type {string} + * @memberof NodeList + */ + entity_id: string; + /** + * + * @type {Array} + * @memberof NodeList + */ + nodes: Array; +} + +export function NodeListFromJSON(json: any): NodeList { + return NodeListFromJSONTyped(json, false); +} + +export function NodeListFromJSONTyped(json: any, ignoreDiscriminator: boolean): NodeList { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'total_count': json['total_count'], + 'is_total_count_clipped': json['is_total_count_clipped'], + 'entity_id': json['entity_id'], + 'nodes': ((json['nodes'] as Array).map(NodeFromJSON)), + }; +} + +export function NodeListToJSON(value?: NodeList | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'total_count': value.total_count, + 'is_total_count_clipped': value.is_total_count_clipped, + 'entity_id': value.entity_id, + 'nodes': ((value.nodes as Array).map(NodeToJSON)), + }; +} + + diff --git a/src/vendors/nexus/models/NodeListAllOf.ts b/src/vendors/nexus/models/NodeListAllOf.ts new file mode 100644 index 0000000000..c5ba62575f --- /dev/null +++ b/src/vendors/nexus/models/NodeListAllOf.ts @@ -0,0 +1,72 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 { + Node, + NodeFromJSON, + NodeFromJSONTyped, + NodeToJSON, +} from './'; + +/** + * A list of nodes registered at the consensus layer. + * @export + * @interface NodeListAllOf + */ +export interface NodeListAllOf { + /** + * + * @type {string} + * @memberof NodeListAllOf + */ + entity_id: string; + /** + * + * @type {Array} + * @memberof NodeListAllOf + */ + nodes: Array; +} + +export function NodeListAllOfFromJSON(json: any): NodeListAllOf { + return NodeListAllOfFromJSONTyped(json, false); +} + +export function NodeListAllOfFromJSONTyped(json: any, ignoreDiscriminator: boolean): NodeListAllOf { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'entity_id': json['entity_id'], + 'nodes': ((json['nodes'] as Array).map(NodeFromJSON)), + }; +} + +export function NodeListAllOfToJSON(value?: NodeListAllOf | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'entity_id': value.entity_id, + 'nodes': ((value.nodes as Array).map(NodeToJSON)), + }; +} + + diff --git a/src/vendors/nexus/models/Proposal.ts b/src/vendors/nexus/models/Proposal.ts new file mode 100644 index 0000000000..0b12498737 --- /dev/null +++ b/src/vendors/nexus/models/Proposal.ts @@ -0,0 +1,182 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 { + ProposalState, + ProposalStateFromJSON, + ProposalStateFromJSONTyped, + ProposalStateToJSON, + ProposalTarget, + ProposalTargetFromJSON, + ProposalTargetFromJSONTyped, + ProposalTargetToJSON, +} from './'; + +/** + * A governance proposal. + * @export + * @interface Proposal + */ +export interface Proposal { + /** + * The unique identifier of the proposal. + * @type {number} + * @memberof Proposal + */ + id: number; + /** + * The staking address of the proposal submitter. + * @type {string} + * @memberof Proposal + */ + submitter: string; + /** + * + * @type {ProposalState} + * @memberof Proposal + */ + state: ProposalState; + /** + * The deposit attached to this proposal. + * @type {string} + * @memberof Proposal + */ + deposit: string; + /** + * The (optional) title of the proposal. + * @type {string} + * @memberof Proposal + */ + title?: string; + /** + * The (optional) description of the proposal. + * @type {string} + * @memberof Proposal + */ + description?: string; + /** + * The name of the upgrade handler. + * @type {string} + * @memberof Proposal + */ + handler?: string; + /** + * + * @type {ProposalTarget} + * @memberof Proposal + */ + target?: ProposalTarget; + /** + * The epoch at which the proposed upgrade will happen. + * @type {number} + * @memberof Proposal + */ + epoch?: number; + /** + * The proposal to cancel, if this proposal proposes + * cancelling an existing proposal. + * @type {number} + * @memberof Proposal + */ + cancels?: number; + /** + * The name of the module whose parameters are to be changed + * by this 'parameters_change' proposal. + * @type {string} + * @memberof Proposal + */ + parameters_change_module?: string; + /** + * The parameters change proposal body. This spec does not encode the many possible types; instead, see [the Go API](https://pkg.go.dev/github.com/oasisprotocol/oasis-core/go) of oasis-core. This object will conform to one of the `ConsensusParameterChanges` types, depending on the `parameters_change_module`. + * @type {any} + * @memberof Proposal + */ + parameters_change?: any | null; + /** + * The epoch at which this proposal was created. + * @type {number} + * @memberof Proposal + */ + created_at: number; + /** + * The epoch at which voting for this proposal will close. + * @type {number} + * @memberof Proposal + */ + closes_at: number; + /** + * The number of invalid votes for this proposal, after tallying. + * @type {string} + * @memberof Proposal + */ + invalid_votes: string; +} + +export function ProposalFromJSON(json: any): Proposal { + return ProposalFromJSONTyped(json, false); +} + +export function ProposalFromJSONTyped(json: any, ignoreDiscriminator: boolean): Proposal { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'id': json['id'], + 'submitter': json['submitter'], + 'state': ProposalStateFromJSON(json['state']), + 'deposit': json['deposit'], + 'title': !exists(json, 'title') ? undefined : json['title'], + 'description': !exists(json, 'description') ? undefined : json['description'], + 'handler': !exists(json, 'handler') ? undefined : json['handler'], + 'target': !exists(json, 'target') ? undefined : ProposalTargetFromJSON(json['target']), + 'epoch': !exists(json, 'epoch') ? undefined : json['epoch'], + 'cancels': !exists(json, 'cancels') ? undefined : json['cancels'], + 'parameters_change_module': !exists(json, 'parameters_change_module') ? undefined : json['parameters_change_module'], + 'parameters_change': !exists(json, 'parameters_change') ? undefined : json['parameters_change'], + 'created_at': json['created_at'], + 'closes_at': json['closes_at'], + 'invalid_votes': json['invalid_votes'], + }; +} + +export function ProposalToJSON(value?: Proposal | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'id': value.id, + 'submitter': value.submitter, + 'state': ProposalStateToJSON(value.state), + 'deposit': value.deposit, + 'title': value.title, + 'description': value.description, + 'handler': value.handler, + 'target': ProposalTargetToJSON(value.target), + 'epoch': value.epoch, + 'cancels': value.cancels, + 'parameters_change_module': value.parameters_change_module, + 'parameters_change': value.parameters_change, + 'created_at': value.created_at, + 'closes_at': value.closes_at, + 'invalid_votes': value.invalid_votes, + }; +} + + diff --git a/src/vendors/nexus/models/ProposalList.ts b/src/vendors/nexus/models/ProposalList.ts new file mode 100644 index 0000000000..df4ae062e7 --- /dev/null +++ b/src/vendors/nexus/models/ProposalList.ts @@ -0,0 +1,89 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 { + List, + ListFromJSON, + ListFromJSONTyped, + ListToJSON, + Proposal, + ProposalFromJSON, + ProposalFromJSONTyped, + ProposalToJSON, + ProposalListAllOf, + ProposalListAllOfFromJSON, + ProposalListAllOfFromJSONTyped, + ProposalListAllOfToJSON, +} from './'; + +/** + * + * @export + * @interface ProposalList + */ +export interface ProposalList { + /** + * The total number of records that match the query, i.e. the number of records + * the query would return with limit=infinity. + * @type {number} + * @memberof ProposalList + */ + total_count: number; + /** + * Whether total_count is clipped for performance reasons. + * @type {boolean} + * @memberof ProposalList + */ + is_total_count_clipped: boolean; + /** + * + * @type {Array} + * @memberof ProposalList + */ + proposals: Array; +} + +export function ProposalListFromJSON(json: any): ProposalList { + return ProposalListFromJSONTyped(json, false); +} + +export function ProposalListFromJSONTyped(json: any, ignoreDiscriminator: boolean): ProposalList { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'total_count': json['total_count'], + 'is_total_count_clipped': json['is_total_count_clipped'], + 'proposals': ((json['proposals'] as Array).map(ProposalFromJSON)), + }; +} + +export function ProposalListToJSON(value?: ProposalList | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'total_count': value.total_count, + 'is_total_count_clipped': value.is_total_count_clipped, + 'proposals': ((value.proposals as Array).map(ProposalToJSON)), + }; +} + + diff --git a/src/vendors/nexus/models/ProposalListAllOf.ts b/src/vendors/nexus/models/ProposalListAllOf.ts new file mode 100644 index 0000000000..9b1ac3286a --- /dev/null +++ b/src/vendors/nexus/models/ProposalListAllOf.ts @@ -0,0 +1,64 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 { + Proposal, + ProposalFromJSON, + ProposalFromJSONTyped, + ProposalToJSON, +} from './'; + +/** + * A list of governance proposals. + * @export + * @interface ProposalListAllOf + */ +export interface ProposalListAllOf { + /** + * + * @type {Array} + * @memberof ProposalListAllOf + */ + proposals: Array; +} + +export function ProposalListAllOfFromJSON(json: any): ProposalListAllOf { + return ProposalListAllOfFromJSONTyped(json, false); +} + +export function ProposalListAllOfFromJSONTyped(json: any, ignoreDiscriminator: boolean): ProposalListAllOf { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'proposals': ((json['proposals'] as Array).map(ProposalFromJSON)), + }; +} + +export function ProposalListAllOfToJSON(value?: ProposalListAllOf | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'proposals': ((value.proposals as Array).map(ProposalToJSON)), + }; +} + + diff --git a/src/vendors/nexus/models/ProposalState.ts b/src/vendors/nexus/models/ProposalState.ts new file mode 100644 index 0000000000..ee154c8952 --- /dev/null +++ b/src/vendors/nexus/models/ProposalState.ts @@ -0,0 +1,38 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * The state of the proposal. + * @export + * @enum {string} + */ +export enum ProposalState { + Active = 'active', + Passed = 'passed', + Failed = 'failed', + Rejected = 'rejected' +} + +export function ProposalStateFromJSON(json: any): ProposalState { + return ProposalStateFromJSONTyped(json, false); +} + +export function ProposalStateFromJSONTyped(json: any, ignoreDiscriminator: boolean): ProposalState { + return json as ProposalState; +} + +export function ProposalStateToJSON(value?: ProposalState | null): any { + return value as any; +} + diff --git a/src/vendors/nexus/models/ProposalTarget.ts b/src/vendors/nexus/models/ProposalTarget.ts new file mode 100644 index 0000000000..58ac18fb93 --- /dev/null +++ b/src/vendors/nexus/models/ProposalTarget.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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'; +/** + * The target propotocol versions for this upgrade proposal. + * @export + * @interface ProposalTarget + */ +export interface ProposalTarget { + /** + * + * @type {string} + * @memberof ProposalTarget + */ + consensus_protocol?: string; + /** + * + * @type {string} + * @memberof ProposalTarget + */ + runtime_host_protocol?: string; + /** + * + * @type {string} + * @memberof ProposalTarget + */ + runtime_committee_protocol?: string; +} + +export function ProposalTargetFromJSON(json: any): ProposalTarget { + return ProposalTargetFromJSONTyped(json, false); +} + +export function ProposalTargetFromJSONTyped(json: any, ignoreDiscriminator: boolean): ProposalTarget { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'consensus_protocol': !exists(json, 'consensus_protocol') ? undefined : json['consensus_protocol'], + 'runtime_host_protocol': !exists(json, 'runtime_host_protocol') ? undefined : json['runtime_host_protocol'], + 'runtime_committee_protocol': !exists(json, 'runtime_committee_protocol') ? undefined : json['runtime_committee_protocol'], + }; +} + +export function ProposalTargetToJSON(value?: ProposalTarget | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'consensus_protocol': value.consensus_protocol, + 'runtime_host_protocol': value.runtime_host_protocol, + 'runtime_committee_protocol': value.runtime_committee_protocol, + }; +} + + diff --git a/src/vendors/nexus/models/ProposalVote.ts b/src/vendors/nexus/models/ProposalVote.ts new file mode 100644 index 0000000000..54b7691597 --- /dev/null +++ b/src/vendors/nexus/models/ProposalVote.ts @@ -0,0 +1,81 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 { + /** + * The staking address casting this vote. + * @type {string} + * @memberof ProposalVote + */ + address: string; + /** + * The vote cast. + * @type {string} + * @memberof ProposalVote + */ + vote: string; + /** + * The block height at which this vote was recorded. + * @type {number} + * @memberof ProposalVote + */ + height?: number; + /** + * The second-granular consensus time of the block in which this vote was cast. + * @type {Date} + * @memberof ProposalVote + */ + timestamp?: Date; +} + +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 { + + 'address': json['address'], + 'vote': json['vote'], + 'height': !exists(json, 'height') ? undefined : json['height'], + 'timestamp': !exists(json, 'timestamp') ? undefined : (new Date(json['timestamp'])), + }; +} + +export function ProposalVoteToJSON(value?: ProposalVote | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'address': value.address, + 'vote': value.vote, + 'height': value.height, + 'timestamp': value.timestamp === undefined ? undefined : (value.timestamp.toISOString()), + }; +} + + diff --git a/src/vendors/nexus/models/ProposalVotes.ts b/src/vendors/nexus/models/ProposalVotes.ts new file mode 100644 index 0000000000..51392f1607 --- /dev/null +++ b/src/vendors/nexus/models/ProposalVotes.ts @@ -0,0 +1,97 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 { + List, + ListFromJSON, + ListFromJSONTyped, + ListToJSON, + ProposalVote, + ProposalVoteFromJSON, + ProposalVoteFromJSONTyped, + ProposalVoteToJSON, + ProposalVotesAllOf, + ProposalVotesAllOfFromJSON, + ProposalVotesAllOfFromJSONTyped, + ProposalVotesAllOfToJSON, +} from './'; + +/** + * + * @export + * @interface ProposalVotes + */ +export interface ProposalVotes { + /** + * The total number of records that match the query, i.e. the number of records + * the query would return with limit=infinity. + * @type {number} + * @memberof ProposalVotes + */ + total_count: number; + /** + * Whether total_count is clipped for performance reasons. + * @type {boolean} + * @memberof ProposalVotes + */ + is_total_count_clipped: boolean; + /** + * The unique identifier of the proposal. + * @type {number} + * @memberof ProposalVotes + */ + proposal_id: number; + /** + * The list of votes for the proposal. + * @type {Array} + * @memberof ProposalVotes + */ + votes: Array; +} + +export function ProposalVotesFromJSON(json: any): ProposalVotes { + return ProposalVotesFromJSONTyped(json, false); +} + +export function ProposalVotesFromJSONTyped(json: any, ignoreDiscriminator: boolean): ProposalVotes { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'total_count': json['total_count'], + 'is_total_count_clipped': json['is_total_count_clipped'], + 'proposal_id': json['proposal_id'], + 'votes': ((json['votes'] as Array).map(ProposalVoteFromJSON)), + }; +} + +export function ProposalVotesToJSON(value?: ProposalVotes | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'total_count': value.total_count, + 'is_total_count_clipped': value.is_total_count_clipped, + 'proposal_id': value.proposal_id, + 'votes': ((value.votes as Array).map(ProposalVoteToJSON)), + }; +} + + diff --git a/src/vendors/nexus/models/ProposalVotesAllOf.ts b/src/vendors/nexus/models/ProposalVotesAllOf.ts new file mode 100644 index 0000000000..fba86b52b0 --- /dev/null +++ b/src/vendors/nexus/models/ProposalVotesAllOf.ts @@ -0,0 +1,72 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 './'; + +/** + * A list of votes for a governance proposal. + * @export + * @interface ProposalVotesAllOf + */ +export interface ProposalVotesAllOf { + /** + * The unique identifier of the proposal. + * @type {number} + * @memberof ProposalVotesAllOf + */ + proposal_id: number; + /** + * The list of votes for the proposal. + * @type {Array} + * @memberof ProposalVotesAllOf + */ + votes: Array; +} + +export function ProposalVotesAllOfFromJSON(json: any): ProposalVotesAllOf { + return ProposalVotesAllOfFromJSONTyped(json, false); +} + +export function ProposalVotesAllOfFromJSONTyped(json: any, ignoreDiscriminator: boolean): ProposalVotesAllOf { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'proposal_id': json['proposal_id'], + 'votes': ((json['votes'] as Array).map(ProposalVoteFromJSON)), + }; +} + +export function ProposalVotesAllOfToJSON(value?: ProposalVotesAllOf | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'proposal_id': value.proposal_id, + 'votes': ((value.votes as Array).map(ProposalVoteToJSON)), + }; +} + + diff --git a/src/vendors/nexus/models/RoothashMessage.ts b/src/vendors/nexus/models/RoothashMessage.ts new file mode 100644 index 0000000000..c28474d2ca --- /dev/null +++ b/src/vendors/nexus/models/RoothashMessage.ts @@ -0,0 +1,141 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 { + RoothashMessageType, + RoothashMessageTypeFromJSON, + RoothashMessageTypeFromJSONTyped, + RoothashMessageTypeToJSON, +} from './'; + +/** + * + * @export + * @interface RoothashMessage + */ +export interface RoothashMessage { + /** + * The runtime that sent this message. + * @type {string} + * @memberof RoothashMessage + */ + runtime: string; + /** + * The block round when the runtime sent this message. + * @type {number} + * @memberof RoothashMessage + */ + round: number; + /** + * The 0-based index of this message in the block. + * @type {number} + * @memberof RoothashMessage + */ + index: number; + /** + * The type of thies message. + * @type {RoothashMessageType} + * @memberof RoothashMessage + */ + type?: RoothashMessageType; + /** + * The "body" of a message is a structure within the + * `github.com/oasisprotocol/oasis-core/go/roothash/api/message` + * `Message` structure + * (https://pkg.go.dev/github.com/oasisprotocol/oasis-core/go/roothash/api/message#Message). + * For example, if the type is `staking.withdraw`, the body is the Go + * `Message` structure's `.Staking.Withdraw` field, which is a + * `github.com/oasisprotocol/oasis-core/go/staking/api` `Withdraw` + * structure + * (https://pkg.go.dev/github.com/oasisprotocol/oasis-core/go/staking/api#Withdraw), + * with `from` and `amount` fields in JSON. + * @type {object} + * @memberof RoothashMessage + */ + body?: object; + /** + * If executing this message resulted in an error, this is the + * error's module. + * @type {string} + * @memberof RoothashMessage + */ + error_module?: string; + /** + * If executing this message resulted in an error, this is the + * error's code. + * @type {number} + * @memberof RoothashMessage + */ + error_code?: number; + /** + * A result value that consensus provided after executing this + * message. These aren't centrally registered anywhere, so look at + * the consensus apps' `ExecuteMessage` + * (https://pkg.go.dev/github.com/oasisprotocol/oasis-core/go/consensus/cometbft/api#MessageSubscriber) + * implementations to see what they return. For example, a + * `staking.withdraw` type message gives a + * `github.com/oasisprotocol/oasis-core/go/staking/api` + * `WithdrawResult` structure as its result + * (`https://pkg.go.dev/github.com/oasisprotocol/oasis-core/go/staking/api#WithdrawResult`) + * with `owner`, `beneficiary`, `allowance`, and `amount_change` + * fields. + * @type {any} + * @memberof RoothashMessage + */ + result?: any | null; +} + +export function RoothashMessageFromJSON(json: any): RoothashMessage { + return RoothashMessageFromJSONTyped(json, false); +} + +export function RoothashMessageFromJSONTyped(json: any, ignoreDiscriminator: boolean): RoothashMessage { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'runtime': json['runtime'], + 'round': json['round'], + 'index': json['index'], + 'type': !exists(json, 'type') ? undefined : RoothashMessageTypeFromJSON(json['type']), + 'body': !exists(json, 'body') ? undefined : json['body'], + 'error_module': !exists(json, 'error_module') ? undefined : json['error_module'], + 'error_code': !exists(json, 'error_code') ? undefined : json['error_code'], + 'result': !exists(json, 'result') ? undefined : json['result'], + }; +} + +export function RoothashMessageToJSON(value?: RoothashMessage | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'runtime': value.runtime, + 'round': value.round, + 'index': value.index, + 'type': RoothashMessageTypeToJSON(value.type), + 'body': value.body, + 'error_module': value.error_module, + 'error_code': value.error_code, + 'result': value.result, + }; +} + + diff --git a/src/vendors/nexus/models/RoothashMessageList.ts b/src/vendors/nexus/models/RoothashMessageList.ts new file mode 100644 index 0000000000..c26fecdf22 --- /dev/null +++ b/src/vendors/nexus/models/RoothashMessageList.ts @@ -0,0 +1,89 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 { + List, + ListFromJSON, + ListFromJSONTyped, + ListToJSON, + RoothashMessage, + RoothashMessageFromJSON, + RoothashMessageFromJSONTyped, + RoothashMessageToJSON, + RoothashMessageListAllOf, + RoothashMessageListAllOfFromJSON, + RoothashMessageListAllOfFromJSONTyped, + RoothashMessageListAllOfToJSON, +} from './'; + +/** + * + * @export + * @interface RoothashMessageList + */ +export interface RoothashMessageList { + /** + * The total number of records that match the query, i.e. the number of records + * the query would return with limit=infinity. + * @type {number} + * @memberof RoothashMessageList + */ + total_count: number; + /** + * Whether total_count is clipped for performance reasons. + * @type {boolean} + * @memberof RoothashMessageList + */ + is_total_count_clipped: boolean; + /** + * + * @type {Array} + * @memberof RoothashMessageList + */ + roothash_messages: Array; +} + +export function RoothashMessageListFromJSON(json: any): RoothashMessageList { + return RoothashMessageListFromJSONTyped(json, false); +} + +export function RoothashMessageListFromJSONTyped(json: any, ignoreDiscriminator: boolean): RoothashMessageList { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'total_count': json['total_count'], + 'is_total_count_clipped': json['is_total_count_clipped'], + 'roothash_messages': ((json['roothash_messages'] as Array).map(RoothashMessageFromJSON)), + }; +} + +export function RoothashMessageListToJSON(value?: RoothashMessageList | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'total_count': value.total_count, + 'is_total_count_clipped': value.is_total_count_clipped, + 'roothash_messages': ((value.roothash_messages as Array).map(RoothashMessageToJSON)), + }; +} + + diff --git a/src/vendors/nexus/models/RoothashMessageListAllOf.ts b/src/vendors/nexus/models/RoothashMessageListAllOf.ts new file mode 100644 index 0000000000..23e6c5385c --- /dev/null +++ b/src/vendors/nexus/models/RoothashMessageListAllOf.ts @@ -0,0 +1,64 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 { + RoothashMessage, + RoothashMessageFromJSON, + RoothashMessageFromJSONTyped, + RoothashMessageToJSON, +} from './'; + +/** + * + * @export + * @interface RoothashMessageListAllOf + */ +export interface RoothashMessageListAllOf { + /** + * + * @type {Array} + * @memberof RoothashMessageListAllOf + */ + roothash_messages: Array; +} + +export function RoothashMessageListAllOfFromJSON(json: any): RoothashMessageListAllOf { + return RoothashMessageListAllOfFromJSONTyped(json, false); +} + +export function RoothashMessageListAllOfFromJSONTyped(json: any, ignoreDiscriminator: boolean): RoothashMessageListAllOf { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'roothash_messages': ((json['roothash_messages'] as Array).map(RoothashMessageFromJSON)), + }; +} + +export function RoothashMessageListAllOfToJSON(value?: RoothashMessageListAllOf | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'roothash_messages': ((value.roothash_messages as Array).map(RoothashMessageToJSON)), + }; +} + + diff --git a/src/vendors/nexus/models/RoothashMessageType.ts b/src/vendors/nexus/models/RoothashMessageType.ts new file mode 100644 index 0000000000..203ec3fd39 --- /dev/null +++ b/src/vendors/nexus/models/RoothashMessageType.ts @@ -0,0 +1,41 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * + * @export + * @enum {string} + */ +export enum RoothashMessageType { + StakingTransfer = 'staking.transfer', + StakingWithdraw = 'staking.withdraw', + StakingAddEscrow = 'staking.add_escrow', + StakingReclaimEscrow = 'staking.reclaim_escrow', + RegistryUpdateRuntime = 'registry.update_runtime', + GovernanceCastVote = 'governance.cast_vote', + GovernanceSubmitProposal = 'governance.submit_proposal' +} + +export function RoothashMessageTypeFromJSON(json: any): RoothashMessageType { + return RoothashMessageTypeFromJSONTyped(json, false); +} + +export function RoothashMessageTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): RoothashMessageType { + return json as RoothashMessageType; +} + +export function RoothashMessageTypeToJSON(value?: RoothashMessageType | null): any { + return value as any; +} + diff --git a/src/vendors/nexus/models/Runtime.ts b/src/vendors/nexus/models/Runtime.ts new file mode 100644 index 0000000000..2fcde0e362 --- /dev/null +++ b/src/vendors/nexus/models/Runtime.ts @@ -0,0 +1,39 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * + * @export + * @enum {string} + */ +export enum Runtime { + Emerald = 'emerald', + Sapphire = 'sapphire', + Pontusxtest = 'pontusxtest', + Pontusxdev = 'pontusxdev', + Cipher = 'cipher' +} + +export function RuntimeFromJSON(json: any): Runtime { + return RuntimeFromJSONTyped(json, false); +} + +export function RuntimeFromJSONTyped(json: any, ignoreDiscriminator: boolean): Runtime { + return json as Runtime; +} + +export function RuntimeToJSON(value?: Runtime | null): any { + return value as any; +} + diff --git a/src/vendors/nexus/models/RuntimeAccount.ts b/src/vendors/nexus/models/RuntimeAccount.ts new file mode 100644 index 0000000000..b03962bc6d --- /dev/null +++ b/src/vendors/nexus/models/RuntimeAccount.ts @@ -0,0 +1,125 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 { + AccountStats, + AccountStatsFromJSON, + AccountStatsFromJSONTyped, + AccountStatsToJSON, + AddressPreimage, + AddressPreimageFromJSON, + AddressPreimageFromJSONTyped, + AddressPreimageToJSON, + RuntimeEvmBalance, + RuntimeEvmBalanceFromJSON, + RuntimeEvmBalanceFromJSONTyped, + RuntimeEvmBalanceToJSON, + RuntimeEvmContract, + RuntimeEvmContractFromJSON, + RuntimeEvmContractFromJSONTyped, + RuntimeEvmContractToJSON, + RuntimeSdkBalance, + RuntimeSdkBalanceFromJSON, + RuntimeSdkBalanceFromJSONTyped, + RuntimeSdkBalanceToJSON, +} from './'; + +/** + * + * @export + * @interface RuntimeAccount + */ +export interface RuntimeAccount { + /** + * The staking address for this account. + * @type {string} + * @memberof RuntimeAccount + */ + address: string; + /** + * + * @type {AddressPreimage} + * @memberof RuntimeAccount + */ + address_preimage?: AddressPreimage; + /** + * The balance(s) of this account in this runtime. Most runtimes use only one denomination, and thus + * produce only one balance here. These balances do not include "layer (n+1) tokens", i.e. tokens + * managed by smart contracts deployed in this runtime. For example, in EVM-compatible runtimes, + * this does not include ERC-20 tokens + * @type {Array} + * @memberof RuntimeAccount + */ + balances: Array; + /** + * Data on the EVM smart contract associated with this account address. Only present for accounts + * that represent a smart contract on EVM. + * @type {RuntimeEvmContract} + * @memberof RuntimeAccount + */ + evm_contract?: RuntimeEvmContract; + /** + * The balances of this account in each runtime, as managed by EVM smart contracts (notably, ERC-20). + * NOTE: This field is limited to 1000 entries. If you need more, please let us know in a GitHub issue. + * @type {Array} + * @memberof RuntimeAccount + */ + evm_balances: Array; + /** + * + * @type {AccountStats} + * @memberof RuntimeAccount + */ + stats: AccountStats; +} + +export function RuntimeAccountFromJSON(json: any): RuntimeAccount { + return RuntimeAccountFromJSONTyped(json, false); +} + +export function RuntimeAccountFromJSONTyped(json: any, ignoreDiscriminator: boolean): RuntimeAccount { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'address': json['address'], + 'address_preimage': !exists(json, 'address_preimage') ? undefined : AddressPreimageFromJSON(json['address_preimage']), + 'balances': ((json['balances'] as Array).map(RuntimeSdkBalanceFromJSON)), + 'evm_contract': !exists(json, 'evm_contract') ? undefined : RuntimeEvmContractFromJSON(json['evm_contract']), + 'evm_balances': ((json['evm_balances'] as Array).map(RuntimeEvmBalanceFromJSON)), + 'stats': AccountStatsFromJSON(json['stats']), + }; +} + +export function RuntimeAccountToJSON(value?: RuntimeAccount | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'address': value.address, + 'address_preimage': AddressPreimageToJSON(value.address_preimage), + 'balances': ((value.balances as Array).map(RuntimeSdkBalanceToJSON)), + 'evm_contract': RuntimeEvmContractToJSON(value.evm_contract), + 'evm_balances': ((value.evm_balances as Array).map(RuntimeEvmBalanceToJSON)), + 'stats': AccountStatsToJSON(value.stats), + }; +} + + diff --git a/src/vendors/nexus/models/RuntimeBlock.ts b/src/vendors/nexus/models/RuntimeBlock.ts new file mode 100644 index 0000000000..b7ac5660ee --- /dev/null +++ b/src/vendors/nexus/models/RuntimeBlock.ts @@ -0,0 +1,97 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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'; +/** + * A ParaTime block. + * @export + * @interface RuntimeBlock + */ +export interface RuntimeBlock { + /** + * The block round. + * @type {number} + * @memberof RuntimeBlock + */ + round: number; + /** + * The block header hash. + * @type {string} + * @memberof RuntimeBlock + */ + hash: string; + /** + * The second-granular consensus time. + * @type {Date} + * @memberof RuntimeBlock + */ + timestamp: Date; + /** + * The number of transactions in the block. + * @type {number} + * @memberof RuntimeBlock + */ + num_transactions: number; + /** + * The total byte size of all transactions in the block. + * @type {number} + * @memberof RuntimeBlock + */ + size: number; + /** + * The total gas used by all transactions in the block. + * @type {number} + * @memberof RuntimeBlock + */ + gas_used: number; +} + +export function RuntimeBlockFromJSON(json: any): RuntimeBlock { + return RuntimeBlockFromJSONTyped(json, false); +} + +export function RuntimeBlockFromJSONTyped(json: any, ignoreDiscriminator: boolean): RuntimeBlock { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'round': json['round'], + 'hash': json['hash'], + 'timestamp': (new Date(json['timestamp'])), + 'num_transactions': json['num_transactions'], + 'size': json['size'], + 'gas_used': json['gas_used'], + }; +} + +export function RuntimeBlockToJSON(value?: RuntimeBlock | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'round': value.round, + 'hash': value.hash, + 'timestamp': (value.timestamp.toISOString()), + 'num_transactions': value.num_transactions, + 'size': value.size, + 'gas_used': value.gas_used, + }; +} + + diff --git a/src/vendors/nexus/models/RuntimeBlockList.ts b/src/vendors/nexus/models/RuntimeBlockList.ts new file mode 100644 index 0000000000..541fb7ff12 --- /dev/null +++ b/src/vendors/nexus/models/RuntimeBlockList.ts @@ -0,0 +1,89 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 { + List, + ListFromJSON, + ListFromJSONTyped, + ListToJSON, + RuntimeBlock, + RuntimeBlockFromJSON, + RuntimeBlockFromJSONTyped, + RuntimeBlockToJSON, + RuntimeBlockListAllOf, + RuntimeBlockListAllOfFromJSON, + RuntimeBlockListAllOfFromJSONTyped, + RuntimeBlockListAllOfToJSON, +} from './'; + +/** + * + * @export + * @interface RuntimeBlockList + */ +export interface RuntimeBlockList { + /** + * The total number of records that match the query, i.e. the number of records + * the query would return with limit=infinity. + * @type {number} + * @memberof RuntimeBlockList + */ + total_count: number; + /** + * Whether total_count is clipped for performance reasons. + * @type {boolean} + * @memberof RuntimeBlockList + */ + is_total_count_clipped: boolean; + /** + * + * @type {Array} + * @memberof RuntimeBlockList + */ + blocks: Array; +} + +export function RuntimeBlockListFromJSON(json: any): RuntimeBlockList { + return RuntimeBlockListFromJSONTyped(json, false); +} + +export function RuntimeBlockListFromJSONTyped(json: any, ignoreDiscriminator: boolean): RuntimeBlockList { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'total_count': json['total_count'], + 'is_total_count_clipped': json['is_total_count_clipped'], + 'blocks': ((json['blocks'] as Array).map(RuntimeBlockFromJSON)), + }; +} + +export function RuntimeBlockListToJSON(value?: RuntimeBlockList | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'total_count': value.total_count, + 'is_total_count_clipped': value.is_total_count_clipped, + 'blocks': ((value.blocks as Array).map(RuntimeBlockToJSON)), + }; +} + + diff --git a/src/vendors/nexus/models/RuntimeBlockListAllOf.ts b/src/vendors/nexus/models/RuntimeBlockListAllOf.ts new file mode 100644 index 0000000000..94776d9fda --- /dev/null +++ b/src/vendors/nexus/models/RuntimeBlockListAllOf.ts @@ -0,0 +1,64 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 { + RuntimeBlock, + RuntimeBlockFromJSON, + RuntimeBlockFromJSONTyped, + RuntimeBlockToJSON, +} from './'; + +/** + * A list of consensus blocks. + * @export + * @interface RuntimeBlockListAllOf + */ +export interface RuntimeBlockListAllOf { + /** + * + * @type {Array} + * @memberof RuntimeBlockListAllOf + */ + blocks: Array; +} + +export function RuntimeBlockListAllOfFromJSON(json: any): RuntimeBlockListAllOf { + return RuntimeBlockListAllOfFromJSONTyped(json, false); +} + +export function RuntimeBlockListAllOfFromJSONTyped(json: any, ignoreDiscriminator: boolean): RuntimeBlockListAllOf { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'blocks': ((json['blocks'] as Array).map(RuntimeBlockFromJSON)), + }; +} + +export function RuntimeBlockListAllOfToJSON(value?: RuntimeBlockListAllOf | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'blocks': ((value.blocks as Array).map(RuntimeBlockToJSON)), + }; +} + + diff --git a/src/vendors/nexus/models/RuntimeEvent.ts b/src/vendors/nexus/models/RuntimeEvent.ts new file mode 100644 index 0000000000..336f6c477d --- /dev/null +++ b/src/vendors/nexus/models/RuntimeEvent.ts @@ -0,0 +1,156 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 { + EvmAbiParam, + EvmAbiParamFromJSON, + EvmAbiParamFromJSONTyped, + EvmAbiParamToJSON, + EvmEventToken, + EvmEventTokenFromJSON, + EvmEventTokenFromJSONTyped, + EvmEventTokenToJSON, + RuntimeEventType, + RuntimeEventTypeFromJSON, + RuntimeEventTypeFromJSONTyped, + RuntimeEventTypeToJSON, +} from './'; + +/** + * An event emitted by the runtime layer + * @export + * @interface RuntimeEvent + */ +export interface RuntimeEvent { + /** + * The block height at which this event was generated. + * @type {number} + * @memberof RuntimeEvent + */ + round: number; + /** + * 0-based index of this event's originating transaction within its block. + * Absent if the event did not originate from a transaction. + * @type {number} + * @memberof RuntimeEvent + */ + tx_index?: number; + /** + * Hash of this event's originating transaction. + * Absent if the event did not originate from a transaction. + * @type {string} + * @memberof RuntimeEvent + */ + tx_hash?: string; + /** + * Ethereum trasnsaction hash of this event's originating transaction. + * Absent if the event did not originate from an EVM transaction. + * @type {string} + * @memberof RuntimeEvent + */ + eth_tx_hash?: string; + /** + * The second-granular consensus time of this event's block. + * @type {Date} + * @memberof RuntimeEvent + */ + timestamp: Date; + /** + * The type of the event. + * @type {RuntimeEventType} + * @memberof RuntimeEvent + */ + type: RuntimeEventType; + /** + * The decoded event contents, possibly augmented with additional address info. + * This spec does not encode the many possible types; instead, see [the Go API](https://pkg.go.dev/github.com/oasisprotocol/oasis-sdk/client-sdk/go/modules). + * This object will conform to one of the `*Event` types two levels down + * the hierarchy (e.g. `MintEvent` from `accounts > Event > MintEvent`), + * OR `evm > Event`. For object fields that specify an oasis-style address, Nexus + * will add a field specifying the corresponding Ethereum address, if known. Currently, + * the only such possible fields are `from_eth`, `to_eth`, and `owner_eth`. + * @type {object} + * @memberof RuntimeEvent + */ + body: object; + /** + * If the event type is `evm.log`, this field describes the human-readable type of + * evm event, e.g. `Transfer`. + * Absent if the event type is not `evm.log`. + * @type {string} + * @memberof RuntimeEvent + */ + evm_log_name?: string; + /** + * The decoded `evm.log` event data. + * Absent if the event type is not `evm.log`. + * @type {Array} + * @memberof RuntimeEvent + */ + evm_log_params?: Array; + /** + * + * @type {EvmEventToken} + * @memberof RuntimeEvent + */ + evm_token?: EvmEventToken; +} + +export function RuntimeEventFromJSON(json: any): RuntimeEvent { + return RuntimeEventFromJSONTyped(json, false); +} + +export function RuntimeEventFromJSONTyped(json: any, ignoreDiscriminator: boolean): RuntimeEvent { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'round': json['round'], + 'tx_index': !exists(json, 'tx_index') ? undefined : json['tx_index'], + 'tx_hash': !exists(json, 'tx_hash') ? undefined : json['tx_hash'], + 'eth_tx_hash': !exists(json, 'eth_tx_hash') ? undefined : json['eth_tx_hash'], + 'timestamp': (new Date(json['timestamp'])), + 'type': RuntimeEventTypeFromJSON(json['type']), + 'body': json['body'], + 'evm_log_name': !exists(json, 'evm_log_name') ? undefined : json['evm_log_name'], + 'evm_log_params': !exists(json, 'evm_log_params') ? undefined : ((json['evm_log_params'] as Array).map(EvmAbiParamFromJSON)), + 'evm_token': !exists(json, 'evm_token') ? undefined : EvmEventTokenFromJSON(json['evm_token']), + }; +} + +export function RuntimeEventToJSON(value?: RuntimeEvent | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'round': value.round, + 'tx_index': value.tx_index, + 'tx_hash': value.tx_hash, + 'eth_tx_hash': value.eth_tx_hash, + 'timestamp': (value.timestamp.toISOString()), + 'type': RuntimeEventTypeToJSON(value.type), + 'body': value.body, + 'evm_log_name': value.evm_log_name, + 'evm_log_params': value.evm_log_params === undefined ? undefined : ((value.evm_log_params as Array).map(EvmAbiParamToJSON)), + 'evm_token': EvmEventTokenToJSON(value.evm_token), + }; +} + + diff --git a/src/vendors/nexus/models/RuntimeEventList.ts b/src/vendors/nexus/models/RuntimeEventList.ts new file mode 100644 index 0000000000..24484731c7 --- /dev/null +++ b/src/vendors/nexus/models/RuntimeEventList.ts @@ -0,0 +1,89 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 { + List, + ListFromJSON, + ListFromJSONTyped, + ListToJSON, + RuntimeEvent, + RuntimeEventFromJSON, + RuntimeEventFromJSONTyped, + RuntimeEventToJSON, + RuntimeEventListAllOf, + RuntimeEventListAllOfFromJSON, + RuntimeEventListAllOfFromJSONTyped, + RuntimeEventListAllOfToJSON, +} from './'; + +/** + * + * @export + * @interface RuntimeEventList + */ +export interface RuntimeEventList { + /** + * The total number of records that match the query, i.e. the number of records + * the query would return with limit=infinity. + * @type {number} + * @memberof RuntimeEventList + */ + total_count: number; + /** + * Whether total_count is clipped for performance reasons. + * @type {boolean} + * @memberof RuntimeEventList + */ + is_total_count_clipped: boolean; + /** + * + * @type {Array} + * @memberof RuntimeEventList + */ + events: Array; +} + +export function RuntimeEventListFromJSON(json: any): RuntimeEventList { + return RuntimeEventListFromJSONTyped(json, false); +} + +export function RuntimeEventListFromJSONTyped(json: any, ignoreDiscriminator: boolean): RuntimeEventList { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'total_count': json['total_count'], + 'is_total_count_clipped': json['is_total_count_clipped'], + 'events': ((json['events'] as Array).map(RuntimeEventFromJSON)), + }; +} + +export function RuntimeEventListToJSON(value?: RuntimeEventList | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'total_count': value.total_count, + 'is_total_count_clipped': value.is_total_count_clipped, + 'events': ((value.events as Array).map(RuntimeEventToJSON)), + }; +} + + diff --git a/src/vendors/nexus/models/RuntimeEventListAllOf.ts b/src/vendors/nexus/models/RuntimeEventListAllOf.ts new file mode 100644 index 0000000000..79e035c655 --- /dev/null +++ b/src/vendors/nexus/models/RuntimeEventListAllOf.ts @@ -0,0 +1,64 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 { + RuntimeEvent, + RuntimeEventFromJSON, + RuntimeEventFromJSONTyped, + RuntimeEventToJSON, +} from './'; + +/** + * A list of runtime events. + * @export + * @interface RuntimeEventListAllOf + */ +export interface RuntimeEventListAllOf { + /** + * + * @type {Array} + * @memberof RuntimeEventListAllOf + */ + events: Array; +} + +export function RuntimeEventListAllOfFromJSON(json: any): RuntimeEventListAllOf { + return RuntimeEventListAllOfFromJSONTyped(json, false); +} + +export function RuntimeEventListAllOfFromJSONTyped(json: any, ignoreDiscriminator: boolean): RuntimeEventListAllOf { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'events': ((json['events'] as Array).map(RuntimeEventFromJSON)), + }; +} + +export function RuntimeEventListAllOfToJSON(value?: RuntimeEventListAllOf | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'events': ((value.events as Array).map(RuntimeEventToJSON)), + }; +} + + diff --git a/src/vendors/nexus/models/RuntimeEventType.ts b/src/vendors/nexus/models/RuntimeEventType.ts new file mode 100644 index 0000000000..ac23ec87ff --- /dev/null +++ b/src/vendors/nexus/models/RuntimeEventType.ts @@ -0,0 +1,44 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * + * @export + * @enum {string} + */ +export enum RuntimeEventType { + AccountsTransfer = 'accounts.transfer', + AccountsBurn = 'accounts.burn', + AccountsMint = 'accounts.mint', + ConsensusAccountsDeposit = 'consensus_accounts.deposit', + ConsensusAccountsWithdraw = 'consensus_accounts.withdraw', + ConsensusAccountsDelegate = 'consensus_accounts.delegate', + ConsensusAccountsUndelegateStart = 'consensus_accounts.undelegate_start', + ConsensusAccountsUndelegateDone = 'consensus_accounts.undelegate_done', + CoreGasUsed = 'core.gas_used', + EvmLog = 'evm.log' +} + +export function RuntimeEventTypeFromJSON(json: any): RuntimeEventType { + return RuntimeEventTypeFromJSONTyped(json, false); +} + +export function RuntimeEventTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): RuntimeEventType { + return json as RuntimeEventType; +} + +export function RuntimeEventTypeToJSON(value?: RuntimeEventType | null): any { + return value as any; +} + diff --git a/src/vendors/nexus/models/RuntimeEvmBalance.ts b/src/vendors/nexus/models/RuntimeEvmBalance.ts new file mode 100644 index 0000000000..ac254093c8 --- /dev/null +++ b/src/vendors/nexus/models/RuntimeEvmBalance.ts @@ -0,0 +1,112 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 { + EvmTokenType, + EvmTokenTypeFromJSON, + EvmTokenTypeFromJSONTyped, + EvmTokenTypeToJSON, +} from './'; + +/** + * Balance of an account for a specific runtime and EVM token. + * @export + * @interface RuntimeEvmBalance + */ +export interface RuntimeEvmBalance { + /** + * Number of tokens held, in base units. + * @type {string} + * @memberof RuntimeEvmBalance + */ + balance: string; + /** + * The Oasis address of this token's contract. + * @type {string} + * @memberof RuntimeEvmBalance + */ + token_contract_addr: string; + /** + * The EVM address of this token's contract. + * @type {string} + * @memberof RuntimeEvmBalance + */ + token_contract_addr_eth: string; + /** + * The token ticker symbol. Not guaranteed to be unique across distinct EVM tokens. + * @type {string} + * @memberof RuntimeEvmBalance + */ + token_symbol?: string; + /** + * The name of the token. Not guaranteed to be unique across distinct EVM tokens. + * @type {string} + * @memberof RuntimeEvmBalance + */ + token_name?: string; + /** + * + * @type {EvmTokenType} + * @memberof RuntimeEvmBalance + */ + token_type: EvmTokenType; + /** + * The number of decimals of precision for this token. + * @type {number} + * @memberof RuntimeEvmBalance + */ + token_decimals: number; +} + +export function RuntimeEvmBalanceFromJSON(json: any): RuntimeEvmBalance { + return RuntimeEvmBalanceFromJSONTyped(json, false); +} + +export function RuntimeEvmBalanceFromJSONTyped(json: any, ignoreDiscriminator: boolean): RuntimeEvmBalance { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'balance': json['balance'], + 'token_contract_addr': json['token_contract_addr'], + 'token_contract_addr_eth': json['token_contract_addr_eth'], + 'token_symbol': !exists(json, 'token_symbol') ? undefined : json['token_symbol'], + 'token_name': !exists(json, 'token_name') ? undefined : json['token_name'], + 'token_type': EvmTokenTypeFromJSON(json['token_type']), + 'token_decimals': json['token_decimals'], + }; +} + +export function RuntimeEvmBalanceToJSON(value?: RuntimeEvmBalance | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'balance': value.balance, + 'token_contract_addr': value.token_contract_addr, + 'token_contract_addr_eth': value.token_contract_addr_eth, + 'token_symbol': value.token_symbol, + 'token_name': value.token_name, + 'token_type': EvmTokenTypeToJSON(value.token_type), + 'token_decimals': value.token_decimals, + }; +} + + diff --git a/src/vendors/nexus/models/RuntimeEvmContract.ts b/src/vendors/nexus/models/RuntimeEvmContract.ts new file mode 100644 index 0000000000..1e25e60251 --- /dev/null +++ b/src/vendors/nexus/models/RuntimeEvmContract.ts @@ -0,0 +1,114 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 { + RuntimeEvmContractVerification, + RuntimeEvmContractVerificationFromJSON, + RuntimeEvmContractVerificationFromJSONTyped, + RuntimeEvmContractVerificationToJSON, +} from './'; + +/** + * + * @export + * @interface RuntimeEvmContract + */ +export interface RuntimeEvmContract { + /** + * The Oasis cryptographic hash of the transaction that created the smart contract. + * Can be omitted for contracts that were created by another contract, as opposed + * to a direct `Create` call. + * @type {string} + * @memberof RuntimeEvmContract + */ + creation_tx?: string; + /** + * The Ethereum transaction hash of the transaction in `creation_tx`. + * Encoded as a lowercase hex string. + * @type {string} + * @memberof RuntimeEvmContract + */ + eth_creation_tx?: string; + /** + * The creation bytecode of the smart contract. This includes the constructor logic + * and the constructor parameters. When run, this code generates the runtime bytecode. + * Can be omitted for contracts that were created by another contract, as opposed + * to a direct `Create` call. + * @type {string} + * @memberof RuntimeEvmContract + */ + creation_bytecode?: string; + /** + * The runtime bytecode of the smart contract. This is the code stored on-chain that + * describes a smart contract. Every contract has this info, but Nexus fetches + * it separately, so the field may be missing for very fresh contracts (or if the fetching + * process is stalled). + * @type {string} + * @memberof RuntimeEvmContract + */ + runtime_bytecode?: string; + /** + * The total amount of gas used to create or call this contract. + * @type {number} + * @memberof RuntimeEvmContract + */ + gas_used: number; + /** + * Additional information obtained from contract verification. Only available for smart + * contracts that have been verified successfully by Sourcify. + * @type {RuntimeEvmContractVerification} + * @memberof RuntimeEvmContract + */ + verification?: RuntimeEvmContractVerification; +} + +export function RuntimeEvmContractFromJSON(json: any): RuntimeEvmContract { + return RuntimeEvmContractFromJSONTyped(json, false); +} + +export function RuntimeEvmContractFromJSONTyped(json: any, ignoreDiscriminator: boolean): RuntimeEvmContract { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'creation_tx': !exists(json, 'creation_tx') ? undefined : json['creation_tx'], + 'eth_creation_tx': !exists(json, 'eth_creation_tx') ? undefined : json['eth_creation_tx'], + 'creation_bytecode': !exists(json, 'creation_bytecode') ? undefined : json['creation_bytecode'], + 'runtime_bytecode': !exists(json, 'runtime_bytecode') ? undefined : json['runtime_bytecode'], + 'gas_used': json['gas_used'], + 'verification': !exists(json, 'verification') ? undefined : RuntimeEvmContractVerificationFromJSON(json['verification']), + }; +} + +export function RuntimeEvmContractToJSON(value?: RuntimeEvmContract | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'creation_tx': value.creation_tx, + 'eth_creation_tx': value.eth_creation_tx, + 'creation_bytecode': value.creation_bytecode, + 'runtime_bytecode': value.runtime_bytecode, + 'gas_used': value.gas_used, + 'verification': RuntimeEvmContractVerificationToJSON(value.verification), + }; +} + + diff --git a/src/vendors/nexus/models/RuntimeEvmContractVerification.ts b/src/vendors/nexus/models/RuntimeEvmContractVerification.ts new file mode 100644 index 0000000000..e4807ae954 --- /dev/null +++ b/src/vendors/nexus/models/RuntimeEvmContractVerification.ts @@ -0,0 +1,81 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 { + VerificationLevel, + VerificationLevelFromJSON, + VerificationLevelFromJSONTyped, + VerificationLevelToJSON, +} from './'; + +/** + * + * @export + * @interface RuntimeEvmContractVerification + */ +export interface RuntimeEvmContractVerification { + /** + * + * @type {VerificationLevel} + * @memberof RuntimeEvmContractVerification + */ + verification_level?: VerificationLevel; + /** + * The smart contract's [metadata.json](https://docs.soliditylang.org/en/latest/metadata.html) file in JSON format as defined by Solidity. + * Includes the smart contract's [ABI](https://docs.soliditylang.org/en/develop/abi-spec.html). + * @type {object} + * @memberof RuntimeEvmContractVerification + */ + compilation_metadata?: object; + /** + * Array of all contract source files, in JSON format as returned by [Sourcify](https://sourcify.dev/server/api-docs/#/Repository/get_files_any__chain___address_). + * @type {Array} + * @memberof RuntimeEvmContractVerification + */ + source_files?: Array; +} + +export function RuntimeEvmContractVerificationFromJSON(json: any): RuntimeEvmContractVerification { + return RuntimeEvmContractVerificationFromJSONTyped(json, false); +} + +export function RuntimeEvmContractVerificationFromJSONTyped(json: any, ignoreDiscriminator: boolean): RuntimeEvmContractVerification { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'verification_level': !exists(json, 'verification_level') ? undefined : VerificationLevelFromJSON(json['verification_level']), + 'compilation_metadata': !exists(json, 'compilation_metadata') ? undefined : json['compilation_metadata'], + 'source_files': !exists(json, 'source_files') ? undefined : json['source_files'], + }; +} + +export function RuntimeEvmContractVerificationToJSON(value?: RuntimeEvmContractVerification | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'verification_level': VerificationLevelToJSON(value.verification_level), + 'compilation_metadata': value.compilation_metadata, + 'source_files': value.source_files, + }; +} + + diff --git a/src/vendors/nexus/models/RuntimeSdkBalance.ts b/src/vendors/nexus/models/RuntimeSdkBalance.ts new file mode 100644 index 0000000000..d1e6d3e507 --- /dev/null +++ b/src/vendors/nexus/models/RuntimeSdkBalance.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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'; +/** + * Balance of an account for a specific runtime and oasis-sdk token (e.g. ROSE). + * @export + * @interface RuntimeSdkBalance + */ +export interface RuntimeSdkBalance { + /** + * Number of tokens held, in base units. + * @type {string} + * @memberof RuntimeSdkBalance + */ + balance: string; + /** + * The token ticker symbol. Unique across all oasis-sdk tokens in the same runtime. + * @type {string} + * @memberof RuntimeSdkBalance + */ + token_symbol: string; + /** + * The number of decimals of precision for this token. + * @type {number} + * @memberof RuntimeSdkBalance + */ + token_decimals: number; +} + +export function RuntimeSdkBalanceFromJSON(json: any): RuntimeSdkBalance { + return RuntimeSdkBalanceFromJSONTyped(json, false); +} + +export function RuntimeSdkBalanceFromJSONTyped(json: any, ignoreDiscriminator: boolean): RuntimeSdkBalance { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'balance': json['balance'], + 'token_symbol': json['token_symbol'], + 'token_decimals': json['token_decimals'], + }; +} + +export function RuntimeSdkBalanceToJSON(value?: RuntimeSdkBalance | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'balance': value.balance, + 'token_symbol': value.token_symbol, + 'token_decimals': value.token_decimals, + }; +} + + diff --git a/src/vendors/nexus/models/RuntimeStatus.ts b/src/vendors/nexus/models/RuntimeStatus.ts new file mode 100644 index 0000000000..5bee1f5054 --- /dev/null +++ b/src/vendors/nexus/models/RuntimeStatus.ts @@ -0,0 +1,81 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 RuntimeStatus + */ +export interface RuntimeStatus { + /** + * The number of compute nodes that are registered and can run the runtime. + * @type {number} + * @memberof RuntimeStatus + */ + active_nodes: number; + /** + * The height of the most recent indexed block (also sometimes referred to as "round") for this runtime. Query a synced Oasis node for the latest block produced. + * @type {number} + * @memberof RuntimeStatus + */ + latest_block: number; + /** + * The RFC 3339 formatted consensus time of when the latest indexed block for this runtime was produced. + * @type {Date} + * @memberof RuntimeStatus + */ + latest_block_time: Date; + /** + * The number of milliseconds since Nexus processed the latest block. + * @type {number} + * @memberof RuntimeStatus + */ + latest_update_age_ms: number; +} + +export function RuntimeStatusFromJSON(json: any): RuntimeStatus { + return RuntimeStatusFromJSONTyped(json, false); +} + +export function RuntimeStatusFromJSONTyped(json: any, ignoreDiscriminator: boolean): RuntimeStatus { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'active_nodes': json['active_nodes'], + 'latest_block': json['latest_block'], + 'latest_block_time': (new Date(json['latest_block_time'])), + 'latest_update_age_ms': json['latest_update_age_ms'], + }; +} + +export function RuntimeStatusToJSON(value?: RuntimeStatus | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'active_nodes': value.active_nodes, + 'latest_block': value.latest_block, + 'latest_block_time': (value.latest_block_time.toISOString()), + 'latest_update_age_ms': value.latest_update_age_ms, + }; +} + + diff --git a/src/vendors/nexus/models/RuntimeTransaction.ts b/src/vendors/nexus/models/RuntimeTransaction.ts new file mode 100644 index 0000000000..acb70cdad6 --- /dev/null +++ b/src/vendors/nexus/models/RuntimeTransaction.ts @@ -0,0 +1,327 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 { + EvmAbiParam, + EvmAbiParamFromJSON, + EvmAbiParamFromJSONTyped, + EvmAbiParamToJSON, + RuntimeTransactionEncryptionEnvelope, + RuntimeTransactionEncryptionEnvelopeFromJSON, + RuntimeTransactionEncryptionEnvelopeFromJSONTyped, + RuntimeTransactionEncryptionEnvelopeToJSON, + TxError, + TxErrorFromJSON, + TxErrorFromJSONTyped, + TxErrorToJSON, +} from './'; + +/** + * A runtime transaction. + * @export + * @interface RuntimeTransaction + */ +export interface RuntimeTransaction { + /** + * The block round at which this transaction was executed. + * @type {number} + * @memberof RuntimeTransaction + */ + round: number; + /** + * The 0-based index of this transaction in the block. + * @type {number} + * @memberof RuntimeTransaction + */ + index: number; + /** + * The second-granular consensus time when this tx's block was proposed. + * @type {Date} + * @memberof RuntimeTransaction + */ + timestamp: Date; + /** + * The Oasis cryptographic hash of this transaction's encoding. + * @type {string} + * @memberof RuntimeTransaction + */ + hash: string; + /** + * The Ethereum cryptographic hash of this transaction's encoding. + * Absent for non-Ethereum-format transactions. + * @type {string} + * @memberof RuntimeTransaction + */ + eth_hash?: string; + /** + * The Oasis address of this transaction's 0th signer. + * Unlike Ethereum, Oasis natively supports multiple-signature transactions. + * However, the great majority of transactions only have a single signer in practice. + * Retrieving the other signers is currently not supported by this API. + * @type {string} + * @memberof RuntimeTransaction + */ + sender_0: string; + /** + * The Ethereum address of this transaction's 0th signer. + * @type {string} + * @memberof RuntimeTransaction + */ + sender_0_eth?: string; + /** + * The nonce used with this transaction's 0th signer, to prevent replay. + * @type {number} + * @memberof RuntimeTransaction + */ + nonce_0: number; + /** + * The fee that this transaction's sender committed to pay to execute + * it (total ParaTime base units, as a string). + * @type {string} + * @memberof RuntimeTransaction + */ + fee: string; + /** + * The denomination of the fee. + * @type {string} + * @memberof RuntimeTransaction + */ + fee_symbol: string; + /** + * The module of the fee proxy. + * @type {string} + * @memberof RuntimeTransaction + */ + fee_proxy_module?: string; + /** + * the base64-encoded id of the fee proxy. + * @type {string} + * @memberof RuntimeTransaction + */ + fee_proxy_id?: string; + /** + * The maximum gas that this transaction's sender committed to use to + * execute it. + * @type {number} + * @memberof RuntimeTransaction + */ + gas_limit: number; + /** + * The total gas used by the transaction. + * @type {number} + * @memberof RuntimeTransaction + */ + gas_used: number; + /** + * The fee that was charged for the transaction execution (total, native denomination, + * ParaTime base units, as a string). + * For EVM transactions this is calculated as `gas_price * gas_used`, where `gas_price = fee / gas_limit`, for compatibility with Ethereum. + * For other transactions this equals to `fee`. + * @type {string} + * @memberof RuntimeTransaction + */ + charged_fee: string; + /** + * The total byte size of the transaction. + * @type {number} + * @memberof RuntimeTransaction + */ + size: number; + /** + * The method that was called. Defined by the runtime. In theory, this could be any string as the runtimes evolve. + * In practice, Nexus currently expects only the following methods: + * - "accounts.Transfer" + * - "consensus.Deposit" + * - "consensus.Withdraw" + * - "consensus.Delegate" + * - "consensus.Undelegate" + * - "evm.Create" + * - "evm.Call" + * May be null if the transaction was malformed or encrypted. + * @type {string} + * @memberof RuntimeTransaction + */ + method?: string; + /** + * The method call body. May be null if the transaction was malformed. + * @type {object} + * @memberof RuntimeTransaction + */ + body?: object; + /** + * Whether this transaction likely represents a native token transfer. + * This is based on a heuristic, and can change at any time without warning and possibly without updating the documentation. + * The current heuristic sets this to `true` for: + * - Transactions with method "accounts.Transfer". Those are always native token transfers. + * - Transactions with method "evm.Call" that have no `data` field in their `body`. Those tend to be transfers, but the runtimes provides no reliable visibility into whether a transfer happened. + * Note: Other transactions with method "evm.Call", and possibly "evm.Create", may also be (or include) native token transfers. The heuristic will be `false` for those. + * @type {boolean} + * @memberof RuntimeTransaction + */ + is_likely_native_token_transfer?: boolean; + /** + * A reasonable "to" Oasis address associated with this transaction, + * if applicable. The meaning varies based on the transaction method. Some notable examples: + * - For `method = "accounts.Transfer"`, this is the paratime account receiving the funds. + * - For `method = "consensus.Deposit"`, this is the paratime account receiving the funds. + * - For `method = "consensus.Withdraw"`, this is the consensus (!) account receiving the funds. + * - For `method = "consensus.Delegate"`, this is the consensus (!) account receiving the funds. + * - For `method = "consensus.Undelegate"`, this is the consensus (!) account to which funds were previously delegated. Note that this corresponds with the `.from` field in the transaction body. + * - For `method = "evm.Create"`, this is the address of the newly created smart contract. + * - For `method = "evm.Call"`, this is the address of the called smart contract + * @type {string} + * @memberof RuntimeTransaction + */ + to?: string; + /** + * A reasonable "to" Ethereum address associated with this transaction, + * @type {string} + * @memberof RuntimeTransaction + */ + to_eth?: string; + /** + * A reasonable "amount" associated with this transaction, if + * applicable. The meaning varies based on the transaction method. + * Usually in native denomination, ParaTime units. As a string. + * @type {string} + * @memberof RuntimeTransaction + */ + amount?: string; + /** + * The denomination of the "amount" associated with this transaction, if applicable. + * @type {string} + * @memberof RuntimeTransaction + */ + amount_symbol?: string; + /** + * The data relevant to the encrypted transaction. Only present for encrypted + * transactions in confidential EVM runtimes like Sapphire. + * Note: The term "envelope" in this context refers to the [Oasis-style encryption envelopes](https://github.com/oasisprotocol/oasis-sdk/blob/c36a7ee194abf4ca28fdac0edbefe3843b39bf69/runtime-sdk/src/types/callformat.rs) + * which differ slightly from [digital envelopes](hhttps://en.wikipedia.org/wiki/Hybrid_cryptosystem#Envelope_encryption). + * @type {RuntimeTransactionEncryptionEnvelope} + * @memberof RuntimeTransaction + */ + encryption_envelope?: RuntimeTransactionEncryptionEnvelope; + /** + * Whether this transaction successfully executed. + * Can be absent (meaning "unknown") for confidential runtimes. + * @type {boolean} + * @memberof RuntimeTransaction + */ + success?: boolean; + /** + * The name of the smart contract function called by the transaction. + * Only present for `evm.log` transaction calls to contracts that have been verified. + * @type {string} + * @memberof RuntimeTransaction + */ + evm_fn_name?: string; + /** + * The decoded parameters with which the smart contract function was called. + * Only present for `evm.log` transaction calls to contracts that have been verified. + * @type {Array} + * @memberof RuntimeTransaction + */ + evm_fn_params?: Array; + /** + * Error details of a failed transaction. + * @type {TxError} + * @memberof RuntimeTransaction + */ + error?: TxError; +} + +export function RuntimeTransactionFromJSON(json: any): RuntimeTransaction { + return RuntimeTransactionFromJSONTyped(json, false); +} + +export function RuntimeTransactionFromJSONTyped(json: any, ignoreDiscriminator: boolean): RuntimeTransaction { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'round': json['round'], + 'index': json['index'], + 'timestamp': (new Date(json['timestamp'])), + 'hash': json['hash'], + 'eth_hash': !exists(json, 'eth_hash') ? undefined : json['eth_hash'], + 'sender_0': json['sender_0'], + 'sender_0_eth': !exists(json, 'sender_0_eth') ? undefined : json['sender_0_eth'], + 'nonce_0': json['nonce_0'], + 'fee': json['fee'], + 'fee_symbol': json['fee_symbol'], + 'fee_proxy_module': !exists(json, 'fee_proxy_module') ? undefined : json['fee_proxy_module'], + 'fee_proxy_id': !exists(json, 'fee_proxy_id') ? undefined : json['fee_proxy_id'], + 'gas_limit': json['gas_limit'], + 'gas_used': json['gas_used'], + 'charged_fee': json['charged_fee'], + 'size': json['size'], + 'method': !exists(json, 'method') ? undefined : json['method'], + 'body': !exists(json, 'body') ? undefined : json['body'], + 'is_likely_native_token_transfer': !exists(json, 'is_likely_native_token_transfer') ? undefined : json['is_likely_native_token_transfer'], + 'to': !exists(json, 'to') ? undefined : json['to'], + 'to_eth': !exists(json, 'to_eth') ? undefined : json['to_eth'], + 'amount': !exists(json, 'amount') ? undefined : json['amount'], + 'amount_symbol': !exists(json, 'amount_symbol') ? undefined : json['amount_symbol'], + 'encryption_envelope': !exists(json, 'encryption_envelope') ? undefined : RuntimeTransactionEncryptionEnvelopeFromJSON(json['encryption_envelope']), + 'success': !exists(json, 'success') ? undefined : json['success'], + 'evm_fn_name': !exists(json, 'evm_fn_name') ? undefined : json['evm_fn_name'], + 'evm_fn_params': !exists(json, 'evm_fn_params') ? undefined : ((json['evm_fn_params'] as Array).map(EvmAbiParamFromJSON)), + 'error': !exists(json, 'error') ? undefined : TxErrorFromJSON(json['error']), + }; +} + +export function RuntimeTransactionToJSON(value?: RuntimeTransaction | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'round': value.round, + 'index': value.index, + 'timestamp': (value.timestamp.toISOString()), + 'hash': value.hash, + 'eth_hash': value.eth_hash, + 'sender_0': value.sender_0, + 'sender_0_eth': value.sender_0_eth, + 'nonce_0': value.nonce_0, + 'fee': value.fee, + 'fee_symbol': value.fee_symbol, + 'fee_proxy_module': value.fee_proxy_module, + 'fee_proxy_id': value.fee_proxy_id, + 'gas_limit': value.gas_limit, + 'gas_used': value.gas_used, + 'charged_fee': value.charged_fee, + 'size': value.size, + 'method': value.method, + 'body': value.body, + 'is_likely_native_token_transfer': value.is_likely_native_token_transfer, + 'to': value.to, + 'to_eth': value.to_eth, + 'amount': value.amount, + 'amount_symbol': value.amount_symbol, + 'encryption_envelope': RuntimeTransactionEncryptionEnvelopeToJSON(value.encryption_envelope), + 'success': value.success, + 'evm_fn_name': value.evm_fn_name, + 'evm_fn_params': value.evm_fn_params === undefined ? undefined : ((value.evm_fn_params as Array).map(EvmAbiParamToJSON)), + 'error': TxErrorToJSON(value.error), + }; +} + + diff --git a/src/vendors/nexus/models/RuntimeTransactionEncryptionEnvelope.ts b/src/vendors/nexus/models/RuntimeTransactionEncryptionEnvelope.ts new file mode 100644 index 0000000000..5f0f0633b5 --- /dev/null +++ b/src/vendors/nexus/models/RuntimeTransactionEncryptionEnvelope.ts @@ -0,0 +1,97 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 RuntimeTransactionEncryptionEnvelope + */ +export interface RuntimeTransactionEncryptionEnvelope { + /** + * The format of the encrypted evm transaction envelope. + * @type {string} + * @memberof RuntimeTransactionEncryptionEnvelope + */ + format: string; + /** + * The base64-encoded public key used to encrypt the transaction. + * @type {string} + * @memberof RuntimeTransactionEncryptionEnvelope + */ + public_key?: string; + /** + * The base64-encoded nonce used to encrypt the transaction data. + * @type {string} + * @memberof RuntimeTransactionEncryptionEnvelope + */ + data_nonce?: string; + /** + * The base64-encoded encrypted transaction data. + * @type {string} + * @memberof RuntimeTransactionEncryptionEnvelope + */ + data?: string; + /** + * The base64-encoded nonce used to encrypt the transaction results. + * @type {string} + * @memberof RuntimeTransactionEncryptionEnvelope + */ + result_nonce?: string; + /** + * The base64-encoded encrypted result data. + * @type {string} + * @memberof RuntimeTransactionEncryptionEnvelope + */ + result?: string; +} + +export function RuntimeTransactionEncryptionEnvelopeFromJSON(json: any): RuntimeTransactionEncryptionEnvelope { + return RuntimeTransactionEncryptionEnvelopeFromJSONTyped(json, false); +} + +export function RuntimeTransactionEncryptionEnvelopeFromJSONTyped(json: any, ignoreDiscriminator: boolean): RuntimeTransactionEncryptionEnvelope { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'format': json['format'], + 'public_key': !exists(json, 'public_key') ? undefined : json['public_key'], + 'data_nonce': !exists(json, 'data_nonce') ? undefined : json['data_nonce'], + 'data': !exists(json, 'data') ? undefined : json['data'], + 'result_nonce': !exists(json, 'result_nonce') ? undefined : json['result_nonce'], + 'result': !exists(json, 'result') ? undefined : json['result'], + }; +} + +export function RuntimeTransactionEncryptionEnvelopeToJSON(value?: RuntimeTransactionEncryptionEnvelope | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'format': value.format, + 'public_key': value.public_key, + 'data_nonce': value.data_nonce, + 'data': value.data, + 'result_nonce': value.result_nonce, + 'result': value.result, + }; +} + + diff --git a/src/vendors/nexus/models/RuntimeTransactionList.ts b/src/vendors/nexus/models/RuntimeTransactionList.ts new file mode 100644 index 0000000000..6c94c8c9c7 --- /dev/null +++ b/src/vendors/nexus/models/RuntimeTransactionList.ts @@ -0,0 +1,89 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 { + List, + ListFromJSON, + ListFromJSONTyped, + ListToJSON, + RuntimeTransaction, + RuntimeTransactionFromJSON, + RuntimeTransactionFromJSONTyped, + RuntimeTransactionToJSON, + RuntimeTransactionListAllOf, + RuntimeTransactionListAllOfFromJSON, + RuntimeTransactionListAllOfFromJSONTyped, + RuntimeTransactionListAllOfToJSON, +} from './'; + +/** + * + * @export + * @interface RuntimeTransactionList + */ +export interface RuntimeTransactionList { + /** + * The total number of records that match the query, i.e. the number of records + * the query would return with limit=infinity. + * @type {number} + * @memberof RuntimeTransactionList + */ + total_count: number; + /** + * Whether total_count is clipped for performance reasons. + * @type {boolean} + * @memberof RuntimeTransactionList + */ + is_total_count_clipped: boolean; + /** + * + * @type {Array} + * @memberof RuntimeTransactionList + */ + transactions: Array; +} + +export function RuntimeTransactionListFromJSON(json: any): RuntimeTransactionList { + return RuntimeTransactionListFromJSONTyped(json, false); +} + +export function RuntimeTransactionListFromJSONTyped(json: any, ignoreDiscriminator: boolean): RuntimeTransactionList { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'total_count': json['total_count'], + 'is_total_count_clipped': json['is_total_count_clipped'], + 'transactions': ((json['transactions'] as Array).map(RuntimeTransactionFromJSON)), + }; +} + +export function RuntimeTransactionListToJSON(value?: RuntimeTransactionList | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'total_count': value.total_count, + 'is_total_count_clipped': value.is_total_count_clipped, + 'transactions': ((value.transactions as Array).map(RuntimeTransactionToJSON)), + }; +} + + diff --git a/src/vendors/nexus/models/RuntimeTransactionListAllOf.ts b/src/vendors/nexus/models/RuntimeTransactionListAllOf.ts new file mode 100644 index 0000000000..46d5089770 --- /dev/null +++ b/src/vendors/nexus/models/RuntimeTransactionListAllOf.ts @@ -0,0 +1,64 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 { + RuntimeTransaction, + RuntimeTransactionFromJSON, + RuntimeTransactionFromJSONTyped, + RuntimeTransactionToJSON, +} from './'; + +/** + * A list of runtime transactions. + * @export + * @interface RuntimeTransactionListAllOf + */ +export interface RuntimeTransactionListAllOf { + /** + * + * @type {Array} + * @memberof RuntimeTransactionListAllOf + */ + transactions: Array; +} + +export function RuntimeTransactionListAllOfFromJSON(json: any): RuntimeTransactionListAllOf { + return RuntimeTransactionListAllOfFromJSONTyped(json, false); +} + +export function RuntimeTransactionListAllOfFromJSONTyped(json: any, ignoreDiscriminator: boolean): RuntimeTransactionListAllOf { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'transactions': ((json['transactions'] as Array).map(RuntimeTransactionFromJSON)), + }; +} + +export function RuntimeTransactionListAllOfToJSON(value?: RuntimeTransactionListAllOf | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'transactions': ((value.transactions as Array).map(RuntimeTransactionToJSON)), + }; +} + + diff --git a/src/vendors/nexus/models/Status.ts b/src/vendors/nexus/models/Status.ts new file mode 100644 index 0000000000..9252a92a31 --- /dev/null +++ b/src/vendors/nexus/models/Status.ts @@ -0,0 +1,82 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 Status + */ +export interface Status { + /** + * The height of the most recent indexed block. Compare with latest_node_block to measure + * how far behind Nexus is from the chain. + * @type {number} + * @memberof Status + */ + latest_block: number; + /** + * The height of the most recently produced block on-chain as seen by Nexus. + * @type {number} + * @memberof Status + */ + latest_node_block: number; + /** + * The RFC 3339 formatted consensus time of when the most recently indexed block was produced. + * @type {Date} + * @memberof Status + */ + latest_block_time: Date; + /** + * The number of milliseconds since Nexus processed the latest block. + * @type {number} + * @memberof Status + */ + latest_update_age_ms: number; +} + +export function StatusFromJSON(json: any): Status { + return StatusFromJSONTyped(json, false); +} + +export function StatusFromJSONTyped(json: any, ignoreDiscriminator: boolean): Status { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'latest_block': json['latest_block'], + 'latest_node_block': json['latest_node_block'], + 'latest_block_time': (new Date(json['latest_block_time'])), + 'latest_update_age_ms': json['latest_update_age_ms'], + }; +} + +export function StatusToJSON(value?: Status | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'latest_block': value.latest_block, + 'latest_node_block': value.latest_node_block, + 'latest_block_time': (value.latest_block_time.toISOString()), + 'latest_update_age_ms': value.latest_update_age_ms, + }; +} + + diff --git a/src/vendors/nexus/models/TokenHolderList.ts b/src/vendors/nexus/models/TokenHolderList.ts new file mode 100644 index 0000000000..9dd54dc502 --- /dev/null +++ b/src/vendors/nexus/models/TokenHolderList.ts @@ -0,0 +1,89 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 { + BareTokenHolder, + BareTokenHolderFromJSON, + BareTokenHolderFromJSONTyped, + BareTokenHolderToJSON, + List, + ListFromJSON, + ListFromJSONTyped, + ListToJSON, + TokenHolderListAllOf, + TokenHolderListAllOfFromJSON, + TokenHolderListAllOfFromJSONTyped, + TokenHolderListAllOfToJSON, +} from './'; + +/** + * + * @export + * @interface TokenHolderList + */ +export interface TokenHolderList { + /** + * The total number of records that match the query, i.e. the number of records + * the query would return with limit=infinity. + * @type {number} + * @memberof TokenHolderList + */ + total_count: number; + /** + * Whether total_count is clipped for performance reasons. + * @type {boolean} + * @memberof TokenHolderList + */ + is_total_count_clipped: boolean; + /** + * + * @type {Array} + * @memberof TokenHolderList + */ + holders: Array; +} + +export function TokenHolderListFromJSON(json: any): TokenHolderList { + return TokenHolderListFromJSONTyped(json, false); +} + +export function TokenHolderListFromJSONTyped(json: any, ignoreDiscriminator: boolean): TokenHolderList { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'total_count': json['total_count'], + 'is_total_count_clipped': json['is_total_count_clipped'], + 'holders': ((json['holders'] as Array).map(BareTokenHolderFromJSON)), + }; +} + +export function TokenHolderListToJSON(value?: TokenHolderList | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'total_count': value.total_count, + 'is_total_count_clipped': value.is_total_count_clipped, + 'holders': ((value.holders as Array).map(BareTokenHolderToJSON)), + }; +} + + diff --git a/src/vendors/nexus/models/TokenHolderListAllOf.ts b/src/vendors/nexus/models/TokenHolderListAllOf.ts new file mode 100644 index 0000000000..bdc0d4446e --- /dev/null +++ b/src/vendors/nexus/models/TokenHolderListAllOf.ts @@ -0,0 +1,64 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 { + BareTokenHolder, + BareTokenHolderFromJSON, + BareTokenHolderFromJSONTyped, + BareTokenHolderToJSON, +} from './'; + +/** + * A list of token holders for a specific (implied) runtime and token. + * @export + * @interface TokenHolderListAllOf + */ +export interface TokenHolderListAllOf { + /** + * + * @type {Array} + * @memberof TokenHolderListAllOf + */ + holders: Array; +} + +export function TokenHolderListAllOfFromJSON(json: any): TokenHolderListAllOf { + return TokenHolderListAllOfFromJSONTyped(json, false); +} + +export function TokenHolderListAllOfFromJSONTyped(json: any, ignoreDiscriminator: boolean): TokenHolderListAllOf { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'holders': ((json['holders'] as Array).map(BareTokenHolderFromJSON)), + }; +} + +export function TokenHolderListAllOfToJSON(value?: TokenHolderListAllOf | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'holders': ((value.holders as Array).map(BareTokenHolderToJSON)), + }; +} + + diff --git a/src/vendors/nexus/models/Transaction.ts b/src/vendors/nexus/models/Transaction.ts new file mode 100644 index 0000000000..e610d9d8d0 --- /dev/null +++ b/src/vendors/nexus/models/Transaction.ts @@ -0,0 +1,158 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 { + ConsensusTxMethod, + ConsensusTxMethodFromJSON, + ConsensusTxMethodFromJSONTyped, + ConsensusTxMethodToJSON, + TxError, + TxErrorFromJSON, + TxErrorFromJSONTyped, + TxErrorToJSON, +} from './'; + +/** + * A consensus transaction. + * @export + * @interface Transaction + */ +export interface Transaction { + /** + * The block height at which this transaction was executed. + * @type {number} + * @memberof Transaction + */ + block: number; + /** + * 0-based index of this transaction in its block + * @type {number} + * @memberof Transaction + */ + index: number; + /** + * The second-granular consensus time of this tx's block, i.e. roughly when the + * [block was proposed](https://github.com/tendermint/tendermint/blob/v0.34.x/spec/core/data_structures.md#header). + * @type {Date} + * @memberof Transaction + */ + timestamp: Date; + /** + * The cryptographic hash of this transaction's encoding. + * @type {string} + * @memberof Transaction + */ + hash: string; + /** + * The address of who sent this transaction. + * @type {string} + * @memberof Transaction + */ + sender: string; + /** + * The nonce used with this transaction, to prevent replay. + * @type {number} + * @memberof Transaction + */ + nonce: number; + /** + * The fee that this transaction's sender committed + * to pay to execute it. + * @type {string} + * @memberof Transaction + */ + fee: string; + /** + * The maximum gas that a transaction can use. + * @type {string} + * @memberof Transaction + */ + gas_limit: string; + /** + * The method that was called. + * @type {ConsensusTxMethod} + * @memberof Transaction + */ + method: ConsensusTxMethod; + /** + * The method call body. This spec does not encode the many possible types; instead, see [the Go API](https://pkg.go.dev/github.com/oasisprotocol/oasis-core/go) of oasis-core. This object will conform to one of the types passed to variable instantiations using `NewMethodName` two levels down the hierarchy, e.g. `MethodTransfer` from `oasis-core/go/staking/api` seen [here](https://pkg.go.dev/github.com/oasisprotocol/oasis-core/go@v0.2300.10/staking/api#pkg-variables). + * @type {object} + * @memberof Transaction + */ + body: object; + /** + * Whether this transaction successfully executed. + * @type {boolean} + * @memberof Transaction + */ + success: boolean; + /** + * Error details of a failed transaction. + * @type {TxError} + * @memberof Transaction + */ + error?: TxError; +} + +export function TransactionFromJSON(json: any): Transaction { + return TransactionFromJSONTyped(json, false); +} + +export function TransactionFromJSONTyped(json: any, ignoreDiscriminator: boolean): Transaction { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'block': json['block'], + 'index': json['index'], + 'timestamp': (new Date(json['timestamp'])), + 'hash': json['hash'], + 'sender': json['sender'], + 'nonce': json['nonce'], + 'fee': json['fee'], + 'gas_limit': json['gas_limit'], + 'method': ConsensusTxMethodFromJSON(json['method']), + 'body': json['body'], + 'success': json['success'], + 'error': !exists(json, 'error') ? undefined : TxErrorFromJSON(json['error']), + }; +} + +export function TransactionToJSON(value?: Transaction | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'block': value.block, + 'index': value.index, + 'timestamp': (value.timestamp.toISOString()), + 'hash': value.hash, + 'sender': value.sender, + 'nonce': value.nonce, + 'fee': value.fee, + 'gas_limit': value.gas_limit, + 'method': ConsensusTxMethodToJSON(value.method), + 'body': value.body, + 'success': value.success, + 'error': TxErrorToJSON(value.error), + }; +} + + diff --git a/src/vendors/nexus/models/TransactionList.ts b/src/vendors/nexus/models/TransactionList.ts new file mode 100644 index 0000000000..26321adfc9 --- /dev/null +++ b/src/vendors/nexus/models/TransactionList.ts @@ -0,0 +1,89 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 { + List, + ListFromJSON, + ListFromJSONTyped, + ListToJSON, + Transaction, + TransactionFromJSON, + TransactionFromJSONTyped, + TransactionToJSON, + TransactionListAllOf, + TransactionListAllOfFromJSON, + TransactionListAllOfFromJSONTyped, + TransactionListAllOfToJSON, +} from './'; + +/** + * + * @export + * @interface TransactionList + */ +export interface TransactionList { + /** + * The total number of records that match the query, i.e. the number of records + * the query would return with limit=infinity. + * @type {number} + * @memberof TransactionList + */ + total_count: number; + /** + * Whether total_count is clipped for performance reasons. + * @type {boolean} + * @memberof TransactionList + */ + is_total_count_clipped: boolean; + /** + * + * @type {Array} + * @memberof TransactionList + */ + transactions: Array; +} + +export function TransactionListFromJSON(json: any): TransactionList { + return TransactionListFromJSONTyped(json, false); +} + +export function TransactionListFromJSONTyped(json: any, ignoreDiscriminator: boolean): TransactionList { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'total_count': json['total_count'], + 'is_total_count_clipped': json['is_total_count_clipped'], + 'transactions': ((json['transactions'] as Array).map(TransactionFromJSON)), + }; +} + +export function TransactionListToJSON(value?: TransactionList | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'total_count': value.total_count, + 'is_total_count_clipped': value.is_total_count_clipped, + 'transactions': ((value.transactions as Array).map(TransactionToJSON)), + }; +} + + diff --git a/src/vendors/nexus/models/TransactionListAllOf.ts b/src/vendors/nexus/models/TransactionListAllOf.ts new file mode 100644 index 0000000000..4e97eb175e --- /dev/null +++ b/src/vendors/nexus/models/TransactionListAllOf.ts @@ -0,0 +1,64 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 { + Transaction, + TransactionFromJSON, + TransactionFromJSONTyped, + TransactionToJSON, +} from './'; + +/** + * A list of consensus transactions. + * @export + * @interface TransactionListAllOf + */ +export interface TransactionListAllOf { + /** + * + * @type {Array} + * @memberof TransactionListAllOf + */ + transactions: Array; +} + +export function TransactionListAllOfFromJSON(json: any): TransactionListAllOf { + return TransactionListAllOfFromJSONTyped(json, false); +} + +export function TransactionListAllOfFromJSONTyped(json: any, ignoreDiscriminator: boolean): TransactionListAllOf { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'transactions': ((json['transactions'] as Array).map(TransactionFromJSON)), + }; +} + +export function TransactionListAllOfToJSON(value?: TransactionListAllOf | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'transactions': ((value.transactions as Array).map(TransactionToJSON)), + }; +} + + diff --git a/src/vendors/nexus/models/TxError.ts b/src/vendors/nexus/models/TxError.ts new file mode 100644 index 0000000000..848e584a07 --- /dev/null +++ b/src/vendors/nexus/models/TxError.ts @@ -0,0 +1,102 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 { + EvmAbiParam, + EvmAbiParamFromJSON, + EvmAbiParamFromJSONTyped, + EvmAbiParamToJSON, +} from './'; + +/** + * + * @export + * @interface TxError + */ +export interface TxError { + /** + * The module of a failed transaction. + * @type {string} + * @memberof TxError + */ + module?: string; + /** + * The status code of a failed transaction. + * @type {number} + * @memberof TxError + */ + code: number; + /** + * The message of a failed transaction. + * This field, like `code` and `module`, can represent an error that originated + * anywhere in the paratime, i.e. either inside or outside a smart contract. + * + * A common special case worth calling out: When the paratime is + * EVM-compatible (e.g. Emerald or Sapphire) and the error originates + * inside a smart contract (using `revert` in solidity), the following + * will be true: + * - `module` will be "evm" and `code` will be 8; see [here](https://github.com/oasisprotocol/oasis-sdk/blob/runtime-sdk/v0.8.3/runtime-sdk/modules/evm/src/lib.rs#L128) for other possible errors in the `evm` module. + * - `message` will contain the best-effort human-readable revert reason. + * @type {string} + * @memberof TxError + */ + message?: string; + /** + * The error parameters, as decoded using the contract abi. Present only when + * - the error originated from within a smart contract (e.g. via `revert` in Solidity), and + * - the contract is verified or the revert reason is a plain String. + * If this field is present, `message` will include the name of the error, e.g. 'InsufficentBalance'. + * Note that users should be cautious when evaluating error data since the + * data origin is not tracked and error information can be faked. + * @type {Array} + * @memberof TxError + */ + revert_params?: Array; +} + +export function TxErrorFromJSON(json: any): TxError { + return TxErrorFromJSONTyped(json, false); +} + +export function TxErrorFromJSONTyped(json: any, ignoreDiscriminator: boolean): TxError { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'module': !exists(json, 'module') ? undefined : json['module'], + 'code': json['code'], + 'message': !exists(json, 'message') ? undefined : json['message'], + 'revert_params': !exists(json, 'revert_params') ? undefined : ((json['revert_params'] as Array).map(EvmAbiParamFromJSON)), + }; +} + +export function TxErrorToJSON(value?: TxError | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'module': value.module, + 'code': value.code, + 'message': value.message, + 'revert_params': value.revert_params === undefined ? undefined : ((value.revert_params as Array).map(EvmAbiParamToJSON)), + }; +} + + diff --git a/src/vendors/nexus/models/TxVolume.ts b/src/vendors/nexus/models/TxVolume.ts new file mode 100644 index 0000000000..cfce8abeba --- /dev/null +++ b/src/vendors/nexus/models/TxVolume.ts @@ -0,0 +1,65 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 TxVolume + */ +export interface TxVolume { + /** + * The end timestamp for this daily transaction volume measurement. + * @type {Date} + * @memberof TxVolume + */ + window_end: Date; + /** + * The transaction volume for this window. + * @type {number} + * @memberof TxVolume + */ + tx_volume: number; +} + +export function TxVolumeFromJSON(json: any): TxVolume { + return TxVolumeFromJSONTyped(json, false); +} + +export function TxVolumeFromJSONTyped(json: any, ignoreDiscriminator: boolean): TxVolume { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'window_end': (new Date(json['window_end'])), + 'tx_volume': json['tx_volume'], + }; +} + +export function TxVolumeToJSON(value?: TxVolume | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'window_end': (value.window_end.toISOString()), + 'tx_volume': value.tx_volume, + }; +} + + diff --git a/src/vendors/nexus/models/TxVolumeList.ts b/src/vendors/nexus/models/TxVolumeList.ts new file mode 100644 index 0000000000..eb15e86ce2 --- /dev/null +++ b/src/vendors/nexus/models/TxVolumeList.ts @@ -0,0 +1,72 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 { + TxVolume, + TxVolumeFromJSON, + TxVolumeFromJSONTyped, + TxVolumeToJSON, +} from './'; + +/** + * A list of daily transaction volumes. + * @export + * @interface TxVolumeList + */ +export interface TxVolumeList { + /** + * + * @type {number} + * @memberof TxVolumeList + */ + window_size_seconds: number; + /** + * The list of daily transaction volumes. + * @type {Array} + * @memberof TxVolumeList + */ + windows: Array; +} + +export function TxVolumeListFromJSON(json: any): TxVolumeList { + return TxVolumeListFromJSONTyped(json, false); +} + +export function TxVolumeListFromJSONTyped(json: any, ignoreDiscriminator: boolean): TxVolumeList { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'window_size_seconds': json['window_size_seconds'], + 'windows': ((json['windows'] as Array).map(TxVolumeFromJSON)), + }; +} + +export function TxVolumeListToJSON(value?: TxVolumeList | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'window_size_seconds': value.window_size_seconds, + 'windows': ((value.windows as Array).map(TxVolumeToJSON)), + }; +} + + diff --git a/src/vendors/nexus/models/Validator.ts b/src/vendors/nexus/models/Validator.ts new file mode 100644 index 0000000000..8e5e566979 --- /dev/null +++ b/src/vendors/nexus/models/Validator.ts @@ -0,0 +1,168 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 { + Escrow, + EscrowFromJSON, + EscrowFromJSONTyped, + EscrowToJSON, + ValidatorCommissionBound, + ValidatorCommissionBoundFromJSON, + ValidatorCommissionBoundFromJSONTyped, + ValidatorCommissionBoundToJSON, + ValidatorMedia, + ValidatorMediaFromJSON, + ValidatorMediaFromJSONTyped, + ValidatorMediaToJSON, +} from './'; + +/** + * An validator registered at the consensus layer. + * @export + * @interface Validator + */ +export interface Validator { + /** + * The staking address identifying this validator. + * @type {string} + * @memberof Validator + */ + entity_address: string; + /** + * The public key identifying this validator. + * @type {string} + * @memberof Validator + */ + entity_id: string; + /** + * The public key identifying this validator's node. + * @type {string} + * @memberof Validator + */ + node_id?: string; + /** + * The escrow account data for this validator. + * @type {Escrow} + * @memberof Validator + */ + escrow: Escrow; + /** + * The voting power of this validator. + * @type {number} + * @memberof Validator + */ + voting_power: number; + /** + * The cumulative voting power of this validator and all other validators ranked higher than itself. + * @type {number} + * @memberof Validator + */ + voting_power_cumulative?: number; + /** + * Whether the entity has a node that is registered for being a validator, node is up to date, and has successfully registered itself. It may or may not be part of validator set. + * @type {boolean} + * @memberof Validator + */ + active: boolean; + /** + * The second-granular consensus time. + * @type {Date} + * @memberof Validator + */ + start_date: Date; + /** + * The rank of the validator, determined by voting power. + * @type {number} + * @memberof Validator + */ + rank: number; + /** + * Whether the entity is part of the validator set (top by stake among active entities). + * @type {boolean} + * @memberof Validator + */ + in_validator_set: boolean; + /** + * + * @type {ValidatorMedia} + * @memberof Validator + */ + media?: ValidatorMedia; + /** + * Commission rate. + * @type {number} + * @memberof Validator + */ + current_rate: number; + /** + * + * @type {ValidatorCommissionBound} + * @memberof Validator + */ + current_commission_bound: ValidatorCommissionBound; +} + +export function ValidatorFromJSON(json: any): Validator { + return ValidatorFromJSONTyped(json, false); +} + +export function ValidatorFromJSONTyped(json: any, ignoreDiscriminator: boolean): Validator { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'entity_address': json['entity_address'], + 'entity_id': json['entity_id'], + 'node_id': !exists(json, 'node_id') ? undefined : json['node_id'], + 'escrow': EscrowFromJSON(json['escrow']), + 'voting_power': json['voting_power'], + 'voting_power_cumulative': !exists(json, 'voting_power_cumulative') ? undefined : json['voting_power_cumulative'], + 'active': json['active'], + 'start_date': (new Date(json['start_date'])), + 'rank': json['rank'], + 'in_validator_set': json['in_validator_set'], + 'media': !exists(json, 'media') ? undefined : ValidatorMediaFromJSON(json['media']), + 'current_rate': json['current_rate'], + 'current_commission_bound': ValidatorCommissionBoundFromJSON(json['current_commission_bound']), + }; +} + +export function ValidatorToJSON(value?: Validator | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'entity_address': value.entity_address, + 'entity_id': value.entity_id, + 'node_id': value.node_id, + 'escrow': EscrowToJSON(value.escrow), + 'voting_power': value.voting_power, + 'voting_power_cumulative': value.voting_power_cumulative, + 'active': value.active, + 'start_date': (value.start_date.toISOString()), + 'rank': value.rank, + 'in_validator_set': value.in_validator_set, + 'media': ValidatorMediaToJSON(value.media), + 'current_rate': value.current_rate, + 'current_commission_bound': ValidatorCommissionBoundToJSON(value.current_commission_bound), + }; +} + + diff --git a/src/vendors/nexus/models/ValidatorAggStats.ts b/src/vendors/nexus/models/ValidatorAggStats.ts new file mode 100644 index 0000000000..f5921cfa86 --- /dev/null +++ b/src/vendors/nexus/models/ValidatorAggStats.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 ValidatorAggStats + */ +export interface ValidatorAggStats { + /** + * The total voting power across all validators. + * @type {number} + * @memberof ValidatorAggStats + */ + total_voting_power: number; + /** + * The total number of delegators in the network. + * @type {number} + * @memberof ValidatorAggStats + */ + total_delegators: number; + /** + * The total amount of token staked to validators. + * @type {string} + * @memberof ValidatorAggStats + */ + total_staked_balance: string; +} + +export function ValidatorAggStatsFromJSON(json: any): ValidatorAggStats { + return ValidatorAggStatsFromJSONTyped(json, false); +} + +export function ValidatorAggStatsFromJSONTyped(json: any, ignoreDiscriminator: boolean): ValidatorAggStats { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'total_voting_power': json['total_voting_power'], + 'total_delegators': json['total_delegators'], + 'total_staked_balance': json['total_staked_balance'], + }; +} + +export function ValidatorAggStatsToJSON(value?: ValidatorAggStats | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'total_voting_power': value.total_voting_power, + 'total_delegators': value.total_delegators, + 'total_staked_balance': value.total_staked_balance, + }; +} + + diff --git a/src/vendors/nexus/models/ValidatorCommissionBound.ts b/src/vendors/nexus/models/ValidatorCommissionBound.ts new file mode 100644 index 0000000000..47b09be5e8 --- /dev/null +++ b/src/vendors/nexus/models/ValidatorCommissionBound.ts @@ -0,0 +1,81 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 ValidatorCommissionBound + */ +export interface ValidatorCommissionBound { + /** + * + * @type {number} + * @memberof ValidatorCommissionBound + */ + lower: number; + /** + * + * @type {number} + * @memberof ValidatorCommissionBound + */ + upper: number; + /** + * + * @type {number} + * @memberof ValidatorCommissionBound + */ + epoch_start: number; + /** + * + * @type {number} + * @memberof ValidatorCommissionBound + */ + epoch_end: number; +} + +export function ValidatorCommissionBoundFromJSON(json: any): ValidatorCommissionBound { + return ValidatorCommissionBoundFromJSONTyped(json, false); +} + +export function ValidatorCommissionBoundFromJSONTyped(json: any, ignoreDiscriminator: boolean): ValidatorCommissionBound { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'lower': json['lower'], + 'upper': json['upper'], + 'epoch_start': json['epoch_start'], + 'epoch_end': json['epoch_end'], + }; +} + +export function ValidatorCommissionBoundToJSON(value?: ValidatorCommissionBound | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'lower': value.lower, + 'upper': value.upper, + 'epoch_start': value.epoch_start, + 'epoch_end': value.epoch_end, + }; +} + + diff --git a/src/vendors/nexus/models/ValidatorHistory.ts b/src/vendors/nexus/models/ValidatorHistory.ts new file mode 100644 index 0000000000..37b653cc81 --- /dev/null +++ b/src/vendors/nexus/models/ValidatorHistory.ts @@ -0,0 +1,97 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 { + List, + ListFromJSON, + ListFromJSONTyped, + ListToJSON, + ValidatorHistoryAllOf, + ValidatorHistoryAllOfFromJSON, + ValidatorHistoryAllOfFromJSONTyped, + ValidatorHistoryAllOfToJSON, + ValidatorHistoryPoint, + ValidatorHistoryPointFromJSON, + ValidatorHistoryPointFromJSONTyped, + ValidatorHistoryPointToJSON, +} from './'; + +/** + * + * @export + * @interface ValidatorHistory + */ +export interface ValidatorHistory { + /** + * The total number of records that match the query, i.e. the number of records + * the query would return with limit=infinity. + * @type {number} + * @memberof ValidatorHistory + */ + total_count: number; + /** + * Whether total_count is clipped for performance reasons. + * @type {boolean} + * @memberof ValidatorHistory + */ + is_total_count_clipped: boolean; + /** + * The staking address of the validator. + * @type {string} + * @memberof ValidatorHistory + */ + address?: string; + /** + * + * @type {Array} + * @memberof ValidatorHistory + */ + history: Array; +} + +export function ValidatorHistoryFromJSON(json: any): ValidatorHistory { + return ValidatorHistoryFromJSONTyped(json, false); +} + +export function ValidatorHistoryFromJSONTyped(json: any, ignoreDiscriminator: boolean): ValidatorHistory { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'total_count': json['total_count'], + 'is_total_count_clipped': json['is_total_count_clipped'], + 'address': !exists(json, 'address') ? undefined : json['address'], + 'history': ((json['history'] as Array).map(ValidatorHistoryPointFromJSON)), + }; +} + +export function ValidatorHistoryToJSON(value?: ValidatorHistory | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'total_count': value.total_count, + 'is_total_count_clipped': value.is_total_count_clipped, + 'address': value.address, + 'history': ((value.history as Array).map(ValidatorHistoryPointToJSON)), + }; +} + + diff --git a/src/vendors/nexus/models/ValidatorHistoryAllOf.ts b/src/vendors/nexus/models/ValidatorHistoryAllOf.ts new file mode 100644 index 0000000000..d59470f411 --- /dev/null +++ b/src/vendors/nexus/models/ValidatorHistoryAllOf.ts @@ -0,0 +1,72 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 { + ValidatorHistoryPoint, + ValidatorHistoryPointFromJSON, + ValidatorHistoryPointFromJSONTyped, + ValidatorHistoryPointToJSON, +} from './'; + +/** + * Historical escrow balance data for a single address. + * @export + * @interface ValidatorHistoryAllOf + */ +export interface ValidatorHistoryAllOf { + /** + * The staking address of the validator. + * @type {string} + * @memberof ValidatorHistoryAllOf + */ + address?: string; + /** + * + * @type {Array} + * @memberof ValidatorHistoryAllOf + */ + history: Array; +} + +export function ValidatorHistoryAllOfFromJSON(json: any): ValidatorHistoryAllOf { + return ValidatorHistoryAllOfFromJSONTyped(json, false); +} + +export function ValidatorHistoryAllOfFromJSONTyped(json: any, ignoreDiscriminator: boolean): ValidatorHistoryAllOf { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'address': !exists(json, 'address') ? undefined : json['address'], + 'history': ((json['history'] as Array).map(ValidatorHistoryPointFromJSON)), + }; +} + +export function ValidatorHistoryAllOfToJSON(value?: ValidatorHistoryAllOf | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'address': value.address, + 'history': ((value.history as Array).map(ValidatorHistoryPointToJSON)), + }; +} + + diff --git a/src/vendors/nexus/models/ValidatorHistoryPoint.ts b/src/vendors/nexus/models/ValidatorHistoryPoint.ts new file mode 100644 index 0000000000..68a40f1df9 --- /dev/null +++ b/src/vendors/nexus/models/ValidatorHistoryPoint.ts @@ -0,0 +1,103 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 ValidatorHistoryPoint + */ +export interface ValidatorHistoryPoint { + /** + * The epoch number. + * @type {number} + * @memberof ValidatorHistoryPoint + */ + epoch: number; + /** + * The amount of tokens that were delegated to this validator account, + * at the start of this epoch, and are NOT in the process of debonding. + * @type {string} + * @memberof ValidatorHistoryPoint + */ + active_balance?: string; + /** + * The shares of tokens that were delegated to this validator account, + * at the start of this epoch, and are NOT in the process of debonding. + * @type {string} + * @memberof ValidatorHistoryPoint + */ + active_shares?: string; + /** + * The amount of tokens that were delegated to this validator account + * at the start of this epoch, but are also in the process of debonding + * (i.e. they will be unstaked within ~2 weeks). + * @type {string} + * @memberof ValidatorHistoryPoint + */ + debonding_balance?: string; + /** + * The shares of tokens that were delegated to this validator account + * at the start of this epoch, but are also in the process of debonding + * (i.e. they will be unstaked within ~2 weeks). + * @type {string} + * @memberof ValidatorHistoryPoint + */ + debonding_shares?: string; + /** + * The number of accounts that have delegated token to this account. + * @type {number} + * @memberof ValidatorHistoryPoint + */ + num_delegators?: number; +} + +export function ValidatorHistoryPointFromJSON(json: any): ValidatorHistoryPoint { + return ValidatorHistoryPointFromJSONTyped(json, false); +} + +export function ValidatorHistoryPointFromJSONTyped(json: any, ignoreDiscriminator: boolean): ValidatorHistoryPoint { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'epoch': json['epoch'], + 'active_balance': !exists(json, 'active_balance') ? undefined : json['active_balance'], + 'active_shares': !exists(json, 'active_shares') ? undefined : json['active_shares'], + 'debonding_balance': !exists(json, 'debonding_balance') ? undefined : json['debonding_balance'], + 'debonding_shares': !exists(json, 'debonding_shares') ? undefined : json['debonding_shares'], + 'num_delegators': !exists(json, 'num_delegators') ? undefined : json['num_delegators'], + }; +} + +export function ValidatorHistoryPointToJSON(value?: ValidatorHistoryPoint | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'epoch': value.epoch, + 'active_balance': value.active_balance, + 'active_shares': value.active_shares, + 'debonding_balance': value.debonding_balance, + 'debonding_shares': value.debonding_shares, + 'num_delegators': value.num_delegators, + }; +} + + diff --git a/src/vendors/nexus/models/ValidatorList.ts b/src/vendors/nexus/models/ValidatorList.ts new file mode 100644 index 0000000000..4151571d9f --- /dev/null +++ b/src/vendors/nexus/models/ValidatorList.ts @@ -0,0 +1,101 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 { + List, + ListFromJSON, + ListFromJSONTyped, + ListToJSON, + Validator, + ValidatorFromJSON, + ValidatorFromJSONTyped, + ValidatorToJSON, + ValidatorAggStats, + ValidatorAggStatsFromJSON, + ValidatorAggStatsFromJSONTyped, + ValidatorAggStatsToJSON, + ValidatorListAllOf, + ValidatorListAllOfFromJSON, + ValidatorListAllOfFromJSONTyped, + ValidatorListAllOfToJSON, +} from './'; + +/** + * + * @export + * @interface ValidatorList + */ +export interface ValidatorList { + /** + * The total number of records that match the query, i.e. the number of records + * the query would return with limit=infinity. + * @type {number} + * @memberof ValidatorList + */ + total_count: number; + /** + * Whether total_count is clipped for performance reasons. + * @type {boolean} + * @memberof ValidatorList + */ + is_total_count_clipped: boolean; + /** + * + * @type {Array} + * @memberof ValidatorList + */ + validators: Array; + /** + * Summary statistics across all consensus validators. + * @type {ValidatorAggStats} + * @memberof ValidatorList + */ + stats: ValidatorAggStats; +} + +export function ValidatorListFromJSON(json: any): ValidatorList { + return ValidatorListFromJSONTyped(json, false); +} + +export function ValidatorListFromJSONTyped(json: any, ignoreDiscriminator: boolean): ValidatorList { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'total_count': json['total_count'], + 'is_total_count_clipped': json['is_total_count_clipped'], + 'validators': ((json['validators'] as Array).map(ValidatorFromJSON)), + 'stats': ValidatorAggStatsFromJSON(json['stats']), + }; +} + +export function ValidatorListToJSON(value?: ValidatorList | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'total_count': value.total_count, + 'is_total_count_clipped': value.is_total_count_clipped, + 'validators': ((value.validators as Array).map(ValidatorToJSON)), + 'stats': ValidatorAggStatsToJSON(value.stats), + }; +} + + diff --git a/src/vendors/nexus/models/ValidatorListAllOf.ts b/src/vendors/nexus/models/ValidatorListAllOf.ts new file mode 100644 index 0000000000..8c31a4d0b3 --- /dev/null +++ b/src/vendors/nexus/models/ValidatorListAllOf.ts @@ -0,0 +1,77 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 { + Validator, + ValidatorFromJSON, + ValidatorFromJSONTyped, + ValidatorToJSON, + ValidatorAggStats, + ValidatorAggStatsFromJSON, + ValidatorAggStatsFromJSONTyped, + ValidatorAggStatsToJSON, +} from './'; + +/** + * A list of validators registered at the consensus layer, plus summary + * statistics across all consensus validators. + * @export + * @interface ValidatorListAllOf + */ +export interface ValidatorListAllOf { + /** + * + * @type {Array} + * @memberof ValidatorListAllOf + */ + validators: Array; + /** + * Summary statistics across all consensus validators. + * @type {ValidatorAggStats} + * @memberof ValidatorListAllOf + */ + stats: ValidatorAggStats; +} + +export function ValidatorListAllOfFromJSON(json: any): ValidatorListAllOf { + return ValidatorListAllOfFromJSONTyped(json, false); +} + +export function ValidatorListAllOfFromJSONTyped(json: any, ignoreDiscriminator: boolean): ValidatorListAllOf { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'validators': ((json['validators'] as Array).map(ValidatorFromJSON)), + 'stats': ValidatorAggStatsFromJSON(json['stats']), + }; +} + +export function ValidatorListAllOfToJSON(value?: ValidatorListAllOf | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'validators': ((value.validators as Array).map(ValidatorToJSON)), + 'stats': ValidatorAggStatsToJSON(value.stats), + }; +} + + diff --git a/src/vendors/nexus/models/ValidatorMedia.ts b/src/vendors/nexus/models/ValidatorMedia.ts new file mode 100644 index 0000000000..ff20df6b8d --- /dev/null +++ b/src/vendors/nexus/models/ValidatorMedia.ts @@ -0,0 +1,97 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 ValidatorMedia + */ +export interface ValidatorMedia { + /** + * An URL associated with the entity. + * @type {string} + * @memberof ValidatorMedia + */ + url?: string; + /** + * An email address associated with the entity. + * @type {string} + * @memberof ValidatorMedia + */ + email?: string; + /** + * Twitter handle. + * @type {string} + * @memberof ValidatorMedia + */ + twitter?: string; + /** + * Keybase handle. + * @type {string} + * @memberof ValidatorMedia + */ + keybase?: string; + /** + * The human-readable name of this entity. + * @type {string} + * @memberof ValidatorMedia + */ + name?: string; + /** + * URL to a logo image for the entity. + * @type {string} + * @memberof ValidatorMedia + */ + logoUrl?: string; +} + +export function ValidatorMediaFromJSON(json: any): ValidatorMedia { + return ValidatorMediaFromJSONTyped(json, false); +} + +export function ValidatorMediaFromJSONTyped(json: any, ignoreDiscriminator: boolean): ValidatorMedia { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'url': !exists(json, 'url') ? undefined : json['url'], + 'email': !exists(json, 'email') ? undefined : json['email'], + 'twitter': !exists(json, 'twitter') ? undefined : json['twitter'], + 'keybase': !exists(json, 'keybase') ? undefined : json['keybase'], + 'name': !exists(json, 'name') ? undefined : json['name'], + 'logoUrl': !exists(json, 'logoUrl') ? undefined : json['logoUrl'], + }; +} + +export function ValidatorMediaToJSON(value?: ValidatorMedia | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'url': value.url, + 'email': value.email, + 'twitter': value.twitter, + 'keybase': value.keybase, + 'name': value.name, + 'logoUrl': value.logoUrl, + }; +} + + diff --git a/src/vendors/nexus/models/ValidatorsResponse.ts b/src/vendors/nexus/models/ValidatorsResponse.ts new file mode 100644 index 0000000000..945b8598c8 --- /dev/null +++ b/src/vendors/nexus/models/ValidatorsResponse.ts @@ -0,0 +1,76 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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 { + ValidatorAggStats, + ValidatorAggStatsFromJSON, + ValidatorAggStatsFromJSONTyped, + ValidatorAggStatsToJSON, + ValidatorList, + ValidatorListFromJSON, + ValidatorListFromJSONTyped, + ValidatorListToJSON, +} from './'; + +/** + * + * @export + * @interface ValidatorsResponse + */ +export interface ValidatorsResponse { + /** + * + * @type {ValidatorList} + * @memberof ValidatorsResponse + */ + validator_list: ValidatorList; + /** + * Summary statistics across all consensus validators. + * @type {ValidatorAggStats} + * @memberof ValidatorsResponse + */ + stats: ValidatorAggStats; +} + +export function ValidatorsResponseFromJSON(json: any): ValidatorsResponse { + return ValidatorsResponseFromJSONTyped(json, false); +} + +export function ValidatorsResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ValidatorsResponse { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'validator_list': ValidatorListFromJSON(json['validator_list']), + 'stats': ValidatorAggStatsFromJSON(json['stats']), + }; +} + +export function ValidatorsResponseToJSON(value?: ValidatorsResponse | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'validator_list': ValidatorListToJSON(value.validator_list), + 'stats': ValidatorAggStatsToJSON(value.stats), + }; +} + + diff --git a/src/vendors/nexus/models/VerificationLevel.ts b/src/vendors/nexus/models/VerificationLevel.ts new file mode 100644 index 0000000000..a9778069b8 --- /dev/null +++ b/src/vendors/nexus/models/VerificationLevel.ts @@ -0,0 +1,38 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * The level of verification of a smart contract, as defined by Sourcify. + * An absence of this field means that the contract has not been verified. + * See also https://docs.sourcify.dev/docs/full-vs-partial-match/ + * @export + * @enum {string} + */ +export enum VerificationLevel { + Partial = 'partial', + Full = 'full' +} + +export function VerificationLevelFromJSON(json: any): VerificationLevel { + return VerificationLevelFromJSONTyped(json, false); +} + +export function VerificationLevelFromJSONTyped(json: any, ignoreDiscriminator: boolean): VerificationLevel { + return json as VerificationLevel; +} + +export function VerificationLevelToJSON(value?: VerificationLevel | null): any { + return value as any; +} + diff --git a/src/vendors/nexus/models/index.ts b/src/vendors/nexus/models/index.ts new file mode 100644 index 0000000000..b9709f7080 --- /dev/null +++ b/src/vendors/nexus/models/index.ts @@ -0,0 +1,96 @@ +export * from './Account' +export * from './AccountList' +export * from './AccountListAllOf' +export * from './AccountStats' +export * from './ActiveAccounts' +export * from './ActiveAccountsList' +export * from './AddressDerivationContext' +export * from './AddressPreimage' +export * from './Allowance' +export * from './BareTokenHolder' +export * from './Block' +export * from './BlockList' +export * from './BlockListAllOf' +export * from './ConsensusEvent' +export * from './ConsensusEventList' +export * from './ConsensusEventListAllOf' +export * from './ConsensusEventType' +export * from './ConsensusTxMethod' +export * from './DebondingDelegation' +export * from './DebondingDelegationList' +export * from './DebondingDelegationListAllOf' +export * from './Delegation' +export * from './DelegationList' +export * from './DelegationListAllOf' +export * from './Entity' +export * from './EntityList' +export * from './EntityListAllOf' +export * from './Epoch' +export * from './EpochList' +export * from './EpochListAllOf' +export * from './Escrow' +export * from './EvmAbiParam' +export * from './EvmEventToken' +export * from './EvmNft' +export * from './EvmNftList' +export * from './EvmNftListAllOf' +export * from './EvmToken' +export * from './EvmTokenList' +export * from './EvmTokenListAllOf' +export * from './EvmTokenType' +export * from './InlineResponse400' +export * from './Layer' +export * from './List' +export * from './Node' +export * from './NodeList' +export * from './NodeListAllOf' +export * from './Proposal' +export * from './ProposalList' +export * from './ProposalListAllOf' +export * from './ProposalState' +export * from './ProposalTarget' +export * from './ProposalVote' +export * from './ProposalVotes' +export * from './ProposalVotesAllOf' +export * from './RoothashMessage' +export * from './RoothashMessageList' +export * from './RoothashMessageListAllOf' +export * from './RoothashMessageType' +export * from './Runtime' +export * from './RuntimeAccount' +export * from './RuntimeBlock' +export * from './RuntimeBlockList' +export * from './RuntimeBlockListAllOf' +export * from './RuntimeEvent' +export * from './RuntimeEventList' +export * from './RuntimeEventListAllOf' +export * from './RuntimeEventType' +export * from './RuntimeEvmBalance' +export * from './RuntimeEvmContract' +export * from './RuntimeEvmContractVerification' +export * from './RuntimeSdkBalance' +export * from './RuntimeStatus' +export * from './RuntimeTransaction' +export * from './RuntimeTransactionEncryptionEnvelope' +export * from './RuntimeTransactionList' +export * from './RuntimeTransactionListAllOf' +export * from './Status' +export * from './TokenHolderList' +export * from './TokenHolderListAllOf' +export * from './Transaction' +export * from './TransactionList' +export * from './TransactionListAllOf' +export * from './TxError' +export * from './TxVolume' +export * from './TxVolumeList' +export * from './Validator' +export * from './ValidatorAggStats' +export * from './ValidatorCommissionBound' +export * from './ValidatorHistory' +export * from './ValidatorHistoryAllOf' +export * from './ValidatorHistoryPoint' +export * from './ValidatorList' +export * from './ValidatorListAllOf' +export * from './ValidatorMedia' +export * from './ValidatorsResponse' +export * from './VerificationLevel' diff --git a/src/vendors/nexus/openapi.json b/src/vendors/nexus/openapi.json new file mode 100644 index 0000000000..c8da170abb --- /dev/null +++ b/src/vendors/nexus/openapi.json @@ -0,0 +1,5501 @@ +{ + "openapi": "3.0.3", + "info": { + "title": "Oasis Nexus API V1", + "description": "An API for accessing indexed data from the Oasis Network.\n\n\n# Endpoints\n", + "version": "0.1.0" + }, + "servers": [ + { + "url": "https://nexus.oasis.io/v1", + "description": "Mainnet index endpoint." + }, + { + "url": "https://testnet.nexus.oasis.io/v1", + "description": "Testnet index endpoint." + } + ], + "x-query-params": [ + { + "in": "query", + "name": "offset", + "schema": { + "type": "integer", + "format": "uint64", + "default": 0 + }, + "description": "The number of items to skip before starting to collect the result set.\n" + }, + { + "in": "query", + "name": "limit", + "schema": { + "type": "integer", + "format": "uint64", + "default": 100, + "minimum": 1, + "maximum": 1000 + }, + "description": "The maximum numbers of items to return.\n" + }, + { + "in": "query", + "name": "height", + "schema": { + "type": "integer", + "format": "int64" + }, + "description": "The block height from which to query state. Oasis Nexus does not\nmake any guarantees about availability of historical state data.\n" + }, + { + "in": "path", + "name": "runtime", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/Runtime" + } + ] + }, + "description": "The runtime which to query.\n" + }, + { + "in": "query", + "name": "window_size_seconds", + "schema": { + "type": "integer", + "format": "uint32", + "default": 86400 + }, + "description": "The size of windows into which the statistic is grouped, in seconds.\nThe backend supports a limited number of window sizes: 300 (5 minutes) and\n86400 (1 day). Requests with other values may be rejected.\n" + }, + { + "in": "query", + "name": "window_step_seconds", + "schema": { + "type": "integer", + "format": "uint32", + "default": 86400 + }, + "description": "The size of the step between returned statistic windows, in seconds.\nThe backend supports a limited number of step sizes: 300 (5 minutes) and\n86400 (1 day). Requests with other values may be rejected.\n" + } + ], + "x-examples": { + "block-height": [8048956, 8049555], + "block-hash": ["0a29ac21fa69bb9e43e5cb25d10826ff3946f1ce977e82f99a2614206a50765c"], + "state-root": ["8e39bf193f8a954ab8f8d7cb6388c591fd0785ea060bbd8e3752e266b54499d3"], + "tx-hash": ["0d0531d6b8a468c07440182b1cdda517f5a076d69fb2199126a83082ecfc0f41"], + "tx-body": ["{\"amount\":\"1000000000\",\"account\":\"oasis1qpg2xuz46g53737343r20yxeddhlvc2ldqsjh70p\"}"], + "parameters-change": [ + "{\"min_validators\":null,\"max_validators\":\"120\",\"voting_power_distribution\":null}" + ], + "epoch": [13402, 13403], + "event-type": ["staking.escrow.take"], + "roothash-message-type": ["staking.transfer"], + "entity-id": ["gb8SHLeDc69Elk7OTfqhtVgE2sqxrBCDQI84xKR+Bjg="], + "node-id": ["lbxs4hlud9XNloIOdhJPaCahd7HtiY8QATCgGnFfCM0="], + "staking-address": [ + "oasis1qpg2xuz46g53737343r20yxeddhlvc2ldqsjh70p", + "oasis1qprtzrg97jk0wxnqkhxwyzy5qys47r7alvfl3fcg" + ], + "eth-address": [1.2367698861069356e48], + "proposal-id": [1], + "proposal-state": ["active"], + "runtime-block-round": [3283246], + "runtime-block-hash": ["21c243cd34bedfc234f1b45615d10a868f0655f59578f063a7d2fc8c6e5b4009"], + "runtime-event-type": ["consensus_accounts.deposit"], + "iso-timestamp": ["2022-03-01T00:00:00Z", "2019-04-01T00:00:00Z", "2022-10-15T00:05:34Z"], + "time-duration": ["72h3m0.5s"], + "validator-media": [ + "{\"email\":\"validator@example.net\",\"keybase\":\"validator_keybase\",\"name\":\"Example Validator\",\"twitter\":\"validator_twitter\",\"url\":\"https://example.com\",\"logoUrl\": \"https://example.com/logo.png\"}" + ] + }, + "x-err-responses": { + "common-errors": { + "400": { + "$ref": "#/components/responses/HumanReadableError" + }, + "404": { + "$ref": "#/components/responses/NotFoundError" + }, + "500": { + "$ref": "#/components/responses/HumanReadableError" + } + } + }, + "paths": { + "/": { + "get": { + "operationId": "getStatus", + "summary": "Returns the status of indexing.", + "responses": { + "200": { + "description": "A JSON object containing status metadata.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Status" + } + } + } + }, + "400": { + "$ref": "#/components/responses/HumanReadableError" + }, + "404": { + "$ref": "#/components/responses/NotFoundError" + }, + "500": { + "$ref": "#/components/responses/HumanReadableError" + } + } + } + }, + "/consensus/blocks": { + "get": { + "summary": "Returns a list of consensus blocks, sorted from most to least recent.", + "parameters": [ + { + "in": "query", + "name": "limit", + "schema": { + "type": "integer", + "format": "uint64", + "default": 100, + "minimum": 1, + "maximum": 1000 + }, + "description": "The maximum numbers of items to return.\n" + }, + { + "in": "query", + "name": "offset", + "schema": { + "type": "integer", + "format": "uint64", + "default": 0 + }, + "description": "The number of items to skip before starting to collect the result set.\n" + }, + { + "in": "query", + "name": "from", + "schema": { + "type": "integer", + "format": "int64" + }, + "description": "A filter on minimum block height, inclusive.", + "example": 8048956 + }, + { + "in": "query", + "name": "to", + "schema": { + "type": "integer", + "format": "int64" + }, + "description": "A filter on maximum block height, inclusive.", + "example": 8049555 + }, + { + "in": "query", + "name": "after", + "schema": { + "type": "string", + "format": "date-time" + }, + "description": "A filter on minimum block time, inclusive.", + "example": "2022-03-01T00:00:00Z" + }, + { + "in": "query", + "name": "before", + "schema": { + "type": "string", + "format": "date-time" + }, + "description": "A filter on maximum block time, exclusive.", + "example": "2019-04-01T00:00:00Z" + }, + { + "in": "query", + "name": "hash", + "schema": { + "type": "string" + }, + "description": "A filter on the block hash.", + "example": "0a29ac21fa69bb9e43e5cb25d10826ff3946f1ce977e82f99a2614206a50765c" + } + ], + "responses": { + "200": { + "description": "A JSON object containing a list of consensus blocks.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BlockList" + } + } + } + }, + "400": { + "$ref": "#/components/responses/HumanReadableError" + }, + "404": { + "$ref": "#/components/responses/NotFoundError" + }, + "500": { + "$ref": "#/components/responses/HumanReadableError" + } + } + } + }, + "/consensus/blocks/{height}": { + "get": { + "summary": "Returns a consensus block.", + "parameters": [ + { + "in": "path", + "name": "height", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + }, + "description": "The block height of the block to return.", + "example": 8048956 + } + ], + "responses": { + "200": { + "description": "A JSON object containing a consensus block.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Block" + } + } + } + }, + "400": { + "$ref": "#/components/responses/HumanReadableError" + }, + "404": { + "$ref": "#/components/responses/NotFoundError" + }, + "500": { + "$ref": "#/components/responses/HumanReadableError" + } + } + } + }, + "/consensus/transactions": { + "get": { + "summary": "Returns a list of consensus transactions.", + "parameters": [ + { + "in": "query", + "name": "limit", + "schema": { + "type": "integer", + "format": "uint64", + "default": 100, + "minimum": 1, + "maximum": 1000 + }, + "description": "The maximum numbers of items to return.\n" + }, + { + "in": "query", + "name": "offset", + "schema": { + "type": "integer", + "format": "uint64", + "default": 0 + }, + "description": "The number of items to skip before starting to collect the result set.\n" + }, + { + "in": "query", + "name": "block", + "schema": { + "type": "integer", + "format": "int64" + }, + "description": "A filter on block height.", + "example": 8048956 + }, + { + "in": "query", + "name": "method", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ConsensusTxMethod" + } + ] + }, + "description": "A filter on transaction method." + }, + { + "in": "query", + "name": "sender", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/StakingAddress" + } + ] + }, + "description": "A filter on transaction sender." + }, + { + "in": "query", + "name": "rel", + "schema": { + "type": "string" + }, + "description": "A filter on related accounts.", + "example": "oasis1qpg2xuz46g53737343r20yxeddhlvc2ldqsjh70p" + }, + { + "in": "query", + "name": "after", + "schema": { + "type": "string", + "format": "date-time" + }, + "description": "A filter on minimum transaction time, inclusive.", + "example": "2022-03-01T00:00:00Z" + }, + { + "in": "query", + "name": "before", + "schema": { + "type": "string", + "format": "date-time" + }, + "description": "A filter on maximum transaction time, exclusive.", + "example": "2019-04-01T00:00:00Z" + } + ], + "responses": { + "200": { + "description": "A JSON object containing a list of consensus transactions.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TransactionList" + } + } + } + }, + "400": { + "$ref": "#/components/responses/HumanReadableError" + }, + "404": { + "$ref": "#/components/responses/NotFoundError" + }, + "500": { + "$ref": "#/components/responses/HumanReadableError" + } + } + } + }, + "/consensus/transactions/{tx_hash}": { + "get": { + "summary": "Returns a consensus transaction.", + "parameters": [ + { + "in": "path", + "name": "tx_hash", + "required": true, + "schema": { + "type": "string" + }, + "description": "The transaction hash of the transaction to return.", + "example": "0d0531d6b8a468c07440182b1cdda517f5a076d69fb2199126a83082ecfc0f41" + } + ], + "responses": { + "200": { + "description": "A JSON object containing a consensus transaction.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Transaction" + } + } + } + }, + "400": { + "$ref": "#/components/responses/HumanReadableError" + }, + "404": { + "$ref": "#/components/responses/NotFoundError" + }, + "500": { + "$ref": "#/components/responses/HumanReadableError" + } + } + } + }, + "/consensus/events": { + "get": { + "summary": "Returns a list of consensus events.", + "parameters": [ + { + "in": "query", + "name": "limit", + "schema": { + "type": "integer", + "format": "uint64", + "default": 100, + "minimum": 1, + "maximum": 1000 + }, + "description": "The maximum numbers of items to return.\n" + }, + { + "in": "query", + "name": "offset", + "schema": { + "type": "integer", + "format": "uint64", + "default": 0 + }, + "description": "The number of items to skip before starting to collect the result set.\n" + }, + { + "in": "query", + "name": "block", + "schema": { + "type": "integer", + "format": "int64" + }, + "description": "A filter on block height.", + "example": 8048956 + }, + { + "in": "query", + "name": "tx_index", + "schema": { + "type": "integer", + "format": "int32" + }, + "description": "A filter on transaction index. The returned events all need to originate\nfrom a transaction that appeared in `tx_index`-th position in the block.\nIt is invalid to specify this filter without also specifying a `block`.\nSpecifying `tx_index` and `block` is an alternative to specifying `tx_hash`;\neither works to fetch events from a specific transaction.\n", + "example": 3 + }, + { + "in": "query", + "name": "tx_hash", + "schema": { + "type": "string" + }, + "description": "A filter on the hash of the transaction that originated the events.\nSpecifying `tx_index` and `block` is an alternative to specifying `tx_hash`;\neither works to fetch events from a specific transaction.\n", + "example": "0d0531d6b8a468c07440182b1cdda517f5a076d69fb2199126a83082ecfc0f41" + }, + { + "in": "query", + "name": "rel", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/StakingAddress" + } + ] + }, + "description": "A filter on related accounts. Every returned event will refer to\nthis account. For example, for a `Transfer` event, this will be the\nthe sender or the recipient of tokens.\n" + }, + { + "in": "query", + "name": "type", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ConsensusEventType" + } + ] + }, + "description": "A filter on the event type.", + "example": "staking.escrow.take" + } + ], + "responses": { + "200": { + "description": "Consensus events matching the filters, sorted by most recent first.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConsensusEventList" + } + } + } + }, + "400": { + "$ref": "#/components/responses/HumanReadableError" + }, + "404": { + "$ref": "#/components/responses/NotFoundError" + }, + "500": { + "$ref": "#/components/responses/HumanReadableError" + } + } + } + }, + "/consensus/roothash_messages": { + "get": { + "parameters": [ + { + "in": "query", + "name": "limit", + "schema": { + "type": "integer", + "format": "uint64", + "default": 100, + "minimum": 1, + "maximum": 1000 + }, + "description": "The maximum numbers of items to return.\n" + }, + { + "in": "query", + "name": "offset", + "schema": { + "type": "integer", + "format": "uint64", + "default": 0 + }, + "description": "The number of items to skip before starting to collect the result set.\n" + }, + { + "in": "query", + "name": "runtime", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/Runtime" + } + ] + } + }, + { + "in": "query", + "name": "round", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "in": "query", + "name": "type", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/RoothashMessageType" + } + ] + } + }, + { + "in": "query", + "name": "rel", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/StakingAddress" + } + ] + } + } + ], + "responses": { + "200": { + "description": "A JSON object containing a list of roothash messages.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RoothashMessageList" + } + } + } + }, + "400": { + "$ref": "#/components/responses/HumanReadableError" + }, + "404": { + "$ref": "#/components/responses/NotFoundError" + }, + "500": { + "$ref": "#/components/responses/HumanReadableError" + } + } + } + }, + "/consensus/entities": { + "get": { + "summary": "Returns a list of entities registered at the consensus layer.", + "parameters": [ + { + "in": "query", + "name": "limit", + "schema": { + "type": "integer", + "format": "uint64", + "default": 100, + "minimum": 1, + "maximum": 1000 + }, + "description": "The maximum numbers of items to return.\n" + }, + { + "in": "query", + "name": "offset", + "schema": { + "type": "integer", + "format": "uint64", + "default": 0 + }, + "description": "The number of items to skip before starting to collect the result set.\n" + } + ], + "responses": { + "200": { + "description": "A JSON object containing a list of entities registered\nat the consensus layer.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EntityList" + } + } + } + }, + "400": { + "$ref": "#/components/responses/HumanReadableError" + }, + "404": { + "$ref": "#/components/responses/NotFoundError" + }, + "500": { + "$ref": "#/components/responses/HumanReadableError" + } + } + } + }, + "/consensus/entities/{address}": { + "get": { + "summary": "Returns an entity registered at the consensus layer.", + "parameters": [ + { + "in": "path", + "name": "address", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/StakingAddress" + } + ] + }, + "description": "The address of the entity to return." + } + ], + "responses": { + "200": { + "description": "A JSON object containing an entity registered\nat the consensus layer.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Entity" + } + } + } + }, + "400": { + "$ref": "#/components/responses/HumanReadableError" + }, + "404": { + "$ref": "#/components/responses/NotFoundError" + }, + "500": { + "$ref": "#/components/responses/HumanReadableError" + } + } + } + }, + "/consensus/entities/{address}/nodes": { + "get": { + "summary": "Returns a list of nodes registered at the consensus layer.", + "parameters": [ + { + "in": "query", + "name": "limit", + "schema": { + "type": "integer", + "format": "uint64", + "default": 100, + "minimum": 1, + "maximum": 1000 + }, + "description": "The maximum numbers of items to return.\n" + }, + { + "in": "query", + "name": "offset", + "schema": { + "type": "integer", + "format": "uint64", + "default": 0 + }, + "description": "The number of items to skip before starting to collect the result set.\n" + }, + { + "in": "path", + "name": "address", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/StakingAddress" + } + ] + }, + "description": "The address of the controlling entity of the nodes to return.\n" + } + ], + "responses": { + "200": { + "description": "A JSON object containing a list of nodes registered at the consensus layer.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NodeList" + } + } + } + }, + "400": { + "$ref": "#/components/responses/HumanReadableError" + }, + "404": { + "$ref": "#/components/responses/NotFoundError" + }, + "500": { + "$ref": "#/components/responses/HumanReadableError" + } + } + } + }, + "/consensus/entities/{address}/nodes/{node_id}": { + "get": { + "summary": "Returns a node registered at the consensus layer.", + "parameters": [ + { + "in": "path", + "name": "address", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/StakingAddress" + } + ] + }, + "description": "The entity ID of the entity controlling the node to return.\n", + "example": "oasis1qpg2xuz46g53737343r20yxeddhlvc2ldqsjh70p" + }, + { + "in": "path", + "name": "node_id", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/Ed25519PubKey" + } + ] + }, + "description": "The node ID of the node to return." + } + ], + "responses": { + "200": { + "description": "A JSON object containing a node registered at the consensus layer.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Node" + } + } + } + }, + "400": { + "$ref": "#/components/responses/HumanReadableError" + }, + "404": { + "$ref": "#/components/responses/NotFoundError" + }, + "500": { + "$ref": "#/components/responses/HumanReadableError" + } + } + } + }, + "/consensus/validators": { + "get": { + "summary": "Returns a list of validators registered at the consensus layer (the list includes all registered entities, even those without a currently active validator node).", + "parameters": [ + { + "in": "query", + "name": "limit", + "schema": { + "type": "integer", + "format": "uint64", + "default": 100, + "minimum": 1, + "maximum": 1000 + }, + "description": "The maximum numbers of items to return.\n" + }, + { + "in": "query", + "name": "offset", + "schema": { + "type": "integer", + "format": "uint64", + "default": 0 + }, + "description": "The number of items to skip before starting to collect the result set.\n" + }, + { + "in": "query", + "name": "name", + "schema": { + "type": "string" + }, + "description": "A filter on the validator name. Every returned validator will have\na name that is a superstring of the input param.\n" + } + ], + "responses": { + "200": { + "description": "A JSON object containing a list of validators registered\nat the consensus layer.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ValidatorList" + } + } + } + }, + "400": { + "$ref": "#/components/responses/HumanReadableError" + }, + "404": { + "$ref": "#/components/responses/NotFoundError" + }, + "500": { + "$ref": "#/components/responses/HumanReadableError" + } + } + } + }, + "/consensus/validators/{address}": { + "get": { + "summary": "Returns a validator registered at the consensus layer.", + "parameters": [ + { + "in": "path", + "name": "address", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/StakingAddress" + } + ] + }, + "description": "The address of the entity to return." + } + ], + "responses": { + "200": { + "description": "A JSON object containing a validator registered at the\nconsensus layer.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ValidatorList" + } + } + } + }, + "400": { + "$ref": "#/components/responses/HumanReadableError" + }, + "404": { + "$ref": "#/components/responses/NotFoundError" + }, + "500": { + "$ref": "#/components/responses/HumanReadableError" + } + } + } + }, + "/consensus/validators/{address}/history": { + "get": { + "summary": "Returns historical information for a single validator.", + "parameters": [ + { + "in": "query", + "name": "limit", + "schema": { + "type": "integer", + "format": "uint64", + "default": 100, + "minimum": 1, + "maximum": 1000 + }, + "description": "The maximum numbers of items to return.\n" + }, + { + "in": "query", + "name": "offset", + "schema": { + "type": "integer", + "format": "uint64", + "default": 0 + }, + "description": "The number of items to skip before starting to collect the result set.\n" + }, + { + "in": "query", + "name": "from", + "schema": { + "type": "integer", + "format": "int64" + }, + "description": "A filter on minimum epoch number, inclusive.", + "example": 13402 + }, + { + "in": "query", + "name": "to", + "schema": { + "type": "integer", + "format": "int64" + }, + "description": "A filter on maximum epoch number, inclusive.", + "example": 13403 + }, + { + "in": "path", + "name": "address", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/StakingAddress" + } + ] + }, + "description": "The address of the entity to return." + } + ], + "responses": { + "200": { + "description": "A JSON object containing historical information for a \nvalidator, grouped by epoch in reverse chronological order.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ValidatorHistory" + } + } + } + }, + "400": { + "$ref": "#/components/responses/HumanReadableError" + }, + "404": { + "$ref": "#/components/responses/NotFoundError" + }, + "500": { + "$ref": "#/components/responses/HumanReadableError" + } + } + } + }, + "/consensus/accounts": { + "get": { + "summary": "Returns a list of consensus layer accounts.\nNote that for performance reasons, the info returned by this endpoint\nmay be slightly stale (<2 minutes). For the most up-to-date account state,\nquery the single-account endpoint.\n", + "parameters": [ + { + "in": "query", + "name": "limit", + "schema": { + "type": "integer", + "format": "uint64", + "default": 100, + "minimum": 1, + "maximum": 1000 + }, + "description": "The maximum numbers of items to return.\n" + }, + { + "in": "query", + "name": "offset", + "schema": { + "type": "integer", + "format": "uint64", + "default": 0 + }, + "description": "The number of items to skip before starting to collect the result set.\n" + } + ], + "responses": { + "200": { + "description": "A JSON object containing a list of consensus layer accounts.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AccountList" + } + } + } + }, + "400": { + "$ref": "#/components/responses/HumanReadableError" + }, + "404": { + "$ref": "#/components/responses/NotFoundError" + }, + "500": { + "$ref": "#/components/responses/HumanReadableError" + } + } + } + }, + "/consensus/accounts/{address}": { + "get": { + "summary": "Returns a consensus layer account.", + "parameters": [ + { + "in": "path", + "name": "address", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/StakingAddress" + } + ] + }, + "description": "The staking address of the account to return." + } + ], + "responses": { + "200": { + "description": "A JSON object containing a consensus layer account.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Account" + } + } + } + }, + "400": { + "$ref": "#/components/responses/HumanReadableError" + }, + "404": { + "$ref": "#/components/responses/NotFoundError" + }, + "500": { + "$ref": "#/components/responses/HumanReadableError" + } + } + } + }, + "/consensus/accounts/{address}/delegations": { + "get": { + "summary": "Returns an account's delegations.", + "parameters": [ + { + "in": "query", + "name": "limit", + "schema": { + "type": "integer", + "format": "uint64", + "default": 100, + "minimum": 1, + "maximum": 1000 + }, + "description": "The maximum numbers of items to return.\n" + }, + { + "in": "query", + "name": "offset", + "schema": { + "type": "integer", + "format": "uint64", + "default": 0 + }, + "description": "The number of items to skip before starting to collect the result set.\n" + }, + { + "in": "path", + "name": "address", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/StakingAddress" + } + ] + }, + "description": "The staking address of the account that delegated." + } + ], + "responses": { + "200": { + "description": "A JSON object containing a list of delegations.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DelegationList" + } + } + } + }, + "400": { + "$ref": "#/components/responses/HumanReadableError" + }, + "404": { + "$ref": "#/components/responses/NotFoundError" + }, + "500": { + "$ref": "#/components/responses/HumanReadableError" + } + } + } + }, + "/consensus/accounts/{address}/delegations_to": { + "get": { + "summary": "Returns a list of delegations to an account.", + "parameters": [ + { + "in": "query", + "name": "limit", + "schema": { + "type": "integer", + "format": "uint64", + "default": 100, + "minimum": 1, + "maximum": 1000 + }, + "description": "The maximum numbers of items to return.\n" + }, + { + "in": "query", + "name": "offset", + "schema": { + "type": "integer", + "format": "uint64", + "default": 0 + }, + "description": "The number of items to skip before starting to collect the result set.\n" + }, + { + "in": "path", + "name": "address", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/StakingAddress" + } + ] + }, + "description": "The staking address of the account that is being delegated to." + } + ], + "responses": { + "200": { + "description": "A JSON object containing a list of delegations.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DelegationList" + } + } + } + }, + "400": { + "$ref": "#/components/responses/HumanReadableError" + }, + "404": { + "$ref": "#/components/responses/NotFoundError" + }, + "500": { + "$ref": "#/components/responses/HumanReadableError" + } + } + } + }, + "/consensus/accounts/{address}/debonding_delegations": { + "get": { + "summary": "Returns an account's debonding delegations.", + "parameters": [ + { + "in": "query", + "name": "limit", + "schema": { + "type": "integer", + "format": "uint64", + "default": 100, + "minimum": 1, + "maximum": 1000 + }, + "description": "The maximum numbers of items to return.\n" + }, + { + "in": "query", + "name": "offset", + "schema": { + "type": "integer", + "format": "uint64", + "default": 0 + }, + "description": "The number of items to skip before starting to collect the result set.\n" + }, + { + "in": "path", + "name": "address", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/StakingAddress" + } + ] + }, + "description": "The staking address of the account that delegated." + } + ], + "responses": { + "200": { + "description": "A JSON object containing a list of debonding delegations.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DebondingDelegationList" + } + } + } + }, + "400": { + "$ref": "#/components/responses/HumanReadableError" + }, + "404": { + "$ref": "#/components/responses/NotFoundError" + }, + "500": { + "$ref": "#/components/responses/HumanReadableError" + } + } + } + }, + "/consensus/accounts/{address}/debonding_delegations_to": { + "get": { + "summary": "Returns a list of debonding delegations to an account.", + "parameters": [ + { + "in": "query", + "name": "limit", + "schema": { + "type": "integer", + "format": "uint64", + "default": 100, + "minimum": 1, + "maximum": 1000 + }, + "description": "The maximum numbers of items to return.\n" + }, + { + "in": "query", + "name": "offset", + "schema": { + "type": "integer", + "format": "uint64", + "default": 0 + }, + "description": "The number of items to skip before starting to collect the result set.\n" + }, + { + "in": "path", + "name": "address", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/StakingAddress" + } + ] + }, + "description": "The staking address of the that is being delegated to." + } + ], + "responses": { + "200": { + "description": "A JSON object containing a list of debonding delegations.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DebondingDelegationList" + } + } + } + }, + "400": { + "$ref": "#/components/responses/HumanReadableError" + }, + "404": { + "$ref": "#/components/responses/NotFoundError" + }, + "500": { + "$ref": "#/components/responses/HumanReadableError" + } + } + } + }, + "/consensus/epochs": { + "get": { + "summary": "Returns a list of consensus epochs.", + "parameters": [ + { + "in": "query", + "name": "limit", + "schema": { + "type": "integer", + "format": "uint64", + "default": 100, + "minimum": 1, + "maximum": 1000 + }, + "description": "The maximum numbers of items to return.\n" + }, + { + "in": "query", + "name": "offset", + "schema": { + "type": "integer", + "format": "uint64", + "default": 0 + }, + "description": "The number of items to skip before starting to collect the result set.\n" + } + ], + "responses": { + "200": { + "description": "A JSON object containing a list of consensus epochs.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EpochList" + } + } + } + }, + "400": { + "$ref": "#/components/responses/HumanReadableError" + }, + "404": { + "$ref": "#/components/responses/NotFoundError" + }, + "500": { + "$ref": "#/components/responses/HumanReadableError" + } + } + } + }, + "/consensus/epochs/{epoch}": { + "get": { + "summary": "Returns a consensus epoch.", + "parameters": [ + { + "in": "path", + "name": "epoch", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + }, + "description": "The epoch number of the epoch to return.", + "example": 13402 + } + ], + "responses": { + "200": { + "description": "A JSON object containing a consensus epoch.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Epoch" + } + } + } + }, + "400": { + "$ref": "#/components/responses/HumanReadableError" + }, + "404": { + "$ref": "#/components/responses/NotFoundError" + }, + "500": { + "$ref": "#/components/responses/HumanReadableError" + } + } + } + }, + "/consensus/proposals": { + "get": { + "summary": "Returns a list of governance proposals.", + "parameters": [ + { + "in": "query", + "name": "limit", + "schema": { + "type": "integer", + "format": "uint64", + "default": 100, + "minimum": 1, + "maximum": 1000 + }, + "description": "The maximum numbers of items to return.\n" + }, + { + "in": "query", + "name": "offset", + "schema": { + "type": "integer", + "format": "uint64", + "default": 0 + }, + "description": "The number of items to skip before starting to collect the result set.\n" + }, + { + "in": "query", + "name": "submitter", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/StakingAddress" + } + ] + }, + "description": "Filter on the submitter of the proposal." + }, + { + "in": "query", + "name": "state", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ProposalState" + } + ] + }, + "description": "Filter on the state of the proposal.", + "example": "active" + } + ], + "responses": { + "200": { + "description": "A JSON object containing a list of governance proposals.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProposalList" + } + } + } + }, + "400": { + "$ref": "#/components/responses/HumanReadableError" + }, + "404": { + "$ref": "#/components/responses/NotFoundError" + }, + "500": { + "$ref": "#/components/responses/HumanReadableError" + } + } + } + }, + "/consensus/proposals/{proposal_id}": { + "get": { + "summary": "Returns a governance proposal.", + "parameters": [ + { + "in": "path", + "name": "proposal_id", + "required": true, + "schema": { + "type": "integer", + "format": "uint64" + }, + "description": "The unique identifier of the proposal to return.", + "example": 1 + } + ], + "responses": { + "200": { + "description": "A JSON object containing a governance proposal.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Proposal" + } + } + } + }, + "400": { + "$ref": "#/components/responses/HumanReadableError" + }, + "404": { + "$ref": "#/components/responses/NotFoundError" + }, + "500": { + "$ref": "#/components/responses/HumanReadableError" + } + } + } + }, + "/consensus/proposals/{proposal_id}/votes": { + "get": { + "summary": "Returns a list of votes for a governance proposal.", + "parameters": [ + { + "in": "query", + "name": "limit", + "schema": { + "type": "integer", + "format": "uint64", + "default": 100, + "minimum": 1, + "maximum": 1000 + }, + "description": "The maximum numbers of items to return.\n" + }, + { + "in": "query", + "name": "offset", + "schema": { + "type": "integer", + "format": "uint64", + "default": 0 + }, + "description": "The number of items to skip before starting to collect the result set.\n" + }, + { + "in": "path", + "name": "proposal_id", + "required": true, + "schema": { + "type": "integer", + "format": "uint64" + }, + "description": "The unique identifier of the proposal for which votes are returned.\n", + "example": 1 + } + ], + "responses": { + "200": { + "description": "A JSON object containing a list of votes for a governance proposal.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProposalVotes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/HumanReadableError" + }, + "404": { + "$ref": "#/components/responses/NotFoundError" + }, + "500": { + "$ref": "#/components/responses/HumanReadableError" + } + } + } + }, + "/{runtime}/blocks": { + "get": { + "summary": "Returns a list of Runtime blocks.", + "parameters": [ + { + "in": "query", + "name": "limit", + "schema": { + "type": "integer", + "format": "uint64", + "default": 100, + "minimum": 1, + "maximum": 1000 + }, + "description": "The maximum numbers of items to return.\n" + }, + { + "in": "query", + "name": "offset", + "schema": { + "type": "integer", + "format": "uint64", + "default": 0 + }, + "description": "The number of items to skip before starting to collect the result set.\n" + }, + { + "in": "path", + "name": "runtime", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/Runtime" + } + ] + }, + "description": "The runtime which to query.\n" + }, + { + "in": "query", + "name": "from", + "schema": { + "type": "integer", + "format": "int64" + }, + "description": "A filter on minimum block height, inclusive.", + "example": 8048956 + }, + { + "in": "query", + "name": "to", + "schema": { + "type": "integer", + "format": "int64" + }, + "description": "A filter on maximum block height, inclusive.", + "example": 8049555 + }, + { + "in": "query", + "name": "after", + "schema": { + "type": "string", + "format": "date-time" + }, + "description": "A filter on minimum block time, inclusive.", + "example": "2022-03-01T00:00:00Z" + }, + { + "in": "query", + "name": "before", + "schema": { + "type": "string", + "format": "date-time" + }, + "description": "A filter on maximum block time, exclusive.", + "example": "2019-04-01T00:00:00Z" + }, + { + "in": "query", + "name": "hash", + "schema": { + "type": "string" + }, + "description": "A filter on the block hash.", + "example": "0a29ac21fa69bb9e43e5cb25d10826ff3946f1ce977e82f99a2614206a50765c" + } + ], + "responses": { + "200": { + "description": "A JSON object containing a list of Runtime blocks.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RuntimeBlockList" + } + } + } + }, + "400": { + "$ref": "#/components/responses/HumanReadableError" + }, + "404": { + "$ref": "#/components/responses/NotFoundError" + }, + "500": { + "$ref": "#/components/responses/HumanReadableError" + } + } + } + }, + "/{runtime}/transactions": { + "get": { + "summary": "Returns a list of Runtime transactions.", + "parameters": [ + { + "in": "query", + "name": "limit", + "schema": { + "type": "integer", + "format": "uint64", + "default": 100, + "minimum": 1, + "maximum": 1000 + }, + "description": "The maximum numbers of items to return.\n" + }, + { + "in": "query", + "name": "offset", + "schema": { + "type": "integer", + "format": "uint64", + "default": 0 + }, + "description": "The number of items to skip before starting to collect the result set.\n" + }, + { + "in": "path", + "name": "runtime", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/Runtime" + } + ] + }, + "description": "The runtime which to query.\n" + }, + { + "in": "query", + "name": "block", + "schema": { + "type": "integer", + "format": "int64" + }, + "description": "A filter on block round.", + "example": 3283246 + }, + { + "in": "query", + "name": "after", + "schema": { + "type": "string", + "format": "date-time" + }, + "description": "A filter on minimum transaction time, inclusive.", + "example": "2022-03-01T00:00:00Z" + }, + { + "in": "query", + "name": "before", + "schema": { + "type": "string", + "format": "date-time" + }, + "description": "A filter on maximum transaction time, exclusive.", + "example": "2019-04-01T00:00:00Z" + }, + { + "in": "query", + "name": "rel", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/EthOrOasisAddress" + } + ] + }, + "examples": { + "eth": { + "$ref": "#/components/examples/EthAddress" + }, + "oasis": { + "$ref": "#/components/examples/StakingAddress" + } + }, + "description": "A filter on related accounts. Every returned transaction will refer to\nthis account in a way. For example, for an `accounts.Transfer` tx, this will be\nthe sender or the recipient of tokens.\nNexus detects related accounts inside EVM transactions and events on a\nbest-effort basis. For example, it inspects ERC20 methods inside `evm.Call` txs.\n" + } + ], + "responses": { + "200": { + "description": "A JSON object containing a list of Runtime transactions.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RuntimeTransactionList" + } + } + } + }, + "400": { + "$ref": "#/components/responses/HumanReadableError" + }, + "404": { + "$ref": "#/components/responses/NotFoundError" + }, + "500": { + "$ref": "#/components/responses/HumanReadableError" + } + } + } + }, + "/{runtime}/transactions/{tx_hash}": { + "get": { + "summary": "Returns runtime transactions with the given transaction hash.", + "parameters": [ + { + "in": "path", + "name": "runtime", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/Runtime" + } + ] + }, + "description": "The runtime which to query.\n" + }, + { + "in": "path", + "name": "tx_hash", + "required": true, + "schema": { + "type": "string" + }, + "description": "The transaction hash of the transaction(s) to return. This can be an\nEthereum transaction hash; the query will compare against both a\ntransaction's regular tx_hash and eth_tx_hash (if it exists).\nThis endpoint can return multiple transactions in extremely rare cases,\ne.g. when a hash matches multiple Oasis runtime transactions or both\nan Oasis runtime transaction and the eth_tx_hash of an evm-transaction.\n", + "example": "0d0531d6b8a468c07440182b1cdda517f5a076d69fb2199126a83082ecfc0f41" + } + ], + "responses": { + "200": { + "description": "The requested runtime transactions.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RuntimeTransactionList" + } + } + } + }, + "400": { + "$ref": "#/components/responses/HumanReadableError" + }, + "404": { + "$ref": "#/components/responses/NotFoundError" + }, + "500": { + "$ref": "#/components/responses/HumanReadableError" + } + } + } + }, + "/{runtime}/events": { + "get": { + "summary": "Returns a list of runtime events.", + "parameters": [ + { + "in": "query", + "name": "limit", + "schema": { + "type": "integer", + "format": "uint64", + "default": 100, + "minimum": 1, + "maximum": 1000 + }, + "description": "The maximum numbers of items to return.\n" + }, + { + "in": "query", + "name": "offset", + "schema": { + "type": "integer", + "format": "uint64", + "default": 0 + }, + "description": "The number of items to skip before starting to collect the result set.\n" + }, + { + "in": "path", + "name": "runtime", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/Runtime" + } + ] + }, + "description": "The runtime which to query.\n" + }, + { + "in": "query", + "name": "block", + "schema": { + "type": "integer", + "format": "int64" + }, + "description": "A filter on block round.", + "example": 3283246 + }, + { + "in": "query", + "name": "tx_index", + "schema": { + "type": "integer", + "format": "int32" + }, + "description": "A filter on transaction index. The returned events all need to originate\nfrom a transaction that appeared in `tx_index`-th position in the block.\nIt is invalid to specify this filter without also specifying a `block`.\nSpecifying `tx_index` and `round` is an alternative to specifying `tx_hash`;\neither works to fetch events from a specific transaction.\n", + "example": 3 + }, + { + "in": "query", + "name": "tx_hash", + "schema": { + "type": "string" + }, + "description": "A filter on the hash of the transaction that originated the events.\nSpecifying `tx_index` and `round` is an alternative to specifying `tx_hash`;\neither works to fetch events from a specific transaction.\nThis can be an Ethereum transaction hash; the query will compare against\nboth a transaction's regular tx_hash and eth_tx_hash (if it exists).\n", + "example": "0d0531d6b8a468c07440182b1cdda517f5a076d69fb2199126a83082ecfc0f41" + }, + { + "in": "query", + "name": "type", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/RuntimeEventType" + } + ] + }, + "description": "A filter on the event type." + }, + { + "in": "query", + "name": "rel", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/EthOrOasisAddress" + } + ] + }, + "examples": { + "eth": { + "$ref": "#/components/examples/EthAddress" + }, + "oasis": { + "$ref": "#/components/examples/StakingAddress" + } + }, + "description": "A filter on related accounts. Every returned event will refer to\nthis account. For example, for a `accounts.Transfer` event, this will be\nthe sender or the recipient of tokens.\n" + }, + { + "in": "query", + "name": "evm_log_signature", + "schema": { + "type": "string" + }, + "description": "A filter on the evm log signatures.\nNote: The filter will only match on parsed (verified) EVM events.\n", + "example": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "in": "query", + "name": "contract_address", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/EthOrOasisAddress" + } + ] + }, + "examples": { + "eth": { + "$ref": "#/components/examples/EthAddress" + }, + "oasis": { + "$ref": "#/components/examples/StakingAddress" + } + }, + "description": "A filter on a smart contract. Every returned event will have been\nemitted by the contract at this address.\n" + }, + { + "in": "query", + "name": "nft_id", + "schema": { + "type": "string" + }, + "example": "999", + "description": "A filter on NFT events. Every returned event will be specifically\nabout this NFT instance ID. You must specify the contract_address\nfilter with this filter.\nCurrently this only supports ERC-721 Transfer events.\nThis may expand to support other event types in the future.\nIf you want only ERC-721 Transfer events, specify\nevm_log_signature=ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef\nto avoid inadvertently getting other event types if they are\nsupported later.\nUsing an evm_log_signature filter with this set to any other value\nwill match no events.\n" + } + ], + "responses": { + "200": { + "description": "Runtime events matching the filters, sorted by most recent first.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RuntimeEventList" + } + } + } + }, + "400": { + "$ref": "#/components/responses/HumanReadableError" + }, + "404": { + "$ref": "#/components/responses/NotFoundError" + }, + "500": { + "$ref": "#/components/responses/HumanReadableError" + } + } + } + }, + "/{runtime}/evm_tokens": { + "get": { + "summary": "Returns a list of EVM (ERC-20, ...) tokens on the runtime.", + "parameters": [ + { + "in": "query", + "name": "limit", + "schema": { + "type": "integer", + "format": "uint64", + "default": 100, + "minimum": 1, + "maximum": 1000 + }, + "description": "The maximum numbers of items to return.\n" + }, + { + "in": "query", + "name": "offset", + "schema": { + "type": "integer", + "format": "uint64", + "default": 0 + }, + "description": "The number of items to skip before starting to collect the result set.\n" + }, + { + "in": "path", + "name": "runtime", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/Runtime" + } + ] + }, + "description": "The runtime which to query.\n" + }, + { + "in": "query", + "name": "name", + "schema": { + "type": "string" + }, + "description": "A filter on the name, the name or symbol must contain this value as a substring." + } + ], + "responses": { + "200": { + "description": "The requested tokens.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EvmTokenList" + } + } + } + }, + "400": { + "$ref": "#/components/responses/HumanReadableError" + }, + "404": { + "$ref": "#/components/responses/NotFoundError" + }, + "500": { + "$ref": "#/components/responses/HumanReadableError" + } + } + } + }, + "/{runtime}/evm_tokens/{address}": { + "get": { + "summary": "Returns info on an EVM (ERC-20, ...) token on the runtime.", + "parameters": [ + { + "in": "path", + "name": "runtime", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/Runtime" + } + ] + }, + "description": "The runtime which to query.\n" + }, + { + "in": "path", + "name": "address", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/EthOrOasisAddress" + } + ] + }, + "examples": { + "eth": { + "$ref": "#/components/examples/EthAddress" + }, + "oasis": { + "$ref": "#/components/examples/StakingAddress" + } + }, + "description": "The staking address of the token contract." + } + ], + "responses": { + "200": { + "description": "The requested token.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EvmToken" + } + } + } + }, + "400": { + "$ref": "#/components/responses/HumanReadableError" + }, + "404": { + "$ref": "#/components/responses/NotFoundError" + }, + "500": { + "$ref": "#/components/responses/HumanReadableError" + } + } + } + }, + "/{runtime}/evm_tokens/{address}/holders": { + "get": { + "summary": "Returns the list of holders of an EVM (ERC-20, ...) token.\nThis endpoint does not verify that `address` is actually an EVM token; if it is not, it will simply return an empty list.\n", + "parameters": [ + { + "in": "query", + "name": "limit", + "schema": { + "type": "integer", + "format": "uint64", + "default": 100, + "minimum": 1, + "maximum": 1000 + }, + "description": "The maximum numbers of items to return.\n" + }, + { + "in": "query", + "name": "offset", + "schema": { + "type": "integer", + "format": "uint64", + "default": 0 + }, + "description": "The number of items to skip before starting to collect the result set.\n" + }, + { + "in": "path", + "name": "runtime", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/Runtime" + } + ] + }, + "description": "The runtime which to query.\n" + }, + { + "in": "path", + "name": "address", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/EthOrOasisAddress" + } + ] + }, + "examples": { + "eth": { + "$ref": "#/components/examples/EthAddress" + }, + "oasis": { + "$ref": "#/components/examples/StakingAddress" + } + }, + "description": "The staking address of the token contract for which to return the holders." + } + ], + "responses": { + "200": { + "description": "The requested holders.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TokenHolderList" + } + } + } + }, + "400": { + "$ref": "#/components/responses/HumanReadableError" + }, + "404": { + "$ref": "#/components/responses/NotFoundError" + }, + "500": { + "$ref": "#/components/responses/HumanReadableError" + } + } + } + }, + "/{runtime}/evm_tokens/{address}/nfts": { + "get": { + "summary": "Returns the list of non-fungible token (NFT) instances of an EVM (ERC-721, ...) token.\nThis endpoint does not verify that `address` is actually an EVM token; if it is not, it will simply return an empty list.\n", + "parameters": [ + { + "in": "query", + "name": "limit", + "schema": { + "type": "integer", + "format": "uint64", + "default": 100, + "minimum": 1, + "maximum": 1000 + }, + "description": "The maximum numbers of items to return.\n" + }, + { + "in": "query", + "name": "offset", + "schema": { + "type": "integer", + "format": "uint64", + "default": 0 + }, + "description": "The number of items to skip before starting to collect the result set.\n" + }, + { + "in": "path", + "name": "runtime", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/Runtime" + } + ] + }, + "description": "The runtime which to query.\n" + }, + { + "in": "path", + "name": "address", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/EthOrOasisAddress" + } + ] + }, + "examples": { + "eth": { + "$ref": "#/components/examples/EthAddress" + }, + "oasis": { + "$ref": "#/components/examples/StakingAddress" + } + }, + "description": "The staking address of the token contract for which to return the NFT instances." + } + ], + "responses": { + "200": { + "description": "The requested instances.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EvmNftList" + } + } + } + }, + "400": { + "$ref": "#/components/responses/HumanReadableError" + }, + "404": { + "$ref": "#/components/responses/NotFoundError" + }, + "500": { + "$ref": "#/components/responses/HumanReadableError" + } + } + } + }, + "/{runtime}/evm_tokens/{address}/nfts/{id}": { + "get": { + "summary": "Returns the non-fungible token (NFT) instance of an EVM (ERC-721, ...) token.\n", + "parameters": [ + { + "in": "path", + "name": "runtime", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/Runtime" + } + ] + }, + "description": "The runtime which to query.\n" + }, + { + "in": "path", + "name": "address", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/EthOrOasisAddress" + } + ] + }, + "examples": { + "eth": { + "$ref": "#/components/examples/EthAddress" + }, + "oasis": { + "$ref": "#/components/examples/StakingAddress" + } + }, + "description": "The staking address of the token contract of the NFT instance." + }, + { + "in": "path", + "name": "id", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/TextBigInt" + } + ] + }, + "description": "The ID of the NFT instance." + } + ], + "responses": { + "200": { + "description": "The requested instances.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EvmNft" + } + } + } + }, + "400": { + "$ref": "#/components/responses/HumanReadableError" + }, + "404": { + "$ref": "#/components/responses/NotFoundError" + }, + "500": { + "$ref": "#/components/responses/HumanReadableError" + } + } + } + }, + "/{runtime}/accounts/{address}": { + "get": { + "summary": "Returns a runtime account.", + "parameters": [ + { + "in": "path", + "name": "runtime", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/Runtime" + } + ] + }, + "description": "The runtime which to query.\n" + }, + { + "in": "path", + "name": "address", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/EthOrOasisAddress" + } + ] + }, + "description": "The staking address of the account to return." + } + ], + "responses": { + "200": { + "description": "A JSON object containing a runtime layer account.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RuntimeAccount" + } + } + } + }, + "400": { + "$ref": "#/components/responses/HumanReadableError" + }, + "404": { + "$ref": "#/components/responses/NotFoundError" + }, + "500": { + "$ref": "#/components/responses/HumanReadableError" + } + } + } + }, + "/{runtime}/accounts/{address}/nfts": { + "get": { + "summary": "Returns the list of non-fungible token (NFT) instances owned by an account.\n", + "parameters": [ + { + "in": "query", + "name": "limit", + "schema": { + "type": "integer", + "format": "uint64", + "default": 100, + "minimum": 1, + "maximum": 1000 + }, + "description": "The maximum numbers of items to return.\n" + }, + { + "in": "query", + "name": "offset", + "schema": { + "type": "integer", + "format": "uint64", + "default": 0 + }, + "description": "The number of items to skip before starting to collect the result set.\n" + }, + { + "in": "path", + "name": "runtime", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/Runtime" + } + ] + }, + "description": "The runtime which to query.\n" + }, + { + "in": "path", + "name": "address", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/EthOrOasisAddress" + } + ] + }, + "examples": { + "eth": { + "$ref": "#/components/examples/EthAddress" + }, + "oasis": { + "$ref": "#/components/examples/StakingAddress" + } + }, + "description": "The staking address of the owner of the NFT instances." + }, + { + "in": "query", + "name": "token_address", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/EthOrOasisAddress" + } + ] + }, + "examples": { + "eth": { + "$ref": "#/components/examples/EthAddress" + }, + "oasis": { + "$ref": "#/components/examples/StakingAddress" + } + }, + "description": "Only return NFT instances from the token contract at the given staking address." + } + ], + "responses": { + "200": { + "description": "The requested instances.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EvmNftList" + } + } + } + }, + "400": { + "$ref": "#/components/responses/HumanReadableError" + }, + "404": { + "$ref": "#/components/responses/NotFoundError" + }, + "500": { + "$ref": "#/components/responses/HumanReadableError" + } + } + } + }, + "/{runtime}/status": { + "get": { + "summary": "Returns the runtime status.", + "parameters": [ + { + "in": "path", + "name": "runtime", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/Runtime" + } + ] + }, + "description": "The runtime which to query.\n" + } + ], + "responses": { + "200": { + "description": "A JSON object containing latest runtime status.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RuntimeStatus" + } + } + } + }, + "400": { + "$ref": "#/components/responses/HumanReadableError" + }, + "404": { + "$ref": "#/components/responses/NotFoundError" + }, + "500": { + "$ref": "#/components/responses/HumanReadableError" + } + } + } + }, + "/{layer}/stats/tx_volume": { + "get": { + "summary": "Returns a timeline of the transaction volume at the chosen granularity,\nfor either consensus or one of the paratimes.\n", + "parameters": [ + { + "in": "query", + "name": "limit", + "schema": { + "type": "integer", + "format": "uint64", + "default": 100, + "minimum": 1, + "maximum": 1000 + }, + "description": "The maximum numbers of items to return.\n" + }, + { + "in": "query", + "name": "offset", + "schema": { + "type": "integer", + "format": "uint64", + "default": 0 + }, + "description": "The number of items to skip before starting to collect the result set.\n" + }, + { + "in": "query", + "name": "window_size_seconds", + "schema": { + "type": "integer", + "format": "uint32", + "default": 86400 + }, + "description": "The size of windows into which the statistic is grouped, in seconds.\nThe backend supports a limited number of window sizes: 300 (5 minutes) and\n86400 (1 day). Requests with other values may be rejected.\n" + }, + { + "in": "query", + "name": "window_step_seconds", + "schema": { + "type": "integer", + "format": "uint32", + "default": 86400 + }, + "description": "The size of the step between returned statistic windows, in seconds.\nThe backend supports a limited number of step sizes: 300 (5 minutes) and\n86400 (1 day). Requests with other values may be rejected.\n" + }, + { + "in": "path", + "name": "layer", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/Layer" + } + ] + }, + "description": "The layer for which to return the transaction volume timeline.\n" + } + ], + "responses": { + "200": { + "description": "A JSON object containing a list of TPS values for each interval.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TxVolumeList" + } + } + } + }, + "400": { + "$ref": "#/components/responses/HumanReadableError" + }, + "404": { + "$ref": "#/components/responses/NotFoundError" + }, + "500": { + "$ref": "#/components/responses/HumanReadableError" + } + } + } + }, + "/{layer}/stats/active_accounts": { + "get": { + "summary": "Returns a (sliding) timeline of the recorded daily unique active accounts for\neither consensus or one of the paratimes.\n", + "parameters": [ + { + "in": "query", + "name": "limit", + "schema": { + "type": "integer", + "format": "uint64", + "default": 100, + "minimum": 1, + "maximum": 1000 + }, + "description": "The maximum numbers of items to return.\n" + }, + { + "in": "query", + "name": "offset", + "schema": { + "type": "integer", + "format": "uint64", + "default": 0 + }, + "description": "The number of items to skip before starting to collect the result set.\n" + }, + { + "in": "query", + "name": "window_step_seconds", + "schema": { + "type": "integer", + "format": "uint32", + "default": 86400 + }, + "description": "The size of the step between returned statistic windows, in seconds.\nThe backend supports a limited number of step sizes: 300 (5 minutes) and\n86400 (1 day). Requests with other values may be rejected.\n" + }, + { + "in": "path", + "name": "layer", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/Layer" + } + ] + }, + "description": "The layer for which to return the active accounts timeline.\n" + } + ], + "responses": { + "200": { + "description": "A JSON object containing a list of unique active accounts values for each interval.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ActiveAccountsList" + } + } + } + }, + "400": { + "$ref": "#/components/responses/HumanReadableError" + }, + "404": { + "$ref": "#/components/responses/NotFoundError" + }, + "500": { + "$ref": "#/components/responses/HumanReadableError" + } + } + } + } + }, + "components": { + "schemas": { + "Layer": { + "type": "string", + "enum": ["emerald", "sapphire", "pontusxtest", "pontusxdev", "cipher", "consensus"] + }, + "Runtime": { + "type": "string", + "enum": ["emerald", "sapphire", "pontusxtest", "pontusxdev", "cipher"] + }, + "StakingAddress": { + "type": "string", + "pattern": "^oasis1[a-z0-9]{40}$", + "example": "oasis1qpg2xuz46g53737343r20yxeddhlvc2ldqsjh70p", + "x-go-type": "staking.Address", + "x-go-type-import": { + "name": "staking", + "path": "github.com/oasisprotocol/nexus/coreapi/v22.2.11/staking/api" + }, + "description": "An Oasis-style (bech32) address." + }, + "TextBigInt": { + "type": "string", + "pattern": "^-?[0-9]+$", + "format": "bigint", + "example": "1234567890123456789012", + "x-go-type": "common.BigInt", + "x-go-type-import": { + "name": "common", + "path": "github.com/oasisprotocol/nexus/common" + } + }, + "Address": { + "type": "string", + "pattern": "^oasis1[a-z0-9]{40}$", + "example": "oasis1qpg2xuz46g53737343r20yxeddhlvc2ldqsjh70p", + "description": "An Oasis-style (bech32) address." + }, + "EthOrOasisAddress": { + "type": "string", + "pattern": "^oasis1[a-z0-9]{40}$|^(0x)?[0-9a-fA-F]{40}$" + }, + "Ed25519PubKey": { + "type": "string", + "format": "byte", + "example": "lbxs4hlud9XNloIOdhJPaCahd7HtiY8QATCgGnFfCM0=", + "x-go-type": "signature.PublicKey", + "x-go-type-import": { + "name": "signature", + "path": "github.com/oasisprotocol/oasis-core/go/common/crypto/signature" + }, + "description": "A base64-encoded ed25519 public key." + }, + "CallFormat": { + "type": "string", + "example": "encrypted/x25519-deoxysii", + "x-go-type": "common.CallFormat", + "x-go-type-import": { + "name": "common", + "path": "github.com/oasisprotocol/nexus/common" + } + }, + "List": { + "type": "object", + "required": ["total_count", "is_total_count_clipped"], + "properties": { + "total_count": { + "type": "integer", + "format": "uint64", + "description": "The total number of records that match the query, i.e. the number of records\nthe query would return with limit=infinity.\n", + "example": 412 + }, + "is_total_count_clipped": { + "type": "boolean", + "description": "Whether total_count is clipped for performance reasons.", + "example": true + } + } + }, + "Status": { + "type": "object", + "required": ["latest_block", "latest_node_block", "latest_block_time", "latest_update_age_ms"], + "properties": { + "latest_block": { + "type": "integer", + "format": "int64", + "description": "The height of the most recent indexed block. Compare with latest_node_block to measure\nhow far behind Nexus is from the chain.\n", + "example": 8048956 + }, + "latest_node_block": { + "type": "integer", + "format": "int64", + "description": "The height of the most recently produced block on-chain as seen by Nexus.", + "example": 8049555 + }, + "latest_block_time": { + "type": "string", + "format": "date-time", + "description": "The RFC 3339 formatted consensus time of when the most recently indexed block was produced.", + "example": "2019-04-01T00:00:00Z" + }, + "latest_update_age_ms": { + "type": "integer", + "format": "int64", + "description": "The number of milliseconds since Nexus processed the latest block.", + "example": 352 + } + } + }, + "BlockList": { + "allOf": [ + { + "$ref": "#/components/schemas/List" + }, + { + "type": "object", + "required": ["blocks"], + "properties": { + "blocks": { + "type": "array", + "items": { + "allOf": [ + { + "$ref": "#/components/schemas/Block" + } + ] + } + } + } + } + ], + "description": "A list of consensus blocks.\n" + }, + "Block": { + "type": "object", + "required": ["height", "hash", "timestamp", "num_transactions", "gas_limit", "epoch", "state_root"], + "properties": { + "height": { + "type": "integer", + "format": "int64", + "description": "The block height.", + "example": 8048956 + }, + "hash": { + "type": "string", + "description": "The block header hash.", + "example": "0a29ac21fa69bb9e43e5cb25d10826ff3946f1ce977e82f99a2614206a50765c" + }, + "timestamp": { + "type": "string", + "format": "date-time", + "description": "The second-granular consensus time.", + "example": "2022-03-01T00:00:00Z" + }, + "num_transactions": { + "type": "integer", + "format": "int32", + "description": "Number of transactions in the block.", + "example": 17 + }, + "gas_limit": { + "allOf": [ + { + "$ref": "#/components/schemas/TextBigInt" + } + ], + "description": "The gas limit for the block. A gas limit 0 means that the max block gas was unlimited.\nBlocks from Cobalt, Damask, and early Eden had no gas limit as their sizes were only\nrestricted by byte size until an upgrade during Eden introduced a gas limit.\n" + }, + "size_limit": { + "allOf": [ + { + "$ref": "#/components/schemas/TextBigInt" + } + ], + "description": "The size limit for the block in bytes.\n" + }, + "epoch": { + "type": "integer", + "format": "int64", + "description": "The epoch number of the epoch in which the block was produced.", + "example": 13402 + }, + "state_root": { + "type": "string", + "description": "The Merkle root of the state tree after applying the block.", + "example": "8e39bf193f8a954ab8f8d7cb6388c591fd0785ea060bbd8e3752e266b54499d3" + } + }, + "description": "A consensus block.\n" + }, + "Delegation": { + "type": "object", + "required": ["amount", "shares", "validator", "delegator"], + "properties": { + "amount": { + "allOf": [ + { + "$ref": "#/components/schemas/TextBigInt" + } + ], + "description": "The amount of tokens delegated in base units." + }, + "shares": { + "allOf": [ + { + "$ref": "#/components/schemas/TextBigInt" + } + ], + "description": "The shares of tokens delegated." + }, + "validator": { + "type": "string", + "description": "The delegatee (validator) address.", + "example": "oasis1qpg2xuz46g53737343r20yxeddhlvc2ldqsjh70p" + }, + "delegator": { + "type": "string", + "description": "The delegator address.", + "example": "oasis1qprtzrg97jk0wxnqkhxwyzy5qys47r7alvfl3fcg" + } + }, + "description": "A delegation.\n" + }, + "DelegationList": { + "allOf": [ + { + "$ref": "#/components/schemas/List" + }, + { + "type": "object", + "required": ["delegations"], + "properties": { + "delegations": { + "type": "array", + "items": { + "allOf": [ + { + "$ref": "#/components/schemas/Delegation" + } + ] + } + } + }, + "description": "A list of delegations.\n" + } + ] + }, + "DebondingDelegation": { + "type": "object", + "required": ["amount", "shares", "validator", "delegator", "debond_end"], + "properties": { + "amount": { + "allOf": [ + { + "$ref": "#/components/schemas/TextBigInt" + } + ], + "description": "The amount of tokens delegated in base units." + }, + "shares": { + "allOf": [ + { + "$ref": "#/components/schemas/TextBigInt" + } + ], + "description": "The shares of tokens delegated." + }, + "validator": { + "type": "string", + "description": "The delegatee (validator) address.", + "example": "oasis1qpg2xuz46g53737343r20yxeddhlvc2ldqsjh70p" + }, + "delegator": { + "type": "string", + "description": "The delegator address.", + "example": "oasis1qprtzrg97jk0wxnqkhxwyzy5qys47r7alvfl3fcg" + }, + "debond_end": { + "type": "integer", + "format": "int64", + "description": "The epoch at which the debonding ends." + } + }, + "description": "A debonding delegation.\n" + }, + "DebondingDelegationList": { + "allOf": [ + { + "$ref": "#/components/schemas/List" + }, + { + "type": "object", + "required": ["debonding_delegations"], + "properties": { + "debonding_delegations": { + "type": "array", + "items": { + "allOf": [ + { + "$ref": "#/components/schemas/DebondingDelegation" + } + ] + } + } + }, + "description": "A list of debonding delegations.\n" + } + ] + }, + "ConsensusTxMethod": { + "type": "string", + "enum": [ + "beacon.PVSSCommit", + "beacon.PVSSReveal", + "beacon.VRFProve", + "consensus.Meta", + "governance.CastVote", + "governance.SubmitProposal", + "keymanager.PublishEphemeralSecret", + "keymanager.PublishMasterSecret", + "keymanager.UpdatePolicy", + "registry.DeregisterEntity", + "registry.ProveFreshness", + "registry.RegisterEntity", + "registry.RegisterNode", + "registry.RegisterRuntime", + "registry.UnfreezeNode", + "roothash.Evidence", + "roothash.ExecutorCommit", + "roothash.ExecutorProposerTimeout", + "roothash.SubmitMsg", + "staking.AddEscrow", + "staking.Allow", + "staking.AmendCommissionSchedule", + "staking.Burn", + "staking.ReclaimEscrow", + "staking.Transfer", + "staking.Withdraw", + "keymanager/churp.Apply", + "keymanager/churp.Confirm", + "keymanager/churp.Create", + "keymanager/churp.Update", + "vault.AuthorizeAction", + "vault.CancelAction", + "vault.Create" + ], + "example": "staking.Transfer" + }, + "TransactionList": { + "allOf": [ + { + "$ref": "#/components/schemas/List" + }, + { + "type": "object", + "required": ["transactions"], + "properties": { + "transactions": { + "type": "array", + "items": { + "allOf": [ + { + "$ref": "#/components/schemas/Transaction" + } + ] + } + } + }, + "description": "A list of consensus transactions.\n" + } + ] + }, + "Transaction": { + "type": "object", + "required": [ + "block", + "index", + "timestamp", + "hash", + "sender", + "nonce", + "fee", + "gas_limit", + "method", + "body", + "success" + ], + "properties": { + "block": { + "type": "integer", + "format": "int64", + "description": "The block height at which this transaction was executed.", + "example": 8048956 + }, + "index": { + "type": "integer", + "format": "int32", + "description": "0-based index of this transaction in its block", + "example": 17 + }, + "timestamp": { + "type": "string", + "format": "date-time", + "description": "The second-granular consensus time of this tx's block, i.e. roughly when the\n[block was proposed](https://github.com/tendermint/tendermint/blob/v0.34.x/spec/core/data_structures.md#header).\n", + "example": "2022-10-15T00:05:34Z" + }, + "hash": { + "type": "string", + "description": "The cryptographic hash of this transaction's encoding.", + "example": "0d0531d6b8a468c07440182b1cdda517f5a076d69fb2199126a83082ecfc0f41" + }, + "sender": { + "type": "string", + "description": "The address of who sent this transaction.", + "example": "oasis1qpg2xuz46g53737343r20yxeddhlvc2ldqsjh70p" + }, + "nonce": { + "type": "integer", + "format": "int64", + "description": "The nonce used with this transaction, to prevent replay.", + "example": 0 + }, + "fee": { + "allOf": [ + { + "$ref": "#/components/schemas/TextBigInt" + } + ], + "description": "The fee that this transaction's sender committed\nto pay to execute it.\n", + "example": 1000 + }, + "gas_limit": { + "allOf": [ + { + "$ref": "#/components/schemas/TextBigInt" + } + ], + "description": "The maximum gas that a transaction can use.\n" + }, + "method": { + "allOf": [ + { + "$ref": "#/components/schemas/ConsensusTxMethod" + } + ], + "description": "The method that was called." + }, + "body": { + "type": "object", + "description": "The method call body. This spec does not encode the many possible types; instead, see [the Go API](https://pkg.go.dev/github.com/oasisprotocol/oasis-core/go) of oasis-core. This object will conform to one of the types passed to variable instantiations using `NewMethodName` two levels down the hierarchy, e.g. `MethodTransfer` from `oasis-core/go/staking/api` seen [here](https://pkg.go.dev/github.com/oasisprotocol/oasis-core/go@v0.2300.10/staking/api#pkg-variables).", + "example": "{\"amount\":\"1000000000\",\"account\":\"oasis1qpg2xuz46g53737343r20yxeddhlvc2ldqsjh70p\"}" + }, + "success": { + "type": "boolean", + "description": "Whether this transaction successfully executed." + }, + "error": { + "allOf": [ + { + "$ref": "#/components/schemas/TxError" + } + ], + "description": "Error details of a failed transaction." + } + }, + "description": "A consensus transaction.\n" + }, + "TxError": { + "type": "object", + "required": ["code"], + "properties": { + "module": { + "type": "string", + "description": "The module of a failed transaction." + }, + "code": { + "type": "integer", + "format": "uint32", + "description": "The status code of a failed transaction." + }, + "message": { + "type": "string", + "description": "The message of a failed transaction.\nThis field, like `code` and `module`, can represent an error that originated\nanywhere in the paratime, i.e. either inside or outside a smart contract.\n\nA common special case worth calling out: When the paratime is\nEVM-compatible (e.g. Emerald or Sapphire) and the error originates\ninside a smart contract (using `revert` in solidity), the following\nwill be true:\n- `module` will be \"evm\" and `code` will be 8; see [here](https://github.com/oasisprotocol/oasis-sdk/blob/runtime-sdk/v0.8.3/runtime-sdk/modules/evm/src/lib.rs#L128) for other possible errors in the `evm` module.\n- `message` will contain the best-effort human-readable revert reason.\n" + }, + "revert_params": { + "type": "array", + "items": { + "allOf": [ + { + "$ref": "#/components/schemas/EvmAbiParam" + } + ] + }, + "description": "The error parameters, as decoded using the contract abi. Present only when\n- the error originated from within a smart contract (e.g. via `revert` in Solidity), and\n- the contract is verified or the revert reason is a plain String.\nIf this field is present, `message` will include the name of the error, e.g. 'InsufficentBalance'.\nNote that users should be cautious when evaluating error data since the\ndata origin is not tracked and error information can be faked.\n" + } + } + }, + "ConsensusEventType": { + "type": "string", + "enum": [ + "governance.proposal_executed", + "governance.proposal_finalized", + "governance.proposal_submitted", + "governance.vote", + "registry.entity", + "registry.node_unfrozen", + "registry.node", + "registry.runtime", + "registry.runtime_suspended", + "roothash.execution_discrepancy", + "roothash.executor_committed", + "roothash.finalized", + "roothash.message", + "roothash.in_msg_processed", + "staking.allowance_change", + "staking.burn", + "staking.escrow.add", + "staking.escrow.debonding_start", + "staking.escrow.reclaim", + "staking.escrow.take", + "staking.transfer" + ], + "example": "staking.escrow.take" + }, + "ConsensusEventList": { + "allOf": [ + { + "$ref": "#/components/schemas/List" + }, + { + "type": "object", + "required": ["events"], + "properties": { + "events": { + "type": "array", + "items": { + "allOf": [ + { + "$ref": "#/components/schemas/ConsensusEvent" + } + ] + } + } + }, + "description": "A list of consensus events.\n" + } + ] + }, + "ConsensusEvent": { + "type": "object", + "required": ["block", "type", "body"], + "properties": { + "block": { + "type": "integer", + "format": "int64", + "description": "The block height at which this event was generated.", + "example": 8048956 + }, + "tx_index": { + "type": "integer", + "format": "int32", + "description": "0-based index of this event's originating transaction within its block.\nAbsent if the event did not originate from a transaction.\n", + "example": 5 + }, + "tx_hash": { + "type": "string", + "description": "Hash of this event's originating transaction.\nAbsent if the event did not originate from a transaction.\n", + "example": "0d0531d6b8a468c07440182b1cdda517f5a076d69fb2199126a83082ecfc0f41" + }, + "roothash_runtime_id": { + "type": "string", + "description": "The ID of the runtime to which the event relates, encoded in hex.\nPresent only for events of type `roothash.*`.\n", + "example": "000000000000000000000000000000000000000000000000e2eaa99fc008f87f" + }, + "roothash_runtime": { + "allOf": [ + { + "$ref": "#/components/schemas/Runtime" + } + ], + "description": "The runtime to which the event relates.\nPresent only for events of type `roothash.*`.\n", + "example": "emerald" + }, + "roothash_runtime_round": { + "type": "integer", + "format": "int64", + "description": "When applicable, the round in the runtime to which this event\nrelates.\nPresent only for events of type `roothash.*` except for\n`roothash.execution_discrepancy` before Eden.\n" + }, + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/ConsensusEventType" + } + ], + "description": "The type of the event." + }, + "body": { + "type": "object", + "description": "The event contents. This spec does not encode the many possible types;\ninstead, see [the Go API](https://pkg.go.dev/github.com/oasisprotocol/oasis-core/go/consensus/api/transaction/results#Event) of oasis-core.\nThis object will conform to one of the `*Event` types two levels down\nthe hierarchy, e.g. `TransferEvent` from `Event > staking.Event > TransferEvent`\n" + } + }, + "description": "An event emitted by the consensus layer.\n" + }, + "RoothashMessageType": { + "type": "string", + "enum": [ + "staking.transfer", + "staking.withdraw", + "staking.add_escrow", + "staking.reclaim_escrow", + "registry.update_runtime", + "governance.cast_vote", + "governance.submit_proposal" + ], + "example": "staking.transfer" + }, + "RoothashMessageList": { + "allOf": [ + { + "$ref": "#/components/schemas/List" + }, + { + "type": "object", + "required": ["roothash_messages"], + "properties": { + "roothash_messages": { + "type": "array", + "items": { + "allOf": [ + { + "$ref": "#/components/schemas/RoothashMessage" + } + ] + } + } + } + } + ] + }, + "RoothashMessage": { + "type": "object", + "required": ["runtime", "round", "index"], + "properties": { + "runtime": { + "type": "string", + "description": "The runtime that sent this message.\n", + "example": "sapphire" + }, + "round": { + "type": "integer", + "format": "int64", + "description": "The block round when the runtime sent this message.\n", + "example": 1357490 + }, + "index": { + "type": "integer", + "format": "int32", + "description": "The 0-based index of this message in the block.\n", + "example": 0 + }, + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/RoothashMessageType" + } + ], + "description": "The type of thies message.\n", + "example": "staking.withdraw" + }, + "body": { + "type": "object", + "description": "The \"body\" of a message is a structure within the\n`github.com/oasisprotocol/oasis-core/go/roothash/api/message`\n`Message` structure\n(https://pkg.go.dev/github.com/oasisprotocol/oasis-core/go/roothash/api/message#Message).\nFor example, if the type is `staking.withdraw`, the body is the Go\n`Message` structure's `.Staking.Withdraw` field, which is a\n`github.com/oasisprotocol/oasis-core/go/staking/api` `Withdraw`\nstructure\n(https://pkg.go.dev/github.com/oasisprotocol/oasis-core/go/staking/api#Withdraw),\nwith `from` and `amount` fields in JSON.\n", + "example": { + "from": "oasis1qqzjq6lqjf8d07ehhvu5ytc47dck8w7a6qgn7efh", + "amount": "500000000" + } + }, + "error_module": { + "type": "string", + "description": "If executing this message resulted in an error, this is the\nerror's module.\n", + "example": "staking" + }, + "error_code": { + "type": "integer", + "format": "int32", + "description": "If executing this message resulted in an error, this is the\nerror's code.\n", + "example": 3 + }, + "result": { + "description": "A result value that consensus provided after executing this\nmessage. These aren't centrally registered anywhere, so look at\nthe consensus apps' `ExecuteMessage`\n(https://pkg.go.dev/github.com/oasisprotocol/oasis-core/go/consensus/cometbft/api#MessageSubscriber)\nimplementations to see what they return. For example, a\n`staking.withdraw` type message gives a\n`github.com/oasisprotocol/oasis-core/go/staking/api`\n`WithdrawResult` structure as its result\n(`https://pkg.go.dev/github.com/oasisprotocol/oasis-core/go/staking/api#WithdrawResult`)\nwith `owner`, `beneficiary`, `allowance`, and `amount_change`\nfields.\n", + "example": { + "owner": "oasis1qqzjq6lqjf8d07ehhvu5ytc47dck8w7a6qgn7efh", + "beneficiary": "oasis1qrd3mnzhhgst26hsp96uf45yhq6zlax0cuzdgcfc", + "allowance": "97000000000", + "amount_change": "500000000" + } + } + } + }, + "EntityList": { + "allOf": [ + { + "$ref": "#/components/schemas/List" + }, + { + "type": "object", + "required": ["entities"], + "properties": { + "entities": { + "type": "array", + "items": { + "allOf": [ + { + "$ref": "#/components/schemas/Entity" + } + ] + } + } + }, + "description": "A list of entities registered at the consensus layer.\n" + } + ] + }, + "Entity": { + "type": "object", + "required": ["id", "address", "nodes"], + "properties": { + "id": { + "x-go-name": "ID", + "type": "string", + "description": "The public key identifying this entity.", + "example": "gb8SHLeDc69Elk7OTfqhtVgE2sqxrBCDQI84xKR+Bjg=" + }, + "address": { + "type": "string", + "description": "The staking address belonging to this entity; derived from the entity's public key.", + "example": "oasis1qpg2xuz46g53737343r20yxeddhlvc2ldqsjh70p" + }, + "nodes": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The vector of nodes owned by this entity." + } + }, + "description": "An entity registered at the consensus layer.\n" + }, + "ValidatorsResponse": { + "type": "object", + "required": ["validator_list", "stats"], + "properties": { + "validator_list": { + "allOf": [ + { + "$ref": "#/components/schemas/ValidatorList" + } + ] + }, + "stats": { + "allOf": [ + { + "$ref": "#/components/schemas/ValidatorAggStats" + } + ], + "description": "Summary statistics across all consensus validators." + } + } + }, + "ValidatorList": { + "allOf": [ + { + "$ref": "#/components/schemas/List" + }, + { + "type": "object", + "required": ["validators", "stats"], + "properties": { + "validators": { + "type": "array", + "items": { + "allOf": [ + { + "$ref": "#/components/schemas/Validator" + } + ] + } + }, + "stats": { + "allOf": [ + { + "$ref": "#/components/schemas/ValidatorAggStats" + } + ], + "description": "Summary statistics across all consensus validators." + } + }, + "description": "A list of validators registered at the consensus layer, plus summary\nstatistics across all consensus validators.\n" + } + ] + }, + "ValidatorAggStats": { + "type": "object", + "required": ["total_voting_power", "total_delegators", "total_staked_balance"], + "properties": { + "total_voting_power": { + "type": "integer", + "format": "int64", + "description": "The total voting power across all validators." + }, + "total_delegators": { + "type": "integer", + "format": "uint64", + "description": "The total number of delegators in the network." + }, + "total_staked_balance": { + "allOf": [ + { + "$ref": "#/components/schemas/TextBigInt" + } + ], + "description": "The total amount of token staked to validators." + } + } + }, + "ValidatorCommissionBound": { + "type": "object", + "required": ["lower", "upper", "epoch_start", "epoch_end"], + "properties": { + "lower": { + "type": "integer", + "format": "uint64" + }, + "upper": { + "type": "integer", + "format": "uint64" + }, + "epoch_start": { + "type": "integer", + "format": "uint64" + }, + "epoch_end": { + "type": "integer", + "format": "uint64" + } + } + }, + "ValidatorMedia": { + "type": "object", + "properties": { + "url": { + "type": "string", + "description": "An URL associated with the entity." + }, + "email": { + "type": "string", + "description": "An email address associated with the entity." + }, + "twitter": { + "type": "string", + "description": "Twitter handle." + }, + "keybase": { + "type": "string", + "description": "Keybase handle." + }, + "name": { + "type": "string", + "description": "The human-readable name of this entity.", + "example": "WhaleStake" + }, + "logoUrl": { + "type": "string", + "description": "URL to a logo image for the entity." + } + } + }, + "Validator": { + "type": "object", + "required": [ + "entity_address", + "entity_id", + "escrow", + "voting_power", + "active", + "start_date", + "rank", + "in_validator_set", + "current_rate", + "current_commission_bound" + ], + "properties": { + "entity_address": { + "type": "string", + "description": "The staking address identifying this validator.", + "example": "oasis1qpg2xuz46g53737343r20yxeddhlvc2ldqsjh70p" + }, + "entity_id": { + "x-go-name": "EntityID", + "type": "string", + "description": "The public key identifying this validator.", + "example": "gb8SHLeDc69Elk7OTfqhtVgE2sqxrBCDQI84xKR+Bjg=" + }, + "node_id": { + "x-go-name": "NodeID", + "type": "string", + "description": "The public key identifying this validator's node.", + "example": "lbxs4hlud9XNloIOdhJPaCahd7HtiY8QATCgGnFfCM0=" + }, + "escrow": { + "allOf": [ + { + "$ref": "#/components/schemas/Escrow" + } + ], + "description": "The escrow account data for this validator." + }, + "voting_power": { + "type": "integer", + "format": "int64", + "description": "The voting power of this validator." + }, + "voting_power_cumulative": { + "type": "integer", + "format": "int64", + "description": "The cumulative voting power of this validator and all other validators ranked higher than itself." + }, + "active": { + "type": "boolean", + "description": "Whether the entity has a node that is registered for being a validator, node is up to date, and has successfully registered itself. It may or may not be part of validator set." + }, + "start_date": { + "type": "string", + "format": "date-time", + "description": "The second-granular consensus time.", + "example": "2022-10-15T00:05:34Z" + }, + "rank": { + "type": "integer", + "format": "uint64", + "description": "The rank of the validator, determined by voting power." + }, + "in_validator_set": { + "type": "boolean", + "description": "Whether the entity is part of the validator set (top by stake among active entities)." + }, + "media": { + "allOf": [ + { + "$ref": "#/components/schemas/ValidatorMedia" + } + ], + "example": "{\"email\":\"validator@example.net\",\"keybase\":\"validator_keybase\",\"name\":\"Example Validator\",\"twitter\":\"validator_twitter\",\"url\":\"https://example.com\",\"logoUrl\": \"https://example.com/logo.png\"}" + }, + "current_rate": { + "type": "integer", + "format": "uint64", + "description": "Commission rate." + }, + "current_commission_bound": { + "allOf": [ + { + "$ref": "#/components/schemas/ValidatorCommissionBound" + } + ] + } + }, + "description": "An validator registered at the consensus layer.\n" + }, + "Escrow": { + "type": "object", + "properties": { + "active_balance": { + "allOf": [ + { + "$ref": "#/components/schemas/TextBigInt" + } + ], + "description": "The amount of tokens that are delegated to this validator account, and are NOT in the process of debonding." + }, + "active_shares": { + "allOf": [ + { + "$ref": "#/components/schemas/TextBigInt" + } + ], + "description": "The shares of tokens that are delegated to this validator account, and are NOT in the process of debonding." + }, + "debonding_balance": { + "allOf": [ + { + "$ref": "#/components/schemas/TextBigInt" + } + ], + "description": "The amount of tokens that are delegated to this validator account, but are also in the process of debonding (i.e. they will be unstaked within ~2 weeks)." + }, + "debonding_shares": { + "allOf": [ + { + "$ref": "#/components/schemas/TextBigInt" + } + ], + "description": "The shares of tokens that are delegated to this validator account, but are also in the process of debonding (i.e. they will be unstaked within ~2 weeks)." + }, + "self_delegation_balance": { + "allOf": [ + { + "$ref": "#/components/schemas/TextBigInt" + } + ], + "description": "The amount of token this validator has delegated to itself, and are NOT in the process of debonding." + }, + "self_delegation_shares": { + "allOf": [ + { + "$ref": "#/components/schemas/TextBigInt" + } + ], + "description": "The shares of tokens this validator has delegated to itself, and are NOT in the process of debonding." + }, + "active_balance_24": { + "allOf": [ + { + "$ref": "#/components/schemas/TextBigInt" + } + ], + "description": "The active_balance of this validator account 24 hours ago." + }, + "num_delegators": { + "type": "integer", + "format": "uint64", + "description": "The number of accounts that have delegated token to this account." + } + } + }, + "ValidatorHistory": { + "allOf": [ + { + "$ref": "#/components/schemas/List" + }, + { + "type": "object", + "required": ["history"], + "properties": { + "address": { + "type": "string", + "description": "The staking address of the validator.", + "example": "oasis1qpg2xuz46g53737343r20yxeddhlvc2ldqsjh70p" + }, + "history": { + "type": "array", + "items": { + "allOf": [ + { + "$ref": "#/components/schemas/ValidatorHistoryPoint" + } + ] + } + } + }, + "description": "Historical escrow balance data for a single address." + } + ] + }, + "ValidatorHistoryPoint": { + "type": "object", + "required": ["epoch"], + "properties": { + "epoch": { + "type": "integer", + "format": "int64", + "description": "The epoch number.", + "example": 13402 + }, + "active_balance": { + "allOf": [ + { + "$ref": "#/components/schemas/TextBigInt" + } + ], + "description": "The amount of tokens that were delegated to this validator account, \nat the start of this epoch, and are NOT in the process of debonding.\n" + }, + "active_shares": { + "allOf": [ + { + "$ref": "#/components/schemas/TextBigInt" + } + ], + "description": "The shares of tokens that were delegated to this validator account, \nat the start of this epoch, and are NOT in the process of debonding.\n" + }, + "debonding_balance": { + "allOf": [ + { + "$ref": "#/components/schemas/TextBigInt" + } + ], + "description": "The amount of tokens that were delegated to this validator account\nat the start of this epoch, but are also in the process of debonding \n(i.e. they will be unstaked within ~2 weeks).\n" + }, + "debonding_shares": { + "allOf": [ + { + "$ref": "#/components/schemas/TextBigInt" + } + ], + "description": "The shares of tokens that were delegated to this validator account\nat the start of this epoch, but are also in the process of debonding \n(i.e. they will be unstaked within ~2 weeks).\n" + }, + "num_delegators": { + "type": "integer", + "format": "uint64", + "description": "The number of accounts that have delegated token to this account." + } + } + }, + "NodeList": { + "allOf": [ + { + "$ref": "#/components/schemas/List" + }, + { + "type": "object", + "required": ["entity_id", "nodes"], + "properties": { + "entity_id": { + "x-go-name": "EntityID", + "type": "string" + }, + "nodes": { + "type": "array", + "items": { + "allOf": [ + { + "$ref": "#/components/schemas/Node" + } + ] + } + } + }, + "description": "A list of nodes registered at the consensus layer.\n" + } + ] + }, + "Node": { + "type": "object", + "required": [ + "id", + "entity_id", + "expiration", + "tls_pubkey", + "tls_next_pubkey", + "p2p_pubkey", + "consensus_pubkey", + "roles" + ], + "properties": { + "id": { + "x-go-name": "ID", + "type": "string", + "description": "The public key identifying this node.", + "example": "lbxs4hlud9XNloIOdhJPaCahd7HtiY8QATCgGnFfCM0=" + }, + "entity_id": { + "x-go-name": "EntityID", + "type": "string", + "description": "The public key identifying the entity controlling this node.\n", + "example": "gb8SHLeDc69Elk7OTfqhtVgE2sqxrBCDQI84xKR+Bjg=" + }, + "expiration": { + "type": "integer", + "format": "int64", + "description": "The epoch in which this node's commitment expires." + }, + "tls_pubkey": { + "x-go-name": "TLSPubkey", + "type": "string", + "description": "The public key used for establishing TLS connections." + }, + "tls_next_pubkey": { + "x-go-name": "TLSNextPubkey", + "type": "string", + "description": "The public key that will be used for establishing TLS connections\nupon rotation.\n" + }, + "p2p_pubkey": { + "x-go-name": "P2PPubkey", + "type": "string", + "description": "The unique identifier of this node on the P2P transport." + }, + "consensus_pubkey": { + "type": "string", + "description": "The unique identifier of this node as a consensus member" + }, + "roles": { + "type": "string", + "description": "A bitmask representing this node's roles." + } + }, + "description": "A node registered at the consensus layer.\n" + }, + "AccountList": { + "allOf": [ + { + "$ref": "#/components/schemas/List" + }, + { + "type": "object", + "required": ["accounts"], + "properties": { + "accounts": { + "type": "array", + "items": { + "allOf": [ + { + "$ref": "#/components/schemas/Account" + } + ] + } + } + }, + "description": "A list of consensus layer accounts.\n" + } + ] + }, + "AddressDerivationContext": { + "type": "string", + "enum": [ + "oasis-core/address: staking", + "oasis-runtime-sdk/address: secp256k1eth", + "oasis-runtime-sdk/address: sr25519", + "oasis-runtime-sdk/address: multisig", + "oasis-runtime-sdk/address: module", + "oasis-runtime-sdk/address: runtime" + ] + }, + "AddressPreimage": { + "description": "The data from which a consensus-style address (`oasis1...`)\nwas derived. Notably, for EVM runtimes like Sapphire,\nthis links the Oasis address and the Ethereum address.\n\nOasis addresses are derived from a piece of data, such as an ed25519\npublic key or an Ethereum address. For example, [this](https://github.com/oasisprotocol/oasis-sdk/blob/b37e6da699df331f5a2ac62793f8be099c68469c/client-sdk/go/helpers/address.go#L90-L91)\nis how an Ethereum is converted to an Oasis address. The type of underlying data usually also\ndetermines how the signatuers for this address are verified.\n\nConsensus supports only \"staking addresses\" (`context=\"oasis-core/address: staking\"`\nbelow; always ed25519-backed).\nRuntimes support all types. This means that every consensus address is also\nvalid in every runtime. For example, in EVM runtimes, you can use staking\naddresses, but only with Oasis tools (e.g. a wallet); EVM contracts such as\nERC20 tokens or tools such as Metamask cannot interact with staking addresses.\n", + "type": "object", + "required": ["context", "address_data"], + "properties": { + "context": { + "allOf": [ + { + "$ref": "#/components/schemas/AddressDerivationContext" + } + ], + "description": "The method by which the Oasis address was derived from `address_data`.\n", + "example": "oasis-runtime-sdk/address: secp256k1eth" + }, + "context_version": { + "type": "integer", + "default": 0, + "description": "Version of the `context`." + }, + "address_data": { + "type": "string", + "format": "byte", + "description": "The base64-encoded data from which the Oasis address was derived.\nWhen `context = \"oasis-runtime-sdk/address: secp256k1eth\"`, this\nis the Ethereum address (in base64, not hex!).\n", + "example": "INLp2Ih3YIdcA+zFNhM+SIGyFgKsYYc9SKQeKRKe2uI=" + } + } + }, + "RuntimeSdkBalance": { + "description": "Balance of an account for a specific runtime and oasis-sdk token (e.g. ROSE).", + "type": "object", + "required": ["balance", "token_symbol", "token_decimals"], + "properties": { + "balance": { + "allOf": [ + { + "$ref": "#/components/schemas/TextBigInt" + } + ], + "description": "Number of tokens held, in base units." + }, + "token_symbol": { + "type": "string", + "description": "The token ticker symbol. Unique across all oasis-sdk tokens in the same runtime.", + "example": "ROSE" + }, + "token_decimals": { + "type": "integer", + "description": "The number of decimals of precision for this token.", + "example": 18 + } + } + }, + "RuntimeEvmBalance": { + "description": "Balance of an account for a specific runtime and EVM token.", + "type": "object", + "required": [ + "balance", + "token_contract_addr", + "token_contract_addr_eth", + "token_decimals", + "token_type" + ], + "properties": { + "balance": { + "allOf": [ + { + "$ref": "#/components/schemas/TextBigInt" + } + ], + "description": "Number of tokens held, in base units." + }, + "token_contract_addr": { + "type": "string", + "description": "The Oasis address of this token's contract.", + "example": "oasis1qzk5pr2x8ah04lgjee3lv06fmyvqvz45egjv4ps0" + }, + "token_contract_addr_eth": { + "type": "string", + "description": "The EVM address of this token's contract.", + "example": "0xF8E3DE55D24D13607A12628E0A113B66BA578bDC" + }, + "token_symbol": { + "type": "string", + "description": "The token ticker symbol. Not guaranteed to be unique across distinct EVM tokens." + }, + "token_name": { + "type": "string", + "description": "The name of the token. Not guaranteed to be unique across distinct EVM tokens." + }, + "token_type": { + "allOf": [ + { + "$ref": "#/components/schemas/EvmTokenType" + } + ] + }, + "token_decimals": { + "type": "integer", + "description": "The number of decimals of precision for this token.", + "example": 18 + } + } + }, + "TokenHolderList": { + "allOf": [ + { + "$ref": "#/components/schemas/List" + }, + { + "type": "object", + "required": ["holders"], + "properties": { + "holders": { + "type": "array", + "items": { + "allOf": [ + { + "$ref": "#/components/schemas/BareTokenHolder" + } + ] + } + } + }, + "description": "A list of token holders for a specific (implied) runtime and token.\n" + } + ] + }, + "BareTokenHolder": { + "description": "Balance of an account for a specific (implied) runtime and token.\n", + "type": "object", + "required": ["holder_address", "balance"], + "properties": { + "holder_address": { + "type": "string", + "description": "The Oasis address of the account holder.", + "example": "oasis1qpg2xuz46g53737343r20yxeddhlvc2ldqsjh70p" + }, + "eth_holder_address": { + "type": "string", + "description": "The Ethereum address of the same account holder, if meaningfully defined.", + "example": 1.2367698861069356e48 + }, + "balance": { + "allOf": [ + { + "$ref": "#/components/schemas/TextBigInt" + } + ], + "description": "Number of tokens held, in base units." + } + } + }, + "Account": { + "type": "object", + "required": [ + "address", + "nonce", + "available", + "escrow", + "debonding", + "delegations_balance", + "debonding_delegations_balance", + "allowances", + "stats" + ], + "properties": { + "address": { + "type": "string", + "description": "The staking address for this account.", + "example": "oasis1qpg2xuz46g53737343r20yxeddhlvc2ldqsjh70p" + }, + "nonce": { + "type": "integer", + "format": "int64", + "description": "The expected nonce for the next transaction (= last used nonce + 1)", + "example": 0 + }, + "available": { + "allOf": [ + { + "$ref": "#/components/schemas/TextBigInt" + } + ], + "description": "The available balance, in base units." + }, + "escrow": { + "allOf": [ + { + "$ref": "#/components/schemas/TextBigInt" + } + ], + "description": "The active escrow balance, in base units." + }, + "debonding": { + "allOf": [ + { + "$ref": "#/components/schemas/TextBigInt" + } + ], + "description": "The debonding escrow balance, in base units." + }, + "delegations_balance": { + "allOf": [ + { + "$ref": "#/components/schemas/TextBigInt" + } + ], + "description": "The balance of this accounts' (outgoing) delegations, in base units.", + "example": 10000000000 + }, + "debonding_delegations_balance": { + "allOf": [ + { + "$ref": "#/components/schemas/TextBigInt" + } + ], + "description": "The balance of this accounts' (outgoing) debonding delegations, in base units.", + "example": 10000000000 + }, + "first_activity": { + "type": "string", + "format": "date-time", + "description": "The second-granular consensus time of the block in which this account was first active.\nDates before Cobalt (2021-04-28) are approximate.\n", + "example": "2022-03-01T00:00:00Z" + }, + "allowances": { + "type": "array", + "items": { + "allOf": [ + { + "$ref": "#/components/schemas/Allowance" + } + ] + }, + "description": "The allowances made by this account.\nThis field is omitted when listing multiple accounts.\n" + }, + "stats": { + "allOf": [ + { + "$ref": "#/components/schemas/AccountStats" + } + ] + } + }, + "description": "A consensus layer account.\n" + }, + "Allowance": { + "type": "object", + "required": ["address", "amount"], + "properties": { + "address": { + "type": "string", + "description": "The allowed account.", + "example": "oasis1qprtzrg97jk0wxnqkhxwyzy5qys47r7alvfl3fcg" + }, + "amount": { + "allOf": [ + { + "$ref": "#/components/schemas/TextBigInt" + } + ], + "description": "The amount allowed for the allowed account.\nThis field is omitted when listing multiple accounts.\n" + } + } + }, + "EpochList": { + "allOf": [ + { + "$ref": "#/components/schemas/List" + }, + { + "type": "object", + "required": ["epochs"], + "properties": { + "epochs": { + "type": "array", + "items": { + "allOf": [ + { + "$ref": "#/components/schemas/Epoch" + } + ] + } + } + }, + "description": "A list of consensus epochs.\n" + } + ] + }, + "Epoch": { + "type": "object", + "required": ["id", "start_height"], + "properties": { + "id": { + "x-go-name": "ID", + "type": "integer", + "format": "int64", + "description": "The epoch number.", + "example": 13402 + }, + "start_height": { + "type": "integer", + "format": "uint64", + "description": "The (inclusive) height at which this epoch started.", + "example": 8048956 + }, + "end_height": { + "type": "integer", + "format": "uint64", + "description": "The (inclusive) height at which this epoch ended. Omitted if the epoch is still active.", + "example": 8049555 + } + }, + "description": "A consensus epoch.\n" + }, + "ProposalList": { + "allOf": [ + { + "$ref": "#/components/schemas/List" + }, + { + "type": "object", + "required": ["proposals"], + "properties": { + "proposals": { + "type": "array", + "items": { + "allOf": [ + { + "$ref": "#/components/schemas/Proposal" + } + ] + } + } + }, + "description": "A list of governance proposals.\n" + } + ] + }, + "ProposalTarget": { + "type": "object", + "properties": { + "consensus_protocol": { + "type": "string" + }, + "runtime_host_protocol": { + "type": "string" + }, + "runtime_committee_protocol": { + "type": "string" + } + }, + "description": "The target propotocol versions for this upgrade proposal." + }, + "ProposalState": { + "type": "string", + "enum": ["active", "passed", "failed", "rejected"], + "description": "The state of the proposal.", + "example": "active" + }, + "Proposal": { + "type": "object", + "required": ["id", "submitter", "state", "deposit", "created_at", "closes_at", "invalid_votes"], + "properties": { + "id": { + "x-go-name": "ID", + "type": "integer", + "format": "uint64", + "description": "The unique identifier of the proposal.", + "example": 1 + }, + "submitter": { + "type": "string", + "description": "The staking address of the proposal submitter.", + "example": "oasis1qpg2xuz46g53737343r20yxeddhlvc2ldqsjh70p" + }, + "state": { + "allOf": [ + { + "$ref": "#/components/schemas/ProposalState" + } + ] + }, + "deposit": { + "allOf": [ + { + "$ref": "#/components/schemas/TextBigInt" + } + ], + "description": "The deposit attached to this proposal." + }, + "title": { + "type": "string", + "description": "The (optional) title of the proposal." + }, + "description": { + "type": "string", + "description": "The (optional) description of the proposal." + }, + "handler": { + "type": "string", + "description": "The name of the upgrade handler." + }, + "target": { + "allOf": [ + { + "$ref": "#/components/schemas/ProposalTarget" + } + ] + }, + "epoch": { + "type": "integer", + "format": "uint64", + "description": "The epoch at which the proposed upgrade will happen.", + "example": 13402 + }, + "cancels": { + "type": "integer", + "format": "int64", + "description": "The proposal to cancel, if this proposal proposes\ncancelling an existing proposal.\n" + }, + "parameters_change_module": { + "type": "string", + "description": "The name of the module whose parameters are to be changed\nby this 'parameters_change' proposal.\n" + }, + "parameters_change": { + "description": "The parameters change proposal body. This spec does not encode the many possible types; instead, see [the Go API](https://pkg.go.dev/github.com/oasisprotocol/oasis-core/go) of oasis-core. This object will conform to one of the `ConsensusParameterChanges` types, depending on the `parameters_change_module`.", + "example": "{\"min_validators\":null,\"max_validators\":\"120\",\"voting_power_distribution\":null}" + }, + "created_at": { + "type": "integer", + "format": "int64", + "description": "The epoch at which this proposal was created.", + "example": 13402 + }, + "closes_at": { + "type": "integer", + "format": "int64", + "description": "The epoch at which voting for this proposal will close.", + "example": 13403 + }, + "invalid_votes": { + "allOf": [ + { + "$ref": "#/components/schemas/TextBigInt" + } + ], + "description": "The number of invalid votes for this proposal, after tallying.\n" + } + }, + "description": "A governance proposal.\n" + }, + "ProposalVotes": { + "allOf": [ + { + "$ref": "#/components/schemas/List" + }, + { + "type": "object", + "required": ["proposal_id", "votes"], + "properties": { + "proposal_id": { + "x-go-name": "ProposalID", + "type": "integer", + "format": "uint64", + "description": "The unique identifier of the proposal." + }, + "votes": { + "type": "array", + "items": { + "allOf": [ + { + "$ref": "#/components/schemas/ProposalVote" + } + ] + }, + "description": "The list of votes for the proposal." + } + }, + "description": "A list of votes for a governance proposal.\n" + } + ] + }, + "ProposalVote": { + "type": "object", + "required": ["address", "vote"], + "properties": { + "address": { + "type": "string", + "description": "The staking address casting this vote.", + "example": "oasis1qpg2xuz46g53737343r20yxeddhlvc2ldqsjh70p" + }, + "vote": { + "type": "string", + "description": "The vote cast.", + "example": "yes" + }, + "height": { + "type": "integer", + "format": "int64", + "description": "The block height at which this vote was recorded.", + "example": 8048956 + }, + "timestamp": { + "type": "string", + "format": "date-time", + "description": "The second-granular consensus time of the block in which this vote was cast.", + "example": "2022-03-01T00:00:00Z" + } + } + }, + "RuntimeBlockList": { + "allOf": [ + { + "$ref": "#/components/schemas/List" + }, + { + "type": "object", + "required": ["blocks"], + "properties": { + "blocks": { + "type": "array", + "items": { + "allOf": [ + { + "$ref": "#/components/schemas/RuntimeBlock" + } + ] + } + } + }, + "description": "A list of consensus blocks.\n" + } + ] + }, + "RuntimeBlock": { + "type": "object", + "required": ["round", "hash", "timestamp", "num_transactions", "size", "gas_used"], + "properties": { + "round": { + "type": "integer", + "format": "int64", + "description": "The block round.", + "example": 3283246 + }, + "hash": { + "type": "string", + "description": "The block header hash.", + "example": "21c243cd34bedfc234f1b45615d10a868f0655f59578f063a7d2fc8c6e5b4009" + }, + "timestamp": { + "type": "string", + "format": "date-time", + "description": "The second-granular consensus time.", + "example": "2022-10-15T00:05:34Z" + }, + "num_transactions": { + "type": "integer", + "format": "int32", + "description": "The number of transactions in the block.", + "example": 1 + }, + "size": { + "type": "integer", + "format": "int32", + "description": "The total byte size of all transactions in the block.", + "example": 203 + }, + "gas_used": { + "type": "integer", + "format": "int64", + "description": "The total gas used by all transactions in the block.", + "example": 118597 + } + }, + "description": "A ParaTime block.\n" + }, + "RuntimeEventList": { + "allOf": [ + { + "$ref": "#/components/schemas/List" + }, + { + "type": "object", + "required": ["events"], + "properties": { + "events": { + "type": "array", + "items": { + "allOf": [ + { + "$ref": "#/components/schemas/RuntimeEvent" + } + ] + } + } + }, + "description": "A list of runtime events.\n" + } + ] + }, + "RuntimeEvent": { + "type": "object", + "required": ["round", "timestamp", "type", "body"], + "properties": { + "round": { + "type": "integer", + "format": "int64", + "description": "The block height at which this event was generated.", + "example": 3283246 + }, + "tx_index": { + "type": "integer", + "format": "int32", + "description": "0-based index of this event's originating transaction within its block.\nAbsent if the event did not originate from a transaction.\n" + }, + "tx_hash": { + "type": "string", + "description": "Hash of this event's originating transaction.\nAbsent if the event did not originate from a transaction.\n", + "example": "0d0531d6b8a468c07440182b1cdda517f5a076d69fb2199126a83082ecfc0f41" + }, + "eth_tx_hash": { + "type": "string", + "description": "Ethereum trasnsaction hash of this event's originating transaction.\nAbsent if the event did not originate from an EVM transaction.\n" + }, + "timestamp": { + "type": "string", + "format": "date-time", + "description": "The second-granular consensus time of this event's block.\n", + "example": "2022-03-01T00:00:00Z" + }, + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/RuntimeEventType" + } + ], + "description": "The type of the event." + }, + "body": { + "type": "object", + "description": "The decoded event contents, possibly augmented with additional address info.\nThis spec does not encode the many possible types; instead, see [the Go API](https://pkg.go.dev/github.com/oasisprotocol/oasis-sdk/client-sdk/go/modules).\nThis object will conform to one of the `*Event` types two levels down\nthe hierarchy (e.g. `MintEvent` from `accounts > Event > MintEvent`),\nOR `evm > Event`. For object fields that specify an oasis-style address, Nexus\nwill add a field specifying the corresponding Ethereum address, if known. Currently,\nthe only such possible fields are `from_eth`, `to_eth`, and `owner_eth`.\n" + }, + "evm_log_name": { + "type": "string", + "description": "If the event type is `evm.log`, this field describes the human-readable type of\nevm event, e.g. `Transfer`.\nAbsent if the event type is not `evm.log`.\n", + "example": "Transfer" + }, + "evm_log_params": { + "type": "array", + "items": { + "allOf": [ + { + "$ref": "#/components/schemas/EvmAbiParam" + } + ] + }, + "description": "The decoded `evm.log` event data.\nAbsent if the event type is not `evm.log`.\n" + }, + "evm_token": { + "allOf": [ + { + "$ref": "#/components/schemas/EvmEventToken" + } + ] + } + }, + "description": "An event emitted by the runtime layer" + }, + "RuntimeEventType": { + "type": "string", + "enum": [ + "accounts.transfer", + "accounts.burn", + "accounts.mint", + "consensus_accounts.deposit", + "consensus_accounts.withdraw", + "consensus_accounts.delegate", + "consensus_accounts.undelegate_start", + "consensus_accounts.undelegate_done", + "core.gas_used", + "evm.log" + ], + "example": "consensus_accounts.deposit" + }, + "EvmAbiParam": { + "type": "object", + "required": ["name", "evm_type", "value"], + "properties": { + "name": { + "type": "string", + "description": "The parameter name." + }, + "evm_type": { + "type": "string", + "description": "The solidity type of the parameter." + }, + "value": { + "description": "The parameter value." + } + }, + "description": "A decoded parameter of an event or error emitted from an EVM runtime.\nValues of EVM type `int128`, `uint128`, `int256`, `uint256`, `fixed`, and `ufixed` are represented as strings.\nValues of EVM type `address` and `address payable` are represented as lowercase hex strings with a \"0x\" prefix.\nValues of EVM type `bytes` and `bytes` are represented as base64 strings.\nValues of other EVM types (integer types, strings, arrays, etc.) are represented as their JSON counterpart.\n" + }, + "EvmEventToken": { + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/EvmTokenType" + } + ] + }, + "symbol": { + "type": "string", + "description": "Symbol of the token, as provided by token contract's `symbol()` method.", + "example": "USDT" + }, + "decimals": { + "type": "integer", + "description": "The number of least significant digits in base units that should be displayed as\ndecimals when displaying tokens. `tokens = base_units / (10**decimals)`.\nAffects display only. Often equals 18, to match ETH.\n", + "example": 18 + } + }, + "description": "Details about the EVM token involved in the event, if any.\n" + }, + "RuntimeEvmContract": { + "type": "object", + "required": ["gas_used"], + "properties": { + "creation_tx": { + "type": "string", + "description": "The Oasis cryptographic hash of the transaction that created the smart contract.\nCan be omitted for contracts that were created by another contract, as opposed\nto a direct `Create` call.\n" + }, + "eth_creation_tx": { + "type": "string", + "description": "The Ethereum transaction hash of the transaction in `creation_tx`.\nEncoded as a lowercase hex string.\n", + "example": "dc19a122e268128b5ee20366299fc7b5b199c8e3" + }, + "creation_bytecode": { + "type": "string", + "format": "byte", + "description": "The creation bytecode of the smart contract. This includes the constructor logic\nand the constructor parameters. When run, this code generates the runtime bytecode.\nCan be omitted for contracts that were created by another contract, as opposed\nto a direct `Create` call.\n" + }, + "runtime_bytecode": { + "type": "string", + "format": "byte", + "description": "The runtime bytecode of the smart contract. This is the code stored on-chain that\ndescribes a smart contract. Every contract has this info, but Nexus fetches\nit separately, so the field may be missing for very fresh contracts (or if the fetching\nprocess is stalled).\n" + }, + "gas_used": { + "description": "The total amount of gas used to create or call this contract.", + "type": "integer", + "format": "uint64", + "example": 153852 + }, + "verification": { + "allOf": [ + { + "$ref": "#/components/schemas/RuntimeEvmContractVerification" + } + ], + "description": "Additional information obtained from contract verification. Only available for smart\ncontracts that have been verified successfully by Sourcify.\n" + } + } + }, + "VerificationLevel": { + "type": "string", + "enum": ["partial", "full"], + "description": "The level of verification of a smart contract, as defined by Sourcify.\nAn absence of this field means that the contract has not been verified.\nSee also https://docs.sourcify.dev/docs/full-vs-partial-match/\n" + }, + "RuntimeEvmContractVerification": { + "type": "object", + "properties": { + "verification_level": { + "allOf": [ + { + "$ref": "#/components/schemas/VerificationLevel" + } + ] + }, + "compilation_metadata": { + "type": "object", + "description": "The smart contract's [metadata.json](https://docs.soliditylang.org/en/latest/metadata.html) file in JSON format as defined by Solidity.\nIncludes the smart contract's [ABI](https://docs.soliditylang.org/en/develop/abi-spec.html).\n" + }, + "source_files": { + "type": "array", + "items": { + "type": "object" + }, + "description": "Array of all contract source files, in JSON format as returned by [Sourcify](https://sourcify.dev/server/api-docs/#/Repository/get_files_any__chain___address_).\n" + } + } + }, + "RuntimeTransactionList": { + "allOf": [ + { + "$ref": "#/components/schemas/List" + }, + { + "type": "object", + "required": ["transactions"], + "properties": { + "transactions": { + "type": "array", + "items": { + "allOf": [ + { + "$ref": "#/components/schemas/RuntimeTransaction" + } + ] + } + } + }, + "description": "A list of runtime transactions.\n" + } + ] + }, + "RuntimeTransaction": { + "type": "object", + "required": [ + "round", + "index", + "timestamp", + "hash", + "sender_0", + "nonce_0", + "fee", + "fee_symbol", + "charged_fee", + "gas_limit", + "gas_used", + "size" + ], + "properties": { + "round": { + "type": "integer", + "format": "int64", + "description": "The block round at which this transaction was executed.", + "example": 3379702 + }, + "index": { + "type": "integer", + "format": "int64", + "description": "The 0-based index of this transaction in the block.", + "example": 0 + }, + "timestamp": { + "type": "string", + "format": "date-time", + "description": "The second-granular consensus time when this tx's block was proposed.", + "example": "2022-10-15T00:05:34Z" + }, + "hash": { + "type": "string", + "description": "The Oasis cryptographic hash of this transaction's encoding.", + "example": "8394f682150e5f62b02f197d16b4769d032cb1c1b7a6dcf853ba1b12626e080b" + }, + "eth_hash": { + "type": "string", + "description": "The Ethereum cryptographic hash of this transaction's encoding.\nAbsent for non-Ethereum-format transactions.\n", + "example": "9e6a5837c6366d4a7e477c71ffe32d40915cdef7ef209792259e5ee70caf2705" + }, + "sender_0": { + "allOf": [ + { + "$ref": "#/components/schemas/Address" + } + ], + "description": "The Oasis address of this transaction's 0th signer.\nUnlike Ethereum, Oasis natively supports multiple-signature transactions.\nHowever, the great majority of transactions only have a single signer in practice.\nRetrieving the other signers is currently not supported by this API.\n", + "example": "oasis1qz670t637yyxshnlxhjj5074wgwl94d0x5x69zqd" + }, + "sender_0_eth": { + "type": "string", + "description": "The Ethereum address of this transaction's 0th signer.\n", + "example": 1.2367698861069356e48 + }, + "nonce_0": { + "type": "integer", + "format": "uint64", + "description": "The nonce used with this transaction's 0th signer, to prevent replay.", + "example": 114194 + }, + "fee": { + "type": "string", + "description": "The fee that this transaction's sender committed to pay to execute\nit (total ParaTime base units, as a string).\n", + "example": "3000000000000000" + }, + "fee_symbol": { + "type": "string", + "description": "The denomination of the fee.\n" + }, + "fee_proxy_module": { + "type": "string", + "description": "The module of the fee proxy.\n" + }, + "fee_proxy_id": { + "type": "string", + "format": "byte", + "description": "the base64-encoded id of the fee proxy.\n" + }, + "gas_limit": { + "type": "integer", + "format": "uint64", + "description": "The maximum gas that this transaction's sender committed to use to\nexecute it.\n", + "example": 30000 + }, + "gas_used": { + "type": "integer", + "format": "uint64", + "description": "The total gas used by the transaction." + }, + "charged_fee": { + "type": "string", + "description": "The fee that was charged for the transaction execution (total, native denomination,\nParaTime base units, as a string).\nFor EVM transactions this is calculated as `gas_price * gas_used`, where `gas_price = fee / gas_limit`, for compatibility with Ethereum.\nFor other transactions this equals to `fee`.\n" + }, + "size": { + "type": "integer", + "format": "int32", + "description": "The total byte size of the transaction." + }, + "method": { + "type": "string", + "description": "The method that was called. Defined by the runtime. In theory, this could be any string as the runtimes evolve.\nIn practice, Nexus currently expects only the following methods:\n - \"accounts.Transfer\"\n - \"consensus.Deposit\"\n - \"consensus.Withdraw\"\n - \"consensus.Delegate\"\n - \"consensus.Undelegate\"\n - \"evm.Create\"\n - \"evm.Call\"\nMay be null if the transaction was malformed or encrypted.\n", + "example": "evm.Call" + }, + "body": { + "type": "object", + "description": "The method call body. May be null if the transaction was malformed.", + "example": { + "address": "t1mAPucIdVnrYBpJOcLV2nZoOFo=", + "data": "RBo+cAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\"", + "value": "" + } + }, + "is_likely_native_token_transfer": { + "type": "boolean", + "description": "Whether this transaction likely represents a native token transfer.\nThis is based on a heuristic, and can change at any time without warning and possibly without updating the documentation.\nThe current heuristic sets this to `true` for:\n - Transactions with method \"accounts.Transfer\". Those are always native token transfers.\n - Transactions with method \"evm.Call\" that have no `data` field in their `body`. Those tend to be transfers, but the runtimes provides no reliable visibility into whether a transfer happened.\nNote: Other transactions with method \"evm.Call\", and possibly \"evm.Create\", may also be (or include) native token transfers. The heuristic will be `false` for those.\n", + "example": true + }, + "to": { + "allOf": [ + { + "$ref": "#/components/schemas/Address" + } + ], + "description": "A reasonable \"to\" Oasis address associated with this transaction,\nif applicable. The meaning varies based on the transaction method. Some notable examples:\n - For `method = \"accounts.Transfer\"`, this is the paratime account receiving the funds.\n - For `method = \"consensus.Deposit\"`, this is the paratime account receiving the funds.\n - For `method = \"consensus.Withdraw\"`, this is the consensus (!) account receiving the funds.\n - For `method = \"consensus.Delegate\"`, this is the consensus (!) account receiving the funds.\n - For `method = \"consensus.Undelegate\"`, this is the consensus (!) account to which funds were previously delegated. Note that this corresponds with the `.from` field in the transaction body.\n - For `method = \"evm.Create\"`, this is the address of the newly created smart contract.\n - For `method = \"evm.Call\"`, this is the address of the called smart contract\n", + "example": "oasis1qq6ulxmcagnp5nr56ylva7nhmwnxtf0krumg9dkq" + }, + "to_eth": { + "type": "string", + "description": "A reasonable \"to\" Ethereum address associated with this transaction,\n", + "example": 1.2367698861069356e48 + }, + "amount": { + "type": "string", + "description": "A reasonable \"amount\" associated with this transaction, if\napplicable. The meaning varies based on the transaction method.\nUsually in native denomination, ParaTime units. As a string.\n", + "example": "100000001666393459" + }, + "amount_symbol": { + "type": "string", + "description": "The denomination of the \"amount\" associated with this transaction, if applicable.\n", + "example": "ROSE" + }, + "encryption_envelope": { + "allOf": [ + { + "$ref": "#/components/schemas/RuntimeTransactionEncryptionEnvelope" + } + ], + "description": "The data relevant to the encrypted transaction. Only present for encrypted\ntransactions in confidential EVM runtimes like Sapphire.\nNote: The term \"envelope\" in this context refers to the [Oasis-style encryption envelopes](https://github.com/oasisprotocol/oasis-sdk/blob/c36a7ee194abf4ca28fdac0edbefe3843b39bf69/runtime-sdk/src/types/callformat.rs)\nwhich differ slightly from [digital envelopes](hhttps://en.wikipedia.org/wiki/Hybrid_cryptosystem#Envelope_encryption).\n" + }, + "success": { + "type": "boolean", + "description": "Whether this transaction successfully executed.\nCan be absent (meaning \"unknown\") for confidential runtimes.\n" + }, + "evm_fn_name": { + "type": "string", + "description": "The name of the smart contract function called by the transaction.\nOnly present for `evm.log` transaction calls to contracts that have been verified.\n", + "example": "acceptTaskResults" + }, + "evm_fn_params": { + "type": "array", + "items": { + "allOf": [ + { + "$ref": "#/components/schemas/EvmAbiParam" + } + ] + }, + "description": "The decoded parameters with which the smart contract function was called.\nOnly present for `evm.log` transaction calls to contracts that have been verified.\n" + }, + "error": { + "allOf": [ + { + "$ref": "#/components/schemas/TxError" + } + ], + "description": "Error details of a failed transaction." + } + }, + "description": "A runtime transaction.\n" + }, + "RuntimeTransactionEncryptionEnvelope": { + "type": "object", + "required": ["format"], + "properties": { + "format": { + "allOf": [ + { + "$ref": "#/components/schemas/CallFormat" + } + ], + "description": "The format of the encrypted evm transaction envelope." + }, + "public_key": { + "type": "string", + "format": "byte", + "description": "The base64-encoded public key used to encrypt the transaction." + }, + "data_nonce": { + "type": "string", + "format": "byte", + "description": "The base64-encoded nonce used to encrypt the transaction data." + }, + "data": { + "type": "string", + "format": "byte", + "description": "The base64-encoded encrypted transaction data." + }, + "result_nonce": { + "type": "string", + "format": "byte", + "description": "The base64-encoded nonce used to encrypt the transaction results." + }, + "result": { + "type": "string", + "format": "byte", + "description": "The base64-encoded encrypted result data." + } + } + }, + "RuntimeAccount": { + "type": "object", + "required": ["address", "balances", "evm_balances", "stats"], + "properties": { + "address": { + "type": "string", + "description": "The staking address for this account.", + "example": "oasis1qpg2xuz46g53737343r20yxeddhlvc2ldqsjh70p" + }, + "address_preimage": { + "allOf": [ + { + "$ref": "#/components/schemas/AddressPreimage" + } + ] + }, + "balances": { + "description": "The balance(s) of this account in this runtime. Most runtimes use only one denomination, and thus\nproduce only one balance here. These balances do not include \"layer (n+1) tokens\", i.e. tokens\nmanaged by smart contracts deployed in this runtime. For example, in EVM-compatible runtimes,\nthis does not include ERC-20 tokens\n", + "type": "array", + "items": { + "allOf": [ + { + "$ref": "#/components/schemas/RuntimeSdkBalance" + } + ] + } + }, + "evm_contract": { + "allOf": [ + { + "$ref": "#/components/schemas/RuntimeEvmContract" + } + ], + "description": "Data on the EVM smart contract associated with this account address. Only present for accounts\nthat represent a smart contract on EVM.\n" + }, + "evm_balances": { + "description": "The balances of this account in each runtime, as managed by EVM smart contracts (notably, ERC-20).\nNOTE: This field is limited to 1000 entries. If you need more, please let us know in a GitHub issue.\n", + "type": "array", + "items": { + "allOf": [ + { + "$ref": "#/components/schemas/RuntimeEvmBalance" + } + ] + } + }, + "stats": { + "allOf": [ + { + "$ref": "#/components/schemas/AccountStats" + } + ] + } + } + }, + "RuntimeStatus": { + "type": "object", + "required": ["active_nodes", "latest_block", "latest_block_time", "latest_update_age_ms"], + "properties": { + "active_nodes": { + "type": "integer", + "description": "The number of compute nodes that are registered and can run the runtime.", + "example": 42 + }, + "latest_block": { + "type": "integer", + "format": "int64", + "description": "The height of the most recent indexed block (also sometimes referred to as \"round\") for this runtime. Query a synced Oasis node for the latest block produced.", + "example": 8048956 + }, + "latest_block_time": { + "type": "string", + "format": "date-time", + "description": "The RFC 3339 formatted consensus time of when the latest indexed block for this runtime was produced.", + "example": "2019-04-01T00:00:00Z" + }, + "latest_update_age_ms": { + "type": "integer", + "format": "int64", + "description": "The number of milliseconds since Nexus processed the latest block.", + "example": 352 + } + } + }, + "EvmTokenType": { + "type": "string", + "enum": ["ERC20", "ERC721"], + "description": "The type of a EVM token.\n" + }, + "EvmTokenList": { + "allOf": [ + { + "$ref": "#/components/schemas/List" + }, + { + "type": "object", + "required": ["evm_tokens"], + "properties": { + "evm_tokens": { + "type": "array", + "items": { + "allOf": [ + { + "$ref": "#/components/schemas/EvmToken" + } + ] + }, + "description": "A list of L2 EVM tokens (ERC-20, ERC-721, ...)." + } + }, + "description": "A list of tokens in a runtime." + } + ] + }, + "EvmToken": { + "type": "object", + "required": ["contract_addr", "eth_contract_addr", "num_holders", "type", "is_verified"], + "properties": { + "contract_addr": { + "type": "string", + "description": "The Oasis address of this token's contract.", + "example": "oasis1qp2hssandc7dekjdr6ygmtzt783k3gn38uupdeys" + }, + "eth_contract_addr": { + "type": "string", + "description": "The Ethereum address of this token's contract.", + "example": 1.2367698861069356e48 + }, + "name": { + "type": "string", + "description": "Name of the token, as provided by token contract's `name()` method.", + "example": "Uniswap" + }, + "symbol": { + "type": "string", + "description": "Symbol of the token, as provided by token contract's `symbol()` method.", + "example": "USDT" + }, + "decimals": { + "type": "integer", + "description": "The number of least significant digits in base units that should be displayed as\ndecimals when displaying tokens. `tokens = base_units / (10**decimals)`.\nAffects display only. Often equals 18, to match ETH.\n", + "example": 18 + }, + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/EvmTokenType" + } + ], + "description": "The heuristically determined interface that the token contract implements.\nA less specialized variant of the token might be detected; for example, an\nERC-1363 token might be labeled as ERC-20 here. If the type cannot be\ndetected or is not supported, this field will be null/absent.\n" + }, + "total_supply": { + "allOf": [ + { + "$ref": "#/components/schemas/TextBigInt" + } + ], + "description": "The total number of base units available." + }, + "num_transfers": { + "type": "integer", + "format": "int64", + "description": "The total number of transfers of this token.\n" + }, + "num_holders": { + "type": "integer", + "format": "int64", + "description": "The number of addresses that have a nonzero balance of this token.\n", + "example": 123 + }, + "is_verified": { + "deprecated": true, + "type": "boolean", + "description": "Whether the contract has been successfully verified by Sourcify.\nAdditional information on verified contracts is available via\nthe `/{runtime}/accounts/{address}` endpoint.\nDEPRECATED: This field will be removed in the future in favor of verification_level\n", + "example": false + }, + "verification_level": { + "allOf": [ + { + "$ref": "#/components/schemas/VerificationLevel" + } + ] + } + } + }, + "EvmNftList": { + "allOf": [ + { + "$ref": "#/components/schemas/List" + }, + { + "type": "object", + "required": ["evm_nfts"], + "properties": { + "evm_nfts": { + "type": "array", + "items": { + "allOf": [ + { + "$ref": "#/components/schemas/EvmNft" + } + ] + }, + "description": "A list of L2 EVM NFT (ERC-721, ...) instances." + } + }, + "description": "A list of NFT instances." + } + ] + }, + "EvmNft": { + "type": "object", + "required": ["token", "id"], + "properties": { + "token": { + "allOf": [ + { + "$ref": "#/components/schemas/EvmToken" + } + ] + }, + "id": { + "allOf": [ + { + "$ref": "#/components/schemas/TextBigInt" + } + ], + "description": "The instance ID of this NFT within the collection represented by `token`." + }, + "owner": { + "allOf": [ + { + "$ref": "#/components/schemas/Address" + } + ], + "description": "The Oasis address of this NFT instance's owner.", + "example": "oasis1qpclnnm0wu44pn43mt6vv3me59kl8zk9ty7qyj03" + }, + "owner_eth": { + "type": "string", + "description": "The Ethereum address of this NFT instance's owner.", + "example": "0xDEF1009df2d6872C214cd9148c6883893B7c4D91" + }, + "num_transfers": { + "type": "integer", + "format": "int64", + "description": "The total number of transfers of this NFT instance.\n" + }, + "metadata_uri": { + "type": "string" + }, + "metadata_accessed": { + "type": "string" + }, + "metadata": { + "description": "A metadata document for this NFT instance.\nCurrently only ERC-721 is supported, where the document is an Asset Metadata from the ERC721 Metadata JSON Schema.\n" + }, + "name": { + "type": "string", + "description": "Identifies the asset which this NFT represents" + }, + "description": { + "type": "string", + "description": "Describes the asset which this NFT represents" + }, + "image": { + "type": "string", + "description": "A URI pointing to a resource with mime type image/* representing\nthe asset which this NFT represents. (Additional\nnon-descriptive text from ERC-721 omitted.)\n" + } + } + }, + "AccountStats": { + "type": "object", + "required": ["num_txns"], + "properties": { + "total_sent": { + "deprecated": true, + "allOf": [ + { + "$ref": "#/components/schemas/TextBigInt" + } + ], + "description": "The total amount of native tokens sent, in base units.\nDEPRECATED: This field might be inaccurate. Nexus is currently not able to track\ncertain actions which subtract/add tokens.\n" + }, + "total_received": { + "deprecated": true, + "allOf": [ + { + "$ref": "#/components/schemas/TextBigInt" + } + ], + "description": "The total amount of native tokens received, in base units.\nDEPRECATED: This field might be inaccurate. Nexus is currently not able to track\ncertain actions which subtract/add tokens.\n" + }, + "num_txns": { + "description": "The total number of transactions this account was involved with.", + "type": "integer", + "format": "uint64", + "example": 4184 + } + } + }, + "TxVolumeList": { + "type": "object", + "required": ["window_size_seconds", "windows"], + "properties": { + "window_size_seconds": { + "type": "integer", + "format": "uint32" + }, + "windows": { + "type": "array", + "items": { + "allOf": [ + { + "$ref": "#/components/schemas/TxVolume" + } + ] + }, + "description": "The list of daily transaction volumes." + } + }, + "description": "A list of daily transaction volumes.\n" + }, + "TxVolume": { + "type": "object", + "required": ["window_end", "tx_volume"], + "properties": { + "window_end": { + "type": "string", + "format": "date-time", + "description": "The end timestamp for this daily transaction volume measurement.", + "example": "2022-03-01T00:00:00Z" + }, + "tx_volume": { + "type": "integer", + "format": "uint64", + "description": "The transaction volume for this window.", + "example": 420 + } + } + }, + "ActiveAccountsList": { + "type": "object", + "required": ["window_size_seconds", "windows"], + "properties": { + "window_size_seconds": { + "type": "integer", + "format": "uint32" + }, + "windows": { + "type": "array", + "items": { + "allOf": [ + { + "$ref": "#/components/schemas/ActiveAccounts" + } + ] + }, + "description": "The list of daily unique active account windows." + } + }, + "description": "A list of daily unique active account windows.\n" + }, + "ActiveAccounts": { + "type": "object", + "required": ["window_end", "active_accounts"], + "properties": { + "window_end": { + "type": "string", + "format": "date-time", + "description": "The date for the end of the daily active accounts measurement window.", + "example": "2022-03-01T00:00:00Z" + }, + "active_accounts": { + "type": "integer", + "format": "uint64", + "description": "The number of active accounts for the 24hour window ending at window_end.", + "example": 420 + } + } + } + }, + "responses": { + "HumanReadableError": { + "content": { + "application/json": { + "schema": { + "type": "object", + "required": ["msg"], + "properties": { + "msg": { + "type": "string", + "description": "An error message.", + "example": "internal storage error" + } + } + } + } + }, + "description": "A human-readable error message." + }, + "NotFoundError": { + "description": "An empty response indicating that the requested resource was not found.", + "content": { + "application/json": { + "schema": {} + } + } + } + }, + "examples": { + "StakingAddress": { + "value": "oasis1qp2hssandc7dekjdr6ygmtzt783k3gn38uupdeys", + "description": "A native Oasis address, bech32-encoded." + }, + "EthAddress": { + "value": "0xDEF1009df2d6872C214cd9148c6883893B7c4D91", + "description": "An Ethereum-compatible address, hex-encoded. Capitalization does not matter." + } + } + } +} diff --git a/src/vendors/nexus/openapitools.json b/src/vendors/nexus/openapitools.json new file mode 100644 index 0000000000..86ee945ba6 --- /dev/null +++ b/src/vendors/nexus/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/nexus/runtime.ts b/src/vendors/nexus/runtime.ts new file mode 100644 index 0000000000..598596291b --- /dev/null +++ b/src/vendors/nexus/runtime.ts @@ -0,0 +1,319 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Oasis Nexus API V1 + * An API for accessing indexed data from the Oasis Network. # Endpoints + * + * The version of the OpenAPI document: 0.1.0 + * + * + * 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://nexus.oasis.io/v1".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(); + }; +}