diff --git a/packages/sdk/README.md b/packages/sdk/README.md index 1bb03928..47f21e74 100644 --- a/packages/sdk/README.md +++ b/packages/sdk/README.md @@ -108,11 +108,11 @@ Component list and current status ⬇️ | Router | API | 🧪 | | TradeRouter | API | 🧪 | | Twap | API | ⏳ | -| XYK | Math | 🧪 | -| XYK | Pool | 🧪 | -| Omni | Math | 🧪 | -| Omni | Pool | 🧪 | | LBP | Math | 🧪 | | LBP | Pool | 🧪 | +| Omni | Math | 🧪 | +| Omni | Pool | 🧪 | | Stable | Math | 🧪 | | Stable | Pool | 🧪 | +| XYK | Math | 🧪 | +| XYK | Pool | 🧪 | diff --git a/packages/xcm-cfg/src/chains.spec.ts b/packages/xcm-cfg/src/chains.spec.ts new file mode 100644 index 00000000..23274289 --- /dev/null +++ b/packages/xcm-cfg/src/chains.spec.ts @@ -0,0 +1,76 @@ +import { AnyChain, ChainEcosystem, Parachain } from '@galacticcouncil/xcm-core'; + +import { chains } from './chains'; + +const fullAddressSpace = (chain: AnyChain): boolean => { + return ( + chain instanceof Parachain && + chain.isEvmParachain() && + chain.usesH160Acc == false + ); +}; + +const h160AddressSpaceOnly = (chain: AnyChain): boolean => { + return ( + (chain instanceof Parachain && chain.usesH160Acc == true) || + chain.isEvmChain() + ); +}; + +const ss58AddressSpaceOnly = (chain: AnyChain): boolean => { + return ( + chain instanceof Parachain && + chain.isParachain() && + chain.usesH160Acc == false + ); +}; + +describe('chains config', () => { + describe('check address space support in polkadot ecosystem', () => { + it('should match given chains with both evm & substrate address space support', async () => { + expect( + chains + .filter((c) => c.ecosystem === ChainEcosystem.Polkadot) + .filter((c) => fullAddressSpace(c)) + .map((c) => c.key) + .sort() + ).toEqual(['acala', 'hydration'].sort()); + }); + it('should match given chains with evm only address space support', async () => { + expect( + chains + .filter((c) => c.ecosystem === ChainEcosystem.Polkadot) + .filter((c) => h160AddressSpaceOnly(c)) + .map((c) => c.key) + .sort() + ).toEqual(['acala-evm', 'darwinia', 'moonbeam', 'mythos'].sort()); + }); + it('should match given chains with substrate only address space support', async () => { + expect( + chains + .filter((c) => c.ecosystem === ChainEcosystem.Polkadot) + .filter((c) => ss58AddressSpaceOnly(c)) + .map((c) => c.key) + .sort() + ).toEqual( + [ + 'ajuna', + 'assethub', + 'astar', + 'bifrost', + 'centrifuge', + 'crust', + 'interlay', + 'kilt', + 'nodle', + 'pendulum', + 'phala', + 'polkadot', + 'subsocial', + 'unique', + 'zeitgeist', + ].sort() + ); + }); + }); +}); diff --git a/packages/xcm-cfg/src/templates.ts b/packages/xcm-cfg/src/templates.ts deleted file mode 100644 index 0f282ef4..00000000 --- a/packages/xcm-cfg/src/templates.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * as assethub from './configs/polkadot/assethub/templates'; -export * as hydration from './configs/polkadot/hydration/templates'; diff --git a/packages/xcm-core/src/utils/account.ts b/packages/xcm-core/src/utils/account.ts index 86df9c67..961e12b8 100644 --- a/packages/xcm-core/src/utils/account.ts +++ b/packages/xcm-core/src/utils/account.ts @@ -1,10 +1,4 @@ -import { - bnToU8a, - hexToU8a, - stringToU8a, - u8aToHex, - u8aToString, -} from '@polkadot/util'; +import { bnToU8a, hexToU8a, stringToU8a, u8aToHex } from '@polkadot/util'; import { decodeAddress, blake2AsU8a } from '@polkadot/util-crypto'; import { TypeRegistry } from '@polkadot/types';