@dynamic-labs/solana-core 3.0.0-alpha.62 → 3.0.0-alpha.64

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,28 @@
1
1
 
2
+ ## [3.0.0-alpha.64](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.63...v3.0.0-alpha.64) (2024-09-10)
3
+
4
+
5
+ ### Features
6
+
7
+ * add solana ledger check for connect-only ([#6833](https://github.com/dynamic-labs/DynamicAuth/issues/6833)) ([4829122](https://github.com/dynamic-labs/DynamicAuth/commit/4829122bbd1e04b9b02f8686df5dd5a6d2ae6c1c))
8
+
9
+ ## [3.0.0-alpha.63](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.62...v3.0.0-alpha.63) (2024-09-10)
10
+
11
+
12
+ ### ⚠ BREAKING CHANGES
13
+
14
+ * remove signWithEmailWalletName (#6824)
15
+
16
+ ### Features
17
+
18
+ * remove signWithEmailWalletName ([#6824](https://github.com/dynamic-labs/DynamicAuth/issues/6824)) ([9da06ce](https://github.com/dynamic-labs/DynamicAuth/commit/9da06ce6f83813e00827295a2952a805e0ef5ec0))
19
+
20
+
21
+ ### Bug Fixes
22
+
23
+ * omit body when creating 204 response data ([#6458](https://github.com/dynamic-labs/DynamicAuth/issues/6458)) ([06aab01](https://github.com/dynamic-labs/DynamicAuth/commit/06aab016eed0fa5ac41e43ece73780844d8d12ad))
24
+ * use a better object clone function to clone wallet signers ([#6835](https://github.com/dynamic-labs/DynamicAuth/issues/6835)) ([d88c195](https://github.com/dynamic-labs/DynamicAuth/commit/d88c195ce8e3af8e2fd8e6d76fbbdad618bc6c85))
25
+
2
26
  ## [3.0.0-alpha.62](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.61...v3.0.0-alpha.62) (2024-09-08)
3
27
 
4
28
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/solana-core",
3
- "version": "3.0.0-alpha.62",
3
+ "version": "3.0.0-alpha.64",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/dynamic-labs/dynamic-auth.git",
@@ -31,11 +31,11 @@
31
31
  "@solana/spl-token": "0.4.6"
32
32
  },
33
33
  "peerDependencies": {
34
- "@dynamic-labs/rpc-providers": "3.0.0-alpha.62",
35
- "@dynamic-labs/types": "3.0.0-alpha.62",
36
- "@dynamic-labs/utils": "3.0.0-alpha.62",
37
- "@dynamic-labs/wallet-book": "3.0.0-alpha.62",
38
- "@dynamic-labs/wallet-connector-core": "3.0.0-alpha.62",
34
+ "@dynamic-labs/rpc-providers": "3.0.0-alpha.64",
35
+ "@dynamic-labs/types": "3.0.0-alpha.64",
36
+ "@dynamic-labs/utils": "3.0.0-alpha.64",
37
+ "@dynamic-labs/wallet-book": "3.0.0-alpha.64",
38
+ "@dynamic-labs/wallet-connector-core": "3.0.0-alpha.64",
39
39
  "eventemitter3": "5.0.1"
40
40
  }
41
41
  }
package/src/index.cjs CHANGED
@@ -14,6 +14,7 @@ var encodeTransactionToBase64 = require('./utils/encodeTransactionToBase64/encod
14
14
  var getGenesisHashLSKey = require('./utils/getGenesisHashLSKey/getGenesisHashLSKey.cjs');
15
15
  var SolanaWallet = require('./wallet/SolanaWallet.cjs');
16
16
  var isSolanaWallet = require('./wallet/isSolanaWallet/isSolanaWallet.cjs');
17
+ var isLedgerSolanaWallet = require('./wallet/isLedgerSolanaWallet/isLedgerSolanaWallet.cjs');
17
18
  var constants = require('./constants.cjs');
18
19
 
19
20
 
@@ -27,6 +28,7 @@ exports.encodeTransactionToBase64 = encodeTransactionToBase64.encodeTransactionT
27
28
  exports.getGenesisHashLSKey = getGenesisHashLSKey.getGenesisHashLSKey;
28
29
  exports.SolanaWallet = SolanaWallet.SolanaWallet;
29
30
  exports.isSolanaWallet = isSolanaWallet.isSolanaWallet;
31
+ exports.isLedgerSolanaWallet = isLedgerSolanaWallet.isLedgerSolanaWallet;
30
32
  exports.SOLANA_GENESIS_HASH = constants.SOLANA_GENESIS_HASH;
31
33
  Object.keys(rpcProviders).forEach(function (k) {
32
34
  if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {
package/src/index.js CHANGED
@@ -10,4 +10,5 @@ export { encodeTransactionToBase64 } from './utils/encodeTransactionToBase64/enc
10
10
  export { getGenesisHashLSKey } from './utils/getGenesisHashLSKey/getGenesisHashLSKey.js';
11
11
  export { SolanaWallet } from './wallet/SolanaWallet.js';
12
12
  export { isSolanaWallet } from './wallet/isSolanaWallet/isSolanaWallet.js';
13
+ export { isLedgerSolanaWallet } from './wallet/isLedgerSolanaWallet/isLedgerSolanaWallet.js';
13
14
  export { SOLANA_GENESIS_HASH } from './constants.js';
@@ -5,6 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
6
  var _tslib = require('../../_virtual/_tslib.cjs');
7
7
  var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
8
+ var utils = require('@dynamic-labs/utils');
8
9
 
9
10
  class SolanaWallet extends walletConnectorCore.Wallet {
10
11
  /**
@@ -27,19 +28,24 @@ class SolanaWallet extends walletConnectorCore.Wallet {
27
28
  if (!signer) {
28
29
  throw new Error('unable to retrieve Solana signer');
29
30
  }
30
- return Object.assign(Object.assign({}, signer), { addListener: signer.addListener, emit: signer.emit, eventNames: signer.eventNames, listenerCount: signer.listenerCount, listeners: signer.listeners, off: signer.off, on: signer.on, once: signer.once, removeAllListeners: signer.removeAllListeners, removeListener: signer.removeListener, signAllTransactions: (transactions) => _tslib.__awaiter(this, void 0, void 0, function* () {
31
+ return utils.cloneObjectWithOverrides(signer, {
32
+ signAllTransactions: (transactions) => _tslib.__awaiter(this, void 0, void 0, function* () {
31
33
  yield this.sync();
32
34
  return signer.signAllTransactions(transactions);
33
- }), signAndSendTransaction: (transaction, ...args) => _tslib.__awaiter(this, void 0, void 0, function* () {
35
+ }),
36
+ signAndSendTransaction: (transaction, ...args) => _tslib.__awaiter(this, void 0, void 0, function* () {
34
37
  yield this.sync();
35
38
  return signer.signAndSendTransaction(transaction, ...args);
36
- }), signMessage: (message, ...args) => _tslib.__awaiter(this, void 0, void 0, function* () {
39
+ }),
40
+ signMessage: (message, ...args) => _tslib.__awaiter(this, void 0, void 0, function* () {
37
41
  yield this.sync();
38
42
  return signer.signMessage(message, ...args);
39
- }), signTransaction: (transaction) => _tslib.__awaiter(this, void 0, void 0, function* () {
43
+ }),
44
+ signTransaction: (transaction) => _tslib.__awaiter(this, void 0, void 0, function* () {
40
45
  yield this.sync();
41
46
  return signer.signTransaction(transaction);
42
- }) });
47
+ }),
48
+ });
43
49
  });
44
50
  }
45
51
  }
@@ -1,6 +1,7 @@
1
1
  'use client'
2
2
  import { __awaiter } from '../../_virtual/_tslib.js';
3
3
  import { Wallet } from '@dynamic-labs/wallet-connector-core';
4
+ import { cloneObjectWithOverrides } from '@dynamic-labs/utils';
4
5
 
5
6
  class SolanaWallet extends Wallet {
6
7
  /**
@@ -23,19 +24,24 @@ class SolanaWallet extends Wallet {
23
24
  if (!signer) {
24
25
  throw new Error('unable to retrieve Solana signer');
25
26
  }
26
- return Object.assign(Object.assign({}, signer), { addListener: signer.addListener, emit: signer.emit, eventNames: signer.eventNames, listenerCount: signer.listenerCount, listeners: signer.listeners, off: signer.off, on: signer.on, once: signer.once, removeAllListeners: signer.removeAllListeners, removeListener: signer.removeListener, signAllTransactions: (transactions) => __awaiter(this, void 0, void 0, function* () {
27
+ return cloneObjectWithOverrides(signer, {
28
+ signAllTransactions: (transactions) => __awaiter(this, void 0, void 0, function* () {
27
29
  yield this.sync();
28
30
  return signer.signAllTransactions(transactions);
29
- }), signAndSendTransaction: (transaction, ...args) => __awaiter(this, void 0, void 0, function* () {
31
+ }),
32
+ signAndSendTransaction: (transaction, ...args) => __awaiter(this, void 0, void 0, function* () {
30
33
  yield this.sync();
31
34
  return signer.signAndSendTransaction(transaction, ...args);
32
- }), signMessage: (message, ...args) => __awaiter(this, void 0, void 0, function* () {
35
+ }),
36
+ signMessage: (message, ...args) => __awaiter(this, void 0, void 0, function* () {
33
37
  yield this.sync();
34
38
  return signer.signMessage(message, ...args);
35
- }), signTransaction: (transaction) => __awaiter(this, void 0, void 0, function* () {
39
+ }),
40
+ signTransaction: (transaction) => __awaiter(this, void 0, void 0, function* () {
36
41
  yield this.sync();
37
42
  return signer.signTransaction(transaction);
38
- }) });
43
+ }),
44
+ });
39
45
  });
40
46
  }
41
47
  }
@@ -1,2 +1,3 @@
1
1
  export * from './SolanaWallet';
2
2
  export * from './isSolanaWallet';
3
+ export * from './isLedgerSolanaWallet';
@@ -0,0 +1 @@
1
+ export { isLedgerSolanaWallet } from './isLedgerSolanaWallet';
@@ -0,0 +1,16 @@
1
+ 'use client'
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
7
+ var isSolanaWallet = require('../isSolanaWallet/isSolanaWallet.cjs');
8
+
9
+ /**
10
+ * Checks if wallet is a Solana wallet and it was marked as a Ledger wallet
11
+ */
12
+ const isLedgerSolanaWallet = (wallet) => isSolanaWallet.isSolanaWallet(wallet) &&
13
+ walletConnectorCore.isHardwareWalletConnector(wallet.connector) &&
14
+ wallet.connector.isHardwareWalletEnabled;
15
+
16
+ exports.isLedgerSolanaWallet = isLedgerSolanaWallet;
@@ -0,0 +1,5 @@
1
+ import { Wallet } from '@dynamic-labs/wallet-connector-core';
2
+ /**
3
+ * Checks if wallet is a Solana wallet and it was marked as a Ledger wallet
4
+ */
5
+ export declare const isLedgerSolanaWallet: (wallet: Wallet) => boolean;
@@ -0,0 +1,12 @@
1
+ 'use client'
2
+ import { isHardwareWalletConnector } from '@dynamic-labs/wallet-connector-core';
3
+ import { isSolanaWallet } from '../isSolanaWallet/isSolanaWallet.js';
4
+
5
+ /**
6
+ * Checks if wallet is a Solana wallet and it was marked as a Ledger wallet
7
+ */
8
+ const isLedgerSolanaWallet = (wallet) => isSolanaWallet(wallet) &&
9
+ isHardwareWalletConnector(wallet.connector) &&
10
+ wallet.connector.isHardwareWalletEnabled;
11
+
12
+ export { isLedgerSolanaWallet };