@dynamic-labs/solana 4.0.0-alpha.32 → 4.0.0-alpha.34
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 +28 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +11 -11
- package/src/CoinbaseSolana/CoinbaseSolana.cjs +2 -4
- package/src/CoinbaseSolana/CoinbaseSolana.d.ts +0 -2
- package/src/CoinbaseSolana/CoinbaseSolana.js +2 -4
- package/src/Solflare/Solflare.cjs +7 -8
- package/src/Solflare/Solflare.d.ts +0 -2
- package/src/Solflare/Solflare.js +7 -8
- package/src/injected/BackpackSol.cjs +2 -4
- package/src/injected/BackpackSol.d.ts +0 -2
- package/src/injected/BackpackSol.js +2 -4
- package/src/injected/FallbackSolanaConnector.cjs +2 -4
- package/src/injected/FallbackSolanaConnector.d.ts +0 -2
- package/src/injected/FallbackSolanaConnector.js +2 -4
- package/src/injected/InjectedWalletBase.cjs +6 -3
- package/src/injected/InjectedWalletBase.d.ts +71 -1
- package/src/injected/InjectedWalletBase.js +6 -3
- package/src/injected/PhantomInjected.cjs +2 -4
- package/src/injected/PhantomInjected.d.ts +0 -2
- package/src/injected/PhantomInjected.js +2 -4
- package/src/injected/UnknownInjected.cjs +2 -4
- package/src/injected/UnknownInjected.d.ts +0 -2
- package/src/injected/UnknownInjected.js +2 -4
- package/src/injected/fetchInjectedWalletConnectors.cjs +5 -3
- package/src/injected/fetchInjectedWalletConnectors.js +5 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,32 @@
|
|
|
1
1
|
|
|
2
|
+
## [4.0.0-alpha.34](https://github.com/dynamic-labs/dynamic-auth/compare/v4.0.0-alpha.33...v4.0.0-alpha.34) (2024-11-20)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### ⚠ BREAKING CHANGES
|
|
6
|
+
|
|
7
|
+
* remove `supportsSatsConnect` helper ([#7453](https://github.com/dynamic-labs/dynamic-auth/issues/7453)) ([920c63b](https://github.com/dynamic-labs/dynamic-auth/commit/920c63bbb5a38dc3d676664db512a4da539c0909))
|
|
8
|
+
* moved `getWalletLinks` helper from `@dynamic-labs/wallet-book` to `@dynamic-labs/wallet-connector-core` ([#7416](https://github.com/dynamic-labs/dynamic-auth/issues/7416)) ([73fdfa8](https://github.com/dynamic-labs/dynamic-auth/commit/73fdfa8a19fe4c2cca55410d5ed3cb7b5bd8cdfd))
|
|
9
|
+
|
|
10
|
+
### Features
|
|
11
|
+
|
|
12
|
+
* allow listening to dynamic events without using a hook ([#7466](https://github.com/dynamic-labs/dynamic-auth/issues/7466)) ([3b34e1b](https://github.com/dynamic-labs/dynamic-auth/commit/3b34e1bd2737003b987887a02d0e21436e9bf908))
|
|
13
|
+
* emit primaryWalletChanged event when primary wallets changes ([#7464](https://github.com/dynamic-labs/dynamic-auth/issues/7464)) ([3bc6ba0](https://github.com/dynamic-labs/dynamic-auth/commit/3bc6ba055e0232bff3c6c6bb93d3d57b1dd90bc6))
|
|
14
|
+
* emit primaryWalletNetworkChanged event when primary wallet network changes ([#7465](https://github.com/dynamic-labs/dynamic-auth/issues/7465)) ([33cc629](https://github.com/dynamic-labs/dynamic-auth/commit/33cc629d3c6a03c381b7e5591a8f4557987cc6fc))
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [4.0.0-alpha.33](https://github.com/dynamic-labs/dynamic-auth/compare/v4.0.0-alpha.32...v4.0.0-alpha.33) (2024-11-18)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
* add login with tiktok ([#7360](https://github.com/dynamic-labs/dynamic-auth/issues/7360)) ([75bb66b](https://github.com/dynamic-labs/dynamic-auth/commit/75bb66b05158fe339daf7d14bfa21538b42c54f9))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Bug Fixes
|
|
26
|
+
|
|
27
|
+
* confirmation ui tweaks ([#7440](https://github.com/dynamic-labs/dynamic-auth/issues/7440)) ([684fb4c](https://github.com/dynamic-labs/dynamic-auth/commit/684fb4ca4232faeaa9975ea346abf88bd8c0acb3))
|
|
28
|
+
* siwe stop passing the query param in the URI ([#7444](https://github.com/dynamic-labs/dynamic-auth/issues/7444)) ([96b7a9c](https://github.com/dynamic-labs/dynamic-auth/commit/96b7a9ce2b7d52395b9dbe2d43c3d7e8a1a5346e))
|
|
29
|
+
|
|
2
30
|
## [4.0.0-alpha.32](https://github.com/dynamic-labs/dynamic-auth/compare/v4.0.0-alpha.31...v4.0.0-alpha.32) (2024-11-13)
|
|
3
31
|
|
|
4
32
|
|
package/package.cjs
CHANGED
package/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/solana",
|
|
3
|
-
"version": "4.0.0-alpha.
|
|
3
|
+
"version": "4.0.0-alpha.34",
|
|
4
4
|
"description": "A React SDK for implementing wallet web3 authentication and authorization to your website.",
|
|
5
5
|
"author": "Dynamic Labs, Inc.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -25,16 +25,16 @@
|
|
|
25
25
|
"@wallet-standard/experimental-features": "0.1.1",
|
|
26
26
|
"bs58": "5.0.0",
|
|
27
27
|
"tweetnacl": "1.0.3",
|
|
28
|
-
"@dynamic-labs/assert-package-version": "4.0.0-alpha.
|
|
29
|
-
"@dynamic-labs/embedded-wallet-solana": "4.0.0-alpha.
|
|
30
|
-
"@dynamic-labs/logger": "4.0.0-alpha.
|
|
31
|
-
"@dynamic-labs/rpc-providers": "4.0.0-alpha.
|
|
32
|
-
"@dynamic-labs/sdk-api-core": "0.0.
|
|
33
|
-
"@dynamic-labs/solana-core": "4.0.0-alpha.
|
|
34
|
-
"@dynamic-labs/types": "4.0.0-alpha.
|
|
35
|
-
"@dynamic-labs/utils": "4.0.0-alpha.
|
|
36
|
-
"@dynamic-labs/wallet-book": "4.0.0-alpha.
|
|
37
|
-
"@dynamic-labs/wallet-connector-core": "4.0.0-alpha.
|
|
28
|
+
"@dynamic-labs/assert-package-version": "4.0.0-alpha.34",
|
|
29
|
+
"@dynamic-labs/embedded-wallet-solana": "4.0.0-alpha.34",
|
|
30
|
+
"@dynamic-labs/logger": "4.0.0-alpha.34",
|
|
31
|
+
"@dynamic-labs/rpc-providers": "4.0.0-alpha.34",
|
|
32
|
+
"@dynamic-labs/sdk-api-core": "0.0.565",
|
|
33
|
+
"@dynamic-labs/solana-core": "4.0.0-alpha.34",
|
|
34
|
+
"@dynamic-labs/types": "4.0.0-alpha.34",
|
|
35
|
+
"@dynamic-labs/utils": "4.0.0-alpha.34",
|
|
36
|
+
"@dynamic-labs/wallet-book": "4.0.0-alpha.34",
|
|
37
|
+
"@dynamic-labs/wallet-connector-core": "4.0.0-alpha.34"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {}
|
|
40
40
|
}
|
|
@@ -5,16 +5,14 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
|
|
6
6
|
var _tslib = require('../../_virtual/_tslib.cjs');
|
|
7
7
|
var utils = require('@dynamic-labs/utils');
|
|
8
|
-
var walletBook = require('@dynamic-labs/wallet-book');
|
|
9
8
|
var InjectedWalletBase = require('../injected/InjectedWalletBase.cjs');
|
|
10
9
|
var isSignedMessage = require('../utils/isSignedMessage.cjs');
|
|
11
10
|
|
|
12
11
|
class CoinbaseSolana extends InjectedWalletBase.InjectedWalletBase {
|
|
13
|
-
constructor(
|
|
14
|
-
super(
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments);
|
|
15
14
|
this.name = 'CoinbaseSolana';
|
|
16
15
|
this.overrideKey = 'coinbasesolana';
|
|
17
|
-
this.wallet = walletBook.findWalletBookWallet(this.walletBook, this.key);
|
|
18
16
|
}
|
|
19
17
|
getSigner() {
|
|
20
18
|
return _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { SolanaWalletConnectorOpts } from '@dynamic-labs/solana-core';
|
|
2
1
|
import { InjectedWalletBase } from '../injected/InjectedWalletBase';
|
|
3
2
|
export declare class CoinbaseSolana extends InjectedWalletBase {
|
|
4
3
|
name: string;
|
|
5
4
|
overrideKey: string;
|
|
6
|
-
constructor(opts: SolanaWalletConnectorOpts);
|
|
7
5
|
getSigner<ICoinbaseSolanaSigner>(): Promise<ICoinbaseSolanaSigner | undefined>;
|
|
8
6
|
signMessage(messageToSign: string): Promise<string | undefined>;
|
|
9
7
|
}
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import { __awaiter } from '../../_virtual/_tslib.js';
|
|
3
3
|
import { bufferToBase64 } from '@dynamic-labs/utils';
|
|
4
|
-
import { findWalletBookWallet } from '@dynamic-labs/wallet-book';
|
|
5
4
|
import { InjectedWalletBase } from '../injected/InjectedWalletBase.js';
|
|
6
5
|
import { isSignedMessage } from '../utils/isSignedMessage.js';
|
|
7
6
|
|
|
8
7
|
class CoinbaseSolana extends InjectedWalletBase {
|
|
9
|
-
constructor(
|
|
10
|
-
super(
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
11
10
|
this.name = 'CoinbaseSolana';
|
|
12
11
|
this.overrideKey = 'coinbasesolana';
|
|
13
|
-
this.wallet = findWalletBookWallet(this.walletBook, this.key);
|
|
14
12
|
}
|
|
15
13
|
getSigner() {
|
|
16
14
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -5,31 +5,30 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
|
|
6
6
|
var _tslib = require('../../_virtual/_tslib.cjs');
|
|
7
7
|
var utils = require('@dynamic-labs/utils');
|
|
8
|
-
var walletBook = require('@dynamic-labs/wallet-book');
|
|
9
8
|
var InjectedWalletBase = require('../injected/InjectedWalletBase.cjs');
|
|
10
9
|
|
|
11
10
|
class Solflare extends InjectedWalletBase.InjectedWalletBase {
|
|
12
|
-
constructor(
|
|
13
|
-
super(
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
14
13
|
this.name = 'Solflare';
|
|
15
14
|
this.overrideKey = 'solflare';
|
|
16
|
-
this.wallet = walletBook.findWalletBookWallet(this.walletBook, this.key);
|
|
17
15
|
}
|
|
18
16
|
getAddress() {
|
|
19
17
|
return _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
20
|
-
var _a, _b
|
|
18
|
+
var _a, _b;
|
|
21
19
|
/**
|
|
22
20
|
* It should redirect to in-app browser if on mobile and if not in the in-app browser,
|
|
23
21
|
* this checks if it is not in the in-app browser by checking if the provider is not available.
|
|
24
22
|
*/
|
|
25
23
|
if (utils.isMobile() && !this.isInstalledOnBrowser()) {
|
|
24
|
+
const mobileDeepLinks = (_a = this.metadata.deepLinks) === null || _a === void 0 ? void 0 : _a.mobile;
|
|
26
25
|
utils.handleMobileWalletRedirect({
|
|
27
|
-
nativeLink: (
|
|
28
|
-
universalLink: (
|
|
26
|
+
nativeLink: (mobileDeepLinks === null || mobileDeepLinks === void 0 ? void 0 : mobileDeepLinks.native) || 'solflare://ul/v1/browse',
|
|
27
|
+
universalLink: (mobileDeepLinks === null || mobileDeepLinks === void 0 ? void 0 : mobileDeepLinks.universal) || 'https://solflare.com/ul/v1/browse',
|
|
29
28
|
});
|
|
30
29
|
return;
|
|
31
30
|
}
|
|
32
|
-
return (
|
|
31
|
+
return (_b = this.getSolProviderHelper()) === null || _b === void 0 ? void 0 : _b.getAddress();
|
|
33
32
|
});
|
|
34
33
|
}
|
|
35
34
|
signMessage(messageToSign) {
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { SolanaWalletConnectorOpts } from '@dynamic-labs/solana-core';
|
|
2
1
|
import { InjectedWalletBase } from '../injected/InjectedWalletBase';
|
|
3
2
|
export declare class Solflare extends InjectedWalletBase {
|
|
4
3
|
name: string;
|
|
5
4
|
overrideKey: string;
|
|
6
|
-
constructor(opts: SolanaWalletConnectorOpts);
|
|
7
5
|
getAddress(): Promise<string | undefined>;
|
|
8
6
|
signMessage(messageToSign: string): Promise<string | undefined>;
|
|
9
7
|
}
|
package/src/Solflare/Solflare.js
CHANGED
|
@@ -1,31 +1,30 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import { __awaiter } from '../../_virtual/_tslib.js';
|
|
3
3
|
import { isMobile, handleMobileWalletRedirect, bufferToBase64 } from '@dynamic-labs/utils';
|
|
4
|
-
import { findWalletBookWallet } from '@dynamic-labs/wallet-book';
|
|
5
4
|
import { InjectedWalletBase } from '../injected/InjectedWalletBase.js';
|
|
6
5
|
|
|
7
6
|
class Solflare extends InjectedWalletBase {
|
|
8
|
-
constructor(
|
|
9
|
-
super(
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
10
9
|
this.name = 'Solflare';
|
|
11
10
|
this.overrideKey = 'solflare';
|
|
12
|
-
this.wallet = findWalletBookWallet(this.walletBook, this.key);
|
|
13
11
|
}
|
|
14
12
|
getAddress() {
|
|
15
13
|
return __awaiter(this, void 0, void 0, function* () {
|
|
16
|
-
var _a, _b
|
|
14
|
+
var _a, _b;
|
|
17
15
|
/**
|
|
18
16
|
* It should redirect to in-app browser if on mobile and if not in the in-app browser,
|
|
19
17
|
* this checks if it is not in the in-app browser by checking if the provider is not available.
|
|
20
18
|
*/
|
|
21
19
|
if (isMobile() && !this.isInstalledOnBrowser()) {
|
|
20
|
+
const mobileDeepLinks = (_a = this.metadata.deepLinks) === null || _a === void 0 ? void 0 : _a.mobile;
|
|
22
21
|
handleMobileWalletRedirect({
|
|
23
|
-
nativeLink: (
|
|
24
|
-
universalLink: (
|
|
22
|
+
nativeLink: (mobileDeepLinks === null || mobileDeepLinks === void 0 ? void 0 : mobileDeepLinks.native) || 'solflare://ul/v1/browse',
|
|
23
|
+
universalLink: (mobileDeepLinks === null || mobileDeepLinks === void 0 ? void 0 : mobileDeepLinks.universal) || 'https://solflare.com/ul/v1/browse',
|
|
25
24
|
});
|
|
26
25
|
return;
|
|
27
26
|
}
|
|
28
|
-
return (
|
|
27
|
+
return (_b = this.getSolProviderHelper()) === null || _b === void 0 ? void 0 : _b.getAddress();
|
|
29
28
|
});
|
|
30
29
|
}
|
|
31
30
|
signMessage(messageToSign) {
|
|
@@ -5,15 +5,13 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
|
|
6
6
|
var _tslib = require('../../_virtual/_tslib.cjs');
|
|
7
7
|
var utils = require('@dynamic-labs/utils');
|
|
8
|
-
var walletBook = require('@dynamic-labs/wallet-book');
|
|
9
8
|
var InjectedWalletBase = require('./InjectedWalletBase.cjs');
|
|
10
9
|
|
|
11
10
|
class BackpackSol extends InjectedWalletBase.InjectedWalletBase {
|
|
12
|
-
constructor(
|
|
13
|
-
super(
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
14
13
|
this.name = 'Backpack';
|
|
15
14
|
this.overrideKey = 'backpacksol';
|
|
16
|
-
this.wallet = walletBook.findWalletBookWallet(this.walletBook, this.key);
|
|
17
15
|
}
|
|
18
16
|
getSigner() {
|
|
19
17
|
return _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { SolanaWalletConnectorOpts } from '@dynamic-labs/solana-core';
|
|
2
1
|
import { InjectedWalletBase } from './InjectedWalletBase';
|
|
3
2
|
export declare class BackpackSol extends InjectedWalletBase {
|
|
4
3
|
name: string;
|
|
5
4
|
overrideKey: string;
|
|
6
|
-
constructor(opts: SolanaWalletConnectorOpts);
|
|
7
5
|
getSigner<IBackpackSolanaSigner>(): Promise<IBackpackSolanaSigner | undefined>;
|
|
8
6
|
signMessage(messageToSign: string): Promise<string | undefined>;
|
|
9
7
|
}
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import { __awaiter } from '../../_virtual/_tslib.js';
|
|
3
3
|
import { bufferToBase64 } from '@dynamic-labs/utils';
|
|
4
|
-
import { findWalletBookWallet } from '@dynamic-labs/wallet-book';
|
|
5
4
|
import { InjectedWalletBase } from './InjectedWalletBase.js';
|
|
6
5
|
|
|
7
6
|
class BackpackSol extends InjectedWalletBase {
|
|
8
|
-
constructor(
|
|
9
|
-
super(
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
10
9
|
this.name = 'Backpack';
|
|
11
10
|
this.overrideKey = 'backpacksol';
|
|
12
|
-
this.wallet = findWalletBookWallet(this.walletBook, this.key);
|
|
13
11
|
}
|
|
14
12
|
getSigner() {
|
|
15
13
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -3,16 +3,14 @@
|
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
|
-
var walletBook = require('@dynamic-labs/wallet-book');
|
|
7
6
|
var InjectedWalletBase = require('./InjectedWalletBase.cjs');
|
|
8
7
|
|
|
9
8
|
class FallbackSolanaConnector extends InjectedWalletBase.InjectedWalletBase {
|
|
10
|
-
constructor(
|
|
11
|
-
super(
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments);
|
|
12
11
|
this.name = 'Fallback Connector';
|
|
13
12
|
this.overrideKey = 'fallbackconnector';
|
|
14
13
|
this.isAvailable = false;
|
|
15
|
-
this.wallet = walletBook.findWalletBookWallet(this.walletBook, this.key);
|
|
16
14
|
}
|
|
17
15
|
isInstalledOnBrowser() {
|
|
18
16
|
return false;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { SolanaWalletConnectorOpts } from '@dynamic-labs/solana-core';
|
|
2
1
|
import { InjectedWalletBase } from './InjectedWalletBase';
|
|
3
2
|
export declare class FallbackSolanaConnector extends InjectedWalletBase {
|
|
4
3
|
name: string;
|
|
5
4
|
overrideKey: string;
|
|
6
5
|
isAvailable: boolean;
|
|
7
|
-
constructor(opts: SolanaWalletConnectorOpts);
|
|
8
6
|
isInstalledOnBrowser(): boolean;
|
|
9
7
|
}
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
'use client'
|
|
2
|
-
import { findWalletBookWallet } from '@dynamic-labs/wallet-book';
|
|
3
2
|
import { InjectedWalletBase } from './InjectedWalletBase.js';
|
|
4
3
|
|
|
5
4
|
class FallbackSolanaConnector extends InjectedWalletBase {
|
|
6
|
-
constructor(
|
|
7
|
-
super(
|
|
5
|
+
constructor() {
|
|
6
|
+
super(...arguments);
|
|
8
7
|
this.name = 'Fallback Connector';
|
|
9
8
|
this.overrideKey = 'fallbackconnector';
|
|
10
9
|
this.isAvailable = false;
|
|
11
|
-
this.wallet = findWalletBookWallet(this.walletBook, this.key);
|
|
12
10
|
}
|
|
13
11
|
isInstalledOnBrowser() {
|
|
14
12
|
return false;
|
|
@@ -12,10 +12,13 @@ var SolProviderHelper = require('../SolProviderHelper/SolProviderHelper.cjs');
|
|
|
12
12
|
var SignMessageNotSupportedError = require('../errors/SignMessageNotSupportedError.cjs');
|
|
13
13
|
|
|
14
14
|
class InjectedWalletBase extends solanaCore.SolanaWalletConnector {
|
|
15
|
-
|
|
16
|
-
if (!this.
|
|
17
|
-
this.
|
|
15
|
+
get wallet() {
|
|
16
|
+
if (!this._wallet) {
|
|
17
|
+
this._wallet = walletBook.findWalletBookWallet(this.walletBook, this.key);
|
|
18
18
|
}
|
|
19
|
+
return this._wallet;
|
|
20
|
+
}
|
|
21
|
+
getSolProviderHelper() {
|
|
19
22
|
if (this.wallet && !this.solProviderHelper) {
|
|
20
23
|
this.solProviderHelper = new SolProviderHelper.SolProviderHelper(this.wallet);
|
|
21
24
|
}
|
|
@@ -5,7 +5,77 @@ import { ISendBalanceWalletConnector } from '@dynamic-labs/wallet-connector-core
|
|
|
5
5
|
import { SolProviderHelper } from '../SolProviderHelper';
|
|
6
6
|
export declare abstract class InjectedWalletBase extends SolanaWalletConnector implements ISendBalanceWalletConnector {
|
|
7
7
|
solProviderHelper: SolProviderHelper | undefined;
|
|
8
|
-
|
|
8
|
+
_wallet: WalletSchema | undefined;
|
|
9
|
+
get wallet(): {
|
|
10
|
+
name: string;
|
|
11
|
+
brand?: {
|
|
12
|
+
alt?: string | undefined;
|
|
13
|
+
primaryColor?: string | undefined;
|
|
14
|
+
spriteId?: string | undefined;
|
|
15
|
+
} | undefined;
|
|
16
|
+
chainGroup?: string | undefined;
|
|
17
|
+
chains?: string[] | undefined;
|
|
18
|
+
desktop?: {
|
|
19
|
+
chromeId?: string | undefined;
|
|
20
|
+
edgeId?: string | undefined;
|
|
21
|
+
firefoxId?: string | undefined;
|
|
22
|
+
native?: string | undefined;
|
|
23
|
+
operaId?: string | undefined;
|
|
24
|
+
safariId?: string | undefined;
|
|
25
|
+
universal?: string | undefined;
|
|
26
|
+
} | undefined;
|
|
27
|
+
eip6963Config?: {
|
|
28
|
+
rdns: string;
|
|
29
|
+
} | undefined;
|
|
30
|
+
filterFromWalletConnect?: boolean | undefined;
|
|
31
|
+
group?: string | undefined;
|
|
32
|
+
hardwareWallets?: string[] | undefined;
|
|
33
|
+
injectedConfig?: {
|
|
34
|
+
chain: string;
|
|
35
|
+
extensionLocators: {
|
|
36
|
+
value: boolean;
|
|
37
|
+
flag: string;
|
|
38
|
+
}[];
|
|
39
|
+
providerInterface?: string | undefined;
|
|
40
|
+
walletStandard?: {
|
|
41
|
+
features: string[];
|
|
42
|
+
name: string;
|
|
43
|
+
providerId?: string | undefined;
|
|
44
|
+
} | undefined;
|
|
45
|
+
walletStandardLocators?: {
|
|
46
|
+
name: string;
|
|
47
|
+
locator: string;
|
|
48
|
+
}[] | undefined;
|
|
49
|
+
windowLocations?: string[] | undefined;
|
|
50
|
+
}[] | undefined;
|
|
51
|
+
mobile?: {
|
|
52
|
+
android?: string | null | undefined;
|
|
53
|
+
androidId?: string | undefined;
|
|
54
|
+
inAppBrowser?: string | null | undefined;
|
|
55
|
+
ios?: string | null | undefined;
|
|
56
|
+
iosId?: string | undefined;
|
|
57
|
+
native?: string | undefined;
|
|
58
|
+
universal?: string | undefined;
|
|
59
|
+
} | undefined;
|
|
60
|
+
mobileExperience?: "in-app-browser" | "redirect" | undefined;
|
|
61
|
+
shortName?: string | undefined;
|
|
62
|
+
showOnlyIfInstalled?: boolean | undefined;
|
|
63
|
+
switchNetworkOnlyFromWallet?: boolean | undefined;
|
|
64
|
+
walletConnect?: {
|
|
65
|
+
sdks?: string[] | undefined;
|
|
66
|
+
} | undefined;
|
|
67
|
+
walletGroup?: string | undefined;
|
|
68
|
+
walletLimitations?: {
|
|
69
|
+
browserExtension?: {
|
|
70
|
+
unsupportedEvents?: string[] | undefined;
|
|
71
|
+
unsupportedMethods?: string[] | undefined;
|
|
72
|
+
} | undefined;
|
|
73
|
+
mobile?: {
|
|
74
|
+
unsupportedEvents?: string[] | undefined;
|
|
75
|
+
unsupportedMethods?: string[] | undefined;
|
|
76
|
+
} | undefined;
|
|
77
|
+
} | undefined;
|
|
78
|
+
} | undefined;
|
|
9
79
|
getSolProviderHelper(): SolProviderHelper | undefined;
|
|
10
80
|
getProvider(): ISolana | undefined;
|
|
11
81
|
setupEventListeners(): void;
|
|
@@ -8,10 +8,13 @@ import { SolProviderHelper } from '../SolProviderHelper/SolProviderHelper.js';
|
|
|
8
8
|
import { SignMessageNotSupportedError } from '../errors/SignMessageNotSupportedError.js';
|
|
9
9
|
|
|
10
10
|
class InjectedWalletBase extends SolanaWalletConnector {
|
|
11
|
-
|
|
12
|
-
if (!this.
|
|
13
|
-
this.
|
|
11
|
+
get wallet() {
|
|
12
|
+
if (!this._wallet) {
|
|
13
|
+
this._wallet = findWalletBookWallet(this.walletBook, this.key);
|
|
14
14
|
}
|
|
15
|
+
return this._wallet;
|
|
16
|
+
}
|
|
17
|
+
getSolProviderHelper() {
|
|
15
18
|
if (this.wallet && !this.solProviderHelper) {
|
|
16
19
|
this.solProviderHelper = new SolProviderHelper(this.wallet);
|
|
17
20
|
}
|
|
@@ -5,15 +5,13 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
|
|
6
6
|
var _tslib = require('../../_virtual/_tslib.cjs');
|
|
7
7
|
var utils = require('@dynamic-labs/utils');
|
|
8
|
-
var walletBook = require('@dynamic-labs/wallet-book');
|
|
9
8
|
var InjectedWalletBase = require('./InjectedWalletBase.cjs');
|
|
10
9
|
|
|
11
10
|
class PhantomInjected extends InjectedWalletBase.InjectedWalletBase {
|
|
12
|
-
constructor(
|
|
13
|
-
super(
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
14
13
|
this.name = 'Phantom';
|
|
15
14
|
this.overrideKey = 'phantom';
|
|
16
|
-
this.wallet = walletBook.findWalletBookWallet(this.walletBook, this.key);
|
|
17
15
|
}
|
|
18
16
|
getAddress() {
|
|
19
17
|
const _super = Object.create(null, {
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { SolanaWalletConnectorOpts } from '@dynamic-labs/solana-core';
|
|
2
1
|
import { InjectedWalletBase } from './InjectedWalletBase';
|
|
3
2
|
export declare class PhantomInjected extends InjectedWalletBase {
|
|
4
3
|
name: string;
|
|
5
4
|
overrideKey: string;
|
|
6
|
-
constructor(opts: SolanaWalletConnectorOpts);
|
|
7
5
|
getAddress(): Promise<string | undefined>;
|
|
8
6
|
canGetChainAddress(): boolean;
|
|
9
7
|
}
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import { __awaiter } from '../../_virtual/_tslib.js';
|
|
3
3
|
import { isMobile, handleMobileWalletRedirect } from '@dynamic-labs/utils';
|
|
4
|
-
import { findWalletBookWallet } from '@dynamic-labs/wallet-book';
|
|
5
4
|
import { InjectedWalletBase } from './InjectedWalletBase.js';
|
|
6
5
|
|
|
7
6
|
class PhantomInjected extends InjectedWalletBase {
|
|
8
|
-
constructor(
|
|
9
|
-
super(
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
10
9
|
this.name = 'Phantom';
|
|
11
10
|
this.overrideKey = 'phantom';
|
|
12
|
-
this.wallet = findWalletBookWallet(this.walletBook, this.key);
|
|
13
11
|
}
|
|
14
12
|
getAddress() {
|
|
15
13
|
const _super = Object.create(null, {
|
|
@@ -3,15 +3,13 @@
|
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
|
-
var walletBook = require('@dynamic-labs/wallet-book');
|
|
7
6
|
var InjectedWalletBase = require('./InjectedWalletBase.cjs');
|
|
8
7
|
|
|
9
8
|
class UnknownInjected extends InjectedWalletBase.InjectedWalletBase {
|
|
10
|
-
constructor(
|
|
11
|
-
super(
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments);
|
|
12
11
|
this.name = 'Unknown';
|
|
13
12
|
this.overrideKey = 'unknown';
|
|
14
|
-
this.wallet = walletBook.findWalletBookWallet(this.walletBook, this.key);
|
|
15
13
|
}
|
|
16
14
|
isInstalledOnBrowser() {
|
|
17
15
|
return false;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { SolanaWalletConnectorOpts } from '@dynamic-labs/solana-core';
|
|
2
1
|
import { InjectedWalletBase } from './InjectedWalletBase';
|
|
3
2
|
export declare class UnknownInjected extends InjectedWalletBase {
|
|
4
3
|
name: string;
|
|
5
4
|
overrideKey: string;
|
|
6
|
-
constructor(opts: SolanaWalletConnectorOpts);
|
|
7
5
|
isInstalledOnBrowser(): boolean;
|
|
8
6
|
}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
'use client'
|
|
2
|
-
import { findWalletBookWallet } from '@dynamic-labs/wallet-book';
|
|
3
2
|
import { InjectedWalletBase } from './InjectedWalletBase.js';
|
|
4
3
|
|
|
5
4
|
class UnknownInjected extends InjectedWalletBase {
|
|
6
|
-
constructor(
|
|
7
|
-
super(
|
|
5
|
+
constructor() {
|
|
6
|
+
super(...arguments);
|
|
8
7
|
this.name = 'Unknown';
|
|
9
8
|
this.overrideKey = 'unknown';
|
|
10
|
-
this.wallet = findWalletBookWallet(this.walletBook, this.key);
|
|
11
9
|
}
|
|
12
10
|
isInstalledOnBrowser() {
|
|
13
11
|
return false;
|
|
@@ -48,13 +48,15 @@ const fetchInjectedWalletConnectors = ({ walletBook, }) => {
|
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
return class extends InjectedWalletBase.InjectedWalletBase {
|
|
51
|
-
constructor(
|
|
52
|
-
super(
|
|
51
|
+
constructor() {
|
|
52
|
+
super(...arguments);
|
|
53
53
|
this.name = name;
|
|
54
|
-
this.wallet = wallet;
|
|
55
54
|
// this is the key from the wallet book entry so that we don't purely rely on the normalized name
|
|
56
55
|
this.overrideKey = key;
|
|
57
56
|
}
|
|
57
|
+
get wallet() {
|
|
58
|
+
return wallet;
|
|
59
|
+
}
|
|
58
60
|
};
|
|
59
61
|
});
|
|
60
62
|
};
|
|
@@ -44,13 +44,15 @@ const fetchInjectedWalletConnectors = ({ walletBook, }) => {
|
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
return class extends InjectedWalletBase {
|
|
47
|
-
constructor(
|
|
48
|
-
super(
|
|
47
|
+
constructor() {
|
|
48
|
+
super(...arguments);
|
|
49
49
|
this.name = name;
|
|
50
|
-
this.wallet = wallet;
|
|
51
50
|
// this is the key from the wallet book entry so that we don't purely rely on the normalized name
|
|
52
51
|
this.overrideKey = key;
|
|
53
52
|
}
|
|
53
|
+
get wallet() {
|
|
54
|
+
return wallet;
|
|
55
|
+
}
|
|
54
56
|
};
|
|
55
57
|
});
|
|
56
58
|
};
|