@moonbeam-network/xcm-utils 2.0.6 → 2.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.cjs +1 -1
- package/build/index.cjs.map +1 -1
- package/build/index.mjs +1 -1
- package/build/index.mjs.map +1 -1
- package/package.json +2 -2
package/build/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var x=Object.create;var c=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var U=Object.getOwnPropertyNames;var w=Object.getPrototypeOf,h=Object.prototype.hasOwnProperty;var v=(t,n)=>{for(var r in n)c(t,r,{get:n[r],enumerable:!0})},a=(t,n,r,e)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of U(n))!h.call(t,o)&&o!==r&&c(t,o,{get:()=>n[o],enumerable:!(e=A(n,o))||e.enumerable});return t};var y=(t,n,r)=>(r=t!=null?x(w(t)):{},a(n||!t||!t.__esModule?c(r,"default",{value:t,enumerable:!0}):r,t)),P=t=>a(c({},"__esModule",{value:!0}),t);var I={};v(I,{MRLTypes:()=>b,convertDecimals:()=>V,formatAssetIdToERC20:()=>R,getPolkadotApi:()=>L,getSovereignAccountAddresses:()=>S,hasDecimalOverflow:()=>X,toBigInt:()=>p,toDecimal:()=>u});module.exports=P(I);function R(t){if(t.startsWith("0x"))return t;if(!/^\d{38,39}$/.test(t))throw new Error(`Asset id: ${t} must be a string and have 38-39 digits`);return`0xffffffff${BigInt(t).toString(16).padStart(32,"0")}`}var s=y(require("big.js"),1);s.default.NE=-18;function u(t,n,r=6,e){let o=(0,s.default)(t.toString().replace(/[^0-9]/g,"")),l=(0,s.default)(10).pow(n);return o.div(l).round(r,e).toString()}function p(t,n){if(typeof t=="bigint")return t;let r=(0,s.default)(10).pow(n),e=(0,s.default)(t).mul(r);return BigInt(e.toFixed(0,s.default.roundDown))}function V(t,n,r){let e=u(t,n,n);return p(e.toString(),r)}function X(t,n){let r=t.toString().split(".");return r.length>1&&r[1].length>n}var m=require("@polkadot/api"),d=require("@polkadot/apps-config"),f=require("lru-cache"),b=(o=>(o.XcmVersionedMultiLocation="XcmVersionedMultiLocation",o.XcmVersionedLocation="XcmVersionedLocation",o.XcmRoutingUserAction="XcmRoutingUserAction",o.VersionedUserAction="VersionedUserAction",o))(b||{}),g=new f.LRUCache({max:20,dispose:async t=>{let n=await t;n.isConnected&&n.disconnect()}});async function L(t){let n=g.get(t)||m.ApiPromise.create({noInitWarn:!0,provider:new m.WsProvider(t),types:{XcmRoutingUserAction:{destination:"XcmVersionedLocation"},VersionedUserAction:{_enum:{V1:"XcmRoutingUserAction"}}},typesBundle:d.typesBundle});g.set(t,n);let r=await n;return await r.isReady,r}var i=require("@polkadot/util");function S(t){let n=(0,i.bnToU8a)(t,{bitLength:32}),r=(0,i.u8aToHex)(new Uint8Array([...(0,i.stringToU8a)("para"),...n])).padEnd(66,"0"),e=(0,i.u8aToHex)(new Uint8Array([...(0,i.stringToU8a)("sibl"),...n])).padEnd(66,"0"),o=e.slice(0,42);return{generic:e,moonbeam:o,relay:r}}0&&(module.exports={MRLTypes,convertDecimals,formatAssetIdToERC20,getPolkadotApi,getSovereignAccountAddresses,hasDecimalOverflow,toBigInt,toDecimal});
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/build/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/format/asset.ts","../src/numbers/decimals.ts","../src/polkadot/polkadot.api.ts","../src/polkadot/polkadot.address.ts"],"sourcesContent":["export * from './format';\nexport * from './numbers';\nexport * from './polkadot';\n","export function formatAssetIdToERC20(id: string) {\n if (id.startsWith('0x')) {\n return id;\n }\n\n if (!/^\\d{38,39}$/.test(id)) {\n throw new Error(`Asset id: ${id} must be a string and have 38-39 digits`);\n }\n\n return `0xffffffff${BigInt(id).toString(16).padStart(32, '0')}`;\n}\n","import Big, { RoundingMode } from 'big.js';\n\nBig.NE = -18;\n\nexport function toDecimal(\n number: bigint | number | string,\n decimals: number,\n maxDecimal = 6,\n roundType?: RoundingMode,\n): string {\n const dividend = Big(number.toString().replace(/[^0-9]/g, ''));\n const divisor = Big(10).pow(decimals);\n const result = dividend.div(divisor).round(maxDecimal, roundType);\n\n return result.toString();\n}\n\nexport function toBigInt(\n amount: bigint | string | number,\n decimals: number,\n): bigint {\n if (typeof amount === 'bigint') {\n return amount;\n }\n\n const multiplier = Big(10).pow(decimals);\n const result = Big(amount).mul(multiplier);\n\n return BigInt(result.toFixed(0, Big.roundDown));\n}\n\nexport function convertDecimals(\n number: string | bigint,\n decimals: number,\n targetDecimals: number,\n): bigint {\n const decimalNumber = toDecimal(number, decimals, decimals);\n\n return toBigInt(decimalNumber.toString(), targetDecimals);\n}\n\nexport function hasDecimalOverflow(fl: number | string, maxDecimal: number) {\n const parts = fl.toString().split('.');\n return parts.length > 1 && parts[1].length > maxDecimal;\n}\n","import { ApiPromise, WsProvider } from '@polkadot/api';\nimport { typesBundle } from '@polkadot/apps-config';\nimport
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/format/asset.ts","../src/numbers/decimals.ts","../src/polkadot/polkadot.api.ts","../src/polkadot/polkadot.address.ts"],"sourcesContent":["export * from './format';\nexport * from './numbers';\nexport * from './polkadot';\n","export function formatAssetIdToERC20(id: string) {\n if (id.startsWith('0x')) {\n return id;\n }\n\n if (!/^\\d{38,39}$/.test(id)) {\n throw new Error(`Asset id: ${id} must be a string and have 38-39 digits`);\n }\n\n return `0xffffffff${BigInt(id).toString(16).padStart(32, '0')}`;\n}\n","import Big, { RoundingMode } from 'big.js';\n\nBig.NE = -18;\n\nexport function toDecimal(\n number: bigint | number | string,\n decimals: number,\n maxDecimal = 6,\n roundType?: RoundingMode,\n): string {\n const dividend = Big(number.toString().replace(/[^0-9]/g, ''));\n const divisor = Big(10).pow(decimals);\n const result = dividend.div(divisor).round(maxDecimal, roundType);\n\n return result.toString();\n}\n\nexport function toBigInt(\n amount: bigint | string | number,\n decimals: number,\n): bigint {\n if (typeof amount === 'bigint') {\n return amount;\n }\n\n const multiplier = Big(10).pow(decimals);\n const result = Big(amount).mul(multiplier);\n\n return BigInt(result.toFixed(0, Big.roundDown));\n}\n\nexport function convertDecimals(\n number: string | bigint,\n decimals: number,\n targetDecimals: number,\n): bigint {\n const decimalNumber = toDecimal(number, decimals, decimals);\n\n return toBigInt(decimalNumber.toString(), targetDecimals);\n}\n\nexport function hasDecimalOverflow(fl: number | string, maxDecimal: number) {\n const parts = fl.toString().split('.');\n return parts.length > 1 && parts[1].length > maxDecimal;\n}\n","import { ApiPromise, WsProvider } from '@polkadot/api';\nimport { typesBundle } from '@polkadot/apps-config';\nimport { LRUCache } from 'lru-cache';\n\nexport enum MRLTypes {\n // TODO handle both types according to RT version\n XcmVersionedMultiLocation = 'XcmVersionedMultiLocation',\n XcmVersionedLocation = 'XcmVersionedLocation',\n XcmRoutingUserAction = 'XcmRoutingUserAction',\n VersionedUserAction = 'VersionedUserAction',\n}\n\nconst cache = new LRUCache<string, Promise<ApiPromise>>({\n max: 20,\n // eslint-disable-next-line sort-keys\n dispose: async (promise: Promise<ApiPromise>) => {\n const api = await promise;\n\n if (api.isConnected) {\n api.disconnect();\n }\n },\n});\n\nexport async function getPolkadotApi(ws: string): Promise<ApiPromise> {\n const promise =\n cache.get(ws) ||\n ApiPromise.create({\n noInitWarn: true,\n provider: new WsProvider(ws),\n types: {\n [MRLTypes.XcmRoutingUserAction]: {\n destination: MRLTypes.XcmVersionedLocation,\n },\n [MRLTypes.VersionedUserAction]: {\n _enum: { V1: MRLTypes.XcmRoutingUserAction },\n },\n },\n typesBundle,\n });\n\n cache.set(ws, promise);\n\n const api = await promise;\n\n await api.isReady;\n\n return api;\n}\n","import { bnToU8a, u8aToHex, stringToU8a } from '@polkadot/util';\n\nexport function getSovereignAccountAddresses(paraId: number) {\n const paraIdU8a = bnToU8a(paraId, { bitLength: 32 });\n const relay = u8aToHex(\n new Uint8Array([...stringToU8a('para'), ...paraIdU8a]),\n ).padEnd(66, '0');\n const generic = u8aToHex(\n new Uint8Array([...stringToU8a('sibl'), ...paraIdU8a]),\n ).padEnd(66, '0');\n const moonbeam = generic.slice(0, 42);\n\n return {\n generic,\n moonbeam,\n relay,\n };\n}\n"],"mappings":"0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,cAAAE,EAAA,oBAAAC,EAAA,yBAAAC,EAAA,mBAAAC,EAAA,iCAAAC,EAAA,uBAAAC,EAAA,aAAAC,EAAA,cAAAC,IAAA,eAAAC,EAAAV,GCAO,SAASW,EAAqBC,EAAY,CAC/C,GAAIA,EAAG,WAAW,IAAI,EACpB,OAAOA,EAGT,GAAI,CAAC,cAAc,KAAKA,CAAE,EACxB,MAAM,IAAI,MAAM,aAAaA,CAAE,yCAAyC,EAG1E,MAAO,aAAa,OAAOA,CAAE,EAAE,SAAS,EAAE,EAAE,SAAS,GAAI,GAAG,CAAC,EAC/D,CCVA,IAAAC,EAAkC,uBAElC,EAAAC,QAAI,GAAK,IAEF,SAASC,EACdC,EACAC,EACAC,EAAa,EACbC,EACQ,CACR,IAAMC,KAAW,EAAAN,SAAIE,EAAO,SAAS,EAAE,QAAQ,UAAW,EAAE,CAAC,EACvDK,KAAU,EAAAP,SAAI,EAAE,EAAE,IAAIG,CAAQ,EAGpC,OAFeG,EAAS,IAAIC,CAAO,EAAE,MAAMH,EAAYC,CAAS,EAElD,SAAS,CACzB,CAEO,SAASG,EACdC,EACAN,EACQ,CACR,GAAI,OAAOM,GAAW,SACpB,OAAOA,EAGT,IAAMC,KAAa,EAAAV,SAAI,EAAE,EAAE,IAAIG,CAAQ,EACjCQ,KAAS,EAAAX,SAAIS,CAAM,EAAE,IAAIC,CAAU,EAEzC,OAAO,OAAOC,EAAO,QAAQ,EAAG,EAAAX,QAAI,SAAS,CAAC,CAChD,CAEO,SAASY,EACdV,EACAC,EACAU,EACQ,CACR,IAAMC,EAAgBb,EAAUC,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M,EAAG,EAAE,EAEpC,MAAO,CACL,QAAAA,EACA,SAAAC,EACA,MAAAF,CACF,CACF","names":["src_exports","__export","MRLTypes","convertDecimals","formatAssetIdToERC20","getPolkadotApi","getSovereignAccountAddresses","hasDecimalOverflow","toBigInt","toDecimal","__toCommonJS","formatAssetIdToERC20","id","import_big","Big","toDecimal","number","decimals","maxDecimal","roundType","dividend","divisor","toBigInt","amount","multiplier","result","convertDecimals","targetDecimals","decimalNumber","hasDecimalOverflow","fl","parts","import_api","import_apps_config","import_lru_cache","MRLTypes","cache","promise","api","getPolkadotApi","ws","import_util","getSovereignAccountAddresses","paraId","paraIdU8a","relay","generic","moonbeam"]}
|
package/build/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function U(t){if(t.startsWith("0x"))return t;if(!/^\d{38,39}$/.test(t))throw new Error(`Asset id: ${t} must be a string and have 38-39 digits`);return`0xffffffff${BigInt(t).toString(16).padStart(32,"0")}`}import i from"big.js";i.NE=-18;function u(t,n,r=6,o){let e=i(t.toString().replace(/[^0-9]/g,"")),a=i(10).pow(n);return e.div(a).round(r,o).toString()}function p(t,n){if(typeof t=="bigint")return t;let r=i(10).pow(n),o=i(t).mul(r);return BigInt(o.toFixed(0,i.roundDown))}function
|
|
1
|
+
function U(t){if(t.startsWith("0x"))return t;if(!/^\d{38,39}$/.test(t))throw new Error(`Asset id: ${t} must be a string and have 38-39 digits`);return`0xffffffff${BigInt(t).toString(16).padStart(32,"0")}`}import i from"big.js";i.NE=-18;function u(t,n,r=6,o){let e=i(t.toString().replace(/[^0-9]/g,"")),a=i(10).pow(n);return e.div(a).round(r,o).toString()}function p(t,n){if(typeof t=="bigint")return t;let r=i(10).pow(n),o=i(t).mul(r);return BigInt(o.toFixed(0,i.roundDown))}function R(t,n,r){let o=u(t,n,n);return p(o.toString(),r)}function V(t,n){let r=t.toString().split(".");return r.length>1&&r[1].length>n}import{ApiPromise as g,WsProvider as d}from"@polkadot/api";import{typesBundle as f}from"@polkadot/apps-config";import{LRUCache as b}from"lru-cache";var l=(e=>(e.XcmVersionedMultiLocation="XcmVersionedMultiLocation",e.XcmVersionedLocation="XcmVersionedLocation",e.XcmRoutingUserAction="XcmRoutingUserAction",e.VersionedUserAction="VersionedUserAction",e))(l||{}),s=new b({max:20,dispose:async t=>{let n=await t;n.isConnected&&n.disconnect()}});async function D(t){let n=s.get(t)||g.create({noInitWarn:!0,provider:new d(t),types:{XcmRoutingUserAction:{destination:"XcmVersionedLocation"},VersionedUserAction:{_enum:{V1:"XcmRoutingUserAction"}}},typesBundle:f});s.set(t,n);let r=await n;return await r.isReady,r}import{bnToU8a as x,u8aToHex as c,stringToU8a as m}from"@polkadot/util";function C(t){let n=x(t,{bitLength:32}),r=c(new Uint8Array([...m("para"),...n])).padEnd(66,"0"),o=c(new Uint8Array([...m("sibl"),...n])).padEnd(66,"0"),e=o.slice(0,42);return{generic:o,moonbeam:e,relay:r}}export{l as MRLTypes,R as convertDecimals,U as formatAssetIdToERC20,D as getPolkadotApi,C as getSovereignAccountAddresses,V as hasDecimalOverflow,p as toBigInt,u as toDecimal};
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
package/build/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/format/asset.ts","../src/numbers/decimals.ts","../src/polkadot/polkadot.api.ts","../src/polkadot/polkadot.address.ts"],"sourcesContent":["export function formatAssetIdToERC20(id: string) {\n if (id.startsWith('0x')) {\n return id;\n }\n\n if (!/^\\d{38,39}$/.test(id)) {\n throw new Error(`Asset id: ${id} must be a string and have 38-39 digits`);\n }\n\n return `0xffffffff${BigInt(id).toString(16).padStart(32, '0')}`;\n}\n","import Big, { RoundingMode } from 'big.js';\n\nBig.NE = -18;\n\nexport function toDecimal(\n number: bigint | number | string,\n decimals: number,\n maxDecimal = 6,\n roundType?: RoundingMode,\n): string {\n const dividend = Big(number.toString().replace(/[^0-9]/g, ''));\n const divisor = Big(10).pow(decimals);\n const result = dividend.div(divisor).round(maxDecimal, roundType);\n\n return result.toString();\n}\n\nexport function toBigInt(\n amount: bigint | string | number,\n decimals: number,\n): bigint {\n if (typeof amount === 'bigint') {\n return amount;\n }\n\n const multiplier = Big(10).pow(decimals);\n const result = Big(amount).mul(multiplier);\n\n return BigInt(result.toFixed(0, Big.roundDown));\n}\n\nexport function convertDecimals(\n number: string | bigint,\n decimals: number,\n targetDecimals: number,\n): bigint {\n const decimalNumber = toDecimal(number, decimals, decimals);\n\n return toBigInt(decimalNumber.toString(), targetDecimals);\n}\n\nexport function hasDecimalOverflow(fl: number | string, maxDecimal: number) {\n const parts = fl.toString().split('.');\n return parts.length > 1 && parts[1].length > maxDecimal;\n}\n","import { ApiPromise, WsProvider } from '@polkadot/api';\nimport { typesBundle } from '@polkadot/apps-config';\nimport
|
|
1
|
+
{"version":3,"sources":["../src/format/asset.ts","../src/numbers/decimals.ts","../src/polkadot/polkadot.api.ts","../src/polkadot/polkadot.address.ts"],"sourcesContent":["export function formatAssetIdToERC20(id: string) {\n if (id.startsWith('0x')) {\n return id;\n }\n\n if (!/^\\d{38,39}$/.test(id)) {\n throw new Error(`Asset id: ${id} must be a string and have 38-39 digits`);\n }\n\n return `0xffffffff${BigInt(id).toString(16).padStart(32, '0')}`;\n}\n","import Big, { RoundingMode } from 'big.js';\n\nBig.NE = -18;\n\nexport function toDecimal(\n number: bigint | number | string,\n decimals: number,\n maxDecimal = 6,\n roundType?: RoundingMode,\n): string {\n const dividend = Big(number.toString().replace(/[^0-9]/g, ''));\n const divisor = Big(10).pow(decimals);\n const result = dividend.div(divisor).round(maxDecimal, roundType);\n\n return result.toString();\n}\n\nexport function toBigInt(\n amount: bigint | string | number,\n decimals: number,\n): bigint {\n if (typeof amount === 'bigint') {\n return amount;\n }\n\n const multiplier = Big(10).pow(decimals);\n const result = Big(amount).mul(multiplier);\n\n return BigInt(result.toFixed(0, Big.roundDown));\n}\n\nexport function convertDecimals(\n number: string | bigint,\n decimals: number,\n targetDecimals: number,\n): bigint {\n const decimalNumber = toDecimal(number, decimals, decimals);\n\n return toBigInt(decimalNumber.toString(), targetDecimals);\n}\n\nexport function hasDecimalOverflow(fl: number | string, maxDecimal: number) {\n const parts = fl.toString().split('.');\n return parts.length > 1 && parts[1].length > maxDecimal;\n}\n","import { ApiPromise, WsProvider } from '@polkadot/api';\nimport { typesBundle } from '@polkadot/apps-config';\nimport { LRUCache } from 'lru-cache';\n\nexport enum MRLTypes {\n // TODO handle both types according to RT version\n XcmVersionedMultiLocation = 'XcmVersionedMultiLocation',\n XcmVersionedLocation = 'XcmVersionedLocation',\n XcmRoutingUserAction = 'XcmRoutingUserAction',\n VersionedUserAction = 'VersionedUserAction',\n}\n\nconst cache = new LRUCache<string, Promise<ApiPromise>>({\n max: 20,\n // eslint-disable-next-line sort-keys\n dispose: async (promise: Promise<ApiPromise>) => {\n const api = await promise;\n\n if (api.isConnected) {\n api.disconnect();\n }\n },\n});\n\nexport async function getPolkadotApi(ws: string): Promise<ApiPromise> {\n const promise =\n cache.get(ws) ||\n ApiPromise.create({\n noInitWarn: true,\n provider: new WsProvider(ws),\n types: {\n [MRLTypes.XcmRoutingUserAction]: {\n destination: MRLTypes.XcmVersionedLocation,\n },\n [MRLTypes.VersionedUserAction]: {\n _enum: { V1: MRLTypes.XcmRoutingUserAction },\n },\n },\n typesBundle,\n });\n\n cache.set(ws, promise);\n\n const api = await promise;\n\n await api.isReady;\n\n return api;\n}\n","import { bnToU8a, u8aToHex, stringToU8a } from '@polkadot/util';\n\nexport function getSovereignAccountAddresses(paraId: number) {\n const paraIdU8a = bnToU8a(paraId, { bitLength: 32 });\n const relay = u8aToHex(\n new Uint8Array([...stringToU8a('para'), ...paraIdU8a]),\n ).padEnd(66, '0');\n const generic = u8aToHex(\n new Uint8Array([...stringToU8a('sibl'), ...paraIdU8a]),\n ).padEnd(66, '0');\n const moonbeam = generic.slice(0, 42);\n\n return {\n generic,\n moonbeam,\n relay,\n };\n}\n"],"mappings":"AAA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,EAAA,oBAAsB,sBALZA,OAAA,IAQNC,EAAQ,IAAIF,EAAsC,CACtD,IAAK,GAEL,QAAS,MAAOG,GAAiC,CAC/C,IAAMC,EAAM,MAAMD,EAEdC,EAAI,aACNA,EAAI,WAAW,CAEnB,CACF,CAAC,EAED,eAAsBC,EAAeC,EAAiC,CACpE,IAAMH,EACJD,EAAM,IAAII,CAAE,GACZT,EAAW,OAAO,CAChB,WAAY,GACZ,SAAU,IAAIC,EAAWQ,CAAE,EAC3B,MAAO,CACJ,qBAAgC,CAC/B,YAAa,sBACf,EACC,oBAA+B,CAC9B,MAAO,CAAE,GAAI,sBAA8B,CAC7C,CACF,EACA,YAAAP,CACF,CAAC,EAEHG,EAAM,IAAII,EAAIH,CAAO,EAErB,IAAMC,EAAM,MAAMD,EAElB,aAAMC,EAAI,QAEHA,CACT,CChDA,OAAS,WAAAG,EAAS,YAAAC,EAAU,eAAAC,MAAmB,iBAExC,SAASC,EAA6BC,EAAgB,CAC3D,IAAMC,EAAYL,EAAQI,EAAQ,CAAE,UAAW,EAAG,CAAC,EAC7CE,EAAQL,EACZ,IAAI,WAAW,CAAC,GAAGC,EAAY,MAAM,EAAG,GAAGG,CAAS,CAAC,CACvD,EAAE,OAAO,GAAI,GAAG,EACVE,EAAUN,EACd,IAAI,WAAW,CAAC,GAAGC,EAAY,MAAM,EAAG,GAAGG,CAAS,CAAC,CACvD,EAAE,OAAO,GAAI,GAAG,EACVG,EAAWD,EAAQ,MAAM,EAAG,EAAE,EAEpC,MAAO,CACL,QAAAA,EACA,SAAAC,EACA,MAAAF,CACF,CACF","names":["formatAssetIdToERC20","id","Big","toDecimal","number","decimals","maxDecimal","roundType","dividend","divisor","toBigInt","amount","multiplier","result","convertDecimals","targetDecimals","decimalNumber","hasDecimalOverflow","fl","parts","ApiPromise","WsProvider","typesBundle","LRUCache","MRLTypes","cache","promise","api","getPolkadotApi","ws","bnToU8a","u8aToHex","stringToU8a","getSovereignAccountAddresses","paraId","paraIdU8a","relay","generic","moonbeam"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moonbeam-network/xcm-utils",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.8",
|
|
4
4
|
"description": "Moonbeam XCM utilities",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "tsup",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"main": "./build/index.cjs",
|
|
53
53
|
"dependencies": {
|
|
54
54
|
"big.js": "^6.2.1",
|
|
55
|
-
"lru-cache": "^
|
|
55
|
+
"lru-cache": "^10.2.2"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@types/big.js": "^6.2.2"
|