diff --git a/CHANGELOG.md b/CHANGELOG.md index f8030ec801..c45512f5db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ Changes: - Added support for typegen over `Range/RangeInclusive` types +- Add explicit support for `Call` typegen (inclusive of non-defaults) ## 8.3.2 May 8, 2022 diff --git a/packages/api-augment/src/kusama/tx.ts b/packages/api-augment/src/kusama/tx.ts index 58deccdcf5..9b840622ef 100644 --- a/packages/api-augment/src/kusama/tx.ts +++ b/packages/api-augment/src/kusama/tx.ts @@ -4,7 +4,7 @@ import type { ApiTypes } from '@polkadot/api-base/types'; import type { Data } from '@polkadot/types'; import type { Bytes, Compact, Option, U8aFixed, Vec, WrapperKeepOpaque, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec'; -import type { AnyNumber, ITuple } from '@polkadot/types-codec/types'; +import type { AnyNumber, IMethod, ITuple } from '@polkadot/types-codec/types'; import type { EthereumAddress } from '@polkadot/types/interfaces/eth'; import type { AccountId32, Call, H256, MultiAddress, Perbill, Percent, Perquintill } from '@polkadot/types/interfaces/runtime'; import type { FrameSupportScheduleMaybeHashed, KusamaRuntimeOriginCaller, KusamaRuntimeProxyType, KusamaRuntimeSessionKeys, PalletDemocracyConviction, PalletDemocracyVoteAccountVote, PalletElectionProviderMultiPhaseRawSolution, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenRenouncing, PalletIdentityBitFlags, PalletIdentityIdentityInfo, PalletIdentityJudgement, PalletImOnlineHeartbeat, PalletImOnlineSr25519AppSr25519Signature, PalletMultisigTimepoint, PalletSocietyJudgement, PalletStakingPalletConfigOpPerbill, PalletStakingPalletConfigOpPercent, PalletStakingPalletConfigOpU128, PalletStakingPalletConfigOpU32, PalletStakingRewardDestination, PalletStakingValidatorPrefs, PalletVestingVestingInfo, PolkadotParachainPrimitivesHrmpChannelId, PolkadotPrimitivesV2InherentData, PolkadotPrimitivesV2PvfCheckStatement, PolkadotPrimitivesV2ValidatorAppSignature, PolkadotRuntimeCommonClaimsEcdsaSignature, PolkadotRuntimeCommonClaimsStatementKind, SpConsensusBabeDigestsNextConfigDescriptor, SpConsensusSlotsEquivocationProof, SpFinalityGrandpaEquivocationProof, SpNposElectionsElectionScore, SpNposElectionsSupport, SpRuntimeHeader, SpRuntimeMultiSignature, SpRuntimeMultiSigner, SpSessionMembershipProof, XcmV1MultiLocation, XcmV2WeightLimit, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup'; @@ -862,7 +862,7 @@ declare module '@polkadot/api-base/types/submittable' { * - 1 event * # **/ - execute: AugmentedSubmittable<(proposal: Call | { callIndex?: any; args?: any } | string | Uint8Array, lengthBound: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Call, Compact]>; + execute: AugmentedSubmittable<(proposal: Call | IMethod | string | Uint8Array, lengthBound: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Call, Compact]>; /** * Add a new proposal to either be voted on or executed directly. * @@ -892,7 +892,7 @@ declare module '@polkadot/api-base/types/submittable' { * - 1 event * # **/ - propose: AugmentedSubmittable<(threshold: Compact | AnyNumber | Uint8Array, proposal: Call | { callIndex?: any; args?: any } | string | Uint8Array, lengthBound: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Compact, Call, Compact]>; + propose: AugmentedSubmittable<(threshold: Compact | AnyNumber | Uint8Array, proposal: Call | IMethod | string | Uint8Array, lengthBound: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Compact, Call, Compact]>; /** * Set the collective's membership. * @@ -2102,7 +2102,7 @@ declare module '@polkadot/api-base/types/submittable' { * - Plus Call Weight * # **/ - asMultiThreshold1: AugmentedSubmittable<(otherSignatories: Vec | (AccountId32 | string | Uint8Array)[], call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic, [Vec, Call]>; + asMultiThreshold1: AugmentedSubmittable<(otherSignatories: Vec | (AccountId32 | string | Uint8Array)[], call: Call | IMethod | string | Uint8Array) => SubmittableExtrinsic, [Vec, Call]>; /** * Cancel a pre-existing, on-going multisig transaction. Any deposit reserved previously * for this operation will be unreserved on success. @@ -2469,7 +2469,7 @@ declare module '@polkadot/api-base/types/submittable' { * Weight is a function of the number of proxies the user has (P). * # **/ - proxy: AugmentedSubmittable<(real: AccountId32 | string | Uint8Array, forceProxyType: Option | null | object | string | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic, [AccountId32, Option, Call]>; + proxy: AugmentedSubmittable<(real: AccountId32 | string | Uint8Array, forceProxyType: Option | null | object | string | Uint8Array, call: Call | IMethod | string | Uint8Array) => SubmittableExtrinsic, [AccountId32, Option, Call]>; /** * Dispatch the given `call` from an account that the sender is authorized for through * `add_proxy`. @@ -2489,7 +2489,7 @@ declare module '@polkadot/api-base/types/submittable' { * - P: the number of proxies the user has. * # **/ - proxyAnnounced: AugmentedSubmittable<(delegate: AccountId32 | string | Uint8Array, real: AccountId32 | string | Uint8Array, forceProxyType: Option | null | object | string | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic, [AccountId32, AccountId32, Option, Call]>; + proxyAnnounced: AugmentedSubmittable<(delegate: AccountId32 | string | Uint8Array, real: AccountId32 | string | Uint8Array, forceProxyType: Option | null | object | string | Uint8Array, call: Call | IMethod | string | Uint8Array) => SubmittableExtrinsic, [AccountId32, AccountId32, Option, Call]>; /** * Remove the given announcement of a delegate. * @@ -2571,7 +2571,7 @@ declare module '@polkadot/api-base/types/submittable' { * - `account`: The recovered account you want to make a call on-behalf-of. * - `call`: The call you want to make with the recovered account. **/ - asRecovered: AugmentedSubmittable<(account: AccountId32 | string | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic, [AccountId32, Call]>; + asRecovered: AugmentedSubmittable<(account: AccountId32 | string | Uint8Array, call: Call | IMethod | string | Uint8Array) => SubmittableExtrinsic, [AccountId32, Call]>; /** * Cancel the ability to use `as_recovered` for `account`. * @@ -3735,7 +3735,7 @@ declare module '@polkadot/api-base/types/submittable' { * - 1 event * # **/ - execute: AugmentedSubmittable<(proposal: Call | { callIndex?: any; args?: any } | string | Uint8Array, lengthBound: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Call, Compact]>; + execute: AugmentedSubmittable<(proposal: Call | IMethod | string | Uint8Array, lengthBound: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Call, Compact]>; /** * Add a new proposal to either be voted on or executed directly. * @@ -3765,7 +3765,7 @@ declare module '@polkadot/api-base/types/submittable' { * - 1 event * # **/ - propose: AugmentedSubmittable<(threshold: Compact | AnyNumber | Uint8Array, proposal: Call | { callIndex?: any; args?: any } | string | Uint8Array, lengthBound: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Compact, Call, Compact]>; + propose: AugmentedSubmittable<(threshold: Compact | AnyNumber | Uint8Array, proposal: Call | IMethod | string | Uint8Array, lengthBound: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Compact, Call, Compact]>; /** * Set the collective's membership. * @@ -4136,7 +4136,7 @@ declare module '@polkadot/api-base/types/submittable' { * * The dispatch origin for this call must be _Signed_. **/ - asDerivative: AugmentedSubmittable<(index: u16 | AnyNumber | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic, [u16, Call]>; + asDerivative: AugmentedSubmittable<(index: u16 | AnyNumber | Uint8Array, call: Call | IMethod | string | Uint8Array) => SubmittableExtrinsic, [u16, Call]>; /** * Send a batch of dispatch calls. * @@ -4158,7 +4158,7 @@ declare module '@polkadot/api-base/types/submittable' { * and the error of the failed call. If all were successful, then the `BatchCompleted` * event is deposited. **/ - batch: AugmentedSubmittable<(calls: Vec | (Call | { callIndex?: any; args?: any } | string | Uint8Array)[]) => SubmittableExtrinsic, [Vec]>; + batch: AugmentedSubmittable<(calls: Vec | (Call | IMethod | string | Uint8Array)[]) => SubmittableExtrinsic, [Vec]>; /** * Send a batch of dispatch calls and atomically execute them. * The whole transaction will rollback and fail if any of the calls failed. @@ -4175,7 +4175,7 @@ declare module '@polkadot/api-base/types/submittable' { * - Complexity: O(C) where C is the number of calls to be batched. * # **/ - batchAll: AugmentedSubmittable<(calls: Vec | (Call | { callIndex?: any; args?: any } | string | Uint8Array)[]) => SubmittableExtrinsic, [Vec]>; + batchAll: AugmentedSubmittable<(calls: Vec | (Call | IMethod | string | Uint8Array)[]) => SubmittableExtrinsic, [Vec]>; /** * Dispatches a function call with a provided origin. * @@ -4188,7 +4188,7 @@ declare module '@polkadot/api-base/types/submittable' { * - Weight of derivative `call` execution + T::WeightInfo::dispatch_as(). * # **/ - dispatchAs: AugmentedSubmittable<(asOrigin: KusamaRuntimeOriginCaller | { system: any } | { Void: any } | { Council: any } | { TechnicalCommittee: any } | { ParachainsOrigin: any } | { XcmPallet: any } | string | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic, [KusamaRuntimeOriginCaller, Call]>; + dispatchAs: AugmentedSubmittable<(asOrigin: KusamaRuntimeOriginCaller | { system: any } | { Void: any } | { Council: any } | { TechnicalCommittee: any } | { ParachainsOrigin: any } | { XcmPallet: any } | string | Uint8Array, call: Call | IMethod | string | Uint8Array) => SubmittableExtrinsic, [KusamaRuntimeOriginCaller, Call]>; /** * Generic tx **/ diff --git a/packages/api-augment/src/polkadot/tx.ts b/packages/api-augment/src/polkadot/tx.ts index 77d8ae53a1..998a75d8d3 100644 --- a/packages/api-augment/src/polkadot/tx.ts +++ b/packages/api-augment/src/polkadot/tx.ts @@ -4,7 +4,7 @@ import type { ApiTypes } from '@polkadot/api-base/types'; import type { Data } from '@polkadot/types'; import type { Bytes, Compact, Option, U8aFixed, Vec, WrapperKeepOpaque, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec'; -import type { AnyNumber, ITuple } from '@polkadot/types-codec/types'; +import type { AnyNumber, IMethod, ITuple } from '@polkadot/types-codec/types'; import type { EthereumAddress } from '@polkadot/types/interfaces/eth'; import type { AccountId32, Call, H256, MultiAddress, Perbill, Percent } from '@polkadot/types/interfaces/runtime'; import type { FrameSupportScheduleMaybeHashed, PalletDemocracyConviction, PalletDemocracyVoteAccountVote, PalletElectionProviderMultiPhaseRawSolution, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenRenouncing, PalletIdentityBitFlags, PalletIdentityIdentityInfo, PalletIdentityJudgement, PalletImOnlineHeartbeat, PalletImOnlineSr25519AppSr25519Signature, PalletMultisigTimepoint, PalletStakingPalletConfigOpPerbill, PalletStakingPalletConfigOpPercent, PalletStakingPalletConfigOpU128, PalletStakingPalletConfigOpU32, PalletStakingRewardDestination, PalletStakingValidatorPrefs, PalletVestingVestingInfo, PolkadotParachainPrimitivesHrmpChannelId, PolkadotPrimitivesV2InherentData, PolkadotPrimitivesV2PvfCheckStatement, PolkadotPrimitivesV2ValidatorAppSignature, PolkadotRuntimeCommonClaimsEcdsaSignature, PolkadotRuntimeCommonClaimsStatementKind, PolkadotRuntimeOriginCaller, PolkadotRuntimeProxyType, PolkadotRuntimeSessionKeys, SpConsensusBabeDigestsNextConfigDescriptor, SpConsensusSlotsEquivocationProof, SpFinalityGrandpaEquivocationProof, SpNposElectionsElectionScore, SpNposElectionsSupport, SpRuntimeHeader, SpRuntimeMultiSignature, SpRuntimeMultiSigner, SpSessionMembershipProof, XcmV1MultiLocation, XcmV2WeightLimit, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup'; @@ -862,7 +862,7 @@ declare module '@polkadot/api-base/types/submittable' { * - 1 event * # **/ - execute: AugmentedSubmittable<(proposal: Call | { callIndex?: any; args?: any } | string | Uint8Array, lengthBound: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Call, Compact]>; + execute: AugmentedSubmittable<(proposal: Call | IMethod | string | Uint8Array, lengthBound: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Call, Compact]>; /** * Add a new proposal to either be voted on or executed directly. * @@ -892,7 +892,7 @@ declare module '@polkadot/api-base/types/submittable' { * - 1 event * # **/ - propose: AugmentedSubmittable<(threshold: Compact | AnyNumber | Uint8Array, proposal: Call | { callIndex?: any; args?: any } | string | Uint8Array, lengthBound: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Compact, Call, Compact]>; + propose: AugmentedSubmittable<(threshold: Compact | AnyNumber | Uint8Array, proposal: Call | IMethod | string | Uint8Array, lengthBound: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Compact, Call, Compact]>; /** * Set the collective's membership. * @@ -2051,7 +2051,7 @@ declare module '@polkadot/api-base/types/submittable' { * - Plus Call Weight * # **/ - asMultiThreshold1: AugmentedSubmittable<(otherSignatories: Vec | (AccountId32 | string | Uint8Array)[], call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic, [Vec, Call]>; + asMultiThreshold1: AugmentedSubmittable<(otherSignatories: Vec | (AccountId32 | string | Uint8Array)[], call: Call | IMethod | string | Uint8Array) => SubmittableExtrinsic, [Vec, Call]>; /** * Cancel a pre-existing, on-going multisig transaction. Any deposit reserved previously * for this operation will be unreserved on success. @@ -2418,7 +2418,7 @@ declare module '@polkadot/api-base/types/submittable' { * Weight is a function of the number of proxies the user has (P). * # **/ - proxy: AugmentedSubmittable<(real: AccountId32 | string | Uint8Array, forceProxyType: Option | null | object | string | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic, [AccountId32, Option, Call]>; + proxy: AugmentedSubmittable<(real: AccountId32 | string | Uint8Array, forceProxyType: Option | null | object | string | Uint8Array, call: Call | IMethod | string | Uint8Array) => SubmittableExtrinsic, [AccountId32, Option, Call]>; /** * Dispatch the given `call` from an account that the sender is authorized for through * `add_proxy`. @@ -2438,7 +2438,7 @@ declare module '@polkadot/api-base/types/submittable' { * - P: the number of proxies the user has. * # **/ - proxyAnnounced: AugmentedSubmittable<(delegate: AccountId32 | string | Uint8Array, real: AccountId32 | string | Uint8Array, forceProxyType: Option | null | object | string | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic, [AccountId32, AccountId32, Option, Call]>; + proxyAnnounced: AugmentedSubmittable<(delegate: AccountId32 | string | Uint8Array, real: AccountId32 | string | Uint8Array, forceProxyType: Option | null | object | string | Uint8Array, call: Call | IMethod | string | Uint8Array) => SubmittableExtrinsic, [AccountId32, AccountId32, Option, Call]>; /** * Remove the given announcement of a delegate. * @@ -3231,7 +3231,7 @@ declare module '@polkadot/api-base/types/submittable' { * - 1 event * # **/ - execute: AugmentedSubmittable<(proposal: Call | { callIndex?: any; args?: any } | string | Uint8Array, lengthBound: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Call, Compact]>; + execute: AugmentedSubmittable<(proposal: Call | IMethod | string | Uint8Array, lengthBound: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Call, Compact]>; /** * Add a new proposal to either be voted on or executed directly. * @@ -3261,7 +3261,7 @@ declare module '@polkadot/api-base/types/submittable' { * - 1 event * # **/ - propose: AugmentedSubmittable<(threshold: Compact | AnyNumber | Uint8Array, proposal: Call | { callIndex?: any; args?: any } | string | Uint8Array, lengthBound: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Compact, Call, Compact]>; + propose: AugmentedSubmittable<(threshold: Compact | AnyNumber | Uint8Array, proposal: Call | IMethod | string | Uint8Array, lengthBound: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Compact, Call, Compact]>; /** * Set the collective's membership. * @@ -3632,7 +3632,7 @@ declare module '@polkadot/api-base/types/submittable' { * * The dispatch origin for this call must be _Signed_. **/ - asDerivative: AugmentedSubmittable<(index: u16 | AnyNumber | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic, [u16, Call]>; + asDerivative: AugmentedSubmittable<(index: u16 | AnyNumber | Uint8Array, call: Call | IMethod | string | Uint8Array) => SubmittableExtrinsic, [u16, Call]>; /** * Send a batch of dispatch calls. * @@ -3654,7 +3654,7 @@ declare module '@polkadot/api-base/types/submittable' { * and the error of the failed call. If all were successful, then the `BatchCompleted` * event is deposited. **/ - batch: AugmentedSubmittable<(calls: Vec | (Call | { callIndex?: any; args?: any } | string | Uint8Array)[]) => SubmittableExtrinsic, [Vec]>; + batch: AugmentedSubmittable<(calls: Vec | (Call | IMethod | string | Uint8Array)[]) => SubmittableExtrinsic, [Vec]>; /** * Send a batch of dispatch calls and atomically execute them. * The whole transaction will rollback and fail if any of the calls failed. @@ -3671,7 +3671,7 @@ declare module '@polkadot/api-base/types/submittable' { * - Complexity: O(C) where C is the number of calls to be batched. * # **/ - batchAll: AugmentedSubmittable<(calls: Vec | (Call | { callIndex?: any; args?: any } | string | Uint8Array)[]) => SubmittableExtrinsic, [Vec]>; + batchAll: AugmentedSubmittable<(calls: Vec | (Call | IMethod | string | Uint8Array)[]) => SubmittableExtrinsic, [Vec]>; /** * Dispatches a function call with a provided origin. * @@ -3684,7 +3684,7 @@ declare module '@polkadot/api-base/types/submittable' { * - Weight of derivative `call` execution + T::WeightInfo::dispatch_as(). * # **/ - dispatchAs: AugmentedSubmittable<(asOrigin: PolkadotRuntimeOriginCaller | { system: any } | { Void: any } | { Council: any } | { TechnicalCommittee: any } | { ParachainsOrigin: any } | { XcmPallet: any } | string | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic, [PolkadotRuntimeOriginCaller, Call]>; + dispatchAs: AugmentedSubmittable<(asOrigin: PolkadotRuntimeOriginCaller | { system: any } | { Void: any } | { Council: any } | { TechnicalCommittee: any } | { ParachainsOrigin: any } | { XcmPallet: any } | string | Uint8Array, call: Call | IMethod | string | Uint8Array) => SubmittableExtrinsic, [PolkadotRuntimeOriginCaller, Call]>; /** * Generic tx **/ diff --git a/packages/api-augment/src/substrate/tx.ts b/packages/api-augment/src/substrate/tx.ts index 3c644c8fec..0f5985968f 100644 --- a/packages/api-augment/src/substrate/tx.ts +++ b/packages/api-augment/src/substrate/tx.ts @@ -4,7 +4,7 @@ import type { ApiTypes } from '@polkadot/api-base/types'; import type { Data } from '@polkadot/types'; import type { Bytes, Compact, Option, U8aFixed, Vec, WrapperKeepOpaque, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec'; -import type { AnyNumber, ITuple } from '@polkadot/types-codec/types'; +import type { AnyNumber, IMethod, ITuple } from '@polkadot/types-codec/types'; import type { AccountId32, Call, H256, MultiAddress, Perbill, Percent, Perquintill } from '@polkadot/types/interfaces/runtime'; import type { FrameSupportScheduleDispatchTime, FrameSupportScheduleMaybeHashed, NodeRuntimeOriginCaller, NodeRuntimeProxyType, NodeRuntimeSessionKeys, PalletAssetsDestroyWitness, PalletConvictionVotingConviction, PalletConvictionVotingVoteAccountVote, PalletDemocracyConviction, PalletDemocracyVoteAccountVote, PalletElectionProviderMultiPhaseRawSolution, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenRenouncing, PalletIdentityBitFlags, PalletIdentityIdentityInfo, PalletIdentityJudgement, PalletImOnlineHeartbeat, PalletImOnlineSr25519AppSr25519Signature, PalletMultisigTimepoint, PalletNominationPoolsBondExtra, PalletNominationPoolsConfigOpU128, PalletNominationPoolsConfigOpU32, PalletNominationPoolsPoolState, PalletSocietyJudgement, PalletStakingPalletConfigOpPerbill, PalletStakingPalletConfigOpPercent, PalletStakingPalletConfigOpU128, PalletStakingPalletConfigOpU32, PalletStakingRewardDestination, PalletStakingValidatorPrefs, PalletStateTrieMigrationMigrationLimits, PalletStateTrieMigrationMigrationTask, PalletStateTrieMigrationProgress, PalletUniquesDestroyWitness, PalletVestingVestingInfo, SpConsensusBabeDigestsNextConfigDescriptor, SpConsensusSlotsEquivocationProof, SpFinalityGrandpaEquivocationProof, SpNposElectionsElectionScore, SpNposElectionsSupport, SpRuntimeHeader, SpSessionMembershipProof, SpTransactionStorageProofTransactionStorageProof } from '@polkadot/types/lookup'; @@ -1175,7 +1175,7 @@ declare module '@polkadot/api-base/types/submittable' { * - 1 event * # **/ - execute: AugmentedSubmittable<(proposal: Call | { callIndex?: any; args?: any } | string | Uint8Array, lengthBound: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Call, Compact]>; + execute: AugmentedSubmittable<(proposal: Call | IMethod | string | Uint8Array, lengthBound: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Call, Compact]>; /** * Add a new proposal to either be voted on or executed directly. * @@ -1205,7 +1205,7 @@ declare module '@polkadot/api-base/types/submittable' { * - 1 event * # **/ - propose: AugmentedSubmittable<(threshold: Compact | AnyNumber | Uint8Array, proposal: Call | { callIndex?: any; args?: any } | string | Uint8Array, lengthBound: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Compact, Call, Compact]>; + propose: AugmentedSubmittable<(threshold: Compact | AnyNumber | Uint8Array, proposal: Call | IMethod | string | Uint8Array, lengthBound: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Compact, Call, Compact]>; /** * Set the collective's membership. * @@ -2271,7 +2271,7 @@ declare module '@polkadot/api-base/types/submittable' { * * This extrinsic must be called by a signed origin. **/ - buyTicket: AugmentedSubmittable<(call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic, [Call]>; + buyTicket: AugmentedSubmittable<(call: Call | IMethod | string | Uint8Array) => SubmittableExtrinsic, [Call]>; /** * Set calls in storage which can be used to purchase a lottery ticket. * @@ -2280,7 +2280,7 @@ declare module '@polkadot/api-base/types/submittable' { * * This extrinsic must be called by the Manager origin. **/ - setCalls: AugmentedSubmittable<(calls: Vec | (Call | { callIndex?: any; args?: any } | string | Uint8Array)[]) => SubmittableExtrinsic, [Vec]>; + setCalls: AugmentedSubmittable<(calls: Vec | (Call | IMethod | string | Uint8Array)[]) => SubmittableExtrinsic, [Vec]>; /** * Start a lottery using the provided configuration. * @@ -2411,7 +2411,7 @@ declare module '@polkadot/api-base/types/submittable' { * - Plus Call Weight * # **/ - asMultiThreshold1: AugmentedSubmittable<(otherSignatories: Vec | (AccountId32 | string | Uint8Array)[], call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic, [Vec, Call]>; + asMultiThreshold1: AugmentedSubmittable<(otherSignatories: Vec | (AccountId32 | string | Uint8Array)[], call: Call | IMethod | string | Uint8Array) => SubmittableExtrinsic, [Vec, Call]>; /** * Cancel a pre-existing, on-going multisig transaction. Any deposit reserved previously * for this operation will be unreserved on success. @@ -2716,7 +2716,7 @@ declare module '@polkadot/api-base/types/submittable' { * Weight is a function of the number of proxies the user has (P). * # **/ - proxy: AugmentedSubmittable<(real: AccountId32 | string | Uint8Array, forceProxyType: Option | null | object | string | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic, [AccountId32, Option, Call]>; + proxy: AugmentedSubmittable<(real: AccountId32 | string | Uint8Array, forceProxyType: Option | null | object | string | Uint8Array, call: Call | IMethod | string | Uint8Array) => SubmittableExtrinsic, [AccountId32, Option, Call]>; /** * Dispatch the given `call` from an account that the sender is authorized for through * `add_proxy`. @@ -2736,7 +2736,7 @@ declare module '@polkadot/api-base/types/submittable' { * - P: the number of proxies the user has. * # **/ - proxyAnnounced: AugmentedSubmittable<(delegate: AccountId32 | string | Uint8Array, real: AccountId32 | string | Uint8Array, forceProxyType: Option | null | object | string | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic, [AccountId32, AccountId32, Option, Call]>; + proxyAnnounced: AugmentedSubmittable<(delegate: AccountId32 | string | Uint8Array, real: AccountId32 | string | Uint8Array, forceProxyType: Option | null | object | string | Uint8Array, call: Call | IMethod | string | Uint8Array) => SubmittableExtrinsic, [AccountId32, AccountId32, Option, Call]>; /** * Remove the given announcement of a delegate. * @@ -2818,7 +2818,7 @@ declare module '@polkadot/api-base/types/submittable' { * - `account`: The recovered account you want to make a call on-behalf-of. * - `call`: The call you want to make with the recovered account. **/ - asRecovered: AugmentedSubmittable<(account: AccountId32 | string | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic, [AccountId32, Call]>; + asRecovered: AugmentedSubmittable<(account: AccountId32 | string | Uint8Array, call: Call | IMethod | string | Uint8Array) => SubmittableExtrinsic, [AccountId32, Call]>; /** * Cancel the ability to use `as_recovered` for `account`. * @@ -3923,7 +3923,7 @@ declare module '@polkadot/api-base/types/submittable' { * - Weight of derivative `call` execution + 10,000. * # **/ - sudo: AugmentedSubmittable<(call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic, [Call]>; + sudo: AugmentedSubmittable<(call: Call | IMethod | string | Uint8Array) => SubmittableExtrinsic, [Call]>; /** * Authenticates the sudo key and dispatches a function call with `Signed` origin from * a given account. @@ -3937,7 +3937,7 @@ declare module '@polkadot/api-base/types/submittable' { * - Weight of derivative `call` execution + 10,000. * # **/ - sudoAs: AugmentedSubmittable<(who: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic, [MultiAddress, Call]>; + sudoAs: AugmentedSubmittable<(who: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, call: Call | IMethod | string | Uint8Array) => SubmittableExtrinsic, [MultiAddress, Call]>; /** * Authenticates the sudo key and dispatches a function call with `Root` origin. * This function does not check the weight of the call, and instead allows the @@ -3950,7 +3950,7 @@ declare module '@polkadot/api-base/types/submittable' { * - The weight of this call is defined by the caller. * # **/ - sudoUncheckedWeight: AugmentedSubmittable<(call: Call | { callIndex?: any; args?: any } | string | Uint8Array, weight: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Call, u64]>; + sudoUncheckedWeight: AugmentedSubmittable<(call: Call | IMethod | string | Uint8Array, weight: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Call, u64]>; /** * Generic tx **/ @@ -4090,7 +4090,7 @@ declare module '@polkadot/api-base/types/submittable' { * - 1 event * # **/ - execute: AugmentedSubmittable<(proposal: Call | { callIndex?: any; args?: any } | string | Uint8Array, lengthBound: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Call, Compact]>; + execute: AugmentedSubmittable<(proposal: Call | IMethod | string | Uint8Array, lengthBound: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Call, Compact]>; /** * Add a new proposal to either be voted on or executed directly. * @@ -4120,7 +4120,7 @@ declare module '@polkadot/api-base/types/submittable' { * - 1 event * # **/ - propose: AugmentedSubmittable<(threshold: Compact | AnyNumber | Uint8Array, proposal: Call | { callIndex?: any; args?: any } | string | Uint8Array, lengthBound: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Compact, Call, Compact]>; + propose: AugmentedSubmittable<(threshold: Compact | AnyNumber | Uint8Array, proposal: Call | IMethod | string | Uint8Array, lengthBound: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Compact, Call, Compact]>; /** * Set the collective's membership. * @@ -4888,7 +4888,7 @@ declare module '@polkadot/api-base/types/submittable' { * * The dispatch origin for this call must be _Signed_. **/ - asDerivative: AugmentedSubmittable<(index: u16 | AnyNumber | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic, [u16, Call]>; + asDerivative: AugmentedSubmittable<(index: u16 | AnyNumber | Uint8Array, call: Call | IMethod | string | Uint8Array) => SubmittableExtrinsic, [u16, Call]>; /** * Send a batch of dispatch calls. * @@ -4910,7 +4910,7 @@ declare module '@polkadot/api-base/types/submittable' { * and the error of the failed call. If all were successful, then the `BatchCompleted` * event is deposited. **/ - batch: AugmentedSubmittable<(calls: Vec | (Call | { callIndex?: any; args?: any } | string | Uint8Array)[]) => SubmittableExtrinsic, [Vec]>; + batch: AugmentedSubmittable<(calls: Vec | (Call | IMethod | string | Uint8Array)[]) => SubmittableExtrinsic, [Vec]>; /** * Send a batch of dispatch calls and atomically execute them. * The whole transaction will rollback and fail if any of the calls failed. @@ -4927,7 +4927,7 @@ declare module '@polkadot/api-base/types/submittable' { * - Complexity: O(C) where C is the number of calls to be batched. * # **/ - batchAll: AugmentedSubmittable<(calls: Vec | (Call | { callIndex?: any; args?: any } | string | Uint8Array)[]) => SubmittableExtrinsic, [Vec]>; + batchAll: AugmentedSubmittable<(calls: Vec | (Call | IMethod | string | Uint8Array)[]) => SubmittableExtrinsic, [Vec]>; /** * Dispatches a function call with a provided origin. * @@ -4940,7 +4940,7 @@ declare module '@polkadot/api-base/types/submittable' { * - Weight of derivative `call` execution + T::WeightInfo::dispatch_as(). * # **/ - dispatchAs: AugmentedSubmittable<(asOrigin: NodeRuntimeOriginCaller | { system: any } | { Void: any } | { Council: any } | { TechnicalCommittee: any } | string | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic, [NodeRuntimeOriginCaller, Call]>; + dispatchAs: AugmentedSubmittable<(asOrigin: NodeRuntimeOriginCaller | { system: any } | { Void: any } | { Council: any } | { TechnicalCommittee: any } | string | Uint8Array, call: Call | IMethod | string | Uint8Array) => SubmittableExtrinsic, [NodeRuntimeOriginCaller, Call]>; /** * Generic tx **/ @@ -5053,7 +5053,7 @@ declare module '@polkadot/api-base/types/submittable' { }; whitelist: { dispatchWhitelistedCall: AugmentedSubmittable<(callHash: H256 | string | Uint8Array, callWeightWitness: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [H256, u64]>; - dispatchWhitelistedCallWithPreimage: AugmentedSubmittable<(call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic, [Call]>; + dispatchWhitelistedCallWithPreimage: AugmentedSubmittable<(call: Call | IMethod | string | Uint8Array) => SubmittableExtrinsic, [Call]>; removeWhitelistedCall: AugmentedSubmittable<(callHash: H256 | string | Uint8Array) => SubmittableExtrinsic, [H256]>; whitelistCall: AugmentedSubmittable<(callHash: H256 | string | Uint8Array) => SubmittableExtrinsic, [H256]>; /** diff --git a/packages/typegen/src/util/derived.ts b/packages/typegen/src/util/derived.ts index a93b6b4823..79973dc678 100644 --- a/packages/typegen/src/util/derived.ts +++ b/packages/typegen/src/util/derived.ts @@ -4,7 +4,7 @@ import type { Constructor, Registry } from '@polkadot/types/types'; import type { TypeDef } from '@polkadot/types-create/types'; -import { GenericAccountId, GenericLookupSource, GenericVote } from '@polkadot/types/generic'; +import { GenericAccountId, GenericCall, GenericLookupSource, GenericVote } from '@polkadot/types/generic'; import { AllConvictions } from '@polkadot/types/interfaces/democracy/definitions'; import { AbstractInt, bool, Compact, Enum, Null, Option, Struct, Tuple, UInt, Vec, WrapperKeepOpaque, WrapperOpaque } from '@polkadot/types-codec'; import { getTypeDef, TypeDefInfo } from '@polkadot/types-create'; @@ -84,6 +84,8 @@ export function getSimilarTypes (registry: Registry, definitions: Record, imports: TypeI types.filter((t): t is string => !!t).forEach((type): void => { if (ignoredTypes.includes(type)) { // do nothing - } else if (['AnyNumber', 'CallFunction', 'Codec', 'IExtrinsic', 'ITuple'].includes(type)) { + } else if (['AnyNumber', 'CallFunction', 'Codec', 'IExtrinsic', 'IMethod', 'ITuple'].includes(type)) { typesTypes[type] = true; } else if (['Metadata', 'PortableRegistry'].includes(type)) { metadataTypes[type] = true;