@dynamic-labs/solana 4.0.0-alpha.34 → 4.0.0-alpha.36
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 +18 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +11 -11
- package/src/SolProviderHelper/SolProviderHelper.cjs +4 -3
- package/src/SolProviderHelper/SolProviderHelper.d.ts +4 -2
- package/src/SolProviderHelper/SolProviderHelper.js +4 -3
- package/src/SolanaWalletConnectors.cjs +0 -2
- package/src/SolanaWalletConnectors.js +0 -2
- package/src/index.d.ts +1 -0
- package/src/injected/InjectedWalletBase.cjs +10 -1
- package/src/injected/InjectedWalletBase.d.ts +7 -0
- package/src/injected/InjectedWalletBase.js +10 -1
- package/src/injected/index.d.ts +0 -1
- package/src/types.d.ts +7 -0
- package/src/injected/UnknownInjected.cjs +0 -19
- package/src/injected/UnknownInjected.d.ts +0 -6
- package/src/injected/UnknownInjected.js +0 -15
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,22 @@
|
|
|
1
1
|
|
|
2
|
+
## [4.0.0-alpha.36](https://github.com/dynamic-labs/dynamic-auth/compare/v4.0.0-alpha.35...v4.0.0-alpha.36) (2024-11-26)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* only fetch nonce when required ([#7495](https://github.com/dynamic-labs/dynamic-auth/issues/7495)) ([2816b6f](https://github.com/dynamic-labs/dynamic-auth/commit/2816b6f22d7f9dc7f7e1858e19263a2cb2631bb5))
|
|
8
|
+
* show network for unknown wallets ([#7463](https://github.com/dynamic-labs/dynamic-auth/issues/7463)) ([3a98cc2](https://github.com/dynamic-labs/dynamic-auth/commit/3a98cc2bc807db457f1d11b08b74237badb1399e))
|
|
9
|
+
|
|
10
|
+
## [4.0.0-alpha.35](https://github.com/dynamic-labs/dynamic-auth/compare/v4.0.0-alpha.34...v4.0.0-alpha.35) (2024-11-25)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* eclipse and solana wallets getting mixed up in connect only ([#7487](https://github.com/dynamic-labs/dynamic-auth/issues/7487)) ([6cabfb8](https://github.com/dynamic-labs/dynamic-auth/commit/6cabfb8da4d23a858652634844653aadc75be062))
|
|
16
|
+
* eclipse wallets never get detected ([#7479](https://github.com/dynamic-labs/dynamic-auth/issues/7479)) ([4a1a040](https://github.com/dynamic-labs/dynamic-auth/commit/4a1a04027e447a0c5c42b2dd3808b82c2ce7724c))
|
|
17
|
+
* **ui:** add missing rule for social login modals ([#7476](https://github.com/dynamic-labs/dynamic-auth/issues/7476)) ([59b5a2d](https://github.com/dynamic-labs/dynamic-auth/commit/59b5a2de10600decedbc167ee30e7900ec53618b))
|
|
18
|
+
* use correct fallback connector for each chain ([#7318](https://github.com/dynamic-labs/dynamic-auth/issues/7318)) ([91dcf8b](https://github.com/dynamic-labs/dynamic-auth/commit/91dcf8b6be4932c8e4122ce4dbceafee7ba1d194))
|
|
19
|
+
|
|
2
20
|
## [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
21
|
|
|
4
22
|
|
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.36",
|
|
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.36",
|
|
29
|
+
"@dynamic-labs/embedded-wallet-solana": "4.0.0-alpha.36",
|
|
30
|
+
"@dynamic-labs/logger": "4.0.0-alpha.36",
|
|
31
|
+
"@dynamic-labs/rpc-providers": "4.0.0-alpha.36",
|
|
32
|
+
"@dynamic-labs/sdk-api-core": "0.0.570",
|
|
33
|
+
"@dynamic-labs/solana-core": "4.0.0-alpha.36",
|
|
34
|
+
"@dynamic-labs/types": "4.0.0-alpha.36",
|
|
35
|
+
"@dynamic-labs/utils": "4.0.0-alpha.36",
|
|
36
|
+
"@dynamic-labs/wallet-book": "4.0.0-alpha.36",
|
|
37
|
+
"@dynamic-labs/wallet-connector-core": "4.0.0-alpha.36"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {}
|
|
40
40
|
}
|
|
@@ -6,18 +6,19 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
6
6
|
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
|
-
var isSignedMessage = require('../utils/isSignedMessage.cjs');
|
|
10
9
|
var findWalletProviderFromWalletStandard = require('../utils/findWalletProviderFromWalletStandard/findWalletProviderFromWalletStandard.cjs');
|
|
10
|
+
var isSignedMessage = require('../utils/isSignedMessage.cjs');
|
|
11
11
|
|
|
12
12
|
class SolProviderHelper {
|
|
13
|
-
constructor(wallet) {
|
|
13
|
+
constructor(wallet, chain) {
|
|
14
14
|
this.wallet = wallet;
|
|
15
|
+
this.chain = chain;
|
|
15
16
|
}
|
|
16
17
|
getInjectedConfig() {
|
|
17
18
|
if (!this.wallet || !this.wallet.injectedConfig)
|
|
18
19
|
return;
|
|
19
20
|
const { injectedConfig } = this.wallet;
|
|
20
|
-
return injectedConfig.find((c) => c.chain ===
|
|
21
|
+
return injectedConfig.find((c) => c.chain === this.chain);
|
|
21
22
|
}
|
|
22
23
|
getInstalledProvider() {
|
|
23
24
|
const config = this.getInjectedConfig();
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import { ExtensionLocator, ISolana } from '@dynamic-labs/solana-core';
|
|
1
2
|
import { WalletSchema } from '@dynamic-labs/wallet-book';
|
|
2
3
|
import { ProviderCondition, WalletConnector } from '@dynamic-labs/wallet-connector-core';
|
|
3
|
-
import {
|
|
4
|
+
import { AllowedSolanaChain } from '../types';
|
|
4
5
|
export declare class SolProviderHelper {
|
|
5
6
|
private wallet;
|
|
6
|
-
|
|
7
|
+
private chain;
|
|
8
|
+
constructor(wallet: WalletSchema, chain: AllowedSolanaChain);
|
|
7
9
|
getInjectedConfig(): {
|
|
8
10
|
chain: string;
|
|
9
11
|
extensionLocators: {
|
|
@@ -2,18 +2,19 @@
|
|
|
2
2
|
import { __awaiter } from '../../_virtual/_tslib.js';
|
|
3
3
|
import { getProvidersFromWindow, bufferToBase64 } from '@dynamic-labs/utils';
|
|
4
4
|
import { ProviderLookup, logger } from '@dynamic-labs/wallet-connector-core';
|
|
5
|
-
import { isSignedMessage } from '../utils/isSignedMessage.js';
|
|
6
5
|
import { findWalletProviderFromWalletStandard } from '../utils/findWalletProviderFromWalletStandard/findWalletProviderFromWalletStandard.js';
|
|
6
|
+
import { isSignedMessage } from '../utils/isSignedMessage.js';
|
|
7
7
|
|
|
8
8
|
class SolProviderHelper {
|
|
9
|
-
constructor(wallet) {
|
|
9
|
+
constructor(wallet, chain) {
|
|
10
10
|
this.wallet = wallet;
|
|
11
|
+
this.chain = chain;
|
|
11
12
|
}
|
|
12
13
|
getInjectedConfig() {
|
|
13
14
|
if (!this.wallet || !this.wallet.injectedConfig)
|
|
14
15
|
return;
|
|
15
16
|
const { injectedConfig } = this.wallet;
|
|
16
|
-
return injectedConfig.find((c) => c.chain ===
|
|
17
|
+
return injectedConfig.find((c) => c.chain === this.chain);
|
|
17
18
|
}
|
|
18
19
|
getInstalledProvider() {
|
|
19
20
|
const config = this.getInjectedConfig();
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
6
6
|
var embeddedWalletSolana = require('@dynamic-labs/embedded-wallet-solana');
|
|
7
7
|
var Phantom = require('./Phantom/Phantom.cjs');
|
|
8
8
|
var fetchInjectedWalletConnectors = require('./injected/fetchInjectedWalletConnectors.cjs');
|
|
9
|
-
var UnknownInjected = require('./injected/UnknownInjected.cjs');
|
|
10
9
|
var FallbackSolanaConnector = require('./injected/FallbackSolanaConnector.cjs');
|
|
11
10
|
|
|
12
11
|
const SolanaWalletConnectors = (
|
|
@@ -16,7 +15,6 @@ props) => [
|
|
|
16
15
|
...fetchInjectedWalletConnectors.fetchInjectedWalletConnectors(props),
|
|
17
16
|
...embeddedWalletSolana.TurnkeySolanaWalletConnectors(props),
|
|
18
17
|
Phantom.Phantom,
|
|
19
|
-
UnknownInjected.UnknownInjected,
|
|
20
18
|
FallbackSolanaConnector.FallbackSolanaConnector,
|
|
21
19
|
];
|
|
22
20
|
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import { TurnkeySolanaWalletConnectors } from '@dynamic-labs/embedded-wallet-solana';
|
|
3
3
|
import { Phantom } from './Phantom/Phantom.js';
|
|
4
4
|
import { injectedWalletOverrides, fetchInjectedWalletConnectors } from './injected/fetchInjectedWalletConnectors.js';
|
|
5
|
-
import { UnknownInjected } from './injected/UnknownInjected.js';
|
|
6
5
|
import { FallbackSolanaConnector } from './injected/FallbackSolanaConnector.js';
|
|
7
6
|
|
|
8
7
|
const SolanaWalletConnectors = (
|
|
@@ -12,7 +11,6 @@ props) => [
|
|
|
12
11
|
...fetchInjectedWalletConnectors(props),
|
|
13
12
|
...TurnkeySolanaWalletConnectors(props),
|
|
14
13
|
Phantom,
|
|
15
|
-
UnknownInjected,
|
|
16
14
|
FallbackSolanaConnector,
|
|
17
15
|
];
|
|
18
16
|
|
package/src/index.d.ts
CHANGED
|
@@ -4,5 +4,6 @@ export { BackpackSol as BackpackConnector } from './injected/BackpackSol';
|
|
|
4
4
|
export { InjectedWalletBase as SolanaInjectedConnector } from './injected/InjectedWalletBase';
|
|
5
5
|
export { SolanaWalletConnectors } from './SolanaWalletConnectors';
|
|
6
6
|
export { SolanaWalletConnectorsWithConfig } from './SolanaWalletConnectorsWithConfig';
|
|
7
|
+
export type { AllowedSolanaChain } from './types';
|
|
7
8
|
export { isBackpackSolanaSigner } from './utils/isBackpackSolanaSigner';
|
|
8
9
|
export { isSignedMessage } from './utils/isSignedMessage';
|
|
@@ -12,6 +12,15 @@ var SolProviderHelper = require('../SolProviderHelper/SolProviderHelper.cjs');
|
|
|
12
12
|
var SignMessageNotSupportedError = require('../errors/SignMessageNotSupportedError.cjs');
|
|
13
13
|
|
|
14
14
|
class InjectedWalletBase extends solanaCore.SolanaWalletConnector {
|
|
15
|
+
constructor() {
|
|
16
|
+
super(...arguments);
|
|
17
|
+
/**
|
|
18
|
+
* The chain being used.
|
|
19
|
+
* Defaults to 'sol', obviously, but since this connector is also used for other chains,
|
|
20
|
+
* such as eclipse, this can be overridden.
|
|
21
|
+
*/
|
|
22
|
+
this.solanaChain = 'sol';
|
|
23
|
+
}
|
|
15
24
|
get wallet() {
|
|
16
25
|
if (!this._wallet) {
|
|
17
26
|
this._wallet = walletBook.findWalletBookWallet(this.walletBook, this.key);
|
|
@@ -20,7 +29,7 @@ class InjectedWalletBase extends solanaCore.SolanaWalletConnector {
|
|
|
20
29
|
}
|
|
21
30
|
getSolProviderHelper() {
|
|
22
31
|
if (this.wallet && !this.solProviderHelper) {
|
|
23
|
-
this.solProviderHelper = new SolProviderHelper.SolProviderHelper(this.wallet);
|
|
32
|
+
this.solProviderHelper = new SolProviderHelper.SolProviderHelper(this.wallet, this.solanaChain);
|
|
24
33
|
}
|
|
25
34
|
return this.solProviderHelper;
|
|
26
35
|
}
|
|
@@ -3,9 +3,16 @@ import { SolanaWalletConnector, type ISolana } from '@dynamic-labs/solana-core';
|
|
|
3
3
|
import { IUITransaction } from '@dynamic-labs/types';
|
|
4
4
|
import { ISendBalanceWalletConnector } from '@dynamic-labs/wallet-connector-core';
|
|
5
5
|
import { SolProviderHelper } from '../SolProviderHelper';
|
|
6
|
+
import { AllowedSolanaChain } from '../types';
|
|
6
7
|
export declare abstract class InjectedWalletBase extends SolanaWalletConnector implements ISendBalanceWalletConnector {
|
|
7
8
|
solProviderHelper: SolProviderHelper | undefined;
|
|
8
9
|
_wallet: WalletSchema | undefined;
|
|
10
|
+
/**
|
|
11
|
+
* The chain being used.
|
|
12
|
+
* Defaults to 'sol', obviously, but since this connector is also used for other chains,
|
|
13
|
+
* such as eclipse, this can be overridden.
|
|
14
|
+
*/
|
|
15
|
+
solanaChain: AllowedSolanaChain;
|
|
9
16
|
get wallet(): {
|
|
10
17
|
name: string;
|
|
11
18
|
brand?: {
|
|
@@ -8,6 +8,15 @@ import { SolProviderHelper } from '../SolProviderHelper/SolProviderHelper.js';
|
|
|
8
8
|
import { SignMessageNotSupportedError } from '../errors/SignMessageNotSupportedError.js';
|
|
9
9
|
|
|
10
10
|
class InjectedWalletBase extends SolanaWalletConnector {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
13
|
+
/**
|
|
14
|
+
* The chain being used.
|
|
15
|
+
* Defaults to 'sol', obviously, but since this connector is also used for other chains,
|
|
16
|
+
* such as eclipse, this can be overridden.
|
|
17
|
+
*/
|
|
18
|
+
this.solanaChain = 'sol';
|
|
19
|
+
}
|
|
11
20
|
get wallet() {
|
|
12
21
|
if (!this._wallet) {
|
|
13
22
|
this._wallet = findWalletBookWallet(this.walletBook, this.key);
|
|
@@ -16,7 +25,7 @@ class InjectedWalletBase extends SolanaWalletConnector {
|
|
|
16
25
|
}
|
|
17
26
|
getSolProviderHelper() {
|
|
18
27
|
if (this.wallet && !this.solProviderHelper) {
|
|
19
|
-
this.solProviderHelper = new SolProviderHelper(this.wallet);
|
|
28
|
+
this.solProviderHelper = new SolProviderHelper(this.wallet, this.solanaChain);
|
|
20
29
|
}
|
|
21
30
|
return this.solProviderHelper;
|
|
22
31
|
}
|
package/src/injected/index.d.ts
CHANGED
package/src/types.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which Solana chains are available for use.
|
|
3
|
+
*
|
|
4
|
+
* Should follow the same names as those seen in the `injectedConfig[number].chain` property
|
|
5
|
+
* from the `getInjectedConfig` method under SolProviderHelper.
|
|
6
|
+
*/
|
|
7
|
+
export type AllowedSolanaChain = 'sol' | 'eclipse';
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
-
|
|
6
|
-
var InjectedWalletBase = require('./InjectedWalletBase.cjs');
|
|
7
|
-
|
|
8
|
-
class UnknownInjected extends InjectedWalletBase.InjectedWalletBase {
|
|
9
|
-
constructor() {
|
|
10
|
-
super(...arguments);
|
|
11
|
-
this.name = 'Unknown';
|
|
12
|
-
this.overrideKey = 'unknown';
|
|
13
|
-
}
|
|
14
|
-
isInstalledOnBrowser() {
|
|
15
|
-
return false;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
exports.UnknownInjected = UnknownInjected;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
import { InjectedWalletBase } from './InjectedWalletBase.js';
|
|
3
|
-
|
|
4
|
-
class UnknownInjected extends InjectedWalletBase {
|
|
5
|
-
constructor() {
|
|
6
|
-
super(...arguments);
|
|
7
|
-
this.name = 'Unknown';
|
|
8
|
-
this.overrideKey = 'unknown';
|
|
9
|
-
}
|
|
10
|
-
isInstalledOnBrowser() {
|
|
11
|
-
return false;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export { UnknownInjected };
|