@dynamic-labs/solana 1.0.3 → 1.0.5

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,22 @@
1
1
 
2
+ ### [1.0.5](https://github.com/dynamic-labs/DynamicAuth/compare/v1.0.4...v1.0.5) (2024-01-10)
3
+
4
+
5
+ ### Bug Fixes
6
+
7
+ * trigger onAuthSuccess before embedded wallet creation ([eff7166](https://github.com/dynamic-labs/DynamicAuth/commit/eff7166902e851e726d5ee7a6bf51f9a9a85dba1))
8
+ * turnkeyWalletConnector is not an email otp connector and uses dynamic otp ([#4314](https://github.com/dynamic-labs/DynamicAuth/issues/4314)) ([446b536](https://github.com/dynamic-labs/DynamicAuth/commit/446b536c83ab2ff9d2bc727047dd2ff2601fa2a6))
9
+
10
+ ### [1.0.4](https://github.com/dynamic-labs/DynamicAuth/compare/v1.0.3...v1.0.4) (2024-01-04)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * edge case with unlinking wallet ([#4285](https://github.com/dynamic-labs/DynamicAuth/issues/4285)) ([#4293](https://github.com/dynamic-labs/DynamicAuth/issues/4293)) ([85eb4ea](https://github.com/dynamic-labs/DynamicAuth/commit/85eb4ea0fa4521d37ee3901dbb1fa6d88a8cf8f7))
16
+ * phantom solana not connecting on mobile ([#4287](https://github.com/dynamic-labs/DynamicAuth/issues/4287)) ([0d85e24](https://github.com/dynamic-labs/DynamicAuth/commit/0d85e2429f2dc0a92c293cf57dc0e241c4b948be))
17
+ * prevent error message when mobile wallet app is open ([#4301](https://github.com/dynamic-labs/DynamicAuth/issues/4301)) ([#4303](https://github.com/dynamic-labs/DynamicAuth/issues/4303)) ([0ba145e](https://github.com/dynamic-labs/DynamicAuth/commit/0ba145e6d1145fecc3e7bc2e60d127106be9aa54))
18
+ * **useFetchBalance:** ensure the latest wallet balance is fetched ([#4288](https://github.com/dynamic-labs/DynamicAuth/issues/4288)) ([#4294](https://github.com/dynamic-labs/DynamicAuth/issues/4294)) ([3fa0d60](https://github.com/dynamic-labs/DynamicAuth/commit/3fa0d60552082dffd032317368d20b87cdab9c6d))
19
+
2
20
  ### [1.0.3](https://github.com/dynamic-labs/DynamicAuth/compare/v1.0.2...v1.0.3) (2023-12-28)
3
21
 
4
22
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/solana",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/dynamic-labs/DynamicAuth.git",
@@ -27,11 +27,11 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@solana/web3.js": "1.70.1",
30
- "@dynamic-labs/rpc-providers": "1.0.3",
31
- "@dynamic-labs/types": "1.0.3",
32
- "@dynamic-labs/utils": "1.0.3",
33
- "@dynamic-labs/wallet-book": "1.0.3",
34
- "@dynamic-labs/wallet-connector-core": "1.0.3",
30
+ "@dynamic-labs/rpc-providers": "1.0.5",
31
+ "@dynamic-labs/types": "1.0.5",
32
+ "@dynamic-labs/utils": "1.0.5",
33
+ "@dynamic-labs/wallet-book": "1.0.5",
34
+ "@dynamic-labs/wallet-connector-core": "1.0.5",
35
35
  "eventemitter3": "5.0.1"
36
36
  },
37
37
  "peerDependencies": {}
package/src/Solflare.cjs CHANGED
@@ -22,14 +22,10 @@ class Solflare extends solWalletConnector.SolWalletConnector {
22
22
  * this checks if it is not in the in-app browser by checking if the provider is not available.
23
23
  */
24
24
  if (utils.isMobile() && !this.isInstalledOnBrowser()) {
25
- const url = encodeURIComponent(window.location.toString());
26
- const ref = encodeURIComponent(window.location.origin);
27
- if (utils.isSamsungBrowser()) {
28
- window.location.assign(`solflare://ul/v1/browse/${url}?ref=${ref}`);
29
- }
30
- else {
31
- window.location.assign(`https://solflare.com/ul/v1/browse/${url}?ref=${ref}`);
32
- }
25
+ utils.handleMobileWalletRedirect({
26
+ nativeLink: 'solflare://ul/v1/browse',
27
+ universalLink: 'https://solflare.com/ul/v1/browse',
28
+ });
33
29
  return;
34
30
  }
35
31
  return solProviderHelper.SolProviderHelper.fetchPublicAddressWithName(this.name);
package/src/Solflare.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { __awaiter } from '../_virtual/_tslib.js';
2
- import { isMobile, isSamsungBrowser, bufferToBase64 } from '@dynamic-labs/utils';
2
+ import { isMobile, handleMobileWalletRedirect, bufferToBase64 } from '@dynamic-labs/utils';
3
3
  import { SolWalletConnector } from './solWalletConnector.js';
4
4
  import { SolProviderHelper } from './solProviderHelper.js';
5
5
 
@@ -18,14 +18,10 @@ class Solflare extends SolWalletConnector {
18
18
  * this checks if it is not in the in-app browser by checking if the provider is not available.
19
19
  */
20
20
  if (isMobile() && !this.isInstalledOnBrowser()) {
21
- const url = encodeURIComponent(window.location.toString());
22
- const ref = encodeURIComponent(window.location.origin);
23
- if (isSamsungBrowser()) {
24
- window.location.assign(`solflare://ul/v1/browse/${url}?ref=${ref}`);
25
- }
26
- else {
27
- window.location.assign(`https://solflare.com/ul/v1/browse/${url}?ref=${ref}`);
28
- }
21
+ handleMobileWalletRedirect({
22
+ nativeLink: 'solflare://ul/v1/browse',
23
+ universalLink: 'https://solflare.com/ul/v1/browse',
24
+ });
29
25
  return;
30
26
  }
31
27
  return SolProviderHelper.fetchPublicAddressWithName(this.name);
@@ -2,6 +2,8 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
+ var _tslib = require('../../_virtual/_tslib.cjs');
6
+ var utils = require('@dynamic-labs/utils');
5
7
  var InjectedWalletBase = require('./InjectedWalletBase.cjs');
6
8
 
7
9
  class Phantom extends InjectedWalletBase.InjectedWalletBase {
@@ -9,6 +11,23 @@ class Phantom extends InjectedWalletBase.InjectedWalletBase {
9
11
  super(...arguments);
10
12
  this.name = 'Phantom';
11
13
  }
14
+ fetchPublicAddress() {
15
+ const _super = Object.create(null, {
16
+ fetchPublicAddress: { get: () => super.fetchPublicAddress }
17
+ });
18
+ return _tslib.__awaiter(this, void 0, void 0, function* () {
19
+ if (this.isInstalledOnBrowser()) {
20
+ return _super.fetchPublicAddress.call(this);
21
+ }
22
+ if (utils.isMobile()) {
23
+ utils.handleMobileWalletRedirect({
24
+ nativeLink: 'phantom://browse',
25
+ universalLink: 'https://phantom.app/ul/browse',
26
+ });
27
+ }
28
+ return undefined;
29
+ });
30
+ }
12
31
  }
13
32
 
14
33
  exports.Phantom = Phantom;
@@ -1,4 +1,5 @@
1
1
  import { InjectedWalletBase } from './InjectedWalletBase';
2
2
  export declare class Phantom extends InjectedWalletBase {
3
3
  name: string;
4
+ fetchPublicAddress(): Promise<string | undefined>;
4
5
  }
@@ -1,3 +1,5 @@
1
+ import { __awaiter } from '../../_virtual/_tslib.js';
2
+ import { isMobile, handleMobileWalletRedirect } from '@dynamic-labs/utils';
1
3
  import { InjectedWalletBase } from './InjectedWalletBase.js';
2
4
 
3
5
  class Phantom extends InjectedWalletBase {
@@ -5,6 +7,23 @@ class Phantom extends InjectedWalletBase {
5
7
  super(...arguments);
6
8
  this.name = 'Phantom';
7
9
  }
10
+ fetchPublicAddress() {
11
+ const _super = Object.create(null, {
12
+ fetchPublicAddress: { get: () => super.fetchPublicAddress }
13
+ });
14
+ return __awaiter(this, void 0, void 0, function* () {
15
+ if (this.isInstalledOnBrowser()) {
16
+ return _super.fetchPublicAddress.call(this);
17
+ }
18
+ if (isMobile()) {
19
+ handleMobileWalletRedirect({
20
+ nativeLink: 'phantom://browse',
21
+ universalLink: 'https://phantom.app/ul/browse',
22
+ });
23
+ }
24
+ return undefined;
25
+ });
26
+ }
8
27
  }
9
28
 
10
29
  export { Phantom };