"use strict";var v=Object.create;var h=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var D=Object.getOwnPropertyNames;var E=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty;var B=(a,t)=>{for(var e in t)h(a,e,{get:t[e],enumerable:!0})},g=(a,t,e,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of D(t))!w.call(a,r)&&r!==e&&h(a,r,{get:()=>t[r],enumerable:!(s=S(t,r))||s.enumerable});return a};var M=(a,t,e)=>(e=a!=null?v(E(a)):{},g(t||!a||!a.__esModule?h(e,"default",{value:a,enumerable:!0}):e,a)),R=a=>g(h({},"__esModule",{value:!0}),a);var T={};B(T,{Asset:()=>i,AssetAmount:()=>d,Chain:()=>m,ChainType:()=>o,Ecosystem:()=>C,EvmParachain:()=>y,Parachain:()=>c});module.exports=R(T);var i=class{key;originSymbol;constructor({key:t,originSymbol:e}){this.key=t,this.originSymbol=e}isEqual(t){return this.key===t.key&&this.originSymbol===t.originSymbol}};var A=require("@moonbeam-network/xcm-utils"),u=M(require("big.js"),1);u.default.NE=-18;var d=class a extends i{amount;decimals;symbol;constructor({amount:t,decimals:e,symbol:s,...r}){super(r),this.amount=BigInt(t),this.decimals=e,this.symbol=s||this.originSymbol}static fromAsset(t,e){return new a({...t,...e})}isSame(t){return super.isEqual(t)&&this.decimals===t.decimals}isEqual(t){return this.isSame(t)&&this.amount===t.amount}copyWith(t){return new a({...this,...t})}toBig(){return(0,u.default)(this.amount.toString())}toBigDecimal(t,e){return(0,u.default)(this.toDecimal(t,e))}toDecimal(t,e){return(0,A.toDecimal)(this.amount,this.decimals,t,e)}};var o=(e=>(e.Parachain="parachain",e.EvmParachain="evm-parachain",e))(o||{}),C=(s=>(s.Polkadot="polkadot",s.Kusama="kusama",s.AlphanetRelay="alphanet-relay",s))(C||{});var m=class{ecosystem;isTestChain;key;name;type;constructor({ecosystem:t,isTestChain:e=!1,key:s,name:r,type:n}){this.ecosystem=t,this.isTestChain=e,this.key=s,this.name=r,this.type=n}isParachain(){return this.type==="parachain"}isEvmParachain(){return this.type==="evm-parachain"}};var P=require("viem");var c=class extends m{assetsData;checkSovereignAccountBalances;genesisHash;isRelay;parachainId;ss58Format;usesChainDecimals;weight;ws;constructor({assetsData:t,checkSovereignAccountBalances:e,genesisHash:s,isRelay:r,parachainId:n,usesChainDecimals:l,ss58Format:b,weight:f,ws:x,type:I="parachain",...k}){super({type:I,...k}),this.assetsData=t instanceof Map?t:new Map(t==null?void 0:t.map(p=>[p.asset.key,p])),this.checkSovereignAccountBalances=!!e,this.genesisHash=s,this.isRelay=!!r,this.parachainId=n,this.ss58Format=b,this.usesChainDecimals=!!l,this.weight=f,this.ws=x}getAssetId(t){var e;return((e=this.assetsData.get(t.key))==null?void 0:e.id)??t.originSymbol}getBalanceAssetId(t){var e;return((e=this.assetsData.get(t.key))==null?void 0:e.balanceId)??this.getAssetId(t)}getMinAssetId(t){var e;return((e=this.assetsData.get(t.key))==null?void 0:e.minId)??this.getAssetId(t)}getMetadataAssetId(t){var e;return((e=this.assetsData.get(t.key))==null?void 0:e.metadataId)??this.getAssetId(t)}getRegisteredAssetIdOrAddress(t){var s;let e=(s=this.assetsData.get(t.key))==null?void 0:s.metadataId;return e&&e!==0?e:this.getAssetId(t)}getAssetPalletInstance(t){var e;return(e=this.assetsData.get(t.key))==null?void 0:e.palletInstance}getAssetDecimals(t){var e;return(e=this.assetsData.get(t.key))==null?void 0:e.decimals}getAssetMin(t){var e;return((e=this.assetsData.get(t.key))==null?void 0:e.min)??0}};var y=class extends c{id;rpc;nativeCurrency;isEvmSigner;contracts;constructor({id:t,rpc:e,nativeCurrency:s,isEvmSigner:r=!1,contracts:n,...l}){super({type:"evm-parachain",...l}),this.contracts=n,this.id=t,this.rpc=e,this.nativeCurrency=s,this.isEvmSigner=r}getViemChain(){return(0,P.defineChain)({id:this.id,name:this.name,nativeCurrency:this.nativeCurrency,rpcUrls:{default:{http:[this.rpc],webSocket:Array.isArray(this.ws)?this.ws:[this.ws]}}})}};0&&(module.exports={Asset,AssetAmount,Chain,ChainType,Ecosystem,EvmParachain,Parachain}); //# sourceMappingURL=index.cjs.map