import type { AccountId32, AccountId32Like, Bytes, BytesLike, DispatchError, FixedBytes, H160, H256, Header, Result, RuntimeVersion, U256, UncheckedExtrinsic, UncheckedExtrinsicLike } from '@dedot/codecs'; import type { GenericRuntimeApiMethod, GenericRuntimeApis } from '@dedot/types'; import type { FrameSupportTokensFungibleUnionOfNativeOrWithId, FrameSupportViewFunctionsViewFunctionDispatchError, FrameSupportViewFunctionsViewFunctionId, KitchensinkRuntimeRuntimeCallLike, PalletContractsPrimitivesCode, PalletContractsPrimitivesCodeUploadReturnValue, PalletContractsPrimitivesContractAccessError, PalletContractsPrimitivesContractResult, PalletContractsPrimitivesContractResultResult, PalletContractsWasmDeterminism, PalletReviveEvmApiDebugRpcTypesTrace, PalletReviveEvmApiDebugRpcTypesTracerType, PalletReviveEvmApiRpcTypesGenGenericTransaction, PalletRevivePrimitivesCode, PalletRevivePrimitivesCodeUploadReturnValue, PalletRevivePrimitivesContractAccessError, PalletRevivePrimitivesContractResult, PalletRevivePrimitivesContractResultInstantiateReturnValue, PalletRevivePrimitivesEthTransactError, PalletRevivePrimitivesEthTransactInfo, PalletTransactionPaymentFeeDetails, PalletTransactionPaymentRuntimeDispatchInfo, SpAuthorityDiscoveryAppPublic, SpConsensusBabeAppPublic, SpConsensusBabeBabeConfiguration, SpConsensusBabeEpoch, SpConsensusBabeOpaqueKeyOwnershipProof, SpConsensusBeefyDoubleVotingProof, SpConsensusBeefyEcdsaCryptoPublic, SpConsensusBeefyForkVotingProofOpaqueValue, SpConsensusBeefyFutureBlockVotingProof, SpConsensusBeefyValidatorSet, SpConsensusGrandpaAppPublic, SpConsensusGrandpaEquivocationProof, SpConsensusSlotsEquivocationProof, SpConsensusSlotsSlot, SpCoreCryptoKeyTypeId, SpCoreOpaqueMetadata, SpInherentsCheckInherentsResult, SpInherentsInherentData, SpMixnetMixnode, SpMixnetMixnodesErr, SpMixnetSessionStatus, SpMmrPrimitivesEncodableOpaqueLeaf, SpMmrPrimitivesError, SpMmrPrimitivesLeafProof, SpRuntimeBlock, SpRuntimeExtrinsicInclusionMode, SpRuntimeOpaqueValue, SpRuntimeTransactionValidityTransactionSource, SpRuntimeTransactionValidityTransactionValidityError, SpRuntimeTransactionValidityValidTransaction, SpStatementStoreRuntimeApiInvalidStatement, SpStatementStoreRuntimeApiStatementSource, SpStatementStoreRuntimeApiValidStatement, SpStatementStoreStatement, SpWeightsWeightV2Weight } from './types.js'; export interface RuntimeApis extends GenericRuntimeApis { /** * @runtimeapi: Core - 0xdf6acb689907609b **/ core: { /** * Returns the version of the runtime. * * @callname: Core_version **/ version: GenericRuntimeApiMethod<() => Promise>; /** * Execute the given block. * * @callname: Core_execute_block * @param {SpRuntimeBlock} block **/ executeBlock: GenericRuntimeApiMethod<(block: SpRuntimeBlock) => Promise<[]>>; /** * Initialize a block with the given header and return the runtime executive mode. * * @callname: Core_initialize_block * @param {Header} header **/ initializeBlock: GenericRuntimeApiMethod<(header: Header) => Promise>; /** * Generic runtime api call **/ [method: string]: GenericRuntimeApiMethod; }; /** * @runtimeapi: Metadata - 0x37e397fc7c91f5e4 **/ metadata: { /** * Returns the metadata of a runtime. * * @callname: Metadata_metadata **/ metadata: GenericRuntimeApiMethod<() => Promise>; /** * Returns the metadata at a given version. * * If the given `version` isn't supported, this will return `None`. * Use [`Self::metadata_versions`] to find out about supported metadata version of the runtime. * * @callname: Metadata_metadata_at_version * @param {number} version **/ metadataAtVersion: GenericRuntimeApiMethod<(version: number) => Promise>; /** * Returns the supported metadata versions. * * This can be used to call `metadata_at_version`. * * @callname: Metadata_metadata_versions **/ metadataVersions: GenericRuntimeApiMethod<() => Promise>>; /** * Generic runtime api call **/ [method: string]: GenericRuntimeApiMethod; }; /** * @runtimeapi: RuntimeViewFunction - 0xccd9de6396c899ca **/ runtimeViewFunction: { /** * Execute a view function query. * * @callname: RuntimeViewFunction_execute_view_function * @param {FrameSupportViewFunctionsViewFunctionId} query_id * @param {BytesLike} input **/ executeViewFunction: GenericRuntimeApiMethod<(queryId: FrameSupportViewFunctionsViewFunctionId, input: BytesLike) => Promise>>; /** * Generic runtime api call **/ [method: string]: GenericRuntimeApiMethod; }; /** * @runtimeapi: BlockBuilder - 0x40fe3ad401f8959a **/ blockBuilder: { /** * Apply the given extrinsic. * * Returns an inclusion outcome which specifies if this extrinsic is included in * this block or not. * * @callname: BlockBuilder_apply_extrinsic * @param {UncheckedExtrinsicLike} extrinsic **/ applyExtrinsic: GenericRuntimeApiMethod<(extrinsic: UncheckedExtrinsicLike) => Promise, SpRuntimeTransactionValidityTransactionValidityError>>>; /** * Finish the current block. * * @callname: BlockBuilder_finalize_block **/ finalizeBlock: GenericRuntimeApiMethod<() => Promise
>; /** * Generate inherent extrinsics. The inherent data will vary from chain to chain. * * @callname: BlockBuilder_inherent_extrinsics * @param {SpInherentsInherentData} inherent **/ inherentExtrinsics: GenericRuntimeApiMethod<(inherent: SpInherentsInherentData) => Promise>>; /** * Check that the inherents are valid. The inherent data will vary from chain to chain. * * @callname: BlockBuilder_check_inherents * @param {SpRuntimeBlock} block * @param {SpInherentsInherentData} data **/ checkInherents: GenericRuntimeApiMethod<(block: SpRuntimeBlock, data: SpInherentsInherentData) => Promise>; /** * Generic runtime api call **/ [method: string]: GenericRuntimeApiMethod; }; /** * @runtimeapi: TaggedTransactionQueue - 0xd2bc9897eed08f15 **/ taggedTransactionQueue: { /** * Validate the transaction. * * This method is invoked by the transaction pool to learn details about given transaction. * The implementation should make sure to verify the correctness of the transaction * against current state. The given `block_hash` corresponds to the hash of the block * that is used as current state. * * Note that this call may be performed by the pool multiple times and transactions * might be verified in any possible order. * * @callname: TaggedTransactionQueue_validate_transaction * @param {SpRuntimeTransactionValidityTransactionSource} source * @param {UncheckedExtrinsicLike} tx * @param {H256} block_hash **/ validateTransaction: GenericRuntimeApiMethod<(source: SpRuntimeTransactionValidityTransactionSource, tx: UncheckedExtrinsicLike, blockHash: H256) => Promise>>; /** * Generic runtime api call **/ [method: string]: GenericRuntimeApiMethod; }; /** * @runtimeapi: ValidateStatement - 0xbe9fb0c91a8046cf **/ validateStatement: { /** * Validate the statement. * * @callname: ValidateStatement_validate_statement * @param {SpStatementStoreRuntimeApiStatementSource} source * @param {SpStatementStoreStatement} statement **/ validateStatement: GenericRuntimeApiMethod<(source: SpStatementStoreRuntimeApiStatementSource, statement: SpStatementStoreStatement) => Promise>>; /** * Generic runtime api call **/ [method: string]: GenericRuntimeApiMethod; }; /** * @runtimeapi: OffchainWorkerApi - 0xf78b278be53f454c **/ offchainWorkerApi: { /** * Starts the off-chain task for given block header. * * @callname: OffchainWorkerApi_offchain_worker * @param {Header} header **/ offchainWorker: GenericRuntimeApiMethod<(header: Header) => Promise<[]>>; /** * Generic runtime api call **/ [method: string]: GenericRuntimeApiMethod; }; /** * @runtimeapi: GrandpaApi - 0xed99c5acb25eedf5 **/ grandpaApi: { /** * Get the current GRANDPA authorities and weights. This should not change except * for when changes are scheduled and the corresponding delay has passed. * * When called at block B, it will return the set of authorities that should be * used to finalize descendants of this block (B+1, B+2, ...). The block B itself * is finalized by the authorities from block B-1. * * @callname: GrandpaApi_grandpa_authorities **/ grandpaAuthorities: GenericRuntimeApiMethod<() => Promise>>; /** * Submits an unsigned extrinsic to report an equivocation. The caller * must provide the equivocation proof and a key ownership proof * (should be obtained using `generate_key_ownership_proof`). The * extrinsic will be unsigned and should only be accepted for local * authorship (not to be broadcast to the network). This method returns * `None` when creation of the extrinsic fails, e.g. if equivocation * reporting is disabled for the given runtime (i.e. this method is * hardcoded to return `None`). Only useful in an offchain context. * * @callname: GrandpaApi_submit_report_equivocation_unsigned_extrinsic * @param {SpConsensusGrandpaEquivocationProof} equivocation_proof * @param {SpRuntimeOpaqueValue} key_owner_proof **/ submitReportEquivocationUnsignedExtrinsic: GenericRuntimeApiMethod<(equivocationProof: SpConsensusGrandpaEquivocationProof, keyOwnerProof: SpRuntimeOpaqueValue) => Promise<[] | undefined>>; /** * Generates a proof of key ownership for the given authority in the * given set. An example usage of this module is coupled with the * session historical module to prove that a given authority key is * tied to a given staking identity during a specific session. Proofs * of key ownership are necessary for submitting equivocation reports. * NOTE: even though the API takes a `set_id` as parameter the current * implementations ignore this parameter and instead rely on this * method being called at the correct block height, i.e. any point at * which the given set id is live on-chain. Future implementations will * instead use indexed data through an offchain worker, not requiring * older states to be available. * * @callname: GrandpaApi_generate_key_ownership_proof * @param {bigint} set_id * @param {SpConsensusGrandpaAppPublic} authority_id **/ generateKeyOwnershipProof: GenericRuntimeApiMethod<(setId: bigint, authorityId: SpConsensusGrandpaAppPublic) => Promise>; /** * Get current GRANDPA authority set id. * * @callname: GrandpaApi_current_set_id **/ currentSetId: GenericRuntimeApiMethod<() => Promise>; /** * Generic runtime api call **/ [method: string]: GenericRuntimeApiMethod; }; /** * @runtimeapi: NominationPoolsApi - 0x17a6bc0d0062aeb3 **/ nominationPoolsApi: { /** * Returns the pending rewards for the member that the AccountId was given for. * * @callname: NominationPoolsApi_pending_rewards * @param {AccountId32Like} who **/ pendingRewards: GenericRuntimeApiMethod<(who: AccountId32Like) => Promise>; /** * Returns the equivalent balance of `points` for a given pool. * * @callname: NominationPoolsApi_points_to_balance * @param {number} pool_id * @param {bigint} points **/ pointsToBalance: GenericRuntimeApiMethod<(poolId: number, points: bigint) => Promise>; /** * Returns the equivalent points of `new_funds` for a given pool. * * @callname: NominationPoolsApi_balance_to_points * @param {number} pool_id * @param {bigint} new_funds **/ balanceToPoints: GenericRuntimeApiMethod<(poolId: number, newFunds: bigint) => Promise>; /** * Returns the pending slash for a given pool. * * @callname: NominationPoolsApi_pool_pending_slash * @param {number} pool_id **/ poolPendingSlash: GenericRuntimeApiMethod<(poolId: number) => Promise>; /** * Returns the pending slash for a given pool member. * * If pending slash of the member exceeds `ExistentialDeposit`, it can be reported on * chain. * * @callname: NominationPoolsApi_member_pending_slash * @param {AccountId32Like} member **/ memberPendingSlash: GenericRuntimeApiMethod<(member: AccountId32Like) => Promise>; /** * Returns true if the pool with `pool_id` needs migration. * * This can happen when the `pallet-nomination-pools` has switched to using strategy * [`DelegateStake`](pallet_nomination_pools::adapter::DelegateStake) but the pool * still has funds that were staked using the older strategy * [TransferStake](pallet_nomination_pools::adapter::TransferStake). Use * [`migrate_pool_to_delegate_stake`](pallet_nomination_pools::Call::migrate_pool_to_delegate_stake) * to migrate the pool. * * @callname: NominationPoolsApi_pool_needs_delegate_migration * @param {number} pool_id **/ poolNeedsDelegateMigration: GenericRuntimeApiMethod<(poolId: number) => Promise>; /** * Returns true if the delegated funds of the pool `member` needs migration. * * Once a pool has successfully migrated to the strategy * [`DelegateStake`](pallet_nomination_pools::adapter::DelegateStake), the funds of the * member can be migrated from pool account to the member's account. Use * [`migrate_delegation`](pallet_nomination_pools::Call::migrate_delegation) * to migrate the funds of the pool member. * * @callname: NominationPoolsApi_member_needs_delegate_migration * @param {AccountId32Like} member **/ memberNeedsDelegateMigration: GenericRuntimeApiMethod<(member: AccountId32Like) => Promise>; /** * Returns the total contribution of a pool member including any balance that is unbonding. * * @callname: NominationPoolsApi_member_total_balance * @param {AccountId32Like} who **/ memberTotalBalance: GenericRuntimeApiMethod<(who: AccountId32Like) => Promise>; /** * Total balance contributed to the pool. * * @callname: NominationPoolsApi_pool_balance * @param {number} pool_id **/ poolBalance: GenericRuntimeApiMethod<(poolId: number) => Promise>; /** * Returns the bonded account and reward account associated with the pool_id. * * @callname: NominationPoolsApi_pool_accounts * @param {number} pool_id **/ poolAccounts: GenericRuntimeApiMethod<(poolId: number) => Promise<[AccountId32, AccountId32]>>; /** * Generic runtime api call **/ [method: string]: GenericRuntimeApiMethod; }; /** * @runtimeapi: StakingApi - 0x18ef58a3b67ba770 **/ stakingApi: { /** * Returns the nominations quota for a nominator with a given balance. * * @callname: StakingApi_nominations_quota * @param {bigint} balance **/ nominationsQuota: GenericRuntimeApiMethod<(balance: bigint) => Promise>; /** * Returns the page count of exposures for a validator `account` in a given era. * * @callname: StakingApi_eras_stakers_page_count * @param {number} era * @param {AccountId32Like} account **/ erasStakersPageCount: GenericRuntimeApiMethod<(era: number, account: AccountId32Like) => Promise>; /** * Returns true if validator `account` has pages to be claimed for the given era. * * @callname: StakingApi_pending_rewards * @param {number} era * @param {AccountId32Like} account **/ pendingRewards: GenericRuntimeApiMethod<(era: number, account: AccountId32Like) => Promise>; /** * Generic runtime api call **/ [method: string]: GenericRuntimeApiMethod; }; /** * @runtimeapi: BabeApi - 0xcbca25e39f142387 **/ babeApi: { /** * Return the configuration for BABE. * * @callname: BabeApi_configuration **/ configuration: GenericRuntimeApiMethod<() => Promise>; /** * Returns the slot that started the current epoch. * * @callname: BabeApi_current_epoch_start **/ currentEpochStart: GenericRuntimeApiMethod<() => Promise>; /** * Returns information regarding the current epoch. * * @callname: BabeApi_current_epoch **/ currentEpoch: GenericRuntimeApiMethod<() => Promise>; /** * Returns information regarding the next epoch (which was already * previously announced). * * @callname: BabeApi_next_epoch **/ nextEpoch: GenericRuntimeApiMethod<() => Promise>; /** * Generates a proof of key ownership for the given authority in the * current epoch. An example usage of this module is coupled with the * session historical module to prove that a given authority key is * tied to a given staking identity during a specific session. Proofs * of key ownership are necessary for submitting equivocation reports. * NOTE: even though the API takes a `slot` as parameter the current * implementations ignores this parameter and instead relies on this * method being called at the correct block height, i.e. any point at * which the epoch for the given slot is live on-chain. Future * implementations will instead use indexed data through an offchain * worker, not requiring older states to be available. * * @callname: BabeApi_generate_key_ownership_proof * @param {SpConsensusSlotsSlot} slot * @param {SpConsensusBabeAppPublic} authority_id **/ generateKeyOwnershipProof: GenericRuntimeApiMethod<(slot: SpConsensusSlotsSlot, authorityId: SpConsensusBabeAppPublic) => Promise>; /** * Submits an unsigned extrinsic to report an equivocation. The caller * must provide the equivocation proof and a key ownership proof * (should be obtained using `generate_key_ownership_proof`). The * extrinsic will be unsigned and should only be accepted for local * authorship (not to be broadcast to the network). This method returns * `None` when creation of the extrinsic fails, e.g. if equivocation * reporting is disabled for the given runtime (i.e. this method is * hardcoded to return `None`). Only useful in an offchain context. * * @callname: BabeApi_submit_report_equivocation_unsigned_extrinsic * @param {SpConsensusSlotsEquivocationProof} equivocation_proof * @param {SpConsensusBabeOpaqueKeyOwnershipProof} key_owner_proof **/ submitReportEquivocationUnsignedExtrinsic: GenericRuntimeApiMethod<(equivocationProof: SpConsensusSlotsEquivocationProof, keyOwnerProof: SpConsensusBabeOpaqueKeyOwnershipProof) => Promise<[] | undefined>>; /** * Generic runtime api call **/ [method: string]: GenericRuntimeApiMethod; }; /** * @runtimeapi: AuthorityDiscoveryApi - 0x687ad44ad37f03c2 **/ authorityDiscoveryApi: { /** * Retrieve authority identifiers of the current and next authority set. * * @callname: AuthorityDiscoveryApi_authorities **/ authorities: GenericRuntimeApiMethod<() => Promise>>; /** * Generic runtime api call **/ [method: string]: GenericRuntimeApiMethod; }; /** * @runtimeapi: AccountNonceApi - 0xbc9d89904f5b923f **/ accountNonceApi: { /** * Get current account nonce of given `AccountId`. * * @callname: AccountNonceApi_account_nonce * @param {AccountId32Like} account **/ accountNonce: GenericRuntimeApiMethod<(account: AccountId32Like) => Promise>; /** * Generic runtime api call **/ [method: string]: GenericRuntimeApiMethod; }; /** * @runtimeapi: AssetsApi - 0x8453b50b22293977 **/ assetsApi: { /** * Returns the list of `AssetId`s and corresponding balance that an `AccountId` has. * * @callname: AssetsApi_account_balances * @param {AccountId32Like} account **/ accountBalances: GenericRuntimeApiMethod<(account: AccountId32Like) => Promise>>; /** * Generic runtime api call **/ [method: string]: GenericRuntimeApiMethod; }; /** * @runtimeapi: ContractsApi - 0x68b66ba122c93fa7 **/ contractsApi: { /** * Perform a call from a specified account to a given contract. * * See [`crate::Pallet::bare_call`]. * * @callname: ContractsApi_call * @param {AccountId32Like} origin * @param {AccountId32Like} dest * @param {bigint} value * @param {SpWeightsWeightV2Weight | undefined} gas_limit * @param {bigint | undefined} storage_deposit_limit * @param {BytesLike} input_data **/ call: GenericRuntimeApiMethod<(origin: AccountId32Like, dest: AccountId32Like, value: bigint, gasLimit: SpWeightsWeightV2Weight | undefined, storageDepositLimit: bigint | undefined, inputData: BytesLike) => Promise>; /** * Instantiate a new contract. * * See `[crate::Pallet::bare_instantiate]`. * * @callname: ContractsApi_instantiate * @param {AccountId32Like} origin * @param {bigint} value * @param {SpWeightsWeightV2Weight | undefined} gas_limit * @param {bigint | undefined} storage_deposit_limit * @param {PalletContractsPrimitivesCode} code * @param {BytesLike} data * @param {BytesLike} salt **/ instantiate: GenericRuntimeApiMethod<(origin: AccountId32Like, value: bigint, gasLimit: SpWeightsWeightV2Weight | undefined, storageDepositLimit: bigint | undefined, code: PalletContractsPrimitivesCode, data: BytesLike, salt: BytesLike) => Promise>; /** * Upload new code without instantiating a contract from it. * * See [`crate::Pallet::bare_upload_code`]. * * @callname: ContractsApi_upload_code * @param {AccountId32Like} origin * @param {BytesLike} code * @param {bigint | undefined} storage_deposit_limit * @param {PalletContractsWasmDeterminism} determinism **/ uploadCode: GenericRuntimeApiMethod<(origin: AccountId32Like, code: BytesLike, storageDepositLimit: bigint | undefined, determinism: PalletContractsWasmDeterminism) => Promise>>; /** * Query a given storage key in a given contract. * * Returns `Ok(Some(Vec))` if the storage value exists under the given key in the * specified account and `Ok(None)` if it doesn't. If the account specified by the address * doesn't exist, or doesn't have a contract then `Err` is returned. * * @callname: ContractsApi_get_storage * @param {AccountId32Like} address * @param {BytesLike} key **/ getStorage: GenericRuntimeApiMethod<(address: AccountId32Like, key: BytesLike) => Promise>>; /** * Generic runtime api call **/ [method: string]: GenericRuntimeApiMethod; }; /** * @runtimeapi: ReviveApi - 0x8c403e5c4a9fd442 **/ reviveApi: { /** * Returns the block gas limit. * * @callname: ReviveApi_block_gas_limit **/ blockGasLimit: GenericRuntimeApiMethod<() => Promise>; /** * Returns the free balance of the given `[H160]` address, using EVM decimals. * * @callname: ReviveApi_balance * @param {H160} address **/ balance: GenericRuntimeApiMethod<(address: H160) => Promise>; /** * Returns the gas price. * * @callname: ReviveApi_gas_price **/ gasPrice: GenericRuntimeApiMethod<() => Promise>; /** * Returns the nonce of the given `[H160]` address. * * @callname: ReviveApi_nonce * @param {H160} address **/ nonce: GenericRuntimeApiMethod<(address: H160) => Promise>; /** * Perform a call from a specified account to a given contract. * * See [`crate::Pallet::bare_call`]. * * @callname: ReviveApi_call * @param {AccountId32Like} origin * @param {H160} dest * @param {bigint} value * @param {SpWeightsWeightV2Weight | undefined} gas_limit * @param {bigint | undefined} storage_deposit_limit * @param {BytesLike} input_data **/ call: GenericRuntimeApiMethod<(origin: AccountId32Like, dest: H160, value: bigint, gasLimit: SpWeightsWeightV2Weight | undefined, storageDepositLimit: bigint | undefined, inputData: BytesLike) => Promise>; /** * Instantiate a new contract. * * See `[crate::Pallet::bare_instantiate]`. * * @callname: ReviveApi_instantiate * @param {AccountId32Like} origin * @param {bigint} value * @param {SpWeightsWeightV2Weight | undefined} gas_limit * @param {bigint | undefined} storage_deposit_limit * @param {PalletRevivePrimitivesCode} code * @param {BytesLike} data * @param {FixedBytes<32> | undefined} salt **/ instantiate: GenericRuntimeApiMethod<(origin: AccountId32Like, value: bigint, gasLimit: SpWeightsWeightV2Weight | undefined, storageDepositLimit: bigint | undefined, code: PalletRevivePrimitivesCode, data: BytesLike, salt?: FixedBytes<32> | undefined) => Promise>; /** * Perform an Ethereum call. * * See [`crate::Pallet::bare_eth_transact`] * * @callname: ReviveApi_eth_transact * @param {PalletReviveEvmApiRpcTypesGenGenericTransaction} tx **/ ethTransact: GenericRuntimeApiMethod<(tx: PalletReviveEvmApiRpcTypesGenGenericTransaction) => Promise>>; /** * Upload new code without instantiating a contract from it. * * See [`crate::Pallet::bare_upload_code`]. * * @callname: ReviveApi_upload_code * @param {AccountId32Like} origin * @param {BytesLike} code * @param {bigint | undefined} storage_deposit_limit **/ uploadCode: GenericRuntimeApiMethod<(origin: AccountId32Like, code: BytesLike, storageDepositLimit?: bigint | undefined) => Promise>>; /** * Query a given storage key in a given contract. * * Returns `Ok(Some(Vec))` if the storage value exists under the given key in the * specified account and `Ok(None)` if it doesn't. If the account specified by the address * doesn't exist, or doesn't have a contract then `Err` is returned. * * @callname: ReviveApi_get_storage * @param {H160} address * @param {FixedBytes<32>} key **/ getStorage: GenericRuntimeApiMethod<(address: H160, key: FixedBytes<32>) => Promise>>; /** * Traces the execution of an entire block and returns call traces. * * This is intended to be called through `state_call` to replay the block from the * parent block. * * See eth-rpc `debug_traceBlockByNumber` for usage. * * @callname: ReviveApi_trace_block * @param {SpRuntimeBlock} block * @param {PalletReviveEvmApiDebugRpcTypesTracerType} config **/ traceBlock: GenericRuntimeApiMethod<(block: SpRuntimeBlock, config: PalletReviveEvmApiDebugRpcTypesTracerType) => Promise>>; /** * Traces the execution of a specific transaction within a block. * * This is intended to be called through `state_call` to replay the block from the * parent hash up to the transaction. * * See eth-rpc `debug_traceTransaction` for usage. * * @callname: ReviveApi_trace_tx * @param {SpRuntimeBlock} block * @param {number} tx_index * @param {PalletReviveEvmApiDebugRpcTypesTracerType} config **/ traceTx: GenericRuntimeApiMethod<(block: SpRuntimeBlock, txIndex: number, config: PalletReviveEvmApiDebugRpcTypesTracerType) => Promise>; /** * Dry run and return the trace of the given call. * * See eth-rpc `debug_traceCall` for usage. * * @callname: ReviveApi_trace_call * @param {PalletReviveEvmApiRpcTypesGenGenericTransaction} tx * @param {PalletReviveEvmApiDebugRpcTypesTracerType} config **/ traceCall: GenericRuntimeApiMethod<(tx: PalletReviveEvmApiRpcTypesGenGenericTransaction, config: PalletReviveEvmApiDebugRpcTypesTracerType) => Promise>>; /** * Generic runtime api call **/ [method: string]: GenericRuntimeApiMethod; }; /** * @runtimeapi: TransactionPaymentApi - 0x37c8bb1350a9a2a8 **/ transactionPaymentApi: { /** * * @callname: TransactionPaymentApi_query_info * @param {UncheckedExtrinsicLike} uxt * @param {number} len **/ queryInfo: GenericRuntimeApiMethod<(uxt: UncheckedExtrinsicLike, len: number) => Promise>; /** * * @callname: TransactionPaymentApi_query_fee_details * @param {UncheckedExtrinsicLike} uxt * @param {number} len **/ queryFeeDetails: GenericRuntimeApiMethod<(uxt: UncheckedExtrinsicLike, len: number) => Promise>; /** * * @callname: TransactionPaymentApi_query_weight_to_fee * @param {SpWeightsWeightV2Weight} weight **/ queryWeightToFee: GenericRuntimeApiMethod<(weight: SpWeightsWeightV2Weight) => Promise>; /** * * @callname: TransactionPaymentApi_query_length_to_fee * @param {number} length **/ queryLengthToFee: GenericRuntimeApiMethod<(length: number) => Promise>; /** * Generic runtime api call **/ [method: string]: GenericRuntimeApiMethod; }; /** * @runtimeapi: AssetConversionApi - 0x8a8047a53a8277ec **/ assetConversionApi: { /** * Provides a quote for [`Pallet::swap_tokens_for_exact_tokens`]. * * Note that the price may have changed by the time the transaction is executed. * (Use `amount_in_max` to control slippage.) * * @callname: AssetConversionApi_quote_price_tokens_for_exact_tokens * @param {FrameSupportTokensFungibleUnionOfNativeOrWithId} asset1 * @param {FrameSupportTokensFungibleUnionOfNativeOrWithId} asset2 * @param {bigint} amount * @param {boolean} include_fee **/ quotePriceTokensForExactTokens: GenericRuntimeApiMethod<(asset1: FrameSupportTokensFungibleUnionOfNativeOrWithId, asset2: FrameSupportTokensFungibleUnionOfNativeOrWithId, amount: bigint, includeFee: boolean) => Promise>; /** * Provides a quote for [`Pallet::swap_exact_tokens_for_tokens`]. * * Note that the price may have changed by the time the transaction is executed. * (Use `amount_out_min` to control slippage.) * * @callname: AssetConversionApi_quote_price_exact_tokens_for_tokens * @param {FrameSupportTokensFungibleUnionOfNativeOrWithId} asset1 * @param {FrameSupportTokensFungibleUnionOfNativeOrWithId} asset2 * @param {bigint} amount * @param {boolean} include_fee **/ quotePriceExactTokensForTokens: GenericRuntimeApiMethod<(asset1: FrameSupportTokensFungibleUnionOfNativeOrWithId, asset2: FrameSupportTokensFungibleUnionOfNativeOrWithId, amount: bigint, includeFee: boolean) => Promise>; /** * Returns the size of the liquidity pool for the given asset pair. * * @callname: AssetConversionApi_get_reserves * @param {FrameSupportTokensFungibleUnionOfNativeOrWithId} asset1 * @param {FrameSupportTokensFungibleUnionOfNativeOrWithId} asset2 **/ getReserves: GenericRuntimeApiMethod<(asset1: FrameSupportTokensFungibleUnionOfNativeOrWithId, asset2: FrameSupportTokensFungibleUnionOfNativeOrWithId) => Promise<[bigint, bigint] | undefined>>; /** * Generic runtime api call **/ [method: string]: GenericRuntimeApiMethod; }; /** * @runtimeapi: TransactionPaymentCallApi - 0xf3ff14d5ab527059 **/ transactionPaymentCallApi: { /** * Query information of a dispatch class, weight, and fee of a given encoded `Call`. * * @callname: TransactionPaymentCallApi_query_call_info * @param {KitchensinkRuntimeRuntimeCallLike} call * @param {number} len **/ queryCallInfo: GenericRuntimeApiMethod<(call: KitchensinkRuntimeRuntimeCallLike, len: number) => Promise>; /** * Query fee details of a given encoded `Call`. * * @callname: TransactionPaymentCallApi_query_call_fee_details * @param {KitchensinkRuntimeRuntimeCallLike} call * @param {number} len **/ queryCallFeeDetails: GenericRuntimeApiMethod<(call: KitchensinkRuntimeRuntimeCallLike, len: number) => Promise>; /** * Query the output of the current `WeightToFee` given some input. * * @callname: TransactionPaymentCallApi_query_weight_to_fee * @param {SpWeightsWeightV2Weight} weight **/ queryWeightToFee: GenericRuntimeApiMethod<(weight: SpWeightsWeightV2Weight) => Promise>; /** * Query the output of the current `LengthToFee` given some input. * * @callname: TransactionPaymentCallApi_query_length_to_fee * @param {number} length **/ queryLengthToFee: GenericRuntimeApiMethod<(length: number) => Promise>; /** * Generic runtime api call **/ [method: string]: GenericRuntimeApiMethod; }; /** * @runtimeapi: NftsApi - 0x899a250cbe84f250 **/ nftsApi: { /** * * @callname: NftsApi_owner * @param {number} collection * @param {number} item **/ owner: GenericRuntimeApiMethod<(collection: number, item: number) => Promise>; /** * * @callname: NftsApi_collection_owner * @param {number} collection **/ collectionOwner: GenericRuntimeApiMethod<(collection: number) => Promise>; /** * * @callname: NftsApi_attribute * @param {number} collection * @param {number} item * @param {BytesLike} key **/ attribute: GenericRuntimeApiMethod<(collection: number, item: number, key: BytesLike) => Promise>; /** * * @callname: NftsApi_custom_attribute * @param {AccountId32Like} account * @param {number} collection * @param {number} item * @param {BytesLike} key **/ customAttribute: GenericRuntimeApiMethod<(account: AccountId32Like, collection: number, item: number, key: BytesLike) => Promise>; /** * * @callname: NftsApi_system_attribute * @param {number} collection * @param {number | undefined} item * @param {BytesLike} key **/ systemAttribute: GenericRuntimeApiMethod<(collection: number, item: number | undefined, key: BytesLike) => Promise>; /** * * @callname: NftsApi_collection_attribute * @param {number} collection * @param {BytesLike} key **/ collectionAttribute: GenericRuntimeApiMethod<(collection: number, key: BytesLike) => Promise>; /** * Generic runtime api call **/ [method: string]: GenericRuntimeApiMethod; }; /** * @runtimeapi: BeefyApi - 0x49eaaf1b548a0cb0 **/ beefyApi: { /** * Return the block number where BEEFY consensus is enabled/started * * @callname: BeefyApi_beefy_genesis **/ beefyGenesis: GenericRuntimeApiMethod<() => Promise>; /** * Return the current active BEEFY validator set * * @callname: BeefyApi_validator_set **/ validatorSet: GenericRuntimeApiMethod<() => Promise>; /** * Submits an unsigned extrinsic to report a double voting equivocation. The caller * must provide the double voting proof and a key ownership proof * (should be obtained using `generate_key_ownership_proof`). The * extrinsic will be unsigned and should only be accepted for local * authorship (not to be broadcast to the network). This method returns * `None` when creation of the extrinsic fails, e.g. if equivocation * reporting is disabled for the given runtime (i.e. this method is * hardcoded to return `None`). Only useful in an offchain context. * * @callname: BeefyApi_submit_report_double_voting_unsigned_extrinsic * @param {SpConsensusBeefyDoubleVotingProof} equivocation_proof * @param {SpRuntimeOpaqueValue} key_owner_proof **/ submitReportDoubleVotingUnsignedExtrinsic: GenericRuntimeApiMethod<(equivocationProof: SpConsensusBeefyDoubleVotingProof, keyOwnerProof: SpRuntimeOpaqueValue) => Promise<[] | undefined>>; /** * Submits an unsigned extrinsic to report a fork voting equivocation. The caller * must provide the fork voting proof (the ancestry proof should be obtained using * `generate_ancestry_proof`) and a key ownership proof (should be obtained using * `generate_key_ownership_proof`). The extrinsic will be unsigned and should only * be accepted for local authorship (not to be broadcast to the network). This method * returns `None` when creation of the extrinsic fails, e.g. if equivocation * reporting is disabled for the given runtime (i.e. this method is * hardcoded to return `None`). Only useful in an offchain context. * * @callname: BeefyApi_submit_report_fork_voting_unsigned_extrinsic * @param {SpConsensusBeefyForkVotingProofOpaqueValue} equivocation_proof * @param {SpRuntimeOpaqueValue} key_owner_proof **/ submitReportForkVotingUnsignedExtrinsic: GenericRuntimeApiMethod<(equivocationProof: SpConsensusBeefyForkVotingProofOpaqueValue, keyOwnerProof: SpRuntimeOpaqueValue) => Promise<[] | undefined>>; /** * Submits an unsigned extrinsic to report a future block voting equivocation. The caller * must provide the future block voting proof and a key ownership proof * (should be obtained using `generate_key_ownership_proof`). * The extrinsic will be unsigned and should only be accepted for local * authorship (not to be broadcast to the network). This method returns * `None` when creation of the extrinsic fails, e.g. if equivocation * reporting is disabled for the given runtime (i.e. this method is * hardcoded to return `None`). Only useful in an offchain context. * * @callname: BeefyApi_submit_report_future_block_voting_unsigned_extrinsic * @param {SpConsensusBeefyFutureBlockVotingProof} equivocation_proof * @param {SpRuntimeOpaqueValue} key_owner_proof **/ submitReportFutureBlockVotingUnsignedExtrinsic: GenericRuntimeApiMethod<(equivocationProof: SpConsensusBeefyFutureBlockVotingProof, keyOwnerProof: SpRuntimeOpaqueValue) => Promise<[] | undefined>>; /** * Generates a proof of key ownership for the given authority in the * given set. An example usage of this module is coupled with the * session historical module to prove that a given authority key is * tied to a given staking identity during a specific session. Proofs * of key ownership are necessary for submitting equivocation reports. * NOTE: even though the API takes a `set_id` as parameter the current * implementations ignores this parameter and instead relies on this * method being called at the correct block height, i.e. any point at * which the given set id is live on-chain. Future implementations will * instead use indexed data through an offchain worker, not requiring * older states to be available. * * @callname: BeefyApi_generate_key_ownership_proof * @param {bigint} set_id * @param {SpConsensusBeefyEcdsaCryptoPublic} authority_id **/ generateKeyOwnershipProof: GenericRuntimeApiMethod<(setId: bigint, authorityId: SpConsensusBeefyEcdsaCryptoPublic) => Promise>; /** * Generates a proof that the `prev_block_number` is part of the canonical chain at * `best_known_block_number`. * * @callname: BeefyApi_generate_ancestry_proof * @param {number} prev_block_number * @param {number | undefined} best_known_block_number **/ generateAncestryProof: GenericRuntimeApiMethod<(prevBlockNumber: number, bestKnownBlockNumber?: number | undefined) => Promise>; /** * Generic runtime api call **/ [method: string]: GenericRuntimeApiMethod; }; /** * @runtimeapi: MmrApi - 0x91d5df18b0d2cf58 **/ mmrApi: { /** * Return the on-chain MMR root hash. * * @callname: MmrApi_mmr_root **/ mmrRoot: GenericRuntimeApiMethod<() => Promise>>; /** * Return the number of MMR blocks in the chain. * * @callname: MmrApi_mmr_leaf_count **/ mmrLeafCount: GenericRuntimeApiMethod<() => Promise>>; /** * Generate MMR proof for a series of block numbers. If `best_known_block_number = Some(n)`, * use historical MMR state at given block height `n`. Else, use current MMR state. * * @callname: MmrApi_generate_proof * @param {Array} block_numbers * @param {number | undefined} best_known_block_number **/ generateProof: GenericRuntimeApiMethod<(blockNumbers: Array, bestKnownBlockNumber?: number | undefined) => Promise, SpMmrPrimitivesLeafProof], SpMmrPrimitivesError>>>; /** * Verify MMR proof against on-chain MMR for a batch of leaves. * * Note this function will use on-chain MMR root hash and check if the proof matches the hash. * Note, the leaves should be sorted such that corresponding leaves and leaf indices have the * same position in both the `leaves` vector and the `leaf_indices` vector contained in the [LeafProof] * * @callname: MmrApi_verify_proof * @param {Array} leaves * @param {SpMmrPrimitivesLeafProof} proof **/ verifyProof: GenericRuntimeApiMethod<(leaves: Array, proof: SpMmrPrimitivesLeafProof) => Promise>>; /** * Verify MMR proof against given root hash for a batch of leaves. * * Note this function does not require any on-chain storage - the * proof is verified against given MMR root hash. * * Note, the leaves should be sorted such that corresponding leaves and leaf indices have the * same position in both the `leaves` vector and the `leaf_indices` vector contained in the [LeafProof] * * @callname: MmrApi_verify_proof_stateless * @param {H256} root * @param {Array} leaves * @param {SpMmrPrimitivesLeafProof} proof **/ verifyProofStateless: GenericRuntimeApiMethod<(root: H256, leaves: Array, proof: SpMmrPrimitivesLeafProof) => Promise>>; /** * Generic runtime api call **/ [method: string]: GenericRuntimeApiMethod; }; /** * @runtimeapi: MixnetApi - 0x6fd7c327202e4a8d **/ mixnetApi: { /** * Get the index and phase of the current session. * * @callname: MixnetApi_session_status **/ sessionStatus: GenericRuntimeApiMethod<() => Promise>; /** * Get the mixnode set for the previous session. * * @callname: MixnetApi_prev_mixnodes **/ prevMixnodes: GenericRuntimeApiMethod<() => Promise, SpMixnetMixnodesErr>>>; /** * Get the mixnode set for the current session. * * @callname: MixnetApi_current_mixnodes **/ currentMixnodes: GenericRuntimeApiMethod<() => Promise, SpMixnetMixnodesErr>>>; /** * Try to register a mixnode for the next session. * * If a registration extrinsic is submitted, `true` is returned. The caller should avoid * calling `maybe_register` again for a few blocks, to give the submitted extrinsic a * chance to get included. * * With the above exception, `maybe_register` is designed to be called every block. Most * of the time it will not do anything, for example: * * - If it is not an appropriate time to submit a registration extrinsic. * - If the local node has already registered a mixnode for the next session. * - If the local node is not permitted to register a mixnode for the next session. * * `session_index` should match `session_status().current_index`; if it does not, `false` * is returned immediately. * * @callname: MixnetApi_maybe_register * @param {number} session_index * @param {SpMixnetMixnode} mixnode **/ maybeRegister: GenericRuntimeApiMethod<(sessionIndex: number, mixnode: SpMixnetMixnode) => Promise>; /** * Generic runtime api call **/ [method: string]: GenericRuntimeApiMethod; }; /** * @runtimeapi: SessionKeys - 0xab3c0572291feb8b **/ sessionKeys: { /** * Generate a set of session keys with optionally using the given seed. * The keys should be stored within the keystore exposed via runtime * externalities. * * The seed needs to be a valid `utf8` string. * * Returns the concatenated SCALE encoded public keys. * * @callname: SessionKeys_generate_session_keys * @param {BytesLike | undefined} seed **/ generateSessionKeys: GenericRuntimeApiMethod<(seed?: BytesLike | undefined) => Promise>; /** * Decode the given public session keys. * * Returns the list of public raw public keys + key type. * * @callname: SessionKeys_decode_session_keys * @param {BytesLike} encoded **/ decodeSessionKeys: GenericRuntimeApiMethod<(encoded: BytesLike) => Promise | undefined>>; /** * Generic runtime api call **/ [method: string]: GenericRuntimeApiMethod; }; /** * @runtimeapi: AssetRewards - 0x65f855d6e093c2f1 **/ assetRewards: { /** * Get the cost of creating a pool. * * This is especially useful when the cost is dynamic. * * @callname: AssetRewards_pool_creation_cost **/ poolCreationCost: GenericRuntimeApiMethod<() => Promise>; /** * Generic runtime api call **/ [method: string]: GenericRuntimeApiMethod; }; /** * @runtimeapi: GenesisBuilder - 0xfbc577b9d747efd6 **/ genesisBuilder: { /** * Build `RuntimeGenesisConfig` from a JSON blob not using any defaults and store it in the * storage. * * In the case of a FRAME-based runtime, this function deserializes the full * `RuntimeGenesisConfig` from the given JSON blob and puts it into the storage. If the * provided JSON blob is incorrect or incomplete or the deserialization fails, an error * is returned. * * Please note that provided JSON blob must contain all `RuntimeGenesisConfig` fields, no * defaults will be used. * * @callname: GenesisBuilder_build_state * @param {BytesLike} json **/ buildState: GenericRuntimeApiMethod<(json: BytesLike) => Promise>>; /** * Returns a JSON blob representation of the built-in `RuntimeGenesisConfig` identified by * `id`. * * If `id` is `None` the function should return JSON blob representation of the default * `RuntimeGenesisConfig` struct of the runtime. Implementation must provide default * `RuntimeGenesisConfig`. * * Otherwise function returns a JSON representation of the built-in, named * `RuntimeGenesisConfig` preset identified by `id`, or `None` if such preset does not * exist. Returned `Vec` contains bytes of JSON blob (patch) which comprises a list of * (potentially nested) key-value pairs that are intended for customizing the default * runtime genesis config. The patch shall be merged (rfc7386) with the JSON representation * of the default `RuntimeGenesisConfig` to create a comprehensive genesis config that can * be used in `build_state` method. * * @callname: GenesisBuilder_get_preset * @param {string | undefined} id **/ getPreset: GenericRuntimeApiMethod<(id?: string | undefined) => Promise>; /** * Returns a list of identifiers for available builtin `RuntimeGenesisConfig` presets. * * The presets from the list can be queried with [`GenesisBuilder::get_preset`] method. If * no named presets are provided by the runtime the list is empty. * * @callname: GenesisBuilder_preset_names **/ presetNames: GenericRuntimeApiMethod<() => Promise>>; /** * Generic runtime api call **/ [method: string]: GenericRuntimeApiMethod; }; }