1234import {IKeyringPair} from '@polkadot/types/types';5import config from '../../config';6import '../../interfaces/augment-api-events';7import {DevUniqueHelper, SilentLogger, SilentConsole} from './unique.dev';8910export const usingPlaygrounds = async (code: (helper: DevUniqueHelper, privateKey: (seed: string) => IKeyringPair) => Promise<void>) => {11 const silentConsole = new SilentConsole();12 silentConsole.enable();1314 const helper = new DevUniqueHelper(new SilentLogger());1516 try {17 await helper.connect(config.substrateUrl);18 const ss58Format = helper.chain.getChainProperties().ss58Format;19 const privateKey = (seed: string) => helper.util.fromSeed(seed, ss58Format);20 await code(helper, privateKey);21 }22 finally {23 await helper.disconnect();24 silentConsole.disable();25 }26};