@rango-dev/wallets-core 0.58.2-next.1 → 0.58.2-next.2

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.
@@ -5,6 +5,7 @@ import type { CosmosActions } from '../../namespaces/cosmos/mod.js';
5
5
  import type { EvmActions } from '../../namespaces/evm/mod.js';
6
6
  import type { SolanaActions } from '../../namespaces/solana/mod.js';
7
7
  import type { StarknetActions } from '../../namespaces/starknet/types.js';
8
+ import type { StellarActions } from '../../namespaces/stellar/types.js';
8
9
  import type { SuiActions } from '../../namespaces/sui/mod.js';
9
10
  import type { TonActions } from '../../namespaces/ton/types.js';
10
11
  import type { TronActions } from '../../namespaces/tron/types.js';
@@ -31,6 +32,7 @@ export interface CommonNamespaces {
31
32
  starknet: StarknetActions;
32
33
  xrpl: XRPLActions;
33
34
  ton: TonActions;
35
+ stellar: StellarActions;
34
36
  }
35
37
  export type CommonNamespaceKeys = Prettify<keyof CommonNamespaces>;
36
38
  export interface ExtendableInternalActions {
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/hub/provider/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+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,EAAE,CAAC,CAAC,CAC3B,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IAAE,KAAK,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC"}
@@ -1,2 +1,2 @@
1
- var k=Object.defineProperty;var r=(a,t)=>k(a,"name",{value:t,configurable:!0});var I=(e=>(e.BTC="BTC",e.BSC="BSC",e.LTC="LTC",e.THORCHAIN="THOR",e.BCH="BCH",e.BINANCE="BNB",e.BLAST="BLAST",e.CELO="CELO",e.LINEA="LINEA",e.METIS="METIS",e.SONIC="SONIC",e.BERACHAIN="BERACHAIN",e.ZETA_CHAIN="ZETA_CHAIN",e.SCROLL="SCROLL",e.ZKSYNC="ZKSYNC",e.MONAD="MONAD",e.ETHEREUM="ETH",e.POLYGON="POLYGON",e.TERRA="TERRA",e.POLKADOT="",e.TRON="TRON",e.DOGE="DOGE",e.HARMONY="HARMONY",e.AVAX_CCHAIN="AVAX_CCHAIN",e.FANTOM="FANTOM",e.MOONBEAM="MOONBEAM",e.ARBITRUM="ARBITRUM",e.BOBA="BOBA",e.OPTIMISM="OPTIMISM",e.FUSE="FUSE",e.CRONOS="CRONOS",e.SOLANA="SOLANA",e.MOONRIVER="MOONRIVER",e.GNOSIS="GNOSIS",e.COSMOS="COSMOS",e.OSMOSIS="OSMOSIS",e.AXELAR="AXELAR",e.MARS="MARS",e.STRIDE="STRIDE",e.MAYA="MAYA",e.AKASH="AKASH",e.IRIS="IRIS",e.PERSISTENCE="PERSISTENCE",e.SENTINEL="SENTINEL",e.REGEN="REGEN",e.CRYPTO_ORG="CRYPTO_ORG",e.SIF="SIF",e.CHIHUAHUA="CHIHUAHUA",e.JUNO="JUNO",e.KUJIRA="KUJIRA",e.STARNAME="STARNAME",e.COMDEX="COMDEX",e.STARGAZE="STARGAZE",e.DESMOS="DESMOS",e.BITCANNA="BITCANNA",e.SECRET="SECRET",e.INJECTIVE="INJECTIVE",e.LUMNETWORK="LUMNETWORK",e.BANDCHAIN="BANDCHAIN",e.EMONEY="EMONEY",e.BITSONG="BITSONG",e.KI="KI",e.MEDIBLOC="MEDIBLOC",e.KONSTELLATION="KONSTELLATION",e.UMEE="UMEE",e.STARKNET="STARKNET",e.TON="TON",e.BASE="BASE",e.SUI="SUI",e.XRPL="XRPL",e.ZCASH="ZCASH",e.Unknown="Unkown",e))(I||{}),E=(c=>(c.CONNECTED="connected",c.CONNECTING="connecting",c.REACHABLE="reachable",c.INSTALLED="installed",c.ACCOUNTS="accounts",c.NETWORK="network",c.NAMESPACE_DISCONNECTED="namespace_disconnected",c.PROVIDER_DISCONNECTED="provider_disconnected",c))(E||{});var N=class{static{r(this,"Persistor")}getItem(t){let n=localStorage.getItem(t);return n?JSON.parse(n):null}setItem(t,n){localStorage.setItem(t,JSON.stringify(n))}removeItem(t){localStorage.removeItem(t)}};function O(a,t){return`${t||""}:${a}`}r(O,"formatAddressWithNetwork");function y(a,t){return a?a.map(n=>O(n,t)):[]}r(y,"accountAddressesWithNetwork");function B(a){let[t,n]=a.split(":");return{network:t,address:n}}r(B,"readAccountAddress");function S(a){let{checkInstallation:t=!0}=a.config;return t}r(S,"needsCheckInstallation");var u=r((a,t)=>(a=typeof a=="string"&&a.startsWith("0x")?parseInt(a):a,Object.values(I).includes(String(a))?a:a==="Binance-Chain-Tigris"?"BNB":t.filter(o=>!!o.chainId).find(o=>(o.chainId?.startsWith("0x")?parseInt(o.chainId):o.chainId)==a)?.name||null),"getBlockChainNameFromId");async function A(a){if(await a.canEagerConnect())return await a.connectHandler();throw new Error(`can't restore connection for ${a.providerName}.`)}r(A,"eagerConnectHandler");function b(a){return a.namespace==="EVM"}r(b,"isEvmNamespace");var T=class{static{r(this,"Wallet")}provider;actions;state;options;info;cleanupSubscribe;constructor(t,n){this.actions=n,this.options=t,this.provider=null,this.info={supportedBlockchains:[],isContractWallet:!1,isHub:!1},this.state={connected:!1,connecting:!1,reachable:!1,installed:!1,accounts:null,network:null},S(t)||this.setInstalledAs(!0)}async suggestAndConnect(t){return this.actions.suggest&&await this.actions.suggest({instance:this.provider,meta:this.info.supportedBlockchains,network:t}),await this.connect(t)}async connect(t,n){if(this.state.connecting)throw new Error("Connecting...");let o=await this.getConnectionFromState(),i=this.state.network,s=t||i||this.options.config.defaultNetwork;if(o){let p=i!==s&&!!s;if(i===s)return o;let d=!0;if(this.actions.canSwitchNetworkTo&&(d=this.actions.canSwitchNetworkTo({provider:this.provider,meta:this.info.supportedBlockchains,network:s||""})),p&&d&&this.actions.switchNetwork)return await this.actions.switchNetwork({instance:this.provider,meta:this.info.supportedBlockchains,network:s,newInstance:this.tryGetInstance.bind(this),getState:this.getState.bind(this),updateChainId:this.updateChainId.bind(this)}),s!==this.state.network&&!this.options.config.isAsyncSwitchNetwork&&this.updateState({network:t}),{accounts:o.accounts,network:s,provider:this.provider}}let l=await this.tryGetInstance({network:t});this.updateState({connecting:!0}),this.setInstalledAs(!0);try{var g=await this.actions.connect({instance:l,network:s||void 0,meta:this.info.supportedBlockchains||[],namespaces:n})}catch(p){throw this.resetState(),p}this.updateState({connected:!0,reachable:!0,connecting:!1});let c=[],C=null,f;if(Array.isArray(g)){let p=null;c=g.flatMap(h=>{let v=h.chainId||"Unkown",m=u(v,this.info.supportedBlockchains)||"Unkown";return f=h.derivationPath?h.derivationPath:f,!p&&m!=="Unkown"&&this.info.supportedBlockchains.find(w=>w.name===m)?.info?.infoType==="EvmMetaInfo"&&(p=m),y(h.accounts,m)}).filter(Boolean),C=p||s||this.options.config.defaultNetwork}else{let p=g.chainId||"Unkown",d=u(p,this.info.supportedBlockchains)||"Unkown",h=g.derivationPath;c=y(g.accounts,d),C=d,f=h}return c.length>0&&this.updateState({accounts:c,network:C,derivationPath:f}),{accounts:this.state.accounts,network:this.state.network,provider:this.provider}}async disconnect(){this.resetState(),this.actions.disconnect&&this.actions.disconnect({instance:this.provider,destroyInstance:()=>{this.setProvider(null)}})}async eagerConnect(){let t=await this.tryGetInstance({network:void 0}),{canEagerConnect:n}=this.actions,o=this.options.config.type;return await A({canEagerConnect:async()=>{if(!n)throw new Error(`${o} provider hasn't implemented canEagerConnect.`);return await n({instance:t,meta:this.info.supportedBlockchains})},connectHandler:async()=>await this.connect(),providerName:o})}async getSigners(t){return await this.actions.getSigners(t)}getWalletInfo(t){return this.actions.getWalletInfo(t)}canSwitchNetworkTo(t,n){let o=this.actions.canSwitchNetworkTo;return o?o({network:t,meta:this.info.supportedBlockchains,provider:n}):!1}onInit(){if(!this.actions.getInstance)throw new Error(`Provider hasn't defined how to get wallet's instance. provider: ${this.options.config.type} on: onInit`);this.options.config.isAsyncInstance?S(this.options)&&this.actions.getInstance().then(t=>{t&&this.setInstalledAs(!0)}):this.actions.getInstance()&&!this.state.installed&&this.setInstalledAs(!0)}setProvider(t){if(this.provider=t,t&&this.actions.subscribe){let n=this.actions.subscribe({instance:t,state:this.state,meta:this.info.supportedBlockchains,connect:this.connect.bind(this),disconnect:this.disconnect.bind(this),updateAccounts:(o,i)=>{let s=this.state.network;i&&(s=u(i,this.info.supportedBlockchains)||"Unkown");let l=y(o,s);l.length>0&&this.updateState({accounts:l})},updateChainId:this.updateChainId.bind(this)});this.cleanupSubscribe=n}else!t&&this.cleanupSubscribe&&this.cleanupSubscribe()}setInfo(t){typeof t.supportedBlockchains<"u"&&(this.info.supportedBlockchains=t.supportedBlockchains),typeof t.isContractWallet<"u"&&(this.info.isContractWallet=t.isContractWallet)}setHandler(t){this.options.handler=t}getState(){return this.state}updateState(t){let n=[];typeof t.connected<"u"&&(this.state.connected=t.connected,n.push(["connected",t.connected])),typeof t.connecting<"u"&&(this.state.connecting=t.connecting,n.push(["connecting",t.connecting])),typeof t.reachable<"u"&&(this.state.reachable=t.reachable,n.push(["reachable",t.reachable])),typeof t.installed<"u"&&(this.state.installed=t.installed,n.push(["installed",t.installed])),typeof t.accounts<"u"&&(this.state.accounts=t.accounts,this.state.derivationPath=t.derivationPath,n.push(["accounts",t.accounts])),typeof t.network<"u"&&(this.state.network=t.network,n.push(["network",t.network]));let o=this.getState();n.forEach(([i,s])=>{let l={supportedBlockchains:this.info.supportedBlockchains,isContractWallet:this.info.isContractWallet,isHub:!1};this.options.handler(this.options.config.type,i,s,o,l)})}resetState(){this.updateState({connected:!1,connecting:!1,reachable:!1,accounts:null,network:null})}async getConnectionFromState(){return this.state.connected&&this.provider?{accounts:this.state.accounts,network:this.state.network,provider:this.provider}:null}updateChainId(t){let n=t?u(t,this.info.supportedBlockchains):"Unkown";this.updateState({network:n})}setInstalledAs(t){!S(this.options)&&t===!1||this.updateState({installed:t})}async tryGetInstance({network:t,force:n}){let o=null;if(this.setProvider(null),this.options.config.isAsyncInstance){let i={currentProvider:this.provider,meta:this.info.supportedBlockchains,force:n||!1,updateChainId:this.updateChainId.bind(this),getState:this.getState.bind(this)};t&&(i.network=t),o=await this.actions.getInstance(i)}else o=this.actions.getInstance();if(!o){this.setInstalledAs(!1),this.resetState();let i=`It seems your selected wallet (${this.options.config.type}) isn't installed.`;throw new Error(i)}return this.setProvider(o),o}},M=T;export{E as LegacyEvents,I as LegacyNetworks,M as LegacyWallet,N as Persistor,A as legacyEagerConnectHandler,O as legacyFormatAddressWithNetwork,u as legacyGetBlockChainNameFromId,b as legacyIsEvmNamespace,B as legacyReadAccountAddress};
1
+ var k=Object.defineProperty;var r=(a,t)=>k(a,"name",{value:t,configurable:!0});var I=(e=>(e.BTC="BTC",e.BSC="BSC",e.LTC="LTC",e.THORCHAIN="THOR",e.BCH="BCH",e.BINANCE="BNB",e.BLAST="BLAST",e.CELO="CELO",e.LINEA="LINEA",e.METIS="METIS",e.SONIC="SONIC",e.BERACHAIN="BERACHAIN",e.ZETA_CHAIN="ZETA_CHAIN",e.SCROLL="SCROLL",e.ZKSYNC="ZKSYNC",e.MONAD="MONAD",e.ETHEREUM="ETH",e.POLYGON="POLYGON",e.TERRA="TERRA",e.POLKADOT="",e.TRON="TRON",e.DOGE="DOGE",e.HARMONY="HARMONY",e.AVAX_CCHAIN="AVAX_CCHAIN",e.FANTOM="FANTOM",e.MOONBEAM="MOONBEAM",e.ARBITRUM="ARBITRUM",e.BOBA="BOBA",e.OPTIMISM="OPTIMISM",e.FUSE="FUSE",e.CRONOS="CRONOS",e.SOLANA="SOLANA",e.MOONRIVER="MOONRIVER",e.GNOSIS="GNOSIS",e.COSMOS="COSMOS",e.OSMOSIS="OSMOSIS",e.AXELAR="AXELAR",e.MARS="MARS",e.STRIDE="STRIDE",e.MAYA="MAYA",e.AKASH="AKASH",e.IRIS="IRIS",e.PERSISTENCE="PERSISTENCE",e.SENTINEL="SENTINEL",e.REGEN="REGEN",e.CRYPTO_ORG="CRYPTO_ORG",e.SIF="SIF",e.CHIHUAHUA="CHIHUAHUA",e.JUNO="JUNO",e.KUJIRA="KUJIRA",e.STARNAME="STARNAME",e.COMDEX="COMDEX",e.STARGAZE="STARGAZE",e.DESMOS="DESMOS",e.BITCANNA="BITCANNA",e.SECRET="SECRET",e.INJECTIVE="INJECTIVE",e.LUMNETWORK="LUMNETWORK",e.BANDCHAIN="BANDCHAIN",e.EMONEY="EMONEY",e.BITSONG="BITSONG",e.KI="KI",e.MEDIBLOC="MEDIBLOC",e.KONSTELLATION="KONSTELLATION",e.UMEE="UMEE",e.STARKNET="STARKNET",e.STELLAR="STELLAR",e.TON="TON",e.BASE="BASE",e.SUI="SUI",e.XRPL="XRPL",e.ZCASH="ZCASH",e.Unknown="Unkown",e))(I||{}),E=(c=>(c.CONNECTED="connected",c.CONNECTING="connecting",c.REACHABLE="reachable",c.INSTALLED="installed",c.ACCOUNTS="accounts",c.NETWORK="network",c.NAMESPACE_DISCONNECTED="namespace_disconnected",c.PROVIDER_DISCONNECTED="provider_disconnected",c))(E||{});var N=class{static{r(this,"Persistor")}getItem(t){let n=localStorage.getItem(t);return n?JSON.parse(n):null}setItem(t,n){localStorage.setItem(t,JSON.stringify(n))}removeItem(t){localStorage.removeItem(t)}};function O(a,t){return`${t||""}:${a}`}r(O,"formatAddressWithNetwork");function y(a,t){return a?a.map(n=>O(n,t)):[]}r(y,"accountAddressesWithNetwork");function B(a){let[t,n]=a.split(":");return{network:t,address:n}}r(B,"readAccountAddress");function S(a){let{checkInstallation:t=!0}=a.config;return t}r(S,"needsCheckInstallation");var u=r((a,t)=>(a=typeof a=="string"&&a.startsWith("0x")?parseInt(a):a,Object.values(I).includes(String(a))?a:a==="Binance-Chain-Tigris"?"BNB":t.filter(o=>!!o.chainId).find(o=>(o.chainId?.startsWith("0x")?parseInt(o.chainId):o.chainId)==a)?.name||null),"getBlockChainNameFromId");async function A(a){if(await a.canEagerConnect())return await a.connectHandler();throw new Error(`can't restore connection for ${a.providerName}.`)}r(A,"eagerConnectHandler");function b(a){return a.namespace==="EVM"}r(b,"isEvmNamespace");var T=class{static{r(this,"Wallet")}provider;actions;state;options;info;cleanupSubscribe;constructor(t,n){this.actions=n,this.options=t,this.provider=null,this.info={supportedBlockchains:[],isContractWallet:!1,isHub:!1},this.state={connected:!1,connecting:!1,reachable:!1,installed:!1,accounts:null,network:null},S(t)||this.setInstalledAs(!0)}async suggestAndConnect(t){return this.actions.suggest&&await this.actions.suggest({instance:this.provider,meta:this.info.supportedBlockchains,network:t}),await this.connect(t)}async connect(t,n){if(this.state.connecting)throw new Error("Connecting...");let o=await this.getConnectionFromState(),i=this.state.network,s=t||i||this.options.config.defaultNetwork;if(o){let p=i!==s&&!!s;if(i===s)return o;let d=!0;if(this.actions.canSwitchNetworkTo&&(d=this.actions.canSwitchNetworkTo({provider:this.provider,meta:this.info.supportedBlockchains,network:s||""})),p&&d&&this.actions.switchNetwork)return await this.actions.switchNetwork({instance:this.provider,meta:this.info.supportedBlockchains,network:s,newInstance:this.tryGetInstance.bind(this),getState:this.getState.bind(this),updateChainId:this.updateChainId.bind(this)}),s!==this.state.network&&!this.options.config.isAsyncSwitchNetwork&&this.updateState({network:t}),{accounts:o.accounts,network:s,provider:this.provider}}let l=await this.tryGetInstance({network:t});this.updateState({connecting:!0}),this.setInstalledAs(!0);try{var g=await this.actions.connect({instance:l,network:s||void 0,meta:this.info.supportedBlockchains||[],namespaces:n})}catch(p){throw this.resetState(),p}this.updateState({connected:!0,reachable:!0,connecting:!1});let c=[],C=null,f;if(Array.isArray(g)){let p=null;c=g.flatMap(h=>{let v=h.chainId||"Unkown",m=u(v,this.info.supportedBlockchains)||"Unkown";return f=h.derivationPath?h.derivationPath:f,!p&&m!=="Unkown"&&this.info.supportedBlockchains.find(w=>w.name===m)?.info?.infoType==="EvmMetaInfo"&&(p=m),y(h.accounts,m)}).filter(Boolean),C=p||s||this.options.config.defaultNetwork}else{let p=g.chainId||"Unkown",d=u(p,this.info.supportedBlockchains)||"Unkown",h=g.derivationPath;c=y(g.accounts,d),C=d,f=h}return c.length>0&&this.updateState({accounts:c,network:C,derivationPath:f}),{accounts:this.state.accounts,network:this.state.network,provider:this.provider}}async disconnect(){this.resetState(),this.actions.disconnect&&this.actions.disconnect({instance:this.provider,destroyInstance:()=>{this.setProvider(null)}})}async eagerConnect(){let t=await this.tryGetInstance({network:void 0}),{canEagerConnect:n}=this.actions,o=this.options.config.type;return await A({canEagerConnect:async()=>{if(!n)throw new Error(`${o} provider hasn't implemented canEagerConnect.`);return await n({instance:t,meta:this.info.supportedBlockchains})},connectHandler:async()=>await this.connect(),providerName:o})}async getSigners(t){return await this.actions.getSigners(t)}getWalletInfo(t){return this.actions.getWalletInfo(t)}canSwitchNetworkTo(t,n){let o=this.actions.canSwitchNetworkTo;return o?o({network:t,meta:this.info.supportedBlockchains,provider:n}):!1}onInit(){if(!this.actions.getInstance)throw new Error(`Provider hasn't defined how to get wallet's instance. provider: ${this.options.config.type} on: onInit`);this.options.config.isAsyncInstance?S(this.options)&&this.actions.getInstance().then(t=>{t&&this.setInstalledAs(!0)}):this.actions.getInstance()&&!this.state.installed&&this.setInstalledAs(!0)}setProvider(t){if(this.provider=t,t&&this.actions.subscribe){let n=this.actions.subscribe({instance:t,state:this.state,meta:this.info.supportedBlockchains,connect:this.connect.bind(this),disconnect:this.disconnect.bind(this),updateAccounts:(o,i)=>{let s=this.state.network;i&&(s=u(i,this.info.supportedBlockchains)||"Unkown");let l=y(o,s);l.length>0&&this.updateState({accounts:l})},updateChainId:this.updateChainId.bind(this)});this.cleanupSubscribe=n}else!t&&this.cleanupSubscribe&&this.cleanupSubscribe()}setInfo(t){typeof t.supportedBlockchains<"u"&&(this.info.supportedBlockchains=t.supportedBlockchains),typeof t.isContractWallet<"u"&&(this.info.isContractWallet=t.isContractWallet)}setHandler(t){this.options.handler=t}getState(){return this.state}updateState(t){let n=[];typeof t.connected<"u"&&(this.state.connected=t.connected,n.push(["connected",t.connected])),typeof t.connecting<"u"&&(this.state.connecting=t.connecting,n.push(["connecting",t.connecting])),typeof t.reachable<"u"&&(this.state.reachable=t.reachable,n.push(["reachable",t.reachable])),typeof t.installed<"u"&&(this.state.installed=t.installed,n.push(["installed",t.installed])),typeof t.accounts<"u"&&(this.state.accounts=t.accounts,this.state.derivationPath=t.derivationPath,n.push(["accounts",t.accounts])),typeof t.network<"u"&&(this.state.network=t.network,n.push(["network",t.network]));let o=this.getState();n.forEach(([i,s])=>{let l={supportedBlockchains:this.info.supportedBlockchains,isContractWallet:this.info.isContractWallet,isHub:!1};this.options.handler(this.options.config.type,i,s,o,l)})}resetState(){this.updateState({connected:!1,connecting:!1,reachable:!1,accounts:null,network:null})}async getConnectionFromState(){return this.state.connected&&this.provider?{accounts:this.state.accounts,network:this.state.network,provider:this.provider}:null}updateChainId(t){let n=t?u(t,this.info.supportedBlockchains):"Unkown";this.updateState({network:n})}setInstalledAs(t){!S(this.options)&&t===!1||this.updateState({installed:t})}async tryGetInstance({network:t,force:n}){let o=null;if(this.setProvider(null),this.options.config.isAsyncInstance){let i={currentProvider:this.provider,meta:this.info.supportedBlockchains,force:n||!1,updateChainId:this.updateChainId.bind(this),getState:this.getState.bind(this)};t&&(i.network=t),o=await this.actions.getInstance(i)}else o=this.actions.getInstance();if(!o){this.setInstalledAs(!1),this.resetState();let i=`It seems your selected wallet (${this.options.config.type}) isn't installed.`;throw new Error(i)}return this.setProvider(o),o}},M=T;export{E as LegacyEvents,I as LegacyNetworks,M as LegacyWallet,N as Persistor,A as legacyEagerConnectHandler,O as legacyFormatAddressWithNetwork,u as legacyGetBlockChainNameFromId,b as legacyIsEvmNamespace,B as legacyReadAccountAddress};
2
2
  //# sourceMappingURL=mod.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/legacy/types.ts", "../../src/legacy/persistor.ts", "../../src/legacy/helpers.ts", "../../src/legacy/utils.ts", "../../src/legacy/wallet.ts"],
4
- "sourcesContent": ["import type { State as WalletState } from './wallet.js';\nimport type { Namespace } from '../namespaces/common/mod.js';\nimport type { BlockchainMeta, SignerFactory } from 'rango-types';\n\nexport enum Networks {\n BTC = 'BTC',\n BSC = 'BSC',\n LTC = 'LTC',\n THORCHAIN = 'THOR',\n BCH = 'BCH',\n BINANCE = 'BNB',\n BLAST = 'BLAST',\n CELO = 'CELO',\n LINEA = 'LINEA',\n METIS = 'METIS',\n SONIC = 'SONIC',\n BERACHAIN = 'BERACHAIN',\n ZETA_CHAIN = 'ZETA_CHAIN',\n SCROLL = 'SCROLL',\n ZKSYNC = 'ZKSYNC',\n MONAD = 'MONAD',\n ETHEREUM = 'ETH',\n POLYGON = 'POLYGON',\n TERRA = 'TERRA',\n POLKADOT = '',\n TRON = 'TRON',\n DOGE = 'DOGE',\n HARMONY = 'HARMONY',\n AVAX_CCHAIN = 'AVAX_CCHAIN',\n FANTOM = 'FANTOM',\n MOONBEAM = 'MOONBEAM',\n ARBITRUM = 'ARBITRUM',\n BOBA = 'BOBA',\n OPTIMISM = 'OPTIMISM',\n FUSE = 'FUSE',\n CRONOS = 'CRONOS',\n SOLANA = 'SOLANA',\n MOONRIVER = 'MOONRIVER',\n GNOSIS = 'GNOSIS',\n COSMOS = 'COSMOS',\n OSMOSIS = 'OSMOSIS',\n AXELAR = 'AXELAR',\n MARS = 'MARS',\n STRIDE = 'STRIDE',\n MAYA = 'MAYA',\n AKASH = 'AKASH',\n IRIS = 'IRIS',\n PERSISTENCE = 'PERSISTENCE',\n SENTINEL = 'SENTINEL',\n REGEN = 'REGEN',\n CRYPTO_ORG = 'CRYPTO_ORG',\n SIF = 'SIF',\n CHIHUAHUA = 'CHIHUAHUA',\n JUNO = 'JUNO',\n KUJIRA = 'KUJIRA',\n STARNAME = 'STARNAME',\n COMDEX = 'COMDEX',\n STARGAZE = 'STARGAZE',\n DESMOS = 'DESMOS',\n BITCANNA = 'BITCANNA',\n SECRET = 'SECRET',\n INJECTIVE = 'INJECTIVE',\n LUMNETWORK = 'LUMNETWORK',\n BANDCHAIN = 'BANDCHAIN',\n EMONEY = 'EMONEY',\n BITSONG = 'BITSONG',\n KI = 'KI',\n MEDIBLOC = 'MEDIBLOC',\n KONSTELLATION = 'KONSTELLATION',\n UMEE = 'UMEE',\n STARKNET = 'STARKNET',\n TON = 'TON',\n BASE = 'BASE',\n SUI = 'SUI',\n XRPL = 'XRPL',\n ZCASH = 'ZCASH',\n\n // Using instead of null\n Unknown = 'Unkown',\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype InstanceType = any;\n\nexport type NamespaceData = {\n namespace: Namespace;\n derivationPath?: string;\n};\n\nexport type WalletType = string;\nexport type Network = string;\n\nexport type InstallObjects = {\n CHROME?: string;\n FIREFOX?: string;\n EDGE?: string;\n BRAVE?: string;\n DEFAULT: string;\n};\n\nexport type NamespaceMeta = {\n label: string;\n /**\n * By using a matched `blockchain.name` (in meta) and `id`, we show logo in Namespace modal\n * e.g. ETH\n */\n id: string;\n value: Namespace;\n unsupported?: boolean;\n getSupportedChains: (chains: BlockchainMeta[]) => BlockchainMeta[];\n};\n\ninterface NeedsNamespace {\n selection: 'single' | 'multiple';\n data: NamespaceMeta[];\n}\n\ninterface NeedsDerivationPath {\n data: {\n id: string;\n label: string;\n namespace: Namespace;\n generateDerivationPath: (index: string) => string;\n }[];\n}\n\nexport type WalletInfo = {\n name: string;\n img: string;\n installLink: InstallObjects | string;\n /**\n * @deprecated we don't use this value anymore.\n */\n color: string;\n supportedChains: BlockchainMeta[];\n showOnMobile?: boolean;\n isContractWallet?: boolean;\n mobileWallet?: boolean;\n\n needsDerivationPath?: NeedsDerivationPath;\n needsNamespace?: NeedsNamespace;\n};\n\nexport type State = {\n [key: string]: WalletState | undefined;\n};\n\nexport type ConnectResult = {\n accounts: string[] | null;\n network: Network | null;\n provider: InstanceType;\n};\n\nexport type Providers = { [type in WalletType]?: InstanceType };\nexport type NetworkProviderMap = Map<Networks, unknown>;\n\nexport enum Events {\n CONNECTED = 'connected',\n CONNECTING = 'connecting',\n REACHABLE = 'reachable',\n INSTALLED = 'installed',\n ACCOUNTS = 'accounts',\n NETWORK = 'network',\n // Hub only events\n NAMESPACE_DISCONNECTED = 'namespace_disconnected',\n\n PROVIDER_DISCONNECTED = 'provider_disconnected',\n}\n\nexport type ProviderConnectResult = {\n accounts: string[];\n chainId: string;\n derivationPath?: string;\n};\n\nexport type GetInstanceOptions = {\n network?: Network;\n currentProvider: InstanceType;\n meta: BlockchainMeta[];\n getState: () => WalletState;\n /**\n * We always get the instance once and reuse it whenever we needs. By using this option\n * We can force the library to get a new instance and replace it with the old one.\n *\n * Originally, we used this option for wallet connect 1 and its switching network challenge.\n */\n force?: boolean;\n updateChainId: (chainId: number | string) => void;\n};\n\nexport type GetInstance =\n | (() => InstanceType)\n | ((options: GetInstanceOptions) => Promise<InstanceType>);\n\nexport type TryGetInstance =\n | (() => InstanceType)\n | ((\n options: Pick<GetInstanceOptions, 'force' | 'network'>\n ) => Promise<InstanceType>);\n\nexport type Connect = (options: {\n instance: InstanceType;\n network?: Network;\n meta: BlockchainMeta[];\n namespaces?: NamespaceData[];\n}) => Promise<ProviderConnectResult | ProviderConnectResult[]>;\n\nexport type Disconnect = (options: {\n instance: InstanceType;\n destroyInstance: () => void;\n}) => Promise<void>;\n\ntype CleanupSubscribe = () => void;\n\nexport type Subscribe = (options: {\n instance: InstanceType;\n state: WalletState;\n meta: BlockchainMeta[];\n updateChainId: (chainId: string) => void;\n updateAccounts: (accounts: string[], chainId?: string) => void;\n connect: (network?: Network) => void;\n disconnect: () => void;\n}) => CleanupSubscribe | void;\n\nexport type SwitchNetwork = (options: {\n instance: InstanceType;\n network: Network;\n meta: BlockchainMeta[];\n newInstance?: TryGetInstance;\n getState?: () => WalletState;\n updateChainId: (chainId: string) => void;\n}) => Promise<void>;\n\nexport type Suggest = (options: {\n instance: InstanceType;\n network: Network;\n meta: BlockchainMeta[];\n}) => Promise<void>;\n\nexport type CanSwitchNetwork = (options: {\n network: Network;\n meta: BlockchainMeta[];\n provider: InstanceType;\n}) => boolean;\n\nexport type CanEagerConnect = (options: {\n instance: InstanceType;\n meta: BlockchainMeta[];\n}) => Promise<boolean>;\n\nexport type EagerConnectResult<I = unknown> = {\n accounts: string[] | null;\n network: string | null;\n provider: I | null;\n};\n\nexport interface WalletActions {\n connect: Connect;\n getInstance: InstanceType;\n disconnect?: Disconnect;\n subscribe?: Subscribe;\n // unsubscribe, // coupled to subscribe.\n\n // Optional, but should be provided at the same time.\n suggest?: Suggest;\n switchNetwork?: SwitchNetwork;\n getSigners: (provider: InstanceType) => Promise<SignerFactory>;\n canSwitchNetworkTo?: CanSwitchNetwork;\n canEagerConnect?: CanEagerConnect;\n getWalletInfo(allBlockChains: BlockchainMeta[]): WalletInfo;\n}\n\nexport interface WalletConfig {\n type: WalletType;\n defaultNetwork?: Network;\n checkInstallation?: boolean;\n isAsyncInstance?: boolean;\n isAsyncSwitchNetwork?: boolean;\n}\n\nexport type WalletProviders = Map<\n WalletType,\n {\n actions: WalletActions;\n config: WalletConfig;\n }\n>;\n\nexport type ProviderInterface = { config: WalletConfig } & WalletActions;\n\n// it comes from wallets.ts and `connect`\ntype NetworkTypeFromLegacyConnect = Network | undefined;\n\nexport type NamespaceInputForConnect<T extends Namespace = Namespace> = {\n /**\n * By default, you should specify namespace (e.g. evm).\n */\n namespace: T;\n /**\n * In some cases, we need to connect a specific network on a namespace. e.g. Polygon on EVM.\n */\n network: NetworkTypeFromLegacyConnect;\n derivationPath?: string;\n};\n", "export interface PersistStorage<T> {\n getItem: (name: string) => T | null;\n setItem: (name: string, value: T) => void;\n removeItem: (name: string) => void;\n}\n\nexport class Persistor<T> implements PersistStorage<T> {\n getItem(name: string) {\n const item = localStorage.getItem(name);\n const parsedItem = item ? (JSON.parse(item) as T) : null;\n return parsedItem;\n }\n setItem(name: string, value: T) {\n localStorage.setItem(name, JSON.stringify(value));\n }\n removeItem(name: string) {\n localStorage.removeItem(name);\n }\n}\n", "import type { Network } from './types.js';\nimport type { Options } from './wallet.js';\nimport type { BlockchainMeta } from 'rango-types';\n\nimport { Networks } from './types.js';\n\nexport function formatAddressWithNetwork(\n address: string,\n network?: Network | null\n) {\n return `${network || ''}:${address}`;\n}\n\nexport function accountAddressesWithNetwork(\n addresses: string[] | null,\n network?: Network | null\n) {\n if (!addresses) {\n return [];\n }\n\n return addresses.map((address) => {\n return formatAddressWithNetwork(address, network);\n });\n}\n\nexport function readAccountAddress(addressWithNetwork: string): {\n address: string;\n network: Network;\n} {\n const [network, address] = addressWithNetwork.split(':');\n\n return {\n network,\n address,\n };\n}\n\nexport function needsCheckInstallation(options: Options) {\n const { checkInstallation = true } = options.config;\n return checkInstallation;\n}\n\nexport const getBlockChainNameFromId = (\n chainId: string | number,\n blockchains: BlockchainMeta[]\n): Network | null => {\n chainId =\n typeof chainId === 'string' && chainId.startsWith('0x')\n ? parseInt(chainId)\n : chainId;\n\n /*\n * Sometimes providers are passing `Network` as chainId.\n * If chainId is a `Network`, we return itself.\n */\n const allNetworks = Object.values(Networks);\n if (allNetworks.includes(String(chainId) as Networks)) {\n return chainId as Networks;\n }\n\n if (chainId === 'Binance-Chain-Tigris') {\n return Networks.BINANCE;\n }\n return (\n blockchains\n .filter((blockchainMeta) => !!blockchainMeta.chainId)\n .find((blockchainMeta) => {\n const blockchainChainId = blockchainMeta.chainId?.startsWith('0x')\n ? parseInt(blockchainMeta.chainId)\n : blockchainMeta.chainId;\n return blockchainChainId == chainId;\n })?.name || null\n );\n};\n", "import type { NamespaceInputForConnect } from './types.js';\n\nexport async function eagerConnectHandler<R = unknown>(params: {\n canEagerConnect: () => Promise<boolean>;\n connectHandler: () => Promise<R>;\n providerName: string;\n}) {\n // Check if we can eagerly connect to the wallet\n if (await params.canEagerConnect()) {\n // Connect to wallet as usual\n return await params.connectHandler();\n }\n throw new Error(`can't restore connection for ${params.providerName}.`);\n}\n\nexport function isEvmNamespace(\n namespace: NamespaceInputForConnect\n): namespace is NamespaceInputForConnect<'EVM'> {\n return namespace.namespace === 'EVM';\n}\n", "import type {\n EagerConnectResult,\n GetInstanceOptions,\n NamespaceData,\n Network,\n WalletActions,\n WalletConfig,\n WalletType,\n} from './types.js';\nimport type { Namespace } from '../namespaces/common/types.js';\nimport type { BlockchainMeta } from 'rango-types';\n\nimport {\n accountAddressesWithNetwork,\n getBlockChainNameFromId,\n needsCheckInstallation,\n} from './helpers.js';\nimport { Events, Networks } from './types.js';\nimport { eagerConnectHandler } from './utils.js';\n\nexport type EventHandler = (\n type: WalletType,\n event: Events,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n value: any,\n coreState: State,\n info: EventInfo\n) => void;\n\nexport type EventInfo = {\n supportedBlockchains: BlockchainMeta[];\n isContractWallet: boolean;\n\n // Hub fields\n isHub: boolean;\n // will be set alongside ACCOUNT event\n namespace?: Namespace;\n derivationPath?: string;\n};\n\nexport interface State {\n connected: boolean;\n connecting: boolean;\n /**\n * @depreacted it always returns `false`. don't use it.\n */\n reachable: boolean;\n installed: boolean;\n accounts: string[] | null;\n network: Network | null;\n derivationPath?: string;\n}\n\nexport interface Options {\n config: WalletConfig;\n handler: EventHandler;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nclass Wallet<InstanceType = any> {\n public provider: InstanceType | null;\n private actions: WalletActions;\n private state: State;\n private options: Options;\n private info: EventInfo;\n private cleanupSubscribe?: (() => void) | void;\n\n constructor(options: Options, actions: WalletActions) {\n this.actions = actions;\n this.options = options;\n this.provider = null;\n this.info = {\n supportedBlockchains: [],\n isContractWallet: false,\n isHub: false,\n };\n this.state = {\n connected: false,\n connecting: false,\n // TODO: Remove\n reachable: false,\n installed: false,\n accounts: null,\n network: null,\n };\n\n if (!needsCheckInstallation(options)) {\n this.setInstalledAs(true);\n }\n }\n\n async suggestAndConnect(network: Network) {\n if (this.actions.suggest) {\n await this.actions.suggest({\n instance: this.provider,\n meta: this.info.supportedBlockchains,\n network,\n });\n }\n return await this.connect(network);\n }\n\n async connect(network?: Network, namespaces?: NamespaceData[]) {\n // If it's connecting, nothing do.\n if (this.state.connecting) {\n throw new Error('Connecting...');\n }\n\n const connectionFromState = await this.getConnectionFromState();\n const currentNetwork = this.state.network;\n /*\n * If a network hasn't been provided and also we have `lastNetwork`\n * We will use lastNetwork to make sure we will not\n * Ask the user to switch his network wrongly.\n */\n const requestedNetwork =\n network || currentNetwork || this.options.config.defaultNetwork;\n\n if (connectionFromState) {\n const networkChanged =\n currentNetwork !== requestedNetwork && !!requestedNetwork;\n\n // Reuse current connection if nothing has changed and we already have the connection in memory.\n if (currentNetwork === requestedNetwork) {\n return connectionFromState;\n }\n\n let canSwitch = true;\n if (this.actions.canSwitchNetworkTo) {\n canSwitch = this.actions.canSwitchNetworkTo({\n provider: this.provider,\n meta: this.info.supportedBlockchains,\n network: requestedNetwork || '',\n });\n }\n\n if (networkChanged && canSwitch && !!this.actions.switchNetwork) {\n await this.actions.switchNetwork({\n instance: this.provider,\n meta: this.info.supportedBlockchains,\n // TODO: Fix type error\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n network: requestedNetwork,\n newInstance: this.tryGetInstance.bind(this),\n getState: this.getState.bind(this),\n updateChainId: this.updateChainId.bind(this),\n });\n\n /*\n * We assume if we reach here (`switchNetwork` not throwing error), Switch successfully has been done.\n * But for providers with async switch network like wallet-connect, we need to wait for chain change\n * event before changing network.\n */\n if (\n requestedNetwork !== this.state.network &&\n !this.options.config.isAsyncSwitchNetwork\n ) {\n this.updateState({\n network,\n });\n }\n\n return {\n // Only network has been changed, so we reuse accounts from what we have already.\n accounts: connectionFromState.accounts,\n network: requestedNetwork,\n provider: this.provider,\n };\n }\n\n // If none of the above conditions didn't match, continute to connect.\n }\n\n // We are connecting to wallet for the first time\n\n // Trying to get wallet's instance, if it's not available, raise an error.\n const instance = await this.tryGetInstance({ network });\n\n // Instance exists, trying to connect\n this.updateState({\n connecting: true,\n });\n this.setInstalledAs(true);\n\n try {\n // eslint-disable-next-line no-var\n var connectResult = await this.actions.connect({\n instance,\n network: requestedNetwork || undefined,\n meta: this.info.supportedBlockchains || [],\n namespaces,\n });\n } catch (e) {\n this.resetState();\n throw e;\n }\n\n this.updateState({\n connected: true,\n reachable: true,\n connecting: false,\n });\n\n // TODO: Handle accounts.length > 0\n\n // Inserting accounts into our state.\n let nextAccounts: string[] = [];\n let nextNetwork: Network | null | undefined = null;\n let nextDerivationPath: string | undefined = undefined;\n if (Array.isArray(connectResult)) {\n let activeEvmNetwork: Network | null = null;\n const accounts = connectResult.flatMap((blockchain) => {\n const chainId = blockchain.chainId || Networks.Unknown;\n // Try to map chainId with a Network, if not found, we use chainId directly.\n const network =\n getBlockChainNameFromId(chainId, this.info.supportedBlockchains) ||\n Networks.Unknown;\n nextDerivationPath = blockchain.derivationPath\n ? blockchain.derivationPath\n : nextDerivationPath;\n\n /*\n * When connecting to an evm instance, it will return address and wallet's active chain.\n * On switch network we are comparing state's network and what passed as requestedNetwork.\n * This code is for making sure we are setting correct active chain in state if it's evm.\n */\n if (!activeEvmNetwork && network !== Networks.Unknown) {\n const blockchainMeta = this.info.supportedBlockchains.find(\n (blockchain) => blockchain.name === network\n );\n if (blockchainMeta?.info?.infoType === 'EvmMetaInfo') {\n activeEvmNetwork = network;\n }\n }\n // TODO: second parameter should be `string` when we decided to open source the package.\n return accountAddressesWithNetwork(blockchain.accounts, network);\n });\n nextAccounts = accounts.filter(Boolean);\n nextNetwork =\n activeEvmNetwork ||\n requestedNetwork ||\n this.options.config.defaultNetwork;\n } else {\n const chainId = connectResult.chainId || Networks.Unknown;\n const network =\n getBlockChainNameFromId(chainId, this.info.supportedBlockchains) ||\n Networks.Unknown;\n const derivationPath = connectResult.derivationPath;\n\n // We fallback to current active network if `chainId` not provided.\n nextAccounts = accountAddressesWithNetwork(\n connectResult.accounts,\n network\n );\n nextNetwork = network;\n nextDerivationPath = derivationPath;\n }\n\n if (nextAccounts.length > 0) {\n this.updateState({\n accounts: nextAccounts,\n network: nextNetwork,\n derivationPath: nextDerivationPath,\n });\n }\n\n return {\n accounts: this.state.accounts,\n network: this.state.network,\n provider: this.provider,\n };\n }\n\n async disconnect() {\n this.resetState();\n\n if (this.actions.disconnect) {\n void this.actions.disconnect({\n instance: this.provider,\n // On wallet connect, we need to destory the instance and get a whole new instance when we are going to connect\n destroyInstance: () => {\n this.setProvider(null);\n },\n });\n }\n }\n\n // This method is only used for auto connection\n async eagerConnect(): Promise<EagerConnectResult<InstanceType>> {\n const instance = await this.tryGetInstance({ network: undefined });\n const { canEagerConnect } = this.actions;\n const providerName = this.options.config.type;\n\n return await eagerConnectHandler({\n canEagerConnect: async () => {\n if (!canEagerConnect) {\n throw new Error(\n `${providerName} provider hasn't implemented canEagerConnect.`\n );\n }\n\n return await canEagerConnect({\n instance: instance,\n meta: this.info.supportedBlockchains,\n });\n },\n connectHandler: async () => {\n const result = await this.connect();\n return result;\n },\n providerName,\n });\n }\n\n async getSigners(provider: InstanceType) {\n return await this.actions.getSigners(provider);\n }\n getWalletInfo(allBlockChains: BlockchainMeta[]) {\n return this.actions.getWalletInfo(allBlockChains);\n }\n canSwitchNetworkTo(network: Network, provider: InstanceType) {\n const switchTo = this.actions.canSwitchNetworkTo;\n if (!switchTo) {\n return false;\n }\n\n return switchTo({\n network,\n meta: this.info.supportedBlockchains,\n provider,\n });\n }\n\n onInit() {\n // some times functions can be overridden by wallets. see rf-2119\n if (!this.actions.getInstance) {\n throw new Error(\n `Provider hasn't defined how to get wallet's instance. provider: ${this.options.config.type} on: onInit`\n );\n }\n\n if (!this.options.config.isAsyncInstance) {\n const instance = this.actions.getInstance();\n if (!!instance && !this.state.installed) {\n this.setInstalledAs(true);\n }\n } else if (needsCheckInstallation(this.options)) {\n this.actions.getInstance().then((data: unknown) => {\n if (data) {\n this.setInstalledAs(true);\n }\n });\n }\n }\n\n setProvider(value: InstanceType | null) {\n this.provider = value;\n if (!!value && !!this.actions.subscribe) {\n const cleanup = this.actions.subscribe({\n instance: value,\n state: this.state,\n meta: this.info.supportedBlockchains,\n connect: this.connect.bind(this),\n disconnect: this.disconnect.bind(this),\n updateAccounts: (accounts, chainId) => {\n let network = this.state.network;\n if (chainId) {\n network =\n getBlockChainNameFromId(\n chainId,\n this.info.supportedBlockchains\n ) || Networks.Unknown;\n }\n\n const nextAccounts = accountAddressesWithNetwork(accounts, network);\n if (nextAccounts.length > 0) {\n this.updateState({\n accounts: nextAccounts,\n });\n }\n },\n updateChainId: this.updateChainId.bind(this),\n });\n this.cleanupSubscribe = cleanup;\n } else if (!value && this.cleanupSubscribe) {\n this.cleanupSubscribe();\n }\n }\n\n setInfo(info: Partial<EventInfo>) {\n if (typeof info.supportedBlockchains !== 'undefined') {\n this.info.supportedBlockchains = info.supportedBlockchains;\n }\n if (typeof info.isContractWallet !== 'undefined') {\n this.info.isContractWallet = info.isContractWallet;\n }\n }\n\n setHandler(handler: EventHandler) {\n this.options.handler = handler;\n }\n\n getState(): State {\n return this.state;\n }\n\n updateState(states: Partial<State>) {\n /*\n * We will notify handler after updating all the states.\n * Because when we call `handler` it will has latest states.\n */\n const updates: [Events, unknown][] = [];\n\n if (typeof states.connected !== 'undefined') {\n this.state.connected = states.connected;\n updates.push([Events.CONNECTED, states.connected]);\n }\n if (typeof states.connecting !== 'undefined') {\n this.state.connecting = states.connecting;\n updates.push([Events.CONNECTING, states.connecting]);\n }\n if (typeof states.reachable !== 'undefined') {\n this.state.reachable = states.reachable;\n updates.push([Events.REACHABLE, states.reachable]);\n }\n if (typeof states.installed !== 'undefined') {\n this.state.installed = states.installed;\n updates.push([Events.INSTALLED, states.installed]);\n }\n if (typeof states.accounts !== 'undefined') {\n this.state.accounts = states.accounts;\n this.state.derivationPath = states.derivationPath;\n updates.push([Events.ACCOUNTS, states.accounts]);\n }\n if (typeof states.network !== 'undefined') {\n this.state.network = states.network;\n updates.push([Events.NETWORK, states.network]);\n }\n\n const state = this.getState();\n updates.forEach(([name, value]) => {\n const eventInfo: EventInfo = {\n supportedBlockchains: this.info.supportedBlockchains,\n isContractWallet: this.info.isContractWallet,\n isHub: false,\n };\n this.options.handler(\n this.options.config.type,\n name,\n value,\n state,\n eventInfo\n );\n });\n }\n\n resetState() {\n this.updateState({\n connected: false,\n connecting: false,\n reachable: false,\n accounts: null,\n network: null,\n });\n }\n\n private async getConnectionFromState() {\n // Already connected, so we return provider that we have in memory.\n\n /*\n * For switching network on Trust Wallet (WalletConnect),\n * We only kill the session (and not restting the whole state)\n * So we are relying on this.provider for achieving this functionality.\n */\n if (this.state.connected && !!this.provider) {\n return {\n accounts: this.state.accounts,\n network: this.state.network,\n provider: this.provider,\n };\n }\n\n return null;\n }\n\n private updateChainId(chainId: string | number) {\n const network = chainId\n ? getBlockChainNameFromId(chainId, this.info.supportedBlockchains)\n : Networks.Unknown;\n\n this.updateState({\n network,\n });\n }\n\n private setInstalledAs(value: boolean) {\n if (!needsCheckInstallation(this.options) && value === false) {\n return;\n }\n\n this.updateState({\n installed: value,\n });\n }\n // eslint-disable-next-line destructuring/in-methods-params\n private async tryGetInstance({\n network,\n force,\n }: {\n network?: Network;\n force?: boolean;\n }) {\n let instance = null;\n /*\n * For switching network on Trust Wallet (WalletConnect),\n * We only kill the session (and not restting the whole state)\n * So we are relying on this.provider for achieving this functionality.\n */\n this.setProvider(null);\n if (this.options.config.isAsyncInstance) {\n // Trying to connect\n const instanceOptions: GetInstanceOptions = {\n currentProvider: this.provider,\n meta: this.info.supportedBlockchains,\n force: force || false,\n updateChainId: this.updateChainId.bind(this),\n getState: this.getState.bind(this),\n };\n\n if (network) {\n instanceOptions.network = network;\n }\n instance = await this.actions.getInstance(instanceOptions);\n } else {\n instance = this.actions.getInstance();\n }\n\n if (!instance) {\n this.setInstalledAs(false);\n this.resetState();\n\n const error_message = `It seems your selected wallet (${this.options.config.type}) isn't installed.`;\n throw new Error(error_message);\n }\n\n this.setProvider(instance);\n return instance;\n }\n}\n\nexport default Wallet;\n"],
5
- "mappings": "+EAIO,IAAKA,OACVA,EAAA,IAAM,MACNA,EAAA,IAAM,MACNA,EAAA,IAAM,MACNA,EAAA,UAAY,OACZA,EAAA,IAAM,MACNA,EAAA,QAAU,MACVA,EAAA,MAAQ,QACRA,EAAA,KAAO,OACPA,EAAA,MAAQ,QACRA,EAAA,MAAQ,QACRA,EAAA,MAAQ,QACRA,EAAA,UAAY,YACZA,EAAA,WAAa,aACbA,EAAA,OAAS,SACTA,EAAA,OAAS,SACTA,EAAA,MAAQ,QACRA,EAAA,SAAW,MACXA,EAAA,QAAU,UACVA,EAAA,MAAQ,QACRA,EAAA,SAAW,GACXA,EAAA,KAAO,OACPA,EAAA,KAAO,OACPA,EAAA,QAAU,UACVA,EAAA,YAAc,cACdA,EAAA,OAAS,SACTA,EAAA,SAAW,WACXA,EAAA,SAAW,WACXA,EAAA,KAAO,OACPA,EAAA,SAAW,WACXA,EAAA,KAAO,OACPA,EAAA,OAAS,SACTA,EAAA,OAAS,SACTA,EAAA,UAAY,YACZA,EAAA,OAAS,SACTA,EAAA,OAAS,SACTA,EAAA,QAAU,UACVA,EAAA,OAAS,SACTA,EAAA,KAAO,OACPA,EAAA,OAAS,SACTA,EAAA,KAAO,OACPA,EAAA,MAAQ,QACRA,EAAA,KAAO,OACPA,EAAA,YAAc,cACdA,EAAA,SAAW,WACXA,EAAA,MAAQ,QACRA,EAAA,WAAa,aACbA,EAAA,IAAM,MACNA,EAAA,UAAY,YACZA,EAAA,KAAO,OACPA,EAAA,OAAS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EAAgB,QAAUrC,GAE5BO,EAAW,MAAM,KAAK,QAAQ,YAAY8B,CAAe,CAC3D,MACE9B,EAAW,KAAK,QAAQ,YAAY,EAGtC,GAAI,CAACA,EAAU,CACb,KAAK,eAAe,EAAK,EACzB,KAAK,WAAW,EAEhB,IAAM+B,EAAgB,kCAAkC,KAAK,QAAQ,OAAO,IAAI,qBAChF,MAAM,IAAI,MAAMA,CAAa,CAC/B,CAEA,YAAK,YAAY/B,CAAQ,EAClBA,CACT,CACF,EAEOgC,EAAQ5C",
4
+ "sourcesContent": ["import type { State as WalletState } from './wallet.js';\nimport type { Namespace } from '../namespaces/common/mod.js';\nimport type { BlockchainMeta, SignerFactory } from 'rango-types';\n\nexport enum Networks {\n BTC = 'BTC',\n BSC = 'BSC',\n LTC = 'LTC',\n THORCHAIN = 'THOR',\n BCH = 'BCH',\n BINANCE = 'BNB',\n BLAST = 'BLAST',\n CELO = 'CELO',\n LINEA = 'LINEA',\n METIS = 'METIS',\n SONIC = 'SONIC',\n BERACHAIN = 'BERACHAIN',\n ZETA_CHAIN = 'ZETA_CHAIN',\n SCROLL = 'SCROLL',\n ZKSYNC = 'ZKSYNC',\n MONAD = 'MONAD',\n ETHEREUM = 'ETH',\n POLYGON = 'POLYGON',\n TERRA = 'TERRA',\n POLKADOT = '',\n TRON = 'TRON',\n DOGE = 'DOGE',\n HARMONY = 'HARMONY',\n AVAX_CCHAIN = 'AVAX_CCHAIN',\n FANTOM = 'FANTOM',\n MOONBEAM = 'MOONBEAM',\n ARBITRUM = 'ARBITRUM',\n BOBA = 'BOBA',\n OPTIMISM = 'OPTIMISM',\n FUSE = 'FUSE',\n CRONOS = 'CRONOS',\n SOLANA = 'SOLANA',\n MOONRIVER = 'MOONRIVER',\n GNOSIS = 'GNOSIS',\n COSMOS = 'COSMOS',\n OSMOSIS = 'OSMOSIS',\n AXELAR = 'AXELAR',\n MARS = 'MARS',\n STRIDE = 'STRIDE',\n MAYA = 'MAYA',\n AKASH = 'AKASH',\n IRIS = 'IRIS',\n PERSISTENCE = 'PERSISTENCE',\n SENTINEL = 'SENTINEL',\n REGEN = 'REGEN',\n CRYPTO_ORG = 'CRYPTO_ORG',\n SIF = 'SIF',\n CHIHUAHUA = 'CHIHUAHUA',\n JUNO = 'JUNO',\n KUJIRA = 'KUJIRA',\n STARNAME = 'STARNAME',\n COMDEX = 'COMDEX',\n STARGAZE = 'STARGAZE',\n DESMOS = 'DESMOS',\n BITCANNA = 'BITCANNA',\n SECRET = 'SECRET',\n INJECTIVE = 'INJECTIVE',\n LUMNETWORK = 'LUMNETWORK',\n BANDCHAIN = 'BANDCHAIN',\n EMONEY = 'EMONEY',\n BITSONG = 'BITSONG',\n KI = 'KI',\n MEDIBLOC = 'MEDIBLOC',\n KONSTELLATION = 'KONSTELLATION',\n UMEE = 'UMEE',\n STARKNET = 'STARKNET',\n STELLAR = 'STELLAR',\n TON = 'TON',\n BASE = 'BASE',\n SUI = 'SUI',\n XRPL = 'XRPL',\n ZCASH = 'ZCASH',\n\n // Using instead of null\n Unknown = 'Unkown',\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype InstanceType = any;\n\nexport type NamespaceData = {\n namespace: Namespace;\n derivationPath?: string;\n};\n\nexport type WalletType = string;\nexport type Network = string;\n\nexport type InstallObjects = {\n CHROME?: string;\n FIREFOX?: string;\n EDGE?: string;\n BRAVE?: string;\n DEFAULT: string;\n};\n\nexport type NamespaceMeta = {\n label: string;\n /**\n * By using a matched `blockchain.name` (in meta) and `id`, we show logo in Namespace modal\n * e.g. ETH\n */\n id: string;\n value: Namespace;\n unsupported?: boolean;\n getSupportedChains: (chains: BlockchainMeta[]) => BlockchainMeta[];\n};\n\ninterface NeedsNamespace {\n selection: 'single' | 'multiple';\n data: NamespaceMeta[];\n}\n\ninterface NeedsDerivationPath {\n data: {\n id: string;\n label: string;\n namespace: Namespace;\n generateDerivationPath: (index: string) => string;\n }[];\n}\n\nexport type WalletInfo = {\n name: string;\n img: string;\n installLink: InstallObjects | string;\n /**\n * @deprecated we don't use this value anymore.\n */\n color: string;\n supportedChains: BlockchainMeta[];\n showOnMobile?: boolean;\n isContractWallet?: boolean;\n mobileWallet?: boolean;\n\n needsDerivationPath?: NeedsDerivationPath;\n needsNamespace?: NeedsNamespace;\n};\n\nexport type State = {\n [key: string]: WalletState | undefined;\n};\n\nexport type ConnectResult = {\n accounts: string[] | null;\n network: Network | null;\n provider: InstanceType;\n};\n\nexport type Providers = { [type in WalletType]?: InstanceType };\nexport type NetworkProviderMap = Map<Networks, unknown>;\n\nexport enum Events {\n CONNECTED = 'connected',\n CONNECTING = 'connecting',\n REACHABLE = 'reachable',\n INSTALLED = 'installed',\n ACCOUNTS = 'accounts',\n NETWORK = 'network',\n // Hub only events\n NAMESPACE_DISCONNECTED = 'namespace_disconnected',\n\n PROVIDER_DISCONNECTED = 'provider_disconnected',\n}\n\nexport type ProviderConnectResult = {\n accounts: string[];\n chainId: string;\n derivationPath?: string;\n};\n\nexport type GetInstanceOptions = {\n network?: Network;\n currentProvider: InstanceType;\n meta: BlockchainMeta[];\n getState: () => WalletState;\n /**\n * We always get the instance once and reuse it whenever we needs. By using this option\n * We can force the library to get a new instance and replace it with the old one.\n *\n * Originally, we used this option for wallet connect 1 and its switching network challenge.\n */\n force?: boolean;\n updateChainId: (chainId: number | string) => void;\n};\n\nexport type GetInstance =\n | (() => InstanceType)\n | ((options: GetInstanceOptions) => Promise<InstanceType>);\n\nexport type TryGetInstance =\n | (() => InstanceType)\n | ((\n options: Pick<GetInstanceOptions, 'force' | 'network'>\n ) => Promise<InstanceType>);\n\nexport type Connect = (options: {\n instance: InstanceType;\n network?: Network;\n meta: BlockchainMeta[];\n namespaces?: NamespaceData[];\n}) => Promise<ProviderConnectResult | ProviderConnectResult[]>;\n\nexport type Disconnect = (options: {\n instance: InstanceType;\n destroyInstance: () => void;\n}) => Promise<void>;\n\ntype CleanupSubscribe = () => void;\n\nexport type Subscribe = (options: {\n instance: InstanceType;\n state: WalletState;\n meta: BlockchainMeta[];\n updateChainId: (chainId: string) => void;\n updateAccounts: (accounts: string[], chainId?: string) => void;\n connect: (network?: Network) => void;\n disconnect: () => void;\n}) => CleanupSubscribe | void;\n\nexport type SwitchNetwork = (options: {\n instance: InstanceType;\n network: Network;\n meta: BlockchainMeta[];\n newInstance?: TryGetInstance;\n getState?: () => WalletState;\n updateChainId: (chainId: string) => void;\n}) => Promise<void>;\n\nexport type Suggest = (options: {\n instance: InstanceType;\n network: Network;\n meta: BlockchainMeta[];\n}) => Promise<void>;\n\nexport type CanSwitchNetwork = (options: {\n network: Network;\n meta: BlockchainMeta[];\n provider: InstanceType;\n}) => boolean;\n\nexport type CanEagerConnect = (options: {\n instance: InstanceType;\n meta: BlockchainMeta[];\n}) => Promise<boolean>;\n\nexport type EagerConnectResult<I = unknown> = {\n accounts: string[] | null;\n network: string | null;\n provider: I | null;\n};\n\nexport interface WalletActions {\n connect: Connect;\n getInstance: InstanceType;\n disconnect?: Disconnect;\n subscribe?: Subscribe;\n // unsubscribe, // coupled to subscribe.\n\n // Optional, but should be provided at the same time.\n suggest?: Suggest;\n switchNetwork?: SwitchNetwork;\n getSigners: (provider: InstanceType) => Promise<SignerFactory>;\n canSwitchNetworkTo?: CanSwitchNetwork;\n canEagerConnect?: CanEagerConnect;\n getWalletInfo(allBlockChains: BlockchainMeta[]): WalletInfo;\n}\n\nexport interface WalletConfig {\n type: WalletType;\n defaultNetwork?: Network;\n checkInstallation?: boolean;\n isAsyncInstance?: boolean;\n isAsyncSwitchNetwork?: boolean;\n}\n\nexport type WalletProviders = Map<\n WalletType,\n {\n actions: WalletActions;\n config: WalletConfig;\n }\n>;\n\nexport type ProviderInterface = { config: WalletConfig } & WalletActions;\n\n// it comes from wallets.ts and `connect`\ntype NetworkTypeFromLegacyConnect = Network | undefined;\n\nexport type NamespaceInputForConnect<T extends Namespace = Namespace> = {\n /**\n * By default, you should specify namespace (e.g. evm).\n */\n namespace: T;\n /**\n * In some cases, we need to connect a specific network on a namespace. e.g. Polygon on EVM.\n */\n network: NetworkTypeFromLegacyConnect;\n derivationPath?: string;\n};\n", "export interface PersistStorage<T> {\n getItem: (name: string) => T | null;\n setItem: (name: string, value: T) => void;\n removeItem: (name: string) => void;\n}\n\nexport class Persistor<T> implements PersistStorage<T> {\n getItem(name: string) {\n const item = localStorage.getItem(name);\n const parsedItem = item ? (JSON.parse(item) as T) : null;\n return parsedItem;\n }\n setItem(name: string, value: T) {\n localStorage.setItem(name, JSON.stringify(value));\n }\n removeItem(name: string) {\n localStorage.removeItem(name);\n }\n}\n", "import type { Network } from './types.js';\nimport type { Options } from './wallet.js';\nimport type { BlockchainMeta } from 'rango-types';\n\nimport { Networks } from './types.js';\n\nexport function formatAddressWithNetwork(\n address: string,\n network?: Network | null\n) {\n return `${network || ''}:${address}`;\n}\n\nexport function accountAddressesWithNetwork(\n addresses: string[] | null,\n network?: Network | null\n) {\n if (!addresses) {\n return [];\n }\n\n return addresses.map((address) => {\n return formatAddressWithNetwork(address, network);\n });\n}\n\nexport function readAccountAddress(addressWithNetwork: string): {\n address: string;\n network: Network;\n} {\n const [network, address] = addressWithNetwork.split(':');\n\n return {\n network,\n address,\n };\n}\n\nexport function needsCheckInstallation(options: Options) {\n const { checkInstallation = true } = options.config;\n return checkInstallation;\n}\n\nexport const getBlockChainNameFromId = (\n chainId: string | number,\n blockchains: BlockchainMeta[]\n): Network | null => {\n chainId =\n typeof chainId === 'string' && chainId.startsWith('0x')\n ? parseInt(chainId)\n : chainId;\n\n /*\n * Sometimes providers are passing `Network` as chainId.\n * If chainId is a `Network`, we return itself.\n */\n const allNetworks = Object.values(Networks);\n if (allNetworks.includes(String(chainId) as Networks)) {\n return chainId as Networks;\n }\n\n if (chainId === 'Binance-Chain-Tigris') {\n return Networks.BINANCE;\n }\n return (\n blockchains\n .filter((blockchainMeta) => !!blockchainMeta.chainId)\n .find((blockchainMeta) => {\n const blockchainChainId = blockchainMeta.chainId?.startsWith('0x')\n ? parseInt(blockchainMeta.chainId)\n : blockchainMeta.chainId;\n return blockchainChainId == chainId;\n })?.name || null\n );\n};\n", "import type { NamespaceInputForConnect } from './types.js';\n\nexport async function eagerConnectHandler<R = unknown>(params: {\n canEagerConnect: () => Promise<boolean>;\n connectHandler: () => Promise<R>;\n providerName: string;\n}) {\n // Check if we can eagerly connect to the wallet\n if (await params.canEagerConnect()) {\n // Connect to wallet as usual\n return await params.connectHandler();\n }\n throw new Error(`can't restore connection for ${params.providerName}.`);\n}\n\nexport function isEvmNamespace(\n namespace: NamespaceInputForConnect\n): namespace is NamespaceInputForConnect<'EVM'> {\n return namespace.namespace === 'EVM';\n}\n", "import type {\n EagerConnectResult,\n GetInstanceOptions,\n NamespaceData,\n Network,\n WalletActions,\n WalletConfig,\n WalletType,\n} from './types.js';\nimport type { Namespace } from '../namespaces/common/types.js';\nimport type { BlockchainMeta } from 'rango-types';\n\nimport {\n accountAddressesWithNetwork,\n getBlockChainNameFromId,\n needsCheckInstallation,\n} from './helpers.js';\nimport { Events, Networks } from './types.js';\nimport { eagerConnectHandler } from './utils.js';\n\nexport type EventHandler = (\n type: WalletType,\n event: Events,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n value: any,\n coreState: State,\n info: EventInfo\n) => void;\n\nexport type EventInfo = {\n supportedBlockchains: BlockchainMeta[];\n isContractWallet: boolean;\n\n // Hub fields\n isHub: boolean;\n // will be set alongside ACCOUNT event\n namespace?: Namespace;\n derivationPath?: string;\n};\n\nexport interface State {\n connected: boolean;\n connecting: boolean;\n /**\n * @depreacted it always returns `false`. don't use it.\n */\n reachable: boolean;\n installed: boolean;\n accounts: string[] | null;\n network: Network | null;\n derivationPath?: string;\n}\n\nexport interface Options {\n config: WalletConfig;\n handler: EventHandler;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nclass Wallet<InstanceType = any> {\n public provider: InstanceType | null;\n private actions: WalletActions;\n private state: State;\n private options: Options;\n private info: EventInfo;\n private cleanupSubscribe?: (() => void) | void;\n\n constructor(options: Options, actions: WalletActions) {\n this.actions = actions;\n this.options = options;\n this.provider = null;\n this.info = {\n supportedBlockchains: [],\n isContractWallet: false,\n isHub: false,\n };\n this.state = {\n connected: false,\n connecting: false,\n // TODO: Remove\n reachable: false,\n installed: false,\n accounts: null,\n network: null,\n };\n\n if (!needsCheckInstallation(options)) {\n this.setInstalledAs(true);\n }\n }\n\n async suggestAndConnect(network: Network) {\n if (this.actions.suggest) {\n await this.actions.suggest({\n instance: this.provider,\n meta: this.info.supportedBlockchains,\n network,\n });\n }\n return await this.connect(network);\n }\n\n async connect(network?: Network, namespaces?: NamespaceData[]) {\n // If it's connecting, nothing do.\n if (this.state.connecting) {\n throw new Error('Connecting...');\n }\n\n const connectionFromState = await this.getConnectionFromState();\n const currentNetwork = this.state.network;\n /*\n * If a network hasn't been provided and also we have `lastNetwork`\n * We will use lastNetwork to make sure we will not\n * Ask the user to switch his network wrongly.\n */\n const requestedNetwork =\n network || currentNetwork || this.options.config.defaultNetwork;\n\n if (connectionFromState) {\n const networkChanged =\n currentNetwork !== requestedNetwork && !!requestedNetwork;\n\n // Reuse current connection if nothing has changed and we already have the connection in memory.\n if (currentNetwork === requestedNetwork) {\n return connectionFromState;\n }\n\n let canSwitch = true;\n if (this.actions.canSwitchNetworkTo) {\n canSwitch = this.actions.canSwitchNetworkTo({\n provider: this.provider,\n meta: this.info.supportedBlockchains,\n network: requestedNetwork || '',\n });\n }\n\n if (networkChanged && canSwitch && !!this.actions.switchNetwork) {\n await this.actions.switchNetwork({\n instance: this.provider,\n meta: this.info.supportedBlockchains,\n // TODO: Fix type error\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n network: requestedNetwork,\n newInstance: this.tryGetInstance.bind(this),\n getState: this.getState.bind(this),\n updateChainId: this.updateChainId.bind(this),\n });\n\n /*\n * We assume if we reach here (`switchNetwork` not throwing error), Switch successfully has been done.\n * But for providers with async switch network like wallet-connect, we need to wait for chain change\n * event before changing network.\n */\n if (\n requestedNetwork !== this.state.network &&\n !this.options.config.isAsyncSwitchNetwork\n ) {\n this.updateState({\n network,\n });\n }\n\n return {\n // Only network has been changed, so we reuse accounts from what we have already.\n accounts: connectionFromState.accounts,\n network: requestedNetwork,\n provider: this.provider,\n };\n }\n\n // If none of the above conditions didn't match, continute to connect.\n }\n\n // We are connecting to wallet for the first time\n\n // Trying to get wallet's instance, if it's not available, raise an error.\n const instance = await this.tryGetInstance({ network });\n\n // Instance exists, trying to connect\n this.updateState({\n connecting: true,\n });\n this.setInstalledAs(true);\n\n try {\n // eslint-disable-next-line no-var\n var connectResult = await this.actions.connect({\n instance,\n network: requestedNetwork || undefined,\n meta: this.info.supportedBlockchains || [],\n namespaces,\n });\n } catch (e) {\n this.resetState();\n throw e;\n }\n\n this.updateState({\n connected: true,\n reachable: true,\n connecting: false,\n });\n\n // TODO: Handle accounts.length > 0\n\n // Inserting accounts into our state.\n let nextAccounts: string[] = [];\n let nextNetwork: Network | null | undefined = null;\n let nextDerivationPath: string | undefined = undefined;\n if (Array.isArray(connectResult)) {\n let activeEvmNetwork: Network | null = null;\n const accounts = connectResult.flatMap((blockchain) => {\n const chainId = blockchain.chainId || Networks.Unknown;\n // Try to map chainId with a Network, if not found, we use chainId directly.\n const network =\n getBlockChainNameFromId(chainId, this.info.supportedBlockchains) ||\n Networks.Unknown;\n nextDerivationPath = blockchain.derivationPath\n ? blockchain.derivationPath\n : nextDerivationPath;\n\n /*\n * When connecting to an evm instance, it will return address and wallet's active chain.\n * On switch network we are comparing state's network and what passed as requestedNetwork.\n * This code is for making sure we are setting correct active chain in state if it's evm.\n */\n if (!activeEvmNetwork && network !== Networks.Unknown) {\n const blockchainMeta = this.info.supportedBlockchains.find(\n (blockchain) => blockchain.name === network\n );\n if (blockchainMeta?.info?.infoType === 'EvmMetaInfo') {\n activeEvmNetwork = network;\n }\n }\n // TODO: second parameter should be `string` when we decided to open source the package.\n return accountAddressesWithNetwork(blockchain.accounts, network);\n });\n nextAccounts = accounts.filter(Boolean);\n nextNetwork =\n activeEvmNetwork ||\n requestedNetwork ||\n this.options.config.defaultNetwork;\n } else {\n const chainId = connectResult.chainId || Networks.Unknown;\n const network =\n getBlockChainNameFromId(chainId, this.info.supportedBlockchains) ||\n Networks.Unknown;\n const derivationPath = connectResult.derivationPath;\n\n // We fallback to current active network if `chainId` not provided.\n nextAccounts = accountAddressesWithNetwork(\n connectResult.accounts,\n network\n );\n nextNetwork = network;\n nextDerivationPath = derivationPath;\n }\n\n if (nextAccounts.length > 0) {\n this.updateState({\n accounts: nextAccounts,\n network: nextNetwork,\n derivationPath: nextDerivationPath,\n });\n }\n\n return {\n accounts: this.state.accounts,\n network: this.state.network,\n provider: this.provider,\n };\n }\n\n async disconnect() {\n this.resetState();\n\n if (this.actions.disconnect) {\n void this.actions.disconnect({\n instance: this.provider,\n // On wallet connect, we need to destory the instance and get a whole new instance when we are going to connect\n destroyInstance: () => {\n this.setProvider(null);\n },\n });\n }\n }\n\n // This method is only used for auto connection\n async eagerConnect(): Promise<EagerConnectResult<InstanceType>> {\n const instance = await this.tryGetInstance({ network: undefined });\n const { canEagerConnect } = this.actions;\n const providerName = this.options.config.type;\n\n return await eagerConnectHandler({\n canEagerConnect: async () => {\n if (!canEagerConnect) {\n throw new Error(\n `${providerName} provider hasn't implemented canEagerConnect.`\n );\n }\n\n return await canEagerConnect({\n instance: instance,\n meta: this.info.supportedBlockchains,\n });\n },\n connectHandler: async () => {\n const result = await this.connect();\n return result;\n },\n providerName,\n });\n }\n\n async getSigners(provider: InstanceType) {\n return await this.actions.getSigners(provider);\n }\n getWalletInfo(allBlockChains: BlockchainMeta[]) {\n return this.actions.getWalletInfo(allBlockChains);\n }\n canSwitchNetworkTo(network: Network, provider: InstanceType) {\n const switchTo = this.actions.canSwitchNetworkTo;\n if (!switchTo) {\n return false;\n }\n\n return switchTo({\n network,\n meta: this.info.supportedBlockchains,\n provider,\n });\n }\n\n onInit() {\n // some times functions can be overridden by wallets. see rf-2119\n if (!this.actions.getInstance) {\n throw new Error(\n `Provider hasn't defined how to get wallet's instance. provider: ${this.options.config.type} on: onInit`\n );\n }\n\n if (!this.options.config.isAsyncInstance) {\n const instance = this.actions.getInstance();\n if (!!instance && !this.state.installed) {\n this.setInstalledAs(true);\n }\n } else if (needsCheckInstallation(this.options)) {\n this.actions.getInstance().then((data: unknown) => {\n if (data) {\n this.setInstalledAs(true);\n }\n });\n }\n }\n\n setProvider(value: InstanceType | null) {\n this.provider = value;\n if (!!value && !!this.actions.subscribe) {\n const cleanup = this.actions.subscribe({\n instance: value,\n state: this.state,\n meta: this.info.supportedBlockchains,\n connect: this.connect.bind(this),\n disconnect: this.disconnect.bind(this),\n updateAccounts: (accounts, chainId) => {\n let network = this.state.network;\n if (chainId) {\n network =\n getBlockChainNameFromId(\n chainId,\n this.info.supportedBlockchains\n ) || Networks.Unknown;\n }\n\n const nextAccounts = accountAddressesWithNetwork(accounts, network);\n if (nextAccounts.length > 0) {\n this.updateState({\n accounts: nextAccounts,\n });\n }\n },\n updateChainId: this.updateChainId.bind(this),\n });\n this.cleanupSubscribe = cleanup;\n } else if (!value && this.cleanupSubscribe) {\n this.cleanupSubscribe();\n }\n }\n\n setInfo(info: Partial<EventInfo>) {\n if (typeof info.supportedBlockchains !== 'undefined') {\n this.info.supportedBlockchains = info.supportedBlockchains;\n }\n if (typeof info.isContractWallet !== 'undefined') {\n this.info.isContractWallet = info.isContractWallet;\n }\n }\n\n setHandler(handler: EventHandler) {\n this.options.handler = handler;\n }\n\n getState(): State {\n return this.state;\n }\n\n updateState(states: Partial<State>) {\n /*\n * We will notify handler after updating all the states.\n * Because when we call `handler` it will has latest states.\n */\n const updates: [Events, unknown][] = [];\n\n if (typeof states.connected !== 'undefined') {\n this.state.connected = states.connected;\n updates.push([Events.CONNECTED, states.connected]);\n }\n if (typeof states.connecting !== 'undefined') {\n this.state.connecting = states.connecting;\n updates.push([Events.CONNECTING, states.connecting]);\n }\n if (typeof states.reachable !== 'undefined') {\n this.state.reachable = states.reachable;\n updates.push([Events.REACHABLE, states.reachable]);\n }\n if (typeof states.installed !== 'undefined') {\n this.state.installed = states.installed;\n updates.push([Events.INSTALLED, states.installed]);\n }\n if (typeof states.accounts !== 'undefined') {\n this.state.accounts = states.accounts;\n this.state.derivationPath = states.derivationPath;\n updates.push([Events.ACCOUNTS, states.accounts]);\n }\n if (typeof states.network !== 'undefined') {\n this.state.network = states.network;\n updates.push([Events.NETWORK, states.network]);\n }\n\n const state = this.getState();\n updates.forEach(([name, value]) => {\n const eventInfo: EventInfo = {\n supportedBlockchains: this.info.supportedBlockchains,\n isContractWallet: this.info.isContractWallet,\n isHub: false,\n };\n this.options.handler(\n this.options.config.type,\n name,\n value,\n state,\n eventInfo\n );\n });\n }\n\n resetState() {\n this.updateState({\n connected: false,\n connecting: false,\n reachable: false,\n accounts: null,\n network: null,\n });\n }\n\n private async getConnectionFromState() {\n // Already connected, so we return provider that we have in memory.\n\n /*\n * For switching network on Trust Wallet (WalletConnect),\n * We only kill the session (and not restting the whole state)\n * So we are relying on this.provider for achieving this functionality.\n */\n if (this.state.connected && !!this.provider) {\n return {\n accounts: this.state.accounts,\n network: this.state.network,\n provider: this.provider,\n };\n }\n\n return null;\n }\n\n private updateChainId(chainId: string | number) {\n const network = chainId\n ? getBlockChainNameFromId(chainId, this.info.supportedBlockchains)\n : Networks.Unknown;\n\n this.updateState({\n network,\n });\n }\n\n private setInstalledAs(value: boolean) {\n if (!needsCheckInstallation(this.options) && value === false) {\n return;\n }\n\n this.updateState({\n installed: value,\n });\n }\n // eslint-disable-next-line destructuring/in-methods-params\n private async tryGetInstance({\n network,\n force,\n }: {\n network?: Network;\n force?: boolean;\n }) {\n let instance = null;\n /*\n * For switching network on Trust Wallet (WalletConnect),\n * We only kill the session (and not restting the whole state)\n * So we are relying on this.provider for achieving this functionality.\n */\n this.setProvider(null);\n if (this.options.config.isAsyncInstance) {\n // Trying to connect\n const instanceOptions: GetInstanceOptions = {\n currentProvider: this.provider,\n meta: this.info.supportedBlockchains,\n force: force || false,\n updateChainId: this.updateChainId.bind(this),\n getState: this.getState.bind(this),\n };\n\n if (network) {\n instanceOptions.network = network;\n }\n instance = await this.actions.getInstance(instanceOptions);\n } else {\n instance = this.actions.getInstance();\n }\n\n if (!instance) {\n this.setInstalledAs(false);\n this.resetState();\n\n const error_message = `It seems your selected wallet (${this.options.config.type}) isn't installed.`;\n throw new Error(error_message);\n }\n\n this.setProvider(instance);\n return instance;\n }\n}\n\nexport default Wallet;\n"],
5
+ "mappings": "+EAIO,IAAKA,OACVA,EAAA,IAAM,MACNA,EAAA,IAAM,MACNA,EAAA,IAAM,MACNA,EAAA,UAAY,OACZA,EAAA,IAAM,MACNA,EAAA,QAAU,MACVA,EAAA,MAAQ,QACRA,EAAA,KAAO,OACPA,EAAA,MAAQ,QACRA,EAAA,MAAQ,QACRA,EAAA,MAAQ,QACRA,EAAA,UAAY,YACZA,EAAA,WAAa,aACbA,EAAA,OAAS,SACTA,EAAA,OAAS,SACTA,EAAA,MAAQ,QACRA,EAAA,SAAW,MACXA,EAAA,QAAU,UACVA,EAAA,MAAQ,QACRA,EAAA,SAAW,GACXA,EAAA,KAAO,OACPA,EAAA,KAAO,OACPA,EAAA,QAAU,UACVA,EAAA,YAAc,cACdA,EAAA,OAAS,SACTA,EAAA,SAAW,WACXA,EAAA,SAAW,WACXA,EAAA,KAAO,OACPA,EAAA,SAAW,WACXA,EAAA,KAAO,OACPA,EAAA,OAAS,SACTA,EAAA,OAAS,SACTA,EAAA,UAAY,YACZA,EAAA,OAAS,SACTA,EAAA,OAAS,SACTA,EAAA,QAAU,UACVA,EAAA,OAAS,SACTA,EAAA,KAAO,OACPA,EAAA,OAAS,SACTA,EAAA,KAAO,OACPA,EAAA,MAAQ,QACRA,EAAA,KAAO,OACPA,EAAA,YAAc,cACdA,EAAA,SAAW,WACXA,EAAA,MAAQ,QACRA,EAAA,WAAa,aACbA,EAAA,IAAM,MACNA,EAAA,UAAY,YACZA,EAAA,KAAO,OACPA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K,IAAI,CACnC,EAEIpC,IACFqC,EAAgB,QAAUrC,GAE5BO,EAAW,MAAM,KAAK,QAAQ,YAAY8B,CAAe,CAC3D,MACE9B,EAAW,KAAK,QAAQ,YAAY,EAGtC,GAAI,CAACA,EAAU,CACb,KAAK,eAAe,EAAK,EACzB,KAAK,WAAW,EAEhB,IAAM+B,EAAgB,kCAAkC,KAAK,QAAQ,OAAO,IAAI,qBAChF,MAAM,IAAI,MAAMA,CAAa,CAC/B,CAEA,YAAK,YAAY/B,CAAQ,EAClBA,CACT,CACF,EAEOgC,EAAQ5C",
6
6
  "names": ["Networks", "Events", "Persistor", "__name", "name", "item", "value", "formatAddressWithNetwork", "address", "network", "__name", "accountAddressesWithNetwork", "addresses", "readAccountAddress", "addressWithNetwork", "needsCheckInstallation", "options", "checkInstallation", "getBlockChainNameFromId", "chainId", "blockchains", "Networks", "blockchainMeta", "eagerConnectHandler", "params", "__name", "isEvmNamespace", "namespace", "Wallet", "__name", "options", "actions", "needsCheckInstallation", "network", "namespaces", "connectionFromState", "currentNetwork", "requestedNetwork", "networkChanged", "canSwitch", "instance", "connectResult", "e", "nextAccounts", "nextNetwork", "nextDerivationPath", "activeEvmNetwork", "blockchain", "chainId", "getBlockChainNameFromId", "accountAddressesWithNetwork", "derivationPath", "canEagerConnect", "providerName", "eagerConnectHandler", "provider", "allBlockChains", "switchTo", "data", "value", "cleanup", "accounts", "info", "handler", "states", "updates", "state", "name", "eventInfo", "force", "instanceOptions", "error_message", "wallet_default"]
7
7
  }
@@ -68,6 +68,7 @@ export declare enum Networks {
68
68
  KONSTELLATION = "KONSTELLATION",
69
69
  UMEE = "UMEE",
70
70
  STARKNET = "STARKNET",
71
+ STELLAR = "STELLAR",
71
72
  TON = "TON",
72
73
  BASE = "BASE",
73
74
  SUI = "SUI",
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/legacy/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,I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SAAS,SAAS,GAAG,SAAS,IAAI;IACtE;;OAEG;IACH,SAAS,EAAE,CAAC,CAAC;IACb;;OAEG;IACH,OAAO,EAAE,4BAA4B,CAAC;IACtC,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC"}
@@ -1,2 +1,2 @@
1
- var T=Object.defineProperty;var t=(n,e)=>T(n,"name",{value:e,configurable:!0});var r=(n,e)=>{for(var o in e)T(n,o,{get:e[o],enumerable:!0})};var M={};r(M,{canEagerConnect:()=>X,connect:()=>J,recommended:()=>Z});function k(n){let[,e]=n.state();e("network",null),e("accounts",null),e("connected",!1),e("connecting",!1),e("connectArgs",null)}t(k,"disconnect");var O=[["disconnect",k]];var R={};r(R,{formatAccountsToCAIP:()=>a,getAccounts:()=>C});import{AccountId as z}from"caip";var S="solana",A="5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp";async function C(n){let e=await n.connect();return{accounts:[e?e.publicKey.toString():n.publicKey.toString()],chainId:"SOLANA"}}t(C,"getAccounts");function a(n){return n.map(e=>z.format({address:e.toString(),chainId:{namespace:S,reference:A}}))}t(a,"formatAccountsToCAIP");var Z=[...O];function J(n){return async()=>{let e=n(),o=await C(e);if(Array.isArray(o))throw new Error("Expecting solana response to be a single value, not an array.");return a(o.accounts)}}t(J,"connect");function X(n){return async()=>{let e=n();if(!e)throw new Error("Trying to eagerly connect to your Solana wallet, but seems its instance is not available.");try{return!!await e.connect({onlyIfTrusted:!0})}catch{return!1}}}t(X,"canEagerConnect");var B={};r(B,{changeAccountSubscriber:()=>q});function q(n){return u.changeAccountSubscriber(n).build()}t(q,"changeAccountSubscriber");var F={};r(F,{recommended:()=>Q});function l(n){let[,e]=n.state();e("connecting",!1)}t(l,"intoConnectionFinished");var x=[["connect",l]];var Q=[...x];var W={};r(W,{recommended:()=>ae});import{createStore as Gt}from"zustand/vanilla";import{produce as Tt}from"immer";import{produce as Ft}from"immer";var s=class{static{t(this,"ActionBuilder")}name;#e=new Map;#t=new Map;#o=new Map;#n=new Map;#r;constructor(e){this.name=e}and(e){return this.#e.has(this.name)||this.#e.set(this.name,[]),this.#e.get(this.name)?.push(e),this}or(e){return this.#t.has(this.name)||this.#t.set(this.name,[]),this.#t.get(this.name)?.push(e),this}before(e){return this.#n.has(this.name)||this.#n.set(this.name,[]),this.#n.get(this.name)?.push(e),this}after(e){return this.#o.has(this.name)||this.#o.set(this.name,[]),this.#o.get(this.name)?.push(e),this}action(e){return this.#r=e,this}build(){if(!this.#r)throw new Error("Your action builder should includes an action.");return{actionName:this.name,action:this.#r,before:this.#n,after:this.#o,and:this.#e,or:this.#t}}};import*as In from"caip";var c=class{static{t(this,"ChangeAccountSubscriberBuilder")}#e=null;#t=null;#o=null;#n=null;#r=null;getInstance(e){return this.#e=e,this}format(e){return this.#t=e,this}onSwitchAccount(e){return this.#o=e,this}addEventListener(e){return this.#n=e,this}removeEventListener(e){return this.#r=e,this}build(){if(this.#e===null)throw new Error(this.#s("getInstance"));if(this.#t===null)throw new Error(this.#s("format"));if(this.#n===null)throw new Error(this.#s("addEventListener"));if(this.#r===null)throw new Error(this.#s("removeEventListener"));let e=this.#e,o=this.#t,_=this.#n,H=this.#r,U=this.#o,f,d;return[async v=>{let[,y]=v.state(),i=e();if(!i)throw new Error("Trying to subscribe to your wallet, but seems its instance is not available.");f=t(async N=>{let P=!0;U?.({payload:N,preventDefault:()=>{P=!1}},v),P&&y("accounts",await o(i,N))},"subscriber"),d=_(i,f)},(v,y)=>{d&&typeof d=="function"&&d();let i=e();return H(i,f),y}]}#s(e){return`Required "${e}" operation has not been set for "changeAccountSubscriber"`}};import{AccountId as ie}from"caip";function K(n){try{return ie.parse(n),!0}catch{return!1}}t(K,"isValidCaipAddress");function p(n,e){if(!e.every(K))throw new Error(`Your provider should format account addresses in CAIP-10 format. Your provided accounts: ${e}`);let[,o]=n.state();return o("accounts",e),o("connected",!0),e}t(p,"connectAndUpdateStateForSingleNetwork");function h(n){let[,e]=n.state();e("connecting",!0)}t(h,"intoConnecting");var w=[["connect",h]];var ae=[["connect",p]];var j={};r(j,{recommended:()=>ce});var ce=[...w];var u={};r(u,{changeAccountSubscriber:()=>de,connect:()=>pe});var pe=t(()=>new s("connect").and(p).before(h).after(l),"connect"),de=t(n=>new c().getInstance(n).onSwitchAccount((e,o)=>{e.payload||(o.action("disconnect"),e.preventDefault())}).format(async(e,o)=>a([o])).addEventListener((e,o)=>{e.on("accountChanged",o)}).removeEventListener((e,o)=>{e.off("accountChanged",o)}),"changeAccountSubscriber");export{S as CAIP_NAMESPACE,A as CAIP_SOLANA_CHAIN_ID,M as actions,F as after,W as and,j as before,u as builders,B as hooks,R as utils};
1
+ var T=Object.defineProperty;var t=(n,e)=>T(n,"name",{value:e,configurable:!0});var r=(n,e)=>{for(var o in e)T(n,o,{get:e[o],enumerable:!0})};var M={};r(M,{canEagerConnect:()=>X,connect:()=>J,recommended:()=>Z});function k(n){let[,e]=n.state();e("network",null),e("accounts",null),e("connected",!1),e("connecting",!1),e("connectArgs",null)}t(k,"disconnect");var O=[["disconnect",k]];var R={};r(R,{formatAccountsToCAIP:()=>a,getAccounts:()=>C});import{AccountId as z}from"caip";var S="solana",A="5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp";async function C(n){let e=await n.connect();return{accounts:[e?e.publicKey.toString():n.publicKey.toString()],chainId:"SOLANA"}}t(C,"getAccounts");function a(n){return n.map(e=>z.format({address:e.toString(),chainId:{namespace:S,reference:A}}))}t(a,"formatAccountsToCAIP");var Z=[...O];function J(n){return async()=>{let e=n(),o=await C(e);if(Array.isArray(o))throw new Error("Expecting solana response to be a single value, not an array.");return a(o.accounts)}}t(J,"connect");function X(n){return async()=>{let e=n();if(!e)throw new Error("Trying to eagerly connect to your Solana wallet, but seems its instance is not available.");try{return!!await e.connect({onlyIfTrusted:!0})}catch{return!1}}}t(X,"canEagerConnect");var B={};r(B,{changeAccountSubscriber:()=>q});function q(n){return u.changeAccountSubscriber(n).build()}t(q,"changeAccountSubscriber");var F={};r(F,{recommended:()=>Q});function l(n){let[,e]=n.state();e("connecting",!1)}t(l,"intoConnectionFinished");var x=[["connect",l]];var Q=[...x];var W={};r(W,{recommended:()=>ae});import{createStore as Gt}from"zustand/vanilla";import{produce as Tt}from"immer";import{produce as Ft}from"immer";var s=class{static{t(this,"ActionBuilder")}name;#e=new Map;#t=new Map;#o=new Map;#n=new Map;#r;constructor(e){this.name=e}and(e){return this.#e.has(this.name)||this.#e.set(this.name,[]),this.#e.get(this.name)?.push(e),this}or(e){return this.#t.has(this.name)||this.#t.set(this.name,[]),this.#t.get(this.name)?.push(e),this}before(e){return this.#n.has(this.name)||this.#n.set(this.name,[]),this.#n.get(this.name)?.push(e),this}after(e){return this.#o.has(this.name)||this.#o.set(this.name,[]),this.#o.get(this.name)?.push(e),this}action(e){return this.#r=e,this}build(){if(!this.#r)throw new Error("Your action builder should includes an action.");return{actionName:this.name,action:this.#r,before:this.#n,after:this.#o,and:this.#e,or:this.#t}}};import*as En from"caip";var c=class{static{t(this,"ChangeAccountSubscriberBuilder")}#e=null;#t=null;#o=null;#n=null;#r=null;getInstance(e){return this.#e=e,this}format(e){return this.#t=e,this}onSwitchAccount(e){return this.#o=e,this}addEventListener(e){return this.#n=e,this}removeEventListener(e){return this.#r=e,this}build(){if(this.#e===null)throw new Error(this.#s("getInstance"));if(this.#t===null)throw new Error(this.#s("format"));if(this.#n===null)throw new Error(this.#s("addEventListener"));if(this.#r===null)throw new Error(this.#s("removeEventListener"));let e=this.#e,o=this.#t,_=this.#n,H=this.#r,U=this.#o,f,d;return[async v=>{let[,y]=v.state(),i=e();if(!i)throw new Error("Trying to subscribe to your wallet, but seems its instance is not available.");f=t(async N=>{let P=!0;U?.({payload:N,preventDefault:()=>{P=!1}},v),P&&y("accounts",await o(i,N))},"subscriber"),d=_(i,f)},(v,y)=>{d&&typeof d=="function"&&d();let i=e();return H(i,f),y}]}#s(e){return`Required "${e}" operation has not been set for "changeAccountSubscriber"`}};import{AccountId as ie}from"caip";function K(n){try{return ie.parse(n),!0}catch{return!1}}t(K,"isValidCaipAddress");function p(n,e){if(!e.every(K))throw new Error(`Your provider should format account addresses in CAIP-10 format. Your provided accounts: ${e}`);let[,o]=n.state();return o("accounts",e),o("connected",!0),e}t(p,"connectAndUpdateStateForSingleNetwork");function h(n){let[,e]=n.state();e("connecting",!0)}t(h,"intoConnecting");var w=[["connect",h]];var ae=[["connect",p]];var j={};r(j,{recommended:()=>ce});var ce=[...w];var u={};r(u,{changeAccountSubscriber:()=>de,connect:()=>pe});var pe=t(()=>new s("connect").and(p).before(h).after(l),"connect"),de=t(n=>new c().getInstance(n).onSwitchAccount((e,o)=>{e.payload||(o.action("disconnect"),e.preventDefault())}).format(async(e,o)=>a([o])).addEventListener((e,o)=>{e.on("accountChanged",o)}).removeEventListener((e,o)=>{e.off("accountChanged",o)}),"changeAccountSubscriber");export{S as CAIP_NAMESPACE,A as CAIP_SOLANA_CHAIN_ID,M as actions,F as after,W as and,j as before,u as builders,B as hooks,R as utils};
2
2
  //# sourceMappingURL=mod.js.map
@@ -0,0 +1,5 @@
1
+ import type { StellarActions } from './types.js';
2
+ import { ActionBuilder } from '../../mod.js';
3
+ export declare const connect: () => ActionBuilder<StellarActions, "connect">;
4
+ export declare const balanceLines: ActionBuilder<StellarActions, "balanceLines">;
5
+ //# sourceMappingURL=builders.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"builders.d.ts","sourceRoot":"","sources":["../../../src/namespaces/stellar/builders.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAIjD,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAS7C,eAAO,MAAM,OAAO,gDAIc,CAAC;AAEnC,eAAO,MAAM,YAAY,+CAOvB,CAAC"}
@@ -0,0 +1,4 @@
1
+ export declare const CAIP_NAMESPACE = "stellar";
2
+ export declare const CAIP_STELLAR_CHAIN_ID = "mainnet";
3
+ export declare const HORIZON_URL = "https://horizon.stellar.org";
4
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/namespaces/stellar/constants.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,cAAc,YAAY,CAAC;AACxC,eAAO,MAAM,qBAAqB,YAAY,CAAC;AAE/C,eAAO,MAAM,WAAW,gCAAgC,CAAC"}
@@ -0,0 +1,5 @@
1
+ export * as builders from './builders.js';
2
+ export * as utils from './utils.js';
3
+ export type { StellarActions } from './types.js';
4
+ export { CAIP_STELLAR_CHAIN_ID, CAIP_NAMESPACE } from './constants.js';
5
+ //# sourceMappingURL=mod.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../src/namespaces/stellar/mod.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAC1C,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,YAAY,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,OAAO,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,2 @@
1
+ var h=Object.defineProperty;var e=(r,t)=>h(r,"name",{value:t,configurable:!0});var l=(r,t)=>{for(var n in t)h(r,n,{get:t[n],enumerable:!0})};var A={};l(A,{balanceLines:()=>_,connect:()=>R});import*as x from"@stellar/stellar-sdk";import{createStore as ke}from"zustand/vanilla";import{produce as he}from"immer";import{produce as xe}from"immer";var o=class{static{e(this,"ActionBuilder")}name;#e=new Map;#t=new Map;#r=new Map;#o=new Map;#n;constructor(t){this.name=t}and(t){return this.#e.has(this.name)||this.#e.set(this.name,[]),this.#e.get(this.name)?.push(t),this}or(t){return this.#t.has(this.name)||this.#t.set(this.name,[]),this.#t.get(this.name)?.push(t),this}before(t){return this.#o.has(this.name)||this.#o.set(this.name,[]),this.#o.get(this.name)?.push(t),this}after(t){return this.#r.has(this.name)||this.#r.set(this.name,[]),this.#r.get(this.name)?.push(t),this}action(t){return this.#n=t,this}build(){if(!this.#n)throw new Error("Your action builder should includes an action.");return{actionName:this.name,action:this.#n,before:this.#o,after:this.#r,and:this.#e,or:this.#t}}};import*as at from"caip";function p(r){let[,t]=r.state();t("connecting",!1)}e(p,"intoConnectionFinished");import{AccountId as k}from"caip";function S(r){try{return k.parse(r),!0}catch{return!1}}e(S,"isValidCaipAddress");function d(r,t){if(!t.every(S))throw new Error(`Your provider should format account addresses in CAIP-10 format. Your provided accounts: ${t}`);let[,n]=r.state();return n("accounts",t),n("connected",!0),t}e(d,"connectAndUpdateStateForSingleNetwork");function u(r){let[,t]=r.state();t("connecting",!0)}e(u,"intoConnecting");var m="stellar",f="mainnet",g="https://horizon.stellar.org";var R=e(()=>new o("connect").and(d).before(u).after(p),"connect"),_=new o("balanceLines").action(async function(r,t){return(await new x.Horizon.Server(g).loadAccount(t)).balances});var b={};l(b,{formatAddressToCAIP:()=>K});import{AccountId as O}from"caip";function K(r){return O.format({address:r,chainId:{namespace:m,reference:f}})}e(K,"formatAddressToCAIP");export{m as CAIP_NAMESPACE,f as CAIP_STELLAR_CHAIN_ID,A as builders,b as utils};
2
+ //# sourceMappingURL=mod.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/namespaces/stellar/builders.ts", "../../../src/hub/store/store.ts", "../../../src/hub/store/namespaces.ts", "../../../src/hub/store/providers.ts", "../../../src/builders/action.ts", "../../../src/utils/mod.ts", "../../../src/namespaces/common/after.ts", "../../../src/namespaces/common/helpers.ts", "../../../src/namespaces/common/and.ts", "../../../src/namespaces/common/before.ts", "../../../src/namespaces/stellar/constants.ts", "../../../src/namespaces/stellar/utils.ts"],
4
+ "sourcesContent": ["import type { StellarActions } from './types.js';\n\nimport * as StellarSdk from '@stellar/stellar-sdk';\n\nimport { ActionBuilder } from '../../mod.js';\nimport {\n connectAndUpdateStateForSingleNetwork,\n intoConnecting,\n intoConnectionFinished,\n} from '../common/mod.js';\n\nimport { HORIZON_URL } from './constants.js';\n\nexport const connect = () =>\n new ActionBuilder<StellarActions, 'connect'>('connect')\n .and(connectAndUpdateStateForSingleNetwork)\n .before(intoConnecting)\n .after(intoConnectionFinished);\n\nexport const balanceLines = new ActionBuilder<StellarActions, 'balanceLines'>(\n 'balanceLines'\n).action(async function (_, accountId: string) {\n const server = new StellarSdk.Horizon.Server(HORIZON_URL);\n const account = await server.loadAccount(accountId);\n\n return account.balances;\n});\n", "import type { StoreApi } from 'zustand/vanilla';\n\nimport { createStore as createZustandStore } from 'zustand/vanilla';\n\nimport { extend, type Store } from './extend.js';\nimport { hubStore, type HubStore } from './hub.js';\nimport { namespacesStore, type NamespaceStore } from './namespaces.js';\nimport { providersStore, type ProviderStore } from './providers.js';\n\n/************ State ************/\n\nexport interface State {\n hub: HubStore;\n providers: ProviderStore;\n namespaces: NamespaceStore;\n}\n\nexport type RawStore = StoreApi<State>;\n\nexport const createStore = (): Store => {\n const store = createZustandStore<State>((...api) => {\n return {\n hub: hubStore(...api),\n providers: providersStore(...api),\n namespaces: namespacesStore(...api),\n };\n });\n\n return extend(store);\n};\n", "/************ Namespace ************/\n\nimport type { StateCreator } from 'zustand';\n\nimport { produce } from 'immer';\n\nimport {\n ConsumableEvents,\n type NamespaceConnectedEvent,\n type NamespaceDisconnectedEvent,\n type NamespaceSwitchedAccountEvent,\n type NamespaceSwitchedNetworkEvent,\n} from './events.js';\nimport { namespaceStateSelector, type State } from './mod.js';\n\n// Currently, namespace doesn't has any config.\nexport type NamespaceConfig = object;\n\nexport interface NamespaceData {\n accounts: null | string[];\n network: null | string;\n connected: boolean;\n connecting: boolean;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n connectArgs: Record<string, any> | null;\n}\n\ninterface NamespaceInfo {\n providerId: string;\n namespaceId: string;\n}\n\ninterface NamespaceItem {\n info: NamespaceInfo;\n data: NamespaceData;\n error: unknown;\n}\n\ntype NamespaceState = {\n events: InstanceType<typeof ConsumableEvents>;\n list: Record<string, NamespaceItem>;\n};\n\ninterface NamespaceActions {\n addNamespace: (id: string, config: NamespaceInfo) => void;\n updateStatus: <K extends keyof NamespaceData>(\n id: string,\n key: K,\n value: NamespaceData[K]\n ) => void;\n\n _produceEventsWhenUpdatingStatus: <K extends keyof NamespaceData>(\n namespace: NamespaceItem,\n id: string,\n key: K,\n value: NamespaceData[K]\n ) => void;\n}\ninterface NamespaceSelectors {\n getNamespaceData(storeId: string): NamespaceData;\n}\n\nexport type NamespaceStore = NamespaceState &\n NamespaceActions &\n NamespaceSelectors;\ntype NamespaceStateCreator = StateCreator<State, [], [], NamespaceStore>;\n\nconst namespacesStore: NamespaceStateCreator = (set, get) => ({\n events: new ConsumableEvents(),\n\n list: {},\n addNamespace: (id, info) => {\n const data: NamespaceData = {\n accounts: null,\n network: null,\n connected: false,\n connecting: false,\n connectArgs: null,\n };\n\n const item = {\n data,\n error: '',\n info,\n };\n\n set(\n produce((state: State) => {\n state.namespaces.list[id] = item;\n })\n );\n },\n updateStatus: (id, key, value) => {\n const ns = get().namespaces.list[id];\n if (!ns) {\n throw new Error(`No namespace with '${id}' found.`);\n }\n\n get().namespaces._produceEventsWhenUpdatingStatus(ns, id, key, value);\n\n // Updating state\n set(\n produce((state: State) => {\n state.namespaces.list[id].data[key] = value;\n })\n );\n },\n getNamespaceData(storeId) {\n return namespaceStateSelector(get(), storeId);\n },\n\n _produceEventsWhenUpdatingStatus: (namespace, id, key, value) => {\n if (key === 'accounts') {\n // check for both null and empty array\n const isAccountsEmpty =\n Object.is(value, null) || (Array.isArray(value) && value.length === 0);\n\n if (isAccountsEmpty) {\n const currentConnectedStatus = get().namespaces.list[id].data.connected;\n if (currentConnectedStatus) {\n const event: NamespaceDisconnectedEvent = {\n type: 'namespace_disconnected',\n provider: namespace.info.providerId,\n namespace: namespace.info.namespaceId,\n };\n\n get().namespaces.events.push(event);\n }\n // Skip emitting disconnect event, if the `connected` is false\n } else {\n const currentAccounts = get().namespaces.list[id].data.accounts;\n\n if (!currentAccounts) {\n const event: NamespaceConnectedEvent = {\n type: 'namespace_connected',\n provider: namespace.info.providerId,\n namespace: namespace.info.namespaceId,\n accounts: value as string[],\n };\n\n get().namespaces.events.push(event);\n } else {\n const areSameAccounts =\n // Clone the object from the Zustand store, as it's immutable, to avoid errors during sorting.\n [...currentAccounts].sort().toString() ===\n (value as string[]).sort().toString();\n\n if (!areSameAccounts) {\n const event: NamespaceSwitchedAccountEvent = {\n type: 'namespace_account_switched',\n provider: namespace.info.providerId,\n namespace: namespace.info.namespaceId,\n previousAccounts: currentAccounts,\n accounts: value as string[],\n };\n\n get().namespaces.events.push(event);\n }\n }\n }\n } else if (key === 'network') {\n const currentNetwork = get().namespaces.list[id].data.network;\n\n const event: NamespaceSwitchedNetworkEvent = {\n type: 'namespace_network_switched',\n provider: namespace.info.providerId,\n namespace: namespace.info.namespaceId,\n network: value as string,\n previousNetwork: currentNetwork,\n };\n\n get().namespaces.events.push(event);\n }\n },\n});\n\nexport { namespacesStore };\n", "import type { Namespace } from '../../namespaces/common/types.js';\nimport type { State as InternalProviderState } from '../provider/mod.js';\nimport type { BlockchainMeta, SignerFactory } from 'rango-types';\nimport type { StateCreator } from 'zustand';\n\nimport { produce } from 'immer';\n\nimport { ConsumableEvents, type ProviderDetectedEvent } from './events.js';\nimport { guessProviderStateSelector, type State } from './mod.js';\n\ntype Browsers = 'firefox' | 'chrome' | 'edge' | 'brave' | 'homepage';\ntype Property<N extends string, V> = { name: N; value: V };\n\ntype NamespacesProperty = Property<\n 'namespaces',\n {\n selection: 'single' | 'multiple';\n data: {\n label: string;\n id: string;\n value: Namespace;\n unsupported?: boolean;\n getSupportedChains: (chains: BlockchainMeta[]) => BlockchainMeta[];\n }[];\n }\n>;\ntype DerivationPathProperty = Property<\n 'derivationPath',\n {\n data: {\n id: string;\n label: string;\n namespace: Namespace;\n generateDerivationPath: (index: string) => string;\n }[];\n }\n>;\ntype DetailsProperty = Property<\n 'details',\n {\n mobileWallet?: boolean;\n showOnMobile?: boolean;\n isContractWallet?: boolean;\n }\n>;\ntype SignersProperty = Property<\n 'signers',\n {\n getSigners: () => Promise<SignerFactory>;\n }\n>;\n\nexport type ProviderMetadata = {\n name: string;\n icon: string;\n extensions: Partial<Record<Browsers, string>>;\n properties?: Array<\n | NamespacesProperty\n | DerivationPathProperty\n | DetailsProperty\n | SignersProperty\n >;\n};\n\nexport interface ProviderConfig {\n metadata: ProviderMetadata;\n}\n\nexport type ProviderInfo = ProviderConfig;\n\ninterface ProviderData {\n installed: boolean;\n}\n\ninterface ProviderItem {\n config: ProviderConfig;\n data: ProviderData;\n error: unknown;\n}\n\ntype ProviderState = {\n events: ConsumableEvents;\n list: Record<string, ProviderItem>;\n};\ninterface ProviderActions {\n addProvider: (id: string, config: ProviderConfig) => void;\n removeProvider: (id: string) => void;\n updateStatus: <K extends keyof ProviderData>(\n id: string,\n key: K,\n value: ProviderData[K]\n ) => void;\n\n _produceEventsWhenUpdatingStatus: <K extends keyof ProviderData>(\n provider: ProviderItem,\n id: string,\n key: K,\n value: ProviderData[K]\n ) => void;\n}\n\ninterface ProviderSelectors {\n /**\n * Provider has a limited state to itself, to be compatible with legacy, we try to produce same object as legacy\n * which includes namespace state as well.\n */\n guessNamespacesState: (id: string) => InternalProviderState;\n}\n\nexport type ProviderStore = ProviderState & ProviderActions & ProviderSelectors;\ntype ProvidersStateCreator = StateCreator<State, [], [], ProviderStore>;\n\nconst providersStore: ProvidersStateCreator = (set, get) => ({\n events: new ConsumableEvents(),\n\n list: {},\n addProvider: (id, config) => {\n const item = {\n data: {\n installed: false,\n },\n error: '',\n config,\n };\n\n set(\n produce((state: State) => {\n state.providers.list[id] = item;\n })\n );\n },\n removeProvider: (id) => {\n set(\n produce((state: State) => {\n delete state.providers.list[id];\n })\n );\n },\n updateStatus: (id, key, value) => {\n const provider = get().providers.list[id];\n if (!provider) {\n throw new Error(`No namespace namespace with '${id}' found.`);\n }\n\n get().providers._produceEventsWhenUpdatingStatus(provider, id, key, value);\n\n set(\n produce((state: State) => {\n state.providers.list[id].data[key] = value;\n })\n );\n },\n guessNamespacesState: (providerId: string): InternalProviderState => {\n return guessProviderStateSelector(get(), providerId);\n },\n\n _produceEventsWhenUpdatingStatus: (_provider, id, key, _value) => {\n if (key === 'installed') {\n const event: ProviderDetectedEvent = {\n type: 'provider_detected',\n provider: id,\n };\n\n get().providers.events.push(event);\n }\n },\n});\n\nexport { providersStore };\n", "import type { Actions, Context, Operators } from '../hub/namespaces/types.js';\nimport type { AnyFunction, FunctionWithContext } from '../types/actions.js';\n\nexport interface ActionByBuilder<T, Context> {\n actionName: keyof T;\n and: Operators<T>;\n or: Operators<T>;\n after: Operators<T>;\n before: Operators<T>;\n action: FunctionWithContext<T[keyof T], Context>;\n}\n\n/*\n * TODO:\n * Currently, to use this builder you will write something like this:\n * new ActionBuilder<EvmActions, 'disconnect'>('disconnect').after(....)\n *\n * I couldn't figure it out to be able typescript infer the constructor value as key of actions.\n * Ideal usage:\n * new ActionBuilder<EvmActions>('disconnect').after(....)\n *\n */\nexport class ActionBuilder<T extends Actions<T>, K extends keyof T> {\n readonly name: K;\n #and: Operators<T> = new Map();\n #or: Operators<T> = new Map();\n #after: Operators<T> = new Map();\n #before: Operators<T> = new Map();\n #action: FunctionWithContext<T[keyof T], Context<T>> | undefined;\n\n constructor(name: K) {\n this.name = name;\n }\n\n public and(action: FunctionWithContext<AnyFunction, Context<T>>) {\n if (!this.#and.has(this.name)) {\n this.#and.set(this.name, []);\n }\n this.#and.get(this.name)?.push(action);\n return this;\n }\n\n public or(action: FunctionWithContext<AnyFunction, Context<T>>) {\n if (!this.#or.has(this.name)) {\n this.#or.set(this.name, []);\n }\n this.#or.get(this.name)?.push(action);\n return this;\n }\n\n public before(action: FunctionWithContext<AnyFunction, Context<T>>) {\n if (!this.#before.has(this.name)) {\n this.#before.set(this.name, []);\n }\n this.#before.get(this.name)?.push(action);\n return this;\n }\n\n public after(action: FunctionWithContext<AnyFunction, Context<T>>) {\n if (!this.#after.has(this.name)) {\n this.#after.set(this.name, []);\n }\n this.#after.get(this.name)?.push(action);\n return this;\n }\n\n public action(action: FunctionWithContext<T[keyof T], Context<T>>) {\n this.#action = action;\n return this;\n }\n\n public build(): ActionByBuilder<T, Context<T>> {\n if (!this.#action) {\n throw new Error('Your action builder should includes an action.');\n }\n\n return {\n actionName: this.name,\n action: this.#action,\n before: this.#before,\n after: this.#after,\n and: this.#and,\n or: this.#or,\n };\n }\n}\n", "/*\n * It is not a good idea to re-export all of CAIP because if they have a breaking change, we will break as well.\n * It would be better to create an abstraction over them and export our own interface to ensure it is under our control.\n */\nexport * as CAIP from 'caip';\n\nexport { generateStoreId } from '../hub/helpers.js';\nexport * from './versions.js';\n", "import type { Context } from '../../hub/namespaces/mod.js';\n\nexport function intoConnectionFinished(context: Context) {\n const [, setState] = context.state();\n setState('connecting', false);\n}\n\nexport const recommended = [['connect', intoConnectionFinished] as const];\n", "import { AccountId } from 'caip';\n\nexport function isValidCaipAddress(address: string): boolean {\n try {\n AccountId.parse(address);\n return true;\n } catch {\n return false;\n }\n}\n", "import type {\n Accounts,\n AccountsWithActiveChain,\n} from './../../types/accounts.js';\nimport type { Context } from '../../hub/namespaces/mod.js';\n\nimport { isValidCaipAddress } from './helpers.js';\n\nexport function connectAndUpdateStateForSingleNetwork(\n context: Context,\n accounts: Accounts\n) {\n if (!accounts.every(isValidCaipAddress)) {\n throw new Error(\n `Your provider should format account addresses in CAIP-10 format. Your provided accounts: ${accounts}`\n );\n }\n\n const [, setState] = context.state();\n setState('accounts', accounts);\n setState('connected', true);\n return accounts;\n}\n\nexport function connectAndUpdateStateForMultiNetworks(\n context: Context,\n accounts: AccountsWithActiveChain\n) {\n if (!accounts.accounts.every(isValidCaipAddress)) {\n throw new Error(\n `Your provider should format account addresses in CAIP-10 format. Your provided accounts: ${accounts.accounts}`\n );\n }\n\n const [, setState] = context.state();\n setState('accounts', accounts.accounts);\n setState('network', accounts.network);\n setState('connected', true);\n return accounts;\n}\n\nexport const recommended = [];\n", "import type { Context } from '../../hub/namespaces/mod.js';\n\nexport function intoConnecting(context: Context) {\n const [, setState] = context.state();\n setState('connecting', true);\n}\n\n// Please consider if you are going to add something here, make sure it works on all namespaces.\nexport const recommended = [['connect', intoConnecting] as const];\n", "/*\n * @see https://namespaces.chainagnostic.org/stellar/README\n */\n\n// if the value neeeds to be change make sure you will update mapCaipNamespaceToLegacyNetworkName as well\nexport const CAIP_NAMESPACE = 'stellar';\nexport const CAIP_STELLAR_CHAIN_ID = 'mainnet';\n\nexport const HORIZON_URL = 'https://horizon.stellar.org';\n", "import type { CaipAccount } from '../common/mod.js';\n\nimport { AccountId } from 'caip';\n\nimport { CAIP_NAMESPACE, CAIP_STELLAR_CHAIN_ID } from './constants.js';\n\nexport function formatAddressToCAIP(address: string): string {\n return AccountId.format({\n address,\n chainId: {\n namespace: CAIP_NAMESPACE,\n reference: CAIP_STELLAR_CHAIN_ID,\n },\n }) as CaipAccount;\n}\n"],
5
+ "mappings": "6IAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,kBAAAE,EAAA,YAAAC,IAEA,UAAYC,MAAgB,uBCA5B,OAAS,eAAeC,OAA0B,kBCElD,OAAS,WAAAC,OAAe,QCCxB,OAAS,WAAAC,OAAe,QCiBjB,IAAMC,EAAN,KAA6D,CAtBpE,MAsBoE,CAAAC,EAAA,sBACzD,KACTC,GAAqB,IAAI,IACzBC,GAAoB,IAAI,IACxBC,GAAuB,IAAI,IAC3BC,GAAwB,IAAI,IAC5BC,GAEA,YAAYC,EAAS,CACnB,KAAK,KAAOA,CACd,CAEO,IAAIC,EAAsD,CAC/D,OAAK,KAAKN,GAAK,IAAI,KAAK,IAAI,GAC1B,KAAKA,GAAK,IAAI,KAAK,KAAM,CAAC,CAAC,EAE7B,KAAKA,GAAK,IAAI,KAAK,IAAI,GAAG,KAAKM,CAAM,EAC9B,IACT,CAEO,GAAGA,EAAsD,CAC9D,OAAK,KAAKL,GAAI,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AAIH,EAAQ,MAAM,EACnC,OAAAG,EAAS,WAAYF,CAAQ,EAC7BE,EAAS,YAAa,EAAI,EACnBF,CACT,CAdgBG,EAAAL,EAAA,yCCNT,SAASM,EAAeC,EAAkB,CAC/C,GAAM,CAAC,CAAEC,CAAQ,EAAID,EAAQ,MAAM,EACnCC,EAAS,aAAc,EAAI,CAC7B,CAHgBC,EAAAH,EAAA,kBCGT,IAAMI,EAAiB,UACjBC,EAAwB,UAExBC,EAAc,8BVKpB,IAAMC,EAAUC,EAAA,IACrB,IAAIC,EAAyC,SAAS,EACnD,IAAIC,CAAqC,EACzC,OAAOC,CAAc,EACrB,MAAMC,CAAsB,EAJV,WAMVC,EAAe,IAAIJ,EAC9B,cACF,EAAE,OAAO,eAAgBK,EAAGC,EAAmB,CAI7C,OAFgB,MADD,IAAe,UAAQ,OAAOC,CAAW,EAC3B,YAAYD,CAAS,GAEnC,QACjB,CAAC,EW1BD,IAAAE,EAAA,GAAAC,EAAAD,EAAA,yBAAAE,IAEA,OAAS,aAAAC,MAAiB,OAInB,SAASC,EAAoBC,EAAyB,CAC3D,OAAOC,EAAU,OAAO,CACtB,QAAAD,EACA,QAAS,CACP,UAAWE,EACX,UAAWC,CACb,CACF,CAAC,CACH,CARgBC,EAAAL,EAAA",
6
+ "names": ["builders_exports", "__export", "balanceLines", "connect", "StellarSdk", "createZustandStore", "produce", "produce", "ActionBuilder", "__name", "#and", "#or", "#after", "#before", "#action", "name", "action", "CAIP", "intoConnectionFinished", "context", "setState", "__name", "AccountId", "isValidCaipAddress", "address", "AccountId", "__name", "connectAndUpdateStateForSingleNetwork", "context", "accounts", "isValidCaipAddress", "setState", "__name", "intoConnecting", "context", "setState", "__name", "CAIP_NAMESPACE", "CAIP_STELLAR_CHAIN_ID", "HORIZON_URL", "connect", "__name", "ActionBuilder", "connectAndUpdateStateForSingleNetwork", "intoConnecting", "intoConnectionFinished", "balanceLines", "_", "accountId", "HORIZON_URL", "utils_exports", "__export", "formatAddressToCAIP", "AccountId", "formatAddressToCAIP", "address", "AccountId", "CAIP_NAMESPACE", "CAIP_STELLAR_CHAIN_ID", "__name"]
7
+ }
@@ -0,0 +1,11 @@
1
+ import type { Accounts } from '../common/mod.js';
2
+ import type { AutoImplementedActionsByRecommended, CommonActions } from '../common/types.js';
3
+ import type { Horizon } from '@stellar/stellar-sdk';
4
+ type BalanceLines = Horizon.AccountResponse['balances'];
5
+ export interface StellarActions extends AutoImplementedActionsByRecommended, CommonActions {
6
+ connect: () => Promise<Accounts>;
7
+ canEagerConnect: () => Promise<boolean>;
8
+ balanceLines: (account: string) => Promise<BalanceLines>;
9
+ }
10
+ export {};
11
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/namespaces/stellar/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,KAAK,EACV,mCAAmC,EACnC,aAAa,EACd,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAEpD,KAAK,YAAY,GAAG,OAAO,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC;AACxD,MAAM,WAAW,cACf,SAAQ,mCAAmC,EACzC,aAAa;IACf,OAAO,EAAE,MAAM,OAAO,CAAC,QAAQ,CAAC,CAAC;IACjC,eAAe,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IACxC,YAAY,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC;CAC1D"}
@@ -0,0 +1,2 @@
1
+ export declare function formatAddressToCAIP(address: string): string;
2
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/namespaces/stellar/utils.ts"],"names":[],"mappings":"AAMA,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAQ3D"}
@@ -1 +1 @@
1
- {"inputs":{"src/hub/helpers.ts":{"bytes":371,"imports":[{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/hub/namespaces/errors.ts":{"bytes":455,"imports":[{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/hub/namespaces/namespace.ts":{"bytes":13059,"imports":[{"path":"src/hub/helpers.ts","kind":"import-statement","original":"../helpers.js"},{"path":"src/hub/namespaces/errors.ts","kind":"import-statement","original":"./errors.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/hub/namespaces/mod.ts":{"bytes":181,"imports":[{"path":"src/hub/namespaces/namespace.ts","kind":"import-statement","original":"./namespace.js"}],"format":"esm"},"src/hub/provider/provider.ts":{"bytes":9393,"imports":[{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/hub/provider/mod.ts":{"bytes":196,"imports":[{"path":"src/hub/provider/provider.ts","kind":"import-statement","original":"./provider.js"}],"format":"esm"},"src/hub/hub.ts":{"bytes":3762,"imports":[{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/hub/store/selectors.ts":{"bytes":2228,"imports":[{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/hub/store/extend.ts":{"bytes":3898,"imports":[{"path":"src/hub/store/selectors.ts","kind":"import-statement","original":"./selectors.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/hub/store/hub.ts":{"bytes":342,"imports":[{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/hub/store/events.ts":{"bytes":1956,"imports":[{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/hub/store/namespaces.ts":{"bytes":4883,"imports":[{"path":"immer","kind":"import-statement","external":true},{"path":"src/hub/store/events.ts","kind":"import-statement","original":"./events.js"},{"path":"src/hub/store/mod.ts","kind":"import-statement","original":"./mod.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/hub/store/providers.ts":{"bytes":4043,"imports":[{"path":"immer","kind":"import-statement","external":true},{"path":"src/hub/store/events.ts","kind":"import-statement","original":"./events.js"},{"path":"src/hub/store/mod.ts","kind":"import-statement","original":"./mod.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/hub/store/store.ts":{"bytes":808,"imports":[{"path":"zustand/vanilla","kind":"import-statement","external":true},{"path":"src/hub/store/extend.ts","kind":"import-statement","original":"./extend.js"},{"path":"src/hub/store/hub.ts","kind":"import-statement","original":"./hub.js"},{"path":"src/hub/store/namespaces.ts","kind":"import-statement","original":"./namespaces.js"},{"path":"src/hub/store/providers.ts","kind":"import-statement","original":"./providers.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/hub/store/mod.ts":{"bytes":652,"imports":[{"path":"src/hub/store/selectors.ts","kind":"import-statement","original":"./selectors.js"},{"path":"src/hub/store/store.ts","kind":"import-statement","original":"./store.js"}],"format":"esm"},"src/hub/mod.ts":{"bytes":522,"imports":[{"path":"src/hub/namespaces/mod.ts","kind":"import-statement","original":"./namespaces/mod.js"},{"path":"src/hub/provider/mod.ts","kind":"import-statement","original":"./provider/mod.js"},{"path":"src/hub/hub.ts","kind":"import-statement","original":"./hub.js"},{"path":"src/hub/store/mod.ts","kind":"import-statement","original":"./store/mod.js"},{"path":"src/hub/helpers.ts","kind":"import-statement","original":"./helpers.js"}],"format":"esm"},"src/builders/namespace.ts":{"bytes":7991,"imports":[{"path":"src/hub/mod.ts","kind":"import-statement","original":"../hub/mod.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/builders/provider.ts":{"bytes":1588,"imports":[{"path":"src/hub/provider/mod.ts","kind":"import-statement","original":"../hub/provider/mod.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/builders/action.ts":{"bytes":2385,"imports":[{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/builders/mod.ts":{"bytes":220,"imports":[{"path":"src/builders/namespace.ts","kind":"import-statement","original":"./namespace.js"},{"path":"src/builders/provider.ts","kind":"import-statement","original":"./provider.js"},{"path":"src/builders/action.ts","kind":"import-statement","original":"./action.js"}],"format":"esm"},"src/utils/versions.ts":{"bytes":1851,"imports":[{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/utils/mod.ts":{"bytes":356,"imports":[{"path":"caip","kind":"import-statement","external":true},{"path":"src/hub/helpers.ts","kind":"import-statement","original":"../hub/helpers.js"},{"path":"src/utils/versions.ts","kind":"import-statement","original":"./versions.js"}],"format":"esm"},"src/mod.ts":{"bytes":1504,"imports":[{"path":"src/hub/mod.ts","kind":"import-statement","original":"./hub/mod.js"},{"path":"src/builders/mod.ts","kind":"import-statement","original":"./builders/mod.js"},{"path":"src/utils/mod.ts","kind":"import-statement","original":"./utils/mod.js"}],"format":"esm"},"src/legacy/types.ts":{"bytes":7300,"imports":[],"format":"esm"},"src/legacy/persistor.ts":{"bytes":544,"imports":[{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/legacy/helpers.ts":{"bytes":1855,"imports":[{"path":"src/legacy/types.ts","kind":"import-statement","original":"./types.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/legacy/utils.ts":{"bytes":645,"imports":[{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/legacy/wallet.ts":{"bytes":16229,"imports":[{"path":"src/legacy/helpers.ts","kind":"import-statement","original":"./helpers.js"},{"path":"src/legacy/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/legacy/utils.ts","kind":"import-statement","original":"./utils.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/legacy/mod.ts":{"bytes":1518,"imports":[{"path":"src/legacy/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/legacy/persistor.ts","kind":"import-statement","original":"./persistor.js"},{"path":"src/legacy/helpers.ts","kind":"import-statement","original":"./helpers.js"},{"path":"src/legacy/wallet.ts","kind":"import-statement","original":"./wallet.js"},{"path":"src/legacy/utils.ts","kind":"import-statement","original":"./utils.js"}],"format":"esm"},"src/namespaces/common/actions.ts":{"bytes":380,"imports":[{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/namespaces/evm/constants.ts":{"bytes":83,"imports":[],"format":"esm"},"src/namespaces/evm/utils.ts":{"bytes":3494,"imports":[{"path":"caip","kind":"import-statement","external":true},{"path":"rango-types","kind":"import-statement","external":true},{"path":"src/namespaces/evm/constants.ts","kind":"import-statement","original":"./constants.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/namespaces/evm/actions.ts":{"bytes":4096,"imports":[{"path":"src/namespaces/common/actions.ts","kind":"import-statement","original":"../common/actions.js"},{"path":"src/namespaces/evm/utils.ts","kind":"import-statement","original":"./utils.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/namespaces/evm/hooks.ts":{"bytes":1217,"imports":[{"path":"src/namespaces/evm/mod.ts","kind":"import-statement","original":"./mod.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/namespaces/common/after.ts":{"bytes":271,"imports":[{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/namespaces/evm/after.ts":{"bytes":123,"imports":[{"path":"src/namespaces/common/after.ts","kind":"import-statement","original":"../common/after.js"}],"format":"esm"},"src/namespaces/common/builders.ts":{"bytes":545,"imports":[{"path":"src/mod.ts","kind":"import-statement","original":"../../mod.js"},{"path":"src/namespaces/common/actions.ts","kind":"import-statement","original":"./actions.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/namespaces/common/utils.ts":{"bytes":987,"imports":[{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/namespaces/common/or.ts":{"bytes":734,"imports":[{"path":"src/namespaces/common/utils.ts","kind":"import-statement","original":"./utils.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/namespaces/common/hooks/changeAccountSubscriber.ts":{"bytes":7467,"imports":[{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/namespaces/common/helpers.ts":{"bytes":189,"imports":[{"path":"caip","kind":"import-statement","external":true},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/namespaces/common/and.ts":{"bytes":1144,"imports":[{"path":"src/namespaces/common/helpers.ts","kind":"import-statement","original":"./helpers.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/namespaces/common/before.ts":{"bytes":351,"imports":[{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/namespaces/common/mod.ts":{"bytes":749,"imports":[{"path":"src/namespaces/common/actions.ts","kind":"import-statement","original":"./actions.js"},{"path":"src/namespaces/common/builders.ts","kind":"import-statement","original":"./builders.js"},{"path":"src/namespaces/common/or.ts","kind":"import-statement","original":"./or.js"},{"path":"src/namespaces/common/utils.ts","kind":"import-statement","original":"./utils.js"},{"path":"src/namespaces/common/after.ts","kind":"import-statement","original":"./after.js"},{"path":"src/namespaces/common/hooks/changeAccountSubscriber.ts","kind":"import-statement","original":"./hooks/changeAccountSubscriber.js"},{"path":"src/namespaces/common/and.ts","kind":"import-statement","original":"./and.js"},{"path":"src/namespaces/common/before.ts","kind":"import-statement","original":"./before.js"}],"format":"esm"},"src/namespaces/evm/and.ts":{"bytes":170,"imports":[{"path":"src/namespaces/common/mod.ts","kind":"import-statement","original":"../common/mod.js"}],"format":"esm"},"src/namespaces/evm/before.ts":{"bytes":106,"imports":[{"path":"src/namespaces/common/mod.ts","kind":"import-statement","original":"../common/mod.js"}],"format":"esm"},"src/namespaces/evm/builders.ts":{"bytes":1992,"imports":[{"path":"src/mod.ts","kind":"import-statement","original":"../../mod.js"},{"path":"src/namespaces/common/hooks/changeAccountSubscriber.ts","kind":"import-statement","original":"../common/hooks/changeAccountSubscriber.js"},{"path":"src/namespaces/common/mod.ts","kind":"import-statement","original":"../common/mod.js"},{"path":"src/namespaces/evm/utils.ts","kind":"import-statement","original":"./utils.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/namespaces/evm/mod.ts":{"bytes":416,"imports":[{"path":"src/namespaces/evm/actions.ts","kind":"import-statement","original":"./actions.js"},{"path":"src/namespaces/evm/hooks.ts","kind":"import-statement","original":"./hooks.js"},{"path":"src/namespaces/evm/after.ts","kind":"import-statement","original":"./after.js"},{"path":"src/namespaces/evm/and.ts","kind":"import-statement","original":"./and.js"},{"path":"src/namespaces/evm/before.ts","kind":"import-statement","original":"./before.js"},{"path":"src/namespaces/evm/utils.ts","kind":"import-statement","original":"./utils.js"},{"path":"src/namespaces/evm/builders.ts","kind":"import-statement","original":"./builders.js"},{"path":"src/namespaces/evm/constants.ts","kind":"import-statement","original":"./constants.js"}],"format":"esm"},"src/namespaces/solana/constants.ts":{"bytes":112,"imports":[],"format":"esm"},"src/namespaces/solana/utils.ts":{"bytes":1037,"imports":[{"path":"caip","kind":"import-statement","external":true},{"path":"src/legacy/mod.ts","kind":"import-statement","original":"../../legacy/mod.js"},{"path":"src/namespaces/solana/constants.ts","kind":"import-statement","original":"./constants.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/namespaces/solana/actions.ts":{"bytes":1262,"imports":[{"path":"src/namespaces/common/actions.ts","kind":"import-statement","original":"../common/actions.js"},{"path":"src/namespaces/solana/utils.ts","kind":"import-statement","original":"./utils.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/namespaces/solana/hooks.ts":{"bytes":369,"imports":[{"path":"src/namespaces/solana/mod.ts","kind":"import-statement","original":"./mod.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/namespaces/solana/after.ts":{"bytes":123,"imports":[{"path":"src/namespaces/common/after.ts","kind":"import-statement","original":"../common/after.js"}],"format":"esm"},"src/namespaces/solana/and.ts":{"bytes":170,"imports":[{"path":"src/namespaces/common/mod.ts","kind":"import-statement","original":"../common/mod.js"}],"format":"esm"},"src/namespaces/solana/before.ts":{"bytes":124,"imports":[{"path":"src/namespaces/common/before.ts","kind":"import-statement","original":"../common/before.js"}],"format":"esm"},"src/namespaces/solana/builders.ts":{"bytes":1433,"imports":[{"path":"src/mod.ts","kind":"import-statement","original":"../../mod.js"},{"path":"src/namespaces/common/hooks/changeAccountSubscriber.ts","kind":"import-statement","original":"../common/hooks/changeAccountSubscriber.js"},{"path":"src/namespaces/common/mod.ts","kind":"import-statement","original":"../common/mod.js"},{"path":"src/namespaces/solana/utils.ts","kind":"import-statement","original":"./utils.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/namespaces/solana/mod.ts":{"bytes":401,"imports":[{"path":"src/namespaces/solana/actions.ts","kind":"import-statement","original":"./actions.js"},{"path":"src/namespaces/solana/hooks.ts","kind":"import-statement","original":"./hooks.js"},{"path":"src/namespaces/solana/after.ts","kind":"import-statement","original":"./after.js"},{"path":"src/namespaces/solana/and.ts","kind":"import-statement","original":"./and.js"},{"path":"src/namespaces/solana/before.ts","kind":"import-statement","original":"./before.js"},{"path":"src/namespaces/solana/builders.ts","kind":"import-statement","original":"./builders.js"},{"path":"src/namespaces/solana/utils.ts","kind":"import-statement","original":"./utils.js"},{"path":"src/namespaces/solana/constants.ts","kind":"import-statement","original":"./constants.js"}],"format":"esm"},"src/namespaces/cosmos/actions.ts":{"bytes":125,"imports":[{"path":"src/namespaces/common/actions.ts","kind":"import-statement","original":"../common/actions.js"}],"format":"esm"},"src/namespaces/cosmos/after.ts":{"bytes":123,"imports":[{"path":"src/namespaces/common/after.ts","kind":"import-statement","original":"../common/after.js"}],"format":"esm"},"src/namespaces/cosmos/and.ts":{"bytes":170,"imports":[{"path":"src/namespaces/common/mod.ts","kind":"import-statement","original":"../common/mod.js"}],"format":"esm"},"src/namespaces/cosmos/before.ts":{"bytes":106,"imports":[{"path":"src/namespaces/common/mod.ts","kind":"import-statement","original":"../common/mod.js"}],"format":"esm"},"src/namespaces/cosmos/constants.ts":{"bytes":40,"imports":[],"format":"esm"},"src/namespaces/cosmos/utils.ts":{"bytes":595,"imports":[{"path":"caip","kind":"import-statement","external":true},{"path":"src/namespaces/cosmos/constants.ts","kind":"import-statement","original":"./constants.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/namespaces/cosmos/builders.ts":{"bytes":427,"imports":[{"path":"src/mod.ts","kind":"import-statement","original":"../../mod.js"},{"path":"src/namespaces/common/mod.ts","kind":"import-statement","original":"../common/mod.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/namespaces/cosmos/mod.ts":{"bytes":404,"imports":[{"path":"src/namespaces/cosmos/actions.ts","kind":"import-statement","original":"./actions.js"},{"path":"src/namespaces/cosmos/after.ts","kind":"import-statement","original":"./after.js"},{"path":"src/namespaces/cosmos/and.ts","kind":"import-statement","original":"./and.js"},{"path":"src/namespaces/cosmos/before.ts","kind":"import-statement","original":"./before.js"},{"path":"src/namespaces/cosmos/utils.ts","kind":"import-statement","original":"./utils.js"},{"path":"src/namespaces/cosmos/builders.ts","kind":"import-statement","original":"./builders.js"},{"path":"src/namespaces/cosmos/constants.ts","kind":"import-statement","original":"./constants.js"}],"format":"esm"},"src/namespaces/utxo/actions.ts":{"bytes":125,"imports":[{"path":"src/namespaces/common/actions.ts","kind":"import-statement","original":"../common/actions.js"}],"format":"esm"},"src/namespaces/utxo/after.ts":{"bytes":123,"imports":[{"path":"src/namespaces/common/after.ts","kind":"import-statement","original":"../common/after.js"}],"format":"esm"},"src/namespaces/utxo/and.ts":{"bytes":170,"imports":[{"path":"src/namespaces/common/mod.ts","kind":"import-statement","original":"../common/mod.js"}],"format":"esm"},"src/namespaces/utxo/before.ts":{"bytes":124,"imports":[{"path":"src/namespaces/common/before.ts","kind":"import-statement","original":"../common/before.js"}],"format":"esm"},"src/namespaces/utxo/builders.ts":{"bytes":480,"imports":[{"path":"src/mod.ts","kind":"import-statement","original":"../../mod.js"},{"path":"src/namespaces/common/after.ts","kind":"import-statement","original":"../common/after.js"},{"path":"src/namespaces/common/and.ts","kind":"import-statement","original":"../common/and.js"},{"path":"src/namespaces/common/before.ts","kind":"import-statement","original":"../common/before.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/namespaces/utxo/constants.ts":{"bytes":157,"imports":[],"format":"esm"},"src/namespaces/utxo/utils.ts":{"bytes":445,"imports":[{"path":"caip","kind":"import-statement","external":true},{"path":"src/namespaces/utxo/constants.ts","kind":"import-statement","original":"./constants.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/namespaces/utxo/mod.ts":{"bytes":390,"imports":[{"path":"src/namespaces/utxo/actions.ts","kind":"import-statement","original":"./actions.js"},{"path":"src/namespaces/utxo/after.ts","kind":"import-statement","original":"./after.js"},{"path":"src/namespaces/utxo/and.ts","kind":"import-statement","original":"./and.js"},{"path":"src/namespaces/utxo/before.ts","kind":"import-statement","original":"./before.js"},{"path":"src/namespaces/utxo/builders.ts","kind":"import-statement","original":"./builders.js"},{"path":"src/namespaces/utxo/utils.ts","kind":"import-statement","original":"./utils.js"},{"path":"src/namespaces/utxo/constants.ts","kind":"import-statement","original":"./constants.js"}],"format":"esm"},"src/namespaces/sui/actions.ts":{"bytes":652,"imports":[{"path":"src/namespaces/sui/mod.ts","kind":"import-statement","original":"./mod.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/namespaces/sui/constants.ts":{"bytes":275,"imports":[],"format":"esm"},"src/namespaces/sui/utils.ts":{"bytes":1527,"imports":[{"path":"@mysten/wallet-standard","kind":"import-statement","external":true},{"path":"caip","kind":"import-statement","external":true},{"path":"src/namespaces/sui/constants.ts","kind":"import-statement","original":"./constants.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/namespaces/sui/builders.ts":{"bytes":2414,"imports":[{"path":"src/mod.ts","kind":"import-statement","original":"../../mod.js"},{"path":"src/utils/mod.ts","kind":"import-statement","original":"../../utils/mod.js"},{"path":"src/namespaces/common/hooks/changeAccountSubscriber.ts","kind":"import-statement","original":"../common/hooks/changeAccountSubscriber.js"},{"path":"src/namespaces/common/mod.ts","kind":"import-statement","original":"../common/mod.js"},{"path":"src/namespaces/sui/constants.ts","kind":"import-statement","original":"./constants.js"},{"path":"src/namespaces/sui/utils.ts","kind":"import-statement","original":"./utils.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/namespaces/sui/hooks.ts":{"bytes":401,"imports":[{"path":"src/namespaces/sui/mod.ts","kind":"import-statement","original":"./mod.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/namespaces/sui/mod.ts":{"bytes":312,"imports":[{"path":"src/namespaces/sui/actions.ts","kind":"import-statement","original":"./actions.js"},{"path":"src/namespaces/sui/builders.ts","kind":"import-statement","original":"./builders.js"},{"path":"src/namespaces/sui/hooks.ts","kind":"import-statement","original":"./hooks.js"},{"path":"src/namespaces/sui/utils.ts","kind":"import-statement","original":"./utils.js"},{"path":"src/namespaces/sui/constants.ts","kind":"import-statement","original":"./constants.js"}],"format":"esm"},"src/namespaces/tron/actions.ts":{"bytes":125,"imports":[{"path":"src/namespaces/common/actions.ts","kind":"import-statement","original":"../common/actions.js"}],"format":"esm"},"src/namespaces/tron/after.ts":{"bytes":123,"imports":[{"path":"src/namespaces/common/after.ts","kind":"import-statement","original":"../common/after.js"}],"format":"esm"},"src/namespaces/tron/and.ts":{"bytes":170,"imports":[{"path":"src/namespaces/common/mod.ts","kind":"import-statement","original":"../common/mod.js"}],"format":"esm"},"src/namespaces/tron/before.ts":{"bytes":124,"imports":[{"path":"src/namespaces/common/before.ts","kind":"import-statement","original":"../common/before.js"}],"format":"esm"},"src/namespaces/tron/builders.ts":{"bytes":590,"imports":[{"path":"src/mod.ts","kind":"import-statement","original":"../../mod.js"},{"path":"src/namespaces/common/after.ts","kind":"import-statement","original":"../common/after.js"},{"path":"src/namespaces/common/and.ts","kind":"import-statement","original":"../common/and.js"},{"path":"src/namespaces/common/before.ts","kind":"import-statement","original":"../common/before.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/namespaces/tron/constants.ts":{"bytes":278,"imports":[],"format":"esm"},"src/namespaces/tron/utils.ts":{"bytes":459,"imports":[{"path":"caip","kind":"import-statement","external":true},{"path":"src/namespaces/tron/constants.ts","kind":"import-statement","original":"./constants.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/namespaces/tron/mod.ts":{"bytes":359,"imports":[{"path":"src/namespaces/tron/actions.ts","kind":"import-statement","original":"./actions.js"},{"path":"src/namespaces/tron/after.ts","kind":"import-statement","original":"./after.js"},{"path":"src/namespaces/tron/and.ts","kind":"import-statement","original":"./and.js"},{"path":"src/namespaces/tron/before.ts","kind":"import-statement","original":"./before.js"},{"path":"src/namespaces/tron/builders.ts","kind":"import-statement","original":"./builders.js"},{"path":"src/namespaces/tron/utils.ts","kind":"import-statement","original":"./utils.js"},{"path":"src/namespaces/tron/constants.ts","kind":"import-statement","original":"./constants.js"}],"format":"esm"},"src/namespaces/starknet/actions.ts":{"bytes":526,"imports":[{"path":"src/namespaces/common/actions.ts","kind":"import-statement","original":"../common/actions.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/namespaces/starknet/after.ts":{"bytes":123,"imports":[{"path":"src/namespaces/common/after.ts","kind":"import-statement","original":"../common/after.js"}],"format":"esm"},"src/namespaces/starknet/and.ts":{"bytes":170,"imports":[{"path":"src/namespaces/common/mod.ts","kind":"import-statement","original":"../common/mod.js"}],"format":"esm"},"src/namespaces/starknet/before.ts":{"bytes":124,"imports":[{"path":"src/namespaces/common/before.ts","kind":"import-statement","original":"../common/before.js"}],"format":"esm"},"src/namespaces/starknet/builders.ts":{"bytes":545,"imports":[{"path":"src/mod.ts","kind":"import-statement","original":"../../mod.js"},{"path":"src/namespaces/common/mod.ts","kind":"import-statement","original":"../common/mod.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/namespaces/starknet/constants.ts":{"bytes":293,"imports":[],"format":"esm"},"src/namespaces/starknet/utils.ts":{"bytes":957,"imports":[{"path":"caip","kind":"import-statement","external":true},{"path":"src/legacy/mod.ts","kind":"import-statement","original":"../../legacy/mod.js"},{"path":"src/namespaces/starknet/constants.ts","kind":"import-statement","original":"./constants.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/namespaces/starknet/mod.ts":{"bytes":368,"imports":[{"path":"src/namespaces/starknet/actions.ts","kind":"import-statement","original":"./actions.js"},{"path":"src/namespaces/starknet/after.ts","kind":"import-statement","original":"./after.js"},{"path":"src/namespaces/starknet/and.ts","kind":"import-statement","original":"./and.js"},{"path":"src/namespaces/starknet/before.ts","kind":"import-statement","original":"./before.js"},{"path":"src/namespaces/starknet/builders.ts","kind":"import-statement","original":"./builders.js"},{"path":"src/namespaces/starknet/utils.ts","kind":"import-statement","original":"./utils.js"},{"path":"src/namespaces/starknet/constants.ts","kind":"import-statement","original":"./constants.js"}],"format":"esm"},"src/namespaces/xrpl/builders.ts":{"bytes":412,"imports":[{"path":"src/mod.ts","kind":"import-statement","original":"../../mod.js"},{"path":"src/namespaces/common/mod.ts","kind":"import-statement","original":"../common/mod.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/namespaces/xrpl/constants.ts":{"bytes":254,"imports":[],"format":"esm"},"src/namespaces/xrpl/utils.ts":{"bytes":378,"imports":[{"path":"caip","kind":"import-statement","external":true},{"path":"src/namespaces/xrpl/constants.ts","kind":"import-statement","original":"./constants.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/namespaces/xrpl/mod.ts":{"bytes":197,"imports":[{"path":"src/namespaces/xrpl/builders.ts","kind":"import-statement","original":"./builders.js"},{"path":"src/namespaces/xrpl/utils.ts","kind":"import-statement","original":"./utils.js"},{"path":"src/namespaces/xrpl/constants.ts","kind":"import-statement","original":"./constants.js"}],"format":"esm"},"src/namespaces/ton/constants.ts":{"bytes":78,"imports":[],"format":"esm"},"src/namespaces/ton/utils.ts":{"bytes":464,"imports":[{"path":"caip","kind":"import-statement","external":true},{"path":"src/namespaces/ton/constants.ts","kind":"import-statement","original":"./constants.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/namespaces/ton/builders.ts":{"bytes":599,"imports":[{"path":"src/builders/action.ts","kind":"import-statement","original":"../../builders/action.js"},{"path":"src/namespaces/common/after.ts","kind":"import-statement","original":"../common/after.js"},{"path":"src/namespaces/common/and.ts","kind":"import-statement","original":"../common/and.js"},{"path":"src/namespaces/common/before.ts","kind":"import-statement","original":"../common/before.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/namespaces/ton/mod.ts":{"bytes":195,"imports":[{"path":"src/namespaces/ton/utils.ts","kind":"import-statement","original":"./utils.js"},{"path":"src/namespaces/ton/builders.ts","kind":"import-statement","original":"./builders.js"},{"path":"src/namespaces/ton/constants.ts","kind":"import-statement","original":"./constants.js"}],"format":"esm"}},"outputs":{"dist/mod.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":83105},"dist/mod.js":{"imports":[{"path":"zustand/vanilla","kind":"import-statement","external":true},{"path":"immer","kind":"import-statement","external":true},{"path":"immer","kind":"import-statement","external":true},{"path":"caip","kind":"import-statement","external":true}],"exports":["ActionBuilder","Hub","Namespace","NamespaceBuilder","Provider","ProviderBuilder","createStore","defineVersions","guessProviderStateSelector","namespaceStateSelector","pickVersion"],"entryPoint":"src/mod.ts","inputs":{"src/hub/helpers.ts":{"bytesInOutput":131},"src/hub/namespaces/errors.ts":{"bytesInOutput":332},"src/hub/namespaces/namespace.ts":{"bytesInOutput":2633},"src/hub/namespaces/mod.ts":{"bytesInOutput":0},"src/hub/mod.ts":{"bytesInOutput":0},"src/hub/provider/provider.ts":{"bytesInOutput":1784},"src/hub/provider/mod.ts":{"bytesInOutput":0},"src/hub/hub.ts":{"bytesInOutput":938},"src/hub/store/selectors.ts":{"bytesInOutput":386},"src/hub/store/mod.ts":{"bytesInOutput":0},"src/hub/store/store.ts":{"bytesInOutput":157},"src/hub/store/extend.ts":{"bytesInOutput":833},"src/hub/store/hub.ts":{"bytesInOutput":38},"src/hub/store/namespaces.ts":{"bytesInOutput":1403},"src/hub/store/events.ts":{"bytesInOutput":188},"src/hub/store/providers.ts":{"bytesInOutput":637},"src/mod.ts":{"bytesInOutput":0},"src/builders/namespace.ts":{"bytesInOutput":1397},"src/builders/mod.ts":{"bytesInOutput":0},"src/builders/provider.ts":{"bytesInOutput":465},"src/builders/action.ts":{"bytesInOutput":746},"src/utils/mod.ts":{"bytesInOutput":24},"src/utils/versions.ts":{"bytesInOutput":356}},"bytes":12782},"dist/utils/mod.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":3724},"dist/utils/mod.js":{"imports":[{"path":"caip","kind":"import-statement","external":true}],"exports":["CAIP","defineVersions","generateStoreId","legacyProviderImportsToVersionsInterface","pickVersion"],"entryPoint":"src/utils/mod.ts","inputs":{"src/utils/mod.ts":{"bytesInOutput":23},"src/hub/helpers.ts":{"bytesInOutput":58},"src/utils/versions.ts":{"bytesInOutput":456}},"bytes":771},"dist/legacy/mod.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":37393},"dist/legacy/mod.js":{"imports":[],"exports":["LegacyEvents","LegacyNetworks","LegacyWallet","Persistor","legacyEagerConnectHandler","legacyFormatAddressWithNetwork","legacyGetBlockChainNameFromId","legacyIsEvmNamespace","legacyReadAccountAddress"],"entryPoint":"src/legacy/mod.ts","inputs":{"src/legacy/types.ts":{"bytesInOutput":1585},"src/legacy/mod.ts":{"bytesInOutput":0},"src/legacy/persistor.ts":{"bytesInOutput":206},"src/legacy/helpers.ts":{"bytesInOutput":610},"src/legacy/utils.ts":{"bytesInOutput":238},"src/legacy/wallet.ts":{"bytesInOutput":6000}},"bytes":8988},"dist/hub/store/mod.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":25244},"dist/hub/store/mod.js":{"imports":[{"path":"zustand/vanilla","kind":"import-statement","external":true},{"path":"immer","kind":"import-statement","external":true},{"path":"immer","kind":"import-statement","external":true}],"exports":["createStore","guessProviderStateSelector","namespaceStateSelector"],"entryPoint":"src/hub/store/mod.ts","inputs":{"src/hub/store/selectors.ts":{"bytesInOutput":386},"src/hub/store/mod.ts":{"bytesInOutput":0},"src/hub/store/store.ts":{"bytesInOutput":157},"src/hub/store/extend.ts":{"bytesInOutput":833},"src/hub/store/hub.ts":{"bytesInOutput":38},"src/hub/store/namespaces.ts":{"bytesInOutput":1403},"src/hub/store/events.ts":{"bytesInOutput":188},"src/hub/store/providers.ts":{"bytesInOutput":637}},"bytes":3839},"dist/namespaces/evm/mod.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":46219},"dist/namespaces/evm/mod.js":{"imports":[{"path":"caip","kind":"import-statement","external":true},{"path":"rango-types","kind":"import-statement","external":true},{"path":"zustand/vanilla","kind":"import-statement","external":true},{"path":"immer","kind":"import-statement","external":true},{"path":"immer","kind":"import-statement","external":true},{"path":"caip","kind":"import-statement","external":true},{"path":"caip","kind":"import-statement","external":true}],"exports":["CAIP_ETHEREUM_CHAIN_ID","CAIP_NAMESPACE","actions","after","and","before","builders","hooks","utils"],"entryPoint":"src/namespaces/evm/mod.ts","inputs":{"src/namespaces/evm/actions.ts":{"bytesInOutput":1255},"src/namespaces/common/actions.ts":{"bytesInOutput":171},"src/namespaces/evm/utils.ts":{"bytesInOutput":1287},"src/namespaces/evm/constants.ts":{"bytesInOutput":21},"src/namespaces/evm/mod.ts":{"bytesInOutput":0},"src/namespaces/evm/hooks.ts":{"bytesInOutput":492},"src/namespaces/evm/after.ts":{"bytesInOutput":49},"src/namespaces/common/after.ts":{"bytesInOutput":103},"src/namespaces/evm/and.ts":{"bytesInOutput":58},"src/namespaces/common/mod.ts":{"bytesInOutput":0},"src/hub/namespaces/mod.ts":{"bytesInOutput":0},"src/hub/mod.ts":{"bytesInOutput":0},"src/hub/provider/mod.ts":{"bytesInOutput":0},"src/hub/store/mod.ts":{"bytesInOutput":0},"src/hub/store/store.ts":{"bytesInOutput":47},"src/hub/store/namespaces.ts":{"bytesInOutput":33},"src/hub/store/providers.ts":{"bytesInOutput":33},"src/mod.ts":{"bytesInOutput":0},"src/builders/mod.ts":{"bytesInOutput":0},"src/builders/action.ts":{"bytesInOutput":746},"src/utils/mod.ts":{"bytesInOutput":24},"src/namespaces/common/hooks/changeAccountSubscriber.ts":{"bytesInOutput":1023},"src/namespaces/common/helpers.ts":{"bytesInOutput":116},"src/namespaces/common/and.ts":{"bytesInOutput":300},"src/namespaces/common/before.ts":{"bytesInOutput":95},"src/namespaces/evm/before.ts":{"bytesInOutput":49},"src/namespaces/evm/builders.ts":{"bytesInOutput":711}},"bytes":6924},"dist/namespaces/solana/mod.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":36022},"dist/namespaces/solana/mod.js":{"imports":[{"path":"caip","kind":"import-statement","external":true},{"path":"zustand/vanilla","kind":"import-statement","external":true},{"path":"immer","kind":"import-statement","external":true},{"path":"immer","kind":"import-statement","external":true},{"path":"caip","kind":"import-statement","external":true},{"path":"caip","kind":"import-statement","external":true}],"exports":["CAIP_NAMESPACE","CAIP_SOLANA_CHAIN_ID","actions","after","and","before","builders","hooks","utils"],"entryPoint":"src/namespaces/solana/mod.ts","inputs":{"src/namespaces/solana/actions.ts":{"bytesInOutput":519},"src/namespaces/common/actions.ts":{"bytesInOutput":171},"src/namespaces/solana/utils.ts":{"bytesInOutput":367},"src/legacy/mod.ts":{"bytesInOutput":0},"src/namespaces/solana/constants.ts":{"bytesInOutput":52},"src/namespaces/solana/mod.ts":{"bytesInOutput":0},"src/namespaces/solana/hooks.ts":{"bytesInOutput":135},"src/namespaces/solana/after.ts":{"bytesInOutput":47},"src/namespaces/common/after.ts":{"bytesInOutput":103},"src/namespaces/solana/and.ts":{"bytesInOutput":58},"src/namespaces/common/mod.ts":{"bytesInOutput":0},"src/hub/namespaces/mod.ts":{"bytesInOutput":0},"src/hub/mod.ts":{"bytesInOutput":0},"src/hub/provider/mod.ts":{"bytesInOutput":0},"src/hub/store/mod.ts":{"bytesInOutput":0},"src/hub/store/store.ts":{"bytesInOutput":47},"src/hub/store/namespaces.ts":{"bytesInOutput":33},"src/hub/store/providers.ts":{"bytesInOutput":33},"src/mod.ts":{"bytesInOutput":0},"src/builders/mod.ts":{"bytesInOutput":0},"src/builders/action.ts":{"bytesInOutput":746},"src/utils/mod.ts":{"bytesInOutput":24},"src/namespaces/common/hooks/changeAccountSubscriber.ts":{"bytesInOutput":1023},"src/namespaces/common/helpers.ts":{"bytesInOutput":116},"src/namespaces/common/and.ts":{"bytesInOutput":250},"src/namespaces/common/before.ts":{"bytesInOutput":95},"src/namespaces/solana/before.ts":{"bytesInOutput":49},"src/namespaces/solana/builders.ts":{"bytesInOutput":403}},"bytes":4580},"dist/namespaces/cosmos/mod.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":22076},"dist/namespaces/cosmos/mod.js":{"imports":[{"path":"zustand/vanilla","kind":"import-statement","external":true},{"path":"immer","kind":"import-statement","external":true},{"path":"immer","kind":"import-statement","external":true},{"path":"caip","kind":"import-statement","external":true},{"path":"caip","kind":"import-statement","external":true},{"path":"caip","kind":"import-statement","external":true}],"exports":["CAIP_NAMESPACE","actions","after","and","before","builders","utils"],"entryPoint":"src/namespaces/cosmos/mod.ts","inputs":{"src/namespaces/cosmos/actions.ts":{"bytesInOutput":47},"src/namespaces/common/actions.ts":{"bytesInOutput":171},"src/namespaces/cosmos/mod.ts":{"bytesInOutput":0},"src/namespaces/cosmos/after.ts":{"bytesInOutput":47},"src/namespaces/common/after.ts":{"bytesInOutput":103},"src/namespaces/cosmos/and.ts":{"bytesInOutput":56},"src/namespaces/common/mod.ts":{"bytesInOutput":0},"src/hub/namespaces/mod.ts":{"bytesInOutput":0},"src/hub/mod.ts":{"bytesInOutput":0},"src/hub/provider/mod.ts":{"bytesInOutput":0},"src/hub/store/mod.ts":{"bytesInOutput":0},"src/hub/store/store.ts":{"bytesInOutput":47},"src/hub/store/namespaces.ts":{"bytesInOutput":33},"src/hub/store/providers.ts":{"bytesInOutput":33},"src/mod.ts":{"bytesInOutput":0},"src/builders/mod.ts":{"bytesInOutput":0},"src/builders/action.ts":{"bytesInOutput":746},"src/utils/mod.ts":{"bytesInOutput":24},"src/namespaces/common/helpers.ts":{"bytesInOutput":114},"src/namespaces/common/and.ts":{"bytesInOutput":550},"src/namespaces/common/before.ts":{"bytesInOutput":95},"src/namespaces/cosmos/before.ts":{"bytesInOutput":47},"src/namespaces/cosmos/utils.ts":{"bytesInOutput":222},"src/namespaces/cosmos/constants.ts":{"bytesInOutput":15},"src/namespaces/cosmos/builders.ts":{"bytesInOutput":96}},"bytes":2718},"dist/namespaces/utxo/mod.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":21826},"dist/namespaces/utxo/mod.js":{"imports":[{"path":"zustand/vanilla","kind":"import-statement","external":true},{"path":"immer","kind":"import-statement","external":true},{"path":"immer","kind":"import-statement","external":true},{"path":"caip","kind":"import-statement","external":true},{"path":"caip","kind":"import-statement","external":true},{"path":"caip","kind":"import-statement","external":true}],"exports":["CAIP_BITCOIN_CHAIN_ID","CAIP_NAMESPACE","CAIP_ZCASH_CHAIN_ID","actions","after","and","before","builders","utils"],"entryPoint":"src/namespaces/utxo/mod.ts","inputs":{"src/namespaces/utxo/actions.ts":{"bytesInOutput":47},"src/namespaces/common/actions.ts":{"bytesInOutput":171},"src/namespaces/utxo/mod.ts":{"bytesInOutput":0},"src/namespaces/utxo/after.ts":{"bytesInOutput":47},"src/namespaces/common/after.ts":{"bytesInOutput":103},"src/namespaces/utxo/and.ts":{"bytesInOutput":56},"src/namespaces/common/mod.ts":{"bytesInOutput":0},"src/hub/namespaces/mod.ts":{"bytesInOutput":0},"src/hub/mod.ts":{"bytesInOutput":0},"src/hub/provider/mod.ts":{"bytesInOutput":0},"src/hub/store/mod.ts":{"bytesInOutput":0},"src/hub/store/store.ts":{"bytesInOutput":47},"src/hub/store/namespaces.ts":{"bytesInOutput":33},"src/hub/store/providers.ts":{"bytesInOutput":33},"src/mod.ts":{"bytesInOutput":0},"src/builders/mod.ts":{"bytesInOutput":0},"src/builders/action.ts":{"bytesInOutput":746},"src/utils/mod.ts":{"bytesInOutput":24},"src/namespaces/common/helpers.ts":{"bytesInOutput":114},"src/namespaces/common/and.ts":{"bytesInOutput":250},"src/namespaces/common/before.ts":{"bytesInOutput":95},"src/namespaces/utxo/before.ts":{"bytesInOutput":47},"src/namespaces/utxo/builders.ts":{"bytesInOutput":96},"src/namespaces/utxo/utils.ts":{"bytesInOutput":204},"src/namespaces/utxo/constants.ts":{"bytesInOutput":62}},"bytes":2499},"dist/namespaces/sui/mod.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":35347},"dist/namespaces/sui/mod.js":{"imports":[{"path":"zustand/vanilla","kind":"import-statement","external":true},{"path":"immer","kind":"import-statement","external":true},{"path":"immer","kind":"import-statement","external":true},{"path":"caip","kind":"import-statement","external":true},{"path":"caip","kind":"import-statement","external":true},{"path":"@mysten/wallet-standard","kind":"import-statement","external":true},{"path":"caip","kind":"import-statement","external":true}],"exports":["CAIP_NAMESPACE","CAIP_SUI_CHAIN_ID","actions","builders","getInstance","getInstanceOrThrow","hooks"],"entryPoint":"src/namespaces/sui/mod.ts","inputs":{"src/namespaces/sui/actions.ts":{"bytesInOutput":213},"src/namespaces/sui/mod.ts":{"bytesInOutput":0},"src/namespaces/sui/builders.ts":{"bytesInOutput":681},"src/hub/namespaces/mod.ts":{"bytesInOutput":0},"src/hub/mod.ts":{"bytesInOutput":0},"src/hub/provider/mod.ts":{"bytesInOutput":0},"src/hub/store/mod.ts":{"bytesInOutput":0},"src/hub/store/store.ts":{"bytesInOutput":47},"src/hub/store/namespaces.ts":{"bytesInOutput":33},"src/hub/store/providers.ts":{"bytesInOutput":33},"src/mod.ts":{"bytesInOutput":0},"src/builders/mod.ts":{"bytesInOutput":0},"src/builders/action.ts":{"bytesInOutput":746},"src/utils/mod.ts":{"bytesInOutput":23},"src/namespaces/common/hooks/changeAccountSubscriber.ts":{"bytesInOutput":1023},"src/namespaces/common/mod.ts":{"bytesInOutput":0},"src/namespaces/common/after.ts":{"bytesInOutput":81},"src/namespaces/common/helpers.ts":{"bytesInOutput":114},"src/namespaces/common/and.ts":{"bytesInOutput":250},"src/namespaces/common/before.ts":{"bytesInOutput":73},"src/namespaces/sui/constants.ts":{"bytesInOutput":20},"src/namespaces/sui/utils.ts":{"bytesInOutput":499},"src/namespaces/sui/hooks.ts":{"bytesInOutput":147}},"bytes":4287},"dist/namespaces/tron/mod.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":22143},"dist/namespaces/tron/mod.js":{"imports":[{"path":"zustand/vanilla","kind":"import-statement","external":true},{"path":"immer","kind":"import-statement","external":true},{"path":"immer","kind":"import-statement","external":true},{"path":"caip","kind":"import-statement","external":true},{"path":"caip","kind":"import-statement","external":true},{"path":"caip","kind":"import-statement","external":true}],"exports":["CAIP_NAMESPACE","CAIP_TRON_CHAIN_ID","actions","after","and","before","builders","utils"],"entryPoint":"src/namespaces/tron/mod.ts","inputs":{"src/namespaces/tron/actions.ts":{"bytesInOutput":47},"src/namespaces/common/actions.ts":{"bytesInOutput":171},"src/namespaces/tron/mod.ts":{"bytesInOutput":0},"src/namespaces/tron/after.ts":{"bytesInOutput":47},"src/namespaces/common/after.ts":{"bytesInOutput":103},"src/namespaces/tron/and.ts":{"bytesInOutput":56},"src/namespaces/common/mod.ts":{"bytesInOutput":0},"src/hub/namespaces/mod.ts":{"bytesInOutput":0},"src/hub/mod.ts":{"bytesInOutput":0},"src/hub/provider/mod.ts":{"bytesInOutput":0},"src/hub/store/mod.ts":{"bytesInOutput":0},"src/hub/store/store.ts":{"bytesInOutput":47},"src/hub/store/namespaces.ts":{"bytesInOutput":33},"src/hub/store/providers.ts":{"bytesInOutput":33},"src/mod.ts":{"bytesInOutput":0},"src/builders/mod.ts":{"bytesInOutput":0},"src/builders/action.ts":{"bytesInOutput":746},"src/utils/mod.ts":{"bytesInOutput":24},"src/namespaces/common/helpers.ts":{"bytesInOutput":114},"src/namespaces/common/and.ts":{"bytesInOutput":250},"src/namespaces/common/before.ts":{"bytesInOutput":95},"src/namespaces/tron/before.ts":{"bytesInOutput":47},"src/namespaces/tron/builders.ts":{"bytesInOutput":170},"src/namespaces/tron/utils.ts":{"bytesInOutput":202},"src/namespaces/tron/constants.ts":{"bytesInOutput":22}},"bytes":2503},"dist/namespaces/starknet/mod.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":23582},"dist/namespaces/starknet/mod.js":{"imports":[{"path":"zustand/vanilla","kind":"import-statement","external":true},{"path":"immer","kind":"import-statement","external":true},{"path":"immer","kind":"import-statement","external":true},{"path":"caip","kind":"import-statement","external":true},{"path":"caip","kind":"import-statement","external":true},{"path":"caip","kind":"import-statement","external":true}],"exports":["CAIP_NAMESPACE","CAIP_STARKNET_CHAIN_ID","actions","after","and","before","builders","utils"],"entryPoint":"src/namespaces/starknet/mod.ts","inputs":{"src/namespaces/starknet/actions.ts":{"bytesInOutput":278},"src/namespaces/common/actions.ts":{"bytesInOutput":171},"src/namespaces/starknet/mod.ts":{"bytesInOutput":0},"src/namespaces/starknet/after.ts":{"bytesInOutput":47},"src/namespaces/common/after.ts":{"bytesInOutput":103},"src/namespaces/starknet/and.ts":{"bytesInOutput":56},"src/namespaces/common/mod.ts":{"bytesInOutput":0},"src/hub/namespaces/mod.ts":{"bytesInOutput":0},"src/hub/mod.ts":{"bytesInOutput":0},"src/hub/provider/mod.ts":{"bytesInOutput":0},"src/hub/store/mod.ts":{"bytesInOutput":0},"src/hub/store/store.ts":{"bytesInOutput":47},"src/hub/store/namespaces.ts":{"bytesInOutput":33},"src/hub/store/providers.ts":{"bytesInOutput":33},"src/mod.ts":{"bytesInOutput":0},"src/builders/mod.ts":{"bytesInOutput":0},"src/builders/action.ts":{"bytesInOutput":746},"src/utils/mod.ts":{"bytesInOutput":24},"src/namespaces/common/helpers.ts":{"bytesInOutput":114},"src/namespaces/common/and.ts":{"bytesInOutput":250},"src/namespaces/common/before.ts":{"bytesInOutput":95},"src/namespaces/starknet/before.ts":{"bytesInOutput":47},"src/namespaces/starknet/builders.ts":{"bytesInOutput":170},"src/namespaces/starknet/utils.ts":{"bytesInOutput":367},"src/legacy/mod.ts":{"bytesInOutput":0},"src/namespaces/starknet/constants.ts":{"bytesInOutput":29}},"bytes":2910},"dist/namespaces/xrpl/mod.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":19524},"dist/namespaces/xrpl/mod.js":{"imports":[{"path":"zustand/vanilla","kind":"import-statement","external":true},{"path":"immer","kind":"import-statement","external":true},{"path":"immer","kind":"import-statement","external":true},{"path":"caip","kind":"import-statement","external":true},{"path":"caip","kind":"import-statement","external":true},{"path":"caip","kind":"import-statement","external":true}],"exports":["CAIP_NAMESPACE","CAIP_XRPL_CHAIN_ID","builders","utils"],"entryPoint":"src/namespaces/xrpl/mod.ts","inputs":{"src/namespaces/xrpl/builders.ts":{"bytesInOutput":96},"src/hub/namespaces/mod.ts":{"bytesInOutput":0},"src/hub/mod.ts":{"bytesInOutput":0},"src/hub/provider/mod.ts":{"bytesInOutput":0},"src/hub/store/mod.ts":{"bytesInOutput":0},"src/hub/store/store.ts":{"bytesInOutput":47},"src/hub/store/namespaces.ts":{"bytesInOutput":33},"src/hub/store/providers.ts":{"bytesInOutput":33},"src/mod.ts":{"bytesInOutput":0},"src/builders/mod.ts":{"bytesInOutput":0},"src/builders/action.ts":{"bytesInOutput":746},"src/utils/mod.ts":{"bytesInOutput":24},"src/namespaces/common/mod.ts":{"bytesInOutput":0},"src/namespaces/common/after.ts":{"bytesInOutput":81},"src/namespaces/common/helpers.ts":{"bytesInOutput":114},"src/namespaces/common/and.ts":{"bytesInOutput":250},"src/namespaces/common/before.ts":{"bytesInOutput":73},"src/namespaces/xrpl/mod.ts":{"bytesInOutput":0},"src/namespaces/xrpl/utils.ts":{"bytesInOutput":179},"src/namespaces/xrpl/constants.ts":{"bytesInOutput":25}},"bytes":1952},"dist/namespaces/common/mod.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":31572},"dist/namespaces/common/mod.js":{"imports":[{"path":"zustand/vanilla","kind":"import-statement","external":true},{"path":"immer","kind":"import-statement","external":true},{"path":"immer","kind":"import-statement","external":true},{"path":"caip","kind":"import-statement","external":true},{"path":"caip","kind":"import-statement","external":true}],"exports":["ChangeAccountSubscriberBuilder","actions","afterRecommended","andRecommended","beforeRecommended","builders","connectAndUpdateStateForMultiNetworks","connectAndUpdateStateForSingleNetwork","intoConnecting","intoConnectionFinished","parseErrorAndThrowStandardizeError","standardizeAndThrowError"],"entryPoint":"src/namespaces/common/mod.ts","inputs":{"src/namespaces/common/actions.ts":{"bytesInOutput":222},"src/namespaces/common/mod.ts":{"bytesInOutput":0},"src/namespaces/common/builders.ts":{"bytesInOutput":89},"src/hub/namespaces/mod.ts":{"bytesInOutput":0},"src/hub/mod.ts":{"bytesInOutput":0},"src/hub/provider/mod.ts":{"bytesInOutput":0},"src/hub/store/mod.ts":{"bytesInOutput":0},"src/hub/store/store.ts":{"bytesInOutput":47},"src/hub/store/namespaces.ts":{"bytesInOutput":33},"src/hub/store/providers.ts":{"bytesInOutput":33},"src/mod.ts":{"bytesInOutput":0},"src/builders/mod.ts":{"bytesInOutput":0},"src/builders/action.ts":{"bytesInOutput":746},"src/utils/mod.ts":{"bytesInOutput":24},"src/namespaces/common/utils.ts":{"bytesInOutput":326},"src/namespaces/common/or.ts":{"bytesInOutput":53},"src/namespaces/common/after.ts":{"bytesInOutput":103},"src/namespaces/common/hooks/changeAccountSubscriber.ts":{"bytesInOutput":1023},"src/namespaces/common/helpers.ts":{"bytesInOutput":114},"src/namespaces/common/and.ts":{"bytesInOutput":559},"src/namespaces/common/before.ts":{"bytesInOutput":95}},"bytes":3981},"dist/namespaces/ton/mod.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":8992},"dist/namespaces/ton/mod.js":{"imports":[{"path":"caip","kind":"import-statement","external":true},{"path":"caip","kind":"import-statement","external":true}],"exports":["CAIP_NAMESPACE","CAIP_TON_CHAIN_ID","builders","utils"],"entryPoint":"src/namespaces/ton/mod.ts","inputs":{"src/namespaces/ton/utils.ts":{"bytesInOutput":202},"src/namespaces/ton/constants.ts":{"bytesInOutput":21},"src/namespaces/ton/mod.ts":{"bytesInOutput":0},"src/namespaces/ton/builders.ts":{"bytesInOutput":170},"src/builders/action.ts":{"bytesInOutput":746},"src/namespaces/common/after.ts":{"bytesInOutput":81},"src/namespaces/common/helpers.ts":{"bytesInOutput":114},"src/namespaces/common/and.ts":{"bytesInOutput":250},"src/namespaces/common/before.ts":{"bytesInOutput":73}},"bytes":1907}}}
1
+ {"inputs":{"src/hub/helpers.ts":{"bytes":371,"imports":[{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/hub/namespaces/errors.ts":{"bytes":455,"imports":[{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/hub/namespaces/namespace.ts":{"bytes":13059,"imports":[{"path":"src/hub/helpers.ts","kind":"import-statement","original":"../helpers.js"},{"path":"src/hub/namespaces/errors.ts","kind":"import-statement","original":"./errors.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/hub/namespaces/mod.ts":{"bytes":181,"imports":[{"path":"src/hub/namespaces/namespace.ts","kind":"import-statement","original":"./namespace.js"}],"format":"esm"},"src/hub/provider/provider.ts":{"bytes":9393,"imports":[{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/hub/provider/mod.ts":{"bytes":196,"imports":[{"path":"src/hub/provider/provider.ts","kind":"import-statement","original":"./provider.js"}],"format":"esm"},"src/hub/hub.ts":{"bytes":3762,"imports":[{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/hub/store/selectors.ts":{"bytes":2228,"imports":[{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/hub/store/extend.ts":{"bytes":3898,"imports":[{"path":"src/hub/store/selectors.ts","kind":"import-statement","original":"./selectors.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/hub/store/hub.ts":{"bytes":342,"imports":[{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/hub/store/events.ts":{"bytes":1956,"imports":[{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/hub/store/namespaces.ts":{"bytes":4883,"imports":[{"path":"immer","kind":"import-statement","external":true},{"path":"src/hub/store/events.ts","kind":"import-statement","original":"./events.js"},{"path":"src/hub/store/mod.ts","kind":"import-statement","original":"./mod.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/hub/store/providers.ts":{"bytes":4043,"imports":[{"path":"immer","kind":"import-statement","external":true},{"path":"src/hub/store/events.ts","kind":"import-statement","original":"./events.js"},{"path":"src/hub/store/mod.ts","kind":"import-statement","original":"./mod.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/hub/store/store.ts":{"bytes":808,"imports":[{"path":"zustand/vanilla","kind":"import-statement","external":true},{"path":"src/hub/store/extend.ts","kind":"import-statement","original":"./extend.js"},{"path":"src/hub/store/hub.ts","kind":"import-statement","original":"./hub.js"},{"path":"src/hub/store/namespaces.ts","kind":"import-statement","original":"./namespaces.js"},{"path":"src/hub/store/providers.ts","kind":"import-statement","original":"./providers.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/hub/store/mod.ts":{"bytes":652,"imports":[{"path":"src/hub/store/selectors.ts","kind":"import-statement","original":"./selectors.js"},{"path":"src/hub/store/store.ts","kind":"import-statement","original":"./store.js"}],"format":"esm"},"src/hub/mod.ts":{"bytes":522,"imports":[{"path":"src/hub/namespaces/mod.ts","kind":"import-statement","original":"./namespaces/mod.js"},{"path":"src/hub/provider/mod.ts","kind":"import-statement","original":"./provider/mod.js"},{"path":"src/hub/hub.ts","kind":"import-statement","original":"./hub.js"},{"path":"src/hub/store/mod.ts","kind":"import-statement","original":"./store/mod.js"},{"path":"src/hub/helpers.ts","kind":"import-statement","original":"./helpers.js"}],"format":"esm"},"src/builders/namespace.ts":{"bytes":7991,"imports":[{"path":"src/hub/mod.ts","kind":"import-statement","original":"../hub/mod.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/builders/provider.ts":{"bytes":1588,"imports":[{"path":"src/hub/provider/mod.ts","kind":"import-statement","original":"../hub/provider/mod.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/builders/action.ts":{"bytes":2385,"imports":[{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/builders/mod.ts":{"bytes":220,"imports":[{"path":"src/builders/namespace.ts","kind":"import-statement","original":"./namespace.js"},{"path":"src/builders/provider.ts","kind":"import-statement","original":"./provider.js"},{"path":"src/builders/action.ts","kind":"import-statement","original":"./action.js"}],"format":"esm"},"src/utils/versions.ts":{"bytes":1851,"imports":[{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/utils/mod.ts":{"bytes":356,"imports":[{"path":"caip","kind":"import-statement","external":true},{"path":"src/hub/helpers.ts","kind":"import-statement","original":"../hub/helpers.js"},{"path":"src/utils/versions.ts","kind":"import-statement","original":"./versions.js"}],"format":"esm"},"src/mod.ts":{"bytes":1504,"imports":[{"path":"src/hub/mod.ts","kind":"import-statement","original":"./hub/mod.js"},{"path":"src/builders/mod.ts","kind":"import-statement","original":"./builders/mod.js"},{"path":"src/utils/mod.ts","kind":"import-statement","original":"./utils/mod.js"}],"format":"esm"},"src/legacy/types.ts":{"bytes":7323,"imports":[],"format":"esm"},"src/legacy/persistor.ts":{"bytes":544,"imports":[{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/legacy/helpers.ts":{"bytes":1855,"imports":[{"path":"src/legacy/types.ts","kind":"import-statement","original":"./types.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/legacy/utils.ts":{"bytes":645,"imports":[{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/legacy/wallet.ts":{"bytes":16229,"imports":[{"path":"src/legacy/helpers.ts","kind":"import-statement","original":"./helpers.js"},{"path":"src/legacy/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/legacy/utils.ts","kind":"import-statement","original":"./utils.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/legacy/mod.ts":{"bytes":1518,"imports":[{"path":"src/legacy/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/legacy/persistor.ts","kind":"import-statement","original":"./persistor.js"},{"path":"src/legacy/helpers.ts","kind":"import-statement","original":"./helpers.js"},{"path":"src/legacy/wallet.ts","kind":"import-statement","original":"./wallet.js"},{"path":"src/legacy/utils.ts","kind":"import-statement","original":"./utils.js"}],"format":"esm"},"src/namespaces/common/actions.ts":{"bytes":380,"imports":[{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/namespaces/evm/constants.ts":{"bytes":83,"imports":[],"format":"esm"},"src/namespaces/evm/utils.ts":{"bytes":3494,"imports":[{"path":"caip","kind":"import-statement","external":true},{"path":"rango-types","kind":"import-statement","external":true},{"path":"src/namespaces/evm/constants.ts","kind":"import-statement","original":"./constants.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/namespaces/evm/actions.ts":{"bytes":4096,"imports":[{"path":"src/namespaces/common/actions.ts","kind":"import-statement","original":"../common/actions.js"},{"path":"src/namespaces/evm/utils.ts","kind":"import-statement","original":"./utils.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/namespaces/evm/hooks.ts":{"bytes":1217,"imports":[{"path":"src/namespaces/evm/mod.ts","kind":"import-statement","original":"./mod.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/namespaces/common/after.ts":{"bytes":271,"imports":[{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/namespaces/evm/after.ts":{"bytes":123,"imports":[{"path":"src/namespaces/common/after.ts","kind":"import-statement","original":"../common/after.js"}],"format":"esm"},"src/namespaces/common/builders.ts":{"bytes":545,"imports":[{"path":"src/mod.ts","kind":"import-statement","original":"../../mod.js"},{"path":"src/namespaces/common/actions.ts","kind":"import-statement","original":"./actions.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/namespaces/common/utils.ts":{"bytes":987,"imports":[{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/namespaces/common/or.ts":{"bytes":734,"imports":[{"path":"src/namespaces/common/utils.ts","kind":"import-statement","original":"./utils.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/namespaces/common/hooks/changeAccountSubscriber.ts":{"bytes":7467,"imports":[{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/namespaces/common/helpers.ts":{"bytes":189,"imports":[{"path":"caip","kind":"import-statement","external":true},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/namespaces/common/and.ts":{"bytes":1144,"imports":[{"path":"src/namespaces/common/helpers.ts","kind":"import-statement","original":"./helpers.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/namespaces/common/before.ts":{"bytes":351,"imports":[{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/namespaces/common/mod.ts":{"bytes":749,"imports":[{"path":"src/namespaces/common/actions.ts","kind":"import-statement","original":"./actions.js"},{"path":"src/namespaces/common/builders.ts","kind":"import-statement","original":"./builders.js"},{"path":"src/namespaces/common/or.ts","kind":"import-statement","original":"./or.js"},{"path":"src/namespaces/common/utils.ts","kind":"import-statement","original":"./utils.js"},{"path":"src/namespaces/common/after.ts","kind":"import-statement","original":"./after.js"},{"path":"src/namespaces/common/hooks/changeAccountSubscriber.ts","kind":"import-statement","original":"./hooks/changeAccountSubscriber.js"},{"path":"src/namespaces/common/and.ts","kind":"import-statement","original":"./and.js"},{"path":"src/namespaces/common/before.ts","kind":"import-statement","original":"./before.js"}],"format":"esm"},"src/namespaces/evm/and.ts":{"bytes":170,"imports":[{"path":"src/namespaces/common/mod.ts","kind":"import-statement","original":"../common/mod.js"}],"format":"esm"},"src/namespaces/evm/before.ts":{"bytes":106,"imports":[{"path":"src/namespaces/common/mod.ts","kind":"import-statement","original":"../common/mod.js"}],"format":"esm"},"src/namespaces/evm/builders.ts":{"bytes":1992,"imports":[{"path":"src/mod.ts","kind":"import-statement","original":"../../mod.js"},{"path":"src/namespaces/common/hooks/changeAccountSubscriber.ts","kind":"import-statement","original":"../common/hooks/changeAccountSubscriber.js"},{"path":"src/namespaces/common/mod.ts","kind":"import-statement","original":"../common/mod.js"},{"path":"src/namespaces/evm/utils.ts","kind":"import-statement","original":"./utils.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/namespaces/evm/mod.ts":{"bytes":416,"imports":[{"path":"src/namespaces/evm/actions.ts","kind":"import-statement","original":"./actions.js"},{"path":"src/namespaces/evm/hooks.ts","kind":"import-statement","original":"./hooks.js"},{"path":"src/namespaces/evm/after.ts","kind":"import-statement","original":"./after.js"},{"path":"src/namespaces/evm/and.ts","kind":"import-statement","original":"./and.js"},{"path":"src/namespaces/evm/before.ts","kind":"import-statement","original":"./before.js"},{"path":"src/namespaces/evm/utils.ts","kind":"import-statement","original":"./utils.js"},{"path":"src/namespaces/evm/builders.ts","kind":"import-statement","original":"./builders.js"},{"path":"src/namespaces/evm/constants.ts","kind":"import-statement","original":"./constants.js"}],"format":"esm"},"src/namespaces/solana/constants.ts":{"bytes":112,"imports":[],"format":"esm"},"src/namespaces/solana/utils.ts":{"bytes":1037,"imports":[{"path":"caip","kind":"import-statement","external":true},{"path":"src/legacy/mod.ts","kind":"import-statement","original":"../../legacy/mod.js"},{"path":"src/namespaces/solana/constants.ts","kind":"import-statement","original":"./constants.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/namespaces/solana/actions.ts":{"bytes":1262,"imports":[{"path":"src/namespaces/common/actions.ts","kind":"import-statement","original":"../common/actions.js"},{"path":"src/namespaces/solana/utils.ts","kind":"import-statement","original":"./utils.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/namespaces/solana/hooks.ts":{"bytes":369,"imports":[{"path":"src/namespaces/solana/mod.ts","kind":"import-statement","original":"./mod.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/namespaces/solana/after.ts":{"bytes":123,"imports":[{"path":"src/namespaces/common/after.ts","kind":"import-statement","original":"../common/after.js"}],"format":"esm"},"src/namespaces/solana/and.ts":{"bytes":170,"imports":[{"path":"src/namespaces/common/mod.ts","kind":"import-statement","original":"../common/mod.js"}],"format":"esm"},"src/namespaces/solana/before.ts":{"bytes":124,"imports":[{"path":"src/namespaces/common/before.ts","kind":"import-statement","original":"../common/before.js"}],"format":"esm"},"src/namespaces/solana/builders.ts":{"bytes":1433,"imports":[{"path":"src/mod.ts","kind":"import-statement","original":"../../mod.js"},{"path":"src/namespaces/common/hooks/changeAccountSubscriber.ts","kind":"import-statement","original":"../common/hooks/changeAccountSubscriber.js"},{"path":"src/namespaces/common/mod.ts","kind":"import-statement","original":"../common/mod.js"},{"path":"src/namespaces/solana/utils.ts","kind":"import-statement","original":"./utils.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/namespaces/solana/mod.ts":{"bytes":401,"imports":[{"path":"src/namespaces/solana/actions.ts","kind":"import-statement","original":"./actions.js"},{"path":"src/namespaces/solana/hooks.ts","kind":"import-statement","original":"./hooks.js"},{"path":"src/namespaces/solana/after.ts","kind":"import-statement","original":"./after.js"},{"path":"src/namespaces/solana/and.ts","kind":"import-statement","original":"./and.js"},{"path":"src/namespaces/solana/before.ts","kind":"import-statement","original":"./before.js"},{"path":"src/namespaces/solana/builders.ts","kind":"import-statement","original":"./builders.js"},{"path":"src/namespaces/solana/utils.ts","kind":"import-statement","original":"./utils.js"},{"path":"src/namespaces/solana/constants.ts","kind":"import-statement","original":"./constants.js"}],"format":"esm"},"src/namespaces/cosmos/actions.ts":{"bytes":125,"imports":[{"path":"src/namespaces/common/actions.ts","kind":"import-statement","original":"../common/actions.js"}],"format":"esm"},"src/namespaces/cosmos/after.ts":{"bytes":123,"imports":[{"path":"src/namespaces/common/after.ts","kind":"import-statement","original":"../common/after.js"}],"format":"esm"},"src/namespaces/cosmos/and.ts":{"bytes":170,"imports":[{"path":"src/namespaces/common/mod.ts","kind":"import-statement","original":"../common/mod.js"}],"format":"esm"},"src/namespaces/cosmos/before.ts":{"bytes":106,"imports":[{"path":"src/namespaces/common/mod.ts","kind":"import-statement","original":"../common/mod.js"}],"format":"esm"},"src/namespaces/cosmos/constants.ts":{"bytes":40,"imports":[],"format":"esm"},"src/namespaces/cosmos/utils.ts":{"bytes":595,"imports":[{"path":"caip","kind":"import-statement","external":true},{"path":"src/namespaces/cosmos/constants.ts","kind":"import-statement","original":"./constants.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/namespaces/cosmos/builders.ts":{"bytes":427,"imports":[{"path":"src/mod.ts","kind":"import-statement","original":"../../mod.js"},{"path":"src/namespaces/common/mod.ts","kind":"import-statement","original":"../common/mod.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/namespaces/cosmos/mod.ts":{"bytes":404,"imports":[{"path":"src/namespaces/cosmos/actions.ts","kind":"import-statement","original":"./actions.js"},{"path":"src/namespaces/cosmos/after.ts","kind":"import-statement","original":"./after.js"},{"path":"src/namespaces/cosmos/and.ts","kind":"import-statement","original":"./and.js"},{"path":"src/namespaces/cosmos/before.ts","kind":"import-statement","original":"./before.js"},{"path":"src/namespaces/cosmos/utils.ts","kind":"import-statement","original":"./utils.js"},{"path":"src/namespaces/cosmos/builders.ts","kind":"import-statement","original":"./builders.js"},{"path":"src/namespaces/cosmos/constants.ts","kind":"import-statement","original":"./constants.js"}],"format":"esm"},"src/namespaces/utxo/actions.ts":{"bytes":125,"imports":[{"path":"src/namespaces/common/actions.ts","kind":"import-statement","original":"../common/actions.js"}],"format":"esm"},"src/namespaces/utxo/after.ts":{"bytes":123,"imports":[{"path":"src/namespaces/common/after.ts","kind":"import-statement","original":"../common/after.js"}],"format":"esm"},"src/namespaces/utxo/and.ts":{"bytes":170,"imports":[{"path":"src/namespaces/common/mod.ts","kind":"import-statement","original":"../common/mod.js"}],"format":"esm"},"src/namespaces/utxo/before.ts":{"bytes":124,"imports":[{"path":"src/namespaces/common/before.ts","kind":"import-statement","original":"../common/before.js"}],"format":"esm"},"src/namespaces/utxo/builders.ts":{"bytes":480,"imports":[{"path":"src/mod.ts","kind":"import-statement","original":"../../mod.js"},{"path":"src/namespaces/common/after.ts","kind":"import-statement","original":"../common/after.js"},{"path":"src/namespaces/common/and.ts","kind":"import-statement","original":"../common/and.js"},{"path":"src/namespaces/common/before.ts","kind":"import-statement","original":"../common/before.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/namespaces/utxo/constants.ts":{"bytes":157,"imports":[],"format":"esm"},"src/namespaces/utxo/utils.ts":{"bytes":445,"imports":[{"path":"caip","kind":"import-statement","external":true},{"path":"src/namespaces/utxo/constants.ts","kind":"import-statement","original":"./constants.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/namespaces/utxo/mod.ts":{"bytes":390,"imports":[{"path":"src/namespaces/utxo/actions.ts","kind":"import-statement","original":"./actions.js"},{"path":"src/namespaces/utxo/after.ts","kind":"import-statement","original":"./after.js"},{"path":"src/namespaces/utxo/and.ts","kind":"import-statement","original":"./and.js"},{"path":"src/namespaces/utxo/before.ts","kind":"import-statement","original":"./before.js"},{"path":"src/namespaces/utxo/builders.ts","kind":"import-statement","original":"./builders.js"},{"path":"src/namespaces/utxo/utils.ts","kind":"import-statement","original":"./utils.js"},{"path":"src/namespaces/utxo/constants.ts","kind":"import-statement","original":"./constants.js"}],"format":"esm"},"src/namespaces/sui/actions.ts":{"bytes":652,"imports":[{"path":"src/namespaces/sui/mod.ts","kind":"import-statement","original":"./mod.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/namespaces/sui/constants.ts":{"bytes":275,"imports":[],"format":"esm"},"src/namespaces/sui/utils.ts":{"bytes":1527,"imports":[{"path":"@mysten/wallet-standard","kind":"import-statement","external":true},{"path":"caip","kind":"import-statement","external":true},{"path":"src/namespaces/sui/constants.ts","kind":"import-statement","original":"./constants.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/namespaces/sui/builders.ts":{"bytes":2414,"imports":[{"path":"src/mod.ts","kind":"import-statement","original":"../../mod.js"},{"path":"src/utils/mod.ts","kind":"import-statement","original":"../../utils/mod.js"},{"path":"src/namespaces/common/hooks/changeAccountSubscriber.ts","kind":"import-statement","original":"../common/hooks/changeAccountSubscriber.js"},{"path":"src/namespaces/common/mod.ts","kind":"import-statement","original":"../common/mod.js"},{"path":"src/namespaces/sui/constants.ts","kind":"import-statement","original":"./constants.js"},{"path":"src/namespaces/sui/utils.ts","kind":"import-statement","original":"./utils.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/namespaces/sui/hooks.ts":{"bytes":401,"imports":[{"path":"src/namespaces/sui/mod.ts","kind":"import-statement","original":"./mod.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/namespaces/sui/mod.ts":{"bytes":312,"imports":[{"path":"src/namespaces/sui/actions.ts","kind":"import-statement","original":"./actions.js"},{"path":"src/namespaces/sui/builders.ts","kind":"import-statement","original":"./builders.js"},{"path":"src/namespaces/sui/hooks.ts","kind":"import-statement","original":"./hooks.js"},{"path":"src/namespaces/sui/utils.ts","kind":"import-statement","original":"./utils.js"},{"path":"src/namespaces/sui/constants.ts","kind":"import-statement","original":"./constants.js"}],"format":"esm"},"src/namespaces/tron/actions.ts":{"bytes":125,"imports":[{"path":"src/namespaces/common/actions.ts","kind":"import-statement","original":"../common/actions.js"}],"format":"esm"},"src/namespaces/tron/after.ts":{"bytes":123,"imports":[{"path":"src/namespaces/common/after.ts","kind":"import-statement","original":"../common/after.js"}],"format":"esm"},"src/namespaces/tron/and.ts":{"bytes":170,"imports":[{"path":"src/namespaces/common/mod.ts","kind":"import-statement","original":"../common/mod.js"}],"format":"esm"},"src/namespaces/tron/before.ts":{"bytes":124,"imports":[{"path":"src/namespaces/common/before.ts","kind":"import-statement","original":"../common/before.js"}],"format":"esm"},"src/namespaces/tron/builders.ts":{"bytes":590,"imports":[{"path":"src/mod.ts","kind":"import-statement","original":"../../mod.js"},{"path":"src/namespaces/common/after.ts","kind":"import-statement","original":"../common/after.js"},{"path":"src/namespaces/common/and.ts","kind":"import-statement","original":"../common/and.js"},{"path":"src/namespaces/common/before.ts","kind":"import-statement","original":"../common/before.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/namespaces/tron/constants.ts":{"bytes":278,"imports":[],"format":"esm"},"src/namespaces/tron/utils.ts":{"bytes":459,"imports":[{"path":"caip","kind":"import-statement","external":true},{"path":"src/namespaces/tron/constants.ts","kind":"import-statement","original":"./constants.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/namespaces/tron/mod.ts":{"bytes":359,"imports":[{"path":"src/namespaces/tron/actions.ts","kind":"import-statement","original":"./actions.js"},{"path":"src/namespaces/tron/after.ts","kind":"import-statement","original":"./after.js"},{"path":"src/namespaces/tron/and.ts","kind":"import-statement","original":"./and.js"},{"path":"src/namespaces/tron/before.ts","kind":"import-statement","original":"./before.js"},{"path":"src/namespaces/tron/builders.ts","kind":"import-statement","original":"./builders.js"},{"path":"src/namespaces/tron/utils.ts","kind":"import-statement","original":"./utils.js"},{"path":"src/namespaces/tron/constants.ts","kind":"import-statement","original":"./constants.js"}],"format":"esm"},"src/namespaces/starknet/actions.ts":{"bytes":526,"imports":[{"path":"src/namespaces/common/actions.ts","kind":"import-statement","original":"../common/actions.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/namespaces/starknet/after.ts":{"bytes":123,"imports":[{"path":"src/namespaces/common/after.ts","kind":"import-statement","original":"../common/after.js"}],"format":"esm"},"src/namespaces/starknet/and.ts":{"bytes":170,"imports":[{"path":"src/namespaces/common/mod.ts","kind":"import-statement","original":"../common/mod.js"}],"format":"esm"},"src/namespaces/starknet/before.ts":{"bytes":124,"imports":[{"path":"src/namespaces/common/before.ts","kind":"import-statement","original":"../common/before.js"}],"format":"esm"},"src/namespaces/starknet/builders.ts":{"bytes":545,"imports":[{"path":"src/mod.ts","kind":"import-statement","original":"../../mod.js"},{"path":"src/namespaces/common/mod.ts","kind":"import-statement","original":"../common/mod.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/namespaces/starknet/constants.ts":{"bytes":293,"imports":[],"format":"esm"},"src/namespaces/starknet/utils.ts":{"bytes":957,"imports":[{"path":"caip","kind":"import-statement","external":true},{"path":"src/legacy/mod.ts","kind":"import-statement","original":"../../legacy/mod.js"},{"path":"src/namespaces/starknet/constants.ts","kind":"import-statement","original":"./constants.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/namespaces/starknet/mod.ts":{"bytes":368,"imports":[{"path":"src/namespaces/starknet/actions.ts","kind":"import-statement","original":"./actions.js"},{"path":"src/namespaces/starknet/after.ts","kind":"import-statement","original":"./after.js"},{"path":"src/namespaces/starknet/and.ts","kind":"import-statement","original":"./and.js"},{"path":"src/namespaces/starknet/before.ts","kind":"import-statement","original":"./before.js"},{"path":"src/namespaces/starknet/builders.ts","kind":"import-statement","original":"./builders.js"},{"path":"src/namespaces/starknet/utils.ts","kind":"import-statement","original":"./utils.js"},{"path":"src/namespaces/starknet/constants.ts","kind":"import-statement","original":"./constants.js"}],"format":"esm"},"src/namespaces/stellar/constants.ts":{"bytes":322,"imports":[],"format":"esm"},"src/namespaces/stellar/builders.ts":{"bytes":812,"imports":[{"path":"@stellar/stellar-sdk","kind":"import-statement","external":true},{"path":"src/mod.ts","kind":"import-statement","original":"../../mod.js"},{"path":"src/namespaces/common/mod.ts","kind":"import-statement","original":"../common/mod.js"},{"path":"src/namespaces/stellar/constants.ts","kind":"import-statement","original":"./constants.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/namespaces/stellar/utils.ts":{"bytes":384,"imports":[{"path":"caip","kind":"import-statement","external":true},{"path":"src/namespaces/stellar/constants.ts","kind":"import-statement","original":"./constants.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/namespaces/stellar/mod.ts":{"bytes":203,"imports":[{"path":"src/namespaces/stellar/builders.ts","kind":"import-statement","original":"./builders.js"},{"path":"src/namespaces/stellar/utils.ts","kind":"import-statement","original":"./utils.js"},{"path":"src/namespaces/stellar/constants.ts","kind":"import-statement","original":"./constants.js"}],"format":"esm"},"src/namespaces/xrpl/builders.ts":{"bytes":412,"imports":[{"path":"src/mod.ts","kind":"import-statement","original":"../../mod.js"},{"path":"src/namespaces/common/mod.ts","kind":"import-statement","original":"../common/mod.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/namespaces/xrpl/constants.ts":{"bytes":254,"imports":[],"format":"esm"},"src/namespaces/xrpl/utils.ts":{"bytes":378,"imports":[{"path":"caip","kind":"import-statement","external":true},{"path":"src/namespaces/xrpl/constants.ts","kind":"import-statement","original":"./constants.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/namespaces/xrpl/mod.ts":{"bytes":197,"imports":[{"path":"src/namespaces/xrpl/builders.ts","kind":"import-statement","original":"./builders.js"},{"path":"src/namespaces/xrpl/utils.ts","kind":"import-statement","original":"./utils.js"},{"path":"src/namespaces/xrpl/constants.ts","kind":"import-statement","original":"./constants.js"}],"format":"esm"},"src/namespaces/ton/constants.ts":{"bytes":78,"imports":[],"format":"esm"},"src/namespaces/ton/utils.ts":{"bytes":464,"imports":[{"path":"caip","kind":"import-statement","external":true},{"path":"src/namespaces/ton/constants.ts","kind":"import-statement","original":"./constants.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/namespaces/ton/builders.ts":{"bytes":599,"imports":[{"path":"src/builders/action.ts","kind":"import-statement","original":"../../builders/action.js"},{"path":"src/namespaces/common/after.ts","kind":"import-statement","original":"../common/after.js"},{"path":"src/namespaces/common/and.ts","kind":"import-statement","original":"../common/and.js"},{"path":"src/namespaces/common/before.ts","kind":"import-statement","original":"../common/before.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/namespaces/ton/mod.ts":{"bytes":195,"imports":[{"path":"src/namespaces/ton/utils.ts","kind":"import-statement","original":"./utils.js"},{"path":"src/namespaces/ton/builders.ts","kind":"import-statement","original":"./builders.js"},{"path":"src/namespaces/ton/constants.ts","kind":"import-statement","original":"./constants.js"}],"format":"esm"}},"outputs":{"dist/mod.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":83105},"dist/mod.js":{"imports":[{"path":"zustand/vanilla","kind":"import-statement","external":true},{"path":"immer","kind":"import-statement","external":true},{"path":"immer","kind":"import-statement","external":true},{"path":"caip","kind":"import-statement","external":true}],"exports":["ActionBuilder","Hub","Namespace","NamespaceBuilder","Provider","ProviderBuilder","createStore","defineVersions","guessProviderStateSelector","namespaceStateSelector","pickVersion"],"entryPoint":"src/mod.ts","inputs":{"src/hub/helpers.ts":{"bytesInOutput":131},"src/hub/namespaces/errors.ts":{"bytesInOutput":332},"src/hub/namespaces/namespace.ts":{"bytesInOutput":2633},"src/hub/namespaces/mod.ts":{"bytesInOutput":0},"src/hub/mod.ts":{"bytesInOutput":0},"src/hub/provider/provider.ts":{"bytesInOutput":1784},"src/hub/provider/mod.ts":{"bytesInOutput":0},"src/hub/hub.ts":{"bytesInOutput":938},"src/hub/store/selectors.ts":{"bytesInOutput":386},"src/hub/store/mod.ts":{"bytesInOutput":0},"src/hub/store/store.ts":{"bytesInOutput":157},"src/hub/store/extend.ts":{"bytesInOutput":833},"src/hub/store/hub.ts":{"bytesInOutput":38},"src/hub/store/namespaces.ts":{"bytesInOutput":1403},"src/hub/store/events.ts":{"bytesInOutput":188},"src/hub/store/providers.ts":{"bytesInOutput":637},"src/mod.ts":{"bytesInOutput":0},"src/builders/namespace.ts":{"bytesInOutput":1397},"src/builders/mod.ts":{"bytesInOutput":0},"src/builders/provider.ts":{"bytesInOutput":465},"src/builders/action.ts":{"bytesInOutput":746},"src/utils/mod.ts":{"bytesInOutput":24},"src/utils/versions.ts":{"bytesInOutput":356}},"bytes":12782},"dist/utils/mod.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":3724},"dist/utils/mod.js":{"imports":[{"path":"caip","kind":"import-statement","external":true}],"exports":["CAIP","defineVersions","generateStoreId","legacyProviderImportsToVersionsInterface","pickVersion"],"entryPoint":"src/utils/mod.ts","inputs":{"src/utils/mod.ts":{"bytesInOutput":23},"src/hub/helpers.ts":{"bytesInOutput":58},"src/utils/versions.ts":{"bytesInOutput":456}},"bytes":771},"dist/legacy/mod.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":37433},"dist/legacy/mod.js":{"imports":[],"exports":["LegacyEvents","LegacyNetworks","LegacyWallet","Persistor","legacyEagerConnectHandler","legacyFormatAddressWithNetwork","legacyGetBlockChainNameFromId","legacyIsEvmNamespace","legacyReadAccountAddress"],"entryPoint":"src/legacy/mod.ts","inputs":{"src/legacy/types.ts":{"bytesInOutput":1605},"src/legacy/mod.ts":{"bytesInOutput":0},"src/legacy/persistor.ts":{"bytesInOutput":206},"src/legacy/helpers.ts":{"bytesInOutput":610},"src/legacy/utils.ts":{"bytesInOutput":238},"src/legacy/wallet.ts":{"bytesInOutput":6000}},"bytes":9008},"dist/hub/store/mod.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":25244},"dist/hub/store/mod.js":{"imports":[{"path":"zustand/vanilla","kind":"import-statement","external":true},{"path":"immer","kind":"import-statement","external":true},{"path":"immer","kind":"import-statement","external":true}],"exports":["createStore","guessProviderStateSelector","namespaceStateSelector"],"entryPoint":"src/hub/store/mod.ts","inputs":{"src/hub/store/selectors.ts":{"bytesInOutput":386},"src/hub/store/mod.ts":{"bytesInOutput":0},"src/hub/store/store.ts":{"bytesInOutput":157},"src/hub/store/extend.ts":{"bytesInOutput":833},"src/hub/store/hub.ts":{"bytesInOutput":38},"src/hub/store/namespaces.ts":{"bytesInOutput":1403},"src/hub/store/events.ts":{"bytesInOutput":188},"src/hub/store/providers.ts":{"bytesInOutput":637}},"bytes":3839},"dist/namespaces/evm/mod.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":46219},"dist/namespaces/evm/mod.js":{"imports":[{"path":"caip","kind":"import-statement","external":true},{"path":"rango-types","kind":"import-statement","external":true},{"path":"zustand/vanilla","kind":"import-statement","external":true},{"path":"immer","kind":"import-statement","external":true},{"path":"immer","kind":"import-statement","external":true},{"path":"caip","kind":"import-statement","external":true},{"path":"caip","kind":"import-statement","external":true}],"exports":["CAIP_ETHEREUM_CHAIN_ID","CAIP_NAMESPACE","actions","after","and","before","builders","hooks","utils"],"entryPoint":"src/namespaces/evm/mod.ts","inputs":{"src/namespaces/evm/actions.ts":{"bytesInOutput":1255},"src/namespaces/common/actions.ts":{"bytesInOutput":171},"src/namespaces/evm/utils.ts":{"bytesInOutput":1287},"src/namespaces/evm/constants.ts":{"bytesInOutput":21},"src/namespaces/evm/mod.ts":{"bytesInOutput":0},"src/namespaces/evm/hooks.ts":{"bytesInOutput":492},"src/namespaces/evm/after.ts":{"bytesInOutput":49},"src/namespaces/common/after.ts":{"bytesInOutput":103},"src/namespaces/evm/and.ts":{"bytesInOutput":58},"src/namespaces/common/mod.ts":{"bytesInOutput":0},"src/hub/namespaces/mod.ts":{"bytesInOutput":0},"src/hub/mod.ts":{"bytesInOutput":0},"src/hub/provider/mod.ts":{"bytesInOutput":0},"src/hub/store/mod.ts":{"bytesInOutput":0},"src/hub/store/store.ts":{"bytesInOutput":47},"src/hub/store/namespaces.ts":{"bytesInOutput":33},"src/hub/store/providers.ts":{"bytesInOutput":33},"src/mod.ts":{"bytesInOutput":0},"src/builders/mod.ts":{"bytesInOutput":0},"src/builders/action.ts":{"bytesInOutput":746},"src/utils/mod.ts":{"bytesInOutput":24},"src/namespaces/common/hooks/changeAccountSubscriber.ts":{"bytesInOutput":1023},"src/namespaces/common/helpers.ts":{"bytesInOutput":116},"src/namespaces/common/and.ts":{"bytesInOutput":300},"src/namespaces/common/before.ts":{"bytesInOutput":95},"src/namespaces/evm/before.ts":{"bytesInOutput":49},"src/namespaces/evm/builders.ts":{"bytesInOutput":711}},"bytes":6924},"dist/namespaces/solana/mod.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":36022},"dist/namespaces/solana/mod.js":{"imports":[{"path":"caip","kind":"import-statement","external":true},{"path":"zustand/vanilla","kind":"import-statement","external":true},{"path":"immer","kind":"import-statement","external":true},{"path":"immer","kind":"import-statement","external":true},{"path":"caip","kind":"import-statement","external":true},{"path":"caip","kind":"import-statement","external":true}],"exports":["CAIP_NAMESPACE","CAIP_SOLANA_CHAIN_ID","actions","after","and","before","builders","hooks","utils"],"entryPoint":"src/namespaces/solana/mod.ts","inputs":{"src/namespaces/solana/actions.ts":{"bytesInOutput":519},"src/namespaces/common/actions.ts":{"bytesInOutput":171},"src/namespaces/solana/utils.ts":{"bytesInOutput":367},"src/legacy/mod.ts":{"bytesInOutput":0},"src/namespaces/solana/constants.ts":{"bytesInOutput":52},"src/namespaces/solana/mod.ts":{"bytesInOutput":0},"src/namespaces/solana/hooks.ts":{"bytesInOutput":135},"src/namespaces/solana/after.ts":{"bytesInOutput":47},"src/namespaces/common/after.ts":{"bytesInOutput":103},"src/namespaces/solana/and.ts":{"bytesInOutput":58},"src/namespaces/common/mod.ts":{"bytesInOutput":0},"src/hub/namespaces/mod.ts":{"bytesInOutput":0},"src/hub/mod.ts":{"bytesInOutput":0},"src/hub/provider/mod.ts":{"bytesInOutput":0},"src/hub/store/mod.ts":{"bytesInOutput":0},"src/hub/store/store.ts":{"bytesInOutput":47},"src/hub/store/namespaces.ts":{"bytesInOutput":33},"src/hub/store/providers.ts":{"bytesInOutput":33},"src/mod.ts":{"bytesInOutput":0},"src/builders/mod.ts":{"bytesInOutput":0},"src/builders/action.ts":{"bytesInOutput":746},"src/utils/mod.ts":{"bytesInOutput":24},"src/namespaces/common/hooks/changeAccountSubscriber.ts":{"bytesInOutput":1023},"src/namespaces/common/helpers.ts":{"bytesInOutput":116},"src/namespaces/common/and.ts":{"bytesInOutput":250},"src/namespaces/common/before.ts":{"bytesInOutput":95},"src/namespaces/solana/before.ts":{"bytesInOutput":49},"src/namespaces/solana/builders.ts":{"bytesInOutput":403}},"bytes":4580},"dist/namespaces/cosmos/mod.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":22076},"dist/namespaces/cosmos/mod.js":{"imports":[{"path":"zustand/vanilla","kind":"import-statement","external":true},{"path":"immer","kind":"import-statement","external":true},{"path":"immer","kind":"import-statement","external":true},{"path":"caip","kind":"import-statement","external":true},{"path":"caip","kind":"import-statement","external":true},{"path":"caip","kind":"import-statement","external":true}],"exports":["CAIP_NAMESPACE","actions","after","and","before","builders","utils"],"entryPoint":"src/namespaces/cosmos/mod.ts","inputs":{"src/namespaces/cosmos/actions.ts":{"bytesInOutput":47},"src/namespaces/common/actions.ts":{"bytesInOutput":171},"src/namespaces/cosmos/mod.ts":{"bytesInOutput":0},"src/namespaces/cosmos/after.ts":{"bytesInOutput":47},"src/namespaces/common/after.ts":{"bytesInOutput":103},"src/namespaces/cosmos/and.ts":{"bytesInOutput":56},"src/namespaces/common/mod.ts":{"bytesInOutput":0},"src/hub/namespaces/mod.ts":{"bytesInOutput":0},"src/hub/mod.ts":{"bytesInOutput":0},"src/hub/provider/mod.ts":{"bytesInOutput":0},"src/hub/store/mod.ts":{"bytesInOutput":0},"src/hub/store/store.ts":{"bytesInOutput":47},"src/hub/store/namespaces.ts":{"bytesInOutput":33},"src/hub/store/providers.ts":{"bytesInOutput":33},"src/mod.ts":{"bytesInOutput":0},"src/builders/mod.ts":{"bytesInOutput":0},"src/builders/action.ts":{"bytesInOutput":746},"src/utils/mod.ts":{"bytesInOutput":24},"src/namespaces/common/helpers.ts":{"bytesInOutput":114},"src/namespaces/common/and.ts":{"bytesInOutput":550},"src/namespaces/common/before.ts":{"bytesInOutput":95},"src/namespaces/cosmos/before.ts":{"bytesInOutput":47},"src/namespaces/cosmos/utils.ts":{"bytesInOutput":222},"src/namespaces/cosmos/constants.ts":{"bytesInOutput":15},"src/namespaces/cosmos/builders.ts":{"bytesInOutput":96}},"bytes":2718},"dist/namespaces/utxo/mod.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":21826},"dist/namespaces/utxo/mod.js":{"imports":[{"path":"zustand/vanilla","kind":"import-statement","external":true},{"path":"immer","kind":"import-statement","external":true},{"path":"immer","kind":"import-statement","external":true},{"path":"caip","kind":"import-statement","external":true},{"path":"caip","kind":"import-statement","external":true},{"path":"caip","kind":"import-statement","external":true}],"exports":["CAIP_BITCOIN_CHAIN_ID","CAIP_NAMESPACE","CAIP_ZCASH_CHAIN_ID","actions","after","and","before","builders","utils"],"entryPoint":"src/namespaces/utxo/mod.ts","inputs":{"src/namespaces/utxo/actions.ts":{"bytesInOutput":47},"src/namespaces/common/actions.ts":{"bytesInOutput":171},"src/namespaces/utxo/mod.ts":{"bytesInOutput":0},"src/namespaces/utxo/after.ts":{"bytesInOutput":47},"src/namespaces/common/after.ts":{"bytesInOutput":103},"src/namespaces/utxo/and.ts":{"bytesInOutput":56},"src/namespaces/common/mod.ts":{"bytesInOutput":0},"src/hub/namespaces/mod.ts":{"bytesInOutput":0},"src/hub/mod.ts":{"bytesInOutput":0},"src/hub/provider/mod.ts":{"bytesInOutput":0},"src/hub/store/mod.ts":{"bytesInOutput":0},"src/hub/store/store.ts":{"bytesInOutput":47},"src/hub/store/namespaces.ts":{"bytesInOutput":33},"src/hub/store/providers.ts":{"bytesInOutput":33},"src/mod.ts":{"bytesInOutput":0},"src/builders/mod.ts":{"bytesInOutput":0},"src/builders/action.ts":{"bytesInOutput":746},"src/utils/mod.ts":{"bytesInOutput":24},"src/namespaces/common/helpers.ts":{"bytesInOutput":114},"src/namespaces/common/and.ts":{"bytesInOutput":250},"src/namespaces/common/before.ts":{"bytesInOutput":95},"src/namespaces/utxo/before.ts":{"bytesInOutput":47},"src/namespaces/utxo/builders.ts":{"bytesInOutput":96},"src/namespaces/utxo/utils.ts":{"bytesInOutput":204},"src/namespaces/utxo/constants.ts":{"bytesInOutput":62}},"bytes":2499},"dist/namespaces/sui/mod.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":35347},"dist/namespaces/sui/mod.js":{"imports":[{"path":"zustand/vanilla","kind":"import-statement","external":true},{"path":"immer","kind":"import-statement","external":true},{"path":"immer","kind":"import-statement","external":true},{"path":"caip","kind":"import-statement","external":true},{"path":"caip","kind":"import-statement","external":true},{"path":"@mysten/wallet-standard","kind":"import-statement","external":true},{"path":"caip","kind":"import-statement","external":true}],"exports":["CAIP_NAMESPACE","CAIP_SUI_CHAIN_ID","actions","builders","getInstance","getInstanceOrThrow","hooks"],"entryPoint":"src/namespaces/sui/mod.ts","inputs":{"src/namespaces/sui/actions.ts":{"bytesInOutput":213},"src/namespaces/sui/mod.ts":{"bytesInOutput":0},"src/namespaces/sui/builders.ts":{"bytesInOutput":681},"src/hub/namespaces/mod.ts":{"bytesInOutput":0},"src/hub/mod.ts":{"bytesInOutput":0},"src/hub/provider/mod.ts":{"bytesInOutput":0},"src/hub/store/mod.ts":{"bytesInOutput":0},"src/hub/store/store.ts":{"bytesInOutput":47},"src/hub/store/namespaces.ts":{"bytesInOutput":33},"src/hub/store/providers.ts":{"bytesInOutput":33},"src/mod.ts":{"bytesInOutput":0},"src/builders/mod.ts":{"bytesInOutput":0},"src/builders/action.ts":{"bytesInOutput":746},"src/utils/mod.ts":{"bytesInOutput":23},"src/namespaces/common/hooks/changeAccountSubscriber.ts":{"bytesInOutput":1023},"src/namespaces/common/mod.ts":{"bytesInOutput":0},"src/namespaces/common/after.ts":{"bytesInOutput":81},"src/namespaces/common/helpers.ts":{"bytesInOutput":114},"src/namespaces/common/and.ts":{"bytesInOutput":250},"src/namespaces/common/before.ts":{"bytesInOutput":73},"src/namespaces/sui/constants.ts":{"bytesInOutput":20},"src/namespaces/sui/utils.ts":{"bytesInOutput":499},"src/namespaces/sui/hooks.ts":{"bytesInOutput":147}},"bytes":4287},"dist/namespaces/tron/mod.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":22143},"dist/namespaces/tron/mod.js":{"imports":[{"path":"zustand/vanilla","kind":"import-statement","external":true},{"path":"immer","kind":"import-statement","external":true},{"path":"immer","kind":"import-statement","external":true},{"path":"caip","kind":"import-statement","external":true},{"path":"caip","kind":"import-statement","external":true},{"path":"caip","kind":"import-statement","external":true}],"exports":["CAIP_NAMESPACE","CAIP_TRON_CHAIN_ID","actions","after","and","before","builders","utils"],"entryPoint":"src/namespaces/tron/mod.ts","inputs":{"src/namespaces/tron/actions.ts":{"bytesInOutput":47},"src/namespaces/common/actions.ts":{"bytesInOutput":171},"src/namespaces/tron/mod.ts":{"bytesInOutput":0},"src/namespaces/tron/after.ts":{"bytesInOutput":47},"src/namespaces/common/after.ts":{"bytesInOutput":103},"src/namespaces/tron/and.ts":{"bytesInOutput":56},"src/namespaces/common/mod.ts":{"bytesInOutput":0},"src/hub/namespaces/mod.ts":{"bytesInOutput":0},"src/hub/mod.ts":{"bytesInOutput":0},"src/hub/provider/mod.ts":{"bytesInOutput":0},"src/hub/store/mod.ts":{"bytesInOutput":0},"src/hub/store/store.ts":{"bytesInOutput":47},"src/hub/store/namespaces.ts":{"bytesInOutput":33},"src/hub/store/providers.ts":{"bytesInOutput":33},"src/mod.ts":{"bytesInOutput":0},"src/builders/mod.ts":{"bytesInOutput":0},"src/builders/action.ts":{"bytesInOutput":746},"src/utils/mod.ts":{"bytesInOutput":24},"src/namespaces/common/helpers.ts":{"bytesInOutput":114},"src/namespaces/common/and.ts":{"bytesInOutput":250},"src/namespaces/common/before.ts":{"bytesInOutput":95},"src/namespaces/tron/before.ts":{"bytesInOutput":47},"src/namespaces/tron/builders.ts":{"bytesInOutput":170},"src/namespaces/tron/utils.ts":{"bytesInOutput":202},"src/namespaces/tron/constants.ts":{"bytesInOutput":22}},"bytes":2503},"dist/namespaces/starknet/mod.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":23582},"dist/namespaces/starknet/mod.js":{"imports":[{"path":"zustand/vanilla","kind":"import-statement","external":true},{"path":"immer","kind":"import-statement","external":true},{"path":"immer","kind":"import-statement","external":true},{"path":"caip","kind":"import-statement","external":true},{"path":"caip","kind":"import-statement","external":true},{"path":"caip","kind":"import-statement","external":true}],"exports":["CAIP_NAMESPACE","CAIP_STARKNET_CHAIN_ID","actions","after","and","before","builders","utils"],"entryPoint":"src/namespaces/starknet/mod.ts","inputs":{"src/namespaces/starknet/actions.ts":{"bytesInOutput":278},"src/namespaces/common/actions.ts":{"bytesInOutput":171},"src/namespaces/starknet/mod.ts":{"bytesInOutput":0},"src/namespaces/starknet/after.ts":{"bytesInOutput":47},"src/namespaces/common/after.ts":{"bytesInOutput":103},"src/namespaces/starknet/and.ts":{"bytesInOutput":56},"src/namespaces/common/mod.ts":{"bytesInOutput":0},"src/hub/namespaces/mod.ts":{"bytesInOutput":0},"src/hub/mod.ts":{"bytesInOutput":0},"src/hub/provider/mod.ts":{"bytesInOutput":0},"src/hub/store/mod.ts":{"bytesInOutput":0},"src/hub/store/store.ts":{"bytesInOutput":47},"src/hub/store/namespaces.ts":{"bytesInOutput":33},"src/hub/store/providers.ts":{"bytesInOutput":33},"src/mod.ts":{"bytesInOutput":0},"src/builders/mod.ts":{"bytesInOutput":0},"src/builders/action.ts":{"bytesInOutput":746},"src/utils/mod.ts":{"bytesInOutput":24},"src/namespaces/common/helpers.ts":{"bytesInOutput":114},"src/namespaces/common/and.ts":{"bytesInOutput":250},"src/namespaces/common/before.ts":{"bytesInOutput":95},"src/namespaces/starknet/before.ts":{"bytesInOutput":47},"src/namespaces/starknet/builders.ts":{"bytesInOutput":170},"src/namespaces/starknet/utils.ts":{"bytesInOutput":367},"src/legacy/mod.ts":{"bytesInOutput":0},"src/namespaces/starknet/constants.ts":{"bytesInOutput":29}},"bytes":2910},"dist/namespaces/stellar/mod.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":20295},"dist/namespaces/stellar/mod.js":{"imports":[{"path":"@stellar/stellar-sdk","kind":"import-statement","external":true},{"path":"zustand/vanilla","kind":"import-statement","external":true},{"path":"immer","kind":"import-statement","external":true},{"path":"immer","kind":"import-statement","external":true},{"path":"caip","kind":"import-statement","external":true},{"path":"caip","kind":"import-statement","external":true},{"path":"caip","kind":"import-statement","external":true}],"exports":["CAIP_NAMESPACE","CAIP_STELLAR_CHAIN_ID","builders","utils"],"entryPoint":"src/namespaces/stellar/mod.ts","inputs":{"src/namespaces/stellar/builders.ts":{"bytesInOutput":269},"src/hub/namespaces/mod.ts":{"bytesInOutput":0},"src/hub/mod.ts":{"bytesInOutput":0},"src/hub/provider/mod.ts":{"bytesInOutput":0},"src/hub/store/mod.ts":{"bytesInOutput":0},"src/hub/store/store.ts":{"bytesInOutput":47},"src/hub/store/namespaces.ts":{"bytesInOutput":33},"src/hub/store/providers.ts":{"bytesInOutput":33},"src/mod.ts":{"bytesInOutput":0},"src/builders/mod.ts":{"bytesInOutput":0},"src/builders/action.ts":{"bytesInOutput":746},"src/utils/mod.ts":{"bytesInOutput":24},"src/namespaces/common/mod.ts":{"bytesInOutput":0},"src/namespaces/common/after.ts":{"bytesInOutput":81},"src/namespaces/common/helpers.ts":{"bytesInOutput":114},"src/namespaces/common/and.ts":{"bytesInOutput":250},"src/namespaces/common/before.ts":{"bytesInOutput":73},"src/namespaces/stellar/constants.ts":{"bytesInOutput":60},"src/namespaces/stellar/mod.ts":{"bytesInOutput":0},"src/namespaces/stellar/utils.ts":{"bytesInOutput":179}},"bytes":2163},"dist/namespaces/xrpl/mod.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":19524},"dist/namespaces/xrpl/mod.js":{"imports":[{"path":"zustand/vanilla","kind":"import-statement","external":true},{"path":"immer","kind":"import-statement","external":true},{"path":"immer","kind":"import-statement","external":true},{"path":"caip","kind":"import-statement","external":true},{"path":"caip","kind":"import-statement","external":true},{"path":"caip","kind":"import-statement","external":true}],"exports":["CAIP_NAMESPACE","CAIP_XRPL_CHAIN_ID","builders","utils"],"entryPoint":"src/namespaces/xrpl/mod.ts","inputs":{"src/namespaces/xrpl/builders.ts":{"bytesInOutput":96},"src/hub/namespaces/mod.ts":{"bytesInOutput":0},"src/hub/mod.ts":{"bytesInOutput":0},"src/hub/provider/mod.ts":{"bytesInOutput":0},"src/hub/store/mod.ts":{"bytesInOutput":0},"src/hub/store/store.ts":{"bytesInOutput":47},"src/hub/store/namespaces.ts":{"bytesInOutput":33},"src/hub/store/providers.ts":{"bytesInOutput":33},"src/mod.ts":{"bytesInOutput":0},"src/builders/mod.ts":{"bytesInOutput":0},"src/builders/action.ts":{"bytesInOutput":746},"src/utils/mod.ts":{"bytesInOutput":24},"src/namespaces/common/mod.ts":{"bytesInOutput":0},"src/namespaces/common/after.ts":{"bytesInOutput":81},"src/namespaces/common/helpers.ts":{"bytesInOutput":114},"src/namespaces/common/and.ts":{"bytesInOutput":250},"src/namespaces/common/before.ts":{"bytesInOutput":73},"src/namespaces/xrpl/mod.ts":{"bytesInOutput":0},"src/namespaces/xrpl/utils.ts":{"bytesInOutput":179},"src/namespaces/xrpl/constants.ts":{"bytesInOutput":25}},"bytes":1952},"dist/namespaces/common/mod.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":31572},"dist/namespaces/common/mod.js":{"imports":[{"path":"zustand/vanilla","kind":"import-statement","external":true},{"path":"immer","kind":"import-statement","external":true},{"path":"immer","kind":"import-statement","external":true},{"path":"caip","kind":"import-statement","external":true},{"path":"caip","kind":"import-statement","external":true}],"exports":["ChangeAccountSubscriberBuilder","actions","afterRecommended","andRecommended","beforeRecommended","builders","connectAndUpdateStateForMultiNetworks","connectAndUpdateStateForSingleNetwork","intoConnecting","intoConnectionFinished","parseErrorAndThrowStandardizeError","standardizeAndThrowError"],"entryPoint":"src/namespaces/common/mod.ts","inputs":{"src/namespaces/common/actions.ts":{"bytesInOutput":222},"src/namespaces/common/mod.ts":{"bytesInOutput":0},"src/namespaces/common/builders.ts":{"bytesInOutput":89},"src/hub/namespaces/mod.ts":{"bytesInOutput":0},"src/hub/mod.ts":{"bytesInOutput":0},"src/hub/provider/mod.ts":{"bytesInOutput":0},"src/hub/store/mod.ts":{"bytesInOutput":0},"src/hub/store/store.ts":{"bytesInOutput":47},"src/hub/store/namespaces.ts":{"bytesInOutput":33},"src/hub/store/providers.ts":{"bytesInOutput":33},"src/mod.ts":{"bytesInOutput":0},"src/builders/mod.ts":{"bytesInOutput":0},"src/builders/action.ts":{"bytesInOutput":746},"src/utils/mod.ts":{"bytesInOutput":24},"src/namespaces/common/utils.ts":{"bytesInOutput":326},"src/namespaces/common/or.ts":{"bytesInOutput":53},"src/namespaces/common/after.ts":{"bytesInOutput":103},"src/namespaces/common/hooks/changeAccountSubscriber.ts":{"bytesInOutput":1023},"src/namespaces/common/helpers.ts":{"bytesInOutput":114},"src/namespaces/common/and.ts":{"bytesInOutput":559},"src/namespaces/common/before.ts":{"bytesInOutput":95}},"bytes":3981},"dist/namespaces/ton/mod.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":8992},"dist/namespaces/ton/mod.js":{"imports":[{"path":"caip","kind":"import-statement","external":true},{"path":"caip","kind":"import-statement","external":true}],"exports":["CAIP_NAMESPACE","CAIP_TON_CHAIN_ID","builders","utils"],"entryPoint":"src/namespaces/ton/mod.ts","inputs":{"src/namespaces/ton/utils.ts":{"bytesInOutput":202},"src/namespaces/ton/constants.ts":{"bytesInOutput":21},"src/namespaces/ton/mod.ts":{"bytesInOutput":0},"src/namespaces/ton/builders.ts":{"bytesInOutput":170},"src/builders/action.ts":{"bytesInOutput":746},"src/namespaces/common/after.ts":{"bytesInOutput":81},"src/namespaces/common/helpers.ts":{"bytesInOutput":114},"src/namespaces/common/and.ts":{"bytesInOutput":250},"src/namespaces/common/before.ts":{"bytesInOutput":73}},"bytes":1907}}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rango-dev/wallets-core",
3
- "version": "0.58.2-next.1",
3
+ "version": "0.58.2-next.2",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "source": "./src/mod.ts",
@@ -43,6 +43,10 @@
43
43
  "types": "./dist/namespaces/starknet/mod.d.ts",
44
44
  "default": "./dist/namespaces/starknet/mod.js"
45
45
  },
46
+ "./namespaces/stellar": {
47
+ "types": "./dist/namespaces/stellar/mod.d.ts",
48
+ "default": "./dist/namespaces/stellar/mod.js"
49
+ },
46
50
  "./namespaces/sui": {
47
51
  "types": "./dist/namespaces/sui/mod.d.ts",
48
52
  "default": "./dist/namespaces/sui/mod.js"
@@ -70,7 +74,7 @@
70
74
  "legacy"
71
75
  ],
72
76
  "scripts": {
73
- "build": "node ../../scripts/build/command.mjs --path wallets/core --inputs src/mod.ts,src/utils/mod.ts,src/legacy/mod.ts,src/hub/store/mod.ts,src/namespaces/evm/mod.ts,src/namespaces/solana/mod.ts,src/namespaces/cosmos/mod.ts,src/namespaces/utxo/mod.ts,src/namespaces/sui/mod.ts,src/namespaces/tron/mod.ts,src/namespaces/starknet/mod.ts,src/namespaces/xrpl/mod.ts,src/namespaces/common/mod.ts,src/namespaces/ton/mod.ts",
77
+ "build": "node ../../scripts/build/command.mjs --path wallets/core --inputs src/mod.ts,src/utils/mod.ts,src/legacy/mod.ts,src/hub/store/mod.ts,src/namespaces/evm/mod.ts,src/namespaces/solana/mod.ts,src/namespaces/cosmos/mod.ts,src/namespaces/utxo/mod.ts,src/namespaces/sui/mod.ts,src/namespaces/tron/mod.ts,src/namespaces/starknet/mod.ts,src/namespaces/stellar/mod.ts,src/namespaces/xrpl/mod.ts,src/namespaces/common/mod.ts,src/namespaces/ton/mod.ts",
74
78
  "ts-check": "tsc --declaration --emitDeclarationOnly -p ./tsconfig.json",
75
79
  "clean": "rimraf dist",
76
80
  "format": "prettier --write '{.,src}/**/*.{ts,tsx}'",
@@ -87,12 +91,14 @@
87
91
  },
88
92
  "dependencies": {
89
93
  "@chain-registry/types": "2.0.110",
94
+ "@stellar/stellar-sdk": "^15.0.1",
90
95
  "caip": "^1.1.1",
91
96
  "immer": "^10.0.4",
92
97
  "rango-types": "^0.4.0",
93
98
  "zustand": "^4.5.2"
94
99
  },
95
100
  "devDependencies": {
101
+ "@types/urijs": "^1.19.26",
96
102
  "xrpl": "^4.2.0"
97
103
  },
98
104
  "publishConfig": {
@@ -5,6 +5,7 @@ import type { CosmosActions } from '../../namespaces/cosmos/mod.js';
5
5
  import type { EvmActions } from '../../namespaces/evm/mod.js';
6
6
  import type { SolanaActions } from '../../namespaces/solana/mod.js';
7
7
  import type { StarknetActions } from '../../namespaces/starknet/types.js';
8
+ import type { StellarActions } from '../../namespaces/stellar/types.js';
8
9
  import type { SuiActions } from '../../namespaces/sui/mod.js';
9
10
  import type { TonActions } from '../../namespaces/ton/types.js';
10
11
  import type { TronActions } from '../../namespaces/tron/types.js';
@@ -40,6 +41,7 @@ export interface CommonNamespaces {
40
41
  starknet: StarknetActions;
41
42
  xrpl: XRPLActions;
42
43
  ton: TonActions;
44
+ stellar: StellarActions;
43
45
  }
44
46
 
45
47
  export type CommonNamespaceKeys = Prettify<keyof CommonNamespaces>;
@@ -69,6 +69,7 @@ export enum Networks {
69
69
  KONSTELLATION = 'KONSTELLATION',
70
70
  UMEE = 'UMEE',
71
71
  STARKNET = 'STARKNET',
72
+ STELLAR = 'STELLAR',
72
73
  TON = 'TON',
73
74
  BASE = 'BASE',
74
75
  SUI = 'SUI',
@@ -0,0 +1,27 @@
1
+ import type { StellarActions } from './types.js';
2
+
3
+ import * as StellarSdk from '@stellar/stellar-sdk';
4
+
5
+ import { ActionBuilder } from '../../mod.js';
6
+ import {
7
+ connectAndUpdateStateForSingleNetwork,
8
+ intoConnecting,
9
+ intoConnectionFinished,
10
+ } from '../common/mod.js';
11
+
12
+ import { HORIZON_URL } from './constants.js';
13
+
14
+ export const connect = () =>
15
+ new ActionBuilder<StellarActions, 'connect'>('connect')
16
+ .and(connectAndUpdateStateForSingleNetwork)
17
+ .before(intoConnecting)
18
+ .after(intoConnectionFinished);
19
+
20
+ export const balanceLines = new ActionBuilder<StellarActions, 'balanceLines'>(
21
+ 'balanceLines'
22
+ ).action(async function (_, accountId: string) {
23
+ const server = new StellarSdk.Horizon.Server(HORIZON_URL);
24
+ const account = await server.loadAccount(accountId);
25
+
26
+ return account.balances;
27
+ });
@@ -0,0 +1,9 @@
1
+ /*
2
+ * @see https://namespaces.chainagnostic.org/stellar/README
3
+ */
4
+
5
+ // if the value neeeds to be change make sure you will update mapCaipNamespaceToLegacyNetworkName as well
6
+ export const CAIP_NAMESPACE = 'stellar';
7
+ export const CAIP_STELLAR_CHAIN_ID = 'mainnet';
8
+
9
+ export const HORIZON_URL = 'https://horizon.stellar.org';
@@ -0,0 +1,5 @@
1
+ export * as builders from './builders.js';
2
+ export * as utils from './utils.js';
3
+ export type { StellarActions } from './types.js';
4
+
5
+ export { CAIP_STELLAR_CHAIN_ID, CAIP_NAMESPACE } from './constants.js';
@@ -0,0 +1,15 @@
1
+ import type { Accounts } from '../common/mod.js';
2
+ import type {
3
+ AutoImplementedActionsByRecommended,
4
+ CommonActions,
5
+ } from '../common/types.js';
6
+ import type { Horizon } from '@stellar/stellar-sdk';
7
+
8
+ type BalanceLines = Horizon.AccountResponse['balances'];
9
+ export interface StellarActions
10
+ extends AutoImplementedActionsByRecommended,
11
+ CommonActions {
12
+ connect: () => Promise<Accounts>;
13
+ canEagerConnect: () => Promise<boolean>;
14
+ balanceLines: (account: string) => Promise<BalanceLines>;
15
+ }
@@ -0,0 +1,15 @@
1
+ import type { CaipAccount } from '../common/mod.js';
2
+
3
+ import { AccountId } from 'caip';
4
+
5
+ import { CAIP_NAMESPACE, CAIP_STELLAR_CHAIN_ID } from './constants.js';
6
+
7
+ export function formatAddressToCAIP(address: string): string {
8
+ return AccountId.format({
9
+ address,
10
+ chainId: {
11
+ namespace: CAIP_NAMESPACE,
12
+ reference: CAIP_STELLAR_CHAIN_ID,
13
+ },
14
+ }) as CaipAccount;
15
+ }