diff --git a/.changelog/2107.internal.md b/.changelog/2107.internal.md new file mode 100644 index 0000000000..343c3774bf --- /dev/null +++ b/.changelog/2107.internal.md @@ -0,0 +1,4 @@ +Update Nexus API bindings + +- update spec +- use type mappings for generating API diff --git a/src/vendors/nexus/.openapi-generator/FILES b/src/vendors/nexus/.openapi-generator/FILES index ee68eb3ded..eb038d2f15 100644 --- a/src/vendors/nexus/.openapi-generator/FILES +++ b/src/vendors/nexus/.openapi-generator/FILES @@ -1,4 +1,3 @@ -.openapi-generator-ignore apis/DefaultApi.ts apis/index.ts index.ts @@ -27,6 +26,7 @@ models/Delegation.ts models/DelegationList.ts models/DelegationListAllOf.ts models/Entity.ts +models/EntityInfo.ts models/EntityList.ts models/EntityListAllOf.ts models/Epoch.ts @@ -38,9 +38,11 @@ models/EvmEventToken.ts models/EvmNft.ts models/EvmNftList.ts models/EvmNftListAllOf.ts +models/EvmRefToken.ts models/EvmToken.ts models/EvmTokenList.ts models/EvmTokenListAllOf.ts +models/EvmTokenSwap.ts models/EvmTokenType.ts models/InlineResponse400.ts models/Layer.ts @@ -78,6 +80,7 @@ models/RuntimeTransaction.ts models/RuntimeTransactionEncryptionEnvelope.ts models/RuntimeTransactionList.ts models/RuntimeTransactionListAllOf.ts +models/RuntimeTransactionSigner.ts models/Status.ts models/TokenHolderList.ts models/TokenHolderListAllOf.ts @@ -96,6 +99,7 @@ models/ValidatorHistoryPoint.ts models/ValidatorList.ts models/ValidatorListAllOf.ts models/ValidatorMedia.ts +models/ValidatorSignedBlock.ts models/ValidatorsResponse.ts models/VerificationLevel.ts models/index.ts diff --git a/src/vendors/nexus/README.md b/src/vendors/nexus/README.md index 38c3e6b938..b8f1f4dafa 100644 --- a/src/vendors/nexus/README.md +++ b/src/vendors/nexus/README.md @@ -2,6 +2,25 @@ This folder contains generated typescript bindings for Nexus. +Validate @openapitools/openapi-generator-cli version: + +``` +npx @openapitools/openapi-generator-cli version +``` + +In order to use type mappings make sure to use at least `7.10.0` version. +To bump version use a following command: + +``` +npx @openapitools/openapi-generator-cli version-manager set 7.10.0 +``` + +You can also use `version-manager`: + +``` +npx @openapitools/openapi-generator-cli version-manager list +``` + To update the bindings: 1. Update openapi.json based on @@ -14,7 +33,8 @@ To update the bindings: -i openapi.json \ -g typescript-fetch \ -o . \ - --additional-properties=modelPropertyNaming=original,typescriptThreePlus=true + --additional-properties=modelPropertyNaming=original,typescriptThreePlus=true \ + --type-mappings string+date-time=string ``` or @@ -27,7 +47,8 @@ To update the bindings: -i openapi.json \ -g typescript-fetch \ -o . \ - --additional-properties=modelPropertyNaming=original,typescriptThreePlus=true + --additional-properties=modelPropertyNaming=original,typescriptThreePlus=true \ + --type-mappings string+date-time=string ``` 3. Lint: diff --git a/src/vendors/nexus/apis/DefaultApi.ts b/src/vendors/nexus/apis/DefaultApi.ts index 9ca668b489..c3fc6eda66 100644 --- a/src/vendors/nexus/apis/DefaultApi.ts +++ b/src/vendors/nexus/apis/DefaultApi.ts @@ -126,9 +126,6 @@ import { TokenHolderList, TokenHolderListFromJSON, TokenHolderListToJSON, - Transaction, - TransactionFromJSON, - TransactionToJSON, TransactionList, TransactionListFromJSON, TransactionListToJSON, @@ -184,6 +181,7 @@ export interface ConsensusBlocksGetRequest { after?: Date; before?: Date; hash?: string; + proposedBy?: string; } export interface ConsensusBlocksHeightGetRequest { @@ -371,6 +369,7 @@ export interface RuntimeEvmTokensGetRequest { limit?: number; offset?: number; name?: string; + sortBy?: RuntimeEvmTokensGetSortByEnum; } export interface RuntimeStatusGetRequest { @@ -385,6 +384,7 @@ export interface RuntimeTransactionsGetRequest { after?: Date; before?: Date; rel?: string; + method?: string; } export interface RuntimeTransactionsTxHashGetRequest { @@ -647,6 +647,10 @@ export class DefaultApi extends runtime.BaseAPI { queryParameters['hash'] = requestParameters.hash; } + if (requestParameters.proposedBy !== undefined) { + queryParameters['proposed_by'] = requestParameters.proposedBy; + } + const headerParameters: runtime.HTTPHeaders = {}; const response = await this.request({ @@ -1172,9 +1176,9 @@ export class DefaultApi extends runtime.BaseAPI { } /** - * Returns a consensus transaction. + * Returns consensus transactions with the given transaction hash. */ - async consensusTransactionsTxHashGetRaw(requestParameters: ConsensusTransactionsTxHashGetRequest): Promise> { + 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.'); } @@ -1190,13 +1194,13 @@ export class DefaultApi extends runtime.BaseAPI { query: queryParameters, }); - return new runtime.JSONApiResponse(response, (jsonValue) => TransactionFromJSON(jsonValue)); + return new runtime.JSONApiResponse(response, (jsonValue) => TransactionListFromJSON(jsonValue)); } /** - * Returns a consensus transaction. + * Returns consensus transactions with the given transaction hash. */ - async consensusTransactionsTxHashGet(requestParameters: ConsensusTransactionsTxHashGetRequest): Promise { + async consensusTransactionsTxHashGet(requestParameters: ConsensusTransactionsTxHashGetRequest): Promise { const response = await this.consensusTransactionsTxHashGetRaw(requestParameters); return await response.value(); } @@ -1815,6 +1819,10 @@ export class DefaultApi extends runtime.BaseAPI { queryParameters['name'] = requestParameters.name; } + if (requestParameters.sortBy !== undefined) { + queryParameters['sort_by'] = requestParameters.sortBy; + } + const headerParameters: runtime.HTTPHeaders = {}; const response = await this.request({ @@ -1899,6 +1907,10 @@ export class DefaultApi extends runtime.BaseAPI { queryParameters['rel'] = requestParameters.rel; } + if (requestParameters.method !== undefined) { + queryParameters['method'] = requestParameters.method; + } + const headerParameters: runtime.HTTPHeaders = {}; const response = await this.request({ @@ -1954,3 +1966,12 @@ export class DefaultApi extends runtime.BaseAPI { } } + +/** + * @export + * @enum {string} + */ +export enum RuntimeEvmTokensGetSortByEnum { + TotalHolders = 'total_holders', + MarketCap = 'market_cap' +} diff --git a/src/vendors/nexus/models/AddressPreimage.ts b/src/vendors/nexus/models/AddressPreimage.ts index 2d8c9a45b7..ea551f65bb 100644 --- a/src/vendors/nexus/models/AddressPreimage.ts +++ b/src/vendors/nexus/models/AddressPreimage.ts @@ -28,7 +28,7 @@ import { * 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. + * determines how the signatures for this address are verified. * * Consensus supports only "staking addresses" (`context="oasis-core/address: staking"` * below; always ed25519-backed). diff --git a/src/vendors/nexus/models/Block.ts b/src/vendors/nexus/models/Block.ts index 2062bbade2..1eb54ebd8d 100644 --- a/src/vendors/nexus/models/Block.ts +++ b/src/vendors/nexus/models/Block.ts @@ -13,6 +13,13 @@ */ import { exists, mapValues } from '../runtime'; +import { + EntityInfo, + EntityInfoFromJSON, + EntityInfoFromJSONTyped, + EntityInfoToJSON, +} from './'; + /** * A consensus block. * @export @@ -69,6 +76,18 @@ export interface Block { * @memberof Block */ state_root: string; + /** + * The entity that proposed this block. + * @type {EntityInfo} + * @memberof Block + */ + proposer: EntityInfo; + /** + * A list of the entities that signed the block. + * @type {Array} + * @memberof Block + */ + signers?: Array; } export function BlockFromJSON(json: any): Block { @@ -89,6 +108,8 @@ export function BlockFromJSONTyped(json: any, ignoreDiscriminator: boolean): Blo 'size_limit': !exists(json, 'size_limit') ? undefined : json['size_limit'], 'epoch': json['epoch'], 'state_root': json['state_root'], + 'proposer': EntityInfoFromJSON(json['proposer']), + 'signers': !exists(json, 'signers') ? undefined : ((json['signers'] as Array).map(EntityInfoFromJSON)), }; } @@ -109,6 +130,8 @@ export function BlockToJSON(value?: Block | null): any { 'size_limit': value.size_limit, 'epoch': value.epoch, 'state_root': value.state_root, + 'proposer': EntityInfoToJSON(value.proposer), + 'signers': value.signers === undefined ? undefined : ((value.signers as Array).map(EntityInfoToJSON)), }; } diff --git a/src/vendors/nexus/models/ConsensusEvent.ts b/src/vendors/nexus/models/ConsensusEvent.ts index 262ddea624..9b3068045a 100644 --- a/src/vendors/nexus/models/ConsensusEvent.ts +++ b/src/vendors/nexus/models/ConsensusEvent.ts @@ -73,6 +73,12 @@ export interface ConsensusEvent { * @memberof ConsensusEvent */ roothash_runtime_round?: number; + /** + * The second-granular consensus time of this event's block. + * @type {Date} + * @memberof ConsensusEvent + */ + timestamp?: Date; /** * The type of the event. * @type {ConsensusEventType} @@ -106,6 +112,7 @@ export function ConsensusEventFromJSONTyped(json: any, ignoreDiscriminator: bool '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'], + 'timestamp': !exists(json, 'timestamp') ? undefined : (new Date(json['timestamp'])), 'type': ConsensusEventTypeFromJSON(json['type']), 'body': json['body'], }; @@ -126,6 +133,7 @@ export function ConsensusEventToJSON(value?: ConsensusEvent | null): any { 'roothash_runtime_id': value.roothash_runtime_id, 'roothash_runtime': RuntimeToJSON(value.roothash_runtime), 'roothash_runtime_round': value.roothash_runtime_round, + 'timestamp': value.timestamp === undefined ? undefined : (value.timestamp.toISOString()), 'type': ConsensusEventTypeToJSON(value.type), 'body': value.body, }; diff --git a/src/vendors/nexus/models/EntityInfo.ts b/src/vendors/nexus/models/EntityInfo.ts new file mode 100644 index 0000000000..3474fcf0e5 --- /dev/null +++ b/src/vendors/nexus/models/EntityInfo.ts @@ -0,0 +1,83 @@ +/* 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'; +/** + * Light-weight entity information, containing only its ID, address and registry metadata. + * @export + * @interface EntityInfo + */ +export interface EntityInfo { + /** + * The ID of the entity owning the node; this corresponds to the entity's public key in base64. + * @type {string} + * @memberof EntityInfo + */ + entity_id?: string; + /** + * Address of the entity owning the node, in Bech32 format (`oasis1...`). + * @type {string} + * @memberof EntityInfo + */ + entity_address?: string; + /** + * Metadata about an entity, if available. See [the metadata registry](https://github.com/oasisprotocol/metadata-registry) for details. + * + * When available, it is an object with some subset of the following fields: + * + * - `v`: The version of the metadata structure (always present). + * - `serial`: The serial number of the metadata statement (always present). + * - `name`: The name of the entity. + * - `url`: The URL associated with the entity. + * - `email`: The email address associated with the entity. + * - `keybase`: Tne entity's keybase.io handle. + * - `twitter`: The twitter handle associated with the entity. + * @type {any} + * @memberof EntityInfo + */ + entity_metadata?: any | null; +} + +export function EntityInfoFromJSON(json: any): EntityInfo { + return EntityInfoFromJSONTyped(json, false); +} + +export function EntityInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean): EntityInfo { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'entity_id': !exists(json, 'entity_id') ? undefined : json['entity_id'], + 'entity_address': !exists(json, 'entity_address') ? undefined : json['entity_address'], + 'entity_metadata': !exists(json, 'entity_metadata') ? undefined : json['entity_metadata'], + }; +} + +export function EntityInfoToJSON(value?: EntityInfo | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'entity_id': value.entity_id, + 'entity_address': value.entity_address, + 'entity_metadata': value.entity_metadata, + }; +} + + diff --git a/src/vendors/nexus/models/EvmRefToken.ts b/src/vendors/nexus/models/EvmRefToken.ts new file mode 100644 index 0000000000..33d333be18 --- /dev/null +++ b/src/vendors/nexus/models/EvmRefToken.ts @@ -0,0 +1,93 @@ +/* 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 './'; + +/** + * + * @export + * @interface EvmRefToken + */ +export interface EvmRefToken { + /** + * 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 EvmRefToken + */ + type: EvmTokenType; + /** + * Name of the token, as provided by token contract's `name()` method. + * @type {string} + * @memberof EvmRefToken + */ + name?: string; + /** + * Symbol of the token, as provided by token contract's `symbol()` method. + * @type {string} + * @memberof EvmRefToken + */ + 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 EvmRefToken + */ + decimals?: number; +} + +export function EvmRefTokenFromJSON(json: any): EvmRefToken { + return EvmRefTokenFromJSONTyped(json, false); +} + +export function EvmRefTokenFromJSONTyped(json: any, ignoreDiscriminator: boolean): EvmRefToken { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'type': EvmTokenTypeFromJSON(json['type']), + 'name': !exists(json, 'name') ? undefined : json['name'], + 'symbol': !exists(json, 'symbol') ? undefined : json['symbol'], + 'decimals': !exists(json, 'decimals') ? undefined : json['decimals'], + }; +} + +export function EvmRefTokenToJSON(value?: EvmRefToken | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'type': EvmTokenTypeToJSON(value.type), + 'name': value.name, + 'symbol': value.symbol, + 'decimals': value.decimals, + }; +} + + diff --git a/src/vendors/nexus/models/EvmToken.ts b/src/vendors/nexus/models/EvmToken.ts index de87571cb0..a3346f983b 100644 --- a/src/vendors/nexus/models/EvmToken.ts +++ b/src/vendors/nexus/models/EvmToken.ts @@ -14,6 +14,14 @@ import { exists, mapValues } from '../runtime'; import { + EvmRefToken, + EvmRefTokenFromJSON, + EvmRefTokenFromJSONTyped, + EvmRefTokenToJSON, + EvmTokenSwap, + EvmTokenSwapFromJSON, + EvmTokenSwapFromJSONTyped, + EvmTokenSwapToJSON, EvmTokenType, EvmTokenTypeFromJSON, EvmTokenTypeFromJSONTyped, @@ -89,6 +97,43 @@ export interface EvmToken { * @memberof EvmToken */ num_holders: number; + /** + * Information about a swap contract between this token and a + * reference token. The relative price and relative total value of + * this token are estimated based on this swap contract. + * @type {EvmTokenSwap} + * @memberof EvmToken + */ + ref_swap?: EvmTokenSwap; + /** + * Information about the reference token. The relative price and + * relative total value are expressed in this reference token's base + * unit. + * @type {EvmRefToken} + * @memberof EvmToken + */ + ref_token?: EvmRefToken; + /** + * The relative price and relative total value are expressed in this + * reference token's base unit. + * @type {string} + * @memberof EvmToken + */ + relative_token_address?: string; + /** + * The relative price of one base unit of this token is this many of + * the relative token's base unit. + * @type {number} + * @memberof EvmToken + */ + relative_price?: number; + /** + * The relative price of this token multiplied by this token's total + * supply, in the relative token's base unit. + * @type {number} + * @memberof EvmToken + */ + relative_total_value?: number; /** * Whether the contract has been successfully verified by Sourcify. * Additional information on verified contracts is available via @@ -125,6 +170,11 @@ export function EvmTokenFromJSONTyped(json: any, ignoreDiscriminator: boolean): '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'], + 'ref_swap': !exists(json, 'ref_swap') ? undefined : EvmTokenSwapFromJSON(json['ref_swap']), + 'ref_token': !exists(json, 'ref_token') ? undefined : EvmRefTokenFromJSON(json['ref_token']), + 'relative_token_address': !exists(json, 'relative_token_address') ? undefined : json['relative_token_address'], + 'relative_price': !exists(json, 'relative_price') ? undefined : json['relative_price'], + 'relative_total_value': !exists(json, 'relative_total_value') ? undefined : json['relative_total_value'], 'is_verified': json['is_verified'], 'verification_level': !exists(json, 'verification_level') ? undefined : VerificationLevelFromJSON(json['verification_level']), }; @@ -148,6 +198,11 @@ export function EvmTokenToJSON(value?: EvmToken | null): any { 'total_supply': value.total_supply, 'num_transfers': value.num_transfers, 'num_holders': value.num_holders, + 'ref_swap': EvmTokenSwapToJSON(value.ref_swap), + 'ref_token': EvmRefTokenToJSON(value.ref_token), + 'relative_token_address': value.relative_token_address, + 'relative_price': value.relative_price, + 'relative_total_value': value.relative_total_value, 'is_verified': value.is_verified, 'verification_level': VerificationLevelToJSON(value.verification_level), }; diff --git a/src/vendors/nexus/models/EvmTokenSwap.ts b/src/vendors/nexus/models/EvmTokenSwap.ts new file mode 100644 index 0000000000..206a6e8fa4 --- /dev/null +++ b/src/vendors/nexus/models/EvmTokenSwap.ts @@ -0,0 +1,145 @@ +/* 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 EvmTokenSwap + */ +export interface EvmTokenSwap { + /** + * The Oasis address of the swap pair contract. + * @type {string} + * @memberof EvmTokenSwap + */ + pair_address: string; + /** + * The Ethereum-compatible address of the swap pair contract. + * @type {string} + * @memberof EvmTokenSwap + */ + pair_address_eth?: string; + /** + * The Oasis address of the swap factory contract. + * @type {string} + * @memberof EvmTokenSwap + */ + factory_address?: string; + /** + * The Ethereum-compatible address of the swap factory contract. + * @type {string} + * @memberof EvmTokenSwap + */ + factory_address_eth?: string; + /** + * The Oasis address of the first token in this swap. + * @type {string} + * @memberof EvmTokenSwap + */ + token0_address?: string; + /** + * The Ethereum-compatible address of the first token in this swap + * @type {string} + * @memberof EvmTokenSwap + */ + token0_address_eth?: string; + /** + * The Oasis address of the second token in this swap. + * @type {string} + * @memberof EvmTokenSwap + */ + token1_address?: string; + /** + * The Ethereum-compatible address of the second token in this swap. + * @type {string} + * @memberof EvmTokenSwap + */ + token1_address_eth?: string; + /** + * The round when this swap pair was created. + * @type {number} + * @memberof EvmTokenSwap + */ + create_round?: number; + /** + * The swap's liquidity pool of the first token, in that token's base units. + * @type {string} + * @memberof EvmTokenSwap + */ + reserve0?: string; + /** + * The swap's liquidity pool of the second token, in that token's base units. + * @type {string} + * @memberof EvmTokenSwap + */ + reserve1?: string; + /** + * The round when this swap pair last updated its reserves. + * @type {number} + * @memberof EvmTokenSwap + */ + last_sync_round?: number; +} + +export function EvmTokenSwapFromJSON(json: any): EvmTokenSwap { + return EvmTokenSwapFromJSONTyped(json, false); +} + +export function EvmTokenSwapFromJSONTyped(json: any, ignoreDiscriminator: boolean): EvmTokenSwap { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'pair_address': json['pair_address'], + 'pair_address_eth': !exists(json, 'pair_address_eth') ? undefined : json['pair_address_eth'], + 'factory_address': !exists(json, 'factory_address') ? undefined : json['factory_address'], + 'factory_address_eth': !exists(json, 'factory_address_eth') ? undefined : json['factory_address_eth'], + 'token0_address': !exists(json, 'token0_address') ? undefined : json['token0_address'], + 'token0_address_eth': !exists(json, 'token0_address_eth') ? undefined : json['token0_address_eth'], + 'token1_address': !exists(json, 'token1_address') ? undefined : json['token1_address'], + 'token1_address_eth': !exists(json, 'token1_address_eth') ? undefined : json['token1_address_eth'], + 'create_round': !exists(json, 'create_round') ? undefined : json['create_round'], + 'reserve0': !exists(json, 'reserve0') ? undefined : json['reserve0'], + 'reserve1': !exists(json, 'reserve1') ? undefined : json['reserve1'], + 'last_sync_round': !exists(json, 'last_sync_round') ? undefined : json['last_sync_round'], + }; +} + +export function EvmTokenSwapToJSON(value?: EvmTokenSwap | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'pair_address': value.pair_address, + 'pair_address_eth': value.pair_address_eth, + 'factory_address': value.factory_address, + 'factory_address_eth': value.factory_address_eth, + 'token0_address': value.token0_address, + 'token0_address_eth': value.token0_address_eth, + 'token1_address': value.token1_address, + 'token1_address_eth': value.token1_address_eth, + 'create_round': value.create_round, + 'reserve0': value.reserve0, + 'reserve1': value.reserve1, + 'last_sync_round': value.last_sync_round, + }; +} + + diff --git a/src/vendors/nexus/models/ProposalTarget.ts b/src/vendors/nexus/models/ProposalTarget.ts index 58ac18fb93..4b3c6620b7 100644 --- a/src/vendors/nexus/models/ProposalTarget.ts +++ b/src/vendors/nexus/models/ProposalTarget.ts @@ -14,7 +14,7 @@ import { exists, mapValues } from '../runtime'; /** - * The target propotocol versions for this upgrade proposal. + * The target protocol versions for this upgrade proposal. * @export * @interface ProposalTarget */ diff --git a/src/vendors/nexus/models/RoothashMessage.ts b/src/vendors/nexus/models/RoothashMessage.ts index c28474d2ca..f26cc4151f 100644 --- a/src/vendors/nexus/models/RoothashMessage.ts +++ b/src/vendors/nexus/models/RoothashMessage.ts @@ -45,7 +45,7 @@ export interface RoothashMessage { */ index: number; /** - * The type of thies message. + * The type of this message. * @type {RoothashMessageType} * @memberof RoothashMessage */ diff --git a/src/vendors/nexus/models/RuntimeEvent.ts b/src/vendors/nexus/models/RuntimeEvent.ts index 336f6c477d..4885d1915b 100644 --- a/src/vendors/nexus/models/RuntimeEvent.ts +++ b/src/vendors/nexus/models/RuntimeEvent.ts @@ -55,7 +55,7 @@ export interface RuntimeEvent { */ tx_hash?: string; /** - * Ethereum trasnsaction hash of this event's originating transaction. + * Ethereum transaction hash of this event's originating transaction. * Absent if the event did not originate from an EVM transaction. * @type {string} * @memberof RuntimeEvent diff --git a/src/vendors/nexus/models/RuntimeEventType.ts b/src/vendors/nexus/models/RuntimeEventType.ts index ac23ec87ff..5577304027 100644 --- a/src/vendors/nexus/models/RuntimeEventType.ts +++ b/src/vendors/nexus/models/RuntimeEventType.ts @@ -27,7 +27,10 @@ export enum RuntimeEventType { ConsensusAccountsUndelegateStart = 'consensus_accounts.undelegate_start', ConsensusAccountsUndelegateDone = 'consensus_accounts.undelegate_done', CoreGasUsed = 'core.gas_used', - EvmLog = 'evm.log' + EvmLog = 'evm.log', + RoflAppCreated = 'rofl.app_created', + RoflAppUpdated = 'rofl.app_updated', + RoflAppRemoved = 'rofl.app_removed' } export function RuntimeEventTypeFromJSON(json: any): RuntimeEventType { diff --git a/src/vendors/nexus/models/RuntimeTransaction.ts b/src/vendors/nexus/models/RuntimeTransaction.ts index acb70cdad6..bf87a9d74a 100644 --- a/src/vendors/nexus/models/RuntimeTransaction.ts +++ b/src/vendors/nexus/models/RuntimeTransaction.ts @@ -22,6 +22,10 @@ import { RuntimeTransactionEncryptionEnvelopeFromJSON, RuntimeTransactionEncryptionEnvelopeFromJSONTyped, RuntimeTransactionEncryptionEnvelopeToJSON, + RuntimeTransactionSigner, + RuntimeTransactionSignerFromJSON, + RuntimeTransactionSignerFromJSONTyped, + RuntimeTransactionSignerToJSON, TxError, TxErrorFromJSON, TxErrorFromJSONTyped, @@ -65,23 +69,31 @@ export interface RuntimeTransaction { * @memberof RuntimeTransaction */ eth_hash?: string; + /** + * The signers of this transaction. + * @type {Array} + * @memberof RuntimeTransaction + */ + signers: Array; /** * 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. + * DEPRECATED: This field will be removed in the future in favor of the signers field. * @type {string} * @memberof RuntimeTransaction */ sender_0: string; /** * The Ethereum address of this transaction's 0th signer. + * DEPRECATED: This field will be removed in the future in favor of the signers field. * @type {string} * @memberof RuntimeTransaction */ sender_0_eth?: string; /** * The nonce used with this transaction's 0th signer, to prevent replay. + * DEPRECATED: This field will be removed in the future in favor of the signers field. * @type {number} * @memberof RuntimeTransaction */ @@ -139,6 +151,14 @@ export interface RuntimeTransaction { * @memberof RuntimeTransaction */ size: number; + /** + * The data relevant to the Oasis-style encrypted transaction. + * 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](https://en.wikipedia.org/wiki/Hybrid_cryptosystem#Envelope_encryption). + * @type {RuntimeTransactionEncryptionEnvelope} + * @memberof RuntimeTransaction + */ + oasis_encryption_envelope?: RuntimeTransactionEncryptionEnvelope; /** * 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: @@ -149,6 +169,10 @@ export interface RuntimeTransaction { * - "consensus.Undelegate" * - "evm.Create" * - "evm.Call" + * - "rofl.Create" + * - "rofl.Update" + * - "rofl.Remove" + * - "rofl.Register" * May be null if the transaction was malformed or encrypted. * @type {string} * @memberof RuntimeTransaction @@ -206,10 +230,10 @@ export interface RuntimeTransaction { */ amount_symbol?: string; /** - * The data relevant to the encrypted transaction. Only present for encrypted + * The data relevant to the EVM 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). + * which differ slightly from [digital envelopes](https://en.wikipedia.org/wiki/Hybrid_cryptosystem#Envelope_encryption). * @type {RuntimeTransactionEncryptionEnvelope} * @memberof RuntimeTransaction */ @@ -258,6 +282,7 @@ export function RuntimeTransactionFromJSONTyped(json: any, ignoreDiscriminator: 'timestamp': (new Date(json['timestamp'])), 'hash': json['hash'], 'eth_hash': !exists(json, 'eth_hash') ? undefined : json['eth_hash'], + 'signers': ((json['signers'] as Array).map(RuntimeTransactionSignerFromJSON)), 'sender_0': json['sender_0'], 'sender_0_eth': !exists(json, 'sender_0_eth') ? undefined : json['sender_0_eth'], 'nonce_0': json['nonce_0'], @@ -269,6 +294,7 @@ export function RuntimeTransactionFromJSONTyped(json: any, ignoreDiscriminator: 'gas_used': json['gas_used'], 'charged_fee': json['charged_fee'], 'size': json['size'], + 'oasis_encryption_envelope': !exists(json, 'oasis_encryption_envelope') ? undefined : RuntimeTransactionEncryptionEnvelopeFromJSON(json['oasis_encryption_envelope']), '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'], @@ -298,6 +324,7 @@ export function RuntimeTransactionToJSON(value?: RuntimeTransaction | null): any 'timestamp': (value.timestamp.toISOString()), 'hash': value.hash, 'eth_hash': value.eth_hash, + 'signers': ((value.signers as Array).map(RuntimeTransactionSignerToJSON)), 'sender_0': value.sender_0, 'sender_0_eth': value.sender_0_eth, 'nonce_0': value.nonce_0, @@ -309,6 +336,7 @@ export function RuntimeTransactionToJSON(value?: RuntimeTransaction | null): any 'gas_used': value.gas_used, 'charged_fee': value.charged_fee, 'size': value.size, + 'oasis_encryption_envelope': RuntimeTransactionEncryptionEnvelopeToJSON(value.oasis_encryption_envelope), 'method': value.method, 'body': value.body, 'is_likely_native_token_transfer': value.is_likely_native_token_transfer, diff --git a/src/vendors/nexus/models/RuntimeTransactionSigner.ts b/src/vendors/nexus/models/RuntimeTransactionSigner.ts new file mode 100644 index 0000000000..3d574c8f35 --- /dev/null +++ b/src/vendors/nexus/models/RuntimeTransactionSigner.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 RuntimeTransactionSigner + */ +export interface RuntimeTransactionSigner { + /** + * The Oasis address of the transaction signer. + * @type {string} + * @memberof RuntimeTransactionSigner + */ + address: string; + /** + * The Ethereum address of this transaction signer. + * @type {string} + * @memberof RuntimeTransactionSigner + */ + address_eth?: string; + /** + * The transaction signer nonce. + * @type {number} + * @memberof RuntimeTransactionSigner + */ + nonce: number; +} + +export function RuntimeTransactionSignerFromJSON(json: any): RuntimeTransactionSigner { + return RuntimeTransactionSignerFromJSONTyped(json, false); +} + +export function RuntimeTransactionSignerFromJSONTyped(json: any, ignoreDiscriminator: boolean): RuntimeTransactionSigner { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'address': json['address'], + 'address_eth': !exists(json, 'address_eth') ? undefined : json['address_eth'], + 'nonce': json['nonce'], + }; +} + +export function RuntimeTransactionSignerToJSON(value?: RuntimeTransactionSigner | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'address': value.address, + 'address_eth': value.address_eth, + 'nonce': value.nonce, + }; +} + + diff --git a/src/vendors/nexus/models/TxError.ts b/src/vendors/nexus/models/TxError.ts index 848e584a07..5df63b3e00 100644 --- a/src/vendors/nexus/models/TxError.ts +++ b/src/vendors/nexus/models/TxError.ts @@ -57,7 +57,7 @@ export interface TxError { * 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'. + * If this field is present, `message` will include the name of the error, e.g. 'InsufficientBalance'. * 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} diff --git a/src/vendors/nexus/models/Validator.ts b/src/vendors/nexus/models/Validator.ts index d0598fb962..ec0d99317d 100644 --- a/src/vendors/nexus/models/Validator.ts +++ b/src/vendors/nexus/models/Validator.ts @@ -26,6 +26,10 @@ import { ValidatorMediaFromJSON, ValidatorMediaFromJSONTyped, ValidatorMediaToJSON, + ValidatorSignedBlock, + ValidatorSignedBlockFromJSON, + ValidatorSignedBlockFromJSONTyped, + ValidatorSignedBlockToJSON, } from './'; /** @@ -112,6 +116,12 @@ export interface Validator { * @memberof Validator */ current_commission_bound: ValidatorCommissionBound; + /** + * An array containing details of the last 100 consensus blocks, indicating whether each block was signed by the validator. Only available when querying a single validator. + * @type {Array} + * @memberof Validator + */ + signed_blocks?: Array; } export function ValidatorFromJSON(json: any): Validator { @@ -137,6 +147,7 @@ export function ValidatorFromJSONTyped(json: any, ignoreDiscriminator: boolean): 'media': !exists(json, 'media') ? undefined : ValidatorMediaFromJSON(json['media']), 'current_rate': json['current_rate'], 'current_commission_bound': ValidatorCommissionBoundFromJSON(json['current_commission_bound']), + 'signed_blocks': !exists(json, 'signed_blocks') ? undefined : ((json['signed_blocks'] as Array).map(ValidatorSignedBlockFromJSON)), }; } @@ -162,6 +173,7 @@ export function ValidatorToJSON(value?: Validator | null): any { 'media': ValidatorMediaToJSON(value.media), 'current_rate': value.current_rate, 'current_commission_bound': ValidatorCommissionBoundToJSON(value.current_commission_bound), + 'signed_blocks': value.signed_blocks === undefined ? undefined : ((value.signed_blocks as Array).map(ValidatorSignedBlockToJSON)), }; } diff --git a/src/vendors/nexus/models/ValidatorHistoryPoint.ts b/src/vendors/nexus/models/ValidatorHistoryPoint.ts index 68a40f1df9..62abd6b8d0 100644 --- a/src/vendors/nexus/models/ValidatorHistoryPoint.ts +++ b/src/vendors/nexus/models/ValidatorHistoryPoint.ts @@ -26,14 +26,14 @@ export interface ValidatorHistoryPoint { */ epoch: number; /** - * The amount of tokens that were delegated to this validator account, + * 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, + * 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 @@ -41,7 +41,7 @@ export interface 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 + * 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 @@ -49,7 +49,7 @@ export interface 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 + * 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 diff --git a/src/vendors/nexus/models/ValidatorSignedBlock.ts b/src/vendors/nexus/models/ValidatorSignedBlock.ts new file mode 100644 index 0000000000..9da43b31aa --- /dev/null +++ b/src/vendors/nexus/models/ValidatorSignedBlock.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'; +/** + * Information whether a block was signed by the validator. + * @export + * @interface ValidatorSignedBlock + */ +export interface ValidatorSignedBlock { + /** + * The block height. + * @type {number} + * @memberof ValidatorSignedBlock + */ + height: number; + /** + * Whether the validator signed the block. + * @type {boolean} + * @memberof ValidatorSignedBlock + */ + signed: boolean; +} + +export function ValidatorSignedBlockFromJSON(json: any): ValidatorSignedBlock { + return ValidatorSignedBlockFromJSONTyped(json, false); +} + +export function ValidatorSignedBlockFromJSONTyped(json: any, ignoreDiscriminator: boolean): ValidatorSignedBlock { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'height': json['height'], + 'signed': json['signed'], + }; +} + +export function ValidatorSignedBlockToJSON(value?: ValidatorSignedBlock | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'height': value.height, + 'signed': value.signed, + }; +} + + diff --git a/src/vendors/nexus/models/index.ts b/src/vendors/nexus/models/index.ts index b9709f7080..62b2045866 100644 --- a/src/vendors/nexus/models/index.ts +++ b/src/vendors/nexus/models/index.ts @@ -23,6 +23,7 @@ export * from './Delegation' export * from './DelegationList' export * from './DelegationListAllOf' export * from './Entity' +export * from './EntityInfo' export * from './EntityList' export * from './EntityListAllOf' export * from './Epoch' @@ -34,9 +35,11 @@ export * from './EvmEventToken' export * from './EvmNft' export * from './EvmNftList' export * from './EvmNftListAllOf' +export * from './EvmRefToken' export * from './EvmToken' export * from './EvmTokenList' export * from './EvmTokenListAllOf' +export * from './EvmTokenSwap' export * from './EvmTokenType' export * from './InlineResponse400' export * from './Layer' @@ -74,6 +77,7 @@ export * from './RuntimeTransaction' export * from './RuntimeTransactionEncryptionEnvelope' export * from './RuntimeTransactionList' export * from './RuntimeTransactionListAllOf' +export * from './RuntimeTransactionSigner' export * from './Status' export * from './TokenHolderList' export * from './TokenHolderListAllOf' @@ -92,5 +96,6 @@ export * from './ValidatorHistoryPoint' export * from './ValidatorList' export * from './ValidatorListAllOf' export * from './ValidatorMedia' +export * from './ValidatorSignedBlock' export * from './ValidatorsResponse' export * from './VerificationLevel' diff --git a/src/vendors/nexus/openapi.json b/src/vendors/nexus/openapi.json index b5474f68b1..cefcd017ff 100644 --- a/src/vendors/nexus/openapi.json +++ b/src/vendors/nexus/openapi.json @@ -226,6 +226,18 @@ }, "description": "A filter on the block hash.", "example": "0a29ac21fa69bb9e43e5cb25d10826ff3946f1ce977e82f99a2614206a50765c" + }, + { + "in": "query", + "name": "proposed_by", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/StakingAddress" + } + ] + }, + "description": "A filter on the proposer of the block." } ], "responses": { @@ -405,7 +417,7 @@ }, "/consensus/transactions/{tx_hash}": { "get": { - "summary": "Returns a consensus transaction.", + "summary": "Returns consensus transactions with the given transaction hash.", "parameters": [ { "in": "path", @@ -414,17 +426,17 @@ "schema": { "type": "string" }, - "description": "The transaction hash of the transaction to return.", + "description": "The transaction hash of the transaction(s) to return.\nThis endpoint can return multiple transactions in cases,\nwhere an already processed transaction is re-sent. In such cases\nonly a single transaction will be successfully processed, others\nwill have a failed status (e.g. 'Invalid nonce').\n", "example": "0d0531d6b8a468c07440182b1cdda517f5a076d69fb2199126a83082ecfc0f41" } ], "responses": { "200": { - "description": "A JSON object containing a consensus transaction.", + "description": "The requested consensus transaction(s).", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Transaction" + "$ref": "#/components/schemas/TransactionList" } } } @@ -1006,7 +1018,7 @@ ], "responses": { "200": { - "description": "A JSON object containing historical information for a \nvalidator, grouped by epoch in reverse chronological order.\n", + "description": "A JSON object containing historical information for a\nvalidator, grouped by epoch in reverse chronological order.\n", "content": { "application/json": { "schema": { @@ -1834,6 +1846,15 @@ } }, "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" + }, + { + "in": "query", + "name": "method", + "schema": { + "type": "string" + }, + "description": "A filter on the runtime transaction method.\n\nIn addition to the existing method names, the following special values are supported:\n - 'native_transfers': Returns transactions \"likely to be native transfers\".\n - These include accounts.Transfer transactions and evm.Calls with an empty 'body' field.\n\n - 'evm.Call_no_native': Returns EVM calls that are \"not likely to be native transfers\".\n", + "example": "accounts.Transfer" } ], "responses": { @@ -2118,6 +2139,15 @@ "type": "string" }, "description": "A filter on the name, the name or symbol must contain this value as a substring." + }, + { + "in": "query", + "name": "sort_by", + "schema": { + "type": "string", + "enum": ["total_holders", "market_cap"] + }, + "description": "The field to sort the tokens by.\nIf unset, the tokens will be sorted by number of holders.\n" } ], "responses": { @@ -2939,7 +2969,16 @@ }, "Block": { "type": "object", - "required": ["height", "hash", "timestamp", "num_transactions", "gas_limit", "epoch", "state_root"], + "required": [ + "height", + "hash", + "timestamp", + "num_transactions", + "gas_limit", + "epoch", + "state_root", + "proposer" + ], "properties": { "height": { "type": "integer", @@ -2990,10 +3029,49 @@ "type": "string", "description": "The Merkle root of the state tree after applying the block.", "example": "8e39bf193f8a954ab8f8d7cb6388c591fd0785ea060bbd8e3752e266b54499d3" + }, + "proposer": { + "allOf": [ + { + "$ref": "#/components/schemas/EntityInfo" + } + ], + "description": "The entity that proposed this block." + }, + "signers": { + "type": "array", + "items": { + "allOf": [ + { + "$ref": "#/components/schemas/EntityInfo" + } + ] + }, + "description": "A list of the entities that signed the block." } }, "description": "A consensus block.\n" }, + "EntityInfo": { + "type": "object", + "description": "Light-weight entity information, containing only its ID, address and registry metadata.", + "properties": { + "entity_id": { + "type": "string", + "description": "The ID of the entity owning the node; this corresponds to the entity's public key in base64.", + "example": "`TqUyj5Q+9vZtqu10yw6Zw7HEX3Ywe0JQA9vHyzY47TU=`" + }, + "entity_address": { + "type": "string", + "description": "Address of the entity owning the node, in Bech32 format (`oasis1...`).", + "example": "`oasis1qzzd6khm3acqskpxlk9vd5044cmmcce78y5l6000`" + }, + "entity_metadata": { + "description": "Metadata about an entity, if available. See [the metadata registry](https://github.com/oasisprotocol/metadata-registry) for details.\n\nWhen available, it is an object with some subset of the following fields:\n\n- `v`: The version of the metadata structure (always present).\n- `serial`: The serial number of the metadata statement (always present).\n- `name`: The name of the entity.\n- `url`: The URL associated with the entity.\n- `email`: The email address associated with the entity.\n- `keybase`: Tne entity's keybase.io handle.\n- `twitter`: The twitter handle associated with the entity.\n", + "example": "An entity with all fields:\n\n {\n \"v\": 1,\n \"serial\": 1,\n \"name\": \"Entity display name\",\n \"url\": \"https://example.org/entity\",\n \"email\": \"entity@example.org\",\n \"keybase\": \"keybase_handle\",\n \"twitter\": \"twitter_handle\"\n }\n" + } + } + }, "Delegation": { "type": "object", "required": ["amount", "shares", "validator", "delegator"], @@ -3297,7 +3375,7 @@ } ] }, - "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" + "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. 'InsufficientBalance'.\nNote that users should be cautious when evaluating error data since the\ndata origin is not tracked and error information can be faked.\n" } } }, @@ -3392,6 +3470,12 @@ "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" }, + "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": [ { @@ -3470,7 +3554,7 @@ "$ref": "#/components/schemas/RoothashMessageType" } ], - "description": "The type of thies message.\n", + "description": "The type of this message.\n", "example": "staking.withdraw" }, "body": { @@ -3768,10 +3852,38 @@ "$ref": "#/components/schemas/ValidatorCommissionBound" } ] + }, + "signed_blocks": { + "type": "array", + "description": "An array containing details of the last 100 consensus blocks, indicating whether each block was signed by the validator. Only available when querying a single validator.", + "items": { + "allOf": [ + { + "$ref": "#/components/schemas/ValidatorSignedBlock" + } + ] + } } }, "description": "An validator registered at the consensus layer.\n" }, + "ValidatorSignedBlock": { + "type": "object", + "required": ["height", "signed"], + "properties": { + "height": { + "type": "integer", + "format": "int64", + "description": "The block height.", + "example": 8048956 + }, + "signed": { + "type": "boolean", + "description": "Whether the validator signed the block." + } + }, + "description": "Information whether a block was signed by the validator.\n" + }, "Escrow": { "type": "object", "properties": { @@ -3883,7 +3995,7 @@ "$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" + "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": [ @@ -3891,7 +4003,7 @@ "$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" + "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": [ @@ -3899,7 +4011,7 @@ "$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" + "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": [ @@ -3907,7 +4019,7 @@ "$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" + "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", @@ -4036,7 +4148,7 @@ ] }, "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", + "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 signatures 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": { @@ -4387,7 +4499,7 @@ "type": "string" } }, - "description": "The target propotocol versions for this upgrade proposal." + "description": "The target protocol versions for this upgrade proposal." }, "ProposalState": { "type": "string", @@ -4658,7 +4770,7 @@ }, "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" + "description": "Ethereum transaction hash of this event's originating transaction.\nAbsent if the event did not originate from an EVM transaction.\n" }, "timestamp": { "type": "string", @@ -4716,7 +4828,10 @@ "consensus_accounts.undelegate_start", "consensus_accounts.undelegate_done", "core.gas_used", - "evm.log" + "evm.log", + "rofl.app_created", + "rofl.app_updated", + "rofl.app_removed" ], "example": "consensus_accounts.deposit" }, @@ -4859,6 +4974,7 @@ "index", "timestamp", "hash", + "signers", "sender_0", "nonce_0", "fee", @@ -4897,24 +5013,38 @@ "description": "The Ethereum cryptographic hash of this transaction's encoding.\nAbsent for non-Ethereum-format transactions.\n", "example": "9e6a5837c6366d4a7e477c71ffe32d40915cdef7ef209792259e5ee70caf2705" }, + "signers": { + "type": "array", + "items": { + "allOf": [ + { + "$ref": "#/components/schemas/RuntimeTransactionSigner" + } + ] + }, + "description": "The signers of this transaction." + }, "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", + "deprecated": true, + "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.\nDEPRECATED: This field will be removed in the future in favor of the signers field.\n", "example": "oasis1qz670t637yyxshnlxhjj5074wgwl94d0x5x69zqd" }, "sender_0_eth": { "type": "string", - "description": "The Ethereum address of this transaction's 0th signer.\n", + "deprecated": true, + "description": "The Ethereum address of this transaction's 0th signer.\nDEPRECATED: This field will be removed in the future in favor of the signers field.\n", "example": 1.2367698861069356e48 }, "nonce_0": { "type": "integer", "format": "uint64", - "description": "The nonce used with this transaction's 0th signer, to prevent replay.", + "deprecated": true, + "description": "The nonce used with this transaction's 0th signer, to prevent replay.\nDEPRECATED: This field will be removed in the future in favor of the signers field.\n", "example": 114194 }, "fee": { @@ -4955,9 +5085,17 @@ "format": "int32", "description": "The total byte size of the transaction." }, + "oasis_encryption_envelope": { + "allOf": [ + { + "$ref": "#/components/schemas/RuntimeTransactionEncryptionEnvelope" + } + ], + "description": "The data relevant to the Oasis-style encrypted transaction.\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](https://en.wikipedia.org/wiki/Hybrid_cryptosystem#Envelope_encryption).\n" + }, "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", + "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\"\n - \"rofl.Create\"\n - \"rofl.Update\"\n - \"rofl.Remove\"\n - \"rofl.Register\"\nMay be null if the transaction was malformed or encrypted.\n", "example": "evm.Call" }, "body": { @@ -5004,7 +5142,7 @@ "$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" + "description": "The data relevant to the EVM 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](https://en.wikipedia.org/wiki/Hybrid_cryptosystem#Envelope_encryption).\n" }, "success": { "type": "boolean", @@ -5076,6 +5214,32 @@ } } }, + "RuntimeTransactionSigner": { + "type": "object", + "required": ["address", "nonce"], + "properties": { + "address": { + "allOf": [ + { + "$ref": "#/components/schemas/Address" + } + ], + "description": "The Oasis address of the transaction signer.\n", + "example": "oasis1qz670t637yyxshnlxhjj5074wgwl94d0x5x69zqd" + }, + "address_eth": { + "type": "string", + "description": "The Ethereum address of this transaction signer.\n", + "example": 1.2367698861069356e48 + }, + "nonce": { + "type": "integer", + "format": "uint64", + "description": "The transaction signer nonce.", + "example": 114194 + } + } + }, "RuntimeAccount": { "type": "object", "required": ["address", "balances", "evm_balances", "stats"], @@ -5246,6 +5410,36 @@ "description": "The number of addresses that have a nonzero balance of this token.\n", "example": 123 }, + "ref_swap": { + "allOf": [ + { + "$ref": "#/components/schemas/EvmTokenSwap" + } + ], + "description": "Information about a swap contract between this token and a\nreference token. The relative price and relative total value of\nthis token are estimated based on this swap contract.\n" + }, + "ref_token": { + "allOf": [ + { + "$ref": "#/components/schemas/EvmRefToken" + } + ], + "description": "Information about the reference token. The relative price and\nrelative total value are expressed in this reference token's base\nunit.\n" + }, + "relative_token_address": { + "type": "string", + "description": "The relative price and relative total value are expressed in this\nreference token's base unit.\n" + }, + "relative_price": { + "type": "number", + "format": "double", + "description": "The relative price of one base unit of this token is this many of\nthe relative token's base unit.\n" + }, + "relative_total_value": { + "type": "number", + "format": "double", + "description": "The relative price of this token multiplied by this token's total\nsupply, in the relative token's base unit.\n" + }, "is_verified": { "deprecated": true, "type": "boolean", @@ -5261,6 +5455,99 @@ } } }, + "EvmTokenSwap": { + "type": "object", + "required": ["pair_address"], + "properties": { + "pair_address": { + "type": "string", + "description": "The Oasis address of the swap pair contract.\n" + }, + "pair_address_eth": { + "type": "string", + "description": "The Ethereum-compatible address of the swap pair contract.\n" + }, + "factory_address": { + "type": "string", + "description": "The Oasis address of the swap factory contract.\n" + }, + "factory_address_eth": { + "type": "string", + "description": "The Ethereum-compatible address of the swap factory contract.\n" + }, + "token0_address": { + "type": "string", + "description": "The Oasis address of the first token in this swap.\n" + }, + "token0_address_eth": { + "type": "string", + "description": "The Ethereum-compatible address of the first token in this swap\n" + }, + "token1_address": { + "type": "string", + "description": "The Oasis address of the second token in this swap.\n" + }, + "token1_address_eth": { + "type": "string", + "description": "The Ethereum-compatible address of the second token in this swap.\n" + }, + "create_round": { + "type": "integer", + "format": "int64", + "description": "The round when this swap pair was created.\n" + }, + "reserve0": { + "allOf": [ + { + "$ref": "#/components/schemas/TextBigInt" + } + ], + "description": "The swap's liquidity pool of the first token, in that token's base units.\n" + }, + "reserve1": { + "allOf": [ + { + "$ref": "#/components/schemas/TextBigInt" + } + ], + "description": "The swap's liquidity pool of the second token, in that token's base units.\n" + }, + "last_sync_round": { + "type": "integer", + "format": "int64", + "description": "The round when this swap pair last updated its reserves.\n" + } + } + }, + "EvmRefToken": { + "type": "object", + "required": ["type"], + "properties": { + "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" + }, + "name": { + "type": "string", + "description": "Name of the token, as provided by token contract's `name()` method.", + "example": "Wrapped ROSE" + }, + "symbol": { + "type": "string", + "description": "Symbol of the token, as provided by token contract's `symbol()` method.", + "example": "wROSE" + }, + "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 + } + } + }, "EvmNftList": { "allOf": [ {