@dynamic-labs/embedded-wallet-solana 4.0.0-alpha.11 → 4.0.0-alpha.13

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,29 @@
1
1
 
2
+ ## [4.0.0-alpha.13](https://github.com/dynamic-labs/dynamic-auth/compare/v4.0.0-alpha.12...v4.0.0-alpha.13) (2024-10-18)
3
+
4
+
5
+ ### Bug Fixes
6
+
7
+ * improve displayed chain name in network switcher ([#7153](https://github.com/dynamic-labs/dynamic-auth/issues/7153)) ([55d2e5a](https://github.com/dynamic-labs/dynamic-auth/commit/55d2e5a9954bf0255b5caf7aba7a6f1f2e215967))
8
+
9
+ ## [4.0.0-alpha.12](https://github.com/dynamic-labs/dynamic-auth/compare/v4.0.0-alpha.11...v4.0.0-alpha.12) (2024-10-18)
10
+
11
+
12
+ ### Features
13
+
14
+ * add support for xverse account change event ([#7114](https://github.com/dynamic-labs/dynamic-auth/issues/7114)) ([79df047](https://github.com/dynamic-labs/dynamic-auth/commit/79df04775edb297a339e2d74adcc873584a6d8af))
15
+ * solana embedded signall headless ([#7132](https://github.com/dynamic-labs/dynamic-auth/issues/7132)) ([fe16b71](https://github.com/dynamic-labs/dynamic-auth/commit/fe16b71a4c0ad775f8de87ca899cfdd1071f11d6))
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * bug where embeddedWalletCreated event was fired before listener … ([#7151](https://github.com/dynamic-labs/dynamic-auth/issues/7151)) ([ae9da56](https://github.com/dynamic-labs/dynamic-auth/commit/ae9da56850130491384a2d5f47c1617815dcce5b))
21
+ * edge case where wallet book fails to load ([#7148](https://github.com/dynamic-labs/dynamic-auth/issues/7148)) ([805dc6d](https://github.com/dynamic-labs/dynamic-auth/commit/805dc6d7cc4cdf0b23748d82b3bd8216d88d55b5))
22
+ * issues where native currency icons were incorrect ([#7126](https://github.com/dynamic-labs/dynamic-auth/issues/7126)) ([8b8891a](https://github.com/dynamic-labs/dynamic-auth/commit/8b8891a52397e17cc127ea3a09ade14c4b70a8ee))
23
+ * remove now-unused sessionTimeout from useSocial ([#7123](https://github.com/dynamic-labs/dynamic-auth/issues/7123)) ([7959a8a](https://github.com/dynamic-labs/dynamic-auth/commit/7959a8a4c8ceb76c5c4f1ae91af204bf9c5cae7b))
24
+ * Revert: Update Exodus extension version " ([#7130](https://github.com/dynamic-labs/dynamic-auth/issues/7130)) ([f2274ae](https://github.com/dynamic-labs/dynamic-auth/commit/f2274aefd29bb9f3fb6de8493e4a5f73946a5600)), closes [#7129](https://github.com/dynamic-labs/dynamic-auth/issues/7129)
25
+ * use embedded primaryChain when passing undefined chains list to createTurnkeyWallet ([#7149](https://github.com/dynamic-labs/dynamic-auth/issues/7149)) ([c73a3ae](https://github.com/dynamic-labs/dynamic-auth/commit/c73a3aeeda8045b936d218f7078ad79967c321ef))
26
+
2
27
  ## [4.0.0-alpha.11](https://github.com/dynamic-labs/dynamic-auth/compare/v4.0.0-alpha.10...v4.0.0-alpha.11) (2024-10-15)
3
28
 
4
29
 
package/package.cjs CHANGED
@@ -3,12 +3,12 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
- var version = "4.0.0-alpha.11";
6
+ var version = "4.0.0-alpha.13";
7
7
  var dependencies = {
8
- "@dynamic-labs/sdk-api-core": "0.0.545",
9
- "@dynamic-labs/utils": "4.0.0-alpha.11",
10
- "@dynamic-labs/logger": "4.0.0-alpha.11",
11
- "@dynamic-labs/types": "4.0.0-alpha.11",
8
+ "@dynamic-labs/sdk-api-core": "0.0.547",
9
+ "@dynamic-labs/utils": "4.0.0-alpha.13",
10
+ "@dynamic-labs/logger": "4.0.0-alpha.13",
11
+ "@dynamic-labs/types": "4.0.0-alpha.13",
12
12
  eventemitter3: "5.0.1",
13
13
  "@solana/spl-token": "0.4.6",
14
14
  "@solana/web3.js": "1.92.1",
package/package.js CHANGED
@@ -1,10 +1,10 @@
1
1
  'use client'
2
- var version = "4.0.0-alpha.11";
2
+ var version = "4.0.0-alpha.13";
3
3
  var dependencies = {
4
- "@dynamic-labs/sdk-api-core": "0.0.545",
5
- "@dynamic-labs/utils": "4.0.0-alpha.11",
6
- "@dynamic-labs/logger": "4.0.0-alpha.11",
7
- "@dynamic-labs/types": "4.0.0-alpha.11",
4
+ "@dynamic-labs/sdk-api-core": "0.0.547",
5
+ "@dynamic-labs/utils": "4.0.0-alpha.13",
6
+ "@dynamic-labs/logger": "4.0.0-alpha.13",
7
+ "@dynamic-labs/types": "4.0.0-alpha.13",
8
8
  eventemitter3: "5.0.1",
9
9
  "@solana/spl-token": "0.4.6",
10
10
  "@solana/web3.js": "1.92.1",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/embedded-wallet-solana",
3
- "version": "4.0.0-alpha.11",
3
+ "version": "4.0.0-alpha.13",
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,10 +18,10 @@
18
18
  },
19
19
  "homepage": "https://www.dynamic.xyz/",
20
20
  "dependencies": {
21
- "@dynamic-labs/sdk-api-core": "0.0.545",
22
- "@dynamic-labs/utils": "4.0.0-alpha.11",
23
- "@dynamic-labs/logger": "4.0.0-alpha.11",
24
- "@dynamic-labs/types": "4.0.0-alpha.11",
21
+ "@dynamic-labs/sdk-api-core": "0.0.547",
22
+ "@dynamic-labs/utils": "4.0.0-alpha.13",
23
+ "@dynamic-labs/logger": "4.0.0-alpha.13",
24
+ "@dynamic-labs/types": "4.0.0-alpha.13",
25
25
  "eventemitter3": "5.0.1",
26
26
  "@solana/spl-token": "0.4.6",
27
27
  "@solana/web3.js": "1.92.1",
@@ -29,13 +29,13 @@
29
29
  "@turnkey/iframe-stamper": "2.0.0",
30
30
  "@turnkey/solana": "0.3.9",
31
31
  "@turnkey/webauthn-stamper": "0.5.0",
32
- "@dynamic-labs/assert-package-version": "4.0.0-alpha.11",
33
- "@dynamic-labs/embedded-wallet": "4.0.0-alpha.11",
34
- "@dynamic-labs/rpc-providers": "4.0.0-alpha.11",
35
- "@dynamic-labs/solana-core": "4.0.0-alpha.11",
36
- "@dynamic-labs/wallet-book": "4.0.0-alpha.11",
37
- "@dynamic-labs/wallet-connector-core": "4.0.0-alpha.11",
38
- "@dynamic-labs/webauthn": "4.0.0-alpha.11",
32
+ "@dynamic-labs/assert-package-version": "4.0.0-alpha.13",
33
+ "@dynamic-labs/embedded-wallet": "4.0.0-alpha.13",
34
+ "@dynamic-labs/rpc-providers": "4.0.0-alpha.13",
35
+ "@dynamic-labs/solana-core": "4.0.0-alpha.13",
36
+ "@dynamic-labs/wallet-book": "4.0.0-alpha.13",
37
+ "@dynamic-labs/wallet-connector-core": "4.0.0-alpha.13",
38
+ "@dynamic-labs/webauthn": "4.0.0-alpha.13",
39
39
  "react-dom": "18.2.0",
40
40
  "viem": "2.9.25"
41
41
  },
@@ -27,11 +27,9 @@ class TurnkeySolanaSigner {
27
27
  return this.walletConnector.signTransaction(transaction);
28
28
  });
29
29
  }
30
- signAllTransactions(
31
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
32
- _transactions) {
30
+ signAllTransactions(transactions) {
33
31
  return _tslib.__awaiter(this, void 0, void 0, function* () {
34
- throw Error('Method not available for embedded wallet');
32
+ return this.walletConnector.signAllTransactions(transactions);
35
33
  });
36
34
  }
37
35
  signAndSendTransaction(transaction, options) {
@@ -32,7 +32,7 @@ export declare class TurnkeySolanaSigner implements IEmbeddedWalletSolanaSigner
32
32
  });
33
33
  signMessage(encodedMessage: Uint8Array): Promise<SignedMessage>;
34
34
  signTransaction<T extends Transaction | VersionedTransaction>(transaction: T): Promise<T>;
35
- signAllTransactions<T extends Transaction | VersionedTransaction>(_transactions: T[]): Promise<T[]>;
35
+ signAllTransactions<T extends Transaction | VersionedTransaction>(transactions: T[]): Promise<T[]>;
36
36
  signAndSendTransaction<T extends Transaction | VersionedTransaction>(transaction: T, options?: SendOptions): Promise<{
37
37
  signature: TransactionSignature;
38
38
  }>;
@@ -23,11 +23,9 @@ class TurnkeySolanaSigner {
23
23
  return this.walletConnector.signTransaction(transaction);
24
24
  });
25
25
  }
26
- signAllTransactions(
27
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
28
- _transactions) {
26
+ signAllTransactions(transactions) {
29
27
  return __awaiter(this, void 0, void 0, function* () {
30
- throw Error('Method not available for embedded wallet');
28
+ return this.walletConnector.signAllTransactions(transactions);
31
29
  });
32
30
  }
33
31
  signAndSendTransaction(transaction, options) {
@@ -288,6 +288,35 @@ class TurnkeySolanaWalletConnector extends embeddedWallet.TurnkeyWalletConnector
288
288
  return transaction;
289
289
  });
290
290
  }
291
+ signAllTransactions(transactions) {
292
+ return _tslib.__awaiter(this, void 0, void 0, function* () {
293
+ yield this.createOrRestoreSession();
294
+ let account = yield this.getTurnkeyAccount();
295
+ const address = this.turnkeyAddress;
296
+ if (!account || !address) {
297
+ throw new Error('No turnkey account');
298
+ }
299
+ try {
300
+ const signedTransactions = yield account.signAllTransactions(transactions, address);
301
+ return signedTransactions;
302
+ }
303
+ catch (err) {
304
+ if (embeddedWallet.TURNKEY_SDK_SESSION_KEY_RETRYABLE_ERRORS.some((errorMsg) => err.message.includes(errorMsg))) {
305
+ yield this.removeSessionKeys();
306
+ yield this.createOrRestoreSession({
307
+ ignoreRestore: true,
308
+ });
309
+ account = (yield this.getTurnkeyAccount());
310
+ const signedTransactions = yield account.signAllTransactions(transactions, address);
311
+ return signedTransactions;
312
+ }
313
+ else {
314
+ embeddedWallet.logger.error('[TK] failed to perform SignAllTransactions activity', err);
315
+ throw err;
316
+ }
317
+ }
318
+ });
319
+ }
291
320
  internalSignAndSendTransaction(transaction, options) {
292
321
  return _tslib.__awaiter(this, void 0, void 0, function* () {
293
322
  if (!this.turnkeyAddress)
@@ -48,6 +48,7 @@ export declare class TurnkeySolanaWalletConnector extends TurnkeyWalletConnector
48
48
  getEnvId: () => any;
49
49
  signMessage(messageToSign: string): Promise<string | undefined>;
50
50
  signTransaction<T extends Transaction | VersionedTransaction>(transaction: T): Promise<T>;
51
+ signAllTransactions<T extends Transaction | VersionedTransaction>(transactions: T[]): Promise<T[]>;
51
52
  internalSignAndSendTransaction<T extends Transaction | VersionedTransaction>(transaction: T, options?: SendOptions): Promise<string>;
52
53
  signAndSendTransaction<T extends Transaction | VersionedTransaction>(transaction: T, options?: SendOptions): Promise<string>;
53
54
  sendTransaction<T extends Transaction | VersionedTransaction>(transaction: T, connection: Connection, options?: SendTransactionOptions): Promise<string>;
@@ -284,6 +284,35 @@ class TurnkeySolanaWalletConnector extends TurnkeyWalletConnectorBase {
284
284
  return transaction;
285
285
  });
286
286
  }
287
+ signAllTransactions(transactions) {
288
+ return __awaiter(this, void 0, void 0, function* () {
289
+ yield this.createOrRestoreSession();
290
+ let account = yield this.getTurnkeyAccount();
291
+ const address = this.turnkeyAddress;
292
+ if (!account || !address) {
293
+ throw new Error('No turnkey account');
294
+ }
295
+ try {
296
+ const signedTransactions = yield account.signAllTransactions(transactions, address);
297
+ return signedTransactions;
298
+ }
299
+ catch (err) {
300
+ if (TURNKEY_SDK_SESSION_KEY_RETRYABLE_ERRORS.some((errorMsg) => err.message.includes(errorMsg))) {
301
+ yield this.removeSessionKeys();
302
+ yield this.createOrRestoreSession({
303
+ ignoreRestore: true,
304
+ });
305
+ account = (yield this.getTurnkeyAccount());
306
+ const signedTransactions = yield account.signAllTransactions(transactions, address);
307
+ return signedTransactions;
308
+ }
309
+ else {
310
+ logger.error('[TK] failed to perform SignAllTransactions activity', err);
311
+ throw err;
312
+ }
313
+ }
314
+ });
315
+ }
287
316
  internalSignAndSendTransaction(transaction, options) {
288
317
  return __awaiter(this, void 0, void 0, function* () {
289
318
  if (!this.turnkeyAddress)