@dynamic-labs/solana 4.2.3 → 4.3.0
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 +12 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +10 -10
- package/src/SolanaWalletConnectors.cjs +4 -0
- package/src/SolanaWalletConnectors.js +4 -0
- package/src/index.cjs +11 -0
- package/src/index.d.ts +2 -0
- package/src/index.js +7 -0
- package/src/injected/fetchInjectedWalletConnectors.cjs +3 -6
- package/src/injected/fetchInjectedWalletConnectors.js +3 -6
- package/src/injected/index.d.ts +3 -0
- package/src/injected/walletStandard/createSolanaSignerFromWalletStandard/createSolanaSignerFromWalletStandard.cjs +4 -4
- package/src/injected/walletStandard/createSolanaSignerFromWalletStandard/createSolanaSignerFromWalletStandard.d.ts +9 -1
- package/src/injected/walletStandard/createSolanaSignerFromWalletStandard/createSolanaSignerFromWalletStandard.js +4 -4
- package/src/injected/walletStandard/getConnectorConstructorForWalletStandardWallet/getConnectorConstructorForWalletStandardWallet.cjs +6 -1
- package/src/injected/walletStandard/getConnectorConstructorForWalletStandardWallet/getConnectorConstructorForWalletStandardWallet.js +6 -1
- package/src/injected/walletStandard/hasAllWalletStandardRequiredFeatures/hasAllWalletStandardRequiredFeatures.cjs +15 -0
- package/src/injected/walletStandard/hasAllWalletStandardRequiredFeatures/hasAllWalletStandardRequiredFeatures.d.ts +2 -0
- package/src/injected/walletStandard/hasAllWalletStandardRequiredFeatures/hasAllWalletStandardRequiredFeatures.js +11 -0
- package/src/injected/walletStandard/hasAllWalletStandardRequiredFeatures/index.d.ts +1 -0
- package/src/phantomRedirect/PhantomRedirect/PhantomRedirect.cjs +1 -1
- package/src/phantomRedirect/PhantomRedirect/PhantomRedirect.js +1 -1
- package/src/{phantomRedirect → utils}/fetchCluster/fetchCluster.cjs +2 -2
- package/src/utils/fetchCluster/fetchCluster.d.ts +1 -0
- package/src/{phantomRedirect → utils}/fetchCluster/fetchCluster.js +2 -2
- package/src/phantomRedirect/fetchCluster/fetchCluster.d.ts +0 -1
- /package/src/{phantomRedirect → utils}/fetchCluster/index.d.ts +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
|
|
2
|
+
## [4.3.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.2.3...v4.3.0) (2025-01-21)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* add support for Nightly wallet on Eclipse ([#7848](https://github.com/dynamic-labs/dynamic-auth/issues/7848)) ([dd6e8d4](https://github.com/dynamic-labs/dynamic-auth/commit/dd6e8d41daf632a1b55137f903b6fc99a148c071))
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* fix storage sync issues when upgrade to sdk v4 while user is logged in ([#7835](https://github.com/dynamic-labs/dynamic-auth/issues/7835)) ([528b6f9](https://github.com/dynamic-labs/dynamic-auth/commit/528b6f9ce5d0e77d518dcfb7021fc711d2a9e503))
|
|
13
|
+
|
|
2
14
|
### [4.2.3](https://github.com/dynamic-labs/dynamic-auth/compare/v4.2.2...v4.2.3) (2025-01-16)
|
|
3
15
|
|
|
4
16
|
|
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.
|
|
3
|
+
"version": "4.3.0",
|
|
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.
|
|
29
|
-
"@dynamic-labs/embedded-wallet-solana": "4.
|
|
30
|
-
"@dynamic-labs/logger": "4.
|
|
31
|
-
"@dynamic-labs/rpc-providers": "4.
|
|
28
|
+
"@dynamic-labs/assert-package-version": "4.3.0",
|
|
29
|
+
"@dynamic-labs/embedded-wallet-solana": "4.3.0",
|
|
30
|
+
"@dynamic-labs/logger": "4.3.0",
|
|
31
|
+
"@dynamic-labs/rpc-providers": "4.3.0",
|
|
32
32
|
"@dynamic-labs/sdk-api-core": "0.0.586",
|
|
33
|
-
"@dynamic-labs/solana-core": "4.
|
|
34
|
-
"@dynamic-labs/types": "4.
|
|
35
|
-
"@dynamic-labs/utils": "4.
|
|
36
|
-
"@dynamic-labs/wallet-book": "4.
|
|
37
|
-
"@dynamic-labs/wallet-connector-core": "4.
|
|
33
|
+
"@dynamic-labs/solana-core": "4.3.0",
|
|
34
|
+
"@dynamic-labs/types": "4.3.0",
|
|
35
|
+
"@dynamic-labs/utils": "4.3.0",
|
|
36
|
+
"@dynamic-labs/wallet-book": "4.3.0",
|
|
37
|
+
"@dynamic-labs/wallet-connector-core": "4.3.0"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {}
|
|
40
40
|
}
|
|
@@ -7,6 +7,10 @@ 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
9
|
var FallbackSolanaConnector = require('./injected/FallbackSolanaConnector/FallbackSolanaConnector.cjs');
|
|
10
|
+
require('@wallet-standard/app');
|
|
11
|
+
require('../_virtual/_tslib.cjs');
|
|
12
|
+
require('@solana/web3.js');
|
|
13
|
+
require('./utils/logger.cjs');
|
|
10
14
|
|
|
11
15
|
const SolanaWalletConnectors = (
|
|
12
16
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -3,6 +3,10 @@ import { TurnkeySolanaWalletConnectors } from '@dynamic-labs/embedded-wallet-sol
|
|
|
3
3
|
import { Phantom } from './Phantom/Phantom.js';
|
|
4
4
|
import { injectedWalletOverrides, fetchInjectedWalletConnectors } from './injected/fetchInjectedWalletConnectors.js';
|
|
5
5
|
import { FallbackSolanaConnector } from './injected/FallbackSolanaConnector/FallbackSolanaConnector.js';
|
|
6
|
+
import '@wallet-standard/app';
|
|
7
|
+
import '../_virtual/_tslib.js';
|
|
8
|
+
import '@solana/web3.js';
|
|
9
|
+
import './utils/logger.js';
|
|
6
10
|
|
|
7
11
|
const SolanaWalletConnectors = (
|
|
8
12
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
package/src/index.cjs
CHANGED
|
@@ -12,6 +12,13 @@ var SolanaWalletConnectors = require('./SolanaWalletConnectors.cjs');
|
|
|
12
12
|
var SolanaWalletConnectorsWithConfig = require('./SolanaWalletConnectorsWithConfig/SolanaWalletConnectorsWithConfig.cjs');
|
|
13
13
|
var isBackpackSolanaSigner = require('./utils/isBackpackSolanaSigner.cjs');
|
|
14
14
|
var isSignedMessage = require('./utils/isSignedMessage.cjs');
|
|
15
|
+
require('@dynamic-labs/utils');
|
|
16
|
+
require('../_virtual/_tslib.cjs');
|
|
17
|
+
require('./utils/logger.cjs');
|
|
18
|
+
var createSolanaSignerFromWalletStandard = require('./injected/walletStandard/createSolanaSignerFromWalletStandard/createSolanaSignerFromWalletStandard.cjs');
|
|
19
|
+
var getWalletStandardWallets = require('./injected/walletStandard/getWalletStandardWallets/getWalletStandardWallets.cjs');
|
|
20
|
+
var hasAllWalletStandardRequiredFeatures = require('./injected/walletStandard/hasAllWalletStandardRequiredFeatures/hasAllWalletStandardRequiredFeatures.cjs');
|
|
21
|
+
var fetchCluster = require('./utils/fetchCluster/fetchCluster.cjs');
|
|
15
22
|
|
|
16
23
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
17
24
|
assertPackageVersion.assertPackageVersion('@dynamic-labs/solana', _package.version);
|
|
@@ -30,3 +37,7 @@ exports.SolanaWalletConnectors = SolanaWalletConnectors.SolanaWalletConnectors;
|
|
|
30
37
|
exports.SolanaWalletConnectorsWithConfig = SolanaWalletConnectorsWithConfig.SolanaWalletConnectorsWithConfig;
|
|
31
38
|
exports.isBackpackSolanaSigner = isBackpackSolanaSigner.isBackpackSolanaSigner;
|
|
32
39
|
exports.isSignedMessage = isSignedMessage.isSignedMessage;
|
|
40
|
+
exports.createSolanaSignerFromWalletStandard = createSolanaSignerFromWalletStandard.createSolanaSignerFromWalletStandard;
|
|
41
|
+
exports.getWalletStandardWallets = getWalletStandardWallets.getWalletStandardWallets;
|
|
42
|
+
exports.hasAllWalletStandardRequiredFeatures = hasAllWalletStandardRequiredFeatures.hasAllWalletStandardRequiredFeatures;
|
|
43
|
+
exports.fetchCluster = fetchCluster.fetchCluster;
|
package/src/index.d.ts
CHANGED
|
@@ -6,3 +6,5 @@ export { SolanaWalletConnectors } from './SolanaWalletConnectors';
|
|
|
6
6
|
export { SolanaWalletConnectorsWithConfig } from './SolanaWalletConnectorsWithConfig';
|
|
7
7
|
export { isBackpackSolanaSigner } from './utils/isBackpackSolanaSigner';
|
|
8
8
|
export { isSignedMessage } from './utils/isSignedMessage';
|
|
9
|
+
export { getWalletStandardWallets, createSolanaSignerFromWalletStandard, hasAllWalletStandardRequiredFeatures, } from './injected';
|
|
10
|
+
export { fetchCluster } from './utils/fetchCluster';
|
package/src/index.js
CHANGED
|
@@ -8,6 +8,13 @@ export { SolanaWalletConnectors } from './SolanaWalletConnectors.js';
|
|
|
8
8
|
export { SolanaWalletConnectorsWithConfig } from './SolanaWalletConnectorsWithConfig/SolanaWalletConnectorsWithConfig.js';
|
|
9
9
|
export { isBackpackSolanaSigner } from './utils/isBackpackSolanaSigner.js';
|
|
10
10
|
export { isSignedMessage } from './utils/isSignedMessage.js';
|
|
11
|
+
import '@dynamic-labs/utils';
|
|
12
|
+
import '../_virtual/_tslib.js';
|
|
13
|
+
import './utils/logger.js';
|
|
14
|
+
export { createSolanaSignerFromWalletStandard } from './injected/walletStandard/createSolanaSignerFromWalletStandard/createSolanaSignerFromWalletStandard.js';
|
|
15
|
+
export { getWalletStandardWallets } from './injected/walletStandard/getWalletStandardWallets/getWalletStandardWallets.js';
|
|
16
|
+
export { hasAllWalletStandardRequiredFeatures } from './injected/walletStandard/hasAllWalletStandardRequiredFeatures/hasAllWalletStandardRequiredFeatures.js';
|
|
17
|
+
export { fetchCluster } from './utils/fetchCluster/fetchCluster.js';
|
|
11
18
|
|
|
12
19
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
13
20
|
assertPackageVersion('@dynamic-labs/solana', version);
|
|
@@ -11,6 +11,7 @@ var InjectedWalletBase = require('./InjectedWalletBase/InjectedWalletBase.cjs');
|
|
|
11
11
|
var BackpackSol = require('./BackpackSol/BackpackSol.cjs');
|
|
12
12
|
var getConnectorConstructorForWalletStandardWallet = require('./walletStandard/getConnectorConstructorForWalletStandardWallet/getConnectorConstructorForWalletStandardWallet.cjs');
|
|
13
13
|
var getWalletStandardWallets = require('./walletStandard/getWalletStandardWallets/getWalletStandardWallets.cjs');
|
|
14
|
+
var hasAllWalletStandardRequiredFeatures = require('./walletStandard/hasAllWalletStandardRequiredFeatures/hasAllWalletStandardRequiredFeatures.cjs');
|
|
14
15
|
|
|
15
16
|
const injectedWalletOverrides = [
|
|
16
17
|
CoinbaseSolana.CoinbaseSolana,
|
|
@@ -25,7 +26,7 @@ const walletsWithCustomConnectors = [
|
|
|
25
26
|
'solflare',
|
|
26
27
|
];
|
|
27
28
|
const shouldAddWalletStandardConnector = (wallet, walletBook) => {
|
|
28
|
-
var _a
|
|
29
|
+
var _a;
|
|
29
30
|
const { name } = wallet;
|
|
30
31
|
const chain = 'sol';
|
|
31
32
|
const connectorKey = `${utils.sanitizeName(name)}${chain}`;
|
|
@@ -42,11 +43,7 @@ const shouldAddWalletStandardConnector = (wallet, walletBook) => {
|
|
|
42
43
|
isNotWalletStandard);
|
|
43
44
|
};
|
|
44
45
|
const shouldHandleFromWalletBook = Object.entries((_a = walletBook === null || walletBook === void 0 ? void 0 : walletBook.wallets) !== null && _a !== void 0 ? _a : {}).find(shouldHandleWalletFromWalletBook);
|
|
45
|
-
const hasAllFeatures =
|
|
46
|
-
((_c = wallet.features) === null || _c === void 0 ? void 0 : _c['standard:connect']) &&
|
|
47
|
-
((_d = wallet.features) === null || _d === void 0 ? void 0 : _d['solana:signMessage']) &&
|
|
48
|
-
((_e = wallet.features) === null || _e === void 0 ? void 0 : _e['solana:signTransaction']) &&
|
|
49
|
-
((_f = wallet.features) === null || _f === void 0 ? void 0 : _f['solana:signAndSendTransaction']));
|
|
46
|
+
const hasAllFeatures = hasAllWalletStandardRequiredFeatures.hasAllWalletStandardRequiredFeatures(wallet);
|
|
50
47
|
logger.logger.logVerboseTroubleshootingMessage('[SOL shouldAddWalletStandardConnector]', {
|
|
51
48
|
hasAllFeatures,
|
|
52
49
|
shouldAdd: !shouldHandleFromWalletBook && hasAllFeatures,
|
|
@@ -7,6 +7,7 @@ import { InjectedWalletBase } from './InjectedWalletBase/InjectedWalletBase.js';
|
|
|
7
7
|
import { BackpackSol } from './BackpackSol/BackpackSol.js';
|
|
8
8
|
import { getConnectorConstructorForWalletStandardWallet } from './walletStandard/getConnectorConstructorForWalletStandardWallet/getConnectorConstructorForWalletStandardWallet.js';
|
|
9
9
|
import { getWalletStandardWallets } from './walletStandard/getWalletStandardWallets/getWalletStandardWallets.js';
|
|
10
|
+
import { hasAllWalletStandardRequiredFeatures } from './walletStandard/hasAllWalletStandardRequiredFeatures/hasAllWalletStandardRequiredFeatures.js';
|
|
10
11
|
|
|
11
12
|
const injectedWalletOverrides = [
|
|
12
13
|
CoinbaseSolana,
|
|
@@ -21,7 +22,7 @@ const walletsWithCustomConnectors = [
|
|
|
21
22
|
'solflare',
|
|
22
23
|
];
|
|
23
24
|
const shouldAddWalletStandardConnector = (wallet, walletBook) => {
|
|
24
|
-
var _a
|
|
25
|
+
var _a;
|
|
25
26
|
const { name } = wallet;
|
|
26
27
|
const chain = 'sol';
|
|
27
28
|
const connectorKey = `${sanitizeName(name)}${chain}`;
|
|
@@ -38,11 +39,7 @@ const shouldAddWalletStandardConnector = (wallet, walletBook) => {
|
|
|
38
39
|
isNotWalletStandard);
|
|
39
40
|
};
|
|
40
41
|
const shouldHandleFromWalletBook = Object.entries((_a = walletBook === null || walletBook === void 0 ? void 0 : walletBook.wallets) !== null && _a !== void 0 ? _a : {}).find(shouldHandleWalletFromWalletBook);
|
|
41
|
-
const hasAllFeatures =
|
|
42
|
-
((_c = wallet.features) === null || _c === void 0 ? void 0 : _c['standard:connect']) &&
|
|
43
|
-
((_d = wallet.features) === null || _d === void 0 ? void 0 : _d['solana:signMessage']) &&
|
|
44
|
-
((_e = wallet.features) === null || _e === void 0 ? void 0 : _e['solana:signTransaction']) &&
|
|
45
|
-
((_f = wallet.features) === null || _f === void 0 ? void 0 : _f['solana:signAndSendTransaction']));
|
|
42
|
+
const hasAllFeatures = hasAllWalletStandardRequiredFeatures(wallet);
|
|
46
43
|
logger.logVerboseTroubleshootingMessage('[SOL shouldAddWalletStandardConnector]', {
|
|
47
44
|
hasAllFeatures,
|
|
48
45
|
shouldAdd: !shouldHandleFromWalletBook && hasAllFeatures,
|
package/src/injected/index.d.ts
CHANGED
|
@@ -1,2 +1,5 @@
|
|
|
1
1
|
export * from './fetchInjectedWalletConnectors';
|
|
2
2
|
export * from './FallbackSolanaConnector';
|
|
3
|
+
export * from './walletStandard/getWalletStandardWallets';
|
|
4
|
+
export * from './walletStandard/createSolanaSignerFromWalletStandard';
|
|
5
|
+
export * from './walletStandard/hasAllWalletStandardRequiredFeatures';
|
|
@@ -5,11 +5,11 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
|
|
6
6
|
var _tslib = require('../../../../_virtual/_tslib.cjs');
|
|
7
7
|
var web3_js = require('@solana/web3.js');
|
|
8
|
-
var fetchCluster = require('../../../phantomRedirect/fetchCluster/fetchCluster.cjs');
|
|
9
8
|
var logger = require('../../../utils/logger.cjs');
|
|
9
|
+
var fetchCluster = require('../../../utils/fetchCluster/fetchCluster.cjs');
|
|
10
10
|
|
|
11
11
|
const isVersionedTransaction = (transaction) => !('instructions' in transaction);
|
|
12
|
-
const createSolanaSignerFromWalletStandard = (wallet, walletConnector) => {
|
|
12
|
+
const createSolanaSignerFromWalletStandard = ({ wallet, walletConnector, network, genesisHashesMap, }) => {
|
|
13
13
|
const features = wallet.features;
|
|
14
14
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
15
15
|
const connect = (args) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -47,8 +47,8 @@ const createSolanaSignerFromWalletStandard = (wallet, walletConnector) => {
|
|
|
47
47
|
});
|
|
48
48
|
const getChain = () => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
49
49
|
var _c, _d;
|
|
50
|
-
const rpc = (_d = (_c =
|
|
51
|
-
const cluster = yield fetchCluster.fetchCluster(rpc);
|
|
50
|
+
const rpc = (_d = (_c = network.privateCustomerRpcUrls) === null || _c === void 0 ? void 0 : _c[0]) !== null && _d !== void 0 ? _d : network.rpcUrls[0];
|
|
51
|
+
const cluster = yield fetchCluster.fetchCluster(rpc, genesisHashesMap);
|
|
52
52
|
return `solana:${cluster}`;
|
|
53
53
|
});
|
|
54
54
|
const signTransaction = (transaction) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
import { Wallet } from '@wallet-standard/base';
|
|
2
2
|
import { ISolana } from '@dynamic-labs/solana-core';
|
|
3
|
+
import { GenericNetwork } from '@dynamic-labs/types';
|
|
3
4
|
import { InjectedWalletBase } from '../../InjectedWalletBase';
|
|
4
|
-
|
|
5
|
+
type CreateSolanaSignerFromWalletStandardProps = {
|
|
6
|
+
wallet: Wallet;
|
|
7
|
+
walletConnector: InjectedWalletBase;
|
|
8
|
+
network: GenericNetwork;
|
|
9
|
+
genesisHashesMap?: Record<string, string>;
|
|
10
|
+
};
|
|
11
|
+
export declare const createSolanaSignerFromWalletStandard: ({ wallet, walletConnector, network, genesisHashesMap, }: CreateSolanaSignerFromWalletStandardProps) => ISolana;
|
|
12
|
+
export {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import { __awaiter } from '../../../../_virtual/_tslib.js';
|
|
3
3
|
import { PublicKey, VersionedTransaction, Transaction } from '@solana/web3.js';
|
|
4
|
-
import { fetchCluster } from '../../../phantomRedirect/fetchCluster/fetchCluster.js';
|
|
5
4
|
import { logger } from '../../../utils/logger.js';
|
|
5
|
+
import { fetchCluster } from '../../../utils/fetchCluster/fetchCluster.js';
|
|
6
6
|
|
|
7
7
|
const isVersionedTransaction = (transaction) => !('instructions' in transaction);
|
|
8
|
-
const createSolanaSignerFromWalletStandard = (wallet, walletConnector) => {
|
|
8
|
+
const createSolanaSignerFromWalletStandard = ({ wallet, walletConnector, network, genesisHashesMap, }) => {
|
|
9
9
|
const features = wallet.features;
|
|
10
10
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
11
11
|
const connect = (args) => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -43,8 +43,8 @@ const createSolanaSignerFromWalletStandard = (wallet, walletConnector) => {
|
|
|
43
43
|
});
|
|
44
44
|
const getChain = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
45
45
|
var _c, _d;
|
|
46
|
-
const rpc = (_d = (_c =
|
|
47
|
-
const cluster = yield fetchCluster(rpc);
|
|
46
|
+
const rpc = (_d = (_c = network.privateCustomerRpcUrls) === null || _c === void 0 ? void 0 : _c[0]) !== null && _d !== void 0 ? _d : network.rpcUrls[0];
|
|
47
|
+
const cluster = yield fetchCluster(rpc, genesisHashesMap);
|
|
48
48
|
return `solana:${cluster}`;
|
|
49
49
|
});
|
|
50
50
|
const signTransaction = (transaction) => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -19,9 +19,14 @@ const getConnectorConstructorForWalletStandardWallet = (wallet) => {
|
|
|
19
19
|
} }));
|
|
20
20
|
this.name = wallet.name;
|
|
21
21
|
this.overrideKey = `${sanitizedName}sol`;
|
|
22
|
+
this._provider = createSolanaSignerFromWalletStandard.createSolanaSignerFromWalletStandard({
|
|
23
|
+
network: this.solNetworks[0],
|
|
24
|
+
wallet,
|
|
25
|
+
walletConnector: this,
|
|
26
|
+
});
|
|
22
27
|
}
|
|
23
28
|
findProvider() {
|
|
24
|
-
return
|
|
29
|
+
return this._provider;
|
|
25
30
|
}
|
|
26
31
|
};
|
|
27
32
|
};
|
|
@@ -15,9 +15,14 @@ const getConnectorConstructorForWalletStandardWallet = (wallet) => {
|
|
|
15
15
|
} }));
|
|
16
16
|
this.name = wallet.name;
|
|
17
17
|
this.overrideKey = `${sanitizedName}sol`;
|
|
18
|
+
this._provider = createSolanaSignerFromWalletStandard({
|
|
19
|
+
network: this.solNetworks[0],
|
|
20
|
+
wallet,
|
|
21
|
+
walletConnector: this,
|
|
22
|
+
});
|
|
18
23
|
}
|
|
19
24
|
findProvider() {
|
|
20
|
-
return
|
|
25
|
+
return this._provider;
|
|
21
26
|
}
|
|
22
27
|
};
|
|
23
28
|
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
const hasAllWalletStandardRequiredFeatures = (wallet) => {
|
|
7
|
+
var _a, _b, _c, _d, _e;
|
|
8
|
+
return Boolean(((_a = wallet.features) === null || _a === void 0 ? void 0 : _a['standard:events']) &&
|
|
9
|
+
((_b = wallet.features) === null || _b === void 0 ? void 0 : _b['standard:connect']) &&
|
|
10
|
+
((_c = wallet.features) === null || _c === void 0 ? void 0 : _c['solana:signMessage']) &&
|
|
11
|
+
((_d = wallet.features) === null || _d === void 0 ? void 0 : _d['solana:signTransaction']) &&
|
|
12
|
+
((_e = wallet.features) === null || _e === void 0 ? void 0 : _e['solana:signAndSendTransaction']));
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
exports.hasAllWalletStandardRequiredFeatures = hasAllWalletStandardRequiredFeatures;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
const hasAllWalletStandardRequiredFeatures = (wallet) => {
|
|
3
|
+
var _a, _b, _c, _d, _e;
|
|
4
|
+
return Boolean(((_a = wallet.features) === null || _a === void 0 ? void 0 : _a['standard:events']) &&
|
|
5
|
+
((_b = wallet.features) === null || _b === void 0 ? void 0 : _b['standard:connect']) &&
|
|
6
|
+
((_c = wallet.features) === null || _c === void 0 ? void 0 : _c['solana:signMessage']) &&
|
|
7
|
+
((_d = wallet.features) === null || _d === void 0 ? void 0 : _d['solana:signTransaction']) &&
|
|
8
|
+
((_e = wallet.features) === null || _e === void 0 ? void 0 : _e['solana:signAndSendTransaction']));
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export { hasAllWalletStandardRequiredFeatures };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { hasAllWalletStandardRequiredFeatures } from './hasAllWalletStandardRequiredFeatures';
|
|
@@ -11,8 +11,8 @@ var solanaCore = require('@dynamic-labs/solana-core');
|
|
|
11
11
|
var buildUrl = require('../buildUrl/buildUrl.cjs');
|
|
12
12
|
var decryptPayload = require('../decryptPayload/decryptPayload.cjs');
|
|
13
13
|
var encryptPayload = require('../encryptPayload/encryptPayload.cjs');
|
|
14
|
-
var fetchCluster = require('../fetchCluster/fetchCluster.cjs');
|
|
15
14
|
var storage = require('../storage/storage.cjs');
|
|
15
|
+
var fetchCluster = require('../../utils/fetchCluster/fetchCluster.cjs');
|
|
16
16
|
|
|
17
17
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
18
18
|
|
|
@@ -7,8 +7,8 @@ import { SolanaWalletConnector } from '@dynamic-labs/solana-core';
|
|
|
7
7
|
import { buildUrl } from '../buildUrl/buildUrl.js';
|
|
8
8
|
import { decryptPayload } from '../decryptPayload/decryptPayload.js';
|
|
9
9
|
import { encryptPayload } from '../encryptPayload/encryptPayload.js';
|
|
10
|
-
import { fetchCluster } from '../fetchCluster/fetchCluster.js';
|
|
11
10
|
import { storage, clearStorage } from '../storage/storage.js';
|
|
11
|
+
import { fetchCluster } from '../../utils/fetchCluster/fetchCluster.js';
|
|
12
12
|
|
|
13
13
|
class PhantomRedirect extends SolanaWalletConnector {
|
|
14
14
|
constructor(props) {
|
|
@@ -10,7 +10,7 @@ const GENESIS_HASHES = {
|
|
|
10
10
|
'5eykt4UsFv8P8NJdTREpY1vzqKqZKvdpKuc147dw2N9d': 'mainnet-beta',
|
|
11
11
|
EtWTRABZaYq6iMfeYKouRu166VU2xqa1wcaWoxPkrZBG: 'devnet',
|
|
12
12
|
};
|
|
13
|
-
const fetchCluster = (
|
|
13
|
+
const fetchCluster = (rpc_1, ...args_1) => _tslib.__awaiter(void 0, [rpc_1, ...args_1], void 0, function* (rpc, genesisHashesMap = GENESIS_HASHES) {
|
|
14
14
|
try {
|
|
15
15
|
const { result } = yield (yield fetch(rpc, {
|
|
16
16
|
body: JSON.stringify({
|
|
@@ -23,7 +23,7 @@ const fetchCluster = (rpc) => _tslib.__awaiter(void 0, void 0, void 0, function*
|
|
|
23
23
|
},
|
|
24
24
|
method: 'POST',
|
|
25
25
|
})).json();
|
|
26
|
-
return
|
|
26
|
+
return genesisHashesMap[result];
|
|
27
27
|
}
|
|
28
28
|
catch (err) {
|
|
29
29
|
return 'mainnet-beta';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const fetchCluster: (rpc: string, genesisHashesMap?: Record<string, string>) => Promise<string>;
|
|
@@ -6,7 +6,7 @@ const GENESIS_HASHES = {
|
|
|
6
6
|
'5eykt4UsFv8P8NJdTREpY1vzqKqZKvdpKuc147dw2N9d': 'mainnet-beta',
|
|
7
7
|
EtWTRABZaYq6iMfeYKouRu166VU2xqa1wcaWoxPkrZBG: 'devnet',
|
|
8
8
|
};
|
|
9
|
-
const fetchCluster = (
|
|
9
|
+
const fetchCluster = (rpc_1, ...args_1) => __awaiter(void 0, [rpc_1, ...args_1], void 0, function* (rpc, genesisHashesMap = GENESIS_HASHES) {
|
|
10
10
|
try {
|
|
11
11
|
const { result } = yield (yield fetch(rpc, {
|
|
12
12
|
body: JSON.stringify({
|
|
@@ -19,7 +19,7 @@ const fetchCluster = (rpc) => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
19
19
|
},
|
|
20
20
|
method: 'POST',
|
|
21
21
|
})).json();
|
|
22
|
-
return
|
|
22
|
+
return genesisHashesMap[result];
|
|
23
23
|
}
|
|
24
24
|
catch (err) {
|
|
25
25
|
return 'mainnet-beta';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const fetchCluster: (rpc: string) => Promise<string>;
|
|
File without changes
|