Compare commits

...
10 Commits
Author SHA1 Message Date
github-actions[bot] a7752f3c18 [CI Skip] release/stable 7.0.2
skip-checks: true
2021-12-21 08:41:54 +00:00
Jaco 3a06775f9f 7.0.2 (#4375) 2021-12-21 10:34:28 +02:00
github-actions[bot] 936b5d9b72 [CI Skip] release/beta 7.0.2-3
skip-checks: true
2021-12-21 08:26:30 +00:00
Jaco 523f1622b5 Collective aliases (don't apply to derive naming) (#4374)
* Collective aliases (don't apply to derive naming)

* Fix build (aka new form apply to prime)
2021-12-21 10:17:41 +02:00
github-actions[bot] a2c027b7b7 [CI Skip] release/beta 7.0.2-2
skip-checks: true
2021-12-21 08:16:23 +00:00
Jaco d13f66eb5b Prep for preimage pallet usage (#4372)
* Prep for preimage pallet usage

* info uses derives

* adjust
2021-12-21 10:07:13 +02:00
github-actions[bot] 9f400ea15c [CI Skip] release/beta 7.0.2-1
skip-checks: true
2021-12-21 06:42:37 +00:00
Jaco c0e841031a Update Substrate metadata & scheduler usage (#4371) 2021-12-21 08:33:23 +02:00
github-actions[bot] 34f6b7b560 [CI Skip] release/beta 7.0.2-0
skip-checks: true
2021-12-20 16:05:36 +00:00
Jaco 55fe455713 Small import cleanups (#4368) 2021-12-20 17:58:16 +02:00
65 changed files with 4447 additions and 3506 deletions
+3 -1
View File
@@ -45,4 +45,6 @@
6.7.2
6.9.2
6.10.2
6.10.3
6.10.3
7.0.2
+11
View File
@@ -1,5 +1,16 @@
# CHANGELOG
## 7.0.2 Dec 21, 2021
Upgrade priority: Low. Recommended for applications where collective derives with aliasses are being used.
Changes:
- Fix alias module mapping in collective derives
- Update `dispathchQueue` derive to align with latest Substrate
- Update to latest Substrate metadata
## 7.0.1 Dec 20, 2021
Upgrade priority: Low. Recommended for TS users with their own non-Polkadot/Kusama chains.
+2 -2
View File
@@ -11,7 +11,7 @@
},
"sideEffects": false,
"type": "commonjs",
"version": "7.0.1",
"version": "7.0.2",
"workspaces": [
"packages/*"
],
@@ -34,7 +34,7 @@
"@babel/core": "^7.16.5",
"@babel/register": "^7.16.5",
"@babel/runtime": "^7.16.5",
"@polkadot/dev": "^0.64.8",
"@polkadot/dev": "^0.64.11",
"@polkadot/ts": "^0.4.20",
"@polkadot/typegen": "workspace:packages/typegen",
"@types/jest": "^27.0.3",
+6 -6
View File
@@ -20,15 +20,15 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "7.0.1",
"version": "7.0.2",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.16.5",
"@polkadot/api-base": "7.0.1",
"@polkadot/rpc-augment": "7.0.1",
"@polkadot/types": "7.0.1",
"@polkadot/types-augment": "7.0.1",
"@polkadot/types-codec": "7.0.1",
"@polkadot/api-base": "7.0.2",
"@polkadot/rpc-augment": "7.0.2",
"@polkadot/types": "7.0.2",
"@polkadot/types-augment": "7.0.2",
"@polkadot/types-codec": "7.0.2",
"@polkadot/util": "^8.2.2"
}
}
@@ -14,6 +14,11 @@ declare module '@polkadot/api-base/types/consts' {
* The amount of funds that must be reserved when creating a new approval.
**/
approvalDeposit: u128 & AugmentedConst<ApiType>;
/**
* The amount of funds that must be reserved for a non-provider asset account to be
* maintained.
**/
assetAccountDeposit: u128 & AugmentedConst<ApiType>;
/**
* The basic amount of funds that must be reserved for an asset.
**/
+56 -6
View File
@@ -6,6 +6,10 @@ import type { ApiTypes } from '@polkadot/api-base/types';
declare module '@polkadot/api-base/types/errors' {
export interface AugmentedErrors<ApiType extends ApiTypes> {
assets: {
/**
* The asset-account already exists.
**/
AlreadyExists: AugmentedError<ApiType>;
/**
* Invalid metadata given.
**/
@@ -18,10 +22,6 @@ declare module '@polkadot/api-base/types/errors' {
* Account balance must be greater than or equal to the transfer amount.
**/
BalanceLow: AugmentedError<ApiType>;
/**
* Balance should be non-zero.
**/
BalanceZero: AugmentedError<ApiType>;
/**
* The origin account is frozen.
**/
@@ -34,13 +34,22 @@ declare module '@polkadot/api-base/types/errors' {
* Minimum balance should be non-zero.
**/
MinBalanceZero: AugmentedError<ApiType>;
/**
* The account to alter does not exist.
**/
NoAccount: AugmentedError<ApiType>;
/**
* The asset-account doesn't have an associated deposit.
**/
NoDeposit: AugmentedError<ApiType>;
/**
* The signing account has no permission to do the operation.
**/
NoPermission: AugmentedError<ApiType>;
/**
* No provider reference exists to allow a non-zero balance of a non-self-sufficient
* asset.
* Unable to increment the consumer reference counters on the account. Either no provider
* reference exists to allow a non-zero balance of a non-self-sufficient asset, or the
* maximum number of consumers has been reached.
**/
NoProvider: AugmentedError<ApiType>;
/**
@@ -51,6 +60,10 @@ declare module '@polkadot/api-base/types/errors' {
* The given asset ID is unknown.
**/
Unknown: AugmentedError<ApiType>;
/**
* The operation would result in funds being burned.
**/
WouldBurn: AugmentedError<ApiType>;
/**
* The source account would not survive the transfer and it needs to stay alive.
**/
@@ -251,6 +264,13 @@ declare module '@polkadot/api-base/types/errors' {
* No contract was found at the specified address.
**/
ContractNotFound: AugmentedError<ApiType>;
/**
* The contract ran to completion but decided to revert its storage changes.
* Please note that this error is only returned from extrinsics. When called directly
* or via RPC an `Ok` will be returned. In this case the caller needs to inspect the flags
* to determine whether a reversion has taken place.
**/
ContractReverted: AugmentedError<ApiType>;
/**
* Contract trapped during execution.
**/
@@ -925,6 +945,36 @@ declare module '@polkadot/api-base/types/errors' {
**/
[key: string]: AugmentedError<ApiType>;
};
preimage: {
/**
* Preimage has already been noted on-chain.
**/
AlreadyNoted: AugmentedError<ApiType>;
/**
* The user is not authorized to perform this action.
**/
NotAuthorized: AugmentedError<ApiType>;
/**
* The preimage cannot be removed since it has not yet been noted.
**/
NotNoted: AugmentedError<ApiType>;
/**
* The preimage request cannot be removed since no outstanding requests exist.
**/
NotRequested: AugmentedError<ApiType>;
/**
* A preimage may not be removed when there are outstanding requests.
**/
Requested: AugmentedError<ApiType>;
/**
* Preimage is too large to store on-chain.
**/
TooLarge: AugmentedError<ApiType>;
/**
* Generic error
**/
[key: string]: AugmentedError<ApiType>;
};
proxy: {
/**
* Account is already a proxy.
+25 -3
View File
@@ -5,7 +5,7 @@ import type { ApiTypes } from '@polkadot/api-base/types';
import type { Bytes, Null, Option, Result, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec';
import type { ITuple } from '@polkadot/types-codec/types';
import type { AccountId32, H256 } from '@polkadot/types/interfaces/runtime';
import type { FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchInfo, NodeRuntimeProxyType, PalletDemocracyVoteAccountVote, PalletDemocracyVoteThreshold, PalletElectionProviderMultiPhaseElectionCompute, PalletImOnlineSr25519AppSr25519Public, PalletMultisigTimepoint, PalletStakingExposure, SpFinalityGrandpaAppPublic, SpRuntimeDispatchError } from '@polkadot/types/lookup';
import type { FrameSupportScheduleLookupError, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchInfo, NodeRuntimeProxyType, PalletDemocracyVoteAccountVote, PalletDemocracyVoteThreshold, PalletElectionProviderMultiPhaseElectionCompute, PalletImOnlineSr25519AppSr25519Public, PalletMultisigTimepoint, PalletStakingExposure, SpFinalityGrandpaAppPublic, SpRuntimeDispatchError } from '@polkadot/types/lookup';
declare module '@polkadot/api-base/types/events' {
export interface AugmentedEvents<ApiType extends ApiTypes> {
@@ -609,6 +609,24 @@ declare module '@polkadot/api-base/types/events' {
**/
[key: string]: AugmentedEvent<ApiType>;
};
preimage: {
/**
* A preimage has ben cleared.
**/
Cleared: AugmentedEvent<ApiType, [H256]>;
/**
* A preimage has been noted.
**/
Noted: AugmentedEvent<ApiType, [H256]>;
/**
* A preimage has been requested.
**/
Requested: AugmentedEvent<ApiType, [H256]>;
/**
* Generic event
**/
[key: string]: AugmentedEvent<ApiType>;
};
proxy: {
/**
* An announcement was placed to make a call in the future.
@@ -663,6 +681,10 @@ declare module '@polkadot/api-base/types/events' {
[key: string]: AugmentedEvent<ApiType>;
};
scheduler: {
/**
* The call for the provided hash was not found so the task has been aborted.
**/
CallLookupFailed: AugmentedEvent<ApiType, [ITuple<[u32, u32]>, Option<Bytes>, FrameSupportScheduleLookupError]>;
/**
* Canceled some task.
**/
@@ -829,9 +851,9 @@ declare module '@polkadot/api-base/types/events' {
};
sudo: {
/**
* The \[sudoer\] just switched identity; the old key is supplied.
* The \[sudoer\] just switched identity; the old key is supplied if one existed.
**/
KeyChanged: AugmentedEvent<ApiType, [AccountId32]>;
KeyChanged: AugmentedEvent<ApiType, [Option<AccountId32>]>;
/**
* A sudo just took place. \[result\]
**/
+25 -6
View File
@@ -6,16 +6,16 @@ import type { Data } from '@polkadot/types';
import type { BTreeMap, Bytes, Null, Option, U8aFixed, Vec, WrapperOpaque, bool, u128, u32, u64, u8 } from '@polkadot/types-codec';
import type { AnyNumber, ITuple } from '@polkadot/types-codec/types';
import type { AccountId32, Call, H256, Perbill, Percent } from '@polkadot/types/interfaces/runtime';
import type { FrameSupportWeightsPerDispatchClassU64, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, NodeRuntimeSessionKeys, PalletAssetsApproval, PalletAssetsAssetBalance, PalletAssetsAssetDetails, PalletAssetsAssetMetadata, PalletAuthorshipUncleEntryItem, PalletBagsListListBag, PalletBagsListListNode, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReleases, PalletBalancesReserveData, PalletBountiesBounty, PalletChildBountiesChildBounty, PalletCollectiveVotes, PalletContractsStorageDeletedContract, PalletContractsStorageRawContractInfo, PalletContractsWasmOwnerInfo, PalletContractsWasmPrefabWasmModule, PalletDemocracyPreimageStatus, PalletDemocracyReferendumInfo, PalletDemocracyReleases, PalletDemocracyVoteThreshold, PalletDemocracyVoteVoting, PalletElectionProviderMultiPhasePhase, PalletElectionProviderMultiPhaseReadySolution, PalletElectionProviderMultiPhaseRoundSnapshot, PalletElectionProviderMultiPhaseSignedSignedSubmission, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenSeatHolder, PalletElectionsPhragmenVoter, PalletGiltActiveGilt, PalletGiltActiveGiltsTotal, PalletGiltGiltBid, PalletGrandpaStoredPendingChange, PalletGrandpaStoredState, PalletIdentityRegistrarInfo, PalletIdentityRegistration, PalletImOnlineBoundedOpaqueNetworkState, PalletImOnlineSr25519AppSr25519Public, PalletLotteryLotteryConfig, PalletMultisigMultisig, PalletProxyAnnouncement, PalletProxyProxyDefinition, PalletRecoveryActiveRecovery, PalletRecoveryRecoveryConfig, PalletSchedulerReleases, PalletSchedulerScheduledV2, PalletSocietyBid, PalletSocietyBidKind, PalletSocietyVote, PalletSocietyVouchingStatus, PalletStakingActiveEraInfo, PalletStakingEraRewardPoints, PalletStakingExposure, PalletStakingForcing, PalletStakingNominations, PalletStakingReleases, PalletStakingRewardDestination, PalletStakingSlashingSlashingSpans, PalletStakingSlashingSpanRecord, PalletStakingStakingLedger, PalletStakingUnappliedSlash, PalletStakingValidatorPrefs, PalletTipsOpenTip, PalletTransactionPaymentReleases, PalletTransactionStorageTransactionInfo, PalletTreasuryProposal, PalletUniquesClassDetails, PalletUniquesClassMetadata, PalletUniquesInstanceDetails, PalletUniquesInstanceMetadata, PalletVestingReleases, PalletVestingVestingInfo, SpAuthorityDiscoveryAppPublic, SpConsensusBabeAppPublic, SpConsensusBabeBabeEpochConfiguration, SpConsensusBabeDigestsNextConfigDescriptor, SpCoreCryptoKeyTypeId, SpRuntimeDigest, SpStakingOffenceOffenceDetails } from '@polkadot/types/lookup';
import type { FrameSupportWeightsPerDispatchClassU64, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, NodeRuntimeSessionKeys, PalletAssetsApproval, PalletAssetsAssetAccount, PalletAssetsAssetDetails, PalletAssetsAssetMetadata, PalletAuthorshipUncleEntryItem, PalletBagsListListBag, PalletBagsListListNode, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReleases, PalletBalancesReserveData, PalletBountiesBounty, PalletChildBountiesChildBounty, PalletCollectiveVotes, PalletContractsStorageDeletedContract, PalletContractsStorageRawContractInfo, PalletContractsWasmOwnerInfo, PalletContractsWasmPrefabWasmModule, PalletDemocracyPreimageStatus, PalletDemocracyReferendumInfo, PalletDemocracyReleases, PalletDemocracyVoteThreshold, PalletDemocracyVoteVoting, PalletElectionProviderMultiPhasePhase, PalletElectionProviderMultiPhaseReadySolution, PalletElectionProviderMultiPhaseRoundSnapshot, PalletElectionProviderMultiPhaseSignedSignedSubmission, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenSeatHolder, PalletElectionsPhragmenVoter, PalletGiltActiveGilt, PalletGiltActiveGiltsTotal, PalletGiltGiltBid, PalletGrandpaStoredPendingChange, PalletGrandpaStoredState, PalletIdentityRegistrarInfo, PalletIdentityRegistration, PalletImOnlineBoundedOpaqueNetworkState, PalletImOnlineSr25519AppSr25519Public, PalletLotteryLotteryConfig, PalletMultisigMultisig, PalletPreimageRequestStatus, PalletProxyAnnouncement, PalletProxyProxyDefinition, PalletRecoveryActiveRecovery, PalletRecoveryRecoveryConfig, PalletSchedulerReleases, PalletSchedulerScheduledV3, PalletSocietyBid, PalletSocietyBidKind, PalletSocietyVote, PalletSocietyVouchingStatus, PalletStakingActiveEraInfo, PalletStakingEraRewardPoints, PalletStakingExposure, PalletStakingForcing, PalletStakingNominations, PalletStakingReleases, PalletStakingRewardDestination, PalletStakingSlashingSlashingSpans, PalletStakingSlashingSpanRecord, PalletStakingStakingLedger, PalletStakingUnappliedSlash, PalletStakingValidatorPrefs, PalletTipsOpenTip, PalletTransactionPaymentReleases, PalletTransactionStorageTransactionInfo, PalletTreasuryProposal, PalletUniquesClassDetails, PalletUniquesClassMetadata, PalletUniquesInstanceDetails, PalletUniquesInstanceMetadata, PalletVestingReleases, PalletVestingVestingInfo, SpAuthorityDiscoveryAppPublic, SpConsensusBabeAppPublic, SpConsensusBabeBabeEpochConfiguration, SpConsensusBabeDigestsNextConfigDescriptor, SpCoreCryptoKeyTypeId, SpRuntimeDigest, SpStakingOffenceOffenceDetails } from '@polkadot/types/lookup';
import type { Observable } from '@polkadot/types/types';
declare module '@polkadot/api-base/types/storage' {
export interface AugmentedQueries<ApiType extends ApiTypes> {
assets: {
/**
* The number of units of assets held by any given account.
* The holdings of a specific account for a specific asset.
**/
account: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: AccountId32 | string | Uint8Array) => Observable<PalletAssetsAssetBalance>, [u32, AccountId32]> & QueryableStorageEntry<ApiType, [u32, AccountId32]>;
account: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: AccountId32 | string | Uint8Array) => Observable<Option<PalletAssetsAssetAccount>>, [u32, AccountId32]> & QueryableStorageEntry<ApiType, [u32, AccountId32]>;
/**
* Approved balance transfers. First balance is the amount approved for transfer. Second
* is the amount of `T::Currency` reserved for storing this.
@@ -478,7 +478,7 @@ declare module '@polkadot/api-base/types/storage' {
* Twox note: the key of the map is an auto-incrementing index which users cannot inspect or
* affect; we shouldn't need a cryptographically secure hasher.
**/
signedSubmissionsMap: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<PalletElectionProviderMultiPhaseSignedSignedSubmission>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
signedSubmissionsMap: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<PalletElectionProviderMultiPhaseSignedSignedSubmission>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
/**
* Snapshot data of the round.
*
@@ -756,6 +756,20 @@ declare module '@polkadot/api-base/types/storage' {
**/
[key: string]: QueryableStorageEntry<ApiType>;
};
preimage: {
/**
* The preimages stored by this pallet.
**/
preimageFor: AugmentedQuery<ApiType, (arg: H256 | string | Uint8Array) => Observable<Option<Bytes>>, [H256]> & QueryableStorageEntry<ApiType, [H256]>;
/**
* The request status of a given hash.
**/
statusFor: AugmentedQuery<ApiType, (arg: H256 | string | Uint8Array) => Observable<Option<PalletPreimageRequestStatus>>, [H256]> & QueryableStorageEntry<ApiType, [H256]>;
/**
* Generic query
**/
[key: string]: QueryableStorageEntry<ApiType>;
};
proxy: {
/**
* The announcements made by the proxy (key).
@@ -810,7 +824,7 @@ declare module '@polkadot/api-base/types/storage' {
/**
* Items to be executed, indexed by the block number that they should be executed on.
**/
agenda: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Vec<Option<PalletSchedulerScheduledV2>>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
agenda: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Vec<Option<PalletSchedulerScheduledV3>>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
/**
* Lookup from identity to the block number and index of the task.
**/
@@ -1172,7 +1186,7 @@ declare module '@polkadot/api-base/types/storage' {
/**
* The `AccountId` of the sudo key.
**/
key: AugmentedQuery<ApiType, () => Observable<AccountId32>, []> & QueryableStorageEntry<ApiType, []>;
key: AugmentedQuery<ApiType, () => Observable<Option<AccountId32>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Generic query
**/
@@ -1420,6 +1434,11 @@ declare module '@polkadot/api-base/types/storage' {
* Details of an asset class.
**/
class: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<PalletUniquesClassDetails>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
/**
* The classes owned by any given account; set out this way so that classes owned by a single
* account can be enumerated.
**/
classAccount: AugmentedQuery<ApiType, (arg1: AccountId32 | string | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<Option<Null>>, [AccountId32, u32]> & QueryableStorageEntry<ApiType, [AccountId32, u32]>;
/**
* Metadata of an asset class.
**/
+59 -6
View File
@@ -6,7 +6,7 @@ import type { Data } from '@polkadot/types';
import type { Bytes, Compact, Option, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec';
import type { AnyNumber, ITuple } from '@polkadot/types-codec/types';
import type { AccountId32, Call, H256, MultiAddress, Perbill, Percent, Perquintill } from '@polkadot/types/interfaces/runtime';
import type { NodeRuntimeOriginCaller, NodeRuntimeProxyType, NodeRuntimeSessionKeys, PalletAssetsDestroyWitness, PalletDemocracyConviction, PalletDemocracyVoteAccountVote, PalletElectionProviderMultiPhaseRawSolution, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenRenouncing, PalletIdentityBitFlags, PalletIdentityIdentityInfo, PalletIdentityJudgement, PalletImOnlineHeartbeat, PalletImOnlineSr25519AppSr25519Signature, PalletMultisigTimepoint, PalletSocietyJudgement, PalletStakingRewardDestination, PalletStakingValidatorPrefs, PalletUniquesDestroyWitness, PalletVestingVestingInfo, SpConsensusBabeDigestsNextConfigDescriptor, SpConsensusSlotsEquivocationProof, SpFinalityGrandpaEquivocationProof, SpNposElectionsSupport, SpRuntimeHeader, SpSessionMembershipProof, SpTransactionStorageProofTransactionStorageProof } from '@polkadot/types/lookup';
import type { FrameSupportScheduleMaybeHashed, NodeRuntimeOriginCaller, NodeRuntimeProxyType, NodeRuntimeSessionKeys, PalletAssetsDestroyWitness, PalletDemocracyConviction, PalletDemocracyVoteAccountVote, PalletElectionProviderMultiPhaseRawSolution, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenRenouncing, PalletIdentityBitFlags, PalletIdentityIdentityInfo, PalletIdentityJudgement, PalletImOnlineHeartbeat, PalletImOnlineSr25519AppSr25519Signature, PalletMultisigTimepoint, PalletSocietyJudgement, PalletStakingRewardDestination, PalletStakingValidatorPrefs, PalletUniquesDestroyWitness, PalletVestingVestingInfo, SpConsensusBabeDigestsNextConfigDescriptor, SpConsensusSlotsEquivocationProof, SpFinalityGrandpaEquivocationProof, SpNposElectionsSupport, SpRuntimeHeader, SpSessionMembershipProof, SpTransactionStorageProofTransactionStorageProof } from '@polkadot/types/lookup';
declare module '@polkadot/api-base/types/submittable' {
export interface AugmentedSubmittables<ApiType extends ApiTypes> {
@@ -39,7 +39,7 @@ declare module '@polkadot/api-base/types/submittable' {
*
* Origin must be Signed and the sender should be the Manager of the asset `id`.
*
* Bails with `BalanceZero` if the `who` is already dead.
* Bails with `NoAccount` if the `who` is already dead.
*
* - `id`: The identifier of the asset to have some amount burned.
* - `who`: The account to be debited from.
@@ -281,6 +281,17 @@ declare module '@polkadot/api-base/types/submittable' {
* Modes: Pre-existing balance of `beneficiary`; Account pre-existence of `beneficiary`.
**/
mint: AugmentedSubmittable<(id: Compact<u32> | AnyNumber | Uint8Array, beneficiary: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, amount: Compact<u128> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, MultiAddress, Compact<u128>]>;
/**
* Return the deposit (if any) of an asset account.
*
* The origin must be Signed.
*
* - `id`: The identifier of the asset for the account to be created.
* - `allow_burn`: If `true` then assets may be destroyed in order to complete the refund.
*
* Emits `Refunded` event when successful.
**/
refund: AugmentedSubmittable<(id: Compact<u32> | AnyNumber | Uint8Array, allowBurn: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, bool]>;
/**
* Set the metadata for an asset.
*
@@ -340,6 +351,18 @@ declare module '@polkadot/api-base/types/submittable' {
* Weight: `O(1)`
**/
thawAsset: AugmentedSubmittable<(id: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>]>;
/**
* Create an asset account for non-provider assets.
*
* A deposit will be taken from the signer account.
*
* - `origin`: Must be Signed; the signer account must have sufficient funds for a deposit
* to be taken.
* - `id`: The identifier of the asset for the account to be created.
*
* Emits `Touched` event when successful.
**/
touch: AugmentedSubmittable<(id: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>]>;
/**
* Move some assets from the sender account to another.
*
@@ -2297,6 +2320,36 @@ declare module '@polkadot/api-base/types/submittable' {
**/
[key: string]: SubmittableExtrinsicFunction<ApiType>;
};
preimage: {
/**
* Register a preimage on-chain.
*
* If the preimage was previously requested, no fees or deposits are taken for providing
* the preimage. Otherwise, a deposit is taken proportional to the size of the preimage.
**/
notePreimage: AugmentedSubmittable<(bytes: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Bytes]>;
/**
* Request a preimage be uploaded to the chain without paying any fees or deposits.
*
* If the preimage requests has already been provided on-chain, we unreserve any deposit
* a user may have paid, and take the control of the preimage out of their hands.
**/
requestPreimage: AugmentedSubmittable<(hash: H256 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [H256]>;
/**
* Clear an unrequested preimage from the runtime storage.
**/
unnotePreimage: AugmentedSubmittable<(hash: H256 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [H256]>;
/**
* Clear a previously made request for a preimage.
*
* NOTE: THIS MUST NOT BE CALLED ON `hash` MORE TIMES THAN `request_preimage`.
**/
unrequestPreimage: AugmentedSubmittable<(hash: H256 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [H256]>;
/**
* Generic tx
**/
[key: string]: SubmittableExtrinsicFunction<ApiType>;
};
proxy: {
/**
* Register a proxy account for the sender that is able to make calls on its behalf.
@@ -2711,7 +2764,7 @@ declare module '@polkadot/api-base/types/submittable' {
/**
* Anonymously schedule a task.
**/
schedule: AugmentedSubmittable<(when: u32 | AnyNumber | Uint8Array, maybePeriodic: Option<ITuple<[u32, u32]>> | null | object | string | Uint8Array, priority: u8 | AnyNumber | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, Option<ITuple<[u32, u32]>>, u8, Call]>;
schedule: AugmentedSubmittable<(when: u32 | AnyNumber | Uint8Array, maybePeriodic: Option<ITuple<[u32, u32]>> | null | object | string | Uint8Array, priority: u8 | AnyNumber | Uint8Array, call: FrameSupportScheduleMaybeHashed | { Value: any } | { Hash: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, Option<ITuple<[u32, u32]>>, u8, FrameSupportScheduleMaybeHashed]>;
/**
* Anonymously schedule a task after a delay.
*
@@ -2719,11 +2772,11 @@ declare module '@polkadot/api-base/types/submittable' {
* Same as [`schedule`].
* # </weight>
**/
scheduleAfter: AugmentedSubmittable<(after: u32 | AnyNumber | Uint8Array, maybePeriodic: Option<ITuple<[u32, u32]>> | null | object | string | Uint8Array, priority: u8 | AnyNumber | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, Option<ITuple<[u32, u32]>>, u8, Call]>;
scheduleAfter: AugmentedSubmittable<(after: u32 | AnyNumber | Uint8Array, maybePeriodic: Option<ITuple<[u32, u32]>> | null | object | string | Uint8Array, priority: u8 | AnyNumber | Uint8Array, call: FrameSupportScheduleMaybeHashed | { Value: any } | { Hash: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, Option<ITuple<[u32, u32]>>, u8, FrameSupportScheduleMaybeHashed]>;
/**
* Schedule a named task.
**/
scheduleNamed: AugmentedSubmittable<(id: Bytes | string | Uint8Array, when: u32 | AnyNumber | Uint8Array, maybePeriodic: Option<ITuple<[u32, u32]>> | null | object | string | Uint8Array, priority: u8 | AnyNumber | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Bytes, u32, Option<ITuple<[u32, u32]>>, u8, Call]>;
scheduleNamed: AugmentedSubmittable<(id: Bytes | string | Uint8Array, when: u32 | AnyNumber | Uint8Array, maybePeriodic: Option<ITuple<[u32, u32]>> | null | object | string | Uint8Array, priority: u8 | AnyNumber | Uint8Array, call: FrameSupportScheduleMaybeHashed | { Value: any } | { Hash: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Bytes, u32, Option<ITuple<[u32, u32]>>, u8, FrameSupportScheduleMaybeHashed]>;
/**
* Schedule a named task after a delay.
*
@@ -2731,7 +2784,7 @@ declare module '@polkadot/api-base/types/submittable' {
* Same as [`schedule_named`](Self::schedule_named).
* # </weight>
**/
scheduleNamedAfter: AugmentedSubmittable<(id: Bytes | string | Uint8Array, after: u32 | AnyNumber | Uint8Array, maybePeriodic: Option<ITuple<[u32, u32]>> | null | object | string | Uint8Array, priority: u8 | AnyNumber | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Bytes, u32, Option<ITuple<[u32, u32]>>, u8, Call]>;
scheduleNamedAfter: AugmentedSubmittable<(id: Bytes | string | Uint8Array, after: u32 | AnyNumber | Uint8Array, maybePeriodic: Option<ITuple<[u32, u32]>> | null | object | string | Uint8Array, priority: u8 | AnyNumber | Uint8Array, call: FrameSupportScheduleMaybeHashed | { Value: any } | { Hash: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Bytes, u32, Option<ITuple<[u32, u32]>>, u8, FrameSupportScheduleMaybeHashed]>;
/**
* Generic tx
**/
+1 -1
View File
@@ -3,4 +3,4 @@
// Auto-generated by @polkadot/dev, do not edit
export const packageInfo = { name: '@polkadot/api-augment', version: '7.0.1' };
export const packageInfo = { name: '@polkadot/api-augment', version: '7.0.2' };
+3 -3
View File
@@ -20,12 +20,12 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "7.0.1",
"version": "7.0.2",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.16.5",
"@polkadot/rpc-core": "7.0.1",
"@polkadot/types": "7.0.1",
"@polkadot/rpc-core": "7.0.2",
"@polkadot/types": "7.0.2",
"@polkadot/util": "^8.2.2",
"rxjs": "^7.4.0"
}
+1 -1
View File
@@ -3,4 +3,4 @@
// Auto-generated by @polkadot/dev, do not edit
export const packageInfo = { name: '@polkadot/api-base', version: '7.0.1' };
export const packageInfo = { name: '@polkadot/api-base', version: '7.0.2' };
+4 -4
View File
@@ -20,13 +20,13 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "7.0.1",
"version": "7.0.2",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.16.5",
"@polkadot/api": "7.0.1",
"@polkadot/types": "7.0.1",
"@polkadot/types-create": "7.0.1",
"@polkadot/api": "7.0.2",
"@polkadot/types": "7.0.2",
"@polkadot/types-create": "7.0.2",
"@polkadot/util": "^8.2.2",
"@polkadot/util-crypto": "^8.2.2",
"rxjs": "^7.4.0"
+1 -1
View File
@@ -3,4 +3,4 @@
// Auto-generated by @polkadot/dev, do not edit
export const packageInfo = { name: '@polkadot/api-contract', version: '7.0.1' };
export const packageInfo = { name: '@polkadot/api-contract', version: '7.0.2' };
+9 -9
View File
@@ -20,22 +20,22 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "7.0.1",
"version": "7.0.2",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.16.5",
"@polkadot/api": "7.0.1",
"@polkadot/api-base": "7.0.1",
"@polkadot/rpc-core": "7.0.1",
"@polkadot/types": "7.0.1",
"@polkadot/types-codec": "7.0.1",
"@polkadot/api": "7.0.2",
"@polkadot/api-base": "7.0.2",
"@polkadot/rpc-core": "7.0.2",
"@polkadot/types": "7.0.2",
"@polkadot/types-codec": "7.0.2",
"@polkadot/util": "^8.2.2",
"@polkadot/util-crypto": "^8.2.2",
"rxjs": "^7.4.0"
},
"devDependencies": {
"@polkadot/api": "7.0.1",
"@polkadot/api-augment": "7.0.1",
"@polkadot/rpc-augment": "7.0.1"
"@polkadot/api": "7.0.2",
"@polkadot/api-augment": "7.0.2",
"@polkadot/rpc-augment": "7.0.2"
}
}
+5 -5
View File
@@ -3,6 +3,7 @@
import type { Observable } from 'rxjs';
import type { AccountId, Address, Balance } from '@polkadot/types/interfaces';
import type { Option } from '@polkadot/types-codec';
import type { DeriveAccountFlags, DeriveApi } from '../types';
import { combineLatest, map, of } from 'rxjs';
@@ -14,19 +15,18 @@ type FlagsIntermediate = [
AccountId[],
AccountId[],
AccountId[],
AccountId | undefined
Option<AccountId> | AccountId | undefined
];
function parseFlags (address: AccountId | Address | string | null | undefined, [electionsMembers, councilMembers, technicalCommitteeMembers, societyMembers, sudoKey]: FlagsIntermediate): DeriveAccountFlags {
const addrStr = address && address.toString();
const isIncluded = (id: AccountId | Address | string) =>
address
? id.toString() === address.toString()
: false;
id.toString() === addrStr;
return {
isCouncil: (electionsMembers?.map(([id]) => id) || councilMembers || []).some(isIncluded),
isSociety: (societyMembers || []).some(isIncluded),
isSudo: sudoKey?.toString() === address?.toString(),
isSudo: sudoKey?.toString() === addrStr,
isTechCommittee: (technicalCommitteeMembers || []).some(isIncluded)
};
}
+11 -10
View File
@@ -11,25 +11,26 @@ import { isFunction } from '@polkadot/util';
import { memo } from '../util';
export function getInstance (api: DeriveApi, section: string): string {
export function getInstance (api: DeriveApi, section: string): DeriveApi['query']['council'] {
const instances = api.registry.getModuleInstances(api.runtimeVersion.specName.toString(), section);
return instances && instances.length
const name = instances && instances.length
? instances[0]
: section;
return api.query[name as 'council'];
}
export function withSection <T, F extends (...args: any[]) => Observable<T>> (_section: Collective, fn: (section: string, api: DeriveApi, instanceId: string) => F): (instanceId: string, api: DeriveApi) => F {
export function withSection <T, F extends (...args: any[]) => Observable<T>> (section: Collective, fn: (query: DeriveApi['query']['council'], api: DeriveApi, instanceId: string) => F): (instanceId: string, api: DeriveApi) => F {
return (instanceId: string, api: DeriveApi) =>
memo(instanceId, fn(getInstance(api, _section), api, instanceId)) as unknown as F;
memo(instanceId, fn(getInstance(api, section), api, instanceId)) as unknown as F;
}
export function callMethod <T> (method: 'members' | 'proposals' | 'proposalCount', empty: T): (_section: Collective) => (instanceId: string, api: DeriveApi) => () => Observable<T> {
return (_section: Collective) =>
withSection(_section, (section, api) =>
export function callMethod <T> (method: 'members' | 'proposals' | 'proposalCount', empty: T): (section: Collective) => (instanceId: string, api: DeriveApi) => () => Observable<T> {
return (section: Collective) =>
withSection(section, (query) =>
(): Observable<T> =>
isFunction(api.query[section]?.[method])
? api.query[section as 'council'][method]() as unknown as Observable<T>
isFunction(query?.[method])
? query[method]() as unknown as Observable<T>
: of(empty)
);
}
+6 -6
View File
@@ -15,13 +15,13 @@ import { withSection } from './helpers';
// We are re-exporting these from here to ensure that *.d.ts generation is correct
export type { AccountId } from '@polkadot/types/interfaces';
export function prime (_section: Collective): (instanceId: string, api: DeriveApi) => () => Observable<AccountId | null> {
return withSection(_section, (section, api) =>
export function prime (section: Collective): (instanceId: string, api: DeriveApi) => () => Observable<AccountId | null> {
return withSection(section, (query) =>
(): Observable<AccountId | null> =>
isFunction(api.query[section as 'council']?.prime)
? api.query[section as 'council'].prime().pipe(
map((optPrime): AccountId | null =>
optPrime.unwrapOr(null)
isFunction(query?.prime)
? query.prime().pipe(
map((o): AccountId | null =>
o.unwrapOr(null)
)
)
: of(null)
+15 -15
View File
@@ -34,19 +34,19 @@ function parse (api: DeriveApi, [hashes, proposals, votes]: Result): DeriveColle
.filter((proposal): proposal is DeriveCollectiveProposal => !!proposal);
}
function _proposalsFrom (section: string, api: DeriveApi, hashes: (Hash | Uint8Array | string)[]): Observable<DeriveCollectiveProposal[]> {
return (isFunction(api.query[section]?.proposals) && hashes.length
function _proposalsFrom (api: DeriveApi, query: DeriveApi['query']['council'], hashes: (Hash | Uint8Array | string)[]): Observable<DeriveCollectiveProposal[]> {
return (isFunction(query?.proposals) && hashes.length
? combineLatest([
of(hashes),
// this should simply be api.query[section].proposalOf.multi<Option<Proposal>>(hashes),
// however we have had cases on Edgeware where the indices have moved around after an
// upgrade, which results in invalid on-chain data
combineLatest(hashes.map((h) =>
api.query[section].proposalOf<Option<Proposal>>(h).pipe(
query.proposalOf<Option<Proposal>>(h).pipe(
catchError(() => of(null))
)
)),
api.query[section].voting.multi<Option<Votes>>(hashes)
query.voting.multi<Option<Votes>>(hashes)
])
: of<Result>([[], [], []])
).pipe(
@@ -54,27 +54,27 @@ function _proposalsFrom (section: string, api: DeriveApi, hashes: (Hash | Uint8A
);
}
export function hasProposals (_section: Collective): (instanceId: string, api: DeriveApi) => () => Observable<boolean> {
return withSection(_section, (section, api) =>
export function hasProposals (section: Collective): (instanceId: string, api: DeriveApi) => () => Observable<boolean> {
return withSection(section, (query) =>
(): Observable<boolean> =>
of(isFunction(api.query[section]?.proposals))
of(isFunction(query?.proposals))
);
}
export function proposals (_section: Collective): (instanceId: string, api: DeriveApi) => () => Observable<DeriveCollectiveProposal[]> {
return withSection(_section, (section, api) =>
export function proposals (section: Collective): (instanceId: string, api: DeriveApi) => () => Observable<DeriveCollectiveProposal[]> {
return withSection(section, (query, api) =>
(): Observable<DeriveCollectiveProposal[]> =>
api.derive[section as 'council'].proposalHashes().pipe(
switchMap((all) => _proposalsFrom(section, api, all))
api.derive[section].proposalHashes().pipe(
switchMap((all) => _proposalsFrom(api, query, all))
)
);
}
export function proposal (_section: Collective): (instanceId: string, api: DeriveApi) => (hash: Hash | Uint8Array | string) => Observable<DeriveCollectiveProposal | null> {
return withSection(_section, (section, api) =>
export function proposal (section: Collective): (instanceId: string, api: DeriveApi) => (hash: Hash | Uint8Array | string) => Observable<DeriveCollectiveProposal | null> {
return withSection(section, (query, api) =>
(hash: Hash | Uint8Array | string): Observable<DeriveCollectiveProposal | null> =>
isFunction(api.query[section]?.proposals)
? firstObservable(_proposalsFrom(section, api, [hash]))
isFunction(query?.proposals)
? firstObservable(_proposalsFrom(api, query, [hash]))
: of(null)
);
}
@@ -3,8 +3,8 @@
import type { Observable } from 'rxjs';
import type { Option, Vec } from '@polkadot/types';
import type { BlockNumber, Hash, ReferendumIndex } from '@polkadot/types/interfaces';
import type { PalletSchedulerScheduledV2 } from '@polkadot/types/lookup';
import type { BlockNumber, Call, Hash, ReferendumIndex, Scheduled } from '@polkadot/types/interfaces';
import type { FrameSupportScheduleMaybeHashed, PalletSchedulerScheduledV3 } from '@polkadot/types/lookup';
import type { ITuple } from '@polkadot/types/types';
import type { DeriveApi, DeriveDispatch, DeriveProposalImage } from '../types';
@@ -22,6 +22,11 @@ interface SchedulerInfo {
index: ReferendumIndex;
}
function isMaybeHashed (call: FrameSupportScheduleMaybeHashed | Call): call is FrameSupportScheduleMaybeHashed {
// check for enum
return (call as FrameSupportScheduleMaybeHashed).isBasic === false;
}
function queryQueue (api: DeriveApi): Observable<DeriveDispatch[]> {
return api.query.democracy.dispatchQueue<Vec<ITuple<[BlockNumber, Hash, ReferendumIndex]>>>().pipe(
switchMap((dispatches) =>
@@ -42,7 +47,7 @@ function queryQueue (api: DeriveApi): Observable<DeriveDispatch[]> {
);
}
function schedulerEntries (api: DeriveApi): Observable<[BlockNumber[], (Option<PalletSchedulerScheduledV2>[] | null)[]]> {
function schedulerEntries (api: DeriveApi): Observable<[BlockNumber[], (Option<PalletSchedulerScheduledV3 | Scheduled>[] | null)[]]> {
// We don't get entries, but rather we get the keys (triggered via finished referendums) and
// the subscribe to those keys - this means we pickup when the schedulers actually executes
// at a block, the entry for that block will become empty
@@ -81,7 +86,15 @@ function queryScheduler (api: DeriveApi): Observable<DeriveDispatch[]> {
if (scheduled.maybeId.isSome) {
const id = scheduled.maybeId.unwrap().toHex();
id.startsWith(DEMOCRACY_ID) && result.push({ at, imageHash: scheduled.call.args[0] as Hash, index: api.registry.createType('(u64, ReferendumIndex)', id)[1] });
if (id.startsWith(DEMOCRACY_ID)) {
const imageHash = isMaybeHashed(scheduled.call)
? scheduled.call.isHash
? scheduled.call.asHash
: scheduled.call.asValue.args[0] as Hash
: scheduled.call.args[0] as Hash;
result.push({ at, imageHash, index: api.registry.createType('(u64, ReferendumIndex)', id)[1] });
}
}
});
});
@@ -4,7 +4,6 @@
export * from './dispatchQueue';
export * from './locks';
export * from './nextExternal';
export * from './preimage';
export * from './preimages';
export * from './proposals';
export * from './referendumIds';
@@ -1,19 +0,0 @@
// Copyright 2017-2021 @polkadot/api-derive authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Observable } from 'rxjs';
import type { Hash } from '@polkadot/types/interfaces';
import type { DeriveApi, DeriveProposalImage } from '../types';
import { map } from 'rxjs';
import { memo } from '../util';
import { parseImage } from './util';
export function preimage (instanceId: string, api: DeriveApi): (hash: Hash) => Observable<DeriveProposalImage | undefined> {
return memo(instanceId, (hash: Hash): Observable<DeriveProposalImage | undefined> =>
api.query.democracy.preimages(hash).pipe(
map((imageOpt) => parseImage(api, imageOpt))
)
);
}
+63 -10
View File
@@ -2,22 +2,75 @@
// SPDX-License-Identifier: Apache-2.0
import type { Observable } from 'rxjs';
import type { Hash } from '@polkadot/types/interfaces';
import type { AccountId, Balance, BlockNumber, Hash, PreimageStatus, Proposal } from '@polkadot/types/interfaces';
import type { Bytes, Option } from '@polkadot/types-codec';
import type { ITuple } from '@polkadot/types-codec/types';
import type { DeriveApi, DeriveProposalImage } from '../types';
import { map, of } from 'rxjs';
import { memo } from '../util';
import { parseImage } from './util';
import { isFunction } from '@polkadot/util';
export function preimages (instanceId: string, api: DeriveApi): (hashes: Hash[]) => Observable<(DeriveProposalImage | undefined)[]> {
return memo(instanceId, (hashes: Hash[]): Observable<(DeriveProposalImage | undefined)[]> =>
import { firstMemo, memo } from '../util';
type PreimageInfo = [Bytes, AccountId, Balance, BlockNumber];
type OldPreimage = ITuple<PreimageInfo>;
function isDemocracyPreimage (api: DeriveApi, imageOpt: Option<OldPreimage> | Option<PreimageStatus>): imageOpt is Option<PreimageStatus> {
return !!imageOpt && !api.query.democracy.dispatchQueue;
}
function constructProposal (api: DeriveApi, [bytes, proposer, balance, at]: PreimageInfo): DeriveProposalImage {
let proposal: Proposal | undefined;
try {
proposal = api.registry.createType('Proposal', bytes.toU8a(true));
} catch (error) {
console.error(error);
}
return { at, balance, proposal, proposer };
}
function parseDemocracy (api: DeriveApi, imageOpt: Option<OldPreimage> | Option<PreimageStatus>): DeriveProposalImage | undefined {
if (imageOpt.isNone) {
return;
}
if (isDemocracyPreimage(api, imageOpt)) {
const status = imageOpt.unwrap();
if (status.isMissing) {
return;
}
const { data, deposit, provider, since } = status.asAvailable;
return constructProposal(api, [data, provider, deposit, since]);
}
return constructProposal(api, imageOpt.unwrap());
}
function getDemocracyImages (api: DeriveApi, hashes: (Hash | Uint8Array | string)[]): Observable<(DeriveProposalImage | undefined)[]> {
return api.query.democracy.preimages.multi(hashes).pipe(
map((images): (DeriveProposalImage | undefined)[] =>
images.map((imageOpt) => parseDemocracy(api, imageOpt))
)
);
}
export function preimages (instanceId: string, api: DeriveApi): (hashes: (Hash | Uint8Array | string)[]) => Observable<(DeriveProposalImage | undefined)[]> {
return memo(instanceId, (hashes: (Hash | Uint8Array | string)[]): Observable<(DeriveProposalImage | undefined)[]> =>
hashes.length
? api.query.democracy.preimages.multi(hashes).pipe(
map((images): (DeriveProposalImage | undefined)[] =>
images.map((imageOpt) => parseImage(api, imageOpt))
)
)
? isFunction(api.query.democracy.preimages)
? getDemocracyImages(api, hashes)
: of([])
: of([])
);
}
export const preimage = firstMemo(
(api: DeriveApi, hash: Hash | Uint8Array | string) =>
api.derive.democracy.preimages([hash])
);
@@ -13,7 +13,7 @@ import { combineLatest, map, of, switchMap } from 'rxjs';
import { isFunction } from '@polkadot/util';
import { memo } from '../util';
import { calcVotes, getStatus, parseImage } from './util';
import { calcVotes, getStatus } from './util';
type VotingDelegating = PalletDemocracyVoteVoting['asDelegating'];
type VotingDirect = PalletDemocracyVoteVoting['asDirect'];
@@ -132,9 +132,9 @@ export function _referendumInfo (instanceId: string, api: DeriveApi): (index: BN
const status = getStatus(info);
return status
? api.query.democracy.preimages(status.proposalHash).pipe(
map((preimage): DeriveReferendum => ({
image: parseImage(api, preimage),
? api.derive.democracy.preimage(status.proposalHash).pipe(
map((image): DeriveReferendum => ({
image,
imageHash: status.proposalHash,
index: api.registry.createType('ReferendumIndex', index),
status
+9 -51
View File
@@ -1,17 +1,13 @@
// Copyright 2017-2021 @polkadot/api-derive authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Bytes, Option } from '@polkadot/types';
import type { AccountId, Balance, BlockNumber, PreimageStatus, Proposal, ReferendumInfoTo239, Tally } from '@polkadot/types/interfaces';
import type { ReferendumInfoTo239, Tally } from '@polkadot/types/interfaces';
import type { PalletDemocracyReferendumInfo, PalletDemocracyReferendumStatus, PalletDemocracyVoteThreshold } from '@polkadot/types/lookup';
import type { ITuple } from '@polkadot/types/types';
import type { DeriveApi, DeriveProposalImage, DeriveReferendum, DeriveReferendumVote, DeriveReferendumVotes, DeriveReferendumVoteState } from '../types';
import type { Option } from '@polkadot/types-codec';
import type { DeriveReferendum, DeriveReferendumVote, DeriveReferendumVotes, DeriveReferendumVoteState } from '../types';
import { BN, bnSqrt } from '@polkadot/util';
type PreimageInfo = [Bytes, AccountId, Balance, BlockNumber];
type OldPreimage = ITuple<PreimageInfo>;
interface ApproxState {
votedAye: BN;
votedNay: BN;
@@ -26,10 +22,6 @@ function isCurrentStatus (status: PalletDemocracyReferendumStatus | ReferendumIn
return !!(status as PalletDemocracyReferendumStatus).tally;
}
function isCurrentPreimage (api: DeriveApi, imageOpt: Option<OldPreimage> | Option<PreimageStatus>): imageOpt is Option<PreimageStatus> {
return !!imageOpt && !api.query.democracy.dispatchQueue;
}
export function compareRationals (n1: BN, d1: BN, n2: BN, d2: BN): boolean {
while (true) {
const q1 = n1.div(d1);
@@ -141,44 +133,10 @@ export function getStatus (info: Option<PalletDemocracyReferendumInfo | Referend
const unwrapped = info.unwrap();
if (isOldInfo(unwrapped)) {
return unwrapped;
} else if (unwrapped.isOngoing) {
return unwrapped.asOngoing;
}
// done, we don't include it here... only currently active
return null;
}
function constructProposal (api: DeriveApi, [bytes, proposer, balance, at]: PreimageInfo): DeriveProposalImage {
let proposal: Proposal | undefined;
try {
proposal = api.registry.createType('Proposal', bytes.toU8a(true));
} catch (error) {
console.error(error);
}
return { at, balance, proposal, proposer };
}
export function parseImage (api: DeriveApi, imageOpt: Option<OldPreimage> | Option<PreimageStatus>): DeriveProposalImage | undefined {
if (imageOpt.isNone) {
return;
}
if (isCurrentPreimage(api, imageOpt)) {
const status = imageOpt.unwrap();
if (status.isMissing) {
return;
}
const { data, deposit, provider, since } = status.asAvailable;
return constructProposal(api, [data, provider, deposit, since]);
}
return constructProposal(api, imageOpt.unwrap());
return isOldInfo(unwrapped)
? unwrapped
: unwrapped.isOngoing
? unwrapped.asOngoing
// done, we don't include it here... only currently active
: null;
}
+1 -1
View File
@@ -3,4 +3,4 @@
// Auto-generated by @polkadot/dev, do not edit
export const packageInfo = { name: '@polkadot/api-derive', version: '7.0.1' };
export const packageInfo = { name: '@polkadot/api-derive', version: '7.0.2' };
+13 -13
View File
@@ -20,28 +20,28 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "7.0.1",
"version": "7.0.2",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.16.5",
"@polkadot/api-augment": "7.0.1",
"@polkadot/api-base": "7.0.1",
"@polkadot/api-derive": "7.0.1",
"@polkadot/api-augment": "7.0.2",
"@polkadot/api-base": "7.0.2",
"@polkadot/api-derive": "7.0.2",
"@polkadot/keyring": "^8.2.2",
"@polkadot/rpc-augment": "7.0.1",
"@polkadot/rpc-core": "7.0.1",
"@polkadot/rpc-provider": "7.0.1",
"@polkadot/types": "7.0.1",
"@polkadot/types-augment": "7.0.1",
"@polkadot/types-codec": "7.0.1",
"@polkadot/types-create": "7.0.1",
"@polkadot/types-known": "7.0.1",
"@polkadot/rpc-augment": "7.0.2",
"@polkadot/rpc-core": "7.0.2",
"@polkadot/rpc-provider": "7.0.2",
"@polkadot/types": "7.0.2",
"@polkadot/types-augment": "7.0.2",
"@polkadot/types-codec": "7.0.2",
"@polkadot/types-create": "7.0.2",
"@polkadot/types-known": "7.0.2",
"@polkadot/util": "^8.2.2",
"@polkadot/util-crypto": "^8.2.2",
"eventemitter3": "^4.0.7",
"rxjs": "^7.4.0"
},
"devDependencies": {
"@polkadot/api-augment": "7.0.1"
"@polkadot/api-augment": "7.0.2"
}
}
+3 -3
View File
@@ -4,7 +4,7 @@
import type { Observable, Subscription } from 'rxjs';
import type { Text } from '@polkadot/types';
import type { ExtDef } from '@polkadot/types/extrinsic/signedExtensions/types';
import type { ChainProperties, Hash, HeaderPartial, RuntimeVersion, RuntimeVersionPartial } from '@polkadot/types/interfaces';
import type { ChainProperties, Hash, RuntimeVersion, RuntimeVersionPartial } from '@polkadot/types/interfaces';
import type { Registry } from '@polkadot/types/types';
import type { BN } from '@polkadot/util';
import type { HexString } from '@polkadot/util/types';
@@ -151,7 +151,7 @@ export abstract class Init<ApiType extends ApiTypes> extends Decorate<ApiType> {
this._genesisHash.eq(blockHash)
? { number: BN_ZERO, parentHash: this._genesisHash }
: await firstValueFrom(this._rpcCore.chain.getHeader.raw(blockHash))
) as unknown as HeaderPartial;
);
assert(!header.parentHash.isEmpty, 'Unable to retrieve header and parent from supplied hash');
@@ -161,7 +161,7 @@ export abstract class Init<ApiType extends ApiTypes> extends Decorate<ApiType> {
(firstVersion && (lastVersion || firstVersion.specVersion.eq(this._runtimeVersion.specVersion)))
? { specName: this._runtimeVersion.specName, specVersion: firstVersion.specVersion }
: await firstValueFrom(this._rpcCore.state.getRuntimeVersion.raw(header.parentHash))
) as unknown as RuntimeVersionPartial;
);
const existingViaVersion = this._getBlockRegistryViaVersion(blockHash, version);
+1 -1
View File
@@ -3,4 +3,4 @@
// Auto-generated by @polkadot/dev, do not edit
export const packageInfo = { name: '@polkadot/api', version: '7.0.1' };
export const packageInfo = { name: '@polkadot/api', version: '7.0.2' };
+4 -4
View File
@@ -20,13 +20,13 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "7.0.1",
"version": "7.0.2",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.16.5",
"@polkadot/rpc-core": "7.0.1",
"@polkadot/types": "7.0.1",
"@polkadot/types-codec": "7.0.1",
"@polkadot/rpc-core": "7.0.2",
"@polkadot/types": "7.0.2",
"@polkadot/types-codec": "7.0.2",
"@polkadot/util": "^8.2.2"
}
}
+1 -1
View File
@@ -3,4 +3,4 @@
// Auto-generated by @polkadot/dev, do not edit
export const packageInfo = { name: '@polkadot/rpc-augment', version: '7.0.1' };
export const packageInfo = { name: '@polkadot/rpc-augment', version: '7.0.2' };
+5 -5
View File
@@ -20,18 +20,18 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "7.0.1",
"version": "7.0.2",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.16.5",
"@polkadot/rpc-augment": "7.0.1",
"@polkadot/rpc-provider": "7.0.1",
"@polkadot/types": "7.0.1",
"@polkadot/rpc-augment": "7.0.2",
"@polkadot/rpc-provider": "7.0.2",
"@polkadot/types": "7.0.2",
"@polkadot/util": "^8.2.2",
"rxjs": "^7.4.0"
},
"devDependencies": {
"@polkadot/keyring": "^8.2.2",
"@polkadot/rpc-augment": "7.0.1"
"@polkadot/rpc-augment": "7.0.2"
}
}
+1 -1
View File
@@ -3,4 +3,4 @@
// Auto-generated by @polkadot/dev, do not edit
export const packageInfo = { name: '@polkadot/rpc-core', version: '7.0.1' };
export const packageInfo = { name: '@polkadot/rpc-core', version: '7.0.2' };
+3 -3
View File
@@ -20,13 +20,13 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "7.0.1",
"version": "7.0.2",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.16.5",
"@polkadot/keyring": "^8.2.2",
"@polkadot/types": "7.0.1",
"@polkadot/types-support": "7.0.1",
"@polkadot/types": "7.0.2",
"@polkadot/types-support": "7.0.2",
"@polkadot/util": "^8.2.2",
"@polkadot/util-crypto": "^8.2.2",
"@polkadot/x-fetch": "^8.2.2",
+1 -1
View File
@@ -3,4 +3,4 @@
// Auto-generated by @polkadot/dev, do not edit
export const packageInfo = { name: '@polkadot/rpc-provider', version: '7.0.1' };
export const packageInfo = { name: '@polkadot/rpc-provider', version: '7.0.2' };
+9 -9
View File
@@ -20,7 +20,7 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "7.0.1",
"version": "7.0.2",
"main": "index.js",
"bin": {
"polkadot-types-chain-info": "./scripts/polkadot-types-chain-info.cjs",
@@ -33,14 +33,14 @@
"@babel/core": "^7.16.5",
"@babel/register": "^7.16.5",
"@babel/runtime": "^7.16.5",
"@polkadot/api": "7.0.1",
"@polkadot/rpc-augment": "7.0.1",
"@polkadot/rpc-provider": "7.0.1",
"@polkadot/types": "7.0.1",
"@polkadot/types-augment": "7.0.1",
"@polkadot/types-codec": "7.0.1",
"@polkadot/types-create": "7.0.1",
"@polkadot/types-support": "7.0.1",
"@polkadot/api": "7.0.2",
"@polkadot/rpc-augment": "7.0.2",
"@polkadot/rpc-provider": "7.0.2",
"@polkadot/types": "7.0.2",
"@polkadot/types-augment": "7.0.2",
"@polkadot/types-codec": "7.0.2",
"@polkadot/types-create": "7.0.2",
"@polkadot/types-support": "7.0.2",
"@polkadot/util": "^8.2.2",
"@polkadot/x-ws": "^8.2.2",
"handlebars": "^4.7.7",
+1 -1
View File
@@ -3,4 +3,4 @@
// Auto-generated by @polkadot/dev, do not edit
export const packageInfo = { name: '@polkadot/typegen', version: '7.0.1' };
export const packageInfo = { name: '@polkadot/typegen', version: '7.0.2' };
+3 -3
View File
@@ -20,12 +20,12 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "7.0.1",
"version": "7.0.2",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.16.5",
"@polkadot/types": "7.0.1",
"@polkadot/types-codec": "7.0.1",
"@polkadot/types": "7.0.2",
"@polkadot/types-codec": "7.0.2",
"@polkadot/util": "^8.2.2"
}
}
@@ -4,37 +4,6 @@
/* eslint-disable sort-keys */
export default {
/**
* Lookup30: frame_support::traits::schedule::LookupError
**/
FrameSupportScheduleLookupError: {
_enum: ['Unknown', 'BadFormat']
},
/**
* Lookup31: pallet_preimage::pallet::Event<T>
**/
PalletPreimageEvent: {
_enum: {
Noted: {
_alias: {
hash_: 'hash',
},
hash_: 'H256',
},
Requested: {
_alias: {
hash_: 'hash',
},
hash_: 'H256',
},
Cleared: {
_alias: {
hash_: 'hash',
},
hash_: 'H256'
}
}
},
/**
* Lookup66: polkadot_runtime_common::claims::pallet::Event<T>
**/
@@ -653,53 +622,6 @@ export default {
V1: 'XcmV1MultiLocation'
}
},
/**
* Lookup164: pallet_scheduler::ScheduledV3<frame_support::traits::schedule::MaybeHashed<polkadot_runtime::Call, primitive_types::H256>, BlockNumber, polkadot_runtime::OriginCaller, sp_core::crypto::AccountId32>
**/
PalletSchedulerScheduledV3: {
maybeId: 'Option<Bytes>',
priority: 'u8',
call: 'FrameSupportScheduleMaybeHashed',
maybePeriodic: 'Option<(u32,u32)>',
origin: 'PolkadotRuntimeOriginCaller'
},
/**
* Lookup165: frame_support::traits::schedule::MaybeHashed<polkadot_runtime::Call, primitive_types::H256>
**/
FrameSupportScheduleMaybeHashed: {
_enum: {
Value: 'Call',
Hash: 'H256'
}
},
/**
* Lookup169: pallet_preimage::pallet::Call<T>
**/
PalletPreimageCall: {
_enum: {
note_preimage: {
bytes: 'Bytes',
},
unnote_preimage: {
_alias: {
hash_: 'hash',
},
hash_: 'H256',
},
request_preimage: {
_alias: {
hash_: 'hash',
},
hash_: 'H256',
},
unrequest_preimage: {
_alias: {
hash_: 'hash',
},
hash_: 'H256'
}
}
},
/**
* Lookup197: polkadot_runtime::SessionKeys
**/
@@ -1803,21 +1725,6 @@ export default {
Version: 'u32'
}
},
/**
* Lookup428: pallet_preimage::RequestStatus<sp_core::crypto::AccountId32, Balance>
**/
PalletPreimageRequestStatus: {
_enum: {
Unrequested: 'Option<(AccountId32,u128)>',
Requested: 'u32'
}
},
/**
* Lookup431: pallet_preimage::pallet::Error<T>
**/
PalletPreimageError: {
_enum: ['TooLarge', 'AlreadyNoted', 'NotAuthorized', 'NotNoted', 'Requested', 'NotRequested']
},
/**
* Lookup528: polkadot_runtime_common::claims::pallet::Error<T>
**/
File diff suppressed because it is too large Load Diff
@@ -5,31 +5,7 @@ declare module '@polkadot/types/lookup' {
import type { BitVec, Bytes, Compact, Enum, Null, Option, Result, Struct, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec';
import type { ITuple } from '@polkadot/types-codec/types';
import type { EthereumAddress } from '@polkadot/types/interfaces/eth';
import type { AccountId32, Call, H256, PerU16 } from '@polkadot/types/interfaces/runtime';
/** @name FrameSupportScheduleLookupError (30) */
export interface FrameSupportScheduleLookupError extends Enum {
readonly isUnknown: boolean;
readonly isBadFormat: boolean;
readonly type: 'Unknown' | 'BadFormat';
}
/** @name PalletPreimageEvent (31) */
export interface PalletPreimageEvent extends Enum {
readonly isNoted: boolean;
readonly asNoted: {
readonly hash_: H256;
} & Struct;
readonly isRequested: boolean;
readonly asRequested: {
readonly hash_: H256;
} & Struct;
readonly isCleared: boolean;
readonly asCleared: {
readonly hash_: H256;
} & Struct;
readonly type: 'Noted' | 'Requested' | 'Cleared';
}
import type { AccountId32, H256, PerU16 } from '@polkadot/types/interfaces/runtime';
/** @name PolkadotRuntimeCommonClaimsPalletEvent (66) */
export interface PolkadotRuntimeCommonClaimsPalletEvent extends Enum {
@@ -744,45 +720,6 @@ declare module '@polkadot/types/lookup' {
readonly type: 'V0' | 'V1';
}
/** @name PalletSchedulerScheduledV3 (164) */
export interface PalletSchedulerScheduledV3 extends Struct {
readonly maybeId: Option<Bytes>;
readonly priority: u8;
readonly call: FrameSupportScheduleMaybeHashed;
readonly maybePeriodic: Option<ITuple<[u32, u32]>>;
readonly origin: PolkadotRuntimeOriginCaller;
}
/** @name FrameSupportScheduleMaybeHashed (165) */
export interface FrameSupportScheduleMaybeHashed extends Enum {
readonly isValue: boolean;
readonly asValue: Call;
readonly isHash: boolean;
readonly asHash: H256;
readonly type: 'Value' | 'Hash';
}
/** @name PalletPreimageCall (169) */
export interface PalletPreimageCall extends Enum {
readonly isNotePreimage: boolean;
readonly asNotePreimage: {
readonly bytes: Bytes;
} & Struct;
readonly isUnnotePreimage: boolean;
readonly asUnnotePreimage: {
readonly hash_: H256;
} & Struct;
readonly isRequestPreimage: boolean;
readonly asRequestPreimage: {
readonly hash_: H256;
} & Struct;
readonly isUnrequestPreimage: boolean;
readonly asUnrequestPreimage: {
readonly hash_: H256;
} & Struct;
readonly type: 'NotePreimage' | 'UnnotePreimage' | 'RequestPreimage' | 'UnrequestPreimage';
}
/** @name PolkadotRuntimeSessionKeys (197) */
export interface PolkadotRuntimeSessionKeys extends Struct {
readonly grandpa: SpFinalityGrandpaAppPublic;
@@ -1738,26 +1675,6 @@ declare module '@polkadot/types/lookup' {
readonly type: 'Assets' | 'Version';
}
/** @name PalletPreimageRequestStatus (428) */
export interface PalletPreimageRequestStatus extends Enum {
readonly isUnrequested: boolean;
readonly asUnrequested: Option<ITuple<[AccountId32, u128]>>;
readonly isRequested: boolean;
readonly asRequested: u32;
readonly type: 'Unrequested' | 'Requested';
}
/** @name PalletPreimageError (431) */
export interface PalletPreimageError extends Enum {
readonly isTooLarge: boolean;
readonly isAlreadyNoted: boolean;
readonly isNotAuthorized: boolean;
readonly isNotNoted: boolean;
readonly isRequested: boolean;
readonly isNotRequested: boolean;
readonly type: 'TooLarge' | 'AlreadyNoted' | 'NotAuthorized' | 'NotNoted' | 'Requested' | 'NotRequested';
}
/** @name PolkadotRuntimeCommonClaimsPalletError (528) */
export interface PolkadotRuntimeCommonClaimsPalletError extends Enum {
readonly isInvalidEthereumSignature: boolean;
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -3,4 +3,4 @@
// Auto-generated by @polkadot/dev, do not edit
export const packageInfo = { name: '@polkadot/types-augment', version: '7.0.1' };
export const packageInfo = { name: '@polkadot/types-augment', version: '7.0.2' };
+2 -2
View File
@@ -20,13 +20,13 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "7.0.1",
"version": "7.0.2",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.16.5",
"@polkadot/util": "^8.2.2"
},
"devDependencies": {
"@polkadot/types": "^7.0.1"
"@polkadot/types": "^7.0.2"
}
}
+1 -1
View File
@@ -3,4 +3,4 @@
// Auto-generated by @polkadot/dev, do not edit
export const packageInfo = { name: '@polkadot/types-codec', version: '7.0.1' };
export const packageInfo = { name: '@polkadot/types-codec', version: '7.0.2' };
+2 -2
View File
@@ -20,11 +20,11 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "7.0.1",
"version": "7.0.2",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.16.5",
"@polkadot/types-codec": "7.0.1",
"@polkadot/types-codec": "7.0.2",
"@polkadot/util": "^8.2.2"
}
}
+1 -1
View File
@@ -3,4 +3,4 @@
// Auto-generated by @polkadot/dev, do not edit
export const packageInfo = { name: '@polkadot/types-create', version: '7.0.1' };
export const packageInfo = { name: '@polkadot/types-create', version: '7.0.2' };
+4 -4
View File
@@ -20,14 +20,14 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "7.0.1",
"version": "7.0.2",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.16.5",
"@polkadot/networks": "^8.2.2",
"@polkadot/types": "7.0.1",
"@polkadot/types-codec": "7.0.1",
"@polkadot/types-create": "7.0.1",
"@polkadot/types": "7.0.2",
"@polkadot/types-codec": "7.0.2",
"@polkadot/types-create": "7.0.2",
"@polkadot/util": "^8.2.2"
}
}
+1 -1
View File
@@ -3,4 +3,4 @@
// Auto-generated by @polkadot/dev, do not edit
export const packageInfo = { name: '@polkadot/types-known', version: '7.0.1' };
export const packageInfo = { name: '@polkadot/types-known', version: '7.0.2' };
+1 -1
View File
@@ -20,7 +20,7 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "7.0.1",
"version": "7.0.2",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.16.5",
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -3,4 +3,4 @@
// Auto-generated by @polkadot/dev, do not edit
export const packageInfo = { name: '@polkadot/types-support', version: '7.0.1' };
export const packageInfo = { name: '@polkadot/types-support', version: '7.0.2' };
+5 -5
View File
@@ -20,20 +20,20 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "7.0.1",
"version": "7.0.2",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.16.5",
"@polkadot/keyring": "^8.2.2",
"@polkadot/types-augment": "7.0.1",
"@polkadot/types-codec": "7.0.1",
"@polkadot/types-create": "7.0.1",
"@polkadot/types-augment": "7.0.2",
"@polkadot/types-codec": "7.0.2",
"@polkadot/types-create": "7.0.2",
"@polkadot/util": "^8.2.2",
"@polkadot/util-crypto": "^8.2.2",
"rxjs": "^7.4.0"
},
"devDependencies": {
"@polkadot/keyring": "^8.2.2",
"@polkadot/types-support": "7.0.1"
"@polkadot/types-support": "7.0.2"
}
}
+2 -3
View File
@@ -3,10 +3,9 @@
import '@polkadot/types-augment';
import type { Compact, Option } from './codec';
import type { Bytes, Compact, Option, u32 } from '@polkadot/types-codec';
import type { IOption, ITuple } from '@polkadot/types-codec/types';
import type { AccountId, BlockAttestations, SessionKeys7 } from './interfaces';
import type { Bytes, u32 } from './primitive';
import type { IOption, ITuple } from './types';
import { assert } from '@polkadot/util';
@@ -1,12 +1,11 @@
// Copyright 2017-2021 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Vec } from '@polkadot/types-codec';
import type { Text, Type, Vec } from '@polkadot/types-codec';
import type { CodecRegistry } from '@polkadot/types-codec/types';
import type { ILookup, TypeDef } from '@polkadot/types-create/types';
import type { PortableType } from '../../interfaces/metadata';
import type { SiField, SiLookupTypeId, SiPath, SiType, SiTypeDefArray, SiTypeDefBitSequence, SiTypeDefCompact, SiTypeDefComposite, SiTypeDefSequence, SiTypeDefTuple, SiTypeDefVariant, SiTypeParameter, SiVariant } from '../../interfaces/scaleInfo';
import type { Text, Type } from '../../primitive';
import { sanitize, Struct, u32 } from '@polkadot/types-codec';
import { getTypeDef, TypeDefInfo, withTypeString } from '@polkadot/types-create';
@@ -1,11 +1,10 @@
// Copyright 2017-2021 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Text } from '@polkadot/types-codec';
import type { Text, u8 } from '@polkadot/types-codec';
import type { CodecRegistry } from '@polkadot/types-codec/types';
import type { DispatchErrorModule, MetadataLatest, SiField, SiVariant } from '../../../interfaces';
import type { PortableRegistry } from '../../../metadata';
import type { u8 } from '../../../primitive';
import type { Errors, IsError } from '../types';
import { lazyMethod, objectSpread, stringCamelCase } from '@polkadot/util';
@@ -1,11 +1,11 @@
// Copyright 2017-2021 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { u32 } from '@polkadot/types-codec';
import json from '@polkadot/types-support/metadata/static-substrate';
import { u8aToHex } from '@polkadot/util';
import { TypeRegistry } from '../../create';
import { u32 } from '../../primitive';
import { Metadata } from '../Metadata';
import { decorateConstants, decorateExtrinsics, decorateStorage } from './';
+1 -1
View File
@@ -1,7 +1,7 @@
// Copyright 2017-2021 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Text } from '../../primitive';
import type { Text } from '@polkadot/types-codec';
import { stringCamelCase, stringLowerFirst } from '@polkadot/util';
@@ -4,9 +4,7 @@
import type { AnyJson, CodecRegistry } from '@polkadot/types-codec/types';
import type { MetadataLatest, PalletCallMetadataLatest } from '../../interfaces/metadata';
import { Option, Text } from '@polkadot/types-codec';
import { u8 } from '../../primitive';
import { Option, Text, u8 } from '@polkadot/types-codec';
interface ModuleMetadataTrimmed {
calls: Option<PalletCallMetadataLatest>;
+1 -1
View File
@@ -3,4 +3,4 @@
// Auto-generated by @polkadot/dev, do not edit
export const packageInfo = { name: '@polkadot/types', version: '7.0.1' };
export const packageInfo = { name: '@polkadot/types', version: '7.0.2' };
+1 -2
View File
@@ -1,11 +1,10 @@
// Copyright 2017-2021 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Codec, ITuple } from '@polkadot/types-codec/types';
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<T extends Codec[]> {
readonly phase: Phase;
+9 -3
View File
@@ -3,18 +3,20 @@
import type { Observable } from 'rxjs';
import type { BitVec, Bool, bool, Bytes, I8, i8, I16, i16, I32, i32, I64, i64, I128, i128, I256, i256, Json, Null, Raw, Text, Type, U8, u8, U16, u16, U32, u32, U64, u64, U128, u128, U256, u256, USize, usize } from '@polkadot/types-codec';
import type { RegistryError as RegistryErrorBase, RegistryTypes } from '@polkadot/types-codec/types';
import type { Codec, CodecClass, RegistryError as RegistryErrorBase, RegistryTypes } from '@polkadot/types-codec/types';
import type { CreateRegistry, TypeDef } from '@polkadot/types-create/types';
import type { BN } from '@polkadot/util';
import type { GenericExtrinsic, GenericExtrinsicEra, GenericExtrinsicPayload, GenericSignerPayload } from '../extrinsic';
import type { ExtDef } from '../extrinsic/signedExtensions/types';
import type { GenericCall } from '../generic';
import type { MetadataLatest } from '../interfaces/metadata';
import type { HeaderPartial } from '../interfaces/runtime';
import type { SiField, SiLookupTypeId } from '../interfaces/scaleInfo';
import type { RuntimeVersionPartial } from '../interfaces/state';
import type { ChainProperties } from '../interfaces/system';
import type { Metadata, PortableRegistry } from '../metadata';
import type { Data, StorageKey } from '../primitive';
import type { CallFunction } from './calls';
import type { Codec, CodecClass } from './codec';
import type { DefinitionRpc, DefinitionRpcSub } from './definitions';
import type { DetectCodec } from './detect';
@@ -25,10 +27,14 @@ export interface InterfaceTypes {
BitVec: BitVec, Bool: Bool, Bytes: Bytes, I128: I128, I16: I16, I256: I256, I32: I32, I64: I64, I8: I8, Json: Json, Null: Null, Raw: Raw, Text: Text, Type: Type, U128: U128, U16: U16, U256: U256, U32: U32, U64: U64, U8: U8, USize: USize, bool: bool, i128: i128, i16: i16, i256: i256, i32: i32, i64: i64, i8: i8, u128: u128, u16: u16, u256: u256, u32: u32, u64: u64, u8: u8, usize: usize,
// extrinsic
Extrinsic: GenericExtrinsic, ExtrinsicEra: GenericExtrinsicEra, ExtrinsicPayload: GenericExtrinsicPayload, SignerPayload: GenericSignerPayload,
// generic
Call: GenericCall,
// primitive
Data: Data, StorageKey: StorageKey,
// metadata
Metadata: Metadata, PortableRegistry: PortableRegistry
Metadata: Metadata, PortableRegistry: PortableRegistry,
// interfaces
HeaderPartial: HeaderPartial, RuntimeVersionPartial: RuntimeVersionPartial
}
export type CodecHasher = (data: Uint8Array) => Uint8Array;
+73 -73
View File
@@ -1867,27 +1867,27 @@ __metadata:
languageName: node
linkType: hard
"@polkadot/api-augment@7.0.1, @polkadot/api-augment@workspace:packages/api-augment":
"@polkadot/api-augment@7.0.2, @polkadot/api-augment@workspace:packages/api-augment":
version: 0.0.0-use.local
resolution: "@polkadot/api-augment@workspace:packages/api-augment"
dependencies:
"@babel/runtime": ^7.16.5
"@polkadot/api-base": 7.0.1
"@polkadot/rpc-augment": 7.0.1
"@polkadot/types": 7.0.1
"@polkadot/types-augment": 7.0.1
"@polkadot/types-codec": 7.0.1
"@polkadot/api-base": 7.0.2
"@polkadot/rpc-augment": 7.0.2
"@polkadot/types": 7.0.2
"@polkadot/types-augment": 7.0.2
"@polkadot/types-codec": 7.0.2
"@polkadot/util": ^8.2.2
languageName: unknown
linkType: soft
"@polkadot/api-base@7.0.1, @polkadot/api-base@workspace:packages/api-base":
"@polkadot/api-base@7.0.2, @polkadot/api-base@workspace:packages/api-base":
version: 0.0.0-use.local
resolution: "@polkadot/api-base@workspace:packages/api-base"
dependencies:
"@babel/runtime": ^7.16.5
"@polkadot/rpc-core": 7.0.1
"@polkadot/types": 7.0.1
"@polkadot/rpc-core": 7.0.2
"@polkadot/types": 7.0.2
"@polkadot/util": ^8.2.2
rxjs: ^7.4.0
languageName: unknown
@@ -1898,50 +1898,50 @@ __metadata:
resolution: "@polkadot/api-contract@workspace:packages/api-contract"
dependencies:
"@babel/runtime": ^7.16.5
"@polkadot/api": 7.0.1
"@polkadot/types": 7.0.1
"@polkadot/types-create": 7.0.1
"@polkadot/api": 7.0.2
"@polkadot/types": 7.0.2
"@polkadot/types-create": 7.0.2
"@polkadot/util": ^8.2.2
"@polkadot/util-crypto": ^8.2.2
rxjs: ^7.4.0
languageName: unknown
linkType: soft
"@polkadot/api-derive@7.0.1, @polkadot/api-derive@workspace:packages/api-derive":
"@polkadot/api-derive@7.0.2, @polkadot/api-derive@workspace:packages/api-derive":
version: 0.0.0-use.local
resolution: "@polkadot/api-derive@workspace:packages/api-derive"
dependencies:
"@babel/runtime": ^7.16.5
"@polkadot/api": 7.0.1
"@polkadot/api-augment": 7.0.1
"@polkadot/api-base": 7.0.1
"@polkadot/rpc-augment": 7.0.1
"@polkadot/rpc-core": 7.0.1
"@polkadot/types": 7.0.1
"@polkadot/types-codec": 7.0.1
"@polkadot/api": 7.0.2
"@polkadot/api-augment": 7.0.2
"@polkadot/api-base": 7.0.2
"@polkadot/rpc-augment": 7.0.2
"@polkadot/rpc-core": 7.0.2
"@polkadot/types": 7.0.2
"@polkadot/types-codec": 7.0.2
"@polkadot/util": ^8.2.2
"@polkadot/util-crypto": ^8.2.2
rxjs: ^7.4.0
languageName: unknown
linkType: soft
"@polkadot/api@7.0.1, @polkadot/api@workspace:packages/api":
"@polkadot/api@7.0.2, @polkadot/api@workspace:packages/api":
version: 0.0.0-use.local
resolution: "@polkadot/api@workspace:packages/api"
dependencies:
"@babel/runtime": ^7.16.5
"@polkadot/api-augment": 7.0.1
"@polkadot/api-base": 7.0.1
"@polkadot/api-derive": 7.0.1
"@polkadot/api-augment": 7.0.2
"@polkadot/api-base": 7.0.2
"@polkadot/api-derive": 7.0.2
"@polkadot/keyring": ^8.2.2
"@polkadot/rpc-augment": 7.0.1
"@polkadot/rpc-core": 7.0.1
"@polkadot/rpc-provider": 7.0.1
"@polkadot/types": 7.0.1
"@polkadot/types-augment": 7.0.1
"@polkadot/types-codec": 7.0.1
"@polkadot/types-create": 7.0.1
"@polkadot/types-known": 7.0.1
"@polkadot/rpc-augment": 7.0.2
"@polkadot/rpc-core": 7.0.2
"@polkadot/rpc-provider": 7.0.2
"@polkadot/types": 7.0.2
"@polkadot/types-augment": 7.0.2
"@polkadot/types-codec": 7.0.2
"@polkadot/types-create": 7.0.2
"@polkadot/types-known": 7.0.2
"@polkadot/util": ^8.2.2
"@polkadot/util-crypto": ^8.2.2
eventemitter3: ^4.0.7
@@ -1949,9 +1949,9 @@ __metadata:
languageName: unknown
linkType: soft
"@polkadot/dev@npm:^0.64.8":
version: 0.64.8
resolution: "@polkadot/dev@npm:0.64.8"
"@polkadot/dev@npm:^0.64.11":
version: 0.64.11
resolution: "@polkadot/dev@npm:0.64.11"
dependencies:
"@babel/cli": ^7.16.0
"@babel/core": ^7.16.5
@@ -2036,7 +2036,7 @@ __metadata:
polkadot-exec-rollup: scripts/polkadot-exec-rollup.mjs
polkadot-exec-tsc: scripts/polkadot-exec-tsc.mjs
polkadot-exec-webpack: scripts/polkadot-exec-webpack.mjs
checksum: c8ab862c3184cbbd4d26b27c53b91178245bfcb39ccdf8a5386e25b4ead71beee546fc5d79c28d21bfe252b65d3cb58cdf7465522a9b5e45560fe9bf48cbef7e
checksum: 97cecfd0df01cffa2bb1767305e20eaa4a94a4005ae3c3571e525a47fcbe4776534910a77ff836c71237d1ece7970f550086955e86c6f3499cdad381f36fc8a6
languageName: node
linkType: hard
@@ -2063,40 +2063,40 @@ __metadata:
languageName: node
linkType: hard
"@polkadot/rpc-augment@7.0.1, @polkadot/rpc-augment@workspace:packages/rpc-augment":
"@polkadot/rpc-augment@7.0.2, @polkadot/rpc-augment@workspace:packages/rpc-augment":
version: 0.0.0-use.local
resolution: "@polkadot/rpc-augment@workspace:packages/rpc-augment"
dependencies:
"@babel/runtime": ^7.16.5
"@polkadot/rpc-core": 7.0.1
"@polkadot/types": 7.0.1
"@polkadot/types-codec": 7.0.1
"@polkadot/rpc-core": 7.0.2
"@polkadot/types": 7.0.2
"@polkadot/types-codec": 7.0.2
"@polkadot/util": ^8.2.2
languageName: unknown
linkType: soft
"@polkadot/rpc-core@7.0.1, @polkadot/rpc-core@workspace:packages/rpc-core":
"@polkadot/rpc-core@7.0.2, @polkadot/rpc-core@workspace:packages/rpc-core":
version: 0.0.0-use.local
resolution: "@polkadot/rpc-core@workspace:packages/rpc-core"
dependencies:
"@babel/runtime": ^7.16.5
"@polkadot/keyring": ^8.2.2
"@polkadot/rpc-augment": 7.0.1
"@polkadot/rpc-provider": 7.0.1
"@polkadot/types": 7.0.1
"@polkadot/rpc-augment": 7.0.2
"@polkadot/rpc-provider": 7.0.2
"@polkadot/types": 7.0.2
"@polkadot/util": ^8.2.2
rxjs: ^7.4.0
languageName: unknown
linkType: soft
"@polkadot/rpc-provider@7.0.1, @polkadot/rpc-provider@workspace:packages/rpc-provider":
"@polkadot/rpc-provider@7.0.2, @polkadot/rpc-provider@workspace:packages/rpc-provider":
version: 0.0.0-use.local
resolution: "@polkadot/rpc-provider@workspace:packages/rpc-provider"
dependencies:
"@babel/runtime": ^7.16.5
"@polkadot/keyring": ^8.2.2
"@polkadot/types": 7.0.1
"@polkadot/types-support": 7.0.1
"@polkadot/types": 7.0.2
"@polkadot/types-support": 7.0.2
"@polkadot/util": ^8.2.2
"@polkadot/util-crypto": ^8.2.2
"@polkadot/x-fetch": ^8.2.2
@@ -2124,14 +2124,14 @@ __metadata:
"@babel/core": ^7.16.5
"@babel/register": ^7.16.5
"@babel/runtime": ^7.16.5
"@polkadot/api": 7.0.1
"@polkadot/rpc-augment": 7.0.1
"@polkadot/rpc-provider": 7.0.1
"@polkadot/types": 7.0.1
"@polkadot/types-augment": 7.0.1
"@polkadot/types-codec": 7.0.1
"@polkadot/types-create": 7.0.1
"@polkadot/types-support": 7.0.1
"@polkadot/api": 7.0.2
"@polkadot/rpc-augment": 7.0.2
"@polkadot/rpc-provider": 7.0.2
"@polkadot/types": 7.0.2
"@polkadot/types-augment": 7.0.2
"@polkadot/types-codec": 7.0.2
"@polkadot/types-create": 7.0.2
"@polkadot/types-support": 7.0.2
"@polkadot/util": ^8.2.2
"@polkadot/x-ws": ^8.2.2
"@types/websocket": ^1.0.4
@@ -2148,51 +2148,51 @@ __metadata:
languageName: unknown
linkType: soft
"@polkadot/types-augment@7.0.1, @polkadot/types-augment@workspace:packages/types-augment":
"@polkadot/types-augment@7.0.2, @polkadot/types-augment@workspace:packages/types-augment":
version: 0.0.0-use.local
resolution: "@polkadot/types-augment@workspace:packages/types-augment"
dependencies:
"@babel/runtime": ^7.16.5
"@polkadot/types": 7.0.1
"@polkadot/types-codec": 7.0.1
"@polkadot/types": 7.0.2
"@polkadot/types-codec": 7.0.2
"@polkadot/util": ^8.2.2
languageName: unknown
linkType: soft
"@polkadot/types-codec@7.0.1, @polkadot/types-codec@workspace:packages/types-codec":
"@polkadot/types-codec@7.0.2, @polkadot/types-codec@workspace:packages/types-codec":
version: 0.0.0-use.local
resolution: "@polkadot/types-codec@workspace:packages/types-codec"
dependencies:
"@babel/runtime": ^7.16.5
"@polkadot/types": ^7.0.1
"@polkadot/types": ^7.0.2
"@polkadot/util": ^8.2.2
languageName: unknown
linkType: soft
"@polkadot/types-create@7.0.1, @polkadot/types-create@workspace:packages/types-create":
"@polkadot/types-create@7.0.2, @polkadot/types-create@workspace:packages/types-create":
version: 0.0.0-use.local
resolution: "@polkadot/types-create@workspace:packages/types-create"
dependencies:
"@babel/runtime": ^7.16.5
"@polkadot/types-codec": 7.0.1
"@polkadot/types-codec": 7.0.2
"@polkadot/util": ^8.2.2
languageName: unknown
linkType: soft
"@polkadot/types-known@7.0.1, @polkadot/types-known@workspace:packages/types-known":
"@polkadot/types-known@7.0.2, @polkadot/types-known@workspace:packages/types-known":
version: 0.0.0-use.local
resolution: "@polkadot/types-known@workspace:packages/types-known"
dependencies:
"@babel/runtime": ^7.16.5
"@polkadot/networks": ^8.2.2
"@polkadot/types": 7.0.1
"@polkadot/types-codec": 7.0.1
"@polkadot/types-create": 7.0.1
"@polkadot/types": 7.0.2
"@polkadot/types-codec": 7.0.2
"@polkadot/types-create": 7.0.2
"@polkadot/util": ^8.2.2
languageName: unknown
linkType: soft
"@polkadot/types-support@7.0.1, @polkadot/types-support@workspace:packages/types-support":
"@polkadot/types-support@7.0.2, @polkadot/types-support@workspace:packages/types-support":
version: 0.0.0-use.local
resolution: "@polkadot/types-support@workspace:packages/types-support"
dependencies:
@@ -2201,16 +2201,16 @@ __metadata:
languageName: unknown
linkType: soft
"@polkadot/types@7.0.1, @polkadot/types@^7.0.1, @polkadot/types@workspace:packages/types":
"@polkadot/types@7.0.2, @polkadot/types@^7.0.2, @polkadot/types@workspace:packages/types":
version: 0.0.0-use.local
resolution: "@polkadot/types@workspace:packages/types"
dependencies:
"@babel/runtime": ^7.16.5
"@polkadot/keyring": ^8.2.2
"@polkadot/types-augment": 7.0.1
"@polkadot/types-codec": 7.0.1
"@polkadot/types-create": 7.0.1
"@polkadot/types-support": 7.0.1
"@polkadot/types-augment": 7.0.2
"@polkadot/types-codec": 7.0.2
"@polkadot/types-create": 7.0.2
"@polkadot/types-support": 7.0.2
"@polkadot/util": ^8.2.2
"@polkadot/util-crypto": ^8.2.2
rxjs: ^7.4.0
@@ -8983,7 +8983,7 @@ resolve@^2.0.0-next.3:
"@babel/core": ^7.16.5
"@babel/register": ^7.16.5
"@babel/runtime": ^7.16.5
"@polkadot/dev": ^0.64.8
"@polkadot/dev": ^0.64.11
"@polkadot/ts": ^0.4.20
"@polkadot/typegen": "workspace:packages/typegen"
"@types/jest": ^27.0.3