From 5c6294b71ca758749419dfe3456f1fca5502246f Mon Sep 17 00:00:00 2001 From: Jaco Date: Tue, 5 Jul 2022 15:01:10 +0200 Subject: [PATCH] Improve type argument generation for `Option<...>` types (#5035) --- .123deno | 1 + CHANGELOG.md | 1 + packages/api-augment/src/kusama/runtime.ts | 2 +- packages/api-augment/src/kusama/tx.ts | 44 ++++++++-------- packages/api-augment/src/polkadot/runtime.ts | 2 +- packages/api-augment/src/polkadot/tx.ts | 44 ++++++++-------- packages/api-augment/src/substrate/query.ts | 2 +- packages/api-augment/src/substrate/runtime.ts | 8 +-- packages/api-augment/src/substrate/tx.ts | 50 +++++++++---------- packages/rpc-augment/src/augment/jsonrpc.ts | 4 +- packages/rpc-provider/src/ws/index.ts | 4 +- packages/typegen/src/util/derived.ts | 12 ++++- 12 files changed, 93 insertions(+), 81 deletions(-) create mode 100644 .123deno diff --git a/.123deno b/.123deno new file mode 100644 index 0000000000..d00491fd7e --- /dev/null +++ b/.123deno @@ -0,0 +1 @@ +1 diff --git a/CHANGELOG.md b/CHANGELOG.md index 0dc307d4d8..cfc444e8c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ Changes: - Adjust type generation to correctly cater for ambient definitions +- Improve type argument generation for `Option<...>` types ## 8.11.3 Jul 5, 2022 diff --git a/packages/api-augment/src/kusama/runtime.ts b/packages/api-augment/src/kusama/runtime.ts index ca22707580..131570a3fe 100644 --- a/packages/api-augment/src/kusama/runtime.ts +++ b/packages/api-augment/src/kusama/runtime.ts @@ -305,7 +305,7 @@ declare module '@polkadot/api-base/types/calls' { /** * Generate a set of session keys with optionally using the given seed. **/ - generateSessionKeys: AugmentedCall | null | object | string | Uint8Array) => Observable>; + generateSessionKeys: AugmentedCall | null | Uint8Array | Bytes | string) => Observable>; /** * Generic call **/ diff --git a/packages/api-augment/src/kusama/tx.ts b/packages/api-augment/src/kusama/tx.ts index 5a42442904..5ee3c8d67e 100644 --- a/packages/api-augment/src/kusama/tx.ts +++ b/packages/api-augment/src/kusama/tx.ts @@ -577,8 +577,8 @@ declare module '@polkadot/api-base/types/submittable' { * Total Complexity: O(1) * **/ - mintClaim: AugmentedSubmittable<(who: EthereumAddress | string | Uint8Array, value: u128 | AnyNumber | Uint8Array, vestingSchedule: Option> | null | object | string | Uint8Array, statement: Option | null | object | string | Uint8Array) => SubmittableExtrinsic, [EthereumAddress, u128, Option>, Option]>; - moveClaim: AugmentedSubmittable<(old: EthereumAddress | string | Uint8Array, updated: EthereumAddress | string | Uint8Array, maybePreclaim: Option | null | object | string | Uint8Array) => SubmittableExtrinsic, [EthereumAddress, EthereumAddress, Option]>; + mintClaim: AugmentedSubmittable<(who: EthereumAddress | string | Uint8Array, value: u128 | AnyNumber | Uint8Array, vestingSchedule: Option> | null | Uint8Array | ITuple<[u128, u128, u32]> | [u128 | AnyNumber | Uint8Array, u128 | AnyNumber | Uint8Array, u32 | AnyNumber | Uint8Array], statement: Option | null | Uint8Array | PolkadotRuntimeCommonClaimsStatementKind | 'Regular' | 'Saft' | number) => SubmittableExtrinsic, [EthereumAddress, u128, Option>, Option]>; + moveClaim: AugmentedSubmittable<(old: EthereumAddress | string | Uint8Array, updated: EthereumAddress | string | Uint8Array, maybePreclaim: Option | null | Uint8Array | AccountId32 | string) => SubmittableExtrinsic, [EthereumAddress, EthereumAddress, Option]>; /** * Generic tx **/ @@ -698,11 +698,11 @@ declare module '@polkadot/api-base/types/submittable' { /** * Set the maximum number of validators to use in parachain consensus. **/ - setMaxValidators: AugmentedSubmittable<(updated: Option | null | object | string | Uint8Array) => SubmittableExtrinsic, [Option]>; + setMaxValidators: AugmentedSubmittable<(updated: Option | null | Uint8Array | u32 | AnyNumber) => SubmittableExtrinsic, [Option]>; /** * Set the maximum number of validators to assign to any core. **/ - setMaxValidatorsPerCore: AugmentedSubmittable<(updated: Option | null | object | string | Uint8Array) => SubmittableExtrinsic, [Option]>; + setMaxValidatorsPerCore: AugmentedSubmittable<(updated: Option | null | Uint8Array | u32 | AnyNumber) => SubmittableExtrinsic, [Option]>; /** * Sets the minimum delay between announcing the upgrade block for a parachain until the * upgrade taking place. @@ -907,7 +907,7 @@ declare module '@polkadot/api-base/types/submittable' { * - 1 storage write (codec `O(1)`) for deleting the old `prime` and setting the new one * # **/ - setMembers: AugmentedSubmittable<(newMembers: Vec | (AccountId32 | string | Uint8Array)[], prime: Option | null | object | string | Uint8Array, oldCount: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Vec, Option, u32]>; + setMembers: AugmentedSubmittable<(newMembers: Vec | (AccountId32 | string | Uint8Array)[], prime: Option | null | Uint8Array | AccountId32 | string, oldCount: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Vec, Option, u32]>; /** * Add an aye or nay vote for the sender to the given proposal. * @@ -942,19 +942,19 @@ declare module '@polkadot/api-base/types/submittable' { * Contribute to a crowd sale. This will transfer some balance over to fund a parachain * slot. It will be withdrawable when the crowdloan has ended and the funds are unused. **/ - contribute: AugmentedSubmittable<(index: Compact | AnyNumber | Uint8Array, value: Compact | AnyNumber | Uint8Array, signature: Option | null | object | string | Uint8Array) => SubmittableExtrinsic, [Compact, Compact, Option]>; + contribute: AugmentedSubmittable<(index: Compact | AnyNumber | Uint8Array, value: Compact | AnyNumber | Uint8Array, signature: Option | null | Uint8Array | SpRuntimeMultiSignature | { Ed25519: any } | { Sr25519: any } | { Ecdsa: any } | string) => SubmittableExtrinsic, [Compact, Compact, Option]>; /** * Contribute your entire balance to a crowd sale. This will transfer the entire balance of a user over to fund a parachain * slot. It will be withdrawable when the crowdloan has ended and the funds are unused. **/ - contributeAll: AugmentedSubmittable<(index: Compact | AnyNumber | Uint8Array, signature: Option | null | object | string | Uint8Array) => SubmittableExtrinsic, [Compact, Option]>; + contributeAll: AugmentedSubmittable<(index: Compact | AnyNumber | Uint8Array, signature: Option | null | Uint8Array | SpRuntimeMultiSignature | { Ed25519: any } | { Sr25519: any } | { Ecdsa: any } | string) => SubmittableExtrinsic, [Compact, Option]>; /** * Create a new crowdloaning campaign for a parachain slot with the given lease period range. * * This applies a lock to your parachain configuration, ensuring that it cannot be changed * by the parachain manager. **/ - create: AugmentedSubmittable<(index: Compact | AnyNumber | Uint8Array, cap: Compact | AnyNumber | Uint8Array, firstPeriod: Compact | AnyNumber | Uint8Array, lastPeriod: Compact | AnyNumber | Uint8Array, end: Compact | AnyNumber | Uint8Array, verifier: Option | null | object | string | Uint8Array) => SubmittableExtrinsic, [Compact, Compact, Compact, Compact, Compact, Option]>; + create: AugmentedSubmittable<(index: Compact | AnyNumber | Uint8Array, cap: Compact | AnyNumber | Uint8Array, firstPeriod: Compact | AnyNumber | Uint8Array, lastPeriod: Compact | AnyNumber | Uint8Array, end: Compact | AnyNumber | Uint8Array, verifier: Option | null | Uint8Array | SpRuntimeMultiSigner | { Ed25519: any } | { Sr25519: any } | { Ecdsa: any } | string) => SubmittableExtrinsic, [Compact, Compact, Compact, Compact, Compact, Option]>; /** * Remove a fund after the retirement period has ended and all funds have been returned. **/ @@ -964,7 +964,7 @@ declare module '@polkadot/api-base/types/submittable' { * * Can only be called by Root origin. **/ - edit: AugmentedSubmittable<(index: Compact | AnyNumber | Uint8Array, cap: Compact | AnyNumber | Uint8Array, firstPeriod: Compact | AnyNumber | Uint8Array, lastPeriod: Compact | AnyNumber | Uint8Array, end: Compact | AnyNumber | Uint8Array, verifier: Option | null | object | string | Uint8Array) => SubmittableExtrinsic, [Compact, Compact, Compact, Compact, Compact, Option]>; + edit: AugmentedSubmittable<(index: Compact | AnyNumber | Uint8Array, cap: Compact | AnyNumber | Uint8Array, firstPeriod: Compact | AnyNumber | Uint8Array, lastPeriod: Compact | AnyNumber | Uint8Array, end: Compact | AnyNumber | Uint8Array, verifier: Option | null | Uint8Array | SpRuntimeMultiSigner | { Ed25519: any } | { Sr25519: any } | { Ecdsa: any } | string) => SubmittableExtrinsic, [Compact, Compact, Compact, Compact, Compact, Option]>; /** * Poke the fund into `NewRaise` * @@ -1022,7 +1022,7 @@ declare module '@polkadot/api-base/types/submittable' { * Weight: `O(p)` (though as this is an high-privilege dispatch, we assume it has a * reasonable value). **/ - blacklist: AugmentedSubmittable<(proposalHash: H256 | string | Uint8Array, maybeRefIndex: Option | null | object | string | Uint8Array) => SubmittableExtrinsic, [H256, Option]>; + blacklist: AugmentedSubmittable<(proposalHash: H256 | string | Uint8Array, maybeRefIndex: Option | null | Uint8Array | u32 | AnyNumber) => SubmittableExtrinsic, [H256, Option]>; /** * Remove a proposal. * @@ -1354,7 +1354,7 @@ declare module '@polkadot/api-base/types/submittable' { * This can only be called when [`Phase::Emergency`] is enabled, as an alternative to * calling [`Call::set_emergency_election_result`]. **/ - governanceFallback: AugmentedSubmittable<(maybeMaxVoters: Option | null | object | string | Uint8Array, maybeMaxTargets: Option | null | object | string | Uint8Array) => SubmittableExtrinsic, [Option, Option]>; + governanceFallback: AugmentedSubmittable<(maybeMaxVoters: Option | null | Uint8Array | u32 | AnyNumber, maybeMaxTargets: Option | null | Uint8Array | u32 | AnyNumber) => SubmittableExtrinsic, [Option, Option]>; /** * Set a solution in the queue, to be handed out to the client of this pallet in the next * call to `ElectionProvider::elect`. @@ -1373,7 +1373,7 @@ declare module '@polkadot/api-base/types/submittable' { * * This check can be turned off by setting the value to `None`. **/ - setMinimumUntrustedScore: AugmentedSubmittable<(maybeNextScore: Option | null | object | string | Uint8Array) => SubmittableExtrinsic, [Option]>; + setMinimumUntrustedScore: AugmentedSubmittable<(maybeNextScore: Option | null | Uint8Array | SpNposElectionsElectionScore | { minimalStake?: any; sumStake?: any; sumStakeSquared?: any } | string) => SubmittableExtrinsic, [Option]>; /** * Submit a solution for the signed phase. * @@ -2021,7 +2021,7 @@ declare module '@polkadot/api-base/types/submittable' { * - Write: Multisig Storage, [Caller Account] * # **/ - approveAsMulti: AugmentedSubmittable<(threshold: u16 | AnyNumber | Uint8Array, otherSignatories: Vec | (AccountId32 | string | Uint8Array)[], maybeTimepoint: Option | null | object | string | Uint8Array, callHash: U8aFixed | string | Uint8Array, maxWeight: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u16, Vec, Option, U8aFixed, u64]>; + approveAsMulti: AugmentedSubmittable<(threshold: u16 | AnyNumber | Uint8Array, otherSignatories: Vec | (AccountId32 | string | Uint8Array)[], maybeTimepoint: Option | null | Uint8Array | PalletMultisigTimepoint | { height?: any; index?: any } | string, callHash: U8aFixed | string | Uint8Array, maxWeight: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u16, Vec, Option, U8aFixed, u64]>; /** * Register approval for a dispatch to be made from a deterministic composite account if * approved by a total of `threshold - 1` of `other_signatories`. @@ -2069,7 +2069,7 @@ declare module '@polkadot/api-base/types/submittable' { * - Plus Call Weight * # **/ - asMulti: AugmentedSubmittable<(threshold: u16 | AnyNumber | Uint8Array, otherSignatories: Vec | (AccountId32 | string | Uint8Array)[], maybeTimepoint: Option | null | object | string | Uint8Array, call: WrapperKeepOpaque | object | string | Uint8Array, storeCall: bool | boolean | Uint8Array, maxWeight: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u16, Vec, Option, WrapperKeepOpaque, bool, u64]>; + asMulti: AugmentedSubmittable<(threshold: u16 | AnyNumber | Uint8Array, otherSignatories: Vec | (AccountId32 | string | Uint8Array)[], maybeTimepoint: Option | null | Uint8Array | PalletMultisigTimepoint | { height?: any; index?: any } | string, call: WrapperKeepOpaque | object | string | Uint8Array, storeCall: bool | boolean | Uint8Array, maxWeight: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u16, Vec, Option, WrapperKeepOpaque, bool, u64]>; /** * Immediately dispatch a multi-signature call using a single approval from the caller. * @@ -2629,7 +2629,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 | IMethod | string | Uint8Array) => SubmittableExtrinsic, [AccountId32, Option, Call]>; + proxy: AugmentedSubmittable<(real: AccountId32 | string | Uint8Array, forceProxyType: Option | null | Uint8Array | KusamaRuntimeProxyType | 'Any' | 'NonTransfer' | 'Governance' | 'Staking' | 'IdentityJudgement' | 'CancelProxy' | 'Auction' | 'Society' | number, 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`. @@ -2649,7 +2649,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 | IMethod | string | Uint8Array) => SubmittableExtrinsic, [AccountId32, AccountId32, Option, Call]>; + proxyAnnounced: AugmentedSubmittable<(delegate: AccountId32 | string | Uint8Array, real: AccountId32 | string | Uint8Array, forceProxyType: Option | null | Uint8Array | KusamaRuntimeProxyType | 'Any' | 'NonTransfer' | 'Governance' | 'Staking' | 'IdentityJudgement' | 'CancelProxy' | 'Auction' | 'Society' | number, call: Call | IMethod | string | Uint8Array) => SubmittableExtrinsic, [AccountId32, AccountId32, Option, Call]>; /** * Remove the given announcement of a delegate. * @@ -2934,7 +2934,7 @@ declare module '@polkadot/api-base/types/submittable' { /** * Anonymously schedule a task. **/ - schedule: AugmentedSubmittable<(when: u32 | AnyNumber | Uint8Array, maybePeriodic: Option> | null | object | string | Uint8Array, priority: u8 | AnyNumber | Uint8Array, call: FrameSupportScheduleMaybeHashed | { Value: any } | { Hash: any } | string | Uint8Array) => SubmittableExtrinsic, [u32, Option>, u8, FrameSupportScheduleMaybeHashed]>; + schedule: AugmentedSubmittable<(when: u32 | AnyNumber | Uint8Array, maybePeriodic: Option> | null | Uint8Array | ITuple<[u32, u32]> | [u32 | AnyNumber | Uint8Array, u32 | AnyNumber | Uint8Array], priority: u8 | AnyNumber | Uint8Array, call: FrameSupportScheduleMaybeHashed | { Value: any } | { Hash: any } | string | Uint8Array) => SubmittableExtrinsic, [u32, Option>, u8, FrameSupportScheduleMaybeHashed]>; /** * Anonymously schedule a task after a delay. * @@ -2942,11 +2942,11 @@ declare module '@polkadot/api-base/types/submittable' { * Same as [`schedule`]. * # **/ - scheduleAfter: AugmentedSubmittable<(after: u32 | AnyNumber | Uint8Array, maybePeriodic: Option> | null | object | string | Uint8Array, priority: u8 | AnyNumber | Uint8Array, call: FrameSupportScheduleMaybeHashed | { Value: any } | { Hash: any } | string | Uint8Array) => SubmittableExtrinsic, [u32, Option>, u8, FrameSupportScheduleMaybeHashed]>; + scheduleAfter: AugmentedSubmittable<(after: u32 | AnyNumber | Uint8Array, maybePeriodic: Option> | null | Uint8Array | ITuple<[u32, u32]> | [u32 | AnyNumber | Uint8Array, u32 | AnyNumber | Uint8Array], priority: u8 | AnyNumber | Uint8Array, call: FrameSupportScheduleMaybeHashed | { Value: any } | { Hash: any } | string | Uint8Array) => SubmittableExtrinsic, [u32, Option>, u8, FrameSupportScheduleMaybeHashed]>; /** * Schedule a named task. **/ - scheduleNamed: AugmentedSubmittable<(id: Bytes | string | Uint8Array, when: u32 | AnyNumber | Uint8Array, maybePeriodic: Option> | null | object | string | Uint8Array, priority: u8 | AnyNumber | Uint8Array, call: FrameSupportScheduleMaybeHashed | { Value: any } | { Hash: any } | string | Uint8Array) => SubmittableExtrinsic, [Bytes, u32, Option>, u8, FrameSupportScheduleMaybeHashed]>; + scheduleNamed: AugmentedSubmittable<(id: Bytes | string | Uint8Array, when: u32 | AnyNumber | Uint8Array, maybePeriodic: Option> | null | Uint8Array | ITuple<[u32, u32]> | [u32 | AnyNumber | Uint8Array, u32 | AnyNumber | Uint8Array], priority: u8 | AnyNumber | Uint8Array, call: FrameSupportScheduleMaybeHashed | { Value: any } | { Hash: any } | string | Uint8Array) => SubmittableExtrinsic, [Bytes, u32, Option>, u8, FrameSupportScheduleMaybeHashed]>; /** * Schedule a named task after a delay. * @@ -2954,7 +2954,7 @@ declare module '@polkadot/api-base/types/submittable' { * Same as [`schedule_named`](Self::schedule_named). * # **/ - scheduleNamedAfter: AugmentedSubmittable<(id: Bytes | string | Uint8Array, after: u32 | AnyNumber | Uint8Array, maybePeriodic: Option> | null | object | string | Uint8Array, priority: u8 | AnyNumber | Uint8Array, call: FrameSupportScheduleMaybeHashed | { Value: any } | { Hash: any } | string | Uint8Array) => SubmittableExtrinsic, [Bytes, u32, Option>, u8, FrameSupportScheduleMaybeHashed]>; + scheduleNamedAfter: AugmentedSubmittable<(id: Bytes | string | Uint8Array, after: u32 | AnyNumber | Uint8Array, maybePeriodic: Option> | null | Uint8Array | ITuple<[u32, u32]> | [u32 | AnyNumber | Uint8Array, u32 | AnyNumber | Uint8Array], priority: u8 | AnyNumber | Uint8Array, call: FrameSupportScheduleMaybeHashed | { Value: any } | { Hash: any } | string | Uint8Array) => SubmittableExtrinsic, [Bytes, u32, Option>, u8, FrameSupportScheduleMaybeHashed]>; /** * Generic tx **/ @@ -3960,7 +3960,7 @@ declare module '@polkadot/api-base/types/submittable' { * - 1 storage write (codec `O(1)`) for deleting the old `prime` and setting the new one * # **/ - setMembers: AugmentedSubmittable<(newMembers: Vec | (AccountId32 | string | Uint8Array)[], prime: Option | null | object | string | Uint8Array, oldCount: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Vec, Option, u32]>; + setMembers: AugmentedSubmittable<(newMembers: Vec | (AccountId32 | string | Uint8Array)[], prime: Option | null | Uint8Array | AccountId32 | string, oldCount: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Vec, Option, u32]>; /** * Add an aye or nay vote for the sender to the given proposal. * @@ -4539,7 +4539,7 @@ declare module '@polkadot/api-base/types/submittable' { * - `origin`: Must be Root. * - `maybe_xcm_version`: The default XCM encoding version, or `None` to disable. **/ - forceDefaultXcmVersion: AugmentedSubmittable<(maybeXcmVersion: Option | null | object | string | Uint8Array) => SubmittableExtrinsic, [Option]>; + forceDefaultXcmVersion: AugmentedSubmittable<(maybeXcmVersion: Option | null | Uint8Array | u32 | AnyNumber) => SubmittableExtrinsic, [Option]>; /** * Ask a location to notify us regarding their XCM version and any changes to it. * diff --git a/packages/api-augment/src/polkadot/runtime.ts b/packages/api-augment/src/polkadot/runtime.ts index ca22707580..131570a3fe 100644 --- a/packages/api-augment/src/polkadot/runtime.ts +++ b/packages/api-augment/src/polkadot/runtime.ts @@ -305,7 +305,7 @@ declare module '@polkadot/api-base/types/calls' { /** * Generate a set of session keys with optionally using the given seed. **/ - generateSessionKeys: AugmentedCall | null | object | string | Uint8Array) => Observable>; + generateSessionKeys: AugmentedCall | null | Uint8Array | Bytes | string) => Observable>; /** * Generic call **/ diff --git a/packages/api-augment/src/polkadot/tx.ts b/packages/api-augment/src/polkadot/tx.ts index 45acf92b07..ed4e347d56 100644 --- a/packages/api-augment/src/polkadot/tx.ts +++ b/packages/api-augment/src/polkadot/tx.ts @@ -577,8 +577,8 @@ declare module '@polkadot/api-base/types/submittable' { * Total Complexity: O(1) * **/ - mintClaim: AugmentedSubmittable<(who: EthereumAddress | string | Uint8Array, value: u128 | AnyNumber | Uint8Array, vestingSchedule: Option> | null | object | string | Uint8Array, statement: Option | null | object | string | Uint8Array) => SubmittableExtrinsic, [EthereumAddress, u128, Option>, Option]>; - moveClaim: AugmentedSubmittable<(old: EthereumAddress | string | Uint8Array, updated: EthereumAddress | string | Uint8Array, maybePreclaim: Option | null | object | string | Uint8Array) => SubmittableExtrinsic, [EthereumAddress, EthereumAddress, Option]>; + mintClaim: AugmentedSubmittable<(who: EthereumAddress | string | Uint8Array, value: u128 | AnyNumber | Uint8Array, vestingSchedule: Option> | null | Uint8Array | ITuple<[u128, u128, u32]> | [u128 | AnyNumber | Uint8Array, u128 | AnyNumber | Uint8Array, u32 | AnyNumber | Uint8Array], statement: Option | null | Uint8Array | PolkadotRuntimeCommonClaimsStatementKind | 'Regular' | 'Saft' | number) => SubmittableExtrinsic, [EthereumAddress, u128, Option>, Option]>; + moveClaim: AugmentedSubmittable<(old: EthereumAddress | string | Uint8Array, updated: EthereumAddress | string | Uint8Array, maybePreclaim: Option | null | Uint8Array | AccountId32 | string) => SubmittableExtrinsic, [EthereumAddress, EthereumAddress, Option]>; /** * Generic tx **/ @@ -698,11 +698,11 @@ declare module '@polkadot/api-base/types/submittable' { /** * Set the maximum number of validators to use in parachain consensus. **/ - setMaxValidators: AugmentedSubmittable<(updated: Option | null | object | string | Uint8Array) => SubmittableExtrinsic, [Option]>; + setMaxValidators: AugmentedSubmittable<(updated: Option | null | Uint8Array | u32 | AnyNumber) => SubmittableExtrinsic, [Option]>; /** * Set the maximum number of validators to assign to any core. **/ - setMaxValidatorsPerCore: AugmentedSubmittable<(updated: Option | null | object | string | Uint8Array) => SubmittableExtrinsic, [Option]>; + setMaxValidatorsPerCore: AugmentedSubmittable<(updated: Option | null | Uint8Array | u32 | AnyNumber) => SubmittableExtrinsic, [Option]>; /** * Sets the minimum delay between announcing the upgrade block for a parachain until the * upgrade taking place. @@ -907,7 +907,7 @@ declare module '@polkadot/api-base/types/submittable' { * - 1 storage write (codec `O(1)`) for deleting the old `prime` and setting the new one * # **/ - setMembers: AugmentedSubmittable<(newMembers: Vec | (AccountId32 | string | Uint8Array)[], prime: Option | null | object | string | Uint8Array, oldCount: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Vec, Option, u32]>; + setMembers: AugmentedSubmittable<(newMembers: Vec | (AccountId32 | string | Uint8Array)[], prime: Option | null | Uint8Array | AccountId32 | string, oldCount: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Vec, Option, u32]>; /** * Add an aye or nay vote for the sender to the given proposal. * @@ -942,19 +942,19 @@ declare module '@polkadot/api-base/types/submittable' { * Contribute to a crowd sale. This will transfer some balance over to fund a parachain * slot. It will be withdrawable when the crowdloan has ended and the funds are unused. **/ - contribute: AugmentedSubmittable<(index: Compact | AnyNumber | Uint8Array, value: Compact | AnyNumber | Uint8Array, signature: Option | null | object | string | Uint8Array) => SubmittableExtrinsic, [Compact, Compact, Option]>; + contribute: AugmentedSubmittable<(index: Compact | AnyNumber | Uint8Array, value: Compact | AnyNumber | Uint8Array, signature: Option | null | Uint8Array | SpRuntimeMultiSignature | { Ed25519: any } | { Sr25519: any } | { Ecdsa: any } | string) => SubmittableExtrinsic, [Compact, Compact, Option]>; /** * Contribute your entire balance to a crowd sale. This will transfer the entire balance of a user over to fund a parachain * slot. It will be withdrawable when the crowdloan has ended and the funds are unused. **/ - contributeAll: AugmentedSubmittable<(index: Compact | AnyNumber | Uint8Array, signature: Option | null | object | string | Uint8Array) => SubmittableExtrinsic, [Compact, Option]>; + contributeAll: AugmentedSubmittable<(index: Compact | AnyNumber | Uint8Array, signature: Option | null | Uint8Array | SpRuntimeMultiSignature | { Ed25519: any } | { Sr25519: any } | { Ecdsa: any } | string) => SubmittableExtrinsic, [Compact, Option]>; /** * Create a new crowdloaning campaign for a parachain slot with the given lease period range. * * This applies a lock to your parachain configuration, ensuring that it cannot be changed * by the parachain manager. **/ - create: AugmentedSubmittable<(index: Compact | AnyNumber | Uint8Array, cap: Compact | AnyNumber | Uint8Array, firstPeriod: Compact | AnyNumber | Uint8Array, lastPeriod: Compact | AnyNumber | Uint8Array, end: Compact | AnyNumber | Uint8Array, verifier: Option | null | object | string | Uint8Array) => SubmittableExtrinsic, [Compact, Compact, Compact, Compact, Compact, Option]>; + create: AugmentedSubmittable<(index: Compact | AnyNumber | Uint8Array, cap: Compact | AnyNumber | Uint8Array, firstPeriod: Compact | AnyNumber | Uint8Array, lastPeriod: Compact | AnyNumber | Uint8Array, end: Compact | AnyNumber | Uint8Array, verifier: Option | null | Uint8Array | SpRuntimeMultiSigner | { Ed25519: any } | { Sr25519: any } | { Ecdsa: any } | string) => SubmittableExtrinsic, [Compact, Compact, Compact, Compact, Compact, Option]>; /** * Remove a fund after the retirement period has ended and all funds have been returned. **/ @@ -964,7 +964,7 @@ declare module '@polkadot/api-base/types/submittable' { * * Can only be called by Root origin. **/ - edit: AugmentedSubmittable<(index: Compact | AnyNumber | Uint8Array, cap: Compact | AnyNumber | Uint8Array, firstPeriod: Compact | AnyNumber | Uint8Array, lastPeriod: Compact | AnyNumber | Uint8Array, end: Compact | AnyNumber | Uint8Array, verifier: Option | null | object | string | Uint8Array) => SubmittableExtrinsic, [Compact, Compact, Compact, Compact, Compact, Option]>; + edit: AugmentedSubmittable<(index: Compact | AnyNumber | Uint8Array, cap: Compact | AnyNumber | Uint8Array, firstPeriod: Compact | AnyNumber | Uint8Array, lastPeriod: Compact | AnyNumber | Uint8Array, end: Compact | AnyNumber | Uint8Array, verifier: Option | null | Uint8Array | SpRuntimeMultiSigner | { Ed25519: any } | { Sr25519: any } | { Ecdsa: any } | string) => SubmittableExtrinsic, [Compact, Compact, Compact, Compact, Compact, Option]>; /** * Poke the fund into `NewRaise` * @@ -1022,7 +1022,7 @@ declare module '@polkadot/api-base/types/submittable' { * Weight: `O(p)` (though as this is an high-privilege dispatch, we assume it has a * reasonable value). **/ - blacklist: AugmentedSubmittable<(proposalHash: H256 | string | Uint8Array, maybeRefIndex: Option | null | object | string | Uint8Array) => SubmittableExtrinsic, [H256, Option]>; + blacklist: AugmentedSubmittable<(proposalHash: H256 | string | Uint8Array, maybeRefIndex: Option | null | Uint8Array | u32 | AnyNumber) => SubmittableExtrinsic, [H256, Option]>; /** * Remove a proposal. * @@ -1354,7 +1354,7 @@ declare module '@polkadot/api-base/types/submittable' { * This can only be called when [`Phase::Emergency`] is enabled, as an alternative to * calling [`Call::set_emergency_election_result`]. **/ - governanceFallback: AugmentedSubmittable<(maybeMaxVoters: Option | null | object | string | Uint8Array, maybeMaxTargets: Option | null | object | string | Uint8Array) => SubmittableExtrinsic, [Option, Option]>; + governanceFallback: AugmentedSubmittable<(maybeMaxVoters: Option | null | Uint8Array | u32 | AnyNumber, maybeMaxTargets: Option | null | Uint8Array | u32 | AnyNumber) => SubmittableExtrinsic, [Option, Option]>; /** * Set a solution in the queue, to be handed out to the client of this pallet in the next * call to `ElectionProvider::elect`. @@ -1373,7 +1373,7 @@ declare module '@polkadot/api-base/types/submittable' { * * This check can be turned off by setting the value to `None`. **/ - setMinimumUntrustedScore: AugmentedSubmittable<(maybeNextScore: Option | null | object | string | Uint8Array) => SubmittableExtrinsic, [Option]>; + setMinimumUntrustedScore: AugmentedSubmittable<(maybeNextScore: Option | null | Uint8Array | SpNposElectionsElectionScore | { minimalStake?: any; sumStake?: any; sumStakeSquared?: any } | string) => SubmittableExtrinsic, [Option]>; /** * Submit a solution for the signed phase. * @@ -1970,7 +1970,7 @@ declare module '@polkadot/api-base/types/submittable' { * - Write: Multisig Storage, [Caller Account] * # **/ - approveAsMulti: AugmentedSubmittable<(threshold: u16 | AnyNumber | Uint8Array, otherSignatories: Vec | (AccountId32 | string | Uint8Array)[], maybeTimepoint: Option | null | object | string | Uint8Array, callHash: U8aFixed | string | Uint8Array, maxWeight: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u16, Vec, Option, U8aFixed, u64]>; + approveAsMulti: AugmentedSubmittable<(threshold: u16 | AnyNumber | Uint8Array, otherSignatories: Vec | (AccountId32 | string | Uint8Array)[], maybeTimepoint: Option | null | Uint8Array | PalletMultisigTimepoint | { height?: any; index?: any } | string, callHash: U8aFixed | string | Uint8Array, maxWeight: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u16, Vec, Option, U8aFixed, u64]>; /** * Register approval for a dispatch to be made from a deterministic composite account if * approved by a total of `threshold - 1` of `other_signatories`. @@ -2018,7 +2018,7 @@ declare module '@polkadot/api-base/types/submittable' { * - Plus Call Weight * # **/ - asMulti: AugmentedSubmittable<(threshold: u16 | AnyNumber | Uint8Array, otherSignatories: Vec | (AccountId32 | string | Uint8Array)[], maybeTimepoint: Option | null | object | string | Uint8Array, call: WrapperKeepOpaque | object | string | Uint8Array, storeCall: bool | boolean | Uint8Array, maxWeight: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u16, Vec, Option, WrapperKeepOpaque, bool, u64]>; + asMulti: AugmentedSubmittable<(threshold: u16 | AnyNumber | Uint8Array, otherSignatories: Vec | (AccountId32 | string | Uint8Array)[], maybeTimepoint: Option | null | Uint8Array | PalletMultisigTimepoint | { height?: any; index?: any } | string, call: WrapperKeepOpaque | object | string | Uint8Array, storeCall: bool | boolean | Uint8Array, maxWeight: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u16, Vec, Option, WrapperKeepOpaque, bool, u64]>; /** * Immediately dispatch a multi-signature call using a single approval from the caller. * @@ -2404,7 +2404,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 | IMethod | string | Uint8Array) => SubmittableExtrinsic, [AccountId32, Option, Call]>; + proxy: AugmentedSubmittable<(real: AccountId32 | string | Uint8Array, forceProxyType: Option | null | Uint8Array | PolkadotRuntimeProxyType | 'Any' | 'NonTransfer' | 'Governance' | 'Staking' | 'IdentityJudgement' | 'CancelProxy' | 'Auction' | number, 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`. @@ -2424,7 +2424,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 | IMethod | string | Uint8Array) => SubmittableExtrinsic, [AccountId32, AccountId32, Option, Call]>; + proxyAnnounced: AugmentedSubmittable<(delegate: AccountId32 | string | Uint8Array, real: AccountId32 | string | Uint8Array, forceProxyType: Option | null | Uint8Array | PolkadotRuntimeProxyType | 'Any' | 'NonTransfer' | 'Governance' | 'Staking' | 'IdentityJudgement' | 'CancelProxy' | 'Auction' | number, call: Call | IMethod | string | Uint8Array) => SubmittableExtrinsic, [AccountId32, AccountId32, Option, Call]>; /** * Remove the given announcement of a delegate. * @@ -2583,7 +2583,7 @@ declare module '@polkadot/api-base/types/submittable' { /** * Anonymously schedule a task. **/ - schedule: AugmentedSubmittable<(when: u32 | AnyNumber | Uint8Array, maybePeriodic: Option> | null | object | string | Uint8Array, priority: u8 | AnyNumber | Uint8Array, call: FrameSupportScheduleMaybeHashed | { Value: any } | { Hash: any } | string | Uint8Array) => SubmittableExtrinsic, [u32, Option>, u8, FrameSupportScheduleMaybeHashed]>; + schedule: AugmentedSubmittable<(when: u32 | AnyNumber | Uint8Array, maybePeriodic: Option> | null | Uint8Array | ITuple<[u32, u32]> | [u32 | AnyNumber | Uint8Array, u32 | AnyNumber | Uint8Array], priority: u8 | AnyNumber | Uint8Array, call: FrameSupportScheduleMaybeHashed | { Value: any } | { Hash: any } | string | Uint8Array) => SubmittableExtrinsic, [u32, Option>, u8, FrameSupportScheduleMaybeHashed]>; /** * Anonymously schedule a task after a delay. * @@ -2591,11 +2591,11 @@ declare module '@polkadot/api-base/types/submittable' { * Same as [`schedule`]. * # **/ - scheduleAfter: AugmentedSubmittable<(after: u32 | AnyNumber | Uint8Array, maybePeriodic: Option> | null | object | string | Uint8Array, priority: u8 | AnyNumber | Uint8Array, call: FrameSupportScheduleMaybeHashed | { Value: any } | { Hash: any } | string | Uint8Array) => SubmittableExtrinsic, [u32, Option>, u8, FrameSupportScheduleMaybeHashed]>; + scheduleAfter: AugmentedSubmittable<(after: u32 | AnyNumber | Uint8Array, maybePeriodic: Option> | null | Uint8Array | ITuple<[u32, u32]> | [u32 | AnyNumber | Uint8Array, u32 | AnyNumber | Uint8Array], priority: u8 | AnyNumber | Uint8Array, call: FrameSupportScheduleMaybeHashed | { Value: any } | { Hash: any } | string | Uint8Array) => SubmittableExtrinsic, [u32, Option>, u8, FrameSupportScheduleMaybeHashed]>; /** * Schedule a named task. **/ - scheduleNamed: AugmentedSubmittable<(id: Bytes | string | Uint8Array, when: u32 | AnyNumber | Uint8Array, maybePeriodic: Option> | null | object | string | Uint8Array, priority: u8 | AnyNumber | Uint8Array, call: FrameSupportScheduleMaybeHashed | { Value: any } | { Hash: any } | string | Uint8Array) => SubmittableExtrinsic, [Bytes, u32, Option>, u8, FrameSupportScheduleMaybeHashed]>; + scheduleNamed: AugmentedSubmittable<(id: Bytes | string | Uint8Array, when: u32 | AnyNumber | Uint8Array, maybePeriodic: Option> | null | Uint8Array | ITuple<[u32, u32]> | [u32 | AnyNumber | Uint8Array, u32 | AnyNumber | Uint8Array], priority: u8 | AnyNumber | Uint8Array, call: FrameSupportScheduleMaybeHashed | { Value: any } | { Hash: any } | string | Uint8Array) => SubmittableExtrinsic, [Bytes, u32, Option>, u8, FrameSupportScheduleMaybeHashed]>; /** * Schedule a named task after a delay. * @@ -2603,7 +2603,7 @@ declare module '@polkadot/api-base/types/submittable' { * Same as [`schedule_named`](Self::schedule_named). * # **/ - scheduleNamedAfter: AugmentedSubmittable<(id: Bytes | string | Uint8Array, after: u32 | AnyNumber | Uint8Array, maybePeriodic: Option> | null | object | string | Uint8Array, priority: u8 | AnyNumber | Uint8Array, call: FrameSupportScheduleMaybeHashed | { Value: any } | { Hash: any } | string | Uint8Array) => SubmittableExtrinsic, [Bytes, u32, Option>, u8, FrameSupportScheduleMaybeHashed]>; + scheduleNamedAfter: AugmentedSubmittable<(id: Bytes | string | Uint8Array, after: u32 | AnyNumber | Uint8Array, maybePeriodic: Option> | null | Uint8Array | ITuple<[u32, u32]> | [u32 | AnyNumber | Uint8Array, u32 | AnyNumber | Uint8Array], priority: u8 | AnyNumber | Uint8Array, call: FrameSupportScheduleMaybeHashed | { Value: any } | { Hash: any } | string | Uint8Array) => SubmittableExtrinsic, [Bytes, u32, Option>, u8, FrameSupportScheduleMaybeHashed]>; /** * Generic tx **/ @@ -3282,7 +3282,7 @@ declare module '@polkadot/api-base/types/submittable' { * - 1 storage write (codec `O(1)`) for deleting the old `prime` and setting the new one * # **/ - setMembers: AugmentedSubmittable<(newMembers: Vec | (AccountId32 | string | Uint8Array)[], prime: Option | null | object | string | Uint8Array, oldCount: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Vec, Option, u32]>; + setMembers: AugmentedSubmittable<(newMembers: Vec | (AccountId32 | string | Uint8Array)[], prime: Option | null | Uint8Array | AccountId32 | string, oldCount: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Vec, Option, u32]>; /** * Add an aye or nay vote for the sender to the given proposal. * @@ -3861,7 +3861,7 @@ declare module '@polkadot/api-base/types/submittable' { * - `origin`: Must be Root. * - `maybe_xcm_version`: The default XCM encoding version, or `None` to disable. **/ - forceDefaultXcmVersion: AugmentedSubmittable<(maybeXcmVersion: Option | null | object | string | Uint8Array) => SubmittableExtrinsic, [Option]>; + forceDefaultXcmVersion: AugmentedSubmittable<(maybeXcmVersion: Option | null | Uint8Array | u32 | AnyNumber) => SubmittableExtrinsic, [Option]>; /** * Ask a location to notify us regarding their XCM version and any changes to it. * diff --git a/packages/api-augment/src/substrate/query.ts b/packages/api-augment/src/substrate/query.ts index a45d9eaaac..10405fc280 100644 --- a/packages/api-augment/src/substrate/query.ts +++ b/packages/api-augment/src/substrate/query.ts @@ -1757,7 +1757,7 @@ declare module '@polkadot/api-base/types/storage' { /** * Attributes of a collection. **/ - attribute: AugmentedQuery | null | object | string | Uint8Array, arg3: Bytes | string | Uint8Array) => Observable>>, [u32, Option, Bytes]> & QueryableStorageEntry, Bytes]>; + attribute: AugmentedQuery | null | Uint8Array | u32 | AnyNumber, arg3: Bytes | string | Uint8Array) => Observable>>, [u32, Option, Bytes]> & QueryableStorageEntry, Bytes]>; /** * Details of a collection. **/ diff --git a/packages/api-augment/src/substrate/runtime.ts b/packages/api-augment/src/substrate/runtime.ts index 4f77a4ffec..0a60e00c78 100644 --- a/packages/api-augment/src/substrate/runtime.ts +++ b/packages/api-augment/src/substrate/runtime.ts @@ -110,7 +110,7 @@ declare module '@polkadot/api-base/types/calls' { /** * Perform a call from a specified account to a given contract. **/ - call: AugmentedCall | null | object | string | Uint8Array, inputData: Bytes | string | Uint8Array) => Observable>; + call: AugmentedCall | null | Uint8Array | Balance | AnyNumber, inputData: Bytes | string | Uint8Array) => Observable>; /** * Query a given storage key in a given contract. **/ @@ -118,11 +118,11 @@ declare module '@polkadot/api-base/types/calls' { /** * Instantiate a new contract. **/ - instantiate: AugmentedCall | null | object | string | Uint8Array, code: Bytes | string | Uint8Array, data: Bytes | string | Uint8Array, salt: Bytes | string | Uint8Array) => Observable>; + instantiate: AugmentedCall | null | Uint8Array | Balance | AnyNumber, code: Bytes | string | Uint8Array, data: Bytes | string | Uint8Array, salt: Bytes | string | Uint8Array) => Observable>; /** * Upload new code without instantiating a contract from it. **/ - uploadCode: AugmentedCall | null | object | string | Uint8Array) => Observable>; + uploadCode: AugmentedCall | null | Uint8Array | Balance | AnyNumber) => Observable>; /** * Generic call **/ @@ -236,7 +236,7 @@ declare module '@polkadot/api-base/types/calls' { /** * Generate a set of session keys with optionally using the given seed. **/ - generateSessionKeys: AugmentedCall | null | object | string | Uint8Array) => Observable>; + generateSessionKeys: AugmentedCall | null | Uint8Array | Bytes | string) => Observable>; /** * Generic call **/ diff --git a/packages/api-augment/src/substrate/tx.ts b/packages/api-augment/src/substrate/tx.ts index 224e42a93b..a68d883811 100644 --- a/packages/api-augment/src/substrate/tx.ts +++ b/packages/api-augment/src/substrate/tx.ts @@ -227,7 +227,7 @@ declare module '@polkadot/api-base/types/submittable' { * - 1 storage write (codec `O(1)`) for deleting the old `prime` and setting the new one * # **/ - setMembers: AugmentedSubmittable<(newMembers: Vec | (AccountId32 | string | Uint8Array)[], prime: Option | null | object | string | Uint8Array, oldCount: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Vec, Option, u32]>; + setMembers: AugmentedSubmittable<(newMembers: Vec | (AccountId32 | string | Uint8Array)[], prime: Option | null | Uint8Array | AccountId32 | string, oldCount: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Vec, Option, u32]>; /** * Add an aye or nay vote for the sender to the given proposal. * @@ -1159,7 +1159,7 @@ declare module '@polkadot/api-base/types/submittable' { * * If no account exists and the call value is not less than `existential_deposit`, * a regular account will be created and any value will be transferred. **/ - call: AugmentedSubmittable<(dest: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, value: Compact | AnyNumber | Uint8Array, gasLimit: Compact | AnyNumber | Uint8Array, storageDepositLimit: Option> | null | object | string | Uint8Array, data: Bytes | string | Uint8Array) => SubmittableExtrinsic, [MultiAddress, Compact, Compact, Option>, Bytes]>; + call: AugmentedSubmittable<(dest: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, value: Compact | AnyNumber | Uint8Array, gasLimit: Compact | AnyNumber | Uint8Array, storageDepositLimit: Option> | null | Uint8Array | Compact | AnyNumber, data: Bytes | string | Uint8Array) => SubmittableExtrinsic, [MultiAddress, Compact, Compact, Option>, Bytes]>; /** * Instantiates a contract from a previously deployed wasm binary. * @@ -1167,7 +1167,7 @@ declare module '@polkadot/api-base/types/submittable' { * code deployment step. Instead, the `code_hash` of an on-chain deployed wasm binary * must be supplied. **/ - instantiate: AugmentedSubmittable<(value: Compact | AnyNumber | Uint8Array, gasLimit: Compact | AnyNumber | Uint8Array, storageDepositLimit: Option> | null | object | string | Uint8Array, codeHash: H256 | string | Uint8Array, data: Bytes | string | Uint8Array, salt: Bytes | string | Uint8Array) => SubmittableExtrinsic, [Compact, Compact, Option>, H256, Bytes, Bytes]>; + instantiate: AugmentedSubmittable<(value: Compact | AnyNumber | Uint8Array, gasLimit: Compact | AnyNumber | Uint8Array, storageDepositLimit: Option> | null | Uint8Array | Compact | AnyNumber, codeHash: H256 | string | Uint8Array, data: Bytes | string | Uint8Array, salt: Bytes | string | Uint8Array) => SubmittableExtrinsic, [Compact, Compact, Option>, H256, Bytes, Bytes]>; /** * Instantiates a new contract from the supplied `code` optionally transferring * some balance. @@ -1196,7 +1196,7 @@ declare module '@polkadot/api-base/types/submittable' { * - The `value` is transferred to the new account. * - The `deploy` function is executed in the context of the newly-created account. **/ - instantiateWithCode: AugmentedSubmittable<(value: Compact | AnyNumber | Uint8Array, gasLimit: Compact | AnyNumber | Uint8Array, storageDepositLimit: Option> | null | object | string | Uint8Array, code: Bytes | string | Uint8Array, data: Bytes | string | Uint8Array, salt: Bytes | string | Uint8Array) => SubmittableExtrinsic, [Compact, Compact, Option>, Bytes, Bytes, Bytes]>; + instantiateWithCode: AugmentedSubmittable<(value: Compact | AnyNumber | Uint8Array, gasLimit: Compact | AnyNumber | Uint8Array, storageDepositLimit: Option> | null | Uint8Array | Compact | AnyNumber, code: Bytes | string | Uint8Array, data: Bytes | string | Uint8Array, salt: Bytes | string | Uint8Array) => SubmittableExtrinsic, [Compact, Compact, Option>, Bytes, Bytes, Bytes]>; /** * Remove the code stored under `code_hash` and refund the deposit to its owner. * @@ -1235,7 +1235,7 @@ declare module '@polkadot/api-base/types/submittable' { * only be instantiated by permissioned entities. The same is true when uploading * through [`Self::instantiate_with_code`]. **/ - uploadCode: AugmentedSubmittable<(code: Bytes | string | Uint8Array, storageDepositLimit: Option> | null | object | string | Uint8Array) => SubmittableExtrinsic, [Bytes, Option>]>; + uploadCode: AugmentedSubmittable<(code: Bytes | string | Uint8Array, storageDepositLimit: Option> | null | Uint8Array | Compact | AnyNumber) => SubmittableExtrinsic, [Bytes, Option>]>; /** * Generic tx **/ @@ -1318,7 +1318,7 @@ declare module '@polkadot/api-base/types/submittable' { * Weight: `O(R + log R)` where R is the number of polls that `target` has voted on. * Weight is calculated for the maximum number of vote. **/ - removeVote: AugmentedSubmittable<(clazz: Option | null | object | string | Uint8Array, index: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Option, u32]>; + removeVote: AugmentedSubmittable<(clazz: Option | null | Uint8Array | u16 | AnyNumber, index: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Option, u32]>; /** * Undelegate the voting power of the sending account for a particular class of polls. * @@ -1496,7 +1496,7 @@ declare module '@polkadot/api-base/types/submittable' { * - 1 storage write (codec `O(1)`) for deleting the old `prime` and setting the new one * # **/ - setMembers: AugmentedSubmittable<(newMembers: Vec | (AccountId32 | string | Uint8Array)[], prime: Option | null | object | string | Uint8Array, oldCount: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Vec, Option, u32]>; + setMembers: AugmentedSubmittable<(newMembers: Vec | (AccountId32 | string | Uint8Array)[], prime: Option | null | Uint8Array | AccountId32 | string, oldCount: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Vec, Option, u32]>; /** * Add an aye or nay vote for the sender to the given proposal. * @@ -1538,7 +1538,7 @@ declare module '@polkadot/api-base/types/submittable' { * Weight: `O(p)` (though as this is an high-privilege dispatch, we assume it has a * reasonable value). **/ - blacklist: AugmentedSubmittable<(proposalHash: H256 | string | Uint8Array, maybeRefIndex: Option | null | object | string | Uint8Array) => SubmittableExtrinsic, [H256, Option]>; + blacklist: AugmentedSubmittable<(proposalHash: H256 | string | Uint8Array, maybeRefIndex: Option | null | Uint8Array | u32 | AnyNumber) => SubmittableExtrinsic, [H256, Option]>; /** * Remove a proposal. * @@ -1864,7 +1864,7 @@ declare module '@polkadot/api-base/types/submittable' { * This can only be called when [`Phase::Emergency`] is enabled, as an alternative to * calling [`Call::set_emergency_election_result`]. **/ - governanceFallback: AugmentedSubmittable<(maybeMaxVoters: Option | null | object | string | Uint8Array, maybeMaxTargets: Option | null | object | string | Uint8Array) => SubmittableExtrinsic, [Option, Option]>; + governanceFallback: AugmentedSubmittable<(maybeMaxVoters: Option | null | Uint8Array | u32 | AnyNumber, maybeMaxTargets: Option | null | Uint8Array | u32 | AnyNumber) => SubmittableExtrinsic, [Option, Option]>; /** * Set a solution in the queue, to be handed out to the client of this pallet in the next * call to `ElectionProvider::elect`. @@ -1883,7 +1883,7 @@ declare module '@polkadot/api-base/types/submittable' { * * This check can be turned off by setting the value to `None`. **/ - setMinimumUntrustedScore: AugmentedSubmittable<(maybeNextScore: Option | null | object | string | Uint8Array) => SubmittableExtrinsic, [Option]>; + setMinimumUntrustedScore: AugmentedSubmittable<(maybeNextScore: Option | null | Uint8Array | SpNposElectionsElectionScore | { minimalStake?: any; sumStake?: any; sumStakeSquared?: any } | string) => SubmittableExtrinsic, [Option]>; /** * Submit a solution for the signed phase. * @@ -2606,7 +2606,7 @@ declare module '@polkadot/api-base/types/submittable' { * - Write: Multisig Storage, [Caller Account] * # **/ - approveAsMulti: AugmentedSubmittable<(threshold: u16 | AnyNumber | Uint8Array, otherSignatories: Vec | (AccountId32 | string | Uint8Array)[], maybeTimepoint: Option | null | object | string | Uint8Array, callHash: U8aFixed | string | Uint8Array, maxWeight: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u16, Vec, Option, U8aFixed, u64]>; + approveAsMulti: AugmentedSubmittable<(threshold: u16 | AnyNumber | Uint8Array, otherSignatories: Vec | (AccountId32 | string | Uint8Array)[], maybeTimepoint: Option | null | Uint8Array | PalletMultisigTimepoint | { height?: any; index?: any } | string, callHash: U8aFixed | string | Uint8Array, maxWeight: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u16, Vec, Option, U8aFixed, u64]>; /** * Register approval for a dispatch to be made from a deterministic composite account if * approved by a total of `threshold - 1` of `other_signatories`. @@ -2654,7 +2654,7 @@ declare module '@polkadot/api-base/types/submittable' { * - Plus Call Weight * # **/ - asMulti: AugmentedSubmittable<(threshold: u16 | AnyNumber | Uint8Array, otherSignatories: Vec | (AccountId32 | string | Uint8Array)[], maybeTimepoint: Option | null | object | string | Uint8Array, call: WrapperKeepOpaque | object | string | Uint8Array, storeCall: bool | boolean | Uint8Array, maxWeight: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u16, Vec, Option, WrapperKeepOpaque, bool, u64]>; + asMulti: AugmentedSubmittable<(threshold: u16 | AnyNumber | Uint8Array, otherSignatories: Vec | (AccountId32 | string | Uint8Array)[], maybeTimepoint: Option | null | Uint8Array | PalletMultisigTimepoint | { height?: any; index?: any } | string, call: WrapperKeepOpaque | object | string | Uint8Array, storeCall: bool | boolean | Uint8Array, maxWeight: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u16, Vec, Option, WrapperKeepOpaque, bool, u64]>; /** * Immediately dispatch a multi-signature call using a single approval from the caller. * @@ -3019,7 +3019,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 | IMethod | string | Uint8Array) => SubmittableExtrinsic, [AccountId32, Option, Call]>; + proxy: AugmentedSubmittable<(real: AccountId32 | string | Uint8Array, forceProxyType: Option | null | Uint8Array | NodeRuntimeProxyType | 'Any' | 'NonTransfer' | 'Governance' | 'Staking' | number, 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`. @@ -3039,7 +3039,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 | IMethod | string | Uint8Array) => SubmittableExtrinsic, [AccountId32, AccountId32, Option, Call]>; + proxyAnnounced: AugmentedSubmittable<(delegate: AccountId32 | string | Uint8Array, real: AccountId32 | string | Uint8Array, forceProxyType: Option | null | Uint8Array | NodeRuntimeProxyType | 'Any' | 'NonTransfer' | 'Governance' | 'Staking' | number, call: Call | IMethod | string | Uint8Array) => SubmittableExtrinsic, [AccountId32, AccountId32, Option, Call]>; /** * Remove the given announcement of a delegate. * @@ -3482,7 +3482,7 @@ declare module '@polkadot/api-base/types/submittable' { /** * Anonymously schedule a task. **/ - schedule: AugmentedSubmittable<(when: u32 | AnyNumber | Uint8Array, maybePeriodic: Option> | null | object | string | Uint8Array, priority: u8 | AnyNumber | Uint8Array, call: FrameSupportScheduleMaybeHashed | { Value: any } | { Hash: any } | string | Uint8Array) => SubmittableExtrinsic, [u32, Option>, u8, FrameSupportScheduleMaybeHashed]>; + schedule: AugmentedSubmittable<(when: u32 | AnyNumber | Uint8Array, maybePeriodic: Option> | null | Uint8Array | ITuple<[u32, u32]> | [u32 | AnyNumber | Uint8Array, u32 | AnyNumber | Uint8Array], priority: u8 | AnyNumber | Uint8Array, call: FrameSupportScheduleMaybeHashed | { Value: any } | { Hash: any } | string | Uint8Array) => SubmittableExtrinsic, [u32, Option>, u8, FrameSupportScheduleMaybeHashed]>; /** * Anonymously schedule a task after a delay. * @@ -3490,11 +3490,11 @@ declare module '@polkadot/api-base/types/submittable' { * Same as [`schedule`]. * # **/ - scheduleAfter: AugmentedSubmittable<(after: u32 | AnyNumber | Uint8Array, maybePeriodic: Option> | null | object | string | Uint8Array, priority: u8 | AnyNumber | Uint8Array, call: FrameSupportScheduleMaybeHashed | { Value: any } | { Hash: any } | string | Uint8Array) => SubmittableExtrinsic, [u32, Option>, u8, FrameSupportScheduleMaybeHashed]>; + scheduleAfter: AugmentedSubmittable<(after: u32 | AnyNumber | Uint8Array, maybePeriodic: Option> | null | Uint8Array | ITuple<[u32, u32]> | [u32 | AnyNumber | Uint8Array, u32 | AnyNumber | Uint8Array], priority: u8 | AnyNumber | Uint8Array, call: FrameSupportScheduleMaybeHashed | { Value: any } | { Hash: any } | string | Uint8Array) => SubmittableExtrinsic, [u32, Option>, u8, FrameSupportScheduleMaybeHashed]>; /** * Schedule a named task. **/ - scheduleNamed: AugmentedSubmittable<(id: Bytes | string | Uint8Array, when: u32 | AnyNumber | Uint8Array, maybePeriodic: Option> | null | object | string | Uint8Array, priority: u8 | AnyNumber | Uint8Array, call: FrameSupportScheduleMaybeHashed | { Value: any } | { Hash: any } | string | Uint8Array) => SubmittableExtrinsic, [Bytes, u32, Option>, u8, FrameSupportScheduleMaybeHashed]>; + scheduleNamed: AugmentedSubmittable<(id: Bytes | string | Uint8Array, when: u32 | AnyNumber | Uint8Array, maybePeriodic: Option> | null | Uint8Array | ITuple<[u32, u32]> | [u32 | AnyNumber | Uint8Array, u32 | AnyNumber | Uint8Array], priority: u8 | AnyNumber | Uint8Array, call: FrameSupportScheduleMaybeHashed | { Value: any } | { Hash: any } | string | Uint8Array) => SubmittableExtrinsic, [Bytes, u32, Option>, u8, FrameSupportScheduleMaybeHashed]>; /** * Schedule a named task after a delay. * @@ -3502,7 +3502,7 @@ declare module '@polkadot/api-base/types/submittable' { * Same as [`schedule_named`](Self::schedule_named). * # **/ - scheduleNamedAfter: AugmentedSubmittable<(id: Bytes | string | Uint8Array, after: u32 | AnyNumber | Uint8Array, maybePeriodic: Option> | null | object | string | Uint8Array, priority: u8 | AnyNumber | Uint8Array, call: FrameSupportScheduleMaybeHashed | { Value: any } | { Hash: any } | string | Uint8Array) => SubmittableExtrinsic, [Bytes, u32, Option>, u8, FrameSupportScheduleMaybeHashed]>; + scheduleNamedAfter: AugmentedSubmittable<(id: Bytes | string | Uint8Array, after: u32 | AnyNumber | Uint8Array, maybePeriodic: Option> | null | Uint8Array | ITuple<[u32, u32]> | [u32 | AnyNumber | Uint8Array, u32 | AnyNumber | Uint8Array], priority: u8 | AnyNumber | Uint8Array, call: FrameSupportScheduleMaybeHashed | { Value: any } | { Hash: any } | string | Uint8Array) => SubmittableExtrinsic, [Bytes, u32, Option>, u8, FrameSupportScheduleMaybeHashed]>; /** * Generic tx **/ @@ -4310,7 +4310,7 @@ declare module '@polkadot/api-base/types/submittable' { * * The dispatch origin of this call must be [`Config::ControlOrigin`]. **/ - controlAutoMigration: AugmentedSubmittable<(maybeConfig: Option | null | object | string | Uint8Array) => SubmittableExtrinsic, [Option]>; + controlAutoMigration: AugmentedSubmittable<(maybeConfig: Option | null | Uint8Array | PalletStateTrieMigrationMigrationLimits | { size_?: any; item?: any } | string) => SubmittableExtrinsic, [Option]>; /** * Forcefully set the progress the running migration. * @@ -4606,7 +4606,7 @@ declare module '@polkadot/api-base/types/submittable' { * - 1 storage write (codec `O(1)`) for deleting the old `prime` and setting the new one * # **/ - setMembers: AugmentedSubmittable<(newMembers: Vec | (AccountId32 | string | Uint8Array)[], prime: Option | null | object | string | Uint8Array, oldCount: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Vec, Option, u32]>; + setMembers: AugmentedSubmittable<(newMembers: Vec | (AccountId32 | string | Uint8Array)[], prime: Option | null | Uint8Array | AccountId32 | string, oldCount: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Vec, Option, u32]>; /** * Add an aye or nay vote for the sender to the given proposal. * @@ -4982,7 +4982,7 @@ declare module '@polkadot/api-base/types/submittable' { * Weight: `O(1)` * Modes: `check_owner.is_some()`. **/ - burn: AugmentedSubmittable<(collection: u32 | AnyNumber | Uint8Array, item: u32 | AnyNumber | Uint8Array, checkOwner: Option | null | object | string | Uint8Array) => SubmittableExtrinsic, [u32, u32, Option]>; + burn: AugmentedSubmittable<(collection: u32 | AnyNumber | Uint8Array, item: u32 | AnyNumber | Uint8Array, checkOwner: Option | null | Uint8Array | MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string) => SubmittableExtrinsic, [u32, u32, Option]>; /** * Cancel the prior approval for the transfer of an item by a delegate. * @@ -5001,7 +5001,7 @@ declare module '@polkadot/api-base/types/submittable' { * * Weight: `O(1)` **/ - cancelApproval: AugmentedSubmittable<(collection: u32 | AnyNumber | Uint8Array, item: u32 | AnyNumber | Uint8Array, maybeCheckDelegate: Option | null | object | string | Uint8Array) => SubmittableExtrinsic, [u32, u32, Option]>; + cancelApproval: AugmentedSubmittable<(collection: u32 | AnyNumber | Uint8Array, item: u32 | AnyNumber | Uint8Array, maybeCheckDelegate: Option | null | Uint8Array | MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string) => SubmittableExtrinsic, [u32, u32, Option]>; /** * Clear an attribute for a collection or item. * @@ -5018,7 +5018,7 @@ declare module '@polkadot/api-base/types/submittable' { * * Weight: `O(1)` **/ - clearAttribute: AugmentedSubmittable<(collection: u32 | AnyNumber | Uint8Array, maybeItem: Option | null | object | string | Uint8Array, key: Bytes | string | Uint8Array) => SubmittableExtrinsic, [u32, Option, Bytes]>; + clearAttribute: AugmentedSubmittable<(collection: u32 | AnyNumber | Uint8Array, maybeItem: Option | null | Uint8Array | u32 | AnyNumber, key: Bytes | string | Uint8Array) => SubmittableExtrinsic, [u32, Option, Bytes]>; /** * Clear the metadata for a collection. * @@ -5197,7 +5197,7 @@ declare module '@polkadot/api-base/types/submittable' { * * Emits `OwnershipAcceptanceChanged`. **/ - setAcceptOwnership: AugmentedSubmittable<(maybeCollection: Option | null | object | string | Uint8Array) => SubmittableExtrinsic, [Option]>; + setAcceptOwnership: AugmentedSubmittable<(maybeCollection: Option | null | Uint8Array | u32 | AnyNumber) => SubmittableExtrinsic, [Option]>; /** * Set an attribute for a collection or item. * @@ -5217,7 +5217,7 @@ declare module '@polkadot/api-base/types/submittable' { * * Weight: `O(1)` **/ - setAttribute: AugmentedSubmittable<(collection: u32 | AnyNumber | Uint8Array, maybeItem: Option | null | object | string | Uint8Array, key: Bytes | string | Uint8Array, value: Bytes | string | Uint8Array) => SubmittableExtrinsic, [u32, Option, Bytes, Bytes]>; + setAttribute: AugmentedSubmittable<(collection: u32 | AnyNumber | Uint8Array, maybeItem: Option | null | Uint8Array | u32 | AnyNumber, key: Bytes | string | Uint8Array, value: Bytes | string | Uint8Array) => SubmittableExtrinsic, [u32, Option, Bytes, Bytes]>; /** * Set the maximum amount of items a collection could have. * diff --git a/packages/rpc-augment/src/augment/jsonrpc.ts b/packages/rpc-augment/src/augment/jsonrpc.ts index 13e4253e1d..f1502ffb9a 100644 --- a/packages/rpc-augment/src/augment/jsonrpc.ts +++ b/packages/rpc-augment/src/augment/jsonrpc.ts @@ -206,7 +206,7 @@ declare module '@polkadot/rpc-core/types/jsonrpc' { /** * Returns fee history for given block count & reward percentiles **/ - feeHistory: AugmentedRpc<(blockCount: U256 | AnyNumber | Uint8Array, newestBlock: BlockNumber | AnyNumber | Uint8Array, rewardPercentiles: Option> | null | object | string | Uint8Array) => Observable>; + feeHistory: AugmentedRpc<(blockCount: U256 | AnyNumber | Uint8Array, newestBlock: BlockNumber | AnyNumber | Uint8Array, rewardPercentiles: Option> | null | Uint8Array | Vec | (f64)[]) => Observable>; /** * Returns current gas price. **/ @@ -496,7 +496,7 @@ declare module '@polkadot/rpc-core/types/jsonrpc' { /** * Provides a way to trace the re-execution of a single block **/ - traceBlock: AugmentedRpc<(block: Hash | string | Uint8Array, targets: Option | null | object | string | Uint8Array, storageKeys: Option | null | object | string | Uint8Array, methods: Option | null | object | string | Uint8Array) => Observable>; + traceBlock: AugmentedRpc<(block: Hash | string | Uint8Array, targets: Option | null | Uint8Array | Text | string, storageKeys: Option | null | Uint8Array | Text | string, methods: Option | null | Uint8Array | Text | string) => Observable>; /** * Check current migration state **/ diff --git a/packages/rpc-provider/src/ws/index.ts b/packages/rpc-provider/src/ws/index.ts index 319c5a898d..aacbfa78d4 100644 --- a/packages/rpc-provider/src/ws/index.ts +++ b/packages/rpc-provider/src/ws/index.ts @@ -197,7 +197,9 @@ export class WsProvider implements ProviderInterface { public async connect (): Promise { try { this.#endpointIndex = (this.#endpointIndex + 1) % this.#endpoints.length; - this.#websocket = typeof xglobal.WebSocket !== 'undefined' && isChildClass(xglobal.WebSocket, WebSocket) + + // the as typeof WebSocket here is Deno-specific - not available on the globalThis + this.#websocket = typeof xglobal.WebSocket !== 'undefined' && isChildClass(xglobal.WebSocket as typeof WebSocket, WebSocket) ? new WebSocket(this.#endpoints[this.#endpointIndex]) // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore - WS may be an instance of w3cwebsocket, which supports headers diff --git a/packages/typegen/src/util/derived.ts b/packages/typegen/src/util/derived.ts index c9d78294cc..ae5a3d1c34 100644 --- a/packages/typegen/src/util/derived.ts +++ b/packages/typegen/src/util/derived.ts @@ -96,8 +96,16 @@ export function getSimilarTypes (registry: Registry, definitions: Record