From 38d81a4db2d7f6ebf94175769c019606148466b4 Mon Sep 17 00:00:00 2001 From: lukaw3d <3758846+lukaw3d@users.noreply.github.com> Date: Mon, 4 Nov 2024 00:26:34 +0000 Subject: [PATCH 1/2] Update API bindings --- src/oasis-nexus/generated/api.ts | 230 ++++++++++++++++++++++++------- 1 file changed, 181 insertions(+), 49 deletions(-) diff --git a/src/oasis-nexus/generated/api.ts b/src/oasis-nexus/generated/api.ts index f7ac967fc..3aa7d8e10 100644 --- a/src/oasis-nexus/generated/api.ts +++ b/src/oasis-nexus/generated/api.ts @@ -611,10 +611,6 @@ before?: string; * A filter on the block hash. */ hash?: string; -/** - * A filter on the proposer of the block. - */ -proposed_by?: string; }; /** @@ -682,6 +678,34 @@ certain actions which subtract/add tokens. total_sent?: TextBigInt; } +export interface EvmNft { + /** Describes the asset which this NFT represents */ + description?: string; + /** The instance ID of this NFT within the collection represented by `token`. */ + id: TextBigInt; + /** A URI pointing to a resource with mime type image/* representing +the asset which this NFT represents. (Additional +non-descriptive text from ERC-721 omitted.) + */ + image?: string; + /** A metadata document for this NFT instance. +Currently only ERC-721 is supported, where the document is an Asset Metadata from the ERC721 Metadata JSON Schema. + */ + metadata?: unknown; + metadata_accessed?: string; + metadata_uri?: string; + /** Identifies the asset which this NFT represents */ + name?: string; + /** The total number of transfers of this NFT instance. + */ + num_transfers?: number; + /** The Oasis address of this NFT instance's owner. */ + owner?: Address; + /** The Ethereum address of this NFT instance's owner. */ + owner_eth?: string; + token: EvmToken; +} + /** * A list of NFT instances. */ @@ -692,6 +716,45 @@ export type EvmNftListAllOf = { export type EvmNftList = List & EvmNftListAllOf; +export interface EvmTokenSwap { + /** The round when this swap pair was created. + */ + create_round?: number; + /** The Oasis address of the swap factory contract. + */ + factory_address?: string; + /** The Ethereum-compatible address of the swap factory contract. + */ + factory_address_eth?: string; + /** The round when this swap pair last updated its reserves. + */ + last_sync_round?: number; + /** The Oasis address of the swap pair contract. + */ + pair_address: string; + /** The Ethereum-compatible address of the swap pair contract. + */ + pair_address_eth?: string; + /** The swap's liquidity pool of the first token, in that token's base units. + */ + reserve0?: TextBigInt; + /** The swap's liquidity pool of the second token, in that token's base units. + */ + reserve1?: TextBigInt; + /** The Oasis address of the first token in this swap. + */ + token0_address?: string; + /** The Ethereum-compatible address of the first token in this swap + */ + token0_address_eth?: string; + /** The Oasis address of the second token in this swap. + */ + token1_address?: string; + /** The Ethereum-compatible address of the second token in this swap. + */ + token1_address_eth?: string; +} + export interface EvmToken { /** The Oasis address of this token's contract. */ contract_addr: string; @@ -719,6 +782,28 @@ DEPRECATED: This field will be removed in the future in favor of verification_le /** The total number of transfers of this token. */ num_transfers?: 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. + */ + ref_swap?: EvmTokenSwap; + /** Information about the reference token. The relative price and +relative total value are expressed in this reference token's base +unit. + */ + ref_token?: EvmRefToken; + /** The relative price of one base unit of this token is this many of +the relative token's base unit. + */ + relative_price?: number; + /** The relative price and relative total value are expressed in this +reference token's base unit. + */ + relative_token_address?: string; + /** The relative price of this token multiplied by this token's total +supply, in the relative token's base unit. + */ + relative_total_value?: number; /** Symbol of the token, as provided by token contract's `symbol()` method. */ symbol?: string; /** The total number of base units available. */ @@ -732,34 +817,6 @@ detected or is not supported, this field will be null/absent. verification_level?: VerificationLevel; } -export interface EvmNft { - /** Describes the asset which this NFT represents */ - description?: string; - /** The instance ID of this NFT within the collection represented by `token`. */ - id: TextBigInt; - /** A URI pointing to a resource with mime type image/* representing -the asset which this NFT represents. (Additional -non-descriptive text from ERC-721 omitted.) - */ - image?: string; - /** A metadata document for this NFT instance. -Currently only ERC-721 is supported, where the document is an Asset Metadata from the ERC721 Metadata JSON Schema. - */ - metadata?: unknown; - metadata_accessed?: string; - metadata_uri?: string; - /** Identifies the asset which this NFT represents */ - name?: string; - /** The total number of transfers of this NFT instance. - */ - num_transfers?: number; - /** The Oasis address of this NFT instance's owner. */ - owner?: Address; - /** The Ethereum address of this NFT instance's owner. */ - owner_eth?: string; - token: EvmToken; -} - /** * A list of tokens in a runtime. */ @@ -783,6 +840,24 @@ export const EvmTokenType = { ERC721: 'ERC721', } as const; +export interface EvmRefToken { + /** 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; + /** Name of the token, as provided by token contract's `name()` method. */ + name?: string; + /** Symbol of the token, as provided by token contract's `symbol()` method. */ + symbol?: 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; +} + export interface RuntimeStatus { /** The number of compute nodes that are registered and can run the runtime. */ active_nodes: number; @@ -856,10 +931,10 @@ For EVM transactions this is calculated as `gas_price * gas_used`, where `gas_pr For other transactions this equals to `fee`. */ charged_fee: 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). */ encryption_envelope?: RuntimeTransactionEncryptionEnvelope; /** Error details of a failed transaction. */ @@ -921,6 +996,11 @@ May be null if the transaction was malformed or encrypted. method?: string; /** The nonce used with this transaction's 0th signer, to prevent replay. */ nonce_0: 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). + */ + oasis_encryption_envelope?: RuntimeTransactionEncryptionEnvelope; /** The block round at which this transaction was executed. */ round: number; /** The Oasis address of this transaction's 0th signer. @@ -1105,7 +1185,7 @@ will add a field specifying the corresponding Ethereum address, if known. Curren the only such possible fields are `from_eth`, `to_eth`, and `owner_eth`. */ body: RuntimeEventBody; - /** 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. */ eth_tx_hash?: string; @@ -1214,7 +1294,7 @@ export const ProposalState = { } as const; /** - * The target propotocol versions for this upgrade proposal. + * The target protocol versions for this upgrade proposal. */ export interface ProposalTarget { consensus_protocol?: string; @@ -1369,7 +1449,7 @@ this links the Oasis address and the Ethereum address. Oasis addresses are derived from a piece of data, such as an ed25519 public key or an Ethereum address. For example, [this](https://github.com/oasisprotocol/oasis-sdk/blob/b37e6da699df331f5a2ac62793f8be099c68469c/client-sdk/go/helpers/address.go#L90-L91) is how an Ethereum is converted to an Oasis address. The type of underlying data usually also -determines how the signatuers for this address are verified. +determines how the signatures for this address are verified. Consensus supports only "staking addresses" (`context="oasis-core/address: staking"` below; always ed25519-backed). @@ -1440,21 +1520,21 @@ export type NodeListAllOf = { export type NodeList = List & NodeListAllOf; export interface ValidatorHistoryPoint { - /** 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. */ active_balance?: TextBigInt; - /** 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. */ active_shares?: TextBigInt; /** 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). */ debonding_balance?: TextBigInt; /** 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). */ debonding_shares?: TextBigInt; @@ -1669,7 +1749,7 @@ fields. /** The runtime that sent this message. */ runtime: string; - /** The type of thies message. + /** The type of this message. */ type?: RoothashMessageType; } @@ -1800,7 +1880,7 @@ will be true: /** 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. */ @@ -1856,8 +1936,6 @@ export type TransactionListAllOf = { transactions: Transaction[]; }; -export type TransactionList = List & TransactionListAllOf; - export type ConsensusTxMethod = typeof ConsensusTxMethod[keyof typeof ConsensusTxMethod]; @@ -1923,8 +2001,6 @@ export type DebondingDelegationListAllOf = { debonding_delegations: DebondingDelegation[]; }; -export type DebondingDelegationList = List & DebondingDelegationListAllOf; - /** * A delegation. @@ -1991,12 +2067,12 @@ restricted by byte size until an upgrade during Eden introduced a gas limit. height: number; /** Number of transactions in the block. */ num_transactions: number; - /** The size limit for the block in bytes. - */ /** The entity that proposed this block. */ proposer?: EntityInfo; /** A list of the entities that signed the block. */ signers?: EntityInfo[]; + /** The size limit for the block in bytes. + */ size_limit?: TextBigInt; /** The Merkle root of the state tree after applying the block. */ state_root: string; @@ -2030,6 +2106,10 @@ the query would return with limit=infinity. total_count: number; } +export type TransactionList = List & TransactionListAllOf; + +export type DebondingDelegationList = List & DebondingDelegationListAllOf; + /** * A list of consensus blocks. @@ -2203,6 +2283,7 @@ export const useGetStatus = >, TErr /** + * @deprecated * @summary Returns a list of consensus blocks, sorted from most to least recent. */ export const GetConsensusBlocks = ( @@ -2249,6 +2330,7 @@ export type GetConsensusBlocksQueryResult = NonNullable>, TError = HumanReadableErrorResponse | NotFoundErrorResponse>( @@ -2270,6 +2352,7 @@ export const useGetConsensusBlocks = >, TError = HumanReadableErrorResponse | NotFoundErrorResponse>( @@ -2336,6 +2420,7 @@ export const useGetConsensusBlocksHeight = >, TError = HumanReadableErrorResponse | NotFoundErrorResponse>( @@ -2403,6 +2489,7 @@ export const useGetConsensusTransactions = >, TError = HumanReadableErrorResponse | NotFoundErrorResponse>( @@ -2469,6 +2557,7 @@ export const useGetConsensusTransactionsTxHash = >, TError = HumanReadableErrorResponse | NotFoundErrorResponse>( @@ -2535,6 +2625,9 @@ export const useGetConsensusEvents = >> export type GetConsensusRoothashMessagesQueryError = HumanReadableErrorResponse | NotFoundErrorResponse +/** + * @deprecated + */ export const useGetConsensusRoothashMessages = >, TError = HumanReadableErrorResponse | NotFoundErrorResponse>( network: 'mainnet' | 'testnet', params: GetConsensusRoothashMessagesParams, options?: { query?:UseQueryOptions>, TError, TData>, request?: SecondParameter} @@ -2597,6 +2693,7 @@ export const useGetConsensusRoothashMessages = >, TError = HumanReadableErrorResponse | NotFoundErrorResponse>( @@ -2664,6 +2762,7 @@ export const useGetConsensusEntities = >, TError = HumanReadableErrorResponse | NotFoundErrorResponse>( @@ -2730,6 +2830,7 @@ export const useGetConsensusEntitiesAddress = >, TError = HumanReadableErrorResponse | NotFoundErrorResponse>( @@ -2801,6 +2903,7 @@ export const useGetConsensusEntitiesAddressNodes = >, TError = HumanReadableErrorResponse | NotFoundErrorResponse>( @@ -2871,6 +2975,7 @@ export const useGetConsensusEntitiesAddressNodesNodeId = >, TError = HumanReadableErrorResponse | NotFoundErrorResponse>( @@ -2938,6 +3044,7 @@ export const useGetConsensusValidators = >, TError = HumanReadableErrorResponse | NotFoundErrorResponse>( @@ -3004,6 +3112,7 @@ export const useGetConsensusValidatorsAddress = >, TError = HumanReadableErrorResponse | NotFoundErrorResponse>( @@ -3075,6 +3185,7 @@ export const useGetConsensusValidatorsAddressHistory = >, TError = HumanReadableErrorResponse | NotFoundErrorResponse>( @@ -3216,6 +3330,7 @@ export const useGetConsensusAccountsAddress = >, TError = HumanReadableErrorResponse | NotFoundErrorResponse>( @@ -3287,6 +3403,7 @@ export const useGetConsensusAccountsAddressDelegations = >, TError = HumanReadableErrorResponse | NotFoundErrorResponse>( @@ -3358,6 +3476,7 @@ export const useGetConsensusAccountsAddressDelegationsTo = >, TError = HumanReadableErrorResponse | NotFoundErrorResponse>( @@ -3429,6 +3549,7 @@ export const useGetConsensusAccountsAddressDebondingDelegations = >, TError = HumanReadableErrorResponse | NotFoundErrorResponse>( @@ -3500,6 +3622,7 @@ export const useGetConsensusAccountsAddressDebondingDelegationsTo = >, TError = HumanReadableErrorResponse | NotFoundErrorResponse>( @@ -3567,6 +3691,7 @@ export const useGetConsensusEpochs = >, TError = HumanReadableErrorResponse | NotFoundErrorResponse>( @@ -3633,6 +3759,7 @@ export const useGetConsensusEpochsEpoch = >, TError = HumanReadableErrorResponse | NotFoundErrorResponse>( @@ -3700,6 +3828,7 @@ export const useGetConsensusProposals = >, TError = HumanReadableErrorResponse | NotFoundErrorResponse>( @@ -3766,6 +3896,7 @@ export const useGetConsensusProposalsProposalId = >, TError = HumanReadableErrorResponse | NotFoundErrorResponse>( From 7c11b166cf90d904bf40549950ceb5620c3a6e3c Mon Sep 17 00:00:00 2001 From: Michal Zielenkiewicz Date: Thu, 7 Nov 2024 08:34:36 +0100 Subject: [PATCH 2/2] Keep incoming proposed_by filter --- .changelog/1526.internal.md | 1 + src/oasis-nexus/generated/api.ts | 4 ++++ 2 files changed, 5 insertions(+) create mode 100644 .changelog/1526.internal.md diff --git a/.changelog/1526.internal.md b/.changelog/1526.internal.md new file mode 100644 index 000000000..882e70821 --- /dev/null +++ b/.changelog/1526.internal.md @@ -0,0 +1 @@ +Update API bindings diff --git a/src/oasis-nexus/generated/api.ts b/src/oasis-nexus/generated/api.ts index 3aa7d8e10..3d1bcd678 100644 --- a/src/oasis-nexus/generated/api.ts +++ b/src/oasis-nexus/generated/api.ts @@ -611,6 +611,10 @@ before?: string; * A filter on the block hash. */ hash?: string; +/** + * A filter on the proposer of the block. + */ +proposed_by?: string; }; /**