difftreelog
update unique-types-js
in: master
24 files changed
tests/README.mddiffbeforeafterboth--- a/tests/README.md
+++ b/tests/README.md
@@ -5,7 +5,7 @@
1. Checkout polkadot in sibling folder with this project
```bash
git clone https://github.com/paritytech/polkadot.git && cd polkadot
-git checkout release-v0.9.9
+git checkout release-v0.9.12
```
2. Build with nightly-2021-06-28
tests/src/check-event/burnItemEvent.test.tsdiffbeforeafterboth--- a/tests/src/check-event/burnItemEvent.test.ts
+++ b/tests/src/check-event/burnItemEvent.test.ts
@@ -10,7 +10,7 @@
import chaiAsPromised from 'chai-as-promised';
import privateKey from '../substrate/privateKey';
import usingApi, {submitTransactionAsync} from '../substrate/substrate-api';
-import {createCollectionExpectSuccess, createItemExpectSuccess, nftEventMessage} from '../util/helpers';
+import {createCollectionExpectSuccess, createItemExpectSuccess, uniqueEventMessage} from '../util/helpers';
chai.use(chaiAsPromised);
const expect = chai.expect;
@@ -31,7 +31,7 @@
const itemID = await createItemExpectSuccess(alice, collectionID, 'NFT');
const burnItem = api.tx.unique.burnItem(collectionID, itemID, 1);
const events = await submitTransactionAsync(alice, burnItem);
- const msg = JSON.stringify(nftEventMessage(events));
+ const msg = JSON.stringify(uniqueEventMessage(events));
expect(msg).to.be.contain(checkSection);
expect(msg).to.be.contain(checkTreasury);
expect(msg).to.be.contain(checkSystem);
tests/src/check-event/createCollectionEvent.test.tsdiffbeforeafterboth--- a/tests/src/check-event/createCollectionEvent.test.ts
+++ b/tests/src/check-event/createCollectionEvent.test.ts
@@ -10,7 +10,7 @@
import chaiAsPromised from 'chai-as-promised';
import privateKey from '../substrate/privateKey';
import usingApi, {submitTransactionAsync} from '../substrate/substrate-api';
-import {nftEventMessage} from '../util/helpers';
+import {uniqueEventMessage} from '../util/helpers';
chai.use(chaiAsPromised);
const expect = chai.expect;
@@ -29,7 +29,7 @@
await usingApi(async (api: ApiPromise) => {
const tx = api.tx.unique.createCollection([0x31], [0x32], '0x33', 'NFT');
const events = await submitTransactionAsync(alice, tx);
- const msg = JSON.stringify(nftEventMessage(events));
+ const msg = JSON.stringify(uniqueEventMessage(events));
expect(msg).to.be.contain(checkSection);
expect(msg).to.be.contain(checkTreasury);
expect(msg).to.be.contain(checkSystem);
tests/src/check-event/createItemEvent.test.tsdiffbeforeafterboth--- a/tests/src/check-event/createItemEvent.test.ts
+++ b/tests/src/check-event/createItemEvent.test.ts
@@ -10,7 +10,7 @@
import chaiAsPromised from 'chai-as-promised';
import privateKey from '../substrate/privateKey';
import usingApi, {submitTransactionAsync} from '../substrate/substrate-api';
-import {createCollectionExpectSuccess, nftEventMessage, normalizeAccountId} from '../util/helpers';
+import {createCollectionExpectSuccess, uniqueEventMessage, normalizeAccountId} from '../util/helpers';
chai.use(chaiAsPromised);
const expect = chai.expect;
@@ -30,7 +30,7 @@
const collectionID = await createCollectionExpectSuccess();
const createItem = api.tx.unique.createItem(collectionID, normalizeAccountId(alice.address), 'NFT');
const events = await submitTransactionAsync(alice, createItem);
- const msg = JSON.stringify(nftEventMessage(events));
+ const msg = JSON.stringify(uniqueEventMessage(events));
expect(msg).to.be.contain(checkSection);
expect(msg).to.be.contain(checkTreasury);
expect(msg).to.be.contain(checkSystem);
tests/src/check-event/createMultipleItemsEvent.test.tsdiffbeforeafterboth--- a/tests/src/check-event/createMultipleItemsEvent.test.ts
+++ b/tests/src/check-event/createMultipleItemsEvent.test.ts
@@ -10,7 +10,7 @@
import chaiAsPromised from 'chai-as-promised';
import privateKey from '../substrate/privateKey';
import usingApi, {submitTransactionAsync} from '../substrate/substrate-api';
-import {createCollectionExpectSuccess, nftEventMessage, normalizeAccountId} from '../util/helpers';
+import {createCollectionExpectSuccess, uniqueEventMessage, normalizeAccountId} from '../util/helpers';
chai.use(chaiAsPromised);
const expect = chai.expect;
@@ -31,7 +31,7 @@
const args = [{NFT: ['0x31', '0x31']}, {NFT: ['0x32', '0x32']}, {NFT: ['0x33', '0x33']}];
const createMultipleItems = api.tx.unique.createMultipleItems(collectionID, normalizeAccountId(alice.address), args);
const events = await submitTransactionAsync(alice, createMultipleItems);
- const msg = JSON.stringify(nftEventMessage(events));
+ const msg = JSON.stringify(uniqueEventMessage(events));
expect(msg).to.be.contain(checkSection);
expect(msg).to.be.contain(checkTreasury);
expect(msg).to.be.contain(checkSystem);
tests/src/check-event/destroyCollectionEvent.test.tsdiffbeforeafterboth--- a/tests/src/check-event/destroyCollectionEvent.test.ts
+++ b/tests/src/check-event/destroyCollectionEvent.test.ts
@@ -10,7 +10,7 @@
import chaiAsPromised from 'chai-as-promised';
import privateKey from '../substrate/privateKey';
import usingApi, {submitTransactionAsync} from '../substrate/substrate-api';
-import {createCollectionExpectSuccess, nftEventMessage} from '../util/helpers';
+import {createCollectionExpectSuccess, uniqueEventMessage} from '../util/helpers';
chai.use(chaiAsPromised);
const expect = chai.expect;
@@ -29,7 +29,7 @@
const collectionID = await createCollectionExpectSuccess();
const destroyCollection = api.tx.unique.destroyCollection(collectionID);
const events = await submitTransactionAsync(alice, destroyCollection);
- const msg = JSON.stringify(nftEventMessage(events));
+ const msg = JSON.stringify(uniqueEventMessage(events));
expect(msg).to.be.contain(checkTreasury);
expect(msg).to.be.contain(checkSystem);
});
tests/src/check-event/transferEvent.test.tsdiffbeforeafterboth--- a/tests/src/check-event/transferEvent.test.ts
+++ b/tests/src/check-event/transferEvent.test.ts
@@ -10,7 +10,7 @@
import chaiAsPromised from 'chai-as-promised';
import privateKey from '../substrate/privateKey';
import usingApi, {submitTransactionAsync} from '../substrate/substrate-api';
-import {createCollectionExpectSuccess, createItemExpectSuccess, nftEventMessage, normalizeAccountId} from '../util/helpers';
+import {createCollectionExpectSuccess, createItemExpectSuccess, uniqueEventMessage, normalizeAccountId} from '../util/helpers';
chai.use(chaiAsPromised);
const expect = chai.expect;
@@ -33,7 +33,7 @@
const itemID = await createItemExpectSuccess(alice, collectionID, 'NFT');
const transfer = api.tx.unique.transfer(normalizeAccountId(bob.address), collectionID, itemID, 1);
const events = await submitTransactionAsync(alice, transfer);
- const msg = JSON.stringify(nftEventMessage(events));
+ const msg = JSON.stringify(uniqueEventMessage(events));
expect(msg).to.be.contain(checkSection);
expect(msg).to.be.contain(checkTreasury);
expect(msg).to.be.contain(checkSystem);
tests/src/check-event/transferFromEvent.test.tsdiffbeforeafterboth--- a/tests/src/check-event/transferFromEvent.test.ts
+++ b/tests/src/check-event/transferFromEvent.test.ts
@@ -10,7 +10,7 @@
import chaiAsPromised from 'chai-as-promised';
import privateKey from '../substrate/privateKey';
import usingApi, {submitTransactionAsync} from '../substrate/substrate-api';
-import {createCollectionExpectSuccess, createItemExpectSuccess, nftEventMessage, normalizeAccountId} from '../util/helpers';
+import {createCollectionExpectSuccess, createItemExpectSuccess, uniqueEventMessage, normalizeAccountId} from '../util/helpers';
chai.use(chaiAsPromised);
const expect = chai.expect;
@@ -33,7 +33,7 @@
const itemID = await createItemExpectSuccess(alice, collectionID, 'NFT');
const transferFrom = api.tx.unique.transferFrom(normalizeAccountId(alice.address), normalizeAccountId(bob.address), collectionID, itemID, 1);
const events = await submitTransactionAsync(alice, transferFrom);
- const msg = JSON.stringify(nftEventMessage(events));
+ const msg = JSON.stringify(uniqueEventMessage(events));
expect(msg).to.be.contain(checkSection);
expect(msg).to.be.contain(checkTreasury);
expect(msg).to.be.contain(checkSystem);
tests/src/interfaces/augment-api-consts.tsdiffbeforeafterboth--- a/tests/src/interfaces/augment-api-consts.ts
+++ b/tests/src/interfaces/augment-api-consts.ts
@@ -159,7 +159,6 @@
[key: string]: Codec;
};
vesting: {
- maxVestingSchedules: u32 & AugmentedConst<ApiType>;
/**
* The minimum amount transferred to call `vested_transfer`.
**/
tests/src/interfaces/augment-api-errors.tsdiffbeforeafterboth--- a/tests/src/interfaces/augment-api-errors.ts
+++ b/tests/src/interfaces/augment-api-errors.ts
@@ -241,32 +241,6 @@
**/
[key: string]: AugmentedError<ApiType>;
};
- nft: {
- /**
- * Decimal_points parameter must be lower than MAX_DECIMAL_POINTS constant, currently it is 30.
- **/
- CollectionDecimalPointLimitExceeded: AugmentedError<ApiType>;
- /**
- * Collection limit bounds per collection exceeded
- **/
- CollectionLimitBoundsExceeded: AugmentedError<ApiType>;
- /**
- * This address is not set as sponsor, use setCollectionSponsor first.
- **/
- ConfirmUnsetSponsorFail: AugmentedError<ApiType>;
- /**
- * Length of items properties must be greater than 0.
- **/
- EmptyArgument: AugmentedError<ApiType>;
- /**
- * Tried to enable permissions which are only permitted to be disabled
- **/
- OwnerPermissionsCantBeReverted: AugmentedError<ApiType>;
- /**
- * Generic error
- **/
- [key: string]: AugmentedError<ApiType>;
- };
nonfungible: {
/**
* Used amount > 1 with NFT
@@ -390,28 +364,6 @@
* Maximum refungibility exceeded
**/
WrongRefungiblePieces: AugmentedError<ApiType>;
- /**
- * Generic error
- **/
- [key: string]: AugmentedError<ApiType>;
- };
- scheduler: {
- /**
- * Failed to schedule a call
- **/
- FailedToSchedule: AugmentedError<ApiType>;
- /**
- * Cannot find the scheduled call.
- **/
- NotFound: AugmentedError<ApiType>;
- /**
- * Reschedule failed because it does not change scheduled time.
- **/
- RescheduleNoChange: AugmentedError<ApiType>;
- /**
- * Given target block number is in the past.
- **/
- TargetBlockNumberInPast: AugmentedError<ApiType>;
/**
* Generic error
**/
@@ -475,28 +427,57 @@
**/
[key: string]: AugmentedError<ApiType>;
};
+ unique: {
+ /**
+ * Decimal_points parameter must be lower than MAX_DECIMAL_POINTS constant, currently it is 30.
+ **/
+ CollectionDecimalPointLimitExceeded: AugmentedError<ApiType>;
+ /**
+ * Collection limit bounds per collection exceeded
+ **/
+ CollectionLimitBoundsExceeded: AugmentedError<ApiType>;
+ /**
+ * This address is not set as sponsor, use setCollectionSponsor first.
+ **/
+ ConfirmUnsetSponsorFail: AugmentedError<ApiType>;
+ /**
+ * Length of items properties must be greater than 0.
+ **/
+ EmptyArgument: AugmentedError<ApiType>;
+ /**
+ * Tried to enable permissions which are only permitted to be disabled
+ **/
+ OwnerPermissionsCantBeReverted: AugmentedError<ApiType>;
+ /**
+ * Generic error
+ **/
+ [key: string]: AugmentedError<ApiType>;
+ };
vesting: {
/**
- * Amount being transferred is too low to create a vesting schedule.
+ * The vested transfer amount is too low
**/
AmountLow: AugmentedError<ApiType>;
/**
- * The account already has `MaxVestingSchedules` count of schedules and thus
- * cannot add another one. Consider merging existing schedules in order to add another.
+ * Insufficient amount of balance to lock
+ **/
+ InsufficientBalanceToLock: AugmentedError<ApiType>;
+ /**
+ * Failed because the maximum vesting schedules was exceeded
**/
- AtMaxVestingSchedules: AugmentedError<ApiType>;
+ MaxVestingSchedulesExceeded: AugmentedError<ApiType>;
/**
- * Failed to create a new schedule because some parameter was invalid.
+ * This account have too many vesting schedules
**/
- InvalidScheduleParams: AugmentedError<ApiType>;
+ TooManyVestingSchedules: AugmentedError<ApiType>;
/**
- * The account given is not vesting.
+ * Vesting period is zero
**/
- NotVesting: AugmentedError<ApiType>;
+ ZeroVestingPeriod: AugmentedError<ApiType>;
/**
- * An index was out of bounds of the vesting schedules.
+ * Number of vests is zero
**/
- ScheduleIndexOutOfBounds: AugmentedError<ApiType>;
+ ZeroVestingPeriodCount: AugmentedError<ApiType>;
/**
* Generic error
**/
tests/src/interfaces/augment-api-events.tsdiffbeforeafterboth--- a/tests/src/interfaces/augment-api-events.ts
+++ b/tests/src/interfaces/augment-api-events.ts
@@ -2,12 +2,11 @@
/* eslint-disable */
import type { EthereumLog, EvmCoreErrorExitReason } from './ethereum';
-import type { PalletCommonAccountBasicCrossAccountIdRepr } from './nft';
+import type { PalletCommonAccountBasicCrossAccountIdRepr } from './unique';
import type { ApiTypes } from '@polkadot/api/types';
-import type { Bytes, Null, Option, Result, U256, U8aFixed, u128, u32, u64, u8 } from '@polkadot/types';
+import type { Null, Option, Result, U256, U8aFixed, u128, u32, u64, u8 } from '@polkadot/types';
import type { AccountId32, H160, H256 } from '@polkadot/types/interfaces/runtime';
import type { FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchInfo, SpRuntimeDispatchError, XcmV1MultiLocation, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation } from '@polkadot/types/lookup';
-import type { ITuple } from '@polkadot/types/types';
declare module '@polkadot/api/types/events' {
export interface AugmentedEvents<ApiType> {
@@ -389,24 +388,6 @@
**/
[key: string]: AugmentedEvent<ApiType>;
};
- scheduler: {
- /**
- * Canceled some task. \[when, index\]
- **/
- Canceled: AugmentedEvent<ApiType, [u32, u32]>;
- /**
- * Dispatched some task. \[task, id, result\]
- **/
- Dispatched: AugmentedEvent<ApiType, [ITuple<[u32, u32]>, Option<Bytes>, Result<Null, SpRuntimeDispatchError>]>;
- /**
- * Scheduled some task. \[when, index\]
- **/
- Scheduled: AugmentedEvent<ApiType, [u32, u32]>;
- /**
- * Generic event
- **/
- [key: string]: AugmentedEvent<ApiType>;
- };
sudo: {
/**
* The \[sudoer\] just switched identity; the old key is supplied.
@@ -492,15 +473,17 @@
};
vesting: {
/**
- * An \[account\] has become fully vested.
+ * Claimed vesting. \[who, locked_amount\]
+ **/
+ Claimed: AugmentedEvent<ApiType, [AccountId32, u128]>;
+ /**
+ * Added new vesting schedule. \[from, to, vesting_schedule\]
**/
- VestingCompleted: AugmentedEvent<ApiType, [AccountId32]>;
+ VestingScheduleAdded: AugmentedEvent<ApiType, [AccountId32, AccountId32, OrmlVestingVestingSchedule]>;
/**
- * The amount vested has been updated. This could indicate a change in funds available.
- * The balance given is the amount which is left unvested (and thus locked).
- * \[account, unvested\]
+ * Updated vesting schedules. \[who\]
**/
- VestingUpdated: AugmentedEvent<ApiType, [AccountId32, u128]>;
+ VestingSchedulesUpdated: AugmentedEvent<ApiType, [AccountId32]>;
/**
* Generic event
**/
tests/src/interfaces/augment-api-query.tsdiffbeforeafterboth--- a/tests/src/interfaces/augment-api-query.ts
+++ b/tests/src/interfaces/augment-api-query.ts
@@ -2,12 +2,12 @@
/* eslint-disable */
import type { EthereumBlock, EthereumReceipt, EthereumTransactionLegacyTransaction, FpRpcTransactionStatus } from './ethereum';
-import type { NftDataStructsCollection, PalletCommonAccountBasicCrossAccountIdRepr, PalletNonfungibleItemData, PalletRefungibleItemData, PalletUnqSchedulerCallSpec, PalletUnqSchedulerReleases, PalletUnqSchedulerScheduledV2 } from './nft';
import type { CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmpQueueInboundStatus, CumulusPalletXcmpQueueOutboundStatus, CumulusPalletXcmpQueueQueueConfigData, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV1AbridgedHostConfiguration, PolkadotPrimitivesV1PersistedValidationData } from './polkadot';
+import type { PalletCommonAccountBasicCrossAccountIdRepr, PalletNonfungibleItemData, PalletRefungibleItemData, UpDataStructsCollection, UpDataStructsCollectionStats } from './unique';
import type { ApiTypes } from '@polkadot/api/types';
import type { BTreeMap, Bytes, Option, U256, Vec, bool, u128, u16, u32, u64 } from '@polkadot/types';
import type { AccountId32, H160, H256 } from '@polkadot/types/interfaces/runtime';
-import type { FrameSupportWeightsPerDispatchClassU64, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReleases, PalletBalancesReserveData, PalletTransactionPaymentReleases, PalletTreasuryProposal, PalletVestingReleases, PalletVestingVestingInfo, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotPrimitivesV1UpgradeRestriction, SpRuntimeGenericDigest } from '@polkadot/types/lookup';
+import type { FrameSupportWeightsPerDispatchClassU64, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReleases, PalletBalancesReserveData, PalletTransactionPaymentReleases, PalletTreasuryProposal, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotPrimitivesV1UpgradeRestriction, SpRuntimeGenericDigest } from '@polkadot/types/lookup';
import type { AnyNumber, ITuple, Observable } from '@polkadot/types/types';
declare module '@polkadot/api/types/storage' {
@@ -58,10 +58,14 @@
/**
* Collection info
**/
- collectionById: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<NftDataStructsCollection>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
+ collectionById: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<UpDataStructsCollection>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
createdCollectionCount: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
destroyedCollectionCount: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
/**
+ * Not used by code, exists only to provide some types to metadata
+ **/
+ dummyStorageValue: AugmentedQuery<ApiType, () => Observable<Option<ITuple<[UpDataStructsCollectionStats, u32, u32]>>>, []> & QueryableStorageEntry<ApiType, []>;
+ /**
* List of collection admins
**/
isAdmin: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: PalletCommonAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array) => Observable<bool>, [u32, PalletCommonAccountBasicCrossAccountIdRepr]> & QueryableStorageEntry<ApiType, [u32, PalletCommonAccountBasicCrossAccountIdRepr]>;
@@ -171,44 +175,6 @@
**/
[key: string]: QueryableStorageEntry<ApiType>;
};
- nft: {
- /**
- * Used for migrations
- **/
- chainVersion: AugmentedQuery<ApiType, () => Observable<u64>, []> & QueryableStorageEntry<ApiType, []>;
- /**
- * (Collection id (controlled?2), who created (real))
- * TODO: Off chain worker should remove from this map when collection gets removed
- **/
- createItemBasket: AugmentedQuery<ApiType, (arg: ITuple<[u32, AccountId32]> | [u32 | AnyNumber | Uint8Array, AccountId32 | string | Uint8Array]) => Observable<u32>, [ITuple<[u32, AccountId32]>]> & QueryableStorageEntry<ApiType, [ITuple<[u32, AccountId32]>]>;
- /**
- * Collection id (controlled?2), owning user (real)
- **/
- fungibleTransferBasket: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: AccountId32 | string | Uint8Array) => Observable<u32>, [u32, AccountId32]> & QueryableStorageEntry<ApiType, [u32, AccountId32]>;
- /**
- * Collection id (controlled?2), token id (controlled?2)
- **/
- nftTransferBasket: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<u32>, [u32, u32]> & QueryableStorageEntry<ApiType, [u32, u32]>;
- /**
- * Collection id (controlled?2), token id (controlled?2)
- **/
- reFungibleTransferBasket: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<u32>, [u32, u32]> & QueryableStorageEntry<ApiType, [u32, u32]>;
- /**
- * Variable metadata sponsoring
- * Collection id (controlled?2), token id (controlled?2)
- **/
- variableMetaDataBasket: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<Option<u32>>, [u32, u32]> & QueryableStorageEntry<ApiType, [u32, u32]>;
- /**
- * Generic query
- **/
- [key: string]: QueryableStorageEntry<ApiType>;
- };
- nftPayment: {
- /**
- * Generic query
- **/
- [key: string]: QueryableStorageEntry<ApiType>;
- };
nonfungible: {
accountBalance: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: PalletCommonAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array) => Observable<u32>, [u32, PalletCommonAccountBasicCrossAccountIdRepr]> & QueryableStorageEntry<ApiType, [u32, PalletCommonAccountBasicCrossAccountIdRepr]>;
allowance: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<Option<PalletCommonAccountBasicCrossAccountIdRepr>>, [u32, u32]> & QueryableStorageEntry<ApiType, [u32, u32]>;
@@ -383,27 +349,6 @@
**/
[key: string]: QueryableStorageEntry<ApiType>;
};
- scheduler: {
- /**
- * 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<PalletUnqSchedulerScheduledV2>>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
- /**
- * Lookup from identity to the block number and index of the task.
- **/
- lookup: AugmentedQuery<ApiType, (arg: Bytes | string | Uint8Array) => Observable<Option<ITuple<[u32, u32]>>>, [Bytes]> & QueryableStorageEntry<ApiType, [Bytes]>;
- specAgenda: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Vec<Option<PalletUnqSchedulerCallSpec>>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
- /**
- * Storage version of the pallet.
- *
- * New networks start with last version.
- **/
- storageVersion: AugmentedQuery<ApiType, () => Observable<PalletUnqSchedulerReleases>, []> & QueryableStorageEntry<ApiType, []>;
- /**
- * Generic query
- **/
- [key: string]: QueryableStorageEntry<ApiType>;
- };
sudo: {
/**
* The `AccountId` of the sudo key.
@@ -537,17 +482,51 @@
**/
[key: string]: QueryableStorageEntry<ApiType>;
};
+ unique: {
+ /**
+ * Used for migrations
+ **/
+ chainVersion: AugmentedQuery<ApiType, () => Observable<u64>, []> & QueryableStorageEntry<ApiType, []>;
+ /**
+ * (Collection id (controlled?2), who created (real))
+ * TODO: Off chain worker should remove from this map when collection gets removed
+ **/
+ createItemBasket: AugmentedQuery<ApiType, (arg: ITuple<[u32, AccountId32]> | [u32 | AnyNumber | Uint8Array, AccountId32 | string | Uint8Array]) => Observable<Option<u32>>, [ITuple<[u32, AccountId32]>]> & QueryableStorageEntry<ApiType, [ITuple<[u32, AccountId32]>]>;
+ fungibleApproveBasket: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: AccountId32 | string | Uint8Array) => Observable<Option<u32>>, [u32, AccountId32]> & QueryableStorageEntry<ApiType, [u32, AccountId32]>;
+ /**
+ * Collection id (controlled?2), owning user (real)
+ **/
+ fungibleTransferBasket: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: AccountId32 | string | Uint8Array) => Observable<Option<u32>>, [u32, AccountId32]> & QueryableStorageEntry<ApiType, [u32, AccountId32]>;
+ /**
+ * Approval sponsoring
+ **/
+ nftApproveBasket: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<Option<u32>>, [u32, u32]> & QueryableStorageEntry<ApiType, [u32, u32]>;
+ /**
+ * Collection id (controlled?2), token id (controlled?2)
+ **/
+ nftTransferBasket: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<Option<u32>>, [u32, u32]> & QueryableStorageEntry<ApiType, [u32, u32]>;
+ refungibleApproveBasket: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array, arg3: AccountId32 | string | Uint8Array) => Observable<Option<u32>>, [u32, u32, AccountId32]> & QueryableStorageEntry<ApiType, [u32, u32, AccountId32]>;
+ /**
+ * Collection id (controlled?2), token id (controlled?2)
+ **/
+ reFungibleTransferBasket: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array, arg3: AccountId32 | string | Uint8Array) => Observable<Option<u32>>, [u32, u32, AccountId32]> & QueryableStorageEntry<ApiType, [u32, u32, AccountId32]>;
+ /**
+ * Variable metadata sponsoring
+ * Collection id (controlled?2), token id (controlled?2)
+ **/
+ variableMetaDataBasket: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<Option<u32>>, [u32, u32]> & QueryableStorageEntry<ApiType, [u32, u32]>;
+ /**
+ * Generic query
+ **/
+ [key: string]: QueryableStorageEntry<ApiType>;
+ };
vesting: {
/**
- * Storage version of the pallet.
+ * Vesting schedules of an account.
*
- * New networks start with latest version, as determined by the genesis build.
+ * VestingSchedules: map AccountId => Vec<VestingSchedule>
**/
- storageVersion: AugmentedQuery<ApiType, () => Observable<PalletVestingReleases>, []> & QueryableStorageEntry<ApiType, []>;
- /**
- * Information regarding the vesting of a given account.
- **/
- vesting: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<Option<Vec<PalletVestingVestingInfo>>>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
+ vestingSchedules: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<Vec<OrmlVestingVestingSchedule>>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
/**
* Generic query
**/
tests/src/interfaces/augment-api-rpc.tsdiffbeforeafterboth--- a/tests/src/interfaces/augment-api-rpc.ts
+++ b/tests/src/interfaces/augment-api-rpc.ts
@@ -1,7 +1,7 @@
// Auto-generated via `yarn polkadot-types-from-chain`, do not edit
/* eslint-disable */
-import type { NftDataStructsCollection, NftDataStructsCollectionId, NftDataStructsCollectionStats, NftDataStructsTokenId, PalletCommonAccountBasicCrossAccountIdRepr } from './nft';
+import type { PalletCommonAccountBasicCrossAccountIdRepr, UpDataStructsCollection, UpDataStructsCollectionId, UpDataStructsCollectionStats, UpDataStructsTokenId } from './unique';
import type { Bytes, HashMap, Json, Metadata, Null, Option, StorageKey, Text, U256, U64, Vec, bool, u128, u32, u64 } from '@polkadot/types';
import type { ExtrinsicOrHash, ExtrinsicStatus } from '@polkadot/types/interfaces/author';
import type { EpochAuthorship } from '@polkadot/types/interfaces/babe';
@@ -354,68 +354,6 @@
* Returns protocol version.
**/
version: AugmentedRpc<() => Observable<Text>>;
- };
- nft: {
- /**
- * Get amount of different user tokens
- **/
- accountBalance: AugmentedRpc<(collection: NftDataStructsCollectionId | AnyNumber | Uint8Array, account: PalletCommonAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable<u32>>;
- /**
- * Get tokens owned by account
- **/
- accountTokens: AugmentedRpc<(collection: NftDataStructsCollectionId | AnyNumber | Uint8Array, account: PalletCommonAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Vec<NftDataStructsTokenId>>>;
- /**
- * Get admin list
- **/
- adminlist: AugmentedRpc<(collection: NftDataStructsCollectionId | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Vec<PalletCommonAccountBasicCrossAccountIdRepr>>>;
- /**
- * Get allowed amount
- **/
- allowance: AugmentedRpc<(collection: NftDataStructsCollectionId | AnyNumber | Uint8Array, sender: PalletCommonAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, spender: PalletCommonAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, tokenId: NftDataStructsTokenId | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<u128>>;
- /**
- * Check if user is allowed to use collection
- **/
- allowed: AugmentedRpc<(collection: NftDataStructsCollectionId | AnyNumber | Uint8Array, account: PalletCommonAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable<bool>>;
- /**
- * Get allowlist
- **/
- allowlist: AugmentedRpc<(collection: NftDataStructsCollectionId | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Vec<PalletCommonAccountBasicCrossAccountIdRepr>>>;
- /**
- * Get amount of specific account token
- **/
- balance: AugmentedRpc<(collection: NftDataStructsCollectionId | AnyNumber | Uint8Array, account: PalletCommonAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, tokenId: NftDataStructsTokenId | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<u128>>;
- /**
- * Get collection by specified id
- **/
- collectionById: AugmentedRpc<(collection: NftDataStructsCollectionId | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Option<NftDataStructsCollection>>>;
- /**
- * Get collection stats
- **/
- collectionStats: AugmentedRpc<(at?: Hash | string | Uint8Array) => Observable<NftDataStructsCollectionStats>>;
- /**
- * Get tokens contained in collection
- **/
- collectionTokens: AugmentedRpc<(collection: NftDataStructsCollectionId | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Vec<NftDataStructsTokenId>>>;
- /**
- * Get token constant metadata
- **/
- constMetadata: AugmentedRpc<(collection: NftDataStructsCollectionId | AnyNumber | Uint8Array, tokenId: NftDataStructsTokenId | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Bytes>>;
- /**
- * Get last token id
- **/
- lastTokenId: AugmentedRpc<(collection: NftDataStructsCollectionId | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<NftDataStructsTokenId>>;
- /**
- * Check if token exists
- **/
- tokenExists: AugmentedRpc<(collection: NftDataStructsCollectionId | AnyNumber | Uint8Array, tokenId: NftDataStructsTokenId | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<bool>>;
- /**
- * Get token owner
- **/
- tokenOwner: AugmentedRpc<(collection: NftDataStructsCollectionId | AnyNumber | Uint8Array, tokenId: NftDataStructsTokenId | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<PalletCommonAccountBasicCrossAccountIdRepr>>;
- /**
- * Get token variable metadata
- **/
- variableMetadata: AugmentedRpc<(collection: NftDataStructsCollectionId | AnyNumber | Uint8Array, tokenId: NftDataStructsTokenId | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Bytes>>;
};
offchain: {
/**
@@ -609,6 +547,68 @@
**/
version: AugmentedRpc<() => Observable<Text>>;
};
+ unique: {
+ /**
+ * Get amount of different user tokens
+ **/
+ accountBalance: AugmentedRpc<(collection: UpDataStructsCollectionId | AnyNumber | Uint8Array, account: PalletCommonAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable<u32>>;
+ /**
+ * Get tokens owned by account
+ **/
+ accountTokens: AugmentedRpc<(collection: UpDataStructsCollectionId | AnyNumber | Uint8Array, account: PalletCommonAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Vec<UpDataStructsTokenId>>>;
+ /**
+ * Get admin list
+ **/
+ adminlist: AugmentedRpc<(collection: UpDataStructsCollectionId | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Vec<PalletCommonAccountBasicCrossAccountIdRepr>>>;
+ /**
+ * Get allowed amount
+ **/
+ allowance: AugmentedRpc<(collection: UpDataStructsCollectionId | AnyNumber | Uint8Array, sender: PalletCommonAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, spender: PalletCommonAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, tokenId: UpDataStructsTokenId | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<u128>>;
+ /**
+ * Check if user is allowed to use collection
+ **/
+ allowed: AugmentedRpc<(collection: UpDataStructsCollectionId | AnyNumber | Uint8Array, account: PalletCommonAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable<bool>>;
+ /**
+ * Get allowlist
+ **/
+ allowlist: AugmentedRpc<(collection: UpDataStructsCollectionId | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Vec<PalletCommonAccountBasicCrossAccountIdRepr>>>;
+ /**
+ * Get amount of specific account token
+ **/
+ balance: AugmentedRpc<(collection: UpDataStructsCollectionId | AnyNumber | Uint8Array, account: PalletCommonAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, tokenId: UpDataStructsTokenId | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<u128>>;
+ /**
+ * Get collection by specified id
+ **/
+ collectionById: AugmentedRpc<(collection: UpDataStructsCollectionId | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Option<UpDataStructsCollection>>>;
+ /**
+ * Get collection stats
+ **/
+ collectionStats: AugmentedRpc<(at?: Hash | string | Uint8Array) => Observable<UpDataStructsCollectionStats>>;
+ /**
+ * Get tokens contained in collection
+ **/
+ collectionTokens: AugmentedRpc<(collection: UpDataStructsCollectionId | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Vec<UpDataStructsTokenId>>>;
+ /**
+ * Get token constant metadata
+ **/
+ constMetadata: AugmentedRpc<(collection: UpDataStructsCollectionId | AnyNumber | Uint8Array, tokenId: UpDataStructsTokenId | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Bytes>>;
+ /**
+ * Get last token id
+ **/
+ lastTokenId: AugmentedRpc<(collection: UpDataStructsCollectionId | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<UpDataStructsTokenId>>;
+ /**
+ * Check if token exists
+ **/
+ tokenExists: AugmentedRpc<(collection: UpDataStructsCollectionId | AnyNumber | Uint8Array, tokenId: UpDataStructsTokenId | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<bool>>;
+ /**
+ * Get token owner
+ **/
+ tokenOwner: AugmentedRpc<(collection: UpDataStructsCollectionId | AnyNumber | Uint8Array, tokenId: UpDataStructsTokenId | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<PalletCommonAccountBasicCrossAccountIdRepr>>;
+ /**
+ * Get token variable metadata
+ **/
+ variableMetadata: AugmentedRpc<(collection: UpDataStructsCollectionId | AnyNumber | Uint8Array, tokenId: UpDataStructsTokenId | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Bytes>>;
+ };
web3: {
/**
* Returns current client version.
tests/src/interfaces/augment-api-tx.tsdiffbeforeafterboth--- a/tests/src/interfaces/augment-api-tx.ts
+++ b/tests/src/interfaces/augment-api-tx.ts
@@ -2,13 +2,13 @@
/* eslint-disable */
import type { EthereumTransactionLegacyTransaction } from './ethereum';
-import type { NftDataStructsAccessMode, NftDataStructsCollectionLimits, NftDataStructsCollectionMode, NftDataStructsCreateItemData, NftDataStructsMetaUpdatePermission, NftDataStructsSchemaVersion, PalletCommonAccountBasicCrossAccountIdRepr } from './nft';
import type { CumulusPrimitivesParachainInherentParachainInherentData } from './polkadot';
+import type { PalletCommonAccountBasicCrossAccountIdRepr, UpDataStructsAccessMode, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCreateItemData, UpDataStructsMetaUpdatePermission, UpDataStructsSchemaVersion } from './unique';
import type { ApiTypes, SubmittableExtrinsic } from '@polkadot/api/types';
-import type { Bytes, Compact, Option, U256, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types';
+import type { Bytes, Compact, Option, U256, Vec, bool, u128, u16, u32, u64 } from '@polkadot/types';
import type { Extrinsic } from '@polkadot/types/interfaces/extrinsics';
import type { AccountId32, Call, H160, H256, MultiAddress, Perbill } from '@polkadot/types/interfaces/runtime';
-import type { PalletVestingVestingInfo, SpCoreChangesTrieChangesTrieConfiguration, XcmV1MultiLocation, XcmV2WeightLimit, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup';
+import type { SpCoreChangesTrieChangesTrieConfiguration, XcmV1MultiLocation, XcmV2WeightLimit, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup';
import type { AnyNumber, ITuple } from '@polkadot/types/types';
declare module '@polkadot/api/types/submittable' {
@@ -196,441 +196,11 @@
[key: string]: SubmittableExtrinsicFunction<ApiType>;
};
inflation: {
- /**
- * Generic tx
- **/
- [key: string]: SubmittableExtrinsicFunction<ApiType>;
- };
- nft: {
- /**
- * Adds an admin of the Collection.
- * NFT Collection can be controlled by multiple admin addresses (some which can also be servers, for example). Admins can issue and burn NFTs, as well as add and remove other admins, but cannot change NFT or Collection ownership.
- *
- * # Permissions
- *
- * * Collection Owner.
- * * Collection Admin.
- *
- * # Arguments
- *
- * * collection_id: ID of the Collection to add admin for.
- *
- * * new_admin_id: Address of new admin to add.
- **/
- addCollectionAdmin: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, newAdminId: PalletCommonAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, PalletCommonAccountBasicCrossAccountIdRepr]>;
- /**
- * Add an address to allow list.
- *
- * # Permissions
- *
- * * Collection Owner
- * * Collection Admin
- *
- * # Arguments
- *
- * * collection_id.
- *
- * * address.
- **/
- addToAllowList: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, address: PalletCommonAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, PalletCommonAccountBasicCrossAccountIdRepr]>;
- /**
- * Set, change, or remove approved address to transfer the ownership of the NFT.
- *
- * # Permissions
- *
- * * Collection Owner
- * * Collection Admin
- * * Current NFT owner
- *
- * # Arguments
- *
- * * approved: Address that is approved to transfer this NFT or zero (if needed to remove approval).
- *
- * * collection_id.
- *
- * * item_id: ID of the item.
- **/
- approve: AugmentedSubmittable<(spender: PalletCommonAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, collectionId: u32 | AnyNumber | Uint8Array, itemId: u32 | AnyNumber | Uint8Array, amount: u128 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [PalletCommonAccountBasicCrossAccountIdRepr, u32, u32, u128]>;
- /**
- * Destroys a concrete instance of NFT on behalf of the owner
- * See also: [`approve`]
- *
- * # Permissions
- *
- * * Collection Owner.
- * * Collection Admin.
- * * Current NFT Owner.
- *
- * # Arguments
- *
- * * collection_id: ID of the collection.
- *
- * * item_id: ID of NFT to burn.
- *
- * * from: owner of item
- **/
- burnFrom: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, from: PalletCommonAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, itemId: u32 | AnyNumber | Uint8Array, value: u128 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, PalletCommonAccountBasicCrossAccountIdRepr, u32, u128]>;
- /**
- * Destroys a concrete instance of NFT.
- *
- * # Permissions
- *
- * * Collection Owner.
- * * Collection Admin.
- * * Current NFT Owner.
- *
- * # Arguments
- *
- * * collection_id: ID of the collection.
- *
- * * item_id: ID of NFT to burn.
- **/
- burnItem: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, itemId: u32 | AnyNumber | Uint8Array, value: u128 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, u32, u128]>;
- /**
- * Change the owner of the collection.
- *
- * # Permissions
- *
- * * Collection Owner.
- *
- * # Arguments
- *
- * * collection_id.
- *
- * * new_owner.
- **/
- changeCollectionOwner: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, newOwner: AccountId32 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, AccountId32]>;
- /**
- * # Permissions
- *
- * * Sponsor.
- *
- * # Arguments
- *
- * * collection_id.
- **/
- confirmSponsorship: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;
- /**
- * This method creates a Collection of NFTs. Each Token may have multiple properties encoded as an array of bytes of certain length. The initial owner and admin of the collection are set to the address that signed the transaction. Both addresses can be changed later.
- *
- * # Permissions
- *
- * * Anyone.
- *
- * # Arguments
- *
- * * collection_name: UTF-16 string with collection name (limit 64 characters), will be stored as zero-terminated.
- *
- * * collection_description: UTF-16 string with collection description (limit 256 characters), will be stored as zero-terminated.
- *
- * * token_prefix: UTF-8 string with token prefix.
- *
- * * mode: [CollectionMode] collection type and type dependent data.
- **/
- createCollection: AugmentedSubmittable<(collectionName: Vec<u16> | (u16 | AnyNumber | Uint8Array)[], collectionDescription: Vec<u16> | (u16 | AnyNumber | Uint8Array)[], tokenPrefix: Bytes | string | Uint8Array, mode: NftDataStructsCollectionMode | { NFT: any } | { Fungible: any } | { ReFungible: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Vec<u16>, Vec<u16>, Bytes, NftDataStructsCollectionMode]>;
- /**
- * This method creates a concrete instance of NFT Collection created with CreateCollection method.
- *
- * # Permissions
- *
- * * Collection Owner.
- * * Collection Admin.
- * * Anyone if
- * * Allow List is enabled, and
- * * Address is added to allow list, and
- * * MintPermission is enabled (see SetMintPermission method)
- *
- * # Arguments
- *
- * * collection_id: ID of the collection.
- *
- * * owner: Address, initial owner of the NFT.
- *
- * * data: Token data to store on chain.
- **/
- createItem: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, owner: PalletCommonAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, data: NftDataStructsCreateItemData | { NFT: any } | { Fungible: any } | { ReFungible: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, PalletCommonAccountBasicCrossAccountIdRepr, NftDataStructsCreateItemData]>;
- /**
- * This method creates multiple items in a collection created with CreateCollection method.
- *
- * # Permissions
- *
- * * Collection Owner.
- * * Collection Admin.
- * * Anyone if
- * * Allow List is enabled, and
- * * Address is added to allow list, and
- * * MintPermission is enabled (see SetMintPermission method)
- *
- * # Arguments
- *
- * * collection_id: ID of the collection.
- *
- * * itemsData: Array items properties. Each property is an array of bytes itself, see [create_item].
- *
- * * owner: Address, initial owner of the NFT.
- **/
- createMultipleItems: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, owner: PalletCommonAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, itemsData: Vec<NftDataStructsCreateItemData> | (NftDataStructsCreateItemData | { NFT: any } | { Fungible: any } | { ReFungible: any } | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [u32, PalletCommonAccountBasicCrossAccountIdRepr, Vec<NftDataStructsCreateItemData>]>;
- /**
- * **DANGEROUS**: Destroys collection and all NFTs within this collection. Users irrecoverably lose their assets and may lose real money.
- *
- * # Permissions
- *
- * * Collection Owner.
- *
- * # Arguments
- *
- * * collection_id: collection to destroy.
- **/
- destroyCollection: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;
- /**
- * Remove admin address of the Collection. An admin address can remove itself. List of admins may become empty, in which case only Collection Owner will be able to add an Admin.
- *
- * # Permissions
- *
- * * Collection Owner.
- * * Collection Admin.
- *
- * # Arguments
- *
- * * collection_id: ID of the Collection to remove admin for.
- *
- * * account_id: Address of admin to remove.
- **/
- removeCollectionAdmin: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, accountId: PalletCommonAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, PalletCommonAccountBasicCrossAccountIdRepr]>;
- /**
- * Switch back to pay-per-own-transaction model.
- *
- * # Permissions
- *
- * * Collection owner.
- *
- * # Arguments
- *
- * * collection_id.
- **/
- removeCollectionSponsor: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;
- /**
- * Remove an address from allow list.
- *
- * # Permissions
- *
- * * Collection Owner
- * * Collection Admin
- *
- * # Arguments
- *
- * * collection_id.
- *
- * * address.
- **/
- removeFromAllowList: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, address: PalletCommonAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, PalletCommonAccountBasicCrossAccountIdRepr]>;
- setCollectionLimits: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, newLimit: NftDataStructsCollectionLimits | { accountTokenOwnershipLimit?: any; sponsoredDataSize?: any; sponsoredDataRateLimit?: any; tokenLimit?: any; sponsorTransferTimeout?: any; ownerCanTransfer?: any; ownerCanDestroy?: any; transfersEnabled?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, NftDataStructsCollectionLimits]>;
- /**
- * # Permissions
- *
- * * Collection Owner
- *
- * # Arguments
- *
- * * collection_id.
- *
- * * new_sponsor.
- **/
- setCollectionSponsor: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, newSponsor: AccountId32 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, AccountId32]>;
- /**
- * Set const on-chain data schema.
- *
- * # Permissions
- *
- * * Collection Owner
- * * Collection Admin
- *
- * # Arguments
- *
- * * collection_id.
- *
- * * schema: String representing the const on-chain data schema.
- **/
- setConstOnChainSchema: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, schema: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, Bytes]>;
- /**
- * Set meta_update_permission value for particular collection
- *
- * # Permissions
- *
- * * Collection Owner.
- *
- * # Arguments
- *
- * * collection_id: ID of the collection.
- *
- * * value: New flag value.
- **/
- setMetaUpdatePermissionFlag: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, value: NftDataStructsMetaUpdatePermission | 'ItemOwner' | 'Admin' | 'None' | number | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, NftDataStructsMetaUpdatePermission]>;
- /**
- * Allows Anyone to create tokens if:
- * * Allow List is enabled, and
- * * Address is added to allow list, and
- * * This method was called with True parameter
- *
- * # Permissions
- * * Collection Owner
- *
- * # Arguments
- *
- * * collection_id.
- *
- * * mint_permission: Boolean parameter. If True, allows minting to Anyone with conditions above.
- **/
- setMintPermission: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, mintPermission: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, bool]>;
- /**
- * Set off-chain data schema.
- *
- * # Permissions
- *
- * * Collection Owner
- * * Collection Admin
- *
- * # Arguments
- *
- * * collection_id.
- *
- * * schema: String representing the offchain data schema.
- **/
- setOffchainSchema: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, schema: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, Bytes]>;
- /**
- * Toggle between normal and allow list access for the methods with access for `Anyone`.
- *
- * # Permissions
- *
- * * Collection Owner.
- *
- * # Arguments
- *
- * * collection_id.
- *
- * * mode: [AccessMode]
- **/
- setPublicAccessMode: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, mode: NftDataStructsAccessMode | 'Normal' | 'AllowList' | number | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, NftDataStructsAccessMode]>;
- /**
- * Set schema standard
- * ImageURL
- * Unique
- *
- * # Permissions
- *
- * * Collection Owner
- * * Collection Admin
- *
- * # Arguments
- *
- * * collection_id.
- *
- * * schema: SchemaVersion: enum
- **/
- setSchemaVersion: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, version: NftDataStructsSchemaVersion | 'ImageURL' | 'Unique' | number | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, NftDataStructsSchemaVersion]>;
- /**
- * Set transfers_enabled value for particular collection
- *
- * # Permissions
- *
- * * Collection Owner.
- *
- * # Arguments
- *
- * * collection_id: ID of the collection.
- *
- * * value: New flag value.
- **/
- setTransfersEnabledFlag: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, value: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, bool]>;
- /**
- * Set off-chain data schema.
- *
- * # Permissions
- *
- * * Collection Owner
- * * Collection Admin
- *
- * # Arguments
- *
- * * collection_id.
- *
- * * schema: String representing the offchain data schema.
- **/
- setVariableMetaData: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, itemId: u32 | AnyNumber | Uint8Array, data: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, u32, Bytes]>;
- /**
- * Set variable on-chain data schema.
- *
- * # Permissions
- *
- * * Collection Owner
- * * Collection Admin
- *
- * # Arguments
- *
- * * collection_id.
- *
- * * schema: String representing the variable on-chain data schema.
- **/
- setVariableOnChainSchema: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, schema: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, Bytes]>;
- /**
- * Change ownership of the token.
- *
- * # Permissions
- *
- * * Collection Owner
- * * Collection Admin
- * * Current NFT owner
- *
- * # Arguments
- *
- * * recipient: Address of token recipient.
- *
- * * collection_id.
- *
- * * item_id: ID of the item
- * * Non-Fungible Mode: Required.
- * * Fungible Mode: Ignored.
- * * Re-Fungible Mode: Required.
- *
- * * value: Amount to transfer.
- * * Non-Fungible Mode: Ignored
- * * Fungible Mode: Must specify transferred amount
- * * Re-Fungible Mode: Must specify transferred portion (between 0 and 1)
- **/
- transfer: AugmentedSubmittable<(recipient: PalletCommonAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, collectionId: u32 | AnyNumber | Uint8Array, itemId: u32 | AnyNumber | Uint8Array, value: u128 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [PalletCommonAccountBasicCrossAccountIdRepr, u32, u32, u128]>;
/**
- * Change ownership of a NFT on behalf of the owner. See Approve method for additional information. After this method executes, the approval is removed so that the approved address will not be able to transfer this NFT again from this owner.
- *
- * # Permissions
- * * Collection Owner
- * * Collection Admin
- * * Current NFT owner
- * * Address approved by current NFT owner
- *
- * # Arguments
- *
- * * from: Address that owns token.
- *
- * * recipient: Address of token recipient.
- *
- * * collection_id.
- *
- * * item_id: ID of the item.
- *
- * * value: Amount to transfer.
- **/
- transferFrom: AugmentedSubmittable<(from: PalletCommonAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, recipient: PalletCommonAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, collectionId: u32 | AnyNumber | Uint8Array, itemId: u32 | AnyNumber | Uint8Array, value: u128 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [PalletCommonAccountBasicCrossAccountIdRepr, PalletCommonAccountBasicCrossAccountIdRepr, u32, u32, u128]>;
- /**
* Generic tx
**/
[key: string]: SubmittableExtrinsicFunction<ApiType>;
};
- nftPayment: {
- /**
- * Generic tx
- **/
- [key: string]: SubmittableExtrinsicFunction<ApiType>;
- };
parachainSystem: {
authorizeUpgrade: AugmentedSubmittable<(codeHash: H256 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [H256]>;
enactAuthorizedUpgrade: AugmentedSubmittable<(code: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Bytes]>;
@@ -778,80 +348,6 @@
**/
[key: string]: SubmittableExtrinsicFunction<ApiType>;
};
- scheduler: {
- /**
- * Cancel an anonymously scheduled task.
- *
- * # <weight>
- * - S = Number of already scheduled calls
- * - Base Weight: 22.15 + 2.869 * S µs
- * - DB Weight:
- * - Read: Agenda
- * - Write: Agenda, Lookup
- * - Will use base weight of 100 which should be good for up to 30 scheduled calls
- * # </weight>
- **/
- cancel: AugmentedSubmittable<(when: u32 | AnyNumber | Uint8Array, index: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, u32]>;
- /**
- * Cancel a named scheduled task.
- *
- * # <weight>
- * - S = Number of already scheduled calls
- * - Base Weight: 24.91 + 2.907 * S µs
- * - DB Weight:
- * - Read: Agenda, Lookup
- * - Write: Agenda, Lookup
- * - Will use base weight of 100 which should be good for up to 30 scheduled calls
- * # </weight>
- **/
- cancelNamed: AugmentedSubmittable<(id: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Bytes]>;
- /**
- * Anonymously schedule a task.
- *
- * # <weight>
- * - S = Number of already scheduled calls
- * - Base Weight: 22.29 + .126 * S µs
- * - DB Weight:
- * - Read: Agenda
- * - Write: Agenda
- * - Will use base weight of 25 which should be good for up to 30 scheduled calls
- * # </weight>
- **/
- schedule: AugmentedSubmittable<(when: u32 | AnyNumber | Uint8Array, maybePeriodic: Option<ITuple<[u32, u32]>> | null | object | string | Uint8Array, priority: u8 | AnyNumber | Uint8Array, call: Call) => SubmittableExtrinsic<ApiType>, [u32, Option<ITuple<[u32, u32]>>, u8, Call]>;
- /**
- * Anonymously schedule a task after a delay.
- *
- * # <weight>
- * 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) => SubmittableExtrinsic<ApiType>, [u32, Option<ITuple<[u32, u32]>>, u8, Call]>;
- /**
- * Schedule a named task.
- *
- * # <weight>
- * - S = Number of already scheduled calls
- * - Base Weight: 29.6 + .159 * S µs
- * - DB Weight:
- * - Read: Agenda, Lookup
- * - Write: Agenda, Lookup
- * - Will use base weight of 35 which should be good for more than 30 scheduled calls
- * # </weight>
- **/
- 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) => SubmittableExtrinsic<ApiType>, [Bytes, u32, Option<ITuple<[u32, u32]>>, u8, Call]>;
- /**
- * Schedule a named task after a delay.
- *
- * # <weight>
- * Same as [`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) => SubmittableExtrinsic<ApiType>, [Bytes, u32, Option<ITuple<[u32, u32]>>, u8, Call]>;
- /**
- * Generic tx
- **/
- [key: string]: SubmittableExtrinsicFunction<ApiType>;
- };
sudo: {
/**
* Authenticates the current sudo key and sets the given AccountId (`new`) as the new sudo
@@ -878,7 +374,7 @@
* - Weight of derivative `call` execution + 10,000.
* # </weight>
**/
- sudo: AugmentedSubmittable<(call: Call) => SubmittableExtrinsic<ApiType>, [Call]>;
+ sudo: AugmentedSubmittable<() => SubmittableExtrinsic<ApiType>, [Call]>;
/**
* Authenticates the sudo key and dispatches a function call with `Signed` origin from
* a given account.
@@ -892,7 +388,7 @@
* - Weight of derivative `call` execution + 10,000.
* # </weight>
**/
- sudoAs: AugmentedSubmittable<(who: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, call: Call) => SubmittableExtrinsic<ApiType>, [MultiAddress, Call]>;
+ sudoAs: AugmentedSubmittable<(who: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, ) => SubmittableExtrinsic<ApiType>, [MultiAddress, Call]>;
/**
* Authenticates the sudo key and dispatches a function call with `Root` origin.
* This function does not check the weight of the call, and instead allows the
@@ -905,7 +401,7 @@
* - The weight of this call is defined by the caller.
* # </weight>
**/
- sudoUncheckedWeight: AugmentedSubmittable<(call: Call, weight: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Call, u64]>;
+ sudoUncheckedWeight: AugmentedSubmittable<(, weight: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Call, u64]>;
/**
* Generic tx
**/
@@ -1094,106 +590,435 @@
**/
[key: string]: SubmittableExtrinsicFunction<ApiType>;
};
- vesting: {
+ unique: {
+ /**
+ * Adds an admin of the Collection.
+ * NFT Collection can be controlled by multiple admin addresses (some which can also be servers, for example). Admins can issue and burn NFTs, as well as add and remove other admins, but cannot change NFT or Collection ownership.
+ *
+ * # Permissions
+ *
+ * * Collection Owner.
+ * * Collection Admin.
+ *
+ * # Arguments
+ *
+ * * collection_id: ID of the Collection to add admin for.
+ *
+ * * new_admin_id: Address of new admin to add.
+ **/
+ addCollectionAdmin: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, newAdminId: PalletCommonAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, PalletCommonAccountBasicCrossAccountIdRepr]>;
/**
- * Force a vested transfer.
+ * Add an address to allow list.
*
- * The dispatch origin for this call must be _Root_.
+ * # Permissions
*
- * - `source`: The account whose funds should be transferred.
- * - `target`: The account that should be transferred the vested funds.
- * - `schedule`: The vesting schedule attached to the transfer.
+ * * Collection Owner
+ * * Collection Admin
+ *
+ * # Arguments
+ *
+ * * collection_id.
+ *
+ * * address.
+ **/
+ addToAllowList: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, address: PalletCommonAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, PalletCommonAccountBasicCrossAccountIdRepr]>;
+ /**
+ * Set, change, or remove approved address to transfer the ownership of the NFT.
+ *
+ * # Permissions
+ *
+ * * Collection Owner
+ * * Collection Admin
+ * * Current NFT owner
+ *
+ * # Arguments
+ *
+ * * approved: Address that is approved to transfer this NFT or zero (if needed to remove approval).
+ *
+ * * collection_id.
+ *
+ * * item_id: ID of the item.
+ **/
+ approve: AugmentedSubmittable<(spender: PalletCommonAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, collectionId: u32 | AnyNumber | Uint8Array, itemId: u32 | AnyNumber | Uint8Array, amount: u128 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [PalletCommonAccountBasicCrossAccountIdRepr, u32, u32, u128]>;
+ /**
+ * Destroys a concrete instance of NFT on behalf of the owner
+ * See also: [`approve`]
+ *
+ * # Permissions
+ *
+ * * Collection Owner.
+ * * Collection Admin.
+ * * Current NFT Owner.
+ *
+ * # Arguments
+ *
+ * * collection_id: ID of the collection.
+ *
+ * * item_id: ID of NFT to burn.
+ *
+ * * from: owner of item
+ **/
+ burnFrom: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, from: PalletCommonAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, itemId: u32 | AnyNumber | Uint8Array, value: u128 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, PalletCommonAccountBasicCrossAccountIdRepr, u32, u128]>;
+ /**
+ * Destroys a concrete instance of NFT.
+ *
+ * # Permissions
+ *
+ * * Collection Owner.
+ * * Collection Admin.
+ * * Current NFT Owner.
+ *
+ * # Arguments
+ *
+ * * collection_id: ID of the collection.
+ *
+ * * item_id: ID of NFT to burn.
+ **/
+ burnItem: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, itemId: u32 | AnyNumber | Uint8Array, value: u128 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, u32, u128]>;
+ /**
+ * Change the owner of the collection.
+ *
+ * # Permissions
+ *
+ * * Collection Owner.
+ *
+ * # Arguments
+ *
+ * * collection_id.
+ *
+ * * new_owner.
+ **/
+ changeCollectionOwner: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, newOwner: AccountId32 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, AccountId32]>;
+ /**
+ * # Permissions
*
- * Emits `VestingCreated`.
+ * * Sponsor.
*
- * NOTE: This will unlock all schedules through the current block.
+ * # Arguments
*
- * # <weight>
- * - `O(1)`.
- * - DbWeight: 4 Reads, 4 Writes
- * - Reads: Vesting Storage, Balances Locks, Target Account, Source Account
- * - Writes: Vesting Storage, Balances Locks, Target Account, Source Account
- * # </weight>
+ * * collection_id.
**/
- forceVestedTransfer: AugmentedSubmittable<(source: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, target: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, schedule: PalletVestingVestingInfo | { locked?: any; perBlock?: any; startingBlock?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [MultiAddress, MultiAddress, PalletVestingVestingInfo]>;
+ confirmSponsorship: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;
/**
- * Merge two vesting schedules together, creating a new vesting schedule that unlocks over
- * the highest possible start and end blocks. If both schedules have already started the
- * current block will be used as the schedule start; with the caveat that if one schedule
- * is finished by the current block, the other will be treated as the new merged schedule,
- * unmodified.
+ * This method creates a Collection of NFTs. Each Token may have multiple properties encoded as an array of bytes of certain length. The initial owner of the collection is set to the address that signed the transaction and can be changed later.
*
- * NOTE: If `schedule1_index == schedule2_index` this is a no-op.
- * NOTE: This will unlock all schedules through the current block prior to merging.
- * NOTE: If both schedules have ended by the current block, no new schedule will be created
- * and both will be removed.
+ * # Permissions
+ *
+ * * Anyone.
+ *
+ * # Arguments
+ *
+ * * collection_name: UTF-16 string with collection name (limit 64 characters), will be stored as zero-terminated.
*
- * Merged schedule attributes:
- * - `starting_block`: `MAX(schedule1.starting_block, scheduled2.starting_block,
- * current_block)`.
- * - `ending_block`: `MAX(schedule1.ending_block, schedule2.ending_block)`.
- * - `locked`: `schedule1.locked_at(current_block) + schedule2.locked_at(current_block)`.
+ * * collection_description: UTF-16 string with collection description (limit 256 characters), will be stored as zero-terminated.
*
- * The dispatch origin for this call must be _Signed_.
+ * * token_prefix: UTF-8 string with token prefix.
*
- * - `schedule1_index`: index of the first schedule to merge.
- * - `schedule2_index`: index of the second schedule to merge.
+ * * mode: [CollectionMode] collection type and type dependent data.
**/
- mergeSchedules: AugmentedSubmittable<(schedule1Index: u32 | AnyNumber | Uint8Array, schedule2Index: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, u32]>;
+ createCollection: AugmentedSubmittable<(collectionName: Vec<u16> | (u16 | AnyNumber | Uint8Array)[], collectionDescription: Vec<u16> | (u16 | AnyNumber | Uint8Array)[], tokenPrefix: Bytes | string | Uint8Array, mode: UpDataStructsCollectionMode | { NFT: any } | { Fungible: any } | { ReFungible: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Vec<u16>, Vec<u16>, Bytes, UpDataStructsCollectionMode]>;
/**
- * Unlock any vested funds of the sender account.
+ * This method creates a concrete instance of NFT Collection created with CreateCollection method.
*
- * The dispatch origin for this call must be _Signed_ and the sender must have funds still
- * locked under this pallet.
+ * # Permissions
*
- * Emits either `VestingCompleted` or `VestingUpdated`.
+ * * Collection Owner.
+ * * Collection Admin.
+ * * Anyone if
+ * * Allow List is enabled, and
+ * * Address is added to allow list, and
+ * * MintPermission is enabled (see SetMintPermission method)
+ *
+ * # Arguments
+ *
+ * * collection_id: ID of the collection.
+ *
+ * * owner: Address, initial owner of the NFT.
*
- * # <weight>
- * - `O(1)`.
- * - DbWeight: 2 Reads, 2 Writes
- * - Reads: Vesting Storage, Balances Locks, [Sender Account]
- * - Writes: Vesting Storage, Balances Locks, [Sender Account]
- * # </weight>
+ * * data: Token data to store on chain.
**/
- vest: AugmentedSubmittable<() => SubmittableExtrinsic<ApiType>, []>;
+ createItem: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, owner: PalletCommonAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, data: UpDataStructsCreateItemData | { NFT: any } | { Fungible: any } | { ReFungible: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, PalletCommonAccountBasicCrossAccountIdRepr, UpDataStructsCreateItemData]>;
/**
- * Create a vested transfer.
+ * This method creates multiple items in a collection created with CreateCollection method.
*
- * The dispatch origin for this call must be _Signed_.
+ * # Permissions
*
- * - `target`: The account receiving the vested funds.
- * - `schedule`: The vesting schedule attached to the transfer.
+ * * Collection Owner.
+ * * Collection Admin.
+ * * Anyone if
+ * * Allow List is enabled, and
+ * * Address is added to allow list, and
+ * * MintPermission is enabled (see SetMintPermission method)
*
- * Emits `VestingCreated`.
+ * # Arguments
*
- * NOTE: This will unlock all schedules through the current block.
+ * * collection_id: ID of the collection.
+ *
+ * * itemsData: Array items properties. Each property is an array of bytes itself, see [create_item].
*
- * # <weight>
- * - `O(1)`.
- * - DbWeight: 3 Reads, 3 Writes
- * - Reads: Vesting Storage, Balances Locks, Target Account, [Sender Account]
- * - Writes: Vesting Storage, Balances Locks, Target Account, [Sender Account]
- * # </weight>
+ * * owner: Address, initial owner of the NFT.
**/
- vestedTransfer: AugmentedSubmittable<(target: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, schedule: PalletVestingVestingInfo | { locked?: any; perBlock?: any; startingBlock?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [MultiAddress, PalletVestingVestingInfo]>;
+ createMultipleItems: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, owner: PalletCommonAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, itemsData: Vec<UpDataStructsCreateItemData> | (UpDataStructsCreateItemData | { NFT: any } | { Fungible: any } | { ReFungible: any } | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [u32, PalletCommonAccountBasicCrossAccountIdRepr, Vec<UpDataStructsCreateItemData>]>;
/**
- * Unlock any vested funds of a `target` account.
+ * **DANGEROUS**: Destroys collection and all NFTs within this collection. Users irrecoverably lose their assets and may lose real money.
*
- * The dispatch origin for this call must be _Signed_.
+ * # Permissions
*
- * - `target`: The account whose vested funds should be unlocked. Must have funds still
- * locked under this pallet.
+ * * Collection Owner.
*
- * Emits either `VestingCompleted` or `VestingUpdated`.
+ * # Arguments
*
- * # <weight>
- * - `O(1)`.
- * - DbWeight: 3 Reads, 3 Writes
- * - Reads: Vesting Storage, Balances Locks, Target Account
- * - Writes: Vesting Storage, Balances Locks, Target Account
- * # </weight>
+ * * collection_id: collection to destroy.
**/
- vestOther: AugmentedSubmittable<(target: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [MultiAddress]>;
+ destroyCollection: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;
+ /**
+ * Remove admin address of the Collection. An admin address can remove itself. List of admins may become empty, in which case only Collection Owner will be able to add an Admin.
+ *
+ * # Permissions
+ *
+ * * Collection Owner.
+ * * Collection Admin.
+ *
+ * # Arguments
+ *
+ * * collection_id: ID of the Collection to remove admin for.
+ *
+ * * account_id: Address of admin to remove.
+ **/
+ removeCollectionAdmin: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, accountId: PalletCommonAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, PalletCommonAccountBasicCrossAccountIdRepr]>;
+ /**
+ * Switch back to pay-per-own-transaction model.
+ *
+ * # Permissions
+ *
+ * * Collection owner.
+ *
+ * # Arguments
+ *
+ * * collection_id.
+ **/
+ removeCollectionSponsor: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;
+ /**
+ * Remove an address from allow list.
+ *
+ * # Permissions
+ *
+ * * Collection Owner
+ * * Collection Admin
+ *
+ * # Arguments
+ *
+ * * collection_id.
+ *
+ * * address.
+ **/
+ removeFromAllowList: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, address: PalletCommonAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, PalletCommonAccountBasicCrossAccountIdRepr]>;
+ setCollectionLimits: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, newLimit: UpDataStructsCollectionLimits | { accountTokenOwnershipLimit?: any; sponsoredDataSize?: any; sponsoredDataRateLimit?: any; tokenLimit?: any; sponsorTransferTimeout?: any; sponsorApproveTimeout?: any; ownerCanTransfer?: any; ownerCanDestroy?: any; transfersEnabled?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, UpDataStructsCollectionLimits]>;
+ /**
+ * # Permissions
+ *
+ * * Collection Owner
+ *
+ * # Arguments
+ *
+ * * collection_id.
+ *
+ * * new_sponsor.
+ **/
+ setCollectionSponsor: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, newSponsor: AccountId32 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, AccountId32]>;
+ /**
+ * Set const on-chain data schema.
+ *
+ * # Permissions
+ *
+ * * Collection Owner
+ * * Collection Admin
+ *
+ * # Arguments
+ *
+ * * collection_id.
+ *
+ * * schema: String representing the const on-chain data schema.
+ **/
+ setConstOnChainSchema: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, schema: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, Bytes]>;
+ /**
+ * Set meta_update_permission value for particular collection
+ *
+ * # Permissions
+ *
+ * * Collection Owner.
+ *
+ * # Arguments
+ *
+ * * collection_id: ID of the collection.
+ *
+ * * value: New flag value.
+ **/
+ setMetaUpdatePermissionFlag: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, value: UpDataStructsMetaUpdatePermission | 'ItemOwner' | 'Admin' | 'None' | number | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, UpDataStructsMetaUpdatePermission]>;
+ /**
+ * Allows Anyone to create tokens if:
+ * * Allow List is enabled, and
+ * * Address is added to allow list, and
+ * * This method was called with True parameter
+ *
+ * # Permissions
+ * * Collection Owner
+ *
+ * # Arguments
+ *
+ * * collection_id.
+ *
+ * * mint_permission: Boolean parameter. If True, allows minting to Anyone with conditions above.
+ **/
+ setMintPermission: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, mintPermission: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, bool]>;
+ /**
+ * Set off-chain data schema.
+ *
+ * # Permissions
+ *
+ * * Collection Owner
+ * * Collection Admin
+ *
+ * # Arguments
+ *
+ * * collection_id.
+ *
+ * * schema: String representing the offchain data schema.
+ **/
+ setOffchainSchema: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, schema: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, Bytes]>;
+ /**
+ * Toggle between normal and allow list access for the methods with access for `Anyone`.
+ *
+ * # Permissions
+ *
+ * * Collection Owner.
+ *
+ * # Arguments
+ *
+ * * collection_id.
+ *
+ * * mode: [AccessMode]
+ **/
+ setPublicAccessMode: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, mode: UpDataStructsAccessMode | 'Normal' | 'AllowList' | number | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, UpDataStructsAccessMode]>;
+ /**
+ * Set schema standard
+ * ImageURL
+ * Unique
+ *
+ * # Permissions
+ *
+ * * Collection Owner
+ * * Collection Admin
+ *
+ * # Arguments
+ *
+ * * collection_id.
+ *
+ * * schema: SchemaVersion: enum
+ **/
+ setSchemaVersion: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, version: UpDataStructsSchemaVersion | 'ImageURL' | 'Unique' | number | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, UpDataStructsSchemaVersion]>;
+ /**
+ * Set transfers_enabled value for particular collection
+ *
+ * # Permissions
+ *
+ * * Collection Owner.
+ *
+ * # Arguments
+ *
+ * * collection_id: ID of the collection.
+ *
+ * * value: New flag value.
+ **/
+ setTransfersEnabledFlag: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, value: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, bool]>;
+ /**
+ * Set off-chain data schema.
+ *
+ * # Permissions
+ *
+ * * Collection Owner
+ * * Collection Admin
+ *
+ * # Arguments
+ *
+ * * collection_id.
+ *
+ * * schema: String representing the offchain data schema.
+ **/
+ setVariableMetaData: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, itemId: u32 | AnyNumber | Uint8Array, data: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, u32, Bytes]>;
+ /**
+ * Set variable on-chain data schema.
+ *
+ * # Permissions
+ *
+ * * Collection Owner
+ * * Collection Admin
+ *
+ * # Arguments
+ *
+ * * collection_id.
+ *
+ * * schema: String representing the variable on-chain data schema.
+ **/
+ setVariableOnChainSchema: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, schema: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, Bytes]>;
+ /**
+ * Change ownership of the token.
+ *
+ * # Permissions
+ *
+ * * Collection Owner
+ * * Collection Admin
+ * * Current NFT owner
+ *
+ * # Arguments
+ *
+ * * recipient: Address of token recipient.
+ *
+ * * collection_id.
+ *
+ * * item_id: ID of the item
+ * * Non-Fungible Mode: Required.
+ * * Fungible Mode: Ignored.
+ * * Re-Fungible Mode: Required.
+ *
+ * * value: Amount to transfer.
+ * * Non-Fungible Mode: Ignored
+ * * Fungible Mode: Must specify transferred amount
+ * * Re-Fungible Mode: Must specify transferred portion (between 0 and 1)
+ **/
+ transfer: AugmentedSubmittable<(recipient: PalletCommonAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, collectionId: u32 | AnyNumber | Uint8Array, itemId: u32 | AnyNumber | Uint8Array, value: u128 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [PalletCommonAccountBasicCrossAccountIdRepr, u32, u32, u128]>;
+ /**
+ * Change ownership of a NFT on behalf of the owner. See Approve method for additional information. After this method executes, the approval is removed so that the approved address will not be able to transfer this NFT again from this owner.
+ *
+ * # Permissions
+ * * Collection Owner
+ * * Collection Admin
+ * * Current NFT owner
+ * * Address approved by current NFT owner
+ *
+ * # Arguments
+ *
+ * * from: Address that owns token.
+ *
+ * * recipient: Address of token recipient.
+ *
+ * * collection_id.
+ *
+ * * item_id: ID of the item.
+ *
+ * * value: Amount to transfer.
+ **/
+ transferFrom: AugmentedSubmittable<(from: PalletCommonAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, recipient: PalletCommonAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, collectionId: u32 | AnyNumber | Uint8Array, itemId: u32 | AnyNumber | Uint8Array, value: u128 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [PalletCommonAccountBasicCrossAccountIdRepr, PalletCommonAccountBasicCrossAccountIdRepr, u32, u32, u128]>;
+ /**
+ * Generic tx
+ **/
+ [key: string]: SubmittableExtrinsicFunction<ApiType>;
+ };
+ vesting: {
+ claim: AugmentedSubmittable<() => SubmittableExtrinsic<ApiType>, []>;
+ claimFor: AugmentedSubmittable<(dest: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [MultiAddress]>;
+ updateVestingSchedules: AugmentedSubmittable<(who: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, vestingSchedules: Vec<OrmlVestingVestingSchedule> | (OrmlVestingVestingSchedule | { start?: any; period?: any; periodCount?: any; perPeriod?: any } | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [MultiAddress, Vec<OrmlVestingVestingSchedule>]>;
+ vestedTransfer: AugmentedSubmittable<(dest: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, schedule: OrmlVestingVestingSchedule | { start?: any; period?: any; periodCount?: any; perPeriod?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [MultiAddress, OrmlVestingVestingSchedule]>;
/**
* Generic tx
**/
tests/src/interfaces/augment-types.tsdiffbeforeafterboth--- a/tests/src/interfaces/augment-types.ts
+++ b/tests/src/interfaces/augment-types.ts
@@ -2,8 +2,8 @@
/* eslint-disable */
import type { EthereumBlock, EthereumLog, EthereumReceipt, EthereumTransactionLegacyTransaction, EvmCoreErrorExitReason, FpRpcTransactionStatus } from './ethereum';
-import type { NftDataStructsAccessMode, NftDataStructsCollection, NftDataStructsCollectionId, NftDataStructsCollectionLimits, NftDataStructsCollectionMode, NftDataStructsCollectionStats, NftDataStructsCreateItemData, NftDataStructsMetaUpdatePermission, NftDataStructsSchemaVersion, NftDataStructsSponsorshipState, NftDataStructsTokenId, PalletCommonAccountBasicCrossAccountIdRepr, PalletNonfungibleItemData, PalletRefungibleItemData, PalletUnqSchedulerCallSpec, PalletUnqSchedulerReleases, PalletUnqSchedulerScheduledV2 } from './nft';
import type { CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmpQueueInboundStatus, CumulusPalletXcmpQueueOutboundStatus, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV1AbridgedHostConfiguration, PolkadotPrimitivesV1PersistedValidationData } from './polkadot';
+import type { PalletCommonAccountBasicCrossAccountIdRepr, PalletNonfungibleItemData, PalletRefungibleItemData, PalletUnqSchedulerCallSpec, PalletUnqSchedulerReleases, PalletUnqSchedulerScheduledV2, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionId, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionStats, UpDataStructsCreateItemData, UpDataStructsMetaUpdatePermission, UpDataStructsSchemaVersion, UpDataStructsSponsorshipState, UpDataStructsTokenId } from './unique';
import type { BitVec, Bool, Bytes, Data, I128, I16, I256, I32, I64, I8, Json, Null, Raw, StorageKey, Text, Type, U128, U16, U256, U32, U64, U8, USize, bool, i128, i16, i256, i32, i64, i8, u128, u16, u256, u32, u64, u8, usize } from '@polkadot/types';
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';
@@ -622,17 +622,6 @@
NextAuthority: NextAuthority;
NextConfigDescriptor: NextConfigDescriptor;
NextConfigDescriptorV1: NextConfigDescriptorV1;
- NftDataStructsAccessMode: NftDataStructsAccessMode;
- NftDataStructsCollection: NftDataStructsCollection;
- NftDataStructsCollectionId: NftDataStructsCollectionId;
- NftDataStructsCollectionLimits: NftDataStructsCollectionLimits;
- NftDataStructsCollectionMode: NftDataStructsCollectionMode;
- NftDataStructsCollectionStats: NftDataStructsCollectionStats;
- NftDataStructsCreateItemData: NftDataStructsCreateItemData;
- NftDataStructsMetaUpdatePermission: NftDataStructsMetaUpdatePermission;
- NftDataStructsSchemaVersion: NftDataStructsSchemaVersion;
- NftDataStructsSponsorshipState: NftDataStructsSponsorshipState;
- NftDataStructsTokenId: NftDataStructsTokenId;
NodeRole: NodeRole;
Nominations: Nominations;
NominatorIndex: NominatorIndex;
@@ -1026,6 +1015,17 @@
UnlockChunk: UnlockChunk;
UnrewardedRelayer: UnrewardedRelayer;
UnrewardedRelayersState: UnrewardedRelayersState;
+ UpDataStructsAccessMode: UpDataStructsAccessMode;
+ UpDataStructsCollection: UpDataStructsCollection;
+ UpDataStructsCollectionId: UpDataStructsCollectionId;
+ UpDataStructsCollectionLimits: UpDataStructsCollectionLimits;
+ UpDataStructsCollectionMode: UpDataStructsCollectionMode;
+ UpDataStructsCollectionStats: UpDataStructsCollectionStats;
+ UpDataStructsCreateItemData: UpDataStructsCreateItemData;
+ UpDataStructsMetaUpdatePermission: UpDataStructsMetaUpdatePermission;
+ UpDataStructsSchemaVersion: UpDataStructsSchemaVersion;
+ UpDataStructsSponsorshipState: UpDataStructsSponsorshipState;
+ UpDataStructsTokenId: UpDataStructsTokenId;
UpgradeGoAhead: UpgradeGoAhead;
UpgradeRestriction: UpgradeRestriction;
UpwardMessage: UpwardMessage;
tests/src/interfaces/definitions.tsdiffbeforeafterboth--- a/tests/src/interfaces/definitions.ts
+++ b/tests/src/interfaces/definitions.ts
@@ -1,3 +1,3 @@
-export {default as nft} from './nft/definitions';
+export {default as unique} from './unique/definitions';
export {default as ethereum} from './ethereum/definitions';
export {default as polkadot} from './polkadot/definitions';
tests/src/interfaces/nft/definitions.tsdiffbeforeafterboth--- a/tests/src/interfaces/nft/definitions.ts
+++ /dev/null
@@ -1,110 +0,0 @@
-function mkDummy(name: string) {
- return {
- ['dummy' + name]: 'u32',
- };
-}
-
-type RpcParam = {
- name: string;
- type: string;
- isOptional?: true;
-};
-
-const CROSS_ACCOUNT_ID_TYPE = 'PalletCommonAccountBasicCrossAccountIdRepr';
-const TOKEN_ID_TYPE = 'NftDataStructsTokenId';
-
-const collectionParam = {name: 'collection', type: 'NftDataStructsCollectionId'};
-const tokenParam = {name: 'tokenId', type: TOKEN_ID_TYPE};
-const crossAccountParam = (name = 'account') => ({name, type: CROSS_ACCOUNT_ID_TYPE});
-const atParam = {name: 'at', type: 'Hash', isOptional: true};
-
-const fun = (description: string, params: RpcParam[], type: string) => ({
- description,
- params: [...params, atParam],
- type,
-});
-
-export default {
- rpc: {
- adminlist: fun('Get admin list', [collectionParam], 'Vec<PalletCommonAccountBasicCrossAccountIdRepr>'),
- allowlist: fun('Get allowlist', [collectionParam], 'Vec<PalletCommonAccountBasicCrossAccountIdRepr>'),
-
- accountTokens: fun('Get tokens owned by account', [collectionParam, crossAccountParam()], 'Vec<NftDataStructsTokenId>'),
- collectionTokens: fun('Get tokens contained in collection', [collectionParam], 'Vec<NftDataStructsTokenId>'),
-
- lastTokenId: fun('Get last token id', [collectionParam], TOKEN_ID_TYPE),
- accountBalance: fun('Get amount of different user tokens', [collectionParam, crossAccountParam()], 'u32'),
- balance: fun('Get amount of specific account token', [collectionParam, crossAccountParam(), tokenParam], 'u128'),
- allowance: fun('Get allowed amount', [collectionParam, crossAccountParam('sender'), crossAccountParam('spender'), tokenParam], 'u128'),
- tokenOwner: fun('Get token owner', [collectionParam, tokenParam], CROSS_ACCOUNT_ID_TYPE),
- constMetadata: fun('Get token constant metadata', [collectionParam, tokenParam], 'Vec<u8>'),
- variableMetadata: fun('Get token variable metadata', [collectionParam, tokenParam], 'Vec<u8>'),
- tokenExists: fun('Check if token exists', [collectionParam, tokenParam], 'bool'),
- collectionById: fun('Get collection by specified id', [collectionParam], 'Option<NftDataStructsCollection>'),
- collectionStats: fun('Get collection stats', [], 'NftDataStructsCollectionStats'),
- allowed: fun('Check if user is allowed to use collection', [collectionParam, crossAccountParam()], 'bool'),
- },
- types: {
- PalletCommonAccountBasicCrossAccountIdRepr: {
- _enum: {
- Substrate: 'AccountId',
- Ethereum: 'H160',
- },
- },
- NftDataStructsCollection: {
- owner: 'AccountId',
- mode: 'NftDataStructsCollectionMode',
- access: 'NftDataStructsAccessMode',
- name: 'Vec<u16>',
- description: 'Vec<u16>',
- tokenPrefix: 'Vec<u8>',
- mintMode: 'bool',
- offchainSchema: 'Vec<u8>',
- schemaVersion: 'NftDataStructsSchemaVersion',
- sponsorship: 'NftDataStructsSponsorshipState',
- limits: 'NftDataStructsCollectionLimits',
- variableOnChainSchema: 'Vec<u8>',
- constOnChainSchema: 'Vec<u8>',
- metaUpdatePermission: 'NftDataStructsMetaUpdatePermission',
- },
- NftDataStructsCollectionStats: {
- created: 'u32',
- destroyed: 'u32',
- alive: 'u32',
- },
- NftDataStructsCollectionId: 'u32',
- NftDataStructsTokenId: 'u32',
- PalletNonfungibleItemData: mkDummy('NftItemData'),
- PalletRefungibleItemData: mkDummy('RftItemData'),
- NftDataStructsCollectionMode: mkDummy('CollectionMode'),
- NftDataStructsCreateItemData: mkDummy('CreateItemData'),
- NftDataStructsCollectionLimits: {
- accountTokenOwnershipLimit: 'Option<u32>',
- sponsoredDataSize: 'Option<u32>',
- sponsoredDataRateLimit: 'Option<u32>',
- tokenLimit: 'Option<u32>',
- sponsorTransferTimeout: 'Option<u32>',
- ownerCanTransfer: 'Option<bool>',
- ownerCanDestroy: 'Option<bool>',
- transfersEnabled: 'Option<bool>',
- },
- NftDataStructsMetaUpdatePermission: {
- _enum: ['ItemOwner', 'Admin', 'None'],
- },
- NftDataStructsSponsorshipState: {
- _enum: {
- Disabled: null,
- Unconfirmed: 'AccountId',
- Confirmed: 'AccountId',
- },
- },
- NftDataStructsAccessMode: {
- _enum: ['Normal', 'AllowList'],
- },
- NftDataStructsSchemaVersion: mkDummy('SchemaVersion'),
-
- PalletUnqSchedulerScheduledV2: mkDummy('ScheduledV2'),
- PalletUnqSchedulerCallSpec: mkDummy('CallSpec'),
- PalletUnqSchedulerReleases: mkDummy('Releases'),
- },
-};
tests/src/interfaces/nft/index.tsdiffbeforeafterboth--- a/tests/src/interfaces/nft/index.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-// Auto-generated via `yarn polkadot-types-from-defs`, do not edit
-/* eslint-disable */
-
-export * from './types';
tests/src/interfaces/nft/types.tsdiffbeforeafterboth--- a/tests/src/interfaces/nft/types.ts
+++ /dev/null
@@ -1,120 +0,0 @@
-// Auto-generated via `yarn polkadot-types-from-defs`, do not edit
-/* eslint-disable */
-
-import type { Bytes, Enum, Option, Struct, Vec, bool, u16, u32 } from '@polkadot/types';
-import type { AccountId, H160 } from '@polkadot/types/interfaces/runtime';
-
-/** @name NftDataStructsAccessMode */
-export interface NftDataStructsAccessMode extends Enum {
- readonly isNormal: boolean;
- readonly isAllowList: boolean;
-}
-
-/** @name NftDataStructsCollection */
-export interface NftDataStructsCollection extends Struct {
- readonly owner: AccountId;
- readonly mode: NftDataStructsCollectionMode;
- readonly access: NftDataStructsAccessMode;
- readonly name: Vec<u16>;
- readonly description: Vec<u16>;
- readonly tokenPrefix: Bytes;
- readonly mintMode: bool;
- readonly offchainSchema: Bytes;
- readonly schemaVersion: NftDataStructsSchemaVersion;
- readonly sponsorship: NftDataStructsSponsorshipState;
- readonly limits: NftDataStructsCollectionLimits;
- readonly variableOnChainSchema: Bytes;
- readonly constOnChainSchema: Bytes;
- readonly metaUpdatePermission: NftDataStructsMetaUpdatePermission;
-}
-
-/** @name NftDataStructsCollectionId */
-export interface NftDataStructsCollectionId extends u32 {}
-
-/** @name NftDataStructsCollectionLimits */
-export interface NftDataStructsCollectionLimits extends Struct {
- readonly accountTokenOwnershipLimit: Option<u32>;
- readonly sponsoredDataSize: Option<u32>;
- readonly sponsoredDataRateLimit: Option<u32>;
- readonly tokenLimit: Option<u32>;
- readonly sponsorTransferTimeout: Option<u32>;
- readonly ownerCanTransfer: Option<bool>;
- readonly ownerCanDestroy: Option<bool>;
- readonly transfersEnabled: Option<bool>;
-}
-
-/** @name NftDataStructsCollectionMode */
-export interface NftDataStructsCollectionMode extends Struct {
- readonly dummyCollectionMode: u32;
-}
-
-/** @name NftDataStructsCollectionStats */
-export interface NftDataStructsCollectionStats extends Struct {
- readonly created: u32;
- readonly destroyed: u32;
- readonly alive: u32;
-}
-
-/** @name NftDataStructsCreateItemData */
-export interface NftDataStructsCreateItemData extends Struct {
- readonly dummyCreateItemData: u32;
-}
-
-/** @name NftDataStructsMetaUpdatePermission */
-export interface NftDataStructsMetaUpdatePermission extends Enum {
- readonly isItemOwner: boolean;
- readonly isAdmin: boolean;
- readonly isNone: boolean;
-}
-
-/** @name NftDataStructsSchemaVersion */
-export interface NftDataStructsSchemaVersion extends Struct {
- readonly dummySchemaVersion: u32;
-}
-
-/** @name NftDataStructsSponsorshipState */
-export interface NftDataStructsSponsorshipState extends Enum {
- readonly isDisabled: boolean;
- readonly isUnconfirmed: boolean;
- readonly asUnconfirmed: AccountId;
- readonly isConfirmed: boolean;
- readonly asConfirmed: AccountId;
-}
-
-/** @name NftDataStructsTokenId */
-export interface NftDataStructsTokenId extends u32 {}
-
-/** @name PalletCommonAccountBasicCrossAccountIdRepr */
-export interface PalletCommonAccountBasicCrossAccountIdRepr extends Enum {
- readonly isSubstrate: boolean;
- readonly asSubstrate: AccountId;
- readonly isEthereum: boolean;
- readonly asEthereum: H160;
-}
-
-/** @name PalletNonfungibleItemData */
-export interface PalletNonfungibleItemData extends Struct {
- readonly dummyNftItemData: u32;
-}
-
-/** @name PalletRefungibleItemData */
-export interface PalletRefungibleItemData extends Struct {
- readonly dummyRftItemData: u32;
-}
-
-/** @name PalletUnqSchedulerCallSpec */
-export interface PalletUnqSchedulerCallSpec extends Struct {
- readonly dummyCallSpec: u32;
-}
-
-/** @name PalletUnqSchedulerReleases */
-export interface PalletUnqSchedulerReleases extends Struct {
- readonly dummyReleases: u32;
-}
-
-/** @name PalletUnqSchedulerScheduledV2 */
-export interface PalletUnqSchedulerScheduledV2 extends Struct {
- readonly dummyScheduledV2: u32;
-}
-
-export type PHANTOM_NFT = 'nft';
tests/src/interfaces/types.tsdiffbeforeafterboth--- a/tests/src/interfaces/types.ts
+++ b/tests/src/interfaces/types.ts
@@ -1,6 +1,6 @@
// Auto-generated via `yarn polkadot-types-from-defs`, do not edit
/* eslint-disable */
-export * from './nft/types';
+export * from './unique/types';
export * from './ethereum/types';
export * from './polkadot/types';
tests/src/interfaces/unique/definitions.tsdiffbeforeafterboth--- /dev/null
+++ b/tests/src/interfaces/unique/definitions.ts
@@ -0,0 +1,110 @@
+function mkDummy(name: string) {
+ return {
+ ['dummy' + name]: 'u32',
+ };
+}
+
+type RpcParam = {
+ name: string;
+ type: string;
+ isOptional?: true;
+};
+
+const CROSS_ACCOUNT_ID_TYPE = 'PalletCommonAccountBasicCrossAccountIdRepr';
+const TOKEN_ID_TYPE = 'UpDataStructsTokenId';
+
+const collectionParam = {name: 'collection', type: 'UpDataStructsCollectionId'};
+const tokenParam = {name: 'tokenId', type: TOKEN_ID_TYPE};
+const crossAccountParam = (name = 'account') => ({name, type: CROSS_ACCOUNT_ID_TYPE});
+const atParam = {name: 'at', type: 'Hash', isOptional: true};
+
+const fun = (description: string, params: RpcParam[], type: string) => ({
+ description,
+ params: [...params, atParam],
+ type,
+});
+
+export default {
+ rpc: {
+ adminlist: fun('Get admin list', [collectionParam], 'Vec<PalletCommonAccountBasicCrossAccountIdRepr>'),
+ allowlist: fun('Get allowlist', [collectionParam], 'Vec<PalletCommonAccountBasicCrossAccountIdRepr>'),
+
+ accountTokens: fun('Get tokens owned by account', [collectionParam, crossAccountParam()], 'Vec<UpDataStructsTokenId>'),
+ collectionTokens: fun('Get tokens contained in collection', [collectionParam], 'Vec<UpDataStructsTokenId>'),
+
+ lastTokenId: fun('Get last token id', [collectionParam], TOKEN_ID_TYPE),
+ accountBalance: fun('Get amount of different user tokens', [collectionParam, crossAccountParam()], 'u32'),
+ balance: fun('Get amount of specific account token', [collectionParam, crossAccountParam(), tokenParam], 'u128'),
+ allowance: fun('Get allowed amount', [collectionParam, crossAccountParam('sender'), crossAccountParam('spender'), tokenParam], 'u128'),
+ tokenOwner: fun('Get token owner', [collectionParam, tokenParam], CROSS_ACCOUNT_ID_TYPE),
+ constMetadata: fun('Get token constant metadata', [collectionParam, tokenParam], 'Vec<u8>'),
+ variableMetadata: fun('Get token variable metadata', [collectionParam, tokenParam], 'Vec<u8>'),
+ tokenExists: fun('Check if token exists', [collectionParam, tokenParam], 'bool'),
+ collectionById: fun('Get collection by specified id', [collectionParam], 'Option<UpDataStructsCollection>'),
+ collectionStats: fun('Get collection stats', [], 'UpDataStructsCollectionStats'),
+ allowed: fun('Check if user is allowed to use collection', [collectionParam, crossAccountParam()], 'bool'),
+ },
+ types: {
+ PalletCommonAccountBasicCrossAccountIdRepr: {
+ _enum: {
+ Substrate: 'AccountId',
+ Ethereum: 'H160',
+ },
+ },
+ UpDataStructsCollection: {
+ owner: 'AccountId',
+ mode: 'UpDataStructsCollectionMode',
+ access: 'UpDataStructsAccessMode',
+ name: 'Vec<u16>',
+ description: 'Vec<u16>',
+ tokenPrefix: 'Vec<u8>',
+ mintMode: 'bool',
+ offchainSchema: 'Vec<u8>',
+ schemaVersion: 'UpDataStructsSchemaVersion',
+ sponsorship: 'UpDataStructsSponsorshipState',
+ limits: 'UpDataStructsCollectionLimits',
+ variableOnChainSchema: 'Vec<u8>',
+ constOnChainSchema: 'Vec<u8>',
+ metaUpdatePermission: 'UpDataStructsMetaUpdatePermission',
+ },
+ UpDataStructsCollectionStats: {
+ created: 'u32',
+ destroyed: 'u32',
+ alive: 'u32',
+ },
+ UpDataStructsCollectionId: 'u32',
+ UpDataStructsTokenId: 'u32',
+ PalletNonfungibleItemData: mkDummy('NftItemData'),
+ PalletRefungibleItemData: mkDummy('RftItemData'),
+ UpDataStructsCollectionMode: mkDummy('CollectionMode'),
+ UpDataStructsCreateItemData: mkDummy('CreateItemData'),
+ UpDataStructsCollectionLimits: {
+ accountTokenOwnershipLimit: 'Option<u32>',
+ sponsoredDataSize: 'Option<u32>',
+ sponsoredDataRateLimit: 'Option<u32>',
+ tokenLimit: 'Option<u32>',
+ sponsorTransferTimeout: 'Option<u32>',
+ ownerCanTransfer: 'Option<bool>',
+ ownerCanDestroy: 'Option<bool>',
+ transfersEnabled: 'Option<bool>',
+ },
+ UpDataStructsMetaUpdatePermission: {
+ _enum: ['ItemOwner', 'Admin', 'None'],
+ },
+ UpDataStructsSponsorshipState: {
+ _enum: {
+ Disabled: null,
+ Unconfirmed: 'AccountId',
+ Confirmed: 'AccountId',
+ },
+ },
+ UpDataStructsAccessMode: {
+ _enum: ['Normal', 'AllowList'],
+ },
+ UpDataStructsSchemaVersion: mkDummy('SchemaVersion'),
+
+ PalletUnqSchedulerScheduledV2: mkDummy('ScheduledV2'),
+ PalletUnqSchedulerCallSpec: mkDummy('CallSpec'),
+ PalletUnqSchedulerReleases: mkDummy('Releases'),
+ },
+};
tests/src/interfaces/unique/index.tsdiffbeforeafterboth--- /dev/null
+++ b/tests/src/interfaces/unique/index.ts
@@ -0,0 +1,4 @@
+// Auto-generated via `yarn polkadot-types-from-defs`, do not edit
+/* eslint-disable */
+
+export * from './types';
tests/src/interfaces/unique/types.tsdiffbeforeafterboth--- /dev/null
+++ b/tests/src/interfaces/unique/types.ts
@@ -0,0 +1,120 @@
+// Auto-generated via `yarn polkadot-types-from-defs`, do not edit
+/* eslint-disable */
+
+import type { Bytes, Enum, Option, Struct, Vec, bool, u16, u32 } from '@polkadot/types';
+import type { AccountId, H160 } from '@polkadot/types/interfaces/runtime';
+
+/** @name PalletCommonAccountBasicCrossAccountIdRepr */
+export interface PalletCommonAccountBasicCrossAccountIdRepr extends Enum {
+ readonly isSubstrate: boolean;
+ readonly asSubstrate: AccountId;
+ readonly isEthereum: boolean;
+ readonly asEthereum: H160;
+}
+
+/** @name PalletNonfungibleItemData */
+export interface PalletNonfungibleItemData extends Struct {
+ readonly dummyNftItemData: u32;
+}
+
+/** @name PalletRefungibleItemData */
+export interface PalletRefungibleItemData extends Struct {
+ readonly dummyRftItemData: u32;
+}
+
+/** @name PalletUnqSchedulerCallSpec */
+export interface PalletUnqSchedulerCallSpec extends Struct {
+ readonly dummyCallSpec: u32;
+}
+
+/** @name PalletUnqSchedulerReleases */
+export interface PalletUnqSchedulerReleases extends Struct {
+ readonly dummyReleases: u32;
+}
+
+/** @name PalletUnqSchedulerScheduledV2 */
+export interface PalletUnqSchedulerScheduledV2 extends Struct {
+ readonly dummyScheduledV2: u32;
+}
+
+/** @name UpDataStructsAccessMode */
+export interface UpDataStructsAccessMode extends Enum {
+ readonly isNormal: boolean;
+ readonly isAllowList: boolean;
+}
+
+/** @name UpDataStructsCollection */
+export interface UpDataStructsCollection extends Struct {
+ readonly owner: AccountId;
+ readonly mode: UpDataStructsCollectionMode;
+ readonly access: UpDataStructsAccessMode;
+ readonly name: Vec<u16>;
+ readonly description: Vec<u16>;
+ readonly tokenPrefix: Bytes;
+ readonly mintMode: bool;
+ readonly offchainSchema: Bytes;
+ readonly schemaVersion: UpDataStructsSchemaVersion;
+ readonly sponsorship: UpDataStructsSponsorshipState;
+ readonly limits: UpDataStructsCollectionLimits;
+ readonly variableOnChainSchema: Bytes;
+ readonly constOnChainSchema: Bytes;
+ readonly metaUpdatePermission: UpDataStructsMetaUpdatePermission;
+}
+
+/** @name UpDataStructsCollectionId */
+export interface UpDataStructsCollectionId extends u32 {}
+
+/** @name UpDataStructsCollectionLimits */
+export interface UpDataStructsCollectionLimits extends Struct {
+ readonly accountTokenOwnershipLimit: Option<u32>;
+ readonly sponsoredDataSize: Option<u32>;
+ readonly sponsoredDataRateLimit: Option<u32>;
+ readonly tokenLimit: Option<u32>;
+ readonly sponsorTransferTimeout: Option<u32>;
+ readonly ownerCanTransfer: Option<bool>;
+ readonly ownerCanDestroy: Option<bool>;
+ readonly transfersEnabled: Option<bool>;
+}
+
+/** @name UpDataStructsCollectionMode */
+export interface UpDataStructsCollectionMode extends Struct {
+ readonly dummyCollectionMode: u32;
+}
+
+/** @name UpDataStructsCollectionStats */
+export interface UpDataStructsCollectionStats extends Struct {
+ readonly created: u32;
+ readonly destroyed: u32;
+ readonly alive: u32;
+}
+
+/** @name UpDataStructsCreateItemData */
+export interface UpDataStructsCreateItemData extends Struct {
+ readonly dummyCreateItemData: u32;
+}
+
+/** @name UpDataStructsMetaUpdatePermission */
+export interface UpDataStructsMetaUpdatePermission extends Enum {
+ readonly isItemOwner: boolean;
+ readonly isAdmin: boolean;
+ readonly isNone: boolean;
+}
+
+/** @name UpDataStructsSchemaVersion */
+export interface UpDataStructsSchemaVersion extends Struct {
+ readonly dummySchemaVersion: u32;
+}
+
+/** @name UpDataStructsSponsorshipState */
+export interface UpDataStructsSponsorshipState extends Enum {
+ readonly isDisabled: boolean;
+ readonly isUnconfirmed: boolean;
+ readonly asUnconfirmed: AccountId;
+ readonly isConfirmed: boolean;
+ readonly asConfirmed: AccountId;
+}
+
+/** @name UpDataStructsTokenId */
+export interface UpDataStructsTokenId extends u32 {}
+
+export type PHANTOM_UNIQUE = 'unique';
tests/src/util/helpers.tsdiffbeforeafterboth11import chai from 'chai';11import chai from 'chai';12import chaiAsPromised from 'chai-as-promised';12import chaiAsPromised from 'chai-as-promised';13import {alicesPublicKey} from '../accounts';13import {alicesPublicKey} from '../accounts';14import {NftDataStructsCollection} from '../interfaces';14import {UpDataStructsCollection} from '../interfaces';15import privateKey from '../substrate/privateKey';15import privateKey from '../substrate/privateKey';16import {default as usingApi, submitTransactionAsync, submitTransactionExpectFailAsync} from '../substrate/substrate-api';16import {default as usingApi, submitTransactionAsync, submitTransactionExpectFailAsync} from '../substrate/substrate-api';17import {hexToStr, strToUTF16, utf16ToStr} from './util';17import {hexToStr, strToUTF16, utf16ToStr} from './util';105}105}106106107interface IGetMessage {107interface IGetMessage {108 checkMsgNftMethod: string;108 checkMsgUnqMethod: string;109 checkMsgTrsMethod: string;109 checkMsgTrsMethod: string;110 checkMsgSysMethod: string;110 checkMsgSysMethod: string;111}111}133 variableData: number[];133 variableData: number[];134}134}135135136export function nftEventMessage(events: EventRecord[]): IGetMessage {136export function uniqueEventMessage(events: EventRecord[]): IGetMessage {137 let checkMsgNftMethod = '';137 let checkMsgUnqMethod = '';138 let checkMsgTrsMethod = '';138 let checkMsgTrsMethod = '';139 let checkMsgSysMethod = '';139 let checkMsgSysMethod = '';140 events.forEach(({event: {method, section}}) => {140 events.forEach(({event: {method, section}}) => {141 if (section === 'common') {141 if (section === 'common') {142 checkMsgNftMethod = method;142 checkMsgUnqMethod = method;143 } else if (section === 'treasury') {143 } else if (section === 'treasury') {144 checkMsgTrsMethod = method;144 checkMsgTrsMethod = method;145 } else if (section === 'system') {145 } else if (section === 'system') {146 checkMsgSysMethod = method;146 checkMsgSysMethod = method;147 } else { return null; }147 } else { return null; }148 });148 });149 const result: IGetMessage = {149 const result: IGetMessage = {150 checkMsgNftMethod,150 checkMsgUnqMethod,151 checkMsgTrsMethod,151 checkMsgTrsMethod,152 checkMsgSysMethod,152 checkMsgSysMethod,153 };153 };716 tokenId: number, owner: IKeyringPair, approved: CrossAccountId | string, amount: number | bigint = 1,716 tokenId: number, owner: IKeyringPair, approved: CrossAccountId | string, amount: number | bigint = 1,717) {717) {718 await usingApi(async (api: ApiPromise) => {718 await usingApi(async (api: ApiPromise) => {719 const approveNftTx = api.tx.unique.approve(normalizeAccountId(approved), collectionId, tokenId, amount);719 const approveUniqueTx = api.tx.unique.approve(normalizeAccountId(approved), collectionId, tokenId, amount);720 const events = await submitTransactionAsync(owner, approveNftTx);720 const events = await submitTransactionAsync(owner, approveUniqueTx);721 const result = getGenericResult(events);721 const result = getGenericResult(events);722 expect(result.success).to.be.true;722 expect(result.success).to.be.true;723723730 tokenId: number, admin: IKeyringPair, owner: CrossAccountId | string, approved: CrossAccountId | string, amount: number | bigint = 1,730 tokenId: number, admin: IKeyringPair, owner: CrossAccountId | string, approved: CrossAccountId | string, amount: number | bigint = 1,731) {731) {732 await usingApi(async (api: ApiPromise) => {732 await usingApi(async (api: ApiPromise) => {733 const approveNftTx = api.tx.unique.approve(normalizeAccountId(approved), collectionId, tokenId, amount);733 const approveUniqueTx = api.tx.unique.approve(normalizeAccountId(approved), collectionId, tokenId, amount);734 const events = await submitTransactionAsync(admin, approveNftTx);734 const events = await submitTransactionAsync(admin, approveUniqueTx);735 const result = getGenericResult(events);735 const result = getGenericResult(events);736 expect(result.success).to.be.true;736 expect(result.success).to.be.true;737737920 tokenId: number, owner: IKeyringPair, approved: IKeyringPair, amount: number | bigint = 1,920 tokenId: number, owner: IKeyringPair, approved: IKeyringPair, amount: number | bigint = 1,921) {921) {922 await usingApi(async (api: ApiPromise) => {922 await usingApi(async (api: ApiPromise) => {923 const approveNftTx = api.tx.unique.approve(normalizeAccountId(approved.address), collectionId, tokenId, amount);923 const approveUniqueTx = api.tx.unique.approve(normalizeAccountId(approved.address), collectionId, tokenId, amount);924 const events = await expect(submitTransactionExpectFailAsync(owner, approveNftTx)).to.be.rejected;924 const events = await expect(submitTransactionExpectFailAsync(owner, approveUniqueTx)).to.be.rejected;925 const result = getCreateCollectionResult(events);925 const result = getCreateCollectionResult(events);926 // tslint:disable-next-line:no-unused-expression926 // tslint:disable-next-line:no-unused-expression927 expect(result.success).to.be.false;927 expect(result.success).to.be.false;1212}1212}121312131214export const getDetailedCollectionInfo = async (api: ApiPromise, collectionId: number)1214export const getDetailedCollectionInfo = async (api: ApiPromise, collectionId: number)1215 : Promise<NftDataStructsCollection | null> => {1215 : Promise<UpDataStructsCollection | null> => {1216 return (await api.rpc.unique.collectionById(collectionId)).unwrapOr(null);1216 return (await api.rpc.unique.collectionById(collectionId)).unwrapOr(null);1217};1217};121812181221 return (await api.rpc.unique.collectionStats()).created.toNumber();1221 return (await api.rpc.unique.collectionStats()).created.toNumber();1222};1222};122312231224export async function queryCollectionExpectSuccess(api: ApiPromise, collectionId: number): Promise<NftDataStructsCollection> {1224export async function queryCollectionExpectSuccess(api: ApiPromise, collectionId: number): Promise<UpDataStructsCollection> {1225 return (await api.rpc.unique.collectionById(collectionId)).unwrap();1225 return (await api.rpc.unique.collectionById(collectionId)).unwrap();1226}1226}12271227