From 336e51fbe0854999c35e15ade1fb3e306b26c18c Mon Sep 17 00:00:00 2001 From: ashkuc Date: Fri, 17 Jun 2022 09:20:08 +0300 Subject: [PATCH] Update UniqueNetwork definitions (#7744) * Update UniqueNetwork definitions * pump @unique-nft/quartz-mainnet-types to 0.5.2 --- packages/apps-config/package.json | 4 +- packages/apps-config/src/api/spec/opal.ts | 2 +- packages/apps-config/src/api/spec/quartz.ts | 2 +- packages/apps-config/src/api/spec/unique.ts | 123 +------------------- yarn.lock | 36 ++++-- 5 files changed, 38 insertions(+), 129 deletions(-) diff --git a/packages/apps-config/package.json b/packages/apps-config/package.json index 526938e7280a..8685b5caa809 100644 --- a/packages/apps-config/package.json +++ b/packages/apps-config/package.json @@ -40,7 +40,9 @@ "@snowfork/snowbridge-types": "0.2.7", "@sora-substrate/type-definitions": "1.9.8", "@subsocial/definitions": "^0.6.10", - "@unique-nft/types": "0.6.0-4", + "@unique-nft/opal-testnet-types": "0.5.2", + "@unique-nft/quartz-mainnet-types": "0.5.2", + "@unique-nft/unique-mainnet-types": "0.6.1", "@zeitgeistpm/type-defs": "0.5.0", "@zeroio/type-definitions": "0.0.14", "lodash": "^4.17.21", diff --git a/packages/apps-config/src/api/spec/opal.ts b/packages/apps-config/src/api/spec/opal.ts index 5aa71ba731a8..89266a28d2c5 100644 --- a/packages/apps-config/src/api/spec/opal.ts +++ b/packages/apps-config/src/api/spec/opal.ts @@ -3,7 +3,7 @@ import type { OverrideBundleDefinition } from '@polkadot/types/types'; -import { unique } from '@unique-nft/types/definitions'; +import { unique } from '@unique-nft/opal-testnet-types/definitions'; export default { rpc: { unique: unique.rpc } diff --git a/packages/apps-config/src/api/spec/quartz.ts b/packages/apps-config/src/api/spec/quartz.ts index 5aa71ba731a8..45907ef96df0 100644 --- a/packages/apps-config/src/api/spec/quartz.ts +++ b/packages/apps-config/src/api/spec/quartz.ts @@ -3,7 +3,7 @@ import type { OverrideBundleDefinition } from '@polkadot/types/types'; -import { unique } from '@unique-nft/types/definitions'; +import { unique } from '@unique-nft/quartz-mainnet-types/definitions'; export default { rpc: { unique: unique.rpc } diff --git a/packages/apps-config/src/api/spec/unique.ts b/packages/apps-config/src/api/spec/unique.ts index cb18c704db8e..7bd086489702 100644 --- a/packages/apps-config/src/api/spec/unique.ts +++ b/packages/apps-config/src/api/spec/unique.ts @@ -3,123 +3,8 @@ import type { OverrideBundleDefinition } from '@polkadot/types/types'; -// structs need to be in order -/* eslint-disable sort-keys */ +import { unique } from '@unique-nft/unique-mainnet-types/definitions'; -const definitions: OverrideBundleDefinition = { - types: [ - { - // on all versions - minmax: [0, undefined], - types: { - AccessMode: { - _enum: ['Normal', 'WhiteList'] - }, - DecimalPoints: 'u8', - CollectionMode: { - _enum: { - Invalid: null, - NFT: null, - Fungible: 'DecimalPoints', - ReFungible: null - } - }, - Ownership: { - Owner: 'AccountId', - Fraction: 'u128' - }, - FungibleItemType: { - Value: 'u128' - }, - NftItemType: { - Owner: 'AccountId', - ConstData: 'Vec', - VariableData: 'Vec' - }, - ReFungibleItemType: { - Owner: 'Vec>', - ConstData: 'Vec', - VariableData: 'Vec' - }, - SponsorshipState: { - _enum: { - Disabled: null, - Unconfirmed: 'AccountId', - Confirmed: 'AccountId' - } - }, - Collection: { - Owner: 'AccountId', - Mode: 'CollectionMode', - Access: 'AccessMode', - DecimalPoints: 'DecimalPoints', - Name: 'Vec', - Description: 'Vec', - TokenPrefix: 'Vec', - MintMode: 'bool', - OffchainSchema: 'Vec', - SchemaVersion: 'SchemaVersion', - Sponsorship: 'SponsorshipState', - Limits: 'CollectionLimits', - VariableOnChainSchema: 'Vec', - ConstOnChainSchema: 'Vec' - }, - RawData: 'Vec', - Address: 'AccountId', - LookupSource: 'AccountId', - Weight: 'u64', - CreateNftData: { - const_data: 'Vec', - variable_data: 'Vec' - }, - CreateFungibleData: { - value: 'u128' - }, - CreateReFungibleData: { - const_data: 'Vec', - variable_data: 'Vec', - pieces: 'u128' - }, - CreateItemData: { - _enum: { - NFT: 'CreateNftData', - Fungible: 'CreateFungibleData', - ReFungible: 'CreateReFungibleData' - } - }, - SchemaVersion: { - _enum: [ - 'ImageURL', - 'Unique' - ] - }, - CollectionId: 'u32', - TokenId: 'u32', - ChainLimits: { - CollectionNumbersLimit: 'u32', - AccountTokenOwnershipLimit: 'u32', - CollectionAdminsLimit: 'u64', - CustomDataLimit: 'u32', - NftSponsorTimeout: 'u32', - FungibleSponsorTimeout: 'u32', - RefungibleSponsorTimeout: 'u32', - OffchainSchemaLimit: 'u32', - VariableOnChainSchemaLimit: 'u32', - ConstOnChainSchemaLimit: 'u32' - }, - CollectionLimits: { - AccountTokenOwnershipLimit: 'u32', - SponsoredDataSize: 'u32', - SponsoredDataRateLimit: 'Option', - TokenLimit: 'u32', - SponsorTimeout: 'u32', - OwnerCanTransfer: 'bool', - OwnerCanDestroy: 'bool' - }, - AccountInfo: 'AccountInfoWithDualRefCount' - } - } - ] -}; - -export default definitions; +export default { + rpc: { unique: unique.rpc } +} as OverrideBundleDefinition; diff --git a/yarn.lock b/yarn.lock index b91464515535..e6f896a7fffc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3033,7 +3033,9 @@ __metadata: "@snowfork/snowbridge-types": 0.2.7 "@sora-substrate/type-definitions": 1.9.8 "@subsocial/definitions": ^0.6.10 - "@unique-nft/types": 0.6.0-4 + "@unique-nft/opal-testnet-types": 0.5.2 + "@unique-nft/quartz-mainnet-types": 0.5.2 + "@unique-nft/unique-mainnet-types": 0.6.1 "@zeitgeistpm/type-defs": 0.5.0 "@zeroio/type-definitions": 0.0.14 lodash: ^4.17.21 @@ -5142,13 +5144,33 @@ __metadata: languageName: node linkType: hard -"@unique-nft/types@npm:0.6.0-4": - version: 0.6.0-4 - resolution: "@unique-nft/types@npm:0.6.0-4" +"@unique-nft/opal-testnet-types@npm:0.5.2": + version: 0.5.2 + resolution: "@unique-nft/opal-testnet-types@npm:0.5.2" + peerDependencies: + "@polkadot/api": ^8.6.2 + "@polkadot/types": ^8.6.2 + checksum: 03a64e3a7c8f30a50681fed2224b5aef45b130096b7cfab3b635b169e390b0c7e64fe1c398d4d905489c28dfc1c9d1d167d753691a712b887c9bc1ff2cfd2ca6 + languageName: node + linkType: hard + +"@unique-nft/quartz-mainnet-types@npm:0.5.2": + version: 0.5.2 + resolution: "@unique-nft/quartz-mainnet-types@npm:0.5.2" + peerDependencies: + "@polkadot/api": ^8.6.2 + "@polkadot/types": ^8.6.2 + checksum: cc6d44a639115308c6ec5ed22c7307654ac45620ec8df426b3be9afd1b6882b71768e93ceed0c5d56ad5ca3f691c40805b09aa7b3524f030774592f959749ae0 + languageName: node + linkType: hard + +"@unique-nft/unique-mainnet-types@npm:0.6.1": + version: 0.6.1 + resolution: "@unique-nft/unique-mainnet-types@npm:0.6.1" peerDependencies: - "@polkadot/api": ^8.6.1 - "@polkadot/types": ^8.6.1 - checksum: 2d370f0e9373300fc2327f08f62a3aea5d9276abb639aa9934cb903cfd1cbccfc89cd67bf3358e0da9e1cd25952f537523b054dc005a2ba4ef58f3f342b80fd7 + "@polkadot/api": ^8.6.2 + "@polkadot/types": ^8.6.2 + checksum: d1f1399eb8d89705944814db85b7b85b84a7c561515a3024afc28984bdd340b0946c7b4f183fbfb79f11a34aed49edede8175760a0c3963a0ef12343037c54b2 languageName: node linkType: hard