difftreelog
move types and interfaces to types.ts
in: master
3 files changed
tests/src/util/playgrounds/types.tsdiffbeforeafterbothno changes
tests/src/util/playgrounds/unique.dev.tsdiffbeforeafterboth334import {mnemonicGenerate} from '@polkadot/util-crypto';4import {mnemonicGenerate} from '@polkadot/util-crypto';5import {UniqueHelper} from './unique';5import {UniqueHelper} from './unique';6import {IKeyringPair} from '@polkadot/types/types';7import {ApiPromise, WsProvider} from '@polkadot/api';6import {ApiPromise, WsProvider} from '@polkadot/api';8import * as defs from '../../interfaces/definitions';7import * as defs from '../../interfaces/definitions';8import { TSigner } from './types';99101011export class DevUniqueHelper extends UniqueHelper {11export class DevUniqueHelper extends UniqueHelper {69 * @returns array of newly created accounts69 * @returns array of newly created accounts70 * @example const [acc1, acc2, acc3] = await createAccounts([0n, 10n, 20n], donor); 70 * @example const [acc1, acc2, acc3] = await createAccounts([0n, 10n, 20n], donor); 71 */71 */72 creteAccounts = async (balances: bigint[], donor: IKeyringPair): Promise<IKeyringPair[]> => {72 creteAccounts = async (balances: bigint[], donor: TSigner): Promise<TSigner[]> => {73 let nonce = await this.helper.chain.getNonce(donor.address);73 let nonce = await this.helper.chain.getNonce(donor.address);74 const tokenNominal = this.helper.balance.getOneTokenNominal();74 const tokenNominal = this.helper.balance.getOneTokenNominal();75 const transactions = [];75 const transactions = [];tests/src/util/playgrounds/unique.tsdiffbeforeafterboth9import {ApiInterfaceEvents} from '@polkadot/api/types';9import {ApiInterfaceEvents} from '@polkadot/api/types';10import {IKeyringPair} from '@polkadot/types/types';10import {IKeyringPair} from '@polkadot/types/types';11import {encodeAddress, decodeAddress, keccakAsHex, evmToAddress, addressToEvm} from '@polkadot/util-crypto';11import {encodeAddress, decodeAddress, keccakAsHex, evmToAddress, addressToEvm} from '@polkadot/util-crypto';12import { ICrossAccountIdLower, ICrossAccountId, TUniqueNetworks, IApiListeners, TApiAllowedListeners, TSigner, TSubstrateAccount, ICollectionLimits, ICollectionPermissions, INestingPermissions, IProperty, ITokenPropertyPermission, ICollectionCreationOptions, IToken, IChainProperties, TEthereumAccount } from './types';1213131414const crossAccountIdFromLower = (lowerAddress: ICrossAccountIdLower): ICrossAccountId => {15const crossAccountIdFromLower = (lowerAddress: ICrossAccountIdLower): ICrossAccountId => {82 events?: any;83 events?: any;83}84}8485interface IApiListeners {86 connected?: (...args: any[]) => any;87 disconnected?: (...args: any[]) => any;88 error?: (...args: any[]) => any;89 ready?: (...args: any[]) => any; 90 decorated?: (...args: any[]) => any;91}9293interface ICrossAccountId {94 Substrate?: TSubstrateAccount;95 Ethereum?: TEthereumAccount;96}9798interface ICrossAccountIdLower {99 substrate?: TSubstrateAccount;100 ethereum?: TEthereumAccount;101}102103interface ICollectionLimits {104 accountTokenOwnershipLimit?: number | null;105 sponsoredDataSize?: number | null;106 sponsoredDataRateLimit?: {blocks: number} | {sponsoringDisabled: null} | null;107 tokenLimit?: number | null;108 sponsorTransferTimeout?: number | null;109 sponsorApproveTimeout?: number | null;110 ownerCanTransfer?: boolean | null;111 ownerCanDestroy?: boolean | null;112 transfersEnabled?: boolean | null;113}114115interface INestingPermissions {116 tokenOwner?: boolean;117 collectionAdmin?: boolean;118 restricted?: number[] | null;119}120121interface ICollectionPermissions {122 access?: 'Normal' | 'AllowList';123 mintMode?: boolean;124 nesting?: INestingPermissions;125}126127interface IProperty {128 key: string;129 value: string;130}131132interface ITokenPropertyPermission {133 key: string;134 permission: {135 mutable: boolean;136 tokenOwner: boolean;137 collectionAdmin: boolean;138 }139}140141interface IToken {142 collectionId: number;143 tokenId: number;144}145146interface ICollectionCreationOptions {147 name: string | number[];148 description: string | number[];149 tokenPrefix: string | number[];150 mode?: {151 nft?: null;152 refungible?: null;153 fungible?: number;154 }155 permissions?: ICollectionPermissions;156 properties?: IProperty[];157 tokenPropertyPermissions?: ITokenPropertyPermission[];158 limits?: ICollectionLimits;159 pendingSponsor?: TSubstrateAccount;160}161162interface IChainProperties {163 ss58Format: number;164 tokenDecimals: number[];165 tokenSymbol: string[]166}167168type TSubstrateAccount = string;169type TEthereumAccount = string;170type TApiAllowedListeners = 'connected' | 'disconnected' | 'error' | 'ready' | 'decorated';171type TUniqueNetworks = 'opal' | 'quartz' | 'unique';172type TSigner = IKeyringPair; // | 'string'17385174class UniqueUtil {86class UniqueUtil {175 static transactionStatus = {87 static transactionStatus = {