From fbe24c04b82175d7c6a662b2c445e1ae9aee3ef3 Mon Sep 17 00:00:00 2001 From: Github Actions Date: Thu, 21 Jan 2021 10:08:55 +0000 Subject: [PATCH] [CI Skip] release/beta 3.5.2-5 skip-checks: true --- package.json | 2 +- packages/api-contract/package.json | 6 +- packages/api-derive/package.json | 10 +- packages/api/package.json | 14 +- packages/api/src/augment/consts.ts | 91 +++-- packages/api/src/augment/errors.ts | 66 +++- packages/api/src/augment/events.ts | 58 +++- packages/api/src/augment/query.ts | 84 ++++- packages/api/src/augment/tx.ts | 320 +++++++++++------- packages/metadata/package.json | 6 +- packages/rpc-core/package.json | 8 +- packages/rpc-provider/package.json | 6 +- packages/typegen/package.json | 10 +- packages/types-known/package.json | 4 +- packages/types/package.json | 4 +- packages/types/src/augment/registry.ts | 21 +- packages/types/src/interfaces/assets/types.ts | 10 +- .../types/src/interfaces/staking/types.ts | 14 + packages/types/src/interfaces/system/types.ts | 12 + yarn.lock | 64 ++-- 20 files changed, 554 insertions(+), 256 deletions(-) diff --git a/package.json b/package.json index 9dbeb02f14..42ae73d3e5 100644 --- a/package.json +++ b/package.json @@ -34,5 +34,5 @@ "@types/jest": "^26.0.20", "copyfiles": "^2.4.1" }, - "version": "3.5.2-4" + "version": "3.5.2-5" } diff --git a/packages/api-contract/package.json b/packages/api-contract/package.json index acbc5e3561..04fc03d443 100644 --- a/packages/api-contract/package.json +++ b/packages/api-contract/package.json @@ -1,6 +1,6 @@ { "name": "@polkadot/api-contract", - "version": "3.5.2-4", + "version": "3.5.2-5", "description": "Interfaces for interacting with contracts and contract ABIs", "main": "index.js", "module": "index.mjs", @@ -14,8 +14,8 @@ "homepage": "https://github.com/polkadot-js/api/tree/master/packages/api-contract#readme", "dependencies": { "@babel/runtime": "^7.12.5", - "@polkadot/api": "3.5.2-4", - "@polkadot/types": "3.5.2-4", + "@polkadot/api": "3.5.2-5", + "@polkadot/types": "3.5.2-5", "@polkadot/util": "^5.3.2-3", "@polkadot/x-rxjs": "3.5.2-1", "bn.js": "^4.11.9" diff --git a/packages/api-derive/package.json b/packages/api-derive/package.json index 3cfd43607b..1603175f80 100644 --- a/packages/api-derive/package.json +++ b/packages/api-derive/package.json @@ -1,6 +1,6 @@ { "name": "@polkadot/api-derive", - "version": "3.5.2-4", + "version": "3.5.2-5", "description": "Common functions used across Polkadot, derived from RPC calls and storage queries.", "main": "index.js", "module": "index.mjs", @@ -14,9 +14,9 @@ "homepage": "https://github.com/polkadot-js/api/tree/master/packages/api-derive#readme", "dependencies": { "@babel/runtime": "^7.12.5", - "@polkadot/api": "3.5.2-4", - "@polkadot/rpc-core": "3.5.2-4", - "@polkadot/types": "3.5.2-4", + "@polkadot/api": "3.5.2-5", + "@polkadot/rpc-core": "3.5.2-5", + "@polkadot/types": "3.5.2-5", "@polkadot/util": "^5.3.2-3", "@polkadot/util-crypto": "^5.3.2-3", "@polkadot/x-rxjs": "3.5.2-1", @@ -24,6 +24,6 @@ }, "devDependencies": { "@polkadot/keyring": "^5.3.2-3", - "@polkadot/rpc-provider": "3.5.2-4" + "@polkadot/rpc-provider": "3.5.2-5" } } diff --git a/packages/api/package.json b/packages/api/package.json index d50ca1486f..0617ac85a5 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -1,6 +1,6 @@ { "name": "@polkadot/api", - "version": "3.5.2-4", + "version": "3.5.2-5", "description": "Promise and RxJS wrappers around the Polkadot JS RPC", "main": "index.js", "module": "index.mjs", @@ -17,13 +17,13 @@ "homepage": "https://github.com/polkadot-js/api/tree/master/packages/api#readme", "dependencies": { "@babel/runtime": "^7.12.5", - "@polkadot/api-derive": "3.5.2-4", + "@polkadot/api-derive": "3.5.2-5", "@polkadot/keyring": "^5.3.2-3", - "@polkadot/metadata": "3.5.2-4", - "@polkadot/rpc-core": "3.5.2-4", - "@polkadot/rpc-provider": "3.5.2-4", - "@polkadot/types": "3.5.2-4", - "@polkadot/types-known": "3.5.2-4", + "@polkadot/metadata": "3.5.2-5", + "@polkadot/rpc-core": "3.5.2-5", + "@polkadot/rpc-provider": "3.5.2-5", + "@polkadot/types": "3.5.2-5", + "@polkadot/types-known": "3.5.2-5", "@polkadot/util": "^5.3.2-3", "@polkadot/util-crypto": "^5.3.2-3", "@polkadot/x-rxjs": "3.5.2-1", diff --git a/packages/api/src/augment/consts.ts b/packages/api/src/augment/consts.ts index 984a425ef8..d137d4e727 100644 --- a/packages/api/src/augment/consts.ts +++ b/packages/api/src/augment/consts.ts @@ -3,11 +3,12 @@ import type { Vec, u16, u32, u64, u8 } from '@polkadot/types'; import type { Codec } from '@polkadot/types/types'; -import type { Balance, BalanceOf, BlockNumber, LockIdentifier, ModuleId, Moment, Perbill, Percent, Permill, RuntimeDbWeight } from '@polkadot/types/interfaces/runtime'; +import type { Balance, BalanceOf, BlockNumber, LockIdentifier, ModuleId, Moment, Perbill, Percent, Permill, RuntimeDbWeight, Weight } from '@polkadot/types/interfaces/runtime'; import type { SessionIndex } from '@polkadot/types/interfaces/session'; import type { EraIndex } from '@polkadot/types/interfaces/staking'; +import type { RuntimeVersion } from '@polkadot/types/interfaces/state'; import type { WeightToFeeCoefficient } from '@polkadot/types/interfaces/support'; -import type { BlockWeights } from '@polkadot/types/interfaces/system'; +import type { BlockLength, BlockWeights } from '@polkadot/types/interfaces/system'; import type { ApiTypes } from '@polkadot/api/types'; declare module '@polkadot/api/types/consts' { @@ -17,6 +18,9 @@ declare module '@polkadot/api/types/consts' { /** * The number of **slots** that an epoch takes. We couple sessions to * epochs, i.e. we start a new session once the new epoch begins. + * NOTE: Currently it is not possible to change the epoch duration + * after the chain has started. Attempting to do so will brick block + * production. **/ epochDuration: u64 & AugmentedConst; /** @@ -49,6 +53,10 @@ declare module '@polkadot/api/types/consts' { * The delay period for which a bounty beneficiary need to wait before claim the payout. **/ bountyDepositPayoutDelay: BlockNumber & AugmentedConst; + /** + * Bounty duration in blocks. + **/ + bountyUpdatePeriod: BlockNumber & AugmentedConst; /** * Minimum value for a bounty. **/ @@ -64,6 +72,40 @@ declare module '@polkadot/api/types/consts' { }; contracts: { [key: string]: Codec; + /** + * The maximum number of tries that can be queued for deletion. + **/ + deletionQueueDepth: u32 & AugmentedConst; + /** + * The maximum amount of weight that can be consumed per block for lazy trie removal. + **/ + deletionWeightLimit: Weight & AugmentedConst; + /** + * The balance every contract needs to deposit to stay alive indefinitely. + * + * This is different from the [`Self::TombstoneDeposit`] because this only needs to be + * deposited while the contract is alive. Costs for additional storage are added to + * this base cost. + * + * This is a simple way to ensure that contracts with empty storage eventually get deleted by + * making them pay rent. This creates an incentive to remove them early in order to save rent. + **/ + depositPerContract: BalanceOf & AugmentedConst; + /** + * The balance a contract needs to deposit per storage byte to stay alive indefinitely. + * + * Let's suppose the deposit is 1,000 BU (balance units)/byte and the rent is 1 BU/byte/day, + * then a contract with 1,000,000 BU that uses 1,000 bytes of storage would pay no rent. + * But if the balance reduced to 500,000 BU and the storage stayed the same at 1,000, + * then it would pay 500 BU/day. + **/ + depositPerStorageByte: BalanceOf & AugmentedConst; + /** + * The balance a contract needs to deposit per storage item to stay alive indefinitely. + * + * It works the same as [`Self::DepositPerStorageByte`] but for storage items. + **/ + depositPerStorageItem: BalanceOf & AugmentedConst; /** * The maximum nesting level of a call/instantiate stack. A reasonable default * value is 100. @@ -74,19 +116,13 @@ declare module '@polkadot/api/types/consts' { **/ maxValueSize: u32 & AugmentedConst; /** - * Price of a byte of storage per one block interval. Should be greater than 0. - **/ - rentByteFee: BalanceOf & AugmentedConst; - /** - * The amount of funds a contract should deposit in order to offset - * the cost of one byte. + * The fraction of the deposit that should be used as rent per block. * - * Let's suppose the deposit is 1,000 BU (balance units)/byte and the rent is 1 BU/byte/day, - * then a contract with 1,000,000 BU that uses 1,000 bytes of storage would pay no rent. - * But if the balance reduced to 500,000 BU and the storage stayed the same at 1,000, - * then it would pay 500 BU/day. + * When a contract hasn't enough balance deposited to stay alive indefinitely it needs + * to pay per block for the storage it consumes that is not covered by the deposit. + * This determines how high this rent payment is per block as a fraction of the deposit. **/ - rentDepositOffset: BalanceOf & AugmentedConst; + rentFraction: Perbill & AugmentedConst; /** * Number of block delay an extrinsic claim surcharge has. * @@ -94,15 +130,6 @@ declare module '@polkadot/api/types/consts' { * for current_block - delay **/ signedClaimHandicap: BlockNumber & AugmentedConst; - /** - * A size offset for an contract. A just created account with untouched storage will have that - * much of storage from the perspective of the state rent. - * - * This is a simple way to ensure that contracts with empty storage eventually get deleted - * by making them pay rent. This creates an incentive to remove them early in order to save - * rent. - **/ - storageSizeOffset: u32 & AugmentedConst; /** * Reward that is received by the party whose touch has led * to removal of a contract. @@ -159,7 +186,8 @@ declare module '@polkadot/api/types/consts' { desiredRunnersUp: u32 & AugmentedConst; moduleId: LockIdentifier & AugmentedConst; termDuration: BlockNumber & AugmentedConst; - votingBond: BalanceOf & AugmentedConst; + votingBondBase: BalanceOf & AugmentedConst; + votingBondFactor: BalanceOf & AugmentedConst; }; identity: { [key: string]: Codec; @@ -199,6 +227,11 @@ declare module '@polkadot/api/types/consts' { **/ deposit: BalanceOf & AugmentedConst; }; + lottery: { + [key: string]: Codec; + maxCalls: u32 & AugmentedConst; + moduleId: ModuleId & AugmentedConst; + }; multisig: { [key: string]: Codec; /** @@ -343,11 +376,15 @@ declare module '@polkadot/api/types/consts' { system: { [key: string]: Codec; /** - * The maximum number of blocks to allow in mortal eras. + * Maximum number of block number to block hash mappings to keep (oldest pruned first). **/ blockHashCount: BlockNumber & AugmentedConst; /** - * The weight configuration (limits & base values) for each class of extrinsics and block. + * The maximum length of a block (in bytes). + **/ + blockLength: BlockLength & AugmentedConst; + /** + * Block & extrinsics weights: base values and limits. **/ blockWeights: BlockWeights & AugmentedConst; /** @@ -362,6 +399,10 @@ declare module '@polkadot/api/types/consts' { * an identifier of the chain. **/ ss58Prefix: u8 & AugmentedConst; + /** + * Get the chain's current version. + **/ + version: RuntimeVersion & AugmentedConst; }; timestamp: { [key: string]: Codec; diff --git a/packages/api/src/augment/errors.ts b/packages/api/src/augment/errors.ts index 9509dbdb7c..1781238193 100644 --- a/packages/api/src/augment/errors.ts +++ b/packages/api/src/augment/errors.ts @@ -11,6 +11,14 @@ declare module '@polkadot/api/types/errors' { * Transfer amount should be non-zero. **/ AmountZero: AugmentedError; + /** + * Invalid metadata given. + **/ + BadMetadata: AugmentedError; + /** + * Some internal state is broken. + **/ + BadState: AugmentedError; /** * Invalid witness data given. **/ @@ -179,6 +187,13 @@ declare module '@polkadot/api/types/errors' { * The code supplied to `put_code` exceeds the limit specified in the current schedule. **/ CodeTooLarge: AugmentedError; + /** + * A contract could not be evicted because it has enough balance to pay rent. + * + * This can be returned from [`Module::claim_surcharge`] because the target + * contract has enough balance to pay for its rent. + **/ + ContractNotEvictable: AugmentedError; /** * Contract trapped during execution. **/ @@ -187,6 +202,14 @@ declare module '@polkadot/api/types/errors' { * Input passed to a contract API function failed to decode as expected type. **/ DecodingFailed: AugmentedError; + /** + * Removal of a contract failed because the deletion queue is full. + * + * This can happen when either calling [`Module::claim_surcharge`] or `seal_terminate`. + * The queue is filled by deleting contracts and emptied by a fixed amount each block. + * Trying again during another block is the only way to resolve this issue. + **/ + DeletionQueueFull: AugmentedError; /** * The topics passed to `seal_deposit_events` contains at least one duplicate. **/ @@ -229,6 +252,12 @@ declare module '@polkadot/api/types/errors' { * its contructor. No contracts are allowed to exist below that threshold. **/ NewContractNotFunded: AugmentedError; + /** + * The chain does not provide a chain extension. Calling the chain extension results + * in this error. Note that this usually shouldn't happen as deploying such contracts + * is rejected. + **/ + NoChainExtension: AugmentedError; /** * The contract that was called is either no contract at all (a plain account) * or is a tombstone. @@ -256,6 +285,13 @@ declare module '@polkadot/api/types/errors' { * of a tombstone. **/ ReentranceDenied: AugmentedError; + /** + * A storage modification exhausted the 32bit type that holds the storage size. + * + * This can either happen when the accumulated storage in bytes is too large or + * when number of storage items is too large. + **/ + StorageExhausted: AugmentedError; /** * The amount of topics passed to `seal_deposit_events` exceeds the limit. **/ @@ -468,10 +504,6 @@ declare module '@polkadot/api/types/errors' { * 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. **/ @@ -484,6 +516,10 @@ declare module '@polkadot/api/types/errors' { * The provided count of number of votes is incorrect. **/ InvalidVoteCount: AugmentedError; + /** + * The provided count of number of candidates is incorrect. + **/ + InvalidWitnessData: AugmentedError; /** * Cannot vote with stake less than minimum balance. **/ @@ -515,7 +551,7 @@ declare module '@polkadot/api/types/errors' { /** * Runner cannot re-submit candidacy. **/ - RunnerSubmit: AugmentedError; + RunnerUpSubmit: AugmentedError; /** * Cannot vote more than candidates. **/ @@ -752,6 +788,10 @@ declare module '@polkadot/api/types/errors' { * This user has already vouched for this recovery **/ AlreadyVouched: AugmentedError; + /** + * Some internal state is broken. + **/ + BadState: AugmentedError; /** * The friend must wait until the delay period to vouch for this recovery **/ @@ -830,6 +870,10 @@ declare module '@polkadot/api/types/errors' { * Invalid ownership proof. **/ InvalidProof: AugmentedError; + /** + * Key setting account is not live, so it's impossible to associate keys. + **/ + NoAccount: AugmentedError; /** * No associated validator ID for account. **/ @@ -928,6 +972,14 @@ declare module '@polkadot/api/types/errors' { * Controller is already paired. **/ AlreadyPaired: AugmentedError; + /** + * Internal state has become somehow corrupted and the operation cannot continue. + **/ + BadState: AugmentedError; + /** + * A nomination target was supplied that was blocked or otherwise not a validator. + **/ + BadTarget: AugmentedError; /** * The call is not allowed at the given time due to restrictions of election period. **/ @@ -1043,6 +1095,10 @@ declare module '@polkadot/api/types/errors' { * The snapshot data of the current window is missing. **/ SnapshotUnavailable: AugmentedError; + /** + * Too many nomination targets supplied. + **/ + TooManyTargets: AugmentedError; }; sudo: { [key: string]: AugmentedError; diff --git a/packages/api/src/augment/events.ts b/packages/api/src/augment/events.ts index fa3206ce1e..ebcdf5c2c6 100644 --- a/packages/api/src/augment/events.ts +++ b/packages/api/src/augment/events.ts @@ -1,7 +1,7 @@ // 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 { Bytes, Option, Vec, bool, u16, u32, u8 } from '@polkadot/types'; import type { ITuple } from '@polkadot/types/types'; import type { TAssetBalance } from '@polkadot/types/interfaces/assets'; import type { BalanceStatus } from '@polkadot/types/interfaces/balances'; @@ -11,6 +11,7 @@ import type { PropIndex, ReferendumIndex } from '@polkadot/types/interfaces/demo 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 { CallIndex } from '@polkadot/types/interfaces/lottery'; 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'; @@ -26,6 +27,14 @@ declare module '@polkadot/api/types/events' { export interface AugmentedEvents { assets: { [key: string]: AugmentedEvent; + /** + * Some asset `asset_id` was frozen. \[asset_id\] + **/ + AssetFrozen: AugmentedEvent; + /** + * Some asset `asset_id` was thawed. \[asset_id\] + **/ + AssetThawed: AugmentedEvent; /** * Some assets were destroyed. \[asset_id, owner, balance\] **/ @@ -58,6 +67,10 @@ declare module '@polkadot/api/types/events' { * The maximum amount of zombies allowed has changed. \[asset_id, max_zombies\] **/ MaxZombiesChanged: AugmentedEvent; + /** + * New metadata has been set for an asset. \[asset_id, name, symbol, decimals\] + **/ + MetadataSet: AugmentedEvent; /** * The owner changed \[asset_id, owner\] **/ @@ -309,7 +322,10 @@ declare module '@polkadot/api/types/events' { elections: { [key: string]: AugmentedEvent; /** - * A candidate was slashed due to failing to obtain a seat as member or runner-up + * A \[candidate\] was slashed by \[amount\] due to failing to obtain a seat as member or + * runner-up. + * + * Note that old members and runners-up are also candidates. **/ CandidateSlashed: AugmentedEvent; /** @@ -326,10 +342,6 @@ declare module '@polkadot/api/types/events' { * `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 @@ -338,14 +350,13 @@ declare module '@polkadot/api/types/events' { **/ NewTerm: AugmentedEvent>]>; /** - * A seat holder (member or runner-up) was slashed due to failing to retaining their position. + * Someone has renounced their candidacy. + **/ + Renounced: AugmentedEvent; + /** + * A \[seat holder\] was slashed by \[amount\] by being forcefully removed from the set. **/ SeatHolderSlashed: AugmentedEvent; - /** - * A voter was reported with the the report being successful or not. - * \[voter, reporter, success\] - **/ - VoterReported: AugmentedEvent; }; grandpa: { [key: string]: AugmentedEvent; @@ -437,6 +448,25 @@ declare module '@polkadot/api/types/events' { **/ IndexFrozen: AugmentedEvent; }; + lottery: { + [key: string]: AugmentedEvent; + /** + * A new set of calls have been set! + **/ + CallsUpdated: AugmentedEvent; + /** + * A lottery has been started! + **/ + LotteryStarted: AugmentedEvent; + /** + * A ticket has been bought! + **/ + TicketBought: AugmentedEvent; + /** + * A winner has been chosen! + **/ + Winner: AugmentedEvent; + }; multisig: { [key: string]: AugmentedEvent; /** @@ -622,6 +652,10 @@ declare module '@polkadot/api/types/events' { * \[era_index, validator_payout, remainder\] **/ EraPayout: AugmentedEvent; + /** + * A nominator has been kicked from a validator. \[nominator, stash\] + **/ + Kicked: AugmentedEvent; /** * An old slashing report from a prior era was discarded because it could * not be processed. \[session_index\] diff --git a/packages/api/src/augment/query.ts b/packages/api/src/augment/query.ts index 1e7efcdc0f..00d9275212 100644 --- a/packages/api/src/augment/query.ts +++ b/packages/api/src/augment/query.ts @@ -3,18 +3,19 @@ import type { Bytes, Data, Option, U8aFixed, Vec, bool, u32, u64 } from '@polkadot/types'; import type { AnyNumber, ITuple, Observable } from '@polkadot/types/types'; -import type { AssetBalance, AssetDetails } from '@polkadot/types/interfaces/assets'; +import type { AssetBalance, AssetDetails, AssetMetadata } from '@polkadot/types/interfaces/assets'; import type { UncleEntryItem } from '@polkadot/types/interfaces/authorship'; import type { BabeAuthorityWeight, MaybeRandomness, NextConfigDescriptor, Randomness } from '@polkadot/types/interfaces/babe'; import type { AccountData, BalanceLock } from '@polkadot/types/interfaces/balances'; import type { ProposalIndex, Votes } from '@polkadot/types/interfaces/collective'; import type { AuthorityId } from '@polkadot/types/interfaces/consensus'; -import type { CodeHash, ContractInfo, PrefabWasmModule, Schedule } from '@polkadot/types/interfaces/contracts'; +import type { CodeHash, ContractInfo, DeletedContract, PrefabWasmModule, Schedule } from '@polkadot/types/interfaces/contracts'; import type { PreimageStatus, PropIndex, Proposal, ReferendumIndex, ReferendumInfo, Voting } from '@polkadot/types/interfaces/democracy'; import type { VoteThreshold } from '@polkadot/types/interfaces/elections'; import type { SetId, StoredPendingChange, StoredState } from '@polkadot/types/interfaces/grandpa'; import type { RegistrarInfo, Registration } from '@polkadot/types/interfaces/identity'; import type { AuthIndex } from '@polkadot/types/interfaces/imOnline'; +import type { CallIndex, LotteryConfig } from '@polkadot/types/interfaces/lottery'; import type { DeferredOffenceOf, Kind, OffenceDetails, OpaqueTimeSlot, ReportIdOf } from '@polkadot/types/interfaces/offences'; import type { ProxyAnnouncement, ProxyDefinition } from '@polkadot/types/interfaces/proxy'; import type { ActiveRecovery, RecoveryConfig } from '@polkadot/types/interfaces/recovery'; @@ -22,7 +23,7 @@ import type { AccountId, AccountIndex, AssetId, Balance, BalanceOf, BlockNumber, import type { Scheduled, TaskAddress } from '@polkadot/types/interfaces/scheduler'; import type { Keys, SessionIndex } from '@polkadot/types/interfaces/session'; import type { Bid, BidKind, SocietyVote, StrikeCount, VouchingStatus } from '@polkadot/types/interfaces/society'; -import type { ActiveEraInfo, ElectionResult, ElectionScore, ElectionStatus, EraIndex, EraRewardPoints, Exposure, Forcing, Nominations, RewardDestination, SlashingSpans, SpanIndex, SpanRecord, StakingLedger, UnappliedSlash, ValidatorPrefs } from '@polkadot/types/interfaces/staking'; +import type { ActiveEraInfo, ElectionResult, ElectionScore, ElectionStatus, EraIndex, EraRewardPoints, Exposure, Forcing, Nominations, RewardDestination, SeatHolder, SlashingSpans, SpanIndex, SpanRecord, StakingLedger, UnappliedSlash, ValidatorPrefs, Voter } from '@polkadot/types/interfaces/staking'; import type { AccountInfo, ConsumedWeight, DigestOf, EventIndex, EventRecord, LastRuntimeUpgradeInfo, Phase } from '@polkadot/types/interfaces/system'; import type { Bounty, BountyIndex, OpenTip, TreasuryProposal } from '@polkadot/types/interfaces/treasury'; import type { Multiplier } from '@polkadot/types/interfaces/txpayment'; @@ -42,6 +43,10 @@ declare module '@polkadot/api/types/storage' { * Details of an asset. **/ asset: AugmentedQuery Observable>, [AssetId]> & QueryableStorageEntry; + /** + * Metadata of an asset. + **/ + metadata: AugmentedQuery Observable, [AssetId]> & QueryableStorageEntry; }; authorship: { [key: string]: QueryableStorageEntry; @@ -96,6 +101,10 @@ declare module '@polkadot/api/types/storage' { * execution context should always yield zero. **/ lateness: AugmentedQuery Observable, []> & QueryableStorageEntry; + /** + * Next epoch authorities. + **/ + nextAuthorities: AugmentedQuery Observable>>, []> & QueryableStorageEntry; /** * Next epoch configuration, if changed. **/ @@ -197,6 +206,13 @@ declare module '@polkadot/api/types/storage' { * Current cost schedule for contracts. **/ currentSchedule: AugmentedQuery Observable, []> & QueryableStorageEntry; + /** + * Evicted contracts that await child trie deletion. + * + * Child trie deletion is a heavy operation depending on the amount of storage items + * stored in said trie. Therefore this operation is performed lazily in `on_initialize`. + **/ + deletionQueue: AugmentedQuery Observable>, []> & QueryableStorageEntry; /** * A mapping from an original code hash to the original code, untouched by instrumentation. **/ @@ -310,28 +326,37 @@ declare module '@polkadot/api/types/storage' { elections: { [key: string]: QueryableStorageEntry; /** - * 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. + * The present candidate list. A current member or runner-up can never enter this vector + * and is always implicitly assumed to be a candidate. + * + * Second element is the deposit. + * + * Invariant: Always sorted based on account id. **/ - 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; /** - * The current elected membership. Sorted based on account id. + * The current elected members. + * + * Invariant: Always 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). + * The current reserved runners-up. + * + * Invariant: Always sorted based on rank (worse to best). Upon removal of a member, the + * last (i.e. _best_) runner-up will be replaced. **/ - 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 + * TWOX-NOTE: SAFE as `AccountId` is a crypto hash. **/ - voting: AugmentedQuery Observable]>>, [AccountId]> & QueryableStorageEntry; + voting: AugmentedQuery Observable, [AccountId]> & QueryableStorageEntry; }; grandpa: { [key: string]: QueryableStorageEntry; @@ -426,6 +451,34 @@ declare module '@polkadot/api/types/storage' { **/ accounts: AugmentedQuery Observable>>, [AccountIndex]> & QueryableStorageEntry; }; + lottery: { + [key: string]: QueryableStorageEntry; + /** + * The calls stored in this pallet to be used in an active lottery if configured + * by `Config::ValidateCall`. + **/ + callIndices: AugmentedQuery Observable>, []> & QueryableStorageEntry; + /** + * The configuration for the current lottery. + **/ + lottery: AugmentedQuery Observable>, []> & QueryableStorageEntry; + lotteryIndex: AugmentedQuery Observable, []> & QueryableStorageEntry; + /** + * Users who have purchased a ticket. (Lottery Index, Tickets Purchased) + **/ + participants: AugmentedQuery Observable]>>, [AccountId]> & QueryableStorageEntry; + /** + * Each ticket's owner. + * + * May have residual storage from previous lotteries. Use `TicketsCount` to see which ones + * are actually valid ticket mappings. + **/ + tickets: AugmentedQuery Observable>, [u32]> & QueryableStorageEntry; + /** + * Total number of tickets sold. + **/ + ticketsCount: AugmentedQuery Observable, []> & QueryableStorageEntry; + }; mmr: { [key: string]: QueryableStorageEntry; /** @@ -817,7 +870,7 @@ declare module '@polkadot/api/types/storage' { * True if network has been upgraded to this version. * Storage version of the pallet. * - * This is set to v3.0.0 for new networks. + * This is set to v5.0.0 for new networks. **/ storageVersion: AugmentedQuery Observable, []> & QueryableStorageEntry; /** @@ -912,6 +965,11 @@ declare module '@polkadot/api/types/storage' { * Hash of the previous block. **/ parentHash: AugmentedQuery Observable, []> & QueryableStorageEntry; + /** + * True if we have upgraded so that AccountInfo contains two types of `RefCount`. False + * (default) if not. + **/ + upgradedToDualRefCount: AugmentedQuery Observable, []> & QueryableStorageEntry; /** * True if we have upgraded so that `type RefCount` is `u32`. False (default) if not. **/ diff --git a/packages/api/src/augment/tx.ts b/packages/api/src/augment/tx.ts index 9407ae5b21..bcc67be6f7 100644 --- a/packages/api/src/augment/tx.ts +++ b/packages/api/src/augment/tx.ts @@ -1,14 +1,14 @@ // Auto-generated via `yarn polkadot-types-from-chain`, do not edit /* eslint-disable */ -import type { Bytes, Compact, Data, Option, U8aFixed, Vec, bool, u16, u32, u64 } from '@polkadot/types'; +import type { Bytes, Compact, Data, Option, U8aFixed, Vec, bool, u16, u32, u64, u8 } from '@polkadot/types'; import type { AnyNumber, ITuple } from '@polkadot/types/types'; import type { TAssetBalance } from '@polkadot/types/interfaces/assets'; import type { BabeEquivocationProof } from '@polkadot/types/interfaces/babe'; import type { MemberCount, ProposalIndex } from '@polkadot/types/interfaces/collective'; import type { CodeHash, Gas, Schedule } from '@polkadot/types/interfaces/contracts'; import type { AccountVote, Conviction, PropIndex, Proposal, ReferendumIndex } from '@polkadot/types/interfaces/democracy'; -import type { DefunctVoter, Renouncing } from '@polkadot/types/interfaces/elections'; +import type { Renouncing } from '@polkadot/types/interfaces/elections'; import type { Extrinsic, Signature } from '@polkadot/types/interfaces/extrinsics'; import type { GrandpaEquivocationProof, KeyOwnerProof } from '@polkadot/types/interfaces/grandpa'; import type { IdentityFields, IdentityInfo, IdentityJudgement, RegistrarIndex } from '@polkadot/types/interfaces/identity'; @@ -158,6 +158,18 @@ declare module '@polkadot/api/types/submittable' { * Weight: `O(1)` **/ freeze: AugmentedSubmittable<(id: Compact | AnyNumber | Uint8Array, who: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array) => SubmittableExtrinsic, [Compact, LookupSource]>; + /** + * Disallow further unprivileged transfers for the asset class. + * + * Origin must be Signed and the sender should be the Freezer of the asset `id`. + * + * - `id`: The identifier of the asset to be frozen. + * + * Emits `Frozen`. + * + * Weight: `O(1)` + **/ + freezeAsset: AugmentedSubmittable<(id: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Compact]>; /** * Mint assets of a particular class. * @@ -173,7 +185,46 @@ declare module '@polkadot/api/types/submittable' { * 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, [Compact, LookupSource, Compact]>; + /** + * Set the maximum number of zombie accounts for an asset. + * + * Origin must be Signed and the sender should be the Owner of the asset `id`. + * + * Funds of sender are reserved according to the formula: + * `AssetDepositBase + AssetDepositPerZombie * max_zombies` taking into account + * any already reserved funds. + * + * - `id`: The identifier of the asset to update zombie count. + * - `max_zombies`: The new number of zombies allowed for this asset. + * + * Emits `MaxZombiesChanged`. + * + * Weight: `O(1)` + **/ setMaxZombies: AugmentedSubmittable<(id: Compact | AnyNumber | Uint8Array, maxZombies: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Compact, Compact]>; + /** + * Set the metadata for an asset. + * + * NOTE: There is no `unset_metadata` call. Simply pass an empty name, symbol, + * and 0 decimals to this function to remove the metadata of an asset and + * return your deposit. + * + * Origin must be Signed and the sender should be the Owner of the asset `id`. + * + * Funds of sender are reserved according to the formula: + * `MetadataDepositBase + MetadataDepositPerByte * (name.len + symbol.len)` taking into + * account any already reserved funds. + * + * - `id`: The identifier of the asset to update. + * - `name`: The user friendly name of this asset. Limited in length by `StringLimit`. + * - `symbol`: The exchange symbol for this asset. Limited in length by `StringLimit`. + * - `decimals`: The number of decimals this asset uses to represent one unit. + * + * Emits `MaxZombiesChanged`. + * + * Weight: `O(1)` + **/ + setMetadata: AugmentedSubmittable<(id: Compact | AnyNumber | Uint8Array, name: Bytes | string | Uint8Array, symbol: Bytes | string | Uint8Array, decimals: u8 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Compact, Bytes, Bytes, u8]>; /** * Change the Issuer, Admin and Freezer of an asset. * @@ -202,6 +253,18 @@ declare module '@polkadot/api/types/submittable' { * Weight: `O(1)` **/ thaw: AugmentedSubmittable<(id: Compact | AnyNumber | Uint8Array, who: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array) => SubmittableExtrinsic, [Compact, LookupSource]>; + /** + * Allow unprivileged transfers for the asset again. + * + * Origin must be Signed and the sender should be the Admin of the asset `id`. + * + * - `id`: The identifier of the asset to be frozen. + * + * Emits `Thawed`. + * + * Weight: `O(1)` + **/ + thawAsset: AugmentedSubmittable<(id: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Compact]>; /** * Move some assets from the sender account to another. * @@ -477,11 +540,15 @@ declare module '@polkadot/api/types/submittable' { **/ 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. + * 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. * - * If contract is not evicted as a result of this call, no actions are taken and - * the sender is not eligible for the reward. + * In case of a successful eviction no fees are charged from the sender. However, the + * reward is capped by the total amount of rent that was payed by the contract while + * it was alive. + * + * If contract is not evicted as a result of this call, [`Error::ContractNotEvictable`] + * is returned and the sender is not eligible for the reward. **/ claimSurcharge: AugmentedSubmittable<(dest: AccountId | string | Uint8Array, auxSender: Option | null | object | string | Uint8Array) => SubmittableExtrinsic, [AccountId, Option]>; /** @@ -986,6 +1053,19 @@ declare module '@polkadot/api/types/submittable' { }; elections: { [key: string]: SubmittableExtrinsicFunction; + /** + * Clean all voters who are defunct (i.e. they do not serve any purpose at all). The + * deposit of the removed voters are returned. + * + * This is an root function to be used only for cleaning the state. + * + * The dispatch origin of this call must be root. + * + * # + * The total number of voters and those that are defunct must be provided as witness data. + * # + **/ + cleanDefunctVoters: AugmentedSubmittable<(numVoters: u32 | AnyNumber | Uint8Array, numDefunct: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u32, u32]>; /** * Remove a particular member from the set. This is effective immediately and the bond of * the outgoing member is slashed. @@ -993,125 +1073,59 @@ declare module '@polkadot/api/types/submittable' { * If a runner-up is available, then the best runner-up will be removed and replaces the * outgoing member. Otherwise, a new phragmen election is started. * + * The dispatch origin of this call must be root. + * * Note that this does not affect the designated block number of the next election. * * # - * If we have a replacement: - * - Base weight: 50.93 µs - * - State reads: - * - RunnersUp.len() - * - Members, RunnersUp (remove_and_replace_member) - * - State writes: - * - Members, RunnersUp (remove_and_replace_member) - * Else, since this is a root call and will go into phragmen, we assume full block for now. + * If we have a replacement, we use a small weight. 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, [LookupSource, bool]>; /** - * Remove `origin` as a voter. This removes the lock and returns the bond. + * Remove `origin` as a voter. * - * # - * Base weight: 36.8 µs - * All state access is from do_remove_voter. - * State reads: - * - Voting - * - [AccountData(who)] - * State writes: - * - Voting - * - Locks - * - [AccountData(who)] - * # + * This removes the lock and returns the deposit. + * + * The dispatch origin of this call must be signed and be a voter. **/ removeVoter: AugmentedSubmittable<() => SubmittableExtrinsic, []>; /** * Renounce one's intention to be a candidate for the next election round. 3 potential * outcomes exist: - * - `origin` is a candidate and not elected in any set. In this case, the bond is + * + * - `origin` is a candidate and not elected in any set. In this case, the deposit is * unreserved, returned and origin is removed as a candidate. - * - `origin` is a current runner-up. In this case, the bond is unreserved, returned and + * - `origin` is a current runner-up. In this case, the deposit is unreserved, returned and * origin is removed as a runner-up. - * - `origin` is a current member. In this case, the bond is unreserved and origin is + * - `origin` is a current member. In this case, the deposit is unreserved and origin is * removed as a member, consequently not being a candidate for the next round anymore. - * Similar to [`remove_voter`], if replacement runners exists, they are immediately used. - * - * If a candidate is renouncing: - * Base weight: 17.28 µs - * Complexity of candidate_count: 0.235 µs - * State reads: - * - Candidates - * - [AccountBalance(who) (unreserve)] - * State writes: - * - Candidates - * - [AccountBalance(who) (unreserve)] - * If member is renouncing: - * Base weight: 46.25 µs - * State reads: - * - Members, RunnersUp (remove_and_replace_member), - * - [AccountData(who) (unreserve)] - * State writes: - * - Members, RunnersUp (remove_and_replace_member), - * - [AccountData(who) (unreserve)] - * If runner is renouncing: - * Base weight: 46.25 µs - * State reads: - * - RunnersUp (remove_and_replace_member), - * - [AccountData(who) (unreserve)] - * State writes: - * - RunnersUp (remove_and_replace_member), - * - [AccountData(who) (unreserve)] - * + * Similar to [`remove_members`], if replacement runners exists, they are immediately used. + * If the prime is renouncing, then no prime will exist until the next round. + * + * The dispatch origin of this call must be signed, and have one of the above roles. + * + * # + * The type of renouncing must be provided as witness data. + * # **/ 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 - * their bond is slashed. + * Submit oneself for candidacy. A fixed amount of deposit is recorded. * - * A defunct voter is defined to be: - * - a voter whose current submitted votes are all invalid. i.e. all of them are no - * longer a candidate nor an active member or a runner-up. + * All candidates are wiped at the end of the term. They either become a member/runner-up, + * or leave the system while their deposit is slashed. * + * The dispatch origin of this call must be signed. * - * The origin must provide the number of current candidates and votes of the reported target - * for the purpose of accurate weight calculation. + * ### Warning + * + * Even if a candidate ends up being a member, they must call [`Call::renounce_candidacy`] + * to get their deposit back. Losing the spot in an election will always lead to a slash. * * # - * No Base weight based on min square analysis. - * Complexity of candidate_count: 1.755 µs - * Complexity of vote_count: 18.51 µs - * State reads: - * - Voting(reporter) - * - Candidate.len() - * - Voting(Target) - * - Candidates, Members, RunnersUp (is_defunct_voter) - * State writes: - * - Lock(reporter || target) - * - [AccountBalance(reporter)] + AccountBalance(target) - * - Voting(reporter || target) - * 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, [DefunctVoter]>; - /** - * Submit oneself for candidacy. - * - * A candidate will either: - * - Lose at the end of the term and forfeit their deposit. - * - Win and become a member. Members will eventually get their stash back. - * - Become a runner-up. Runners-ups are reserved members in case one gets forcefully - * removed. - * - * # - * Base weight = 33.33 µs - * Complexity of candidate_count: 0.375 µs - * State reads: - * - Candidates - * - Members - * - RunnersUp - * - [AccountBalance(who)] - * State writes: - * - [AccountBalance(who)] - * - Candidates + * The number of current candidates must be provided as witness data. * # **/ submitCandidacy: AugmentedSubmittable<(candidateCount: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Compact]>; @@ -1119,28 +1133,25 @@ declare module '@polkadot/api/types/submittable' { * 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. * - * Upon initial voting, `value` units of `who`'s balance is locked and a bond amount is - * reserved. + * Upon initial voting, `value` units of `who`'s balance is locked and a deposit amount is + * reserved. The deposit is based on the number of votes and can be updated over time. * * The `votes` should: * - not be empty. * - be less than the number of possible candidates. Note that all current members and * runners-up are also automatically candidates for the next round. * - * It is the responsibility of the caller to not place all of their balance into the lock - * and keep some for further transactions. + * If `value` is more than `who`'s total balance, then the maximum of the two is used. + * + * The dispatch origin of this call must be signed. + * + * ### Warning + * + * It is the responsibility of the caller to **NOT** place all of their balance into the + * lock and keep some for further operations. * * # - * Base weight: 47.93 µs - * State reads: - * - Candidates.len() + Members.len() + RunnersUp.len() - * - Voting (is_voter) - * - Lock - * - [AccountBalance(who) (unreserve + total_balance)] - * State writes: - * - Voting - * - Lock - * - [AccountBalance(who) (unreserve -- only when creating a new voter)] + * We assume the maximum weight among all 3 cases: vote_equal, vote_more and vote_less. * # **/ vote: AugmentedSubmittable<(votes: Vec | (AccountId | string | Uint8Array)[], value: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Vec, Compact]>; @@ -1568,6 +1579,52 @@ declare module '@polkadot/api/types/submittable' { **/ transfer: AugmentedSubmittable<(updated: AccountId | string | Uint8Array, index: AccountIndex | AnyNumber | Uint8Array) => SubmittableExtrinsic, [AccountId, AccountIndex]>; }; + lottery: { + [key: string]: SubmittableExtrinsicFunction; + /** + * Buy a ticket to enter the lottery. + * + * This extrinsic acts as a passthrough function for `call`. In all + * situations where `call` alone would succeed, this extrinsic should + * succeed. + * + * If `call` is successful, then we will attempt to purchase a ticket, + * which may fail silently. To detect success of a ticket purchase, you + * should listen for the `TicketBought` event. + * + * This extrinsic must be called by a signed origin. + **/ + buyTicket: AugmentedSubmittable<(call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic, [Call]>; + /** + * Set calls in storage which can be used to purchase a lottery ticket. + * + * This function only matters if you use the `ValidateCall` implementation + * provided by this pallet, which uses storage to determine the valid calls. + * + * This extrinsic must be called by the Manager origin. + **/ + setCalls: AugmentedSubmittable<(calls: Vec | (Call | { callIndex?: any; args?: any } | string | Uint8Array)[]) => SubmittableExtrinsic, [Vec]>; + /** + * Start a lottery using the provided configuration. + * + * This extrinsic must be called by the `ManagerOrigin`. + * + * Parameters: + * + * * `price`: The cost of a single ticket. + * * `length`: How long the lottery should run for starting at the current block. + * * `delay`: How long after the lottery end we should wait before picking a winner. + * * `repeat`: If the lottery should repeat when completed. + **/ + startLottery: AugmentedSubmittable<(price: BalanceOf | AnyNumber | Uint8Array, length: BlockNumber | AnyNumber | Uint8Array, delay: BlockNumber | AnyNumber | Uint8Array, repeat: bool | boolean | Uint8Array) => SubmittableExtrinsic, [BalanceOf, BlockNumber, BlockNumber, bool]>; + /** + * If a lottery is repeating, you can use this to stop the repeat. + * The lottery will continue to run to completion. + * + * This extrinsic must be called by the `ManagerOrigin`. + **/ + stopRepeat: AugmentedSubmittable<() => SubmittableExtrinsic, []>; + }; multisig: { [key: string]: SubmittableExtrinsicFunction; /** @@ -2676,6 +2733,22 @@ declare module '@polkadot/api/types/submittable' { * # **/ increaseValidatorCount: AugmentedSubmittable<(additional: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Compact]>; + /** + * Remove the given nominations from the calling validator. + * + * Effects will be felt at the beginning of the next era. + * + * The dispatch origin for this call must be _Signed_ by the controller, not the stash. + * And, it can be only called when [`EraElectionStatus`] is `Closed`. The controller + * account should represent a validator. + * + * - `who`: A list of nominator stash accounts who are nominating this validator which + * should no longer be nominating this validator. + * + * Note: Making this call only makes sense if you first set the validator preferences to + * block any further nominations. + **/ + kick: AugmentedSubmittable<(who: Vec | (LookupSource | Address | AccountId | AccountIndex | string | Uint8Array)[]) => SubmittableExtrinsic, [Vec]>; /** * Declare the desire to nominate `targets` for the origin controller. * @@ -2730,9 +2803,9 @@ declare module '@polkadot/api/types/submittable' { **/ 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. + * Remove all data structure concerning a staker/stash once its balance is at the minimum. * This is essentially equivalent to `withdraw_unbonded` except it can be called by anyone - * and the target `stash` must have no funds left. + * and the target `stash` must have no funds left beyond the ED. * * This can be called from any origin. * @@ -3167,19 +3240,6 @@ declare module '@polkadot/api/types/submittable' { * # **/ 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. - * - * # - * - `O(1)` - * - 1 storage read and deletion. - * -------------------- - * Base Weight: 8.626 µs - * No DB Read or Write operations because caller is already in overlay - * # - **/ - suicide: AugmentedSubmittable<() => SubmittableExtrinsic, []>; }; technicalCommittee: { [key: string]: SubmittableExtrinsicFunction; diff --git a/packages/metadata/package.json b/packages/metadata/package.json index 9d0590f58e..b46db95b9d 100644 --- a/packages/metadata/package.json +++ b/packages/metadata/package.json @@ -1,6 +1,6 @@ { "name": "@polkadot/metadata", - "version": "3.5.2-4", + "version": "3.5.2-5", "description": "Helpers to extract information from runtime metadata", "main": "index.js", "module": "index.mjs", @@ -17,8 +17,8 @@ "homepage": "https://github.com/polkadot-js/api/tree/master/packages/type-metadata#readme", "dependencies": { "@babel/runtime": "^7.12.5", - "@polkadot/types": "3.5.2-4", - "@polkadot/types-known": "3.5.2-4", + "@polkadot/types": "3.5.2-5", + "@polkadot/types-known": "3.5.2-5", "@polkadot/util": "^5.3.2-3", "@polkadot/util-crypto": "^5.3.2-3", "bn.js": "^4.11.9" diff --git a/packages/rpc-core/package.json b/packages/rpc-core/package.json index e64368f54d..d4a2f120a3 100644 --- a/packages/rpc-core/package.json +++ b/packages/rpc-core/package.json @@ -1,6 +1,6 @@ { "name": "@polkadot/rpc-core", - "version": "3.5.2-4", + "version": "3.5.2-5", "description": "A JavaScript wrapper for the Polkadot JsonRPC interface", "main": "index.js", "module": "index.mjs", @@ -14,9 +14,9 @@ "homepage": "https://github.com/polkadot-js/api/tree/master/packages/rpc-core#readme", "dependencies": { "@babel/runtime": "^7.12.5", - "@polkadot/metadata": "3.5.2-4", - "@polkadot/rpc-provider": "3.5.2-4", - "@polkadot/types": "3.5.2-4", + "@polkadot/metadata": "3.5.2-5", + "@polkadot/rpc-provider": "3.5.2-5", + "@polkadot/types": "3.5.2-5", "@polkadot/util": "^5.3.2-3", "@polkadot/x-rxjs": "3.5.2-1" }, diff --git a/packages/rpc-provider/package.json b/packages/rpc-provider/package.json index 4b9576c5fc..3756bda3bd 100644 --- a/packages/rpc-provider/package.json +++ b/packages/rpc-provider/package.json @@ -1,6 +1,6 @@ { "name": "@polkadot/rpc-provider", - "version": "3.5.2-4", + "version": "3.5.2-5", "description": "Transport providers for the API", "main": "index.js", "module": "index.mjs", @@ -14,7 +14,7 @@ "homepage": "https://github.com/polkadot-js/api/tree/master/packages/rpc-provider#readme", "dependencies": { "@babel/runtime": "^7.12.5", - "@polkadot/types": "3.5.2-4", + "@polkadot/types": "3.5.2-5", "@polkadot/util": "^5.3.2-3", "@polkadot/util-crypto": "^5.3.2-3", "@polkadot/x-fetch": "^5.3.2-3", @@ -24,7 +24,7 @@ }, "devDependencies": { "@polkadot/keyring": "^5.3.2-3", - "@polkadot/metadata": "3.5.2-4", + "@polkadot/metadata": "3.5.2-5", "mock-socket": "^9.0.3", "nock": "^13.0.5" } diff --git a/packages/typegen/package.json b/packages/typegen/package.json index eef5fd6ac0..d9e2cd92ca 100644 --- a/packages/typegen/package.json +++ b/packages/typegen/package.json @@ -1,6 +1,6 @@ { "name": "@polkadot/typegen", - "version": "3.5.2-4", + "version": "3.5.2-5", "description": "Type generation scripts", "main": "index.js", "module": "index.mjs", @@ -23,10 +23,10 @@ "@babel/core": "^7.12.10", "@babel/register": "^7.12.10", "@babel/runtime": "^7.12.5", - "@polkadot/api": "3.5.2-4", - "@polkadot/metadata": "3.5.2-4", - "@polkadot/rpc-provider": "3.5.2-4", - "@polkadot/types": "3.5.2-4", + "@polkadot/api": "3.5.2-5", + "@polkadot/metadata": "3.5.2-5", + "@polkadot/rpc-provider": "3.5.2-5", + "@polkadot/types": "3.5.2-5", "@polkadot/util": "^5.3.2-3", "handlebars": "^4.7.6", "websocket": "^1.0.33", diff --git a/packages/types-known/package.json b/packages/types-known/package.json index 040b45098c..a3ba09f7e1 100644 --- a/packages/types-known/package.json +++ b/packages/types-known/package.json @@ -1,6 +1,6 @@ { "name": "@polkadot/types-known", - "version": "3.5.2-4", + "version": "3.5.2-5", "description": "A JavaScript wrapper for the Polkadot JsonRPC interface", "main": "index.js", "module": "index.mjs", @@ -14,7 +14,7 @@ "homepage": "https://github.com/polkadot-js/api/tree/master/packages/types-known#readme", "dependencies": { "@babel/runtime": "^7.12.5", - "@polkadot/types": "3.5.2-4", + "@polkadot/types": "3.5.2-5", "@polkadot/util": "^5.3.2-3", "bn.js": "^4.11.9" }, diff --git a/packages/types/package.json b/packages/types/package.json index 378ecd83e3..1c37a41ebd 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@polkadot/types", - "version": "3.5.2-4", + "version": "3.5.2-5", "description": "Implementation of the Parity codec", "main": "index.js", "module": "index.mjs", @@ -17,7 +17,7 @@ "homepage": "https://github.com/polkadot-js/api/tree/master/packages/types#readme", "dependencies": { "@babel/runtime": "^7.12.5", - "@polkadot/metadata": "3.5.2-4", + "@polkadot/metadata": "3.5.2-5", "@polkadot/util": "^5.3.2-3", "@polkadot/util-crypto": "^5.3.2-3", "@polkadot/x-rxjs": "3.5.2-1", diff --git a/packages/types/src/augment/registry.ts b/packages/types/src/augment/registry.ts index 489e34d3dc..2611a9d6c9 100644 --- a/packages/types/src/augment/registry.ts +++ b/packages/types/src/augment/registry.ts @@ -2,7 +2,7 @@ /* eslint-disable */ import type { BitVec, Bool, Bytes, Compact, Data, DoNotConstruct, I128, I16, I256, I32, I64, I8, Json, Null, Option, Raw, StorageKey, Text, Type, U128, U16, U256, U32, U64, U8, USize, Vec, bool, i128, i16, i256, i32, i64, i8, u128, u16, u256, u32, u64, u8, usize } from '@polkadot/types'; -import type { AssetBalance, AssetDetails, TAssetBalance, TAssetDepositBalance } from '@polkadot/types/interfaces/assets'; +import type { AssetBalance, AssetDetails, AssetMetadata, TAssetBalance, TAssetDepositBalance } from '@polkadot/types/interfaces/assets'; import type { BlockAttestations, IncludedBlocks, MoreAttestations } from '@polkadot/types/interfaces/attestations'; import type { RawAuraPreDigest } from '@polkadot/types/interfaces/aura'; import type { ExtrinsicOrHash, ExtrinsicStatus } from '@polkadot/types/interfaces/author'; @@ -43,10 +43,10 @@ import type { SiField, SiLookupTypeId, SiPath, SiType, SiTypeDef, SiTypeDefArray import type { Period, Priority, SchedulePeriod, SchedulePriority, Scheduled, ScheduledTo254, TaskAddress } from '@polkadot/types/interfaces/scheduler'; import type { FullIdentification, IdentificationTuple, Keys, MembershipProof, SessionIndex, SessionKeys1, SessionKeys2, SessionKeys3, SessionKeys4, SessionKeys5, SessionKeys6, SessionKeys7, SessionKeys8, SessionKeys9, ValidatorCount } from '@polkadot/types/interfaces/session'; import type { Bid, BidKind, SocietyJudgement, SocietyVote, StrikeCount, VouchingStatus } from '@polkadot/types/interfaces/society'; -import type { ActiveEraInfo, CompactAssignments, CompactAssignmentsTo257, CompactScore, CompactScoreCompact, ElectionCompute, ElectionResult, ElectionScore, ElectionSize, ElectionStatus, EraIndex, EraPoints, EraRewardPoints, EraRewards, Exposure, Forcing, IndividualExposure, KeyType, MomentOf, Nominations, NominatorIndex, NominatorIndexCompact, OffchainAccuracy, OffchainAccuracyCompact, PhragmenScore, Points, RewardDestination, RewardDestinationTo257, RewardPoint, SlashJournalEntry, SlashingSpans, SlashingSpansTo204, SpanIndex, SpanRecord, StakingLedger, StakingLedgerTo223, StakingLedgerTo240, UnappliedSlash, UnappliedSlashOther, UnlockChunk, ValidatorIndex, ValidatorIndexCompact, ValidatorPrefs, ValidatorPrefsTo145, ValidatorPrefsTo196, ValidatorPrefsWithBlocked, ValidatorPrefsWithCommission } from '@polkadot/types/interfaces/staking'; +import type { ActiveEraInfo, CompactAssignments, CompactAssignmentsTo257, CompactScore, CompactScoreCompact, ElectionCompute, ElectionResult, ElectionScore, ElectionSize, ElectionStatus, EraIndex, EraPoints, EraRewardPoints, EraRewards, Exposure, Forcing, IndividualExposure, KeyType, MomentOf, Nominations, NominatorIndex, NominatorIndexCompact, OffchainAccuracy, OffchainAccuracyCompact, PhragmenScore, Points, RewardDestination, RewardDestinationTo257, RewardPoint, SeatHolder, SlashJournalEntry, SlashingSpans, SlashingSpansTo204, SpanIndex, SpanRecord, StakingLedger, StakingLedgerTo223, StakingLedgerTo240, UnappliedSlash, UnappliedSlashOther, UnlockChunk, ValidatorIndex, ValidatorIndexCompact, ValidatorPrefs, ValidatorPrefsTo145, ValidatorPrefsTo196, ValidatorPrefsWithBlocked, ValidatorPrefsWithCommission, Voter } from '@polkadot/types/interfaces/staking'; import type { ApiId, KeyValueOption, ReadProof, RuntimeVersion, RuntimeVersionApi, StorageChangeSet } from '@polkadot/types/interfaces/state'; import type { WeightToFeeCoefficient } from '@polkadot/types/interfaces/support'; -import type { AccountInfo, AccountInfoWithProviders, AccountInfoWithRefCount, ApplyExtrinsicResult, BlockWeights, ChainProperties, ChainType, ConsumedWeight, DigestOf, DispatchClass, DispatchError, DispatchErrorModule, DispatchErrorTo198, DispatchInfo, DispatchInfoTo190, DispatchInfoTo244, DispatchOutcome, DispatchResult, DispatchResultOf, DispatchResultTo198, Event, EventId, EventIndex, EventRecord, Health, InvalidTransaction, Key, LastRuntimeUpgradeInfo, NetworkState, NetworkStatePeerset, NetworkStatePeersetInfo, NodeRole, NotConnectedPeer, Peer, PeerEndpoint, PeerEndpointAddr, PeerInfo, PeerPing, PerDispatchClass, Phase, RawOrigin, RefCount, RefCountTo259, SyncState, SystemOrigin, TransactionValidityError, UnknownTransaction, WeightPerClass } from '@polkadot/types/interfaces/system'; +import type { AccountInfo, AccountInfoWithProviders, AccountInfoWithRefCount, ApplyExtrinsicResult, BlockLength, BlockWeights, ChainProperties, ChainType, ConsumedWeight, DigestOf, DispatchClass, DispatchError, DispatchErrorModule, DispatchErrorTo198, DispatchInfo, DispatchInfoTo190, DispatchInfoTo244, DispatchOutcome, DispatchResult, DispatchResultOf, DispatchResultTo198, Event, EventId, EventIndex, EventRecord, Health, InvalidTransaction, Key, LastRuntimeUpgradeInfo, NetworkState, NetworkStatePeerset, NetworkStatePeersetInfo, NodeRole, NotConnectedPeer, Peer, PeerEndpoint, PeerEndpointAddr, PeerInfo, PeerPing, PerDispatchClass, PerDispatchClassU32, Phase, RawOrigin, RefCount, RefCountTo259, SyncState, SystemOrigin, TransactionValidityError, UnknownTransaction, WeightPerClass } from '@polkadot/types/interfaces/system'; import type { Bounty, BountyIndex, BountyStatus, BountyStatusActive, BountyStatusCuratorProposed, BountyStatusPendingPayout, OpenTip, OpenTipFinderTo225, OpenTipTip, OpenTipTo225, TreasuryProposal } from '@polkadot/types/interfaces/treasury'; import type { Multiplier } from '@polkadot/types/interfaces/txpayment'; import type { Multisig, Timepoint } from '@polkadot/types/interfaces/utility'; @@ -169,6 +169,7 @@ declare module '@polkadot/types/types/registry' { 'Option': Option; 'Option': Option; 'Option': Option; + 'Option': Option; 'Option': Option; 'Option': Option; 'Option': Option; @@ -201,6 +202,7 @@ declare module '@polkadot/types/types/registry' { 'Option': Option; 'Option': Option; 'Option': Option; + 'Option': Option; 'Option': Option; 'Option': Option; 'Option': Option; @@ -589,6 +591,7 @@ declare module '@polkadot/types/types/registry' { 'Option': Option; 'Option': Option; 'Option': Option; + 'Option': Option; 'Option': Option; 'Option': Option; 'Option': Option; @@ -679,6 +682,7 @@ declare module '@polkadot/types/types/registry' { 'Option': Option; 'Option': Option; 'Option': Option; + 'Option': Option; 'Option': Option; 'Option': Option; 'Option': Option; @@ -821,6 +825,7 @@ declare module '@polkadot/types/types/registry' { 'Option': Option; 'Option': Option; 'Option': Option; + 'Option': Option; 'Option': Option; 'Option': Option; 'Option': Option; @@ -880,6 +885,7 @@ declare module '@polkadot/types/types/registry' { 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; + 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; @@ -912,6 +918,7 @@ declare module '@polkadot/types/types/registry' { 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; + 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; @@ -1300,6 +1307,7 @@ declare module '@polkadot/types/types/registry' { 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; + 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; @@ -1390,6 +1398,7 @@ declare module '@polkadot/types/types/registry' { 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; + 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; @@ -1532,6 +1541,7 @@ declare module '@polkadot/types/types/registry' { 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; + 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; @@ -1591,6 +1601,7 @@ declare module '@polkadot/types/types/registry' { AssetDetails: AssetDetails; AssetId: AssetId; AssetInstance: AssetInstance; + AssetMetadata: AssetMetadata; AssetOptions: AssetOptions; AssignmentId: AssignmentId; AssignmentKind: AssignmentKind; @@ -1623,6 +1634,7 @@ declare module '@polkadot/types/types/registry' { Block: Block; BlockAttestations: BlockAttestations; BlockHash: BlockHash; + BlockLength: BlockLength; BlockNumber: BlockNumber; BlockWeights: BlockWeights; bool: bool; @@ -2011,6 +2023,7 @@ declare module '@polkadot/types/types/registry' { Perbill: Perbill; Percent: Percent; PerDispatchClass: PerDispatchClass; + PerDispatchClassU32: PerDispatchClassU32; Period: Period; Permill: Permill; PermissionLatest: PermissionLatest; @@ -2101,6 +2114,7 @@ declare module '@polkadot/types/types/registry' { Scheduling: Scheduling; Seal: Seal; SealV0: SealV0; + SeatHolder: SeatHolder; SeedOf: SeedOf; SessionIndex: SessionIndex; SessionInfo: SessionInfo; @@ -2243,6 +2257,7 @@ declare module '@polkadot/types/types/registry' { VestingSchedule: VestingSchedule; Vote: Vote; VoteIndex: VoteIndex; + Voter: Voter; VoterInfo: VoterInfo; Votes: Votes; VotesTo230: VotesTo230; diff --git a/packages/types/src/interfaces/assets/types.ts b/packages/types/src/interfaces/assets/types.ts index 007ee867b4..d9bba6b83b 100644 --- a/packages/types/src/interfaces/assets/types.ts +++ b/packages/types/src/interfaces/assets/types.ts @@ -1,7 +1,7 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import type { Struct, bool, u32, u64 } from '@polkadot/types'; +import type { Bytes, Struct, bool, u32, u64, u8 } from '@polkadot/types'; import type { AccountId, BalanceOf } from '@polkadot/types/interfaces/runtime'; /** @name AssetBalance */ @@ -25,6 +25,14 @@ export interface AssetDetails extends Struct { readonly accounts: u32; } +/** @name AssetMetadata */ +export interface AssetMetadata extends Struct { + readonly deposit: TAssetDepositBalance; + readonly name: Bytes; + readonly symbol: Bytes; + readonly decimals: u8; +} + /** @name TAssetBalance */ export interface TAssetBalance extends u64 {} diff --git a/packages/types/src/interfaces/staking/types.ts b/packages/types/src/interfaces/staking/types.ts index 9617406e80..3c1a4ef17f 100644 --- a/packages/types/src/interfaces/staking/types.ts +++ b/packages/types/src/interfaces/staking/types.ts @@ -180,6 +180,13 @@ export interface RewardDestinationTo257 extends Enum { /** @name RewardPoint */ export interface RewardPoint extends u32 {} +/** @name SeatHolder */ +export interface SeatHolder extends Struct { + readonly who: AccountId; + readonly stake: Balance; + readonly deposit: Balance; +} + /** @name SlashingSpans */ export interface SlashingSpans extends Struct { readonly spanIndex: SpanIndex; @@ -286,4 +293,11 @@ export interface ValidatorPrefsWithCommission extends Struct { readonly commission: Compact; } +/** @name Voter */ +export interface Voter extends Struct { + readonly votes: Vec; + readonly stake: Balance; + readonly deposit: Balance; +} + export type PHANTOM_STAKING = 'staking'; diff --git a/packages/types/src/interfaces/system/types.ts b/packages/types/src/interfaces/system/types.ts index 103e21b0c1..fec192dc92 100644 --- a/packages/types/src/interfaces/system/types.ts +++ b/packages/types/src/interfaces/system/types.ts @@ -32,6 +32,11 @@ export interface ApplyExtrinsicResult extends Result