Rebrand: polkadot → pezkuwi, substrate → bizinikiwi, kusama → dicle

This commit is contained in:
2026-01-07 02:29:40 +03:00
commit d5f038faea
1383 changed files with 1088018 additions and 0 deletions
+3
View File
@@ -0,0 +1,3 @@
# @pezkuwi/api-augment
Generated augmentation.
+32
View File
@@ -0,0 +1,32 @@
{
"author": "Jaco Greeff <jacogr@gmail.com>",
"bugs": "https://github.com/pezkuwichain/pezkuwi-api/issues",
"description": "API generated augmentation",
"engines": {
"node": ">=18"
},
"homepage": "https://github.com/pezkuwichain/pezkuwi-api/tree/master/packages/api-augment#readme",
"license": "Apache-2.0",
"name": "@pezkuwi/api-augment",
"repository": {
"directory": "packages/api-augment",
"type": "git",
"url": "https://github.com/pezkuwichain/pezkuwi-api.git"
},
"sideEffects": [
"./packageDetect.js",
"./packageDetect.cjs"
],
"type": "module",
"version": "16.5.6",
"main": "index.js",
"dependencies": {
"@pezkuwi/api-base": "16.5.4",
"@pezkuwi/rpc-augment": "16.5.4",
"@pezkuwi/types": "16.5.4",
"@pezkuwi/types-augment": "16.5.4",
"@pezkuwi/types-codec": "16.5.4",
"@pezkuwi/util": "^14.0.1",
"tslib": "^2.8.1"
}
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,11 @@
// Copyright 2017-2025 @pezkuwi/api-augment authors & contributors
// SPDX-License-Identifier: Apache-2.0
import '../base.js';
import './consts.js';
import './errors.js';
import './events.js';
import './query.js';
import './registry.js';
import './runtime.js';
import './tx.js';
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,4 @@
// Copyright 2017-2025 @pezkuwi/api-augment authors & contributors
// SPDX-License-Identifier: Apache-2.0
import '@pezkuwi/types-augment/registry/assetHubDicle';
@@ -0,0 +1,518 @@
// Auto-generated via `yarn polkadot-types-from-chain`, do not edit
/* eslint-disable */
// import type lookup before we augment - in some environments
// this is required to allow for ambient/previous definitions
import '@pezkuwi/api-base/types/calls';
import type { ApiTypes, AugmentedCall, DecoratedCallBase } from '@pezkuwi/api-base/types';
import type { Bytes, Null, Option, Result, Text, U256, U8aFixed, Vec, bool, u128, u32 } from '@pezkuwi/types-codec';
import type { AnyNumber, IMethod, ITuple } from '@pezkuwi/types-codec/types';
import type { Extrinsic } from '@pezkuwi/types/interfaces/extrinsics';
import type { OpaqueMetadata } from '@pezkuwi/types/interfaces/metadata';
import type { AccountId32, H160, H256, OriginCaller, RuntimeCall, Slot, SlotDuration } from '@pezkuwi/types/interfaces/runtime';
import type { ParaId } from '@pezkuwi/types/interfaces/teyrchains';
import type { AssetsCommonRuntimeApiFungiblesAccessError, PezcumulusPrimitivesCoreCollationInfo, PezframeSupportViewFunctionsViewFunctionDispatchError, PezframeSupportViewFunctionsViewFunctionId, PezpalletReviveEvmApiDebugRpcTypesTrace, PezpalletReviveEvmApiDebugRpcTypesTracerType, PezpalletReviveEvmApiRpcTypesGenGenericTransaction, PezpalletRevivePrimitivesCode, PezpalletRevivePrimitivesCodeUploadReturnValue, PezpalletRevivePrimitivesContractAccessError, PezpalletRevivePrimitivesContractResultExecReturnValue, PezpalletRevivePrimitivesContractResultInstantiateReturnValue, PezpalletRevivePrimitivesEthTransactError, PezpalletRevivePrimitivesEthTransactInfo, PezpalletTransactionPaymentFeeDetails, PezpalletTransactionPaymentRuntimeDispatchInfo, PezspConsensusAuraSr25519AppSr25519Public, PezspCoreCryptoKeyTypeId, PezspInherentsCheckInherentsResult, PezspInherentsInherentData, PezspRuntimeBlock, PezspRuntimeDispatchError, PezspRuntimeExtrinsicInclusionMode, PezspRuntimeHeader, PezspRuntimeTransactionValidityTransactionSource, PezspRuntimeTransactionValidityTransactionValidityError, PezspRuntimeTransactionValidityValidTransaction, PezspVersionRuntimeVersion, PezspWeightsWeightV2Weight, StagingXcmV5Location, XcmRuntimeApisAuthorizedAliasesError, XcmRuntimeApisAuthorizedAliasesOriginAliaser, XcmRuntimeApisConversionsError, XcmRuntimeApisDryRunCallDryRunEffects, XcmRuntimeApisDryRunError, XcmRuntimeApisDryRunXcmDryRunEffects, XcmRuntimeApisFeesError, XcmRuntimeApisTrustedQueryError, XcmVersionedAsset, XcmVersionedAssetId, XcmVersionedAssets, XcmVersionedLocation, XcmVersionedXcm } from '@pezkuwi/types/lookup';
import type { IExtrinsic, Observable } from '@pezkuwi/types/types';
export type __AugmentedCall<ApiType extends ApiTypes> = AugmentedCall<ApiType>;
export type __DecoratedCallBase<ApiType extends ApiTypes> = DecoratedCallBase<ApiType>;
declare module '@pezkuwi/api-base/types/calls' {
interface AugmentedCalls<ApiType extends ApiTypes> {
/** 0xbc9d89904f5b923f/ */
accountNonceApi: {
/**
* Get current account nonce of given `AccountId`.
**/
accountNonce: AugmentedCall<ApiType, (account: AccountId32 | string | Uint8Array) => Observable<u32>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x8a8047a53a8277ec/ */
assetConversionApi: {
/**
* Returns the size of the liquidity pool for the given asset pair.
**/
getReserves: AugmentedCall<ApiType, (asset1: StagingXcmV5Location | { parents?: any; interior?: any } | string | Uint8Array, asset2: StagingXcmV5Location | { parents?: any; interior?: any } | string | Uint8Array) => Observable<Option<ITuple<[u128, u128]>>>>;
/**
* 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.)
**/
quotePriceExactTokensForTokens: AugmentedCall<ApiType, (asset1: StagingXcmV5Location | { parents?: any; interior?: any } | string | Uint8Array, asset2: StagingXcmV5Location | { parents?: any; interior?: any } | string | Uint8Array, amount: u128 | AnyNumber | Uint8Array, include_fee: bool | boolean | Uint8Array) => Observable<Option<u128>>>;
/**
* 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.)
**/
quotePriceTokensForExactTokens: AugmentedCall<ApiType, (asset1: StagingXcmV5Location | { parents?: any; interior?: any } | string | Uint8Array, asset2: StagingXcmV5Location | { parents?: any; interior?: any } | string | Uint8Array, amount: u128 | AnyNumber | Uint8Array, include_fee: bool | boolean | Uint8Array) => Observable<Option<u128>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0xdd718d5cc53262d4/ */
auraApi: {
/**
* Return the current set of authorities.
**/
authorities: AugmentedCall<ApiType, () => Observable<Vec<PezspConsensusAuraSr25519AppSr25519Public>>>;
/**
* Returns the slot duration for Aura.,, Currently, only the value provided by this type at genesis will be used.
**/
slotDuration: AugmentedCall<ApiType, () => Observable<SlotDuration>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0xd7bdd8a272ca0d65/ */
auraUnincludedSegmentApi: {
/**
* Whether it is legal to extend the chain, assuming the given block is the most, recently included one as-of the relay parent that will be built against, and, the given relay chain slot.,, This should be consistent with the logic the runtime uses when validating blocks to, avoid issues.,, When the unincluded segment is empty, i.e. `included_hash == at`, where at is the block, whose state we are querying against, this must always return `true` as long as the slot, is more recent than the included block itself.
**/
canBuildUpon: AugmentedCall<ApiType, (included_hash: H256 | string | Uint8Array, slot: Slot | AnyNumber | Uint8Array) => Observable<bool>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x12c8e3d4d7e06de0/ */
authorizedAliasersApi: {
/**
* Returns locations allowed to alias into and act as `target`.
**/
authorizedAliasers: AugmentedCall<ApiType, (target: XcmVersionedLocation | { V3: any } | { V4: any } | { V5: any } | string | Uint8Array) => Observable<Result<Vec<XcmRuntimeApisAuthorizedAliasesOriginAliaser>, XcmRuntimeApisAuthorizedAliasesError>>>;
/**
* Returns whether `origin` is allowed to alias into and act as `target`.
**/
isAuthorizedAlias: AugmentedCall<ApiType, (origin: XcmVersionedLocation | { V3: any } | { V4: any } | { V5: any } | string | Uint8Array, target: XcmVersionedLocation | { V3: any } | { V4: any } | { V5: any } | string | Uint8Array) => Observable<Result<bool, XcmRuntimeApisAuthorizedAliasesError>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x40fe3ad401f8959a/ */
blockBuilder: {
/**
* Apply the given extrinsic.,, Returns an inclusion outcome which specifies if this extrinsic is included in, this block or not.
**/
applyExtrinsic: AugmentedCall<ApiType, (extrinsic: Extrinsic | IExtrinsic | string | Uint8Array) => Observable<Result<Result<Null, PezspRuntimeDispatchError>, PezspRuntimeTransactionValidityTransactionValidityError>>>;
/**
* Check that the inherents are valid. The inherent data will vary from chain to chain.
**/
checkInherents: AugmentedCall<ApiType, (block: PezspRuntimeBlock, data: PezspInherentsInherentData) => Observable<PezspInherentsCheckInherentsResult>>;
/**
* Finish the current block.
**/
finalizeBlock: AugmentedCall<ApiType, () => Observable<PezspRuntimeHeader>>;
/**
* Generate inherent extrinsics. The inherent data will vary from chain to chain.
**/
inherentExtrinsics: AugmentedCall<ApiType, (inherent: PezspInherentsInherentData) => Observable<Vec<Bytes>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0xea93e3f16f3d6962/ */
collectCollationInfo: {
/**
* Collect information about a collation.,, The given `header` is the header of the built block for that, we are collecting the collation info for.
**/
collectCollationInfo: AugmentedCall<ApiType, (header: PezspRuntimeHeader) => Observable<PezcumulusPrimitivesCoreCollationInfo>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0xdf6acb689907609b/ */
core: {
/**
* Execute the given block.
**/
executeBlock: AugmentedCall<ApiType, (block: PezspRuntimeBlock) => Observable<Null>>;
/**
* Initialize a block with the given header and return the runtime executive mode.
**/
initializeBlock: AugmentedCall<ApiType, (header: PezspRuntimeHeader) => Observable<PezspRuntimeExtrinsicInclusionMode>>;
/**
* Returns the version of the runtime.
**/
version: AugmentedCall<ApiType, () => Observable<PezspVersionRuntimeVersion>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x91b1c8b16328eb92/ */
dryRunApi: {
/**
* Dry run call V2.
**/
dryRunCall: AugmentedCall<ApiType, (origin: OriginCaller | { System: any } | string | Uint8Array, call: RuntimeCall | IMethod | string | Uint8Array, result_xcms_version: u32 | AnyNumber | Uint8Array) => Observable<Result<XcmRuntimeApisDryRunCallDryRunEffects, XcmRuntimeApisDryRunError>>>;
/**
* Dry run XCM program
**/
dryRunXcm: AugmentedCall<ApiType, (origin_location: XcmVersionedLocation | { V3: any } | { V4: any } | { V5: any } | string | Uint8Array, xcm: XcmVersionedXcm | { V3: any } | { V4: any } | { V5: any } | string | Uint8Array) => Observable<Result<XcmRuntimeApisDryRunXcmDryRunEffects, XcmRuntimeApisDryRunError>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0xde92b8a0426b9bf6/ */
fungiblesApi: {
/**
* Returns the list of all [`Asset`] that an `AccountId` has.
**/
queryAccountBalances: AugmentedCall<ApiType, (account: AccountId32 | string | Uint8Array) => Observable<Result<XcmVersionedAssets, AssetsCommonRuntimeApiFungiblesAccessError>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 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.
**/
buildState: AugmentedCall<ApiType, (json: Bytes | string | Uint8Array) => Observable<Result<Null, Text>>>;
/**
* 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<u8>` 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.
**/
getPreset: AugmentedCall<ApiType, (id: Option<Text> | null | Uint8Array | Text | string) => Observable<Option<Bytes>>>;
/**
* 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.
**/
presetNames: AugmentedCall<ApiType, () => Observable<Vec<Text>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0xa2ddb6a58477bf63/ */
getParachainInfo: {
/**
* Retrieve the parachain id used for runtime.
**/
parachainId: AugmentedCall<ApiType, () => Observable<ParaId>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x9ffb505aa738d69c/ */
locationToAccountApi: {
/**
* Converts `Location` to `AccountId`.
**/
convertLocation: AugmentedCall<ApiType, (location: XcmVersionedLocation | { V3: any } | { V4: any } | { V5: any } | string | Uint8Array) => Observable<Result<AccountId32, XcmRuntimeApisConversionsError>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x37e397fc7c91f5e4/ */
metadata: {
/**
* Returns the metadata of a runtime.
**/
metadata: AugmentedCall<ApiType, () => Observable<OpaqueMetadata>>;
/**
* 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.
**/
metadataAtVersion: AugmentedCall<ApiType, (version: u32 | AnyNumber | Uint8Array) => Observable<Option<OpaqueMetadata>>>;
/**
* Returns the supported metadata versions.,, This can be used to call `metadata_at_version`.
**/
metadataVersions: AugmentedCall<ApiType, () => Observable<Vec<u32>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x17a6bc0d0062aeb3/ */
nominationPoolsApi: {
/**
* Returns the equivalent points of `new_funds` for a given pool.
**/
balanceToPoints: AugmentedCall<ApiType, (pool_id: u32 | AnyNumber | Uint8Array, new_funds: u128 | AnyNumber | Uint8Array) => Observable<u128>>;
/**
* 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.
**/
memberNeedsDelegateMigration: AugmentedCall<ApiType, (member: AccountId32 | string | Uint8Array) => Observable<bool>>;
/**
* Returns the pending slash for a given pool member.,, If pending slash of the member exceeds `ExistentialDeposit`, it can be reported on, chain.
**/
memberPendingSlash: AugmentedCall<ApiType, (member: AccountId32 | string | Uint8Array) => Observable<u128>>;
/**
* Returns the total contribution of a pool member including any balance that is unbonding.
**/
memberTotalBalance: AugmentedCall<ApiType, (who: AccountId32 | string | Uint8Array) => Observable<u128>>;
/**
* Returns the pending rewards for the member that the AccountId was given for.
**/
pendingRewards: AugmentedCall<ApiType, (who: AccountId32 | string | Uint8Array) => Observable<u128>>;
/**
* Returns the equivalent balance of `points` for a given pool.
**/
pointsToBalance: AugmentedCall<ApiType, (pool_id: u32 | AnyNumber | Uint8Array, points: u128 | AnyNumber | Uint8Array) => Observable<u128>>;
/**
* Returns the bonded account and reward account associated with the pool_id.
**/
poolAccounts: AugmentedCall<ApiType, (pool_id: u32 | AnyNumber | Uint8Array) => Observable<ITuple<[AccountId32, AccountId32]>>>;
/**
* Total balance contributed to the pool.
**/
poolBalance: AugmentedCall<ApiType, (pool_id: u32 | AnyNumber | Uint8Array) => Observable<u128>>;
/**
* 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.
**/
poolNeedsDelegateMigration: AugmentedCall<ApiType, (pool_id: u32 | AnyNumber | Uint8Array) => Observable<bool>>;
/**
* Returns the pending slash for a given pool.
**/
poolPendingSlash: AugmentedCall<ApiType, (pool_id: u32 | AnyNumber | Uint8Array) => Observable<u128>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0xf78b278be53f454c/ */
offchainWorkerApi: {
/**
* Starts the off-chain task for given block header.
**/
offchainWorker: AugmentedCall<ApiType, (header: PezspRuntimeHeader) => Observable<Null>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x04e70521a0d3d2f8/ */
relayParentOffsetApi: {
/**
* Fetch the slot offset that is expected from the relay chain.
**/
relayParentOffset: AugmentedCall<ApiType, () => Observable<u32>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x8c403e5c4a9fd442/ */
reviveApi: {
/**
* Get the H160 address associated to this account id
**/
address: AugmentedCall<ApiType, (account_id: AccountId32 | string | Uint8Array) => Observable<H160>>;
/**
* Returns the free balance of the given `[H160]` address, using EVM decimals.
**/
balance: AugmentedCall<ApiType, (address: H160 | string | Uint8Array) => Observable<U256>>;
/**
* The address of the validator that produced the current block.
**/
blockAuthor: AugmentedCall<ApiType, () => Observable<Option<H160>>>;
/**
* Returns the block gas limit.
**/
blockGasLimit: AugmentedCall<ApiType, () => Observable<U256>>;
/**
* Perform a call from a specified account to a given contract.,, See [`crate::Pallet::bare_call`].
**/
call: AugmentedCall<ApiType, (origin: AccountId32 | string | Uint8Array, dest: H160 | string | Uint8Array, value: u128 | AnyNumber | Uint8Array, gas_limit: Option<PezspWeightsWeightV2Weight> | null | Uint8Array | PezspWeightsWeightV2Weight, storage_deposit_limit: Option<u128> | null | Uint8Array | u128 | AnyNumber, input_data: Bytes | string | Uint8Array) => Observable<PezpalletRevivePrimitivesContractResultExecReturnValue>>;
/**
* The code at the specified address taking pre-compiles into account.
**/
code: AugmentedCall<ApiType, (address: H160 | string | Uint8Array) => Observable<Bytes>>;
/**
* Perform an Ethereum call.,, See [`crate::Pallet::dry_run_eth_transact`]
**/
ethTransact: AugmentedCall<ApiType, (tx: PezpalletReviveEvmApiRpcTypesGenGenericTransaction) => Observable<Result<PezpalletRevivePrimitivesEthTransactInfo, PezpalletRevivePrimitivesEthTransactError>>>;
/**
* Returns the gas price.
**/
gasPrice: AugmentedCall<ApiType, () => Observable<U256>>;
/**
* Query a given storage key in a given contract.,, Returns `Ok(Some(Vec<u8>))` 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.
**/
getStorage: AugmentedCall<ApiType, (address: H160 | string | Uint8Array, key: U8aFixed | string | Uint8Array) => Observable<Result<Option<Bytes>, PezpalletRevivePrimitivesContractAccessError>>>;
/**
* Query a given variable-sized storage key in a given contract.,, Returns `Ok(Some(Vec<u8>))` 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.
**/
getStorageVarKey: AugmentedCall<ApiType, (address: H160 | string | Uint8Array, key: Bytes | string | Uint8Array) => Observable<Result<Option<Bytes>, PezpalletRevivePrimitivesContractAccessError>>>;
/**
* Instantiate a new contract.,, See `[crate::Pallet::bare_instantiate]`.
**/
instantiate: AugmentedCall<ApiType, (origin: AccountId32 | string | Uint8Array, value: u128 | AnyNumber | Uint8Array, gas_limit: Option<PezspWeightsWeightV2Weight> | null | Uint8Array | PezspWeightsWeightV2Weight, storage_deposit_limit: Option<u128> | null | Uint8Array | u128 | AnyNumber, code: PezpalletRevivePrimitivesCode, data: Bytes | string | Uint8Array, salt: Option<U8aFixed> | null | Uint8Array | U8aFixed | string) => Observable<PezpalletRevivePrimitivesContractResultInstantiateReturnValue>>;
/**
* Returns the nonce of the given `[H160]` address.
**/
nonce: AugmentedCall<ApiType, (address: H160 | string | Uint8Array) => Observable<u32>>;
/**
* The address used to call the runtime's pallets dispatchables
**/
runtimePalletsAddress: AugmentedCall<ApiType, () => Observable<H160>>;
/**
* 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.
**/
traceBlock: AugmentedCall<ApiType, (block: PezspRuntimeBlock, config: PezpalletReviveEvmApiDebugRpcTypesTracerType) => Observable<Vec<ITuple<[u32, PezpalletReviveEvmApiDebugRpcTypesTrace]>>>>;
/**
* Dry run and return the trace of the given call.,, See eth-rpc `debug_traceCall` for usage.
**/
traceCall: AugmentedCall<ApiType, (tx: PezpalletReviveEvmApiRpcTypesGenGenericTransaction, config: PezpalletReviveEvmApiDebugRpcTypesTracerType) => Observable<Result<PezpalletReviveEvmApiDebugRpcTypesTrace, PezpalletRevivePrimitivesEthTransactError>>>;
/**
* 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.
**/
traceTx: AugmentedCall<ApiType, (block: PezspRuntimeBlock, tx_index: u32 | AnyNumber | Uint8Array, config: PezpalletReviveEvmApiDebugRpcTypesTracerType) => Observable<Option<PezpalletReviveEvmApiDebugRpcTypesTrace>>>;
/**
* Upload new code without instantiating a contract from it.,, See [`crate::Pallet::bare_upload_code`].
**/
uploadCode: AugmentedCall<ApiType, (origin: AccountId32 | string | Uint8Array, code: Bytes | string | Uint8Array, storage_deposit_limit: Option<u128> | null | Uint8Array | u128 | AnyNumber) => Observable<Result<PezpalletRevivePrimitivesCodeUploadReturnValue, PezspRuntimeDispatchError>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0xccd9de6396c899ca/ */
runtimeViewFunction: {
/**
* Execute a view function query.
**/
executeViewFunction: AugmentedCall<ApiType, (query_id: PezframeSupportViewFunctionsViewFunctionId, input: Bytes | string | Uint8Array) => Observable<Result<Bytes, PezframeSupportViewFunctionsViewFunctionDispatchError>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0xab3c0572291feb8b/ */
sessionKeys: {
/**
* Decode the given public session keys.,, Returns the list of public raw public keys + key type.
**/
decodeSessionKeys: AugmentedCall<ApiType, (encoded: Bytes | string | Uint8Array) => Observable<Option<Vec<ITuple<[Bytes, PezspCoreCryptoKeyTypeId]>>>>>;
/**
* 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.
**/
generateSessionKeys: AugmentedCall<ApiType, (seed: Option<Bytes> | null | Uint8Array | Bytes | string) => Observable<Bytes>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x18ef58a3b67ba770/ */
stakingApi: {
/**
* Returns the page count of exposures for a validator `account` in a given era.
**/
erasStakersPageCount: AugmentedCall<ApiType, (era: u32 | AnyNumber | Uint8Array, account: AccountId32 | string | Uint8Array) => Observable<u32>>;
/**
* Returns the nominations quota for a nominator with a given balance.
**/
nominationsQuota: AugmentedCall<ApiType, (balance: u128 | AnyNumber | Uint8Array) => Observable<u32>>;
/**
* Returns true if validator `account` has pages to be claimed for the given era.
**/
pendingRewards: AugmentedCall<ApiType, (era: u32 | AnyNumber | Uint8Array, account: AccountId32 | string | Uint8Array) => Observable<bool>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 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.
**/
validateTransaction: AugmentedCall<ApiType, (source: PezspRuntimeTransactionValidityTransactionSource, tx: Extrinsic | IExtrinsic | string | Uint8Array, block_hash: H256 | string | Uint8Array) => Observable<Result<PezspRuntimeTransactionValidityValidTransaction, PezspRuntimeTransactionValidityTransactionValidityError>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x37c8bb1350a9a2a8/ */
transactionPaymentApi: {
/**
*
**/
queryFeeDetails: AugmentedCall<ApiType, (uxt: Extrinsic | IExtrinsic | string | Uint8Array, len: u32 | AnyNumber | Uint8Array) => Observable<PezpalletTransactionPaymentFeeDetails>>;
/**
*
**/
queryInfo: AugmentedCall<ApiType, (uxt: Extrinsic | IExtrinsic | string | Uint8Array, len: u32 | AnyNumber | Uint8Array) => Observable<PezpalletTransactionPaymentRuntimeDispatchInfo>>;
/**
*
**/
queryLengthToFee: AugmentedCall<ApiType, (length: u32 | AnyNumber | Uint8Array) => Observable<u128>>;
/**
*
**/
queryWeightToFee: AugmentedCall<ApiType, (weight: PezspWeightsWeightV2Weight) => Observable<u128>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0xf3ff14d5ab527059/ */
transactionPaymentCallApi: {
/**
* Query fee details of a given encoded `Call`.
**/
queryCallFeeDetails: AugmentedCall<ApiType, (call: RuntimeCall | IMethod | string | Uint8Array, len: u32 | AnyNumber | Uint8Array) => Observable<PezpalletTransactionPaymentFeeDetails>>;
/**
* Query information of a dispatch class, weight, and fee of a given encoded `Call`.
**/
queryCallInfo: AugmentedCall<ApiType, (call: RuntimeCall | IMethod | string | Uint8Array, len: u32 | AnyNumber | Uint8Array) => Observable<PezpalletTransactionPaymentRuntimeDispatchInfo>>;
/**
* Query the output of the current `LengthToFee` given some input.
**/
queryLengthToFee: AugmentedCall<ApiType, (length: u32 | AnyNumber | Uint8Array) => Observable<u128>>;
/**
* Query the output of the current `WeightToFee` given some input.
**/
queryWeightToFee: AugmentedCall<ApiType, (weight: PezspWeightsWeightV2Weight) => Observable<u128>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x2609be83ac4468dc/ */
trustedQueryApi: {
/**
* Returns if the location is a trusted reserve for the asset.,, # Arguments, * `asset`: `VersionedAsset`., * `location`: `VersionedLocation`.
**/
isTrustedReserve: AugmentedCall<ApiType, (asset: XcmVersionedAsset | { V3: any } | { V4: any } | { V5: any } | string | Uint8Array, location: XcmVersionedLocation | { V3: any } | { V4: any } | { V5: any } | string | Uint8Array) => Observable<Result<bool, XcmRuntimeApisTrustedQueryError>>>;
/**
* Returns if the asset can be teleported to the location.,, # Arguments, * `asset`: `VersionedAsset`., * `location`: `VersionedLocation`.
**/
isTrustedTeleporter: AugmentedCall<ApiType, (asset: XcmVersionedAsset | { V3: any } | { V4: any } | { V5: any } | string | Uint8Array, location: XcmVersionedLocation | { V3: any } | { V4: any } | { V5: any } | string | Uint8Array) => Observable<Result<bool, XcmRuntimeApisTrustedQueryError>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x6ff52ee858e6c5bd/ */
xcmPaymentApi: {
/**
* Returns a list of acceptable payment assets.,, # Arguments,, * `xcm_version`: Version.
**/
queryAcceptablePaymentAssets: AugmentedCall<ApiType, (xcm_version: u32 | AnyNumber | Uint8Array) => Observable<Result<Vec<XcmVersionedAssetId>, XcmRuntimeApisFeesError>>>;
/**
* Get delivery fees for sending a specific `message` to a `destination`., These always come in a specific asset, defined by the chain.,, # Arguments, * `message`: The message that'll be sent, necessary because most delivery fees are based on the, size of the message., * `destination`: The destination to send the message to. Different destinations may use, different senders that charge different fees.
**/
queryDeliveryFees: AugmentedCall<ApiType, (destination: XcmVersionedLocation | { V3: any } | { V4: any } | { V5: any } | string | Uint8Array, message: XcmVersionedXcm | { V3: any } | { V4: any } | { V5: any } | string | Uint8Array) => Observable<Result<XcmVersionedAssets, XcmRuntimeApisFeesError>>>;
/**
* Converts a weight into a fee for the specified `AssetId`.,, # Arguments,, * `weight`: convertible `Weight`., * `asset`: `VersionedAssetId`.
**/
queryWeightToAssetFee: AugmentedCall<ApiType, (weight: PezspWeightsWeightV2Weight, asset: XcmVersionedAssetId | { V3: any } | { V4: any } | { V5: any } | string | Uint8Array) => Observable<Result<u128, XcmRuntimeApisFeesError>>>;
/**
* Returns a weight needed to execute a XCM.,, # Arguments,, * `message`: `VersionedXcm`.
**/
queryXcmWeight: AugmentedCall<ApiType, (message: XcmVersionedXcm | { V3: any } | { V4: any } | { V5: any } | string | Uint8Array) => Observable<Result<PezspWeightsWeightV2Weight, XcmRuntimeApisFeesError>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
} // AugmentedCalls
} // declare module
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,11 @@
// Copyright 2017-2025 @pezkuwi/api-augment authors & contributors
// SPDX-License-Identifier: Apache-2.0
import '../base.js';
import './consts.js';
import './errors.js';
import './events.js';
import './query.js';
import './registry.js';
import './runtime.js';
import './tx.js';
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,4 @@
// Copyright 2017-2025 @pezkuwi/api-augment authors & contributors
// SPDX-License-Identifier: Apache-2.0
import '@pezkuwi/types-augment/registry/assetHubPezkuwi';
@@ -0,0 +1,443 @@
// Auto-generated via `yarn polkadot-types-from-chain`, do not edit
/* eslint-disable */
// import type lookup before we augment - in some environments
// this is required to allow for ambient/previous definitions
import '@pezkuwi/api-base/types/calls';
import type { ApiTypes, AugmentedCall, DecoratedCallBase } from '@pezkuwi/api-base/types';
import type { Bytes, Null, Option, Result, Text, Vec, bool, u128, u32 } from '@pezkuwi/types-codec';
import type { AnyNumber, IMethod, ITuple } from '@pezkuwi/types-codec/types';
import type { Extrinsic } from '@pezkuwi/types/interfaces/extrinsics';
import type { OpaqueMetadata } from '@pezkuwi/types/interfaces/metadata';
import type { AccountId32, H256, RuntimeCall, Slot, SlotDuration } from '@pezkuwi/types/interfaces/runtime';
import type { ParaId } from '@pezkuwi/types/interfaces/teyrchains';
import type { AssetHubPezkuwiRuntimeOriginCaller, AssetsCommonRuntimeApiFungiblesAccessError, PezcumulusPrimitivesCoreCollationInfo, PezframeSupportViewFunctionsViewFunctionDispatchError, PezframeSupportViewFunctionsViewFunctionId, PezpalletTransactionPaymentFeeDetails, PezpalletTransactionPaymentRuntimeDispatchInfo, PezspConsensusAuraEd25519AppEd25519Public, PezspCoreCryptoKeyTypeId, PezspInherentsCheckInherentsResult, PezspInherentsInherentData, PezspRuntimeBlock, PezspRuntimeDispatchError, PezspRuntimeExtrinsicInclusionMode, PezspRuntimeHeader, PezspRuntimeTransactionValidityTransactionSource, PezspRuntimeTransactionValidityTransactionValidityError, PezspRuntimeTransactionValidityValidTransaction, PezspVersionRuntimeVersion, PezspWeightsWeightV2Weight, StagingXcmV5Location, XcmRuntimeApisAuthorizedAliasesError, XcmRuntimeApisAuthorizedAliasesOriginAliaser, XcmRuntimeApisConversionsError, XcmRuntimeApisDryRunCallDryRunEffects, XcmRuntimeApisDryRunError, XcmRuntimeApisDryRunXcmDryRunEffects, XcmRuntimeApisFeesError, XcmRuntimeApisTrustedQueryError, XcmVersionedAsset, XcmVersionedAssetId, XcmVersionedAssets, XcmVersionedLocation, XcmVersionedXcm } from '@pezkuwi/types/lookup';
import type { IExtrinsic, Observable } from '@pezkuwi/types/types';
export type __AugmentedCall<ApiType extends ApiTypes> = AugmentedCall<ApiType>;
export type __DecoratedCallBase<ApiType extends ApiTypes> = DecoratedCallBase<ApiType>;
declare module '@pezkuwi/api-base/types/calls' {
interface AugmentedCalls<ApiType extends ApiTypes> {
/** 0xbc9d89904f5b923f/ */
accountNonceApi: {
/**
* Get current account nonce of given `AccountId`.
**/
accountNonce: AugmentedCall<ApiType, (account: AccountId32 | string | Uint8Array) => Observable<u32>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x8a8047a53a8277ec/ */
assetConversionApi: {
/**
* Returns the size of the liquidity pool for the given asset pair.
**/
getReserves: AugmentedCall<ApiType, (asset1: StagingXcmV5Location | { parents?: any; interior?: any } | string | Uint8Array, asset2: StagingXcmV5Location | { parents?: any; interior?: any } | string | Uint8Array) => Observable<Option<ITuple<[u128, u128]>>>>;
/**
* 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.)
**/
quotePriceExactTokensForTokens: AugmentedCall<ApiType, (asset1: StagingXcmV5Location | { parents?: any; interior?: any } | string | Uint8Array, asset2: StagingXcmV5Location | { parents?: any; interior?: any } | string | Uint8Array, amount: u128 | AnyNumber | Uint8Array, include_fee: bool | boolean | Uint8Array) => Observable<Option<u128>>>;
/**
* 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.)
**/
quotePriceTokensForExactTokens: AugmentedCall<ApiType, (asset1: StagingXcmV5Location | { parents?: any; interior?: any } | string | Uint8Array, asset2: StagingXcmV5Location | { parents?: any; interior?: any } | string | Uint8Array, amount: u128 | AnyNumber | Uint8Array, include_fee: bool | boolean | Uint8Array) => Observable<Option<u128>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0xdd718d5cc53262d4/ */
auraApi: {
/**
* Return the current set of authorities.
**/
authorities: AugmentedCall<ApiType, () => Observable<Vec<PezspConsensusAuraEd25519AppEd25519Public>>>;
/**
* Returns the slot duration for Aura.,, Currently, only the value provided by this type at genesis will be used.
**/
slotDuration: AugmentedCall<ApiType, () => Observable<SlotDuration>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0xd7bdd8a272ca0d65/ */
auraUnincludedSegmentApi: {
/**
* Whether it is legal to extend the chain, assuming the given block is the most, recently included one as-of the relay parent that will be built against, and, the given relay chain slot.,, This should be consistent with the logic the runtime uses when validating blocks to, avoid issues.,, When the unincluded segment is empty, i.e. `included_hash == at`, where at is the block, whose state we are querying against, this must always return `true` as long as the slot, is more recent than the included block itself.
**/
canBuildUpon: AugmentedCall<ApiType, (included_hash: H256 | string | Uint8Array, slot: Slot | AnyNumber | Uint8Array) => Observable<bool>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x12c8e3d4d7e06de0/ */
authorizedAliasersApi: {
/**
* Returns locations allowed to alias into and act as `target`.
**/
authorizedAliasers: AugmentedCall<ApiType, (target: XcmVersionedLocation | { V3: any } | { V4: any } | { V5: any } | string | Uint8Array) => Observable<Result<Vec<XcmRuntimeApisAuthorizedAliasesOriginAliaser>, XcmRuntimeApisAuthorizedAliasesError>>>;
/**
* Returns whether `origin` is allowed to alias into and act as `target`.
**/
isAuthorizedAlias: AugmentedCall<ApiType, (origin: XcmVersionedLocation | { V3: any } | { V4: any } | { V5: any } | string | Uint8Array, target: XcmVersionedLocation | { V3: any } | { V4: any } | { V5: any } | string | Uint8Array) => Observable<Result<bool, XcmRuntimeApisAuthorizedAliasesError>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x40fe3ad401f8959a/ */
blockBuilder: {
/**
* Apply the given extrinsic.,, Returns an inclusion outcome which specifies if this extrinsic is included in, this block or not.
**/
applyExtrinsic: AugmentedCall<ApiType, (extrinsic: Extrinsic | IExtrinsic | string | Uint8Array) => Observable<Result<Result<Null, PezspRuntimeDispatchError>, PezspRuntimeTransactionValidityTransactionValidityError>>>;
/**
* Check that the inherents are valid. The inherent data will vary from chain to chain.
**/
checkInherents: AugmentedCall<ApiType, (block: PezspRuntimeBlock, data: PezspInherentsInherentData) => Observable<PezspInherentsCheckInherentsResult>>;
/**
* Finish the current block.
**/
finalizeBlock: AugmentedCall<ApiType, () => Observable<PezspRuntimeHeader>>;
/**
* Generate inherent extrinsics. The inherent data will vary from chain to chain.
**/
inherentExtrinsics: AugmentedCall<ApiType, (inherent: PezspInherentsInherentData) => Observable<Vec<Bytes>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0xea93e3f16f3d6962/ */
collectCollationInfo: {
/**
* Collect information about a collation.,, The given `header` is the header of the built block for that, we are collecting the collation info for.
**/
collectCollationInfo: AugmentedCall<ApiType, (header: PezspRuntimeHeader) => Observable<PezcumulusPrimitivesCoreCollationInfo>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0xdf6acb689907609b/ */
core: {
/**
* Execute the given block.
**/
executeBlock: AugmentedCall<ApiType, (block: PezspRuntimeBlock) => Observable<Null>>;
/**
* Initialize a block with the given header and return the runtime executive mode.
**/
initializeBlock: AugmentedCall<ApiType, (header: PezspRuntimeHeader) => Observable<PezspRuntimeExtrinsicInclusionMode>>;
/**
* Returns the version of the runtime.
**/
version: AugmentedCall<ApiType, () => Observable<PezspVersionRuntimeVersion>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x91b1c8b16328eb92/ */
dryRunApi: {
/**
* Dry run call V2.
**/
dryRunCall: AugmentedCall<ApiType, (origin: AssetHubPezkuwiRuntimeOriginCaller, call: RuntimeCall | IMethod | string | Uint8Array, result_xcms_version: u32 | AnyNumber | Uint8Array) => Observable<Result<XcmRuntimeApisDryRunCallDryRunEffects, XcmRuntimeApisDryRunError>>>;
/**
* Dry run XCM program
**/
dryRunXcm: AugmentedCall<ApiType, (origin_location: XcmVersionedLocation | { V3: any } | { V4: any } | { V5: any } | string | Uint8Array, xcm: XcmVersionedXcm | { V3: any } | { V4: any } | { V5: any } | string | Uint8Array) => Observable<Result<XcmRuntimeApisDryRunXcmDryRunEffects, XcmRuntimeApisDryRunError>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0xde92b8a0426b9bf6/ */
fungiblesApi: {
/**
* Returns the list of all [`Asset`] that an `AccountId` has.
**/
queryAccountBalances: AugmentedCall<ApiType, (account: AccountId32 | string | Uint8Array) => Observable<Result<XcmVersionedAssets, AssetsCommonRuntimeApiFungiblesAccessError>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 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.
**/
buildState: AugmentedCall<ApiType, (json: Bytes | string | Uint8Array) => Observable<Result<Null, Text>>>;
/**
* 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<u8>` 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.
**/
getPreset: AugmentedCall<ApiType, (id: Option<Text> | null | Uint8Array | Text | string) => Observable<Option<Bytes>>>;
/**
* 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.
**/
presetNames: AugmentedCall<ApiType, () => Observable<Vec<Text>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0xa2ddb6a58477bf63/ */
getParachainInfo: {
/**
* Retrieve the parachain id used for runtime.
**/
parachainId: AugmentedCall<ApiType, () => Observable<ParaId>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x9ffb505aa738d69c/ */
locationToAccountApi: {
/**
* Converts `Location` to `AccountId`.
**/
convertLocation: AugmentedCall<ApiType, (location: XcmVersionedLocation | { V3: any } | { V4: any } | { V5: any } | string | Uint8Array) => Observable<Result<AccountId32, XcmRuntimeApisConversionsError>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x37e397fc7c91f5e4/ */
metadata: {
/**
* Returns the metadata of a runtime.
**/
metadata: AugmentedCall<ApiType, () => Observable<OpaqueMetadata>>;
/**
* 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.
**/
metadataAtVersion: AugmentedCall<ApiType, (version: u32 | AnyNumber | Uint8Array) => Observable<Option<OpaqueMetadata>>>;
/**
* Returns the supported metadata versions.,, This can be used to call `metadata_at_version`.
**/
metadataVersions: AugmentedCall<ApiType, () => Observable<Vec<u32>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x17a6bc0d0062aeb3/ */
nominationPoolsApi: {
/**
* Returns the equivalent points of `new_funds` for a given pool.
**/
balanceToPoints: AugmentedCall<ApiType, (pool_id: u32 | AnyNumber | Uint8Array, new_funds: u128 | AnyNumber | Uint8Array) => Observable<u128>>;
/**
* 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.
**/
memberNeedsDelegateMigration: AugmentedCall<ApiType, (member: AccountId32 | string | Uint8Array) => Observable<bool>>;
/**
* Returns the pending slash for a given pool member.,, If pending slash of the member exceeds `ExistentialDeposit`, it can be reported on, chain.
**/
memberPendingSlash: AugmentedCall<ApiType, (member: AccountId32 | string | Uint8Array) => Observable<u128>>;
/**
* Returns the total contribution of a pool member including any balance that is unbonding.
**/
memberTotalBalance: AugmentedCall<ApiType, (who: AccountId32 | string | Uint8Array) => Observable<u128>>;
/**
* Returns the pending rewards for the member that the AccountId was given for.
**/
pendingRewards: AugmentedCall<ApiType, (who: AccountId32 | string | Uint8Array) => Observable<u128>>;
/**
* Returns the equivalent balance of `points` for a given pool.
**/
pointsToBalance: AugmentedCall<ApiType, (pool_id: u32 | AnyNumber | Uint8Array, points: u128 | AnyNumber | Uint8Array) => Observable<u128>>;
/**
* Returns the bonded account and reward account associated with the pool_id.
**/
poolAccounts: AugmentedCall<ApiType, (pool_id: u32 | AnyNumber | Uint8Array) => Observable<ITuple<[AccountId32, AccountId32]>>>;
/**
* Total balance contributed to the pool.
**/
poolBalance: AugmentedCall<ApiType, (pool_id: u32 | AnyNumber | Uint8Array) => Observable<u128>>;
/**
* 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.
**/
poolNeedsDelegateMigration: AugmentedCall<ApiType, (pool_id: u32 | AnyNumber | Uint8Array) => Observable<bool>>;
/**
* Returns the pending slash for a given pool.
**/
poolPendingSlash: AugmentedCall<ApiType, (pool_id: u32 | AnyNumber | Uint8Array) => Observable<u128>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0xf78b278be53f454c/ */
offchainWorkerApi: {
/**
* Starts the off-chain task for given block header.
**/
offchainWorker: AugmentedCall<ApiType, (header: PezspRuntimeHeader) => Observable<Null>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x04e70521a0d3d2f8/ */
relayParentOffsetApi: {
/**
* Fetch the slot offset that is expected from the relay chain.
**/
relayParentOffset: AugmentedCall<ApiType, () => Observable<u32>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0xccd9de6396c899ca/ */
runtimeViewFunction: {
/**
* Execute a view function query.
**/
executeViewFunction: AugmentedCall<ApiType, (query_id: PezframeSupportViewFunctionsViewFunctionId, input: Bytes | string | Uint8Array) => Observable<Result<Bytes, PezframeSupportViewFunctionsViewFunctionDispatchError>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0xab3c0572291feb8b/ */
sessionKeys: {
/**
* Decode the given public session keys.,, Returns the list of public raw public keys + key type.
**/
decodeSessionKeys: AugmentedCall<ApiType, (encoded: Bytes | string | Uint8Array) => Observable<Option<Vec<ITuple<[Bytes, PezspCoreCryptoKeyTypeId]>>>>>;
/**
* 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.
**/
generateSessionKeys: AugmentedCall<ApiType, (seed: Option<Bytes> | null | Uint8Array | Bytes | string) => Observable<Bytes>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x18ef58a3b67ba770/ */
stakingApi: {
/**
* Returns the page count of exposures for a validator `account` in a given era.
**/
erasStakersPageCount: AugmentedCall<ApiType, (era: u32 | AnyNumber | Uint8Array, account: AccountId32 | string | Uint8Array) => Observable<u32>>;
/**
* Returns the nominations quota for a nominator with a given balance.
**/
nominationsQuota: AugmentedCall<ApiType, (balance: u128 | AnyNumber | Uint8Array) => Observable<u32>>;
/**
* Returns true if validator `account` has pages to be claimed for the given era.
**/
pendingRewards: AugmentedCall<ApiType, (era: u32 | AnyNumber | Uint8Array, account: AccountId32 | string | Uint8Array) => Observable<bool>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 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.
**/
validateTransaction: AugmentedCall<ApiType, (source: PezspRuntimeTransactionValidityTransactionSource, tx: Extrinsic | IExtrinsic | string | Uint8Array, block_hash: H256 | string | Uint8Array) => Observable<Result<PezspRuntimeTransactionValidityValidTransaction, PezspRuntimeTransactionValidityTransactionValidityError>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x37c8bb1350a9a2a8/ */
transactionPaymentApi: {
/**
*
**/
queryFeeDetails: AugmentedCall<ApiType, (uxt: Extrinsic | IExtrinsic | string | Uint8Array, len: u32 | AnyNumber | Uint8Array) => Observable<PezpalletTransactionPaymentFeeDetails>>;
/**
*
**/
queryInfo: AugmentedCall<ApiType, (uxt: Extrinsic | IExtrinsic | string | Uint8Array, len: u32 | AnyNumber | Uint8Array) => Observable<PezpalletTransactionPaymentRuntimeDispatchInfo>>;
/**
*
**/
queryLengthToFee: AugmentedCall<ApiType, (length: u32 | AnyNumber | Uint8Array) => Observable<u128>>;
/**
*
**/
queryWeightToFee: AugmentedCall<ApiType, (weight: PezspWeightsWeightV2Weight) => Observable<u128>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0xf3ff14d5ab527059/ */
transactionPaymentCallApi: {
/**
* Query fee details of a given encoded `Call`.
**/
queryCallFeeDetails: AugmentedCall<ApiType, (call: RuntimeCall | IMethod | string | Uint8Array, len: u32 | AnyNumber | Uint8Array) => Observable<PezpalletTransactionPaymentFeeDetails>>;
/**
* Query information of a dispatch class, weight, and fee of a given encoded `Call`.
**/
queryCallInfo: AugmentedCall<ApiType, (call: RuntimeCall | IMethod | string | Uint8Array, len: u32 | AnyNumber | Uint8Array) => Observable<PezpalletTransactionPaymentRuntimeDispatchInfo>>;
/**
* Query the output of the current `LengthToFee` given some input.
**/
queryLengthToFee: AugmentedCall<ApiType, (length: u32 | AnyNumber | Uint8Array) => Observable<u128>>;
/**
* Query the output of the current `WeightToFee` given some input.
**/
queryWeightToFee: AugmentedCall<ApiType, (weight: PezspWeightsWeightV2Weight) => Observable<u128>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x2609be83ac4468dc/ */
trustedQueryApi: {
/**
* Returns if the location is a trusted reserve for the asset.,, # Arguments, * `asset`: `VersionedAsset`., * `location`: `VersionedLocation`.
**/
isTrustedReserve: AugmentedCall<ApiType, (asset: XcmVersionedAsset | { V3: any } | { V4: any } | { V5: any } | string | Uint8Array, location: XcmVersionedLocation | { V3: any } | { V4: any } | { V5: any } | string | Uint8Array) => Observable<Result<bool, XcmRuntimeApisTrustedQueryError>>>;
/**
* Returns if the asset can be teleported to the location.,, # Arguments, * `asset`: `VersionedAsset`., * `location`: `VersionedLocation`.
**/
isTrustedTeleporter: AugmentedCall<ApiType, (asset: XcmVersionedAsset | { V3: any } | { V4: any } | { V5: any } | string | Uint8Array, location: XcmVersionedLocation | { V3: any } | { V4: any } | { V5: any } | string | Uint8Array) => Observable<Result<bool, XcmRuntimeApisTrustedQueryError>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x6ff52ee858e6c5bd/ */
xcmPaymentApi: {
/**
* Returns a list of acceptable payment assets.,, # Arguments,, * `xcm_version`: Version.
**/
queryAcceptablePaymentAssets: AugmentedCall<ApiType, (xcm_version: u32 | AnyNumber | Uint8Array) => Observable<Result<Vec<XcmVersionedAssetId>, XcmRuntimeApisFeesError>>>;
/**
* Get delivery fees for sending a specific `message` to a `destination`., These always come in a specific asset, defined by the chain.,, # Arguments, * `message`: The message that'll be sent, necessary because most delivery fees are based on the, size of the message., * `destination`: The destination to send the message to. Different destinations may use, different senders that charge different fees.
**/
queryDeliveryFees: AugmentedCall<ApiType, (destination: XcmVersionedLocation | { V3: any } | { V4: any } | { V5: any } | string | Uint8Array, message: XcmVersionedXcm | { V3: any } | { V4: any } | { V5: any } | string | Uint8Array) => Observable<Result<XcmVersionedAssets, XcmRuntimeApisFeesError>>>;
/**
* Converts a weight into a fee for the specified `AssetId`.,, # Arguments,, * `weight`: convertible `Weight`., * `asset`: `VersionedAssetId`.
**/
queryWeightToAssetFee: AugmentedCall<ApiType, (weight: PezspWeightsWeightV2Weight, asset: XcmVersionedAssetId | { V3: any } | { V4: any } | { V5: any } | string | Uint8Array) => Observable<Result<u128, XcmRuntimeApisFeesError>>>;
/**
* Returns a weight needed to execute a XCM.,, # Arguments,, * `message`: `VersionedXcm`.
**/
queryXcmWeight: AugmentedCall<ApiType, (message: XcmVersionedXcm | { V3: any } | { V4: any } | { V5: any } | string | Uint8Array) => Observable<Result<PezspWeightsWeightV2Weight, XcmRuntimeApisFeesError>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
} // AugmentedCalls
} // declare module
File diff suppressed because it is too large Load Diff
+6
View File
@@ -0,0 +1,6 @@
// Copyright 2017-2025 @pezkuwi/api-augment authors & contributors
// SPDX-License-Identifier: Apache-2.0
// for the API, we decorate not only the endpoints, but all types
import '@pezkuwi/rpc-augment';
import '@pezkuwi/types-augment';
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,11 @@
// Copyright 2017-2025 @pezkuwi/api-augment authors & contributors
// SPDX-License-Identifier: Apache-2.0
import '../base.js';
import './consts.js';
import './errors.js';
import './events.js';
import './query.js';
import './registry.js';
import './runtime.js';
import './tx.js';
File diff suppressed because one or more lines are too long
@@ -0,0 +1,4 @@
// Copyright 2017-2025 @pezkuwi/api-augment authors & contributors
// SPDX-License-Identifier: Apache-2.0
import '@pezkuwi/types-augment/registry/bizinikiwi';
@@ -0,0 +1,593 @@
// Auto-generated via `yarn polkadot-types-from-chain`, do not edit
/* eslint-disable */
// import type lookup before we augment - in some environments
// this is required to allow for ambient/previous definitions
import '@pezkuwi/api-base/types/calls';
import type { ApiTypes, AugmentedCall, DecoratedCallBase } from '@pezkuwi/api-base/types';
import type { Bytes, Null, Option, Result, Struct, Text, U256, U8aFixed, Vec, bool, u128, u32, u64 } from '@pezkuwi/types-codec';
import type { AnyNumber, IMethod, ITuple } from '@pezkuwi/types-codec/types';
import type { OpaqueKeyOwnershipProof } from '@pezkuwi/types/interfaces/babe';
import type { Extrinsic } from '@pezkuwi/types/interfaces/extrinsics';
import type { OpaqueMetadata } from '@pezkuwi/types/interfaces/metadata';
import type { AccountId32, H160, H256, RuntimeCall, Slot } from '@pezkuwi/types/interfaces/runtime';
import type { PezframeSupportTokensFungibleUnionOfNativeOrWithId, PezframeSupportViewFunctionsViewFunctionDispatchError, PezframeSupportViewFunctionsViewFunctionId, PezframeSystemEventRecord, PezpalletContractsPrimitivesCode, PezpalletContractsPrimitivesCodeUploadReturnValue, PezpalletContractsPrimitivesContractAccessError, PezpalletContractsPrimitivesContractResult, PezpalletContractsPrimitivesExecReturnValue, PezpalletContractsPrimitivesStorageDeposit, PezpalletContractsWasmDeterminism, PezpalletReviveEvmApiDebugRpcTypesTrace, PezpalletReviveEvmApiDebugRpcTypesTracerType, PezpalletReviveEvmApiRpcTypesGenGenericTransaction, PezpalletRevivePrimitivesCode, PezpalletRevivePrimitivesCodeUploadReturnValue, PezpalletRevivePrimitivesContractAccessError, PezpalletRevivePrimitivesContractResultExecReturnValue, PezpalletRevivePrimitivesContractResultInstantiateReturnValue, PezpalletRevivePrimitivesEthTransactError, PezpalletRevivePrimitivesEthTransactInfo, PezpalletTransactionPaymentFeeDetails, PezpalletTransactionPaymentRuntimeDispatchInfo, PezspAuthorityDiscoveryAppPublic, PezspConsensusBabeAppPublic, PezspConsensusBabeBabeConfiguration, PezspConsensusBabeEpoch, PezspConsensusBeefyDoubleVotingProof, PezspConsensusBeefyEcdsaCryptoPublic, PezspConsensusBeefyForkVotingProofOpaqueValue, PezspConsensusBeefyFutureBlockVotingProof, PezspConsensusBeefyValidatorSet, PezspConsensusGrandpaAppPublic, PezspConsensusGrandpaEquivocationProof, PezspConsensusSlotsEquivocationProof, PezspCoreCryptoKeyTypeId, PezspInherentsCheckInherentsResult, PezspInherentsInherentData, PezspMixnetMixnode, PezspMixnetMixnodesErr, PezspMixnetSessionStatus, PezspMmrPrimitivesError, PezspMmrPrimitivesLeafProof, PezspRuntimeBlock, PezspRuntimeDispatchError, PezspRuntimeExtrinsicInclusionMode, PezspRuntimeHeader, PezspRuntimeTransactionValidityTransactionSource, PezspRuntimeTransactionValidityTransactionValidityError, PezspRuntimeTransactionValidityValidTransaction, PezspStatementStoreRuntimeApiInvalidStatement, PezspStatementStoreRuntimeApiStatementSource, PezspStatementStoreRuntimeApiValidStatement, PezspStatementStoreStatement, PezspVersionRuntimeVersion, PezspWeightsWeightV2Weight } from '@pezkuwi/types/lookup';
import type { IExtrinsic, Observable } from '@pezkuwi/types/types';
export type __AugmentedCall<ApiType extends ApiTypes> = AugmentedCall<ApiType>;
export type __DecoratedCallBase<ApiType extends ApiTypes> = DecoratedCallBase<ApiType>;
declare module '@pezkuwi/api-base/types/calls' {
interface AugmentedCalls<ApiType extends ApiTypes> {
/** 0xbc9d89904f5b923f/ */
accountNonceApi: {
/**
* Get current account nonce of given `AccountId`.
**/
accountNonce: AugmentedCall<ApiType, (account: AccountId32 | string | Uint8Array) => Observable<u32>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x8a8047a53a8277ec/ */
assetConversionApi: {
/**
* Returns the size of the liquidity pool for the given asset pair.
**/
getReserves: AugmentedCall<ApiType, (asset1: PezframeSupportTokensFungibleUnionOfNativeOrWithId, asset2: PezframeSupportTokensFungibleUnionOfNativeOrWithId) => Observable<Option<ITuple<[u128, u128]>>>>;
/**
* 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.)
**/
quotePriceExactTokensForTokens: AugmentedCall<ApiType, (asset1: PezframeSupportTokensFungibleUnionOfNativeOrWithId, asset2: PezframeSupportTokensFungibleUnionOfNativeOrWithId, amount: u128 | AnyNumber | Uint8Array, include_fee: bool | boolean | Uint8Array) => Observable<Option<u128>>>;
/**
* 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.)
**/
quotePriceTokensForExactTokens: AugmentedCall<ApiType, (asset1: PezframeSupportTokensFungibleUnionOfNativeOrWithId, asset2: PezframeSupportTokensFungibleUnionOfNativeOrWithId, amount: u128 | AnyNumber | Uint8Array, include_fee: bool | boolean | Uint8Array) => Observable<Option<u128>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x65f855d6e093c2f1/ */
assetRewards: {
/**
* Get the cost of creating a pool.,, This is especially useful when the cost is dynamic.
**/
poolCreationCost: AugmentedCall<ApiType, () => Observable<u128>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x8453b50b22293977/ */
assetsApi: {
/**
* Returns the list of `AssetId`s and corresponding balance that an `AccountId` has.
**/
accountBalances: AugmentedCall<ApiType, (account: AccountId32 | string | Uint8Array) => Observable<Vec<ITuple<[u32, u128]>>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x687ad44ad37f03c2/ */
authorityDiscoveryApi: {
/**
* Retrieve authority identifiers of the current and next authority set.
**/
authorities: AugmentedCall<ApiType, () => Observable<Vec<PezspAuthorityDiscoveryAppPublic>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0xcbca25e39f142387/ */
babeApi: {
/**
* Return the configuration for BABE.
**/
configuration: AugmentedCall<ApiType, () => Observable<PezspConsensusBabeBabeConfiguration>>;
/**
* Returns information regarding the current epoch.
**/
currentEpoch: AugmentedCall<ApiType, () => Observable<PezspConsensusBabeEpoch>>;
/**
* Returns the slot that started the current epoch.
**/
currentEpochStart: AugmentedCall<ApiType, () => Observable<Slot>>;
/**
* 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.
**/
generateKeyOwnershipProof: AugmentedCall<ApiType, (slot: Slot | AnyNumber | Uint8Array, authority_id: PezspConsensusBabeAppPublic) => Observable<Option<Bytes>>>;
/**
* Returns information regarding the next epoch (which was already, previously announced).
**/
nextEpoch: AugmentedCall<ApiType, () => Observable<PezspConsensusBabeEpoch>>;
/**
* 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.
**/
submitReportEquivocationUnsignedExtrinsic: AugmentedCall<ApiType, (equivocation_proof: PezspConsensusSlotsEquivocationProof, key_owner_proof: OpaqueKeyOwnershipProof | string | Uint8Array) => Observable<Option<Null>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x49eaaf1b548a0cb0/ */
beefyApi: {
/**
* Return the block number where BEEFY consensus is enabled/started
**/
beefyGenesis: AugmentedCall<ApiType, () => Observable<Option<u32>>>;
/**
* Generates a proof that the `prev_block_number` is part of the canonical chain at, `best_known_block_number`.
**/
generateAncestryProof: AugmentedCall<ApiType, (prev_block_number: u32 | AnyNumber | Uint8Array, best_known_block_number: Option<u32> | null | Uint8Array | u32 | AnyNumber) => Observable<Option<Bytes>>>;
/**
* 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.
**/
generateKeyOwnershipProof: AugmentedCall<ApiType, (set_id: u64 | AnyNumber | Uint8Array, authority_id: PezspConsensusBeefyEcdsaCryptoPublic) => Observable<Option<Bytes>>>;
/**
* 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.
**/
submitReportDoubleVotingUnsignedExtrinsic: AugmentedCall<ApiType, (equivocation_proof: PezspConsensusBeefyDoubleVotingProof, key_owner_proof: Bytes | string | Uint8Array) => Observable<Option<Null>>>;
/**
* 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.
**/
submitReportForkVotingUnsignedExtrinsic: AugmentedCall<ApiType, (equivocation_proof: PezspConsensusBeefyForkVotingProofOpaqueValue, key_owner_proof: Bytes | string | Uint8Array) => Observable<Option<Null>>>;
/**
* 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.
**/
submitReportFutureBlockVotingUnsignedExtrinsic: AugmentedCall<ApiType, (equivocation_proof: PezspConsensusBeefyFutureBlockVotingProof, key_owner_proof: Bytes | string | Uint8Array) => Observable<Option<Null>>>;
/**
* Return the current active BEEFY validator set
**/
validatorSet: AugmentedCall<ApiType, () => Observable<Option<PezspConsensusBeefyValidatorSet>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x40fe3ad401f8959a/ */
blockBuilder: {
/**
* Apply the given extrinsic.,, Returns an inclusion outcome which specifies if this extrinsic is included in, this block or not.
**/
applyExtrinsic: AugmentedCall<ApiType, (extrinsic: Extrinsic | IExtrinsic | string | Uint8Array) => Observable<Result<Result<Null, PezspRuntimeDispatchError>, PezspRuntimeTransactionValidityTransactionValidityError>>>;
/**
* Check that the inherents are valid. The inherent data will vary from chain to chain.
**/
checkInherents: AugmentedCall<ApiType, (block: PezspRuntimeBlock, data: PezspInherentsInherentData) => Observable<PezspInherentsCheckInherentsResult>>;
/**
* Finish the current block.
**/
finalizeBlock: AugmentedCall<ApiType, () => Observable<PezspRuntimeHeader>>;
/**
* Generate inherent extrinsics. The inherent data will vary from chain to chain.
**/
inherentExtrinsics: AugmentedCall<ApiType, (inherent: PezspInherentsInherentData) => Observable<Vec<Bytes>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x68b66ba122c93fa7/ */
contractsApi: {
/**
* Perform a call from a specified account to a given contract.,, See [`crate::Pallet::bare_call`].
**/
call: AugmentedCall<ApiType, (origin: AccountId32 | string | Uint8Array, dest: AccountId32 | string | Uint8Array, value: u128 | AnyNumber | Uint8Array, gas_limit: Option<PezspWeightsWeightV2Weight> | null | Uint8Array | PezspWeightsWeightV2Weight, storage_deposit_limit: Option<u128> | null | Uint8Array | u128 | AnyNumber, input_data: Bytes | string | Uint8Array) => Observable<{
readonly gasConsumed: PezspWeightsWeightV2Weight;
readonly gasRequired: PezspWeightsWeightV2Weight;
readonly storageDeposit: PezpalletContractsPrimitivesStorageDeposit;
readonly debugMessage: Bytes;
readonly result: Result<PezpalletContractsPrimitivesExecReturnValue, PezspRuntimeDispatchError>;
readonly events: Option<Vec<PezframeSystemEventRecord>>;
} & Struct>>;
/**
* Query a given storage key in a given contract.,, Returns `Ok(Some(Vec<u8>))` 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.
**/
getStorage: AugmentedCall<ApiType, (address: AccountId32 | string | Uint8Array, key: Bytes | string | Uint8Array) => Observable<Result<Option<Bytes>, PezpalletContractsPrimitivesContractAccessError>>>;
/**
* Instantiate a new contract.,, See `[crate::Pallet::bare_instantiate]`.
**/
instantiate: AugmentedCall<ApiType, (origin: AccountId32 | string | Uint8Array, value: u128 | AnyNumber | Uint8Array, gas_limit: Option<PezspWeightsWeightV2Weight> | null | Uint8Array | PezspWeightsWeightV2Weight, storage_deposit_limit: Option<u128> | null | Uint8Array | u128 | AnyNumber, code: PezpalletContractsPrimitivesCode, data: Bytes | string | Uint8Array, salt: Bytes | string | Uint8Array) => Observable<PezpalletContractsPrimitivesContractResult>>;
/**
* Upload new code without instantiating a contract from it.,, See [`crate::Pallet::bare_upload_code`].
**/
uploadCode: AugmentedCall<ApiType, (origin: AccountId32 | string | Uint8Array, code: Bytes | string | Uint8Array, storage_deposit_limit: Option<u128> | null | Uint8Array | u128 | AnyNumber, determinism: PezpalletContractsWasmDeterminism) => Observable<Result<PezpalletContractsPrimitivesCodeUploadReturnValue, PezspRuntimeDispatchError>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0xdf6acb689907609b/ */
core: {
/**
* Execute the given block.
**/
executeBlock: AugmentedCall<ApiType, (block: PezspRuntimeBlock) => Observable<Null>>;
/**
* Initialize a block with the given header and return the runtime executive mode.
**/
initializeBlock: AugmentedCall<ApiType, (header: PezspRuntimeHeader) => Observable<PezspRuntimeExtrinsicInclusionMode>>;
/**
* Returns the version of the runtime.
**/
version: AugmentedCall<ApiType, () => Observable<PezspVersionRuntimeVersion>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 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.
**/
buildState: AugmentedCall<ApiType, (json: Bytes | string | Uint8Array) => Observable<Result<Null, Text>>>;
/**
* 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<u8>` 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.
**/
getPreset: AugmentedCall<ApiType, (id: Option<Text> | null | Uint8Array | Text | string) => Observable<Option<Bytes>>>;
/**
* 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.
**/
presetNames: AugmentedCall<ApiType, () => Observable<Vec<Text>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0xed99c5acb25eedf5/ */
grandpaApi: {
/**
* Get current GRANDPA authority set id.
**/
currentSetId: AugmentedCall<ApiType, () => Observable<u64>>;
/**
* 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.
**/
generateKeyOwnershipProof: AugmentedCall<ApiType, (set_id: u64 | AnyNumber | Uint8Array, authority_id: PezspConsensusGrandpaAppPublic) => Observable<Option<Bytes>>>;
/**
* 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.
**/
grandpaAuthorities: AugmentedCall<ApiType, () => Observable<Vec<ITuple<[PezspConsensusGrandpaAppPublic, u64]>>>>;
/**
* 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.
**/
submitReportEquivocationUnsignedExtrinsic: AugmentedCall<ApiType, (equivocation_proof: PezspConsensusGrandpaEquivocationProof, key_owner_proof: Bytes | string | Uint8Array) => Observable<Option<Null>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x37e397fc7c91f5e4/ */
metadata: {
/**
* Returns the metadata of a runtime.
**/
metadata: AugmentedCall<ApiType, () => Observable<OpaqueMetadata>>;
/**
* 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.
**/
metadataAtVersion: AugmentedCall<ApiType, (version: u32 | AnyNumber | Uint8Array) => Observable<Option<OpaqueMetadata>>>;
/**
* Returns the supported metadata versions.,, This can be used to call `metadata_at_version`.
**/
metadataVersions: AugmentedCall<ApiType, () => Observable<Vec<u32>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x6fd7c327202e4a8d/ */
mixnetApi: {
/**
* Get the mixnode set for the current session.
**/
currentMixnodes: AugmentedCall<ApiType, () => Observable<Result<Vec<PezspMixnetMixnode>, PezspMixnetMixnodesErr>>>;
/**
* 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.
**/
maybeRegister: AugmentedCall<ApiType, (session_index: u32 | AnyNumber | Uint8Array, mixnode: PezspMixnetMixnode) => Observable<bool>>;
/**
* Get the mixnode set for the previous session.
**/
prevMixnodes: AugmentedCall<ApiType, () => Observable<Result<Vec<PezspMixnetMixnode>, PezspMixnetMixnodesErr>>>;
/**
* Get the index and phase of the current session.
**/
sessionStatus: AugmentedCall<ApiType, () => Observable<PezspMixnetSessionStatus>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x91d5df18b0d2cf58/ */
mmrApi: {
/**
* 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.
**/
generateProof: AugmentedCall<ApiType, (block_numbers: Vec<u32> | (u32 | AnyNumber | Uint8Array)[], best_known_block_number: Option<u32> | null | Uint8Array | u32 | AnyNumber) => Observable<Result<ITuple<[Vec<Bytes>, PezspMmrPrimitivesLeafProof]>, PezspMmrPrimitivesError>>>;
/**
* Return the number of MMR blocks in the chain.
**/
mmrLeafCount: AugmentedCall<ApiType, () => Observable<Result<u64, PezspMmrPrimitivesError>>>;
/**
* Return the on-chain MMR root hash.
**/
mmrRoot: AugmentedCall<ApiType, () => Observable<Result<H256, PezspMmrPrimitivesError>>>;
/**
* 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]
**/
verifyProof: AugmentedCall<ApiType, (leaves: Vec<Bytes> | (Bytes | string | Uint8Array)[], proof: PezspMmrPrimitivesLeafProof) => Observable<Result<Null, PezspMmrPrimitivesError>>>;
/**
* 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]
**/
verifyProofStateless: AugmentedCall<ApiType, (root: H256 | string | Uint8Array, leaves: Vec<Bytes> | (Bytes | string | Uint8Array)[], proof: PezspMmrPrimitivesLeafProof) => Observable<Result<Null, PezspMmrPrimitivesError>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x899a250cbe84f250/ */
nftsApi: {
/**
*
**/
attribute: AugmentedCall<ApiType, (collection: u32 | AnyNumber | Uint8Array, item: u32 | AnyNumber | Uint8Array, key: Bytes | string | Uint8Array) => Observable<Option<Bytes>>>;
/**
*
**/
collectionAttribute: AugmentedCall<ApiType, (collection: u32 | AnyNumber | Uint8Array, key: Bytes | string | Uint8Array) => Observable<Option<Bytes>>>;
/**
*
**/
collectionOwner: AugmentedCall<ApiType, (collection: u32 | AnyNumber | Uint8Array) => Observable<Option<AccountId32>>>;
/**
*
**/
customAttribute: AugmentedCall<ApiType, (account: AccountId32 | string | Uint8Array, collection: u32 | AnyNumber | Uint8Array, item: u32 | AnyNumber | Uint8Array, key: Bytes | string | Uint8Array) => Observable<Option<Bytes>>>;
/**
*
**/
owner: AugmentedCall<ApiType, (collection: u32 | AnyNumber | Uint8Array, item: u32 | AnyNumber | Uint8Array) => Observable<Option<AccountId32>>>;
/**
*
**/
systemAttribute: AugmentedCall<ApiType, (collection: u32 | AnyNumber | Uint8Array, item: Option<u32> | null | Uint8Array | u32 | AnyNumber, key: Bytes | string | Uint8Array) => Observable<Option<Bytes>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x17a6bc0d0062aeb3/ */
nominationPoolsApi: {
/**
* Returns the equivalent points of `new_funds` for a given pool.
**/
balanceToPoints: AugmentedCall<ApiType, (pool_id: u32 | AnyNumber | Uint8Array, new_funds: u128 | AnyNumber | Uint8Array) => Observable<u128>>;
/**
* 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.
**/
memberNeedsDelegateMigration: AugmentedCall<ApiType, (member: AccountId32 | string | Uint8Array) => Observable<bool>>;
/**
* Returns the pending slash for a given pool member.,, If pending slash of the member exceeds `ExistentialDeposit`, it can be reported on, chain.
**/
memberPendingSlash: AugmentedCall<ApiType, (member: AccountId32 | string | Uint8Array) => Observable<u128>>;
/**
* Returns the total contribution of a pool member including any balance that is unbonding.
**/
memberTotalBalance: AugmentedCall<ApiType, (who: AccountId32 | string | Uint8Array) => Observable<u128>>;
/**
* Returns the pending rewards for the member that the AccountId was given for.
**/
pendingRewards: AugmentedCall<ApiType, (who: AccountId32 | string | Uint8Array) => Observable<u128>>;
/**
* Returns the equivalent balance of `points` for a given pool.
**/
pointsToBalance: AugmentedCall<ApiType, (pool_id: u32 | AnyNumber | Uint8Array, points: u128 | AnyNumber | Uint8Array) => Observable<u128>>;
/**
* Returns the bonded account and reward account associated with the pool_id.
**/
poolAccounts: AugmentedCall<ApiType, (pool_id: u32 | AnyNumber | Uint8Array) => Observable<ITuple<[AccountId32, AccountId32]>>>;
/**
* Total balance contributed to the pool.
**/
poolBalance: AugmentedCall<ApiType, (pool_id: u32 | AnyNumber | Uint8Array) => Observable<u128>>;
/**
* 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.
**/
poolNeedsDelegateMigration: AugmentedCall<ApiType, (pool_id: u32 | AnyNumber | Uint8Array) => Observable<bool>>;
/**
* Returns the pending slash for a given pool.
**/
poolPendingSlash: AugmentedCall<ApiType, (pool_id: u32 | AnyNumber | Uint8Array) => Observable<u128>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0xf78b278be53f454c/ */
offchainWorkerApi: {
/**
* Starts the off-chain task for given block header.
**/
offchainWorker: AugmentedCall<ApiType, (header: PezspRuntimeHeader) => Observable<Null>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x8c403e5c4a9fd442/ */
reviveApi: {
/**
* Returns the free balance of the given `[H160]` address, using EVM decimals.
**/
balance: AugmentedCall<ApiType, (address: H160 | string | Uint8Array) => Observable<U256>>;
/**
* Returns the block gas limit.
**/
blockGasLimit: AugmentedCall<ApiType, () => Observable<U256>>;
/**
* Perform a call from a specified account to a given contract.,, See [`crate::Pallet::bare_call`].
**/
call: AugmentedCall<ApiType, (origin: AccountId32 | string | Uint8Array, dest: H160 | string | Uint8Array, value: u128 | AnyNumber | Uint8Array, gas_limit: Option<PezspWeightsWeightV2Weight> | null | Uint8Array | PezspWeightsWeightV2Weight, storage_deposit_limit: Option<u128> | null | Uint8Array | u128 | AnyNumber, input_data: Bytes | string | Uint8Array) => Observable<PezpalletRevivePrimitivesContractResultExecReturnValue>>;
/**
* Perform an Ethereum call.,, See [`crate::Pallet::bare_eth_transact`]
**/
ethTransact: AugmentedCall<ApiType, (tx: PezpalletReviveEvmApiRpcTypesGenGenericTransaction) => Observable<Result<PezpalletRevivePrimitivesEthTransactInfo, PezpalletRevivePrimitivesEthTransactError>>>;
/**
* Returns the gas price.
**/
gasPrice: AugmentedCall<ApiType, () => Observable<U256>>;
/**
* Query a given storage key in a given contract.,, Returns `Ok(Some(Vec<u8>))` 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.
**/
getStorage: AugmentedCall<ApiType, (address: H160 | string | Uint8Array, key: U8aFixed | string | Uint8Array) => Observable<Result<Option<Bytes>, PezpalletRevivePrimitivesContractAccessError>>>;
/**
* Instantiate a new contract.,, See `[crate::Pallet::bare_instantiate]`.
**/
instantiate: AugmentedCall<ApiType, (origin: AccountId32 | string | Uint8Array, value: u128 | AnyNumber | Uint8Array, gas_limit: Option<PezspWeightsWeightV2Weight> | null | Uint8Array | PezspWeightsWeightV2Weight, storage_deposit_limit: Option<u128> | null | Uint8Array | u128 | AnyNumber, code: PezpalletRevivePrimitivesCode, data: Bytes | string | Uint8Array, salt: Option<U8aFixed> | null | Uint8Array | U8aFixed | string) => Observable<PezpalletRevivePrimitivesContractResultInstantiateReturnValue>>;
/**
* Returns the nonce of the given `[H160]` address.
**/
nonce: AugmentedCall<ApiType, (address: H160 | string | Uint8Array) => Observable<u32>>;
/**
* 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.
**/
traceBlock: AugmentedCall<ApiType, (block: PezspRuntimeBlock, config: PezpalletReviveEvmApiDebugRpcTypesTracerType) => Observable<Vec<ITuple<[u32, PezpalletReviveEvmApiDebugRpcTypesTrace]>>>>;
/**
* Dry run and return the trace of the given call.,, See eth-rpc `debug_traceCall` for usage.
**/
traceCall: AugmentedCall<ApiType, (tx: PezpalletReviveEvmApiRpcTypesGenGenericTransaction, config: PezpalletReviveEvmApiDebugRpcTypesTracerType) => Observable<Result<PezpalletReviveEvmApiDebugRpcTypesTrace, PezpalletRevivePrimitivesEthTransactError>>>;
/**
* 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.
**/
traceTx: AugmentedCall<ApiType, (block: PezspRuntimeBlock, tx_index: u32 | AnyNumber | Uint8Array, config: PezpalletReviveEvmApiDebugRpcTypesTracerType) => Observable<Option<PezpalletReviveEvmApiDebugRpcTypesTrace>>>;
/**
* Upload new code without instantiating a contract from it.,, See [`crate::Pallet::bare_upload_code`].
**/
uploadCode: AugmentedCall<ApiType, (origin: AccountId32 | string | Uint8Array, code: Bytes | string | Uint8Array, storage_deposit_limit: Option<u128> | null | Uint8Array | u128 | AnyNumber) => Observable<Result<PezpalletRevivePrimitivesCodeUploadReturnValue, PezspRuntimeDispatchError>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0xccd9de6396c899ca/ */
runtimeViewFunction: {
/**
* Execute a view function query.
**/
executeViewFunction: AugmentedCall<ApiType, (query_id: PezframeSupportViewFunctionsViewFunctionId, input: Bytes | string | Uint8Array) => Observable<Result<Bytes, PezframeSupportViewFunctionsViewFunctionDispatchError>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0xab3c0572291feb8b/ */
sessionKeys: {
/**
* Decode the given public session keys.,, Returns the list of public raw public keys + key type.
**/
decodeSessionKeys: AugmentedCall<ApiType, (encoded: Bytes | string | Uint8Array) => Observable<Option<Vec<ITuple<[Bytes, PezspCoreCryptoKeyTypeId]>>>>>;
/**
* 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.
**/
generateSessionKeys: AugmentedCall<ApiType, (seed: Option<Bytes> | null | Uint8Array | Bytes | string) => Observable<Bytes>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x18ef58a3b67ba770/ */
stakingApi: {
/**
* Returns the page count of exposures for a validator `account` in a given era.
**/
erasStakersPageCount: AugmentedCall<ApiType, (era: u32 | AnyNumber | Uint8Array, account: AccountId32 | string | Uint8Array) => Observable<u32>>;
/**
* Returns the nominations quota for a nominator with a given balance.
**/
nominationsQuota: AugmentedCall<ApiType, (balance: u128 | AnyNumber | Uint8Array) => Observable<u32>>;
/**
* Returns true if validator `account` has pages to be claimed for the given era.
**/
pendingRewards: AugmentedCall<ApiType, (era: u32 | AnyNumber | Uint8Array, account: AccountId32 | string | Uint8Array) => Observable<bool>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 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.
**/
validateTransaction: AugmentedCall<ApiType, (source: PezspRuntimeTransactionValidityTransactionSource, tx: Extrinsic | IExtrinsic | string | Uint8Array, block_hash: H256 | string | Uint8Array) => Observable<Result<PezspRuntimeTransactionValidityValidTransaction, PezspRuntimeTransactionValidityTransactionValidityError>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x37c8bb1350a9a2a8/ */
transactionPaymentApi: {
/**
*
**/
queryFeeDetails: AugmentedCall<ApiType, (uxt: Extrinsic | IExtrinsic | string | Uint8Array, len: u32 | AnyNumber | Uint8Array) => Observable<PezpalletTransactionPaymentFeeDetails>>;
/**
*
**/
queryInfo: AugmentedCall<ApiType, (uxt: Extrinsic | IExtrinsic | string | Uint8Array, len: u32 | AnyNumber | Uint8Array) => Observable<PezpalletTransactionPaymentRuntimeDispatchInfo>>;
/**
*
**/
queryLengthToFee: AugmentedCall<ApiType, (length: u32 | AnyNumber | Uint8Array) => Observable<u128>>;
/**
*
**/
queryWeightToFee: AugmentedCall<ApiType, (weight: PezspWeightsWeightV2Weight) => Observable<u128>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0xf3ff14d5ab527059/ */
transactionPaymentCallApi: {
/**
* Query fee details of a given encoded `Call`.
**/
queryCallFeeDetails: AugmentedCall<ApiType, (call: RuntimeCall | IMethod | string | Uint8Array, len: u32 | AnyNumber | Uint8Array) => Observable<PezpalletTransactionPaymentFeeDetails>>;
/**
* Query information of a dispatch class, weight, and fee of a given encoded `Call`.
**/
queryCallInfo: AugmentedCall<ApiType, (call: RuntimeCall | IMethod | string | Uint8Array, len: u32 | AnyNumber | Uint8Array) => Observable<PezpalletTransactionPaymentRuntimeDispatchInfo>>;
/**
* Query the output of the current `LengthToFee` given some input.
**/
queryLengthToFee: AugmentedCall<ApiType, (length: u32 | AnyNumber | Uint8Array) => Observable<u128>>;
/**
* Query the output of the current `WeightToFee` given some input.
**/
queryWeightToFee: AugmentedCall<ApiType, (weight: PezspWeightsWeightV2Weight) => Observable<u128>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0xbe9fb0c91a8046cf/ */
validateStatement: {
/**
* Validate the statement.
**/
validateStatement: AugmentedCall<ApiType, (source: PezspStatementStoreRuntimeApiStatementSource, statement: PezspStatementStoreStatement) => Observable<Result<PezspStatementStoreRuntimeApiValidStatement, PezspStatementStoreRuntimeApiInvalidStatement>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
} // AugmentedCalls
} // declare module
File diff suppressed because it is too large Load Diff
+6
View File
@@ -0,0 +1,6 @@
// Copyright 2017-2025 @pezkuwi/api-augment authors & contributors
// SPDX-License-Identifier: Apache-2.0
import './bizinikiwi/index.js';
export { packageInfo } from './packageInfo.js';
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
+610
View File
@@ -0,0 +1,610 @@
// Auto-generated via `yarn polkadot-types-from-chain`, do not edit
/* eslint-disable */
// import type lookup before we augment - in some environments
// this is required to allow for ambient/previous definitions
import '@pezkuwi/api-base/types/calls';
import type { ApiTypes, AugmentedCall, DecoratedCallBase } from '@pezkuwi/api-base/types';
import type { BTreeMap, BitVec, Bytes, Null, Option, Result, Text, Vec, bool, u128, u32, u64 } from '@pezkuwi/types-codec';
import type { AnyNumber, IMethod, ITuple } from '@pezkuwi/types-codec/types';
import type { OpaqueKeyOwnershipProof } from '@pezkuwi/types/interfaces/babe';
import type { Extrinsic } from '@pezkuwi/types/interfaces/extrinsics';
import type { OpaqueMetadata } from '@pezkuwi/types/interfaces/metadata';
import type { AccountId32, H256, OriginCaller, RuntimeCall, Slot } from '@pezkuwi/types/interfaces/runtime';
import type { ParaId, ValidationCodeHash } from '@pezkuwi/types/interfaces/teyrchains';
import type { PezkuwiCorePrimitivesInboundDownwardMessage, PezkuwiCorePrimitivesInboundHrmpMessage, PezkuwiPrimitivesV8ApprovalVotingParams, PezkuwiPrimitivesV8AsyncBackingAsyncBackingParams, PezkuwiPrimitivesV8CandidateCommitments, PezkuwiPrimitivesV8DisputeState, PezkuwiPrimitivesV8ExecutorParams, PezkuwiPrimitivesV8GroupRotationInfo, PezkuwiPrimitivesV8OccupiedCoreAssumption, PezkuwiPrimitivesV8PersistedValidationData, PezkuwiPrimitivesV8PvfCheckStatement, PezkuwiPrimitivesV8SessionInfo, PezkuwiPrimitivesV8SlashingDisputeProof, PezkuwiPrimitivesV8SlashingPendingSlashes, PezkuwiPrimitivesV8ValidatorAppPublic, PezkuwiPrimitivesV8ValidatorAppSignature, PezkuwiPrimitivesVstagingAsyncBackingBackingState, PezkuwiPrimitivesVstagingAsyncBackingConstraints, PezkuwiPrimitivesVstagingCandidateEvent, PezkuwiPrimitivesVstagingCommittedCandidateReceiptV2, PezkuwiPrimitivesVstagingCoreState, PezkuwiPrimitivesVstagingScrapedOnChainVotes, PezpalletTransactionPaymentFeeDetails, PezpalletTransactionPaymentRuntimeDispatchInfo, PezspAuthorityDiscoveryAppPublic, PezspConsensusBabeAppPublic, PezspConsensusBabeBabeConfiguration, PezspConsensusBabeEpoch, PezspConsensusBeefyDoubleVotingProof, PezspConsensusBeefyEcdsaCryptoPublic, PezspConsensusBeefyForkVotingProofOpaqueValue, PezspConsensusBeefyFutureBlockVotingProof, PezspConsensusBeefyMmrBeefyAuthoritySet, PezspConsensusBeefyValidatorSet, PezspConsensusGrandpaAppPublic, PezspConsensusGrandpaEquivocationProof, PezspConsensusSlotsEquivocationProof, PezspCoreCryptoKeyTypeId, PezspInherentsCheckInherentsResult, PezspInherentsInherentData, PezspMmrPrimitivesError, PezspMmrPrimitivesLeafProof, PezspRuntimeBlock, PezspRuntimeDispatchError, PezspRuntimeExtrinsicInclusionMode, PezspRuntimeHeader, PezspRuntimeTransactionValidityTransactionSource, PezspRuntimeTransactionValidityTransactionValidityError, PezspRuntimeTransactionValidityValidTransaction, PezspVersionRuntimeVersion, PezspWeightsWeightV2Weight, RelayCommonApisInflationInfo, XcmRuntimeApisConversionsError, XcmRuntimeApisDryRunCallDryRunEffects, XcmRuntimeApisDryRunError, XcmRuntimeApisDryRunXcmDryRunEffects, XcmRuntimeApisFeesError, XcmVersionedAssetId, XcmVersionedAssets, XcmVersionedLocation, XcmVersionedXcm } from '@pezkuwi/types/lookup';
import type { IExtrinsic, Observable } from '@pezkuwi/types/types';
export type __AugmentedCall<ApiType extends ApiTypes> = AugmentedCall<ApiType>;
export type __DecoratedCallBase<ApiType extends ApiTypes> = DecoratedCallBase<ApiType>;
declare module '@pezkuwi/api-base/types/calls' {
interface AugmentedCalls<ApiType extends ApiTypes> {
/** 0xbc9d89904f5b923f/ */
accountNonceApi: {
/**
* Get current account nonce of given `AccountId`.
**/
accountNonce: AugmentedCall<ApiType, (account: AccountId32 | string | Uint8Array) => Observable<u32>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x687ad44ad37f03c2/ */
authorityDiscoveryApi: {
/**
* Retrieve authority identifiers of the current and next authority set.
**/
authorities: AugmentedCall<ApiType, () => Observable<Vec<PezspAuthorityDiscoveryAppPublic>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0xcbca25e39f142387/ */
babeApi: {
/**
* Return the configuration for BABE.
**/
configuration: AugmentedCall<ApiType, () => Observable<PezspConsensusBabeBabeConfiguration>>;
/**
* Returns information regarding the current epoch.
**/
currentEpoch: AugmentedCall<ApiType, () => Observable<PezspConsensusBabeEpoch>>;
/**
* Returns the slot that started the current epoch.
**/
currentEpochStart: AugmentedCall<ApiType, () => Observable<Slot>>;
/**
* 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.
**/
generateKeyOwnershipProof: AugmentedCall<ApiType, (slot: Slot | AnyNumber | Uint8Array, authority_id: PezspConsensusBabeAppPublic) => Observable<Option<Bytes>>>;
/**
* Returns information regarding the next epoch (which was already, previously announced).
**/
nextEpoch: AugmentedCall<ApiType, () => Observable<PezspConsensusBabeEpoch>>;
/**
* 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.
**/
submitReportEquivocationUnsignedExtrinsic: AugmentedCall<ApiType, (equivocation_proof: PezspConsensusSlotsEquivocationProof, key_owner_proof: OpaqueKeyOwnershipProof | string | Uint8Array) => Observable<Option<Null>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x49eaaf1b548a0cb0/ */
beefyApi: {
/**
* Return the block number where BEEFY consensus is enabled/started
**/
beefyGenesis: AugmentedCall<ApiType, () => Observable<Option<u32>>>;
/**
* Generates a proof that the `prev_block_number` is part of the canonical chain at, `best_known_block_number`.
**/
generateAncestryProof: AugmentedCall<ApiType, (prev_block_number: u32 | AnyNumber | Uint8Array, best_known_block_number: Option<u32> | null | Uint8Array | u32 | AnyNumber) => Observable<Option<Bytes>>>;
/**
* 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.
**/
generateKeyOwnershipProof: AugmentedCall<ApiType, (set_id: u64 | AnyNumber | Uint8Array, authority_id: PezspConsensusBeefyEcdsaCryptoPublic) => Observable<Option<Bytes>>>;
/**
* 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.
**/
submitReportDoubleVotingUnsignedExtrinsic: AugmentedCall<ApiType, (equivocation_proof: PezspConsensusBeefyDoubleVotingProof, key_owner_proof: Bytes | string | Uint8Array) => Observable<Option<Null>>>;
/**
* 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.
**/
submitReportForkVotingUnsignedExtrinsic: AugmentedCall<ApiType, (equivocation_proof: PezspConsensusBeefyForkVotingProofOpaqueValue, key_owner_proof: Bytes | string | Uint8Array) => Observable<Option<Null>>>;
/**
* 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.
**/
submitReportFutureBlockVotingUnsignedExtrinsic: AugmentedCall<ApiType, (equivocation_proof: PezspConsensusBeefyFutureBlockVotingProof, key_owner_proof: Bytes | string | Uint8Array) => Observable<Option<Null>>>;
/**
* Return the current active BEEFY validator set
**/
validatorSet: AugmentedCall<ApiType, () => Observable<Option<PezspConsensusBeefyValidatorSet>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x2a5e924655399e60/ */
beefyMmrApi: {
/**
* Return the currently active BEEFY authority set proof.
**/
authoritySetProof: AugmentedCall<ApiType, () => Observable<PezspConsensusBeefyMmrBeefyAuthoritySet>>;
/**
* Return the next/queued BEEFY authority set proof.
**/
nextAuthoritySetProof: AugmentedCall<ApiType, () => Observable<PezspConsensusBeefyMmrBeefyAuthoritySet>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x40fe3ad401f8959a/ */
blockBuilder: {
/**
* Apply the given extrinsic.,, Returns an inclusion outcome which specifies if this extrinsic is included in, this block or not.
**/
applyExtrinsic: AugmentedCall<ApiType, (extrinsic: Extrinsic | IExtrinsic | string | Uint8Array) => Observable<Result<Result<Null, PezspRuntimeDispatchError>, PezspRuntimeTransactionValidityTransactionValidityError>>>;
/**
* Check that the inherents are valid. The inherent data will vary from chain to chain.
**/
checkInherents: AugmentedCall<ApiType, (block: PezspRuntimeBlock, data: PezspInherentsInherentData) => Observable<PezspInherentsCheckInherentsResult>>;
/**
* Finish the current block.
**/
finalizeBlock: AugmentedCall<ApiType, () => Observable<PezspRuntimeHeader>>;
/**
* Generate inherent extrinsics. The inherent data will vary from chain to chain.
**/
inherentExtrinsics: AugmentedCall<ApiType, (inherent: PezspInherentsInherentData) => Observable<Vec<Bytes>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0xdf6acb689907609b/ */
core: {
/**
* Execute the given block.
**/
executeBlock: AugmentedCall<ApiType, (block: PezspRuntimeBlock) => Observable<Null>>;
/**
* Initialize a block with the given header and return the runtime executive mode.
**/
initializeBlock: AugmentedCall<ApiType, (header: PezspRuntimeHeader) => Observable<PezspRuntimeExtrinsicInclusionMode>>;
/**
* Returns the version of the runtime.
**/
version: AugmentedCall<ApiType, () => Observable<PezspVersionRuntimeVersion>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x91b1c8b16328eb92/ */
dryRunApi: {
/**
* Dry run call V2.
**/
dryRunCall: AugmentedCall<ApiType, (origin: OriginCaller | { System: any } | string | Uint8Array, call: RuntimeCall | IMethod | string | Uint8Array, result_xcms_version: u32 | AnyNumber | Uint8Array) => Observable<Result<XcmRuntimeApisDryRunCallDryRunEffects, XcmRuntimeApisDryRunError>>>;
/**
* Dry run XCM program
**/
dryRunXcm: AugmentedCall<ApiType, (origin_location: XcmVersionedLocation | { V3: any } | { V4: any } | { V5: any } | string | Uint8Array, xcm: XcmVersionedXcm | { V3: any } | { V4: any } | { V5: any } | string | Uint8Array) => Observable<Result<XcmRuntimeApisDryRunXcmDryRunEffects, XcmRuntimeApisDryRunError>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 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.
**/
buildState: AugmentedCall<ApiType, (json: Bytes | string | Uint8Array) => Observable<Result<Null, Text>>>;
/**
* 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<u8>` 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.
**/
getPreset: AugmentedCall<ApiType, (id: Option<Text> | null | Uint8Array | Text | string) => Observable<Option<Bytes>>>;
/**
* 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.
**/
presetNames: AugmentedCall<ApiType, () => Observable<Vec<Text>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0xed99c5acb25eedf5/ */
grandpaApi: {
/**
* Get current GRANDPA authority set id.
**/
currentSetId: AugmentedCall<ApiType, () => Observable<u64>>;
/**
* 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.
**/
generateKeyOwnershipProof: AugmentedCall<ApiType, (set_id: u64 | AnyNumber | Uint8Array, authority_id: PezspConsensusGrandpaAppPublic) => Observable<Option<Bytes>>>;
/**
* 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.
**/
grandpaAuthorities: AugmentedCall<ApiType, () => Observable<Vec<ITuple<[PezspConsensusGrandpaAppPublic, u64]>>>>;
/**
* 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.
**/
submitReportEquivocationUnsignedExtrinsic: AugmentedCall<ApiType, (equivocation_proof: PezspConsensusGrandpaEquivocationProof, key_owner_proof: Bytes | string | Uint8Array) => Observable<Option<Null>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0xc51ff1fa3f5d0cca/ */
inflation: {
/**
* Return the current estimates of the inflation amount.,, This is marked as experimental in light of RFC#89. Nonetheless, its usage is highly, recommended over trying to read-storage, or re-create the onchain logic.
**/
experimentalInflationPredictionInfo: AugmentedCall<ApiType, () => Observable<RelayCommonApisInflationInfo>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x9ffb505aa738d69c/ */
locationToAccountApi: {
/**
* Converts `Location` to `AccountId`.
**/
convertLocation: AugmentedCall<ApiType, (location: XcmVersionedLocation | { V3: any } | { V4: any } | { V5: any } | string | Uint8Array) => Observable<Result<AccountId32, XcmRuntimeApisConversionsError>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x37e397fc7c91f5e4/ */
metadata: {
/**
* Returns the metadata of a runtime.
**/
metadata: AugmentedCall<ApiType, () => Observable<OpaqueMetadata>>;
/**
* 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.
**/
metadataAtVersion: AugmentedCall<ApiType, (version: u32 | AnyNumber | Uint8Array) => Observable<Option<OpaqueMetadata>>>;
/**
* Returns the supported metadata versions.,, This can be used to call `metadata_at_version`.
**/
metadataVersions: AugmentedCall<ApiType, () => Observable<Vec<u32>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x91d5df18b0d2cf58/ */
mmrApi: {
/**
* 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.
**/
generateProof: AugmentedCall<ApiType, (block_numbers: Vec<u32> | (u32 | AnyNumber | Uint8Array)[], best_known_block_number: Option<u32> | null | Uint8Array | u32 | AnyNumber) => Observable<Result<ITuple<[Vec<Bytes>, PezspMmrPrimitivesLeafProof]>, PezspMmrPrimitivesError>>>;
/**
* Return the number of MMR blocks in the chain.
**/
mmrLeafCount: AugmentedCall<ApiType, () => Observable<Result<u64, PezspMmrPrimitivesError>>>;
/**
* Return the on-chain MMR root hash.
**/
mmrRoot: AugmentedCall<ApiType, () => Observable<Result<H256, PezspMmrPrimitivesError>>>;
/**
* 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]
**/
verifyProof: AugmentedCall<ApiType, (leaves: Vec<Bytes> | (Bytes | string | Uint8Array)[], proof: PezspMmrPrimitivesLeafProof) => Observable<Result<Null, PezspMmrPrimitivesError>>>;
/**
* 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]
**/
verifyProofStateless: AugmentedCall<ApiType, (root: H256 | string | Uint8Array, leaves: Vec<Bytes> | (Bytes | string | Uint8Array)[], proof: PezspMmrPrimitivesLeafProof) => Observable<Result<Null, PezspMmrPrimitivesError>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x17a6bc0d0062aeb3/ */
nominationPoolsApi: {
/**
* Returns the equivalent points of `new_funds` for a given pool.
**/
balanceToPoints: AugmentedCall<ApiType, (pool_id: u32 | AnyNumber | Uint8Array, new_funds: u128 | AnyNumber | Uint8Array) => Observable<u128>>;
/**
* 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.
**/
memberNeedsDelegateMigration: AugmentedCall<ApiType, (member: AccountId32 | string | Uint8Array) => Observable<bool>>;
/**
* Returns the pending slash for a given pool member.,, If pending slash of the member exceeds `ExistentialDeposit`, it can be reported on, chain.
**/
memberPendingSlash: AugmentedCall<ApiType, (member: AccountId32 | string | Uint8Array) => Observable<u128>>;
/**
* Returns the total contribution of a pool member including any balance that is unbonding.
**/
memberTotalBalance: AugmentedCall<ApiType, (who: AccountId32 | string | Uint8Array) => Observable<u128>>;
/**
* Returns the pending rewards for the member that the AccountId was given for.
**/
pendingRewards: AugmentedCall<ApiType, (who: AccountId32 | string | Uint8Array) => Observable<u128>>;
/**
* Returns the equivalent balance of `points` for a given pool.
**/
pointsToBalance: AugmentedCall<ApiType, (pool_id: u32 | AnyNumber | Uint8Array, points: u128 | AnyNumber | Uint8Array) => Observable<u128>>;
/**
* Returns the bonded account and reward account associated with the pool_id.
**/
poolAccounts: AugmentedCall<ApiType, (pool_id: u32 | AnyNumber | Uint8Array) => Observable<ITuple<[AccountId32, AccountId32]>>>;
/**
* Total balance contributed to the pool.
**/
poolBalance: AugmentedCall<ApiType, (pool_id: u32 | AnyNumber | Uint8Array) => Observable<u128>>;
/**
* 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.
**/
poolNeedsDelegateMigration: AugmentedCall<ApiType, (pool_id: u32 | AnyNumber | Uint8Array) => Observable<bool>>;
/**
* Returns the pending slash for a given pool.
**/
poolPendingSlash: AugmentedCall<ApiType, (pool_id: u32 | AnyNumber | Uint8Array) => Observable<u128>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0xf78b278be53f454c/ */
offchainWorkerApi: {
/**
* Starts the off-chain task for given block header.
**/
offchainWorker: AugmentedCall<ApiType, (header: PezspRuntimeHeader) => Observable<Null>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0xaf2c0297a23e6d3d/ */
parachainHost: {
/**
* Approval voting configuration parameters
**/
approvalVotingParams: AugmentedCall<ApiType, () => Observable<PezkuwiPrimitivesV8ApprovalVotingParams>>;
/**
* Returns the persisted validation data for the given `ParaId` along with the corresponding, validation code hash. Instead of accepting assumption about the para, matches the validation, data hash against an expected one and yields `None` if they're not equal.
**/
assumedValidationData: AugmentedCall<ApiType, (para_id: ParaId | AnyNumber | Uint8Array, expected_persisted_validation_data_hash: H256 | string | Uint8Array) => Observable<Option<ITuple<[PezkuwiPrimitivesV8PersistedValidationData, H256]>>>>;
/**
* Returns candidate's acceptance limitations for asynchronous backing for a relay parent.
**/
asyncBackingParams: AugmentedCall<ApiType, () => Observable<PezkuwiPrimitivesV8AsyncBackingAsyncBackingParams>>;
/**
* Yields information on all availability cores as relevant to the child block., Cores are either free or occupied. Free cores can have paras assigned to them.
**/
availabilityCores: AugmentedCall<ApiType, () => Observable<Vec<PezkuwiPrimitivesVstagingCoreState>>>;
/**
* Returns the constraints on the actions that can be taken by a new parachain, block.
**/
backingConstraints: AugmentedCall<ApiType, (para_id: ParaId | AnyNumber | Uint8Array) => Observable<Option<PezkuwiPrimitivesVstagingAsyncBackingConstraints>>>;
/**
* Get a vector of events concerning candidates that occurred within a block.
**/
candidateEvents: AugmentedCall<ApiType, () => Observable<Vec<PezkuwiPrimitivesVstagingCandidateEvent>>>;
/**
* Get the receipt of a candidate pending availability. This returns `Some` for any paras, assigned to occupied cores in `availability_cores` and `None` otherwise.
**/
candidatePendingAvailability: AugmentedCall<ApiType, (para_id: ParaId | AnyNumber | Uint8Array) => Observable<Option<PezkuwiPrimitivesVstagingCommittedCandidateReceiptV2>>>;
/**
* Elastic scaling support
**/
candidatesPendingAvailability: AugmentedCall<ApiType, (para_id: ParaId | AnyNumber | Uint8Array) => Observable<Vec<PezkuwiPrimitivesVstagingCommittedCandidateReceiptV2>>>;
/**
* Checks if the given validation outputs pass the acceptance criteria.
**/
checkValidationOutputs: AugmentedCall<ApiType, (para_id: ParaId | AnyNumber | Uint8Array, outputs: PezkuwiPrimitivesV8CandidateCommitments) => Observable<bool>>;
/**
* Claim queue
**/
claimQueue: AugmentedCall<ApiType, () => Observable<BTreeMap<u32, Vec<u32>>>>;
/**
* Returns a list of all disabled validators at the given block.
**/
disabledValidators: AugmentedCall<ApiType, () => Observable<Vec<u32>>>;
/**
* Returns all onchain disputes.
**/
disputes: AugmentedCall<ApiType, () => Observable<Vec<ITuple<[u32, H256, PezkuwiPrimitivesV8DisputeState]>>>>;
/**
* Get all the pending inbound messages in the downward message queue for a para.
**/
dmqContents: AugmentedCall<ApiType, (recipient: ParaId | AnyNumber | Uint8Array) => Observable<Vec<PezkuwiCorePrimitivesInboundDownwardMessage>>>;
/**
* Get the contents of all channels addressed to the given recipient. Channels that have no, messages in them are also included.
**/
inboundHrmpChannelsContents: AugmentedCall<ApiType, (recipient: ParaId | AnyNumber | Uint8Array) => Observable<BTreeMap<u32, Vec<PezkuwiCorePrimitivesInboundHrmpMessage>>>>;
/**
* Returns a merkle proof of a validator session key., NOTE: This function is only available since parachain host version 5.
**/
keyOwnershipProof: AugmentedCall<ApiType, (validator_id: PezkuwiPrimitivesV8ValidatorAppPublic) => Observable<Option<Bytes>>>;
/**
* Get the minimum number of backing votes for a parachain candidate., This is a staging method! Do not use on production runtimes!
**/
minimumBackingVotes: AugmentedCall<ApiType, () => Observable<u32>>;
/**
* Get node features., This is a staging method! Do not use on production runtimes!
**/
nodeFeatures: AugmentedCall<ApiType, () => Observable<BitVec>>;
/**
* Scrape dispute relevant from on-chain, backing votes and resolved disputes.
**/
onChainVotes: AugmentedCall<ApiType, () => Observable<Option<PezkuwiPrimitivesVstagingScrapedOnChainVotes>>>;
/**
* Returns the state of parachain backing for a given para.
**/
paraBackingState: AugmentedCall<ApiType, (__runtime_api_generated_name_0__: ParaId | AnyNumber | Uint8Array) => Observable<Option<PezkuwiPrimitivesVstagingAsyncBackingBackingState>>>;
/**
* Yields the persisted validation data for the given `ParaId` along with an assumption that, should be used if the para currently occupies a core.,, Returns `None` if either the para is not registered or the assumption is `Freed`, and the para already occupies a core.
**/
persistedValidationData: AugmentedCall<ApiType, (para_id: ParaId | AnyNumber | Uint8Array, assumption: PezkuwiPrimitivesV8OccupiedCoreAssumption) => Observable<Option<PezkuwiPrimitivesV8PersistedValidationData>>>;
/**
* Returns code hashes of PVFs that require pre-checking by validators in the active set.,, NOTE: This function is only available since parachain host version 2.
**/
pvfsRequirePrecheck: AugmentedCall<ApiType, () => Observable<Vec<H256>>>;
/**
* Retrieve the scheduling lookahead
**/
schedulingLookahead: AugmentedCall<ApiType, () => Observable<u32>>;
/**
* Returns execution parameters for the session.
**/
sessionExecutorParams: AugmentedCall<ApiType, (session_index: u32 | AnyNumber | Uint8Array) => Observable<Option<PezkuwiPrimitivesV8ExecutorParams>>>;
/**
* Returns the session index expected at a child of the block.,, This can be used to instantiate a `SigningContext`.
**/
sessionIndexForChild: AugmentedCall<ApiType, () => Observable<u32>>;
/**
* Get the session info for the given session, if stored.,, NOTE: This function is only available since parachain host version 2.
**/
sessionInfo: AugmentedCall<ApiType, (index: u32 | AnyNumber | Uint8Array) => Observable<Option<PezkuwiPrimitivesV8SessionInfo>>>;
/**
* Submits a PVF pre-checking statement into the transaction pool.,, NOTE: This function is only available since parachain host version 2.
**/
submitPvfCheckStatement: AugmentedCall<ApiType, (stmt: PezkuwiPrimitivesV8PvfCheckStatement, signature: PezkuwiPrimitivesV8ValidatorAppSignature) => Observable<Null>>;
/**
* Submit an unsigned extrinsic to slash validators who lost a dispute about, a candidate of a past session., NOTE: This function is only available since parachain host version 5.
**/
submitReportDisputeLost: AugmentedCall<ApiType, (dispute_proof: PezkuwiPrimitivesV8SlashingDisputeProof, key_ownership_proof: OpaqueKeyOwnershipProof | string | Uint8Array) => Observable<Option<Null>>>;
/**
* Returns a list of validators that lost a past session dispute and need to be slashed., NOTE: This function is only available since parachain host version 5.
**/
unappliedSlashes: AugmentedCall<ApiType, () => Observable<Vec<ITuple<[u32, H256, PezkuwiPrimitivesV8SlashingPendingSlashes]>>>>;
/**
* Fetch the validation code used by a para, making the given `OccupiedCoreAssumption`.,, Returns `None` if either the para is not registered or the assumption is `Freed`, and the para already occupies a core.
**/
validationCode: AugmentedCall<ApiType, (para_id: ParaId | AnyNumber | Uint8Array, assumption: PezkuwiPrimitivesV8OccupiedCoreAssumption) => Observable<Option<Bytes>>>;
/**
* Retrieve the maximum uncompressed code size.
**/
validationCodeBombLimit: AugmentedCall<ApiType, () => Observable<u32>>;
/**
* Get the validation code from its hash.
**/
validationCodeByHash: AugmentedCall<ApiType, (hash: ValidationCodeHash | string | Uint8Array) => Observable<Option<Bytes>>>;
/**
* Fetch the hash of the validation code used by a para, making the given `OccupiedCoreAssumption`.,, NOTE: This function is only available since parachain host version 2.
**/
validationCodeHash: AugmentedCall<ApiType, (para_id: ParaId | AnyNumber | Uint8Array, assumption: PezkuwiPrimitivesV8OccupiedCoreAssumption) => Observable<Option<H256>>>;
/**
* Returns the validator groups and rotation info localized based on the hypothetical child, of a block whose state this is invoked on. Note that `now` in the `GroupRotationInfo`, should be the successor of the number of the block.
**/
validatorGroups: AugmentedCall<ApiType, () => Observable<ITuple<[Vec<Vec<u32>>, PezkuwiPrimitivesV8GroupRotationInfo]>>>;
/**
* Get the current validators.
**/
validators: AugmentedCall<ApiType, () => Observable<Vec<PezkuwiPrimitivesV8ValidatorAppPublic>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0xab3c0572291feb8b/ */
sessionKeys: {
/**
* Decode the given public session keys.,, Returns the list of public raw public keys + key type.
**/
decodeSessionKeys: AugmentedCall<ApiType, (encoded: Bytes | string | Uint8Array) => Observable<Option<Vec<ITuple<[Bytes, PezspCoreCryptoKeyTypeId]>>>>>;
/**
* 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.
**/
generateSessionKeys: AugmentedCall<ApiType, (seed: Option<Bytes> | null | Uint8Array | Bytes | string) => Observable<Bytes>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x18ef58a3b67ba770/ */
stakingApi: {
/**
* Returns the page count of exposures for a validator `account` in a given era.
**/
erasStakersPageCount: AugmentedCall<ApiType, (era: u32 | AnyNumber | Uint8Array, account: AccountId32 | string | Uint8Array) => Observable<u32>>;
/**
* Returns the nominations quota for a nominator with a given balance.
**/
nominationsQuota: AugmentedCall<ApiType, (balance: u128 | AnyNumber | Uint8Array) => Observable<u32>>;
/**
* Returns true if validator `account` has pages to be claimed for the given era.
**/
pendingRewards: AugmentedCall<ApiType, (era: u32 | AnyNumber | Uint8Array, account: AccountId32 | string | Uint8Array) => Observable<bool>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 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.
**/
validateTransaction: AugmentedCall<ApiType, (source: PezspRuntimeTransactionValidityTransactionSource, tx: Extrinsic | IExtrinsic | string | Uint8Array, block_hash: H256 | string | Uint8Array) => Observable<Result<PezspRuntimeTransactionValidityValidTransaction, PezspRuntimeTransactionValidityTransactionValidityError>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x37c8bb1350a9a2a8/ */
transactionPaymentApi: {
/**
*
**/
queryFeeDetails: AugmentedCall<ApiType, (uxt: Extrinsic | IExtrinsic | string | Uint8Array, len: u32 | AnyNumber | Uint8Array) => Observable<PezpalletTransactionPaymentFeeDetails>>;
/**
*
**/
queryInfo: AugmentedCall<ApiType, (uxt: Extrinsic | IExtrinsic | string | Uint8Array, len: u32 | AnyNumber | Uint8Array) => Observable<PezpalletTransactionPaymentRuntimeDispatchInfo>>;
/**
*
**/
queryLengthToFee: AugmentedCall<ApiType, (length: u32 | AnyNumber | Uint8Array) => Observable<u128>>;
/**
*
**/
queryWeightToFee: AugmentedCall<ApiType, (weight: PezspWeightsWeightV2Weight) => Observable<u128>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0xf3ff14d5ab527059/ */
transactionPaymentCallApi: {
/**
* Query fee details of a given encoded `Call`.
**/
queryCallFeeDetails: AugmentedCall<ApiType, (call: RuntimeCall | IMethod | string | Uint8Array, len: u32 | AnyNumber | Uint8Array) => Observable<PezpalletTransactionPaymentFeeDetails>>;
/**
* Query information of a dispatch class, weight, and fee of a given encoded `Call`.
**/
queryCallInfo: AugmentedCall<ApiType, (call: RuntimeCall | IMethod | string | Uint8Array, len: u32 | AnyNumber | Uint8Array) => Observable<PezpalletTransactionPaymentRuntimeDispatchInfo>>;
/**
* Query the output of the current `LengthToFee` given some input.
**/
queryLengthToFee: AugmentedCall<ApiType, (length: u32 | AnyNumber | Uint8Array) => Observable<u128>>;
/**
* Query the output of the current `WeightToFee` given some input.
**/
queryWeightToFee: AugmentedCall<ApiType, (weight: PezspWeightsWeightV2Weight) => Observable<u128>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x6ff52ee858e6c5bd/ */
xcmPaymentApi: {
/**
* Returns a list of acceptable payment assets.,, # Arguments,, * `xcm_version`: Version.
**/
queryAcceptablePaymentAssets: AugmentedCall<ApiType, (xcm_version: u32 | AnyNumber | Uint8Array) => Observable<Result<Vec<XcmVersionedAssetId>, XcmRuntimeApisFeesError>>>;
/**
* Get delivery fees for sending a specific `message` to a `destination`., These always come in a specific asset, defined by the chain.,, # Arguments, * `message`: The message that'll be sent, necessary because most delivery fees are based on the, size of the message., * `destination`: The destination to send the message to. Different destinations may use, different senders that charge different fees.
**/
queryDeliveryFees: AugmentedCall<ApiType, (destination: XcmVersionedLocation | { V3: any } | { V4: any } | { V5: any } | string | Uint8Array, message: XcmVersionedXcm | { V3: any } | { V4: any } | { V5: any } | string | Uint8Array) => Observable<Result<XcmVersionedAssets, XcmRuntimeApisFeesError>>>;
/**
* Converts a weight into a fee for the specified `AssetId`.,, # Arguments,, * `weight`: convertible `Weight`., * `asset`: `VersionedAssetId`.
**/
queryWeightToAssetFee: AugmentedCall<ApiType, (weight: PezspWeightsWeightV2Weight, asset: XcmVersionedAssetId | { V3: any } | { V4: any } | { V5: any } | string | Uint8Array) => Observable<Result<u128, XcmRuntimeApisFeesError>>>;
/**
* Returns a weight needed to execute a XCM.,, # Arguments,, * `message`: `VersionedXcm`.
**/
queryXcmWeight: AugmentedCall<ApiType, (message: XcmVersionedXcm | { V3: any } | { V4: any } | { V5: any } | string | Uint8Array) => Observable<Result<PezspWeightsWeightV2Weight, XcmRuntimeApisFeesError>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
} // AugmentedCalls
} // declare module
File diff suppressed because it is too large Load Diff
+6
View File
@@ -0,0 +1,6 @@
// Copyright 2017-2025 @pezkuwi/api-augment authors & contributors
// SPDX-License-Identifier: Apache-2.0
import './packageDetect.js';
export * from './bundle.js';
+4
View File
@@ -0,0 +1,4 @@
// Copyright 2017-2025 @pezkuwi/api-augment authors & contributors
// SPDX-License-Identifier: Apache-2.0
export * from './index.js';
+14
View File
@@ -0,0 +1,14 @@
// Copyright 2017-2026 @pezkuwi/api-augment authors & contributors
// SPDX-License-Identifier: Apache-2.0
// Do not edit, auto-generated by @pezkuwi/dev
// (packageInfo imports will be kept as-is, user-editable)
import { packageInfo as baseInfo } from '@pezkuwi/api-base/packageInfo';
import { packageInfo as typesInfo } from '@pezkuwi/types/packageInfo';
import { packageInfo as codecInfo } from '@pezkuwi/types-codec/packageInfo';
import { detectPackage } from '@pezkuwi/util';
import { packageInfo } from './packageInfo.js';
detectPackage(packageInfo, null, [baseInfo, codecInfo, typesInfo]);
+6
View File
@@ -0,0 +1,6 @@
// Copyright 2017-2026 @pezkuwi/api-augment authors & contributors
// SPDX-License-Identifier: Apache-2.0
// Do not edit, auto-generated by @pezkuwi/dev
export const packageInfo = { name: '@pezkuwi/api-augment', path: 'auto', type: 'auto', version: '16.5.4' };
+949
View File
@@ -0,0 +1,949 @@
// Auto-generated via `yarn polkadot-types-from-chain`, do not edit
/* eslint-disable */
// import type lookup before we augment - in some environments
// this is required to allow for ambient/previous definitions
import '@pezkuwi/api-base/types/consts';
import type { ApiTypes, AugmentedConst } from '@pezkuwi/api-base/types';
import type { Bytes, Option, Vec, u128, u16, u32, u64, u8 } from '@pezkuwi/types-codec';
import type { Codec, ITuple } from '@pezkuwi/types-codec/types';
import type { AccountId32, Perbill, Permill } from '@pezkuwi/types/interfaces/runtime';
import type { PezframeSupportPezpalletId, PezframeSystemLimitsBlockLength, PezframeSystemLimitsBlockWeights, PezpalletReferendaTrackDetails, PezspVersionRuntimeVersion, PezspWeightsRuntimeDbWeight, PezspWeightsWeightV2Weight, StagingXcmV5Junctions } from '@pezkuwi/types/lookup';
export type __AugmentedConst<ApiType extends ApiTypes> = AugmentedConst<ApiType>;
declare module '@pezkuwi/api-base/types/consts' {
interface AugmentedConsts<ApiType extends ApiTypes> {
auctions: {
/**
* The number of blocks over which an auction may be retroactively ended.
**/
endingPeriod: u32 & AugmentedConst<ApiType>;
leasePeriodsPerSlot: u32 & AugmentedConst<ApiType>;
/**
* The length of each sample to take during the ending period.
*
* `EndingPeriod` / `SampleLength` = Total # of Samples
**/
sampleLength: u32 & AugmentedConst<ApiType>;
slotRangeCount: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
babe: {
/**
* The amount of time, in slots, that each epoch should last.
* NOTE: Currently it is not possible to change the epoch duration after
* the chain has started. Attempting to do so will brick block production.
**/
epochDuration: u64 & AugmentedConst<ApiType>;
/**
* The expected average block time at which BABE should be creating
* blocks. Since BABE is probabilistic it is not trivial to figure out
* what the expected average block time should be based on the slot
* duration and the security parameter `c` (where `1 - c` represents
* the probability of a slot being empty).
**/
expectedBlockTime: u64 & AugmentedConst<ApiType>;
/**
* Max number of authorities allowed
**/
maxAuthorities: u32 & AugmentedConst<ApiType>;
/**
* The maximum number of nominators for each validator.
**/
maxNominators: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
balances: {
/**
* The minimum amount required to keep an account open. MUST BE GREATER THAN ZERO!
*
* If you *really* need it to be zero, you can enable the feature `insecure_zero_ed` for
* this pallet. However, you do so at your own risk: this will open up a major DoS vector.
* In case you have multiple sources of provider references, you may also get unexpected
* behaviour if you set this to zero.
*
* Bottom line: Do yourself a favour and make it at least one!
**/
existentialDeposit: u128 & AugmentedConst<ApiType>;
/**
* The maximum number of individual freeze locks that can exist on an account at any time.
**/
maxFreezes: u32 & AugmentedConst<ApiType>;
/**
* The maximum number of locks that should exist on an account.
* Not strictly enforced, but used for weight estimation.
*
* Use of locks is deprecated in favour of freezes. See `https://github.com/paritytech/substrate/pull/12951/`
**/
maxLocks: u32 & AugmentedConst<ApiType>;
/**
* The maximum number of named reserves that can exist on an account.
*
* Use of reserves is deprecated in favour of holds. See `https://github.com/paritytech/substrate/pull/12951/`
**/
maxReserves: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
beefy: {
/**
* The maximum number of authorities that can be added.
**/
maxAuthorities: u32 & AugmentedConst<ApiType>;
/**
* The maximum number of nominators for each validator.
**/
maxNominators: u32 & AugmentedConst<ApiType>;
/**
* The maximum number of entries to keep in the set id to session index mapping.
*
* Since the `SetIdSession` map is only used for validating equivocations this
* value should relate to the bonding duration of whatever staking system is
* being used (if any). If equivocation handling is not enabled then this value
* can be zero.
**/
maxSetIdSessionEntries: u64 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
bounties: {
/**
* The amount held on deposit for placing a bounty proposal.
**/
bountyDepositBase: u128 & AugmentedConst<ApiType>;
/**
* The delay period for which a bounty beneficiary need to wait before claim the payout.
**/
bountyDepositPayoutDelay: u32 & AugmentedConst<ApiType>;
/**
* The time limit for a curator to act before a bounty expires.
*
* The period that starts when a curator is approved, during which they must execute or
* update the bounty via `extend_bounty_expiry`. If missed, the bounty expires, and the
* curator may be slashed. If `BlockNumberFor::MAX`, bounties stay active indefinitely,
* removing the need for `extend_bounty_expiry`.
**/
bountyUpdatePeriod: u32 & AugmentedConst<ApiType>;
/**
* Minimum value for a bounty.
**/
bountyValueMinimum: u128 & AugmentedConst<ApiType>;
/**
* Maximum amount of funds that should be placed in a deposit for making a proposal.
**/
curatorDepositMax: Option<u128> & AugmentedConst<ApiType>;
/**
* Minimum amount of funds that should be placed in a deposit for making a proposal.
**/
curatorDepositMin: Option<u128> & AugmentedConst<ApiType>;
/**
* The curator deposit is calculated as a percentage of the curator fee.
*
* This deposit has optional upper and lower bounds with `CuratorDepositMax` and
* `CuratorDepositMin`.
**/
curatorDepositMultiplier: Permill & AugmentedConst<ApiType>;
/**
* The amount held on deposit per byte within the tip report reason or bounty description.
**/
dataDepositPerByte: u128 & AugmentedConst<ApiType>;
/**
* Maximum acceptable reason length.
*
* Benchmarks depend on this value, be sure to update weights file when changing this value
**/
maximumReasonLength: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
childBounties: {
/**
* Minimum value for a child-bounty.
**/
childBountyValueMinimum: u128 & AugmentedConst<ApiType>;
/**
* Maximum number of child bounties that can be added to a parent bounty.
**/
maxActiveChildBountyCount: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
claims: {
prefix: Bytes & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
convictionVoting: {
/**
* The maximum number of concurrent votes an account may have.
*
* Also used to compute weight, an overly large value can lead to extrinsics with large
* weight estimation: see `delegate` for instance.
**/
maxVotes: u32 & AugmentedConst<ApiType>;
/**
* The minimum period of vote locking.
*
* It should be no shorter than enactment period to ensure that in the case of an approval,
* those successful voters are locked into the consequences that their votes entail.
**/
voteLockingPeriod: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
coretime: {
/**
* The ParaId of the coretime chain.
**/
brokerId: u32 & AugmentedConst<ApiType>;
/**
* The coretime chain pot location.
**/
brokerPotLocation: StagingXcmV5Junctions & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
crowdloan: {
/**
* The minimum amount that may be contributed into a crowdloan. Should almost certainly be
* at least `ExistentialDeposit`.
**/
minContribution: u128 & AugmentedConst<ApiType>;
/**
* `PalletId` for the crowdloan pallet. An appropriate value could be
* `PalletId(*b"py/cfund")`
**/
palletId: PezframeSupportPezpalletId & AugmentedConst<ApiType>;
/**
* Max number of storage keys to remove per extrinsic call.
**/
removeKeysLimit: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
delegatedStaking: {
/**
* Injected identifier for the pallet.
**/
palletId: PezframeSupportPezpalletId & AugmentedConst<ApiType>;
/**
* Fraction of the slash that is rewarded to the caller of pending slash to the agent.
**/
slashRewardFraction: Perbill & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
electionProviderMultiPhase: {
/**
* The minimum amount of improvement to the solution score that defines a solution as
* "better" in the Signed phase.
**/
betterSignedThreshold: Perbill & AugmentedConst<ApiType>;
/**
* Maximum number of voters that can support a winner in an election solution.
*
* This is needed to ensure election computation is bounded.
**/
maxBackersPerWinner: u32 & AugmentedConst<ApiType>;
/**
* Maximum number of winners that an election supports.
*
* Note: This must always be greater or equal to `T::DataProvider::desired_targets()`.
**/
maxWinners: u32 & AugmentedConst<ApiType>;
minerMaxLength: u32 & AugmentedConst<ApiType>;
minerMaxVotesPerVoter: u32 & AugmentedConst<ApiType>;
minerMaxWeight: PezspWeightsWeightV2Weight & AugmentedConst<ApiType>;
minerMaxWinners: u32 & AugmentedConst<ApiType>;
/**
* The priority of the unsigned transaction submitted in the unsigned-phase
**/
minerTxPriority: u64 & AugmentedConst<ApiType>;
/**
* The repeat threshold of the offchain worker.
*
* For example, if it is 5, that means that at least 5 blocks will elapse between attempts
* to submit the worker's solution.
**/
offchainRepeat: u32 & AugmentedConst<ApiType>;
/**
* Per-byte deposit for a signed solution.
**/
signedDepositByte: u128 & AugmentedConst<ApiType>;
/**
* Per-weight deposit for a signed solution.
**/
signedDepositWeight: u128 & AugmentedConst<ApiType>;
/**
* The maximum amount of unchecked solutions to refund the call fee for.
**/
signedMaxRefunds: u32 & AugmentedConst<ApiType>;
/**
* Maximum number of signed submissions that can be queued.
*
* It is best to avoid adjusting this during an election, as it impacts downstream data
* structures. In particular, `SignedSubmissionIndices<T>` is bounded on this value. If you
* update this value during an election, you _must_ ensure that
* `SignedSubmissionIndices.len()` is less than or equal to the new value. Otherwise,
* attempts to submit new solutions may cause a runtime panic.
**/
signedMaxSubmissions: u32 & AugmentedConst<ApiType>;
/**
* Maximum weight of a signed solution.
*
* If [`Config::MinerConfig`] is being implemented to submit signed solutions (outside of
* this pallet), then [`MinerConfig::solution_weight`] is used to compare against
* this value.
**/
signedMaxWeight: PezspWeightsWeightV2Weight & AugmentedConst<ApiType>;
/**
* Base reward for a signed solution
**/
signedRewardBase: u128 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
fastUnstake: {
/**
* Deposit to take for unstaking, to make sure we're able to slash the it in order to cover
* the costs of resources on unsuccessful unstake.
**/
deposit: u128 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
grandpa: {
/**
* Max Authorities in use
**/
maxAuthorities: u32 & AugmentedConst<ApiType>;
/**
* The maximum number of nominators for each validator.
**/
maxNominators: u32 & AugmentedConst<ApiType>;
/**
* The maximum number of entries to keep in the set id to session index mapping.
*
* Since the `SetIdSession` map is only used for validating equivocations this
* value should relate to the bonding duration of whatever staking system is
* being used (if any). If equivocation handling is not enabled then this value
* can be zero.
**/
maxSetIdSessionEntries: u64 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
indices: {
/**
* The deposit needed for reserving an index.
**/
deposit: u128 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
messageQueue: {
/**
* The size of the page; this implies the maximum message size which can be sent.
*
* A good value depends on the expected message sizes, their weights, the weight that is
* available for processing them and the maximal needed message size. The maximal message
* size is slightly lower than this as defined by [`MaxMessageLenOf`].
**/
heapSize: u32 & AugmentedConst<ApiType>;
/**
* The maximum amount of weight (if any) to be used from remaining weight `on_idle` which
* should be provided to the message queue for servicing enqueued items `on_idle`.
* Useful for parachains to process messages at the same block they are received.
*
* If `None`, it will not call `ServiceQueues::service_queues` in `on_idle`.
**/
idleMaxServiceWeight: Option<PezspWeightsWeightV2Weight> & AugmentedConst<ApiType>;
/**
* The maximum number of stale pages (i.e. of overweight messages) allowed before culling
* can happen. Once there are more stale pages than this, then historical pages may be
* dropped, even if they contain unprocessed overweight messages.
**/
maxStale: u32 & AugmentedConst<ApiType>;
/**
* The amount of weight (if any) which should be provided to the message queue for
* servicing enqueued items `on_initialize`.
*
* This may be legitimately `None` in the case that you will call
* `ServiceQueues::service_queues` manually or set [`Self::IdleMaxServiceWeight`] to have
* it run in `on_idle`.
**/
serviceWeight: Option<PezspWeightsWeightV2Weight> & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
multisig: {
/**
* The base amount of currency needed to reserve for creating a multisig execution or to
* store a dispatch call for later.
*
* This is held for an additional storage item whose value size is
* `4 + sizeof((BlockNumber, Balance, AccountId))` bytes and whose key size is
* `32 + sizeof(AccountId)` bytes.
**/
depositBase: u128 & AugmentedConst<ApiType>;
/**
* The amount of currency needed per unit threshold when creating a multisig execution.
*
* This is held for adding 32 bytes more into a pre-existing storage value.
**/
depositFactor: u128 & AugmentedConst<ApiType>;
/**
* The maximum amount of signatories allowed in the multisig.
**/
maxSignatories: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
nominationPools: {
/**
* The maximum pool points-to-balance ratio that an `open` pool can have.
*
* This is important in the event slashing takes place and the pool's points-to-balance
* ratio becomes disproportional.
*
* Moreover, this relates to the `RewardCounter` type as well, as the arithmetic operations
* are a function of number of points, and by setting this value to e.g. 10, you ensure
* that the total number of points in the system are at most 10 times the total_issuance of
* the chain, in the absolute worse case.
*
* For a value of 10, the threshold would be a pool points-to-balance ratio of 10:1.
* Such a scenario would also be the equivalent of the pool being 90% slashed.
**/
maxPointsToBalance: u8 & AugmentedConst<ApiType>;
/**
* The maximum number of simultaneous unbonding chunks that can exist per member.
**/
maxUnbonding: u32 & AugmentedConst<ApiType>;
/**
* The nomination pool's pallet id.
**/
palletId: PezframeSupportPezpalletId & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
onDemand: {
/**
* The maximum number of blocks some historical revenue
* information stored for.
**/
maxHistoricalRevenue: u32 & AugmentedConst<ApiType>;
/**
* Identifier for the internal revenue balance.
**/
palletId: PezframeSupportPezpalletId & AugmentedConst<ApiType>;
/**
* The default value for the spot traffic multiplier.
**/
trafficDefaultValue: u128 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
paras: {
unsignedPriority: u64 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
proxy: {
/**
* The base amount of currency needed to reserve for creating an announcement.
*
* This is held when a new storage item holding a `Balance` is created (typically 16
* bytes).
**/
announcementDepositBase: u128 & AugmentedConst<ApiType>;
/**
* The amount of currency needed per announcement made.
*
* This is held for adding an `AccountId`, `Hash` and `BlockNumber` (typically 68 bytes)
* into a pre-existing storage value.
**/
announcementDepositFactor: u128 & AugmentedConst<ApiType>;
/**
* The maximum amount of time-delayed announcements that are allowed to be pending.
**/
maxPending: u32 & AugmentedConst<ApiType>;
/**
* The maximum amount of proxies allowed for a single account.
**/
maxProxies: u32 & AugmentedConst<ApiType>;
/**
* The base amount of currency needed to reserve for creating a proxy.
*
* This is held for an additional storage item whose value size is
* `sizeof(Balance)` bytes and whose key size is `sizeof(AccountId)` bytes.
**/
proxyDepositBase: u128 & AugmentedConst<ApiType>;
/**
* The amount of currency needed per proxy added.
*
* This is held for adding 32 bytes plus an instance of `ProxyType` more into a
* pre-existing storage value. Thus, when configuring `ProxyDepositFactor` one should take
* into account `32 + proxy_type.encode().len()` bytes of data.
**/
proxyDepositFactor: u128 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
referenda: {
/**
* Quantization level for the referendum wakeup scheduler. A higher number will result in
* fewer storage reads/writes needed for smaller voters, but also result in delays to the
* automatic referendum status changes. Explicit servicing instructions are unaffected.
**/
alarmInterval: u32 & AugmentedConst<ApiType>;
/**
* Maximum size of the referendum queue for a single track.
**/
maxQueued: u32 & AugmentedConst<ApiType>;
/**
* The minimum amount to be used as a deposit for a public referendum proposal.
**/
submissionDeposit: u128 & AugmentedConst<ApiType>;
/**
* A list of tracks.
*
* Note: if the tracks are dynamic, the value in the static metadata might be inaccurate.
**/
tracks: Vec<ITuple<[u16, PezpalletReferendaTrackDetails]>> & AugmentedConst<ApiType>;
/**
* The number of blocks after submission that a referendum must begin being decided by.
* Once this passes, then anyone may cancel the referendum.
**/
undecidingTimeout: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
registrar: {
/**
* The deposit to be paid per byte stored on chain.
**/
dataDepositPerByte: u128 & AugmentedConst<ApiType>;
/**
* The deposit to be paid to run a on-demand parachain.
* This should include the cost for storing the genesis head and validation code.
**/
paraDeposit: u128 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
scheduler: {
/**
* The maximum weight that may be scheduled per block for any dispatchables.
**/
maximumWeight: PezspWeightsWeightV2Weight & AugmentedConst<ApiType>;
/**
* The maximum number of scheduled calls in the queue for a single block.
*
* NOTE:
* + Dependent pallets' benchmarks might require a higher limit for the setting. Set a
* higher limit under `runtime-benchmarks` feature.
**/
maxScheduledPerBlock: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
session: {
/**
* The amount to be held when setting keys.
**/
keyDeposit: u128 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
slots: {
/**
* The number of blocks to offset each lease period by.
**/
leaseOffset: u32 & AugmentedConst<ApiType>;
/**
* The number of blocks over which a single period lasts.
**/
leasePeriod: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
staking: {
/**
* Number of eras that staked funds must remain bonded for.
**/
bondingDuration: u32 & AugmentedConst<ApiType>;
/**
* Number of eras to keep in history.
*
* Following information is kept for eras in `[current_era -
* HistoryDepth, current_era]`: `ErasStakers`, `ErasStakersClipped`,
* `ErasValidatorPrefs`, `ErasValidatorReward`, `ErasRewardPoints`,
* `ErasTotalStake`, `ErasStartSessionIndex`, `ClaimedRewards`, `ErasStakersPaged`,
* `ErasStakersOverview`.
*
* Must be more than the number of eras delayed by session.
* I.e. active era must always be in history. I.e. `active_era >
* current_era - history_depth` must be guaranteed.
*
* If migrating an existing pallet from storage value to config value,
* this should be set to same value or greater as in storage.
*
* Note: `HistoryDepth` is used as the upper bound for the `BoundedVec`
* item `StakingLedger.legacy_claimed_rewards`. Setting this value lower than
* the existing value can lead to inconsistencies in the
* `StakingLedger` and will need to be handled properly in a migration.
* The test `reducing_history_depth_abrupt` shows this effect.
**/
historyDepth: u32 & AugmentedConst<ApiType>;
/**
* The maximum size of each `T::ExposurePage`.
*
* An `ExposurePage` is weakly bounded to a maximum of `MaxExposurePageSize`
* nominators.
*
* For older non-paged exposure, a reward payout was restricted to the top
* `MaxExposurePageSize` nominators. This is to limit the i/o cost for the
* nominator payout.
*
* Note: `MaxExposurePageSize` is used to bound `ClaimedRewards` and is unsafe to reduce
* without handling it in a migration.
**/
maxExposurePageSize: u32 & AugmentedConst<ApiType>;
/**
* The maximum number of `unlocking` chunks a [`StakingLedger`] can
* have. Effectively determines how many unique eras a staker may be
* unbonding in.
*
* Note: `MaxUnlockingChunks` is used as the upper bound for the
* `BoundedVec` item `StakingLedger.unlocking`. Setting this value
* lower than the existing value can lead to inconsistencies in the
* `StakingLedger` and will need to be handled properly in a runtime
* migration. The test `reducing_max_unlocking_chunks_abrupt` shows
* this effect.
**/
maxUnlockingChunks: u32 & AugmentedConst<ApiType>;
/**
* The absolute maximum of winner validators this pallet should return.
**/
maxValidatorSet: u32 & AugmentedConst<ApiType>;
/**
* Number of sessions per era.
**/
sessionsPerEra: u32 & AugmentedConst<ApiType>;
/**
* Number of eras that slashes are deferred by, after computation.
*
* This should be less than the bonding duration. Set to 0 if slashes
* should be applied immediately, without opportunity for intervention.
**/
slashDeferDuration: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
stateTrieMigration: {
/**
* Maximal number of bytes that a key can have.
*
* FRAME itself does not limit the key length.
* The concrete value must therefore depend on your storage usage.
* A [`frame_support::storage::StorageNMap`] for example can have an arbitrary number of
* keys which are then hashed and concatenated, resulting in arbitrarily long keys.
*
* Use the *state migration RPC* to retrieve the length of the longest key in your
* storage: <https://github.com/paritytech/substrate/issues/11642>
*
* The migration will halt with a `Halted` event if this value is too small.
* Since there is no real penalty from over-estimating, it is advised to use a large
* value. The default is 512 byte.
*
* Some key lengths for reference:
* - [`frame_support::storage::StorageValue`]: 32 byte
* - [`frame_support::storage::StorageMap`]: 64 byte
* - [`frame_support::storage::StorageDoubleMap`]: 96 byte
*
* For more info see
* <https://www.shawntabrizi.com/blog/substrate/querying-substrate-storage-via-rpc/>
**/
maxKeyLen: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
system: {
/**
* Maximum number of block number to block hash mappings to keep (oldest pruned first).
**/
blockHashCount: u32 & AugmentedConst<ApiType>;
/**
* The maximum length of a block (in bytes).
**/
blockLength: PezframeSystemLimitsBlockLength & AugmentedConst<ApiType>;
/**
* Block & extrinsics weights: base values and limits.
**/
blockWeights: PezframeSystemLimitsBlockWeights & AugmentedConst<ApiType>;
/**
* The weight of runtime database operations the runtime can invoke.
**/
dbWeight: PezspWeightsRuntimeDbWeight & AugmentedConst<ApiType>;
/**
* The designated SS58 prefix of this chain.
*
* This replaces the "ss58Format" property declared in the chain spec. Reason is
* that the runtime should know about the prefix in order to make use of it as
* an identifier of the chain.
**/
ss58Prefix: u16 & AugmentedConst<ApiType>;
/**
* Get the chain's in-code version.
**/
version: PezspVersionRuntimeVersion & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
timestamp: {
/**
* The minimum period between blocks.
*
* Be aware that this is different to the *expected* period that the block production
* apparatus provides. Your chosen consensus system will generally work with this to
* determine a sensible block time. For example, in the Aura pallet it will be double this
* period on default settings.
**/
minimumPeriod: u64 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
transactionPayment: {
/**
* A fee multiplier for `Operational` extrinsics to compute "virtual tip" to boost their
* `priority`
*
* This value is multiplied by the `final_fee` to obtain a "virtual tip" that is later
* added to a tip component in regular `priority` calculations.
* It means that a `Normal` transaction can front-run a similarly-sized `Operational`
* extrinsic (with no tip), by including a tip value greater than the virtual tip.
*
* ```rust,ignore
* // For `Normal`
* let priority = priority_calc(tip);
*
* // For `Operational`
* let virtual_tip = (inclusion_fee + tip) * OperationalFeeMultiplier;
* let priority = priority_calc(tip + virtual_tip);
* ```
*
* Note that since we use `final_fee` the multiplier applies also to the regular `tip`
* sent with the transaction. So, not only does the transaction get a priority bump based
* on the `inclusion_fee`, but we also amplify the impact of tips applied to `Operational`
* transactions.
**/
operationalFeeMultiplier: u8 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
treasury: {
/**
* Percentage of spare funds (if any) that are burnt per spend period.
**/
burn: Permill & AugmentedConst<ApiType>;
/**
* DEPRECATED: associated with `spend_local` call and will be removed in May 2025.
* Refer to <https://github.com/paritytech/polkadot-sdk/pull/5961> for migration to `spend`.
*
* The maximum number of approvals that can wait in the spending queue.
*
* NOTE: This parameter is also used within the Bounties Pallet extension if enabled.
**/
maxApprovals: u32 & AugmentedConst<ApiType>;
/**
* The treasury's pallet id, used for deriving its sovereign account ID.
**/
palletId: PezframeSupportPezpalletId & AugmentedConst<ApiType>;
/**
* The period during which an approved treasury spend has to be claimed.
**/
payoutPeriod: u32 & AugmentedConst<ApiType>;
/**
* Gets this pallet's derived pot account.
**/
potAccount: AccountId32 & AugmentedConst<ApiType>;
/**
* Period between successive spends.
**/
spendPeriod: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
utility: {
/**
* The limit on the number of batched calls.
**/
batchedCallsLimit: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
vesting: {
maxVestingSchedules: u32 & AugmentedConst<ApiType>;
/**
* The minimum amount transferred to call `vested_transfer`.
**/
minVestedTransfer: u128 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
voterList: {
/**
* The list of thresholds separating the various bags.
*
* Ids are separated into unsorted bags according to their score. This specifies the
* thresholds separating the bags. An id's bag is the largest bag for which the id's score
* is less than or equal to its upper threshold.
*
* When ids are iterated, higher bags are iterated completely before lower bags. This means
* that iteration is _semi-sorted_: ids of higher score tend to come before ids of lower
* score, but peer ids within a particular bag are sorted in insertion order.
*
* # Expressing the constant
*
* This constant must be sorted in strictly increasing order. Duplicate items are not
* permitted.
*
* There is an implied upper limit of `Score::MAX`; that value does not need to be
* specified within the bag. For any two threshold lists, if one ends with
* `Score::MAX`, the other one does not, and they are otherwise equal, the two
* lists will behave identically.
*
* # Calculation
*
* It is recommended to generate the set of thresholds in a geometric series, such that
* there exists some constant ratio such that `threshold[k + 1] == (threshold[k] *
* constant_ratio).max(threshold[k] + 1)` for all `k`.
*
* The helpers in the `/utils/frame/generate-bags` module can simplify this calculation.
*
* # Examples
*
* - If `BagThresholds::get().is_empty()`, then all ids are put into the same bag, and
* iteration is strictly in insertion order.
* - If `BagThresholds::get().len() == 64`, and the thresholds are determined according to
* the procedure given above, then the constant ratio is equal to 2.
* - If `BagThresholds::get().len() == 200`, and the thresholds are determined according to
* the procedure given above, then the constant ratio is approximately equal to 1.248.
* - If the threshold list begins `[1, 2, 3, ...]`, then an id with score 0 or 1 will fall
* into bag 0, an id with score 2 will fall into bag 1, etc.
*
* # Migration
*
* In the event that this list ever changes, a copy of the old bags list must be retained.
* With that `List::migrate` can be called, which will perform the appropriate migration.
**/
bagThresholds: Vec<u64> & AugmentedConst<ApiType>;
/**
* Maximum number of accounts that may be re-bagged automatically in `on_idle`.
*
* A value of `0` (obtained by configuring `type MaxAutoRebagPerBlock = ();`) disables
* the feature.
**/
maxAutoRebagPerBlock: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
xcmPallet: {
/**
* The latest supported version that we advertise. Generally just set it to
* `pallet_xcm::CurrentXcmVersion`.
**/
advertisedXcmVersion: u32 & AugmentedConst<ApiType>;
/**
* The maximum number of local XCM locks that a single account may have.
**/
maxLockers: u32 & AugmentedConst<ApiType>;
/**
* The maximum number of consumers a single remote lock may have.
**/
maxRemoteLockConsumers: u32 & AugmentedConst<ApiType>;
/**
* This chain's Universal Location.
**/
universalLocation: StagingXcmV5Junctions & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
} // AugmentedConsts
} // declare module
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+11
View File
@@ -0,0 +1,11 @@
// Copyright 2017-2025 @pezkuwi/api-augment authors & contributors
// SPDX-License-Identifier: Apache-2.0
import '../base.js';
import './consts.js';
import './errors.js';
import './events.js';
import './query.js';
import './registry.js';
import './runtime.js';
import './tx.js';
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,5 @@
// Copyright 2017-2025 @pezkuwi/api-augment authors & contributors
// SPDX-License-Identifier: Apache-2.0
import '@pezkuwi/types-augment/registry/bizinikiwi';
import '@pezkuwi/types-augment/registry/pezkuwi';
+621
View File
@@ -0,0 +1,621 @@
// Auto-generated via `yarn polkadot-types-from-chain`, do not edit
/* eslint-disable */
// import type lookup before we augment - in some environments
// this is required to allow for ambient/previous definitions
import '@pezkuwi/api-base/types/calls';
import type { ApiTypes, AugmentedCall, DecoratedCallBase } from '@pezkuwi/api-base/types';
import type { BTreeMap, BitVec, Bytes, Null, Option, Result, Text, Vec, bool, u128, u32, u64 } from '@pezkuwi/types-codec';
import type { AnyNumber, IMethod, ITuple } from '@pezkuwi/types-codec/types';
import type { OpaqueKeyOwnershipProof } from '@pezkuwi/types/interfaces/babe';
import type { Extrinsic } from '@pezkuwi/types/interfaces/extrinsics';
import type { OpaqueMetadata } from '@pezkuwi/types/interfaces/metadata';
import type { AccountId32, H256, RuntimeCall, Slot } from '@pezkuwi/types/interfaces/runtime';
import type { ParaId, ValidationCodeHash } from '@pezkuwi/types/interfaces/teyrchains';
import type { PezframeSupportViewFunctionsViewFunctionDispatchError, PezframeSupportViewFunctionsViewFunctionId, PezkuwiCorePrimitivesInboundDownwardMessage, PezkuwiCorePrimitivesInboundHrmpMessage, PezkuwiPrimitivesV8ApprovalVotingParams, PezkuwiPrimitivesV8AsyncBackingAsyncBackingParams, PezkuwiPrimitivesV8CandidateCommitments, PezkuwiPrimitivesV8DisputeState, PezkuwiPrimitivesV8ExecutorParams, PezkuwiPrimitivesV8GroupRotationInfo, PezkuwiPrimitivesV8OccupiedCoreAssumption, PezkuwiPrimitivesV8PersistedValidationData, PezkuwiPrimitivesV8PvfCheckStatement, PezkuwiPrimitivesV8SessionInfo, PezkuwiPrimitivesV8SlashingDisputeProof, PezkuwiPrimitivesV8SlashingPendingSlashes, PezkuwiPrimitivesV8ValidatorAppPublic, PezkuwiPrimitivesV8ValidatorAppSignature, PezkuwiPrimitivesVstagingAsyncBackingBackingState, PezkuwiPrimitivesVstagingAsyncBackingConstraints, PezkuwiPrimitivesVstagingCandidateEvent, PezkuwiPrimitivesVstagingCommittedCandidateReceiptV2, PezkuwiPrimitivesVstagingCoreState, PezkuwiPrimitivesVstagingScrapedOnChainVotes, PezkuwiRuntimeOriginCaller, PezpalletTransactionPaymentFeeDetails, PezpalletTransactionPaymentRuntimeDispatchInfo, PezspAuthorityDiscoveryAppPublic, PezspConsensusBabeAppPublic, PezspConsensusBabeBabeConfiguration, PezspConsensusBabeEpoch, PezspConsensusBeefyDoubleVotingProof, PezspConsensusBeefyEcdsaCryptoPublic, PezspConsensusBeefyForkVotingProofOpaqueValue, PezspConsensusBeefyFutureBlockVotingProof, PezspConsensusBeefyMmrBeefyAuthoritySet, PezspConsensusBeefyValidatorSet, PezspConsensusGrandpaAppPublic, PezspConsensusGrandpaEquivocationProof, PezspConsensusSlotsEquivocationProof, PezspCoreCryptoKeyTypeId, PezspInherentsCheckInherentsResult, PezspInherentsInherentData, PezspMmrPrimitivesError, PezspMmrPrimitivesLeafProof, PezspRuntimeBlock, PezspRuntimeDispatchError, PezspRuntimeExtrinsicInclusionMode, PezspRuntimeHeader, PezspRuntimeTransactionValidityTransactionSource, PezspRuntimeTransactionValidityTransactionValidityError, PezspRuntimeTransactionValidityValidTransaction, PezspVersionRuntimeVersion, PezspWeightsWeightV2Weight, RelayCommonApisInflationInfo, XcmRuntimeApisConversionsError, XcmRuntimeApisDryRunCallDryRunEffects, XcmRuntimeApisDryRunError, XcmRuntimeApisDryRunXcmDryRunEffects, XcmRuntimeApisFeesError, XcmVersionedAssetId, XcmVersionedAssets, XcmVersionedLocation, XcmVersionedXcm } from '@pezkuwi/types/lookup';
import type { IExtrinsic, Observable } from '@pezkuwi/types/types';
export type __AugmentedCall<ApiType extends ApiTypes> = AugmentedCall<ApiType>;
export type __DecoratedCallBase<ApiType extends ApiTypes> = DecoratedCallBase<ApiType>;
declare module '@pezkuwi/api-base/types/calls' {
interface AugmentedCalls<ApiType extends ApiTypes> {
/** 0xbc9d89904f5b923f/ */
accountNonceApi: {
/**
* Get current account nonce of given `AccountId`.
**/
accountNonce: AugmentedCall<ApiType, (account: AccountId32 | string | Uint8Array) => Observable<u32>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x687ad44ad37f03c2/ */
authorityDiscoveryApi: {
/**
* Retrieve authority identifiers of the current and next authority set.
**/
authorities: AugmentedCall<ApiType, () => Observable<Vec<PezspAuthorityDiscoveryAppPublic>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0xcbca25e39f142387/ */
babeApi: {
/**
* Return the configuration for BABE.
**/
configuration: AugmentedCall<ApiType, () => Observable<PezspConsensusBabeBabeConfiguration>>;
/**
* Returns information regarding the current epoch.
**/
currentEpoch: AugmentedCall<ApiType, () => Observable<PezspConsensusBabeEpoch>>;
/**
* Returns the slot that started the current epoch.
**/
currentEpochStart: AugmentedCall<ApiType, () => Observable<Slot>>;
/**
* 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.
**/
generateKeyOwnershipProof: AugmentedCall<ApiType, (slot: Slot | AnyNumber | Uint8Array, authority_id: PezspConsensusBabeAppPublic) => Observable<Option<Bytes>>>;
/**
* Returns information regarding the next epoch (which was already, previously announced).
**/
nextEpoch: AugmentedCall<ApiType, () => Observable<PezspConsensusBabeEpoch>>;
/**
* 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.
**/
submitReportEquivocationUnsignedExtrinsic: AugmentedCall<ApiType, (equivocation_proof: PezspConsensusSlotsEquivocationProof, key_owner_proof: OpaqueKeyOwnershipProof | string | Uint8Array) => Observable<Option<Null>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x49eaaf1b548a0cb0/ */
beefyApi: {
/**
* Return the block number where BEEFY consensus is enabled/started
**/
beefyGenesis: AugmentedCall<ApiType, () => Observable<Option<u32>>>;
/**
* Generates a proof that the `prev_block_number` is part of the canonical chain at, `best_known_block_number`.
**/
generateAncestryProof: AugmentedCall<ApiType, (prev_block_number: u32 | AnyNumber | Uint8Array, best_known_block_number: Option<u32> | null | Uint8Array | u32 | AnyNumber) => Observable<Option<Bytes>>>;
/**
* 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.
**/
generateKeyOwnershipProof: AugmentedCall<ApiType, (set_id: u64 | AnyNumber | Uint8Array, authority_id: PezspConsensusBeefyEcdsaCryptoPublic) => Observable<Option<Bytes>>>;
/**
* 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.
**/
submitReportDoubleVotingUnsignedExtrinsic: AugmentedCall<ApiType, (equivocation_proof: PezspConsensusBeefyDoubleVotingProof, key_owner_proof: Bytes | string | Uint8Array) => Observable<Option<Null>>>;
/**
* 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.
**/
submitReportForkVotingUnsignedExtrinsic: AugmentedCall<ApiType, (equivocation_proof: PezspConsensusBeefyForkVotingProofOpaqueValue, key_owner_proof: Bytes | string | Uint8Array) => Observable<Option<Null>>>;
/**
* 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.
**/
submitReportFutureBlockVotingUnsignedExtrinsic: AugmentedCall<ApiType, (equivocation_proof: PezspConsensusBeefyFutureBlockVotingProof, key_owner_proof: Bytes | string | Uint8Array) => Observable<Option<Null>>>;
/**
* Return the current active BEEFY validator set
**/
validatorSet: AugmentedCall<ApiType, () => Observable<Option<PezspConsensusBeefyValidatorSet>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x2a5e924655399e60/ */
beefyMmrApi: {
/**
* Return the currently active BEEFY authority set proof.
**/
authoritySetProof: AugmentedCall<ApiType, () => Observable<PezspConsensusBeefyMmrBeefyAuthoritySet>>;
/**
* Return the next/queued BEEFY authority set proof.
**/
nextAuthoritySetProof: AugmentedCall<ApiType, () => Observable<PezspConsensusBeefyMmrBeefyAuthoritySet>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x40fe3ad401f8959a/ */
blockBuilder: {
/**
* Apply the given extrinsic.,, Returns an inclusion outcome which specifies if this extrinsic is included in, this block or not.
**/
applyExtrinsic: AugmentedCall<ApiType, (extrinsic: Extrinsic | IExtrinsic | string | Uint8Array) => Observable<Result<Result<Null, PezspRuntimeDispatchError>, PezspRuntimeTransactionValidityTransactionValidityError>>>;
/**
* Check that the inherents are valid. The inherent data will vary from chain to chain.
**/
checkInherents: AugmentedCall<ApiType, (block: PezspRuntimeBlock, data: PezspInherentsInherentData) => Observable<PezspInherentsCheckInherentsResult>>;
/**
* Finish the current block.
**/
finalizeBlock: AugmentedCall<ApiType, () => Observable<PezspRuntimeHeader>>;
/**
* Generate inherent extrinsics. The inherent data will vary from chain to chain.
**/
inherentExtrinsics: AugmentedCall<ApiType, (inherent: PezspInherentsInherentData) => Observable<Vec<Bytes>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0xdf6acb689907609b/ */
core: {
/**
* Execute the given block.
**/
executeBlock: AugmentedCall<ApiType, (block: PezspRuntimeBlock) => Observable<Null>>;
/**
* Initialize a block with the given header and return the runtime executive mode.
**/
initializeBlock: AugmentedCall<ApiType, (header: PezspRuntimeHeader) => Observable<PezspRuntimeExtrinsicInclusionMode>>;
/**
* Returns the version of the runtime.
**/
version: AugmentedCall<ApiType, () => Observable<PezspVersionRuntimeVersion>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x91b1c8b16328eb92/ */
dryRunApi: {
/**
* Dry run call V2.
**/
dryRunCall: AugmentedCall<ApiType, (origin: PezkuwiRuntimeOriginCaller, call: RuntimeCall | IMethod | string | Uint8Array, result_xcms_version: u32 | AnyNumber | Uint8Array) => Observable<Result<XcmRuntimeApisDryRunCallDryRunEffects, XcmRuntimeApisDryRunError>>>;
/**
* Dry run XCM program
**/
dryRunXcm: AugmentedCall<ApiType, (origin_location: XcmVersionedLocation | { V3: any } | { V4: any } | { V5: any } | string | Uint8Array, xcm: XcmVersionedXcm | { V3: any } | { V4: any } | { V5: any } | string | Uint8Array) => Observable<Result<XcmRuntimeApisDryRunXcmDryRunEffects, XcmRuntimeApisDryRunError>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 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.
**/
buildState: AugmentedCall<ApiType, (json: Bytes | string | Uint8Array) => Observable<Result<Null, Text>>>;
/**
* 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<u8>` 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.
**/
getPreset: AugmentedCall<ApiType, (id: Option<Text> | null | Uint8Array | Text | string) => Observable<Option<Bytes>>>;
/**
* 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.
**/
presetNames: AugmentedCall<ApiType, () => Observable<Vec<Text>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0xed99c5acb25eedf5/ */
grandpaApi: {
/**
* Get current GRANDPA authority set id.
**/
currentSetId: AugmentedCall<ApiType, () => Observable<u64>>;
/**
* 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.
**/
generateKeyOwnershipProof: AugmentedCall<ApiType, (set_id: u64 | AnyNumber | Uint8Array, authority_id: PezspConsensusGrandpaAppPublic) => Observable<Option<Bytes>>>;
/**
* 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.
**/
grandpaAuthorities: AugmentedCall<ApiType, () => Observable<Vec<ITuple<[PezspConsensusGrandpaAppPublic, u64]>>>>;
/**
* 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.
**/
submitReportEquivocationUnsignedExtrinsic: AugmentedCall<ApiType, (equivocation_proof: PezspConsensusGrandpaEquivocationProof, key_owner_proof: Bytes | string | Uint8Array) => Observable<Option<Null>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0xc51ff1fa3f5d0cca/ */
inflation: {
/**
* Return the current estimates of the inflation amount.,, This is marked as experimental in light of RFC#89. Nonetheless, its usage is highly, recommended over trying to read-storage, or re-create the onchain logic.
**/
experimentalInflationPredictionInfo: AugmentedCall<ApiType, () => Observable<RelayCommonApisInflationInfo>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x9ffb505aa738d69c/ */
locationToAccountApi: {
/**
* Converts `Location` to `AccountId`.
**/
convertLocation: AugmentedCall<ApiType, (location: XcmVersionedLocation | { V3: any } | { V4: any } | { V5: any } | string | Uint8Array) => Observable<Result<AccountId32, XcmRuntimeApisConversionsError>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x37e397fc7c91f5e4/ */
metadata: {
/**
* Returns the metadata of a runtime.
**/
metadata: AugmentedCall<ApiType, () => Observable<OpaqueMetadata>>;
/**
* 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.
**/
metadataAtVersion: AugmentedCall<ApiType, (version: u32 | AnyNumber | Uint8Array) => Observable<Option<OpaqueMetadata>>>;
/**
* Returns the supported metadata versions.,, This can be used to call `metadata_at_version`.
**/
metadataVersions: AugmentedCall<ApiType, () => Observable<Vec<u32>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x91d5df18b0d2cf58/ */
mmrApi: {
/**
* 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.
**/
generateProof: AugmentedCall<ApiType, (block_numbers: Vec<u32> | (u32 | AnyNumber | Uint8Array)[], best_known_block_number: Option<u32> | null | Uint8Array | u32 | AnyNumber) => Observable<Result<ITuple<[Vec<Bytes>, PezspMmrPrimitivesLeafProof]>, PezspMmrPrimitivesError>>>;
/**
* Return the number of MMR blocks in the chain.
**/
mmrLeafCount: AugmentedCall<ApiType, () => Observable<Result<u64, PezspMmrPrimitivesError>>>;
/**
* Return the on-chain MMR root hash.
**/
mmrRoot: AugmentedCall<ApiType, () => Observable<Result<H256, PezspMmrPrimitivesError>>>;
/**
* 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]
**/
verifyProof: AugmentedCall<ApiType, (leaves: Vec<Bytes> | (Bytes | string | Uint8Array)[], proof: PezspMmrPrimitivesLeafProof) => Observable<Result<Null, PezspMmrPrimitivesError>>>;
/**
* 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]
**/
verifyProofStateless: AugmentedCall<ApiType, (root: H256 | string | Uint8Array, leaves: Vec<Bytes> | (Bytes | string | Uint8Array)[], proof: PezspMmrPrimitivesLeafProof) => Observable<Result<Null, PezspMmrPrimitivesError>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x17a6bc0d0062aeb3/ */
nominationPoolsApi: {
/**
* Returns the equivalent points of `new_funds` for a given pool.
**/
balanceToPoints: AugmentedCall<ApiType, (pool_id: u32 | AnyNumber | Uint8Array, new_funds: u128 | AnyNumber | Uint8Array) => Observable<u128>>;
/**
* 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.
**/
memberNeedsDelegateMigration: AugmentedCall<ApiType, (member: AccountId32 | string | Uint8Array) => Observable<bool>>;
/**
* Returns the pending slash for a given pool member.,, If pending slash of the member exceeds `ExistentialDeposit`, it can be reported on, chain.
**/
memberPendingSlash: AugmentedCall<ApiType, (member: AccountId32 | string | Uint8Array) => Observable<u128>>;
/**
* Returns the total contribution of a pool member including any balance that is unbonding.
**/
memberTotalBalance: AugmentedCall<ApiType, (who: AccountId32 | string | Uint8Array) => Observable<u128>>;
/**
* Returns the pending rewards for the member that the AccountId was given for.
**/
pendingRewards: AugmentedCall<ApiType, (who: AccountId32 | string | Uint8Array) => Observable<u128>>;
/**
* Returns the equivalent balance of `points` for a given pool.
**/
pointsToBalance: AugmentedCall<ApiType, (pool_id: u32 | AnyNumber | Uint8Array, points: u128 | AnyNumber | Uint8Array) => Observable<u128>>;
/**
* Returns the bonded account and reward account associated with the pool_id.
**/
poolAccounts: AugmentedCall<ApiType, (pool_id: u32 | AnyNumber | Uint8Array) => Observable<ITuple<[AccountId32, AccountId32]>>>;
/**
* Total balance contributed to the pool.
**/
poolBalance: AugmentedCall<ApiType, (pool_id: u32 | AnyNumber | Uint8Array) => Observable<u128>>;
/**
* 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.
**/
poolNeedsDelegateMigration: AugmentedCall<ApiType, (pool_id: u32 | AnyNumber | Uint8Array) => Observable<bool>>;
/**
* Returns the pending slash for a given pool.
**/
poolPendingSlash: AugmentedCall<ApiType, (pool_id: u32 | AnyNumber | Uint8Array) => Observable<u128>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0xf78b278be53f454c/ */
offchainWorkerApi: {
/**
* Starts the off-chain task for given block header.
**/
offchainWorker: AugmentedCall<ApiType, (header: PezspRuntimeHeader) => Observable<Null>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0xaf2c0297a23e6d3d/ */
parachainHost: {
/**
* Approval voting configuration parameters
**/
approvalVotingParams: AugmentedCall<ApiType, () => Observable<PezkuwiPrimitivesV8ApprovalVotingParams>>;
/**
* Returns the persisted validation data for the given `ParaId` along with the corresponding, validation code hash. Instead of accepting assumption about the para, matches the validation, data hash against an expected one and yields `None` if they're not equal.
**/
assumedValidationData: AugmentedCall<ApiType, (para_id: ParaId | AnyNumber | Uint8Array, expected_persisted_validation_data_hash: H256 | string | Uint8Array) => Observable<Option<ITuple<[PezkuwiPrimitivesV8PersistedValidationData, H256]>>>>;
/**
* Returns candidate's acceptance limitations for asynchronous backing for a relay parent.
**/
asyncBackingParams: AugmentedCall<ApiType, () => Observable<PezkuwiPrimitivesV8AsyncBackingAsyncBackingParams>>;
/**
* Yields information on all availability cores as relevant to the child block., Cores are either free or occupied. Free cores can have paras assigned to them.
**/
availabilityCores: AugmentedCall<ApiType, () => Observable<Vec<PezkuwiPrimitivesVstagingCoreState>>>;
/**
* Returns the constraints on the actions that can be taken by a new parachain, block.
**/
backingConstraints: AugmentedCall<ApiType, (para_id: ParaId | AnyNumber | Uint8Array) => Observable<Option<PezkuwiPrimitivesVstagingAsyncBackingConstraints>>>;
/**
* Get a vector of events concerning candidates that occurred within a block.
**/
candidateEvents: AugmentedCall<ApiType, () => Observable<Vec<PezkuwiPrimitivesVstagingCandidateEvent>>>;
/**
* Get the receipt of a candidate pending availability. This returns `Some` for any paras, assigned to occupied cores in `availability_cores` and `None` otherwise.
**/
candidatePendingAvailability: AugmentedCall<ApiType, (para_id: ParaId | AnyNumber | Uint8Array) => Observable<Option<PezkuwiPrimitivesVstagingCommittedCandidateReceiptV2>>>;
/**
* Elastic scaling support
**/
candidatesPendingAvailability: AugmentedCall<ApiType, (para_id: ParaId | AnyNumber | Uint8Array) => Observable<Vec<PezkuwiPrimitivesVstagingCommittedCandidateReceiptV2>>>;
/**
* Checks if the given validation outputs pass the acceptance criteria.
**/
checkValidationOutputs: AugmentedCall<ApiType, (para_id: ParaId | AnyNumber | Uint8Array, outputs: PezkuwiPrimitivesV8CandidateCommitments) => Observable<bool>>;
/**
* Claim queue
**/
claimQueue: AugmentedCall<ApiType, () => Observable<BTreeMap<u32, Vec<u32>>>>;
/**
* Returns a list of all disabled validators at the given block.
**/
disabledValidators: AugmentedCall<ApiType, () => Observable<Vec<u32>>>;
/**
* Returns all onchain disputes.
**/
disputes: AugmentedCall<ApiType, () => Observable<Vec<ITuple<[u32, H256, PezkuwiPrimitivesV8DisputeState]>>>>;
/**
* Get all the pending inbound messages in the downward message queue for a para.
**/
dmqContents: AugmentedCall<ApiType, (recipient: ParaId | AnyNumber | Uint8Array) => Observable<Vec<PezkuwiCorePrimitivesInboundDownwardMessage>>>;
/**
* Get the contents of all channels addressed to the given recipient. Channels that have no, messages in them are also included.
**/
inboundHrmpChannelsContents: AugmentedCall<ApiType, (recipient: ParaId | AnyNumber | Uint8Array) => Observable<BTreeMap<u32, Vec<PezkuwiCorePrimitivesInboundHrmpMessage>>>>;
/**
* Returns a merkle proof of a validator session key., NOTE: This function is only available since parachain host version 5.
**/
keyOwnershipProof: AugmentedCall<ApiType, (validator_id: PezkuwiPrimitivesV8ValidatorAppPublic) => Observable<Option<Bytes>>>;
/**
* Get the minimum number of backing votes for a parachain candidate., This is a staging method! Do not use on production runtimes!
**/
minimumBackingVotes: AugmentedCall<ApiType, () => Observable<u32>>;
/**
* Get node features., This is a staging method! Do not use on production runtimes!
**/
nodeFeatures: AugmentedCall<ApiType, () => Observable<BitVec>>;
/**
* Scrape dispute relevant from on-chain, backing votes and resolved disputes.
**/
onChainVotes: AugmentedCall<ApiType, () => Observable<Option<PezkuwiPrimitivesVstagingScrapedOnChainVotes>>>;
/**
* Returns the state of parachain backing for a given para.
**/
paraBackingState: AugmentedCall<ApiType, (__runtime_api_generated_name_0__: ParaId | AnyNumber | Uint8Array) => Observable<Option<PezkuwiPrimitivesVstagingAsyncBackingBackingState>>>;
/**
* Yields the persisted validation data for the given `ParaId` along with an assumption that, should be used if the para currently occupies a core.,, Returns `None` if either the para is not registered or the assumption is `Freed`, and the para already occupies a core.
**/
persistedValidationData: AugmentedCall<ApiType, (para_id: ParaId | AnyNumber | Uint8Array, assumption: PezkuwiPrimitivesV8OccupiedCoreAssumption) => Observable<Option<PezkuwiPrimitivesV8PersistedValidationData>>>;
/**
* Returns code hashes of PVFs that require pre-checking by validators in the active set.,, NOTE: This function is only available since parachain host version 2.
**/
pvfsRequirePrecheck: AugmentedCall<ApiType, () => Observable<Vec<H256>>>;
/**
* Retrieve the scheduling lookahead
**/
schedulingLookahead: AugmentedCall<ApiType, () => Observable<u32>>;
/**
* Returns execution parameters for the session.
**/
sessionExecutorParams: AugmentedCall<ApiType, (session_index: u32 | AnyNumber | Uint8Array) => Observable<Option<PezkuwiPrimitivesV8ExecutorParams>>>;
/**
* Returns the session index expected at a child of the block.,, This can be used to instantiate a `SigningContext`.
**/
sessionIndexForChild: AugmentedCall<ApiType, () => Observable<u32>>;
/**
* Get the session info for the given session, if stored.,, NOTE: This function is only available since parachain host version 2.
**/
sessionInfo: AugmentedCall<ApiType, (index: u32 | AnyNumber | Uint8Array) => Observable<Option<PezkuwiPrimitivesV8SessionInfo>>>;
/**
* Submits a PVF pre-checking statement into the transaction pool.,, NOTE: This function is only available since parachain host version 2.
**/
submitPvfCheckStatement: AugmentedCall<ApiType, (stmt: PezkuwiPrimitivesV8PvfCheckStatement, signature: PezkuwiPrimitivesV8ValidatorAppSignature) => Observable<Null>>;
/**
* Submit an unsigned extrinsic to slash validators who lost a dispute about, a candidate of a past session., NOTE: This function is only available since parachain host version 5.
**/
submitReportDisputeLost: AugmentedCall<ApiType, (dispute_proof: PezkuwiPrimitivesV8SlashingDisputeProof, key_ownership_proof: OpaqueKeyOwnershipProof | string | Uint8Array) => Observable<Option<Null>>>;
/**
* Returns a list of validators that lost a past session dispute and need to be slashed., NOTE: This function is only available since parachain host version 5.
**/
unappliedSlashes: AugmentedCall<ApiType, () => Observable<Vec<ITuple<[u32, H256, PezkuwiPrimitivesV8SlashingPendingSlashes]>>>>;
/**
* Fetch the validation code used by a para, making the given `OccupiedCoreAssumption`.,, Returns `None` if either the para is not registered or the assumption is `Freed`, and the para already occupies a core.
**/
validationCode: AugmentedCall<ApiType, (para_id: ParaId | AnyNumber | Uint8Array, assumption: PezkuwiPrimitivesV8OccupiedCoreAssumption) => Observable<Option<Bytes>>>;
/**
* Retrieve the maximum uncompressed code size.
**/
validationCodeBombLimit: AugmentedCall<ApiType, () => Observable<u32>>;
/**
* Get the validation code from its hash.
**/
validationCodeByHash: AugmentedCall<ApiType, (hash: ValidationCodeHash | string | Uint8Array) => Observable<Option<Bytes>>>;
/**
* Fetch the hash of the validation code used by a para, making the given `OccupiedCoreAssumption`.,, NOTE: This function is only available since parachain host version 2.
**/
validationCodeHash: AugmentedCall<ApiType, (para_id: ParaId | AnyNumber | Uint8Array, assumption: PezkuwiPrimitivesV8OccupiedCoreAssumption) => Observable<Option<H256>>>;
/**
* Returns the validator groups and rotation info localized based on the hypothetical child, of a block whose state this is invoked on. Note that `now` in the `GroupRotationInfo`, should be the successor of the number of the block.
**/
validatorGroups: AugmentedCall<ApiType, () => Observable<ITuple<[Vec<Vec<u32>>, PezkuwiPrimitivesV8GroupRotationInfo]>>>;
/**
* Get the current validators.
**/
validators: AugmentedCall<ApiType, () => Observable<Vec<PezkuwiPrimitivesV8ValidatorAppPublic>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0xccd9de6396c899ca/ */
runtimeViewFunction: {
/**
* Execute a view function query.
**/
executeViewFunction: AugmentedCall<ApiType, (query_id: PezframeSupportViewFunctionsViewFunctionId, input: Bytes | string | Uint8Array) => Observable<Result<Bytes, PezframeSupportViewFunctionsViewFunctionDispatchError>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0xab3c0572291feb8b/ */
sessionKeys: {
/**
* Decode the given public session keys.,, Returns the list of public raw public keys + key type.
**/
decodeSessionKeys: AugmentedCall<ApiType, (encoded: Bytes | string | Uint8Array) => Observable<Option<Vec<ITuple<[Bytes, PezspCoreCryptoKeyTypeId]>>>>>;
/**
* 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.
**/
generateSessionKeys: AugmentedCall<ApiType, (seed: Option<Bytes> | null | Uint8Array | Bytes | string) => Observable<Bytes>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x18ef58a3b67ba770/ */
stakingApi: {
/**
* Returns the page count of exposures for a validator `account` in a given era.
**/
erasStakersPageCount: AugmentedCall<ApiType, (era: u32 | AnyNumber | Uint8Array, account: AccountId32 | string | Uint8Array) => Observable<u32>>;
/**
* Returns the nominations quota for a nominator with a given balance.
**/
nominationsQuota: AugmentedCall<ApiType, (balance: u128 | AnyNumber | Uint8Array) => Observable<u32>>;
/**
* Returns true if validator `account` has pages to be claimed for the given era.
**/
pendingRewards: AugmentedCall<ApiType, (era: u32 | AnyNumber | Uint8Array, account: AccountId32 | string | Uint8Array) => Observable<bool>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 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.
**/
validateTransaction: AugmentedCall<ApiType, (source: PezspRuntimeTransactionValidityTransactionSource, tx: Extrinsic | IExtrinsic | string | Uint8Array, block_hash: H256 | string | Uint8Array) => Observable<Result<PezspRuntimeTransactionValidityValidTransaction, PezspRuntimeTransactionValidityTransactionValidityError>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x37c8bb1350a9a2a8/ */
transactionPaymentApi: {
/**
*
**/
queryFeeDetails: AugmentedCall<ApiType, (uxt: Extrinsic | IExtrinsic | string | Uint8Array, len: u32 | AnyNumber | Uint8Array) => Observable<PezpalletTransactionPaymentFeeDetails>>;
/**
*
**/
queryInfo: AugmentedCall<ApiType, (uxt: Extrinsic | IExtrinsic | string | Uint8Array, len: u32 | AnyNumber | Uint8Array) => Observable<PezpalletTransactionPaymentRuntimeDispatchInfo>>;
/**
*
**/
queryLengthToFee: AugmentedCall<ApiType, (length: u32 | AnyNumber | Uint8Array) => Observable<u128>>;
/**
*
**/
queryWeightToFee: AugmentedCall<ApiType, (weight: PezspWeightsWeightV2Weight) => Observable<u128>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0xf3ff14d5ab527059/ */
transactionPaymentCallApi: {
/**
* Query fee details of a given encoded `Call`.
**/
queryCallFeeDetails: AugmentedCall<ApiType, (call: RuntimeCall | IMethod | string | Uint8Array, len: u32 | AnyNumber | Uint8Array) => Observable<PezpalletTransactionPaymentFeeDetails>>;
/**
* Query information of a dispatch class, weight, and fee of a given encoded `Call`.
**/
queryCallInfo: AugmentedCall<ApiType, (call: RuntimeCall | IMethod | string | Uint8Array, len: u32 | AnyNumber | Uint8Array) => Observable<PezpalletTransactionPaymentRuntimeDispatchInfo>>;
/**
* Query the output of the current `LengthToFee` given some input.
**/
queryLengthToFee: AugmentedCall<ApiType, (length: u32 | AnyNumber | Uint8Array) => Observable<u128>>;
/**
* Query the output of the current `WeightToFee` given some input.
**/
queryWeightToFee: AugmentedCall<ApiType, (weight: PezspWeightsWeightV2Weight) => Observable<u128>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x6ff52ee858e6c5bd/ */
xcmPaymentApi: {
/**
* Returns a list of acceptable payment assets.,, # Arguments,, * `xcm_version`: Version.
**/
queryAcceptablePaymentAssets: AugmentedCall<ApiType, (xcm_version: u32 | AnyNumber | Uint8Array) => Observable<Result<Vec<XcmVersionedAssetId>, XcmRuntimeApisFeesError>>>;
/**
* Get delivery fees for sending a specific `message` to a `destination`., These always come in a specific asset, defined by the chain.,, # Arguments, * `message`: The message that'll be sent, necessary because most delivery fees are based on the, size of the message., * `destination`: The destination to send the message to. Different destinations may use, different senders that charge different fees.
**/
queryDeliveryFees: AugmentedCall<ApiType, (destination: XcmVersionedLocation | { V3: any } | { V4: any } | { V5: any } | string | Uint8Array, message: XcmVersionedXcm | { V3: any } | { V4: any } | { V5: any } | string | Uint8Array) => Observable<Result<XcmVersionedAssets, XcmRuntimeApisFeesError>>>;
/**
* Converts a weight into a fee for the specified `AssetId`.,, # Arguments,, * `weight`: convertible `Weight`., * `asset`: `VersionedAssetId`.
**/
queryWeightToAssetFee: AugmentedCall<ApiType, (weight: PezspWeightsWeightV2Weight, asset: XcmVersionedAssetId | { V3: any } | { V4: any } | { V5: any } | string | Uint8Array) => Observable<Result<u128, XcmRuntimeApisFeesError>>>;
/**
* Returns a weight needed to execute a XCM.,, # Arguments,, * `message`: `VersionedXcm`.
**/
queryXcmWeight: AugmentedCall<ApiType, (message: XcmVersionedXcm | { V3: any } | { V4: any } | { V5: any } | string | Uint8Array) => Observable<Result<PezspWeightsWeightV2Weight, XcmRuntimeApisFeesError>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
} // AugmentedCalls
} // declare module
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,22 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"baseUrl": "..",
"outDir": "./build",
"rootDir": "./src"
},
"include": [
"**/base.ts",
"**/assetHubZagros/*.ts"
],
"exclude": [
"**/assetHubZagros/*.spec.ts"
],
"references": [
{ "path": "../api-base/tsconfig.build.json" },
{ "path": "../rpc-augment/tsconfig.build.json" },
{ "path": "../types/tsconfig.build.json" },
{ "path": "../types-codec/tsconfig.build.json" },
{ "path": "../types-augment/tsconfig.build.json" }
]
}
@@ -0,0 +1,22 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"baseUrl": "..",
"outDir": "./build",
"rootDir": "./src"
},
"include": [
"**/base.ts",
"**/assetHubZagros/*.ts"
],
"exclude": [
"**/assetHubZagros/*.spec.ts"
],
"references": [
{ "path": "../api-base/tsconfig.build.json" },
{ "path": "../rpc-augment/tsconfig.build.json" },
{ "path": "../types/tsconfig.build.json" },
{ "path": "../types-codec/tsconfig.build.json" },
{ "path": "../types-augment/tsconfig.build.json" }
]
}
+25
View File
@@ -0,0 +1,25 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"baseUrl": "..",
"outDir": "./build",
"rootDir": "./src"
},
"exclude": [
"**/*.spec.ts",
"**/mod.ts",
"**/assetHubZagros/*.ts",
"**/assetHubPezkuwi/*.ts",
"**/assetHubDicle/*.ts",
"**/zagros/*.ts",
"**/pezkuwi/*.ts",
"**/dicle/*.ts"
],
"references": [
{ "path": "../api-base/tsconfig.build.json" },
{ "path": "../rpc-augment/tsconfig.build.json" },
{ "path": "../types/tsconfig.build.json" },
{ "path": "../types-codec/tsconfig.build.json" },
{ "path": "../types-augment/tsconfig.build.json" }
]
}
@@ -0,0 +1,22 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"baseUrl": "..",
"outDir": "./build",
"rootDir": "./src"
},
"include": [
"**/base.ts",
"**/pezkuwi/*.ts"
],
"exclude": [
"**/pezkuwi/*.spec.ts"
],
"references": [
{ "path": "../api-base/tsconfig.build.json" },
{ "path": "../rpc-augment/tsconfig.build.json" },
{ "path": "../types/tsconfig.build.json" },
{ "path": "../types-codec/tsconfig.build.json" },
{ "path": "../types-augment/tsconfig.build.json" }
]
}
+22
View File
@@ -0,0 +1,22 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"baseUrl": "..",
"outDir": "./build",
"rootDir": "./src"
},
"include": [
"**/base.ts",
"**/zagros/*.ts"
],
"exclude": [
"**/zagros/*.spec.ts"
],
"references": [
{ "path": "../api-base/tsconfig.build.json" },
{ "path": "../rpc-augment/tsconfig.build.json" },
{ "path": "../types/tsconfig.build.json" },
{ "path": "../types-codec/tsconfig.build.json" },
{ "path": "../types-augment/tsconfig.build.json" }
]
}
+3
View File
@@ -0,0 +1,3 @@
# @pezkuwi/api-base
API Base interfaces
+30
View File
@@ -0,0 +1,30 @@
{
"author": "Jaco Greeff <jacogr@gmail.com>",
"bugs": "https://github.com/pezkuwichain/pezkuwi-api/issues",
"description": "Interfaces for interacting with contracts and contract ABIs",
"engines": {
"node": ">=18"
},
"homepage": "https://github.com/pezkuwichain/pezkuwi-api/tree/master/packages/api-base#readme",
"license": "Apache-2.0",
"name": "@pezkuwi/api-base",
"repository": {
"directory": "packages/api-base",
"type": "git",
"url": "https://github.com/pezkuwichain/pezkuwi-api.git"
},
"sideEffects": [
"./packageDetect.js",
"./packageDetect.cjs"
],
"type": "module",
"version": "16.5.6",
"main": "index.js",
"dependencies": {
"@pezkuwi/rpc-core": "16.5.4",
"@pezkuwi/types": "16.5.4",
"@pezkuwi/util": "^14.0.1",
"rxjs": "^7.8.1",
"tslib": "^2.8.1"
}
}
+4
View File
@@ -0,0 +1,4 @@
// Copyright 2017-2025 @pezkuwi/api-base authors & contributors
// SPDX-License-Identifier: Apache-2.0
export { packageInfo } from './packageInfo.js';
+6
View File
@@ -0,0 +1,6 @@
// Copyright 2017-2025 @pezkuwi/api-base authors & contributors
// SPDX-License-Identifier: Apache-2.0
import './packageDetect.js';
export * from './bundle.js';
+4
View File
@@ -0,0 +1,4 @@
// Copyright 2017-2025 @pezkuwi/api-base authors & contributors
// SPDX-License-Identifier: Apache-2.0
export * from './index.js';
+13
View File
@@ -0,0 +1,13 @@
// Copyright 2017-2026 @pezkuwi/api-base authors & contributors
// SPDX-License-Identifier: Apache-2.0
// Do not edit, auto-generated by @pezkuwi/dev
// (packageInfo imports will be kept as-is, user-editable)
import { packageInfo as rpcInfo } from '@pezkuwi/rpc-core/packageInfo';
import { packageInfo as typesInfo } from '@pezkuwi/types/packageInfo';
import { detectPackage } from '@pezkuwi/util';
import { packageInfo } from './packageInfo.js';
detectPackage(packageInfo, null, [rpcInfo, typesInfo]);
+6
View File
@@ -0,0 +1,6 @@
// Copyright 2017-2026 @pezkuwi/api-base authors & contributors
// SPDX-License-Identifier: Apache-2.0
// Do not edit, auto-generated by @pezkuwi/dev
export const packageInfo = { name: '@pezkuwi/api-base', path: 'auto', type: 'auto', version: '16.5.4' };
+29
View File
@@ -0,0 +1,29 @@
// Copyright 2017-2025 @pezkuwi/api-base authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Observable } from 'rxjs';
import type { DecoratedRpc, QueryableCalls, QueryableConsts, QueryableStorage, QueryableStorageMulti, SubmittableExtrinsics } from '@pezkuwi/api-base/types';
import type { RpcInterface } from '@pezkuwi/rpc-core/types';
import type { Metadata } from '@pezkuwi/types';
import type { Hash, RuntimeVersion } from '@pezkuwi/types/interfaces';
import type { Registry, Signer } from '@pezkuwi/types/types';
// A smaller interface of ApiRx, used in derive and in SubmittableExtrinsic
export interface ApiInterfaceRx {
call: QueryableCalls<'rxjs'>;
consts: QueryableConsts<'rxjs'>;
extrinsicType: number;
genesisHash?: Hash | undefined;
hasSubscriptions: boolean;
registry: Registry;
runtimeMetadata: Metadata;
runtimeVersion: RuntimeVersion;
query: QueryableStorage<'rxjs'>;
queryMulti: QueryableStorageMulti<'rxjs'>;
rpc: DecoratedRpc<'rxjs', RpcInterface>;
tx: SubmittableExtrinsics<'rxjs'>;
signer?: Signer | undefined;
callAt: (blockHash: Uint8Array | string, knownVersion?: RuntimeVersion) => Observable<QueryableCalls<'rxjs'>>;
queryAt: (blockHash: Uint8Array | string, knownVersion?: RuntimeVersion) => Observable<QueryableStorage<'rxjs'>>;
}
+78
View File
@@ -0,0 +1,78 @@
// Copyright 2017-2025 @pezkuwi/api-base authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Observable } from 'rxjs';
import type { AnyFunction, Callback, Codec } from '@pezkuwi/types/types';
export type Push<T extends readonly unknown[], V> = [...T, V]
export type DropLast<T extends readonly unknown[]> = T extends readonly [...infer U, any?] ? U : [...T];
export type ApiTypes = 'promise' | 'rxjs';
// Returns the inner type of an Observable
export type ObsInnerType<O extends Observable<any>> = O extends Observable<infer U> ? U : never;
export type VoidFn = () => void;
export type UnsubscribePromise = Promise<VoidFn>;
export type PromiseOrObs<ApiType extends ApiTypes, T> =
ApiType extends 'rxjs'
? Observable<T>
: Promise<T>;
export type MethodResult<ApiType extends ApiTypes, F extends AnyFunction> =
ApiType extends 'rxjs'
? RxResult<F>
: PromiseResult<F>;
// Here are the return types of these parts of the api:
// - api.query.*.*: no exact typings
// - api.tx.*.*: SubmittableExtrinsic<ApiType extends ApiTypes>
// - api.derive.*.*: MethodResult<ApiType, F>
// - api.rpc.*.*: no exact typings (for now, FIXME: should be MethodResult<ApiType, F>, like in derive)
// These are the types that don't lose type information (used for api.derive.*)
// Also use these for api.rpc.* https://github.com/pezkuwichain/pezkuwi-api/issues/1009
export interface RxResult<F extends AnyFunction> {
(...args: Parameters<F>): Observable<ObsInnerType<ReturnType<F>>>;
<T>(...args: Parameters<F>): Observable<T>;
}
export interface PromiseResult<F extends AnyFunction> {
(...args: Parameters<F>): Promise<ObsInnerType<ReturnType<F>>>;
(...args: Push<Parameters<F>, Callback<ObsInnerType<ReturnType<F>>>>): UnsubscribePromise;
<T extends Codec | Codec[]>(...args: Parameters<F>): Promise<T>;
<T extends Codec | Codec[]>(...args: Push<Parameters<F>, Callback<T>>): UnsubscribePromise;
}
// In the abstract `decorateMethod` in Base.ts, we can also pass in some meta-
// information. This describes it.
export interface DecorateMethodOptions {
methodName?: string;
overrideNoSub?: (...args: unknown[]) => Observable<Codec>;
}
export type DecorateFn <T extends Codec> = (...args: any[]) => Observable<T>;
export interface PaginationOptions<A = unknown> {
args: A[];
pageSize: number;
startKey?: string;
}
export type DecorateMethod<_ApiType extends ApiTypes, T = any> =
<M extends (...args: any[]) => Observable<any>>(method: M, options?: DecorateMethodOptions) => T;
type AsCodec<R> = R extends Codec
? R
: Codec;
export type ReturnCodec<F extends AnyFunction> = AsCodec<ObsInnerType<ReturnType<F>>>;
// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface EmptyBase<_> {
// this is use to allow use to have unused vars in augmented interfaces,
// so intentionally left empty
}
+31
View File
@@ -0,0 +1,31 @@
// Copyright 2017-2025 @pezkuwi/api-base authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Observable } from 'rxjs';
import type { AnyFunction, Codec, DefinitionCallNamed } from '@pezkuwi/types/types';
import type { ApiTypes, EmptyBase, ReturnCodec } from './base.js';
export type DecoratedCallBase<ApiType extends ApiTypes, F extends AnyFunction = (...args: any[]) => Observable<Codec>> =
ApiType extends 'rxjs'
? <T = ReturnCodec<F>> (...args: Parameters<F>) => Observable<T>
: <T = ReturnCodec<F>> (...args: Parameters<F>) => Promise<T>;
export type AugmentedCall<ApiType extends ApiTypes, F extends AnyFunction = (...args: any[]) => Observable<Codec>> = DecoratedCallBase<ApiType, F> & {
/** The metadata/description/definition for this method */
meta: DefinitionCallNamed
};
// augmented interfaces
// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface AugmentedCalls<ApiType extends ApiTypes> extends EmptyBase<ApiType> {
// augmented
}
// eslint-disable-next-line @typescript-eslint/consistent-indexed-object-style
export interface QueryableCalls<ApiType extends ApiTypes> extends AugmentedCalls<ApiType> {
// when non-augmented, we need to at least have Codec results
[key: string]: QueryableModuleCalls<ApiType>;
}
export type QueryableModuleCalls<ApiType extends ApiTypes> = Record<string, DecoratedCallBase<ApiType>>;
+25
View File
@@ -0,0 +1,25 @@
// Copyright 2017-2025 @pezkuwi/api-base authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { PezpalletConstantMetadataLatest } from '@pezkuwi/types/interfaces';
import type { Codec } from '@pezkuwi/types/types';
import type { ApiTypes, EmptyBase } from './base.js';
export interface AugmentedConst<_ extends ApiTypes> {
meta: PezpalletConstantMetadataLatest;
}
// augmented interfaces
// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface AugmentedConsts<ApiType extends ApiTypes> extends EmptyBase<ApiType> {
// augmented
}
// eslint-disable-next-line @typescript-eslint/consistent-indexed-object-style
export interface QueryableConsts<ApiType extends ApiTypes> extends AugmentedConsts<ApiType> {
// when non-augmented, we need to at least have Codec results
[key: string]: QueryableModuleConsts;
}
export type QueryableModuleConsts = Record<string, Codec>;
+8
View File
@@ -0,0 +1,8 @@
// Copyright 2017-2025 @pezkuwi/api-base authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Observable } from 'rxjs';
type DeriveCreator = (instanceId: string, api: unknown) => (...args: unknown[]) => Observable<any>;
export type DeriveCustom = Record<string, Record<string, DeriveCreator>>;
+22
View File
@@ -0,0 +1,22 @@
// Copyright 2017-2025 @pezkuwi/api-base authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { IsError } from '@pezkuwi/types/metadata/decorate/types';
import type { ApiTypes, EmptyBase } from './base.js';
export type AugmentedError<_ extends ApiTypes> = IsError;
// augmented interfaces
// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface AugmentedErrors<ApiType extends ApiTypes> extends EmptyBase<ApiType> {
// augmented
}
// eslint-disable-next-line @typescript-eslint/consistent-indexed-object-style
export interface DecoratedErrors<ApiType extends ApiTypes> extends AugmentedErrors<ApiType> {
// when non-augmented, we need to at least have Codec results
[key: string]: ModuleErrors<ApiType>;
}
export type ModuleErrors<ApiType extends ApiTypes> = Record<string, AugmentedError<ApiType>>;
+23
View File
@@ -0,0 +1,23 @@
// Copyright 2017-2025 @pezkuwi/api-base authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { IsEvent } from '@pezkuwi/types/metadata/decorate/types';
import type { AnyTuple } from '@pezkuwi/types/types';
import type { ApiTypes, EmptyBase } from './base.js';
export type AugmentedEvent<_ extends ApiTypes, T extends AnyTuple = AnyTuple, N = unknown> = IsEvent<T, N>;
// augmented interfaces
// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface AugmentedEvents<ApiType extends ApiTypes> extends EmptyBase<ApiType> {
// augmented
}
// eslint-disable-next-line @typescript-eslint/consistent-indexed-object-style
export interface DecoratedEvents<ApiType extends ApiTypes> extends AugmentedEvents<ApiType> {
// when non-augmented, we need to at least have Codec results
[key: string]: ModuleEvents<ApiType>;
}
export type ModuleEvents<ApiType extends ApiTypes> = Record<string, AugmentedEvent<ApiType>>;
+16
View File
@@ -0,0 +1,16 @@
// Copyright 2017-2025 @pezkuwi/api authors & contributors
// SPDX-License-Identifier: Apache-2.0
// These are augmented, do an augmentation export
export * from '@pezkuwi/api-base/types/calls';
export * from '@pezkuwi/api-base/types/consts';
export * from '@pezkuwi/api-base/types/errors';
export * from '@pezkuwi/api-base/types/events';
export * from '@pezkuwi/api-base/types/storage';
export * from '@pezkuwi/api-base/types/submittable';
// normal exports
export * from './api.js';
export * from './base.js';
export * from './derive.js';
export * from './rpc.js';
+35
View File
@@ -0,0 +1,35 @@
// Copyright 2017-2025 @pezkuwi/api-base authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Observable } from 'rxjs';
import type { AnyFunction, AnyJson, Callback, DefinitionRpc } from '@pezkuwi/types/types';
import type { ApiTypes, PromiseResult, Push, RxResult, UnsubscribePromise } from './base.js';
export type { AugmentedRpc } from '@pezkuwi/rpc-core/types';
export interface RxRpcResult<F extends AnyFunction> extends RxResult<F> {
raw <T> (...args: Parameters<F>): Observable<T>;
meta: DefinitionRpc;
}
export interface PromiseRpcResult<F extends AnyFunction> extends PromiseResult<F> {
raw <T> (...args: Parameters<F>): Promise<T>;
raw <T> (...args: Push<Parameters<F>, Callback<T>>): UnsubscribePromise;
meta: DefinitionRpc;
}
export type RpcMethodResult<ApiType extends ApiTypes, F extends AnyFunction> = ApiType extends 'rxjs'
? RxRpcResult<F>
: PromiseRpcResult<F>;
export type DecoratedRpcSection<ApiType extends ApiTypes, Section> = {
[M in keyof Section]: Section[M] extends AnyFunction
? RpcMethodResult<ApiType, Section[M]>
: never
}
export type RawRpcType<ApiType extends ApiTypes> = (method: string, ...params: unknown[]) => ApiType extends 'rxjs' ? Observable<AnyJson> : Promise<AnyJson>;
export type DecoratedRpc<ApiType extends ApiTypes, AllSections> = {
[S in keyof AllSections]: DecoratedRpcSection<ApiType, AllSections[S]>
} & RawRpcType<ApiType>
+123
View File
@@ -0,0 +1,123 @@
// Copyright 2017-2025 @pezkuwi/api-base authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Observable } from 'rxjs';
import type { StorageKey, u64 } from '@pezkuwi/types';
import type { Hash } from '@pezkuwi/types/interfaces';
import type { StorageEntry } from '@pezkuwi/types/primitive/types';
import type { AnyFunction, AnyTuple, Callback, Codec, IStorageKey } from '@pezkuwi/types/types';
import type { ApiTypes, DropLast, EmptyBase, MethodResult, PaginationOptions, PromiseOrObs, ReturnCodec, UnsubscribePromise } from './base.js';
type StorageEntryObservableMulti<R extends Codec = Codec> = <T extends Codec = R>(args: unknown[]) => Observable<T[]>;
interface StorageEntryPromiseMulti<R extends Codec = Codec> {
<T extends Codec = R>(args: unknown[]): Promise<T[]>;
<T extends Codec = R>(args: unknown[], callback: Callback<T[]>): UnsubscribePromise;
}
export interface StorageEntryPromiseOverloads {
(arg1?: unknown, arg2?: unknown, arg3?: unknown): Promise<Codec>;
<T extends Codec>(arg1?: unknown, arg2?: unknown, arg3?: unknown): Promise<T>;
<T extends Codec>(callback: Callback<T>): UnsubscribePromise;
<T extends Codec>(arg: unknown, callback: Callback<T>): UnsubscribePromise;
<T extends Codec>(arg1: unknown, arg2: unknown, callback: Callback<T>): UnsubscribePromise;
<T extends Codec>(arg1: unknown, arg2: unknown, arg3: unknown, callback: Callback<T>): UnsubscribePromise;
}
export interface StorageEntryPromiseOverloadsAt {
(arg1?: unknown, arg2?: unknown, arg3?: unknown): Promise<Codec>;
<T extends Codec>(arg1?: unknown, arg2?: unknown, arg3?: unknown): Promise<T>;
}
// This is the most generic typings we can have for a storage entry function
export type GenericStorageEntryFunction = (...args: unknown[]) => Observable<Codec>
export type QueryableStorageEntry<ApiType extends ApiTypes, A extends AnyTuple = AnyTuple> =
ApiType extends 'rxjs'
? AugmentedQuery<'rxjs', GenericStorageEntryFunction, A>
: AugmentedQuery<'promise', GenericStorageEntryFunction, A> & StorageEntryPromiseOverloads;
export type QueryableStorageEntryAt<ApiType extends ApiTypes, A extends AnyTuple = AnyTuple> =
ApiType extends 'rxjs'
? AugmentedQueryAt<'rxjs', GenericStorageEntryFunction, A>
: AugmentedQueryAt<'promise', GenericStorageEntryFunction, A> & StorageEntryPromiseOverloadsAt;
export interface StorageEntryBase<ApiType extends ApiTypes, F extends AnyFunction, A extends AnyTuple = AnyTuple> extends StorageEntryBaseAt<ApiType, F, A> {
/**
* @deprecated Use api.at(<blockHash>)
*/
at: <T = ReturnCodec<F>>(hash: Hash | Uint8Array | string, ...args: Parameters<F>) => PromiseOrObs<ApiType, T>;
creator: StorageEntry;
/**
* @deprecated Use api.at(<blockHash>)
*/
entriesAt: <T = ReturnCodec<F>, K extends AnyTuple = A>(hash: Hash | Uint8Array | string, ...args: DropLast<Parameters<F>>) => PromiseOrObs<ApiType, [StorageKey<K>, T][]>;
/**
* @deprecated Use api.at(<blockHash>)
*/
keysAt: <K extends AnyTuple = A> (hash: Hash | Uint8Array | string, ...args: DropLast<Parameters<F>>) => PromiseOrObs<ApiType, StorageKey<K>[]>;
/**
* @deprecated Use api.at(<blockHash>)
*/
sizeAt: (hash: Hash | Uint8Array | string, ...args: Parameters<F>) => PromiseOrObs<ApiType, u64>;
multi: ApiType extends 'rxjs'
? StorageEntryObservableMulti<ReturnCodec<F>>
: StorageEntryPromiseMulti<ReturnCodec<F>>;
}
export interface StorageEntryBaseAt<ApiType extends ApiTypes, F extends AnyFunction, A extends AnyTuple = AnyTuple> {
entries: <T = ReturnCodec<F>, K extends AnyTuple = A>(...args: DropLast<Parameters<F>>) => PromiseOrObs<ApiType, [StorageKey<K>, T][]>;
entriesPaged: <T = ReturnCodec<F>, K extends AnyTuple = A>(opts: PaginationOptions<Parameters<F>[0]>) => PromiseOrObs<ApiType, [StorageKey<K>, T][]>;
hash: (...args: Parameters<F>) => PromiseOrObs<ApiType, Hash>;
is: (key: IStorageKey<AnyTuple>) => key is IStorageKey<A>;
key: (...args: Parameters<F>) => string;
keyPrefix: (...args: DropLast<Parameters<F>>) => string;
keys: <K extends AnyTuple = A> (...args: DropLast<Parameters<F>>) => PromiseOrObs<ApiType, StorageKey<K>[]>;
keysPaged: <K extends AnyTuple = A> (opts: PaginationOptions<Parameters<F>[0]>) => PromiseOrObs<ApiType, StorageKey<K>[]>;
size: (...args: Parameters<F>) => PromiseOrObs<ApiType, u64>;
}
export type QueryableModuleStorage<ApiType extends ApiTypes> = Record<string, QueryableStorageEntry<ApiType, AnyTuple>>;
export type QueryableModuleStorageAt<ApiType extends ApiTypes> = Record<string, QueryableStorageEntryAt<ApiType, AnyTuple>>;
export type QueryableStorageMultiArg<ApiType extends ApiTypes> =
QueryableStorageEntry<ApiType> |
[QueryableStorageEntry<ApiType>, ...unknown[]];
export type QueryableStorageMultiBase<ApiType extends ApiTypes> = <T extends Codec[]>(calls: QueryableStorageMultiArg<ApiType>[]) => Observable<T>;
export interface QueryableStorageMultiPromise<ApiType extends ApiTypes> {
<T extends Codec[]>(calls: QueryableStorageMultiArg<ApiType>[], callback: Callback<T>): UnsubscribePromise;
<T extends Codec[]>(calls: QueryableStorageMultiArg<ApiType>[]): Promise<T>;
}
export type QueryableStorageMulti<ApiType extends ApiTypes> =
ApiType extends 'rxjs'
? QueryableStorageMultiBase<ApiType>
: QueryableStorageMultiPromise<ApiType>;
export type AugmentedQuery<ApiType extends ApiTypes, F extends AnyFunction, A extends AnyTuple = AnyTuple> = MethodResult<ApiType, F> & StorageEntryBase<ApiType, F, A>;
export type AugmentedQueryAt<ApiType extends ApiTypes, F extends AnyFunction, A extends AnyTuple = AnyTuple> = MethodResult<ApiType, F> & StorageEntryBaseAt<ApiType, F, A>;
// backwards compatibility-only
export type AugmentedQueryDoubleMap<ApiType extends ApiTypes, F extends AnyFunction, A extends AnyTuple = AnyTuple> = AugmentedQuery<ApiType, F, A>;
// augmented interfaces
// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface AugmentedQueries<ApiType extends ApiTypes> extends EmptyBase<ApiType> {
// augmented
}
// eslint-disable-next-line @typescript-eslint/consistent-indexed-object-style
export interface QueryableStorage<ApiType extends ApiTypes> extends AugmentedQueries<ApiType> {
// when non-augmented, we need to at least have Codec results
[key: string]: QueryableModuleStorage<ApiType>;
}
// eslint-disable-next-line @typescript-eslint/consistent-indexed-object-style
export interface QueryableStorageAt<ApiType extends ApiTypes> extends AugmentedQueries<ApiType> {
[key: string]: QueryableModuleStorageAt<ApiType>;
}
+114
View File
@@ -0,0 +1,114 @@
// Copyright 2017-2025 @pezkuwi/api-base authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Observable } from 'rxjs';
import type { AccountId, Address, ApplyExtrinsicResult, BlockNumber, Call, DispatchError, DispatchInfo, EventRecord, Extrinsic, ExtrinsicStatus, Hash, RuntimeDispatchInfo } from '@pezkuwi/types/interfaces';
import type { AnyFunction, AnyNumber, AnyTuple, AnyU8a, Callback, CallBase, Codec, IExtrinsicEra, IKeyringPair, ISubmittableResult, Signer } from '@pezkuwi/types/types';
import type { ApiTypes, EmptyBase, PromiseOrObs } from './base.js';
export type AugmentedSubmittable<T extends AnyFunction, A extends AnyTuple = AnyTuple> = T & CallBase<A>;
export type AddressOrPair = IKeyringPair | string | AccountId | Address;
export interface SignerOptions {
blockHash: Uint8Array | string;
era?: IExtrinsicEra | number;
nonce: AnyNumber | Codec;
signer?: Signer;
tip?: AnyNumber;
assetId?: AnyNumber | object;
mode?: AnyNumber;
metadataHash?: AnyU8a;
withSignedTransaction?: boolean;
}
export type SubmittableDryRunResult<ApiType extends ApiTypes> =
ApiType extends 'rxjs'
? Observable<ApplyExtrinsicResult>
: Promise<ApplyExtrinsicResult>;
export type SubmittableResultResult<ApiType extends ApiTypes, R extends ISubmittableResult = ISubmittableResult> =
ApiType extends 'rxjs'
? Observable<R>
: Promise<Hash>;
export type SubmittableResultSubscription<ApiType extends ApiTypes, R extends ISubmittableResult = ISubmittableResult> =
ApiType extends 'rxjs'
? Observable<R>
: Promise<() => void>;
export type SubmittablePaymentResult<ApiType extends ApiTypes> =
ApiType extends 'rxjs'
? Observable<RuntimeDispatchInfo>
: Promise<RuntimeDispatchInfo>;
export interface SubmittableResultValue {
dispatchError?: DispatchError | undefined;
dispatchInfo?: DispatchInfo | undefined;
events?: EventRecord[];
internalError?: Error | undefined;
status: ExtrinsicStatus;
txHash: Hash;
txIndex?: number | undefined;
blockNumber?: BlockNumber;
}
export interface SubmittableExtrinsic<ApiType extends ApiTypes, R extends ISubmittableResult = ISubmittableResult> extends Extrinsic {
/** true if api.rpc.system.dryRun is available, enabling dryRun(...) */
hasDryRun: boolean;
/** true if api.call.transactionPaymentApi.queryInfo is available, enabling paymentInfo(...) */
hasPaymentInfo: boolean;
dryRun (account: AddressOrPair, options?: Partial<SignerOptions>): SubmittableDryRunResult<ApiType>;
paymentInfo (account: AddressOrPair, options?: Partial<SignerOptions>): SubmittablePaymentResult<ApiType>;
send (): SubmittableResultResult<ApiType>;
send (statusCb: Callback<R>): SubmittableResultSubscription<ApiType, R>;
/**
* @description Sign the constructed transaction asynchronously.
*
* The result is a signed extrinsic that is ready to be broadcast to the network via `.send()`, `rpc.author.submitExtrinsic()`, or
* any custom submission logic.
*/
signAsync (account: AddressOrPair, _options?: Partial<SignerOptions>): PromiseOrObs<ApiType, this>;
/**
* @description Sign and broadcast the constructued transaction.
*
* Note for injected signers:
* As of v12.0.1 and up the `SignerResult` return type for `signPayload` allows for the `signedTransaction` field.
* This allows the signer to input a signed transaction that will be directly broadcasted. This
* bypasses the api adding the signature to the payload. The api will ensure that the Call Data is not changed before it broadcasts the
* transaction. This allows for the signer to modify the payload to add things like `mode`, and `metadataHash` for
* signedExtensions such as `CheckMetadataHash`.
*/
signAndSend (account: AddressOrPair, options?: Partial<SignerOptions>): SubmittableResultResult<ApiType, R>;
signAndSend (account: AddressOrPair, statusCb: Callback<R>): SubmittableResultSubscription<ApiType>;
signAndSend (account: AddressOrPair, options: Partial<SignerOptions>, statusCb?: Callback<R>): SubmittableResultSubscription<ApiType, R>;
withResultTransform (transform: (input: ISubmittableResult) => ISubmittableResult): this;
}
export interface SubmittableExtrinsicFunction<ApiType extends ApiTypes, A extends AnyTuple = AnyTuple> extends CallBase<A> {
(...params: any[]): SubmittableExtrinsic<ApiType>;
}
// augmented interfaces
// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface AugmentedSubmittables<ApiType extends ApiTypes> extends EmptyBase<ApiType> {
// augmented
}
export interface SubmittableExtrinsics<ApiType extends ApiTypes> extends AugmentedSubmittables<ApiType> {
(extrinsic: Call | Extrinsic | Uint8Array | string): SubmittableExtrinsic<ApiType>;
// when non-augmented, we need to at least have Codec results
[key: string]: SubmittableModuleExtrinsics<ApiType>;
}
export type SubmittableModuleExtrinsics<ApiType extends ApiTypes> = Record<string, SubmittableExtrinsicFunction<ApiType>>;
+15
View File
@@ -0,0 +1,15 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"baseUrl": "..",
"outDir": "./build",
"rootDir": "./src"
},
"exclude": [
"**/mod.ts"
],
"references": [
{ "path": "../rpc-core/tsconfig.build.json" },
{ "path": "../types/tsconfig.build.json" }
]
}
+3
View File
@@ -0,0 +1,3 @@
# @pezkuwi/api-contract
Interfaces to allow for the encoding and decoding of Bizinikiwi contract ABIs.
+39
View File
@@ -0,0 +1,39 @@
{
"author": "Jaco Greeff <jacogr@gmail.com>",
"bugs": "https://github.com/pezkuwichain/pezkuwi-api/issues",
"description": "Interfaces for interacting with contracts and contract ABIs",
"engines": {
"node": ">=18"
},
"homepage": "https://github.com/pezkuwichain/pezkuwi-api/tree/master/packages/api-contract#readme",
"license": "Apache-2.0",
"name": "@pezkuwi/api-contract",
"repository": {
"directory": "packages/api-contract",
"type": "git",
"url": "https://github.com/pezkuwichain/pezkuwi-api.git"
},
"sideEffects": [
"./packageDetect.js",
"./packageDetect.cjs"
],
"type": "module",
"version": "16.5.6",
"main": "index.js",
"dependencies": {
"@pezkuwi/api": "16.5.4",
"@pezkuwi/api-augment": "16.5.4",
"@pezkuwi/types": "16.5.4",
"@pezkuwi/types-codec": "16.5.4",
"@pezkuwi/types-create": "16.5.4",
"@pezkuwi/util": "^14.0.1",
"@pezkuwi/util-crypto": "^14.0.1",
"rxjs": "^7.8.1",
"tslib": "^2.8.1"
},
"devDependencies": {
"@pezkuwi/api-augment": "16.5.4",
"@pezkuwi/keyring": "^14.0.1",
"@pezkuwi/types-support": "16.5.4"
}
}
+235
View File
@@ -0,0 +1,235 @@
// Copyright 2017-2025 @pezkuwi/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
/// <reference types="@pezkuwi/dev-test/globals.d.ts" />
import type { Registry } from '@pezkuwi/types/types';
import fs from 'node:fs';
import process from 'node:process';
import { TypeDefInfo } from '@pezkuwi/types/types';
import rpcMetadata from '@pezkuwi/types-support/metadata/static-bizinikiwi-contracts-node';
import { blake2AsHex } from '@pezkuwi/util-crypto';
import { Metadata, TypeRegistry } from '../../../types/src/bundle.js';
import abis from '../test/contracts/index.js';
import { Abi } from './index.js';
interface SpecDef {
messages: {
label: string;
name: string[] | string
}[]
}
interface JSONAbi {
source: {
compiler: string,
hash: string,
language: string,
wasm: string
},
spec: SpecDef;
V1: {
spec: SpecDef;
},
V2: {
spec: SpecDef;
},
V3: {
spec: SpecDef;
},
V4: {
spec: SpecDef;
}
}
function stringifyInfo (key: string, value: unknown): unknown {
return key === 'info' && typeof value === 'number'
? TypeDefInfo[value]
: value;
}
function stringifyJson (registry: Registry): string {
const defs = registry.lookup.types.map(({ id }) =>
registry.lookup.getTypeDef(id)
);
return JSON.stringify(defs, stringifyInfo, 2);
}
describe('Abi', (): void => {
describe('ABI', (): void => {
Object.entries(abis).forEach(([abiName, _abi]) => {
const abi = _abi as unknown as JSONAbi;
it(`initializes from a contract ABI (${abiName})`, (): void => {
try {
const messageIds = (abi.V4 || abi.V3 || abi.V2 || abi.V1 || abi).spec.messages.map(({ label, name }) =>
label || (
Array.isArray(name)
? name.join('::')
: name
)
);
const inkAbi = new Abi(abis[abiName]);
expect(inkAbi.messages.map(({ identifier }) => identifier)).toEqual(messageIds);
} catch (error) {
console.error(error);
throw error;
}
});
});
});
describe('TypeDef', (): void => {
for (const [abiName, abiJson] of Object.entries(abis)) {
it(`initializes from a contract ABI: ${abiName}`, (): void => {
const abi = new Abi(abiJson);
const registryJson = stringifyJson(abi.registry);
const cmpFile = new URL(`../test/compare/${abiName}.test.json`, import.meta.url);
try {
expect(
JSON.parse(registryJson)
).toEqual(
JSON.parse(fs.readFileSync(cmpFile, 'utf-8'))
);
} catch (error) {
if (process.env['GITHUB_REPOSITORY']) {
console.error(registryJson);
throw error;
}
fs.writeFileSync(cmpFile, registryJson, { flag: 'w' });
}
});
}
});
it('has the correct hash for the source', (): void => {
const abi = new Abi(abis['ink_v0_flipperBundle']);
const bundle = abis['ink_v0_flipperBundle'] as unknown as JSONAbi;
// manual
expect(bundle.source.hash).toEqual(blake2AsHex(bundle.source.wasm));
// the Codec hash
expect(bundle.source.hash).toEqual(abi.info.source.wasm.hash.toHex());
// the hash as per the actual Abi
expect(bundle.source.hash).toEqual(abi.info.source.wasmHash.toHex());
});
describe('Events', (): void => {
const registry = new TypeRegistry();
beforeAll((): void => {
const metadata = new Metadata(registry, rpcMetadata);
registry.setMetadata(metadata);
});
it('decoding <=ink!v4 event', (): void => {
const abiJson = abis['ink_v4_erc20Metadata'];
expect(abiJson).toBeDefined();
const abi = new Abi(abiJson);
const eventRecordHex =
'0x0001000000080360951b8baf569bca905a279c12d6ce17db7cdce23a42563870ef585129ce5dc64d010001d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d018eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a4800505a4f7e9f4eb106000000000000000c0045726332303a3a5472616e7366657200000000000000000000000000000000da2d695d3b5a304e0039e7fc4419c34fa0c1f239189c99bb72a6484f1634782b2b00c7d40fe6d84d660f3e6bed90f218e022a0909f7e1a7ea35ada8b6e003564';
const record = registry.createType('EventRecord', eventRecordHex);
const decodedEvent = abi.decodeEvent(record);
expect(decodedEvent.event.args.length).toEqual(3);
expect(decodedEvent.args.length).toEqual(3);
expect(decodedEvent.event.identifier).toEqual('Transfer');
const decodedEventHuman = decodedEvent.event.args.reduce((prev, cur, index) => {
return {
...prev,
[cur.name]: decodedEvent.args[index].toHuman()
};
}, {});
const expectedEvent = {
from: '5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY',
to: '5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty',
value: '123.4567 MUnit'
};
expect(decodedEventHuman).toEqual(expectedEvent);
});
it('decoding >=ink!v5 event', (): void => {
const abiJson = abis['ink_v5_erc20Metadata'];
expect(abiJson).toBeDefined();
const abi = new Abi(abiJson);
const eventRecordHex =
'0x00010000000803da17150e96b3955a4db6ad35ddeb495f722f9c1d84683113bfb096bf3faa30f2490101d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d018eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a4800505a4f7e9f4eb106000000000000000cb5b61a3e6a21a16be4f044b517c28ac692492f73c5bfd3f60178ad98c767f4cbd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d8eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a48';
const record = registry.createType('EventRecord', eventRecordHex);
const decodedEvent = abi.decodeEvent(record);
expect(decodedEvent.event.args.length).toEqual(3);
expect(decodedEvent.args.length).toEqual(3);
expect(decodedEvent.event.identifier).toEqual('erc20::erc20::Transfer');
const decodedEventHuman = decodedEvent.event.args.reduce((prev, cur, index) => {
return {
...prev,
[cur.name]: decodedEvent.args[index].toHuman()
};
}, {});
const expectedEvent = {
from: '5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY',
to: '5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty',
value: '123.4567 MUnit'
};
expect(decodedEventHuman).toEqual(expectedEvent);
});
it('decoding >=ink!v5 anonymous event', (): void => {
const abiJson = abis['ink_v5_erc20AnonymousTransferMetadata'];
expect(abiJson).toBeDefined();
const abi = new Abi(abiJson);
expect(abi.events[0].identifier).toEqual('erc20::erc20::Transfer');
expect(abi.events[0].signatureTopic).toEqual(null);
const eventRecordWithAnonymousEventHex = '0x00010000000803538e726248a9c155911e7d99f4f474c3408630a2f6275dd501d4471c7067ad2c490101d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d018eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a4800505a4f7e9f4eb1060000000000000008d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d8eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a48';
const record = registry.createType('EventRecord', eventRecordWithAnonymousEventHex);
const decodedEvent = abi.decodeEvent(record);
expect(decodedEvent.event.args.length).toEqual(3);
expect(decodedEvent.args.length).toEqual(3);
expect(decodedEvent.event.identifier).toEqual('erc20::erc20::Transfer');
const decodedEventHuman = decodedEvent.event.args.reduce((prev, cur, index) => {
return {
...prev,
[cur.name]: decodedEvent.args[index].toHuman()
};
}, {});
const expectedEvent = {
from: '5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY',
to: '5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty',
value: '123.4567 MUnit'
};
expect(decodedEventHuman).toEqual(expectedEvent);
});
});
});
+477
View File
@@ -0,0 +1,477 @@
// Copyright 2017-2025 @pezkuwi/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Bytes, Vec } from '@pezkuwi/types';
import type { ChainProperties, ContractConstructorSpecLatest, ContractEventParamSpecLatest, ContractMessageParamSpecLatest, ContractMessageSpecLatest, ContractMetadata, ContractMetadataV4, ContractMetadataV5, ContractMetadataV6, ContractProjectInfo, ContractTypeSpec, EventRecord } from '@pezkuwi/types/interfaces';
import type { Codec, Registry, TypeDef } from '@pezkuwi/types/types';
import type { AbiConstructor, AbiEvent, AbiEventParam, AbiMessage, AbiMessageParam, AbiParam, DecodedEvent, DecodedMessage } from '../types.js';
import { Option, TypeRegistry } from '@pezkuwi/types';
import { TypeDefInfo } from '@pezkuwi/types-create';
import { assertReturn, compactAddLength, compactStripLength, isBn, isNumber, isObject, isString, isUndefined, logger, stringCamelCase, stringify, u8aConcat, u8aToHex } from '@pezkuwi/util';
import { convertVersions, enumVersions } from './toLatestCompatible.js';
interface AbiJson {
version?: string;
[key: string]: unknown;
}
type EventOf<M> = M extends {spec: { events: Vec<infer E>}} ? E : never
export type ContractMetadataSupported = ContractMetadataV4 | ContractMetadataV5 | ContractMetadataV6;
type ContractEventSupported = EventOf<ContractMetadataSupported>;
const l = logger('Abi');
const PRIMITIVE_ALWAYS = ['AccountId', 'AccountId20', 'AccountIndex', 'Address', 'Balance'];
function findMessage <T extends AbiMessage> (list: T[], messageOrId: T | string | number): T {
const message = isNumber(messageOrId)
? list[messageOrId]
: isString(messageOrId)
? list.find(({ identifier }) => [identifier, stringCamelCase(identifier)].includes(messageOrId.toString()))
: messageOrId;
return assertReturn(message, () => `Attempted to call an invalid contract interface, ${stringify(messageOrId)}`);
}
function getMetadata (registry: Registry, json: AbiJson): ContractMetadataSupported {
// this is for V1, V2, V3
const vx = enumVersions.find((v) => isObject(json[v]));
// this was added in V4
const jsonVersion = json.version;
if (!vx && jsonVersion && !enumVersions.find((v) => v === `V${jsonVersion}`)) {
throw new Error(`Unable to handle version ${jsonVersion}`);
}
const metadata = registry.createType<ContractMetadata>('ContractMetadata',
vx
? { [vx]: json[vx] }
: jsonVersion
? { [`V${jsonVersion}`]: json }
: { V0: json }
);
const converter = convertVersions.find(([v]) => metadata[`is${v}`]);
if (!converter) {
throw new Error(`Unable to convert ABI with version ${metadata.type} to a supported version`);
}
const upgradedMetadata = converter[1](registry, metadata[`as${converter[0]}`]);
return upgradedMetadata;
}
function isRevive (json: Record<string, unknown>): boolean {
const source = json['source'];
const version = json['version'];
const hasContractBinary =
typeof source === 'object' &&
source !== null &&
'contract_binary' in source;
const hasVersion =
typeof version === 'number' && version >= 6;
return hasContractBinary || hasVersion;
}
function parseJson (json: Record<string, unknown>, chainProperties?: ChainProperties): [Record<string, unknown>, Registry, ContractMetadataSupported, ContractProjectInfo, boolean] {
const registry = new TypeRegistry();
const revive = isRevive(json);
const typeName = revive ? 'ContractReviveProjectInfo' : 'ContractProjectInfo';
const info = registry.createType(typeName, json) as unknown as ContractProjectInfo;
const metadata = getMetadata(registry, json as unknown as AbiJson);
const lookup = registry.createType('PortableRegistry', { types: metadata.types }, true);
// attach the lookup to the registry - now the types are known
registry.setLookup(lookup);
if (chainProperties) {
registry.setChainProperties(chainProperties);
}
// warm-up the actual type, pre-use
lookup.types.forEach(({ id }) =>
lookup.getTypeDef(id)
);
return [json, registry, metadata, info, revive];
}
/**
* @internal
* Determines if the given input value is a ContractTypeSpec
*/
function isTypeSpec (value: Codec): value is ContractTypeSpec {
return !!value && value instanceof Map && !isUndefined((value as ContractTypeSpec).type) && !isUndefined((value as ContractTypeSpec).displayName);
}
/**
* @internal
* Determines if the given input value is an Option
*/
function isOption (value: Codec): value is Option<Codec> {
return !!value && value instanceof Option;
}
export class Abi {
readonly events: AbiEvent[];
readonly constructors: AbiConstructor[];
readonly info: ContractProjectInfo;
readonly json: Record<string, unknown>;
readonly messages: AbiMessage[];
readonly metadata: ContractMetadataSupported;
readonly registry: Registry;
readonly environment = new Map<string, TypeDef | Codec>();
readonly isRevive: boolean;
constructor (abiJson: Record<string, unknown> | string, chainProperties?: ChainProperties) {
[this.json, this.registry, this.metadata, this.info, this.isRevive] = parseJson(
isString(abiJson)
? JSON.parse(abiJson) as Record<string, unknown>
: abiJson,
chainProperties
);
this.constructors = this.metadata.spec.constructors.map((spec: ContractConstructorSpecLatest, index) =>
this.#createMessage(spec, index, {
isConstructor: true,
isDefault: spec.default.isTrue,
isPayable: spec.payable.isTrue,
returnType: spec.returnType.isSome
? this.registry.lookup.getTypeDef(spec.returnType.unwrap().type)
: null
})
);
this.events = this.metadata.spec.events.map((_: ContractEventSupported, index: number) =>
this.#createEvent(index)
);
this.messages = this.metadata.spec.messages.map((spec: ContractMessageSpecLatest, index): AbiMessage =>
this.#createMessage(spec, index, {
isDefault: spec.default.isTrue,
isMutating: spec.mutates.isTrue,
isPayable: spec.payable.isTrue,
returnType: spec.returnType.isSome
? this.registry.lookup.getTypeDef(spec.returnType.unwrap().type)
: null
})
);
// NOTE See the rationale for having Option<...> values in the actual
// ContractEnvironmentV4 structure definition in interfaces/contractsAbi
// (Due to conversions, the fields may not exist)
for (const [key, opt] of this.metadata.spec.environment.entries()) {
if (isOption(opt)) {
if (opt.isSome) {
const value = opt.unwrap();
if (isBn(value)) {
this.environment.set(key, value);
} else if (isTypeSpec(value)) {
this.environment.set(key, this.registry.lookup.getTypeDef(value.type));
} else {
throw new Error(`Invalid environment definition for ${key}:: Expected either Number or ContractTypeSpec`);
}
}
} else {
throw new Error(`Expected Option<*> definition for ${key} in ContractEnvironment`);
}
}
}
/**
* Warning: Unstable API, bound to change
*/
public decodeEvent (record: EventRecord): DecodedEvent {
switch (this.metadata.version.toString()) {
// earlier version are hoisted to v4
case '4':
return this.#decodeEventV4(record);
case '5':
return this.#decodeEventV5(record);
// Latest
default:
return this.#decodeEventV6(record);
}
}
#decodeEventV6 = (record: EventRecord): DecodedEvent => {
const topics = record.event.data[2] as unknown as { toHex: () => string }[];
// Try to match by signature topic (first topic)
const signatureTopic = topics[0];
const data = record.event.data[1] as Bytes;
if (signatureTopic) {
const event = this.events.find((e) => e.signatureTopic !== undefined && e.signatureTopic !== null && e.signatureTopic === signatureTopic.toHex());
// Early return if event found by signature topic
if (event) {
return event.fromU8a(data);
}
}
// If no event returned yet, it might be anonymous
const amountOfTopics = topics.length;
const potentialEvents = this.events.filter((e) => {
// event can't have a signature topic
if (e.signatureTopic !== null && e.signatureTopic !== undefined) {
return false;
}
// event should have same amount of indexed fields as emitted topics
const amountIndexed = e.args.filter((a) => a.indexed).length;
if (amountIndexed !== amountOfTopics) {
return false;
}
// If all conditions met, it's a potential event
return true;
});
if (potentialEvents.length === 1) {
return potentialEvents[0].fromU8a(data);
}
throw new Error('Unable to determine event');
};
#decodeEventV5 = (record: EventRecord): DecodedEvent => {
// Find event by first topic, which potentially is the signature_topic
const signatureTopic = record.topics[0];
const data = record.event.data[1] as Bytes;
if (signatureTopic) {
const event = this.events.find((e) => e.signatureTopic !== undefined && e.signatureTopic !== null && e.signatureTopic === signatureTopic.toHex());
// Early return if event found by signature topic
if (event) {
return event.fromU8a(data);
}
}
// If no event returned yet, it might be anonymous
const amountOfTopics = record.topics.length;
const potentialEvents = this.events.filter((e) => {
// event can't have a signature topic
if (e.signatureTopic !== null && e.signatureTopic !== undefined) {
return false;
}
// event should have same amount of indexed fields as emitted topics
const amountIndexed = e.args.filter((a) => a.indexed).length;
if (amountIndexed !== amountOfTopics) {
return false;
}
// If all conditions met, it's a potential event
return true;
});
if (potentialEvents.length === 1) {
return potentialEvents[0].fromU8a(data);
}
throw new Error('Unable to determine event');
};
#decodeEventV4 = (record: EventRecord): DecodedEvent => {
const data = record.event.data[1] as Bytes;
const index = data[0];
const event = this.events[index];
if (!event) {
throw new Error(`Unable to find event with index ${index}`);
}
return event.fromU8a(data.subarray(1));
};
/**
* Warning: Unstable API, bound to change
*/
public decodeConstructor (data: Uint8Array): DecodedMessage {
return this.#decodeMessage('message', this.constructors, data);
}
/**
* Warning: Unstable API, bound to change
*/
public decodeMessage (data: Uint8Array): DecodedMessage {
return this.#decodeMessage('message', this.messages, data);
}
public findConstructor (constructorOrId: AbiConstructor | string | number): AbiConstructor {
return findMessage(this.constructors, constructorOrId);
}
public findMessage (messageOrId: AbiMessage | string | number): AbiMessage {
return findMessage(this.messages, messageOrId);
}
#createArgs = (args: ContractMessageParamSpecLatest[] | ContractEventParamSpecLatest[], spec: unknown): AbiParam[] => {
return args.map(({ label, type }, index): AbiParam => {
try {
if (!isObject(type)) {
throw new Error('Invalid type definition found');
}
const displayName = type.displayName.length
? type.displayName[type.displayName.length - 1].toString()
: undefined;
const camelName = stringCamelCase(label);
if (displayName && PRIMITIVE_ALWAYS.includes(displayName)) {
return {
name: camelName,
type: {
info: TypeDefInfo.Plain,
type: displayName
}
};
}
const typeDef = this.registry.lookup.getTypeDef(type.type);
return {
name: camelName,
type: displayName && !typeDef.type.startsWith(displayName)
? { displayName, ...typeDef }
: typeDef
};
} catch (error) {
l.error(`Error expanding argument ${index} in ${stringify(spec)}`);
throw error;
}
});
};
#createMessageParams = (args: ContractMessageParamSpecLatest[], spec: unknown): AbiMessageParam[] => {
return this.#createArgs(args, spec);
};
#createEventParams = (args: ContractEventParamSpecLatest[], spec: unknown): AbiEventParam[] => {
const params = this.#createArgs(args, spec);
return params.map((p, index): AbiEventParam => ({ ...p, indexed: args[index].indexed.toPrimitive() }));
};
#createEvent = (index: number): AbiEvent => {
// TODO TypeScript would narrow this type to the correct version,
// but version is `Text` so I need to call `toString()` here,
// which breaks the type inference.
switch (this.metadata.version.toString()) {
case '4':
return this.#createEventV4((this.metadata as ContractMetadataV4).spec.events[index], index);
default:
return this.#createEventV5((this.metadata as ContractMetadataV5).spec.events[index], index);
}
};
#createEventV5 = (spec: EventOf<ContractMetadataV5>, index: number): AbiEvent => {
const args = this.#createEventParams(spec.args, spec);
const event = {
args,
docs: spec.docs.map((d) => d.toString()),
fromU8a: (data: Uint8Array): DecodedEvent => ({
args: this.#decodeArgs(args, data),
event
}),
identifier: [spec.module_path, spec.label].join('::'),
index,
signatureTopic: spec.signature_topic.isSome ? spec.signature_topic.unwrap().toHex() : null
};
return event;
};
#createEventV4 = (spec: EventOf<ContractMetadataV4>, index: number): AbiEvent => {
const args = this.#createEventParams(spec.args, spec);
const event = {
args,
docs: spec.docs.map((d) => d.toString()),
fromU8a: (data: Uint8Array): DecodedEvent => ({
args: this.#decodeArgs(args, data),
event
}),
identifier: spec.label.toString(),
index
};
return event;
};
#createMessage = (spec: ContractMessageSpecLatest | ContractConstructorSpecLatest, index: number, add: Partial<AbiMessage> = {}): AbiMessage => {
const args = this.#createMessageParams(spec.args, spec);
const identifier = spec.label.toString();
const message = {
...add,
args,
docs: spec.docs.map((d) => d.toString()),
fromU8a: (data: Uint8Array): DecodedMessage => ({
args: this.#decodeArgs(args, data),
message
}),
identifier,
index,
isDefault: spec.default.isTrue,
method: stringCamelCase(identifier),
path: identifier.split('::').map((s) => stringCamelCase(s)),
selector: spec.selector,
toU8a: (params: unknown[]) =>
this.#encodeMessageArgs(spec, args, params)
};
return message;
};
#decodeArgs = (args: AbiParam[], data: Uint8Array): Codec[] => {
// for decoding we expect the input to be just the arg data, no selectors
// no length added (this allows use with events as well)
let offset = 0;
return args.map(({ type: { lookupName, type } }): Codec => {
const value = this.registry.createType(lookupName || type, data.subarray(offset));
offset += value.encodedLength;
return value;
});
};
#decodeMessage = (type: 'constructor' | 'message', list: AbiMessage[], data: Uint8Array): DecodedMessage => {
const [, trimmed] = compactStripLength(data);
const selector = trimmed.subarray(0, 4);
const message = list.find((m) => m.selector.eq(selector));
if (!message) {
throw new Error(`Unable to find ${type} with selector ${u8aToHex(selector)}`);
}
return message.fromU8a(trimmed.subarray(4));
};
#encodeMessageArgs = ({ label, selector }: ContractMessageSpecLatest | ContractConstructorSpecLatest, args: AbiMessageParam[], data: unknown[]): Uint8Array => {
if (data.length !== args.length) {
throw new Error(`Expected ${args.length} arguments to contract message '${label.toString()}', found ${data.length}`);
}
return compactAddLength(
u8aConcat(
this.registry.createType('ContractSelector', selector).toU8a(),
...args.map(({ type: { lookupName, type } }, index) =>
this.registry.createType(lookupName || type, data[index]).toU8a()
)
)
);
};
}
@@ -0,0 +1,219 @@
// Copyright 2017-2025 @pezkuwi/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
/// <reference types="@pezkuwi/dev-test/globals.d.ts" />
import { TypeRegistry } from '@pezkuwi/types';
import abis from '../test/contracts/index.js';
import { v0ToLatestCompatible, v1ToLatestCompatible, v2ToLatestCompatible, v3ToLatestCompatible, v4ToLatestCompatible, v5ToLatestCompatible, v6ToLatestCompatible } from './toLatestCompatible.js';
describe('v0ToLatestCompatible', (): void => {
const registry = new TypeRegistry();
const contract = registry.createType('ContractMetadata', { V0: abis['ink_v0_erc20'] });
const latest = v0ToLatestCompatible(registry, contract.asV0);
it('has the correct constructors', (): void => {
expect(
latest.spec.constructors.map(({ label }) => label.toString())
).toEqual(['new']);
});
it('has the correct messages', (): void => {
expect(
latest.spec.messages.map(({ label }) => label.toString())
).toEqual(['total_supply', 'balance_of', 'allowance', 'transfer', 'approve', 'transfer_from']);
});
it('has the correct events', (): void => {
expect(
latest.spec.events.map(({ label }) => label.toString())
).toEqual(['Transfer', 'Approval']);
});
it('has the correct constructor arguments', (): void => {
expect(
latest.spec.constructors[0].args.map(({ label }) => label.toString())
).toEqual(['initial_supply']);
});
it('has the correct message arguments', (): void => {
expect(
latest.spec.messages[1].args.map(({ label }) => label.toString())
).toEqual(['owner']);
});
it('has the correct event arguments', (): void => {
expect(
latest.spec.events[0].args.map(({ label }) => label.toString())
).toEqual(['from', 'to', 'value']);
});
it('has the latest compatible version number', (): void => {
expect(latest.version.toString()).toEqual('4');
});
});
describe('v1ToLatestCompatible', (): void => {
const registry = new TypeRegistry();
const contract = registry.createType('ContractMetadata', { V1: abis['ink_v1_flipper']['V1'] });
const latest = v1ToLatestCompatible(registry, contract.asV1);
it('has the correct constructors', (): void => {
expect(
latest.spec.constructors.map(({ label }) => label.toString())
).toEqual(['new', 'default']);
});
it('has the correct messages', (): void => {
expect(
latest.spec.messages.map(({ label }) => label.toString())
).toEqual(['flip', 'get']);
});
it('has the correct messages with namespaced method name', (): void => {
const contract = registry.createType('ContractMetadata', { V1: abis['ink_v1_psp22']['V1'] });
const latest = v1ToLatestCompatible(registry, contract.asV1);
expect(
latest.spec.messages.map(({ label }) => label.toString())
).toEqual([
'PSP22Metadata::token_name', 'PSP22Metadata::token_symbol', 'PSP22Metadata::token_decimals', 'PSP22Mintable::mint', 'PSP22::decrease_allowance', 'PSP22::transfer', 'PSP22::approve', 'PSP22::allowance', 'PSP22::transfer_from', 'PSP22::balance_of', 'PSP22::increase_allowance', 'PSP22::total_supply', 'pause', 'unpause'
]);
});
it('has the correct constructor arguments', (): void => {
expect(
latest.spec.constructors[0].args.map(({ label }) => label.toString())
).toEqual(['init_value']);
});
it('has the latest compatible version number', (): void => {
expect(latest.version.toString()).toEqual('4');
});
});
describe('v2ToLatestCompatible', (): void => {
const registry = new TypeRegistry();
const contract = registry.createType('ContractMetadata', { V2: abis['ink_v2_flipper']['V2'] });
const latest = v2ToLatestCompatible(registry, contract.asV2);
it('has the correct constructor flag', (): void => {
expect(
latest.spec.constructors[0].payable.isTrue
).toEqual(true);
});
it('has the latest compatible version number', (): void => {
expect(latest.version.toString()).toEqual('4');
});
});
describe('v3ToLatestCompatible', (): void => {
const registry = new TypeRegistry();
const contract = registry.createType('ContractMetadata', { V3: abis['ink_v3_flipper']['V3'] });
const latest = v3ToLatestCompatible(registry, contract.asV3);
it('has the correct constructor flags', (): void => {
expect(
latest.spec.constructors[0].payable.isTrue
).toEqual(false);
expect(
latest.spec.constructors[1].payable.isTrue
).toEqual(true);
});
it('has the correct messages', (): void => {
const contract = registry.createType('ContractMetadata', { V3: abis['ink_v3_traitErc20']['V3'] });
const latest = v3ToLatestCompatible(registry, contract.asV3);
expect(
latest.spec.messages.map(({ label }) => label.toString())
).toEqual([
'BaseErc20::total_supply', 'BaseErc20::balance_of', 'BaseErc20::allowance', 'BaseErc20::transfer', 'BaseErc20::approve', 'BaseErc20::transfer_from'
]);
});
it('has the latest compatible version number', (): void => {
expect(latest.version.toString()).toEqual('4');
});
});
describe('v4ToLatestCompatible', (): void => {
const registry = new TypeRegistry();
const contract = registry.createType('ContractMetadata', { V4: abis['ink_v4_flipperContract'] });
const latest = v4ToLatestCompatible(registry, contract.asV4);
it('has the correct constructor flags', (): void => {
expect(
latest.spec.constructors[0].payable.isTrue
).toEqual(false);
expect(
latest.spec.constructors[1].payable.isTrue
).toEqual(false);
});
it('has the latest compatible version number', (): void => {
expect(latest.version.toString()).toEqual('4');
});
});
describe('v5ToLatestCompatible', (): void => {
const registry = new TypeRegistry();
const contract = registry.createType('ContractMetadata', { V5: abis['ink_v5_erc20Metadata'] });
const latest = v5ToLatestCompatible(registry, contract.asV5);
it('has the correct messages', (): void => {
expect(
latest.spec.messages.map(({ label }) => label.toString())
).toEqual(['total_supply', 'balance_of', 'allowance', 'transfer', 'approve', 'transfer_from']);
});
it('has new event fields', (): void => {
expect(
latest.spec.events.length
).toEqual(2);
expect(
latest.spec.events.every((e) => e.has('module_path'))
).toEqual(true);
expect(latest.spec.events[0].module_path.toString()).toEqual('erc20::erc20');
expect(
latest.spec.events.every((e) => e.has('signature_topic'))
).toEqual(true);
expect(latest.spec.events[0].signature_topic.toHex()).toEqual('0xb5b61a3e6a21a16be4f044b517c28ac692492f73c5bfd3f60178ad98c767f4cb');
});
it('has the latest compatible version number', (): void => {
expect(latest.version.toString()).toEqual('5');
});
});
describe('v6ToLatestCompatible', (): void => {
const registry = new TypeRegistry();
const contract = registry.createType('ContractMetadata', { V6: abis['ink_v6_erc20Metadata'] });
const latest = v6ToLatestCompatible(registry, contract.asV6);
it('has the correct messages', (): void => {
expect(
latest.spec.messages.map(({ label }) => label.toString())
).toEqual(['total_supply', 'balance_of', 'allowance', 'transfer', 'approve', 'transfer_from']);
});
it('has H160 as the type of balance_of argument', (): void => {
const arg = latest.spec.messages.find(
(m) => m.label.toString() === 'balance_of'
)?.args[0];
const name = arg?.type.displayName?.[0]?.toString();
expect(name).toBe('H160');
});
it('has the latest compatible version number', (): void => {
expect(latest.version.toString()).toEqual('6');
});
});
@@ -0,0 +1,52 @@
// Copyright 2017-2025 @pezkuwi/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { ContractMetadataV4, ContractMetadataV5, ContractMetadataV6 } from '@pezkuwi/types/interfaces';
import type { Registry } from '@pezkuwi/types/types';
import type { ContractMetadataSupported } from './index.js';
import { v0ToV1 } from './toV1.js';
import { v1ToV2 } from './toV2.js';
import { v2ToV3 } from './toV3.js';
import { v3ToV4 } from './toV4.js';
// The versions where an enum is used, aka V0 is missing
// (Order from newest, i.e. we expect more on newest vs oldest)
export const enumVersions = ['V6', 'V5', 'V4', 'V3', 'V2', 'V1'] as const;
type Versions = typeof enumVersions[number] | 'V0';
type Converter = (registry: Registry, vx: any) => ContractMetadataSupported;
// Helper to convert metadata from one step to the next
function createConverter <I, O> (next: (registry: Registry, input: O) => ContractMetadataSupported, step: (registry: Registry, input: I) => O): (registry: Registry, input: I) => ContractMetadataSupported {
return (registry: Registry, input: I): ContractMetadataSupported =>
next(registry, step(registry, input));
}
export function v6ToLatestCompatible (_registry: Registry, v6: ContractMetadataV6): ContractMetadataV6 {
return v6;
}
export function v5ToLatestCompatible (_registry: Registry, v5: ContractMetadataV5): ContractMetadataV5 {
return v5;
}
export function v4ToLatestCompatible (_registry: Registry, v4: ContractMetadataV4): ContractMetadataV4 {
return v4;
}
export const v3ToLatestCompatible = /*#__PURE__*/ createConverter(v4ToLatestCompatible, v3ToV4);
export const v2ToLatestCompatible = /*#__PURE__*/ createConverter(v3ToLatestCompatible, v2ToV3);
export const v1ToLatestCompatible = /*#__PURE__*/ createConverter(v2ToLatestCompatible, v1ToV2);
export const v0ToLatestCompatible = /*#__PURE__*/ createConverter(v1ToLatestCompatible, v0ToV1);
export const convertVersions: [Versions, Converter][] = [
['V6', v6ToLatestCompatible],
['V5', v5ToLatestCompatible],
['V4', v4ToLatestCompatible],
['V3', v3ToLatestCompatible],
['V2', v2ToLatestCompatible],
['V1', v1ToLatestCompatible],
['V0', v0ToLatestCompatible]
];
+35
View File
@@ -0,0 +1,35 @@
// Copyright 2017-2025 @pezkuwi/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { ContractMetadataV0, ContractMetadataV1 } from '@pezkuwi/types/interfaces';
import type { Registry } from '@pezkuwi/types/types';
import { convertSiV0toV1 } from '@pezkuwi/types';
import { objectSpread } from '@pezkuwi/util';
interface Named {
name: unknown;
}
function v0ToV1Names (all: Named[]): unknown[] {
return all.map((e) =>
objectSpread({}, e, {
name: Array.isArray(e.name)
? e.name
: [e.name]
}));
}
export function v0ToV1 (registry: Registry, v0: ContractMetadataV0): ContractMetadataV1 {
if (!v0.metadataVersion.length) {
throw new Error('Invalid format for V0 (detected) contract metadata');
}
return registry.createType('ContractMetadataV1', objectSpread({}, v0, {
spec: objectSpread({}, v0.spec, {
constructors: v0ToV1Names(v0.spec.constructors),
messages: v0ToV1Names(v0.spec.messages)
}),
types: convertSiV0toV1(registry, v0.types)
}));
}
+58
View File
@@ -0,0 +1,58 @@
// Copyright 2017-2025 @pezkuwi/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Text } from '@pezkuwi/types';
import type { ContractConstructorSpecV0, ContractEventSpecV0, ContractMessageSpecV0, ContractMetadataV1, ContractMetadataV2 } from '@pezkuwi/types/interfaces';
import type { Registry } from '@pezkuwi/types/types';
import { objectSpread } from '@pezkuwi/util';
type WithArgs = keyof typeof ARG_TYPES;
interface NamedEntry {
name: Text | Text[];
}
type GetArgsType<T extends WithArgs> = T extends 'ContractConstructorSpec'
? ContractConstructorSpecV0
: T extends ContractEventSpecV0
? ContractEventSpecV0
: ContractMessageSpecV0;
interface ArgsEntry <T extends WithArgs> extends NamedEntry {
args: GetArgsType<T>['args'][0][];
}
const ARG_TYPES = {
ContractConstructorSpec: 'ContractMessageParamSpecV2',
ContractEventSpec: 'ContractEventParamSpecV2',
ContractMessageSpec: 'ContractMessageParamSpecV2'
} as const;
function v1ToV2Label (entry: NamedEntry): { label: Text } {
return objectSpread({}, entry, {
label: Array.isArray(entry.name)
? entry.name.join('::')
: entry.name
});
}
function v1ToV2Labels <T extends WithArgs> (registry: Registry, outType: T, all: ArgsEntry<T>[]): unknown[] {
return all.map((e) =>
registry.createType(`${outType}V2`, objectSpread(v1ToV2Label(e), {
args: e.args.map((a) =>
registry.createType(ARG_TYPES[outType], v1ToV2Label(a))
)
}))
);
}
export function v1ToV2 (registry: Registry, v1: ContractMetadataV1): ContractMetadataV2 {
return registry.createType('ContractMetadataV2', objectSpread({}, v1, {
spec: objectSpread({}, v1.spec, {
constructors: v1ToV2Labels(registry, 'ContractConstructorSpec', v1.spec.constructors),
events: v1ToV2Labels(registry, 'ContractEventSpec', v1.spec.events),
messages: v1ToV2Labels(registry, 'ContractMessageSpec', v1.spec.messages)
})
}));
}
+18
View File
@@ -0,0 +1,18 @@
// Copyright 2017-2025 @pezkuwi/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { ContractMetadataV2, ContractMetadataV3 } from '@pezkuwi/types/interfaces';
import type { Registry } from '@pezkuwi/types/types';
import { objectSpread } from '@pezkuwi/util';
export function v2ToV3 (registry: Registry, v2: ContractMetadataV2): ContractMetadataV3 {
return registry.createType('ContractMetadataV3', objectSpread({}, v2, {
spec: objectSpread({}, v2.spec, {
constructors: v2.spec.constructors.map((c) =>
// V3 introduces the payable flag on constructors, for <V3, it is always true
registry.createType('ContractConstructorSpecV3', objectSpread({}, c, { payable: true }))
)
})
}));
}
+21
View File
@@ -0,0 +1,21 @@
// Copyright 2017-2025 @pezkuwi/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { ContractMetadataV3, ContractMetadataV4 } from '@pezkuwi/types/interfaces';
import type { Registry } from '@pezkuwi/types/types';
import { objectSpread } from '@pezkuwi/util';
export function v3ToV4 (registry: Registry, v3: ContractMetadataV3): ContractMetadataV4 {
return registry.createType('ContractMetadataV4', objectSpread({}, v3, {
spec: objectSpread({}, v3.spec, {
constructors: v3.spec.constructors.map((c) =>
registry.createType('ContractConstructorSpecV4', objectSpread({}, c))
),
messages: v3.spec.messages.map((m) =>
registry.createType('ContractMessageSpecV3', objectSpread({}, m))
)
}),
version: registry.createType('Text', '4')
}));
}
+4
View File
@@ -0,0 +1,4 @@
// Copyright 2017-2025 @pezkuwi/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
import '@pezkuwi/api-augment';
+52
View File
@@ -0,0 +1,52 @@
// Copyright 2017-2025 @pezkuwi/api authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { ApiBase } from '@pezkuwi/api/base';
import type { ApiTypes, DecorateMethod } from '@pezkuwi/api/types';
import type { WeightV2 } from '@pezkuwi/types/interfaces';
import type { Registry } from '@pezkuwi/types/types';
import { isFunction } from '@pezkuwi/util';
import { Abi } from '../Abi/index.js';
export abstract class Base<ApiType extends ApiTypes> {
readonly abi: Abi;
readonly api: ApiBase<ApiType>;
protected readonly _decorateMethod: DecorateMethod<ApiType>;
protected readonly _isWeightV1: boolean;
protected readonly _isRevive: boolean;
constructor (api: ApiBase<ApiType>, abi: string | Record<string, unknown> | Abi, decorateMethod: DecorateMethod<ApiType>) {
if (!api || !api.isConnected || !api.tx) {
throw new Error('Your API has not been initialized correctly and is not connected to a chain');
}
this.abi = abi instanceof Abi
? abi
: new Abi(abi, api.registry.getChainProperties());
this.api = api;
this._decorateMethod = decorateMethod;
this._isWeightV1 = !api.registry.createType<WeightV2>('Weight').proofSize;
this._isRevive = this.abi.isRevive;
if (this._isRevive) {
if (!api.tx.revive || !isFunction(api.tx.revive.instantiateWithCode) || api.tx.revive.instantiateWithCode.meta.args.length !== 6) {
throw new Error('The runtime does not expose api.tx.revive.instantiateWithCode with storageDepositLimit');
} else if (!api.call.reviveApi || !isFunction(api.call.reviveApi.call)) {
throw new Error('Your runtime does not expose the api.call.reviveApi.call runtime interfaces');
}
} else {
if (!api.tx.contracts || !isFunction(api.tx.contracts.instantiateWithCode) || api.tx.contracts.instantiateWithCode.meta.args.length !== 6) {
throw new Error('The runtime does not expose api.tx.contracts.instantiateWithCode with storageDepositLimit');
} else if (!api.call.contractsApi || !isFunction(api.call.contractsApi.call)) {
throw new Error('Your runtime does not expose the api.call.contractsApi.call runtime interfaces');
}
}
}
public get registry (): Registry {
return this.api.registry;
}
}
@@ -0,0 +1,90 @@
// Copyright 2017-2025 @pezkuwi/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { ApiBase } from '@pezkuwi/api/base';
import type { SubmittableExtrinsic } from '@pezkuwi/api/submittable/types';
import type { ApiTypes, DecorateMethod } from '@pezkuwi/api/types';
import type { AccountId, EventRecord, Hash } from '@pezkuwi/types/interfaces';
import type { ISubmittableResult } from '@pezkuwi/types/types';
import type { Abi } from '../Abi/index.js';
import type { AbiConstructor, BlueprintOptions } from '../types.js';
import type { MapConstructorExec } from './types.js';
import { SubmittableResult } from '@pezkuwi/api';
import { BN_ZERO, isUndefined } from '@pezkuwi/util';
import { applyOnEvent } from '../util.js';
import { Base } from './Base.js';
import { Contract } from './Contract.js';
import { convertWeight, createBluePrintTx, encodeSalt } from './util.js';
export type BlueprintConstructor<ApiType extends ApiTypes> = new(api: ApiBase<ApiType>, abi: string | Record<string, unknown> | Abi, codeHash: string | Hash | Uint8Array) => Blueprint<ApiType>;
export class BlueprintSubmittableResult<ApiType extends ApiTypes> extends SubmittableResult {
readonly contract?: Contract<ApiType> | undefined;
constructor (result: ISubmittableResult, contract?: Contract<ApiType>) {
super(result);
this.contract = contract;
}
}
export class Blueprint<ApiType extends ApiTypes> extends Base<ApiType> {
/**
* @description The on-chain code hash for this blueprint
*/
readonly codeHash: Hash;
readonly #tx: MapConstructorExec<ApiType> = {};
constructor (api: ApiBase<ApiType>, abi: string | Record<string, unknown> | Abi, codeHash: string | Hash | Uint8Array, decorateMethod: DecorateMethod<ApiType>) {
super(api, abi, decorateMethod);
this.codeHash = this.registry.createType('Hash', codeHash);
this.abi.constructors.forEach((c): void => {
if (isUndefined(this.#tx[c.method])) {
this.#tx[c.method] = createBluePrintTx(c, (o, p) => this.#deploy(c, o, p));
}
});
}
public get tx (): MapConstructorExec<ApiType> {
return this.#tx;
}
#deploy = (constructorOrId: AbiConstructor | string | number, { gasLimit = BN_ZERO, salt, storageDepositLimit = null, value = BN_ZERO }: BlueprintOptions, params: unknown[]): SubmittableExtrinsic<ApiType, BlueprintSubmittableResult<ApiType>> => {
const palletTx = this._isRevive
? this.api.tx.revive
: this.api.tx.contracts;
return palletTx.instantiate(
value,
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore jiggle v1 weights, metadata points to latest
this._isWeightV1
? convertWeight(gasLimit).v1Weight
: convertWeight(gasLimit).v2Weight,
storageDepositLimit,
this.codeHash,
this.abi.findConstructor(constructorOrId).toU8a(params),
encodeSalt(salt)
).withResultTransform((result: ISubmittableResult) =>
new BlueprintSubmittableResult(result, applyOnEvent(result, ['Instantiated'], ([record]: EventRecord[]) =>
new Contract<ApiType>(this.api, this.abi, record.event.data[1] as AccountId, this._decorateMethod), this._isRevive
)
)
);
};
}
export function extendBlueprint <ApiType extends ApiTypes> (type: ApiType, decorateMethod: DecorateMethod<ApiType>): BlueprintConstructor<ApiType> {
return class extends Blueprint<ApiType> {
static __BlueprintType = type;
constructor (api: ApiBase<ApiType>, abi: string | Record<string, unknown> | Abi, codeHash: string | Hash | Uint8Array) {
super(api, abi, codeHash, decorateMethod);
}
};
}
@@ -0,0 +1,47 @@
// Copyright 2017-2025 @pezkuwi/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
/// <reference types="@pezkuwi/dev-test/globals.d.ts" />
import fs from 'node:fs';
import { toPromiseMethod } from '@pezkuwi/api';
import v0contractFlipper from '../test/contracts/ink/v0/flipper.contract.json' assert { type: 'json' };
import v0abiFlipper from '../test/contracts/ink/v0/flipper.json' assert { type: 'json' };
import v1contractFlipper from '../test/contracts/ink/v1/flipper.contract.json' assert { type: 'json' };
import v6contractErc20 from '../test/contracts/ink/v6/erc20.contract.json' assert { type: 'json' };
import { Code } from './Code.js';
import { mockApi, mockReviveApi } from './mock.js';
const v0wasmFlipper = fs.readFileSync(new URL('../test/contracts/ink/v0/flipper.wasm', import.meta.url), 'utf-8');
describe('Code', (): void => {
it('can construct with an individual ABI/WASM combo', (): void => {
expect(
() => new Code(mockApi, v0abiFlipper as Record<string, unknown>, v0wasmFlipper, toPromiseMethod)
).not.toThrow();
});
it('can construct with an .contract ABI (v0)', (): void => {
expect(
() => new Code(mockApi, v0contractFlipper as Record<string, unknown>, null, toPromiseMethod)
).not.toThrow();
});
it('can construct with an .contract ABI (v1)', (): void => {
expect(
() => new Code(mockApi, v1contractFlipper as Record<string, unknown>, null, toPromiseMethod)
).not.toThrow();
});
it('can construct a revive compatible contract (v6)', (): void => {
expect(
() => new Code(mockApi, v6contractErc20 as Record<string, unknown>, null, toPromiseMethod)
).toThrow('The runtime does not expose api.tx.revive.instantiateWithCode with storageDepositLimit');
expect(
() => new Code(mockReviveApi, v6contractErc20 as Record<string, unknown>, null, toPromiseMethod)
).not.toThrow();
});
});
+142
View File
@@ -0,0 +1,142 @@
// Copyright 2017-2025 @pezkuwi/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { ApiBase } from '@pezkuwi/api/base';
import type { SubmittableExtrinsic } from '@pezkuwi/api/submittable/types';
import type { ApiTypes, DecorateMethod } from '@pezkuwi/api/types';
import type { AccountId, EventRecord } from '@pezkuwi/types/interfaces';
import type { ISubmittableResult } from '@pezkuwi/types/types';
import type { Codec } from '@pezkuwi/types-codec/types';
import type { Abi } from '../Abi/index.js';
import type { AbiConstructor, BlueprintOptions } from '../types.js';
import type { MapConstructorExec } from './types.js';
import { SubmittableResult } from '@pezkuwi/api';
import { BN_ZERO, compactAddLength, isRiscV, isUndefined, isWasm, u8aToU8a } from '@pezkuwi/util';
import { applyOnEvent } from '../util.js';
import { Base } from './Base.js';
import { Blueprint } from './Blueprint.js';
import { Contract } from './Contract.js';
import { convertWeight, createBluePrintTx, encodeSalt } from './util.js';
export type CodeConstructor<ApiType extends ApiTypes> = new(api: ApiBase<ApiType>, abi: string | Record<string, unknown> | Abi, wasm: Uint8Array | string | Buffer | null | undefined) => Code<ApiType>;
export class CodeSubmittableResult<ApiType extends ApiTypes> extends SubmittableResult {
readonly blueprint?: Blueprint<ApiType> | undefined;
readonly contract?: Contract<ApiType> | undefined;
constructor (result: ISubmittableResult, blueprint?: Blueprint<ApiType> | undefined, contract?: Contract<ApiType> | undefined) {
super(result);
this.blueprint = blueprint;
this.contract = contract;
}
}
// checks to see if the code (or at least the header)
// is a valid/supported format
function isValidCode (code: Uint8Array): boolean {
return isWasm(code) || isRiscV(code);
}
export class Code<ApiType extends ApiTypes> extends Base<ApiType> {
readonly code: Uint8Array;
readonly #tx: MapConstructorExec<ApiType> = {};
constructor (api: ApiBase<ApiType>, abi: string | Record<string, unknown> | Abi, wasm: Uint8Array | string | Buffer | null | undefined, decorateMethod: DecorateMethod<ApiType>) {
super(api, abi, decorateMethod);
this.code = isValidCode(this.abi.info.source.wasm)
? this.abi.info.source.wasm
: u8aToU8a(wasm);
if (!isValidCode(this.code)) {
throw new Error('Invalid code provided');
}
this.abi.constructors.forEach((c): void => {
if (isUndefined(this.#tx[c.method])) {
this.#tx[c.method] = createBluePrintTx(c, (o, p) => this.#instantiate(c, o, p));
}
});
}
public get tx (): MapConstructorExec<ApiType> {
return this.#tx;
}
#instantiate = (constructorOrId: AbiConstructor | string | number, { gasLimit = BN_ZERO, salt, storageDepositLimit = null, value = BN_ZERO }: BlueprintOptions, params: unknown[]): SubmittableExtrinsic<ApiType, CodeSubmittableResult<ApiType>> => {
const palletTx = this._isRevive ? this.api.tx.revive : this.api.tx.contracts;
if (this._isRevive) {
return palletTx.instantiateWithCode(
value,
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore jiggle v1 weights, metadata points to latest
this._isWeightV1
? convertWeight(gasLimit).v1Weight
: convertWeight(gasLimit).v2Weight,
storageDepositLimit,
compactAddLength(this.code),
this.abi.findConstructor(constructorOrId).toU8a(params),
encodeSalt(salt)
).withResultTransform((result: ISubmittableResult) =>
new CodeSubmittableResult(
result,
...(applyOnEvent(result, ['Instantiated'], (records: EventRecord[]) =>
records.reduce<[Blueprint<ApiType> | undefined, Contract<ApiType> | undefined]>(
([blueprint, contract], { event }) =>
this.api.events.revive['Instantiated'].is(event)
? [
blueprint,
new Contract<ApiType>(
this.api,
this.abi,
(event as unknown as { data: [Codec, AccountId] }).data[1],
this._decorateMethod
)
]
: [blueprint, contract],
[undefined, undefined]
), this._isRevive
) || [undefined, undefined])
)
);
}
return palletTx.instantiateWithCode(
value,
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore jiggle v1 weights, metadata points to latest
this._isWeightV1
? convertWeight(gasLimit).v1Weight
: convertWeight(gasLimit).v2Weight,
storageDepositLimit,
compactAddLength(this.code),
this.abi.findConstructor(constructorOrId).toU8a(params),
encodeSalt(salt)
).withResultTransform((result: ISubmittableResult) =>
new CodeSubmittableResult(result, ...(applyOnEvent(result, ['CodeStored', 'Instantiated'], (records: EventRecord[]) =>
records.reduce<[Blueprint<ApiType> | undefined, Contract<ApiType> | undefined]>(([blueprint, contract], { event }) =>
this.api.events.contracts.Instantiated.is(event)
? [blueprint, new Contract<ApiType>(this.api, this.abi, (event as unknown as { data: [Codec, AccountId] }).data[1], this._decorateMethod)]
: this.api.events.contracts.CodeStored.is(event)
? [new Blueprint<ApiType>(this.api, this.abi, (event as unknown as { data: [AccountId] }).data[0], this._decorateMethod), contract]
: [blueprint, contract],
[undefined, undefined]), this._isRevive
) || [undefined, undefined]))
);
};
}
export function extendCode <ApiType extends ApiTypes> (type: ApiType, decorateMethod: DecorateMethod<ApiType>): CodeConstructor<ApiType> {
return class extends Code<ApiType> {
static __CodeType = type;
constructor (api: ApiBase<ApiType>, abi: string | Record<string, unknown> | Abi, wasm: Uint8Array | string | Buffer | null | undefined) {
super(api, abi, wasm, decorateMethod);
}
};
}
+197
View File
@@ -0,0 +1,197 @@
// Copyright 2017-2025 @pezkuwi/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { ApiBase } from '@pezkuwi/api/base';
import type { SubmittableExtrinsic } from '@pezkuwi/api/submittable/types';
import type { ApiTypes, DecorateMethod } from '@pezkuwi/api/types';
import type { AccountId, AccountId20, ContractExecResult, EventRecord, Weight, WeightV2 } from '@pezkuwi/types/interfaces';
import type { ISubmittableResult } from '@pezkuwi/types/types';
import type { Abi } from '../Abi/index.js';
import type { AbiMessage, ContractCallOutcome, ContractOptions, DecodedEvent, WeightAll } from '../types.js';
import type { ContractCallResult, ContractCallSend, ContractQuery, ContractTx, MapMessageQuery, MapMessageTx } from './types.js';
import { map } from 'rxjs';
import { SubmittableResult } from '@pezkuwi/api';
import { BN, BN_HUNDRED, BN_ONE, BN_ZERO, isUndefined, logger } from '@pezkuwi/util';
import { applyOnEvent } from '../util.js';
import { Base } from './Base.js';
import { convertWeight, withMeta } from './util.js';
export type ContractConstructor<ApiType extends ApiTypes> = new(api: ApiBase<ApiType>, abi: string | Record<string, unknown> | Abi, address: string | AccountId) => Contract<ApiType>;
// As per Rust, 5 * GAS_PER_SEC
const MAX_CALL_GAS = new BN(5_000_000_000_000).isub(BN_ONE);
const l = logger('Contract');
function createQuery <ApiType extends ApiTypes> (meta: AbiMessage, fn: (origin: string | AccountId | Uint8Array, options: ContractOptions, params: unknown[]) => ContractCallResult<ApiType, ContractCallOutcome>): ContractQuery<ApiType> {
return withMeta(meta, (origin: string | AccountId | Uint8Array, options: ContractOptions, ...params: unknown[]): ContractCallResult<ApiType, ContractCallOutcome> =>
fn(origin, options, params)
);
}
function createTx <ApiType extends ApiTypes> (meta: AbiMessage, fn: (options: ContractOptions, params: unknown[]) => SubmittableExtrinsic<ApiType>): ContractTx<ApiType> {
return withMeta(meta, (options: ContractOptions, ...params: unknown[]): SubmittableExtrinsic<ApiType> =>
fn(options, params)
);
}
export class ContractSubmittableResult extends SubmittableResult {
readonly contractEvents?: DecodedEvent[] | undefined;
constructor (result: ISubmittableResult, contractEvents?: DecodedEvent[]) {
super(result);
this.contractEvents = contractEvents;
}
}
export class Contract<ApiType extends ApiTypes> extends Base<ApiType> {
/**
* @description The on-chain address for this contract
*/
readonly address: AccountId | AccountId20;
readonly #query: MapMessageQuery<ApiType> = {};
readonly #tx: MapMessageTx<ApiType> = {};
constructor (api: ApiBase<ApiType>, abi: string | Record<string, unknown> | Abi, address: string | AccountId | AccountId20, decorateMethod: DecorateMethod<ApiType>) {
super(api, abi, decorateMethod);
this.address = this.registry.createType(this._isRevive ? 'AccountId20' : 'AccountId', address);
this.abi.messages.forEach((m): void => {
if (isUndefined(this.#tx[m.method])) {
this.#tx[m.method] = createTx(m, (o, p) => this.#exec(m, o, p));
}
if (isUndefined(this.#query[m.method])) {
this.#query[m.method] = createQuery(m, (f, o, p) => this.#read(m, o, p).send(f));
}
});
}
public get query (): MapMessageQuery<ApiType> {
return this.#query;
}
public get tx (): MapMessageTx<ApiType> {
return this.#tx;
}
#getGas = (_gasLimit: bigint | BN | string | number | WeightV2, isCall = false): WeightAll => {
const weight = convertWeight(_gasLimit);
if (weight.v1Weight.gt(BN_ZERO)) {
return weight;
}
return convertWeight(
isCall
? MAX_CALL_GAS
: convertWeight(
this.api.consts.system.blockWeights
? (this.api.consts.system.blockWeights as unknown as { maxBlock: WeightV2 }).maxBlock
: this.api.consts.system['maximumBlockWeight'] as Weight
).v1Weight.muln(64).div(BN_HUNDRED)
);
};
#exec = (messageOrId: AbiMessage | string | number, { gasLimit = BN_ZERO, storageDepositLimit = null, value = BN_ZERO }: ContractOptions, params: unknown[]): SubmittableExtrinsic<ApiType> => {
const palletTx = this._isRevive ? this.api.tx.revive : this.api.tx.contracts;
return palletTx.call(
this.address,
value,
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore jiggle v1 weights, metadata points to latest
this._isWeightV1
? convertWeight(gasLimit).v1Weight
: convertWeight(gasLimit).v2Weight,
storageDepositLimit,
this.abi.findMessage(messageOrId).toU8a(params)
).withResultTransform((result: ISubmittableResult) =>
// ContractEmitted is the current generation, ContractExecution is the previous generation
new ContractSubmittableResult(result, applyOnEvent(result, ['ContractEmitted', 'ContractExecution'], (records: EventRecord[]) =>
records
// Filter to only decode events emitted by this specific contract instance.
.filter((record): boolean => {
try {
const contractAddress = record.event.data[0];
if (this.address.eq(contractAddress)) {
return true;
}
l.debug(`Skipping event from different contract ${contractAddress.toString()} (this contract: ${this.address.toString()})`);
return false;
} catch (error) {
l.warn(`Unable to extract contract address from event: ${(error as Error).message}`);
return false;
}
})
.map((record): DecodedEvent | null => {
try {
return this.abi.decodeEvent(record);
} catch (error) {
l.error(`Unable to decode contract event: ${(error as Error).message}`);
return null;
}
})
.filter((decoded): decoded is DecodedEvent => !!decoded), this._isRevive
))
);
};
#read = (messageOrId: AbiMessage | string | number, { gasLimit = BN_ZERO, storageDepositLimit = null, value = BN_ZERO }: ContractOptions, params: unknown[]): ContractCallSend<ApiType> => {
const message = this.abi.findMessage(messageOrId);
return {
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
send: this._decorateMethod((origin: string | AccountId | Uint8Array) =>
(this._isRevive
? this.api.rx.call.reviveApi.call
: this.api.rx.call.contractsApi.call)<ContractExecResult>(
origin,
this.address,
value,
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore jiggle v1 weights, metadata points to latest
this._isWeightV1
? this.#getGas(gasLimit, true).v1Weight
: this.#getGas(gasLimit, true).v2Weight,
storageDepositLimit,
message.toU8a(params)
).pipe(
map(({ debugMessage, gasConsumed, gasRequired, result, storageDeposit }): ContractCallOutcome => ({
debugMessage,
gasConsumed,
gasRequired: gasRequired && !convertWeight(gasRequired).v1Weight.isZero()
? gasRequired
: gasConsumed,
output: result.isOk && message.returnType
? this.abi.registry.createTypeUnsafe(message.returnType.lookupName || message.returnType.type, [result.asOk.data.toU8a(true)], { isPedantic: true })
: null,
result,
storageDeposit
}))
)
)
};
};
}
export function extendContract <ApiType extends ApiTypes> (type: ApiType, decorateMethod: DecorateMethod<ApiType>): ContractConstructor<ApiType> {
return class extends Contract<ApiType> {
static __ContractType = type;
constructor (api: ApiBase<ApiType>, abi: string | Record<string, unknown> | Abi, address: string | AccountId) {
super(api, abi, address, decorateMethod);
}
};
}
+6
View File
@@ -0,0 +1,6 @@
// Copyright 2017-2025 @pezkuwi/api authors & contributors
// SPDX-License-Identifier: Apache-2.0
export { Blueprint, BlueprintSubmittableResult, extendBlueprint } from './Blueprint.js';
export { Code, CodeSubmittableResult, extendCode } from './Code.js';
export { Contract, extendContract } from './Contract.js';
+48
View File
@@ -0,0 +1,48 @@
// Copyright 2017-2025 @pezkuwi/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { ApiBase } from '@pezkuwi/api/base';
import { TypeRegistry } from '@pezkuwi/types';
const registry = new TypeRegistry();
const instantiateWithCode = (): never => {
throw new Error('mock');
};
instantiateWithCode.meta = { args: new Array(6) };
export const mockApi = {
call: {
contractsApi: {
call: (): never => {
throw new Error('mock');
}
}
},
isConnected: true,
registry,
tx: {
contracts: {
instantiateWithCode
}
}
} as unknown as ApiBase<'promise'>;
export const mockReviveApi = {
call: {
reviveApi: {
call: (): never => {
throw new Error('mock');
}
}
},
isConnected: true,
registry,
tx: {
revive: {
instantiateWithCode
}
}
} as unknown as ApiBase<'promise'>;
+40
View File
@@ -0,0 +1,40 @@
// Copyright 2017-2025 @pezkuwi/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Observable } from 'rxjs';
import type { SubmittableExtrinsic } from '@pezkuwi/api/submittable/types';
import type { ApiTypes, ObsInnerType } from '@pezkuwi/api/types';
import type { AccountId } from '@pezkuwi/types/interfaces';
import type { AbiMessage, BlueprintOptions, ContractCallOutcome, ContractOptions } from '../types.js';
export interface MessageMeta {
readonly meta: AbiMessage;
}
export interface BlueprintDeploy<ApiType extends ApiTypes> extends MessageMeta {
(options: BlueprintOptions, ...params: unknown[]): SubmittableExtrinsic<ApiType>;
}
export interface ContractQuery<ApiType extends ApiTypes> extends MessageMeta {
(origin: AccountId | string | Uint8Array, options: ContractOptions, ...params: unknown[]): ContractCallResult<ApiType, ContractCallOutcome>;
}
export interface ContractTx<ApiType extends ApiTypes> extends MessageMeta {
(options: ContractOptions, ...params: unknown[]): SubmittableExtrinsic<ApiType>;
}
export type ContractGeneric<O, T> = (messageOrId: AbiMessage | string | number, options: O, ...params: unknown[]) => T;
export type ContractCallResult<ApiType extends ApiTypes, T> = ApiType extends 'rxjs'
? Observable<T>
: Promise<ObsInnerType<Observable<T>>>;
export interface ContractCallSend<ApiType extends ApiTypes> {
send (account: string | AccountId | Uint8Array): ContractCallResult<ApiType, ContractCallOutcome>;
}
export type MapConstructorExec<ApiType extends ApiTypes> = Record<string, BlueprintDeploy<ApiType>>;
export type MapMessageTx<ApiType extends ApiTypes> = Record<string, ContractTx<ApiType>>;
export type MapMessageQuery<ApiType extends ApiTypes> = Record<string, ContractQuery<ApiType>>;
+56
View File
@@ -0,0 +1,56 @@
// Copyright 2017-2025 @pezkuwi/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { SubmittableResult } from '@pezkuwi/api';
import type { SubmittableExtrinsic } from '@pezkuwi/api/submittable/types';
import type { ApiTypes } from '@pezkuwi/api/types';
import type { WeightV1, WeightV2 } from '@pezkuwi/types/interfaces';
import type { BN } from '@pezkuwi/util';
import type { AbiConstructor, AbiMessage, BlueprintOptions, WeightAll } from '../types.js';
import type { BlueprintDeploy, ContractGeneric } from './types.js';
import { Bytes } from '@pezkuwi/types';
import { bnToBn, compactAddLength, u8aToU8a } from '@pezkuwi/util';
import { randomAsU8a } from '@pezkuwi/util-crypto';
export const EMPTY_SALT = new Uint8Array();
export function withMeta <T extends { meta: AbiMessage }> (meta: AbiMessage, creator: Omit<T, 'meta'>): T {
(creator as T).meta = meta;
return creator as T;
}
export function createBluePrintTx <ApiType extends ApiTypes, R extends SubmittableResult> (meta: AbiMessage, fn: (options: BlueprintOptions, params: unknown[]) => SubmittableExtrinsic<ApiType, R>): BlueprintDeploy<ApiType> {
return withMeta(meta, (options: BlueprintOptions, ...params: unknown[]): SubmittableExtrinsic<ApiType, R> =>
fn(options, params)
);
}
export function createBluePrintWithId <T> (fn: (constructorOrId: AbiConstructor | string | number, options: BlueprintOptions, params: unknown[]) => T): ContractGeneric<BlueprintOptions, T> {
return (constructorOrId: AbiConstructor | string | number, options: BlueprintOptions, ...params: unknown[]): T =>
fn(constructorOrId, options, params);
}
export function encodeSalt (salt: Uint8Array | string | null = randomAsU8a()): Uint8Array {
return salt instanceof Bytes
? salt
: salt?.length
? compactAddLength(u8aToU8a(salt))
: EMPTY_SALT;
}
export function convertWeight (weight: WeightV1 | WeightV2 | bigint | string | number | BN): WeightAll {
const [refTime, proofSize] = isWeightV2(weight)
? [weight.refTime.toBn(), weight.proofSize.toBn()]
: [bnToBn(weight), undefined];
return {
v1Weight: refTime,
v2Weight: { proofSize, refTime }
};
}
export function isWeightV2 (weight: WeightV1 | WeightV2 | bigint | string | number | BN): weight is WeightV2 {
return !!(weight as WeightV2).proofSize;
}
+10
View File
@@ -0,0 +1,10 @@
// Copyright 2017-2025 @pezkuwi/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
// all named
export { Abi } from './Abi/index.js';
export { packageInfo } from './packageInfo.js';
// all starred
export * from './promise/index.js';
export * from './rx/index.js';
@@ -0,0 +1,45 @@
// Copyright 2017-2025 @pezkuwi/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
// Simple non-runnable checks to test type definitions in the editor itself
import '@pezkuwi/api-augment';
import type { TestKeyringMapBizinikiwi } from '@pezkuwi/keyring/testingPairs';
import { ApiPromise } from '@pezkuwi/api';
import { BlueprintPromise, ContractPromise } from '@pezkuwi/api-contract';
import { createTestPairs } from '@pezkuwi/keyring/testingPairs';
import abiIncrementer from './test/contracts/ink/v0/incrementer.json' assert { type: 'json' };
async function checkBlueprint (api: ApiPromise, pairs: TestKeyringMapBizinikiwi): Promise<void> {
const blueprint = new BlueprintPromise(api, abiIncrementer as Record<string, unknown>, '0x1234');
await blueprint.tx['new']({ gasLimit: 456, salt: '0x1234', value: 123 }, 42).signAndSend(pairs.bob);
await blueprint.tx['new']({ gasLimit: 456, value: 123 }, 42).signAndSend(pairs.bob);
}
async function checkContract (api: ApiPromise, pairs: TestKeyringMapBizinikiwi): Promise<void> {
const contract = new ContractPromise(api, abiIncrementer as Record<string, unknown>, '0x1234');
// queries
await contract.query['get'](pairs.alice.address, {});
// execute
await contract.tx['inc']({ gasLimit: 1234 }, 123).signAndSend(pairs.eve);
}
async function main (): Promise<void> {
const api = await ApiPromise.create({
hasher: (data: Uint8Array): Uint8Array => data
});
const pairs = createTestPairs();
await Promise.all([
checkBlueprint(api, pairs),
checkContract(api, pairs)
]);
}
main().catch(console.error);
+6
View File
@@ -0,0 +1,6 @@
// Copyright 2017-2025 @pezkuwi/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
import './packageDetect.js';
export * from './bundle.js';
+4
View File
@@ -0,0 +1,4 @@
// Copyright 2017-2025 @pezkuwi/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
export * from './index.js';
@@ -0,0 +1,13 @@
// Copyright 2017-2026 @pezkuwi/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
// Do not edit, auto-generated by @pezkuwi/dev
// (packageInfo imports will be kept as-is, user-editable)
import { packageInfo as apiInfo } from '@pezkuwi/api/packageInfo';
import { packageInfo as typesInfo } from '@pezkuwi/types/packageInfo';
import { detectPackage } from '@pezkuwi/util';
import { packageInfo } from './packageInfo.js';
detectPackage(packageInfo, null, [apiInfo, typesInfo]);
+6
View File
@@ -0,0 +1,6 @@
// Copyright 2017-2026 @pezkuwi/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
// Do not edit, auto-generated by @pezkuwi/dev
export const packageInfo = { name: '@pezkuwi/api-contract', path: 'auto', type: 'auto', version: '16.5.4' };
@@ -0,0 +1,28 @@
// Copyright 2017-2025 @pezkuwi/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { ApiPromise } from '@pezkuwi/api';
import type { AccountId, AccountId20, Hash } from '@pezkuwi/types/interfaces';
import type { Abi } from '../Abi/index.js';
import { toPromiseMethod } from '@pezkuwi/api';
import { Blueprint, Code, Contract } from '../base/index.js';
export class BlueprintPromise extends Blueprint<'promise'> {
constructor (api: ApiPromise, abi: string | Record<string, unknown> | Abi, codeHash: string | Hash) {
super(api, abi, codeHash, toPromiseMethod);
}
}
export class CodePromise extends Code<'promise'> {
constructor (api: ApiPromise, abi: string | Record<string, unknown> | Abi, wasm: Uint8Array | string | Buffer | null | undefined) {
super(api, abi, wasm, toPromiseMethod);
}
}
export class ContractPromise extends Contract<'promise'> {
constructor (api: ApiPromise, abi: string | Record<string, unknown> | Abi, address: string | AccountId | AccountId20) {
super(api, abi, address, toPromiseMethod);
}
}
@@ -0,0 +1,7 @@
// Copyright 2017-2025 @pezkuwi/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { BlueprintSubmittableResult as BaseBlueprintSubmittableResult, CodeSubmittableResult as BaseCodeSubmittableResult } from '../base/index.js';
export type BlueprintSubmittableResult = BaseBlueprintSubmittableResult<'promise'>;
export type CodeSubmittableResult = BaseCodeSubmittableResult<'promise'>;
+28
View File
@@ -0,0 +1,28 @@
// Copyright 2017-2025 @pezkuwi/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { ApiRx } from '@pezkuwi/api';
import type { AccountId, Hash } from '@pezkuwi/types/interfaces';
import type { Abi } from '../Abi/index.js';
import { toRxMethod } from '@pezkuwi/api';
import { Blueprint, Code, Contract } from '../base/index.js';
export class BlueprintRx extends Blueprint<'rxjs'> {
constructor (api: ApiRx, abi: string | Record<string, unknown> | Abi, codeHash: string | Hash) {
super(api, abi, codeHash, toRxMethod);
}
}
export class CodeRx extends Code<'rxjs'> {
constructor (api: ApiRx, abi: string | Record<string, unknown> | Abi, wasm: Uint8Array | string | Buffer | null | undefined) {
super(api, abi, wasm, toRxMethod);
}
}
export class ContractRx extends Contract<'rxjs'> {
constructor (api: ApiRx, abi: string | Record<string, unknown> | Abi, address: string | AccountId) {
super(api, abi, address, toRxMethod);
}
}
+7
View File
@@ -0,0 +1,7 @@
// Copyright 2017-2025 @pezkuwi/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { BlueprintSubmittableResult as BaseBlueprintSubmittableResult, CodeSubmittableResult as BaseCodeSubmittableResult } from '../base/index.js';
export type BlueprintSubmittableResult = BaseBlueprintSubmittableResult<'promise'>;
export type CodeSubmittableResult = BaseCodeSubmittableResult<'promise'>;

Some files were not shown because too many files have changed in this diff Show More