@dynamic-labs/solana-core 3.4.6 → 3.5.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,23 @@
1
1
 
2
+ ### [3.5.1](https://github.com/dynamic-labs/DynamicAuth/compare/v3.5.0...v3.5.1) (2024-11-05)
3
+
4
+
5
+ ### Features
6
+
7
+ * allow passing connection config to solana wallet connectors ([#7364](https://github.com/dynamic-labs/DynamicAuth/issues/7364)) ([5dd5176](https://github.com/dynamic-labs/DynamicAuth/commit/5dd5176e6f91d9771ce1d1af031ab1adb25f5b74))
8
+
9
+ ## [3.5.0](https://github.com/dynamic-labs/DynamicAuth/compare/v3.4.6...v3.5.0) (2024-11-05)
10
+
11
+
12
+ ### Features
13
+
14
+ * add support for line social ([61b23fd](https://github.com/dynamic-labs/dynamic-auth/commit/61b23fde9f4b0bc56c1cdc2f7456784931bdb878))
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * global connectivity transaction failures and confirmation modal ([#7355](https://github.com/dynamic-labs/DynamicAuth/issues/7355)) ([eb1c5d7](https://github.com/dynamic-labs/DynamicAuth/commit/eb1c5d794df972dfb2f84fdcaa6c581ba68285c0)), closes [#7347](https://github.com/dynamic-labs/DynamicAuth/issues/7347)
20
+
2
21
  ### [3.4.6](https://github.com/dynamic-labs/DynamicAuth/compare/v3.4.5...v3.4.6) (2024-10-31)
3
22
 
4
23
 
package/package.cjs CHANGED
@@ -3,6 +3,6 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
- var version = "3.4.6";
6
+ var version = "3.5.1";
7
7
 
8
8
  exports.version = version;
package/package.js CHANGED
@@ -1,4 +1,4 @@
1
1
  'use client'
2
- var version = "3.4.6";
2
+ var version = "3.5.1";
3
3
 
4
4
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/solana-core",
3
- "version": "3.4.6",
3
+ "version": "3.5.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/dynamic-labs/dynamic-auth.git",
@@ -31,12 +31,12 @@
31
31
  "@solana/spl-token": "0.4.6"
32
32
  },
33
33
  "peerDependencies": {
34
- "@dynamic-labs/assert-package-version": "3.4.6",
35
- "@dynamic-labs/rpc-providers": "3.4.6",
36
- "@dynamic-labs/types": "3.4.6",
37
- "@dynamic-labs/utils": "3.4.6",
38
- "@dynamic-labs/wallet-book": "3.4.6",
39
- "@dynamic-labs/wallet-connector-core": "3.4.6",
34
+ "@dynamic-labs/assert-package-version": "3.5.1",
35
+ "@dynamic-labs/rpc-providers": "3.5.1",
36
+ "@dynamic-labs/types": "3.5.1",
37
+ "@dynamic-labs/utils": "3.5.1",
38
+ "@dynamic-labs/wallet-book": "3.5.1",
39
+ "@dynamic-labs/wallet-connector-core": "3.5.1",
40
40
  "eventemitter3": "5.0.1"
41
41
  }
42
42
  }
@@ -24,7 +24,8 @@ class SolanaWalletConnector extends walletConnectorCore.WalletConnectorBase {
24
24
  this.connectedChain = 'SOL';
25
25
  this.solNetworks = opts.solNetworks;
26
26
  this.chainRpcProviders = opts.chainRpcProviders;
27
- (_a = this.chainRpcProviders) === null || _a === void 0 ? void 0 : _a.registerSolanaProviders();
27
+ this.connectionConfig = opts.connectionConfig;
28
+ (_a = this.chainRpcProviders) === null || _a === void 0 ? void 0 : _a.registerSolanaProviders(this.connectionConfig);
28
29
  }
29
30
  getNetwork() {
30
31
  return _tslib.__awaiter(this, void 0, void 0, function* () {
@@ -55,13 +56,13 @@ class SolanaWalletConnector extends walletConnectorCore.WalletConnectorBase {
55
56
  });
56
57
  }
57
58
  getWalletClient() {
58
- var _a;
59
+ var _a, _b;
59
60
  const [network] = this.solNetworks;
60
61
  if (!network) {
61
62
  throw new utils.DynamicError('No enabled networks');
62
63
  }
63
64
  const rpcUrl = ((_a = network.privateCustomerRpcUrls) === null || _a === void 0 ? void 0 : _a[0]) || network.rpcUrls[0];
64
- return new web3_js.Connection(rpcUrl, 'confirmed');
65
+ return new web3_js.Connection(rpcUrl, (_b = this.connectionConfig) !== null && _b !== void 0 ? _b : 'confirmed');
65
66
  }
66
67
  getPublicClient() {
67
68
  return _tslib.__awaiter(this, void 0, void 0, function* () {
@@ -1,4 +1,4 @@
1
- import { Connection } from '@solana/web3.js';
1
+ import { Connection, ConnectionConfig } from '@solana/web3.js';
2
2
  import { Chain, IHardwareWalletConnector, WalletConnectorBase, WalletMetadata } from '@dynamic-labs/wallet-connector-core';
3
3
  import { GenericNetwork } from '@dynamic-labs/types';
4
4
  import { WalletBookSchema } from '@dynamic-labs/wallet-book';
@@ -11,6 +11,7 @@ export type SolanaWalletConnectorOpts = {
11
11
  solNetworks: GenericNetwork[];
12
12
  walletBook: WalletBookSchema;
13
13
  metadata?: WalletMetadata;
14
+ connectionConfig?: ConnectionConfig;
14
15
  };
15
16
  export declare abstract class SolanaWalletConnector extends WalletConnectorBase<typeof SolanaWallet> implements IHardwareWalletConnector {
16
17
  isHardwareWalletEnabled: boolean;
@@ -19,6 +20,7 @@ export declare abstract class SolanaWalletConnector extends WalletConnectorBase<
19
20
  ChainWallet: typeof SolanaWallet;
20
21
  supportedChains: Chain[];
21
22
  connectedChain: Chain;
23
+ protected connectionConfig: ConnectionConfig | undefined;
22
24
  constructor(opts: SolanaWalletConnectorOpts);
23
25
  getNetwork(): Promise<string>;
24
26
  endSession(): Promise<void>;
@@ -20,7 +20,8 @@ class SolanaWalletConnector extends WalletConnectorBase {
20
20
  this.connectedChain = 'SOL';
21
21
  this.solNetworks = opts.solNetworks;
22
22
  this.chainRpcProviders = opts.chainRpcProviders;
23
- (_a = this.chainRpcProviders) === null || _a === void 0 ? void 0 : _a.registerSolanaProviders();
23
+ this.connectionConfig = opts.connectionConfig;
24
+ (_a = this.chainRpcProviders) === null || _a === void 0 ? void 0 : _a.registerSolanaProviders(this.connectionConfig);
24
25
  }
25
26
  getNetwork() {
26
27
  return __awaiter(this, void 0, void 0, function* () {
@@ -51,13 +52,13 @@ class SolanaWalletConnector extends WalletConnectorBase {
51
52
  });
52
53
  }
53
54
  getWalletClient() {
54
- var _a;
55
+ var _a, _b;
55
56
  const [network] = this.solNetworks;
56
57
  if (!network) {
57
58
  throw new DynamicError('No enabled networks');
58
59
  }
59
60
  const rpcUrl = ((_a = network.privateCustomerRpcUrls) === null || _a === void 0 ? void 0 : _a[0]) || network.rpcUrls[0];
60
- return new Connection(rpcUrl, 'confirmed');
61
+ return new Connection(rpcUrl, (_b = this.connectionConfig) !== null && _b !== void 0 ? _b : 'confirmed');
61
62
  }
62
63
  getPublicClient() {
63
64
  return __awaiter(this, void 0, void 0, function* () {
@@ -9,14 +9,14 @@ rpcProviders.ChainRpcProviders.getSolanaProviderByChainId = (rpcProviders, chain
9
9
  const provider = (_a = rpcProviders['solana']) === null || _a === void 0 ? void 0 : _a.find((rpcProvider) => rpcProvider.chainId === chainId);
10
10
  return provider;
11
11
  };
12
- rpcProviders.ChainRpcProviders.registerSolanaProviders = () => {
12
+ rpcProviders.ChainRpcProviders.registerSolanaProviders = (connectionConfig) => {
13
13
  rpcProviders.ChainRpcProviders.registerChainProviders(rpcProviders.ProviderChain.SOLANA, (config) => {
14
14
  const rpcProviders = {};
15
15
  if (config === null || config === void 0 ? void 0 : config.solana) {
16
16
  rpcProviders.solana = config.solana.map((network) => {
17
17
  var _a;
18
18
  const rpcUrl = ((_a = network.privateCustomerRpcUrls) === null || _a === void 0 ? void 0 : _a[0]) || network.rpcUrls[0];
19
- const provider = new web3_js.Connection(rpcUrl);
19
+ const provider = new web3_js.Connection(rpcUrl, connectionConfig);
20
20
  return {
21
21
  chainId: network.chainId.toString(),
22
22
  chainName: network.name,
@@ -1,4 +1,4 @@
1
- import { Connection } from '@solana/web3.js';
1
+ import { Connection, ConnectionConfig } from '@solana/web3.js';
2
2
  import { RpcProviders } from '@dynamic-labs/rpc-providers';
3
3
  type ISolanaRpcProvider = {
4
4
  chainId: string;
@@ -12,7 +12,7 @@ declare module '@dynamic-labs/rpc-providers' {
12
12
  }
13
13
  interface IChainRpcProviders {
14
14
  getSolanaProviderByChainId(rpcProviders: RpcProviders, chainId: string): SolanaRpcProvider | undefined;
15
- registerSolanaProviders(): void;
15
+ registerSolanaProviders(connectionConfig?: ConnectionConfig): void;
16
16
  }
17
17
  }
18
18
  export {};
@@ -7,14 +7,14 @@ ChainRpcProviders.getSolanaProviderByChainId = (rpcProviders, chainId) => {
7
7
  const provider = (_a = rpcProviders['solana']) === null || _a === void 0 ? void 0 : _a.find((rpcProvider) => rpcProvider.chainId === chainId);
8
8
  return provider;
9
9
  };
10
- ChainRpcProviders.registerSolanaProviders = () => {
10
+ ChainRpcProviders.registerSolanaProviders = (connectionConfig) => {
11
11
  ChainRpcProviders.registerChainProviders(ProviderChain.SOLANA, (config) => {
12
12
  const rpcProviders = {};
13
13
  if (config === null || config === void 0 ? void 0 : config.solana) {
14
14
  rpcProviders.solana = config.solana.map((network) => {
15
15
  var _a;
16
16
  const rpcUrl = ((_a = network.privateCustomerRpcUrls) === null || _a === void 0 ? void 0 : _a[0]) || network.rpcUrls[0];
17
- const provider = new Connection(rpcUrl);
17
+ const provider = new Connection(rpcUrl, connectionConfig);
18
18
  return {
19
19
  chainId: network.chainId.toString(),
20
20
  chainName: network.name,