@dynamic-labs/solana 1.0.3 → 1.0.4
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 +10 -0
- package/package.json +6 -6
- package/src/Solflare.cjs +4 -8
- package/src/Solflare.js +5 -9
- package/src/injected/Phantom.cjs +19 -0
- package/src/injected/Phantom.d.ts +1 -0
- package/src/injected/Phantom.js +19 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
|
|
2
|
+
### [1.0.4](https://github.com/dynamic-labs/DynamicAuth/compare/v1.0.3...v1.0.4) (2024-01-04)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* 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))
|
|
8
|
+
* phantom solana not connecting on mobile ([#4287](https://github.com/dynamic-labs/DynamicAuth/issues/4287)) ([0d85e24](https://github.com/dynamic-labs/DynamicAuth/commit/0d85e2429f2dc0a92c293cf57dc0e241c4b948be))
|
|
9
|
+
* 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))
|
|
10
|
+
* **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))
|
|
11
|
+
|
|
2
12
|
### [1.0.3](https://github.com/dynamic-labs/DynamicAuth/compare/v1.0.2...v1.0.3) (2023-12-28)
|
|
3
13
|
|
|
4
14
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/solana",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
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.
|
|
31
|
-
"@dynamic-labs/types": "1.0.
|
|
32
|
-
"@dynamic-labs/utils": "1.0.
|
|
33
|
-
"@dynamic-labs/wallet-book": "1.0.
|
|
34
|
-
"@dynamic-labs/wallet-connector-core": "1.0.
|
|
30
|
+
"@dynamic-labs/rpc-providers": "1.0.4",
|
|
31
|
+
"@dynamic-labs/types": "1.0.4",
|
|
32
|
+
"@dynamic-labs/utils": "1.0.4",
|
|
33
|
+
"@dynamic-labs/wallet-book": "1.0.4",
|
|
34
|
+
"@dynamic-labs/wallet-connector-core": "1.0.4",
|
|
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
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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,
|
|
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
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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);
|
package/src/injected/Phantom.cjs
CHANGED
|
@@ -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;
|
package/src/injected/Phantom.js
CHANGED
|
@@ -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 };
|