Skip to content

Commit 1d3258f

Browse files
authored
Add explicit support for Call typegen (inclusive of non-defaults) (#4803)
1 parent e8d7013 commit 1d3258f

File tree

6 files changed

+49
-46
lines changed

6 files changed

+49
-46
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
Changes:
66

77
- Added support for typegen over `Range/RangeInclusive` types
8+
- Add explicit support for `Call` typegen (inclusive of non-defaults)
89

910

1011
## 8.3.2 May 8, 2022

packages/api-augment/src/kusama/tx.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import type { ApiTypes } from '@polkadot/api-base/types';
55
import type { Data } from '@polkadot/types';
66
import type { Bytes, Compact, Option, U8aFixed, Vec, WrapperKeepOpaque, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec';
7-
import type { AnyNumber, ITuple } from '@polkadot/types-codec/types';
7+
import type { AnyNumber, IMethod, ITuple } from '@polkadot/types-codec/types';
88
import type { EthereumAddress } from '@polkadot/types/interfaces/eth';
99
import type { AccountId32, Call, H256, MultiAddress, Perbill, Percent, Perquintill } from '@polkadot/types/interfaces/runtime';
1010
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' {
862862
* - 1 event
863863
* # </weight>
864864
**/
865-
execute: AugmentedSubmittable<(proposal: Call | { callIndex?: any; args?: any } | string | Uint8Array, lengthBound: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Call, Compact<u32>]>;
865+
execute: AugmentedSubmittable<(proposal: Call | IMethod | string | Uint8Array, lengthBound: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Call, Compact<u32>]>;
866866
/**
867867
* Add a new proposal to either be voted on or executed directly.
868868
*
@@ -892,7 +892,7 @@ declare module '@polkadot/api-base/types/submittable' {
892892
* - 1 event
893893
* # </weight>
894894
**/
895-
propose: AugmentedSubmittable<(threshold: Compact<u32> | AnyNumber | Uint8Array, proposal: Call | { callIndex?: any; args?: any } | string | Uint8Array, lengthBound: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Call, Compact<u32>]>;
895+
propose: AugmentedSubmittable<(threshold: Compact<u32> | AnyNumber | Uint8Array, proposal: Call | IMethod | string | Uint8Array, lengthBound: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Call, Compact<u32>]>;
896896
/**
897897
* Set the collective's membership.
898898
*
@@ -2102,7 +2102,7 @@ declare module '@polkadot/api-base/types/submittable' {
21022102
* - Plus Call Weight
21032103
* # </weight>
21042104
**/
2105-
asMultiThreshold1: AugmentedSubmittable<(otherSignatories: Vec<AccountId32> | (AccountId32 | string | Uint8Array)[], call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Vec<AccountId32>, Call]>;
2105+
asMultiThreshold1: AugmentedSubmittable<(otherSignatories: Vec<AccountId32> | (AccountId32 | string | Uint8Array)[], call: Call | IMethod | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Vec<AccountId32>, Call]>;
21062106
/**
21072107
* Cancel a pre-existing, on-going multisig transaction. Any deposit reserved previously
21082108
* for this operation will be unreserved on success.
@@ -2469,7 +2469,7 @@ declare module '@polkadot/api-base/types/submittable' {
24692469
* Weight is a function of the number of proxies the user has (P).
24702470
* # </weight>
24712471
**/
2472-
proxy: AugmentedSubmittable<(real: AccountId32 | string | Uint8Array, forceProxyType: Option<KusamaRuntimeProxyType> | null | object | string | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32, Option<KusamaRuntimeProxyType>, Call]>;
2472+
proxy: AugmentedSubmittable<(real: AccountId32 | string | Uint8Array, forceProxyType: Option<KusamaRuntimeProxyType> | null | object | string | Uint8Array, call: Call | IMethod | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32, Option<KusamaRuntimeProxyType>, Call]>;
24732473
/**
24742474
* Dispatch the given `call` from an account that the sender is authorized for through
24752475
* `add_proxy`.
@@ -2489,7 +2489,7 @@ declare module '@polkadot/api-base/types/submittable' {
24892489
* - P: the number of proxies the user has.
24902490
* # </weight>
24912491
**/
2492-
proxyAnnounced: AugmentedSubmittable<(delegate: AccountId32 | string | Uint8Array, real: AccountId32 | string | Uint8Array, forceProxyType: Option<KusamaRuntimeProxyType> | null | object | string | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32, AccountId32, Option<KusamaRuntimeProxyType>, Call]>;
2492+
proxyAnnounced: AugmentedSubmittable<(delegate: AccountId32 | string | Uint8Array, real: AccountId32 | string | Uint8Array, forceProxyType: Option<KusamaRuntimeProxyType> | null | object | string | Uint8Array, call: Call | IMethod | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32, AccountId32, Option<KusamaRuntimeProxyType>, Call]>;
24932493
/**
24942494
* Remove the given announcement of a delegate.
24952495
*
@@ -2571,7 +2571,7 @@ declare module '@polkadot/api-base/types/submittable' {
25712571
* - `account`: The recovered account you want to make a call on-behalf-of.
25722572
* - `call`: The call you want to make with the recovered account.
25732573
**/
2574-
asRecovered: AugmentedSubmittable<(account: AccountId32 | string | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32, Call]>;
2574+
asRecovered: AugmentedSubmittable<(account: AccountId32 | string | Uint8Array, call: Call | IMethod | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32, Call]>;
25752575
/**
25762576
* Cancel the ability to use `as_recovered` for `account`.
25772577
*
@@ -3735,7 +3735,7 @@ declare module '@polkadot/api-base/types/submittable' {
37353735
* - 1 event
37363736
* # </weight>
37373737
**/
3738-
execute: AugmentedSubmittable<(proposal: Call | { callIndex?: any; args?: any } | string | Uint8Array, lengthBound: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Call, Compact<u32>]>;
3738+
execute: AugmentedSubmittable<(proposal: Call | IMethod | string | Uint8Array, lengthBound: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Call, Compact<u32>]>;
37393739
/**
37403740
* Add a new proposal to either be voted on or executed directly.
37413741
*
@@ -3765,7 +3765,7 @@ declare module '@polkadot/api-base/types/submittable' {
37653765
* - 1 event
37663766
* # </weight>
37673767
**/
3768-
propose: AugmentedSubmittable<(threshold: Compact<u32> | AnyNumber | Uint8Array, proposal: Call | { callIndex?: any; args?: any } | string | Uint8Array, lengthBound: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Call, Compact<u32>]>;
3768+
propose: AugmentedSubmittable<(threshold: Compact<u32> | AnyNumber | Uint8Array, proposal: Call | IMethod | string | Uint8Array, lengthBound: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Call, Compact<u32>]>;
37693769
/**
37703770
* Set the collective's membership.
37713771
*
@@ -4136,7 +4136,7 @@ declare module '@polkadot/api-base/types/submittable' {
41364136
*
41374137
* The dispatch origin for this call must be _Signed_.
41384138
**/
4139-
asDerivative: AugmentedSubmittable<(index: u16 | AnyNumber | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u16, Call]>;
4139+
asDerivative: AugmentedSubmittable<(index: u16 | AnyNumber | Uint8Array, call: Call | IMethod | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u16, Call]>;
41404140
/**
41414141
* Send a batch of dispatch calls.
41424142
*
@@ -4158,7 +4158,7 @@ declare module '@polkadot/api-base/types/submittable' {
41584158
* and the error of the failed call. If all were successful, then the `BatchCompleted`
41594159
* event is deposited.
41604160
**/
4161-
batch: AugmentedSubmittable<(calls: Vec<Call> | (Call | { callIndex?: any; args?: any } | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [Vec<Call>]>;
4161+
batch: AugmentedSubmittable<(calls: Vec<Call> | (Call | IMethod | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [Vec<Call>]>;
41624162
/**
41634163
* Send a batch of dispatch calls and atomically execute them.
41644164
* The whole transaction will rollback and fail if any of the calls failed.
@@ -4175,7 +4175,7 @@ declare module '@polkadot/api-base/types/submittable' {
41754175
* - Complexity: O(C) where C is the number of calls to be batched.
41764176
* # </weight>
41774177
**/
4178-
batchAll: AugmentedSubmittable<(calls: Vec<Call> | (Call | { callIndex?: any; args?: any } | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [Vec<Call>]>;
4178+
batchAll: AugmentedSubmittable<(calls: Vec<Call> | (Call | IMethod | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [Vec<Call>]>;
41794179
/**
41804180
* Dispatches a function call with a provided origin.
41814181
*
@@ -4188,7 +4188,7 @@ declare module '@polkadot/api-base/types/submittable' {
41884188
* - Weight of derivative `call` execution + T::WeightInfo::dispatch_as().
41894189
* # </weight>
41904190
**/
4191-
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<ApiType>, [KusamaRuntimeOriginCaller, Call]>;
4191+
dispatchAs: AugmentedSubmittable<(asOrigin: KusamaRuntimeOriginCaller | { system: any } | { Void: any } | { Council: any } | { TechnicalCommittee: any } | { ParachainsOrigin: any } | { XcmPallet: any } | string | Uint8Array, call: Call | IMethod | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [KusamaRuntimeOriginCaller, Call]>;
41924192
/**
41934193
* Generic tx
41944194
**/

0 commit comments

Comments
 (0)