@dynamic-labs/solana 2.1.2-alpha.0 → 2.1.2

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
+ ### [2.1.2](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.2-alpha.1...v2.1.2) (2024-06-10)
3
+
4
+
5
+ ### Features
6
+
7
+ * hide wallets from wallet list that can't have multiple accounts linked ([#5935](https://github.com/dynamic-labs/DynamicAuth/issues/5935)) ([20f9b15](https://github.com/dynamic-labs/DynamicAuth/commit/20f9b15b145cbc57519155691b3640149eec3689))
8
+
9
+
10
+ ### Bug Fixes
11
+
12
+ * ensure sign message will not show 2 times ([#5938](https://github.com/dynamic-labs/DynamicAuth/issues/5938)) ([#5941](https://github.com/dynamic-labs/DynamicAuth/issues/5941)) ([2c5a156](https://github.com/dynamic-labs/DynamicAuth/commit/2c5a156ead565bd25067b3bc2b23cbc704f9b314))
13
+ * improve logic related to embedded wallets and emailVerifcation ([#5947](https://github.com/dynamic-labs/DynamicAuth/issues/5947)) ([b885a14](https://github.com/dynamic-labs/DynamicAuth/commit/b885a14dcf200f05233e4ab42b8b518d877d291a))
14
+ * init coinbase provider adhoc ([#5907](https://github.com/dynamic-labs/DynamicAuth/issues/5907)) ([#5933](https://github.com/dynamic-labs/DynamicAuth/issues/5933)) ([2fa1f52](https://github.com/dynamic-labs/DynamicAuth/commit/2fa1f528b27113ee108252ee874ee7f5ead88329))
15
+ * remove force consent and account selection even for returning google users ([#5912](https://github.com/dynamic-labs/DynamicAuth/issues/5912)) ([26a07f2](https://github.com/dynamic-labs/DynamicAuth/commit/26a07f29bdb8bf32a080396906a21d8b084c202f))
16
+ * resolve the default phone country based on enabled countries ([#5](https://github.com/dynamic-labs/DynamicAuth/issues/5)… ([#5916](https://github.com/dynamic-labs/DynamicAuth/issues/5916)) ([8f27c00](https://github.com/dynamic-labs/DynamicAuth/commit/8f27c0082edb77b964b8402cfa75c6a896b061d3)), closes [#5910](https://github.com/dynamic-labs/DynamicAuth/issues/5910)
17
+ * versioned tx needs address lookup table ([#5909](https://github.com/dynamic-labs/DynamicAuth/issues/5909)) ([#5919](https://github.com/dynamic-labs/DynamicAuth/issues/5919)) ([22e3ca2](https://github.com/dynamic-labs/DynamicAuth/commit/22e3ca2d0b27d15efb50e3092a7bc3a0c0d255a5))
18
+
19
+ ### [2.1.2-alpha.1](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.2-alpha.0...v2.1.2-alpha.1) (2024-06-07)
20
+
21
+
22
+ ### Bug Fixes
23
+
24
+ * find phantom solana provider when opening dapp on new tab ([#5902](https://github.com/dynamic-labs/DynamicAuth/issues/5902)) ([99daf87](https://github.com/dynamic-labs/DynamicAuth/commit/99daf87f17caed870a76e4f89a257a14da37c7ab)), closes [#5895](https://github.com/dynamic-labs/DynamicAuth/issues/5895) [#5896](https://github.com/dynamic-labs/DynamicAuth/issues/5896) [#5897](https://github.com/dynamic-labs/DynamicAuth/issues/5897)
25
+
2
26
  ### [2.1.2-alpha.0](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.1...v2.1.2-alpha.0) (2024-06-07)
3
27
 
4
28
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/solana",
3
- "version": "2.1.2-alpha.0",
3
+ "version": "2.1.2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/dynamic-labs/dynamic-auth.git",
@@ -34,13 +34,13 @@
34
34
  "@wallet-standard/experimental-features": "0.1.1",
35
35
  "bs58": "5.0.0",
36
36
  "tweetnacl": "1.0.3",
37
- "@dynamic-labs/rpc-provider-solana": "2.1.2-alpha.0",
38
- "@dynamic-labs/rpc-providers": "2.1.2-alpha.0",
39
- "@dynamic-labs/turnkey": "2.1.2-alpha.0",
40
- "@dynamic-labs/types": "2.1.2-alpha.0",
41
- "@dynamic-labs/utils": "2.1.2-alpha.0",
42
- "@dynamic-labs/wallet-book": "2.1.2-alpha.0",
43
- "@dynamic-labs/wallet-connector-core": "2.1.2-alpha.0",
37
+ "@dynamic-labs/rpc-provider-solana": "2.1.2",
38
+ "@dynamic-labs/rpc-providers": "2.1.2",
39
+ "@dynamic-labs/turnkey": "2.1.2",
40
+ "@dynamic-labs/types": "2.1.2",
41
+ "@dynamic-labs/utils": "2.1.2",
42
+ "@dynamic-labs/wallet-book": "2.1.2",
43
+ "@dynamic-labs/wallet-connector-core": "2.1.2",
44
44
  "eventemitter3": "5.0.1"
45
45
  },
46
46
  "peerDependencies": {}
@@ -7,6 +7,7 @@ var _tslib = require('../_virtual/_tslib.cjs');
7
7
  var utils = require('@dynamic-labs/utils');
8
8
  var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
9
9
  var isSignedMessage = require('./utils/isSignedMessage.cjs');
10
+ var findWalletProviderFromWalletStandard = require('./utils/findWalletProviderFromWalletStandard/findWalletProviderFromWalletStandard.cjs');
10
11
 
11
12
  class SolProviderHelper {
12
13
  constructor(wallet) {
@@ -26,6 +27,7 @@ class SolProviderHelper {
26
27
  return this.installedProviderLookup(config.extensionLocators);
27
28
  }
28
29
  installedProviders() {
30
+ var _a, _b;
29
31
  const config = this.getInjectedConfig();
30
32
  if (!config)
31
33
  return [];
@@ -48,6 +50,12 @@ class SolProviderHelper {
48
50
  window.solana.providers.forEach((provider) => providers.push(provider));
49
51
  }
50
52
  }
53
+ if (((_b = (_a = config.walletStandardLocators) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) > 0) {
54
+ const walletStandardProvider = findWalletProviderFromWalletStandard.findWalletProviderFromWalletStandard(config);
55
+ if (walletStandardProvider) {
56
+ providers.push(walletStandardProvider);
57
+ }
58
+ }
51
59
  return providers;
52
60
  }
53
61
  installedProviderLookup(extensionLocators) {
@@ -15,6 +15,10 @@ export declare class SolProviderHelper {
15
15
  features: string[];
16
16
  name: string;
17
17
  } | undefined;
18
+ walletStandardLocators?: {
19
+ name: string;
20
+ locator: string;
21
+ }[] | undefined;
18
22
  windowLocations?: string[] | undefined;
19
23
  } | undefined;
20
24
  getInstalledProvider(): ISolana | undefined;
@@ -3,6 +3,7 @@ import { __awaiter } from '../_virtual/_tslib.js';
3
3
  import { getProvidersFromWindow, bufferToBase64 } from '@dynamic-labs/utils';
4
4
  import { ProviderLookup } from '@dynamic-labs/wallet-connector-core';
5
5
  import { isSignedMessage } from './utils/isSignedMessage.js';
6
+ import { findWalletProviderFromWalletStandard } from './utils/findWalletProviderFromWalletStandard/findWalletProviderFromWalletStandard.js';
6
7
 
7
8
  class SolProviderHelper {
8
9
  constructor(wallet) {
@@ -22,6 +23,7 @@ class SolProviderHelper {
22
23
  return this.installedProviderLookup(config.extensionLocators);
23
24
  }
24
25
  installedProviders() {
26
+ var _a, _b;
25
27
  const config = this.getInjectedConfig();
26
28
  if (!config)
27
29
  return [];
@@ -44,6 +46,12 @@ class SolProviderHelper {
44
46
  window.solana.providers.forEach((provider) => providers.push(provider));
45
47
  }
46
48
  }
49
+ if (((_b = (_a = config.walletStandardLocators) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) > 0) {
50
+ const walletStandardProvider = findWalletProviderFromWalletStandard(config);
51
+ if (walletStandardProvider) {
52
+ providers.push(walletStandardProvider);
53
+ }
54
+ }
47
55
  return providers;
48
56
  }
49
57
  installedProviderLookup(extensionLocators) {
@@ -0,0 +1,29 @@
1
+ 'use client'
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ var app = require('@wallet-standard/app');
7
+ var utils = require('@dynamic-labs/utils');
8
+
9
+ const findWalletProviderFromWalletStandard = (injectConfig) => {
10
+ const { walletStandardLocators } = injectConfig;
11
+ if (!walletStandardLocators || walletStandardLocators.length === 0) {
12
+ return undefined;
13
+ }
14
+ const wallets = app.getWallets().get();
15
+ return walletStandardLocators.reduce((provider, walletStandardLocator) => {
16
+ /**
17
+ * Return early if the provider is already found
18
+ */
19
+ if (provider) {
20
+ return provider;
21
+ }
22
+ const wallet = wallets.find((w) => w.name === walletStandardLocator.name);
23
+ if (!wallet)
24
+ return undefined;
25
+ return utils.get(wallet, walletStandardLocator.locator);
26
+ }, undefined);
27
+ };
28
+
29
+ exports.findWalletProviderFromWalletStandard = findWalletProviderFromWalletStandard;
@@ -0,0 +1,3 @@
1
+ import { WalletSchema } from '@dynamic-labs/wallet-book';
2
+ import { ISolana } from '../../types';
3
+ export declare const findWalletProviderFromWalletStandard: (injectConfig: NonNullable<WalletSchema['injectedConfig']>[number]) => ISolana | undefined;
@@ -0,0 +1,25 @@
1
+ 'use client'
2
+ import { getWallets } from '@wallet-standard/app';
3
+ import { get } from '@dynamic-labs/utils';
4
+
5
+ const findWalletProviderFromWalletStandard = (injectConfig) => {
6
+ const { walletStandardLocators } = injectConfig;
7
+ if (!walletStandardLocators || walletStandardLocators.length === 0) {
8
+ return undefined;
9
+ }
10
+ const wallets = getWallets().get();
11
+ return walletStandardLocators.reduce((provider, walletStandardLocator) => {
12
+ /**
13
+ * Return early if the provider is already found
14
+ */
15
+ if (provider) {
16
+ return provider;
17
+ }
18
+ const wallet = wallets.find((w) => w.name === walletStandardLocator.name);
19
+ if (!wallet)
20
+ return undefined;
21
+ return get(wallet, walletStandardLocator.locator);
22
+ }, undefined);
23
+ };
24
+
25
+ export { findWalletProviderFromWalletStandard };
@@ -0,0 +1 @@
1
+ export { findWalletProviderFromWalletStandard } from './findWalletProviderFromWalletStandard';