Update to latest Substrate metadata (#3316)

* Update to latest Substrate metadata

* Update contract Schedule

* Update CHANGELOG.md

Co-authored-by: Xiliang Chen <xlchen1291@gmail.com>

* CHANGELOG

* Updates

Co-authored-by: Xiliang Chen <xlchen1291@gmail.com>
This commit is contained in:
Jaco Greeff
2021-03-15 10:36:05 +01:00
committed by GitHub
co-authored by Xiliang Chen
parent a398b2201f
commit 1434b86b8f
15 changed files with 855 additions and 254 deletions
+10 -14
View File
@@ -7,18 +7,10 @@ declare module '@polkadot/api/types/errors' {
export interface AugmentedErrors<ApiType> {
assets: {
[key: string]: AugmentedError<ApiType>;
/**
* Transfer amount should be non-zero.
**/
AmountZero: AugmentedError<ApiType>;
/**
* Invalid metadata given.
**/
BadMetadata: AugmentedError<ApiType>;
/**
* Some internal state is broken.
**/
BadState: AugmentedError<ApiType>;
/**
* Invalid witness data given.
**/
@@ -47,22 +39,26 @@ declare module '@polkadot/api/types/errors' {
* 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.
**/
NoProvider: AugmentedError<ApiType>;
/**
* A mint operation lead to an overflow.
**/
Overflow: AugmentedError<ApiType>;
/**
* Attempt to destroy an asset class when non-zombie, reference-bearing accounts exist.
* No approval exists that would allow the transfer.
**/
RefsLeft: AugmentedError<ApiType>;
/**
* Too many zombie accounts in use.
**/
TooManyZombies: AugmentedError<ApiType>;
Unapproved: AugmentedError<ApiType>;
/**
* The given asset ID is unknown.
**/
Unknown: AugmentedError<ApiType>;
/**
* The source account would not survive the transfer and it needs to stay alive.
**/
WouldDie: AugmentedError<ApiType>;
};
authorship: {
[key: string]: AugmentedError<ApiType>;
+25 -8
View File
@@ -28,10 +28,25 @@ declare module '@polkadot/api/types/events' {
export interface AugmentedEvents<ApiType> {
assets: {
[key: string]: AugmentedEvent<ApiType>;
/**
* An approval for account `delegate` was cancelled by `owner`.
* \[id, owner, delegate\]
**/
ApprovalCancelled: AugmentedEvent<ApiType, [AssetId, AccountId, AccountId]>;
/**
* (Additional) funds have been approved for transfer to a destination account.
* \[asset_id, source, delegate, amount\]
**/
ApprovedTransfer: AugmentedEvent<ApiType, [AssetId, AccountId, AccountId, TAssetBalance]>;
/**
* Some asset `asset_id` was frozen. \[asset_id\]
**/
AssetFrozen: AugmentedEvent<ApiType, [AssetId]>;
/**
* An asset has had its attributes changed by the `Force` origin.
* \[id\]
**/
AssetStatusChanged: AugmentedEvent<ApiType, [AssetId]>;
/**
* Some asset `asset_id` was thawed. \[asset_id\]
**/
@@ -52,10 +67,6 @@ declare module '@polkadot/api/types/events' {
* Some asset class was force-created. \[asset_id, owner\]
**/
ForceCreated: AugmentedEvent<ApiType, [AssetId, AccountId]>;
/**
* Some assets was transferred by an admin. \[asset_id, from, to, amount\]
**/
ForceTransferred: AugmentedEvent<ApiType, [AssetId, AccountId, AccountId, TAssetBalance]>;
/**
* Some account `who` was frozen. \[asset_id, who\]
**/
@@ -65,13 +76,13 @@ declare module '@polkadot/api/types/events' {
**/
Issued: AugmentedEvent<ApiType, [AssetId, AccountId, TAssetBalance]>;
/**
* The maximum amount of zombies allowed has changed. \[asset_id, max_zombies\]
* Metadata has been cleared for an asset. \[asset_id\]
**/
MaxZombiesChanged: AugmentedEvent<ApiType, [AssetId, u32]>;
MetadataCleared: AugmentedEvent<ApiType, [AssetId]>;
/**
* New metadata has been set for an asset. \[asset_id, name, symbol, decimals\]
* New metadata has been set for an asset. \[asset_id, name, symbol, decimals, is_frozen\]
**/
MetadataSet: AugmentedEvent<ApiType, [AssetId, Bytes, Bytes, u8]>;
MetadataSet: AugmentedEvent<ApiType, [AssetId, Bytes, Bytes, u8, bool]>;
/**
* The owner changed \[asset_id, owner\]
**/
@@ -88,6 +99,12 @@ declare module '@polkadot/api/types/events' {
* Some assets were transferred. \[asset_id, from, to, amount\]
**/
Transferred: AugmentedEvent<ApiType, [AssetId, AccountId, AccountId, TAssetBalance]>;
/**
* An `amount` was transferred in its entirety from `owner` to `destination` by
* the approved `delegate`.
* \[id, owner, delegate, destination\]
**/
TransferredApproved: AugmentedEvent<ApiType, [AssetId, AccountId, AccountId, AccountId, TAssetBalance]>;
};
balances: {
[key: string]: AugmentedEvent<ApiType>;
+36 -9
View File
@@ -3,9 +3,9 @@
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, AssetMetadata } from '@polkadot/types/interfaces/assets';
import type { AssetApproval, AssetApprovalKey, 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 { BabeAuthorityWeight, BabeEpochConfiguration, 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';
@@ -40,6 +40,11 @@ declare module '@polkadot/api/types/storage' {
* The number of units of assets held by any given account.
**/
account: AugmentedQueryDoubleMap<ApiType, (key1: AssetId | AnyNumber | Uint8Array, key2: AccountId | string | Uint8Array) => Observable<AssetBalance>, [AssetId, AccountId]> & QueryableStorageEntry<ApiType, [AssetId, AccountId]>;
/**
* Approved balance transfers. First balance is the amount approved for transfer. Second
* is the amount of `T::Currency` reserved for storing this.
**/
approvals: AugmentedQueryDoubleMap<ApiType, (key1: AssetId | AnyNumber | Uint8Array, key2: AssetApprovalKey | { owner?: any; delegate?: any } | string | Uint8Array) => Observable<Option<AssetApproval>>, [AssetId, AssetApprovalKey]> & QueryableStorageEntry<ApiType, [AssetId, AssetApprovalKey]>;
/**
* Details of an asset.
**/
@@ -80,10 +85,22 @@ declare module '@polkadot/api/types/storage' {
* Current slot number.
**/
currentSlot: AugmentedQuery<ApiType, () => Observable<Slot>, []> & QueryableStorageEntry<ApiType, []>;
/**
* The configuration for the current epoch. Should never be `None` as it is initialized in genesis.
**/
epochConfig: AugmentedQuery<ApiType, () => Observable<Option<BabeEpochConfiguration>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Current epoch index.
**/
epochIndex: AugmentedQuery<ApiType, () => Observable<u64>, []> & QueryableStorageEntry<ApiType, []>;
/**
* The block numbers when the last and current epoch have started, respectively `N-1` and
* `N`.
* NOTE: We track this is in order to annotate the block number when a given pool of
* entropy was fixed (i.e. it was known to chain observers). Since epochs are defined in
* slots, which may be skipped, the block numbers may not line up with the slot numbers.
**/
epochStart: AugmentedQuery<ApiType, () => Observable<ITuple<[BlockNumber, BlockNumber]>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* The slot at which the first epoch actually started. This is 0
* until the first block of the chain.
@@ -107,13 +124,18 @@ declare module '@polkadot/api/types/storage' {
**/
nextAuthorities: AugmentedQuery<ApiType, () => Observable<Vec<ITuple<[AuthorityId, BabeAuthorityWeight]>>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Next epoch configuration, if changed.
* The configuration for the next epoch, `None` if the config will not change
* (you can fallback to `EpochConfig` instead in that case).
**/
nextEpochConfig: AugmentedQuery<ApiType, () => Observable<Option<NextConfigDescriptor>>, []> & QueryableStorageEntry<ApiType, []>;
nextEpochConfig: AugmentedQuery<ApiType, () => Observable<Option<BabeEpochConfiguration>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Next epoch randomness.
**/
nextRandomness: AugmentedQuery<ApiType, () => Observable<Randomness>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Pending epoch configuration change that will be applied when the next epoch is enacted.
**/
pendingEpochConfigChange: AugmentedQuery<ApiType, () => Observable<Option<NextConfigDescriptor>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* The epoch randomness for the *current* epoch.
*
@@ -488,12 +510,17 @@ declare module '@polkadot/api/types/storage' {
**/
authoredBlocks: AugmentedQueryDoubleMap<ApiType, (key1: SessionIndex | AnyNumber | Uint8Array, key2: ValidatorId | string | Uint8Array) => Observable<u32>, [SessionIndex, ValidatorId]> & QueryableStorageEntry<ApiType, [SessionIndex, ValidatorId]>;
/**
* The block number after which it's ok to send heartbeats in current session.
* The block number after which it's ok to send heartbeats in the current
* session.
*
* At the beginning of each session we set this to a value that should
* fall roughly in the middle of the session duration.
* The idea is to first wait for the validators to produce a block
* in the current session, so that the heartbeat later on will not be necessary.
* At the beginning of each session we set this to a value that should fall
* roughly in the middle of the session duration. The idea is to first wait for
* the validators to produce a block in the current session, so that the
* heartbeat later on will not be necessary.
*
* This value will only be used as a fallback if we fail to get a proper session
* progress estimate from `NextSessionRotation`, as those estimates should be
* more accurate then the value we calculate for `HeartbeatAfter`.
**/
heartbeatAfter: AugmentedQuery<ApiType, () => Observable<BlockNumber>, []> & QueryableStorageEntry<ApiType, []>;
/**
+181 -44
View File
@@ -3,7 +3,7 @@
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 { AssetDestroyWitness, TAssetBalance } from '@polkadot/types/interfaces/assets';
import type { BabeEquivocationProof, NextConfigDescriptor } from '@polkadot/types/interfaces/babe';
import type { MemberCount, ProposalIndex } from '@polkadot/types/interfaces/collective';
import type { CodeHash, Schedule } from '@polkadot/types/interfaces/contracts';
@@ -30,6 +30,29 @@ declare module '@polkadot/api/types/submittable' {
export interface AugmentedSubmittables<ApiType> {
assets: {
[key: string]: SubmittableExtrinsicFunction<ApiType>;
/**
* Approve an amount of asset for transfer by a delegated third-party account.
*
* Origin must be Signed.
*
* Ensures that `ApprovalDeposit` worth of `Currency` is reserved from signing account
* for the purpose of holding the approval. If some non-zero amount of assets is already
* approved from signing account to `delegate`, then it is topped up or unreserved to
* meet the right value.
*
* NOTE: The signing account does not need to own `amount` of assets at the point of
* making this call.
*
* - `id`: The identifier of the asset.
* - `delegate`: The account to delegate permission to transfer asset.
* - `amount`: The amount of asset that may be transferred by `delegate`. If there is
* already an approval in place, then this acts additively.
*
* Emits `ApprovedTransfer` on success.
*
* Weight: `O(1)`
**/
approveTransfer: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, delegate: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, amount: Compact<TAssetBalance> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, LookupSource, Compact<TAssetBalance>]>;
/**
* Reduce the balance of `who` by as much as possible up to `amount` assets of `id`.
*
@@ -48,10 +71,40 @@ declare module '@polkadot/api/types/submittable' {
* Modes: Post-existence of `who`; Pre & post Zombie-status of `who`.
**/
burn: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, who: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, amount: Compact<TAssetBalance> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, LookupSource, Compact<TAssetBalance>]>;
/**
* Cancel all of some asset approved for delegated transfer by a third-party account.
*
* Origin must be Signed and there must be an approval in place between signer and
* `delegate`.
*
* Unreserves any deposit previously reserved by `approve_transfer` for the approval.
*
* - `id`: The identifier of the asset.
* - `delegate`: The account delegated permission to transfer asset.
*
* Emits `ApprovalCancelled` on success.
*
* Weight: `O(1)`
**/
cancelApproval: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, delegate: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, LookupSource]>;
/**
* Clear the metadata for an asset.
*
* Origin must be Signed and the sender should be the Owner of the asset `id`.
*
* Any deposit is freed for the asset owner.
*
* - `id`: The identifier of the asset to clear.
*
* Emits `MetadataCleared`.
*
* Weight: `O(1)`
**/
clearMetadata: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>]>;
/**
* Issue a new class of fungible assets from a public origin.
*
* This new asset class has no assets initially.
* This new asset class has no assets initially and its owner is the origin.
*
* The origin must be Signed and the sender must have sufficient funds free.
*
@@ -61,11 +114,8 @@ declare module '@polkadot/api/types/submittable' {
* Parameters:
* - `id`: The identifier of the new asset. This must not be currently in use to identify
* an existing asset.
* - `owner`: The owner of this class of assets. The owner has full superuser permissions
* over this asset, but may later change and configure the permissions using `transfer_ownership`
* and `set_team`.
* - `max_zombies`: The total number of accounts which may hold assets in this class yet
* have no existential deposit.
* - `admin`: The admin of this class of assets. The admin is the initial address of each
* member of the asset class's admin team.
* - `min_balance`: The minimum balance of this new asset that any single account must
* have. If an account's balance is reduced below this, then it collapses to zero.
*
@@ -73,20 +123,79 @@ declare module '@polkadot/api/types/submittable' {
*
* Weight: `O(1)`
**/
create: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, admin: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, maxZombies: u32 | AnyNumber | Uint8Array, minBalance: TAssetBalance | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, LookupSource, u32, TAssetBalance]>;
create: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, admin: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, minBalance: TAssetBalance | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, LookupSource, TAssetBalance]>;
/**
* Destroy a class of fungible assets owned by the sender.
* Destroy a class of fungible assets.
*
* The origin must be Signed and the sender must be the owner of the asset `id`.
* The origin must conform to `ForceOrigin` or must be Signed and the sender must be the
* owner of the asset `id`.
*
* - `id`: The identifier of the asset to be destroyed. This must identify an existing
* asset.
*
* Emits `Destroyed` event when successful.
*
* Weight: `O(z)` where `z` is the number of zombie accounts.
* Weight: `O(c + p + a)` where:
* - `c = (witness.accounts - witness.sufficients)`
* - `s = witness.sufficients`
* - `a = witness.approvals`
**/
destroy: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, zombiesWitness: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, Compact<u32>]>;
destroy: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, witness: AssetDestroyWitness | { accounts?: any; sufficients?: any; approvals?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, AssetDestroyWitness]>;
/**
* Alter the attributes of a given asset.
*
* Origin must be `ForceOrigin`.
*
* - `id`: The identifier of the asset.
* - `owner`: The new Owner of this asset.
* - `issuer`: The new Issuer of this asset.
* - `admin`: The new Admin of this asset.
* - `freezer`: The new Freezer of this asset.
* - `min_balance`: The minimum balance of this new asset that any single account must
* have. If an account's balance is reduced below this, then it collapses to zero.
* - `is_sufficient`: Whether a non-zero balance of this asset is deposit of sufficient
* value to account for the state bloat associated with its balance storage. If set to
* `true`, then non-zero balances may be stored without a `consumer` reference (and thus
* an ED in the Balances pallet or whatever else is used to control user-account state
* growth).
* - `is_frozen`: Whether this asset class is frozen except for permissioned/admin
* instructions.
*
* Emits `AssetStatusChanged` with the identity of the asset.
*
* Weight: `O(1)`
**/
forceAssetStatus: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, owner: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, issuer: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, admin: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, freezer: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, minBalance: Compact<TAssetBalance> | AnyNumber | Uint8Array, isSufficient: bool | boolean | Uint8Array, isFrozen: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, LookupSource, LookupSource, LookupSource, LookupSource, Compact<TAssetBalance>, bool, bool]>;
/**
* Cancel all of some asset approved for delegated transfer by a third-party account.
*
* Origin must be either ForceOrigin or Signed origin with the signer being the Admin
* account of the asset `id`.
*
* Unreserves any deposit previously reserved by `approve_transfer` for the approval.
*
* - `id`: The identifier of the asset.
* - `delegate`: The account delegated permission to transfer asset.
*
* Emits `ApprovalCancelled` on success.
*
* Weight: `O(1)`
**/
forceCancelApproval: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, owner: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, delegate: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, LookupSource, LookupSource]>;
/**
* Clear the metadata for an asset.
*
* Origin must be ForceOrigin.
*
* Any deposit is returned.
*
* - `id`: The identifier of the asset to clear.
*
* Emits `MetadataCleared`.
*
* Weight: `O(1)`
**/
forceClearMetadata: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>]>;
/**
* Issue a new class of fungible assets from a privileged origin.
*
@@ -110,20 +219,24 @@ declare module '@polkadot/api/types/submittable' {
*
* Weight: `O(1)`
**/
forceCreate: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, owner: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, maxZombies: Compact<u32> | AnyNumber | Uint8Array, minBalance: Compact<TAssetBalance> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, LookupSource, Compact<u32>, Compact<TAssetBalance>]>;
forceCreate: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, owner: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, isSufficient: bool | boolean | Uint8Array, minBalance: Compact<TAssetBalance> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, LookupSource, bool, Compact<TAssetBalance>]>;
/**
* Destroy a class of fungible assets.
* Force the metadata for an asset to some value.
*
* The origin must conform to `ForceOrigin`.
* Origin must be ForceOrigin.
*
* - `id`: The identifier of the asset to be destroyed. This must identify an existing
* asset.
* Any deposit is left alone.
*
* Emits `Destroyed` event when successful.
* - `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.
*
* Weight: `O(1)`
* Emits `MetadataSet`.
*
* Weight: `O(N + S)` where N and S are the length of the name and symbol respectively.
**/
forceDestroy: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, zombiesWitness: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, Compact<u32>]>;
forceSetMetadata: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, name: Bytes | string | Uint8Array, symbol: Bytes | string | Uint8Array, decimals: u8 | AnyNumber | Uint8Array, isFrozen: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, Bytes, Bytes, u8, bool]>;
/**
* Move some assets from one account to another.
*
@@ -186,30 +299,9 @@ declare module '@polkadot/api/types/submittable' {
* Modes: Pre-existing balance of `beneficiary`; Account pre-existence of `beneficiary`.
**/
mint: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, beneficiary: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, amount: Compact<TAssetBalance> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, LookupSource, Compact<TAssetBalance>]>;
/**
* 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<AssetId> | AnyNumber | Uint8Array, maxZombies: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, Compact<u32>]>;
/**
* 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:
@@ -221,7 +313,7 @@ declare module '@polkadot/api/types/submittable' {
* - `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`.
* Emits `MetadataSet`.
*
* Weight: `O(1)`
**/
@@ -287,12 +379,54 @@ declare module '@polkadot/api/types/submittable' {
* of sender; Account pre-existence of `target`.
**/
transfer: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, target: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, amount: Compact<TAssetBalance> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, LookupSource, Compact<TAssetBalance>]>;
/**
* Transfer some asset balance from a previously delegated account to some third-party
* account.
*
* Origin must be Signed and there must be an approval in place by the `owner` to the
* signer.
*
* If the entire amount approved for transfer is transferred, then any deposit previously
* reserved by `approve_transfer` is unreserved.
*
* - `id`: The identifier of the asset.
* - `owner`: The account which previously approved for a transfer of at least `amount` and
* from which the asset balance will be withdrawn.
* - `destination`: The account to which the asset balance of `amount` will be transferred.
* - `amount`: The amount of assets to transfer.
*
* Emits `TransferredApproved` on success.
*
* Weight: `O(1)`
**/
transferApproved: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, owner: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, destination: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, amount: Compact<TAssetBalance> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, LookupSource, LookupSource, Compact<TAssetBalance>]>;
/**
* Move some assets from the sender account to another, keeping the sender account alive.
*
* Origin must be Signed.
*
* - `id`: The identifier of the asset to have some amount transferred.
* - `target`: The account to be credited.
* - `amount`: The amount by which the sender's balance of assets should be reduced and
* `target`'s balance increased. The amount actually transferred may be slightly greater in
* the case that the transfer would otherwise take the sender balance above zero but below
* the minimum balance. Must be greater than zero.
*
* Emits `Transferred` with the actual amount transferred. If this takes the source balance
* to below the minimum for the asset, then the amount transferred is increased to take it
* to zero.
*
* Weight: `O(1)`
* Modes: Pre-existence of `target`; Post-existence of sender; Prior & post zombie-status
* of sender; Account pre-existence of `target`.
**/
transferKeepAlive: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, target: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, amount: Compact<TAssetBalance> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, LookupSource, Compact<TAssetBalance>]>;
/**
* Change the Owner of an asset.
*
* Origin must be Signed and the sender should be the Owner of the asset `id`.
*
* - `id`: The identifier of the asset to be frozen.
* - `id`: The identifier of the asset.
* - `owner`: The new Owner of this asset.
*
* Emits `OwnerChanged`.
@@ -594,7 +728,10 @@ declare module '@polkadot/api/types/submittable' {
/**
* Updates the schedule for metering contracts.
*
* The schedule must have a greater version than the stored schedule.
* The schedule's version cannot be less than the version of the stored schedule.
* If a schedule does not change the instruction weights the version does not
* need to be increased. Therefore we allow storing a schedule that has the same
* version as the stored one.
**/
updateSchedule: AugmentedSubmittable<(schedule: Schedule | { version?: any; enablePrintln?: any; limits?: any; instructionWeights?: any; hostFnWeights?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Schedule]>;
};
+1 -1
View File
@@ -65,7 +65,7 @@ export function defaultValues (registry: Registry, rpcData: string, withThrow =
if (withFallbackCheck) {
const [hexType, hexOrig] = [u8aToHex(type.toU8a()), u8aToHex(fallback.toU8a(true))];
assert(hexType === hexOrig, `Fallback does not match: ${hexType} !== ${hexOrig}`);
assert(hexType === hexOrig, `Fallback does not match (${((hexOrig.length - 2) / 2) - ((hexType.length - 2) / 2)} bytes missing): ${hexType} !== ${hexOrig}`);
}
} catch (error) {
const message = `${location}:: ${(error as Error).message}`;
+489 -131
View File
@@ -736,14 +736,14 @@
]
},
{
"name": "NextEpochConfig",
"name": "PendingEpochConfigChange",
"modifier": "Optional",
"type": {
"plain": "NextConfigDescriptor"
},
"fallback": "0x00",
"documentation": [
" Next epoch configuration, if changed."
" Pending epoch configuration change that will be applied when the next epoch is enacted."
]
},
{
@@ -828,6 +828,21 @@
" secondary plain slots are enabled (which don't contain a VRF output)."
]
},
{
"name": "EpochStart",
"modifier": "Default",
"type": {
"plain": "(BlockNumber,BlockNumber)"
},
"fallback": "0x0000000000000000",
"documentation": [
" The block numbers when the last and current epoch have started, respectively `N-1` and",
" `N`.",
" NOTE: We track this is in order to annotate the block number when a given pool of",
" entropy was fixed (i.e. it was known to chain observers). Since epochs are defined in",
" slots, which may be skipped, the block numbers may not line up with the slot numbers."
]
},
{
"name": "Lateness",
"modifier": "Default",
@@ -842,6 +857,29 @@
" on block finalization. Querying this storage entry outside of block",
" execution context should always yield zero."
]
},
{
"name": "EpochConfig",
"modifier": "Optional",
"type": {
"plain": "BabeEpochConfiguration"
},
"fallback": "0x00",
"documentation": [
" The configuration for the current epoch. Should never be `None` as it is initialized in genesis."
]
},
{
"name": "NextEpochConfig",
"modifier": "Optional",
"type": {
"plain": "BabeEpochConfiguration"
},
"fallback": "0x00",
"documentation": [
" The configuration for the next epoch, `None` if the config will not change",
" (you can fallback to `EpochConfig` instead in that case)."
]
}
]
},
@@ -7131,7 +7169,7 @@
"type": {
"plain": "Schedule"
},
"fallback": "0x0000000000040000000002000000010000800000001000000000100000000100002000000078060000a5600200a1740300271600000d1c0000e20c00006e160000ff280000a00000008b780100e4f80200b70600002c06000027070000a705000074170000ca2700002807000002ea8f08ef070000fd0700003c0a0000630800007f070000c7070000fe0700008909000022090000ea080000c30900002709000059070000d508000082080000b60900007a090000c90800009b080000bb080000a51f0000b51c00009a1f0000c21c00008c0800006b080000ea0800004009000092090000fc080000ae090000c2090000ae37290000000000e636290000000000be5a280000000000d479570000000000bc25280000000000a285280000000000008c28000000000052385c00000000003a07280000000000942a280000000000541d4d00000000002603130000000000b08a6f00000000000b01000000000000a053480000000000fd020000000000009862332700000000a32000000000000000e3bd3100000000902200000000000056120000000000006872ad0900000000de326200000000007cfe8e00000000008211ce07000000009309000000000000ac096d0000000000e43f161100000000da020000000000005e74cf0800000000e07b0b0200000000f005000000000000deb1c40a00000000f24a370900000000ff0e000000000000228bf9080000000049020000000000002a030000000000004c971c2300000000892100000000000067020000000000005703000000000000e60b000000000000aac22400000000006210000000000000f434270000000000200d00000000000094672200000000001806000000000000f86c2200000000001806000000000000",
"fallback": "0x000000000004000000000200000001000080000000100000000010000000010000200000001f060000d66a0200dd84030026180000bd1c0000430b000003170000ae2800009c000000dd69010063e00200300700000706000065070000b10500006e180000002800006905000072deae08f0070000dc070000710a00006a080000a507000096070000d1070000770900003e09000075090000d809000082090000bc090000120900003c09000072090000dc090000f7080000e108000062090000162000006b1d00002e2000002c1b0000fe080000000900000f090000a7090000f1090000ba090000bb09000065090000d8b82800000000009e9828000000000016902700000000004c705700000000004cc8270000000000e4bc270000000000e8d1270000000000a0685b0000000000484f2700000000009e7627000000000000f45100000000004cab120000000000184a700000000000140100000000000000cd460000000000fc02000000000000d0b570270000000013200000000000007821da3100000000e0200000000000009a120000000000000482b10900000000e03463000000000038d7900000000000de67d00700000000840900000000000006186e000000000016935d1200000000da02000000000000eaced408000000003a240e0200000000e705000000000000fc41d50a00000000d48e9309000000002d0f0000000000003a4225090000000047020000000000002303000000000000ba7c962300000000a5210000000000006d020000000000005403000000000000e50b00000000000026922400000000006110000000000000a4122600000000001d0d000000000000520e2200000000001a0600000000000020222200000000001a0600000000000044b13c0000000000",
"documentation": [
" Current cost schedule for contracts."
]
@@ -7225,7 +7263,10 @@
"documentation": [
" Updates the schedule for metering contracts.",
"",
" The schedule must have a greater version than the stored schedule."
" The schedule's version cannot be less than the version of the stored schedule.",
" If a schedule does not change the instruction weights the version does not",
" need to be increased. Therefore we allow storing a schedule that has the same",
" version as the stored one."
]
},
{
@@ -7575,7 +7616,7 @@
{
"name": "DeletionQueueDepth",
"type": "u32",
"value": "0x1b010000",
"value": "0xf0000000",
"documentation": [
" The maximum number of tries that can be queued for deletion."
]
@@ -7965,12 +8006,17 @@
},
"fallback": "0x00000000",
"documentation": [
" The block number after which it's ok to send heartbeats in current session.",
" The block number after which it's ok to send heartbeats in the current",
" session.",
"",
" At the beginning of each session we set this to a value that should",
" fall roughly in the middle of the session duration.",
" The idea is to first wait for the validators to produce a block",
" in the current session, so that the heartbeat later on will not be necessary."
" At the beginning of each session we set this to a value that should fall",
" roughly in the middle of the session duration. The idea is to first wait for",
" the validators to produce a block in the current session, so that the",
" heartbeat later on will not be necessary.",
"",
" This value will only be used as a fallback if we fail to get a proper session",
" progress estimate from `NextSessionRotation`, as those estimates should be",
" more accurate then the value we calculate for `HeartbeatAfter`."
]
},
{
@@ -12805,6 +12851,24 @@
" The number of units of assets held by any given account."
]
},
{
"name": "Approvals",
"modifier": "Optional",
"type": {
"doubleMap": {
"hasher": "Blake2_128Concat",
"key1": "AssetId",
"key2": "AssetApprovalKey",
"value": "AssetApproval",
"key2Hasher": "Blake2_128Concat"
}
},
"fallback": "0x00",
"documentation": [
" Approved balance transfers. First balance is the amount approved for transfer. Second",
" is the amount of `T::Currency` reserved for storing this."
]
},
{
"name": "Metadata",
"modifier": "Default",
@@ -12816,7 +12880,7 @@
"linked": false
}
},
"fallback": "0x00000000000000000000000000000000000000",
"fallback": "0x0000000000000000000000000000000000000000",
"documentation": [
" Metadata of an asset."
]
@@ -12835,10 +12899,6 @@
"name": "admin",
"type": "LookupSource"
},
{
"name": "max_zombies",
"type": "u32"
},
{
"name": "min_balance",
"type": "TAssetBalance"
@@ -12847,7 +12907,7 @@
"documentation": [
" Issue a new class of fungible assets from a public origin.",
"",
" This new asset class has no assets initially.",
" This new asset class has no assets initially and its owner is the origin.",
"",
" The origin must be Signed and the sender must have sufficient funds free.",
"",
@@ -12857,11 +12917,8 @@
" Parameters:",
" - `id`: The identifier of the new asset. This must not be currently in use to identify",
" an existing asset.",
" - `owner`: The owner of this class of assets. The owner has full superuser permissions",
" over this asset, but may later change and configure the permissions using `transfer_ownership`",
" and `set_team`.",
" - `max_zombies`: The total number of accounts which may hold assets in this class yet",
" have no existential deposit.",
" - `admin`: The admin of this class of assets. The admin is the initial address of each",
" member of the asset class's admin team.",
" - `min_balance`: The minimum balance of this new asset that any single account must",
" have. If an account's balance is reduced below this, then it collapses to zero.",
"",
@@ -12882,8 +12939,8 @@
"type": "LookupSource"
},
{
"name": "max_zombies",
"type": "Compact<u32>"
"name": "is_sufficient",
"type": "bool"
},
{
"name": "min_balance",
@@ -12922,46 +12979,25 @@
"type": "Compact<AssetId>"
},
{
"name": "zombies_witness",
"type": "Compact<u32>"
}
],
"documentation": [
" Destroy a class of fungible assets owned by the sender.",
"",
" The origin must be Signed and the sender must be the owner of the asset `id`.",
"",
" - `id`: The identifier of the asset to be destroyed. This must identify an existing",
" asset.",
"",
" Emits `Destroyed` event when successful.",
"",
" Weight: `O(z)` where `z` is the number of zombie accounts."
]
},
{
"name": "force_destroy",
"args": [
{
"name": "id",
"type": "Compact<AssetId>"
},
{
"name": "zombies_witness",
"type": "Compact<u32>"
"name": "witness",
"type": "AssetDestroyWitness"
}
],
"documentation": [
" Destroy a class of fungible assets.",
"",
" The origin must conform to `ForceOrigin`.",
" The origin must conform to `ForceOrigin` or must be Signed and the sender must be the",
" owner of the asset `id`.",
"",
" - `id`: The identifier of the asset to be destroyed. This must identify an existing",
" asset.",
"",
" Emits `Destroyed` event when successful.",
"",
" Weight: `O(1)`"
" Weight: `O(c + p + a)` where:",
" - `c = (witness.accounts - witness.sufficients)`",
" - `s = witness.sufficients`",
" - `a = witness.approvals`"
]
},
{
@@ -13066,6 +13102,43 @@
" of sender; Account pre-existence of `target`."
]
},
{
"name": "transfer_keep_alive",
"args": [
{
"name": "id",
"type": "Compact<AssetId>"
},
{
"name": "target",
"type": "LookupSource"
},
{
"name": "amount",
"type": "Compact<TAssetBalance>"
}
],
"documentation": [
" Move some assets from the sender account to another, keeping the sender account alive.",
"",
" Origin must be Signed.",
"",
" - `id`: The identifier of the asset to have some amount transferred.",
" - `target`: The account to be credited.",
" - `amount`: The amount by which the sender's balance of assets should be reduced and",
" `target`'s balance increased. The amount actually transferred may be slightly greater in",
" the case that the transfer would otherwise take the sender balance above zero but below",
" the minimum balance. Must be greater than zero.",
"",
" Emits `Transferred` with the actual amount transferred. If this takes the source balance",
" to below the minimum for the asset, then the amount transferred is increased to take it",
" to zero.",
"",
" Weight: `O(1)`",
" Modes: Pre-existence of `target`; Post-existence of sender; Prior & post zombie-status",
" of sender; Account pre-existence of `target`."
]
},
{
"name": "force_transfer",
"args": [
@@ -13215,7 +13288,7 @@
"",
" Origin must be Signed and the sender should be the Owner of the asset `id`.",
"",
" - `id`: The identifier of the asset to be frozen.",
" - `id`: The identifier of the asset.",
" - `owner`: The new Owner of this asset.",
"",
" Emits `OwnerChanged`.",
@@ -13258,35 +13331,6 @@
" Weight: `O(1)`"
]
},
{
"name": "set_max_zombies",
"args": [
{
"name": "id",
"type": "Compact<AssetId>"
},
{
"name": "max_zombies",
"type": "Compact<u32>"
}
],
"documentation": [
" 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)`"
]
},
{
"name": "set_metadata",
"args": [
@@ -13310,10 +13354,6 @@
"documentation": [
" 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:",
@@ -13325,7 +13365,293 @@
" - `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`.",
" Emits `MetadataSet`.",
"",
" Weight: `O(1)`"
]
},
{
"name": "clear_metadata",
"args": [
{
"name": "id",
"type": "Compact<AssetId>"
}
],
"documentation": [
" Clear the metadata for an asset.",
"",
" Origin must be Signed and the sender should be the Owner of the asset `id`.",
"",
" Any deposit is freed for the asset owner.",
"",
" - `id`: The identifier of the asset to clear.",
"",
" Emits `MetadataCleared`.",
"",
" Weight: `O(1)`"
]
},
{
"name": "force_set_metadata",
"args": [
{
"name": "id",
"type": "Compact<AssetId>"
},
{
"name": "name",
"type": "Bytes"
},
{
"name": "symbol",
"type": "Bytes"
},
{
"name": "decimals",
"type": "u8"
},
{
"name": "is_frozen",
"type": "bool"
}
],
"documentation": [
" Force the metadata for an asset to some value.",
"",
" Origin must be ForceOrigin.",
"",
" Any deposit is left alone.",
"",
" - `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 `MetadataSet`.",
"",
" Weight: `O(N + S)` where N and S are the length of the name and symbol respectively."
]
},
{
"name": "force_clear_metadata",
"args": [
{
"name": "id",
"type": "Compact<AssetId>"
}
],
"documentation": [
" Clear the metadata for an asset.",
"",
" Origin must be ForceOrigin.",
"",
" Any deposit is returned.",
"",
" - `id`: The identifier of the asset to clear.",
"",
" Emits `MetadataCleared`.",
"",
" Weight: `O(1)`"
]
},
{
"name": "force_asset_status",
"args": [
{
"name": "id",
"type": "Compact<AssetId>"
},
{
"name": "owner",
"type": "LookupSource"
},
{
"name": "issuer",
"type": "LookupSource"
},
{
"name": "admin",
"type": "LookupSource"
},
{
"name": "freezer",
"type": "LookupSource"
},
{
"name": "min_balance",
"type": "Compact<TAssetBalance>"
},
{
"name": "is_sufficient",
"type": "bool"
},
{
"name": "is_frozen",
"type": "bool"
}
],
"documentation": [
" Alter the attributes of a given asset.",
"",
" Origin must be `ForceOrigin`.",
"",
" - `id`: The identifier of the asset.",
" - `owner`: The new Owner of this asset.",
" - `issuer`: The new Issuer of this asset.",
" - `admin`: The new Admin of this asset.",
" - `freezer`: The new Freezer of this asset.",
" - `min_balance`: The minimum balance of this new asset that any single account must",
" have. If an account's balance is reduced below this, then it collapses to zero.",
" - `is_sufficient`: Whether a non-zero balance of this asset is deposit of sufficient",
" value to account for the state bloat associated with its balance storage. If set to",
" `true`, then non-zero balances may be stored without a `consumer` reference (and thus",
" an ED in the Balances pallet or whatever else is used to control user-account state",
" growth).",
" - `is_frozen`: Whether this asset class is frozen except for permissioned/admin",
" instructions.",
"",
" Emits `AssetStatusChanged` with the identity of the asset.",
"",
" Weight: `O(1)`"
]
},
{
"name": "approve_transfer",
"args": [
{
"name": "id",
"type": "Compact<AssetId>"
},
{
"name": "delegate",
"type": "LookupSource"
},
{
"name": "amount",
"type": "Compact<TAssetBalance>"
}
],
"documentation": [
" Approve an amount of asset for transfer by a delegated third-party account.",
"",
" Origin must be Signed.",
"",
" Ensures that `ApprovalDeposit` worth of `Currency` is reserved from signing account",
" for the purpose of holding the approval. If some non-zero amount of assets is already",
" approved from signing account to `delegate`, then it is topped up or unreserved to",
" meet the right value.",
"",
" NOTE: The signing account does not need to own `amount` of assets at the point of",
" making this call.",
"",
" - `id`: The identifier of the asset.",
" - `delegate`: The account to delegate permission to transfer asset.",
" - `amount`: The amount of asset that may be transferred by `delegate`. If there is",
" already an approval in place, then this acts additively.",
"",
" Emits `ApprovedTransfer` on success.",
"",
" Weight: `O(1)`"
]
},
{
"name": "cancel_approval",
"args": [
{
"name": "id",
"type": "Compact<AssetId>"
},
{
"name": "delegate",
"type": "LookupSource"
}
],
"documentation": [
" Cancel all of some asset approved for delegated transfer by a third-party account.",
"",
" Origin must be Signed and there must be an approval in place between signer and",
" `delegate`.",
"",
" Unreserves any deposit previously reserved by `approve_transfer` for the approval.",
"",
" - `id`: The identifier of the asset.",
" - `delegate`: The account delegated permission to transfer asset.",
"",
" Emits `ApprovalCancelled` on success.",
"",
" Weight: `O(1)`"
]
},
{
"name": "force_cancel_approval",
"args": [
{
"name": "id",
"type": "Compact<AssetId>"
},
{
"name": "owner",
"type": "LookupSource"
},
{
"name": "delegate",
"type": "LookupSource"
}
],
"documentation": [
" Cancel all of some asset approved for delegated transfer by a third-party account.",
"",
" Origin must be either ForceOrigin or Signed origin with the signer being the Admin",
" account of the asset `id`.",
"",
" Unreserves any deposit previously reserved by `approve_transfer` for the approval.",
"",
" - `id`: The identifier of the asset.",
" - `delegate`: The account delegated permission to transfer asset.",
"",
" Emits `ApprovalCancelled` on success.",
"",
" Weight: `O(1)`"
]
},
{
"name": "transfer_approved",
"args": [
{
"name": "id",
"type": "Compact<AssetId>"
},
{
"name": "owner",
"type": "LookupSource"
},
{
"name": "destination",
"type": "LookupSource"
},
{
"name": "amount",
"type": "Compact<TAssetBalance>"
}
],
"documentation": [
" Transfer some asset balance from a previously delegated account to some third-party",
" account.",
"",
" Origin must be Signed and there must be an approval in place by the `owner` to the",
" signer.",
"",
" If the entire amount approved for transfer is transferred, then any deposit previously",
" reserved by `approve_transfer` is unreserved.",
"",
" - `id`: The identifier of the asset.",
" - `owner`: The account which previously approved for a transfer of at least `amount` and",
" from which the asset balance will be withdrawn.",
" - `destination`: The account to which the asset balance of `amount` will be transferred.",
" - `amount`: The amount of assets to transfer.",
"",
" Emits `TransferredApproved` on success.",
"",
" Weight: `O(1)`"
]
@@ -13399,18 +13725,6 @@
" The owner changed \\[asset_id, owner\\]"
]
},
{
"name": "ForceTransferred",
"args": [
"AssetId",
"AccountId",
"AccountId",
"TAssetBalance"
],
"documentation": [
" Some assets was transferred by an admin. \\[asset_id, from, to, amount\\]"
]
},
{
"name": "Frozen",
"args": [
@@ -13468,37 +13782,81 @@
" Some asset class was force-created. \\[asset_id, owner\\]"
]
},
{
"name": "MaxZombiesChanged",
"args": [
"AssetId",
"u32"
],
"documentation": [
" The maximum amount of zombies allowed has changed. \\[asset_id, max_zombies\\]"
]
},
{
"name": "MetadataSet",
"args": [
"AssetId",
"Bytes",
"Bytes",
"u8"
"u8",
"bool"
],
"documentation": [
" New metadata has been set for an asset. \\[asset_id, name, symbol, decimals\\]"
" New metadata has been set for an asset. \\[asset_id, name, symbol, decimals, is_frozen\\]"
]
},
{
"name": "MetadataCleared",
"args": [
"AssetId"
],
"documentation": [
" Metadata has been cleared for an asset. \\[asset_id\\]"
]
},
{
"name": "ApprovedTransfer",
"args": [
"AssetId",
"AccountId",
"AccountId",
"TAssetBalance"
],
"documentation": [
" (Additional) funds have been approved for transfer to a destination account.",
" \\[asset_id, source, delegate, amount\\]"
]
},
{
"name": "ApprovalCancelled",
"args": [
"AssetId",
"AccountId",
"AccountId"
],
"documentation": [
" An approval for account `delegate` was cancelled by `owner`.",
" \\[id, owner, delegate\\]"
]
},
{
"name": "TransferredApproved",
"args": [
"AssetId",
"AccountId",
"AccountId",
"AccountId",
"TAssetBalance"
],
"documentation": [
" An `amount` was transferred in its entirety from `owner` to `destination` by",
" the approved `delegate`.",
" \\[id, owner, delegate, destination\\]"
]
},
{
"name": "AssetStatusChanged",
"args": [
"AssetId"
],
"documentation": [
" An asset has had its attributes changed by the `Force` origin.",
" \\[id\\]"
]
}
],
"constants": [],
"errors": [
{
"name": "AmountZero",
"documentation": [
" Transfer amount should be non-zero."
]
},
{
"name": "BalanceLow",
"documentation": [
@@ -13535,18 +13893,6 @@
" The asset ID is already taken."
]
},
{
"name": "TooManyZombies",
"documentation": [
" Too many zombie accounts in use."
]
},
{
"name": "RefsLeft",
"documentation": [
" Attempt to destroy an asset class when non-zombie, reference-bearing accounts exist."
]
},
{
"name": "BadWitness",
"documentation": [
@@ -13566,9 +13912,9 @@
]
},
{
"name": "BadState",
"name": "NoProvider",
"documentation": [
" Some internal state is broken."
" No provider reference exists to allow a non-zero balance of a non-self-sufficient asset."
]
},
{
@@ -13576,6 +13922,18 @@
"documentation": [
" Invalid metadata given."
]
},
{
"name": "Unapproved",
"documentation": [
" No approval exists that would allow the transfer."
]
},
{
"name": "WouldDie",
"documentation": [
" The source account would not survive the transfer and it needs to stay alive."
]
}
],
"index": 34
File diff suppressed because one or more lines are too long
+20 -22
View File
@@ -20,22 +20,24 @@ const KNOWN_ORIGINS: Record<string, string> = {
* Find and apply the correct type override
* @internal
**/
function setTypeOverride (sectionTypes: OverrideModuleType, type: Type): void {
const override = Object.keys(sectionTypes).find((aliased) => type.eq(aliased));
function setTypeOverride (sectionTypes: OverrideModuleType, ...types: Type[]): void {
types.forEach((type): void => {
const override = Object.keys(sectionTypes).find((aliased) => type.eq(aliased));
if (override) {
type.setOverride(sectionTypes[override]);
} else {
// FIXME: NOT happy with this approach, but gets over the initial hump cased by (Vec<Announcement>,BalanceOf)
const orig = type.toString();
const alias = Object.entries(sectionTypes).reduce((result: string, [from, to]): string =>
[['<', '>'], ['<', ','], [',', '>'], ['(', ')'], ['(', ','], [',', ','], [',', ')']].reduce((result, [one, two]): string =>
result.replace(`${one}${from}${two}`, `${one}${to}${two}`), result), orig);
if (override) {
type.setOverride(sectionTypes[override]);
} else {
// FIXME: NOT happy with this approach, but gets over the initial hump cased by (Vec<Announcement>,BalanceOf)
const orig = type.toString();
const alias = Object.entries(sectionTypes).reduce((result: string, [from, to]): string =>
[['<', '>'], ['<', ','], [',', '>'], ['(', ')'], ['(', ','], [',', ','], [',', ')']].reduce((result, [one, two]): string =>
result.replace(`${one}${from}${two}`, `${one}${to}${two}`), result), orig);
if (orig !== alias) {
type.setOverride(alias);
if (orig !== alias) {
type.setOverride(alias);
}
}
}
});
}
/**
@@ -81,18 +83,14 @@ function convertEvents (registry: Registry, events: EventMetadataV12[], sectionT
function convertStorage (registry: Registry, { items, prefix }: StorageMetadataV12, sectionTypes: OverrideModuleType): StorageMetadataLatest {
return registry.createType('StorageMetadataLatest', {
items: items.map((s): StorageEntryMetadataLatest => {
let resultType: Type;
if (s.type.isMap) {
resultType = s.type.asMap.value;
} else if (s.type.isDoubleMap) {
resultType = s.type.asDoubleMap.value;
if (s.type.isDoubleMap) {
setTypeOverride(sectionTypes, s.type.asDoubleMap.value, s.type.asDoubleMap.key1, s.type.asDoubleMap.key2);
} else if (s.type.isMap) {
setTypeOverride(sectionTypes, s.type.asMap.value, s.type.asMap.key);
} else {
resultType = s.type.asPlain;
setTypeOverride(sectionTypes, s.type.asPlain);
}
setTypeOverride(sectionTypes, resultType);
return registry.createType('StorageEntryMetadataLatest', s);
}),
prefix
+4 -1
View File
@@ -6,7 +6,10 @@ import type { OverrideModuleType } from '@polkadot/types/types';
// type overrides for modules (where duplication between modules exist)
const typesModules: Record<string, OverrideModuleType> = {
assets: {
Balance: 'TAssetBalance'
Approval: 'AssetApproval',
ApprovalKey: 'AssetApprovalKey',
Balance: 'TAssetBalance',
DestroyWitness: 'AssetDestroyWitness'
},
babe: {
EquivocationProof: 'BabeEquivocationProof'
+11 -5
View File
@@ -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, AssetMetadata, TAssetBalance, TAssetDepositBalance } from '@polkadot/types/interfaces/assets';
import type { AssetApproval, AssetApprovalKey, AssetBalance, AssetDestroyWitness, 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';
@@ -14,7 +14,7 @@ import type { PrefixedStorageKey } from '@polkadot/types/interfaces/childstate';
import type { EthereumAddress, StatementKind } from '@polkadot/types/interfaces/claims';
import type { CollectiveOrigin, MemberCount, ProposalIndex, Votes, VotesTo230 } from '@polkadot/types/interfaces/collective';
import type { AuthorityId, RawVRFOutput } from '@polkadot/types/interfaces/consensus';
import type { AliveContractInfo, CodeHash, ContractCallRequest, ContractExecResult, ContractExecResultErr, ContractExecResultErrModule, ContractExecResultOk, ContractExecResultResult, ContractExecResultSuccessTo255, ContractExecResultSuccessTo260, ContractExecResultTo255, ContractExecResultTo260, ContractInfo, ContractStorageKey, DeletedContract, Gas, HostFnWeights, HostFnWeightsTo264, InstructionWeights, Limits, LimitsTo264, PrefabWasmModule, PrefabWasmModuleReserved, Schedule, ScheduleTo212, ScheduleTo258, ScheduleTo264, SeedOf, TombstoneContractInfo, TrieId } from '@polkadot/types/interfaces/contracts';
import type { AliveContractInfo, CodeHash, ContractCallRequest, ContractExecResult, ContractExecResultErr, ContractExecResultErrModule, ContractExecResultOk, ContractExecResultResult, ContractExecResultSuccessTo255, ContractExecResultSuccessTo260, ContractExecResultTo255, ContractExecResultTo260, ContractInfo, ContractStorageKey, DeletedContract, Gas, HostFnWeights, HostFnWeightsTo264, InstructionWeights, Limits, LimitsTo264, PrefabWasmModule, Schedule, ScheduleTo212, ScheduleTo258, ScheduleTo264, SeedOf, TombstoneContractInfo, TrieId } from '@polkadot/types/interfaces/contracts';
import type { ContractConstructorSpec, ContractContractSpec, ContractCryptoHasher, ContractDiscriminant, ContractDisplayName, ContractEventParamSpec, ContractEventSpec, ContractLayoutArray, ContractLayoutCell, ContractLayoutEnum, ContractLayoutHash, ContractLayoutHashingStrategy, ContractLayoutKey, ContractLayoutStruct, ContractLayoutStructField, ContractMessageParamSpec, ContractMessageSpec, ContractProject, ContractProjectContract, ContractProjectSource, ContractSelector, ContractStorageLayout, ContractTypeSpec } from '@polkadot/types/interfaces/contractsAbi';
import type { FundIndex, FundInfo, LastContribution, TrieIndex } from '@polkadot/types/interfaces/crowdloan';
import type { AccountVote, AccountVoteSplit, AccountVoteStandard, Conviction, Delegations, PreimageStatus, PreimageStatusAvailable, PriorLock, PropIndex, Proposal, ProxyState, ReferendumIndex, ReferendumInfo, ReferendumInfoFinished, ReferendumInfoTo239, ReferendumStatus, Tally, Voting, VotingDelegating, VotingDirect, VotingDirectVote } from '@polkadot/types/interfaces/democracy';
@@ -176,7 +176,10 @@ declare module '@polkadot/types/types/registry' {
'Option<ApplyExtrinsicResult>': Option<ApplyExtrinsicResult>;
'Option<ApprovalFlag>': Option<ApprovalFlag>;
'Option<Approvals>': Option<Approvals>;
'Option<AssetApproval>': Option<AssetApproval>;
'Option<AssetApprovalKey>': Option<AssetApprovalKey>;
'Option<AssetBalance>': Option<AssetBalance>;
'Option<AssetDestroyWitness>': Option<AssetDestroyWitness>;
'Option<AssetDetails>': Option<AssetDetails>;
'Option<AssetId>': Option<AssetId>;
'Option<AssetInstance>': Option<AssetInstance>;
@@ -631,7 +634,6 @@ declare module '@polkadot/types/types/registry' {
'Option<Points>': Option<Points>;
'Option<Precommits>': Option<Precommits>;
'Option<PrefabWasmModule>': Option<PrefabWasmModule>;
'Option<PrefabWasmModuleReserved>': Option<PrefabWasmModuleReserved>;
'Option<PrefixedStorageKey>': Option<PrefixedStorageKey>;
'Option<PreimageStatus>': Option<PreimageStatus>;
'Option<PreimageStatusAvailable>': Option<PreimageStatusAvailable>;
@@ -923,7 +925,10 @@ declare module '@polkadot/types/types/registry' {
'Vec<ApplyExtrinsicResult>': Vec<ApplyExtrinsicResult>;
'Vec<ApprovalFlag>': Vec<ApprovalFlag>;
'Vec<Approvals>': Vec<Approvals>;
'Vec<AssetApproval>': Vec<AssetApproval>;
'Vec<AssetApprovalKey>': Vec<AssetApprovalKey>;
'Vec<AssetBalance>': Vec<AssetBalance>;
'Vec<AssetDestroyWitness>': Vec<AssetDestroyWitness>;
'Vec<AssetDetails>': Vec<AssetDetails>;
'Vec<AssetId>': Vec<AssetId>;
'Vec<AssetInstance>': Vec<AssetInstance>;
@@ -1378,7 +1383,6 @@ declare module '@polkadot/types/types/registry' {
'Vec<Points>': Vec<Points>;
'Vec<Precommits>': Vec<Precommits>;
'Vec<PrefabWasmModule>': Vec<PrefabWasmModule>;
'Vec<PrefabWasmModuleReserved>': Vec<PrefabWasmModuleReserved>;
'Vec<PrefixedStorageKey>': Vec<PrefixedStorageKey>;
'Vec<PreimageStatus>': Vec<PreimageStatus>;
'Vec<PreimageStatusAvailable>': Vec<PreimageStatusAvailable>;
@@ -1670,7 +1674,10 @@ declare module '@polkadot/types/types/registry' {
ApplyExtrinsicResult: ApplyExtrinsicResult;
ApprovalFlag: ApprovalFlag;
Approvals: Approvals;
AssetApproval: AssetApproval;
AssetApprovalKey: AssetApprovalKey;
AssetBalance: AssetBalance;
AssetDestroyWitness: AssetDestroyWitness;
AssetDetails: AssetDetails;
AssetId: AssetId;
AssetInstance: AssetInstance;
@@ -2125,7 +2132,6 @@ declare module '@polkadot/types/types/registry' {
Points: Points;
Precommits: Precommits;
PrefabWasmModule: PrefabWasmModule;
PrefabWasmModuleReserved: PrefabWasmModuleReserved;
PrefixedStorageKey: PrefixedStorageKey;
PreimageStatus: PreimageStatus;
PreimageStatusAvailable: PreimageStatusAvailable;
@@ -9,10 +9,23 @@ import type { Definitions } from '../../types';
export default {
rpc: {},
types: {
AssetApprovalKey: {
owner: 'AccountId',
delegate: 'AccountId'
},
AssetApproval: {
amount: 'TAssetBalance',
deposit: 'TAssetDepositBalance'
},
AssetBalance: {
balance: 'TAssetBalance',
isFrozen: 'bool',
isZombie: 'bool'
isSufficient: 'bool'
},
AssetDestroyWitness: {
accounts: 'Compact<u32>',
sufficients: 'Compact<u32>',
approvals: 'Compact<u32>'
},
AssetDetails: {
owner: 'AccountId',
@@ -21,16 +34,19 @@ export default {
freezer: 'AccountId',
supply: 'TAssetBalance',
deposit: 'TAssetDepositBalance',
maxZombies: 'u32',
minBalance: 'TAssetBalance',
zombies: 'u32',
accounts: 'u32'
isSufficient: 'bool',
accounts: 'u32',
sufficients: 'u32',
approvals: 'u32',
isFrozen: 'bool'
},
AssetMetadata: {
deposit: 'TAssetDepositBalance',
name: 'Vec<u8>',
symbol: 'Vec<u8>',
decimals: 'u8'
decimals: 'u8',
isFrozen: 'bool'
},
TAssetBalance: 'u64',
TAssetDepositBalance: 'BalanceOf'
+26 -4
View File
@@ -1,14 +1,33 @@
// Auto-generated via `yarn polkadot-types-from-defs`, do not edit
/* eslint-disable */
import type { Bytes, Struct, bool, u32, u64, u8 } from '@polkadot/types';
import type { Bytes, Compact, Struct, bool, u32, u64, u8 } from '@polkadot/types';
import type { AccountId, BalanceOf } from '@polkadot/types/interfaces/runtime';
/** @name AssetApproval */
export interface AssetApproval extends Struct {
readonly amount: TAssetBalance;
readonly deposit: TAssetDepositBalance;
}
/** @name AssetApprovalKey */
export interface AssetApprovalKey extends Struct {
readonly owner: AccountId;
readonly delegate: AccountId;
}
/** @name AssetBalance */
export interface AssetBalance extends Struct {
readonly balance: TAssetBalance;
readonly isFrozen: bool;
readonly isZombie: bool;
readonly isSufficient: bool;
}
/** @name AssetDestroyWitness */
export interface AssetDestroyWitness extends Struct {
readonly accounts: Compact<u32>;
readonly sufficients: Compact<u32>;
readonly approvals: Compact<u32>;
}
/** @name AssetDetails */
@@ -19,10 +38,12 @@ export interface AssetDetails extends Struct {
readonly freezer: AccountId;
readonly supply: TAssetBalance;
readonly deposit: TAssetDepositBalance;
readonly maxZombies: u32;
readonly minBalance: TAssetBalance;
readonly zombies: u32;
readonly isSufficient: bool;
readonly accounts: u32;
readonly sufficients: u32;
readonly approvals: u32;
readonly isFrozen: bool;
}
/** @name AssetMetadata */
@@ -31,6 +52,7 @@ export interface AssetMetadata extends Struct {
readonly name: Bytes;
readonly symbol: Bytes;
readonly decimals: u8;
readonly isFrozen: bool;
}
/** @name TAssetBalance */
@@ -70,7 +70,8 @@ export default {
codeHash: 'CodeHash',
rentAllowance: 'Balance',
deductBlock: 'BlockNumber',
lastWrite: 'Option<BlockNumber>'
lastWrite: 'Option<BlockNumber>',
_reserved: 'Option<Null>'
},
CodeHash: 'Hash',
ContractCallRequest: {
@@ -239,7 +240,8 @@ export default {
hashBlake2256: 'Weight',
hashBlake2256PerByte: 'Weight',
hashBlake2128: 'Weight',
hashBlake2128PerByte: 'Weight'
hashBlake2128PerByte: 'Weight',
rentParams: 'Weight'
},
InstructionWeights: {
i64const: 'u32',
@@ -319,10 +321,11 @@ export default {
scheduleVersion: 'Compact<u32>',
initial: 'Compact<u32>',
maximum: 'Compact<u32>',
_reserved: 'PrefabWasmModuleReserved',
code: 'Bytes'
refcount: 'Compact<u64>',
_reserved: 'Option<Null>',
code: 'Bytes',
originalCodeLen: 'u32'
},
PrefabWasmModuleReserved: 'Option<Null>',
ScheduleTo212: {
version: 'u32',
putCodePerByteCost: 'Gas',
@@ -14,6 +14,7 @@ export interface AliveContractInfo extends Struct {
readonly rentAllowance: Balance;
readonly deductBlock: BlockNumber;
readonly lastWrite: Option<BlockNumber>;
readonly _reserved: Option<Null>;
}
/** @name CodeHash */
@@ -166,6 +167,7 @@ export interface HostFnWeights extends Struct {
readonly hashBlake2256PerByte: Weight;
readonly hashBlake2128: Weight;
readonly hashBlake2128PerByte: Weight;
readonly rentParams: Weight;
}
/** @name HostFnWeightsTo264 */
@@ -302,13 +304,12 @@ export interface PrefabWasmModule extends Struct {
readonly scheduleVersion: Compact<u32>;
readonly initial: Compact<u32>;
readonly maximum: Compact<u32>;
readonly _reserved: PrefabWasmModuleReserved;
readonly refcount: Compact<u64>;
readonly _reserved: Option<Null>;
readonly code: Bytes;
readonly originalCodeLen: u32;
}
/** @name PrefabWasmModuleReserved */
export interface PrefabWasmModuleReserved extends Option<Null> {}
/** @name Schedule */
export interface Schedule extends Struct {
readonly version: u32;