git.delta.rocks / unique-network / refs/commits / 0fae602fb292

difftreelog

fix foreign-assets related docs

Daniel Shiposha2023-10-25parent: #68c3995.patch.diff
in: master

5 files changed

modifiedjs-packages/playgrounds/types.tsdiffbeforeafterboth
after · js-packages/playgrounds/types.ts
1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.2// SPDX-License-Identifier: Apache-2.034import type {IKeyringPair} from '@polkadot/types/types';56export const NON_EXISTENT_COLLECTION_ID = 4_294_967_295;78export const MILLISECS_PER_BLOCK = 12000;9export const MINUTES = 60_000 / MILLISECS_PER_BLOCK;10export const HOURS = MINUTES * 60;11export const DAYS = HOURS * 24;1213export interface IEvent {14  section: string;15  method: string;16  index: [number, number] | string;17  data: any[];18  phase: {applyExtrinsic: number} | 'Initialization',19}2021export interface IPhasicEvent {22  phase: any, // {ApplyExtrinsic: number} | 'Initialization',23  event: IEvent;24}2526export interface ITransactionResult {27  status: 'Fail' | 'Success';28  result: {29      dispatchError: any,30      events: IPhasicEvent[];31  },32  blockHash: string,33  moduleError?: string | object;34}3536export interface ISubscribeBlockEventsData {37  number: number;38  hash: string;39  timestamp: number;40  events: IEvent[];41}4243export interface ILogger {44  log: (msg: any, level?: string) => void;45  level: {46    ERROR: 'ERROR';47    WARNING: 'WARNING';48    INFO: 'INFO';49    [key: string]: string;50  }51}5253export interface IUniqueHelperLog {54  executedAt: number;55  executionTime: number;56  type: 'extrinsic' | 'rpc';57  status: 'Fail' | 'Success';58  call: string;59  params: any[];60  moduleError?: string;61  dispatchError?: any;62  events?: any;63}6465export interface IApiListeners {66  connected?: (...args: any[]) => any;67  disconnected?: (...args: any[]) => any;68  error?: (...args: any[]) => any;69  ready?: (...args: any[]) => any;70  decorated?: (...args: any[]) => any;71}7273export type ICrossAccountId = {74  Substrate: TSubstrateAccount;75} | {76  Ethereum: TEthereumAccount;77}7879export type ICrossAccountIdLower = {80  substrate: TSubstrateAccount;81} | {82  ethereum: TEthereumAccount;83};8485export interface IEthCrossAccountId {86  0: TEthereumAccount;87  1: TSubstrateAccount;88  eth: TEthereumAccount;89  sub: TSubstrateAccount;90}9192export interface ICollectionLimits {93  accountTokenOwnershipLimit?: number | null;94  sponsoredDataSize?: number | null;95  sponsoredDataRateLimit?: {blocks: number} | {sponsoringDisabled: null} | null;96  tokenLimit?: number | null;97  sponsorTransferTimeout?: number | null;98  sponsorApproveTimeout?: number | null;99  ownerCanTransfer?: boolean | null;100  ownerCanDestroy?: boolean | null;101  transfersEnabled?: boolean | null;102}103104export interface INestingPermissions {105  tokenOwner?: boolean;106  collectionAdmin?: boolean;107  restricted?: number[] | null;108}109110export interface ICollectionPermissions {111  access?: 'Normal' | 'AllowList';112  mintMode?: boolean;113  nesting?: INestingPermissions;114}115116export interface IProperty {117  key: string;118  value?: string;119}120121export interface ITokenPropertyPermission {122  key: string;123  permission: {124    mutable?: boolean;125    tokenOwner?: boolean;126    collectionAdmin?: boolean;127  }128}129130export interface IToken {131  collectionId: number;132  tokenId: number;133}134135export interface IBlock {136  extrinsics: IExtrinsic[]137  header: {138    parentHash: string,139    number: number,140  };141}142143export interface IExtrinsic {144  isSigned: boolean,145  method: {146    method: string,147    section: string,148    args: any[]149  }150}151152export interface ICollectionFlags {153  foreign: boolean,154  erc721metadata: boolean,155}156157export enum CollectionFlag {158  None = 0,159  /// External collections can't be managed using `unique` api160  External = 1,161  /// Supports ERC721Metadata162  Erc721metadata = 64,163  /// A collection of foreign assets164  Foreign = 128,165}166167export interface ICollectionCreationOptions {168  name?: string | number[];169  description?: string | number[];170  tokenPrefix?: string | number[];171  mode?: {172    nft?: null;173    refungible?: null;174    fungible?: number;175  }176  permissions?: ICollectionPermissions;177  properties?: IProperty[];178  tokenPropertyPermissions?: ITokenPropertyPermission[];179  limits?: ICollectionLimits;180  pendingSponsor?: ICrossAccountId;181  adminList?: ICrossAccountId[];182  flags?: number[] | CollectionFlag[] ,183}184185export interface IChainProperties {186  ss58Format: number;187  tokenDecimals: number[];188  tokenSymbol: string[]189}190191export interface ISubstrateBalance {192  free: bigint,193  reserved: bigint,194  frozen: bigint,195}196197export interface IStakingInfo {198  block: bigint,199  amount: bigint,200}201202export interface IPovInfo {203  proofSize: number,204  compactProofSize: number,205  compressedProofSize: number,206  results: any[],207  kv: any,208}209210export interface ISchedulerOptions {211  scheduledId?: string,212  priority?: number,213  periodic?: {214    period: number,215    repetitions: number,216  },217}218219export interface DemocracySplitAccount {220  aye: bigint,221  nay: bigint,222}223224export type TSubstrateAccount = string;225export type TEthereumAccount = string;226export type TApiAllowedListeners = 'connected' | 'disconnected' | 'error' | 'ready' | 'decorated';227export type TUniqueNetworks = 'opal' | 'quartz' | 'unique';228export type TSiblingNetworkds = 'moonbeam' | 'moonriver' | 'acala' | 'karura' | 'westmint';229export type TRelayNetworks = 'rococo' | 'westend';230export type TNetworks = TUniqueNetworks | TSiblingNetworkds | TRelayNetworks;231export type TSigner = IKeyringPair; // | 'string'232export type TCollectionMode = 'nft' | 'rft' | 'ft';
modifiedjs-packages/tests/eth/api/CollectionHelpers.soldiffbeforeafterboth
--- a/js-packages/tests/eth/api/CollectionHelpers.sol
+++ b/js-packages/tests/eth/api/CollectionHelpers.sol
@@ -132,7 +132,7 @@
 type CollectionFlags is uint8;
 
 library CollectionFlagsLib {
-	/// Tokens in foreign collections can be transferred, but not burnt
+	/// A collection of foreign assets
 	CollectionFlags constant foreignField = CollectionFlags.wrap(128);
 	/// Supports ERC721Metadata
 	CollectionFlags constant erc721metadataField = CollectionFlags.wrap(64);
modifiedpallets/foreign-assets/src/lib.rsdiffbeforeafterboth
--- a/pallets/foreign-assets/src/lib.rs
+++ b/pallets/foreign-assets/src/lib.rs
@@ -259,7 +259,7 @@
 		}
 	}
 
-	/// Converts a multiasset to a Unique Network's collection (either local or the foreign one).
+	/// Converts a multiasset to a Unique Network's collection (either local or a foreign one).
 	///
 	/// The function will try to convert the multiasset's reserve location
 	/// to the Unique Network's local collection.
@@ -385,8 +385,6 @@
 	/// Withdraws an asset instance from the `from` account.
 	///
 	/// Transfers the asset instance to the pallet's account.
-	///
-	/// Won't withdraw the instance if it has children.
 	fn withdraw_asset_instance(
 		xcm_ext: &dyn XcmExtensions<T>,
 		collection_id: CollectionId,
modifiedpallets/unique/src/eth/stubs/CollectionHelpers.soldiffbeforeafterboth
--- a/pallets/unique/src/eth/stubs/CollectionHelpers.sol
+++ b/pallets/unique/src/eth/stubs/CollectionHelpers.sol
@@ -199,7 +199,7 @@
 type CollectionFlags is uint8;
 
 library CollectionFlagsLib {
-	/// Tokens in foreign collections can be transferred, but not burnt
+	/// A collection of foreign assets
 	CollectionFlags constant foreignField = CollectionFlags.wrap(128);
 	/// Supports ERC721Metadata
 	CollectionFlags constant erc721metadataField = CollectionFlags.wrap(64);
modifiedprimitives/data-structs/src/lib.rsdiffbeforeafterboth
--- a/primitives/data-structs/src/lib.rs
+++ b/primitives/data-structs/src/lib.rs
@@ -378,7 +378,7 @@
 #[derive(AbiCoderFlags, Bitfields, Clone, Copy, PartialEq, Eq, Debug, Default)]
 #[bondrewd(enforce_bytes = 1)]
 pub struct CollectionFlags {
-	/// Reserved flag
+	/// A collection of foreign assets
 	#[bondrewd(bits = "0..1")]
 	pub foreign: bool,
 	/// Supports ERC721Metadata