diff --git a/src/createXcmTypes/ParaToPara.ts b/src/createXcmTypes/ParaToPara.ts index 25af862d..c23eb53f 100644 --- a/src/createXcmTypes/ParaToPara.ts +++ b/src/createXcmTypes/ParaToPara.ts @@ -2,11 +2,7 @@ import type { ApiPromise } from '@polkadot/api'; import type { u32 } from '@polkadot/types'; -import type { - MultiAssetsV2, - VersionedMultiAssets, - WeightLimitV2, -} from '@polkadot/types/interfaces'; +import type { MultiAssetsV2, VersionedMultiAssets, WeightLimitV2 } from '@polkadot/types/interfaces'; import type { XcmV3MultiassetMultiAssets } from '@polkadot/types/lookup'; import type { AnyJson } from '@polkadot/types/types'; diff --git a/src/createXcmTypes/ParaToSystem.ts b/src/createXcmTypes/ParaToSystem.ts index 854d87b7..e54984d9 100644 --- a/src/createXcmTypes/ParaToSystem.ts +++ b/src/createXcmTypes/ParaToSystem.ts @@ -2,11 +2,7 @@ import type { ApiPromise } from '@polkadot/api'; import type { u32 } from '@polkadot/types'; -import type { - MultiAssetsV2, - VersionedMultiAssets, - WeightLimitV2, -} from '@polkadot/types/interfaces'; +import type { MultiAssetsV2, VersionedMultiAssets, WeightLimitV2 } from '@polkadot/types/interfaces'; import type { XcmV3MultiassetMultiAssets } from '@polkadot/types/lookup'; import type { AnyJson } from '@polkadot/types/types'; diff --git a/src/createXcmTypes/RelayToPara.ts b/src/createXcmTypes/RelayToPara.ts index 21c89f71..49381d27 100644 --- a/src/createXcmTypes/RelayToPara.ts +++ b/src/createXcmTypes/RelayToPara.ts @@ -2,11 +2,7 @@ import type { ApiPromise } from '@polkadot/api'; import { u32 } from '@polkadot/types'; -import type { - MultiAssetsV2, - VersionedMultiAssets, - WeightLimitV2, -} from '@polkadot/types/interfaces'; +import type { MultiAssetsV2, VersionedMultiAssets, WeightLimitV2 } from '@polkadot/types/interfaces'; import type { XcmV3MultiassetMultiAssets } from '@polkadot/types/lookup'; import { isEthereumAddress } from '@polkadot/util-crypto'; diff --git a/src/createXcmTypes/RelayToSystem.ts b/src/createXcmTypes/RelayToSystem.ts index d92578b9..708601aa 100644 --- a/src/createXcmTypes/RelayToSystem.ts +++ b/src/createXcmTypes/RelayToSystem.ts @@ -2,11 +2,7 @@ import type { ApiPromise } from '@polkadot/api'; import { u32 } from '@polkadot/types'; -import type { - MultiAssetsV2, - VersionedMultiAssets, - WeightLimitV2, -} from '@polkadot/types/interfaces'; +import type { MultiAssetsV2, VersionedMultiAssets, WeightLimitV2 } from '@polkadot/types/interfaces'; import type { XcmV3MultiassetMultiAssets } from '@polkadot/types/lookup'; import { CreateWeightLimitOpts, ICreateXcmType, IWeightLimit, XcmBase } from './types'; diff --git a/src/createXcmTypes/SystemToPara.spec.ts b/src/createXcmTypes/SystemToPara.spec.ts index 2b70356b..a0aececa 100644 --- a/src/createXcmTypes/SystemToPara.spec.ts +++ b/src/createXcmTypes/SystemToPara.spec.ts @@ -32,10 +32,7 @@ describe('SystemToPara XcmVersioned Generation', () => { expect(beneficiary).toStrictEqual(expectedRes); }); it('Should work for V2 for an Ethereum Address', () => { - const beneficiary = SystemToPara.createBeneficiary( - '0x96Bd611EbE3Af39544104e26764F4939924F6Ece', - 2 - ); + const beneficiary = SystemToPara.createBeneficiary('0x96Bd611EbE3Af39544104e26764F4939924F6Ece', 2); const expectedRes = { V2: { @@ -75,10 +72,7 @@ describe('SystemToPara XcmVersioned Generation', () => { expect(beneficiary).toStrictEqual(expectedRes); }); it('Should work for V3 for an Ethereum Address', () => { - const beneficiary = SystemToPara.createBeneficiary( - '0x96Bd611EbE3Af39544104e26764F4939924F6Ece', - 3 - ); + const beneficiary = SystemToPara.createBeneficiary('0x96Bd611EbE3Af39544104e26764F4939924F6Ece', 3); const expectedRes = { V3: { diff --git a/src/createXcmTypes/SystemToPara.ts b/src/createXcmTypes/SystemToPara.ts index 14929b0a..57058de3 100644 --- a/src/createXcmTypes/SystemToPara.ts +++ b/src/createXcmTypes/SystemToPara.ts @@ -2,11 +2,7 @@ import type { ApiPromise } from '@polkadot/api'; import type { u32 } from '@polkadot/types'; -import type { - MultiAssetsV2, - VersionedMultiAssets, - WeightLimitV2, -} from '@polkadot/types/interfaces'; +import type { MultiAssetsV2, VersionedMultiAssets, WeightLimitV2 } from '@polkadot/types/interfaces'; import type { XcmV3MultiassetMultiAssets } from '@polkadot/types/lookup'; import { isEthereumAddress } from '@polkadot/util-crypto'; @@ -16,7 +12,14 @@ import { FungibleStrMultiAsset, UnionXcmMultiLocation } from '../types'; import { getFeeAssetItemIndex } from '../util/getFeeAssetItemIndex'; import { normalizeArrToStr } from '../util/normalizeArrToStr'; import { validateNumber } from '../validate'; -import { CreateAssetsOpts, CreateFeeAssetItemOpts, CreateWeightLimitOpts, ICreateXcmType, IWeightLimit, XcmBase } from './types'; +import { + CreateAssetsOpts, + CreateFeeAssetItemOpts, + CreateWeightLimitOpts, + ICreateXcmType, + IWeightLimit, + XcmBase, +} from './types'; import { constructForeignAssetMultiLocationFromAssetId } from './util/constructForeignAssetMultiLocationFromAssetId'; import { dedupeMultiAssets } from './util/dedupeMultiAssets'; import { fetchPalletInstanceId } from './util/fetchPalletInstanceId'; diff --git a/src/createXcmTypes/SystemToRelay.ts b/src/createXcmTypes/SystemToRelay.ts index 96d173f6..5bce19db 100644 --- a/src/createXcmTypes/SystemToRelay.ts +++ b/src/createXcmTypes/SystemToRelay.ts @@ -2,11 +2,7 @@ import type { ApiPromise } from '@polkadot/api'; import { u32 } from '@polkadot/types'; -import type { - MultiAssetsV2, - VersionedMultiAssets, - WeightLimitV2, -} from '@polkadot/types/interfaces'; +import type { MultiAssetsV2, VersionedMultiAssets, WeightLimitV2 } from '@polkadot/types/interfaces'; import type { XcmV3MultiassetMultiAssets } from '@polkadot/types/lookup'; import { CreateWeightLimitOpts, ICreateXcmType, IWeightLimit, XcmBase } from './types'; diff --git a/src/createXcmTypes/SystemToSystem.ts b/src/createXcmTypes/SystemToSystem.ts index 27bee173..9b7d8b79 100644 --- a/src/createXcmTypes/SystemToSystem.ts +++ b/src/createXcmTypes/SystemToSystem.ts @@ -2,11 +2,7 @@ import type { ApiPromise } from '@polkadot/api'; import { u32 } from '@polkadot/types'; -import type { - MultiAssetsV2, - VersionedMultiAssets, - WeightLimitV2, -} from '@polkadot/types/interfaces'; +import type { MultiAssetsV2, VersionedMultiAssets, WeightLimitV2 } from '@polkadot/types/interfaces'; import type { XcmV3MultiassetMultiAssets } from '@polkadot/types/lookup'; import { BaseError, BaseErrorsEnum } from '../errors'; @@ -16,7 +12,14 @@ import { normalizeArrToStr } from '../util/normalizeArrToStr'; import { resolveMultiLocation } from '../util/resolveMultiLocation'; import { validateNumber } from '../validate'; import { FungibleStrMultiAsset, UnionXcmMultiLocation } from './../types'; -import { CreateAssetsOpts, CreateFeeAssetItemOpts, CreateWeightLimitOpts, ICreateXcmType, IWeightLimit, XcmBase } from './types'; +import { + CreateAssetsOpts, + CreateFeeAssetItemOpts, + CreateWeightLimitOpts, + ICreateXcmType, + IWeightLimit, + XcmBase, +} from './types'; import { dedupeMultiAssets } from './util/dedupeMultiAssets'; import { fetchPalletInstanceId } from './util/fetchPalletInstanceId'; import { getAssetId } from './util/getAssetId'; @@ -24,8 +27,6 @@ import { isRelayNativeAsset } from './util/isRelayNativeAsset'; import { isSystemChain } from './util/isSystemChain'; import { sortMultiAssetsAscending } from './util/sortMultiAssetsAscending'; - - export const SystemToSystem: ICreateXcmType = { /** * Create a XcmVersionedMultiLocation type for a beneficiary. diff --git a/src/createXcmTypes/types.ts b/src/createXcmTypes/types.ts index bf098193..8228e2d6 100644 --- a/src/createXcmTypes/types.ts +++ b/src/createXcmTypes/types.ts @@ -9,24 +9,24 @@ import type { RequireOnlyOne, XCMDestBenificiary, XcmMultiLocation, XcmVersioned export type XcmBase = { [x: string]: { - parents: number, + parents: number; interior: { - [x: string]: RequireOnlyOne | null - } - } -} + [x: string]: RequireOnlyOne | null; + }; + }; +}; export type XcmJunction = { AccountId32: { network?: string; id: string; - }, + }; AccountKey20: { network?: string; key: string; - } - Parachain: string -} + }; + Parachain: string; +}; export interface CreateAssetsOpts { registry: Registry;