@dynamic-labs/embedded-wallet-solana 3.0.0-alpha.10 → 3.0.0-alpha.12

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.0.0-alpha.12](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.11...v3.0.0-alpha.12) (2024-06-27)
3
+
4
+
5
+ ### ⚠ BREAKING CHANGES
6
+
7
+ * return Transaction type from signTransaction and update solana … (#6180)
8
+
9
+ ### Bug Fixes
10
+
11
+ * return Transaction type from signTransaction and update solana … ([#6180](https://github.com/dynamic-labs/DynamicAuth/issues/6180)) ([07798b2](https://github.com/dynamic-labs/DynamicAuth/commit/07798b241a13f35a62e4ca0172a57a8d0cd98cf9))
12
+
13
+ ## [3.0.0-alpha.11](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.10...v3.0.0-alpha.11) (2024-06-26)
14
+
15
+
16
+ ### Bug Fixes
17
+
18
+ * prevent unwanted magiceden solana popups ([#6158](https://github.com/dynamic-labs/DynamicAuth/issues/6158)) ([b3c8208](https://github.com/dynamic-labs/DynamicAuth/commit/b3c820887eb5ec2badcfce3b19ec4dd874e90811))
19
+ * status icon for embedded wallets ([#6149](https://github.com/dynamic-labs/DynamicAuth/issues/6149)) ([135fd72](https://github.com/dynamic-labs/DynamicAuth/commit/135fd7274f4a6b2dcab98248f7bfe34a09e79f01))
20
+
2
21
  ## [3.0.0-alpha.10](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.9...v3.0.0-alpha.10) (2024-06-24)
3
22
 
4
23
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/embedded-wallet-solana",
3
- "version": "3.0.0-alpha.10",
3
+ "version": "3.0.0-alpha.12",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/dynamic-labs/dynamic-auth.git",
@@ -33,14 +33,14 @@
33
33
  "@turnkey/iframe-stamper": "2.0.0",
34
34
  "@turnkey/solana": "0.3.1",
35
35
  "@turnkey/webauthn-stamper": "0.5.0",
36
- "@dynamic-labs/embedded-wallet": "3.0.0-alpha.10",
37
- "@dynamic-labs/rpc-provider-solana": "3.0.0-alpha.10",
38
- "@dynamic-labs/rpc-providers": "3.0.0-alpha.10",
39
- "@dynamic-labs/solana-utils": "3.0.0-alpha.10",
40
- "@dynamic-labs/types": "3.0.0-alpha.10",
41
- "@dynamic-labs/utils": "3.0.0-alpha.10",
42
- "@dynamic-labs/wallet-book": "3.0.0-alpha.10",
43
- "@dynamic-labs/wallet-connector-core": "3.0.0-alpha.10",
36
+ "@dynamic-labs/embedded-wallet": "3.0.0-alpha.12",
37
+ "@dynamic-labs/rpc-provider-solana": "3.0.0-alpha.12",
38
+ "@dynamic-labs/rpc-providers": "3.0.0-alpha.12",
39
+ "@dynamic-labs/solana-utils": "3.0.0-alpha.12",
40
+ "@dynamic-labs/types": "3.0.0-alpha.12",
41
+ "@dynamic-labs/utils": "3.0.0-alpha.12",
42
+ "@dynamic-labs/wallet-book": "3.0.0-alpha.12",
43
+ "@dynamic-labs/wallet-connector-core": "3.0.0-alpha.12",
44
44
  "viem": "2.9.25"
45
45
  },
46
46
  "peerDependencies": {}
@@ -27,7 +27,7 @@ class TurnkeySolanaSigner {
27
27
  }
28
28
  signTransaction(transaction) {
29
29
  return _tslib.__awaiter(this, void 0, void 0, function* () {
30
- return this.walletConnector.signTransaction({ transaction });
30
+ return this.walletConnector.signTransaction(transaction);
31
31
  });
32
32
  }
33
33
  signAllTransactions(
@@ -30,9 +30,9 @@ export declare class TurnkeySolanaSigner implements IEmbeddedWalletSolanaSigner
30
30
  walletConnector: TurnkeySolanaWalletConnector;
31
31
  });
32
32
  signMessage(message: string): Promise<string>;
33
- signTransaction(transaction: Transaction | VersionedTransaction): Promise<any>;
34
- signAllTransactions(_transactions: Array<Transaction | VersionedTransaction>): Promise<any>;
35
- signAndSendTransaction(transaction: Transaction | VersionedTransaction, options?: SendOptions): Promise<{
33
+ signTransaction<T extends Transaction | VersionedTransaction>(transaction: T): Promise<T>;
34
+ signAllTransactions<T extends Transaction | VersionedTransaction>(_transactions: T[]): Promise<T[]>;
35
+ signAndSendTransaction<T extends Transaction | VersionedTransaction>(transaction: T, options?: SendOptions): Promise<{
36
36
  signature: TransactionSignature;
37
37
  }>;
38
38
  connect(_args?: {
@@ -23,7 +23,7 @@ class TurnkeySolanaSigner {
23
23
  }
24
24
  signTransaction(transaction) {
25
25
  return __awaiter(this, void 0, void 0, function* () {
26
- return this.walletConnector.signTransaction({ transaction });
26
+ return this.walletConnector.signTransaction(transaction);
27
27
  });
28
28
  }
29
29
  signAllTransactions(
@@ -205,15 +205,15 @@ class TurnkeySolanaWalletConnector extends embeddedWallet.TurnkeyWalletConnector
205
205
  return signedMessage;
206
206
  });
207
207
  }
208
- signTransaction(_a) {
209
- return _tslib.__awaiter(this, arguments, void 0, function* ({ transaction, }) {
208
+ signTransaction(transaction) {
209
+ return _tslib.__awaiter(this, void 0, void 0, function* () {
210
210
  const account = yield this.getTurnkeyAccount();
211
211
  const address = this.turnkeyAddress;
212
212
  if (!account || !address) {
213
213
  throw new Error('No turnkey account');
214
214
  }
215
215
  yield account.addSignature(transaction, address);
216
- return Buffer.from(transaction.serialize());
216
+ return transaction;
217
217
  });
218
218
  }
219
219
  internalSignAndSendTransaction(transaction, options) {
@@ -232,8 +232,8 @@ class TurnkeySolanaWalletConnector extends embeddedWallet.TurnkeyWalletConnector
232
232
  transaction.feePayer =
233
233
  (_a = transaction.feePayer) !== null && _a !== void 0 ? _a : new web3_js.PublicKey(this.turnkeyAddress);
234
234
  }
235
- const signedTransaction = yield this.signTransaction({ transaction });
236
- const signature = yield currentConnection.sendRawTransaction(signedTransaction, options);
235
+ const signedTransaction = yield this.signTransaction(transaction);
236
+ const signature = yield currentConnection.sendRawTransaction(Buffer.from(signedTransaction.serialize()), options);
237
237
  // listen for tx confirmation until 60 seconds, which is ~150 blocks expiration
238
238
  return new Promise((resolve, reject) => {
239
239
  const timeout = setTimeout(() => {
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import { Commitment, Connection, ConnectionConfig, Transaction, VersionedTransaction, ConfirmOptions, Signer, SendOptions } from '@solana/web3.js';
3
2
  import { GenericNetwork, IUITransaction, WalletUiUtils } from '@dynamic-labs/types';
4
3
  import { Chain, ISendBalanceWalletConnector, WalletConnector } from '@dynamic-labs/wallet-connector-core';
@@ -43,12 +42,10 @@ export declare class TurnkeySolanaWalletConnector extends TurnkeyWalletConnector
43
42
  getSigner(): Promise<TurnkeySolanaSigner | undefined>;
44
43
  getBalance(): Promise<string | undefined>;
45
44
  signMessage(messageToSign: string): Promise<string | undefined>;
46
- signTransaction({ transaction, }: {
47
- transaction: Transaction | VersionedTransaction;
48
- }): Promise<Buffer>;
49
- internalSignAndSendTransaction(transaction: Transaction | VersionedTransaction, options?: SendOptions): Promise<string>;
50
- signAndSendTransaction(transaction: Transaction | VersionedTransaction, options?: SendOptions): Promise<string>;
51
- sendTransaction(transaction: Transaction | VersionedTransaction, connection: Connection, options?: SendTransactionOptions): Promise<string>;
45
+ signTransaction<T extends Transaction | VersionedTransaction>(transaction: T): Promise<T>;
46
+ internalSignAndSendTransaction<T extends Transaction | VersionedTransaction>(transaction: T, options?: SendOptions): Promise<string>;
47
+ signAndSendTransaction<T extends Transaction | VersionedTransaction>(transaction: T, options?: SendOptions): Promise<string>;
48
+ sendTransaction<T extends Transaction | VersionedTransaction>(transaction: T, connection: Connection, options?: SendTransactionOptions): Promise<string>;
52
49
  private lamportsToSol;
53
50
  createUiTransaction(from: string): Promise<IUITransaction>;
54
51
  }
@@ -201,15 +201,15 @@ class TurnkeySolanaWalletConnector extends TurnkeyWalletConnectorBase {
201
201
  return signedMessage;
202
202
  });
203
203
  }
204
- signTransaction(_a) {
205
- return __awaiter(this, arguments, void 0, function* ({ transaction, }) {
204
+ signTransaction(transaction) {
205
+ return __awaiter(this, void 0, void 0, function* () {
206
206
  const account = yield this.getTurnkeyAccount();
207
207
  const address = this.turnkeyAddress;
208
208
  if (!account || !address) {
209
209
  throw new Error('No turnkey account');
210
210
  }
211
211
  yield account.addSignature(transaction, address);
212
- return Buffer.from(transaction.serialize());
212
+ return transaction;
213
213
  });
214
214
  }
215
215
  internalSignAndSendTransaction(transaction, options) {
@@ -228,8 +228,8 @@ class TurnkeySolanaWalletConnector extends TurnkeyWalletConnectorBase {
228
228
  transaction.feePayer =
229
229
  (_a = transaction.feePayer) !== null && _a !== void 0 ? _a : new PublicKey(this.turnkeyAddress);
230
230
  }
231
- const signedTransaction = yield this.signTransaction({ transaction });
232
- const signature = yield currentConnection.sendRawTransaction(signedTransaction, options);
231
+ const signedTransaction = yield this.signTransaction(transaction);
232
+ const signature = yield currentConnection.sendRawTransaction(Buffer.from(signedTransaction.serialize()), options);
233
233
  // listen for tx confirmation until 60 seconds, which is ~150 blocks expiration
234
234
  return new Promise((resolve, reject) => {
235
235
  const timeout = setTimeout(() => {