difftreelog
feat add foreignAssets to playgrnds
in: master
2 files changed
tests/src/util/playgrounds/types.tsdiffbeforeafterboth--- a/tests/src/util/playgrounds/types.ts
+++ b/tests/src/util/playgrounds/types.ts
@@ -172,6 +172,13 @@
},
}
+export interface IForeignAssetMetadata {
+ name?: number | Uint8Array,
+ symbol?: string,
+ decimals?: number,
+ minimalBalance?: bigint,
+}
+
export type TSubstrateAccount = string;
export type TEthereumAccount = string;
export type TApiAllowedListeners = 'connected' | 'disconnected' | 'error' | 'ready' | 'decorated';
tests/src/util/playgrounds/unique.tsdiffbeforeafterboth9import {ApiInterfaceEvents, SignerOptions} from '@polkadot/api/types';9import {ApiInterfaceEvents, SignerOptions} from '@polkadot/api/types';10import {encodeAddress, decodeAddress, keccakAsHex, evmToAddress, addressToEvm} from '@polkadot/util-crypto';10import {encodeAddress, decodeAddress, keccakAsHex, evmToAddress, addressToEvm} from '@polkadot/util-crypto';11import {IKeyringPair} from '@polkadot/types/types';11import {IKeyringPair} from '@polkadot/types/types';12import {IApiListeners, IBlock, IEvent, IChainProperties, ICollectionCreationOptions, ICollectionLimits, ICollectionPermissions, ICrossAccountId, ICrossAccountIdLower, ILogger, INestingPermissions, IProperty, IStakingInfo, ISchedulerOptions, ISubstrateBalance, IToken, ITokenPropertyPermission, ITransactionResult, IUniqueHelperLog, TApiAllowedListeners, TEthereumAccount, TSigner, TSubstrateAccount, TUniqueNetworks} from './types';12import {IApiListeners, IBlock, IEvent, IChainProperties, ICollectionCreationOptions, ICollectionLimits, ICollectionPermissions, ICrossAccountId, ICrossAccountIdLower, ILogger, INestingPermissions, IProperty, IStakingInfo, ISchedulerOptions, ISubstrateBalance, IToken, ITokenPropertyPermission, ITransactionResult, IUniqueHelperLog, TApiAllowedListeners, TEthereumAccount, TSigner, TSubstrateAccount, TUniqueNetworks, IForeignAssetMetadata} from './types';131314export class CrossAccountId implements ICrossAccountId {14export class CrossAccountId implements ICrossAccountId {15 Substrate?: TSubstrateAccount;15 Substrate?: TSubstrateAccount;2314 }2314 }2315}2315}23162317class ForeignAssetsGroup extends HelperGroup {2318 constructor(helper: UniqueHelper) {2319 super(helper);2320 }23212322 async register(signer: TSigner, ownerAddress: TSubstrateAccount, location: any, metadata: IForeignAssetMetadata) {2323 await this.helper.executeExtrinsic(2324 signer,2325 'api.tx.foreignAssets.registerForeignAsset',2326 [ownerAddress, location, metadata],2327 true,2328 );2329 }23302331 async update(signer: TSigner, foreignAssetId: number, location: any, metadata: IForeignAssetMetadata) {2332 await this.helper.executeExtrinsic(2333 signer,2334 'api.tx.foreignAssets.updateForeignAsset',2335 [foreignAssetId, location, metadata],2336 true,2337 );2338 }2339}231623402317export type UniqueHelperConstructor = new(...args: any[]) => UniqueHelper;2341export type UniqueHelperConstructor = new(...args: any[]) => UniqueHelper;231823422328 ft: FTGroup;2352 ft: FTGroup;2329 staking: StakingGroup;2353 staking: StakingGroup;2330 scheduler: SchedulerGroup;2354 scheduler: SchedulerGroup;2355 foreignAssets: ForeignAssetsGroup;233123562332 constructor(logger?: ILogger, options: {[key: string]: any} = {}) {2357 constructor(logger?: ILogger, options: {[key: string]: any} = {}) {2333 super(logger);2358 super(logger);2343 this.ft = new FTGroup(this);2368 this.ft = new FTGroup(this);2344 this.staking = new StakingGroup(this);2369 this.staking = new StakingGroup(this);2345 this.scheduler = new SchedulerGroup(this);2370 this.scheduler = new SchedulerGroup(this);2371 this.foreignAssets = new ForeignAssetsGroup(this);2346 }2372 }234723732348 clone(helperCls: UniqueHelperConstructor, options: {[key: string]: any} = {}) {2374 clone(helperCls: UniqueHelperConstructor, options: {[key: string]: any} = {}) {