@dynamic-labs/eclipse 4.4.0 → 4.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,4 +1,16 @@
1
1
 
2
+ ### [4.4.1](https://github.com/dynamic-labs/dynamic-auth/compare/v4.4.0...v4.4.1) (2025-01-27)
3
+
4
+
5
+ ### Features
6
+
7
+ * allow override of rpc urls in connectionConfig for Solana and Eclipse ([#7884](https://github.com/dynamic-labs/dynamic-auth/issues/7884)) ([b65cea0](https://github.com/dynamic-labs/dynamic-auth/commit/b65cea0f7f5240c0e021843266c1437feffa51c5))
8
+
9
+
10
+ ### Bug Fixes
11
+
12
+ * close banxa modal when clicking outside of modal ([#7890](https://github.com/dynamic-labs/dynamic-auth/issues/7890)) ([cc5b5a5](https://github.com/dynamic-labs/dynamic-auth/commit/cc5b5a5911615925065411472f7874aeafff0a25))
13
+
2
14
  ## [4.4.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.3.2...v4.4.0) (2025-01-24)
3
15
 
4
16
 
package/package.cjs CHANGED
@@ -3,6 +3,6 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
- var version = "4.4.0";
6
+ var version = "4.4.1";
7
7
 
8
8
  exports.version = version;
package/package.js CHANGED
@@ -1,4 +1,4 @@
1
1
  'use client'
2
- var version = "4.4.0";
2
+ var version = "4.4.1";
3
3
 
4
4
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/eclipse",
3
- "version": "4.4.0",
3
+ "version": "4.4.1",
4
4
  "description": "A React SDK for implementing wallet web3 authentication and authorization to your website.",
5
5
  "author": "Dynamic Labs, Inc.",
6
6
  "license": "MIT",
@@ -20,15 +20,15 @@
20
20
  "dependencies": {
21
21
  "@solana/web3.js": "1.92.1",
22
22
  "@wallet-standard/base": "1.0.1",
23
- "@dynamic-labs/assert-package-version": "4.4.0",
24
- "@dynamic-labs/rpc-providers": "4.4.0",
23
+ "@dynamic-labs/assert-package-version": "4.4.1",
24
+ "@dynamic-labs/rpc-providers": "4.4.1",
25
25
  "@dynamic-labs/sdk-api-core": "0.0.599",
26
- "@dynamic-labs/solana": "4.4.0",
27
- "@dynamic-labs/solana-core": "4.4.0",
28
- "@dynamic-labs/types": "4.4.0",
29
- "@dynamic-labs/utils": "4.4.0",
30
- "@dynamic-labs/wallet-book": "4.4.0",
31
- "@dynamic-labs/wallet-connector-core": "4.4.0"
26
+ "@dynamic-labs/solana": "4.4.1",
27
+ "@dynamic-labs/solana-core": "4.4.1",
28
+ "@dynamic-labs/types": "4.4.1",
29
+ "@dynamic-labs/utils": "4.4.1",
30
+ "@dynamic-labs/wallet-book": "4.4.1",
31
+ "@dynamic-labs/wallet-connector-core": "4.4.1"
32
32
  },
33
33
  "peerDependencies": {}
34
34
  }
@@ -1,6 +1,6 @@
1
- import { ConnectionConfig } from '@solana/web3.js';
2
1
  import { WalletConnectorConstructor } from '@dynamic-labs/wallet-connector-core';
2
+ import { SolanaConnectionConfig } from '@dynamic-labs/solana-core';
3
3
  /**
4
4
  * Allows passing in Solana connection configuration to all wallet connectors.
5
5
  */
6
- export declare const EclipseWalletConnectorsWithConfig: (connectionConfig: ConnectionConfig) => () => WalletConnectorConstructor[];
6
+ export declare const EclipseWalletConnectorsWithConfig: (connectionConfig: SolanaConnectionConfig) => () => WalletConnectorConstructor[];
@@ -35,13 +35,13 @@ class InjectedWalletBase extends solana.SolanaInjectedConnector {
35
35
  });
36
36
  }
37
37
  getWalletClient() {
38
- var _a, _b;
38
+ var _a;
39
39
  const [network] = this.eclipseNetworks;
40
40
  if (!network) {
41
41
  throw new utils.DynamicError('No enabled networks');
42
42
  }
43
- const rpcUrl = ((_a = network.privateCustomerRpcUrls) === null || _a === void 0 ? void 0 : _a[0]) || network.rpcUrls[0];
44
- return new web3_js.Connection(rpcUrl, (_b = this.connectionConfig) !== null && _b !== void 0 ? _b : 'confirmed');
43
+ const rpcUrl = solanaCore.getOverrideRpcUrlForNetwork(this.connectionConfig, network);
44
+ return new web3_js.Connection(rpcUrl, (_a = this.connectionConfig) !== null && _a !== void 0 ? _a : 'confirmed');
45
45
  }
46
46
  // the genesis hashes on Eclipse are different than Solana
47
47
  getNetwork() {
@@ -2,7 +2,7 @@
2
2
  import { __awaiter } from '../../../../_virtual/_tslib.js';
3
3
  import { Connection } from '@solana/web3.js';
4
4
  import { SolanaInjectedConnector } from '@dynamic-labs/solana';
5
- import { getGenesisHashLSKey } from '@dynamic-labs/solana-core';
5
+ import { getOverrideRpcUrlForNetwork, getGenesisHashLSKey } from '@dynamic-labs/solana-core';
6
6
  import { DynamicError } from '@dynamic-labs/utils';
7
7
  import { eclipseMainnetHash, eclipseTestnetHash } from '../../constants.js';
8
8
 
@@ -31,13 +31,13 @@ class InjectedWalletBase extends SolanaInjectedConnector {
31
31
  });
32
32
  }
33
33
  getWalletClient() {
34
- var _a, _b;
34
+ var _a;
35
35
  const [network] = this.eclipseNetworks;
36
36
  if (!network) {
37
37
  throw new DynamicError('No enabled networks');
38
38
  }
39
- const rpcUrl = ((_a = network.privateCustomerRpcUrls) === null || _a === void 0 ? void 0 : _a[0]) || network.rpcUrls[0];
40
- return new Connection(rpcUrl, (_b = this.connectionConfig) !== null && _b !== void 0 ? _b : 'confirmed');
39
+ const rpcUrl = getOverrideRpcUrlForNetwork(this.connectionConfig, network);
40
+ return new Connection(rpcUrl, (_a = this.connectionConfig) !== null && _a !== void 0 ? _a : 'confirmed');
41
41
  }
42
42
  // the genesis hashes on Eclipse are different than Solana
43
43
  getNetwork() {
package/src/index.cjs CHANGED
@@ -8,6 +8,7 @@ var _package = require('../package.cjs');
8
8
  require('@dynamic-labs/wallet-connector-core');
9
9
  var EclipseWallet = require('./wallet/EclipseWallet.cjs');
10
10
  var isEclipseWallet = require('./wallet/isEclipseWallet/isEclipseWallet.cjs');
11
+ var isLedgerEclipseWallet = require('./wallet/isLedgerEclipseWallet/isLedgerEclipseWallet.cjs');
11
12
  var EclipseWalletConnectors = require('./connectors/EclipseWalletConnectors.cjs');
12
13
  var EclipseWalletConnectorsWithConfig = require('./connectors/EclipseWalletConnectorsWithConfig/EclipseWalletConnectorsWithConfig.cjs');
13
14
  require('./rpc/RpcProviderEclipse/RpcProviderEclipse.cjs');
@@ -18,6 +19,7 @@ assertPackageVersion.assertPackageVersion('@dynamic-labs/eclipse', _package.vers
18
19
 
19
20
  exports.EclipseWallet = EclipseWallet.EclipseWallet;
20
21
  exports.isEclipseWallet = isEclipseWallet.isEclipseWallet;
22
+ exports.isLedgerEclipseWallet = isLedgerEclipseWallet.isLedgerEclipseWallet;
21
23
  exports.EclipseWalletConnectors = EclipseWalletConnectors.EclipseWalletConnectors;
22
24
  exports.EclipseWalletConnectorsWithConfig = EclipseWalletConnectorsWithConfig.EclipseWalletConnectorsWithConfig;
23
25
  Object.defineProperty(exports, 'ChainRpcProviders', {
package/src/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  export { EclipseWalletConnectors, EclipseWalletConnectorsWithConfig, } from './connectors';
2
2
  export { ChainRpcProviders, ChainRpcProvidersClass, eclipseProvidersSelector, ProviderChain, type EclipseRpcProvider, type EclipseRpcProviderMethods, type IChainRpcProviders, type RegisteredProviderMethod, type RegisteredProviderMethods, type RpcProviderLookup, type RpcProviders, type RpcProvidersSelector, type SolanaRpcProvider, } from './rpc';
3
- export { EclipseWallet, isEclipseWallet } from './wallet';
3
+ export { EclipseWallet, isEclipseWallet, isLedgerEclipseWallet, } from './wallet';
package/src/index.js CHANGED
@@ -4,6 +4,7 @@ import { version } from '../package.js';
4
4
  import '@dynamic-labs/wallet-connector-core';
5
5
  export { EclipseWallet } from './wallet/EclipseWallet.js';
6
6
  export { isEclipseWallet } from './wallet/isEclipseWallet/isEclipseWallet.js';
7
+ export { isLedgerEclipseWallet } from './wallet/isLedgerEclipseWallet/isLedgerEclipseWallet.js';
7
8
  export { EclipseWalletConnectors } from './connectors/EclipseWalletConnectors.js';
8
9
  export { EclipseWalletConnectorsWithConfig } from './connectors/EclipseWalletConnectorsWithConfig/EclipseWalletConnectorsWithConfig.js';
9
10
  import './rpc/RpcProviderEclipse/RpcProviderEclipse.js';
@@ -3,6 +3,7 @@
3
3
 
4
4
  var web3_js = require('@solana/web3.js');
5
5
  var rpcProviders = require('@dynamic-labs/rpc-providers');
6
+ var solanaCore = require('@dynamic-labs/solana-core');
6
7
 
7
8
  rpcProviders.ChainRpcProviders.getEclipseProviderByChainId = (rpcProviders, chainId) => {
8
9
  var _a;
@@ -14,8 +15,7 @@ rpcProviders.ChainRpcProviders.registerEclipseProviders = (connectionConfig) =>
14
15
  const rpcProviders = {};
15
16
  if (config === null || config === void 0 ? void 0 : config.eclipse) {
16
17
  rpcProviders.eclipse = config.eclipse.map((network) => {
17
- var _a;
18
- const rpcUrl = ((_a = network.privateCustomerRpcUrls) === null || _a === void 0 ? void 0 : _a[0]) || network.rpcUrls[0];
18
+ const rpcUrl = solanaCore.getOverrideRpcUrlForNetwork(connectionConfig, network);
19
19
  const provider = new web3_js.Connection(rpcUrl, connectionConfig);
20
20
  return {
21
21
  chainId: network.chainId.toString(),
@@ -1,6 +1,7 @@
1
1
  'use client'
2
2
  import { Connection } from '@solana/web3.js';
3
3
  import { ChainRpcProviders, ProviderChain } from '@dynamic-labs/rpc-providers';
4
+ import { getOverrideRpcUrlForNetwork } from '@dynamic-labs/solana-core';
4
5
 
5
6
  ChainRpcProviders.getEclipseProviderByChainId = (rpcProviders, chainId) => {
6
7
  var _a;
@@ -12,8 +13,7 @@ ChainRpcProviders.registerEclipseProviders = (connectionConfig) => {
12
13
  const rpcProviders = {};
13
14
  if (config === null || config === void 0 ? void 0 : config.eclipse) {
14
15
  rpcProviders.eclipse = config.eclipse.map((network) => {
15
- var _a;
16
- const rpcUrl = ((_a = network.privateCustomerRpcUrls) === null || _a === void 0 ? void 0 : _a[0]) || network.rpcUrls[0];
16
+ const rpcUrl = getOverrideRpcUrlForNetwork(connectionConfig, network);
17
17
  const provider = new Connection(rpcUrl, connectionConfig);
18
18
  return {
19
19
  chainId: network.chainId.toString(),
@@ -1,2 +1,3 @@
1
1
  export * from './EclipseWallet';
2
2
  export * from './isEclipseWallet';
3
+ export * from './isLedgerEclipseWallet';
@@ -0,0 +1 @@
1
+ export { isLedgerEclipseWallet } from './isLedgerEclipseWallet';
@@ -0,0 +1,16 @@
1
+ 'use client'
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
7
+ var isEclipseWallet = require('../isEclipseWallet/isEclipseWallet.cjs');
8
+
9
+ /**
10
+ * Checks if wallet is a Eclipse wallet and it was marked as a Ledger wallet
11
+ */
12
+ const isLedgerEclipseWallet = (wallet) => isEclipseWallet.isEclipseWallet(wallet) &&
13
+ walletConnectorCore.isHardwareWalletConnector(wallet.connector) &&
14
+ wallet.connector.isHardwareWalletEnabled;
15
+
16
+ exports.isLedgerEclipseWallet = isLedgerEclipseWallet;
@@ -0,0 +1,5 @@
1
+ import { Wallet } from '@dynamic-labs/wallet-connector-core';
2
+ /**
3
+ * Checks if wallet is a Eclipse wallet and it was marked as a Ledger wallet
4
+ */
5
+ export declare const isLedgerEclipseWallet: (wallet: Wallet) => boolean;
@@ -0,0 +1,12 @@
1
+ 'use client'
2
+ import { isHardwareWalletConnector } from '@dynamic-labs/wallet-connector-core';
3
+ import { isEclipseWallet } from '../isEclipseWallet/isEclipseWallet.js';
4
+
5
+ /**
6
+ * Checks if wallet is a Eclipse wallet and it was marked as a Ledger wallet
7
+ */
8
+ const isLedgerEclipseWallet = (wallet) => isEclipseWallet(wallet) &&
9
+ isHardwareWalletConnector(wallet.connector) &&
10
+ wallet.connector.isHardwareWalletEnabled;
11
+
12
+ export { isLedgerEclipseWallet };