@dynamic-labs/solana-extension 4.0.0-alpha.25 → 4.0.0-alpha.27

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,20 @@
1
1
 
2
+ ## [4.0.0-alpha.27](https://github.com/dynamic-labs/dynamic-auth/compare/v4.0.0-alpha.26...v4.0.0-alpha.27) (2024-11-06)
3
+
4
+
5
+ ### Features
6
+
7
+ * allows adding connection configuration for solana connectors ([#7354](https://github.com/dynamic-labs/dynamic-auth/issues/7354)) ([01e35ee](https://github.com/dynamic-labs/dynamic-auth/commit/01e35ee5bfe4605df48e4188a753111efe483048))
8
+ * allows passing solana connection config to dynamic client ([#7357](https://github.com/dynamic-labs/dynamic-auth/issues/7357)) ([6da14ce](https://github.com/dynamic-labs/dynamic-auth/commit/6da14ceb481147aea31d192fe268be43a8af80e9))
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * check legacy vs eip1599 tx in global connectivity ([#7341](https://github.com/dynamic-labs/dynamic-auth/issues/7341)) ([b223ea7](https://github.com/dynamic-labs/dynamic-auth/commit/b223ea7a5ed5637e11da1040c631c48bc23ba76d))
14
+ * global connectivity multiple transactions in a row ([#7342](https://github.com/dynamic-labs/dynamic-auth/issues/7342)) ([d13c1af](https://github.com/dynamic-labs/dynamic-auth/commit/d13c1afec6b3680961621d8317f55549b3ed428f))
15
+
16
+ ## [4.0.0-alpha.26](https://github.com/dynamic-labs/dynamic-auth/compare/v4.0.0-alpha.25...v4.0.0-alpha.26) (2024-11-04)
17
+
2
18
  ## [4.0.0-alpha.25](https://github.com/dynamic-labs/dynamic-auth/compare/v4.0.0-alpha.24...v4.0.0-alpha.25) (2024-11-01)
3
19
 
4
20
  ## [4.0.0-alpha.24](https://github.com/dynamic-labs/dynamic-auth/compare/v4.0.0-alpha.23...v4.0.0-alpha.24) (2024-10-31)
package/README.md CHANGED
@@ -15,7 +15,13 @@ import { Connection } from '@solana/web3.js'
15
15
 
16
16
  const dynamicClient = createClient({...}).extend(SolanaExtension())
17
17
 
18
- const connection: Connection = dynamicClient.solana.getConnection();
18
+ // Optionally passing in connection config for illustration
19
+ const connection: Connection = dynamicClient.solana.getConnection({
20
+ commitment: 'confirmed',
21
+ httpHeaders: {
22
+ 'X-Requested-With': 'XMLHttpRequest',
23
+ },
24
+ });
19
25
 
20
26
  const signer = dynamicClient.solana.getSigner({
21
27
  wallet: dynamicClient.wallets.primary,
package/package.cjs CHANGED
@@ -3,6 +3,6 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
- var version = "4.0.0-alpha.25";
6
+ var version = "4.0.0-alpha.27";
7
7
 
8
8
  exports.version = version;
package/package.js CHANGED
@@ -1,4 +1,4 @@
1
1
  'use client'
2
- var version = "4.0.0-alpha.25";
2
+ var version = "4.0.0-alpha.27";
3
3
 
4
4
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/solana-extension",
3
- "version": "4.0.0-alpha.25",
3
+ "version": "4.0.0-alpha.27",
4
4
  "main": "./src/index.cjs",
5
5
  "module": "./src/index.js",
6
6
  "types": "./src/index.d.ts",
@@ -17,10 +17,10 @@
17
17
  "@solana/web3.js": "1.92.1"
18
18
  },
19
19
  "dependencies": {
20
- "@dynamic-labs/assert-package-version": "4.0.0-alpha.25",
21
- "@dynamic-labs/client": "4.0.0-alpha.25",
22
- "@dynamic-labs/message-transport": "4.0.0-alpha.25",
23
- "@dynamic-labs/solana-core": "4.0.0-alpha.25",
24
- "@dynamic-labs/types": "4.0.0-alpha.25"
20
+ "@dynamic-labs/assert-package-version": "4.0.0-alpha.27",
21
+ "@dynamic-labs/client": "4.0.0-alpha.27",
22
+ "@dynamic-labs/message-transport": "4.0.0-alpha.27",
23
+ "@dynamic-labs/solana-core": "4.0.0-alpha.27",
24
+ "@dynamic-labs/types": "4.0.0-alpha.27"
25
25
  }
26
26
  }
@@ -11,7 +11,7 @@ const SolanaExtension = () => (client, core) => {
11
11
  core.declaredExtensionNames.push(solanaExtensionName);
12
12
  return {
13
13
  solana: {
14
- getConnection: () => createConnection.createConnection(client, core),
14
+ getConnection: (connectionConfig) => createConnection.createConnection({ client, connectionConfig, core }),
15
15
  getSigner: ({ wallet }) => createSigner.createSigner({ core, wallet }),
16
16
  },
17
17
  };
@@ -1,10 +1,10 @@
1
- import { Connection } from '@solana/web3.js';
1
+ import { Commitment, Connection, ConnectionConfig } from '@solana/web3.js';
2
2
  import { type Extension, type Wallet } from '@dynamic-labs/client';
3
3
  import { ISolanaSigner } from './types';
4
4
  export declare const solanaExtensionName = "solana";
5
5
  export type ISolanaExtension = {
6
6
  solana: {
7
- getConnection: () => Connection;
7
+ getConnection: (connectionConfig?: ConnectionConfig | Commitment) => Connection;
8
8
  getSigner: (props: {
9
9
  wallet: Wallet;
10
10
  }) => ISolanaSigner;
@@ -7,7 +7,7 @@ const SolanaExtension = () => (client, core) => {
7
7
  core.declaredExtensionNames.push(solanaExtensionName);
8
8
  return {
9
9
  solana: {
10
- getConnection: () => createConnection(client, core),
10
+ getConnection: (connectionConfig) => createConnection({ client, connectionConfig, core }),
11
11
  getSigner: ({ wallet }) => createSigner({ core, wallet }),
12
12
  },
13
13
  };
@@ -6,15 +6,15 @@ Object.defineProperty(exports, '__esModule', { value: true });
6
6
  var web3_js = require('@solana/web3.js');
7
7
  var client = require('@dynamic-labs/client');
8
8
 
9
- const createConnection = (client$1, core) => {
9
+ const createConnection = ({ client: client$1, core, connectionConfig, }) => {
10
10
  if (!client.hasExtension(client$1, core, client.baseClientExtensionName)) {
11
- throw new Error('Client does not have a network configuration');
11
+ throw new Error('Dynamic client is malformed and missing base configuration');
12
12
  }
13
13
  const [rpcEndpoint] = client$1.networks.solana.map((network) => { var _a; return ((_a = network.privateCustomerRpcUrls) === null || _a === void 0 ? void 0 : _a[0]) || network.rpcUrls[0]; });
14
14
  if (!rpcEndpoint) {
15
- throw new Error('Client does not have a network configuration');
15
+ throw new Error('Dynamic client missing solana network configuration');
16
16
  }
17
- return new web3_js.Connection(rpcEndpoint);
17
+ return new web3_js.Connection(rpcEndpoint, connectionConfig);
18
18
  };
19
19
 
20
20
  exports.createConnection = createConnection;
@@ -1,3 +1,9 @@
1
- import { Connection } from '@solana/web3.js';
1
+ import { Commitment, Connection, ConnectionConfig } from '@solana/web3.js';
2
2
  import { Extendable, Core } from '@dynamic-labs/client';
3
- export declare const createConnection: (client: Extendable, core: Core) => Connection;
3
+ type CreateConnectionProps = {
4
+ client: Extendable;
5
+ core: Core;
6
+ connectionConfig?: ConnectionConfig | Commitment;
7
+ };
8
+ export declare const createConnection: ({ client, core, connectionConfig, }: CreateConnectionProps) => Connection;
9
+ export {};
@@ -2,15 +2,15 @@
2
2
  import { Connection } from '@solana/web3.js';
3
3
  import { hasExtension, baseClientExtensionName } from '@dynamic-labs/client';
4
4
 
5
- const createConnection = (client, core) => {
5
+ const createConnection = ({ client, core, connectionConfig, }) => {
6
6
  if (!hasExtension(client, core, baseClientExtensionName)) {
7
- throw new Error('Client does not have a network configuration');
7
+ throw new Error('Dynamic client is malformed and missing base configuration');
8
8
  }
9
9
  const [rpcEndpoint] = client.networks.solana.map((network) => { var _a; return ((_a = network.privateCustomerRpcUrls) === null || _a === void 0 ? void 0 : _a[0]) || network.rpcUrls[0]; });
10
10
  if (!rpcEndpoint) {
11
- throw new Error('Client does not have a network configuration');
11
+ throw new Error('Dynamic client missing solana network configuration');
12
12
  }
13
- return new Connection(rpcEndpoint);
13
+ return new Connection(rpcEndpoint, connectionConfig);
14
14
  };
15
15
 
16
16
  export { createConnection };