@dynamic-labs/solana 2.0.2 → 2.1.0-alpha.1

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.
Files changed (38) hide show
  1. package/CHANGELOG.md +14 -12
  2. package/_virtual/_tslib.cjs +1 -0
  3. package/_virtual/_tslib.js +1 -0
  4. package/package.json +9 -9
  5. package/src/CoinbaseSolana.cjs +1 -0
  6. package/src/CoinbaseSolana.js +1 -0
  7. package/src/Phantom.cjs +1 -0
  8. package/src/Phantom.js +1 -0
  9. package/src/Solflare.cjs +1 -0
  10. package/src/Solflare.js +1 -0
  11. package/src/errors/SignMessageNotSupportedError.cjs +1 -0
  12. package/src/errors/SignMessageNotSupportedError.js +1 -0
  13. package/src/index.cjs +1 -0
  14. package/src/index.js +1 -0
  15. package/src/injected/BackpackSol.cjs +1 -0
  16. package/src/injected/BackpackSol.js +1 -0
  17. package/src/injected/InjectedWalletBase.cjs +1 -0
  18. package/src/injected/InjectedWalletBase.js +1 -0
  19. package/src/injected/PhantomInjected.cjs +1 -0
  20. package/src/injected/PhantomInjected.js +1 -0
  21. package/src/injected/fetchInjectedWalletConnectors.cjs +1 -0
  22. package/src/injected/fetchInjectedWalletConnectors.js +1 -0
  23. package/src/phantomRedirect/PhantomRedirect.cjs +1 -0
  24. package/src/phantomRedirect/PhantomRedirect.js +1 -0
  25. package/src/phantomRedirect/storage.cjs +1 -0
  26. package/src/phantomRedirect/storage.js +1 -0
  27. package/src/phantomRedirect/utils.cjs +1 -0
  28. package/src/phantomRedirect/utils.js +1 -0
  29. package/src/solProviderHelper.cjs +1 -0
  30. package/src/solProviderHelper.js +1 -0
  31. package/src/solWalletConnector.cjs +2 -4
  32. package/src/solWalletConnector.js +3 -5
  33. package/src/utils/extractNonce.cjs +1 -0
  34. package/src/utils/extractNonce.js +1 -0
  35. package/src/utils/isBackpackSolanaSigner.cjs +1 -0
  36. package/src/utils/isBackpackSolanaSigner.js +1 -0
  37. package/src/utils/isSignedMessage.cjs +1 -0
  38. package/src/utils/isSignedMessage.js +1 -0
package/CHANGELOG.md CHANGED
@@ -1,24 +1,26 @@
1
1
 
2
- ### [2.0.2](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.1...v2.0.2) (2024-04-19)
3
-
4
-
5
- ### Bug Fixes
6
-
7
- * buffer polyfill for utils package ([#5404](https://github.com/dynamic-labs/DynamicAuth/issues/5404)) ([#5405](https://github.com/dynamic-labs/DynamicAuth/issues/5405)) ([679c197](https://github.com/dynamic-labs/DynamicAuth/commit/679c197a52969a0db614ed280d7b9a0bf172bf72))
8
-
9
- ### [2.0.1](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0...v2.0.1) (2024-04-18)
2
+ ## [2.1.0-alpha.1](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.0-alpha.0...v2.1.0-alpha.1) (2024-04-18)
10
3
 
11
4
 
12
5
  ### Features
13
6
 
14
- * add redirectUri to farcaster connect ([#5373](https://github.com/dynamic-labs/DynamicAuth/issues/5373)) ([#5383](https://github.com/dynamic-labs/DynamicAuth/issues/5383)) ([d031d7e](https://github.com/dynamic-labs/DynamicAuth/commit/d031d7ee5705de5ec83ef328f03633d5f3524786))
7
+ * add frame metadata to demo index page ([#5327](https://github.com/dynamic-labs/DynamicAuth/issues/5327)) ([34a071a](https://github.com/dynamic-labs/DynamicAuth/commit/34a071af8faa8a867ad747ec2a607056a883568d))
8
+ * add MfaChooseDeviceView and MfaSecureDeviceView ([#5343](https://github.com/dynamic-labs/DynamicAuth/issues/5343)) ([4c39b1c](https://github.com/dynamic-labs/DynamicAuth/commit/4c39b1c34b5091190b095770e95a733c8f458ca2)), closes [#5356](https://github.com/dynamic-labs/DynamicAuth/issues/5356)
9
+ * add redirectUri to farcaster connect ([#5373](https://github.com/dynamic-labs/DynamicAuth/issues/5373)) ([ed13fc2](https://github.com/dynamic-labs/DynamicAuth/commit/ed13fc2948e06df0017ac122db54aca44f264a6d))
10
+ * add useMfa hook ([#5337](https://github.com/dynamic-labs/DynamicAuth/issues/5337)) ([a7682ba](https://github.com/dynamic-labs/DynamicAuth/commit/a7682ba10fd0f0809af802e0172154726f1bd857))
11
+ * headless create session and is session active ([#5346](https://github.com/dynamic-labs/DynamicAuth/issues/5346)) ([a787bbc](https://github.com/dynamic-labs/DynamicAuth/commit/a787bbcbb44104d2d0bd263579bd87a78453681d))
12
+ * secure enclave wallet generate one-time code headless ([#5329](https://github.com/dynamic-labs/DynamicAuth/issues/5329)) ([cab80a2](https://github.com/dynamic-labs/DynamicAuth/commit/cab80a2bfa77e48263d47cdcb813c54ef5b831d5))
15
13
 
16
14
 
17
15
  ### Bug Fixes
18
16
 
19
- * copy and ui fixes ([#5367](https://github.com/dynamic-labs/DynamicAuth/issues/5367)) ([e39ea97](https://github.com/dynamic-labs/DynamicAuth/commit/e39ea97d98de6b7087c24f2326a5fdc07ab9c8c3))
20
- * bitcoin connector improvements
21
- * solana package improvements ([#5360](https://github.com/dynamic-labs/DynamicAuth/issues/5360)) ([#5385](https://github.com/dynamic-labs/DynamicAuth/issues/5385)) ([9010bce](https://github.com/dynamic-labs/DynamicAuth/commit/9010bcebb4b0f2d293d517347187d38accbac0d3))
17
+ * always stringify the message before signing a message using walletUiUtils ([#5325](https://github.com/dynamic-labs/DynamicAuth/issues/5325)) ([7abf094](https://github.com/dynamic-labs/DynamicAuth/commit/7abf09456e30ad0657892e9ba58d7391f0f430e6))
18
+ * bitcoin network connector sendBitcoin methods updates ([#5369](https://github.com/dynamic-labs/DynamicAuth/issues/5369)) ([e9bf444](https://github.com/dynamic-labs/DynamicAuth/commit/e9bf444122ee86030d85b84ede96bdfb9772425e))
19
+ * buffer missing when using buffer util function ([#5360](https://github.com/dynamic-labs/DynamicAuth/issues/5360)) ([e998e46](https://github.com/dynamic-labs/DynamicAuth/commit/e998e464bd2671a82aa271b407a7d8fc49a16bd0))
20
+ * embedded solana send transaction shouldn't sign a signed transaction ([#5357](https://github.com/dynamic-labs/DynamicAuth/issues/5357)) ([c2ae2fa](https://github.com/dynamic-labs/DynamicAuth/commit/c2ae2faa509b62fc5ceb345fbc0f0b47217bf4b0))
21
+ * use network.name if vanity name is missing ([#5338](https://github.com/dynamic-labs/DynamicAuth/issues/5338)) ([34ec2ae](https://github.com/dynamic-labs/DynamicAuth/commit/34ec2ae5c4dad5376a3b9c5a07221f68a2f7756c))
22
+
23
+ ## [2.1.0-alpha.0](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.32...v2.1.0-alpha.0) (2024-04-15)
22
24
 
23
25
  ## [2.0.0-alpha.32](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.31...v2.0.0-alpha.32) (2024-04-15)
24
26
 
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  /******************************************************************************
2
3
  Copyright (c) Microsoft Corporation.
3
4
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/solana",
3
- "version": "2.0.2",
3
+ "version": "2.1.0-alpha.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/dynamic-labs/DynamicAuth.git",
@@ -27,16 +27,16 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@solana/web3.js": "1.91.6",
30
- "@dynamic-labs/sdk-api-core": "0.0.418",
30
+ "@dynamic-labs/sdk-api-core": "0.0.422",
31
31
  "bs58": "5.0.0",
32
32
  "tweetnacl": "1.0.3",
33
- "@dynamic-labs/rpc-provider-solana": "2.0.2",
34
- "@dynamic-labs/rpc-providers": "2.0.2",
35
- "@dynamic-labs/turnkey": "2.0.2",
36
- "@dynamic-labs/types": "2.0.2",
37
- "@dynamic-labs/utils": "2.0.2",
38
- "@dynamic-labs/wallet-book": "2.0.2",
39
- "@dynamic-labs/wallet-connector-core": "2.0.2",
33
+ "@dynamic-labs/rpc-provider-solana": "2.1.0-alpha.1",
34
+ "@dynamic-labs/rpc-providers": "2.1.0-alpha.1",
35
+ "@dynamic-labs/turnkey": "2.1.0-alpha.1",
36
+ "@dynamic-labs/types": "2.1.0-alpha.1",
37
+ "@dynamic-labs/utils": "2.1.0-alpha.1",
38
+ "@dynamic-labs/wallet-book": "2.1.0-alpha.1",
39
+ "@dynamic-labs/wallet-connector-core": "2.1.0-alpha.1",
40
40
  "eventemitter3": "5.0.1"
41
41
  },
42
42
  "peerDependencies": {}
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  import { __awaiter } from '../_virtual/_tslib.js';
2
3
  import { bufferToBase64 } from '@dynamic-labs/utils';
3
4
  import { findWalletBookWallet } from '@dynamic-labs/wallet-book';
package/src/Phantom.cjs CHANGED
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
package/src/Phantom.js CHANGED
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  import { __awaiter } from '../_virtual/_tslib.js';
2
3
  import { findWalletBookWallet } from '@dynamic-labs/wallet-book';
3
4
  import { isMobile } from '@dynamic-labs/utils';
package/src/Solflare.cjs CHANGED
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
package/src/Solflare.js CHANGED
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  import { __awaiter } from '../_virtual/_tslib.js';
2
3
  import { isMobile, handleMobileWalletRedirect, bufferToBase64 } from '@dynamic-labs/utils';
3
4
  import { findWalletBookWallet } from '@dynamic-labs/wallet-book';
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  import { NotSupportedError } from '@dynamic-labs/utils';
2
3
 
3
4
  class SignMessageNotSupportedError extends NotSupportedError {
package/src/index.cjs CHANGED
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
package/src/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  import { TurnkeySolanaWalletConnectors } from '@dynamic-labs/turnkey';
2
3
  import { Phantom } from './Phantom.js';
3
4
  import { injectedWalletOverrides, fetchInjectedWalletConnectors } from './injected/fetchInjectedWalletConnectors.js';
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  import { __awaiter } from '../../_virtual/_tslib.js';
2
3
  import { bufferToBase64 } from '@dynamic-labs/utils';
3
4
  import { findWalletBookWallet } from '@dynamic-labs/wallet-book';
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  import { __awaiter } from '../../_virtual/_tslib.js';
2
3
  import { findWalletBookWallet } from '@dynamic-labs/wallet-book';
3
4
  import { SolProviderHelper } from '../solProviderHelper.js';
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  import { __awaiter } from '../../_virtual/_tslib.js';
2
3
  import { isMobile, handleMobileWalletRedirect } from '@dynamic-labs/utils';
3
4
  import { findWalletBookWallet } from '@dynamic-labs/wallet-book';
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  import { CoinbaseSolana } from '../CoinbaseSolana.js';
2
3
  import { Solflare } from '../Solflare.js';
3
4
  import { InjectedWalletBase } from './InjectedWalletBase.js';
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  import { __awaiter } from '../../_virtual/_tslib.js';
2
3
  import nacl from 'tweetnacl';
3
4
  import bs58 from 'bs58';
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  const storage = {
2
3
  address: {
3
4
  get: () => { var _a; return (_a = localStorage.getItem('dynamic_phantom_wallet_address')) !== null && _a !== void 0 ? _a : undefined; },
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  import { __awaiter } from '../../_virtual/_tslib.js';
2
3
  import nacl from 'tweetnacl';
3
4
  import bs58 from 'bs58';
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  import { __awaiter } from '../_virtual/_tslib.js';
2
3
  import { getProvidersFromWindow, bufferToBase64 } from '@dynamic-labs/utils';
3
4
  import { ProviderLookup } from '@dynamic-labs/wallet-connector-core';
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -152,10 +153,7 @@ class SolWalletConnector extends walletConnectorCore.WalletConnectorBase {
152
153
  this.verifiedCredentials = verifiedCredentials;
153
154
  }
154
155
  isLedgerAddress(address) {
155
- const ledgerWallets = this.verifiedCredentials
156
- .filter((v) => { var _a; return ((_a = v.walletProperties) === null || _a === void 0 ? void 0 : _a.hardwareWallet) === 'ledger'; })
157
- .map((v) => v.address);
158
- return ledgerWallets.includes(address);
156
+ return utils.isLedgerAddressViaVerifiedCredentials(address, this.verifiedCredentials);
159
157
  }
160
158
  }
161
159
 
@@ -1,7 +1,8 @@
1
+ 'use client'
1
2
  import { __awaiter } from '../_virtual/_tslib.js';
2
3
  import { PublicKey, Connection, Transaction, TransactionInstruction } from '@solana/web3.js';
3
4
  import { WalletConnectorBase } from '@dynamic-labs/wallet-connector-core';
4
- import { DynamicError, NotSupportedError } from '@dynamic-labs/utils';
5
+ import { DynamicError, NotSupportedError, isLedgerAddressViaVerifiedCredentials } from '@dynamic-labs/utils';
5
6
  import { findWalletBookWallet } from '@dynamic-labs/wallet-book';
6
7
  import { extractNonce } from './utils/extractNonce.js';
7
8
 
@@ -148,10 +149,7 @@ class SolWalletConnector extends WalletConnectorBase {
148
149
  this.verifiedCredentials = verifiedCredentials;
149
150
  }
150
151
  isLedgerAddress(address) {
151
- const ledgerWallets = this.verifiedCredentials
152
- .filter((v) => { var _a; return ((_a = v.walletProperties) === null || _a === void 0 ? void 0 : _a.hardwareWallet) === 'ledger'; })
153
- .map((v) => v.address);
154
- return ledgerWallets.includes(address);
152
+ return isLedgerAddressViaVerifiedCredentials(address, this.verifiedCredentials);
155
153
  }
156
154
  }
157
155
 
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  const extractNonce = (messageToSign) => {
2
3
  const regex = messageToSign.match(/Nonce: (.*)/);
3
4
  if (regex && regex.length === 2) {
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  const isBackpackSolanaSigner = (signer) => Boolean(signer) && signer.send !== undefined;
2
3
 
3
4
  export { isBackpackSolanaSigner };
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  const isSignedMessage = (message) => Boolean(message) && message.signature !== undefined;
2
3
 
3
4
  export { isSignedMessage };