typegen: keep array and null inputs for types that contain an account

getSimilarTypes widened lookup types by name before its class checks, with
type.includes('AccountId32') and type.includes('MultiAddress'). Those also
match every type that only contains one: Vec<AccountId32>,
Option<AccountId32>, ITuple<[AccountId32, u32]>, Vec<MultiAddress>. They
were widened like a bare account and returned before reaching the Vec,
Option or Tuple branch, so the generated augment typed
multisig.asMulti(otherSignatories) as `Vec<AccountId32> | string |
Uint8Array` (no string[]), an Option<AccountId32> argument without null,
and a tuple key without its tuple form.

The names are now matched whole. The augment is regenerated
(yarn build:metadata); for these types it now matches what upstream
generates, e.g. `Vec<AccountId32> | (AccountId32 | string | Uint8Array)[]`.
This commit is contained in:
Satoshi Qazi Muhammed authored and SatoshiQaziMuhammed committed 2026-10-08 23:02:46 +04:00
1 parent 2a358917c7
commit a0b19f4916
12 files changed
+157 -138

No files matched your search

+2 -2
View File
@@ -47,7 +47,7 @@ declare module '@pezkuwi/api-base/types/storage' {
* Amounts currently reserved in the accounts of the bidders currently winning
* (sub-)ranges.
**/
reservedAmounts: AugmentedQuery<ApiType, (arg: ITuple<[AccountId32, u32]> | string | Uint8Array) => Observable<Option<u128>>, [ITuple<[AccountId32, u32]>]> & QueryableStorageEntry<ApiType, [ITuple<[AccountId32, u32]>]>;
reservedAmounts: AugmentedQuery<ApiType, (arg: ITuple<[AccountId32, u32]> | [AccountId32 | string | Uint8Array, u32 | AnyNumber | Uint8Array]) => Observable<Option<u128>>, [ITuple<[AccountId32, u32]>]> & QueryableStorageEntry<ApiType, [ITuple<[AccountId32, u32]>]>;
/**
* The winning bids for each of the 10 ranges at each sample in the final Ending Period of
* the current auction. The map's key is the 0-based index into the Sample Size. The
@@ -2089,7 +2089,7 @@ declare module '@pezkuwi/api-base/types/storage' {
* Records information about the maximum slash of a stash within a slashing span,
* as well as how much reward has been paid out.
**/
spanSlash: AugmentedQuery<ApiType, (arg: ITuple<[AccountId32, u32]> | string | Uint8Array) => Observable<PezpalletStakingSlashingSpanRecord>, [ITuple<[AccountId32, u32]>]> & QueryableStorageEntry<ApiType, [ITuple<[AccountId32, u32]>]>;
spanSlash: AugmentedQuery<ApiType, (arg: ITuple<[AccountId32, u32]> | [AccountId32 | string | Uint8Array, u32 | AnyNumber | Uint8Array]) => Observable<PezpalletStakingSlashingSpanRecord>, [ITuple<[AccountId32, u32]>]> & QueryableStorageEntry<ApiType, [ITuple<[AccountId32, u32]>]>;
/**
* All unapplied slashes that are queued for later.
**/
+20 -20
View File
@@ -198,7 +198,7 @@ declare module '@pezkuwi/api-base/types/submittable' {
* be upgraded. (We let some not have to be upgraded just in order to allow for the
* possibility of churn).
**/
upgradeAccounts: AugmentedSubmittable<(who: Vec<AccountId32> | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Vec<AccountId32>]>;
upgradeAccounts: AugmentedSubmittable<(who: Vec<AccountId32> | (AccountId32 | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [Vec<AccountId32>]>;
/**
* Generic tx
**/
@@ -687,7 +687,7 @@ declare module '@pezkuwi/api-base/types/submittable' {
* </weight>
**/
mintClaim: AugmentedSubmittable<(who: EthereumAddress | string | Uint8Array, value: u128 | AnyNumber | Uint8Array, vestingSchedule: Option<ITuple<[u128, u128, u32]>> | null | Uint8Array | ITuple<[u128, u128, u32]> | [u128 | AnyNumber | Uint8Array, u128 | AnyNumber | Uint8Array, u32 | AnyNumber | Uint8Array], statement: Option<PezkuwiRuntimeCommonClaimsStatementKind> | null | Uint8Array | PezkuwiRuntimeCommonClaimsStatementKind) => SubmittableExtrinsic<ApiType>, [EthereumAddress, u128, Option<ITuple<[u128, u128, u32]>>, Option<PezkuwiRuntimeCommonClaimsStatementKind>]>;
moveClaim: AugmentedSubmittable<(old: EthereumAddress | string | Uint8Array, updated: EthereumAddress | string | Uint8Array, maybePreclaim: Option<AccountId32> | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [EthereumAddress, EthereumAddress, Option<AccountId32>]>;
moveClaim: AugmentedSubmittable<(old: EthereumAddress | string | Uint8Array, updated: EthereumAddress | string | Uint8Array, maybePreclaim: Option<AccountId32> | null | Uint8Array | AccountId32 | string) => SubmittableExtrinsic<ApiType>, [EthereumAddress, EthereumAddress, Option<AccountId32>]>;
/**
* Generic tx
**/
@@ -1145,7 +1145,7 @@ declare module '@pezkuwi/api-base/types/submittable' {
* feasibility check itself can in principle cause the election process to fail (due to
* memory/weight constrains).
**/
setEmergencyElectionResult: AugmentedSubmittable<(supports: Vec<ITuple<[AccountId32, PezspNposElectionsSupport]>> | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Vec<ITuple<[AccountId32, PezspNposElectionsSupport]>>]>;
setEmergencyElectionResult: AugmentedSubmittable<(supports: Vec<ITuple<[AccountId32, PezspNposElectionsSupport]>> | ([AccountId32 | string | Uint8Array, PezspNposElectionsSupport])[]) => SubmittableExtrinsic<ApiType>, [Vec<ITuple<[AccountId32, PezspNposElectionsSupport]>>]>;
/**
* Set a new value for `MinimumUntrustedScore`.
*
@@ -1764,7 +1764,7 @@ declare module '@pezkuwi/api-base/types/submittable' {
* - Storage: inserts one item, value size bounded by `MaxSignatories`, with a deposit
* taken for its lifetime of `DepositBase + threshold * DepositFactor`.
**/
approveAsMulti: AugmentedSubmittable<(threshold: u16 | AnyNumber | Uint8Array, otherSignatories: Vec<AccountId32> | string | Uint8Array, maybeTimepoint: Option<PezpalletMultisigTimepoint> | null | Uint8Array | PezpalletMultisigTimepoint, callHash: U8aFixed | string | Uint8Array, maxWeight: PezspWeightsWeightV2Weight) => SubmittableExtrinsic<ApiType>, [u16, Vec<AccountId32>, Option<PezpalletMultisigTimepoint>, U8aFixed, PezspWeightsWeightV2Weight]>;
approveAsMulti: AugmentedSubmittable<(threshold: u16 | AnyNumber | Uint8Array, otherSignatories: Vec<AccountId32> | (AccountId32 | string | Uint8Array)[], maybeTimepoint: Option<PezpalletMultisigTimepoint> | null | Uint8Array | PezpalletMultisigTimepoint, callHash: U8aFixed | string | Uint8Array, maxWeight: PezspWeightsWeightV2Weight) => SubmittableExtrinsic<ApiType>, [u16, Vec<AccountId32>, Option<PezpalletMultisigTimepoint>, U8aFixed, PezspWeightsWeightV2Weight]>;
/**
* Register approval for a dispatch to be made from a deterministic composite account if
* approved by a total of `threshold - 1` of `other_signatories`.
@@ -1806,7 +1806,7 @@ declare module '@pezkuwi/api-base/types/submittable' {
* - Storage: inserts one item, value size bounded by `MaxSignatories`, with a deposit
* taken for its lifetime of `DepositBase + threshold * DepositFactor`.
**/
asMulti: AugmentedSubmittable<(threshold: u16 | AnyNumber | Uint8Array, otherSignatories: Vec<AccountId32> | string | Uint8Array, maybeTimepoint: Option<PezpalletMultisigTimepoint> | null | Uint8Array | PezpalletMultisigTimepoint, call: Call | IMethod | string | Uint8Array, maxWeight: PezspWeightsWeightV2Weight) => SubmittableExtrinsic<ApiType>, [u16, Vec<AccountId32>, Option<PezpalletMultisigTimepoint>, Call, PezspWeightsWeightV2Weight]>;
asMulti: AugmentedSubmittable<(threshold: u16 | AnyNumber | Uint8Array, otherSignatories: Vec<AccountId32> | (AccountId32 | string | Uint8Array)[], maybeTimepoint: Option<PezpalletMultisigTimepoint> | null | Uint8Array | PezpalletMultisigTimepoint, call: Call | IMethod | string | Uint8Array, maxWeight: PezspWeightsWeightV2Weight) => SubmittableExtrinsic<ApiType>, [u16, Vec<AccountId32>, Option<PezpalletMultisigTimepoint>, Call, PezspWeightsWeightV2Weight]>;
/**
* Immediately dispatch a multi-signature call using a single approval from the caller.
*
@@ -1821,7 +1821,7 @@ declare module '@pezkuwi/api-base/types/submittable' {
* ## Complexity
* O(Z + C) where Z is the length of the call and C its execution weight.
**/
asMultiThreshold1: AugmentedSubmittable<(otherSignatories: Vec<AccountId32> | string | Uint8Array, call: Call | IMethod | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Vec<AccountId32>, Call]>;
asMultiThreshold1: AugmentedSubmittable<(otherSignatories: Vec<AccountId32> | (AccountId32 | string | Uint8Array)[], call: Call | IMethod | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Vec<AccountId32>, Call]>;
/**
* Cancel a pre-existing, on-going multisig transaction. Any deposit reserved previously
* for this operation will be unreserved on success.
@@ -1845,7 +1845,7 @@ declare module '@pezkuwi/api-base/types/submittable' {
* - I/O: 1 read `O(S)`, one remove.
* - Storage: removes one item.
**/
cancelAsMulti: AugmentedSubmittable<(threshold: u16 | AnyNumber | Uint8Array, otherSignatories: Vec<AccountId32> | string | Uint8Array, timepoint: PezpalletMultisigTimepoint, callHash: U8aFixed | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u16, Vec<AccountId32>, PezpalletMultisigTimepoint, U8aFixed]>;
cancelAsMulti: AugmentedSubmittable<(threshold: u16 | AnyNumber | Uint8Array, otherSignatories: Vec<AccountId32> | (AccountId32 | string | Uint8Array)[], timepoint: PezpalletMultisigTimepoint, callHash: U8aFixed | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u16, Vec<AccountId32>, PezpalletMultisigTimepoint, U8aFixed]>;
/**
* Poke the deposit reserved for an existing multisig operation.
*
@@ -1861,7 +1861,7 @@ declare module '@pezkuwi/api-base/types/submittable' {
*
* Emits `DepositPoked` if successful.
**/
pokeDeposit: AugmentedSubmittable<(threshold: u16 | AnyNumber | Uint8Array, otherSignatories: Vec<AccountId32> | string | Uint8Array, callHash: U8aFixed | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u16, Vec<AccountId32>, U8aFixed]>;
pokeDeposit: AugmentedSubmittable<(threshold: u16 | AnyNumber | Uint8Array, otherSignatories: Vec<AccountId32> | (AccountId32 | string | Uint8Array)[], callHash: U8aFixed | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u16, Vec<AccountId32>, U8aFixed]>;
/**
* Generic tx
**/
@@ -2055,7 +2055,7 @@ declare module '@pezkuwi/api-base/types/submittable' {
* In addition to a `root` or `nominator` role of `origin`, the pool's depositor needs to
* have at least `depositor_min_bond` in the pool to start nominating.
**/
nominate: AugmentedSubmittable<(poolId: u32 | AnyNumber | Uint8Array, validators: Vec<AccountId32> | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, Vec<AccountId32>]>;
nominate: AugmentedSubmittable<(poolId: u32 | AnyNumber | Uint8Array, validators: Vec<AccountId32> | (AccountId32 | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [u32, Vec<AccountId32>]>;
/**
* Call `withdraw_unbonded` for the pools account. This call can be made by any account.
*
@@ -2082,7 +2082,7 @@ declare module '@pezkuwi/api-base/types/submittable' {
*
* - If a `None` is supplied to `new_commission`, existing commission will be removed.
**/
setCommission: AugmentedSubmittable<(poolId: u32 | AnyNumber | Uint8Array, newCommission: Option<ITuple<[Perbill, AccountId32]>> | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, Option<ITuple<[Perbill, AccountId32]>>]>;
setCommission: AugmentedSubmittable<(poolId: u32 | AnyNumber | Uint8Array, newCommission: Option<ITuple<[Perbill, AccountId32]>> | null | Uint8Array | ITuple<[Perbill, AccountId32]> | [Perbill | AnyNumber | Uint8Array, AccountId32 | string | Uint8Array]) => SubmittableExtrinsic<ApiType>, [u32, Option<ITuple<[Perbill, AccountId32]>>]>;
/**
* Set the commission change rate for a pool.
*
@@ -2634,7 +2634,7 @@ declare module '@pezkuwi/api-base/types/submittable' {
*
* The accounts must have no consumers references.
**/
preserveAccounts: AugmentedSubmittable<(accounts: Vec<AccountId32> | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Vec<AccountId32>]>;
preserveAccounts: AugmentedSubmittable<(accounts: Vec<AccountId32> | (AccountId32 | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [Vec<AccountId32>]>;
/**
* Receive a query response from the Asset Hub for a previously sent xcm message.
**/
@@ -2684,14 +2684,14 @@ declare module '@pezkuwi/api-base/types/submittable' {
*
* The canceller can only stop scheduled migration.
**/
setCanceller: AugmentedSubmittable<(updated: Option<AccountId32> | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Option<AccountId32>]>;
setCanceller: AugmentedSubmittable<(updated: Option<AccountId32> | null | Uint8Array | AccountId32 | string) => SubmittableExtrinsic<ApiType>, [Option<AccountId32>]>;
/**
* Set the manager account id.
*
* The manager has the similar to [`Config::AdminOrigin`] privileges except that it
* can not set the manager account id via `set_manager` call.
**/
setManager: AugmentedSubmittable<(updated: Option<AccountId32> | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Option<AccountId32>]>;
setManager: AugmentedSubmittable<(updated: Option<AccountId32> | null | Uint8Array | AccountId32 | string) => SubmittableExtrinsic<ApiType>, [Option<AccountId32>]>;
/**
* Set the unprocessed message buffer size.
*
@@ -2788,7 +2788,7 @@ declare module '@pezkuwi/api-base/types/submittable' {
* - `delay_period`: The number of blocks after a recovery attempt is initialized that
* needs to pass before the account can be recovered.
**/
createRecovery: AugmentedSubmittable<(friends: Vec<AccountId32> | string | Uint8Array, threshold: u16 | AnyNumber | Uint8Array, delayPeriod: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Vec<AccountId32>, u16, u32]>;
createRecovery: AugmentedSubmittable<(friends: Vec<AccountId32> | (AccountId32 | string | Uint8Array)[], threshold: u16 | AnyNumber | Uint8Array, delayPeriod: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Vec<AccountId32>, u16, u32]>;
/**
* Initiate the process for recovering a recoverable account.
*
@@ -2828,7 +2828,7 @@ declare module '@pezkuwi/api-base/types/submittable' {
* Emits `DepositPoked` if any deposit is updated.
* Multiple events may be emitted in case both types of deposits are updated.
**/
pokeDeposit: AugmentedSubmittable<(maybeAccount: Option<MultiAddress> | AccountId | AccountIndex | Address | LookupSource | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Option<MultiAddress>]>;
pokeDeposit: AugmentedSubmittable<(maybeAccount: Option<MultiAddress> | null | Uint8Array | MultiAddress | AccountId | AccountIndex | Address | LookupSource | string) => SubmittableExtrinsic<ApiType>, [Option<MultiAddress>]>;
/**
* Remove the recovery process for your account. Recovered accounts are still accessible.
*
@@ -3530,7 +3530,7 @@ declare module '@pezkuwi/api-base/types/submittable' {
*
* The dispatch origin must be `T::AdminOrigin`.
**/
deprecateControllerBatch: AugmentedSubmittable<(controllers: Vec<AccountId32> | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Vec<AccountId32>]>;
deprecateControllerBatch: AugmentedSubmittable<(controllers: Vec<AccountId32> | (AccountId32 | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [Vec<AccountId32>]>;
/**
* Force a validator to have at least the minimum commission. This will not affect a
* validator who already has a commission greater than or equal to the minimum. Any account
@@ -3616,7 +3616,7 @@ declare module '@pezkuwi/api-base/types/submittable' {
* Note: Making this call only makes sense if you first set the validator preferences to
* block any further nominations.
**/
kick: AugmentedSubmittable<(who: Vec<MultiAddress> | AccountId | AccountIndex | Address | LookupSource | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Vec<MultiAddress>]>;
kick: AugmentedSubmittable<(who: Vec<MultiAddress> | (MultiAddress | AccountId | AccountIndex | Address | LookupSource | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [Vec<MultiAddress>]>;
/**
* This function allows governance to manually slash a validator and is a
* **fallback mechanism**.
@@ -3663,7 +3663,7 @@ declare module '@pezkuwi/api-base/types/submittable' {
* which is capped at CompactAssignments::LIMIT (T::MaxNominations).
* - Both the reads and writes follow a similar pattern.
**/
nominate: AugmentedSubmittable<(targets: Vec<MultiAddress> | AccountId | AccountIndex | Address | LookupSource | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Vec<MultiAddress>]>;
nominate: AugmentedSubmittable<(targets: Vec<MultiAddress> | (MultiAddress | AccountId | AccountIndex | Address | LookupSource | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [Vec<MultiAddress>]>;
/**
* Pay out next page of the stakers behind a validator for the given era.
*
@@ -3744,7 +3744,7 @@ declare module '@pezkuwi/api-base/types/submittable' {
* ledger associated with the stash. If the input parameters are not set, the ledger will
* be reset values from on-chain state.
**/
restoreLedger: AugmentedSubmittable<(stash: AccountId32 | string | Uint8Array, maybeController: Option<AccountId32> | string | Uint8Array, maybeTotal: Option<u128> | null | Uint8Array | u128 | AnyNumber, maybeUnlocking: Option<Vec<PezpalletStakingUnlockChunk>> | null | Uint8Array | Vec<PezpalletStakingUnlockChunk> | (PezpalletStakingUnlockChunk)[]) => SubmittableExtrinsic<ApiType>, [AccountId32, Option<AccountId32>, Option<u128>, Option<Vec<PezpalletStakingUnlockChunk>>]>;
restoreLedger: AugmentedSubmittable<(stash: AccountId32 | string | Uint8Array, maybeController: Option<AccountId32> | null | Uint8Array | AccountId32 | string, maybeTotal: Option<u128> | null | Uint8Array | u128 | AnyNumber, maybeUnlocking: Option<Vec<PezpalletStakingUnlockChunk>> | null | Uint8Array | Vec<PezpalletStakingUnlockChunk> | (PezpalletStakingUnlockChunk)[]) => SubmittableExtrinsic<ApiType>, [AccountId32, Option<AccountId32>, Option<u128>, Option<Vec<PezpalletStakingUnlockChunk>>]>;
/**
* Scale up the ideal number of validators by a factor up to maximum of
* `ElectionProviderBase::MaxWinners`.
@@ -3777,7 +3777,7 @@ declare module '@pezkuwi/api-base/types/submittable' {
*
* The dispatch origin must be Root.
**/
setInvulnerables: AugmentedSubmittable<(invulnerables: Vec<AccountId32> | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Vec<AccountId32>]>;
setInvulnerables: AugmentedSubmittable<(invulnerables: Vec<AccountId32> | (AccountId32 | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [Vec<AccountId32>]>;
/**
* Sets the minimum amount of commission that each validators must maintain.
*