@dynamic-labs/embedded-wallet-solana 4.0.0-alpha.26 → 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,18 @@
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
+
2
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)
3
17
 
4
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)
package/package.cjs CHANGED
@@ -3,11 +3,11 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
- var version = "4.0.0-alpha.26";
6
+ var version = "4.0.0-alpha.27";
7
7
  var dependencies = {
8
- "@dynamic-labs/utils": "4.0.0-alpha.26",
9
- "@dynamic-labs/logger": "4.0.0-alpha.26",
10
- "@dynamic-labs/types": "4.0.0-alpha.26",
8
+ "@dynamic-labs/utils": "4.0.0-alpha.27",
9
+ "@dynamic-labs/logger": "4.0.0-alpha.27",
10
+ "@dynamic-labs/types": "4.0.0-alpha.27",
11
11
  "@dynamic-labs/sdk-api-core": "0.0.559",
12
12
  eventemitter3: "5.0.1",
13
13
  "@solana/spl-token": "0.4.6",
package/package.js CHANGED
@@ -1,9 +1,9 @@
1
1
  'use client'
2
- var version = "4.0.0-alpha.26";
2
+ var version = "4.0.0-alpha.27";
3
3
  var dependencies = {
4
- "@dynamic-labs/utils": "4.0.0-alpha.26",
5
- "@dynamic-labs/logger": "4.0.0-alpha.26",
6
- "@dynamic-labs/types": "4.0.0-alpha.26",
4
+ "@dynamic-labs/utils": "4.0.0-alpha.27",
5
+ "@dynamic-labs/logger": "4.0.0-alpha.27",
6
+ "@dynamic-labs/types": "4.0.0-alpha.27",
7
7
  "@dynamic-labs/sdk-api-core": "0.0.559",
8
8
  eventemitter3: "5.0.1",
9
9
  "@solana/spl-token": "0.4.6",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/embedded-wallet-solana",
3
- "version": "4.0.0-alpha.26",
3
+ "version": "4.0.0-alpha.27",
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",
@@ -18,9 +18,9 @@
18
18
  },
19
19
  "homepage": "https://www.dynamic.xyz/",
20
20
  "dependencies": {
21
- "@dynamic-labs/utils": "4.0.0-alpha.26",
22
- "@dynamic-labs/logger": "4.0.0-alpha.26",
23
- "@dynamic-labs/types": "4.0.0-alpha.26",
21
+ "@dynamic-labs/utils": "4.0.0-alpha.27",
22
+ "@dynamic-labs/logger": "4.0.0-alpha.27",
23
+ "@dynamic-labs/types": "4.0.0-alpha.27",
24
24
  "@dynamic-labs/sdk-api-core": "0.0.559",
25
25
  "eventemitter3": "5.0.1",
26
26
  "@solana/spl-token": "0.4.6",
@@ -28,13 +28,13 @@
28
28
  "@turnkey/iframe-stamper": "2.0.0",
29
29
  "@turnkey/solana": "1.0.1",
30
30
  "@turnkey/webauthn-stamper": "0.5.0",
31
- "@dynamic-labs/assert-package-version": "4.0.0-alpha.26",
32
- "@dynamic-labs/embedded-wallet": "4.0.0-alpha.26",
33
- "@dynamic-labs/rpc-providers": "4.0.0-alpha.26",
34
- "@dynamic-labs/solana-core": "4.0.0-alpha.26",
35
- "@dynamic-labs/wallet-book": "4.0.0-alpha.26",
36
- "@dynamic-labs/wallet-connector-core": "4.0.0-alpha.26",
37
- "@dynamic-labs/webauthn": "4.0.0-alpha.26",
31
+ "@dynamic-labs/assert-package-version": "4.0.0-alpha.27",
32
+ "@dynamic-labs/embedded-wallet": "4.0.0-alpha.27",
33
+ "@dynamic-labs/rpc-providers": "4.0.0-alpha.27",
34
+ "@dynamic-labs/solana-core": "4.0.0-alpha.27",
35
+ "@dynamic-labs/wallet-book": "4.0.0-alpha.27",
36
+ "@dynamic-labs/wallet-connector-core": "4.0.0-alpha.27",
37
+ "@dynamic-labs/webauthn": "4.0.0-alpha.27",
38
38
  "react-dom": "18.2.0",
39
39
  "viem": "2.9.25"
40
40
  },
@@ -47,8 +47,9 @@ class TurnkeySolanaWalletConnector extends embeddedWallet.TurnkeyWalletConnector
47
47
  this.walletUiUtils = props.walletUiUtils;
48
48
  this._turnkeyAccount = undefined;
49
49
  this._connectionClient = undefined;
50
+ this.connectionConfig = props.connectionConfig;
50
51
  this.chainRpcProviders = props.chainRpcProviders;
51
- (_a = this.chainRpcProviders) === null || _a === void 0 ? void 0 : _a.registerSolanaProviders();
52
+ (_a = this.chainRpcProviders) === null || _a === void 0 ? void 0 : _a.registerSolanaProviders(this.connectionConfig);
52
53
  this.__turnkeyClient = this.getTurnkeyClient();
53
54
  }
54
55
  getRpcUrl() {
@@ -64,7 +65,9 @@ class TurnkeySolanaWalletConnector extends embeddedWallet.TurnkeyWalletConnector
64
65
  const rpcUrl = this.getRpcUrl();
65
66
  if (!rpcUrl)
66
67
  throw new utils.DynamicError('No rpcUrl');
67
- this._connectionClient = createSolanaConnection.createSolanaConnection(rpcUrl, commitmentOrConfig);
68
+ const config = typeof commitmentOrConfig === 'string'
69
+ ? Object.assign(Object.assign({}, this.connectionConfig), { commitment: commitmentOrConfig }) : Object.assign(Object.assign({}, this.connectionConfig), commitmentOrConfig);
70
+ this._connectionClient = createSolanaConnection.createSolanaConnection(rpcUrl, config);
68
71
  }
69
72
  return this._connectionClient;
70
73
  }
@@ -296,9 +299,10 @@ class TurnkeySolanaWalletConnector extends embeddedWallet.TurnkeyWalletConnector
296
299
  }
297
300
  internalSignAndSendTransaction(transaction, options) {
298
301
  return _tslib.__awaiter(this, void 0, void 0, function* () {
302
+ var _a, _b;
299
303
  if (!this.turnkeyAddress)
300
304
  throw new utils.DynamicError('Solana wallet not found');
301
- const currentConnection = this.getConnection('confirmed');
305
+ const currentConnection = this.getConnection((_b = (_a = this.connectionConfig) === null || _a === void 0 ? void 0 : _a.commitment) !== null && _b !== void 0 ? _b : 'confirmed');
302
306
  const signedTransaction = yield this.signTransaction(transaction);
303
307
  const signature = yield currentConnection.sendRawTransaction(signedTransaction.serialize(), options);
304
308
  // listen for tx confirmation until 60 seconds, which is ~150 blocks expiration
@@ -15,6 +15,7 @@ export type TurnkeySolanaConnectorProps = {
15
15
  solNetworks: GenericNetwork[];
16
16
  appName?: string;
17
17
  chainRpcProviders: IChainRpcProviders;
18
+ connectionConfig?: ConnectionConfig;
18
19
  };
19
20
  export declare class TurnkeySolanaWalletConnector extends TurnkeyWalletConnectorBase implements ISendBalanceWalletConnector {
20
21
  ChainWallet: typeof SolanaWallet;
@@ -25,6 +26,7 @@ export declare class TurnkeySolanaWalletConnector extends TurnkeyWalletConnector
25
26
  private walletUiUtils;
26
27
  private _turnkeyAccount;
27
28
  private _connectionClient;
29
+ private connectionConfig;
28
30
  constructor(nameAndKey: TurnkeyWalletConnectorNameAndKey, props: TurnkeySolanaConnectorProps);
29
31
  getRpcUrl(): string;
30
32
  getConnection(commitmentOrConfig?: Commitment | ConnectionConfig): Connection;
@@ -43,8 +43,9 @@ class TurnkeySolanaWalletConnector extends TurnkeyWalletConnectorBase {
43
43
  this.walletUiUtils = props.walletUiUtils;
44
44
  this._turnkeyAccount = undefined;
45
45
  this._connectionClient = undefined;
46
+ this.connectionConfig = props.connectionConfig;
46
47
  this.chainRpcProviders = props.chainRpcProviders;
47
- (_a = this.chainRpcProviders) === null || _a === void 0 ? void 0 : _a.registerSolanaProviders();
48
+ (_a = this.chainRpcProviders) === null || _a === void 0 ? void 0 : _a.registerSolanaProviders(this.connectionConfig);
48
49
  this.__turnkeyClient = this.getTurnkeyClient();
49
50
  }
50
51
  getRpcUrl() {
@@ -60,7 +61,9 @@ class TurnkeySolanaWalletConnector extends TurnkeyWalletConnectorBase {
60
61
  const rpcUrl = this.getRpcUrl();
61
62
  if (!rpcUrl)
62
63
  throw new DynamicError('No rpcUrl');
63
- this._connectionClient = createSolanaConnection(rpcUrl, commitmentOrConfig);
64
+ const config = typeof commitmentOrConfig === 'string'
65
+ ? Object.assign(Object.assign({}, this.connectionConfig), { commitment: commitmentOrConfig }) : Object.assign(Object.assign({}, this.connectionConfig), commitmentOrConfig);
66
+ this._connectionClient = createSolanaConnection(rpcUrl, config);
64
67
  }
65
68
  return this._connectionClient;
66
69
  }
@@ -292,9 +295,10 @@ class TurnkeySolanaWalletConnector extends TurnkeyWalletConnectorBase {
292
295
  }
293
296
  internalSignAndSendTransaction(transaction, options) {
294
297
  return __awaiter(this, void 0, void 0, function* () {
298
+ var _a, _b;
295
299
  if (!this.turnkeyAddress)
296
300
  throw new DynamicError('Solana wallet not found');
297
- const currentConnection = this.getConnection('confirmed');
301
+ const currentConnection = this.getConnection((_b = (_a = this.connectionConfig) === null || _a === void 0 ? void 0 : _a.commitment) !== null && _b !== void 0 ? _b : 'confirmed');
298
302
  const signedTransaction = yield this.signTransaction(transaction);
299
303
  const signature = yield currentConnection.sendRawTransaction(signedTransaction.serialize(), options);
300
304
  // listen for tx confirmation until 60 seconds, which is ~150 blocks expiration