From 0967dbba6b0f89b9c4af2c1cb6ee85b3305e62c2 Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Sun, 27 Dec 2020 11:15:02 +0100 Subject: [PATCH] Add api.{errors, events, query, tx}..
.is(...) (#2984) * api.{event, error}.
.is * Full generation, with checkTypes * .is * Extrinsic with arg type definition * decorate is * Call is * Remove hasOrigin * Renames * Query is * Fix extrinsic is * Backwards compatibility for generated types * event with optional AnyTuple * Cleanups * Cleanups * Adjust * Cleanup --- packages/api/src/augment/errors.ts | 1162 +++++++++++++++++ packages/api/src/augment/events.ts | 842 ++++++++++++ packages/api/src/augment/index.ts | 2 + packages/api/src/augment/query.ts | 362 ++--- packages/api/src/augment/tx.ts | 410 +++--- packages/api/src/base/Decorate.ts | 17 +- packages/api/src/base/Getters.ts | 16 +- packages/api/src/checkTypes.manual.ts | 60 +- packages/api/src/types/errors.ts | 16 + packages/api/src/types/events.ts | 17 + packages/api/src/types/index.ts | 2 + packages/api/src/types/storage.ts | 19 +- packages/api/src/types/submittable.ts | 9 +- .../src/decorate/constants/index.spec.ts | 2 +- .../metadata/src/decorate/constants/index.ts | 14 +- .../metadata/src/decorate/errors/index.ts | 42 + .../metadata/src/decorate/events/index.ts | 36 + .../decorate/extrinsics/createUnchecked.ts | 9 +- .../src/decorate/extrinsics/index.spec.ts | 11 +- .../metadata/src/decorate/extrinsics/index.ts | 6 +- packages/metadata/src/decorate/index.spec.ts | 2 +- packages/metadata/src/decorate/index.ts | 6 +- .../src/decorate/storage/index.spec.ts | 2 +- packages/metadata/src/decorate/types.ts | 36 +- packages/typegen/src/fromChain.ts | 6 +- packages/typegen/src/generate/errors.ts | 60 + packages/typegen/src/generate/events.ts | 80 ++ packages/typegen/src/generate/index.ts | 2 + packages/typegen/src/generate/query.ts | 9 +- packages/typegen/src/generate/tx.ts | 3 +- packages/typegen/src/interfacesTs.ts | 4 +- packages/typegen/src/templates/errors.hbs | 26 + packages/typegen/src/templates/events.hbs | 26 + packages/typegen/src/templates/query.hbs | 2 +- packages/typegen/src/templates/tx.hbs | 2 +- packages/types/src/create/registry.ts | 2 +- packages/types/src/extrinsic/Extrinsic.ts | 32 +- .../types/src/extrinsic/v4/Extrinsic.spec.ts | 2 +- packages/types/src/generic/Call.spec.ts | 25 - packages/types/src/generic/Call.ts | 24 +- packages/types/src/generic/Event.ts | 6 +- packages/types/src/primitive/StorageKey.ts | 20 +- packages/types/src/types/calls.ts | 18 +- packages/types/src/types/codec.ts | 2 + packages/types/src/types/events.ts | 27 + packages/types/src/types/extrinsic.ts | 8 +- packages/types/src/types/index.ts | 1 + packages/types/src/types/interfaces.ts | 24 +- 48 files changed, 2987 insertions(+), 524 deletions(-) create mode 100644 packages/api/src/augment/errors.ts create mode 100644 packages/api/src/augment/events.ts create mode 100644 packages/api/src/types/errors.ts create mode 100644 packages/api/src/types/events.ts create mode 100644 packages/metadata/src/decorate/errors/index.ts create mode 100644 packages/metadata/src/decorate/events/index.ts create mode 100644 packages/typegen/src/generate/errors.ts create mode 100644 packages/typegen/src/generate/events.ts create mode 100644 packages/typegen/src/templates/errors.hbs create mode 100644 packages/typegen/src/templates/events.hbs create mode 100644 packages/types/src/types/events.ts diff --git a/packages/api/src/augment/errors.ts b/packages/api/src/augment/errors.ts new file mode 100644 index 0000000000..889bc77751 --- /dev/null +++ b/packages/api/src/augment/errors.ts @@ -0,0 +1,1162 @@ +// Auto-generated via `yarn polkadot-types-from-chain`, do not edit +/* eslint-disable */ + +import type { ApiTypes } from '@polkadot/api/types'; + +declare module '@polkadot/api/types/errors' { + export interface AugmentedErrors { + assets: { + [key: string]: AugmentedError; + /** + * Transfer amount should be non-zero. + **/ + AmountZero: AugmentedError; + /** + * Invalid witness data given. + **/ + BadWitness: AugmentedError; + /** + * Account balance must be greater than or equal to the transfer amount. + **/ + BalanceLow: AugmentedError; + /** + * Balance should be non-zero. + **/ + BalanceZero: AugmentedError; + /** + * The origin account is frozen. + **/ + Frozen: AugmentedError; + /** + * The asset ID is already taken. + **/ + InUse: AugmentedError; + /** + * Minimum balance should be non-zero. + **/ + MinBalanceZero: AugmentedError; + /** + * The signing account has no permission to do the operation. + **/ + NoPermission: AugmentedError; + /** + * A mint operation lead to an overflow. + **/ + Overflow: AugmentedError; + /** + * Attempt to destroy an asset class when non-zombie, reference-bearing accounts exist. + **/ + RefsLeft: AugmentedError; + /** + * Too many zombie accounts in use. + **/ + TooManyZombies: AugmentedError; + /** + * The given asset ID is unknown. + **/ + Unknown: AugmentedError; + }; + authorship: { + [key: string]: AugmentedError; + /** + * The uncle is genesis. + **/ + GenesisUncle: AugmentedError; + /** + * The uncle parent not in the chain. + **/ + InvalidUncleParent: AugmentedError; + /** + * The uncle isn't recent enough to be included. + **/ + OldUncle: AugmentedError; + /** + * The uncle is too high in chain. + **/ + TooHighUncle: AugmentedError; + /** + * Too many uncles. + **/ + TooManyUncles: AugmentedError; + /** + * The uncle is already included. + **/ + UncleAlreadyIncluded: AugmentedError; + /** + * Uncles already set in the block. + **/ + UnclesAlreadySet: AugmentedError; + }; + balances: { + [key: string]: AugmentedError; + /** + * Beneficiary account must pre-exist + **/ + DeadAccount: AugmentedError; + /** + * Value too low to create account due to existential deposit + **/ + ExistentialDeposit: AugmentedError; + /** + * A vesting schedule already exists for this account + **/ + ExistingVestingSchedule: AugmentedError; + /** + * Balance too low to send value + **/ + InsufficientBalance: AugmentedError; + /** + * Transfer/payment would kill account + **/ + KeepAlive: AugmentedError; + /** + * Account liquidity restrictions prevent withdrawal + **/ + LiquidityRestrictions: AugmentedError; + /** + * Got an overflow after adding + **/ + Overflow: AugmentedError; + /** + * Vesting balance too high to send value + **/ + VestingBalance: AugmentedError; + }; + bounties: { + [key: string]: AugmentedError; + /** + * Proposer's balance is too low. + **/ + InsufficientProposersBalance: AugmentedError; + /** + * Invalid bounty fee. + **/ + InvalidFee: AugmentedError; + /** + * No proposal or bounty at that index. + **/ + InvalidIndex: AugmentedError; + /** + * Invalid bounty value. + **/ + InvalidValue: AugmentedError; + /** + * A bounty payout is pending. + * To cancel the bounty, you must unassign and slash the curator. + **/ + PendingPayout: AugmentedError; + /** + * The bounties cannot be claimed/closed because it's still in the countdown period. + **/ + Premature: AugmentedError; + /** + * The reason given is just too big. + **/ + ReasonTooBig: AugmentedError; + /** + * Require bounty curator. + **/ + RequireCurator: AugmentedError; + /** + * The bounty status is unexpected. + **/ + UnexpectedStatus: AugmentedError; + }; + contracts: { + [key: string]: AugmentedError; + /** + * Performing the requested transfer would have brought the contract below + * the subsistence threshold. No transfer is allowed to do this in order to allow + * for a tombstone to be created. Use `seal_terminate` to remove a contract without + * leaving a tombstone behind. + **/ + BelowSubsistenceThreshold: AugmentedError; + /** + * No code could be found at the supplied code hash. + **/ + CodeNotFound: AugmentedError; + /** + * The code supplied to `put_code` exceeds the limit specified in the current schedule. + **/ + CodeTooLarge: AugmentedError; + /** + * Contract trapped during execution. + **/ + ContractTrapped: AugmentedError; + /** + * Input passed to a contract API function failed to decode as expected type. + **/ + DecodingFailed: AugmentedError; + /** + * An origin TrieId written in the current block. + **/ + InvalidContractOrigin: AugmentedError; + /** + * Cannot restore to nonexisting or alive contract. + **/ + InvalidDestinationContract: AugmentedError; + /** + * A new schedule must have a greater version than the current one. + **/ + InvalidScheduleVersion: AugmentedError; + /** + * Cannot restore from nonexisting or tombstone contract. + **/ + InvalidSourceContract: AugmentedError; + /** + * An origin must be signed or inherent and auxiliary sender only provided on inherent. + **/ + InvalidSurchargeClaim: AugmentedError; + /** + * Tombstones don't match. + **/ + InvalidTombstone: AugmentedError; + /** + * Performing a call was denied because the calling depth reached the limit + * of what is specified in the schedule. + **/ + MaxCallDepthReached: AugmentedError; + /** + * The newly created contract is below the subsistence threshold after executing + * its contructor. No contracts are allowed to exist below that threshold. + **/ + NewContractNotFunded: AugmentedError; + /** + * The contract that was called is either no contract at all (a plain account) + * or is a tombstone. + **/ + NotCallable: AugmentedError; + /** + * A buffer outside of sandbox memory was passed to a contract API function. + **/ + OutOfBounds: AugmentedError; + /** + * The executed contract exhausted its gas limit. + **/ + OutOfGas: AugmentedError; + /** + * The output buffer supplied to a contract API call was too small. + **/ + OutputBufferTooSmall: AugmentedError; + /** + * The action performed is not allowed while the contract performing it is already + * on the call stack. Those actions are contract self destruction and restoration + * of a tombstone. + **/ + ReentranceDenied: AugmentedError; + /** + * Performing the requested transfer failed for a reason originating in the + * chosen currency implementation of the runtime. Most probably the balance is + * too low or locks are placed on it. + **/ + TransferFailed: AugmentedError; + /** + * The size defined in `T::MaxValueSize` was exceeded. + **/ + ValueTooLarge: AugmentedError; + }; + council: { + [key: string]: AugmentedError; + /** + * Members are already initialized! + **/ + AlreadyInitialized: AugmentedError; + /** + * Duplicate proposals not allowed + **/ + DuplicateProposal: AugmentedError; + /** + * Duplicate vote ignored + **/ + DuplicateVote: AugmentedError; + /** + * Account is not a member + **/ + NotMember: AugmentedError; + /** + * Proposal must exist + **/ + ProposalMissing: AugmentedError; + /** + * The close call was made too early, before the end of the voting. + **/ + TooEarly: AugmentedError; + /** + * There can only be a maximum of `MaxProposals` active proposals. + **/ + TooManyProposals: AugmentedError; + /** + * Mismatched index + **/ + WrongIndex: AugmentedError; + /** + * The given length bound for the proposal was too low. + **/ + WrongProposalLength: AugmentedError; + /** + * The given weight bound for the proposal was too low. + **/ + WrongProposalWeight: AugmentedError; + }; + democracy: { + [key: string]: AugmentedError; + /** + * Cannot cancel the same proposal twice + **/ + AlreadyCanceled: AugmentedError; + /** + * The account is already delegating. + **/ + AlreadyDelegating: AugmentedError; + /** + * Identity may not veto a proposal twice + **/ + AlreadyVetoed: AugmentedError; + /** + * Unknown index + **/ + BadIndex: AugmentedError; + /** + * Preimage already noted + **/ + DuplicatePreimage: AugmentedError; + /** + * Proposal already made + **/ + DuplicateProposal: AugmentedError; + /** + * Imminent + **/ + Imminent: AugmentedError; + /** + * The instant referendum origin is currently disallowed. + **/ + InstantNotAllowed: AugmentedError; + /** + * Too high a balance was provided that the account cannot afford. + **/ + InsufficientFunds: AugmentedError; + /** + * Invalid hash + **/ + InvalidHash: AugmentedError; + /** + * The provided witness data is wrong. + **/ + InvalidWitness: AugmentedError; + /** + * Maximum number of votes reached. + **/ + MaxVotesReached: AugmentedError; + /** + * No proposals waiting + **/ + NoneWaiting: AugmentedError; + /** + * Delegation to oneself makes no sense. + **/ + Nonsense: AugmentedError; + /** + * The actor has no permission to conduct the action. + **/ + NoPermission: AugmentedError; + /** + * No external proposal + **/ + NoProposal: AugmentedError; + /** + * Not delegated + **/ + NotDelegated: AugmentedError; + /** + * The account is not currently delegating. + **/ + NotDelegating: AugmentedError; + /** + * The lock on the account to be unlocked has not yet expired. + **/ + NotExpired: AugmentedError; + /** + * Not imminent + **/ + NotImminent: AugmentedError; + /** + * The target account does not have a lock. + **/ + NotLocked: AugmentedError; + /** + * Next external proposal not simple majority + **/ + NotSimpleMajority: AugmentedError; + /** + * The given account did not vote on the referendum. + **/ + NotVoter: AugmentedError; + /** + * An unexpected integer overflow occurred. + **/ + Overflow: AugmentedError; + /** + * Invalid preimage + **/ + PreimageInvalid: AugmentedError; + /** + * Preimage not found + **/ + PreimageMissing: AugmentedError; + /** + * Proposal still blacklisted + **/ + ProposalBlacklisted: AugmentedError; + /** + * Proposal does not exist + **/ + ProposalMissing: AugmentedError; + /** + * Vote given for invalid referendum + **/ + ReferendumInvalid: AugmentedError; + /** + * Too early + **/ + TooEarly: AugmentedError; + /** + * Maximum number of proposals reached. + **/ + TooManyProposals: AugmentedError; + /** + * An unexpected integer underflow occurred. + **/ + Underflow: AugmentedError; + /** + * Value too low + **/ + ValueLow: AugmentedError; + /** + * The account currently has votes attached to it and the operation cannot succeed until + * these are removed, either through `unvote` or `reap_vote`. + **/ + VotesExist: AugmentedError; + /** + * Invalid upper bound. + **/ + WrongUpperBound: AugmentedError; + }; + elections: { + [key: string]: AugmentedError; + /** + * Duplicated candidate submission. + **/ + DuplicatedCandidate: AugmentedError; + /** + * Candidate does not have enough funds. + **/ + InsufficientCandidateFunds: AugmentedError; + /** + * The provided count of number of candidates is incorrect. + **/ + InvalidCandidateCount: AugmentedError; + /** + * The renouncing origin presented a wrong `Renouncing` parameter. + **/ + InvalidRenouncing: AugmentedError; + /** + * Prediction regarding replacement after member removal is wrong. + **/ + InvalidReplacement: AugmentedError; + /** + * The provided count of number of votes is incorrect. + **/ + InvalidVoteCount: AugmentedError; + /** + * Cannot vote with stake less than minimum balance. + **/ + LowBalance: AugmentedError; + /** + * Cannot vote more than maximum allowed. + **/ + MaximumVotesExceeded: AugmentedError; + /** + * Member cannot re-submit candidacy. + **/ + MemberSubmit: AugmentedError; + /** + * Must be a voter. + **/ + MustBeVoter: AugmentedError; + /** + * Not a member. + **/ + NotMember: AugmentedError; + /** + * Must vote for at least one candidate. + **/ + NoVotes: AugmentedError; + /** + * Cannot report self. + **/ + ReportSelf: AugmentedError; + /** + * Runner cannot re-submit candidacy. + **/ + RunnerSubmit: AugmentedError; + /** + * Cannot vote more than candidates. + **/ + TooManyVotes: AugmentedError; + /** + * Voter can not pay voting bond. + **/ + UnableToPayBond: AugmentedError; + /** + * Cannot vote when no candidates or members exist. + **/ + UnableToVote: AugmentedError; + }; + grandpa: { + [key: string]: AugmentedError; + /** + * Attempt to signal GRANDPA change with one already pending. + **/ + ChangePending: AugmentedError; + /** + * A given equivocation report is valid but already previously reported. + **/ + DuplicateOffenceReport: AugmentedError; + /** + * An equivocation proof provided as part of an equivocation report is invalid. + **/ + InvalidEquivocationProof: AugmentedError; + /** + * A key ownership proof provided as part of an equivocation report is invalid. + **/ + InvalidKeyOwnershipProof: AugmentedError; + /** + * Attempt to signal GRANDPA pause when the authority set isn't live + * (either paused or already pending pause). + **/ + PauseFailed: AugmentedError; + /** + * Attempt to signal GRANDPA resume when the authority set isn't paused + * (either live or already pending resume). + **/ + ResumeFailed: AugmentedError; + /** + * Cannot signal forced change so soon after last. + **/ + TooSoon: AugmentedError; + }; + identity: { + [key: string]: AugmentedError; + /** + * Account ID is already named. + **/ + AlreadyClaimed: AugmentedError; + /** + * Empty index. + **/ + EmptyIndex: AugmentedError; + /** + * Fee is changed. + **/ + FeeChanged: AugmentedError; + /** + * The index is invalid. + **/ + InvalidIndex: AugmentedError; + /** + * Invalid judgement. + **/ + InvalidJudgement: AugmentedError; + /** + * The target is invalid. + **/ + InvalidTarget: AugmentedError; + /** + * Judgement given. + **/ + JudgementGiven: AugmentedError; + /** + * No identity found. + **/ + NoIdentity: AugmentedError; + /** + * Account isn't found. + **/ + NotFound: AugmentedError; + /** + * Account isn't named. + **/ + NotNamed: AugmentedError; + /** + * Sub-account isn't owned by sender. + **/ + NotOwned: AugmentedError; + /** + * Sender is not a sub-account. + **/ + NotSub: AugmentedError; + /** + * Sticky judgement. + **/ + StickyJudgement: AugmentedError; + /** + * Too many additional fields. + **/ + TooManyFields: AugmentedError; + /** + * Maximum amount of registrars reached. Cannot add any more. + **/ + TooManyRegistrars: AugmentedError; + /** + * Too many subs-accounts. + **/ + TooManySubAccounts: AugmentedError; + }; + imOnline: { + [key: string]: AugmentedError; + /** + * Duplicated heartbeat. + **/ + DuplicatedHeartbeat: AugmentedError; + /** + * Non existent public key. + **/ + InvalidKey: AugmentedError; + }; + multisig: { + [key: string]: AugmentedError; + /** + * Call is already approved by this signatory. + **/ + AlreadyApproved: AugmentedError; + /** + * The data to be stored is already stored. + **/ + AlreadyStored: AugmentedError; + /** + * Threshold must be 2 or greater. + **/ + MinimumThreshold: AugmentedError; + /** + * Call doesn't need any (more) approvals. + **/ + NoApprovalsNeeded: AugmentedError; + /** + * Multisig operation not found when attempting to cancel. + **/ + NotFound: AugmentedError; + /** + * No timepoint was given, yet the multisig operation is already underway. + **/ + NoTimepoint: AugmentedError; + /** + * Only the account that originally created the multisig is able to cancel it. + **/ + NotOwner: AugmentedError; + /** + * The sender was contained in the other signatories; it shouldn't be. + **/ + SenderInSignatories: AugmentedError; + /** + * The signatories were provided out of order; they should be ordered. + **/ + SignatoriesOutOfOrder: AugmentedError; + /** + * There are too few signatories in the list. + **/ + TooFewSignatories: AugmentedError; + /** + * There are too many signatories in the list. + **/ + TooManySignatories: AugmentedError; + /** + * A timepoint was given, yet no multisig operation is underway. + **/ + UnexpectedTimepoint: AugmentedError; + /** + * The maximum weight information provided was too low. + **/ + WeightTooLow: AugmentedError; + /** + * A different timepoint was given to the multisig operation that is underway. + **/ + WrongTimepoint: AugmentedError; + }; + proxy: { + [key: string]: AugmentedError; + /** + * Account is already a proxy. + **/ + Duplicate: AugmentedError; + /** + * Call may not be made by proxy because it may escalate its privileges. + **/ + NoPermission: AugmentedError; + /** + * Proxy registration not found. + **/ + NotFound: AugmentedError; + /** + * Sender is not a proxy of the account to be proxied. + **/ + NotProxy: AugmentedError; + /** + * There are too many proxies registered or too many announcements pending. + **/ + TooMany: AugmentedError; + /** + * Announcement, if made at all, was made too recently. + **/ + Unannounced: AugmentedError; + /** + * A call which is incompatible with the proxy type's filter was attempted. + **/ + Unproxyable: AugmentedError; + }; + recovery: { + [key: string]: AugmentedError; + /** + * This account is already set up for recovery + **/ + AlreadyProxy: AugmentedError; + /** + * This account is already set up for recovery + **/ + AlreadyRecoverable: AugmentedError; + /** + * A recovery process has already started for this account + **/ + AlreadyStarted: AugmentedError; + /** + * This user has already vouched for this recovery + **/ + AlreadyVouched: AugmentedError; + /** + * The friend must wait until the delay period to vouch for this recovery + **/ + DelayPeriod: AugmentedError; + /** + * Friends list must be less than max friends + **/ + MaxFriends: AugmentedError; + /** + * User is not allowed to make a call on behalf of this account + **/ + NotAllowed: AugmentedError; + /** + * Friends list must be greater than zero and threshold + **/ + NotEnoughFriends: AugmentedError; + /** + * This account is not a friend who can vouch + **/ + NotFriend: AugmentedError; + /** + * This account is not set up for recovery + **/ + NotRecoverable: AugmentedError; + /** + * Friends list must be sorted and free of duplicates + **/ + NotSorted: AugmentedError; + /** + * A recovery process has not started for this rescuer + **/ + NotStarted: AugmentedError; + /** + * There was an overflow in a calculation + **/ + Overflow: AugmentedError; + /** + * There are still active recovery attempts that need to be closed + **/ + StillActive: AugmentedError; + /** + * The threshold for recovering this account has not been met + **/ + Threshold: AugmentedError; + /** + * Threshold must be greater than zero + **/ + ZeroThreshold: AugmentedError; + }; + scheduler: { + [key: string]: AugmentedError; + /** + * Failed to schedule a call + **/ + FailedToSchedule: AugmentedError; + /** + * Cannot find the scheduled call. + **/ + NotFound: AugmentedError; + /** + * Reschedule failed because it does not change scheduled time. + **/ + RescheduleNoChange: AugmentedError; + /** + * Given target block number is in the past. + **/ + TargetBlockNumberInPast: AugmentedError; + }; + session: { + [key: string]: AugmentedError; + /** + * Registered duplicate key. + **/ + DuplicatedKey: AugmentedError; + /** + * Invalid ownership proof. + **/ + InvalidProof: AugmentedError; + /** + * No associated validator ID for account. + **/ + NoAssociatedValidatorId: AugmentedError; + /** + * No keys are associated with this account. + **/ + NoKeys: AugmentedError; + }; + society: { + [key: string]: AugmentedError; + /** + * User has already made a bid. + **/ + AlreadyBid: AugmentedError; + /** + * User is already a candidate. + **/ + AlreadyCandidate: AugmentedError; + /** + * Society already founded. + **/ + AlreadyFounded: AugmentedError; + /** + * User is already a member. + **/ + AlreadyMember: AugmentedError; + /** + * Member is already vouching or banned from vouching again. + **/ + AlreadyVouching: AugmentedError; + /** + * An incorrect position was provided. + **/ + BadPosition: AugmentedError; + /** + * Cannot remove the founder. + **/ + Founder: AugmentedError; + /** + * Cannot remove the head of the chain. + **/ + Head: AugmentedError; + /** + * Not enough in pot to accept candidate. + **/ + InsufficientPot: AugmentedError; + /** + * Too many members in the society. + **/ + MaxMembers: AugmentedError; + /** + * Nothing to payout. + **/ + NoPayout: AugmentedError; + /** + * User is not a candidate. + **/ + NotCandidate: AugmentedError; + /** + * The caller is not the founder. + **/ + NotFounder: AugmentedError; + /** + * The caller is not the head. + **/ + NotHead: AugmentedError; + /** + * User is not a member. + **/ + NotMember: AugmentedError; + /** + * User is not suspended. + **/ + NotSuspended: AugmentedError; + /** + * Member is not vouching. + **/ + NotVouching: AugmentedError; + /** + * User is suspended. + **/ + Suspended: AugmentedError; + }; + staking: { + [key: string]: AugmentedError; + /** + * Stash is already bonded. + **/ + AlreadyBonded: AugmentedError; + /** + * Rewards for this era have already been claimed for this validator. + **/ + AlreadyClaimed: AugmentedError; + /** + * Controller is already paired. + **/ + AlreadyPaired: AugmentedError; + /** + * The call is not allowed at the given time due to restrictions of election period. + **/ + CallNotAllowed: AugmentedError; + /** + * Duplicate index. + **/ + DuplicateIndex: AugmentedError; + /** + * Targets cannot be empty. + **/ + EmptyTargets: AugmentedError; + /** + * Attempting to target a stash that still has funds. + **/ + FundedTarget: AugmentedError; + /** + * Incorrect previous history depth input provided. + **/ + IncorrectHistoryDepth: AugmentedError; + /** + * Incorrect number of slashing spans provided. + **/ + IncorrectSlashingSpans: AugmentedError; + /** + * Can not bond with value less than minimum balance. + **/ + InsufficientValue: AugmentedError; + /** + * Invalid era to reward. + **/ + InvalidEraToReward: AugmentedError; + /** + * Invalid number of nominations. + **/ + InvalidNumberOfNominations: AugmentedError; + /** + * Slash record index out of bounds. + **/ + InvalidSlashIndex: AugmentedError; + /** + * Can not schedule more unlock chunks. + **/ + NoMoreChunks: AugmentedError; + /** + * Not a controller account. + **/ + NotController: AugmentedError; + /** + * Items are not sorted and unique. + **/ + NotSortedAndUnique: AugmentedError; + /** + * Not a stash account. + **/ + NotStash: AugmentedError; + /** + * Can not rebond without unlocking chunks. + **/ + NoUnlockChunk: AugmentedError; + /** + * Error while building the assignment type from the compact. This can happen if an index + * is invalid, or if the weights _overflow_. + **/ + OffchainElectionBogusCompact: AugmentedError; + /** + * The submitted result has unknown edges that are not among the presented winners. + **/ + OffchainElectionBogusEdge: AugmentedError; + /** + * The election size is invalid. + **/ + OffchainElectionBogusElectionSize: AugmentedError; + /** + * One of the submitted nominators has an edge to which they have not voted on chain. + **/ + OffchainElectionBogusNomination: AugmentedError; + /** + * One of the submitted nominators is not an active nominator on chain. + **/ + OffchainElectionBogusNominator: AugmentedError; + /** + * The claimed score does not match with the one computed from the data. + **/ + OffchainElectionBogusScore: AugmentedError; + /** + * A self vote must only be originated from a validator to ONLY themselves. + **/ + OffchainElectionBogusSelfVote: AugmentedError; + /** + * One of the submitted winners is not an active candidate on chain (index is out of range + * in snapshot). + **/ + OffchainElectionBogusWinner: AugmentedError; + /** + * Incorrect number of winners were presented. + **/ + OffchainElectionBogusWinnerCount: AugmentedError; + /** + * The submitted result is received out of the open window. + **/ + OffchainElectionEarlySubmission: AugmentedError; + /** + * One of the submitted nominators has an edge which is submitted before the last non-zero + * slash of the target. + **/ + OffchainElectionSlashedNomination: AugmentedError; + /** + * The submitted result is not as good as the one stored on chain. + **/ + OffchainElectionWeakSubmission: AugmentedError; + /** + * The snapshot data of the current window is missing. + **/ + SnapshotUnavailable: AugmentedError; + }; + sudo: { + [key: string]: AugmentedError; + /** + * Sender must be the Sudo account + **/ + RequireSudo: AugmentedError; + }; + system: { + [key: string]: AugmentedError; + /** + * Failed to extract the runtime version from the new runtime. + * + * Either calling `Core_version` or decoding `RuntimeVersion` failed. + **/ + FailedToExtractRuntimeVersion: AugmentedError; + /** + * The name of specification does not match between the current runtime + * and the new runtime. + **/ + InvalidSpecName: AugmentedError; + /** + * Suicide called when the account has non-default composite data. + **/ + NonDefaultComposite: AugmentedError; + /** + * There is a non-zero reference count preventing the account from being purged. + **/ + NonZeroRefCount: AugmentedError; + /** + * The specification version is not allowed to decrease between the current runtime + * and the new runtime. + **/ + SpecVersionNeedsToIncrease: AugmentedError; + }; + technicalCommittee: { + [key: string]: AugmentedError; + /** + * Members are already initialized! + **/ + AlreadyInitialized: AugmentedError; + /** + * Duplicate proposals not allowed + **/ + DuplicateProposal: AugmentedError; + /** + * Duplicate vote ignored + **/ + DuplicateVote: AugmentedError; + /** + * Account is not a member + **/ + NotMember: AugmentedError; + /** + * Proposal must exist + **/ + ProposalMissing: AugmentedError; + /** + * The close call was made too early, before the end of the voting. + **/ + TooEarly: AugmentedError; + /** + * There can only be a maximum of `MaxProposals` active proposals. + **/ + TooManyProposals: AugmentedError; + /** + * Mismatched index + **/ + WrongIndex: AugmentedError; + /** + * The given length bound for the proposal was too low. + **/ + WrongProposalLength: AugmentedError; + /** + * The given weight bound for the proposal was too low. + **/ + WrongProposalWeight: AugmentedError; + }; + tips: { + [key: string]: AugmentedError; + /** + * The tip was already found/started. + **/ + AlreadyKnown: AugmentedError; + /** + * The account attempting to retract the tip is not the finder of the tip. + **/ + NotFinder: AugmentedError; + /** + * The tip cannot be claimed/closed because it's still in the countdown period. + **/ + Premature: AugmentedError; + /** + * The reason given is just too big. + **/ + ReasonTooBig: AugmentedError; + /** + * The tip cannot be claimed/closed because there are not enough tippers yet. + **/ + StillOpen: AugmentedError; + /** + * The tip hash is unknown. + **/ + UnknownTip: AugmentedError; + }; + treasury: { + [key: string]: AugmentedError; + /** + * Proposer's balance is too low. + **/ + InsufficientProposersBalance: AugmentedError; + /** + * No proposal or bounty at that index. + **/ + InvalidIndex: AugmentedError; + }; + vesting: { + [key: string]: AugmentedError; + /** + * Amount being transferred is too low to create a vesting schedule. + **/ + AmountLow: AugmentedError; + /** + * An existing vesting schedule already exists for this account that cannot be clobbered. + **/ + ExistingVestingSchedule: AugmentedError; + /** + * The account given is not vesting. + **/ + NotVesting: AugmentedError; + }; + } + + export interface DecoratedErrors extends AugmentedErrors { + [key: string]: ModuleErrors; + } +} diff --git a/packages/api/src/augment/events.ts b/packages/api/src/augment/events.ts new file mode 100644 index 0000000000..7a45cbf427 --- /dev/null +++ b/packages/api/src/augment/events.ts @@ -0,0 +1,842 @@ +// Auto-generated via `yarn polkadot-types-from-chain`, do not edit +/* eslint-disable */ + +import type { Bytes, Option, Vec, bool, u16, u32 } from '@polkadot/types'; +import type { ITuple } from '@polkadot/types/types'; +import type { BalanceStatus } from '@polkadot/types/interfaces/balances'; +import type { MemberCount, ProposalIndex } from '@polkadot/types/interfaces/collective'; +import type { AuthorityId } from '@polkadot/types/interfaces/consensus'; +import type { PropIndex, ReferendumIndex } from '@polkadot/types/interfaces/democracy'; +import type { VoteThreshold } from '@polkadot/types/interfaces/elections'; +import type { AuthorityList } from '@polkadot/types/interfaces/grandpa'; +import type { RegistrarIndex } from '@polkadot/types/interfaces/identity'; +import type { Kind, OpaqueTimeSlot } from '@polkadot/types/interfaces/offences'; +import type { ProxyType } from '@polkadot/types/interfaces/proxy'; +import type { AccountId, AccountIndex, AssetId, Balance, BlockNumber, CallHash, Hash, PhantomData } from '@polkadot/types/interfaces/runtime'; +import type { TaskAddress } from '@polkadot/types/interfaces/scheduler'; +import type { IdentificationTuple, SessionIndex } from '@polkadot/types/interfaces/session'; +import type { ElectionCompute, EraIndex } from '@polkadot/types/interfaces/staking'; +import type { DispatchError, DispatchInfo, DispatchResult } from '@polkadot/types/interfaces/system'; +import type { BountyIndex } from '@polkadot/types/interfaces/treasury'; +import type { Timepoint } from '@polkadot/types/interfaces/utility'; +import type { ApiTypes } from '@polkadot/api/types'; + +declare module '@polkadot/api/types/events' { + export interface AugmentedEvents { + assets: { + [key: string]: AugmentedEvent; + /** + * Some assets were destroyed. \[asset_id, owner, balance\] + **/ + Burned: AugmentedEvent; + /** + * Some asset class was created. \[asset_id, creator, owner\] + **/ + Created: AugmentedEvent; + /** + * An asset class was destroyed. + **/ + Destroyed: AugmentedEvent; + /** + * Some asset class was force-created. \[asset_id, owner\] + **/ + ForceCreated: AugmentedEvent; + /** + * Some assets was transferred by an admin. \[asset_id, from, to, amount\] + **/ + ForceTransferred: AugmentedEvent; + /** + * Some account `who` was frozen. \[asset_id, who\] + **/ + Frozen: AugmentedEvent; + /** + * Some assets were issued. \[asset_id, owner, total_supply\] + **/ + Issued: AugmentedEvent; + /** + * The maximum amount of zombies allowed has changed. \[asset_id, max_zombies\] + **/ + MaxZombiesChanged: AugmentedEvent; + /** + * The owner changed \[asset_id, owner\] + **/ + OwnerChanged: AugmentedEvent; + /** + * The management team changed \[asset_id, issuer, admin, freezer\] + **/ + TeamChanged: AugmentedEvent; + /** + * Some account `who` was thawed. \[asset_id, who\] + **/ + Thawed: AugmentedEvent; + /** + * Some assets were transferred. \[asset_id, from, to, amount\] + **/ + Transferred: AugmentedEvent; + }; + balances: { + [key: string]: AugmentedEvent; + /** + * A balance was set by root. \[who, free, reserved\] + **/ + BalanceSet: AugmentedEvent; + /** + * Some amount was deposited (e.g. for transaction fees). \[who, deposit\] + **/ + Deposit: AugmentedEvent; + /** + * An account was removed whose balance was non-zero but below ExistentialDeposit, + * resulting in an outright loss. \[account, balance\] + **/ + DustLost: AugmentedEvent; + /** + * An account was created with some free balance. \[account, free_balance\] + **/ + Endowed: AugmentedEvent; + /** + * Some balance was reserved (moved from free to reserved). \[who, value\] + **/ + Reserved: AugmentedEvent; + /** + * Some balance was moved from the reserve of the first account to the second account. + * Final argument indicates the destination balance type. + * \[from, to, balance, destination_status\] + **/ + ReserveRepatriated: AugmentedEvent; + /** + * Transfer succeeded. \[from, to, value\] + **/ + Transfer: AugmentedEvent; + /** + * Some balance was unreserved (moved from reserved to free). \[who, value\] + **/ + Unreserved: AugmentedEvent; + }; + bounties: { + [key: string]: AugmentedEvent; + /** + * A bounty is awarded to a beneficiary. \[index, beneficiary\] + **/ + BountyAwarded: AugmentedEvent; + /** + * A bounty proposal is funded and became active. \[index\] + **/ + BountyBecameActive: AugmentedEvent; + /** + * A bounty is cancelled. \[index\] + **/ + BountyCanceled: AugmentedEvent; + /** + * A bounty is claimed by beneficiary. \[index, payout, beneficiary\] + **/ + BountyClaimed: AugmentedEvent; + /** + * A bounty expiry is extended. \[index\] + **/ + BountyExtended: AugmentedEvent; + /** + * New bounty proposal. \[index\] + **/ + BountyProposed: AugmentedEvent; + /** + * A bounty proposal was rejected; funds were slashed. \[index, bond\] + **/ + BountyRejected: AugmentedEvent; + }; + contracts: { + [key: string]: AugmentedEvent; + /** + * Code with the specified hash has been stored. + * \[code_hash\] + **/ + CodeStored: AugmentedEvent; + /** + * An event deposited upon execution of a contract from the account. + * \[account, data\] + **/ + ContractExecution: AugmentedEvent; + /** + * Contract has been evicted and is now in tombstone state. + * \[contract, tombstone\] + * + * # Params + * + * - `contract`: `AccountId`: The account ID of the evicted contract. + * - `tombstone`: `bool`: True if the evicted contract left behind a tombstone. + **/ + Evicted: AugmentedEvent; + /** + * Contract deployed by address at the specified address. \[owner, contract\] + **/ + Instantiated: AugmentedEvent; + /** + * Restoration for a contract has been successful. + * \[donor, dest, code_hash, rent_allowance\] + * + * # Params + * + * - `donor`: `AccountId`: Account ID of the restoring contract + * - `dest`: `AccountId`: Account ID of the restored contract + * - `code_hash`: `Hash`: Code hash of the restored contract + * - `rent_allowance: `Balance`: Rent allowance of the restored contract + **/ + Restored: AugmentedEvent; + /** + * Triggered when the current \[schedule\] is updated. + **/ + ScheduleUpdated: AugmentedEvent; + }; + council: { + [key: string]: AugmentedEvent; + /** + * A motion was approved by the required threshold. + * \[proposal_hash\] + **/ + Approved: AugmentedEvent; + /** + * A proposal was closed because its threshold was reached or after its duration was up. + * \[proposal_hash, yes, no\] + **/ + Closed: AugmentedEvent; + /** + * A motion was not approved by the required threshold. + * \[proposal_hash\] + **/ + Disapproved: AugmentedEvent; + /** + * A motion was executed; result will be `Ok` if it returned without error. + * \[proposal_hash, result\] + **/ + Executed: AugmentedEvent; + /** + * A single member did some action; result will be `Ok` if it returned without error. + * \[proposal_hash, result\] + **/ + MemberExecuted: AugmentedEvent; + /** + * A motion (given hash) has been proposed (by given account) with a threshold (given + * `MemberCount`). + * \[account, proposal_index, proposal_hash, threshold\] + **/ + Proposed: AugmentedEvent; + /** + * A motion (given hash) has been voted on by given account, leaving + * a tally (yes votes and no votes given respectively as `MemberCount`). + * \[account, proposal_hash, voted, yes, no\] + **/ + Voted: AugmentedEvent; + }; + democracy: { + [key: string]: AugmentedEvent; + /** + * A proposal \[hash\] has been blacklisted permanently. + **/ + Blacklisted: AugmentedEvent; + /** + * A referendum has been cancelled. \[ref_index\] + **/ + Cancelled: AugmentedEvent; + /** + * An account has delegated their vote to another account. \[who, target\] + **/ + Delegated: AugmentedEvent; + /** + * A proposal has been enacted. \[ref_index, is_ok\] + **/ + Executed: AugmentedEvent; + /** + * An external proposal has been tabled. + **/ + ExternalTabled: AugmentedEvent; + /** + * A proposal has been rejected by referendum. \[ref_index\] + **/ + NotPassed: AugmentedEvent; + /** + * A proposal has been approved by referendum. \[ref_index\] + **/ + Passed: AugmentedEvent; + /** + * A proposal could not be executed because its preimage was invalid. + * \[proposal_hash, ref_index\] + **/ + PreimageInvalid: AugmentedEvent; + /** + * A proposal could not be executed because its preimage was missing. + * \[proposal_hash, ref_index\] + **/ + PreimageMissing: AugmentedEvent; + /** + * A proposal's preimage was noted, and the deposit taken. \[proposal_hash, who, deposit\] + **/ + PreimageNoted: AugmentedEvent; + /** + * A registered preimage was removed and the deposit collected by the reaper. + * \[proposal_hash, provider, deposit, reaper\] + **/ + PreimageReaped: AugmentedEvent; + /** + * A proposal preimage was removed and used (the deposit was returned). + * \[proposal_hash, provider, deposit\] + **/ + PreimageUsed: AugmentedEvent; + /** + * A motion has been proposed by a public account. \[proposal_index, deposit\] + **/ + Proposed: AugmentedEvent; + /** + * A referendum has begun. \[ref_index, threshold\] + **/ + Started: AugmentedEvent; + /** + * A public proposal has been tabled for referendum vote. \[proposal_index, deposit, depositors\] + **/ + Tabled: AugmentedEvent]>; + /** + * An \[account\] has cancelled a previous delegation operation. + **/ + Undelegated: AugmentedEvent; + /** + * An \[account\] has been unlocked successfully. + **/ + Unlocked: AugmentedEvent; + /** + * An external proposal has been vetoed. \[who, proposal_hash, until\] + **/ + Vetoed: AugmentedEvent; + }; + elections: { + [key: string]: AugmentedEvent; + /** + * A candidate was slashed due to failing to obtain a seat as member or runner-up + **/ + CandidateSlashed: AugmentedEvent; + /** + * Internal error happened while trying to perform election. + **/ + ElectionError: AugmentedEvent; + /** + * No (or not enough) candidates existed for this round. This is different from + * `NewTerm(\[\])`. See the description of `NewTerm`. + **/ + EmptyTerm: AugmentedEvent; + /** + * A \[member\] has been removed. This should always be followed by either `NewTerm` or + * `EmptyTerm`. + **/ + MemberKicked: AugmentedEvent; + /** + * A \[member\] has renounced their candidacy. + **/ + MemberRenounced: AugmentedEvent; + /** + * A new term with \[new_members\]. This indicates that enough candidates existed to run the + * election, not that enough have has been elected. The inner value must be examined for + * this purpose. A `NewTerm(\[\])` indicates that some candidates got their bond slashed and + * none were elected, whilst `EmptyTerm` means that no candidates existed to begin with. + **/ + NewTerm: AugmentedEvent>]>; + /** + * A seat holder (member or runner-up) was slashed due to failing to retaining their position. + **/ + SeatHolderSlashed: AugmentedEvent; + /** + * A voter was reported with the the report being successful or not. + * \[voter, reporter, success\] + **/ + VoterReported: AugmentedEvent; + }; + grandpa: { + [key: string]: AugmentedEvent; + /** + * New authority set has been applied. \[authority_set\] + **/ + NewAuthorities: AugmentedEvent; + /** + * Current authority set has been paused. + **/ + Paused: AugmentedEvent; + /** + * Current authority set has been resumed. + **/ + Resumed: AugmentedEvent; + }; + identity: { + [key: string]: AugmentedEvent; + /** + * A name was cleared, and the given balance returned. \[who, deposit\] + **/ + IdentityCleared: AugmentedEvent; + /** + * A name was removed and the given balance slashed. \[who, deposit\] + **/ + IdentityKilled: AugmentedEvent; + /** + * A name was set or reset (which will remove all judgements). \[who\] + **/ + IdentitySet: AugmentedEvent; + /** + * A judgement was given by a registrar. \[target, registrar_index\] + **/ + JudgementGiven: AugmentedEvent; + /** + * A judgement was asked from a registrar. \[who, registrar_index\] + **/ + JudgementRequested: AugmentedEvent; + /** + * A judgement request was retracted. \[who, registrar_index\] + **/ + JudgementUnrequested: AugmentedEvent; + /** + * A registrar was added. \[registrar_index\] + **/ + RegistrarAdded: AugmentedEvent; + /** + * A sub-identity was added to an identity and the deposit paid. \[sub, main, deposit\] + **/ + SubIdentityAdded: AugmentedEvent; + /** + * A sub-identity was removed from an identity and the deposit freed. + * \[sub, main, deposit\] + **/ + SubIdentityRemoved: AugmentedEvent; + /** + * A sub-identity was cleared, and the given deposit repatriated from the + * main identity account to the sub-identity account. \[sub, main, deposit\] + **/ + SubIdentityRevoked: AugmentedEvent; + }; + imOnline: { + [key: string]: AugmentedEvent; + /** + * At the end of the session, no offence was committed. + **/ + AllGood: AugmentedEvent; + /** + * A new heartbeat was received from `AuthorityId` \[authority_id\] + **/ + HeartbeatReceived: AugmentedEvent; + /** + * At the end of the session, at least one validator was found to be \[offline\]. + **/ + SomeOffline: AugmentedEvent]>; + }; + indices: { + [key: string]: AugmentedEvent; + /** + * A account index was assigned. \[index, who\] + **/ + IndexAssigned: AugmentedEvent; + /** + * A account index has been freed up (unassigned). \[index\] + **/ + IndexFreed: AugmentedEvent; + /** + * A account index has been frozen to its current account ID. \[index, who\] + **/ + IndexFrozen: AugmentedEvent; + }; + multisig: { + [key: string]: AugmentedEvent; + /** + * A multisig operation has been approved by someone. + * \[approving, timepoint, multisig, call_hash\] + **/ + MultisigApproval: AugmentedEvent; + /** + * A multisig operation has been cancelled. \[cancelling, timepoint, multisig, call_hash\] + **/ + MultisigCancelled: AugmentedEvent; + /** + * A multisig operation has been executed. \[approving, timepoint, multisig, call_hash\] + **/ + MultisigExecuted: AugmentedEvent; + /** + * A new multisig operation has begun. \[approving, multisig, call_hash\] + **/ + NewMultisig: AugmentedEvent; + }; + offences: { + [key: string]: AugmentedEvent; + /** + * There is an offence reported of the given `kind` happened at the `session_index` and + * (kind-specific) time slot. This event is not deposited for duplicate slashes. last + * element indicates of the offence was applied (true) or queued (false) + * \[kind, timeslot, applied\]. + **/ + Offence: AugmentedEvent; + }; + proxy: { + [key: string]: AugmentedEvent; + /** + * An announcement was placed to make a call in the future. \[real, proxy, call_hash\] + **/ + Announced: AugmentedEvent; + /** + * Anonymous account has been created by new proxy with given + * disambiguation index and proxy type. \[anonymous, who, proxy_type, disambiguation_index\] + **/ + AnonymousCreated: AugmentedEvent; + /** + * A proxy was executed correctly, with the given \[result\]. + **/ + ProxyExecuted: AugmentedEvent; + }; + recovery: { + [key: string]: AugmentedEvent; + /** + * Lost account has been successfully recovered by rescuer account. + * \[lost, rescuer\] + **/ + AccountRecovered: AugmentedEvent; + /** + * A recovery process for lost account by rescuer account has been closed. + * \[lost, rescuer\] + **/ + RecoveryClosed: AugmentedEvent; + /** + * A recovery process has been set up for an \[account\]. + **/ + RecoveryCreated: AugmentedEvent; + /** + * A recovery process has been initiated for lost account by rescuer account. + * \[lost, rescuer\] + **/ + RecoveryInitiated: AugmentedEvent; + /** + * A recovery process has been removed for an \[account\]. + **/ + RecoveryRemoved: AugmentedEvent; + /** + * A recovery process for lost account by rescuer account has been vouched for by sender. + * \[lost, rescuer, sender\] + **/ + RecoveryVouched: AugmentedEvent; + }; + scheduler: { + [key: string]: AugmentedEvent; + /** + * Canceled some task. \[when, index\] + **/ + Canceled: AugmentedEvent; + /** + * Dispatched some task. \[task, id, result\] + **/ + Dispatched: AugmentedEvent, DispatchResult]>; + /** + * Scheduled some task. \[when, index\] + **/ + Scheduled: AugmentedEvent; + }; + session: { + [key: string]: AugmentedEvent; + /** + * New session has happened. Note that the argument is the \[session_index\], not the block + * number as the type might suggest. + **/ + NewSession: AugmentedEvent; + }; + society: { + [key: string]: AugmentedEvent; + /** + * A \[candidate\] was dropped (due to an excess of bids in the system). + **/ + AutoUnbid: AugmentedEvent; + /** + * A membership bid just happened. The given account is the candidate's ID and their offer + * is the second. \[candidate_id, offer\] + **/ + Bid: AugmentedEvent; + /** + * A \[candidate\] has been suspended + **/ + CandidateSuspended: AugmentedEvent; + /** + * A \[member\] has been challenged + **/ + Challenged: AugmentedEvent; + /** + * A vote has been placed for a defending member \[voter, vote\] + **/ + DefenderVote: AugmentedEvent; + /** + * Some funds were deposited into the society account. \[value\] + **/ + Deposit: AugmentedEvent; + /** + * The society is founded by the given identity. \[founder\] + **/ + Founded: AugmentedEvent; + /** + * A group of candidates have been inducted. The batch's primary is the first value, the + * batch in full is the second. \[primary, candidates\] + **/ + Inducted: AugmentedEvent]>; + /** + * A \[member\] has been suspended + **/ + MemberSuspended: AugmentedEvent; + /** + * A new \[max\] member count has been set + **/ + NewMaxMembers: AugmentedEvent; + /** + * A suspended member has been judged. \[who, judged\] + **/ + SuspendedMemberJudgement: AugmentedEvent; + /** + * A \[candidate\] was dropped (by their request). + **/ + Unbid: AugmentedEvent; + /** + * Society is unfounded. \[founder\] + **/ + Unfounded: AugmentedEvent; + /** + * A \[candidate\] was dropped (by request of who vouched for them). + **/ + Unvouch: AugmentedEvent; + /** + * A vote has been placed \[candidate, voter, vote\] + **/ + Vote: AugmentedEvent; + /** + * A membership bid just happened by vouching. The given account is the candidate's ID and + * their offer is the second. The vouching party is the third. \[candidate_id, offer, vouching\] + **/ + Vouch: AugmentedEvent; + }; + staking: { + [key: string]: AugmentedEvent; + /** + * An account has bonded this amount. \[stash, amount\] + * + * NOTE: This event is only emitted when funds are bonded via a dispatchable. Notably, + * it will not be emitted for staking rewards when they are added to stake. + **/ + Bonded: AugmentedEvent; + /** + * The era payout has been set; the first balance is the validator-payout; the second is + * the remainder from the maximum amount of reward. + * \[era_index, validator_payout, remainder\] + **/ + EraPayout: AugmentedEvent; + /** + * An old slashing report from a prior era was discarded because it could + * not be processed. \[session_index\] + **/ + OldSlashingReportDiscarded: AugmentedEvent; + /** + * The staker has been rewarded by this amount. \[stash, amount\] + **/ + Reward: AugmentedEvent; + /** + * One validator (and its nominators) has been slashed by the given amount. + * \[validator, amount\] + **/ + Slash: AugmentedEvent; + /** + * A new solution for the upcoming election has been stored. \[compute\] + **/ + SolutionStored: AugmentedEvent; + /** + * A new set of stakers was elected with the given \[compute\]. + **/ + StakingElection: AugmentedEvent; + /** + * An account has unbonded this amount. \[stash, amount\] + **/ + Unbonded: AugmentedEvent; + /** + * An account has called `withdraw_unbonded` and removed unbonding chunks worth `Balance` + * from the unlocking queue. \[stash, amount\] + **/ + Withdrawn: AugmentedEvent; + }; + sudo: { + [key: string]: AugmentedEvent; + /** + * The \[sudoer\] just switched identity; the old key is supplied. + **/ + KeyChanged: AugmentedEvent; + /** + * A sudo just took place. \[result\] + **/ + Sudid: AugmentedEvent; + /** + * A sudo just took place. \[result\] + **/ + SudoAsDone: AugmentedEvent; + }; + system: { + [key: string]: AugmentedEvent; + /** + * `:code` was updated. + **/ + CodeUpdated: AugmentedEvent; + /** + * An extrinsic failed. \[error, info\] + **/ + ExtrinsicFailed: AugmentedEvent; + /** + * An extrinsic completed successfully. \[info\] + **/ + ExtrinsicSuccess: AugmentedEvent; + /** + * An \[account\] was reaped. + **/ + KilledAccount: AugmentedEvent; + /** + * A new \[account\] was created. + **/ + NewAccount: AugmentedEvent; + }; + technicalCommittee: { + [key: string]: AugmentedEvent; + /** + * A motion was approved by the required threshold. + * \[proposal_hash\] + **/ + Approved: AugmentedEvent; + /** + * A proposal was closed because its threshold was reached or after its duration was up. + * \[proposal_hash, yes, no\] + **/ + Closed: AugmentedEvent; + /** + * A motion was not approved by the required threshold. + * \[proposal_hash\] + **/ + Disapproved: AugmentedEvent; + /** + * A motion was executed; result will be `Ok` if it returned without error. + * \[proposal_hash, result\] + **/ + Executed: AugmentedEvent; + /** + * A single member did some action; result will be `Ok` if it returned without error. + * \[proposal_hash, result\] + **/ + MemberExecuted: AugmentedEvent; + /** + * A motion (given hash) has been proposed (by given account) with a threshold (given + * `MemberCount`). + * \[account, proposal_index, proposal_hash, threshold\] + **/ + Proposed: AugmentedEvent; + /** + * A motion (given hash) has been voted on by given account, leaving + * a tally (yes votes and no votes given respectively as `MemberCount`). + * \[account, proposal_hash, voted, yes, no\] + **/ + Voted: AugmentedEvent; + }; + technicalMembership: { + [key: string]: AugmentedEvent; + /** + * Phantom member, never used. + **/ + Dummy: AugmentedEvent; + /** + * One of the members' keys changed. + **/ + KeyChanged: AugmentedEvent; + /** + * The given member was added; see the transaction for who. + **/ + MemberAdded: AugmentedEvent; + /** + * The given member was removed; see the transaction for who. + **/ + MemberRemoved: AugmentedEvent; + /** + * The membership was reset; see the transaction for who the new set is. + **/ + MembersReset: AugmentedEvent; + /** + * Two members were swapped; see the transaction for who. + **/ + MembersSwapped: AugmentedEvent; + }; + tips: { + [key: string]: AugmentedEvent; + /** + * A new tip suggestion has been opened. \[tip_hash\] + **/ + NewTip: AugmentedEvent; + /** + * A tip suggestion has been closed. \[tip_hash, who, payout\] + **/ + TipClosed: AugmentedEvent; + /** + * A tip suggestion has reached threshold and is closing. \[tip_hash\] + **/ + TipClosing: AugmentedEvent; + /** + * A tip suggestion has been retracted. \[tip_hash\] + **/ + TipRetracted: AugmentedEvent; + }; + treasury: { + [key: string]: AugmentedEvent; + /** + * Some funds have been allocated. \[proposal_index, award, beneficiary\] + **/ + Awarded: AugmentedEvent; + /** + * Some of our funds have been burnt. \[burn\] + **/ + Burnt: AugmentedEvent; + /** + * Some funds have been deposited. \[deposit\] + **/ + Deposit: AugmentedEvent; + /** + * New proposal. \[proposal_index\] + **/ + Proposed: AugmentedEvent; + /** + * A proposal was rejected; funds were slashed. \[proposal_index, slashed\] + **/ + Rejected: AugmentedEvent; + /** + * Spending has finished; this is the amount that rolls over until next spend. + * \[budget_remaining\] + **/ + Rollover: AugmentedEvent; + /** + * We have ended a spend period and will now allocate funds. \[budget_remaining\] + **/ + Spending: AugmentedEvent; + }; + utility: { + [key: string]: AugmentedEvent; + /** + * Batch of dispatches completed fully with no error. + **/ + BatchCompleted: AugmentedEvent; + /** + * Batch of dispatches did not complete fully. Index of first failing dispatch given, as + * well as the error. \[index, error\] + **/ + BatchInterrupted: AugmentedEvent; + }; + vesting: { + [key: string]: AugmentedEvent; + /** + * An \[account\] has become fully vested. No further vesting can happen. + **/ + VestingCompleted: AugmentedEvent; + /** + * The amount vested has been updated. This could indicate more funds are available. The + * balance given is the amount which is left unvested (and thus locked). + * \[account, unvested\] + **/ + VestingUpdated: AugmentedEvent; + }; + } + + export interface DecoratedEvents extends AugmentedEvents { + [key: string]: ModuleEvents; + } +} diff --git a/packages/api/src/augment/index.ts b/packages/api/src/augment/index.ts index f3178af726..65c2a0aeba 100644 --- a/packages/api/src/augment/index.ts +++ b/packages/api/src/augment/index.ts @@ -2,6 +2,8 @@ // SPDX-License-Identifier: Apache-2.0 import './consts'; +import './errors'; +import './events'; import './query'; import './rpc'; import './tx'; diff --git a/packages/api/src/augment/query.ts b/packages/api/src/augment/query.ts index 1d62d2d747..dda8e78e2a 100644 --- a/packages/api/src/augment/query.ts +++ b/packages/api/src/augment/query.ts @@ -37,57 +37,57 @@ declare module '@polkadot/api/types/storage' { /** * The number of units of assets held by any given account. **/ - account: AugmentedQueryDoubleMap Observable> & QueryableStorageEntry; + account: AugmentedQueryDoubleMap Observable, [AssetId, AccountId]> & QueryableStorageEntry; /** * Details of an asset. **/ - asset: AugmentedQuery Observable>> & QueryableStorageEntry; + asset: AugmentedQuery Observable>, [AssetId]> & QueryableStorageEntry; }; authorship: { [key: string]: QueryableStorageEntry; /** * Author of current block. **/ - author: AugmentedQuery Observable>> & QueryableStorageEntry; + author: AugmentedQuery Observable>, []> & QueryableStorageEntry; /** * Whether uncles were already set in this block. **/ - didSetUncles: AugmentedQuery Observable> & QueryableStorageEntry; + didSetUncles: AugmentedQuery Observable, []> & QueryableStorageEntry; /** * Uncles **/ - uncles: AugmentedQuery Observable>> & QueryableStorageEntry; + uncles: AugmentedQuery Observable>, []> & QueryableStorageEntry; }; babe: { [key: string]: QueryableStorageEntry; /** * Current epoch authorities. **/ - authorities: AugmentedQuery Observable>>> & QueryableStorageEntry; + authorities: AugmentedQuery Observable>>, []> & QueryableStorageEntry; /** * Temporary value (cleared at block finalization) that includes the VRF output generated * at this block. This field should always be populated during block processing unless * secondary plain slots are enabled (which don't contain a VRF output). **/ - authorVrfRandomness: AugmentedQuery Observable> & QueryableStorageEntry; + authorVrfRandomness: AugmentedQuery Observable, []> & QueryableStorageEntry; /** * Current slot number. **/ - currentSlot: AugmentedQuery Observable> & QueryableStorageEntry; + currentSlot: AugmentedQuery Observable, []> & QueryableStorageEntry; /** * Current epoch index. **/ - epochIndex: AugmentedQuery Observable> & QueryableStorageEntry; + epochIndex: AugmentedQuery Observable, []> & QueryableStorageEntry; /** * The slot at which the first epoch actually started. This is 0 * until the first block of the chain. **/ - genesisSlot: AugmentedQuery Observable> & QueryableStorageEntry; + genesisSlot: AugmentedQuery Observable, []> & QueryableStorageEntry; /** * Temporary value (cleared at block finalization) which is `Some` * if per-block initialization has already been called for current block. **/ - initialized: AugmentedQuery Observable>> & QueryableStorageEntry; + initialized: AugmentedQuery Observable>, []> & QueryableStorageEntry; /** * How late the current block is compared to its parent. * @@ -95,15 +95,15 @@ declare module '@polkadot/api/types/storage' { * on block finalization. Querying this storage entry outside of block * execution context should always yield zero. **/ - lateness: AugmentedQuery Observable> & QueryableStorageEntry; + lateness: AugmentedQuery Observable, []> & QueryableStorageEntry; /** * Next epoch configuration, if changed. **/ - nextEpochConfig: AugmentedQuery Observable>> & QueryableStorageEntry; + nextEpochConfig: AugmentedQuery Observable>, []> & QueryableStorageEntry; /** * Next epoch randomness. **/ - nextRandomness: AugmentedQuery Observable> & QueryableStorageEntry; + nextRandomness: AugmentedQuery Observable, []> & QueryableStorageEntry; /** * The epoch randomness for the *current* epoch. * @@ -116,7 +116,7 @@ declare module '@polkadot/api/types/storage' { * used where a number is needed that cannot have been chosen by an * adversary, for purposes such as public-coin zero-knowledge proofs. **/ - randomness: AugmentedQuery Observable> & QueryableStorageEntry; + randomness: AugmentedQuery Observable, []> & QueryableStorageEntry; /** * Randomness under construction. * @@ -128,11 +128,11 @@ declare module '@polkadot/api/types/storage' { * We reset all segments and return to `0` at the beginning of every * epoch. **/ - segmentIndex: AugmentedQuery Observable> & QueryableStorageEntry; + segmentIndex: AugmentedQuery Observable, []> & QueryableStorageEntry; /** * TWOX-NOTE: `SegmentIndex` is an increasing integer, so this is okay. **/ - underConstruction: AugmentedQuery Observable>> & QueryableStorageEntry; + underConstruction: AugmentedQuery Observable>, [u32]> & QueryableStorageEntry; }; balances: { [key: string]: QueryableStorageEntry; @@ -141,93 +141,93 @@ declare module '@polkadot/api/types/storage' { * * NOTE: This is only used in the case that this module is used to store balances. **/ - account: AugmentedQuery Observable> & QueryableStorageEntry; + account: AugmentedQuery Observable, [AccountId]> & QueryableStorageEntry; /** * Any liquidity locks on some account balances. * NOTE: Should only be accessed when setting, changing and freeing a lock. **/ - locks: AugmentedQuery Observable>> & QueryableStorageEntry; + locks: AugmentedQuery Observable>, [AccountId]> & QueryableStorageEntry; /** * Storage version of the pallet. * * This is set to v2.0.0 for new networks. **/ - storageVersion: AugmentedQuery Observable> & QueryableStorageEntry; + storageVersion: AugmentedQuery Observable, []> & QueryableStorageEntry; /** * The total units issued in the system. **/ - totalIssuance: AugmentedQuery Observable> & QueryableStorageEntry; + totalIssuance: AugmentedQuery Observable, []> & QueryableStorageEntry; }; bounties: { [key: string]: QueryableStorageEntry; /** * Bounties that have been made. **/ - bounties: AugmentedQuery Observable>> & QueryableStorageEntry; + bounties: AugmentedQuery Observable>, [BountyIndex]> & QueryableStorageEntry; /** * Bounty indices that have been approved but not yet funded. **/ - bountyApprovals: AugmentedQuery Observable>> & QueryableStorageEntry; + bountyApprovals: AugmentedQuery Observable>, []> & QueryableStorageEntry; /** * Number of bounty proposals that have been made. **/ - bountyCount: AugmentedQuery Observable> & QueryableStorageEntry; + bountyCount: AugmentedQuery Observable, []> & QueryableStorageEntry; /** * The description of each bounty. **/ - bountyDescriptions: AugmentedQuery Observable>> & QueryableStorageEntry; + bountyDescriptions: AugmentedQuery Observable>, [BountyIndex]> & QueryableStorageEntry; }; contracts: { [key: string]: QueryableStorageEntry; /** * The subtrie counter. **/ - accountCounter: AugmentedQuery Observable> & QueryableStorageEntry; + accountCounter: AugmentedQuery Observable, []> & QueryableStorageEntry; /** * A mapping between an original code hash and instrumented wasm code, ready for execution. **/ - codeStorage: AugmentedQuery Observable>> & QueryableStorageEntry; + codeStorage: AugmentedQuery Observable>, [CodeHash]> & QueryableStorageEntry; /** * The code associated with a given account. * * TWOX-NOTE: SAFE since `AccountId` is a secure hash. **/ - contractInfoOf: AugmentedQuery Observable>> & QueryableStorageEntry; + contractInfoOf: AugmentedQuery Observable>, [AccountId]> & QueryableStorageEntry; /** * Current cost schedule for contracts. **/ - currentSchedule: AugmentedQuery Observable> & QueryableStorageEntry; + currentSchedule: AugmentedQuery Observable, []> & QueryableStorageEntry; /** * A mapping from an original code hash to the original code, untouched by instrumentation. **/ - pristineCode: AugmentedQuery Observable>> & QueryableStorageEntry; + pristineCode: AugmentedQuery Observable>, [CodeHash]> & QueryableStorageEntry; }; council: { [key: string]: QueryableStorageEntry; /** * The current members of the collective. This is stored sorted (just by value). **/ - members: AugmentedQuery Observable>> & QueryableStorageEntry; + members: AugmentedQuery Observable>, []> & QueryableStorageEntry; /** * The prime member that helps determine the default vote behavior in case of absentations. **/ - prime: AugmentedQuery Observable>> & QueryableStorageEntry; + prime: AugmentedQuery Observable>, []> & QueryableStorageEntry; /** * Proposals so far. **/ - proposalCount: AugmentedQuery Observable> & QueryableStorageEntry; + proposalCount: AugmentedQuery Observable, []> & QueryableStorageEntry; /** * Actual proposal for a given hash, if it's current. **/ - proposalOf: AugmentedQuery Observable>> & QueryableStorageEntry; + proposalOf: AugmentedQuery Observable>, [Hash]> & QueryableStorageEntry; /** * The hashes of the active proposals. **/ - proposals: AugmentedQuery Observable>> & QueryableStorageEntry; + proposals: AugmentedQuery Observable>, []> & QueryableStorageEntry; /** * Votes on a given proposal, if it is ongoing. **/ - voting: AugmentedQuery Observable>> & QueryableStorageEntry; + voting: AugmentedQuery Observable>, [Hash]> & QueryableStorageEntry; }; democracy: { [key: string]: QueryableStorageEntry; @@ -235,77 +235,77 @@ declare module '@polkadot/api/types/storage' { * A record of who vetoed what. Maps proposal hash to a possible existent block number * (until when it may not be resubmitted) and who vetoed it. **/ - blacklist: AugmentedQuery Observable]>>>> & QueryableStorageEntry; + blacklist: AugmentedQuery Observable]>>>, [Hash]> & QueryableStorageEntry; /** * Record of all proposals that have been subject to emergency cancellation. **/ - cancellations: AugmentedQuery Observable> & QueryableStorageEntry; + cancellations: AugmentedQuery Observable, [Hash]> & QueryableStorageEntry; /** * Those who have locked a deposit. * * TWOX-NOTE: Safe, as increasing integer keys are safe. **/ - depositOf: AugmentedQuery Observable, BalanceOf]>>>> & QueryableStorageEntry; + depositOf: AugmentedQuery Observable, BalanceOf]>>>, [PropIndex]> & QueryableStorageEntry; /** * True if the last referendum tabled was submitted externally. False if it was a public * proposal. **/ - lastTabledWasExternal: AugmentedQuery Observable> & QueryableStorageEntry; + lastTabledWasExternal: AugmentedQuery Observable, []> & QueryableStorageEntry; /** * Accounts for which there are locks in action which may be removed at some point in the * future. The value is the block number at which the lock expires and may be removed. * * TWOX-NOTE: OK ― `AccountId` is a secure hash. **/ - locks: AugmentedQuery Observable>> & QueryableStorageEntry; + locks: AugmentedQuery Observable>, [AccountId]> & QueryableStorageEntry; /** * The lowest referendum index representing an unbaked referendum. Equal to * `ReferendumCount` if there isn't a unbaked referendum. **/ - lowestUnbaked: AugmentedQuery Observable> & QueryableStorageEntry; + lowestUnbaked: AugmentedQuery Observable, []> & QueryableStorageEntry; /** * The referendum to be tabled whenever it would be valid to table an external proposal. * This happens when a referendum needs to be tabled and one of two conditions are met: * - `LastTabledWasExternal` is `false`; or * - `PublicProps` is empty. **/ - nextExternal: AugmentedQuery Observable>>> & QueryableStorageEntry; + nextExternal: AugmentedQuery Observable>>, []> & QueryableStorageEntry; /** * Map of hashes to the proposal preimage, along with who registered it and their deposit. * The block number is the block at which it was deposited. **/ - preimages: AugmentedQuery Observable>> & QueryableStorageEntry; + preimages: AugmentedQuery Observable>, [Hash]> & QueryableStorageEntry; /** * The number of (public) proposals that have been made so far. **/ - publicPropCount: AugmentedQuery Observable> & QueryableStorageEntry; + publicPropCount: AugmentedQuery Observable, []> & QueryableStorageEntry; /** * The public proposals. Unsorted. The second item is the proposal's hash. **/ - publicProps: AugmentedQuery Observable>>> & QueryableStorageEntry; + publicProps: AugmentedQuery Observable>>, []> & QueryableStorageEntry; /** * The next free referendum index, aka the number of referenda started so far. **/ - referendumCount: AugmentedQuery Observable> & QueryableStorageEntry; + referendumCount: AugmentedQuery Observable, []> & QueryableStorageEntry; /** * Information concerning any given referendum. * * TWOX-NOTE: SAFE as indexes are not under an attacker’s control. **/ - referendumInfoOf: AugmentedQuery Observable>> & QueryableStorageEntry; + referendumInfoOf: AugmentedQuery Observable>, [ReferendumIndex]> & QueryableStorageEntry; /** * Storage version of the pallet. * * New networks start with last version. **/ - storageVersion: AugmentedQuery Observable>> & QueryableStorageEntry; + storageVersion: AugmentedQuery Observable>, []> & QueryableStorageEntry; /** * All votes for a particular voter. We store the balance for the number of votes that we * have recorded. The second item is the total amount of delegations, that will be added. * * TWOX-NOTE: SAFE as `AccountId`s are crypto hashes anyway. **/ - votingOf: AugmentedQuery Observable> & QueryableStorageEntry; + votingOf: AugmentedQuery Observable, [AccountId]> & QueryableStorageEntry; }; elections: { [key: string]: QueryableStorageEntry; @@ -313,25 +313,25 @@ declare module '@polkadot/api/types/storage' { * The present candidate list. Sorted based on account-id. A current member or runner-up * can never enter this vector and is always implicitly assumed to be a candidate. **/ - candidates: AugmentedQuery Observable>> & QueryableStorageEntry; + candidates: AugmentedQuery Observable>, []> & QueryableStorageEntry; /** * The total number of vote rounds that have happened, excluding the upcoming one. **/ - electionRounds: AugmentedQuery Observable> & QueryableStorageEntry; + electionRounds: AugmentedQuery Observable, []> & QueryableStorageEntry; /** * The current elected membership. Sorted based on account id. **/ - members: AugmentedQuery Observable>>> & QueryableStorageEntry; + members: AugmentedQuery Observable>>, []> & QueryableStorageEntry; /** * The current runners_up. Sorted based on low to high merit (worse to best). **/ - runnersUp: AugmentedQuery Observable>>> & QueryableStorageEntry; + runnersUp: AugmentedQuery Observable>>, []> & QueryableStorageEntry; /** * Votes and locked stake of a particular voter. * * TWOX-NOTE: SAFE as `AccountId` is a crypto hash **/ - voting: AugmentedQuery Observable]>>> & QueryableStorageEntry; + voting: AugmentedQuery Observable]>>, [AccountId]> & QueryableStorageEntry; }; grandpa: { [key: string]: QueryableStorageEntry; @@ -339,30 +339,30 @@ declare module '@polkadot/api/types/storage' { * The number of changes (both in terms of keys and underlying economic responsibilities) * in the "set" of Grandpa validators from genesis. **/ - currentSetId: AugmentedQuery Observable> & QueryableStorageEntry; + currentSetId: AugmentedQuery Observable, []> & QueryableStorageEntry; /** * next block number where we can force a change. **/ - nextForced: AugmentedQuery Observable>> & QueryableStorageEntry; + nextForced: AugmentedQuery Observable>, []> & QueryableStorageEntry; /** * Pending change: (signaled at, scheduled change). **/ - pendingChange: AugmentedQuery Observable>> & QueryableStorageEntry; + pendingChange: AugmentedQuery Observable>, []> & QueryableStorageEntry; /** * A mapping from grandpa set ID to the index of the *most recent* session for which its * members were responsible. * * TWOX-NOTE: `SetId` is not under user control. **/ - setIdSession: AugmentedQuery Observable>> & QueryableStorageEntry; + setIdSession: AugmentedQuery Observable>, [SetId]> & QueryableStorageEntry; /** * `true` if we are currently stalled. **/ - stalled: AugmentedQuery Observable>>> & QueryableStorageEntry; + stalled: AugmentedQuery Observable>>, []> & QueryableStorageEntry; /** * State of the current authority set. **/ - state: AugmentedQuery Observable> & QueryableStorageEntry; + state: AugmentedQuery Observable, []> & QueryableStorageEntry; }; identity: { [key: string]: QueryableStorageEntry; @@ -371,14 +371,14 @@ declare module '@polkadot/api/types/storage' { * * TWOX-NOTE: OK ― `AccountId` is a secure hash. **/ - identityOf: AugmentedQuery Observable>> & QueryableStorageEntry; + identityOf: AugmentedQuery Observable>, [AccountId]> & QueryableStorageEntry; /** * The set of registrars. Not expected to get very big as can only be added through a * special origin (likely a council motion). * * The index into this can be cast to `RegistrarIndex` to get a valid value. **/ - registrars: AugmentedQuery Observable>>> & QueryableStorageEntry; + registrars: AugmentedQuery Observable>>, []> & QueryableStorageEntry; /** * Alternative "sub" identities of this account. * @@ -386,12 +386,12 @@ declare module '@polkadot/api/types/storage' { * * TWOX-NOTE: OK ― `AccountId` is a secure hash. **/ - subsOf: AugmentedQuery Observable]>>> & QueryableStorageEntry; + subsOf: AugmentedQuery Observable]>>, [AccountId]> & QueryableStorageEntry; /** * The super-identity of an alternative "sub" identity together with its name, within that * context. If the account is not some other account's sub-identity, then just `None`. **/ - superOf: AugmentedQuery Observable>>> & QueryableStorageEntry; + superOf: AugmentedQuery Observable>>, [AccountId]> & QueryableStorageEntry; }; imOnline: { [key: string]: QueryableStorageEntry; @@ -399,7 +399,7 @@ declare module '@polkadot/api/types/storage' { * For each session index, we keep a mapping of `T::ValidatorId` to the * number of blocks authored by the given authority. **/ - authoredBlocks: AugmentedQueryDoubleMap Observable> & QueryableStorageEntry; + authoredBlocks: AugmentedQueryDoubleMap Observable, [SessionIndex, ValidatorId]> & QueryableStorageEntry; /** * The block number after which it's ok to send heartbeats in current session. * @@ -408,23 +408,23 @@ declare module '@polkadot/api/types/storage' { * The idea is to first wait for the validators to produce a block * in the current session, so that the heartbeat later on will not be necessary. **/ - heartbeatAfter: AugmentedQuery Observable> & QueryableStorageEntry; + heartbeatAfter: AugmentedQuery Observable, []> & QueryableStorageEntry; /** * The current set of keys that may issue a heartbeat. **/ - keys: AugmentedQuery Observable>> & QueryableStorageEntry; + keys: AugmentedQuery Observable>, []> & QueryableStorageEntry; /** * For each session index, we keep a mapping of `AuthIndex` to * `offchain::OpaqueNetworkState`. **/ - receivedHeartbeats: AugmentedQueryDoubleMap Observable>> & QueryableStorageEntry; + receivedHeartbeats: AugmentedQueryDoubleMap Observable>, [SessionIndex, AuthIndex]> & QueryableStorageEntry; }; indices: { [key: string]: QueryableStorageEntry; /** * The lookup from index to account. **/ - accounts: AugmentedQuery Observable>>> & QueryableStorageEntry; + accounts: AugmentedQuery Observable>>, [AccountIndex]> & QueryableStorageEntry; }; mmr: { [key: string]: QueryableStorageEntry; @@ -434,39 +434,39 @@ declare module '@polkadot/api/types/storage' { * Note this collection only contains MMR peaks, the inner nodes (and leaves) * are pruned and only stored in the Offchain DB. **/ - nodes: AugmentedQuery Observable>> & QueryableStorageEntry; + nodes: AugmentedQuery Observable>, [u64]> & QueryableStorageEntry; /** * Current size of the MMR (number of leaves). **/ - numberOfLeaves: AugmentedQuery Observable> & QueryableStorageEntry; + numberOfLeaves: AugmentedQuery Observable, []> & QueryableStorageEntry; /** * Latest MMR Root hash. **/ - rootHash: AugmentedQuery Observable> & QueryableStorageEntry; + rootHash: AugmentedQuery Observable, []> & QueryableStorageEntry; }; multisig: { [key: string]: QueryableStorageEntry; - calls: AugmentedQuery Observable>>> & QueryableStorageEntry; + calls: AugmentedQuery Observable>>, [U8aFixed]> & QueryableStorageEntry; /** * The set of open multisig operations. **/ - multisigs: AugmentedQueryDoubleMap Observable>> & QueryableStorageEntry; + multisigs: AugmentedQueryDoubleMap Observable>, [AccountId, U8aFixed]> & QueryableStorageEntry; }; offences: { [key: string]: QueryableStorageEntry; /** * A vector of reports of the same kind that happened at the same time slot. **/ - concurrentReportsIndex: AugmentedQueryDoubleMap Observable>> & QueryableStorageEntry; + concurrentReportsIndex: AugmentedQueryDoubleMap Observable>, [Kind, OpaqueTimeSlot]> & QueryableStorageEntry; /** * Deferred reports that have been rejected by the offence handler and need to be submitted * at a later time. **/ - deferredOffences: AugmentedQuery Observable>> & QueryableStorageEntry; + deferredOffences: AugmentedQuery Observable>, []> & QueryableStorageEntry; /** * The primary structure that holds all offence records keyed by report identifiers. **/ - reports: AugmentedQuery Observable>> & QueryableStorageEntry; + reports: AugmentedQuery Observable>, [ReportIdOf]> & QueryableStorageEntry; /** * Enumerates all reports of a kind along with the time they happened. * @@ -475,19 +475,19 @@ declare module '@polkadot/api/types/storage' { * Note that the actual type of this mapping is `Vec`, this is because values of * different types are not supported at the moment so we are doing the manual serialization. **/ - reportsByKindIndex: AugmentedQuery Observable> & QueryableStorageEntry; + reportsByKindIndex: AugmentedQuery Observable, [Kind]> & QueryableStorageEntry; }; proxy: { [key: string]: QueryableStorageEntry; /** * The announcements made by the proxy (key). **/ - announcements: AugmentedQuery Observable, BalanceOf]>>> & QueryableStorageEntry; + announcements: AugmentedQuery Observable, BalanceOf]>>, [AccountId]> & QueryableStorageEntry; /** * The set of account proxies. Maps the account which has delegated to the accounts * which are being delegated to, together with the amount held on deposit. **/ - proxies: AugmentedQuery Observable, BalanceOf]>>> & QueryableStorageEntry; + proxies: AugmentedQuery Observable, BalanceOf]>>, [AccountId]> & QueryableStorageEntry; }; randomnessCollectiveFlip: { [key: string]: QueryableStorageEntry; @@ -496,7 +496,7 @@ declare module '@polkadot/api/types/storage' { * is arranged as a ring buffer with `block_number % 81` being the index into the `Vec` of * the oldest hash. **/ - randomMaterial: AugmentedQuery Observable>> & QueryableStorageEntry; + randomMaterial: AugmentedQuery Observable>, []> & QueryableStorageEntry; }; recovery: { [key: string]: QueryableStorageEntry; @@ -506,137 +506,137 @@ declare module '@polkadot/api/types/storage' { * First account is the account to be recovered, and the second account * is the user trying to recover the account. **/ - activeRecoveries: AugmentedQueryDoubleMap Observable>> & QueryableStorageEntry; + activeRecoveries: AugmentedQueryDoubleMap Observable>, [AccountId, AccountId]> & QueryableStorageEntry; /** * The list of allowed proxy accounts. * * Map from the user who can access it to the recovered account. **/ - proxy: AugmentedQuery Observable>> & QueryableStorageEntry; + proxy: AugmentedQuery Observable>, [AccountId]> & QueryableStorageEntry; /** * The set of recoverable accounts and their recovery configuration. **/ - recoverable: AugmentedQuery Observable>> & QueryableStorageEntry; + recoverable: AugmentedQuery Observable>, [AccountId]> & QueryableStorageEntry; }; scheduler: { [key: string]: QueryableStorageEntry; /** * Items to be executed, indexed by the block number that they should be executed on. **/ - agenda: AugmentedQuery Observable>>> & QueryableStorageEntry; + agenda: AugmentedQuery Observable>>, [BlockNumber]> & QueryableStorageEntry; /** * Lookup from identity to the block number and index of the task. **/ - lookup: AugmentedQuery Observable>> & QueryableStorageEntry; + lookup: AugmentedQuery Observable>, [Bytes]> & QueryableStorageEntry; /** * Storage version of the pallet. * * New networks start with last version. **/ - storageVersion: AugmentedQuery Observable> & QueryableStorageEntry; + storageVersion: AugmentedQuery Observable, []> & QueryableStorageEntry; }; session: { [key: string]: QueryableStorageEntry; /** * Current index of the session. **/ - currentIndex: AugmentedQuery Observable> & QueryableStorageEntry; + currentIndex: AugmentedQuery Observable, []> & QueryableStorageEntry; /** * Indices of disabled validators. * * The set is cleared when `on_session_ending` returns a new set of identities. **/ - disabledValidators: AugmentedQuery Observable>> & QueryableStorageEntry; + disabledValidators: AugmentedQuery Observable>, []> & QueryableStorageEntry; /** * The owner of a key. The key is the `KeyTypeId` + the encoded key. **/ - keyOwner: AugmentedQuery | [KeyTypeId | AnyNumber | Uint8Array, Bytes | string | Uint8Array]) => Observable>> & QueryableStorageEntry; + keyOwner: AugmentedQuery | [KeyTypeId | AnyNumber | Uint8Array, Bytes | string | Uint8Array]) => Observable>, [ITuple<[KeyTypeId, Bytes]>]> & QueryableStorageEntry]>; /** * The next session keys for a validator. **/ - nextKeys: AugmentedQuery Observable>> & QueryableStorageEntry; + nextKeys: AugmentedQuery Observable>, [ValidatorId]> & QueryableStorageEntry; /** * True if the underlying economic identities or weighting behind the validators * has changed in the queued validator set. **/ - queuedChanged: AugmentedQuery Observable> & QueryableStorageEntry; + queuedChanged: AugmentedQuery Observable, []> & QueryableStorageEntry; /** * The queued keys for the next session. When the next session begins, these keys * will be used to determine the validator's session keys. **/ - queuedKeys: AugmentedQuery Observable>>> & QueryableStorageEntry; + queuedKeys: AugmentedQuery Observable>>, []> & QueryableStorageEntry; /** * The current set of validators. **/ - validators: AugmentedQuery Observable>> & QueryableStorageEntry; + validators: AugmentedQuery Observable>, []> & QueryableStorageEntry; }; society: { [key: string]: QueryableStorageEntry; /** * The current bids, stored ordered by the value of the bid. **/ - bids: AugmentedQuery Observable>> & QueryableStorageEntry; + bids: AugmentedQuery Observable>, []> & QueryableStorageEntry; /** * The current set of candidates; bidders that are attempting to become members. **/ - candidates: AugmentedQuery Observable>> & QueryableStorageEntry; + candidates: AugmentedQuery Observable>, []> & QueryableStorageEntry; /** * The defending member currently being challenged. **/ - defender: AugmentedQuery Observable>> & QueryableStorageEntry; + defender: AugmentedQuery Observable>, []> & QueryableStorageEntry; /** * Votes for the defender. **/ - defenderVotes: AugmentedQuery Observable>> & QueryableStorageEntry; + defenderVotes: AugmentedQuery Observable>, [AccountId]> & QueryableStorageEntry; /** * The first member. **/ - founder: AugmentedQuery Observable>> & QueryableStorageEntry; + founder: AugmentedQuery Observable>, []> & QueryableStorageEntry; /** * The most primary from the most recently approved members. **/ - head: AugmentedQuery Observable>> & QueryableStorageEntry; + head: AugmentedQuery Observable>, []> & QueryableStorageEntry; /** * The max number of members for the society at one time. **/ - maxMembers: AugmentedQuery Observable> & QueryableStorageEntry; + maxMembers: AugmentedQuery Observable, []> & QueryableStorageEntry; /** * The current set of members, ordered. **/ - members: AugmentedQuery Observable>> & QueryableStorageEntry; + members: AugmentedQuery Observable>, []> & QueryableStorageEntry; /** * Pending payouts; ordered by block number, with the amount that should be paid out. **/ - payouts: AugmentedQuery Observable>>> & QueryableStorageEntry; + payouts: AugmentedQuery Observable>>, [AccountId]> & QueryableStorageEntry; /** * Amount of our account balance that is specifically for the next round's bid(s). **/ - pot: AugmentedQuery Observable> & QueryableStorageEntry; + pot: AugmentedQuery Observable, []> & QueryableStorageEntry; /** * A hash of the rules of this society concerning membership. Can only be set once and * only by the founder. **/ - rules: AugmentedQuery Observable>> & QueryableStorageEntry; + rules: AugmentedQuery Observable>, []> & QueryableStorageEntry; /** * The ongoing number of losing votes cast by the member. **/ - strikes: AugmentedQuery Observable> & QueryableStorageEntry; + strikes: AugmentedQuery Observable, [AccountId]> & QueryableStorageEntry; /** * The set of suspended candidates. **/ - suspendedCandidates: AugmentedQuery Observable>>> & QueryableStorageEntry; + suspendedCandidates: AugmentedQuery Observable>>, [AccountId]> & QueryableStorageEntry; /** * The set of suspended members. **/ - suspendedMembers: AugmentedQuery Observable> & QueryableStorageEntry; + suspendedMembers: AugmentedQuery Observable, [AccountId]> & QueryableStorageEntry; /** * Double map from Candidate -> Voter -> (Maybe) Vote. **/ - votes: AugmentedQueryDoubleMap Observable>> & QueryableStorageEntry; + votes: AugmentedQueryDoubleMap Observable>, [AccountId, AccountId]> & QueryableStorageEntry; /** * Members currently vouching or banned from vouching again **/ - vouching: AugmentedQuery Observable>> & QueryableStorageEntry; + vouching: AugmentedQuery Observable>, [AccountId]> & QueryableStorageEntry; }; staking: { [key: string]: QueryableStorageEntry; @@ -646,44 +646,44 @@ declare module '@polkadot/api/types/storage' { * The active era is the era currently rewarded. * Validator set of this era must be equal to `SessionInterface::validators`. **/ - activeEra: AugmentedQuery Observable>> & QueryableStorageEntry; + activeEra: AugmentedQuery Observable>, []> & QueryableStorageEntry; /** * Map from all locked "stash" accounts to the controller account. **/ - bonded: AugmentedQuery Observable>> & QueryableStorageEntry; + bonded: AugmentedQuery Observable>, [AccountId]> & QueryableStorageEntry; /** * A mapping from still-bonded eras to the first session index of that era. * * Must contains information for eras for the range: * `[active_era - bounding_duration; active_era]` **/ - bondedEras: AugmentedQuery Observable>>> & QueryableStorageEntry; + bondedEras: AugmentedQuery Observable>>, []> & QueryableStorageEntry; /** * The amount of currency given to reporters of a slash event which was * canceled by extraordinary circumstances (e.g. governance). **/ - canceledSlashPayout: AugmentedQuery Observable> & QueryableStorageEntry; + canceledSlashPayout: AugmentedQuery Observable, []> & QueryableStorageEntry; /** * The current era index. * * This is the latest planned era, depending on how the Session pallet queues the validator * set, it might be active or not. **/ - currentEra: AugmentedQuery Observable>> & QueryableStorageEntry; + currentEra: AugmentedQuery Observable>, []> & QueryableStorageEntry; /** * The earliest era for which we have a pending, unapplied slash. **/ - earliestUnappliedSlash: AugmentedQuery Observable>> & QueryableStorageEntry; + earliestUnappliedSlash: AugmentedQuery Observable>, []> & QueryableStorageEntry; /** * Flag to control the execution of the offchain election. When `Open(_)`, we accept * solutions to be submitted. **/ - eraElectionStatus: AugmentedQuery Observable> & QueryableStorageEntry; + eraElectionStatus: AugmentedQuery Observable, []> & QueryableStorageEntry; /** * Rewards for the last `HISTORY_DEPTH` eras. * If reward hasn't been set or has been removed then 0 reward is returned. **/ - erasRewardPoints: AugmentedQuery Observable> & QueryableStorageEntry; + erasRewardPoints: AugmentedQuery Observable, [EraIndex]> & QueryableStorageEntry; /** * Exposure of validator at era. * @@ -692,7 +692,7 @@ declare module '@polkadot/api/types/storage' { * Is it removed after `HISTORY_DEPTH` eras. * If stakers hasn't been set or has been removed then empty exposure is returned. **/ - erasStakers: AugmentedQueryDoubleMap Observable> & QueryableStorageEntry; + erasStakers: AugmentedQueryDoubleMap Observable, [EraIndex, AccountId]> & QueryableStorageEntry; /** * Clipped Exposure of validator at era. * @@ -706,16 +706,16 @@ declare module '@polkadot/api/types/storage' { * Is it removed after `HISTORY_DEPTH` eras. * If stakers hasn't been set or has been removed then empty exposure is returned. **/ - erasStakersClipped: AugmentedQueryDoubleMap Observable> & QueryableStorageEntry; + erasStakersClipped: AugmentedQueryDoubleMap Observable, [EraIndex, AccountId]> & QueryableStorageEntry; /** * The session index at which the era start for the last `HISTORY_DEPTH` eras. **/ - erasStartSessionIndex: AugmentedQuery Observable>> & QueryableStorageEntry; + erasStartSessionIndex: AugmentedQuery Observable>, [EraIndex]> & QueryableStorageEntry; /** * The total amount staked for the last `HISTORY_DEPTH` eras. * If total hasn't been set or has been removed then 0 stake is returned. **/ - erasTotalStake: AugmentedQuery Observable> & QueryableStorageEntry; + erasTotalStake: AugmentedQuery Observable, [EraIndex]> & QueryableStorageEntry; /** * Similar to `ErasStakers`, this holds the preferences of validators. * @@ -723,17 +723,17 @@ declare module '@polkadot/api/types/storage' { * * Is it removed after `HISTORY_DEPTH` eras. **/ - erasValidatorPrefs: AugmentedQueryDoubleMap Observable> & QueryableStorageEntry; + erasValidatorPrefs: AugmentedQueryDoubleMap Observable, [EraIndex, AccountId]> & QueryableStorageEntry; /** * The total validator era payout for the last `HISTORY_DEPTH` eras. * * Eras that haven't finished yet or has been removed doesn't have reward. **/ - erasValidatorReward: AugmentedQuery Observable>> & QueryableStorageEntry; + erasValidatorReward: AugmentedQuery Observable>, [EraIndex]> & QueryableStorageEntry; /** * Mode of era forcing. **/ - forceEra: AugmentedQuery Observable> & QueryableStorageEntry; + forceEra: AugmentedQuery Observable, []> & QueryableStorageEntry; /** * Number of eras to keep in history. * @@ -743,135 +743,135 @@ declare module '@polkadot/api/types/storage' { * always be in history. I.e. `active_era > current_era - history_depth` must be * guaranteed. **/ - historyDepth: AugmentedQuery Observable> & QueryableStorageEntry; + historyDepth: AugmentedQuery Observable, []> & QueryableStorageEntry; /** * Any validators that may never be slashed or forcibly kicked. It's a Vec since they're * easy to initialize and the performance hit is minimal (we expect no more than four * invulnerables) and restricted to testnets. **/ - invulnerables: AugmentedQuery Observable>> & QueryableStorageEntry; + invulnerables: AugmentedQuery Observable>, []> & QueryableStorageEntry; /** * True if the current **planned** session is final. Note that this does not take era * forcing into account. **/ - isCurrentSessionFinal: AugmentedQuery Observable> & QueryableStorageEntry; + isCurrentSessionFinal: AugmentedQuery Observable, []> & QueryableStorageEntry; /** * Map from all (unlocked) "controller" accounts to the info regarding the staking. **/ - ledger: AugmentedQuery Observable>> & QueryableStorageEntry; + ledger: AugmentedQuery Observable>, [AccountId]> & QueryableStorageEntry; /** * Minimum number of staking participants before emergency conditions are imposed. **/ - minimumValidatorCount: AugmentedQuery Observable> & QueryableStorageEntry; + minimumValidatorCount: AugmentedQuery Observable, []> & QueryableStorageEntry; /** * The map from nominator stash key to the set of stash keys of all validators to nominate. **/ - nominators: AugmentedQuery Observable>> & QueryableStorageEntry; + nominators: AugmentedQuery Observable>, [AccountId]> & QueryableStorageEntry; /** * All slashing events on nominators, mapped by era to the highest slash value of the era. **/ - nominatorSlashInEra: AugmentedQueryDoubleMap Observable>> & QueryableStorageEntry; + nominatorSlashInEra: AugmentedQueryDoubleMap Observable>, [EraIndex, AccountId]> & QueryableStorageEntry; /** * Where the reward payment should be made. Keyed by stash. **/ - payee: AugmentedQuery Observable> & QueryableStorageEntry; + payee: AugmentedQuery Observable, [AccountId]> & QueryableStorageEntry; /** * The next validator set. At the end of an era, if this is available (potentially from the * result of an offchain worker), it is immediately used. Otherwise, the on-chain election * is executed. **/ - queuedElected: AugmentedQuery Observable>> & QueryableStorageEntry; + queuedElected: AugmentedQuery Observable>, []> & QueryableStorageEntry; /** * The score of the current [`QueuedElected`]. **/ - queuedScore: AugmentedQuery Observable>> & QueryableStorageEntry; + queuedScore: AugmentedQuery Observable>, []> & QueryableStorageEntry; /** * Slashing spans for stash accounts. **/ - slashingSpans: AugmentedQuery Observable>> & QueryableStorageEntry; + slashingSpans: AugmentedQuery Observable>, [AccountId]> & QueryableStorageEntry; /** * The percentage of the slash that is distributed to reporters. * * The rest of the slashed value is handled by the `Slash`. **/ - slashRewardFraction: AugmentedQuery Observable> & QueryableStorageEntry; + slashRewardFraction: AugmentedQuery Observable, []> & QueryableStorageEntry; /** * Snapshot of nominators at the beginning of the current election window. This should only * have a value when [`EraElectionStatus`] == `ElectionStatus::Open(_)`. **/ - snapshotNominators: AugmentedQuery Observable>>> & QueryableStorageEntry; + snapshotNominators: AugmentedQuery Observable>>, []> & QueryableStorageEntry; /** * Snapshot of validators at the beginning of the current election window. This should only * have a value when [`EraElectionStatus`] == `ElectionStatus::Open(_)`. **/ - snapshotValidators: AugmentedQuery Observable>>> & QueryableStorageEntry; + snapshotValidators: AugmentedQuery Observable>>, []> & QueryableStorageEntry; /** * Records information about the maximum slash of a stash within a slashing span, * as well as how much reward has been paid out. **/ - spanSlash: AugmentedQuery | [AccountId | string | Uint8Array, SpanIndex | AnyNumber | Uint8Array]) => Observable> & QueryableStorageEntry; + spanSlash: AugmentedQuery | [AccountId | string | Uint8Array, SpanIndex | AnyNumber | Uint8Array]) => Observable, [ITuple<[AccountId, SpanIndex]>]> & QueryableStorageEntry]>; /** * True if network has been upgraded to this version. * Storage version of the pallet. * * This is set to v3.0.0 for new networks. **/ - storageVersion: AugmentedQuery Observable> & QueryableStorageEntry; + storageVersion: AugmentedQuery Observable, []> & QueryableStorageEntry; /** * All unapplied slashes that are queued for later. **/ - unappliedSlashes: AugmentedQuery Observable>> & QueryableStorageEntry; + unappliedSlashes: AugmentedQuery Observable>, [EraIndex]> & QueryableStorageEntry; /** * The ideal number of staking participants. **/ - validatorCount: AugmentedQuery Observable> & QueryableStorageEntry; + validatorCount: AugmentedQuery Observable, []> & QueryableStorageEntry; /** * The map from (wannabe) validator stash key to the preferences of that validator. **/ - validators: AugmentedQuery Observable> & QueryableStorageEntry; + validators: AugmentedQuery Observable, [AccountId]> & QueryableStorageEntry; /** * All slashing events on validators, mapped by era to the highest slash proportion * and slash value of the era. **/ - validatorSlashInEra: AugmentedQueryDoubleMap Observable>>> & QueryableStorageEntry; + validatorSlashInEra: AugmentedQueryDoubleMap Observable>>, [EraIndex, AccountId]> & QueryableStorageEntry; }; sudo: { [key: string]: QueryableStorageEntry; /** * The `AccountId` of the sudo key. **/ - key: AugmentedQuery Observable> & QueryableStorageEntry; + key: AugmentedQuery Observable, []> & QueryableStorageEntry; }; system: { [key: string]: QueryableStorageEntry; /** * The full account information for a particular account ID. **/ - account: AugmentedQuery Observable> & QueryableStorageEntry; + account: AugmentedQuery Observable, [AccountId]> & QueryableStorageEntry; /** * Total length (in bytes) for all extrinsics put together, for the current block. **/ - allExtrinsicsLen: AugmentedQuery Observable>> & QueryableStorageEntry; + allExtrinsicsLen: AugmentedQuery Observable>, []> & QueryableStorageEntry; /** * Map of block numbers to block hashes. **/ - blockHash: AugmentedQuery Observable> & QueryableStorageEntry; + blockHash: AugmentedQuery Observable, [BlockNumber]> & QueryableStorageEntry; /** * The current weight for the block. **/ - blockWeight: AugmentedQuery Observable> & QueryableStorageEntry; + blockWeight: AugmentedQuery Observable, []> & QueryableStorageEntry; /** * Digest of the current block, also part of the block header. **/ - digest: AugmentedQuery Observable> & QueryableStorageEntry; + digest: AugmentedQuery Observable, []> & QueryableStorageEntry; /** * The number of events in the `Events` list. **/ - eventCount: AugmentedQuery Observable> & QueryableStorageEntry; + eventCount: AugmentedQuery Observable, []> & QueryableStorageEntry; /** * Events deposited for the current block. **/ - events: AugmentedQuery Observable>> & QueryableStorageEntry; + events: AugmentedQuery Observable>, []> & QueryableStorageEntry; /** * Mapping between a topic (represented by T::Hash) and a vector of indexes * of events in the `>` list. @@ -884,88 +884,88 @@ declare module '@polkadot/api/types/storage' { * the `EventIndex` then in case if the topic has the same contents on the next block * no notification will be triggered thus the event might be lost. **/ - eventTopics: AugmentedQuery Observable>>> & QueryableStorageEntry; + eventTopics: AugmentedQuery Observable>>, [Hash]> & QueryableStorageEntry; /** * The execution phase of the block. **/ - executionPhase: AugmentedQuery Observable>> & QueryableStorageEntry; + executionPhase: AugmentedQuery Observable>, []> & QueryableStorageEntry; /** * Total extrinsics count for the current block. **/ - extrinsicCount: AugmentedQuery Observable>> & QueryableStorageEntry; + extrinsicCount: AugmentedQuery Observable>, []> & QueryableStorageEntry; /** * Extrinsics data for the current block (maps an extrinsic's index to its data). **/ - extrinsicData: AugmentedQuery Observable> & QueryableStorageEntry; + extrinsicData: AugmentedQuery Observable, [u32]> & QueryableStorageEntry; /** * Extrinsics root of the current block, also part of the block header. **/ - extrinsicsRoot: AugmentedQuery Observable> & QueryableStorageEntry; + extrinsicsRoot: AugmentedQuery Observable, []> & QueryableStorageEntry; /** * Stores the `spec_version` and `spec_name` of when the last runtime upgrade happened. **/ - lastRuntimeUpgrade: AugmentedQuery Observable>> & QueryableStorageEntry; + lastRuntimeUpgrade: AugmentedQuery Observable>, []> & QueryableStorageEntry; /** * The current block number being processed. Set by `execute_block`. **/ - number: AugmentedQuery Observable> & QueryableStorageEntry; + number: AugmentedQuery Observable, []> & QueryableStorageEntry; /** * Hash of the previous block. **/ - parentHash: AugmentedQuery Observable> & QueryableStorageEntry; + parentHash: AugmentedQuery Observable, []> & QueryableStorageEntry; /** * True if we have upgraded so that `type RefCount` is `u32`. False (default) if not. **/ - upgradedToU32RefCount: AugmentedQuery Observable> & QueryableStorageEntry; + upgradedToU32RefCount: AugmentedQuery Observable, []> & QueryableStorageEntry; }; technicalCommittee: { [key: string]: QueryableStorageEntry; /** * The current members of the collective. This is stored sorted (just by value). **/ - members: AugmentedQuery Observable>> & QueryableStorageEntry; + members: AugmentedQuery Observable>, []> & QueryableStorageEntry; /** * The prime member that helps determine the default vote behavior in case of absentations. **/ - prime: AugmentedQuery Observable>> & QueryableStorageEntry; + prime: AugmentedQuery Observable>, []> & QueryableStorageEntry; /** * Proposals so far. **/ - proposalCount: AugmentedQuery Observable> & QueryableStorageEntry; + proposalCount: AugmentedQuery Observable, []> & QueryableStorageEntry; /** * Actual proposal for a given hash, if it's current. **/ - proposalOf: AugmentedQuery Observable>> & QueryableStorageEntry; + proposalOf: AugmentedQuery Observable>, [Hash]> & QueryableStorageEntry; /** * The hashes of the active proposals. **/ - proposals: AugmentedQuery Observable>> & QueryableStorageEntry; + proposals: AugmentedQuery Observable>, []> & QueryableStorageEntry; /** * Votes on a given proposal, if it is ongoing. **/ - voting: AugmentedQuery Observable>> & QueryableStorageEntry; + voting: AugmentedQuery Observable>, [Hash]> & QueryableStorageEntry; }; technicalMembership: { [key: string]: QueryableStorageEntry; /** * The current membership, stored as an ordered Vec. **/ - members: AugmentedQuery Observable>> & QueryableStorageEntry; + members: AugmentedQuery Observable>, []> & QueryableStorageEntry; /** * The current prime member, if one exists. **/ - prime: AugmentedQuery Observable>> & QueryableStorageEntry; + prime: AugmentedQuery Observable>, []> & QueryableStorageEntry; }; timestamp: { [key: string]: QueryableStorageEntry; /** * Did the timestamp get updated in this block? **/ - didUpdate: AugmentedQuery Observable> & QueryableStorageEntry; + didUpdate: AugmentedQuery Observable, []> & QueryableStorageEntry; /** * Current time for the current block. **/ - now: AugmentedQuery Observable> & QueryableStorageEntry; + now: AugmentedQuery Observable, []> & QueryableStorageEntry; }; tips: { [key: string]: QueryableStorageEntry; @@ -973,40 +973,40 @@ declare module '@polkadot/api/types/storage' { * Simple preimage lookup from the reason's hash to the original data. Again, has an * insecure enumerable hash since the key is guaranteed to be the result of a secure hash. **/ - reasons: AugmentedQuery Observable>> & QueryableStorageEntry; + reasons: AugmentedQuery Observable>, [Hash]> & QueryableStorageEntry; /** * TipsMap that are not yet completed. Keyed by the hash of `(reason, who)` from the value. * This has the insecure enumerable hash function since the key itself is already * guaranteed to be a secure hash. **/ - tips: AugmentedQuery Observable>> & QueryableStorageEntry; + tips: AugmentedQuery Observable>, [Hash]> & QueryableStorageEntry; }; transactionPayment: { [key: string]: QueryableStorageEntry; - nextFeeMultiplier: AugmentedQuery Observable> & QueryableStorageEntry; - storageVersion: AugmentedQuery Observable> & QueryableStorageEntry; + nextFeeMultiplier: AugmentedQuery Observable, []> & QueryableStorageEntry; + storageVersion: AugmentedQuery Observable, []> & QueryableStorageEntry; }; treasury: { [key: string]: QueryableStorageEntry; /** * Proposal indices that have been approved but not yet awarded. **/ - approvals: AugmentedQuery Observable>> & QueryableStorageEntry; + approvals: AugmentedQuery Observable>, []> & QueryableStorageEntry; /** * Number of proposals that have been made. **/ - proposalCount: AugmentedQuery Observable> & QueryableStorageEntry; + proposalCount: AugmentedQuery Observable, []> & QueryableStorageEntry; /** * Proposals that have been made. **/ - proposals: AugmentedQuery Observable>> & QueryableStorageEntry; + proposals: AugmentedQuery Observable>, [ProposalIndex]> & QueryableStorageEntry; }; vesting: { [key: string]: QueryableStorageEntry; /** * Information regarding the vesting of a given account. **/ - vesting: AugmentedQuery Observable>> & QueryableStorageEntry; + vesting: AugmentedQuery Observable>, [AccountId]> & QueryableStorageEntry; }; } diff --git a/packages/api/src/augment/tx.ts b/packages/api/src/augment/tx.ts index f91a909c57..b0f0c9ddbc 100644 --- a/packages/api/src/augment/tx.ts +++ b/packages/api/src/augment/tx.ts @@ -45,7 +45,7 @@ declare module '@polkadot/api/types/submittable' { * Weight: `O(1)` * Modes: Post-existence of `who`; Pre & post Zombie-status of `who`. **/ - burn: AugmentedSubmittable<(id: Compact | AnyNumber | Uint8Array, who: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, amount: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + burn: AugmentedSubmittable<(id: Compact | AnyNumber | Uint8Array, who: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, amount: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Compact, LookupSource, Compact]>; /** * Issue a new class of fungible assets from a public origin. * @@ -71,7 +71,7 @@ declare module '@polkadot/api/types/submittable' { * * Weight: `O(1)` **/ - create: AugmentedSubmittable<(id: Compact | AnyNumber | Uint8Array, admin: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, maxZombies: u32 | AnyNumber | Uint8Array, minBalance: Balance | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + create: AugmentedSubmittable<(id: Compact | AnyNumber | Uint8Array, admin: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, maxZombies: u32 | AnyNumber | Uint8Array, minBalance: Balance | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Compact, LookupSource, u32, Balance]>; /** * Destroy a class of fungible assets owned by the sender. * @@ -84,7 +84,7 @@ declare module '@polkadot/api/types/submittable' { * * Weight: `O(z)` where `z` is the number of zombie accounts. **/ - destroy: AugmentedSubmittable<(id: Compact | AnyNumber | Uint8Array, zombiesWitness: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + destroy: AugmentedSubmittable<(id: Compact | AnyNumber | Uint8Array, zombiesWitness: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Compact, Compact]>; /** * Issue a new class of fungible assets from a privileged origin. * @@ -108,7 +108,7 @@ declare module '@polkadot/api/types/submittable' { * * Weight: `O(1)` **/ - forceCreate: AugmentedSubmittable<(id: Compact | AnyNumber | Uint8Array, owner: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, maxZombies: Compact | AnyNumber | Uint8Array, minBalance: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + forceCreate: AugmentedSubmittable<(id: Compact | AnyNumber | Uint8Array, owner: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, maxZombies: Compact | AnyNumber | Uint8Array, minBalance: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Compact, LookupSource, Compact, Compact]>; /** * Destroy a class of fungible assets. * @@ -121,7 +121,7 @@ declare module '@polkadot/api/types/submittable' { * * Weight: `O(1)` **/ - forceDestroy: AugmentedSubmittable<(id: Compact | AnyNumber | Uint8Array, zombiesWitness: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + forceDestroy: AugmentedSubmittable<(id: Compact | AnyNumber | Uint8Array, zombiesWitness: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Compact, Compact]>; /** * Move some assets from one account to another. * @@ -143,7 +143,7 @@ declare module '@polkadot/api/types/submittable' { * Modes: Pre-existence of `dest`; Post-existence of `source`; Prior & post zombie-status * of `source`; Account pre-existence of `dest`. **/ - forceTransfer: AugmentedSubmittable<(id: Compact | AnyNumber | Uint8Array, source: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, dest: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, amount: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + forceTransfer: AugmentedSubmittable<(id: Compact | AnyNumber | Uint8Array, source: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, dest: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, amount: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Compact, LookupSource, LookupSource, Compact]>; /** * Disallow further unprivileged transfers from an account. * @@ -156,7 +156,7 @@ declare module '@polkadot/api/types/submittable' { * * Weight: `O(1)` **/ - freeze: AugmentedSubmittable<(id: Compact | AnyNumber | Uint8Array, who: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array) => SubmittableExtrinsic>; + freeze: AugmentedSubmittable<(id: Compact | AnyNumber | Uint8Array, who: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array) => SubmittableExtrinsic, [Compact, LookupSource]>; /** * Mint assets of a particular class. * @@ -171,8 +171,8 @@ declare module '@polkadot/api/types/submittable' { * Weight: `O(1)` * Modes: Pre-existing balance of `beneficiary`; Account pre-existence of `beneficiary`. **/ - mint: AugmentedSubmittable<(id: Compact | AnyNumber | Uint8Array, beneficiary: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, amount: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic>; - setMaxZombies: AugmentedSubmittable<(id: Compact | AnyNumber | Uint8Array, maxZombies: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + mint: AugmentedSubmittable<(id: Compact | AnyNumber | Uint8Array, beneficiary: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, amount: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Compact, LookupSource, Compact]>; + setMaxZombies: AugmentedSubmittable<(id: Compact | AnyNumber | Uint8Array, maxZombies: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Compact, Compact]>; /** * Change the Issuer, Admin and Freezer of an asset. * @@ -187,7 +187,7 @@ declare module '@polkadot/api/types/submittable' { * * Weight: `O(1)` **/ - setTeam: AugmentedSubmittable<(id: Compact | AnyNumber | Uint8Array, issuer: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, admin: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, freezer: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array) => SubmittableExtrinsic>; + setTeam: AugmentedSubmittable<(id: Compact | AnyNumber | Uint8Array, issuer: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, admin: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, freezer: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array) => SubmittableExtrinsic, [Compact, LookupSource, LookupSource, LookupSource]>; /** * Allow unprivileged transfers from an account again. * @@ -200,7 +200,7 @@ declare module '@polkadot/api/types/submittable' { * * Weight: `O(1)` **/ - thaw: AugmentedSubmittable<(id: Compact | AnyNumber | Uint8Array, who: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array) => SubmittableExtrinsic>; + thaw: AugmentedSubmittable<(id: Compact | AnyNumber | Uint8Array, who: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array) => SubmittableExtrinsic, [Compact, LookupSource]>; /** * Move some assets from the sender account to another. * @@ -221,7 +221,7 @@ declare module '@polkadot/api/types/submittable' { * Modes: Pre-existence of `target`; Post-existence of sender; Prior & post zombie-status * of sender; Account pre-existence of `target`. **/ - transfer: AugmentedSubmittable<(id: Compact | AnyNumber | Uint8Array, target: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, amount: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + transfer: AugmentedSubmittable<(id: Compact | AnyNumber | Uint8Array, target: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, amount: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Compact, LookupSource, Compact]>; /** * Change the Owner of an asset. * @@ -234,14 +234,14 @@ declare module '@polkadot/api/types/submittable' { * * Weight: `O(1)` **/ - transferOwnership: AugmentedSubmittable<(id: Compact | AnyNumber | Uint8Array, owner: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array) => SubmittableExtrinsic>; + transferOwnership: AugmentedSubmittable<(id: Compact | AnyNumber | Uint8Array, owner: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array) => SubmittableExtrinsic, [Compact, LookupSource]>; }; authorship: { [key: string]: SubmittableExtrinsicFunction; /** * Provide a set of uncles. **/ - setUncles: AugmentedSubmittable<(newUncles: Vec
| (Header | { parentHash?: any; number?: any; stateRoot?: any; extrinsicsRoot?: any; digest?: any } | string | Uint8Array)[]) => SubmittableExtrinsic>; + setUncles: AugmentedSubmittable<(newUncles: Vec
| (Header | { parentHash?: any; number?: any; stateRoot?: any; extrinsicsRoot?: any; digest?: any } | string | Uint8Array)[]) => SubmittableExtrinsic, [Vec
]>; }; babe: { [key: string]: SubmittableExtrinsicFunction; @@ -251,7 +251,7 @@ declare module '@polkadot/api/types/submittable' { * against the extracted offender. If both are valid, the offence will * be reported. **/ - reportEquivocation: AugmentedSubmittable<(equivocationProof: BabeEquivocationProof | { offender?: any; slotNumber?: any; firstHeader?: any; secondHeader?: any } | string | Uint8Array, keyOwnerProof: KeyOwnerProof | { session?: any; trieNodes?: any; validatorCount?: any } | string | Uint8Array) => SubmittableExtrinsic>; + reportEquivocation: AugmentedSubmittable<(equivocationProof: BabeEquivocationProof | { offender?: any; slotNumber?: any; firstHeader?: any; secondHeader?: any } | string | Uint8Array, keyOwnerProof: KeyOwnerProof | { session?: any; trieNodes?: any; validatorCount?: any } | string | Uint8Array) => SubmittableExtrinsic, [BabeEquivocationProof, KeyOwnerProof]>; /** * Report authority equivocation/misbehavior. This method will verify * the equivocation proof and validate the given key ownership proof @@ -262,7 +262,7 @@ declare module '@polkadot/api/types/submittable' { * if the block author is defined it will be defined as the equivocation * reporter. **/ - reportEquivocationUnsigned: AugmentedSubmittable<(equivocationProof: BabeEquivocationProof | { offender?: any; slotNumber?: any; firstHeader?: any; secondHeader?: any } | string | Uint8Array, keyOwnerProof: KeyOwnerProof | { session?: any; trieNodes?: any; validatorCount?: any } | string | Uint8Array) => SubmittableExtrinsic>; + reportEquivocationUnsigned: AugmentedSubmittable<(equivocationProof: BabeEquivocationProof | { offender?: any; slotNumber?: any; firstHeader?: any; secondHeader?: any } | string | Uint8Array, keyOwnerProof: KeyOwnerProof | { session?: any; trieNodes?: any; validatorCount?: any } | string | Uint8Array) => SubmittableExtrinsic, [BabeEquivocationProof, KeyOwnerProof]>; }; balances: { [key: string]: SubmittableExtrinsicFunction; @@ -274,7 +274,7 @@ declare module '@polkadot/api/types/submittable' { * not assumed to be in the overlay. * # **/ - forceTransfer: AugmentedSubmittable<(source: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, dest: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, value: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + forceTransfer: AugmentedSubmittable<(source: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, dest: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, value: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [LookupSource, LookupSource, Compact]>; /** * Set the balances of a given account. * @@ -295,7 +295,7 @@ declare module '@polkadot/api/types/submittable' { * - DB Weight: 1 Read, 1 Write to `who` * # **/ - setBalance: AugmentedSubmittable<(who: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, newFree: Compact | AnyNumber | Uint8Array, newReserved: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + setBalance: AugmentedSubmittable<(who: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, newFree: Compact | AnyNumber | Uint8Array, newReserved: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [LookupSource, Compact, Compact]>; /** * Transfer some liquid free balance to another account. * @@ -325,7 +325,7 @@ declare module '@polkadot/api/types/submittable' { * - Origin account is already in memory, so no DB operations for them. * # **/ - transfer: AugmentedSubmittable<(dest: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, value: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + transfer: AugmentedSubmittable<(dest: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, value: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [LookupSource, Compact]>; /** * Same as the [`transfer`] call, but with a check that the transfer will not kill the * origin account. @@ -339,7 +339,7 @@ declare module '@polkadot/api/types/submittable' { * - DB Weight: 1 Read and 1 Write to dest (sender is in overlay already) * # **/ - transferKeepAlive: AugmentedSubmittable<(dest: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, value: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + transferKeepAlive: AugmentedSubmittable<(dest: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, value: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [LookupSource, Compact]>; }; bounties: { [key: string]: SubmittableExtrinsicFunction; @@ -353,7 +353,7 @@ declare module '@polkadot/api/types/submittable' { * - O(1). * # **/ - acceptCurator: AugmentedSubmittable<(bountyId: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + acceptCurator: AugmentedSubmittable<(bountyId: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Compact]>; /** * Approve a bounty proposal. At a later time, the bounty will be funded and become active * and the original deposit will be returned. @@ -364,7 +364,7 @@ declare module '@polkadot/api/types/submittable' { * - O(1). * # **/ - approveBounty: AugmentedSubmittable<(bountyId: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + approveBounty: AugmentedSubmittable<(bountyId: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Compact]>; /** * Award bounty to a beneficiary account. The beneficiary will be able to claim the funds after a delay. * @@ -377,7 +377,7 @@ declare module '@polkadot/api/types/submittable' { * - O(1). * # **/ - awardBounty: AugmentedSubmittable<(bountyId: Compact | AnyNumber | Uint8Array, beneficiary: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array) => SubmittableExtrinsic>; + awardBounty: AugmentedSubmittable<(bountyId: Compact | AnyNumber | Uint8Array, beneficiary: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array) => SubmittableExtrinsic, [Compact, LookupSource]>; /** * Claim the payout from an awarded bounty after payout delay. * @@ -389,7 +389,7 @@ declare module '@polkadot/api/types/submittable' { * - O(1). * # **/ - claimBounty: AugmentedSubmittable<(bountyId: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + claimBounty: AugmentedSubmittable<(bountyId: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Compact]>; /** * Cancel a proposed or active bounty. All the funds will be sent to treasury and * the curator deposit will be unreserved if possible. @@ -402,7 +402,7 @@ declare module '@polkadot/api/types/submittable' { * - O(1). * # **/ - closeBounty: AugmentedSubmittable<(bountyId: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + closeBounty: AugmentedSubmittable<(bountyId: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Compact]>; /** * Extend the expiry time of an active bounty. * @@ -415,7 +415,7 @@ declare module '@polkadot/api/types/submittable' { * - O(1). * # **/ - extendBountyExpiry: AugmentedSubmittable<(bountyId: Compact | AnyNumber | Uint8Array, remark: Bytes | string | Uint8Array) => SubmittableExtrinsic>; + extendBountyExpiry: AugmentedSubmittable<(bountyId: Compact | AnyNumber | Uint8Array, remark: Bytes | string | Uint8Array) => SubmittableExtrinsic, [Compact, Bytes]>; /** * Propose a new bounty. * @@ -430,7 +430,7 @@ declare module '@polkadot/api/types/submittable' { * - `value`: The total payment amount of this bounty, curator fee included. * - `description`: The description of this bounty. **/ - proposeBounty: AugmentedSubmittable<(value: Compact | AnyNumber | Uint8Array, description: Bytes | string | Uint8Array) => SubmittableExtrinsic>; + proposeBounty: AugmentedSubmittable<(value: Compact | AnyNumber | Uint8Array, description: Bytes | string | Uint8Array) => SubmittableExtrinsic, [Compact, Bytes]>; /** * Assign a curator to a funded bounty. * @@ -440,7 +440,7 @@ declare module '@polkadot/api/types/submittable' { * - O(1). * # **/ - proposeCurator: AugmentedSubmittable<(bountyId: Compact | AnyNumber | Uint8Array, curator: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, fee: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + proposeCurator: AugmentedSubmittable<(bountyId: Compact | AnyNumber | Uint8Array, curator: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, fee: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Compact, LookupSource, Compact]>; /** * Unassign curator from a bounty. * @@ -461,7 +461,7 @@ declare module '@polkadot/api/types/submittable' { * - O(1). * # **/ - unassignCurator: AugmentedSubmittable<(bountyId: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + unassignCurator: AugmentedSubmittable<(bountyId: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Compact]>; }; contracts: { [key: string]: SubmittableExtrinsicFunction; @@ -474,7 +474,7 @@ declare module '@polkadot/api/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: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, value: Compact | AnyNumber | Uint8Array, gasLimit: Compact | AnyNumber | Uint8Array, data: Bytes | string | Uint8Array) => SubmittableExtrinsic>; + call: AugmentedSubmittable<(dest: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, value: Compact | AnyNumber | Uint8Array, gasLimit: Compact | AnyNumber | Uint8Array, data: Bytes | string | Uint8Array) => SubmittableExtrinsic, [LookupSource, Compact, Compact, Bytes]>; /** * Allows block producers to claim a small reward for evicting a contract. If a block producer * fails to do so, a regular users will be allowed to claim the reward. @@ -482,7 +482,7 @@ declare module '@polkadot/api/types/submittable' { * If contract is not evicted as a result of this call, no actions are taken and * the sender is not eligible for the reward. **/ - claimSurcharge: AugmentedSubmittable<(dest: AccountId | string | Uint8Array, auxSender: Option | null | object | string | Uint8Array) => SubmittableExtrinsic>; + claimSurcharge: AugmentedSubmittable<(dest: AccountId | string | Uint8Array, auxSender: Option | null | object | string | Uint8Array) => SubmittableExtrinsic, [AccountId, Option]>; /** * Instantiates a new contract from the `code_hash` generated by `put_code`, * optionally transferring some balance. @@ -498,18 +498,18 @@ declare module '@polkadot/api/types/submittable' { * upon any call received by this account. * - The contract is initialized. **/ - instantiate: AugmentedSubmittable<(endowment: Compact | AnyNumber | Uint8Array, gasLimit: Compact | AnyNumber | Uint8Array, codeHash: CodeHash | string | Uint8Array, data: Bytes | string | Uint8Array, salt: Bytes | string | Uint8Array) => SubmittableExtrinsic>; + instantiate: AugmentedSubmittable<(endowment: Compact | AnyNumber | Uint8Array, gasLimit: Compact | AnyNumber | Uint8Array, codeHash: CodeHash | string | Uint8Array, data: Bytes | string | Uint8Array, salt: Bytes | string | Uint8Array) => SubmittableExtrinsic, [Compact, Compact, CodeHash, Bytes, Bytes]>; /** * Stores the given binary Wasm code into the chain's storage and returns its `codehash`. * You can instantiate contracts only with stored code. **/ - putCode: AugmentedSubmittable<(code: Bytes | string | Uint8Array) => SubmittableExtrinsic>; + putCode: AugmentedSubmittable<(code: Bytes | string | Uint8Array) => SubmittableExtrinsic, [Bytes]>; /** * Updates the schedule for metering contracts. * * The schedule must have a greater version than the stored schedule. **/ - updateSchedule: AugmentedSubmittable<(schedule: Schedule | { version?: any; enablePrintln?: any; limits?: any; instructionWeights?: any; hostFnWeights?: any } | string | Uint8Array) => SubmittableExtrinsic>; + updateSchedule: AugmentedSubmittable<(schedule: Schedule | { version?: any; enablePrintln?: any; limits?: any; instructionWeights?: any; hostFnWeights?: any } | string | Uint8Array) => SubmittableExtrinsic, [Schedule]>; }; council: { [key: string]: SubmittableExtrinsicFunction; @@ -545,7 +545,7 @@ declare module '@polkadot/api/types/submittable' { * - up to 3 events * # **/ - close: AugmentedSubmittable<(proposalHash: Hash | string | Uint8Array, index: Compact | AnyNumber | Uint8Array, proposalWeightBound: Compact | AnyNumber | Uint8Array, lengthBound: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + close: AugmentedSubmittable<(proposalHash: Hash | string | Uint8Array, index: Compact | AnyNumber | Uint8Array, proposalWeightBound: Compact | AnyNumber | Uint8Array, lengthBound: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Hash, Compact, Compact, Compact]>; /** * Disapprove a proposal, close, and remove it from the system, regardless of its current state. * @@ -561,7 +561,7 @@ declare module '@polkadot/api/types/submittable' { * * Writes: Voting, Proposals, ProposalOf * # **/ - disapproveProposal: AugmentedSubmittable<(proposalHash: Hash | string | Uint8Array) => SubmittableExtrinsic>; + disapproveProposal: AugmentedSubmittable<(proposalHash: Hash | string | Uint8Array) => SubmittableExtrinsic, [Hash]>; /** * Dispatch a proposal from a member using the `Member` origin. * @@ -574,7 +574,7 @@ declare module '@polkadot/api/types/submittable' { * - 1 event * # **/ - execute: AugmentedSubmittable<(proposal: Proposal | { callIndex?: any; args?: any } | string | Uint8Array, lengthBound: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + execute: AugmentedSubmittable<(proposal: Proposal | { callIndex?: any; args?: any } | string | Uint8Array, lengthBound: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Proposal, Compact]>; /** * Add a new proposal to either be voted on or executed directly. * @@ -604,7 +604,7 @@ declare module '@polkadot/api/types/submittable' { * - 1 event * # **/ - propose: AugmentedSubmittable<(threshold: Compact | AnyNumber | Uint8Array, proposal: Proposal | { callIndex?: any; args?: any } | string | Uint8Array, lengthBound: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + propose: AugmentedSubmittable<(threshold: Compact | AnyNumber | Uint8Array, proposal: Proposal | { callIndex?: any; args?: any } | string | Uint8Array, lengthBound: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Compact, Proposal, Compact]>; /** * Set the collective's membership. * @@ -631,7 +631,7 @@ declare module '@polkadot/api/types/submittable' { * - 1 storage write (codec `O(1)`) for deleting the old `prime` and setting the new one * # **/ - setMembers: AugmentedSubmittable<(newMembers: Vec | (AccountId | string | Uint8Array)[], prime: Option | null | object | string | Uint8Array, oldCount: MemberCount | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + setMembers: AugmentedSubmittable<(newMembers: Vec | (AccountId | string | Uint8Array)[], prime: Option | null | object | string | Uint8Array, oldCount: MemberCount | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Vec, Option, MemberCount]>; /** * Add an aye or nay vote for the sender to the given proposal. * @@ -648,7 +648,7 @@ declare module '@polkadot/api/types/submittable' { * - 1 event * # **/ - vote: AugmentedSubmittable<(proposal: Hash | string | Uint8Array, index: Compact | AnyNumber | Uint8Array, approve: bool | boolean | Uint8Array) => SubmittableExtrinsic>; + vote: AugmentedSubmittable<(proposal: Hash | string | Uint8Array, index: Compact | AnyNumber | Uint8Array, approve: bool | boolean | Uint8Array) => SubmittableExtrinsic, [Hash, Compact, bool]>; }; democracy: { [key: string]: SubmittableExtrinsicFunction; @@ -669,7 +669,7 @@ declare module '@polkadot/api/types/submittable' { * Weight: `O(p)` (though as this is an high-privilege dispatch, we assume it has a * reasonable value). **/ - blacklist: AugmentedSubmittable<(proposalHash: Hash | string | Uint8Array, maybeRefIndex: Option | null | object | string | Uint8Array) => SubmittableExtrinsic>; + blacklist: AugmentedSubmittable<(proposalHash: Hash | string | Uint8Array, maybeRefIndex: Option | null | object | string | Uint8Array) => SubmittableExtrinsic, [Hash, Option]>; /** * Remove a proposal. * @@ -679,7 +679,7 @@ declare module '@polkadot/api/types/submittable' { * * Weight: `O(p)` where `p = PublicProps::::decode_len()` **/ - cancelProposal: AugmentedSubmittable<(propIndex: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + cancelProposal: AugmentedSubmittable<(propIndex: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Compact]>; /** * Cancel a proposal queued for enactment. * @@ -689,7 +689,7 @@ declare module '@polkadot/api/types/submittable' { * * Weight: `O(D)` where `D` is the items in the dispatch queue. Weighted as `D = 10`. **/ - cancelQueued: AugmentedSubmittable<(which: ReferendumIndex | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + cancelQueued: AugmentedSubmittable<(which: ReferendumIndex | AnyNumber | Uint8Array) => SubmittableExtrinsic, [ReferendumIndex]>; /** * Remove a referendum. * @@ -699,7 +699,7 @@ declare module '@polkadot/api/types/submittable' { * * # Weight: `O(1)`. **/ - cancelReferendum: AugmentedSubmittable<(refIndex: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + cancelReferendum: AugmentedSubmittable<(refIndex: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Compact]>; /** * Clears all public proposals. * @@ -707,7 +707,7 @@ declare module '@polkadot/api/types/submittable' { * * Weight: `O(1)`. **/ - clearPublicProposals: AugmentedSubmittable<() => SubmittableExtrinsic>; + clearPublicProposals: AugmentedSubmittable<() => SubmittableExtrinsic, []>; /** * Delegate the voting power (with some given conviction) of the sending account. * @@ -730,7 +730,7 @@ declare module '@polkadot/api/types/submittable' { * Weight: `O(R)` where R is the number of referendums the voter delegating to has * voted on. Weight is charged as if maximum votes. **/ - delegate: AugmentedSubmittable<(to: AccountId | string | Uint8Array, conviction: Conviction | 'None' | 'Locked1x' | 'Locked2x' | 'Locked3x' | 'Locked4x' | 'Locked5x' | 'Locked6x' | number | Uint8Array, balance: BalanceOf | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + delegate: AugmentedSubmittable<(to: AccountId | string | Uint8Array, conviction: Conviction | 'None' | 'Locked1x' | 'Locked2x' | 'Locked3x' | 'Locked4x' | 'Locked5x' | 'Locked6x' | number | Uint8Array, balance: BalanceOf | AnyNumber | Uint8Array) => SubmittableExtrinsic, [AccountId, Conviction, BalanceOf]>; /** * Schedule an emergency cancellation of a referendum. Cannot happen twice to the same * referendum. @@ -741,11 +741,11 @@ declare module '@polkadot/api/types/submittable' { * * Weight: `O(1)`. **/ - emergencyCancel: AugmentedSubmittable<(refIndex: ReferendumIndex | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + emergencyCancel: AugmentedSubmittable<(refIndex: ReferendumIndex | AnyNumber | Uint8Array) => SubmittableExtrinsic, [ReferendumIndex]>; /** * Enact a proposal from a referendum. For now we just make the weight be the maximum. **/ - enactProposal: AugmentedSubmittable<(proposalHash: Hash | string | Uint8Array, index: ReferendumIndex | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + enactProposal: AugmentedSubmittable<(proposalHash: Hash | string | Uint8Array, index: ReferendumIndex | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Hash, ReferendumIndex]>; /** * Schedule a referendum to be tabled once it is legal to schedule an external * referendum. @@ -757,7 +757,7 @@ declare module '@polkadot/api/types/submittable' { * Weight: `O(V)` with V number of vetoers in the blacklist of proposal. * Decoding vec of length V. Charged as maximum **/ - externalPropose: AugmentedSubmittable<(proposalHash: Hash | string | Uint8Array) => SubmittableExtrinsic>; + externalPropose: AugmentedSubmittable<(proposalHash: Hash | string | Uint8Array) => SubmittableExtrinsic, [Hash]>; /** * Schedule a negative-turnout-bias referendum to be tabled next once it is legal to * schedule an external referendum. @@ -771,7 +771,7 @@ declare module '@polkadot/api/types/submittable' { * * Weight: `O(1)` **/ - externalProposeDefault: AugmentedSubmittable<(proposalHash: Hash | string | Uint8Array) => SubmittableExtrinsic>; + externalProposeDefault: AugmentedSubmittable<(proposalHash: Hash | string | Uint8Array) => SubmittableExtrinsic, [Hash]>; /** * Schedule a majority-carries referendum to be tabled next once it is legal to schedule * an external referendum. @@ -785,7 +785,7 @@ declare module '@polkadot/api/types/submittable' { * * Weight: `O(1)` **/ - externalProposeMajority: AugmentedSubmittable<(proposalHash: Hash | string | Uint8Array) => SubmittableExtrinsic>; + externalProposeMajority: AugmentedSubmittable<(proposalHash: Hash | string | Uint8Array) => SubmittableExtrinsic, [Hash]>; /** * Schedule the currently externally-proposed majority-carries referendum to be tabled * immediately. If there is no externally-proposed referendum currently, or if there is one @@ -803,7 +803,7 @@ declare module '@polkadot/api/types/submittable' { * * Weight: `O(1)` **/ - fastTrack: AugmentedSubmittable<(proposalHash: Hash | string | Uint8Array, votingPeriod: BlockNumber | AnyNumber | Uint8Array, delay: BlockNumber | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + fastTrack: AugmentedSubmittable<(proposalHash: Hash | string | Uint8Array, votingPeriod: BlockNumber | AnyNumber | Uint8Array, delay: BlockNumber | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Hash, BlockNumber, BlockNumber]>; /** * Register the preimage for an upcoming proposal. This requires the proposal to be * in the dispatch queue. No deposit is needed. When this call is successful, i.e. @@ -818,11 +818,11 @@ declare module '@polkadot/api/types/submittable' { * * Weight: `O(E)` with E size of `encoded_proposal` (protected by a required deposit). **/ - noteImminentPreimage: AugmentedSubmittable<(encodedProposal: Bytes | string | Uint8Array) => SubmittableExtrinsic>; + noteImminentPreimage: AugmentedSubmittable<(encodedProposal: Bytes | string | Uint8Array) => SubmittableExtrinsic, [Bytes]>; /** * Same as `note_imminent_preimage` but origin is `OperationalPreimageOrigin`. **/ - noteImminentPreimageOperational: AugmentedSubmittable<(encodedProposal: Bytes | string | Uint8Array) => SubmittableExtrinsic>; + noteImminentPreimageOperational: AugmentedSubmittable<(encodedProposal: Bytes | string | Uint8Array) => SubmittableExtrinsic, [Bytes]>; /** * Register the preimage for an upcoming proposal. This doesn't require the proposal to be * in the dispatch queue but does require a deposit, returned once enacted. @@ -835,11 +835,11 @@ declare module '@polkadot/api/types/submittable' { * * Weight: `O(E)` with E size of `encoded_proposal` (protected by a required deposit). **/ - notePreimage: AugmentedSubmittable<(encodedProposal: Bytes | string | Uint8Array) => SubmittableExtrinsic>; + notePreimage: AugmentedSubmittable<(encodedProposal: Bytes | string | Uint8Array) => SubmittableExtrinsic, [Bytes]>; /** * Same as `note_preimage` but origin is `OperationalPreimageOrigin`. **/ - notePreimageOperational: AugmentedSubmittable<(encodedProposal: Bytes | string | Uint8Array) => SubmittableExtrinsic>; + notePreimageOperational: AugmentedSubmittable<(encodedProposal: Bytes | string | Uint8Array) => SubmittableExtrinsic, [Bytes]>; /** * Propose a sensitive action to be taken. * @@ -853,7 +853,7 @@ declare module '@polkadot/api/types/submittable' { * * Weight: `O(p)` **/ - propose: AugmentedSubmittable<(proposalHash: Hash | string | Uint8Array, value: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + propose: AugmentedSubmittable<(proposalHash: Hash | string | Uint8Array, value: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Hash, Compact]>; /** * Remove an expired proposal preimage and collect the deposit. * @@ -871,7 +871,7 @@ declare module '@polkadot/api/types/submittable' { * * Weight: `O(D)` where D is length of proposal. **/ - reapPreimage: AugmentedSubmittable<(proposalHash: Hash | string | Uint8Array, proposalLenUpperBound: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + reapPreimage: AugmentedSubmittable<(proposalHash: Hash | string | Uint8Array, proposalLenUpperBound: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Hash, Compact]>; /** * Remove a vote for a referendum. * @@ -889,7 +889,7 @@ declare module '@polkadot/api/types/submittable' { * Weight: `O(R + log R)` where R is the number of referenda that `target` has voted on. * Weight is calculated for the maximum number of vote. **/ - removeOtherVote: AugmentedSubmittable<(target: AccountId | string | Uint8Array, index: ReferendumIndex | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + removeOtherVote: AugmentedSubmittable<(target: AccountId | string | Uint8Array, index: ReferendumIndex | AnyNumber | Uint8Array) => SubmittableExtrinsic, [AccountId, ReferendumIndex]>; /** * Remove a vote for a referendum. * @@ -919,7 +919,7 @@ declare module '@polkadot/api/types/submittable' { * Weight: `O(R + log R)` where R is the number of referenda that `target` has voted on. * Weight is calculated for the maximum number of vote. **/ - removeVote: AugmentedSubmittable<(index: ReferendumIndex | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + removeVote: AugmentedSubmittable<(index: ReferendumIndex | AnyNumber | Uint8Array) => SubmittableExtrinsic, [ReferendumIndex]>; /** * Signals agreement with a particular proposal. * @@ -932,7 +932,7 @@ declare module '@polkadot/api/types/submittable' { * * Weight: `O(S)` where S is the number of seconds a proposal already has. **/ - second: AugmentedSubmittable<(proposal: Compact | AnyNumber | Uint8Array, secondsUpperBound: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + second: AugmentedSubmittable<(proposal: Compact | AnyNumber | Uint8Array, secondsUpperBound: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Compact, Compact]>; /** * Undelegate the voting power of the sending account. * @@ -947,7 +947,7 @@ declare module '@polkadot/api/types/submittable' { * Weight: `O(R)` where R is the number of referendums the voter delegating to has * voted on. Weight is charged as if maximum votes. **/ - undelegate: AugmentedSubmittable<() => SubmittableExtrinsic>; + undelegate: AugmentedSubmittable<() => SubmittableExtrinsic, []>; /** * Unlock tokens that have an expired lock. * @@ -957,7 +957,7 @@ declare module '@polkadot/api/types/submittable' { * * Weight: `O(R)` with R number of vote of target. **/ - unlock: AugmentedSubmittable<(target: AccountId | string | Uint8Array) => SubmittableExtrinsic>; + unlock: AugmentedSubmittable<(target: AccountId | string | Uint8Array) => SubmittableExtrinsic, [AccountId]>; /** * Veto and blacklist the external proposal hash. * @@ -969,7 +969,7 @@ declare module '@polkadot/api/types/submittable' { * * Weight: `O(V + log(V))` where V is number of `existing vetoers` **/ - vetoExternal: AugmentedSubmittable<(proposalHash: Hash | string | Uint8Array) => SubmittableExtrinsic>; + vetoExternal: AugmentedSubmittable<(proposalHash: Hash | string | Uint8Array) => SubmittableExtrinsic, [Hash]>; /** * Vote in a referendum. If `vote.is_aye()`, the vote is to enact the proposal; * otherwise it is a vote to keep the status quo. @@ -981,7 +981,7 @@ declare module '@polkadot/api/types/submittable' { * * Weight: `O(R)` where R is the number of referendums the voter has voted on. **/ - vote: AugmentedSubmittable<(refIndex: Compact | AnyNumber | Uint8Array, vote: AccountVote | { Standard: any } | { Split: any } | string | Uint8Array) => SubmittableExtrinsic>; + vote: AugmentedSubmittable<(refIndex: Compact | AnyNumber | Uint8Array, vote: AccountVote | { Standard: any } | { Split: any } | string | Uint8Array) => SubmittableExtrinsic, [Compact, AccountVote]>; }; elections: { [key: string]: SubmittableExtrinsicFunction; @@ -1005,7 +1005,7 @@ declare module '@polkadot/api/types/submittable' { * Else, since this is a root call and will go into phragmen, we assume full block for now. * # **/ - removeMember: AugmentedSubmittable<(who: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, hasReplacement: bool | boolean | Uint8Array) => SubmittableExtrinsic>; + removeMember: AugmentedSubmittable<(who: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, hasReplacement: bool | boolean | Uint8Array) => SubmittableExtrinsic, [LookupSource, bool]>; /** * Remove `origin` as a voter. This removes the lock and returns the bond. * @@ -1021,7 +1021,7 @@ declare module '@polkadot/api/types/submittable' { * - [AccountData(who)] * # **/ - removeVoter: AugmentedSubmittable<() => SubmittableExtrinsic>; + removeVoter: AugmentedSubmittable<() => SubmittableExtrinsic, []>; /** * Renounce one's intention to be a candidate for the next election round. 3 potential * outcomes exist: @@ -1060,7 +1060,7 @@ declare module '@polkadot/api/types/submittable' { * - [AccountData(who) (unreserve)] * **/ - renounceCandidacy: AugmentedSubmittable<(renouncing: Renouncing | { Member: any } | { RunnerUp: any } | { Candidate: any } | string | Uint8Array) => SubmittableExtrinsic>; + renounceCandidacy: AugmentedSubmittable<(renouncing: Renouncing | { Member: any } | { RunnerUp: any } | { Candidate: any } | string | Uint8Array) => SubmittableExtrinsic, [Renouncing]>; /** * Report `target` for being an defunct voter. In case of a valid report, the reporter is * rewarded by the bond amount of `target`. Otherwise, the reporter itself is removed and @@ -1090,7 +1090,7 @@ declare module '@polkadot/api/types/submittable' { * Note: the db access is worse with respect to db, which is when the report is correct. * # **/ - reportDefunctVoter: AugmentedSubmittable<(defunct: DefunctVoter | { who?: any; voteCount?: any; candidateCount?: any } | string | Uint8Array) => SubmittableExtrinsic>; + reportDefunctVoter: AugmentedSubmittable<(defunct: DefunctVoter | { who?: any; voteCount?: any; candidateCount?: any } | string | Uint8Array) => SubmittableExtrinsic, [DefunctVoter]>; /** * Submit oneself for candidacy. * @@ -1113,7 +1113,7 @@ declare module '@polkadot/api/types/submittable' { * - Candidates * # **/ - submitCandidacy: AugmentedSubmittable<(candidateCount: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + submitCandidacy: AugmentedSubmittable<(candidateCount: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Compact]>; /** * Vote for a set of candidates for the upcoming round of election. This can be called to * set the initial votes, or update already existing votes. @@ -1142,7 +1142,7 @@ declare module '@polkadot/api/types/submittable' { * - [AccountBalance(who) (unreserve -- only when creating a new voter)] * # **/ - vote: AugmentedSubmittable<(votes: Vec | (AccountId | string | Uint8Array)[], value: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + vote: AugmentedSubmittable<(votes: Vec | (AccountId | string | Uint8Array)[], value: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Vec, Compact]>; }; grandpa: { [key: string]: SubmittableExtrinsicFunction; @@ -1155,14 +1155,14 @@ declare module '@polkadot/api/types/submittable' { * will start the new authority set using the given finalized block as base. * Only callable by root. **/ - noteStalled: AugmentedSubmittable<(delay: BlockNumber | AnyNumber | Uint8Array, bestFinalizedBlockNumber: BlockNumber | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + noteStalled: AugmentedSubmittable<(delay: BlockNumber | AnyNumber | Uint8Array, bestFinalizedBlockNumber: BlockNumber | AnyNumber | Uint8Array) => SubmittableExtrinsic, [BlockNumber, BlockNumber]>; /** * Report voter equivocation/misbehavior. This method will verify the * equivocation proof and validate the given key ownership proof * against the extracted offender. If both are valid, the offence * will be reported. **/ - reportEquivocation: AugmentedSubmittable<(equivocationProof: GrandpaEquivocationProof | { setId?: any; equivocation?: any } | string | Uint8Array, keyOwnerProof: KeyOwnerProof | { session?: any; trieNodes?: any; validatorCount?: any } | string | Uint8Array) => SubmittableExtrinsic>; + reportEquivocation: AugmentedSubmittable<(equivocationProof: GrandpaEquivocationProof | { setId?: any; equivocation?: any } | string | Uint8Array, keyOwnerProof: KeyOwnerProof | { session?: any; trieNodes?: any; validatorCount?: any } | string | Uint8Array) => SubmittableExtrinsic, [GrandpaEquivocationProof, KeyOwnerProof]>; /** * Report voter equivocation/misbehavior. This method will verify the * equivocation proof and validate the given key ownership proof @@ -1174,7 +1174,7 @@ declare module '@polkadot/api/types/submittable' { * if the block author is defined it will be defined as the equivocation * reporter. **/ - reportEquivocationUnsigned: AugmentedSubmittable<(equivocationProof: GrandpaEquivocationProof | { setId?: any; equivocation?: any } | string | Uint8Array, keyOwnerProof: KeyOwnerProof | { session?: any; trieNodes?: any; validatorCount?: any } | string | Uint8Array) => SubmittableExtrinsic>; + reportEquivocationUnsigned: AugmentedSubmittable<(equivocationProof: GrandpaEquivocationProof | { setId?: any; equivocation?: any } | string | Uint8Array, keyOwnerProof: KeyOwnerProof | { session?: any; trieNodes?: any; validatorCount?: any } | string | Uint8Array) => SubmittableExtrinsic, [GrandpaEquivocationProof, KeyOwnerProof]>; }; identity: { [key: string]: SubmittableExtrinsicFunction; @@ -1193,7 +1193,7 @@ declare module '@polkadot/api/types/submittable' { * - One event. * # **/ - addRegistrar: AugmentedSubmittable<(account: AccountId | string | Uint8Array) => SubmittableExtrinsic>; + addRegistrar: AugmentedSubmittable<(account: AccountId | string | Uint8Array) => SubmittableExtrinsic, [AccountId]>; /** * Add the given account to the sender's subs. * @@ -1203,7 +1203,7 @@ declare module '@polkadot/api/types/submittable' { * The dispatch origin for this call must be _Signed_ and the sender must have a registered * sub identity of `sub`. **/ - addSub: AugmentedSubmittable<(sub: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, data: Data | { None: any } | { Raw: any } | { BlakeTwo256: any } | { Sha256: any } | { Keccak256: any } | { ShaThree256: any } | string | Uint8Array) => SubmittableExtrinsic>; + addSub: AugmentedSubmittable<(sub: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, data: Data | { None: any } | { Raw: any } | { BlakeTwo256: any } | { Sha256: any } | { Keccak256: any } | { ShaThree256: any } | string | Uint8Array) => SubmittableExtrinsic, [LookupSource, Data]>; /** * Cancel a previous request. * @@ -1223,7 +1223,7 @@ declare module '@polkadot/api/types/submittable' { * - One event * # **/ - cancelRequest: AugmentedSubmittable<(regIndex: RegistrarIndex | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + cancelRequest: AugmentedSubmittable<(regIndex: RegistrarIndex | AnyNumber | Uint8Array) => SubmittableExtrinsic, [RegistrarIndex]>; /** * Clear an account's identity info and all sub-accounts and return all deposits. * @@ -1244,7 +1244,7 @@ declare module '@polkadot/api/types/submittable' { * - One event. * # **/ - clearIdentity: AugmentedSubmittable<() => SubmittableExtrinsic>; + clearIdentity: AugmentedSubmittable<() => SubmittableExtrinsic, []>; /** * Remove an account's identity and sub-account information and slash the deposits. * @@ -1266,7 +1266,7 @@ declare module '@polkadot/api/types/submittable' { * - One event. * # **/ - killIdentity: AugmentedSubmittable<(target: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array) => SubmittableExtrinsic>; + killIdentity: AugmentedSubmittable<(target: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array) => SubmittableExtrinsic, [LookupSource]>; /** * Provide a judgement for an account's identity. * @@ -1288,7 +1288,7 @@ declare module '@polkadot/api/types/submittable' { * - One event. * # **/ - provideJudgement: AugmentedSubmittable<(regIndex: Compact | AnyNumber | Uint8Array, target: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, judgement: IdentityJudgement | { Unknown: any } | { FeePaid: any } | { Reasonable: any } | { KnownGood: any } | { OutOfDate: any } | { LowQuality: any } | { Erroneous: any } | string | Uint8Array) => SubmittableExtrinsic>; + provideJudgement: AugmentedSubmittable<(regIndex: Compact | AnyNumber | Uint8Array, target: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, judgement: IdentityJudgement | { Unknown: any } | { FeePaid: any } | { Reasonable: any } | { KnownGood: any } | { OutOfDate: any } | { LowQuality: any } | { Erroneous: any } | string | Uint8Array) => SubmittableExtrinsic, [Compact, LookupSource, IdentityJudgement]>; /** * Remove the sender as a sub-account. * @@ -1301,7 +1301,7 @@ declare module '@polkadot/api/types/submittable' { * NOTE: This should not normally be used, but is provided in the case that the non- * controller of an account is maliciously registered as a sub-account. **/ - quitSub: AugmentedSubmittable<() => SubmittableExtrinsic>; + quitSub: AugmentedSubmittable<() => SubmittableExtrinsic, []>; /** * Remove the given account from the sender's subs. * @@ -1311,14 +1311,14 @@ declare module '@polkadot/api/types/submittable' { * The dispatch origin for this call must be _Signed_ and the sender must have a registered * sub identity of `sub`. **/ - removeSub: AugmentedSubmittable<(sub: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array) => SubmittableExtrinsic>; + removeSub: AugmentedSubmittable<(sub: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array) => SubmittableExtrinsic, [LookupSource]>; /** * Alter the associated name of the given sub-account. * * The dispatch origin for this call must be _Signed_ and the sender must have a registered * sub identity of `sub`. **/ - renameSub: AugmentedSubmittable<(sub: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, data: Data | { None: any } | { Raw: any } | { BlakeTwo256: any } | { Sha256: any } | { Keccak256: any } | { ShaThree256: any } | string | Uint8Array) => SubmittableExtrinsic>; + renameSub: AugmentedSubmittable<(sub: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, data: Data | { None: any } | { Raw: any } | { BlakeTwo256: any } | { Sha256: any } | { Keccak256: any } | { ShaThree256: any } | string | Uint8Array) => SubmittableExtrinsic, [LookupSource, Data]>; /** * Request a judgement from a registrar. * @@ -1344,7 +1344,7 @@ declare module '@polkadot/api/types/submittable' { * - One event. * # **/ - requestJudgement: AugmentedSubmittable<(regIndex: Compact | AnyNumber | Uint8Array, maxFee: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + requestJudgement: AugmentedSubmittable<(regIndex: Compact | AnyNumber | Uint8Array, maxFee: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Compact, Compact]>; /** * Change the account associated with a registrar. * @@ -1360,7 +1360,7 @@ declare module '@polkadot/api/types/submittable' { * - Benchmark: 8.823 + R * 0.32 µs (min squares analysis) * # **/ - setAccountId: AugmentedSubmittable<(index: Compact | AnyNumber | Uint8Array, updated: AccountId | string | Uint8Array) => SubmittableExtrinsic>; + setAccountId: AugmentedSubmittable<(index: Compact | AnyNumber | Uint8Array, updated: AccountId | string | Uint8Array) => SubmittableExtrinsic, [Compact, AccountId]>; /** * Set the fee required for a judgement to be requested from a registrar. * @@ -1376,7 +1376,7 @@ declare module '@polkadot/api/types/submittable' { * - Benchmark: 7.315 + R * 0.329 µs (min squares analysis) * # **/ - setFee: AugmentedSubmittable<(index: Compact | AnyNumber | Uint8Array, fee: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + setFee: AugmentedSubmittable<(index: Compact | AnyNumber | Uint8Array, fee: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Compact, Compact]>; /** * Set the field information for a registrar. * @@ -1392,7 +1392,7 @@ declare module '@polkadot/api/types/submittable' { * - Benchmark: 7.464 + R * 0.325 µs (min squares analysis) * # **/ - setFields: AugmentedSubmittable<(index: Compact | AnyNumber | Uint8Array, fields: IdentityFields) => SubmittableExtrinsic>; + setFields: AugmentedSubmittable<(index: Compact | AnyNumber | Uint8Array, fields: IdentityFields) => SubmittableExtrinsic, [Compact, IdentityFields]>; /** * Set an account's identity information and reserve the appropriate deposit. * @@ -1414,7 +1414,7 @@ declare module '@polkadot/api/types/submittable' { * - One event. * # **/ - setIdentity: AugmentedSubmittable<(info: IdentityInfo | { additional?: any; display?: any; legal?: any; web?: any; riot?: any; email?: any; pgpFingerprint?: any; image?: any; twitter?: any } | string | Uint8Array) => SubmittableExtrinsic>; + setIdentity: AugmentedSubmittable<(info: IdentityInfo | { additional?: any; display?: any; legal?: any; web?: any; riot?: any; email?: any; pgpFingerprint?: any; image?: any; twitter?: any } | string | Uint8Array) => SubmittableExtrinsic, [IdentityInfo]>; /** * Set the sub-accounts of the sender. * @@ -1438,7 +1438,7 @@ declare module '@polkadot/api/types/submittable' { * - One storage-exists (`IdentityOf::contains_key`). * # **/ - setSubs: AugmentedSubmittable<(subs: Vec> | ([AccountId | string | Uint8Array, Data | { None: any } | { Raw: any } | { BlakeTwo256: any } | { Sha256: any } | { Keccak256: any } | { ShaThree256: any } | string | Uint8Array])[]) => SubmittableExtrinsic>; + setSubs: AugmentedSubmittable<(subs: Vec> | ([AccountId | string | Uint8Array, Data | { None: any } | { Raw: any } | { BlakeTwo256: any } | { Sha256: any } | { Keccak256: any } | { ShaThree256: any } | string | Uint8Array])[]) => SubmittableExtrinsic, [Vec>]>; }; imOnline: { [key: string]: SubmittableExtrinsicFunction; @@ -1453,7 +1453,7 @@ declare module '@polkadot/api/types/submittable' { * - DbWrites: `ReceivedHeartbeats` * # **/ - heartbeat: AugmentedSubmittable<(heartbeat: Heartbeat | { blockNumber?: any; networkState?: any; sessionIndex?: any; authorityIndex?: any; validatorsLen?: any } | string | Uint8Array, signature: Signature | string | Uint8Array) => SubmittableExtrinsic>; + heartbeat: AugmentedSubmittable<(heartbeat: Heartbeat | { blockNumber?: any; networkState?: any; sessionIndex?: any; authorityIndex?: any; validatorsLen?: any } | string | Uint8Array, signature: Signature | string | Uint8Array) => SubmittableExtrinsic, [Heartbeat, Signature]>; }; indices: { [key: string]: SubmittableExtrinsicFunction; @@ -1477,7 +1477,7 @@ declare module '@polkadot/api/types/submittable' { * - DB Weight: 1 Read/Write (Accounts) * # **/ - claim: AugmentedSubmittable<(index: AccountIndex | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + claim: AugmentedSubmittable<(index: AccountIndex | AnyNumber | Uint8Array) => SubmittableExtrinsic, [AccountIndex]>; /** * Force an index to an account. This doesn't require a deposit. If the index is already * held, then any deposit is reimbursed to its current owner. @@ -1501,7 +1501,7 @@ declare module '@polkadot/api/types/submittable' { * - Writes: Indices Accounts, System Account (original owner) * # **/ - forceTransfer: AugmentedSubmittable<(updated: AccountId | string | Uint8Array, index: AccountIndex | AnyNumber | Uint8Array, freeze: bool | boolean | Uint8Array) => SubmittableExtrinsic>; + forceTransfer: AugmentedSubmittable<(updated: AccountId | string | Uint8Array, index: AccountIndex | AnyNumber | Uint8Array, freeze: bool | boolean | Uint8Array) => SubmittableExtrinsic, [AccountId, AccountIndex, bool]>; /** * Free up an index owned by the sender. * @@ -1522,7 +1522,7 @@ declare module '@polkadot/api/types/submittable' { * - DB Weight: 1 Read/Write (Accounts) * # **/ - free: AugmentedSubmittable<(index: AccountIndex | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + free: AugmentedSubmittable<(index: AccountIndex | AnyNumber | Uint8Array) => SubmittableExtrinsic, [AccountIndex]>; /** * Freeze an index so it will always point to the sender account. This consumes the deposit. * @@ -1542,7 +1542,7 @@ declare module '@polkadot/api/types/submittable' { * - DB Weight: 1 Read/Write (Accounts) * # **/ - freeze: AugmentedSubmittable<(index: AccountIndex | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + freeze: AugmentedSubmittable<(index: AccountIndex | AnyNumber | Uint8Array) => SubmittableExtrinsic, [AccountIndex]>; /** * Assign an index already owned by the sender to another account. The balance reservation * is effectively transferred to the new account. @@ -1565,7 +1565,7 @@ declare module '@polkadot/api/types/submittable' { * - Writes: Indices Accounts, System Account (recipient) * # **/ - transfer: AugmentedSubmittable<(updated: AccountId | string | Uint8Array, index: AccountIndex | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + transfer: AugmentedSubmittable<(updated: AccountId | string | Uint8Array, index: AccountIndex | AnyNumber | Uint8Array) => SubmittableExtrinsic, [AccountId, AccountIndex]>; }; multisig: { [key: string]: SubmittableExtrinsicFunction; @@ -1607,7 +1607,7 @@ declare module '@polkadot/api/types/submittable' { * - Write: Multisig Storage, [Caller Account] * # **/ - approveAsMulti: AugmentedSubmittable<(threshold: u16 | AnyNumber | Uint8Array, otherSignatories: Vec | (AccountId | string | Uint8Array)[], maybeTimepoint: Option | null | object | string | Uint8Array, callHash: U8aFixed | string | Uint8Array, maxWeight: Weight | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + approveAsMulti: AugmentedSubmittable<(threshold: u16 | AnyNumber | Uint8Array, otherSignatories: Vec | (AccountId | string | Uint8Array)[], maybeTimepoint: Option | null | object | string | Uint8Array, callHash: U8aFixed | string | Uint8Array, maxWeight: Weight | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u16, Vec, Option, U8aFixed, Weight]>; /** * Register approval for a dispatch to be made from a deterministic composite account if * approved by a total of `threshold - 1` of `other_signatories`. @@ -1656,7 +1656,7 @@ declare module '@polkadot/api/types/submittable' { * - Plus Call Weight * # **/ - asMulti: AugmentedSubmittable<(threshold: u16 | AnyNumber | Uint8Array, otherSignatories: Vec | (AccountId | string | Uint8Array)[], maybeTimepoint: Option | null | object | string | Uint8Array, call: OpaqueCall | string | Uint8Array, storeCall: bool | boolean | Uint8Array, maxWeight: Weight | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + asMulti: AugmentedSubmittable<(threshold: u16 | AnyNumber | Uint8Array, otherSignatories: Vec | (AccountId | string | Uint8Array)[], maybeTimepoint: Option | null | object | string | Uint8Array, call: OpaqueCall | string | Uint8Array, storeCall: bool | boolean | Uint8Array, maxWeight: Weight | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u16, Vec, Option, OpaqueCall, bool, Weight]>; /** * Immediately dispatch a multi-signature call using a single approval from the caller. * @@ -1675,7 +1675,7 @@ declare module '@polkadot/api/types/submittable' { * - Plus Call Weight * # **/ - asMultiThreshold1: AugmentedSubmittable<(otherSignatories: Vec | (AccountId | string | Uint8Array)[], call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic>; + asMultiThreshold1: AugmentedSubmittable<(otherSignatories: Vec | (AccountId | string | Uint8Array)[], call: Call | { callIndex?: any; args?: any } | 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. @@ -1704,7 +1704,7 @@ declare module '@polkadot/api/types/submittable' { * - Write: Multisig Storage, [Caller Account], Refund Account, Calls * # **/ - cancelAsMulti: AugmentedSubmittable<(threshold: u16 | AnyNumber | Uint8Array, otherSignatories: Vec | (AccountId | string | Uint8Array)[], timepoint: Timepoint | { height?: any; index?: any } | string | Uint8Array, callHash: U8aFixed | string | Uint8Array) => SubmittableExtrinsic>; + cancelAsMulti: AugmentedSubmittable<(threshold: u16 | AnyNumber | Uint8Array, otherSignatories: Vec | (AccountId | string | Uint8Array)[], timepoint: Timepoint | { height?: any; index?: any } | string | Uint8Array, callHash: U8aFixed | string | Uint8Array) => SubmittableExtrinsic, [u16, Vec, Timepoint, U8aFixed]>; }; proxy: { [key: string]: SubmittableExtrinsicFunction; @@ -1723,7 +1723,7 @@ declare module '@polkadot/api/types/submittable' { * Weight is a function of the number of proxies the user has (P). * # **/ - addProxy: AugmentedSubmittable<(delegate: AccountId | string | Uint8Array, proxyType: ProxyType | 'Any' | 'NonTransfer' | 'Governance' | 'Staking' | number | Uint8Array, delay: BlockNumber | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + addProxy: AugmentedSubmittable<(delegate: AccountId | string | Uint8Array, proxyType: ProxyType | 'Any' | 'NonTransfer' | 'Governance' | 'Staking' | number | Uint8Array, delay: BlockNumber | AnyNumber | Uint8Array) => SubmittableExtrinsic, [AccountId, ProxyType, BlockNumber]>; /** * Publish the hash of a proxy-call that will be made in the future. * @@ -1747,7 +1747,7 @@ declare module '@polkadot/api/types/submittable' { * - P: the number of proxies the user has. * # **/ - announce: AugmentedSubmittable<(real: AccountId | string | Uint8Array, callHash: CallHashOf | string | Uint8Array) => SubmittableExtrinsic>; + announce: AugmentedSubmittable<(real: AccountId | string | Uint8Array, callHash: CallHashOf | string | Uint8Array) => SubmittableExtrinsic, [AccountId, CallHashOf]>; /** * Spawn a fresh new account that is guaranteed to be otherwise inaccessible, and * initialize it with a proxy of `proxy_type` for `origin` sender. @@ -1773,7 +1773,7 @@ declare module '@polkadot/api/types/submittable' { * # * TODO: Might be over counting 1 read **/ - anonymous: AugmentedSubmittable<(proxyType: ProxyType | 'Any' | 'NonTransfer' | 'Governance' | 'Staking' | number | Uint8Array, delay: BlockNumber | AnyNumber | Uint8Array, index: u16 | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + anonymous: AugmentedSubmittable<(proxyType: ProxyType | 'Any' | 'NonTransfer' | 'Governance' | 'Staking' | number | Uint8Array, delay: BlockNumber | AnyNumber | Uint8Array, index: u16 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [ProxyType, BlockNumber, u16]>; /** * Removes a previously spawned anonymous proxy. * @@ -1796,7 +1796,7 @@ declare module '@polkadot/api/types/submittable' { * Weight is a function of the number of proxies the user has (P). * # **/ - killAnonymous: AugmentedSubmittable<(spawner: AccountId | string | Uint8Array, proxyType: ProxyType | 'Any' | 'NonTransfer' | 'Governance' | 'Staking' | number | Uint8Array, index: u16 | AnyNumber | Uint8Array, height: Compact | AnyNumber | Uint8Array, extIndex: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + killAnonymous: AugmentedSubmittable<(spawner: AccountId | string | Uint8Array, proxyType: ProxyType | 'Any' | 'NonTransfer' | 'Governance' | 'Staking' | number | Uint8Array, index: u16 | AnyNumber | Uint8Array, height: Compact | AnyNumber | Uint8Array, extIndex: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [AccountId, ProxyType, u16, Compact, Compact]>; /** * Dispatch the given `call` from an account that the sender is authorised for through * `add_proxy`. @@ -1814,7 +1814,7 @@ declare module '@polkadot/api/types/submittable' { * Weight is a function of the number of proxies the user has (P). * # **/ - proxy: AugmentedSubmittable<(real: AccountId | string | Uint8Array, forceProxyType: Option | null | object | string | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic>; + proxy: AugmentedSubmittable<(real: AccountId | string | Uint8Array, forceProxyType: Option | null | object | string | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic, [AccountId, Option, Call]>; /** * Dispatch the given `call` from an account that the sender is authorised for through * `add_proxy`. @@ -1834,7 +1834,7 @@ declare module '@polkadot/api/types/submittable' { * - P: the number of proxies the user has. * # **/ - proxyAnnounced: AugmentedSubmittable<(delegate: AccountId | string | Uint8Array, real: AccountId | string | Uint8Array, forceProxyType: Option | null | object | string | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic>; + proxyAnnounced: AugmentedSubmittable<(delegate: AccountId | string | Uint8Array, real: AccountId | string | Uint8Array, forceProxyType: Option | null | object | string | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic, [AccountId, AccountId, Option, Call]>; /** * Remove the given announcement of a delegate. * @@ -1853,7 +1853,7 @@ declare module '@polkadot/api/types/submittable' { * - P: the number of proxies the user has. * # **/ - rejectAnnouncement: AugmentedSubmittable<(delegate: AccountId | string | Uint8Array, callHash: CallHashOf | string | Uint8Array) => SubmittableExtrinsic>; + rejectAnnouncement: AugmentedSubmittable<(delegate: AccountId | string | Uint8Array, callHash: CallHashOf | string | Uint8Array) => SubmittableExtrinsic, [AccountId, CallHashOf]>; /** * Remove a given announcement. * @@ -1872,7 +1872,7 @@ declare module '@polkadot/api/types/submittable' { * - P: the number of proxies the user has. * # **/ - removeAnnouncement: AugmentedSubmittable<(real: AccountId | string | Uint8Array, callHash: CallHashOf | string | Uint8Array) => SubmittableExtrinsic>; + removeAnnouncement: AugmentedSubmittable<(real: AccountId | string | Uint8Array, callHash: CallHashOf | string | Uint8Array) => SubmittableExtrinsic, [AccountId, CallHashOf]>; /** * Unregister all proxy accounts for the sender. * @@ -1885,7 +1885,7 @@ declare module '@polkadot/api/types/submittable' { * Weight is a function of the number of proxies the user has (P). * # **/ - removeProxies: AugmentedSubmittable<() => SubmittableExtrinsic>; + removeProxies: AugmentedSubmittable<() => SubmittableExtrinsic, []>; /** * Unregister a proxy account for the sender. * @@ -1899,7 +1899,7 @@ declare module '@polkadot/api/types/submittable' { * Weight is a function of the number of proxies the user has (P). * # **/ - removeProxy: AugmentedSubmittable<(delegate: AccountId | string | Uint8Array, proxyType: ProxyType | 'Any' | 'NonTransfer' | 'Governance' | 'Staking' | number | Uint8Array, delay: BlockNumber | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + removeProxy: AugmentedSubmittable<(delegate: AccountId | string | Uint8Array, proxyType: ProxyType | 'Any' | 'NonTransfer' | 'Governance' | 'Staking' | number | Uint8Array, delay: BlockNumber | AnyNumber | Uint8Array) => SubmittableExtrinsic, [AccountId, ProxyType, BlockNumber]>; }; recovery: { [key: string]: SubmittableExtrinsicFunction; @@ -1918,7 +1918,7 @@ declare module '@polkadot/api/types/submittable' { * - One storage lookup to check account is recovered by `who`. O(1) * # **/ - asRecovered: AugmentedSubmittable<(account: AccountId | string | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic>; + asRecovered: AugmentedSubmittable<(account: AccountId | string | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic, [AccountId, Call]>; /** * Cancel the ability to use `as_recovered` for `account`. * @@ -1932,7 +1932,7 @@ declare module '@polkadot/api/types/submittable' { * - One storage mutation to check account is recovered by `who`. O(1) * # **/ - cancelRecovered: AugmentedSubmittable<(account: AccountId | string | Uint8Array) => SubmittableExtrinsic>; + cancelRecovered: AugmentedSubmittable<(account: AccountId | string | Uint8Array) => SubmittableExtrinsic, [AccountId]>; /** * Allow a successful rescuer to claim their recovered account. * @@ -1955,7 +1955,7 @@ declare module '@polkadot/api/types/submittable' { * Total Complexity: O(F + V) * # **/ - claimRecovery: AugmentedSubmittable<(account: AccountId | string | Uint8Array) => SubmittableExtrinsic>; + claimRecovery: AugmentedSubmittable<(account: AccountId | string | Uint8Array) => SubmittableExtrinsic, [AccountId]>; /** * As the controller of a recoverable account, close an active recovery * process for your account. @@ -1978,7 +1978,7 @@ declare module '@polkadot/api/types/submittable' { * Total Complexity: O(V + X) * # **/ - closeRecovery: AugmentedSubmittable<(rescuer: AccountId | string | Uint8Array) => SubmittableExtrinsic>; + closeRecovery: AugmentedSubmittable<(rescuer: AccountId | string | Uint8Array) => SubmittableExtrinsic, [AccountId]>; /** * Create a recovery configuration for your account. This makes your account recoverable. * @@ -2008,7 +2008,7 @@ declare module '@polkadot/api/types/submittable' { * Total Complexity: O(F + X) * # **/ - createRecovery: AugmentedSubmittable<(friends: Vec | (AccountId | string | Uint8Array)[], threshold: u16 | AnyNumber | Uint8Array, delayPeriod: BlockNumber | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + createRecovery: AugmentedSubmittable<(friends: Vec | (AccountId | string | Uint8Array)[], threshold: u16 | AnyNumber | Uint8Array, delayPeriod: BlockNumber | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Vec, u16, BlockNumber]>; /** * Initiate the process for recovering a recoverable account. * @@ -2033,7 +2033,7 @@ declare module '@polkadot/api/types/submittable' { * Total Complexity: O(F + X) * # **/ - initiateRecovery: AugmentedSubmittable<(account: AccountId | string | Uint8Array) => SubmittableExtrinsic>; + initiateRecovery: AugmentedSubmittable<(account: AccountId | string | Uint8Array) => SubmittableExtrinsic, [AccountId]>; /** * Remove the recovery process for your account. Recovered accounts are still accessible. * @@ -2057,7 +2057,7 @@ declare module '@polkadot/api/types/submittable' { * Total Complexity: O(F + X) * # **/ - removeRecovery: AugmentedSubmittable<() => SubmittableExtrinsic>; + removeRecovery: AugmentedSubmittable<() => SubmittableExtrinsic, []>; /** * Allow ROOT to bypass the recovery process and set an a rescuer account * for a lost account directly. @@ -2073,7 +2073,7 @@ declare module '@polkadot/api/types/submittable' { * - One event * # **/ - setRecovered: AugmentedSubmittable<(lost: AccountId | string | Uint8Array, rescuer: AccountId | string | Uint8Array) => SubmittableExtrinsic>; + setRecovered: AugmentedSubmittable<(lost: AccountId | string | Uint8Array, rescuer: AccountId | string | Uint8Array) => SubmittableExtrinsic, [AccountId, AccountId]>; /** * Allow a "friend" of a recoverable account to vouch for an active recovery * process for that account. @@ -2101,7 +2101,7 @@ declare module '@polkadot/api/types/submittable' { * Total Complexity: O(F + logF + V + logV) * # **/ - vouchRecovery: AugmentedSubmittable<(lost: AccountId | string | Uint8Array, rescuer: AccountId | string | Uint8Array) => SubmittableExtrinsic>; + vouchRecovery: AugmentedSubmittable<(lost: AccountId | string | Uint8Array, rescuer: AccountId | string | Uint8Array) => SubmittableExtrinsic, [AccountId, AccountId]>; }; scheduler: { [key: string]: SubmittableExtrinsicFunction; @@ -2117,7 +2117,7 @@ declare module '@polkadot/api/types/submittable' { * - Will use base weight of 100 which should be good for up to 30 scheduled calls * # **/ - cancel: AugmentedSubmittable<(when: BlockNumber | AnyNumber | Uint8Array, index: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + cancel: AugmentedSubmittable<(when: BlockNumber | AnyNumber | Uint8Array, index: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [BlockNumber, u32]>; /** * Cancel a named scheduled task. * @@ -2130,7 +2130,7 @@ declare module '@polkadot/api/types/submittable' { * - Will use base weight of 100 which should be good for up to 30 scheduled calls * # **/ - cancelNamed: AugmentedSubmittable<(id: Bytes | string | Uint8Array) => SubmittableExtrinsic>; + cancelNamed: AugmentedSubmittable<(id: Bytes | string | Uint8Array) => SubmittableExtrinsic, [Bytes]>; /** * Anonymously schedule a task. * @@ -2143,7 +2143,7 @@ declare module '@polkadot/api/types/submittable' { * - Will use base weight of 25 which should be good for up to 30 scheduled calls * # **/ - schedule: AugmentedSubmittable<(when: BlockNumber | AnyNumber | Uint8Array, maybePeriodic: Option | null | object | string | Uint8Array, priority: Priority | AnyNumber | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic>; + schedule: AugmentedSubmittable<(when: BlockNumber | AnyNumber | Uint8Array, maybePeriodic: Option | null | object | string | Uint8Array, priority: Priority | AnyNumber | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic, [BlockNumber, Option, Priority, Call]>; /** * Anonymously schedule a task after a delay. * @@ -2151,7 +2151,7 @@ declare module '@polkadot/api/types/submittable' { * Same as [`schedule`]. * # **/ - scheduleAfter: AugmentedSubmittable<(after: BlockNumber | AnyNumber | Uint8Array, maybePeriodic: Option | null | object | string | Uint8Array, priority: Priority | AnyNumber | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic>; + scheduleAfter: AugmentedSubmittable<(after: BlockNumber | AnyNumber | Uint8Array, maybePeriodic: Option | null | object | string | Uint8Array, priority: Priority | AnyNumber | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic, [BlockNumber, Option, Priority, Call]>; /** * Schedule a named task. * @@ -2164,7 +2164,7 @@ declare module '@polkadot/api/types/submittable' { * - Will use base weight of 35 which should be good for more than 30 scheduled calls * # **/ - scheduleNamed: AugmentedSubmittable<(id: Bytes | string | Uint8Array, when: BlockNumber | AnyNumber | Uint8Array, maybePeriodic: Option | null | object | string | Uint8Array, priority: Priority | AnyNumber | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic>; + scheduleNamed: AugmentedSubmittable<(id: Bytes | string | Uint8Array, when: BlockNumber | AnyNumber | Uint8Array, maybePeriodic: Option | null | object | string | Uint8Array, priority: Priority | AnyNumber | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic, [Bytes, BlockNumber, Option, Priority, Call]>; /** * Schedule a named task after a delay. * @@ -2172,7 +2172,7 @@ declare module '@polkadot/api/types/submittable' { * Same as [`schedule_named`]. * # **/ - scheduleNamedAfter: AugmentedSubmittable<(id: Bytes | string | Uint8Array, after: BlockNumber | AnyNumber | Uint8Array, maybePeriodic: Option | null | object | string | Uint8Array, priority: Priority | AnyNumber | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic>; + scheduleNamedAfter: AugmentedSubmittable<(id: Bytes | string | Uint8Array, after: BlockNumber | AnyNumber | Uint8Array, maybePeriodic: Option | null | object | string | Uint8Array, priority: Priority | AnyNumber | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic, [Bytes, BlockNumber, Option, Priority, Call]>; }; session: { [key: string]: SubmittableExtrinsicFunction; @@ -2190,7 +2190,7 @@ declare module '@polkadot/api/types/submittable' { * - DbWrites per key id: `KeyOwnder` * # **/ - purgeKeys: AugmentedSubmittable<() => SubmittableExtrinsic>; + purgeKeys: AugmentedSubmittable<() => SubmittableExtrinsic, []>; /** * Sets the session key(s) of the function caller to `keys`. * Allows an account to set its session key prior to becoming a validator. @@ -2207,7 +2207,7 @@ declare module '@polkadot/api/types/submittable' { * - DbWrites per key id: `KeyOwner` * # **/ - setKeys: AugmentedSubmittable<(keys: Keys, proof: Bytes | string | Uint8Array) => SubmittableExtrinsic>; + setKeys: AugmentedSubmittable<(keys: Keys, proof: Bytes | string | Uint8Array) => SubmittableExtrinsic, [Keys, Bytes]>; }; society: { [key: string]: SubmittableExtrinsicFunction; @@ -2246,7 +2246,7 @@ declare module '@polkadot/api/types/submittable' { * Total Complexity: O(M + B + C + logM + logB + X) * # **/ - bid: AugmentedSubmittable<(value: BalanceOf | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + bid: AugmentedSubmittable<(value: BalanceOf | AnyNumber | Uint8Array) => SubmittableExtrinsic, [BalanceOf]>; /** * As a member, vote on the defender. * @@ -2265,7 +2265,7 @@ declare module '@polkadot/api/types/submittable' { * Total Complexity: O(M + logM) * # **/ - defenderVote: AugmentedSubmittable<(approve: bool | boolean | Uint8Array) => SubmittableExtrinsic>; + defenderVote: AugmentedSubmittable<(approve: bool | boolean | Uint8Array) => SubmittableExtrinsic, [bool]>; /** * Found the society. * @@ -2287,7 +2287,7 @@ declare module '@polkadot/api/types/submittable' { * Total Complexity: O(1) * # **/ - found: AugmentedSubmittable<(founder: AccountId | string | Uint8Array, maxMembers: u32 | AnyNumber | Uint8Array, rules: Bytes | string | Uint8Array) => SubmittableExtrinsic>; + found: AugmentedSubmittable<(founder: AccountId | string | Uint8Array, maxMembers: u32 | AnyNumber | Uint8Array, rules: Bytes | string | Uint8Array) => SubmittableExtrinsic, [AccountId, u32, Bytes]>; /** * Allow suspended judgement origin to make judgement on a suspended candidate. * @@ -2330,7 +2330,7 @@ declare module '@polkadot/api/types/submittable' { * Total Complexity: O(M + logM + B + X) * # **/ - judgeSuspendedCandidate: AugmentedSubmittable<(who: AccountId | string | Uint8Array, judgement: SocietyJudgement | 'Rebid' | 'Reject' | 'Approve' | number | Uint8Array) => SubmittableExtrinsic>; + judgeSuspendedCandidate: AugmentedSubmittable<(who: AccountId | string | Uint8Array, judgement: SocietyJudgement | 'Rebid' | 'Reject' | 'Approve' | number | Uint8Array) => SubmittableExtrinsic, [AccountId, SocietyJudgement]>; /** * Allow suspension judgement origin to make judgement on a suspended member. * @@ -2360,7 +2360,7 @@ declare module '@polkadot/api/types/submittable' { * Total Complexity: O(M + logM + B) * # **/ - judgeSuspendedMember: AugmentedSubmittable<(who: AccountId | string | Uint8Array, forgive: bool | boolean | Uint8Array) => SubmittableExtrinsic>; + judgeSuspendedMember: AugmentedSubmittable<(who: AccountId | string | Uint8Array, forgive: bool | boolean | Uint8Array) => SubmittableExtrinsic, [AccountId, bool]>; /** * Transfer the first matured payout for the sender and remove it from the records. * @@ -2383,7 +2383,7 @@ declare module '@polkadot/api/types/submittable' { * Total Complexity: O(M + logM + P + X) * # **/ - payout: AugmentedSubmittable<() => SubmittableExtrinsic>; + payout: AugmentedSubmittable<() => SubmittableExtrinsic, []>; /** * Allows root origin to change the maximum number of members in society. * Max membership count must be greater than 1. @@ -2400,7 +2400,7 @@ declare module '@polkadot/api/types/submittable' { * Total Complexity: O(1) * # **/ - setMaxMembers: AugmentedSubmittable<(max: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + setMaxMembers: AugmentedSubmittable<(max: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u32]>; /** * A bidder can remove their bid for entry into society. * By doing so, they will have their candidate deposit returned or @@ -2422,7 +2422,7 @@ declare module '@polkadot/api/types/submittable' { * Total Complexity: O(B + X) * # **/ - unbid: AugmentedSubmittable<(pos: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + unbid: AugmentedSubmittable<(pos: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u32]>; /** * Annul the founding of the society. * @@ -2438,7 +2438,7 @@ declare module '@polkadot/api/types/submittable' { * Total Complexity: O(1) * # **/ - unfound: AugmentedSubmittable<() => SubmittableExtrinsic>; + unfound: AugmentedSubmittable<() => SubmittableExtrinsic, []>; /** * As a vouching member, unvouch a bid. This only works while vouched user is * only a bidder (and not a candidate). @@ -2458,7 +2458,7 @@ declare module '@polkadot/api/types/submittable' { * Total Complexity: O(B) * # **/ - unvouch: AugmentedSubmittable<(pos: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + unvouch: AugmentedSubmittable<(pos: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u32]>; /** * As a member, vote on a candidate. * @@ -2480,7 +2480,7 @@ declare module '@polkadot/api/types/submittable' { * Total Complexity: O(M + logM + C) * # **/ - vote: AugmentedSubmittable<(candidate: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, approve: bool | boolean | Uint8Array) => SubmittableExtrinsic>; + vote: AugmentedSubmittable<(candidate: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, approve: bool | boolean | Uint8Array) => SubmittableExtrinsic, [LookupSource, bool]>; /** * As a member, vouch for someone to join society by placing a bid on their behalf. * @@ -2527,7 +2527,7 @@ declare module '@polkadot/api/types/submittable' { * Total Complexity: O(M + B + C + logM + logB + X) * # **/ - vouch: AugmentedSubmittable<(who: AccountId | string | Uint8Array, value: BalanceOf | AnyNumber | Uint8Array, tip: BalanceOf | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + vouch: AugmentedSubmittable<(who: AccountId | string | Uint8Array, value: BalanceOf | AnyNumber | Uint8Array, tip: BalanceOf | AnyNumber | Uint8Array) => SubmittableExtrinsic, [AccountId, BalanceOf, BalanceOf]>; }; staking: { [key: string]: SubmittableExtrinsicFunction; @@ -2555,7 +2555,7 @@ declare module '@polkadot/api/types/submittable' { * - Write: Bonded, Payee, [Origin Account], Locks, Ledger * # **/ - bond: AugmentedSubmittable<(controller: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, value: Compact | AnyNumber | Uint8Array, payee: RewardDestination | { Staked: any } | { Stash: any } | { Controller: any } | { Account: any } | string | Uint8Array) => SubmittableExtrinsic>; + bond: AugmentedSubmittable<(controller: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, value: Compact | AnyNumber | Uint8Array, payee: RewardDestination | { Staked: any } | { Stash: any } | { Controller: any } | { Account: any } | string | Uint8Array) => SubmittableExtrinsic, [LookupSource, Compact, RewardDestination]>; /** * Add some extra amount that have appeared in the stash `free_balance` into the balance up * for staking. @@ -2579,7 +2579,7 @@ declare module '@polkadot/api/types/submittable' { * - Write: [Origin Account], Locks, Ledger * # **/ - bondExtra: AugmentedSubmittable<(maxAdditional: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + bondExtra: AugmentedSubmittable<(maxAdditional: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Compact]>; /** * Cancel enactment of a deferred slash. * @@ -2595,7 +2595,7 @@ declare module '@polkadot/api/types/submittable' { * - Write: Unapplied Slashes * # **/ - cancelDeferredSlash: AugmentedSubmittable<(era: EraIndex | AnyNumber | Uint8Array, slashIndices: Vec | (u32 | AnyNumber | Uint8Array)[]) => SubmittableExtrinsic>; + cancelDeferredSlash: AugmentedSubmittable<(era: EraIndex | AnyNumber | Uint8Array, slashIndices: Vec | (u32 | AnyNumber | Uint8Array)[]) => SubmittableExtrinsic, [EraIndex, Vec]>; /** * Declare no desire to either validate or nominate. * @@ -2615,7 +2615,7 @@ declare module '@polkadot/api/types/submittable' { * - Write: Validators, Nominators * # **/ - chill: AugmentedSubmittable<() => SubmittableExtrinsic>; + chill: AugmentedSubmittable<() => SubmittableExtrinsic, []>; /** * Force there to be a new era at the end of the next session. After this, it will be * reset to normal (non-forced) behaviour. @@ -2628,7 +2628,7 @@ declare module '@polkadot/api/types/submittable' { * - Write ForceEra * # **/ - forceNewEra: AugmentedSubmittable<() => SubmittableExtrinsic>; + forceNewEra: AugmentedSubmittable<() => SubmittableExtrinsic, []>; /** * Force there to be a new era at the end of sessions indefinitely. * @@ -2639,7 +2639,7 @@ declare module '@polkadot/api/types/submittable' { * - Write: ForceEra * # **/ - forceNewEraAlways: AugmentedSubmittable<() => SubmittableExtrinsic>; + forceNewEraAlways: AugmentedSubmittable<() => SubmittableExtrinsic, []>; /** * Force there to be no new eras indefinitely. * @@ -2651,7 +2651,7 @@ declare module '@polkadot/api/types/submittable' { * - Write: ForceEra * # **/ - forceNoEras: AugmentedSubmittable<() => SubmittableExtrinsic>; + forceNoEras: AugmentedSubmittable<() => SubmittableExtrinsic, []>; /** * Force a current staker to become completely unstaked, immediately. * @@ -2664,7 +2664,7 @@ declare module '@polkadot/api/types/submittable' { * Writes Each: SpanSlash * S * # **/ - forceUnstake: AugmentedSubmittable<(stash: AccountId | string | Uint8Array, numSlashingSpans: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + forceUnstake: AugmentedSubmittable<(stash: AccountId | string | Uint8Array, numSlashingSpans: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [AccountId, u32]>; /** * Increments the ideal number of validators. * @@ -2674,7 +2674,7 @@ declare module '@polkadot/api/types/submittable' { * Same as [`set_validator_count`]. * # **/ - increaseValidatorCount: AugmentedSubmittable<(additional: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + increaseValidatorCount: AugmentedSubmittable<(additional: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Compact]>; /** * Declare the desire to nominate `targets` for the origin controller. * @@ -2696,7 +2696,7 @@ declare module '@polkadot/api/types/submittable' { * - Writes: Validators, Nominators * # **/ - nominate: AugmentedSubmittable<(targets: Vec | (LookupSource | Address | AccountId | AccountIndex | string | Uint8Array)[]) => SubmittableExtrinsic>; + nominate: AugmentedSubmittable<(targets: Vec | (LookupSource | Address | AccountId | AccountIndex | string | Uint8Array)[]) => SubmittableExtrinsic, [Vec]>; /** * Pay out all the stakers behind a single validator for a single era. * @@ -2727,7 +2727,7 @@ declare module '@polkadot/api/types/submittable' { * Paying even a dead controller is cheaper weight-wise. We don't do any refunds here. * # **/ - payoutStakers: AugmentedSubmittable<(validatorStash: AccountId | string | Uint8Array, era: EraIndex | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + payoutStakers: AugmentedSubmittable<(validatorStash: AccountId | string | Uint8Array, era: EraIndex | AnyNumber | Uint8Array) => SubmittableExtrinsic, [AccountId, EraIndex]>; /** * Remove all data structure concerning a staker/stash once its balance is zero. * This is essentially equivalent to `withdraw_unbonded` except it can be called by anyone @@ -2745,7 +2745,7 @@ declare module '@polkadot/api/types/submittable' { * - Writes Each: SpanSlash * S * # **/ - reapStash: AugmentedSubmittable<(stash: AccountId | string | Uint8Array, numSlashingSpans: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + reapStash: AugmentedSubmittable<(stash: AccountId | string | Uint8Array, numSlashingSpans: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [AccountId, u32]>; /** * Rebond a portion of the stash scheduled to be unlocked. * @@ -2762,7 +2762,7 @@ declare module '@polkadot/api/types/submittable' { * - Writes: [Origin Account], Locks, Ledger * # **/ - rebond: AugmentedSubmittable<(value: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + rebond: AugmentedSubmittable<(value: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Compact]>; /** * Scale up the ideal number of validators by a factor. * @@ -2772,7 +2772,7 @@ declare module '@polkadot/api/types/submittable' { * Same as [`set_validator_count`]. * # **/ - scaleValidatorCount: AugmentedSubmittable<(factor: Percent | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + scaleValidatorCount: AugmentedSubmittable<(factor: Percent | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Percent]>; /** * (Re-)set the controller of a stash. * @@ -2791,7 +2791,7 @@ declare module '@polkadot/api/types/submittable' { * - Write: Bonded, Ledger New Controller, Ledger Old Controller * # **/ - setController: AugmentedSubmittable<(controller: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array) => SubmittableExtrinsic>; + setController: AugmentedSubmittable<(controller: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array) => SubmittableExtrinsic, [LookupSource]>; /** * Set `HistoryDepth` value. This function will delete any history information * when `HistoryDepth` is reduced. @@ -2815,7 +2815,7 @@ declare module '@polkadot/api/types/submittable' { * - Writes Each: ErasValidatorReward, ErasRewardPoints, ErasTotalStake, ErasStartSessionIndex * # **/ - setHistoryDepth: AugmentedSubmittable<(newHistoryDepth: Compact | AnyNumber | Uint8Array, eraItemsDeleted: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + setHistoryDepth: AugmentedSubmittable<(newHistoryDepth: Compact | AnyNumber | Uint8Array, eraItemsDeleted: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Compact, Compact]>; /** * Set the validators who cannot be slashed (if any). * @@ -2826,7 +2826,7 @@ declare module '@polkadot/api/types/submittable' { * - Write: Invulnerables * # **/ - setInvulnerables: AugmentedSubmittable<(invulnerables: Vec | (AccountId | string | Uint8Array)[]) => SubmittableExtrinsic>; + setInvulnerables: AugmentedSubmittable<(invulnerables: Vec | (AccountId | string | Uint8Array)[]) => SubmittableExtrinsic, [Vec]>; /** * (Re-)set the payment target for a controller. * @@ -2845,7 +2845,7 @@ declare module '@polkadot/api/types/submittable' { * - Write: Payee * # **/ - setPayee: AugmentedSubmittable<(payee: RewardDestination | { Staked: any } | { Stash: any } | { Controller: any } | { Account: any } | string | Uint8Array) => SubmittableExtrinsic>; + setPayee: AugmentedSubmittable<(payee: RewardDestination | { Staked: any } | { Stash: any } | { Controller: any } | { Account: any } | string | Uint8Array) => SubmittableExtrinsic, [RewardDestination]>; /** * Sets the ideal number of validators. * @@ -2856,7 +2856,7 @@ declare module '@polkadot/api/types/submittable' { * Write: Validator Count * # **/ - setValidatorCount: AugmentedSubmittable<(updated: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + setValidatorCount: AugmentedSubmittable<(updated: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Compact]>; /** * Submit an election result to the chain. If the solution: * @@ -2908,7 +2908,7 @@ declare module '@polkadot/api/types/submittable' { * - Worse solution is retraced in pre-dispatch-checks which sets its own weight. * # **/ - submitElectionSolution: AugmentedSubmittable<(winners: Vec | (ValidatorIndex | AnyNumber | Uint8Array)[], compact: CompactAssignments | { votes1?: any; votes2?: any; votes3?: any; votes4?: any; votes5?: any; votes6?: any; votes7?: any; votes8?: any; votes9?: any; votes10?: any; votes11?: any; votes12?: any; votes13?: any; votes14?: any; votes15?: any; votes16?: any } | string | Uint8Array, score: ElectionScore, era: EraIndex | AnyNumber | Uint8Array, size: ElectionSize | { validators?: any; nominators?: any } | string | Uint8Array) => SubmittableExtrinsic>; + submitElectionSolution: AugmentedSubmittable<(winners: Vec | (ValidatorIndex | AnyNumber | Uint8Array)[], compact: CompactAssignments | { votes1?: any; votes2?: any; votes3?: any; votes4?: any; votes5?: any; votes6?: any; votes7?: any; votes8?: any; votes9?: any; votes10?: any; votes11?: any; votes12?: any; votes13?: any; votes14?: any; votes15?: any; votes16?: any } | string | Uint8Array, score: ElectionScore, era: EraIndex | AnyNumber | Uint8Array, size: ElectionSize | { validators?: any; nominators?: any } | string | Uint8Array) => SubmittableExtrinsic, [Vec, CompactAssignments, ElectionScore, EraIndex, ElectionSize]>; /** * Unsigned version of `submit_election_solution`. * @@ -2920,7 +2920,7 @@ declare module '@polkadot/api/types/submittable' { * See [`submit_election_solution`]. * # **/ - submitElectionSolutionUnsigned: AugmentedSubmittable<(winners: Vec | (ValidatorIndex | AnyNumber | Uint8Array)[], compact: CompactAssignments | { votes1?: any; votes2?: any; votes3?: any; votes4?: any; votes5?: any; votes6?: any; votes7?: any; votes8?: any; votes9?: any; votes10?: any; votes11?: any; votes12?: any; votes13?: any; votes14?: any; votes15?: any; votes16?: any } | string | Uint8Array, score: ElectionScore, era: EraIndex | AnyNumber | Uint8Array, size: ElectionSize | { validators?: any; nominators?: any } | string | Uint8Array) => SubmittableExtrinsic>; + submitElectionSolutionUnsigned: AugmentedSubmittable<(winners: Vec | (ValidatorIndex | AnyNumber | Uint8Array)[], compact: CompactAssignments | { votes1?: any; votes2?: any; votes3?: any; votes4?: any; votes5?: any; votes6?: any; votes7?: any; votes8?: any; votes9?: any; votes10?: any; votes11?: any; votes12?: any; votes13?: any; votes14?: any; votes15?: any; votes16?: any } | string | Uint8Array, score: ElectionScore, era: EraIndex | AnyNumber | Uint8Array, size: ElectionSize | { validators?: any; nominators?: any } | string | Uint8Array) => SubmittableExtrinsic, [Vec, CompactAssignments, ElectionScore, EraIndex, ElectionSize]>; /** * Schedule a portion of the stash to be unlocked ready for transfer out after the bond * period ends. If this leaves an amount actively bonded less than @@ -2955,7 +2955,7 @@ declare module '@polkadot/api/types/submittable' { * - Write: Locks, Ledger, BalanceOf Stash, * **/ - unbond: AugmentedSubmittable<(value: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + unbond: AugmentedSubmittable<(value: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Compact]>; /** * Declare the desire to validate for the origin controller. * @@ -2975,7 +2975,7 @@ declare module '@polkadot/api/types/submittable' { * - Write: Nominators, Validators * # **/ - validate: AugmentedSubmittable<(prefs: ValidatorPrefs | { commission?: any } | string | Uint8Array) => SubmittableExtrinsic>; + validate: AugmentedSubmittable<(prefs: ValidatorPrefs | { commission?: any } | string | Uint8Array) => SubmittableExtrinsic, [ValidatorPrefs]>; /** * Remove any unlocked chunks from the `unlocking` queue from our management. * @@ -3009,7 +3009,7 @@ declare module '@polkadot/api/types/submittable' { * NOTE: Weight annotation is the kill scenario, we refund otherwise. * # **/ - withdrawUnbonded: AugmentedSubmittable<(numSlashingSpans: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + withdrawUnbonded: AugmentedSubmittable<(numSlashingSpans: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u32]>; }; sudo: { [key: string]: SubmittableExtrinsicFunction; @@ -3024,7 +3024,7 @@ declare module '@polkadot/api/types/submittable' { * - One DB change. * # **/ - setKey: AugmentedSubmittable<(updated: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array) => SubmittableExtrinsic>; + setKey: AugmentedSubmittable<(updated: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array) => SubmittableExtrinsic, [LookupSource]>; /** * Authenticates the sudo key and dispatches a function call with `Root` origin. * @@ -3037,7 +3037,7 @@ declare module '@polkadot/api/types/submittable' { * - Weight of derivative `call` execution + 10,000. * # **/ - sudo: AugmentedSubmittable<(call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic>; + sudo: AugmentedSubmittable<(call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic, [Call]>; /** * Authenticates the sudo key and dispatches a function call with `Signed` origin from * a given account. @@ -3051,7 +3051,7 @@ declare module '@polkadot/api/types/submittable' { * - Weight of derivative `call` execution + 10,000. * # **/ - sudoAs: AugmentedSubmittable<(who: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic>; + sudoAs: AugmentedSubmittable<(who: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic, [LookupSource, 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 @@ -3064,14 +3064,14 @@ declare module '@polkadot/api/types/submittable' { * - The weight of this call is defined by the caller. * # **/ - sudoUncheckedWeight: AugmentedSubmittable<(call: Call | { callIndex?: any; args?: any } | string | Uint8Array, weight: Weight | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + sudoUncheckedWeight: AugmentedSubmittable<(call: Call | { callIndex?: any; args?: any } | string | Uint8Array, weight: Weight | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Call, Weight]>; }; system: { [key: string]: SubmittableExtrinsicFunction; /** * A dispatch that will fill the block weight up to the given ratio. **/ - fillBlock: AugmentedSubmittable<(ratio: Perbill | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + fillBlock: AugmentedSubmittable<(ratio: Perbill | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Perbill]>; /** * Kill all storage items with a key that starts with the given prefix. * @@ -3085,7 +3085,7 @@ declare module '@polkadot/api/types/submittable' { * - Writes: Number of subkeys + 1 * # **/ - killPrefix: AugmentedSubmittable<(prefix: Key | string | Uint8Array, subkeys: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + killPrefix: AugmentedSubmittable<(prefix: Key | string | Uint8Array, subkeys: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Key, u32]>; /** * Kill some items from storage. * @@ -3096,7 +3096,7 @@ declare module '@polkadot/api/types/submittable' { * - Writes: Number of items * # **/ - killStorage: AugmentedSubmittable<(keys: Vec | (Key | string | Uint8Array)[]) => SubmittableExtrinsic>; + killStorage: AugmentedSubmittable<(keys: Vec | (Key | string | Uint8Array)[]) => SubmittableExtrinsic, [Vec]>; /** * Make some on-chain remark. * @@ -3106,7 +3106,7 @@ declare module '@polkadot/api/types/submittable' { * - No DB operations. * # **/ - remark: AugmentedSubmittable<(remark: Bytes | string | Uint8Array) => SubmittableExtrinsic>; + remark: AugmentedSubmittable<(remark: Bytes | string | Uint8Array) => SubmittableExtrinsic, [Bytes]>; /** * Set the new changes trie configuration. * @@ -3119,7 +3119,7 @@ declare module '@polkadot/api/types/submittable' { * - Writes: Changes Trie, System Digest * # **/ - setChangesTrieConfig: AugmentedSubmittable<(changesTrieConfig: Option | null | object | string | Uint8Array) => SubmittableExtrinsic>; + setChangesTrieConfig: AugmentedSubmittable<(changesTrieConfig: Option | null | object | string | Uint8Array) => SubmittableExtrinsic, [Option]>; /** * Set the new runtime code. * @@ -3132,7 +3132,7 @@ declare module '@polkadot/api/types/submittable' { * We will treat this as a full block. * # **/ - setCode: AugmentedSubmittable<(code: Bytes | string | Uint8Array) => SubmittableExtrinsic>; + setCode: AugmentedSubmittable<(code: Bytes | string | Uint8Array) => SubmittableExtrinsic, [Bytes]>; /** * Set the new runtime code without doing any checks of the given `code`. * @@ -3143,7 +3143,7 @@ declare module '@polkadot/api/types/submittable' { * The weight of this function is dependent on the runtime. We will treat this as a full block. * # **/ - setCodeWithoutChecks: AugmentedSubmittable<(code: Bytes | string | Uint8Array) => SubmittableExtrinsic>; + setCodeWithoutChecks: AugmentedSubmittable<(code: Bytes | string | Uint8Array) => SubmittableExtrinsic, [Bytes]>; /** * Set the number of pages in the WebAssembly environment's heap. * @@ -3154,7 +3154,7 @@ declare module '@polkadot/api/types/submittable' { * - 1 write to HEAP_PAGES * # **/ - setHeapPages: AugmentedSubmittable<(pages: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + setHeapPages: AugmentedSubmittable<(pages: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u64]>; /** * Set some items of storage. * @@ -3165,7 +3165,7 @@ declare module '@polkadot/api/types/submittable' { * - Writes: Number of items * # **/ - setStorage: AugmentedSubmittable<(items: Vec | (KeyValue)[]) => SubmittableExtrinsic>; + setStorage: AugmentedSubmittable<(items: Vec | (KeyValue)[]) => SubmittableExtrinsic, [Vec]>; /** * Kill the sending account, assuming there are no references outstanding and the composite * data is equal to its default value. @@ -3178,7 +3178,7 @@ declare module '@polkadot/api/types/submittable' { * No DB Read or Write operations because caller is already in overlay * # **/ - suicide: AugmentedSubmittable<() => SubmittableExtrinsic>; + suicide: AugmentedSubmittable<() => SubmittableExtrinsic, []>; }; technicalCommittee: { [key: string]: SubmittableExtrinsicFunction; @@ -3214,7 +3214,7 @@ declare module '@polkadot/api/types/submittable' { * - up to 3 events * # **/ - close: AugmentedSubmittable<(proposalHash: Hash | string | Uint8Array, index: Compact | AnyNumber | Uint8Array, proposalWeightBound: Compact | AnyNumber | Uint8Array, lengthBound: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + close: AugmentedSubmittable<(proposalHash: Hash | string | Uint8Array, index: Compact | AnyNumber | Uint8Array, proposalWeightBound: Compact | AnyNumber | Uint8Array, lengthBound: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Hash, Compact, Compact, Compact]>; /** * Disapprove a proposal, close, and remove it from the system, regardless of its current state. * @@ -3230,7 +3230,7 @@ declare module '@polkadot/api/types/submittable' { * * Writes: Voting, Proposals, ProposalOf * # **/ - disapproveProposal: AugmentedSubmittable<(proposalHash: Hash | string | Uint8Array) => SubmittableExtrinsic>; + disapproveProposal: AugmentedSubmittable<(proposalHash: Hash | string | Uint8Array) => SubmittableExtrinsic, [Hash]>; /** * Dispatch a proposal from a member using the `Member` origin. * @@ -3243,7 +3243,7 @@ declare module '@polkadot/api/types/submittable' { * - 1 event * # **/ - execute: AugmentedSubmittable<(proposal: Proposal | { callIndex?: any; args?: any } | string | Uint8Array, lengthBound: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + execute: AugmentedSubmittable<(proposal: Proposal | { callIndex?: any; args?: any } | string | Uint8Array, lengthBound: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Proposal, Compact]>; /** * Add a new proposal to either be voted on or executed directly. * @@ -3273,7 +3273,7 @@ declare module '@polkadot/api/types/submittable' { * - 1 event * # **/ - propose: AugmentedSubmittable<(threshold: Compact | AnyNumber | Uint8Array, proposal: Proposal | { callIndex?: any; args?: any } | string | Uint8Array, lengthBound: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + propose: AugmentedSubmittable<(threshold: Compact | AnyNumber | Uint8Array, proposal: Proposal | { callIndex?: any; args?: any } | string | Uint8Array, lengthBound: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Compact, Proposal, Compact]>; /** * Set the collective's membership. * @@ -3300,7 +3300,7 @@ declare module '@polkadot/api/types/submittable' { * - 1 storage write (codec `O(1)`) for deleting the old `prime` and setting the new one * # **/ - setMembers: AugmentedSubmittable<(newMembers: Vec | (AccountId | string | Uint8Array)[], prime: Option | null | object | string | Uint8Array, oldCount: MemberCount | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + setMembers: AugmentedSubmittable<(newMembers: Vec | (AccountId | string | Uint8Array)[], prime: Option | null | object | string | Uint8Array, oldCount: MemberCount | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Vec, Option, MemberCount]>; /** * Add an aye or nay vote for the sender to the given proposal. * @@ -3317,7 +3317,7 @@ declare module '@polkadot/api/types/submittable' { * - 1 event * # **/ - vote: AugmentedSubmittable<(proposal: Hash | string | Uint8Array, index: Compact | AnyNumber | Uint8Array, approve: bool | boolean | Uint8Array) => SubmittableExtrinsic>; + vote: AugmentedSubmittable<(proposal: Hash | string | Uint8Array, index: Compact | AnyNumber | Uint8Array, approve: bool | boolean | Uint8Array) => SubmittableExtrinsic, [Hash, Compact, bool]>; }; technicalMembership: { [key: string]: SubmittableExtrinsicFunction; @@ -3326,7 +3326,7 @@ declare module '@polkadot/api/types/submittable' { * * May only be called from `T::AddOrigin`. **/ - addMember: AugmentedSubmittable<(who: AccountId | string | Uint8Array) => SubmittableExtrinsic>; + addMember: AugmentedSubmittable<(who: AccountId | string | Uint8Array) => SubmittableExtrinsic, [AccountId]>; /** * Swap out the sending member for some other key `new`. * @@ -3334,32 +3334,32 @@ declare module '@polkadot/api/types/submittable' { * * Prime membership is passed from the origin account to `new`, if extant. **/ - changeKey: AugmentedSubmittable<(updated: AccountId | string | Uint8Array) => SubmittableExtrinsic>; + changeKey: AugmentedSubmittable<(updated: AccountId | string | Uint8Array) => SubmittableExtrinsic, [AccountId]>; /** * Remove the prime member if it exists. * * May only be called from `T::PrimeOrigin`. **/ - clearPrime: AugmentedSubmittable<() => SubmittableExtrinsic>; + clearPrime: AugmentedSubmittable<() => SubmittableExtrinsic, []>; /** * Remove a member `who` from the set. * * May only be called from `T::RemoveOrigin`. **/ - removeMember: AugmentedSubmittable<(who: AccountId | string | Uint8Array) => SubmittableExtrinsic>; + removeMember: AugmentedSubmittable<(who: AccountId | string | Uint8Array) => SubmittableExtrinsic, [AccountId]>; /** * Change the membership to a new set, disregarding the existing membership. Be nice and * pass `members` pre-sorted. * * May only be called from `T::ResetOrigin`. **/ - resetMembers: AugmentedSubmittable<(members: Vec | (AccountId | string | Uint8Array)[]) => SubmittableExtrinsic>; + resetMembers: AugmentedSubmittable<(members: Vec | (AccountId | string | Uint8Array)[]) => SubmittableExtrinsic, [Vec]>; /** * Set the prime member. Must be a current member. * * May only be called from `T::PrimeOrigin`. **/ - setPrime: AugmentedSubmittable<(who: AccountId | string | Uint8Array) => SubmittableExtrinsic>; + setPrime: AugmentedSubmittable<(who: AccountId | string | Uint8Array) => SubmittableExtrinsic, [AccountId]>; /** * Swap out one member `remove` for another `add`. * @@ -3367,7 +3367,7 @@ declare module '@polkadot/api/types/submittable' { * * Prime membership is *not* passed from `remove` to `add`, if extant. **/ - swapMember: AugmentedSubmittable<(remove: AccountId | string | Uint8Array, add: AccountId | string | Uint8Array) => SubmittableExtrinsic>; + swapMember: AugmentedSubmittable<(remove: AccountId | string | Uint8Array, add: AccountId | string | Uint8Array) => SubmittableExtrinsic, [AccountId, AccountId]>; }; timestamp: { [key: string]: SubmittableExtrinsicFunction; @@ -3388,7 +3388,7 @@ declare module '@polkadot/api/types/submittable' { * - 1 event handler `on_timestamp_set`. Must be `O(1)`. * # **/ - set: AugmentedSubmittable<(now: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + set: AugmentedSubmittable<(now: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Compact]>; }; tips: { [key: string]: SubmittableExtrinsicFunction; @@ -3411,7 +3411,7 @@ declare module '@polkadot/api/types/submittable' { * - DbWrites: `Reasons`, `Tips`, `Tippers`, `tip finder` * # **/ - closeTip: AugmentedSubmittable<(hash: Hash | string | Uint8Array) => SubmittableExtrinsic>; + closeTip: AugmentedSubmittable<(hash: Hash | string | Uint8Array) => SubmittableExtrinsic, [Hash]>; /** * Report something `reason` that deserves a tip and claim any eventual the finder's fee. * @@ -3433,7 +3433,7 @@ declare module '@polkadot/api/types/submittable' { * - DbWrites: `Reasons`, `Tips` * # **/ - reportAwesome: AugmentedSubmittable<(reason: Bytes | string | Uint8Array, who: AccountId | string | Uint8Array) => SubmittableExtrinsic>; + reportAwesome: AugmentedSubmittable<(reason: Bytes | string | Uint8Array, who: AccountId | string | Uint8Array) => SubmittableExtrinsic, [Bytes, AccountId]>; /** * Retract a prior tip-report from `report_awesome`, and cancel the process of tipping. * @@ -3455,7 +3455,7 @@ declare module '@polkadot/api/types/submittable' { * - DbWrites: `Reasons`, `Tips`, `origin account` * # **/ - retractTip: AugmentedSubmittable<(hash: Hash | string | Uint8Array) => SubmittableExtrinsic>; + retractTip: AugmentedSubmittable<(hash: Hash | string | Uint8Array) => SubmittableExtrinsic, [Hash]>; /** * Declare a tip value for an already-open tip. * @@ -3483,7 +3483,7 @@ declare module '@polkadot/api/types/submittable' { * - DbWrites: `Tips` * # **/ - tip: AugmentedSubmittable<(hash: Hash | string | Uint8Array, tipValue: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + tip: AugmentedSubmittable<(hash: Hash | string | Uint8Array, tipValue: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Hash, Compact]>; /** * Give a tip for something new; no finder's fee will be taken. * @@ -3508,7 +3508,7 @@ declare module '@polkadot/api/types/submittable' { * - DbWrites: `Reasons`, `Tips` * # **/ - tipNew: AugmentedSubmittable<(reason: Bytes | string | Uint8Array, who: AccountId | string | Uint8Array, tipValue: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + tipNew: AugmentedSubmittable<(reason: Bytes | string | Uint8Array, who: AccountId | string | Uint8Array, tipValue: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Bytes, AccountId, Compact]>; }; treasury: { [key: string]: SubmittableExtrinsicFunction; @@ -3524,7 +3524,7 @@ declare module '@polkadot/api/types/submittable' { * - DbWrite: `Approvals` * # **/ - approveProposal: AugmentedSubmittable<(proposalId: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + approveProposal: AugmentedSubmittable<(proposalId: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Compact]>; /** * Put forward a suggestion for spending. A deposit proportional to the value * is reserved and slashed if the proposal is rejected. It is returned once the @@ -3536,7 +3536,7 @@ declare module '@polkadot/api/types/submittable' { * - DbWrites: `ProposalCount`, `Proposals`, `origin account` * # **/ - proposeSpend: AugmentedSubmittable<(value: Compact | AnyNumber | Uint8Array, beneficiary: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array) => SubmittableExtrinsic>; + proposeSpend: AugmentedSubmittable<(value: Compact | AnyNumber | Uint8Array, beneficiary: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array) => SubmittableExtrinsic, [Compact, LookupSource]>; /** * Reject a proposed spend. The original deposit will be slashed. * @@ -3548,7 +3548,7 @@ declare module '@polkadot/api/types/submittable' { * - DbWrites: `Proposals`, `rejected proposer account` * # **/ - rejectProposal: AugmentedSubmittable<(proposalId: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic>; + rejectProposal: AugmentedSubmittable<(proposalId: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Compact]>; }; utility: { [key: string]: SubmittableExtrinsicFunction; @@ -3567,7 +3567,7 @@ declare module '@polkadot/api/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>; + asDerivative: AugmentedSubmittable<(index: u16 | AnyNumber | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic, [u16, Call]>; /** * Send a batch of dispatch calls. * @@ -3588,7 +3588,7 @@ declare module '@polkadot/api/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>; + batch: AugmentedSubmittable<(calls: Vec | (Call | { callIndex?: any; args?: any } | 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. @@ -3604,7 +3604,7 @@ declare module '@polkadot/api/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>; + batchAll: AugmentedSubmittable<(calls: Vec | (Call | { callIndex?: any; args?: any } | string | Uint8Array)[]) => SubmittableExtrinsic, [Vec]>; }; vesting: { [key: string]: SubmittableExtrinsicFunction; @@ -3627,7 +3627,7 @@ declare module '@polkadot/api/types/submittable' { * - Writes: Vesting Storage, Balances Locks, Target Account, Source Account * # **/ - forceVestedTransfer: AugmentedSubmittable<(source: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, target: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, schedule: VestingInfo | { locked?: any; perBlock?: any; startingBlock?: any } | string | Uint8Array) => SubmittableExtrinsic>; + forceVestedTransfer: AugmentedSubmittable<(source: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, target: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, schedule: VestingInfo | { locked?: any; perBlock?: any; startingBlock?: any } | string | Uint8Array) => SubmittableExtrinsic, [LookupSource, LookupSource, VestingInfo]>; /** * Unlock any vested funds of the sender account. * @@ -3643,7 +3643,7 @@ declare module '@polkadot/api/types/submittable' { * - Writes: Vesting Storage, Balances Locks, [Sender Account] * # **/ - vest: AugmentedSubmittable<() => SubmittableExtrinsic>; + vest: AugmentedSubmittable<() => SubmittableExtrinsic, []>; /** * Unlock any vested funds of a `target` account. * @@ -3661,7 +3661,7 @@ declare module '@polkadot/api/types/submittable' { * - Writes: Vesting Storage, Balances Locks, Target Account * # **/ - vestOther: AugmentedSubmittable<(target: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array) => SubmittableExtrinsic>; + vestOther: AugmentedSubmittable<(target: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array) => SubmittableExtrinsic, [LookupSource]>; /** * Create a vested transfer. * @@ -3680,7 +3680,7 @@ declare module '@polkadot/api/types/submittable' { * - Writes: Vesting Storage, Balances Locks, Target Account, [Sender Account] * # **/ - vestedTransfer: AugmentedSubmittable<(target: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, schedule: VestingInfo | { locked?: any; perBlock?: any; startingBlock?: any } | string | Uint8Array) => SubmittableExtrinsic>; + vestedTransfer: AugmentedSubmittable<(target: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, schedule: VestingInfo | { locked?: any; perBlock?: any; startingBlock?: any } | string | Uint8Array) => SubmittableExtrinsic, [LookupSource, VestingInfo]>; }; } diff --git a/packages/api/src/base/Decorate.ts b/packages/api/src/base/Decorate.ts index 4266a251da..f9d9d39f34 100644 --- a/packages/api/src/base/Decorate.ts +++ b/packages/api/src/base/Decorate.ts @@ -6,9 +6,9 @@ import type { RpcInterface } from '@polkadot/rpc-core/types'; import type { Option, Raw, StorageKey, Text, u64 } from '@polkadot/types'; import type { Call, Hash, RuntimeVersion } from '@polkadot/types/interfaces'; import type { StorageEntry } from '@polkadot/types/primitive/types'; -import type { AnyFunction, CallFunction, Codec, CodecArg as Arg, DefinitionRpc, DefinitionRpcSub, InterfaceTypes, Registry, RegistryTypes } from '@polkadot/types/types'; +import type { AnyFunction, AnyTuple, CallFunction, Codec, CodecArg as Arg, DefinitionRpc, DefinitionRpcSub, IMethod, InterfaceTypes, IStorageKey, Registry, RegistryTypes } from '@polkadot/types/types'; import type { SubmittableExtrinsic } from '../submittable/types'; -import type { ApiInterfaceRx, ApiOptions, ApiTypes, DecoratedRpc, DecoratedRpcSection, DecorateMethod, PaginationOptions, QueryableConsts, QueryableModuleStorage, QueryableStorage, QueryableStorageEntry, QueryableStorageMulti, QueryableStorageMultiArg, SubmittableExtrinsicFunction, SubmittableExtrinsics, SubmittableModuleExtrinsics } from '../types'; +import type { ApiInterfaceRx, ApiOptions, ApiTypes, DecoratedErrors, DecoratedEvents, DecoratedRpc, DecoratedRpcSection, DecorateMethod, PaginationOptions, QueryableConsts, QueryableModuleStorage, QueryableStorage, QueryableStorageEntry, QueryableStorageMulti, QueryableStorageMultiArg, SubmittableExtrinsicFunction, SubmittableExtrinsics, SubmittableModuleExtrinsics } from '../types'; import BN from 'bn.js'; @@ -57,6 +57,10 @@ export abstract class Decorate extends Events { protected _derive?: ReturnType['_decorateDerive']>; + protected _errors: DecoratedErrors = {} as DecoratedErrors; + + protected _events: DecoratedEvents = {} as DecoratedEvents; + protected _extrinsics?: SubmittableExtrinsics; protected _extrinsicType: number = EXTRINSIC_DEFAULT_VERSION; @@ -195,6 +199,8 @@ export abstract class Decorate extends Events { // this API augmentObject('query', this._decorateStorage(decoratedMeta, this._decorateMethod), this._query, fromEmpty); augmentObject('consts', decoratedMeta.consts, this._consts, fromEmpty); + augmentObject('errors', decoratedMeta.errors, this._errors, fromEmpty); + augmentObject('events', decoratedMeta.events, this._events, fromEmpty); // rx augmentObject(null, this._decorateStorage(decoratedMeta, this._rxDecorateMethod), this._rx.query, fromEmpty); @@ -338,6 +344,10 @@ export abstract class Decorate extends Events { const decorated = (...params: Arg[]): SubmittableExtrinsic => creator(method(...params)); + // pass through the `.is` + decorated.is = (other: IMethod) => + method.is(other); + // eslint-disable-next-line @typescript-eslint/no-unsafe-return return this._decorateFunctionMeta(method as any, decorated as any) as unknown as SubmittableExtrinsicFunction; } @@ -371,6 +381,9 @@ export abstract class Decorate extends Events { decorated.hash = decorateMethod((arg1?: Arg, arg2?: Arg): Observable => this._rpcCore.state.getStorageHash(getArgs(arg1, arg2))); + decorated.is = (key: IStorageKey): key is IStorageKey => + key.section === creator.section && key.method === creator.method; + decorated.key = (arg1?: Arg, arg2?: Arg): string => u8aToHex(compactStripLength(creator(creator.meta.type.isDoubleMap ? [arg1, arg2] : arg1))[1]); diff --git a/packages/api/src/base/Getters.ts b/packages/api/src/base/Getters.ts index 54dec1cca8..c856cd50aa 100644 --- a/packages/api/src/base/Getters.ts +++ b/packages/api/src/base/Getters.ts @@ -5,7 +5,7 @@ import type { Metadata } from '@polkadot/metadata'; import type { RpcInterface } from '@polkadot/rpc-core/types'; import type { Text } from '@polkadot/types'; import type { Hash, RuntimeVersion } from '@polkadot/types/interfaces'; -import type { ApiInterfaceRx, ApiTypes, DecoratedRpc, QueryableConsts, QueryableStorage, QueryableStorageMulti, SubmittableExtrinsics } from '../types'; +import type { ApiInterfaceRx, ApiTypes, DecoratedErrors, DecoratedEvents, DecoratedRpc, QueryableConsts, QueryableStorage, QueryableStorageMulti, SubmittableExtrinsics } from '../types'; import { assertReturn } from '@polkadot/util'; @@ -54,6 +54,20 @@ export abstract class Getters extends Init { return assertResult(this._derive); } + /** + * @description Errors from metadata + */ + public get errors (): DecoratedErrors { + return assertResult(this._errors); + } + + /** + * @description Events from metadata + */ + public get events (): DecoratedEvents { + return assertResult(this._events); + } + /** * @description Returns the version of extrinsics in-use on this chain */ diff --git a/packages/api/src/checkTypes.manual.ts b/packages/api/src/checkTypes.manual.ts index ed36dcfc32..99a99af47a 100644 --- a/packages/api/src/checkTypes.manual.ts +++ b/packages/api/src/checkTypes.manual.ts @@ -3,8 +3,9 @@ // Simple non-runnable checks to test type definitions in the editor itself -import type { AccountId, Balance, Header, Index } from '@polkadot/types/interfaces'; -import type { IExtrinsic, IMethod } from '@polkadot/types/types'; +import type { StorageKey } from '@polkadot/types'; +import type { AccountId, Balance, DispatchError, EventRecord, Header, Index } from '@polkadot/types/interfaces'; +import type { AnyTuple, IExtrinsic, IMethod } from '@polkadot/types/types'; import { ApiPromise } from '@polkadot/api'; import { HeaderExtended } from '@polkadot/api-derive'; @@ -34,6 +35,39 @@ async function derive (api: ApiPromise): Promise { console.log('fees', fees); } +function errors (api: ApiPromise): void { + const someError = {} as DispatchError; + + // existing + console.log(api.errors.vesting.AmountLow.is(someError)); + + // non-existing error, existing module + console.log(api.errors.vesting.Something.is(someError)); + + // something random + console.log(api.errors.something.Random.is(someError)); +} + +function events (api: ApiPromise): void { + const eventRecord = {} as EventRecord; + + // existing + if (api.events.balances.Transfer.is(eventRecord)) { + // the types are correctly expanded + const [from, to, amount] = eventRecord.event.data; + + console.log(from.toHuman(), to.toHuman(), amount.toBn()); + } + + // something random + if (api.events.something.Random.is(eventRecord)) { + // the types are just codec + const [a, b] = eventRecord.event.data; + + console.log(a.toHuman(), b.toHuman()); + } +} + async function query (api: ApiPromise, pairs: TestKeyringMap): Promise { const intentions = await api.query.staking.bonded(); @@ -102,6 +136,16 @@ async function queryExtra (api: ApiPromise, pairs: TestKeyringMap): Promise `${hash.toHex()}: ${events.length} events`).join(', ')}`); + + // is + const key = {} as StorageKey; + + if (api.query.balances.account.is(key)) { + const [accountId] = key.args; + + // should be AccountId type + console.log(accountId.toHuman()); + } } async function rpc (api: ApiPromise): Promise { @@ -143,7 +187,7 @@ async function tx (api: ApiPromise, pairs: TestKeyringMap): Promise { // transfer, also allows for BigInt inputs here const transfer = api.tx.balances.transfer(pairs.bob.address, 123456789n); - console.log('transfer casted', transfer as IMethod, transfer as IExtrinsic); + console.log('transfer casted', transfer as IMethod, transfer as IExtrinsic); // simple "return the hash" variant console.log('hash:', (await transfer.signAndSend(pairs.alice)).toHex()); @@ -179,6 +223,14 @@ async function tx (api: ApiPromise, pairs: TestKeyringMap): Promise { // it handles enum inputs correctly await api.tx.democracy.proxyVote(123, { Split: { nay: 456, yay: 123 } }).signAndSend(pairs.alice); + + // is + if (api.tx.balances.transfer.is(second)) { + const [recipientId, balance] = second.args; + + // should be LookupSource & Balance types + console.log(recipientId.toHuman(), balance.toNumber()); + } } async function main (): Promise { @@ -189,6 +241,8 @@ async function main (): Promise { Promise.all([ consts(api), derive(api), + errors(api), + events(api), query(api, pairs), queryExtra(api, pairs), rpc(api), diff --git a/packages/api/src/types/errors.ts b/packages/api/src/types/errors.ts new file mode 100644 index 0000000000..0e969e71fd --- /dev/null +++ b/packages/api/src/types/errors.ts @@ -0,0 +1,16 @@ +// Copyright 2017-2020 @polkadot/api authors & contributors +// SPDX-License-Identifier: Apache-2.0 + +import type { IsError } from '@polkadot/metadata/decorate/types'; +import type { ApiTypes } from './base'; + +// In errors we don't need the ApiType, however add it for consistency +// eslint-disable-next-line @typescript-eslint/no-empty-interface,@typescript-eslint/no-unused-vars +export interface AugmentedErrors { } + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +export type AugmentedError = IsError; + +export interface ModuleErrors { + [key: string]: AugmentedError; +} diff --git a/packages/api/src/types/events.ts b/packages/api/src/types/events.ts new file mode 100644 index 0000000000..222ecfaf76 --- /dev/null +++ b/packages/api/src/types/events.ts @@ -0,0 +1,17 @@ +// Copyright 2017-2020 @polkadot/api authors & contributors +// SPDX-License-Identifier: Apache-2.0 + +import type { IsEvent } from '@polkadot/metadata/decorate/types'; +import type { AnyTuple } from '@polkadot/types/types'; +import type { ApiTypes } from './base'; + +// In events we don't need the ApiType, however add it for consistency +// eslint-disable-next-line @typescript-eslint/no-empty-interface,@typescript-eslint/no-unused-vars +export interface AugmentedEvents { } + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +export type AugmentedEvent = IsEvent; + +export interface ModuleEvents { + [key: string]: AugmentedEvent; +} diff --git a/packages/api/src/types/index.ts b/packages/api/src/types/index.ts index f0828c3cac..4eda356403 100644 --- a/packages/api/src/types/index.ts +++ b/packages/api/src/types/index.ts @@ -23,6 +23,8 @@ export { ApiBase } from '../base'; export * from '../submittable/types'; export * from './base'; export * from './consts'; +export * from './errors'; +export * from './events'; export * from './rpc'; export * from './storage'; export * from './submittable'; diff --git a/packages/api/src/types/storage.ts b/packages/api/src/types/storage.ts index 532c92411b..c89270eb3f 100644 --- a/packages/api/src/types/storage.ts +++ b/packages/api/src/types/storage.ts @@ -4,7 +4,7 @@ import type { StorageKey, u64 } from '@polkadot/types'; import type { Hash } from '@polkadot/types/interfaces'; import type { StorageEntry } from '@polkadot/types/primitive/types'; -import type { AnyFunction, Callback, Codec, CodecArg } from '@polkadot/types/types'; +import type { AnyFunction, AnyTuple, Callback, Codec, CodecArg, IStorageKey } from '@polkadot/types/types'; import type { Observable } from '@polkadot/x-rxjs'; import type { ApiTypes, MethodResult, ObsInnerType, PaginationOptions, PromiseOrObs, UnsubscribePromise } from './base'; @@ -28,20 +28,21 @@ export interface StorageEntryPromiseOverloads { // This is the most generic typings we can have for a storage entry function type GenericStorageEntryFunction = (arg1?: CodecArg, arg2?: CodecArg) => Observable -export type QueryableStorageEntry = +export type QueryableStorageEntry = ApiType extends 'rxjs' // eslint-disable-next-line no-use-before-define - ? AugmentedQuery<'rxjs', GenericStorageEntryFunction> + ? AugmentedQuery<'rxjs', GenericStorageEntryFunction, A> // eslint-disable-next-line no-use-before-define - : AugmentedQuery<'promise', GenericStorageEntryFunction> & StorageEntryPromiseOverloads; + : AugmentedQuery<'promise', GenericStorageEntryFunction, A> & StorageEntryPromiseOverloads; -export interface StorageEntryBase { +export interface StorageEntryBase { at: >>(hash: Hash | Uint8Array | string, ...args: Parameters) => PromiseOrObs; creator: StorageEntry; entries: >>(arg?: Parameters[0]) => PromiseOrObs; entriesAt: >>(hash: Hash | Uint8Array | string, arg?: Parameters[0]) => PromiseOrObs; entriesPaged: >>(opts: PaginationOptions[0]>) => PromiseOrObs; hash: (...args: Parameters) => PromiseOrObs; + is: (key: IStorageKey) => key is IStorageKey; key: (...args: Parameters) => string; keyPrefix: () => string; keys: (arg?: any) => PromiseOrObs; @@ -55,7 +56,7 @@ export interface StorageEntryBase { - [index: string]: QueryableStorageEntry; + [index: string]: QueryableStorageEntry; } export type QueryableStorageMultiArg = @@ -79,10 +80,10 @@ export type QueryableStorageMulti = // eslint-disable-next-line @typescript-eslint/no-empty-interface,@typescript-eslint/no-unused-vars export interface AugmentedQueries { } -export interface StorageEntryDoubleMap extends StorageEntryBase { +export interface StorageEntryDoubleMap extends StorageEntryBase { keyPrefix: (key1?: Parameters[0]) => string; } -export type AugmentedQuery = MethodResult & StorageEntryBase +export type AugmentedQuery = MethodResult & StorageEntryBase; -export type AugmentedQueryDoubleMap = MethodResult & StorageEntryDoubleMap +export type AugmentedQueryDoubleMap = MethodResult & StorageEntryDoubleMap; diff --git a/packages/api/src/types/submittable.ts b/packages/api/src/types/submittable.ts index 9ff26b3d12..2b33ae0444 100644 --- a/packages/api/src/types/submittable.ts +++ b/packages/api/src/types/submittable.ts @@ -1,19 +1,20 @@ // Copyright 2017-2020 @polkadot/api authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { AnyFunction, CallBase } from '@polkadot/types/types'; +import type { AnyFunction, AnyTuple, CallBase } from '@polkadot/types/types'; import type { SubmittableExtrinsic } from '../submittable/types'; import type { ApiTypes } from './base'; // eslint-disable-next-line @typescript-eslint/no-empty-interface,@typescript-eslint/no-unused-vars export interface AugmentedSubmittables { } -export type AugmentedSubmittable = T & CallBase; +export type AugmentedSubmittable = T & CallBase; -export interface SubmittableExtrinsicFunction extends CallBase { +export interface SubmittableExtrinsicFunction extends CallBase { (...params: any[]): SubmittableExtrinsic; } export interface SubmittableModuleExtrinsics { - [index: string]: SubmittableExtrinsicFunction; + // only with is augmentation + [index: string]: SubmittableExtrinsicFunction; // | AugmentedIsSubmittable; } diff --git a/packages/metadata/src/decorate/constants/index.spec.ts b/packages/metadata/src/decorate/constants/index.spec.ts index 005249aa2e..51cac85044 100644 --- a/packages/metadata/src/decorate/constants/index.spec.ts +++ b/packages/metadata/src/decorate/constants/index.spec.ts @@ -20,7 +20,7 @@ function init (meta: string): [Constants, TypeRegistry] { return [decorateConstants(registry, metadata.asLatest), registry]; } -describe('fromMetadata', (): void => { +describe('decorateConstants', (): void => { it('should return constants with the correct type and value', (): void => { const [consts, registry] = init(rpcMetadata); diff --git a/packages/metadata/src/decorate/constants/index.ts b/packages/metadata/src/decorate/constants/index.ts index 25eb1a789d..81c00c210e 100644 --- a/packages/metadata/src/decorate/constants/index.ts +++ b/packages/metadata/src/decorate/constants/index.ts @@ -9,21 +9,19 @@ import { hexToU8a, stringCamelCase } from '@polkadot/util'; /** @internal */ export function decorateConstants (registry: Registry, { modules }: MetadataLatest): Constants { - return modules.reduce((result: Constants, moduleMetadata): Constants => { - if (moduleMetadata.constants.isEmpty) { + return modules.reduce((result: Constants, { constants, name }): Constants => { + if (constants.isEmpty) { return result; } - const { name } = moduleMetadata; - // For access, we change the index names, i.e. Democracy.EnactmentPeriod -> democracy.enactmentPeriod - result[stringCamelCase(name)] = moduleMetadata.constants.reduce((newModule: ModuleConstants, meta): ModuleConstants => { + result[stringCamelCase(name)] = constants.reduce((newModule: ModuleConstants, meta): ModuleConstants => { // convert to the natural type as received const type = meta.type.toString(); - const codec = registry.createType(type as 'Raw', hexToU8a(meta.value.toHex())) as unknown as ConstantCodec; + const codec = registry.createType(type as 'Raw', hexToU8a(meta.value.toHex())) as unknown; - codec.meta = meta; - newModule[stringCamelCase(meta.name)] = codec; + (codec as Record).meta = meta; + newModule[stringCamelCase(meta.name)] = codec as ConstantCodec; return newModule; }, {} as ModuleConstants); diff --git a/packages/metadata/src/decorate/errors/index.ts b/packages/metadata/src/decorate/errors/index.ts new file mode 100644 index 0000000000..ed34cb2020 --- /dev/null +++ b/packages/metadata/src/decorate/errors/index.ts @@ -0,0 +1,42 @@ +// Copyright 2017-2020 @polkadot/metadata authors & contributors +// SPDX-License-Identifier: Apache-2.0 + +import type { DispatchError, MetadataLatest } from '@polkadot/types/interfaces'; +import type { Registry } from '@polkadot/types/types'; +import type { Errors, ModuleErrors } from '../types'; + +import { stringCamelCase } from '@polkadot/util'; + +function isError (dispatchError: DispatchError, sectionIndex: number, errorIndex: number): boolean { + if (!dispatchError.isModule) { + return false; + } + + const { error, index } = dispatchError.asModule; + + return index.eq(sectionIndex) && error.eq(errorIndex); +} + +/** @internal */ +export function decorateErrors (_: Registry, { modules }: MetadataLatest, metaVersion: number): Errors { + return modules.reduce((result: Errors, { errors, index, name }, _sectionIndex): Errors => { + if (!errors.length) { + return result; + } + + const sectionIndex = metaVersion === 12 ? index.toNumber() : _sectionIndex; + + result[stringCamelCase(name)] = errors.reduce((newModule: ModuleErrors, meta, errorIndex): ModuleErrors => { + // we don't camelCase the error name + newModule[meta.name.toString()] = { + is: (dispatchError: DispatchError): boolean => + isError(dispatchError, sectionIndex, errorIndex), + meta + }; + + return newModule; + }, {} as ModuleErrors); + + return result; + }, {} as Errors); +} diff --git a/packages/metadata/src/decorate/events/index.ts b/packages/metadata/src/decorate/events/index.ts new file mode 100644 index 0000000000..330484b831 --- /dev/null +++ b/packages/metadata/src/decorate/events/index.ts @@ -0,0 +1,36 @@ +// Copyright 2017-2020 @polkadot/metadata authors & contributors +// SPDX-License-Identifier: Apache-2.0 + +import type { MetadataLatest } from '@polkadot/types/interfaces'; +import type { AnyTuple, IEventRecord, Registry } from '@polkadot/types/types'; +import type { Events, ModuleEvents } from '../types'; + +import { stringCamelCase } from '@polkadot/util'; + +function isEvent (eventRecord: IEventRecord, sectionIndex: number, eventIndex: number): eventRecord is IEventRecord { + return eventRecord.event.index[0] === sectionIndex && eventRecord.event.index[0] === eventIndex; +} + +/** @internal */ +export function decorateEvents (_: Registry, { modules }: MetadataLatest, metaVersion: number): Events { + return modules.reduce((result: Events, { events, index, name }, _sectionIndex): Events => { + if (!events.isSome) { + return result; + } + + const sectionIndex = metaVersion === 12 ? index.toNumber() : _sectionIndex; + + result[stringCamelCase(name)] = events.unwrap().reduce((newModule: ModuleEvents, meta, eventIndex): ModuleEvents => { + // we don't camelCase the event name + newModule[meta.name.toString()] = { + is: (eventRecord: IEventRecord): eventRecord is IEventRecord => + isEvent(eventRecord, sectionIndex, eventIndex), + meta + }; + + return newModule; + }, {} as ModuleEvents); + + return result; + }, {} as Events); +} diff --git a/packages/metadata/src/decorate/extrinsics/createUnchecked.ts b/packages/metadata/src/decorate/extrinsics/createUnchecked.ts index c5efab7586..518e17b716 100644 --- a/packages/metadata/src/decorate/extrinsics/createUnchecked.ts +++ b/packages/metadata/src/decorate/extrinsics/createUnchecked.ts @@ -2,10 +2,14 @@ // SPDX-License-Identifier: Apache-2.0 import type { Call, FunctionMetadataLatest } from '@polkadot/types/interfaces'; -import type { AnyJson, CallFunction, Registry } from '@polkadot/types/types'; +import type { AnyJson, AnyTuple, CallFunction, IMethod, Registry } from '@polkadot/types/types'; import { assert, stringCamelCase } from '@polkadot/util'; +function isTx (tx: IMethod, callIndex: Uint8Array): tx is IMethod { + return tx.callIndex[0] === callIndex[0] && tx.callIndex[1] === callIndex[1]; +} + /** @internal */ export function createUnchecked (registry: Registry, section: string, callIndex: Uint8Array, callMetadata: FunctionMetadataLatest): CallFunction { const expectedArgs = callMetadata.args; @@ -20,6 +24,9 @@ export function createUnchecked (registry: Registry, section: string, callIndex: }, callMetadata); }; + extrinsicFn.is = (tx: IMethod): tx is IMethod => + isTx(tx, callIndex); + extrinsicFn.callIndex = callIndex; extrinsicFn.meta = callMetadata; extrinsicFn.method = funcName; diff --git a/packages/metadata/src/decorate/extrinsics/index.spec.ts b/packages/metadata/src/decorate/extrinsics/index.spec.ts index 4896c9399e..c51716d777 100644 --- a/packages/metadata/src/decorate/extrinsics/index.spec.ts +++ b/packages/metadata/src/decorate/extrinsics/index.spec.ts @@ -16,7 +16,7 @@ const metadata = new Metadata(registry, metadataStatic); registry.setMetadata(metadata); -const extrinsics = decorateExtrinsics(registry, metadata.asLatest); +const extrinsics = decorateExtrinsics(registry, metadata.asLatest, metadata.version); describe('extrinsics', (): void => { it('encodes an actual transfer (actual data)', (): void => { @@ -53,7 +53,7 @@ describe('extrinsics', (): void => { }); }); -describe('fromMetadata', (): void => { +describe('decorateExtrinsics', (): void => { it('should throw if an incorrect number of args is supplied', (): void => { expect(() => extrinsics.balances.setBalance()).toThrowError(/expects 3 arguments/); }); @@ -78,4 +78,11 @@ describe('fromMetadata', (): void => { ]) ); }); + + it('has working .is', (): void => { + const tx = extrinsics.balances.setBalance('5C62W7ELLAAfix9LYrcx5smtcffbhvThkM5x7xfMeYXCtGwF', 2, 3); + + expect(extrinsics.balances.setBalance.is(tx)).toBe(true); + expect(extrinsics.balances.transfer.is(tx)).toBe(false); + }); }); diff --git a/packages/metadata/src/decorate/extrinsics/index.ts b/packages/metadata/src/decorate/extrinsics/index.ts index 288884e0d3..cafcfb5eb5 100644 --- a/packages/metadata/src/decorate/extrinsics/index.ts +++ b/packages/metadata/src/decorate/extrinsics/index.ts @@ -10,13 +10,11 @@ import { stringCamelCase } from '@polkadot/util'; import { createUnchecked } from './createUnchecked'; /** @internal */ -export function decorateExtrinsics (registry: Registry, { modules }: MetadataLatest): Extrinsics { - const isIndexed = modules.some(({ index }) => !index.eqn(255)); - +export function decorateExtrinsics (registry: Registry, { modules }: MetadataLatest, metaVersion: number): Extrinsics { return modules .filter(({ calls }) => calls.isSome) .reduce((result: Extrinsics, { calls, index, name }, _sectionIndex): Extrinsics => { - const sectionIndex = isIndexed + const sectionIndex = metaVersion === 12 ? index.toNumber() : _sectionIndex; const section = stringCamelCase(name); diff --git a/packages/metadata/src/decorate/index.spec.ts b/packages/metadata/src/decorate/index.spec.ts index d0682718a4..bba74cbe91 100644 --- a/packages/metadata/src/decorate/index.spec.ts +++ b/packages/metadata/src/decorate/index.spec.ts @@ -27,7 +27,7 @@ describe('Decorated', () => { }); it('should return properly-encoded transactions', (): void => { - const tx = decorateExtrinsics(registry, metadata.asLatest); + const tx = decorateExtrinsics(registry, metadata.asLatest, metadata.version); expect( registry.createType('Extrinsic', tx.timestamp.set([10101])).toU8a() diff --git a/packages/metadata/src/decorate/index.ts b/packages/metadata/src/decorate/index.ts index 347bc8191f..c7a3bf3ee9 100644 --- a/packages/metadata/src/decorate/index.ts +++ b/packages/metadata/src/decorate/index.ts @@ -8,6 +8,8 @@ import { assert } from '@polkadot/util'; import { Metadata } from '../Metadata'; import { decorateConstants } from './constants'; +import { decorateErrors } from './errors'; +import { decorateEvents } from './events'; import { decorateExtrinsics } from './extrinsics'; import { decorateStorage } from './storage'; @@ -21,8 +23,10 @@ export function expandMetadata (registry: Registry, metadata: Metadata): Decorat return { consts: decorateConstants(registry, latest), + errors: decorateErrors(registry, latest, metadata.version), + events: decorateEvents(registry, latest, metadata.version), query: decorateStorage(registry, latest, metadata.version), - tx: decorateExtrinsics(registry, latest) + tx: decorateExtrinsics(registry, latest, metadata.version) }; } diff --git a/packages/metadata/src/decorate/storage/index.spec.ts b/packages/metadata/src/decorate/storage/index.spec.ts index d7e25e78cf..aedb703cf2 100644 --- a/packages/metadata/src/decorate/storage/index.spec.ts +++ b/packages/metadata/src/decorate/storage/index.spec.ts @@ -11,7 +11,7 @@ import { decorateStorage } from '..'; const keyring = createTestPairs({ type: 'ed25519' }); -describe('fromMetadata', (): void => { +describe('decorateStorage', (): void => { describe('latest', (): void => { const registry = new TypeRegistry(); const metadata = new Metadata(registry, rpcMetadata); diff --git a/packages/metadata/src/decorate/types.ts b/packages/metadata/src/decorate/types.ts index 418c9acc7b..91fc40f6e7 100644 --- a/packages/metadata/src/decorate/types.ts +++ b/packages/metadata/src/decorate/types.ts @@ -1,15 +1,31 @@ // Copyright 2017-2020 @polkadot/metadata authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ModuleConstantMetadataLatest } from '@polkadot/types/interfaces'; +import type { DispatchError, ErrorMetadataLatest, EventMetadataLatest, ModuleConstantMetadataLatest } from '@polkadot/types/interfaces'; import type { StorageEntry } from '@polkadot/types/primitive/types'; -import type { CallFunction, Codec } from '@polkadot/types/types'; +import type { AnyTuple, CallFunction, Codec, IEventRecord } from '@polkadot/types/types'; export interface ConstantCodec extends Codec { - meta: ModuleConstantMetadataLatest; + readonly meta: ModuleConstantMetadataLatest; } -export type ModuleConstants = Record +export interface IsError { + readonly meta: ErrorMetadataLatest; + + is: (dispatchError: DispatchError) => boolean; +} + +export interface IsEvent { + readonly meta: EventMetadataLatest; + + is: (record: IEventRecord) => record is IEventRecord; +} + +export type ModuleConstants = Record; + +export type ModuleErrors = Record; + +export type ModuleEvents = Record>; export type ModuleExtrinsics = Record; @@ -17,12 +33,18 @@ export type ModuleStorage = Record export type Constants = Record; +export type Errors = Record; + +export type Events = Record; + export type Extrinsics = Record export type Storage = Record; export interface DecoratedMeta { - consts: Constants; - query: Storage; - tx: Extrinsics + readonly consts: Constants; + readonly errors: Errors; + readonly events: Events; + readonly query: Storage; + readonly tx: Extrinsics } diff --git a/packages/typegen/src/fromChain.ts b/packages/typegen/src/fromChain.ts index 1eab4e698f..8e0ee25719 100644 --- a/packages/typegen/src/fromChain.ts +++ b/packages/typegen/src/fromChain.ts @@ -7,7 +7,7 @@ import yargs from 'yargs'; import { formatNumber } from '@polkadot/util'; import { WebSocket } from '@polkadot/x-ws'; -import { generateDefaultConsts, generateDefaultQuery, generateDefaultRpc, generateDefaultTx } from './generate'; +import { generateDefaultConsts, generateDefaultErrors, generateDefaultEvents, generateDefaultQuery, generateDefaultRpc, generateDefaultTx } from './generate'; import { HEADER, writeFile } from './util'; function generate (metaHex: string, pkg: string | undefined, output: string, isStrict?: boolean): void { @@ -19,6 +19,8 @@ function generate (metaHex: string, pkg: string | undefined, output: string, isS : {}; generateDefaultConsts(path.join(process.cwd(), output, 'augment-api-consts.ts'), metaHex, extraTypes, isStrict); + generateDefaultErrors(path.join(process.cwd(), output, 'augment-api-errors.ts'), metaHex, isStrict); + generateDefaultEvents(path.join(process.cwd(), output, 'augment-api-events.ts'), metaHex, extraTypes, isStrict); generateDefaultQuery(path.join(process.cwd(), output, 'augment-api-query.ts'), metaHex, extraTypes, isStrict); generateDefaultRpc(path.join(process.cwd(), output, 'augment-api-rpc.ts'), extraTypes); generateDefaultTx(path.join(process.cwd(), output, 'augment-api-tx.ts'), metaHex, extraTypes, isStrict); @@ -28,7 +30,7 @@ function generate (metaHex: string, pkg: string | undefined, output: string, isS HEADER('chain'), ...[ '@polkadot/api/augment/rpc', - ...['consts', 'query', 'tx', 'rpc'].filter((key) => !!key).map((key) => `./augment-api-${key}`) + ...['consts', 'errors', 'events', 'query', 'tx', 'rpc'].filter((key) => !!key).map((key) => `./augment-api-${key}`) ].map((path) => `import '${path}';\n`) ].join('') ); diff --git a/packages/typegen/src/generate/errors.ts b/packages/typegen/src/generate/errors.ts new file mode 100644 index 0000000000..4b7da91310 --- /dev/null +++ b/packages/typegen/src/generate/errors.ts @@ -0,0 +1,60 @@ +// Copyright 2017-2020 @polkadot/typegen authors & contributors +// SPDX-License-Identifier: Apache-2.0 + +import Handlebars from 'handlebars'; + +import { Metadata } from '@polkadot/metadata/Metadata'; +import staticData from '@polkadot/metadata/static'; +import { TypeRegistry } from '@polkadot/types/create'; +import { stringCamelCase } from '@polkadot/util'; + +import { compareName, createImports, readTemplate, writeFile } from '../util'; + +const template = readTemplate('errors'); +const generateForMetaTemplate = Handlebars.compile(template); + +/** @internal */ +function generateForMeta (meta: Metadata, dest: string, isStrict: boolean): void { + writeFile(dest, (): string => { + const imports = createImports({}); + + const modules = meta.asLatest.modules + .sort(compareName) + .filter((mod) => mod.errors.length > 0) + .map(({ errors, name }) => ({ + items: errors + .sort(compareName) + .map(({ documentation, name }) => ({ + docs: documentation, + name: name.toString() + })), + name: stringCamelCase(name) + })); + + const types = [ + { + file: '@polkadot/api/types', + types: ['ApiTypes'] + } + ]; + + return generateForMetaTemplate({ + headerType: 'chain', + imports, + isStrict, + modules, + types + }); + }); +} + +// Call `generateForMeta()` with current static metadata +/** @internal */ +export function generateDefaultErrors (dest = 'packages/api/src/augment/errors.ts', data = staticData, isStrict = false): void { + const registry = new TypeRegistry(); + const metadata = new Metadata(registry, data); + + registry.setMetadata(metadata); + + return generateForMeta(metadata, dest, isStrict); +} diff --git a/packages/typegen/src/generate/events.ts b/packages/typegen/src/generate/events.ts new file mode 100644 index 0000000000..f04f0834af --- /dev/null +++ b/packages/typegen/src/generate/events.ts @@ -0,0 +1,80 @@ +// Copyright 2017-2020 @polkadot/typegen authors & contributors +// SPDX-License-Identifier: Apache-2.0 + +import Handlebars from 'handlebars'; + +import { Metadata } from '@polkadot/metadata/Metadata'; +import staticData from '@polkadot/metadata/static'; +import { TypeRegistry } from '@polkadot/types/create'; +import * as defaultDefs from '@polkadot/types/interfaces/definitions'; +import { stringCamelCase } from '@polkadot/util'; + +import { compareName, createImports, formatType, readTemplate, registerDefinitions, setImports, writeFile } from '../util'; + +const template = readTemplate('events'); +const generateForMetaTemplate = Handlebars.compile(template); + +/** @internal */ +function generateForMeta (meta: Metadata, dest: string, extraTypes: Record }>>, isStrict: boolean): void { + writeFile(dest, (): string => { + const allTypes: Record }>> = { '@polkadot/types/interfaces': defaultDefs, ...extraTypes }; + const imports = createImports(allTypes); + const allDefs = Object.entries(allTypes).reduce((defs, [path, obj]) => { + return Object.entries(obj).reduce((defs, [key, value]) => ({ ...defs, [`${path}/${key}`]: value }), defs); + }, {}); + + const modules = meta.asLatest.modules + .sort(compareName) + .filter((mod) => mod.events.isSome) + .map(({ events, name }) => ({ + items: events + .unwrap() + .sort(compareName) + .map(({ args, documentation, name }) => { + const types = args.map((type) => formatType(allDefs, type.toString(), imports)); + + setImports(allDefs, imports, types); + + return { + docs: documentation, + name: name.toString(), + type: types.join(', ') + }; + }), + name: stringCamelCase(name) + })); + + const types = [ + ...Object.keys(imports.localTypes).sort().map((packagePath): { file: string; types: string[] } => ({ + file: packagePath, + types: Object.keys(imports.localTypes[packagePath]) + })), + { + file: '@polkadot/api/types', + types: ['ApiTypes'] + } + ]; + + return generateForMetaTemplate({ + headerType: 'chain', + imports, + isStrict, + modules, + types + }); + }); +} + +// Call `generateForMeta()` with current static metadata +/** @internal */ +export function generateDefaultEvents (dest = 'packages/api/src/augment/events.ts', data = staticData, extraTypes: Record }>> = {}, isStrict = false): void { + const registry = new TypeRegistry(); + + registerDefinitions(registry, extraTypes); + + const metadata = new Metadata(registry, data); + + registry.setMetadata(metadata); + + return generateForMeta(metadata, dest, extraTypes, isStrict); +} diff --git a/packages/typegen/src/generate/index.ts b/packages/typegen/src/generate/index.ts index 8023f2f84a..44c000292b 100644 --- a/packages/typegen/src/generate/index.ts +++ b/packages/typegen/src/generate/index.ts @@ -2,6 +2,8 @@ // SPDX-License-Identifier: Apache-2.0 export { generateDefaultConsts } from './consts'; +export { generateDefaultErrors } from './errors'; +export { generateDefaultEvents } from './events'; export { generateDefaultInterface } from './interfaceRegistry'; export { generateDefaultQuery } from './query'; export { generateDefaultRpc } from './rpc'; diff --git a/packages/typegen/src/generate/query.ts b/packages/typegen/src/generate/query.ts index 3528dbebb9..ff58860e41 100644 --- a/packages/typegen/src/generate/query.ts +++ b/packages/typegen/src/generate/query.ts @@ -18,13 +18,13 @@ import { ModuleTypes } from '../util/imports'; // From a storage entry metadata, we return [args, returnType] /** @internal */ -function entrySignature (allDefs: Record, registry: Registry, storageEntry: StorageEntryMetadataLatest, imports: TypeImports): [string, string] { +function entrySignature (allDefs: Record, registry: Registry, storageEntry: StorageEntryMetadataLatest, imports: TypeImports): [string, string, string] { const outputType = unwrapStorageType(storageEntry.type, storageEntry.modifier.isOptional); if (storageEntry.type.isPlain) { setImports(allDefs, imports, [storageEntry.type.asPlain.toString()]); - return ['', formatType(allDefs, outputType, imports)]; + return ['', '', formatType(allDefs, outputType, imports)]; } else if (storageEntry.type.isMap) { // Find similar types of the `key` type const similarTypes = getSimilarTypes(registry, allDefs, storageEntry.type.asMap.key.toString(), imports); @@ -35,6 +35,7 @@ function entrySignature (allDefs: Record, registry: Registr ]); return [ + formatType(allDefs, storageEntry.type.asMap.key.toString(), imports), `arg: ${similarTypes.join(' | ')}`, formatType(allDefs, outputType, imports) ]; @@ -53,6 +54,7 @@ function entrySignature (allDefs: Record, registry: Registr const key2Types = similarTypes2.join(' | '); return [ + [formatType(allDefs, storageEntry.type.asDoubleMap.key1.toString(), imports), formatType(allDefs, storageEntry.type.asDoubleMap.key2.toString(), imports)].join(', '), `key1: ${key1Types}, key2: ${key2Types}`, formatType(allDefs, outputType, imports) ]; @@ -80,7 +82,7 @@ function generateForMeta (registry: Registry, meta: Metadata, dest: string, extr const items = storage.unwrap().items .sort(compareName) .map((storageEntry) => { - const [args, returnType] = entrySignature(allDefs, registry, storageEntry, imports); + const [args, params, returnType] = entrySignature(allDefs, registry, storageEntry, imports); let entryType = 'AugmentedQuery'; if (storageEntry.type.isDoubleMap) { @@ -92,6 +94,7 @@ function generateForMeta (registry: Registry, meta: Metadata, dest: string, extr docs: storageEntry.documentation, entryType, name: stringCamelCase(storageEntry.name), + params, returnType }; }); diff --git a/packages/typegen/src/generate/tx.ts b/packages/typegen/src/generate/tx.ts index 08e2d79f6e..11eba4ccfd 100644 --- a/packages/typegen/src/generate/tx.ts +++ b/packages/typegen/src/generate/tx.ts @@ -12,7 +12,7 @@ import * as defaultDefs from '@polkadot/types/interfaces/definitions'; import { Text } from '@polkadot/types/primitive'; import { stringCamelCase } from '@polkadot/util'; -import { compareName, createImports, getSimilarTypes, readTemplate, registerDefinitions, setImports, writeFile } from '../util'; +import { compareName, createImports, formatType, getSimilarTypes, readTemplate, registerDefinitions, setImports, writeFile } from '../util'; const MAPPED_NAMES: Record = { new: 'updated' @@ -57,6 +57,7 @@ function generateForMeta (registry: Registry, meta: Metadata, dest: string, extr .join(', '); return { + args: args.map(({ type }) => formatType(allDefs, type.toString(), imports)).join(', '), docs: documentation, name: stringCamelCase(name), params diff --git a/packages/typegen/src/interfacesTs.ts b/packages/typegen/src/interfacesTs.ts index 1bbc3ae375..6bb03368cc 100644 --- a/packages/typegen/src/interfacesTs.ts +++ b/packages/typegen/src/interfacesTs.ts @@ -1,12 +1,14 @@ // Copyright 2017-2020 @polkadot/typegen authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { generateDefaultConsts, generateDefaultInterface, generateDefaultQuery, generateDefaultRpc, generateDefaultTsDef, generateDefaultTx } from './generate'; +import { generateDefaultConsts, generateDefaultErrors, generateDefaultEvents, generateDefaultInterface, generateDefaultQuery, generateDefaultRpc, generateDefaultTsDef, generateDefaultTx } from './generate'; export function main (): void { generateDefaultInterface(); generateDefaultConsts(); + generateDefaultErrors(); + generateDefaultEvents(); generateDefaultQuery(); generateDefaultTx(); generateDefaultRpc(); diff --git a/packages/typegen/src/templates/errors.hbs b/packages/typegen/src/templates/errors.hbs new file mode 100644 index 0000000000..bcc76587e3 --- /dev/null +++ b/packages/typegen/src/templates/errors.hbs @@ -0,0 +1,26 @@ +{{> header }} + +{{{ imports }}} + +declare module '@polkadot/api/types/errors' { + export interface AugmentedErrors { + {{#each modules}} + {{{name}}}: { + {{#unless @root.isStrict}} + [key: string]: AugmentedError; + {{/unless}} + {{~#each items}} + {{> docs}} + {{{name}}}: AugmentedError; + {{/each}} + }; + {{/each}} + } + + export interface DecoratedErrors extends AugmentedErrors { + {{#unless isStrict}} + [key: string]: ModuleErrors; + {{/unless}} + } +} +{{> footer }} diff --git a/packages/typegen/src/templates/events.hbs b/packages/typegen/src/templates/events.hbs new file mode 100644 index 0000000000..8e72e0457d --- /dev/null +++ b/packages/typegen/src/templates/events.hbs @@ -0,0 +1,26 @@ +{{> header }} + +{{{ imports }}} + +declare module '@polkadot/api/types/events' { + export interface AugmentedEvents { + {{#each modules}} + {{{name}}}: { + {{#unless @root.isStrict}} + [key: string]: AugmentedEvent; + {{/unless}} + {{~#each items}} + {{> docs}} + {{{name}}}: AugmentedEvent; + {{/each}} + }; + {{/each}} + } + + export interface DecoratedEvents extends AugmentedEvents { + {{#unless isStrict}} + [key: string]: ModuleEvents; + {{/unless}} + } +} +{{> footer }} diff --git a/packages/typegen/src/templates/query.hbs b/packages/typegen/src/templates/query.hbs index d1bf7ba4cc..85d0951b39 100644 --- a/packages/typegen/src/templates/query.hbs +++ b/packages/typegen/src/templates/query.hbs @@ -11,7 +11,7 @@ declare module '@polkadot/api/types/storage' { {{/unless}} {{~#each items}} {{> docs}} - {{{name}}}: {{{entryType}}} Observable<{{{returnType}}}>>{{#unless @root.isStrict}} & QueryableStorageEntry{{/unless}}; + {{{name}}}: {{{entryType}}} Observable<{{{returnType}}}>, [{{{args}}}]>{{#unless @root.isStrict}} & QueryableStorageEntry{{/unless}}; {{/each}} }; {{/each}} diff --git a/packages/typegen/src/templates/tx.hbs b/packages/typegen/src/templates/tx.hbs index 5afd98c7b5..61c48ba6b5 100644 --- a/packages/typegen/src/templates/tx.hbs +++ b/packages/typegen/src/templates/tx.hbs @@ -11,7 +11,7 @@ declare module '@polkadot/api/types/submittable' { {{/unless}} {{~#each items}} {{> docs}} - {{{name}}}: AugmentedSubmittable<({{{params}}}) => SubmittableExtrinsic>; + {{{name}}}: AugmentedSubmittable<({{{params}}}) => SubmittableExtrinsic, [{{{args}}}]>; {{/each}} }; {{/each}} diff --git a/packages/types/src/create/registry.ts b/packages/types/src/create/registry.ts index a18fac445c..70753c5493 100644 --- a/packages/types/src/create/registry.ts +++ b/packages/types/src/create/registry.ts @@ -88,7 +88,7 @@ function injectEvents (registry: Registry, metadata: Metadata, metadataEvents: R // create extrinsic mapping from metadata function injectExtrinsics (registry: Registry, metadata: Metadata, metadataCalls: Record): void { - const extrinsics = decorateExtrinsics(registry, metadata.asLatest); + const extrinsics = decorateExtrinsics(registry, metadata.asLatest, metadata.version); // decorate the extrinsics Object.values(extrinsics).forEach((methods): void => diff --git a/packages/types/src/extrinsic/Extrinsic.ts b/packages/types/src/extrinsic/Extrinsic.ts index 47e097b05f..3f9c63c537 100644 --- a/packages/types/src/extrinsic/Extrinsic.ts +++ b/packages/types/src/extrinsic/Extrinsic.ts @@ -4,7 +4,7 @@ import type { EcdsaSignature, Ed25519Signature, ExtrinsicUnknown, ExtrinsicV4, Sr25519Signature } from '../interfaces/extrinsics'; import type { FunctionMetadataLatest } from '../interfaces/metadata/types'; import type { Address, Balance, Call, Index } from '../interfaces/runtime'; -import type { AnyJson, AnyU8a, ArgsDef, Codec, ExtrinsicPayloadValue, IExtrinsic, IKeyringPair, InterfaceTypes, Registry, SignatureOptions } from '../types'; +import type { AnyJson, AnyTuple, AnyU8a, ArgsDef, ExtrinsicPayloadValue, IExtrinsic, IKeyringPair, IMethod, InterfaceTypes, Registry, SignatureOptions } from '../types'; import type { GenericExtrinsicEra } from './ExtrinsicEra'; import type { ExtrinsicValueV4 } from './v4/Extrinsic'; @@ -34,11 +34,11 @@ const VERSIONS: (keyof InterfaceTypes)[] = [ export { EXTRINSIC_VERSION as LATEST_EXTRINSIC_VERSION } from './v4/Extrinsic'; -abstract class ExtrinsicBase extends Base { +abstract class ExtrinsicBase extends Base { /** * @description The arguments passed to for the call, exposes args so it is compatible with [[Call]] */ - public get args (): Codec[] { + public get args (): A { return this.method.args; } @@ -77,13 +77,6 @@ abstract class ExtrinsicBase extends Base { return this.toU8a().length; } - /** - * @description `true` is method has `Origin` argument (compatibility with [Call]) - */ - public get hasOrigin (): boolean { - return this.method.hasOrigin; - } - /** * @description `true` id the extrinsic is signed */ @@ -108,8 +101,8 @@ abstract class ExtrinsicBase extends Base { /** * @description The [[Call]] this extrinsic wraps */ - public get method (): Call { - return (this._raw as ExtrinsicVx).method; + public get method (): IMethod { + return (this._raw as ExtrinsicVx).method as unknown as IMethod; } /** @@ -153,6 +146,13 @@ abstract class ExtrinsicBase extends Base { public get version (): number { return this.type | (this.isSigned ? BIT_SIGNED : BIT_UNSIGNED); } + + /** + * @description Checks if the source matches this in type + */ + public is (other: IMethod): other is IMethod { + return this.method.is(other); + } } /** @@ -167,7 +167,7 @@ abstract class ExtrinsicBase extends Base { * - signed, to create a transaction * - left as is, to create an inherent */ -export class GenericExtrinsic extends ExtrinsicBase implements IExtrinsic { +export class GenericExtrinsic extends ExtrinsicBase implements IExtrinsic { constructor (registry: Registry, value: GenericExtrinsic | ExtrinsicValue | AnyU8a | Call | undefined, { version }: CreateOptions = {}) { super(registry, GenericExtrinsic._decodeExtrinsic(registry, value, version)); } @@ -216,7 +216,7 @@ export class GenericExtrinsic extends ExtrinsicBase implements IExtrinsic { /** * @description Injects an already-generated signature into the extrinsic */ - public addSignature (signer: Address | Uint8Array | string, signature: Uint8Array | string, payload: ExtrinsicPayloadValue | Uint8Array | string): GenericExtrinsic { + public addSignature (signer: Address | Uint8Array | string, signature: Uint8Array | string, payload: ExtrinsicPayloadValue | Uint8Array | string): GenericExtrinsic { (this._raw as ExtrinsicVx).addSignature(signer, signature, payload); return this; @@ -225,7 +225,7 @@ export class GenericExtrinsic extends ExtrinsicBase implements IExtrinsic { /** * @description Sign the extrinsic with a specific keypair */ - public sign (account: IKeyringPair, options: SignatureOptions): GenericExtrinsic { + public sign (account: IKeyringPair, options: SignatureOptions): GenericExtrinsic { (this._raw as ExtrinsicVx).sign(account, options); return this; @@ -234,7 +234,7 @@ export class GenericExtrinsic extends ExtrinsicBase implements IExtrinsic { /** * @describe Adds a fake signature to the extrinsic */ - public signFake (signer: Address | Uint8Array | string, options: SignatureOptions): GenericExtrinsic { + public signFake (signer: Address | Uint8Array | string, options: SignatureOptions): GenericExtrinsic { (this._raw as ExtrinsicVx).signFake(signer, options); return this; diff --git a/packages/types/src/extrinsic/v4/Extrinsic.spec.ts b/packages/types/src/extrinsic/v4/Extrinsic.spec.ts index 7ec729b8a8..24e8d9ffac 100644 --- a/packages/types/src/extrinsic/v4/Extrinsic.spec.ts +++ b/packages/types/src/extrinsic/v4/Extrinsic.spec.ts @@ -16,7 +16,7 @@ const keyring = createTestPairs({ type: 'ed25519' }, false); registry.setMetadata(metadata); -const tx = decorateExtrinsics(registry, metadata.asLatest); +const tx = decorateExtrinsics(registry, metadata.asLatest, metadata.version); describe('ExtrinsicV4', (): void => { it.only('constructs a sane Uint8Array (default)', (): void => { diff --git a/packages/types/src/generic/Call.spec.ts b/packages/types/src/generic/Call.spec.ts index ec659a7d37..fdbbdd2e1c 100644 --- a/packages/types/src/generic/Call.spec.ts +++ b/packages/types/src/generic/Call.spec.ts @@ -27,29 +27,4 @@ describe('Call', (): void => { new Call(registry, '0x0601').toU8a() ).toEqual(new Uint8Array([6, 1, 0, 0, 0])); // balances.setBalance }); - - describe('hasOrigin', (): void => { - const test = { - args: [], - callIndex: [2, 2] // timestamp - }; - - it('is false with no arguments', (): void => { - expect( - new Call(registry, test, { args: [] } as any).hasOrigin - ).toEqual(false); - }); - - it('is false with first argument as non-Origin', (): void => { - expect( - new Call(registry, test, { args: [{ name: 'a', type: 'u32' }] } as any).hasOrigin - ).toEqual(false); - }); - - it('is false with first argument as non-Origin', (): void => { - expect( - new Call(registry, test, { args: [{ name: 'a', type: 'Origin' }] } as any).hasOrigin - ).toEqual(true); - }); - }); }); diff --git a/packages/types/src/generic/Call.ts b/packages/types/src/generic/Call.ts index d4adccdca8..ce687e4fa3 100644 --- a/packages/types/src/generic/Call.ts +++ b/packages/types/src/generic/Call.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { FunctionArgumentMetadataLatest, FunctionMetadataLatest } from '../interfaces/metadata'; -import type { AnyJson, AnyU8a, ArgsDef, CallFunction, Codec, IMethod, Registry } from '../types'; +import type { AnyJson, AnyTuple, AnyU8a, ArgsDef, CallFunction, IMethod, Registry } from '../types'; import { isHex, isObject, isU8a, u8aToU8a } from '@polkadot/util'; @@ -117,7 +117,7 @@ export class GenericCallIndex extends U8aFixed { * @description * Extrinsic function descriptor */ -export class GenericCall extends Struct implements IMethod { +export class GenericCall extends Struct implements IMethod { protected _meta: FunctionMetadataLatest; constructor (registry: Registry, value: unknown, meta?: FunctionMetadataLatest) { @@ -159,9 +159,9 @@ export class GenericCall extends Struct implements IMethod { /** * @description The arguments for the function call */ - public get args (): Codec[] { + public get args (): A { // FIXME This should return a Struct instead of an Array - return [...(this.get('args') as Struct).values()]; + return [...(this.get('args') as Struct).values()] as A; } /** @@ -185,15 +185,6 @@ export class GenericCall extends Struct implements IMethod { return (this.get('args') as Struct).toU8a(); } - /** - * @description `true` if the `Origin` type is on the method (extrinsic method) - */ - public get hasOrigin (): boolean { - const firstArg = this.meta.args[0]; - - return !!firstArg && firstArg.type.toString() === 'Origin'; - } - /** * @description The [[FunctionMetadata]] */ @@ -229,6 +220,13 @@ export class GenericCall extends Struct implements IMethod { return this.sectionName; } + /** + * @description Checks if the source matches this in type + */ + public is (other: IMethod): other is IMethod { + return other.callIndex[0] === this.callIndex[0] && other.callIndex[1] === this.callIndex[1]; + } + /** * @description Converts the Object to to a human-friendly JSON, with additional fields, expansion and formatting of information */ diff --git a/packages/types/src/generic/Event.ts b/packages/types/src/generic/Event.ts index cab8f374a0..79b7bb8229 100644 --- a/packages/types/src/generic/Event.ts +++ b/packages/types/src/generic/Event.ts @@ -4,7 +4,7 @@ import type { TypeDef } from '../create/types'; import type { EventMetadataLatest } from '../interfaces/metadata'; import type { EventId } from '../interfaces/system'; -import type { AnyJson, Constructor, Registry } from '../types'; +import type { AnyJson, Codec, Constructor, IEvent, IEventData, Registry } from '../types'; import { Struct } from '../codec/Struct'; import { Tuple } from '../codec/Tuple'; @@ -15,7 +15,7 @@ import { Null } from '../primitive/Null'; * @description * Wrapper for the actual data that forms part of an [[Event]] */ -export class GenericEventData extends Tuple { +export class GenericEventData extends Tuple implements IEventData { readonly #meta: EventMetadataLatest; readonly #method: string; @@ -68,7 +68,7 @@ export class GenericEventData extends Tuple { * A representation of a system event. These are generated via the [[Metadata]] interfaces and * specific to a specific Substrate runtime */ -export class GenericEvent extends Struct { +export class GenericEvent extends Struct implements IEvent { // Currently we _only_ decode from Uint8Array, since we expect it to // be used via EventRecord constructor (registry: Registry, _value?: Uint8Array) { diff --git a/packages/types/src/primitive/StorageKey.ts b/packages/types/src/primitive/StorageKey.ts index ef12766b62..cc64c95d62 100644 --- a/packages/types/src/primitive/StorageKey.ts +++ b/packages/types/src/primitive/StorageKey.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { StorageEntryMetadataLatest, StorageEntryTypeLatest, StorageHasher } from '../interfaces/metadata'; -import type { AnyJson, AnyU8a, Codec, InterfaceTypes, Registry } from '../types'; +import type { AnyJson, AnyTuple, AnyU8a, Codec, InterfaceTypes, IStorageKey, Registry } from '../types'; import type { StorageEntry } from './types'; import { assert, isFunction, isString, isU8a } from '@polkadot/util'; @@ -85,7 +85,7 @@ function decodeStorageKey (value?: AnyU8a | StorageKey | StorageEntry | [Storage throw new Error(`Unable to convert input ${value as string} to StorageKey`); } -function decodeHashers (registry: Registry, value: Uint8Array, hashers: [StorageHasher, string][]): Codec[] { +function decodeHashers (registry: Registry, value: Uint8Array, hashers: [StorageHasher, string][]): A { // the storage entry is xxhashAsU8a(prefix, 128) + xxhashAsU8a(method, 128), 256 bits total let offset = 32; @@ -99,13 +99,13 @@ function decodeHashers (registry: Registry, value: Uint8Array, hashers: [Storage result.push(decoded); return result; - }, []); + }, []) as A; } /** @internal */ -function decodeArgsFromMeta (registry: Registry, value: Uint8Array, meta?: StorageEntryMetadataLatest): Codec[] { +function decodeArgsFromMeta (registry: Registry, value: Uint8Array, meta?: StorageEntryMetadataLatest): A { if (!meta || !(meta.type.isDoubleMap || meta.type.isMap)) { - return []; + return [] as unknown as A; } if (meta.type.isMap) { @@ -130,10 +130,10 @@ function decodeArgsFromMeta (registry: Registry, value: Uint8Array, meta?: Stora * A representation of a storage key (typically hashed) in the system. It can be * constructed by passing in a raw key or a StorageEntry with (optional) arguments. */ -export class StorageKey extends Bytes { +export class StorageKey extends Bytes implements IStorageKey { // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore This is assigned via this.decodeArgsFromMeta() - private _args: Codec[]; + private _args: A; private _meta?: StorageEntryMetadataLatest; @@ -188,7 +188,7 @@ export class StorageKey extends Bytes { /** * @description Return the decoded arguments (applicable to map/doublemap with decodable values) */ - public get args (): Codec[] { + public get args (): A { return this._args; } @@ -220,6 +220,10 @@ export class StorageKey extends Bytes { return this._section; } + public is (key: IStorageKey): key is IStorageKey { + return key.section === this.section && key.method === this.method; + } + /** * @description Sets the meta for this key */ diff --git a/packages/types/src/types/calls.ts b/packages/types/src/types/calls.ts index bd2230f0f6..e1dc1cbb57 100644 --- a/packages/types/src/types/calls.ts +++ b/packages/types/src/types/calls.ts @@ -3,15 +3,19 @@ import type { FunctionMetadataLatest } from '../interfaces/metadata'; import type { Call } from '../interfaces/runtime'; +import type { AnyTuple } from './codec'; +import type { IMethod } from './interfaces'; -export interface CallBase { - callIndex: Uint8Array; - meta: FunctionMetadataLatest; - method: string; - section: string; +export interface CallBase { + readonly callIndex: Uint8Array; + readonly meta: FunctionMetadataLatest; + readonly method: string; + readonly section: string; + + is: (tx: IMethod) => tx is IMethod; toJSON: () => any; } -export interface CallFunction extends CallBase { - (...args: any[]): Call; +export interface CallFunction extends CallBase { + (...args: any[]): Call & IMethod; } diff --git a/packages/types/src/types/codec.ts b/packages/types/src/types/codec.ts index 05aa9e601a..99306249e4 100644 --- a/packages/types/src/types/codec.ts +++ b/packages/types/src/types/codec.ts @@ -13,6 +13,8 @@ export type AnyNumber = BN | BigInt | Uint8Array | number | string; export type AnyString = string | string; +export type AnyTuple = Codec[]; + export type AnyU8a = Uint8Array | number[] | string; // helper to extract keys from an array diff --git a/packages/types/src/types/events.ts b/packages/types/src/types/events.ts new file mode 100644 index 0000000000..7f3328ec2b --- /dev/null +++ b/packages/types/src/types/events.ts @@ -0,0 +1,27 @@ +// Copyright 2017-2020 @polkadot/types authors & contributors +// SPDX-License-Identifier: Apache-2.0 + +import type { EventMetadataLatest } from '../interfaces/metadata'; +import type { Hash } from '../interfaces/runtime'; +import type { EventId, Phase } from '../interfaces/system'; +import type { Codec } from './codec'; +import type { ITuple } from './interfaces'; + +export interface IEventRecord { + readonly phase: Phase; + readonly event: IEvent; + readonly topics: Hash[]; +} + +export interface IEventData { + readonly meta: EventMetadataLatest; + readonly method: string; + readonly section: string; +} + +export interface IEvent { + readonly data: ITuple & IEventData; + readonly index: EventId; + readonly method: string; + readonly section: string; +} diff --git a/packages/types/src/types/extrinsic.ts b/packages/types/src/types/extrinsic.ts index e21251f3c5..121646e4e2 100644 --- a/packages/types/src/types/extrinsic.ts +++ b/packages/types/src/types/extrinsic.ts @@ -5,7 +5,7 @@ import type { ExtrinsicStatus } from '../interfaces/author'; import type { EcdsaSignature, Ed25519Signature, Sr25519Signature } from '../interfaces/extrinsics'; import type { Address, Balance, Call, H256, Index } from '../interfaces/runtime'; import type { DispatchError, DispatchInfo, EventRecord } from '../interfaces/system'; -import type { AnyJson, AnyNumber, AnyU8a, Codec } from './codec'; +import type { AnyJson, AnyNumber, AnyTuple, AnyU8a, Codec } from './codec'; import type { ICompact, IKeyringPair, IMethod, IRuntimeVersion } from './interfaces'; export interface ISubmittableResult { @@ -173,7 +173,7 @@ export interface ExtrinsicPayloadValue { blockHash: AnyU8a; era: AnyU8a | IExtrinsicEra; genesisHash: AnyU8a; - method: AnyU8a | IMethod; + method: AnyU8a | IMethod; nonce: AnyNumber; specVersion: AnyNumber; tip: AnyNumber; @@ -198,9 +198,9 @@ export interface IExtrinsicImpl extends IExtrinsicSignable, Code readonly version: number; } -export interface IExtrinsic extends IExtrinsicSignable, ExtrinsicSignatureBase, IMethod { +export interface IExtrinsic extends IExtrinsicSignable>, ExtrinsicSignatureBase, IMethod { readonly length: number; - readonly method: Call; + readonly method: IMethod; readonly type: number; readonly version: number; } diff --git a/packages/types/src/types/index.ts b/packages/types/src/types/index.ts index 87a87590a5..163d2b5deb 100644 --- a/packages/types/src/types/index.ts +++ b/packages/types/src/types/index.ts @@ -8,6 +8,7 @@ export * from '../create/types'; export * from './calls'; export * from './codec'; export * from './definitions'; +export * from './events'; export * from './extrinsic'; export * from './interfaces'; export * from './registry'; diff --git a/packages/types/src/types/interfaces.ts b/packages/types/src/types/interfaces.ts index 922d64c2f1..2451b8bf22 100644 --- a/packages/types/src/types/interfaces.ts +++ b/packages/types/src/types/interfaces.ts @@ -3,9 +3,9 @@ import type BN from 'bn.js'; import type { SignOptions } from '@polkadot/keyring/types'; -import type { FunctionMetadataLatest } from '../interfaces/metadata'; +import type { FunctionMetadataLatest, StorageEntryMetadataLatest } from '../interfaces/metadata'; import type { Hash } from '../interfaces/runtime'; -import type { ArgsDef, Codec } from './codec'; +import type { AnyTuple, ArgsDef, Codec } from './codec'; export interface ICompact extends Codec { toBigInt (): BigInt; @@ -18,17 +18,19 @@ export interface IKeyringPair { address: string; addressRaw: Uint8Array; publicKey: Uint8Array; + sign: (data: Uint8Array, options?: SignOptions) => Uint8Array; } -export interface IMethod extends Codec { - readonly args: Codec[]; +export interface IMethod extends Codec { + readonly args: A; readonly argsDef: ArgsDef; readonly callIndex: Uint8Array; readonly data: Uint8Array; readonly hash: Hash; - readonly hasOrigin: boolean; readonly meta: FunctionMetadataLatest; + + is: (tx: IMethod) => tx is IMethod; } export interface IRuntimeVersion { @@ -44,9 +46,19 @@ export interface IRuntimeVersion { readonly transactionVersion: BN; } +export interface IStorageKey { + readonly args: A; + readonly meta: StorageEntryMetadataLatest | undefined; + readonly method: string | undefined; + readonly outputType: string; + readonly section: string | undefined; + + is: (key: IStorageKey) => key is IStorageKey; +} + // A type alias for [Type1, Type2] & Codec, representing a tuple (Type1, Type2) // FIXME Implement this generic on Tuple.ts itself. -export type ITuple = Sub & Codec +export type ITuple = Sub & Codec export interface IU8a extends Uint8Array, Codec { bitLength (): number;