import * as _unique_nft_unique_mainnet_types_default from '@unique-nft/unique-mainnet-types/default'; import { UpDataStructsTokenData } from '@unique-nft/unique-mainnet-types/default'; import { KeyringPair } from '@polkadot/keyring/types'; import { InjectedAccountWithMeta } from '@polkadot/extension-inject/types'; declare type ISigner = InjectedAccountWithMeta | KeyringPair; declare type SubAddressObj = { Substrate: string; }; declare type SubAddressObjUncapitalized = { substrate: string; }; declare type EthAddressObj = { Ethereum: string; }; declare type EthAddressObjUncapitalized = { ethereum: string; }; declare type CrossAccountId = SubAddressObj & { Ethereum?: never; } | EthAddressObj & { Substrate?: never; }; declare type CrossAccountIdUncapitalized = SubAddressObjUncapitalized & { ethereum?: never; } | EthAddressObjUncapitalized & { substrate?: never; }; declare type CrossAccountIdOrString = CrossAccountId | string; declare type CrossAccountIdUncapitalizedOrString = CrossAccountIdUncapitalized | string; declare type PropertiesArray = Array<{ key: string; value: string; }>; declare type HumanizedNftToken = { owner: CrossAccountId; properties: PropertiesArray; }; interface TokenPropertyPermission { mutable: boolean; collectionAdmin: boolean; tokenOwner: boolean; } interface TokenPropertyPermissionObject { key: string; permission: TokenPropertyPermission; } interface CollectionParams { name: string; description: string; tokenPrefix: string; mode?: { nft: null; }; access?: 'Normal' | 'AllowList'; limits?: { accountTokenOwnershipLimit?: number | null; ownerCanDestroy?: boolean | null; ownerCanTransfer?: boolean | null; sponsorApproveTimeout?: number | null; sponsorTransferTimeout?: number | null; sponsoredDataRateLimit?: number | null; sponsoredDataSize?: number | null; tokenLimit?: number | null; transfersEnabled?: boolean | null; }; permissions?: { access?: 'Normal' | 'AllowList'; mintMode?: boolean; nesting?: { tokenOwner: boolean; collectionAdmin: boolean; restricted: Array; }; }; tokenPropertyPermissions?: Array; properties?: Array<{ key: string; value: string; }>; } declare type CollectionTokenPropertyPermissions = Required['tokenPropertyPermissions']; declare type CollectionSponsorship = 'Disabled' | { Confirmed: string; } | { Unconfirmed: string; }; declare type InfixOrUrlOrCid = { url: string; urlInfix?: undefined; ipfsCid?: undefined; } | { urlInfix: string; url?: undefined; ipfsCid?: undefined; } | { ipfsCid: string; url?: undefined; urlInfix?: undefined; }; declare type InfixOrUrlOrCidAndHash = InfixOrUrlOrCid & { hash?: string; }; declare const URL_TEMPLATE_INFIX: "{infix}"; declare type UrlTemplateString = `${string}${typeof URL_TEMPLATE_INFIX}${string}`; declare enum AttributeType { integer = "integer", float = "float", boolean = "boolean", timestamp = "timestamp", string = "string", url = "url", isoDate = "isoDate", time = "time", colorRgba = "colorRgba" } declare const NumberAttributeTypes: AttributeType[]; declare const IntegerAttributeTypes: AttributeType[]; declare const StringAttributeTypes: AttributeType[]; declare const AttributeTypeValues: AttributeType[]; declare type BoxedNumberWithDefault = { _: number; }; declare type LocalizedStringWithDefault = { _: string; [K: string]: string; }; declare type LocalizedStringOrBoxedNumberWithDefault = BoxedNumberWithDefault | LocalizedStringWithDefault; interface AttributeSchema { name: LocalizedStringWithDefault; optional?: boolean; isArray?: boolean; type: AttributeType; enumValues?: { [K: number]: LocalizedStringOrBoxedNumberWithDefault; }; } declare type EncodedTokenAttributeValue = number | Array | LocalizedStringOrBoxedNumberWithDefault | LocalizedStringOrBoxedNumberWithDefault[]; interface EncodedTokenAttributes { [K: number]: EncodedTokenAttributeValue; } declare type CollectionAttributesSchema = { [K: number]: AttributeSchema; }; declare enum COLLECTION_SCHEMA_NAME { unique = "unique", old = "_old_", ERC721Metadata = "ERC721Metadata" } interface UniqueCollectionSchemaToCreate { schemaName: COLLECTION_SCHEMA_NAME.unique; schemaVersion: string; coverPicture: InfixOrUrlOrCidAndHash; coverPicturePreview?: InfixOrUrlOrCidAndHash; attributesSchemaVersion?: string; attributesSchema?: CollectionAttributesSchema; image: { urlTemplate: UrlTemplateString; }; imagePreview?: { urlTemplate?: UrlTemplateString; }; video?: { urlTemplate?: UrlTemplateString; }; audio?: { urlTemplate?: UrlTemplateString; format: string; isLossless?: boolean; }; spatialObject?: { urlTemplate?: UrlTemplateString; format: string; }; } declare type UniqueCollectionSchemaDecoded = Omit & { schemaName: COLLECTION_SCHEMA_NAME; collectionId: number; coverPicture: DecodedInfixOrUrlOrCidAndHash; coverPicturePreview?: DecodedInfixOrUrlOrCidAndHash; oldProperties?: { _old_schemaVersion?: string; _old_offchainSchema?: string; _old_constOnChainSchema?: string; _old_variableOnChainSchema?: string; }; }; interface IToken { name?: LocalizedStringWithDefault; description?: LocalizedStringWithDefault; image: GenericInfixUrlOrCidWithHash; imagePreview?: GenericInfixUrlOrCidWithHash; video?: GenericInfixUrlOrCidWithHash; audio?: GenericInfixUrlOrCidWithHash; spatialObject?: GenericInfixUrlOrCidWithHash; } interface UniqueTokenToCreate extends IToken { encodedAttributes?: EncodedTokenAttributes; } declare type DecodedAttributes = { [K: number]: { name: LocalizedStringWithDefault; value: LocalizedStringOrBoxedNumberWithDefault | Array; type: AttributeType; isArray: boolean; rawValue: EncodedTokenAttributeValue | string | Array; isEnum: boolean; }; }; declare type DecodedInfixOrUrlOrCidAndHash = InfixOrUrlOrCidAndHash & { fullUrl: string | null; }; interface UniqueTokenDecoded extends IToken { tokenId: number; collectionId: number; owner: CrossAccountId; nestingParentToken?: { collectionId: number; tokenId: number; }; attributes: DecodedAttributes; } declare type DecodingImageLinkOptions = { imageUrlTemplate?: UrlTemplateString; dummyImageFullUrl?: string; }; type types_InfixOrUrlOrCid = InfixOrUrlOrCid; type types_InfixOrUrlOrCidAndHash = InfixOrUrlOrCidAndHash; declare const types_URL_TEMPLATE_INFIX: typeof URL_TEMPLATE_INFIX; type types_UrlTemplateString = UrlTemplateString; type types_AttributeType = AttributeType; declare const types_AttributeType: typeof AttributeType; declare const types_NumberAttributeTypes: typeof NumberAttributeTypes; declare const types_IntegerAttributeTypes: typeof IntegerAttributeTypes; declare const types_StringAttributeTypes: typeof StringAttributeTypes; declare const types_AttributeTypeValues: typeof AttributeTypeValues; type types_BoxedNumberWithDefault = BoxedNumberWithDefault; type types_LocalizedStringWithDefault = LocalizedStringWithDefault; type types_LocalizedStringOrBoxedNumberWithDefault = LocalizedStringOrBoxedNumberWithDefault; type types_AttributeSchema = AttributeSchema; type types_EncodedTokenAttributeValue = EncodedTokenAttributeValue; type types_EncodedTokenAttributes = EncodedTokenAttributes; type types_CollectionAttributesSchema = CollectionAttributesSchema; type types_COLLECTION_SCHEMA_NAME = COLLECTION_SCHEMA_NAME; declare const types_COLLECTION_SCHEMA_NAME: typeof COLLECTION_SCHEMA_NAME; type types_UniqueCollectionSchemaToCreate = UniqueCollectionSchemaToCreate; type types_UniqueCollectionSchemaDecoded = UniqueCollectionSchemaDecoded; type types_UniqueTokenToCreate = UniqueTokenToCreate; type types_DecodedAttributes = DecodedAttributes; type types_DecodedInfixOrUrlOrCidAndHash = DecodedInfixOrUrlOrCidAndHash; type types_UniqueTokenDecoded = UniqueTokenDecoded; type types_DecodingImageLinkOptions = DecodingImageLinkOptions; declare namespace types { export { types_InfixOrUrlOrCid as InfixOrUrlOrCid, types_InfixOrUrlOrCidAndHash as InfixOrUrlOrCidAndHash, types_URL_TEMPLATE_INFIX as URL_TEMPLATE_INFIX, types_UrlTemplateString as UrlTemplateString, types_AttributeType as AttributeType, types_NumberAttributeTypes as NumberAttributeTypes, types_IntegerAttributeTypes as IntegerAttributeTypes, types_StringAttributeTypes as StringAttributeTypes, types_AttributeTypeValues as AttributeTypeValues, types_BoxedNumberWithDefault as BoxedNumberWithDefault, types_LocalizedStringWithDefault as LocalizedStringWithDefault, types_LocalizedStringOrBoxedNumberWithDefault as LocalizedStringOrBoxedNumberWithDefault, types_AttributeSchema as AttributeSchema, types_EncodedTokenAttributeValue as EncodedTokenAttributeValue, types_EncodedTokenAttributes as EncodedTokenAttributes, types_CollectionAttributesSchema as CollectionAttributesSchema, types_COLLECTION_SCHEMA_NAME as COLLECTION_SCHEMA_NAME, types_UniqueCollectionSchemaToCreate as UniqueCollectionSchemaToCreate, types_UniqueCollectionSchemaDecoded as UniqueCollectionSchemaDecoded, types_UniqueTokenToCreate as UniqueTokenToCreate, types_DecodedAttributes as DecodedAttributes, types_DecodedInfixOrUrlOrCidAndHash as DecodedInfixOrUrlOrCidAndHash, types_UniqueTokenDecoded as UniqueTokenDecoded, types_DecodingImageLinkOptions as DecodingImageLinkOptions, }; } declare type DecodingResult = { result: T; error: null; } | { result: null; error: Error; }; declare class Semver { protected _major: number; protected _minor: number; protected _patch: number; constructor(semver: [number, number, number]); get major(): number; get minor(): number; get patch(): number; toString(): string; private static parseToArray; static fromString(version: string): Semver; static isValid(version: string): boolean; isGteThan(version: string): boolean; isLessThan(version: string): boolean; isEqual(version: string): boolean; } declare const isPlainObject: (obj: any, varName: string) => obj is Object; declare const validateNumber: (num: any, shouldBeInteger: boolean, varName: string) => num is number; declare const validateAttributeKey: (num: string | number | symbol, varName: string) => boolean; declare const validateURL: (url: string, varName: string) => boolean; declare const validateAndParseSemverString: (str: string, varName: string) => Semver; declare const validateLocalizedStringWithDefault: (dict: any, canHaveLocalization: boolean, varName: string) => dict is LocalizedStringWithDefault; declare const validateBoxedNumberWithDefault: (dict: BoxedNumberWithDefault, shouldBeInteger: boolean, varName: string) => dict is BoxedNumberWithDefault; declare const validateUrlTemplateString: (str: any, varName: string) => str is `${string}{infix}${string}`; declare const validateUrlWithHashObject: (obj: any, varName: string) => obj is InfixOrUrlOrCidAndHash; declare const validateFieldByType: (obj: T, key: keyof T, type: string, optional: boolean, varName: string) => boolean; declare const validateSingleTokenPropertyPermission: (tpp: any, varName: string) => tpp is TokenPropertyPermissionObject; declare const checkSafeFactory: any>(fn: T) => T; declare const validateUrlTemplateStringSafe: (str: any, varName: string) => str is `${string}{infix}${string}`; declare const validateURLSafe: (url: string, varName: string) => boolean; declare const validateLocalizedStringWithDefaultSafe: (dict: any, canHaveLocalization: boolean, varName: string) => dict is LocalizedStringWithDefault; declare const validateValueVsAttributeType: (value: any, type: AttributeType, varName: string) => value is AttributeType; declare const validateAttributesSchemaSingleAttribute: (attr: AttributeSchema, varName: string) => attr is AttributeSchema; declare const validateCollectionAttributesSchema: (attributes: any, varName: string) => attributes is CollectionAttributesSchema; declare const validateUniqueCollectionSchema: (schema: any) => schema is C; declare const validateCollectionTokenPropertyPermissions: (tpps: any, varName?: string) => tpps is TokenPropertyPermissionObject[]; declare const validateUniqueToken: (token: any, collectionSchema: C) => token is T; declare const RGB_REGEX: RegExp; declare const RGBA_REGEX: RegExp; declare const LANG_REGEX: RegExp; declare const validators_isPlainObject: typeof isPlainObject; declare const validators_validateNumber: typeof validateNumber; declare const validators_validateAttributeKey: typeof validateAttributeKey; declare const validators_validateURL: typeof validateURL; declare const validators_validateAndParseSemverString: typeof validateAndParseSemverString; declare const validators_validateLocalizedStringWithDefault: typeof validateLocalizedStringWithDefault; declare const validators_validateBoxedNumberWithDefault: typeof validateBoxedNumberWithDefault; declare const validators_validateUrlTemplateString: typeof validateUrlTemplateString; declare const validators_validateUrlWithHashObject: typeof validateUrlWithHashObject; declare const validators_validateFieldByType: typeof validateFieldByType; declare const validators_validateSingleTokenPropertyPermission: typeof validateSingleTokenPropertyPermission; declare const validators_checkSafeFactory: typeof checkSafeFactory; declare const validators_validateUrlTemplateStringSafe: typeof validateUrlTemplateStringSafe; declare const validators_validateURLSafe: typeof validateURLSafe; declare const validators_validateLocalizedStringWithDefaultSafe: typeof validateLocalizedStringWithDefaultSafe; declare const validators_validateValueVsAttributeType: typeof validateValueVsAttributeType; declare const validators_validateAttributesSchemaSingleAttribute: typeof validateAttributesSchemaSingleAttribute; declare const validators_validateCollectionAttributesSchema: typeof validateCollectionAttributesSchema; declare const validators_validateUniqueCollectionSchema: typeof validateUniqueCollectionSchema; declare const validators_validateCollectionTokenPropertyPermissions: typeof validateCollectionTokenPropertyPermissions; declare const validators_validateUniqueToken: typeof validateUniqueToken; declare const validators_RGB_REGEX: typeof RGB_REGEX; declare const validators_RGBA_REGEX: typeof RGBA_REGEX; declare const validators_LANG_REGEX: typeof LANG_REGEX; declare namespace validators { export { validators_isPlainObject as isPlainObject, validators_validateNumber as validateNumber, validators_validateAttributeKey as validateAttributeKey, validators_validateURL as validateURL, validators_validateAndParseSemverString as validateAndParseSemverString, validators_validateLocalizedStringWithDefault as validateLocalizedStringWithDefault, validators_validateBoxedNumberWithDefault as validateBoxedNumberWithDefault, validators_validateUrlTemplateString as validateUrlTemplateString, validators_validateUrlWithHashObject as validateUrlWithHashObject, validators_validateFieldByType as validateFieldByType, validators_validateSingleTokenPropertyPermission as validateSingleTokenPropertyPermission, validators_checkSafeFactory as checkSafeFactory, validators_validateUrlTemplateStringSafe as validateUrlTemplateStringSafe, validators_validateURLSafe as validateURLSafe, validators_validateLocalizedStringWithDefaultSafe as validateLocalizedStringWithDefaultSafe, validators_validateValueVsAttributeType as validateValueVsAttributeType, validators_validateAttributesSchemaSingleAttribute as validateAttributesSchemaSingleAttribute, validators_validateCollectionAttributesSchema as validateCollectionAttributesSchema, validators_validateUniqueCollectionSchema as validateUniqueCollectionSchema, validators_validateCollectionTokenPropertyPermissions as validateCollectionTokenPropertyPermissions, validators_validateUniqueToken as validateUniqueToken, validators_RGB_REGEX as RGB_REGEX, validators_RGBA_REGEX as RGBA_REGEX, validators_LANG_REGEX as LANG_REGEX, }; } declare const encodeCollectionSchemaToProperties: (schema: UniqueCollectionSchemaToCreate) => { key: string; value: string; }[]; declare const unpackCollectionSchemaFromProperties: (properties: PropertiesArray) => any; declare const decodeUniqueCollectionFromProperties: (collectionId: number, properties: { key: string; value: string; }[]) => Promise>; interface ICollectionSchemaToTokenPropertyPermissionsOptions { overwriteTPPs?: CollectionTokenPropertyPermissions; } declare const generateTokenPropertyPermissionsFromCollectionSchema: (schema: UniqueCollectionSchemaToCreate, options?: ICollectionSchemaToTokenPropertyPermissionsOptions) => TokenPropertyPermissionObject[]; declare const collection_encodeCollectionSchemaToProperties: typeof encodeCollectionSchemaToProperties; declare const collection_unpackCollectionSchemaFromProperties: typeof unpackCollectionSchemaFromProperties; declare const collection_decodeUniqueCollectionFromProperties: typeof decodeUniqueCollectionFromProperties; type collection_ICollectionSchemaToTokenPropertyPermissionsOptions = ICollectionSchemaToTokenPropertyPermissionsOptions; declare const collection_generateTokenPropertyPermissionsFromCollectionSchema: typeof generateTokenPropertyPermissionsFromCollectionSchema; declare namespace collection { export { collection_encodeCollectionSchemaToProperties as encodeCollectionSchemaToProperties, collection_unpackCollectionSchemaFromProperties as unpackCollectionSchemaFromProperties, collection_decodeUniqueCollectionFromProperties as decodeUniqueCollectionFromProperties, collection_ICollectionSchemaToTokenPropertyPermissionsOptions as ICollectionSchemaToTokenPropertyPermissionsOptions, collection_generateTokenPropertyPermissionsFromCollectionSchema as generateTokenPropertyPermissionsFromCollectionSchema, }; } declare const encodeTokenToProperties: (token: UniqueTokenToCreate, schema: UniqueCollectionSchemaToCreate | UniqueCollectionSchemaDecoded) => PropertiesArray; declare const unpackEncodedTokenFromProperties: (properties: { key: string; value: string; }[], schema: UniqueCollectionSchemaToCreate | UniqueCollectionSchemaDecoded) => T; declare const decodeTokenFromProperties: (collectionId: number, tokenId: number, rawToken: HumanizedNftToken, schema: UniqueCollectionSchemaToCreate | UniqueCollectionSchemaDecoded) => Promise>; declare const fullDecodeTokenAttributes: (token: UniqueTokenToCreate, collectionSchema: UniqueCollectionSchemaToCreate | UniqueCollectionSchemaDecoded) => DecodedAttributes; declare const token_encodeTokenToProperties: typeof encodeTokenToProperties; declare const token_unpackEncodedTokenFromProperties: typeof unpackEncodedTokenFromProperties; declare const token_decodeTokenFromProperties: typeof decodeTokenFromProperties; declare const token_fullDecodeTokenAttributes: typeof fullDecodeTokenAttributes; declare namespace token { export { token_encodeTokenToProperties as encodeTokenToProperties, token_unpackEncodedTokenFromProperties as unpackEncodedTokenFromProperties, token_decodeTokenFromProperties as decodeTokenFromProperties, token_fullDecodeTokenAttributes as fullDecodeTokenAttributes, }; } declare const decodeOldSchemaCollection: (collectionId: number, properties: { key: string; value: string; }[], options: Required) => Promise>; declare const decodeOldSchemaToken: (collectionId: number, tokenId: number, rawToken: { owner: any; properties: any[]; }, schema: UniqueCollectionSchemaDecoded, options: Required) => Promise>; declare const oldSchema_decodeOldSchemaCollection: typeof decodeOldSchemaCollection; declare const oldSchema_decodeOldSchemaToken: typeof decodeOldSchemaToken; declare namespace oldSchema { export { oldSchema_decodeOldSchemaCollection as decodeOldSchemaCollection, oldSchema_decodeOldSchemaToken as decodeOldSchemaToken, }; } declare const universallyDecodeCollectionSchema: (collectionId: number, properties: PropertiesArray, options?: DecodingImageLinkOptions) => Promise>; declare const universallyDecodeToken: (collectionId: number, tokenId: number, rawToken: UpDataStructsTokenData, schema: UniqueCollectionSchemaDecoded, options?: DecodingImageLinkOptions) => Promise>; declare const universal_universallyDecodeCollectionSchema: typeof universallyDecodeCollectionSchema; declare const universal_universallyDecodeToken: typeof universallyDecodeToken; declare namespace universal { export { universal_universallyDecodeCollectionSchema as universallyDecodeCollectionSchema, universal_universallyDecodeToken as universallyDecodeToken, }; } declare const SchemaTools: { decode: { collectionSchema: (collectionId: number, properties: PropertiesArray, options?: DecodingImageLinkOptions | undefined) => Promise>; token: (collectionId: number, tokenId: number, rawToken: _unique_nft_unique_mainnet_types_default.UpDataStructsTokenData, schema: UniqueCollectionSchemaDecoded, options?: DecodingImageLinkOptions | undefined) => Promise>; }; encodeUnique: { collectionSchema: (schema: UniqueCollectionSchemaToCreate) => { key: string; value: string; }[]; collectionTokenPropertyPermissions: (schema: UniqueCollectionSchemaToCreate, options?: ICollectionSchemaToTokenPropertyPermissionsOptions | undefined) => TokenPropertyPermissionObject[]; token: (token: UniqueTokenToCreate, schema: UniqueCollectionSchemaToCreate | UniqueCollectionSchemaDecoded) => PropertiesArray; }; tools: { unique: { collection: typeof collection; token: typeof token; validators: typeof validators; }; oldSchema: typeof oldSchema; universal: typeof universal; }; types: typeof types; }; export { AttributeType as A, BoxedNumberWithDefault as B, CrossAccountId as C, DecodedAttributes as D, EthAddressObj as E, HumanizedNftToken as H, ISigner as I, LocalizedStringWithDefault as L, NumberAttributeTypes as N, PropertiesArray as P, SubAddressObj as S, TokenPropertyPermissionObject as T, UniqueCollectionSchemaDecoded as U, CrossAccountIdUncapitalized as a, SubAddressObjUncapitalized as b, EthAddressObjUncapitalized as c, CollectionParams as d, CollectionSponsorship as e, UniqueTokenDecoded as f, SchemaTools as g, CrossAccountIdOrString as h, CrossAccountIdUncapitalizedOrString as i, InfixOrUrlOrCid as j, InfixOrUrlOrCidAndHash as k, URL_TEMPLATE_INFIX as l, UrlTemplateString as m, IntegerAttributeTypes as n, StringAttributeTypes as o, AttributeTypeValues as p, LocalizedStringOrBoxedNumberWithDefault as q, AttributeSchema as r, EncodedTokenAttributeValue as s, EncodedTokenAttributes as t, CollectionAttributesSchema as u, COLLECTION_SCHEMA_NAME as v, UniqueCollectionSchemaToCreate as w, UniqueTokenToCreate as x, DecodedInfixOrUrlOrCidAndHash as y, DecodingImageLinkOptions as z };