From 3d54731572b86530404d7536b6e01868f8785e92 Mon Sep 17 00:00:00 2001 From: Csillag Kristof Date: Fri, 27 Oct 2023 21:39:42 +0200 Subject: [PATCH] Re-generate API wrapper code with orval v6.19.1 --- src/oasis-nexus/generated/api.ts | 789 +++++++++++++++---------------- 1 file changed, 378 insertions(+), 411 deletions(-) diff --git a/src/oasis-nexus/generated/api.ts b/src/oasis-nexus/generated/api.ts index 20996a39e..1af954dee 100644 --- a/src/oasis-nexus/generated/api.ts +++ b/src/oasis-nexus/generated/api.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.18.1 🍺 + * Generated by orval v6.19.1 🍺 * Do not edit manually. * Oasis Nexus API V1 * An API for accessing indexed data from the Oasis Network. @@ -9,10 +9,10 @@ import { useQuery } from '@tanstack/react-query' import type { - UseQueryOptions, QueryFunction, - UseQueryResult, - QueryKey + QueryKey, + UseQueryOptions, + UseQueryResult } from '@tanstack/react-query' import getStatusMutator from '../replaceNetworkWithBaseURL'; import GetConsensusBlocksMutator from '../replaceNetworkWithBaseURL'; @@ -558,10 +558,10 @@ export type HumanReadableErrorResponse = { }; export interface ActiveAccounts { - /** The date for the end of the daily active accounts measurement window. */ - window_end: string; /** The number of active accounts for the 24hour window ending at window_end. */ active_accounts: number; + /** The date for the end of the daily active accounts measurement window. */ + window_end: string; } /** @@ -575,10 +575,10 @@ export interface ActiveAccountsList { } export interface TxVolume { - /** The end timestamp for this daily transaction volume measurement. */ - window_end: string; /** The transaction volume for this window. */ tx_volume: number; + /** The end timestamp for this daily transaction volume measurement. */ + window_end: string; } /** @@ -592,47 +592,47 @@ export interface TxVolumeList { } export interface AccountStats { - /** The total number of tokens sent, in base units. */ - total_sent: string; - /** The total number of tokens received, in base units. */ - total_received: string; /** The total number of transactions this account was involved with. */ num_txns: number; + /** The total number of tokens received, in base units. */ + total_received: string; + /** The total number of tokens sent, in base units. */ + total_sent: string; } export interface EvmToken { /** The Oasis address of this token's contract. */ contract_addr: 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. + */ + decimals?: number; /** The Ethereum address of this token's contract. */ eth_contract_addr: string; + /** Whether the contract has been successfully verified by Sourcify. +Additional information on verified contracts is available via +the `/{runtime}/accounts/{address}` endpoint. + */ + is_verified: boolean; /** Name of the token, as provided by token contract's `name()` method. */ name?: string; + /** The number of addresses that have a nonzero balance of this token. + */ + num_holders: number; + /** The total number of transfers of this token. + */ + num_transfers?: number; /** Symbol of the token, as provided by token contract's `symbol()` method. */ 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. - */ - decimals?: number; + /** The total number of base units available. */ + total_supply?: string; /** 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; - /** The total number of base units available. */ - total_supply?: string; - /** The total number of transfers of this token. - */ - num_transfers?: number; - /** The number of addresses that have a nonzero balance of this token. - */ - 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. - */ - is_verified: boolean; } /** @@ -679,30 +679,30 @@ managed by smart contracts deployed in this runtime. For example, in EVM-compati this does not include ERC-20 tokens */ balances: RuntimeSdkBalance[]; - /** Data on the EVM smart contract associated with this account address. Only present for accounts -that represent a smart contract on EVM. - */ - 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. */ evm_balances: RuntimeEvmBalance[]; + /** Data on the EVM smart contract associated with this account address. Only present for accounts +that represent a smart contract on EVM. + */ + evm_contract?: RuntimeEvmContract; stats: AccountStats; } export interface RuntimeTransactionEncryptionEnvelope { + /** The base64-encoded encrypted transaction data. */ + data?: string; + /** The base64-encoded nonce used to encrypt the transaction data. */ + data_nonce?: string; /** The format of the encrypted evm transaction envelope. */ format: string; /** The base64-encoded public key used to encrypt the transaction. */ public_key?: string; - /** The base64-encoded nonce used to encrypt the transaction data. */ - data_nonce?: string; - /** The base64-encoded encrypted transaction data. */ - data?: string; - /** The base64-encoded nonce used to encrypt the transaction results. */ - result_nonce?: string; /** The base64-encoded encrypted result data. */ result?: string; + /** The base64-encoded nonce used to encrypt the transaction results. */ + result_nonce?: string; } /** @@ -715,29 +715,30 @@ export type RuntimeTransactionBody = { [key: string]: any }; */ export interface RuntimeTransaction { - /** The block round at which this transaction was executed. */ - round: number; - /** The 0-based index of this transaction in the block. */ - index: number; - /** The second-granular consensus time when this tx's block was proposed. */ - timestamp: string; - /** The Oasis cryptographic hash of this transaction's encoding. */ - hash: 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. + */ + amount?: string; + /** The method call body. May be null if the transaction was malformed. */ + body?: RuntimeTransactionBody; + /** The fee that was charged for the transaction execution (total, native denomination, +ParaTime base units, as a string). +Calculated as `gas_price * gas_used`, where `gas_price = fee / gas_limit`. + */ + charged_fee: 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). + */ + encryption_envelope?: RuntimeTransactionEncryptionEnvelope; + /** Error details of a failed transaction. */ + error?: TxError; /** The Ethereum cryptographic hash of this transaction's encoding. Absent for non-Ethereum-format transactions. */ 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. - */ - sender_0: string; - /** The Ethereum address of this transaction's 0th signer. - */ - sender_0_eth?: string; - /** The nonce used with this transaction's 0th signer, to prevent replay. */ - nonce_0: number; /** The fee that this transaction's sender committed to pay to execute it (total, native denomination, ParaTime base units, as a string). */ @@ -748,13 +749,18 @@ execute it. gas_limit: number; /** The total gas used by the transaction. */ gas_used: number; - /** The fee that was charged for the transaction execution (total, native denomination, -ParaTime base units, as a string). -Calculated as `gas_price * gas_used`, where `gas_price = fee / gas_limit`. + /** The Oasis cryptographic hash of this transaction's encoding. */ + hash: string; + /** The 0-based index of this transaction in the block. */ + index: number; + /** 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. */ - charged_fee: string; - /** The total byte size of the transaction. */ - size: number; + is_likely_native_token_transfer?: boolean; /** 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" @@ -767,16 +773,27 @@ In practice, Nexus currently expects only the following methods: May be null if the transaction was malformed or encrypted. */ method?: string; - /** The method call body. May be null if the transaction was malformed. */ - body?: RuntimeTransactionBody; - /** 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. + /** The nonce used with this transaction's 0th signer, to prevent replay. */ + nonce_0: number; + /** The block round at which this transaction was executed. */ + round: number; + /** 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. */ - is_likely_native_token_transfer?: boolean; + sender_0: string; + /** The Ethereum address of this transaction's 0th signer. + */ + sender_0_eth?: string; + /** The total byte size of the transaction. */ + size: number; + /** Whether this transaction successfully executed. +Can be absent (meaning "unknown") for confidential runtimes. + */ + success?: boolean; + /** The second-granular consensus time when this tx's block was proposed. */ + timestamp: string; /** 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. @@ -791,23 +808,6 @@ if applicable. The meaning varies based on the transaction method. Some notable /** A reasonable "to" Ethereum address associated with this transaction, */ 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. - */ - amount?: 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). - */ - encryption_envelope?: RuntimeTransactionEncryptionEnvelope; - /** Whether this transaction successfully executed. -Can be absent (meaning "unknown") for confidential runtimes. - */ - success?: boolean; - /** Error details of a failed transaction. */ - error?: TxError; } /** @@ -840,6 +840,12 @@ Includes the smart contract's [ABI](https://docs.soliditylang.org/en/develop/abi } export interface RuntimeEvmContract { + /** 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. + */ + creation_bytecode?: string; /** 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. @@ -849,20 +855,14 @@ to a direct `Create` call. Encoded as a lowercase hex string. */ 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. - */ - creation_bytecode?: string; + /** The total amount of gas used to create or call this contract. */ + gas_used: number; /** 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). */ runtime_bytecode?: string; - /** The total amount of gas used to create or call this contract. */ - gas_used: number; /** Additional information obtained from contract verification. Only available for smart contracts that have been verified successfully by Sourcify. */ @@ -874,14 +874,14 @@ contracts that have been verified successfully by Sourcify. */ export interface EvmEventToken { - type?: EvmTokenType; - /** Symbol of the token, as provided by token contract's `symbol()` method. */ - 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. */ decimals?: number; + /** Symbol of the token, as provided by token contract's `symbol()` method. */ + symbol?: string; + type?: EvmTokenType; } /** @@ -893,10 +893,10 @@ Values of other EVM types (integer types, strings, arrays, etc.) are represented */ export interface EvmEventParam { - /** The parameter name. */ - name: string; /** The solidity type of the event parameter. */ evm_type: string; + /** The parameter name. */ + name: string; /** The parameter value. */ value: unknown; } @@ -929,25 +929,6 @@ export type RuntimeEventBody = { [key: string]: any }; * An event emitted by the runtime layer */ export interface RuntimeEvent { - /** The block height at which this event was generated. */ - round: number; - /** 0-based index of this event's originating transaction within its block. -Absent if the event did not originate from a transaction. - */ - tx_index?: number; - /** Hash of this event's originating transaction. -Absent if the event did not originate from a transaction. - */ - tx_hash?: string | null; - /** Ethereum trasnsaction hash of this event's originating transaction. -Absent if the event did not originate from an EVM transaction. - */ - eth_tx_hash?: string; - /** The second-granular consensus time of this event's block. - */ - timestamp: string; - /** The type of the event. */ - type: RuntimeEventType; /** The decoded event contents. 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 @@ -955,6 +936,10 @@ the hierarchy (e.g. `MintEvent` from `accounts > Event > MintEvent`), OR `evm > Event`. */ body: RuntimeEventBody; + /** Ethereum trasnsaction hash of this event's originating transaction. +Absent if the event did not originate from an EVM transaction. + */ + eth_tx_hash?: string; /** If the event type is `evm.log`, this field describes the human-readable type of evm event, e.g. `Transfer`. We currently only support two types of evm events, ERC20 `Transfer` and `Approve`. Absent if the event type is not `evm.log`. @@ -966,6 +951,21 @@ Absent if the event type is not `evm.log`. */ evm_log_params?: EvmEventParam[]; evm_token?: EvmEventToken; + /** The block height at which this event was generated. */ + round: number; + /** The second-granular consensus time of this event's block. + */ + timestamp: string; + /** Hash of this event's originating transaction. +Absent if the event did not originate from a transaction. + */ + tx_hash?: string | null; + /** 0-based index of this event's originating transaction within its block. +Absent if the event did not originate from a transaction. + */ + tx_index?: number; + /** The type of the event. */ + type: RuntimeEventType; } /** @@ -983,18 +983,18 @@ export type RuntimeEventList = List & RuntimeEventListAllOf; */ export interface RuntimeBlock { - /** The block round. */ - round: number; + /** The total gas used by all transactions in the block. */ + gas_used: number; /** The block header hash. */ hash: string; - /** The second-granular consensus time. */ - timestamp: string; /** The number of transactions in the block. */ num_transactions: number; + /** The block round. */ + round: number; /** The total byte size of all transactions in the block. */ size: number; - /** The total gas used by all transactions in the block. */ - gas_used: number; + /** The second-granular consensus time. */ + timestamp: string; } /** @@ -1032,8 +1032,8 @@ export type ProposalVotes = List & ProposalVotesAllOf; */ export interface ProposalTarget { consensus_protocol?: string; - runtime_host_protocol?: string; runtime_committee_protocol?: string; + runtime_host_protocol?: string; } /** @@ -1041,30 +1041,30 @@ export interface ProposalTarget { */ export interface Proposal { - /** The unique identifier of the proposal. */ - id: number; - /** The staking address of the proposal submitter. */ - submitter: string; - /** The state of the proposal. */ - state: string; - /** The deposit attached to this proposal. */ - deposit: string; - /** The name of the upgrade handler. */ - handler?: string; - target?: ProposalTarget; - /** The epoch at which the proposed upgrade will happen. */ - epoch?: number; /** The proposal to cancel, if this proposal proposes cancelling an existing proposal. */ cancels?: number; - /** The epoch at which this proposal was created. */ - created_at: number; /** The epoch at which voting for this proposal will close. */ closes_at: number; + /** The epoch at which this proposal was created. */ + created_at: number; + /** The deposit attached to this proposal. */ + deposit: string; + /** The epoch at which the proposed upgrade will happen. */ + epoch?: number; + /** The name of the upgrade handler. */ + handler?: string; + /** The unique identifier of the proposal. */ + id: number; /** The number of invalid votes for this proposal, after tallying. */ invalid_votes: string; + /** The state of the proposal. */ + state: string; + /** The staking address of the proposal submitter. */ + submitter: string; + target?: ProposalTarget; } /** @@ -1082,12 +1082,12 @@ export type ProposalList = List & ProposalListAllOf; */ export interface Epoch { + /** The (inclusive) height at which this epoch ended. Omitted if the epoch is still active. */ + end_height?: number; /** The epoch number. */ id: number; /** The (inclusive) height at which this epoch started. */ start_height: number; - /** The (inclusive) height at which this epoch ended. Omitted if the epoch is still active. */ - end_height?: number; } /** @@ -1114,24 +1114,24 @@ export interface Allowance { export interface Account { /** The staking address for this account. */ address: string; - /** A nonce used to prevent replay. */ - nonce: number; + /** The allowances made by this account. */ + allowances: Allowance[]; /** The available balance, in base units. */ available: string; - /** The active escrow balance, in base units. */ - escrow: string; /** The debonding escrow balance, in base units. */ debonding: string; - /** The delegations balance, in base units. -For efficiency, this field is omitted when listing multiple-accounts. - */ - delegations_balance?: string; /** The debonding delegations balance, in base units. For efficiency, this field is omitted when listing multiple-accounts. */ debonding_delegations_balance?: string; - /** The allowances made by this account. */ - allowances: Allowance[]; + /** The delegations balance, in base units. +For efficiency, this field is omitted when listing multiple-accounts. + */ + delegations_balance?: string; + /** The active escrow balance, in base units. */ + escrow: string; + /** A nonce used to prevent replay. */ + nonce: number; } /** @@ -1139,12 +1139,12 @@ For efficiency, this field is omitted when listing multiple-accounts. */ export interface BareTokenHolder { - /** The oasis address of the account holder. */ - holder_address: string; - /** The Ethereum address of the same account holder, if meaningfully defined. */ - eth_holder_address?: string; /** Number of tokens held, in base units. */ balance: string; + /** The Ethereum address of the same account holder, if meaningfully defined. */ + eth_holder_address?: string; + /** The oasis address of the account holder. */ + holder_address: string; } /** @@ -1167,13 +1167,13 @@ export interface RuntimeEvmBalance { token_contract_addr: string; /** The EVM address of this token's contract. */ token_contract_addr_eth: string; - /** The token ticker symbol. Not guaranteed to be unique across distinct EVM tokens. */ - token_symbol?: string; + /** The number of decimals of precision for this token. */ + token_decimals: number; /** The name of the token. Not guaranteed to be unique across distinct EVM tokens. */ token_name?: string; + /** The token ticker symbol. Not guaranteed to be unique across distinct EVM tokens. */ + token_symbol?: string; token_type: EvmTokenType; - /** The number of decimals of precision for this token. */ - token_decimals: number; } /** @@ -1182,10 +1182,10 @@ export interface RuntimeEvmBalance { export interface RuntimeSdkBalance { /** Number of tokens held, in base units. */ balance: string; - /** The token ticker symbol. Unique across all oasis-sdk tokens in the same runtime. */ - token_symbol: string; /** The number of decimals of precision for this token. */ token_decimals: number; + /** The token ticker symbol. Unique across all oasis-sdk tokens in the same runtime. */ + token_symbol: string; } export type AddressDerivationContext = typeof AddressDerivationContext[keyof typeof AddressDerivationContext]; @@ -1220,16 +1220,16 @@ ERC20 tokens or tools such as Metamask cannot interact with staking addresses. */ export interface AddressPreimage { - /** The method by which the oasis address was derived from `address_data`. - */ - context: AddressDerivationContext; - /** Version of the `context`. */ - context_version?: number | null; /** 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!). */ address_data: string; + /** The method by which the oasis address was derived from `address_data`. + */ + context: AddressDerivationContext; + /** Version of the `context`. */ + context_version?: number | null; } /** @@ -1247,25 +1247,25 @@ export type AccountList = List & AccountListAllOf; */ export interface Node { - /** The public key identifying this node. */ - id: string; + /** The unique identifier of this node as a consensus member */ + consensus_pubkey: string; /** The public key identifying the entity controlling this node. */ entity_id: string; /** The epoch in which this node's commitment expires. */ expiration: number; - /** The public key used for establishing TLS connections. */ - tls_pubkey: string; - /** The public key that will be used for establishing TLS connections -upon rotation. - */ - tls_next_pubkey: string; + /** The public key identifying this node. */ + id: string; /** The unique identifier of this node on the P2P transport. */ p2p_pubkey: string; - /** The unique identifier of this node as a consensus member */ - consensus_pubkey: string; /** A bitmask representing this node's roles. */ roles: string; + /** The public key that will be used for establishing TLS connections +upon rotation. + */ + tls_next_pubkey: string; + /** The public key used for establishing TLS connections. */ + tls_pubkey: string; } /** @@ -1280,25 +1280,25 @@ export type NodeListAllOf = { export type NodeList = List & NodeListAllOf; export interface ValidatorMedia { - /** An URL associated with the entity. */ - website_link?: string; /** An email address for the validator. */ email_address?: string; - /** A Twitter handle. */ - twitter_acc?: string; - /** An Telegram handle. */ - tg_chat?: string; /** A logo type. */ logotype?: string; /** The human-readable name of this validator. */ name?: string; + /** An Telegram handle. */ + tg_chat?: string; + /** A Twitter handle. */ + twitter_acc?: string; + /** An URL associated with the entity. */ + website_link?: string; } export interface ValidatorCommissionBound { + epoch_end: number; + epoch_start: number; lower: number; upper: number; - epoch_start: number; - epoch_end: number; } /** @@ -1306,22 +1306,22 @@ export interface ValidatorCommissionBound { */ export interface Validator { + /** Whether the entity is part of validator set (top by stake). */ + active: boolean; + current_commission_bound: ValidatorCommissionBound; + /** Commission rate. */ + current_rate: number; /** The staking address identifying this Validator. */ entity_address: string; /** The public key identifying this Validator. */ entity_id: string; - /** The public key identifying this Validator's node. */ - node_id: string; /** The amount staked. */ escrow: string; - /** Whether the entity is part of validator set (top by stake). */ - active: boolean; + media?: ValidatorMedia; + /** The public key identifying this Validator's node. */ + node_id: string; /** 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. */ status: boolean; - media?: ValidatorMedia; - /** Commission rate. */ - current_rate: number; - current_commission_bound: ValidatorCommissionBound; } /** @@ -1339,10 +1339,10 @@ export type ValidatorList = List & ValidatorListAllOf; */ export interface Entity { - /** The public key identifying this entity. */ - id: string; /** The staking address belonging to this entity; derived from the entity's public key. */ address: string; + /** The public key identifying this entity. */ + id: string; /** The vector of nodes owned by this entity. */ nodes: string[]; } @@ -1373,22 +1373,22 @@ export type ConsensusEventBody = { [key: string]: any }; export interface ConsensusEvent { /** The block height at which this event was generated. */ block: number; - /** 0-based index of this event's originating transaction within its block. -Absent if the event did not originate from a transaction. + /** 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` */ - tx_index?: number | null; + body: ConsensusEventBody; /** Hash of this event's originating transaction. Absent if the event did not originate from a transaction. */ tx_hash?: string | null; + /** 0-based index of this event's originating transaction within its block. +Absent if the event did not originate from a transaction. + */ + tx_index?: number | null; /** The type of the event. */ 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` - */ - body: ConsensusEventBody; } /** @@ -1427,12 +1427,12 @@ export const ConsensusEventType = { } as const; export interface TxError { - /** The module of a failed transaction. */ - module?: string; /** The status code of a failed transaction. */ code: number; /** The message of a failed transaction. */ message?: string; + /** The module of a failed transaction. */ + module?: string; } /** @@ -1475,30 +1475,30 @@ export const ConsensusTxMethod = { export interface Transaction { /** The block height at which this transaction was executed. */ block: number; - /** 0-based index of this transaction in its block */ - 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). - */ - timestamp: string; - /** The cryptographic hash of this transaction's encoding. */ - hash: string; - /** The address of who sent this transaction. */ - sender: string; - /** The nonce used with this transaction, to prevent replay. */ - nonce: number; + /** The method call body. */ + body: string; + /** Error details of a failed transaction. */ + error?: TxError; /** The fee that this transaction's sender committed to pay to execute it. */ fee: string; + /** The cryptographic hash of this transaction's encoding. */ + hash: string; + /** 0-based index of this transaction in its block */ + index: number; /** The method that was called. */ method: ConsensusTxMethod; - /** The method call body. */ - body: string; + /** The nonce used with this transaction, to prevent replay. */ + nonce: number; + /** The address of who sent this transaction. */ + sender: string; /** Whether this transaction successfully executed. */ success: boolean; - /** Error details of a failed transaction. */ - error?: TxError; + /** 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). + */ + timestamp: string; } /** @@ -1508,14 +1508,14 @@ to pay to execute it. export interface DebondingDelegation { /** The amount of tokens delegated in base units. */ amount: string; + /** The epoch at which the debonding ends. */ + debond_end: number; + /** The delegator address. */ + delegator: string; /** The shares of tokens delegated. */ shares: string; /** The delegatee (validator) address. */ validator: string; - /** The delegator address. */ - delegator: string; - /** The epoch at which the debonding ends. */ - debond_end: number; } /** @@ -1535,12 +1535,12 @@ export type DebondingDelegationList = List & DebondingDelegationListAllOf; export interface Delegation { /** The amount of tokens delegated in base units. */ amount: string; + /** The delegator address. */ + delegator: string; /** The shares of tokens delegated. */ shares: string; /** The delegatee (validator) address. */ validator: string; - /** The delegator address. */ - delegator: string; } /** @@ -1558,14 +1558,14 @@ export type DelegationList = List & DelegationListAllOf; */ export interface Block { - /** The block height. */ - height: number; /** The block header hash. */ hash: string; - /** The second-granular consensus time. */ - timestamp: string; + /** The block height. */ + height: number; /** Number of transactions in the block. */ num_transactions: number; + /** The second-granular consensus time. */ + timestamp: string; } export type BlockListAllOf = { @@ -1577,21 +1577,21 @@ export interface Status { how far behind Nexus is from the chain. */ latest_block: number; - /** The height of the most recently produced block on-chain as seen by Nexus. */ - latest_node_block: number; /** The RFC 3339 formatted consensus time of when the most recently indexed block was produced. */ latest_block_time: string; + /** The height of the most recently produced block on-chain as seen by Nexus. */ + latest_node_block: number; /** The number of milliseconds since Nexus processed the latest block. */ latest_update_age_ms: number; } export interface List { + /** Whether total_count is clipped for performance reasons. */ + is_total_count_clipped: boolean; /** The total number of records that match the query, i.e. the number of records the query would return with limit=infinity. */ total_count: number; - /** Whether total_count is clipped for performance reasons. */ - is_total_count_clipped: boolean; } /** @@ -1636,6 +1636,7 @@ type AwaitedInput = PromiseLike | T; ? P : never; + /** * @summary Returns the status of indexing. */ @@ -1656,24 +1657,23 @@ export const getGetStatusQueryKey = (network: 'mainnet' | 'testnet',) => { return [`/${network}/`] as const; } - export const getGetStatusQueryOptions = >, TError = HumanReadableErrorResponse | NotFoundErrorResponse>(network: 'mainnet' | 'testnet', options?: { query?:UseQueryOptions>, TError, TData>, request?: SecondParameter} ) => { - + const {query: queryOptions, request: requestOptions} = options ?? {}; const queryKey = queryOptions?.queryKey ?? getGetStatusQueryKey(network); - + const queryFn: QueryFunction>> = ({ signal }) => getStatus(network, requestOptions, signal); - - + + return { queryKey, queryFn, enabled: !!(network), ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } } @@ -1721,25 +1721,24 @@ export const getGetConsensusBlocksQueryKey = (network: 'mainnet' | 'testnet', return [`/${network}/consensus/blocks`, ...(params ? [params]: [])] as const; } - export const getGetConsensusBlocksQueryOptions = >, TError = HumanReadableErrorResponse | NotFoundErrorResponse>(network: 'mainnet' | 'testnet', params?: GetConsensusBlocksParams, options?: { query?:UseQueryOptions>, TError, TData>, request?: SecondParameter} ) => { - + const {query: queryOptions, request: requestOptions} = options ?? {}; const queryKey = queryOptions?.queryKey ?? getGetConsensusBlocksQueryKey(network,params); - + const queryFn: QueryFunction>> = ({ signal }) => GetConsensusBlocks(network,params, requestOptions, signal); - - + + return { queryKey, queryFn, enabled: !!(network), ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } } @@ -1787,25 +1786,24 @@ export const getGetConsensusBlocksHeightQueryKey = (network: 'mainnet' | 'testne return [`/${network}/consensus/blocks/${height}`] as const; } - export const getGetConsensusBlocksHeightQueryOptions = >, TError = HumanReadableErrorResponse | NotFoundErrorResponse>(network: 'mainnet' | 'testnet', height: number, options?: { query?:UseQueryOptions>, TError, TData>, request?: SecondParameter} ) => { - + const {query: queryOptions, request: requestOptions} = options ?? {}; const queryKey = queryOptions?.queryKey ?? getGetConsensusBlocksHeightQueryKey(network,height); - + const queryFn: QueryFunction>> = ({ signal }) => GetConsensusBlocksHeight(network,height, requestOptions, signal); - - + + return { queryKey, queryFn, enabled: !!(network && height), ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } } @@ -1854,25 +1852,24 @@ export const getGetConsensusTransactionsQueryKey = (network: 'mainnet' | 'testne return [`/${network}/consensus/transactions`, ...(params ? [params]: [])] as const; } - export const getGetConsensusTransactionsQueryOptions = >, TError = HumanReadableErrorResponse | NotFoundErrorResponse>(network: 'mainnet' | 'testnet', params?: GetConsensusTransactionsParams, options?: { query?:UseQueryOptions>, TError, TData>, request?: SecondParameter} ) => { - + const {query: queryOptions, request: requestOptions} = options ?? {}; const queryKey = queryOptions?.queryKey ?? getGetConsensusTransactionsQueryKey(network,params); - + const queryFn: QueryFunction>> = ({ signal }) => GetConsensusTransactions(network,params, requestOptions, signal); - - + + return { queryKey, queryFn, enabled: !!(network), ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } } @@ -1920,25 +1917,24 @@ export const getGetConsensusTransactionsTxHashQueryKey = (network: 'mainnet' | ' return [`/${network}/consensus/transactions/${txHash}`] as const; } - export const getGetConsensusTransactionsTxHashQueryOptions = >, TError = HumanReadableErrorResponse | NotFoundErrorResponse>(network: 'mainnet' | 'testnet', txHash: string, options?: { query?:UseQueryOptions>, TError, TData>, request?: SecondParameter} ) => { - + const {query: queryOptions, request: requestOptions} = options ?? {}; const queryKey = queryOptions?.queryKey ?? getGetConsensusTransactionsTxHashQueryKey(network,txHash); - + const queryFn: QueryFunction>> = ({ signal }) => GetConsensusTransactionsTxHash(network,txHash, requestOptions, signal); - - + + return { queryKey, queryFn, enabled: !!(network && txHash), ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } } @@ -1987,25 +1983,24 @@ export const getGetConsensusEventsQueryKey = (network: 'mainnet' | 'testnet', return [`/${network}/consensus/events`, ...(params ? [params]: [])] as const; } - export const getGetConsensusEventsQueryOptions = >, TError = HumanReadableErrorResponse | NotFoundErrorResponse>(network: 'mainnet' | 'testnet', params?: GetConsensusEventsParams, options?: { query?:UseQueryOptions>, TError, TData>, request?: SecondParameter} ) => { - + const {query: queryOptions, request: requestOptions} = options ?? {}; const queryKey = queryOptions?.queryKey ?? getGetConsensusEventsQueryKey(network,params); - + const queryFn: QueryFunction>> = ({ signal }) => GetConsensusEvents(network,params, requestOptions, signal); - - + + return { queryKey, queryFn, enabled: !!(network), ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } } @@ -2054,25 +2049,24 @@ export const getGetConsensusEntitiesQueryKey = (network: 'mainnet' | 'testnet', return [`/${network}/consensus/entities`, ...(params ? [params]: [])] as const; } - export const getGetConsensusEntitiesQueryOptions = >, TError = HumanReadableErrorResponse | NotFoundErrorResponse>(network: 'mainnet' | 'testnet', params?: GetConsensusEntitiesParams, options?: { query?:UseQueryOptions>, TError, TData>, request?: SecondParameter} ) => { - + const {query: queryOptions, request: requestOptions} = options ?? {}; const queryKey = queryOptions?.queryKey ?? getGetConsensusEntitiesQueryKey(network,params); - + const queryFn: QueryFunction>> = ({ signal }) => GetConsensusEntities(network,params, requestOptions, signal); - - + + return { queryKey, queryFn, enabled: !!(network), ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } } @@ -2120,25 +2114,24 @@ export const getGetConsensusEntitiesEntityIdQueryKey = (network: 'mainnet' | 'te return [`/${network}/consensus/entities/${entityId}`] as const; } - export const getGetConsensusEntitiesEntityIdQueryOptions = >, TError = HumanReadableErrorResponse | NotFoundErrorResponse>(network: 'mainnet' | 'testnet', entityId: string, options?: { query?:UseQueryOptions>, TError, TData>, request?: SecondParameter} ) => { - + const {query: queryOptions, request: requestOptions} = options ?? {}; const queryKey = queryOptions?.queryKey ?? getGetConsensusEntitiesEntityIdQueryKey(network,entityId); - + const queryFn: QueryFunction>> = ({ signal }) => GetConsensusEntitiesEntityId(network,entityId, requestOptions, signal); - - + + return { queryKey, queryFn, enabled: !!(network && entityId), ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } } @@ -2189,26 +2182,25 @@ export const getGetConsensusEntitiesEntityIdNodesQueryKey = (network: 'mainnet' return [`/${network}/consensus/entities/${entityId}/nodes`, ...(params ? [params]: [])] as const; } - export const getGetConsensusEntitiesEntityIdNodesQueryOptions = >, TError = HumanReadableErrorResponse | NotFoundErrorResponse>(network: 'mainnet' | 'testnet', entityId: string, params?: GetConsensusEntitiesEntityIdNodesParams, options?: { query?:UseQueryOptions>, TError, TData>, request?: SecondParameter} ) => { - + const {query: queryOptions, request: requestOptions} = options ?? {}; const queryKey = queryOptions?.queryKey ?? getGetConsensusEntitiesEntityIdNodesQueryKey(network,entityId,params); - + const queryFn: QueryFunction>> = ({ signal }) => GetConsensusEntitiesEntityIdNodes(network,entityId,params, requestOptions, signal); - - + + return { queryKey, queryFn, enabled: !!(network && entityId), ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } } @@ -2259,26 +2251,25 @@ export const getGetConsensusEntitiesEntityIdNodesNodeIdQueryKey = (network: 'mai return [`/${network}/consensus/entities/${entityId}/nodes/${nodeId}`] as const; } - export const getGetConsensusEntitiesEntityIdNodesNodeIdQueryOptions = >, TError = HumanReadableErrorResponse | NotFoundErrorResponse>(network: 'mainnet' | 'testnet', entityId: string, nodeId: string, options?: { query?:UseQueryOptions>, TError, TData>, request?: SecondParameter} ) => { - + const {query: queryOptions, request: requestOptions} = options ?? {}; const queryKey = queryOptions?.queryKey ?? getGetConsensusEntitiesEntityIdNodesNodeIdQueryKey(network,entityId,nodeId); - + const queryFn: QueryFunction>> = ({ signal }) => GetConsensusEntitiesEntityIdNodesNodeId(network,entityId,nodeId, requestOptions, signal); - - + + return { queryKey, queryFn, enabled: !!(network && entityId && nodeId), ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } } @@ -2328,25 +2319,24 @@ export const getGetConsensusValidatorsQueryKey = (network: 'mainnet' | 'testnet' return [`/${network}/consensus/validators`, ...(params ? [params]: [])] as const; } - export const getGetConsensusValidatorsQueryOptions = >, TError = HumanReadableErrorResponse | NotFoundErrorResponse>(network: 'mainnet' | 'testnet', params?: GetConsensusValidatorsParams, options?: { query?:UseQueryOptions>, TError, TData>, request?: SecondParameter} ) => { - + const {query: queryOptions, request: requestOptions} = options ?? {}; const queryKey = queryOptions?.queryKey ?? getGetConsensusValidatorsQueryKey(network,params); - + const queryFn: QueryFunction>> = ({ signal }) => GetConsensusValidators(network,params, requestOptions, signal); - - + + return { queryKey, queryFn, enabled: !!(network), ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } } @@ -2394,25 +2384,24 @@ export const getGetConsensusValidatorsEntityIdQueryKey = (network: 'mainnet' | ' return [`/${network}/consensus/validators/${entityId}`] as const; } - export const getGetConsensusValidatorsEntityIdQueryOptions = >, TError = HumanReadableErrorResponse | NotFoundErrorResponse>(network: 'mainnet' | 'testnet', entityId: string, options?: { query?:UseQueryOptions>, TError, TData>, request?: SecondParameter} ) => { - + const {query: queryOptions, request: requestOptions} = options ?? {}; const queryKey = queryOptions?.queryKey ?? getGetConsensusValidatorsEntityIdQueryKey(network,entityId); - + const queryFn: QueryFunction>> = ({ signal }) => GetConsensusValidatorsEntityId(network,entityId, requestOptions, signal); - - + + return { queryKey, queryFn, enabled: !!(network && entityId), ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } } @@ -2461,25 +2450,24 @@ export const getGetConsensusAccountsQueryKey = (network: 'mainnet' | 'testnet', return [`/${network}/consensus/accounts`, ...(params ? [params]: [])] as const; } - export const getGetConsensusAccountsQueryOptions = >, TError = HumanReadableErrorResponse | NotFoundErrorResponse>(network: 'mainnet' | 'testnet', params?: GetConsensusAccountsParams, options?: { query?:UseQueryOptions>, TError, TData>, request?: SecondParameter} ) => { - + const {query: queryOptions, request: requestOptions} = options ?? {}; const queryKey = queryOptions?.queryKey ?? getGetConsensusAccountsQueryKey(network,params); - + const queryFn: QueryFunction>> = ({ signal }) => GetConsensusAccounts(network,params, requestOptions, signal); - - + + return { queryKey, queryFn, enabled: !!(network), ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } } @@ -2527,25 +2515,24 @@ export const getGetConsensusAccountsAddressQueryKey = (network: 'mainnet' | 'tes return [`/${network}/consensus/accounts/${address}`] as const; } - export const getGetConsensusAccountsAddressQueryOptions = >, TError = HumanReadableErrorResponse | NotFoundErrorResponse>(network: 'mainnet' | 'testnet', address: string, options?: { query?:UseQueryOptions>, TError, TData>, request?: SecondParameter} ) => { - + const {query: queryOptions, request: requestOptions} = options ?? {}; const queryKey = queryOptions?.queryKey ?? getGetConsensusAccountsAddressQueryKey(network,address); - + const queryFn: QueryFunction>> = ({ signal }) => GetConsensusAccountsAddress(network,address, requestOptions, signal); - - + + return { queryKey, queryFn, enabled: !!(network && address), ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } } @@ -2596,26 +2583,25 @@ export const getGetConsensusAccountsAddressDelegationsQueryKey = (network: 'main return [`/${network}/consensus/accounts/${address}/delegations`, ...(params ? [params]: [])] as const; } - export const getGetConsensusAccountsAddressDelegationsQueryOptions = >, TError = HumanReadableErrorResponse | NotFoundErrorResponse>(network: 'mainnet' | 'testnet', address: string, params?: GetConsensusAccountsAddressDelegationsParams, options?: { query?:UseQueryOptions>, TError, TData>, request?: SecondParameter} ) => { - + const {query: queryOptions, request: requestOptions} = options ?? {}; const queryKey = queryOptions?.queryKey ?? getGetConsensusAccountsAddressDelegationsQueryKey(network,address,params); - + const queryFn: QueryFunction>> = ({ signal }) => GetConsensusAccountsAddressDelegations(network,address,params, requestOptions, signal); - - + + return { queryKey, queryFn, enabled: !!(network && address), ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } } @@ -2667,26 +2653,25 @@ export const getGetConsensusAccountsAddressDelegationsToQueryKey = (network: 'ma return [`/${network}/consensus/accounts/${address}/delegations_to`, ...(params ? [params]: [])] as const; } - export const getGetConsensusAccountsAddressDelegationsToQueryOptions = >, TError = HumanReadableErrorResponse | NotFoundErrorResponse>(network: 'mainnet' | 'testnet', address: string, params?: GetConsensusAccountsAddressDelegationsToParams, options?: { query?:UseQueryOptions>, TError, TData>, request?: SecondParameter} ) => { - + const {query: queryOptions, request: requestOptions} = options ?? {}; const queryKey = queryOptions?.queryKey ?? getGetConsensusAccountsAddressDelegationsToQueryKey(network,address,params); - + const queryFn: QueryFunction>> = ({ signal }) => GetConsensusAccountsAddressDelegationsTo(network,address,params, requestOptions, signal); - - + + return { queryKey, queryFn, enabled: !!(network && address), ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } } @@ -2738,26 +2723,25 @@ export const getGetConsensusAccountsAddressDebondingDelegationsQueryKey = (netwo return [`/${network}/consensus/accounts/${address}/debonding_delegations`, ...(params ? [params]: [])] as const; } - export const getGetConsensusAccountsAddressDebondingDelegationsQueryOptions = >, TError = HumanReadableErrorResponse | NotFoundErrorResponse>(network: 'mainnet' | 'testnet', address: string, params?: GetConsensusAccountsAddressDebondingDelegationsParams, options?: { query?:UseQueryOptions>, TError, TData>, request?: SecondParameter} ) => { - + const {query: queryOptions, request: requestOptions} = options ?? {}; const queryKey = queryOptions?.queryKey ?? getGetConsensusAccountsAddressDebondingDelegationsQueryKey(network,address,params); - + const queryFn: QueryFunction>> = ({ signal }) => GetConsensusAccountsAddressDebondingDelegations(network,address,params, requestOptions, signal); - - + + return { queryKey, queryFn, enabled: !!(network && address), ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } } @@ -2809,26 +2793,25 @@ export const getGetConsensusAccountsAddressDebondingDelegationsToQueryKey = (net return [`/${network}/consensus/accounts/${address}/debonding_delegations_to`, ...(params ? [params]: [])] as const; } - export const getGetConsensusAccountsAddressDebondingDelegationsToQueryOptions = >, TError = HumanReadableErrorResponse | NotFoundErrorResponse>(network: 'mainnet' | 'testnet', address: string, params?: GetConsensusAccountsAddressDebondingDelegationsToParams, options?: { query?:UseQueryOptions>, TError, TData>, request?: SecondParameter} ) => { - + const {query: queryOptions, request: requestOptions} = options ?? {}; const queryKey = queryOptions?.queryKey ?? getGetConsensusAccountsAddressDebondingDelegationsToQueryKey(network,address,params); - + const queryFn: QueryFunction>> = ({ signal }) => GetConsensusAccountsAddressDebondingDelegationsTo(network,address,params, requestOptions, signal); - - + + return { queryKey, queryFn, enabled: !!(network && address), ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } } @@ -2878,25 +2861,24 @@ export const getGetConsensusEpochsQueryKey = (network: 'mainnet' | 'testnet', return [`/${network}/consensus/epochs`, ...(params ? [params]: [])] as const; } - export const getGetConsensusEpochsQueryOptions = >, TError = HumanReadableErrorResponse | NotFoundErrorResponse>(network: 'mainnet' | 'testnet', params?: GetConsensusEpochsParams, options?: { query?:UseQueryOptions>, TError, TData>, request?: SecondParameter} ) => { - + const {query: queryOptions, request: requestOptions} = options ?? {}; const queryKey = queryOptions?.queryKey ?? getGetConsensusEpochsQueryKey(network,params); - + const queryFn: QueryFunction>> = ({ signal }) => GetConsensusEpochs(network,params, requestOptions, signal); - - + + return { queryKey, queryFn, enabled: !!(network), ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } } @@ -2944,25 +2926,24 @@ export const getGetConsensusEpochsEpochQueryKey = (network: 'mainnet' | 'testnet return [`/${network}/consensus/epochs/${epoch}`] as const; } - export const getGetConsensusEpochsEpochQueryOptions = >, TError = HumanReadableErrorResponse | NotFoundErrorResponse>(network: 'mainnet' | 'testnet', epoch: number, options?: { query?:UseQueryOptions>, TError, TData>, request?: SecondParameter} ) => { - + const {query: queryOptions, request: requestOptions} = options ?? {}; const queryKey = queryOptions?.queryKey ?? getGetConsensusEpochsEpochQueryKey(network,epoch); - + const queryFn: QueryFunction>> = ({ signal }) => GetConsensusEpochsEpoch(network,epoch, requestOptions, signal); - - + + return { queryKey, queryFn, enabled: !!(network && epoch), ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } } @@ -3011,25 +2992,24 @@ export const getGetConsensusProposalsQueryKey = (network: 'mainnet' | 'testnet', return [`/${network}/consensus/proposals`, ...(params ? [params]: [])] as const; } - export const getGetConsensusProposalsQueryOptions = >, TError = HumanReadableErrorResponse | NotFoundErrorResponse>(network: 'mainnet' | 'testnet', params?: GetConsensusProposalsParams, options?: { query?:UseQueryOptions>, TError, TData>, request?: SecondParameter} ) => { - + const {query: queryOptions, request: requestOptions} = options ?? {}; const queryKey = queryOptions?.queryKey ?? getGetConsensusProposalsQueryKey(network,params); - + const queryFn: QueryFunction>> = ({ signal }) => GetConsensusProposals(network,params, requestOptions, signal); - - + + return { queryKey, queryFn, enabled: !!(network), ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } } @@ -3077,25 +3057,24 @@ export const getGetConsensusProposalsProposalIdQueryKey = (network: 'mainnet' | return [`/${network}/consensus/proposals/${proposalId}`] as const; } - export const getGetConsensusProposalsProposalIdQueryOptions = >, TError = HumanReadableErrorResponse | NotFoundErrorResponse>(network: 'mainnet' | 'testnet', proposalId: number, options?: { query?:UseQueryOptions>, TError, TData>, request?: SecondParameter} ) => { - + const {query: queryOptions, request: requestOptions} = options ?? {}; const queryKey = queryOptions?.queryKey ?? getGetConsensusProposalsProposalIdQueryKey(network,proposalId); - + const queryFn: QueryFunction>> = ({ signal }) => GetConsensusProposalsProposalId(network,proposalId, requestOptions, signal); - - + + return { queryKey, queryFn, enabled: !!(network && proposalId), ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } } @@ -3146,26 +3125,25 @@ export const getGetConsensusProposalsProposalIdVotesQueryKey = (network: 'mainne return [`/${network}/consensus/proposals/${proposalId}/votes`, ...(params ? [params]: [])] as const; } - export const getGetConsensusProposalsProposalIdVotesQueryOptions = >, TError = HumanReadableErrorResponse | NotFoundErrorResponse>(network: 'mainnet' | 'testnet', proposalId: number, params?: GetConsensusProposalsProposalIdVotesParams, options?: { query?:UseQueryOptions>, TError, TData>, request?: SecondParameter} ) => { - + const {query: queryOptions, request: requestOptions} = options ?? {}; const queryKey = queryOptions?.queryKey ?? getGetConsensusProposalsProposalIdVotesQueryKey(network,proposalId,params); - + const queryFn: QueryFunction>> = ({ signal }) => GetConsensusProposalsProposalIdVotes(network,proposalId,params, requestOptions, signal); - - + + return { queryKey, queryFn, enabled: !!(network && proposalId), ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } } @@ -3217,26 +3195,25 @@ export const getGetRuntimeBlocksQueryKey = (network: 'mainnet' | 'testnet', return [`/${network}/${runtime}/blocks`, ...(params ? [params]: [])] as const; } - export const getGetRuntimeBlocksQueryOptions = >, TError = HumanReadableErrorResponse | NotFoundErrorResponse>(network: 'mainnet' | 'testnet', runtime: Runtime, params?: GetRuntimeBlocksParams, options?: { query?:UseQueryOptions>, TError, TData>, request?: SecondParameter} ) => { - + const {query: queryOptions, request: requestOptions} = options ?? {}; const queryKey = queryOptions?.queryKey ?? getGetRuntimeBlocksQueryKey(network,runtime,params); - + const queryFn: QueryFunction>> = ({ signal }) => GetRuntimeBlocks(network,runtime,params, requestOptions, signal); - - + + return { queryKey, queryFn, enabled: !!(network && runtime), ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } } @@ -3288,26 +3265,25 @@ export const getGetRuntimeTransactionsQueryKey = (network: 'mainnet' | 'testnet' return [`/${network}/${runtime}/transactions`, ...(params ? [params]: [])] as const; } - export const getGetRuntimeTransactionsQueryOptions = >, TError = HumanReadableErrorResponse | NotFoundErrorResponse>(network: 'mainnet' | 'testnet', runtime: Runtime, params?: GetRuntimeTransactionsParams, options?: { query?:UseQueryOptions>, TError, TData>, request?: SecondParameter} ) => { - + const {query: queryOptions, request: requestOptions} = options ?? {}; const queryKey = queryOptions?.queryKey ?? getGetRuntimeTransactionsQueryKey(network,runtime,params); - + const queryFn: QueryFunction>> = ({ signal }) => GetRuntimeTransactions(network,runtime,params, requestOptions, signal); - - + + return { queryKey, queryFn, enabled: !!(network && runtime), ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } } @@ -3358,26 +3334,25 @@ export const getGetRuntimeTransactionsTxHashQueryKey = (network: 'mainnet' | 'te return [`/${network}/${runtime}/transactions/${txHash}`] as const; } - export const getGetRuntimeTransactionsTxHashQueryOptions = >, TError = HumanReadableErrorResponse | NotFoundErrorResponse>(network: 'mainnet' | 'testnet', runtime: Runtime, txHash: string, options?: { query?:UseQueryOptions>, TError, TData>, request?: SecondParameter} ) => { - + const {query: queryOptions, request: requestOptions} = options ?? {}; const queryKey = queryOptions?.queryKey ?? getGetRuntimeTransactionsTxHashQueryKey(network,runtime,txHash); - + const queryFn: QueryFunction>> = ({ signal }) => GetRuntimeTransactionsTxHash(network,runtime,txHash, requestOptions, signal); - - + + return { queryKey, queryFn, enabled: !!(network && runtime && txHash), ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } } @@ -3429,26 +3404,25 @@ export const getGetRuntimeEventsQueryKey = (network: 'mainnet' | 'testnet', return [`/${network}/${runtime}/events`, ...(params ? [params]: [])] as const; } - export const getGetRuntimeEventsQueryOptions = >, TError = HumanReadableErrorResponse | NotFoundErrorResponse>(network: 'mainnet' | 'testnet', runtime: Runtime, params?: GetRuntimeEventsParams, options?: { query?:UseQueryOptions>, TError, TData>, request?: SecondParameter} ) => { - + const {query: queryOptions, request: requestOptions} = options ?? {}; const queryKey = queryOptions?.queryKey ?? getGetRuntimeEventsQueryKey(network,runtime,params); - + const queryFn: QueryFunction>> = ({ signal }) => GetRuntimeEvents(network,runtime,params, requestOptions, signal); - - + + return { queryKey, queryFn, enabled: !!(network && runtime), ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } } @@ -3500,26 +3474,25 @@ export const getGetRuntimeEvmTokensQueryKey = (network: 'mainnet' | 'testnet', return [`/${network}/${runtime}/evm_tokens`, ...(params ? [params]: [])] as const; } - export const getGetRuntimeEvmTokensQueryOptions = >, TError = HumanReadableErrorResponse | NotFoundErrorResponse>(network: 'mainnet' | 'testnet', runtime: Runtime, params?: GetRuntimeEvmTokensParams, options?: { query?:UseQueryOptions>, TError, TData>, request?: SecondParameter} ) => { - + const {query: queryOptions, request: requestOptions} = options ?? {}; const queryKey = queryOptions?.queryKey ?? getGetRuntimeEvmTokensQueryKey(network,runtime,params); - + const queryFn: QueryFunction>> = ({ signal }) => GetRuntimeEvmTokens(network,runtime,params, requestOptions, signal); - - + + return { queryKey, queryFn, enabled: !!(network && runtime), ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } } @@ -3570,26 +3543,25 @@ export const getGetRuntimeEvmTokensAddressQueryKey = (network: 'mainnet' | 'test return [`/${network}/${runtime}/evm_tokens/${address}`] as const; } - export const getGetRuntimeEvmTokensAddressQueryOptions = >, TError = HumanReadableErrorResponse | NotFoundErrorResponse>(network: 'mainnet' | 'testnet', runtime: Runtime, address: string, options?: { query?:UseQueryOptions>, TError, TData>, request?: SecondParameter} ) => { - + const {query: queryOptions, request: requestOptions} = options ?? {}; const queryKey = queryOptions?.queryKey ?? getGetRuntimeEvmTokensAddressQueryKey(network,runtime,address); - + const queryFn: QueryFunction>> = ({ signal }) => GetRuntimeEvmTokensAddress(network,runtime,address, requestOptions, signal); - - + + return { queryKey, queryFn, enabled: !!(network && runtime && address), ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } } @@ -3645,7 +3617,6 @@ export const getGetRuntimeEvmTokensAddressHoldersQueryKey = (network: 'mainnet' return [`/${network}/${runtime}/evm_tokens/${address}/holders`, ...(params ? [params]: [])] as const; } - export const getGetRuntimeEvmTokensAddressHoldersQueryOptions = >, TError = HumanReadableErrorResponse | NotFoundErrorResponse>(network: 'mainnet' | 'testnet', @@ -3653,19 +3624,19 @@ export const getGetRuntimeEvmTokensAddressHoldersQueryOptions = >, TError, TData>, request?: SecondParameter} ) => { - + const {query: queryOptions, request: requestOptions} = options ?? {}; const queryKey = queryOptions?.queryKey ?? getGetRuntimeEvmTokensAddressHoldersQueryKey(network,runtime,address,params); - + const queryFn: QueryFunction>> = ({ signal }) => GetRuntimeEvmTokensAddressHolders(network,runtime,address,params, requestOptions, signal); - - + + return { queryKey, queryFn, enabled: !!(network && runtime && address), ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } } @@ -3719,26 +3690,25 @@ export const getGetRuntimeAccountsAddressQueryKey = (network: 'mainnet' | 'testn return [`/${network}/${runtime}/accounts/${address}`] as const; } - export const getGetRuntimeAccountsAddressQueryOptions = >, TError = HumanReadableErrorResponse | NotFoundErrorResponse>(network: 'mainnet' | 'testnet', runtime: Runtime, address: string, options?: { query?:UseQueryOptions>, TError, TData>, request?: SecondParameter} ) => { - + const {query: queryOptions, request: requestOptions} = options ?? {}; const queryKey = queryOptions?.queryKey ?? getGetRuntimeAccountsAddressQueryKey(network,runtime,address); - + const queryFn: QueryFunction>> = ({ signal }) => GetRuntimeAccountsAddress(network,runtime,address, requestOptions, signal); - - + + return { queryKey, queryFn, enabled: !!(network && runtime && address), ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } } @@ -3787,25 +3757,24 @@ export const getGetRuntimeStatusQueryKey = (network: 'mainnet' | 'testnet', return [`/${network}/${runtime}/status`] as const; } - export const getGetRuntimeStatusQueryOptions = >, TError = HumanReadableErrorResponse | NotFoundErrorResponse>(network: 'mainnet' | 'testnet', runtime: Runtime, options?: { query?:UseQueryOptions>, TError, TData>, request?: SecondParameter} ) => { - + const {query: queryOptions, request: requestOptions} = options ?? {}; const queryKey = queryOptions?.queryKey ?? getGetRuntimeStatusQueryKey(network,runtime); - + const queryFn: QueryFunction>> = ({ signal }) => GetRuntimeStatus(network,runtime, requestOptions, signal); - - + + return { queryKey, queryFn, enabled: !!(network && runtime), ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } } @@ -3858,26 +3827,25 @@ export const getGetLayerStatsTxVolumeQueryKey = (network: 'mainnet' | 'testnet', return [`/${network}/${layer}/stats/tx_volume`, ...(params ? [params]: [])] as const; } - export const getGetLayerStatsTxVolumeQueryOptions = >, TError = HumanReadableErrorResponse | NotFoundErrorResponse>(network: 'mainnet' | 'testnet', layer: Layer, params?: GetLayerStatsTxVolumeParams, options?: { query?:UseQueryOptions>, TError, TData>, request?: SecondParameter} ) => { - + const {query: queryOptions, request: requestOptions} = options ?? {}; const queryKey = queryOptions?.queryKey ?? getGetLayerStatsTxVolumeQueryKey(network,layer,params); - + const queryFn: QueryFunction>> = ({ signal }) => GetLayerStatsTxVolume(network,layer,params, requestOptions, signal); - - + + return { queryKey, queryFn, enabled: !!(network && layer), ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } } @@ -3933,26 +3901,25 @@ export const getGetLayerStatsActiveAccountsQueryKey = (network: 'mainnet' | 'tes return [`/${network}/${layer}/stats/active_accounts`, ...(params ? [params]: [])] as const; } - export const getGetLayerStatsActiveAccountsQueryOptions = >, TError = HumanReadableErrorResponse | NotFoundErrorResponse>(network: 'mainnet' | 'testnet', layer: Layer, params?: GetLayerStatsActiveAccountsParams, options?: { query?:UseQueryOptions>, TError, TData>, request?: SecondParameter} ) => { - + const {query: queryOptions, request: requestOptions} = options ?? {}; const queryKey = queryOptions?.queryKey ?? getGetLayerStatsActiveAccountsQueryKey(network,layer,params); - + const queryFn: QueryFunction>> = ({ signal }) => GetLayerStatsActiveAccounts(network,layer,params, requestOptions, signal); - - + + return { queryKey, queryFn, enabled: !!(network && layer), ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } }