diff --git a/.changelog/.internal.md b/.changelog/.internal.md new file mode 100644 index 0000000000..882e70821e --- /dev/null +++ b/.changelog/.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 41a36d067f..a7b9a0287a 100644 --- a/src/oasis-nexus/generated/api.ts +++ b/src/oasis-nexus/generated/api.ts @@ -71,7 +71,9 @@ import GetRuntimeRoflAppsIdInstancesRakTransactionsMutator from '../replaceNetwo import GetRuntimeRoflmarketProvidersMutator from '../replaceNetworkWithBaseURL'; import GetRuntimeRoflmarketProvidersAddressMutator from '../replaceNetworkWithBaseURL'; import GetRuntimeRoflmarketProvidersAddressOffersMutator from '../replaceNetworkWithBaseURL'; -import GetRuntimeRoflmarketProvidersAddressInstancesMutator from '../replaceNetworkWithBaseURL'; +import GetRuntimeRoflmarketProvidersAddressOffersIdMutator from '../replaceNetworkWithBaseURL'; +import GetRuntimeRoflmarketProvidersAddressInstancesIdMutator from '../replaceNetworkWithBaseURL'; +import GetRuntimeRoflmarketInstancesMutator from '../replaceNetworkWithBaseURL'; import GetStatsTxVolumeMutator from '../replaceNetworkWithBaseURL'; import GetLayerStatsTxVolumeMutator from '../replaceNetworkWithBaseURL'; import GetLayerStatsActiveAccountsMutator from '../replaceNetworkWithBaseURL'; @@ -111,6 +113,11 @@ export type StakingAddress = OasisAddress; /* modified by afterAllFilesWrite */ */ export type TextBigInt = string; +/** + * @pattern ^-?[0-9]+(\.[0-9]+)?$ + */ +export type TextBigDecimal = string; + /** * An Oasis-style (bech32) address. * @pattern ^oasis1[a-z0-9]{40}$ @@ -1407,6 +1414,10 @@ For other transactions this equals to `fee`. charged_fee: string; /** The total byte size of the transaction. */ size: number; + /** The raw result of the transaction execution, as returned by the runtime. +This is a base64-encoded byte array. The meaning of this field depends on the transaction type. + */ + raw_result: string; /** 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). @@ -1522,6 +1533,8 @@ export interface RuntimeTransactionSigner { export interface RuntimeAccount { /** The staking address for this account. */ address: string; + /** The expected nonce for the next transaction (= last used nonce + 1) */ + nonce: number; address_preimage?: AddressPreimage; /** The balance(s) of this account in this runtime. Most runtimes use only one denomination, and thus produce only one balance here. These balances do not include "layer (n+1) tokens", i.e. tokens @@ -1596,12 +1609,21 @@ detected or is not supported, this field will be null/absent. type: EvmTokenType; /** The total number of base units available. */ total_supply?: TextBigInt; + /** The estimated price of one base unit of this token, expressed in the native denomination of the runtime. + +This value is sourced from the Neby GraphQL API and reflects the token's `derivedETH` price as computed by the subgraph indexing the Neby DEX. +It is available only for tokens listed and tradable on the Neby exchange. + +May be zero if the subgraph could not determine a valid price route to the native token unit. + */ + neby_derived_price?: TextBigDecimal; /** The total number of transfers of this token. May be omitted if the number of transfers cannot be known (e.g. private ERC20 tokens such as BitUSD). */ num_transfers?: number; /** The number of addresses that have a nonzero balance of this token. + May be omited if the number of holders cannot be known (e.g. private ERC20 tokens such as BitUSD). */ num_holders?: number; @@ -2000,8 +2022,8 @@ export interface RoflMarketInstance { creator: string; /** The address of the administrator of the instance. */ admin: string; - /** The identifier of the node that this instance is deployed on. */ - node_id: string; + /** the optional identifier of the node where the instance has been provisioned. */ + node_id?: string; /** Arbitrary metadata key-value pairs assigned by the provider. */ metadata: RoflMarketInstanceMetadata; /** The resources allocated to this instance. */ @@ -2239,6 +2261,12 @@ a name that is a superstring of the input param. */ name?: string; +/** + * A filter on the entity or node ID (base64-encoded ed25519 public key). +Returns the validator whose entity_id matches the provided value, or whose node's node_id matches the provided value. + + */ +id?: string; }; export type GetConsensusValidatorsAddressHistoryParams = { @@ -2390,6 +2418,10 @@ limit?: number; */ offset?: number; +/** + * A filter on the vote value. + */ +vote?: string; }; export type GetRuntimeBlocksParams = { @@ -2604,7 +2636,7 @@ limit?: number; offset?: number; }; -export type GetRuntimeAccountsAddressDelegationsParams = { +export type GetRuntimeEvmTokensAddressNftsParams = { /** * The maximum numbers of items to return. @@ -2619,7 +2651,7 @@ limit?: number; offset?: number; }; -export type GetRuntimeAccountsAddressDebondingDelegationsParams = { +export type GetRuntimeAccountsAddressDelegationsParams = { /** * The maximum numbers of items to return. @@ -2634,7 +2666,7 @@ limit?: number; offset?: number; }; -export type GetRuntimeEvmTokensAddressNftsParams = { +export type GetRuntimeAccountsAddressDebondingDelegationsParams = { /** * The maximum numbers of items to return. @@ -2681,13 +2713,33 @@ limit?: number; */ offset?: number; +/** + * A filter on the admin of the ROFL app. + */ +admin?: EthOrOasisAddress; /** * A filter on the name of the ROFL app. If multiple names are provided, the ROFL App must match all of them. * @maxItems 6 */ name?: string[]; +/** + * The field to sort the ROFL apps by. +If unset, the ROFL apps will be sorted by activity (num_active_instances, num_transactions) in descending order. +To sort by creation time, set this to `created_at` (or `created_at_desc`). + + */ +sort_by?: GetRuntimeRoflAppsSortBy; }; +export type GetRuntimeRoflAppsSortBy = typeof GetRuntimeRoflAppsSortBy[keyof typeof GetRuntimeRoflAppsSortBy]; + + +// eslint-disable-next-line @typescript-eslint/no-redeclare +export const GetRuntimeRoflAppsSortBy = { + created_at: 'created_at', + created_at_desc: 'created_at_desc', +} as const; + export type GetRuntimeRoflAppsIdTransactionsParams = { /** * The maximum numbers of items to return. @@ -2811,7 +2863,7 @@ limit?: number; offset?: number; }; -export type GetRuntimeRoflmarketProvidersAddressInstancesParams = { +export type GetRuntimeRoflmarketInstancesParams = { /** * The maximum numbers of items to return. @@ -2824,9 +2876,21 @@ limit?: number; */ offset?: number; +/** + * A filter on the provider of the ROFL market instance. + */ +provider?: StakingAddress; +/** + * A filter on the admin of the ROFL market instance. + */ +admin?: EthOrOasisAddress; +/** + * A filter on the deployed app ID of the ROFL market instance. + */ +deployed_app_id?: string; }; -export type GetLayerStatsTxVolumeParams = { +export type GetStatsTxVolumeParams = { /** * The maximum numbers of items to return. @@ -2855,7 +2919,7 @@ The backend supports a limited number of step sizes: 300 (5 minutes) and window_step_seconds?: number; }; -export type GetStatsTxVolumeParams = { +export type GetLayerStatsTxVolumeParams = { /** * The maximum numbers of items to return. @@ -2980,7 +3044,8 @@ export function useGetStatus>, TErr /** - * @summary Returns a list of recent blocks across all layers, sorted from most to least recent. Limited to 10 blocks. + * Sorted from most to least recent. Limited to 10 blocks. + * @summary Returns a list of recent blocks across all layers */ export const GetRecentBlocks = ( network: 'mainnet' | 'testnet' | 'localnet', @@ -3023,7 +3088,7 @@ export type GetRecentBlocksQueryError = HumanReadableErrorResponse | NotFoundErr /** - * @summary Returns a list of recent blocks across all layers, sorted from most to least recent. Limited to 10 blocks. + * @summary Returns a list of recent blocks across all layers */ export function useGetRecentBlocks>, TError = HumanReadableErrorResponse | NotFoundErrorResponse>( @@ -3860,7 +3925,8 @@ export function useGetConsensusEntitiesAddressNodesNodeId>, TError = HumanReadableErrorResponse | NotFoundErrorResponse>( @@ -4070,11 +4136,12 @@ export function useGetConsensusValidatorsAddressHistory,signal?: AbortSignal + id: string, + options?: SecondParameter,signal?: AbortSignal ) => { - return GetRuntimeRoflmarketProvidersAddressInstancesMutator( - {url: `/${encodeURIComponent(String(network))}/${encodeURIComponent(String(runtime))}/roflmarket_providers/${encodeURIComponent(String(address))}/instances`, method: 'GET', - params, signal + return GetRuntimeRoflmarketProvidersAddressOffersIdMutator( + {url: `/${encodeURIComponent(String(network))}/${encodeURIComponent(String(runtime))}/roflmarket_providers/${encodeURIComponent(String(address))}/offers/${encodeURIComponent(String(id))}`, method: 'GET', signal + }, + options); + } + + +export const getGetRuntimeRoflmarketProvidersAddressOffersIdQueryKey = (network: 'mainnet' | 'testnet' | 'localnet', + runtime: Runtime, + address: StakingAddress, + id: string,) => { + return [`/${network}/${runtime}/roflmarket_providers/${address}/offers/${id}`] as const; + } + + +export const getGetRuntimeRoflmarketProvidersAddressOffersIdQueryOptions = >, TError = HumanReadableErrorResponse | NotFoundErrorResponse>(network: 'mainnet' | 'testnet' | 'localnet', + runtime: Runtime, + address: StakingAddress, + id: string, options?: { query?:UseQueryOptions>, TError, TData>, request?: SecondParameter} +) => { + +const {query: queryOptions, request: requestOptions} = options ?? {}; + + const queryKey = queryOptions?.queryKey ?? getGetRuntimeRoflmarketProvidersAddressOffersIdQueryKey(network,runtime,address,id); + + + + const queryFn: QueryFunction>> = ({ signal }) => GetRuntimeRoflmarketProvidersAddressOffersId(network,runtime,address,id, requestOptions, signal); + + + + + + return { queryKey, queryFn, enabled: !!(network && runtime && address && id), ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } +} + +export type GetRuntimeRoflmarketProvidersAddressOffersIdQueryResult = NonNullable>> +export type GetRuntimeRoflmarketProvidersAddressOffersIdQueryError = HumanReadableErrorResponse | NotFoundErrorResponse + + +/** + * @summary Returns a specific ROFL market offer. + */ + +export function useGetRuntimeRoflmarketProvidersAddressOffersId>, TError = HumanReadableErrorResponse | NotFoundErrorResponse>( + network: 'mainnet' | 'testnet' | 'localnet', + runtime: Runtime, + address: StakingAddress, + id: string, options?: { query?:UseQueryOptions>, TError, TData>, request?: SecondParameter} + + ): UseQueryResult & { queryKey: QueryKey } { + + const queryOptions = getGetRuntimeRoflmarketProvidersAddressOffersIdQueryOptions(network,runtime,address,id,options) + + const query = useQuery(queryOptions ) as UseQueryResult & { queryKey: QueryKey }; + + query.queryKey = queryOptions.queryKey ; + + return query; +} + + + + +/** + * @summary Returns a specific ROFL market instance. + */ +export const GetRuntimeRoflmarketProvidersAddressInstancesId = ( + network: 'mainnet' | 'testnet' | 'localnet', + runtime: Runtime, + address: StakingAddress, + id: string, + options?: SecondParameter,signal?: AbortSignal +) => { + + + return GetRuntimeRoflmarketProvidersAddressInstancesIdMutator( + {url: `/${encodeURIComponent(String(network))}/${encodeURIComponent(String(runtime))}/roflmarket_providers/${encodeURIComponent(String(address))}/instances/${encodeURIComponent(String(id))}`, method: 'GET', signal }, options); } -export const getGetRuntimeRoflmarketProvidersAddressInstancesQueryKey = (network: 'mainnet' | 'testnet' | 'localnet', +export const getGetRuntimeRoflmarketProvidersAddressInstancesIdQueryKey = (network: 'mainnet' | 'testnet' | 'localnet', runtime: Runtime, address: StakingAddress, - params?: GetRuntimeRoflmarketProvidersAddressInstancesParams,) => { - return [`/${network}/${runtime}/roflmarket_providers/${address}/instances`, ...(params ? [params]: [])] as const; + id: string,) => { + return [`/${network}/${runtime}/roflmarket_providers/${address}/instances/${id}`] as const; } -export const getGetRuntimeRoflmarketProvidersAddressInstancesQueryOptions = >, TError = HumanReadableErrorResponse | NotFoundErrorResponse>(network: 'mainnet' | 'testnet' | 'localnet', +export const getGetRuntimeRoflmarketProvidersAddressInstancesIdQueryOptions = >, TError = HumanReadableErrorResponse | NotFoundErrorResponse>(network: 'mainnet' | 'testnet' | 'localnet', runtime: Runtime, address: StakingAddress, - params?: GetRuntimeRoflmarketProvidersAddressInstancesParams, options?: { query?:UseQueryOptions>, TError, TData>, request?: SecondParameter} + id: string, options?: { query?:UseQueryOptions>, TError, TData>, request?: SecondParameter} ) => { const {query: queryOptions, request: requestOptions} = options ?? {}; - const queryKey = queryOptions?.queryKey ?? getGetRuntimeRoflmarketProvidersAddressInstancesQueryKey(network,runtime,address,params); + const queryKey = queryOptions?.queryKey ?? getGetRuntimeRoflmarketProvidersAddressInstancesIdQueryKey(network,runtime,address,id); - const queryFn: QueryFunction>> = ({ signal }) => GetRuntimeRoflmarketProvidersAddressInstances(network,runtime,address,params, requestOptions, signal); + const queryFn: QueryFunction>> = ({ signal }) => GetRuntimeRoflmarketProvidersAddressInstancesId(network,runtime,address,id, requestOptions, signal); - return { queryKey, queryFn, enabled: !!(network && runtime && address), ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } + return { queryKey, queryFn, enabled: !!(network && runtime && address && id), ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } } -export type GetRuntimeRoflmarketProvidersAddressInstancesQueryResult = NonNullable>> -export type GetRuntimeRoflmarketProvidersAddressInstancesQueryError = HumanReadableErrorResponse | NotFoundErrorResponse +export type GetRuntimeRoflmarketProvidersAddressInstancesIdQueryResult = NonNullable>> +export type GetRuntimeRoflmarketProvidersAddressInstancesIdQueryError = HumanReadableErrorResponse | NotFoundErrorResponse /** - * @summary Returns a list of ROFL market instances for a specific provider. + * @summary Returns a specific ROFL market instance. */ -export function useGetRuntimeRoflmarketProvidersAddressInstances>, TError = HumanReadableErrorResponse | NotFoundErrorResponse>( +export function useGetRuntimeRoflmarketProvidersAddressInstancesId>, TError = HumanReadableErrorResponse | NotFoundErrorResponse>( network: 'mainnet' | 'testnet' | 'localnet', runtime: Runtime, address: StakingAddress, - params?: GetRuntimeRoflmarketProvidersAddressInstancesParams, options?: { query?:UseQueryOptions>, TError, TData>, request?: SecondParameter} + id: string, options?: { query?:UseQueryOptions>, TError, TData>, request?: SecondParameter} + + ): UseQueryResult & { queryKey: QueryKey } { + + const queryOptions = getGetRuntimeRoflmarketProvidersAddressInstancesIdQueryOptions(network,runtime,address,id,options) + + const query = useQuery(queryOptions ) as UseQueryResult & { queryKey: QueryKey }; + + query.queryKey = queryOptions.queryKey ; + + return query; +} + + + + +/** + * @summary Returns a list of ROFL market instances. + */ +export const GetRuntimeRoflmarketInstances = ( + network: 'mainnet' | 'testnet' | 'localnet', + runtime: Runtime, + params?: GetRuntimeRoflmarketInstancesParams, + options?: SecondParameter,signal?: AbortSignal +) => { + + + return GetRuntimeRoflmarketInstancesMutator( + {url: `/${encodeURIComponent(String(network))}/${encodeURIComponent(String(runtime))}/roflmarket_instances`, method: 'GET', + params, signal + }, + options); + } + + +export const getGetRuntimeRoflmarketInstancesQueryKey = (network: 'mainnet' | 'testnet' | 'localnet', + runtime: Runtime, + params?: GetRuntimeRoflmarketInstancesParams,) => { + return [`/${network}/${runtime}/roflmarket_instances`, ...(params ? [params]: [])] as const; + } + + +export const getGetRuntimeRoflmarketInstancesQueryOptions = >, TError = HumanReadableErrorResponse | NotFoundErrorResponse>(network: 'mainnet' | 'testnet' | 'localnet', + runtime: Runtime, + params?: GetRuntimeRoflmarketInstancesParams, options?: { query?:UseQueryOptions>, TError, TData>, request?: SecondParameter} +) => { + +const {query: queryOptions, request: requestOptions} = options ?? {}; + + const queryKey = queryOptions?.queryKey ?? getGetRuntimeRoflmarketInstancesQueryKey(network,runtime,params); + + + + const queryFn: QueryFunction>> = ({ signal }) => GetRuntimeRoflmarketInstances(network,runtime,params, requestOptions, signal); + + + + + + return { queryKey, queryFn, enabled: !!(network && runtime), ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } +} + +export type GetRuntimeRoflmarketInstancesQueryResult = NonNullable>> +export type GetRuntimeRoflmarketInstancesQueryError = HumanReadableErrorResponse | NotFoundErrorResponse + + +/** + * @summary Returns a list of ROFL market instances. + */ + +export function useGetRuntimeRoflmarketInstances>, TError = HumanReadableErrorResponse | NotFoundErrorResponse>( + network: 'mainnet' | 'testnet' | 'localnet', + runtime: Runtime, + params?: GetRuntimeRoflmarketInstancesParams, options?: { query?:UseQueryOptions>, TError, TData>, request?: SecondParameter} ): UseQueryResult & { queryKey: QueryKey } { - const queryOptions = getGetRuntimeRoflmarketProvidersAddressInstancesQueryOptions(network,runtime,address,params,options) + const queryOptions = getGetRuntimeRoflmarketInstancesQueryOptions(network,runtime,params,options) const query = useQuery(queryOptions ) as UseQueryResult & { queryKey: QueryKey };