From c4c099e693fb985555efd4c53330d45af60c071f Mon Sep 17 00:00:00 2001 From: Jaco Date: Thu, 20 May 2021 15:02:10 +0300 Subject: [PATCH] Add types for uniques (#3551) --- packages/types/src/augment/registry.ts | 32 ++++++++++ packages/types/src/interfaces/definitions.ts | 1 + packages/types/src/interfaces/types.ts | 1 + .../src/interfaces/uniques/definitions.ts | 50 +++++++++++++++ .../types/src/interfaces/uniques/index.ts | 4 ++ .../types/src/interfaces/uniques/types.ts | 62 +++++++++++++++++++ 6 files changed, 150 insertions(+) create mode 100644 packages/types/src/interfaces/uniques/definitions.ts create mode 100644 packages/types/src/interfaces/uniques/index.ts create mode 100644 packages/types/src/interfaces/uniques/types.ts diff --git a/packages/types/src/augment/registry.ts b/packages/types/src/augment/registry.ts index f0e601f09a..d106e3b555 100644 --- a/packages/types/src/augment/registry.ts +++ b/packages/types/src/augment/registry.ts @@ -53,6 +53,7 @@ import type { WeightToFeeCoefficient } from '@polkadot/types/interfaces/support' import type { AccountInfo, AccountInfoWithDualRefCount, AccountInfoWithProviders, AccountInfoWithRefCount, AccountInfoWithTripleRefCount, ApplyExtrinsicResult, ArithmeticError, BlockLength, BlockWeights, ChainProperties, ChainType, ConsumedWeight, DigestOf, DispatchClass, DispatchError, DispatchErrorModule, DispatchErrorTo198, DispatchInfo, DispatchInfoTo190, DispatchInfoTo244, DispatchOutcome, DispatchResult, DispatchResultOf, DispatchResultTo198, Event, EventId, EventIndex, EventRecord, Health, InvalidTransaction, Key, LastRuntimeUpgradeInfo, NetworkState, NetworkStatePeerset, NetworkStatePeersetInfo, NodeRole, NotConnectedPeer, Peer, PeerEndpoint, PeerEndpointAddr, PeerInfo, PeerPing, PerDispatchClassU32, PerDispatchClassWeight, PerDispatchClassWeightsPerClass, Phase, RawOrigin, RefCount, RefCountTo259, SyncState, SystemOrigin, TokenError, TransactionValidityError, UnknownTransaction, WeightPerClass } from '@polkadot/types/interfaces/system'; import type { Bounty, BountyIndex, BountyStatus, BountyStatusActive, BountyStatusCuratorProposed, BountyStatusPendingPayout, OpenTip, OpenTipFinderTo225, OpenTipTip, OpenTipTo225, TreasuryProposal } from '@polkadot/types/interfaces/treasury'; import type { Multiplier } from '@polkadot/types/interfaces/txpayment'; +import type { ClassDetails, ClassId, ClassMetadata, DepositBalance, DepositBalanceOf, DestroyWitness, InstanceDetails, InstanceId, InstanceMetadata } from '@polkadot/types/interfaces/uniques'; import type { Multisig, Timepoint } from '@polkadot/types/interfaces/utility'; import type { VestingInfo } from '@polkadot/types/interfaces/vesting'; import type { AccountId32Junction, AccountIndex64Junction, AccountKey20Junction, AssetInstance, BodyId, BodyPart, BodyPartAtLeastProportion, BodyPartFraction, BodyPartMoreThanProportion, DoubleEncodedCall, InboundStatus, Junction, MultiAsset, MultiAssetAbstractFungible, MultiAssetAbstractNonFungible, MultiAssetConcreteFungible, MultiAssetConcreteNonFungible, MultiLocation, NetworkId, OutboundStatus, Outcome, PluralityJunction, QueueConfigData, VersionedMultiAsset, VersionedMultiLocation, VersionedXcm, Xcm, XcmAssetEffects, XcmError, XcmHrmpChannelAccepted, XcmHrmpChannelClosing, XcmHrmpNewChannelOpenRequest, XcmOrder, XcmOrderBuyExecution, XcmOrderDepositAsset, XcmOrderDepositReserveAsset, XcmOrderExchangeAsset, XcmOrderInitiateReserveWithdraw, XcmOrderInitiateTeleport, XcmOrderQueryHolding, XcmOriginKind, XcmQueryResponse, XcmRelayedFrom, XcmReserveAssetDeposit, XcmResponse, XcmTeleportAsset, XcmTransact, XcmTransferAsset, XcmTransferReserveAsset, XcmWithdrawAsset, XcmpMessageFormat } from '@polkadot/types/interfaces/xcm'; @@ -74,8 +75,11 @@ declare module '@polkadot/types/types/registry' { 'Compact': Compact; 'Compact': Compact; 'Compact': Compact; + 'Compact': Compact; 'Compact': Compact; 'Compact': Compact; + 'Compact': Compact; + 'Compact': Compact; 'Compact': Compact; 'Compact': Compact; 'Compact': Compact; @@ -85,6 +89,7 @@ declare module '@polkadot/types/types/registry' { 'Compact': Compact; 'Compact': Compact; 'Compact': Compact; + 'Compact': Compact; 'Compact': Compact; 'Compact': Compact; 'Compact': Compact; @@ -262,6 +267,9 @@ declare module '@polkadot/types/types/registry' { 'Option': Option; 'Option': Option; 'Option': Option; + 'Option': Option; + 'Option': Option; + 'Option': Option; 'Option': Option; 'Option': Option; 'Option': Option; @@ -325,6 +333,9 @@ declare module '@polkadot/types/types/registry' { 'Option': Option; 'Option': Option; 'Option': Option; + 'Option': Option; + 'Option': Option; + 'Option': Option; 'Option': Option; 'Option': Option; 'Option': Option; @@ -527,6 +538,9 @@ declare module '@polkadot/types/types/registry' { 'Option': Option; 'Option': Option; 'Option': Option; + 'Option': Option; + 'Option': Option; + 'Option': Option; 'Option': Option; 'Option': Option; 'Option': Option; @@ -1105,6 +1119,9 @@ declare module '@polkadot/types/types/registry' { 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; + 'Vec': Vec; + 'Vec': Vec; + 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; @@ -1168,6 +1185,9 @@ declare module '@polkadot/types/types/registry' { 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; + 'Vec': Vec; + 'Vec': Vec; + 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; @@ -1370,6 +1390,9 @@ declare module '@polkadot/types/types/registry' { 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; + 'Vec': Vec; + 'Vec': Vec; + 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; @@ -1948,6 +1971,9 @@ declare module '@polkadot/types/types/registry' { ChainType: ChainType; ChangesTrieConfiguration: ChangesTrieConfiguration; ChangesTrieSignal: ChangesTrieSignal; + ClassDetails: ClassDetails; + ClassId: ClassId; + ClassMetadata: ClassMetadata; CodecHash: CodecHash; CodeHash: CodeHash; CollatorId: CollatorId; @@ -2011,6 +2037,9 @@ declare module '@polkadot/types/types/registry' { DefunctVoter: DefunctVoter; Delegations: Delegations; DeletedContract: DeletedContract; + DepositBalance: DepositBalance; + DepositBalanceOf: DepositBalanceOf; + DestroyWitness: DestroyWitness; Digest: Digest; DigestItem: DigestItem; DigestOf: DigestOf; @@ -2213,6 +2242,9 @@ declare module '@polkadot/types/types/registry' { Index: Index; IndicesLookupSource: IndicesLookupSource; IndividualExposure: IndividualExposure; + InstanceDetails: InstanceDetails; + InstanceId: InstanceId; + InstanceMetadata: InstanceMetadata; InstantiateRequest: InstantiateRequest; InstantiateReturnValue: InstantiateReturnValue; InstructionWeights: InstructionWeights; diff --git a/packages/types/src/interfaces/definitions.ts b/packages/types/src/interfaces/definitions.ts index 1f07356151..21e18985e1 100644 --- a/packages/types/src/interfaces/definitions.ts +++ b/packages/types/src/interfaces/definitions.ts @@ -38,6 +38,7 @@ export { default as syncstate } from './syncstate/definitions'; export { default as system } from './system/definitions'; export { default as treasury } from './treasury/definitions'; export { default as txpayment } from './txpayment/definitions'; +export { default as uniques } from './uniques/definitions'; export { default as utility } from './utility/definitions'; export { default as vesting } from './vesting/definitions'; diff --git a/packages/types/src/interfaces/types.ts b/packages/types/src/interfaces/types.ts index a24d45bba2..2834ef07b5 100644 --- a/packages/types/src/interfaces/types.ts +++ b/packages/types/src/interfaces/types.ts @@ -35,6 +35,7 @@ export * from './syncstate/types'; export * from './system/types'; export * from './treasury/types'; export * from './txpayment/types'; +export * from './uniques/types'; export * from './utility/types'; export * from './vesting/types'; export * from './attestations/types'; diff --git a/packages/types/src/interfaces/uniques/definitions.ts b/packages/types/src/interfaces/uniques/definitions.ts new file mode 100644 index 0000000000..72d458d4e7 --- /dev/null +++ b/packages/types/src/interfaces/uniques/definitions.ts @@ -0,0 +1,50 @@ +// Copyright 2017-2021 @polkadot/types authors & contributors +// SPDX-License-Identifier: Apache-2.0 + +// order important in structs... :) +/* eslint-disable sort-keys */ + +import type { Definitions } from '../../types'; + +export default { + rpc: {}, + types: { + ClassId: 'u32', + InstanceId: 'u32', + DepositBalance: 'Balance', + DepositBalanceOf: 'Balance', + ClassDetails: { + owner: 'AccountId', + issuer: 'AccountId', + admin: 'AccountId', + freezer: 'AccountId', + totalTeposit: 'DepositBalance', + freeHolding: 'bool', + instances: 'u32', + instanceMetadatas: 'u32', + isFrozen: 'bool' + }, + DestroyWitness: { + instances: 'Compact', + instanceMetadatas: 'Compact' + }, + InstanceDetails: { + owner: 'AccountId', + approved: 'Option', + isFrozen: 'bool', + deposit: 'DepositBalance' + }, + ClassMetadata: { + deposit: 'DepositBalance', + name: 'Vec', + information: 'Vec', + isFrozen: 'bool' + }, + InstanceMetadata: { + deposit: 'DepositBalance', + name: 'Vec', + information: 'Vec', + isFrozen: 'bool' + } + } +} as Definitions; diff --git a/packages/types/src/interfaces/uniques/index.ts b/packages/types/src/interfaces/uniques/index.ts new file mode 100644 index 0000000000..2d307291c3 --- /dev/null +++ b/packages/types/src/interfaces/uniques/index.ts @@ -0,0 +1,4 @@ +// Auto-generated via `yarn polkadot-types-from-defs`, do not edit +/* eslint-disable */ + +export * from './types'; diff --git a/packages/types/src/interfaces/uniques/types.ts b/packages/types/src/interfaces/uniques/types.ts new file mode 100644 index 0000000000..fb2b630f3b --- /dev/null +++ b/packages/types/src/interfaces/uniques/types.ts @@ -0,0 +1,62 @@ +// Auto-generated via `yarn polkadot-types-from-defs`, do not edit +/* eslint-disable */ + +import type { Bytes, Compact, Option, Struct, bool, u32 } from '@polkadot/types'; +import type { AccountId, Balance } from '@polkadot/types/interfaces/runtime'; + +/** @name ClassDetails */ +export interface ClassDetails extends Struct { + readonly owner: AccountId; + readonly issuer: AccountId; + readonly admin: AccountId; + readonly freezer: AccountId; + readonly totalTeposit: DepositBalance; + readonly freeHolding: bool; + readonly instances: u32; + readonly instanceMetadatas: u32; + readonly isFrozen: bool; +} + +/** @name ClassId */ +export interface ClassId extends u32 {} + +/** @name ClassMetadata */ +export interface ClassMetadata extends Struct { + readonly deposit: DepositBalance; + readonly name: Bytes; + readonly information: Bytes; + readonly isFrozen: bool; +} + +/** @name DepositBalance */ +export interface DepositBalance extends Balance {} + +/** @name DepositBalanceOf */ +export interface DepositBalanceOf extends Balance {} + +/** @name DestroyWitness */ +export interface DestroyWitness extends Struct { + readonly instances: Compact; + readonly instanceMetadatas: Compact; +} + +/** @name InstanceDetails */ +export interface InstanceDetails extends Struct { + readonly owner: AccountId; + readonly approved: Option; + readonly isFrozen: bool; + readonly deposit: DepositBalance; +} + +/** @name InstanceId */ +export interface InstanceId extends u32 {} + +/** @name InstanceMetadata */ +export interface InstanceMetadata extends Struct { + readonly deposit: DepositBalance; + readonly name: Bytes; + readonly information: Bytes; + readonly isFrozen: bool; +} + +export type PHANTOM_UNIQUES = 'uniques';