Skip to content

Commit

Permalink
add mrl types to polkadot api
Browse files Browse the repository at this point in the history
  • Loading branch information
mmaurello committed Feb 29, 2024
1 parent c194655 commit de75c6b
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions packages/utils/src/polkadot/polkadot.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ import { ApiPromise, WsProvider } from '@polkadot/api';
import { typesBundle } from '@polkadot/apps-config';
import LRU from 'lru-cache';

export enum MRLTypes {
XcmVersionedMultiLocation = 'XcmVersionedMultiLocation',
XcmRoutingUserAction = 'XcmRoutingUserAction',
VersionedUserAction = 'VersionedUserAction',
}

const cache = new LRU<string, Promise<ApiPromise>>({
max: 20,
// eslint-disable-next-line sort-keys
Expand All @@ -20,6 +26,14 @@ export async function getPolkadotApi(ws: string): Promise<ApiPromise> {
ApiPromise.create({
noInitWarn: true,
provider: new WsProvider(ws),
types: {
[MRLTypes.XcmRoutingUserAction]: {
destination: MRLTypes.XcmVersionedMultiLocation,
},
[MRLTypes.VersionedUserAction]: {
_enum: { V1: MRLTypes.XcmRoutingUserAction },
},
},
typesBundle,
});

Expand Down

0 comments on commit de75c6b

Please sign in to comment.