@dynamic-labs/multi-wallet 4.0.0-alpha.38 → 4.0.0-alpha.39
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 +14 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +7 -7
- package/src/index.cjs +2 -0
- package/src/index.js +1 -0
- package/src/utils/getSupportedWallets/applyLinksOverrides/applyLinksOverrides.cjs +4 -3
- package/src/utils/getSupportedWallets/applyLinksOverrides/applyLinksOverrides.js +4 -3
- package/src/utils/getSupportedWallets/getSupportedWallets.cjs +3 -37
- package/src/utils/getSupportedWallets/getSupportedWallets.js +4 -38
- package/src/utils/getWalletConnectorConstructorOptions/getWalletConnectorConstructorOptions.cjs +42 -0
- package/src/utils/getWalletConnectorConstructorOptions/getWalletConnectorConstructorOptions.d.ts +162 -0
- package/src/utils/getWalletConnectorConstructorOptions/getWalletConnectorConstructorOptions.js +38 -0
- package/src/utils/getWalletConnectorConstructorOptions/index.d.ts +1 -0
- package/src/utils/index.d.ts +1 -0
- /package/src/{utils/getSupportedWallets/const.cjs → const.cjs} +0 -0
- /package/src/{utils/getSupportedWallets/const.d.ts → const.d.ts} +0 -0
- /package/src/{utils/getSupportedWallets/const.js → const.js} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
|
|
2
|
+
## [4.0.0-alpha.39](https://github.com/dynamic-labs/dynamic-auth/compare/v4.0.0-alpha.38...v4.0.0-alpha.39) (2024-12-02)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### ⚠ BREAKING CHANGES
|
|
6
|
+
|
|
7
|
+
* remove usages of findWalletBookWallet when possible (#7455)
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* sdkHasLoaded always false in cookie enabled env ([#7516](https://github.com/dynamic-labs/dynamic-auth/issues/7516)) ([1c3335c](https://github.com/dynamic-labs/dynamic-auth/commit/1c3335c13930e9bffe60cf1c09bc9c9584a59ef7))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
* remove usages of findWalletBookWallet when possible ([#7455](https://github.com/dynamic-labs/dynamic-auth/issues/7455)) ([0ce977d](https://github.com/dynamic-labs/dynamic-auth/commit/0ce977d5d4d591c371c6ea2edfb252ba7acff5d2))
|
|
15
|
+
|
|
2
16
|
## [4.0.0-alpha.38](https://github.com/dynamic-labs/dynamic-auth/compare/v4.0.0-alpha.37...v4.0.0-alpha.38) (2024-11-27)
|
|
3
17
|
|
|
4
18
|
|
package/package.cjs
CHANGED
package/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/multi-wallet",
|
|
3
|
-
"version": "4.0.0-alpha.
|
|
3
|
+
"version": "4.0.0-alpha.39",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@dynamic-labs/sdk-api-core": "0.0.570",
|
|
6
6
|
"tslib": "2.4.1",
|
|
7
|
-
"@dynamic-labs/assert-package-version": "4.0.0-alpha.
|
|
8
|
-
"@dynamic-labs/rpc-providers": "4.0.0-alpha.
|
|
9
|
-
"@dynamic-labs/types": "4.0.0-alpha.
|
|
10
|
-
"@dynamic-labs/utils": "4.0.0-alpha.
|
|
11
|
-
"@dynamic-labs/wallet-book": "4.0.0-alpha.
|
|
12
|
-
"@dynamic-labs/wallet-connector-core": "4.0.0-alpha.
|
|
7
|
+
"@dynamic-labs/assert-package-version": "4.0.0-alpha.39",
|
|
8
|
+
"@dynamic-labs/rpc-providers": "4.0.0-alpha.39",
|
|
9
|
+
"@dynamic-labs/types": "4.0.0-alpha.39",
|
|
10
|
+
"@dynamic-labs/utils": "4.0.0-alpha.39",
|
|
11
|
+
"@dynamic-labs/wallet-book": "4.0.0-alpha.39",
|
|
12
|
+
"@dynamic-labs/wallet-connector-core": "4.0.0-alpha.39"
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
15
|
"@walletconnect/types": "2.10.6"
|
package/src/index.cjs
CHANGED
|
@@ -10,6 +10,7 @@ var getEnabledProviders = require('./utils/getEnabledProviders/getEnabledProvide
|
|
|
10
10
|
var getEnabledWallets = require('./utils/getEnabledWallets/getEnabledWallets.cjs');
|
|
11
11
|
var getSupportedWallets = require('./utils/getSupportedWallets/getSupportedWallets.cjs');
|
|
12
12
|
var getSupportedChainsForWalletConnector = require('./utils/getSupportedChainsForWalletConnector/getSupportedChainsForWalletConnector.cjs');
|
|
13
|
+
var getWalletConnectorConstructorOptions = require('./utils/getWalletConnectorConstructorOptions/getWalletConnectorConstructorOptions.cjs');
|
|
13
14
|
|
|
14
15
|
assertPackageVersion.assertPackageVersion('@dynamic-labs/multi-wallet', _package.version);
|
|
15
16
|
|
|
@@ -18,3 +19,4 @@ exports.getEnabledProviders = getEnabledProviders.getEnabledProviders;
|
|
|
18
19
|
exports.getEnabledWallets = getEnabledWallets.getEnabledWallets;
|
|
19
20
|
exports.getSupportedWallets = getSupportedWallets.getSupportedWallets;
|
|
20
21
|
exports.getSupportedChainsForWalletConnector = getSupportedChainsForWalletConnector.getSupportedChainsForWalletConnector;
|
|
22
|
+
exports.getWalletConnectorConstructorOptions = getWalletConnectorConstructorOptions.getWalletConnectorConstructorOptions;
|
package/src/index.js
CHANGED
|
@@ -6,5 +6,6 @@ export { getEnabledProviders } from './utils/getEnabledProviders/getEnabledProvi
|
|
|
6
6
|
export { getEnabledWallets } from './utils/getEnabledWallets/getEnabledWallets.js';
|
|
7
7
|
export { getSupportedWallets } from './utils/getSupportedWallets/getSupportedWallets.js';
|
|
8
8
|
export { getSupportedChainsForWalletConnector } from './utils/getSupportedChainsForWalletConnector/getSupportedChainsForWalletConnector.js';
|
|
9
|
+
export { getWalletConnectorConstructorOptions } from './utils/getWalletConnectorConstructorOptions/getWalletConnectorConstructorOptions.js';
|
|
9
10
|
|
|
10
11
|
assertPackageVersion('@dynamic-labs/multi-wallet', version);
|
|
@@ -6,9 +6,10 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
6
6
|
var walletBook = require('@dynamic-labs/wallet-book');
|
|
7
7
|
|
|
8
8
|
const applyLinksOverrides = (walletBook$1, wallets) => wallets.map((wallet) => {
|
|
9
|
-
const
|
|
10
|
-
if (
|
|
11
|
-
wallet.switchNetworkOnlyFromWallet =
|
|
9
|
+
const walletData = walletBook.getWalletBookWallet(walletBook$1, wallet.key, wallet.walletFallback);
|
|
10
|
+
if (walletData.switchNetworkOnlyFromWallet !== undefined) {
|
|
11
|
+
wallet.switchNetworkOnlyFromWallet =
|
|
12
|
+
walletData.switchNetworkOnlyFromWallet;
|
|
12
13
|
}
|
|
13
14
|
return wallet;
|
|
14
15
|
});
|
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
import { getWalletBookWallet } from '@dynamic-labs/wallet-book';
|
|
3
3
|
|
|
4
4
|
const applyLinksOverrides = (walletBook, wallets) => wallets.map((wallet) => {
|
|
5
|
-
const
|
|
6
|
-
if (
|
|
7
|
-
wallet.switchNetworkOnlyFromWallet =
|
|
5
|
+
const walletData = getWalletBookWallet(walletBook, wallet.key, wallet.walletFallback);
|
|
6
|
+
if (walletData.switchNetworkOnlyFromWallet !== undefined) {
|
|
7
|
+
wallet.switchNetworkOnlyFromWallet =
|
|
8
|
+
walletData.switchNetworkOnlyFromWallet;
|
|
8
9
|
}
|
|
9
10
|
return wallet;
|
|
10
11
|
});
|
|
@@ -4,55 +4,21 @@
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
6
|
var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
|
|
7
|
-
var
|
|
8
|
-
var getEnabledProviders = require('../getEnabledProviders/getEnabledProviders.cjs');
|
|
7
|
+
var getWalletConnectorConstructorOptions = require('../getWalletConnectorConstructorOptions/getWalletConnectorConstructorOptions.cjs');
|
|
9
8
|
var filterWalletsForPlatform = require('./filterWalletsForPlatform/filterWalletsForPlatform.cjs');
|
|
10
9
|
var applyLinksOverrides = require('./applyLinksOverrides/applyLinksOverrides.cjs');
|
|
11
|
-
var _const = require('./const.cjs');
|
|
12
10
|
|
|
13
11
|
// needs to be a global variable, otherwise it breaks the list of wallets in the dashboard
|
|
14
12
|
// https://linear.app/dynamic-labs/issue/QNTM-2642/update-to-getsupportedwallets-broke-the-list-of-wallets-on-the
|
|
15
13
|
let walletConnectors = [];
|
|
16
14
|
const getSupportedWallets = (args) => {
|
|
17
15
|
var _a;
|
|
18
|
-
const {
|
|
19
|
-
cosmos: [],
|
|
20
|
-
eclipse: [],
|
|
21
|
-
evm: [],
|
|
22
|
-
solana: [],
|
|
23
|
-
starknet: [],
|
|
24
|
-
}, settings, skipMemo = false, walletConnectProjectId = '', walletConnectorsProp, walletUiUtils = undefined, walletBook, walletConnectPreferredChains, } = args;
|
|
16
|
+
const { settings, skipMemo = false, walletConnectorsProp, walletBook } = args;
|
|
25
17
|
if (!skipMemo && walletConnectors.length > 0) {
|
|
26
18
|
return walletConnectors;
|
|
27
19
|
}
|
|
28
|
-
const eclipseNetworkConfigs = (networkConfigurations === null || networkConfigurations === void 0 ? void 0 : networkConfigurations.eclipse) || [];
|
|
29
|
-
const evmNetworkConfigs = (networkConfigurations === null || networkConfigurations === void 0 ? void 0 : networkConfigurations.evm) || [];
|
|
30
|
-
const solanaNetworkConfigs = (networkConfigurations === null || networkConfigurations === void 0 ? void 0 : networkConfigurations.solana) || [];
|
|
31
|
-
const cosmosNetworkConfigs = (networkConfigurations === null || networkConfigurations === void 0 ? void 0 : networkConfigurations.cosmos) || [];
|
|
32
|
-
const starknetNetworkConfigs = (networkConfigurations === null || networkConfigurations === void 0 ? void 0 : networkConfigurations.starknet) || [];
|
|
33
|
-
const apiProviders = getApiProviders.getApiProviders(getEnabledProviders.getEnabledProviders(settings.providers));
|
|
34
20
|
const disabledConnectors = (_a = settings.sdk.disabledWalletConnectors) !== null && _a !== void 0 ? _a : [];
|
|
35
|
-
const opts =
|
|
36
|
-
apiProviders,
|
|
37
|
-
appLogoUrl,
|
|
38
|
-
appName,
|
|
39
|
-
chainRpcProviders,
|
|
40
|
-
coinbaseWalletPreference,
|
|
41
|
-
cosmosNetworks: cosmosNetworkConfigs,
|
|
42
|
-
deepLinkPreference,
|
|
43
|
-
eclipseNetworks: eclipseNetworkConfigs,
|
|
44
|
-
evmNetworks: evmNetworkConfigs,
|
|
45
|
-
flowNetwork,
|
|
46
|
-
mobileExperience,
|
|
47
|
-
projectId: walletConnectProjectId,
|
|
48
|
-
settings,
|
|
49
|
-
solNetworks: solanaNetworkConfigs,
|
|
50
|
-
starknetNetworks: starknetNetworkConfigs,
|
|
51
|
-
walletBook,
|
|
52
|
-
walletConnectPreferredChains,
|
|
53
|
-
walletConnectorEventsEmitter: walletConnectorCore.walletConnectorEvents,
|
|
54
|
-
walletUiUtils: walletUiUtils || _const.defaultWalletUiUtils,
|
|
55
|
-
};
|
|
21
|
+
const opts = getWalletConnectorConstructorOptions.getWalletConnectorConstructorOptions(args);
|
|
56
22
|
const allWalletConnectors = walletConnectorsProp
|
|
57
23
|
.map((getWalletConnectorConstructors) => getWalletConnectorConstructors(opts))
|
|
58
24
|
.flat()
|
|
@@ -1,54 +1,20 @@
|
|
|
1
1
|
'use client'
|
|
2
|
-
import { logger
|
|
3
|
-
import {
|
|
4
|
-
import { getEnabledProviders } from '../getEnabledProviders/getEnabledProviders.js';
|
|
2
|
+
import { logger } from '@dynamic-labs/wallet-connector-core';
|
|
3
|
+
import { getWalletConnectorConstructorOptions } from '../getWalletConnectorConstructorOptions/getWalletConnectorConstructorOptions.js';
|
|
5
4
|
import { filterWalletsForPlatform } from './filterWalletsForPlatform/filterWalletsForPlatform.js';
|
|
6
5
|
import { applyLinksOverrides } from './applyLinksOverrides/applyLinksOverrides.js';
|
|
7
|
-
import { defaultWalletUiUtils } from './const.js';
|
|
8
6
|
|
|
9
7
|
// needs to be a global variable, otherwise it breaks the list of wallets in the dashboard
|
|
10
8
|
// https://linear.app/dynamic-labs/issue/QNTM-2642/update-to-getsupportedwallets-broke-the-list-of-wallets-on-the
|
|
11
9
|
let walletConnectors = [];
|
|
12
10
|
const getSupportedWallets = (args) => {
|
|
13
11
|
var _a;
|
|
14
|
-
const {
|
|
15
|
-
cosmos: [],
|
|
16
|
-
eclipse: [],
|
|
17
|
-
evm: [],
|
|
18
|
-
solana: [],
|
|
19
|
-
starknet: [],
|
|
20
|
-
}, settings, skipMemo = false, walletConnectProjectId = '', walletConnectorsProp, walletUiUtils = undefined, walletBook, walletConnectPreferredChains, } = args;
|
|
12
|
+
const { settings, skipMemo = false, walletConnectorsProp, walletBook } = args;
|
|
21
13
|
if (!skipMemo && walletConnectors.length > 0) {
|
|
22
14
|
return walletConnectors;
|
|
23
15
|
}
|
|
24
|
-
const eclipseNetworkConfigs = (networkConfigurations === null || networkConfigurations === void 0 ? void 0 : networkConfigurations.eclipse) || [];
|
|
25
|
-
const evmNetworkConfigs = (networkConfigurations === null || networkConfigurations === void 0 ? void 0 : networkConfigurations.evm) || [];
|
|
26
|
-
const solanaNetworkConfigs = (networkConfigurations === null || networkConfigurations === void 0 ? void 0 : networkConfigurations.solana) || [];
|
|
27
|
-
const cosmosNetworkConfigs = (networkConfigurations === null || networkConfigurations === void 0 ? void 0 : networkConfigurations.cosmos) || [];
|
|
28
|
-
const starknetNetworkConfigs = (networkConfigurations === null || networkConfigurations === void 0 ? void 0 : networkConfigurations.starknet) || [];
|
|
29
|
-
const apiProviders = getApiProviders(getEnabledProviders(settings.providers));
|
|
30
16
|
const disabledConnectors = (_a = settings.sdk.disabledWalletConnectors) !== null && _a !== void 0 ? _a : [];
|
|
31
|
-
const opts =
|
|
32
|
-
apiProviders,
|
|
33
|
-
appLogoUrl,
|
|
34
|
-
appName,
|
|
35
|
-
chainRpcProviders,
|
|
36
|
-
coinbaseWalletPreference,
|
|
37
|
-
cosmosNetworks: cosmosNetworkConfigs,
|
|
38
|
-
deepLinkPreference,
|
|
39
|
-
eclipseNetworks: eclipseNetworkConfigs,
|
|
40
|
-
evmNetworks: evmNetworkConfigs,
|
|
41
|
-
flowNetwork,
|
|
42
|
-
mobileExperience,
|
|
43
|
-
projectId: walletConnectProjectId,
|
|
44
|
-
settings,
|
|
45
|
-
solNetworks: solanaNetworkConfigs,
|
|
46
|
-
starknetNetworks: starknetNetworkConfigs,
|
|
47
|
-
walletBook,
|
|
48
|
-
walletConnectPreferredChains,
|
|
49
|
-
walletConnectorEventsEmitter: walletConnectorEvents,
|
|
50
|
-
walletUiUtils: walletUiUtils || defaultWalletUiUtils,
|
|
51
|
-
};
|
|
17
|
+
const opts = getWalletConnectorConstructorOptions(args);
|
|
52
18
|
const allWalletConnectors = walletConnectorsProp
|
|
53
19
|
.map((getWalletConnectorConstructors) => getWalletConnectorConstructors(opts))
|
|
54
20
|
.flat()
|
package/src/utils/getWalletConnectorConstructorOptions/getWalletConnectorConstructorOptions.cjs
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
|
|
7
|
+
var getEnabledProviders = require('../getEnabledProviders/getEnabledProviders.cjs');
|
|
8
|
+
var getApiProviders = require('../getApiProviders/getApiProviders.cjs');
|
|
9
|
+
var _const = require('../../const.cjs');
|
|
10
|
+
|
|
11
|
+
const getWalletConnectorConstructorOptions = ({ appLogoUrl, appName, coinbaseWalletPreference, chainRpcProviders, deepLinkPreference, flowNetwork, mobileExperience, networkConfigurations, settings, walletConnectProjectId, walletUiUtils, walletBook, walletConnectPreferredChains, }) => {
|
|
12
|
+
const eclipseNetworkConfigs = (networkConfigurations === null || networkConfigurations === void 0 ? void 0 : networkConfigurations.eclipse) || [];
|
|
13
|
+
const evmNetworkConfigs = (networkConfigurations === null || networkConfigurations === void 0 ? void 0 : networkConfigurations.evm) || [];
|
|
14
|
+
const solanaNetworkConfigs = (networkConfigurations === null || networkConfigurations === void 0 ? void 0 : networkConfigurations.solana) || [];
|
|
15
|
+
const cosmosNetworkConfigs = (networkConfigurations === null || networkConfigurations === void 0 ? void 0 : networkConfigurations.cosmos) || [];
|
|
16
|
+
const starknetNetworkConfigs = (networkConfigurations === null || networkConfigurations === void 0 ? void 0 : networkConfigurations.starknet) || [];
|
|
17
|
+
const apiProviders = getApiProviders.getApiProviders(getEnabledProviders.getEnabledProviders(settings.providers));
|
|
18
|
+
const opts = {
|
|
19
|
+
apiProviders,
|
|
20
|
+
appLogoUrl,
|
|
21
|
+
appName,
|
|
22
|
+
chainRpcProviders,
|
|
23
|
+
coinbaseWalletPreference,
|
|
24
|
+
cosmosNetworks: cosmosNetworkConfigs,
|
|
25
|
+
deepLinkPreference,
|
|
26
|
+
eclipseNetworks: eclipseNetworkConfigs,
|
|
27
|
+
evmNetworks: evmNetworkConfigs,
|
|
28
|
+
flowNetwork,
|
|
29
|
+
mobileExperience,
|
|
30
|
+
projectId: walletConnectProjectId,
|
|
31
|
+
settings,
|
|
32
|
+
solNetworks: solanaNetworkConfigs,
|
|
33
|
+
starknetNetworks: starknetNetworkConfigs,
|
|
34
|
+
walletBook,
|
|
35
|
+
walletConnectPreferredChains,
|
|
36
|
+
walletConnectorEventsEmitter: walletConnectorCore.walletConnectorEvents,
|
|
37
|
+
walletUiUtils: walletUiUtils || _const.defaultWalletUiUtils,
|
|
38
|
+
};
|
|
39
|
+
return opts;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
exports.getWalletConnectorConstructorOptions = getWalletConnectorConstructorOptions;
|
package/src/utils/getWalletConnectorConstructorOptions/getWalletConnectorConstructorOptions.d.ts
ADDED
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { IChainRpcProviders } from '@dynamic-labs/rpc-providers';
|
|
2
|
+
import { ProjectSettings } from '@dynamic-labs/sdk-api-core';
|
|
3
|
+
import { CoinbaseWalletPreference, MobileExperience, NetworkConfigurationMap, WalletUiUtils } from '@dynamic-labs/types';
|
|
4
|
+
import { WalletBookSchema } from '@dynamic-labs/wallet-book';
|
|
5
|
+
import { DeepLinkVariant, InternalWalletConnector } from '@dynamic-labs/wallet-connector-core';
|
|
6
|
+
type WalletConnectorConstructorOptionsParams = {
|
|
7
|
+
appLogoUrl?: string;
|
|
8
|
+
appName?: string;
|
|
9
|
+
coinbaseWalletPreference?: CoinbaseWalletPreference;
|
|
10
|
+
chainRpcProviders: IChainRpcProviders;
|
|
11
|
+
deepLinkPreference?: DeepLinkVariant;
|
|
12
|
+
flowNetwork?: 'mainnet' | 'testnet';
|
|
13
|
+
mobileExperience?: MobileExperience;
|
|
14
|
+
networkConfigurations?: NetworkConfigurationMap;
|
|
15
|
+
settings: ProjectSettings;
|
|
16
|
+
walletBook: WalletBookSchema;
|
|
17
|
+
walletConnectProjectId?: string;
|
|
18
|
+
walletUiUtils?: WalletUiUtils<InternalWalletConnector>;
|
|
19
|
+
walletConnectPreferredChains?: `eip155:${number}`[];
|
|
20
|
+
};
|
|
21
|
+
export declare const getWalletConnectorConstructorOptions: ({ appLogoUrl, appName, coinbaseWalletPreference, chainRpcProviders, deepLinkPreference, flowNetwork, mobileExperience, networkConfigurations, settings, walletConnectProjectId, walletUiUtils, walletBook, walletConnectPreferredChains, }: WalletConnectorConstructorOptionsParams) => {
|
|
22
|
+
apiProviders: {
|
|
23
|
+
emailOnly?: import("@dynamic-labs/sdk-api-core").Provider | undefined;
|
|
24
|
+
magicLink?: import("@dynamic-labs/sdk-api-core").Provider | undefined;
|
|
25
|
+
apple?: import("@dynamic-labs/sdk-api-core").Provider | undefined;
|
|
26
|
+
bitbucket?: import("@dynamic-labs/sdk-api-core").Provider | undefined;
|
|
27
|
+
coinbasesocial?: import("@dynamic-labs/sdk-api-core").Provider | undefined;
|
|
28
|
+
discord?: import("@dynamic-labs/sdk-api-core").Provider | undefined;
|
|
29
|
+
epicgames?: import("@dynamic-labs/sdk-api-core").Provider | undefined;
|
|
30
|
+
facebook?: import("@dynamic-labs/sdk-api-core").Provider | undefined;
|
|
31
|
+
farcaster?: import("@dynamic-labs/sdk-api-core").Provider | undefined;
|
|
32
|
+
github?: import("@dynamic-labs/sdk-api-core").Provider | undefined;
|
|
33
|
+
gitlab?: import("@dynamic-labs/sdk-api-core").Provider | undefined;
|
|
34
|
+
google?: import("@dynamic-labs/sdk-api-core").Provider | undefined;
|
|
35
|
+
instagram?: import("@dynamic-labs/sdk-api-core").Provider | undefined;
|
|
36
|
+
linkedin?: import("@dynamic-labs/sdk-api-core").Provider | undefined;
|
|
37
|
+
microsoft?: import("@dynamic-labs/sdk-api-core").Provider | undefined;
|
|
38
|
+
twitch?: import("@dynamic-labs/sdk-api-core").Provider | undefined;
|
|
39
|
+
twitter?: import("@dynamic-labs/sdk-api-core").Provider | undefined;
|
|
40
|
+
blocto?: import("@dynamic-labs/sdk-api-core").Provider | undefined;
|
|
41
|
+
banxa?: import("@dynamic-labs/sdk-api-core").Provider | undefined;
|
|
42
|
+
dynamic?: import("@dynamic-labs/sdk-api-core").Provider | undefined;
|
|
43
|
+
alchemy?: import("@dynamic-labs/sdk-api-core").Provider | undefined;
|
|
44
|
+
zerodev?: import("@dynamic-labs/sdk-api-core").Provider | undefined;
|
|
45
|
+
telegram?: import("@dynamic-labs/sdk-api-core").Provider | undefined;
|
|
46
|
+
turnkey?: import("@dynamic-labs/sdk-api-core").Provider | undefined;
|
|
47
|
+
coinbaseWaas?: import("@dynamic-labs/sdk-api-core").Provider | undefined;
|
|
48
|
+
sms?: import("@dynamic-labs/sdk-api-core").Provider | undefined;
|
|
49
|
+
spotify?: import("@dynamic-labs/sdk-api-core").Provider | undefined;
|
|
50
|
+
tiktok?: import("@dynamic-labs/sdk-api-core").Provider | undefined;
|
|
51
|
+
line?: import("@dynamic-labs/sdk-api-core").Provider | undefined;
|
|
52
|
+
steam?: import("@dynamic-labs/sdk-api-core").Provider | undefined;
|
|
53
|
+
shopify?: import("@dynamic-labs/sdk-api-core").Provider | undefined;
|
|
54
|
+
};
|
|
55
|
+
appLogoUrl: string | undefined;
|
|
56
|
+
appName: string | undefined;
|
|
57
|
+
chainRpcProviders: IChainRpcProviders;
|
|
58
|
+
coinbaseWalletPreference: CoinbaseWalletPreference | undefined;
|
|
59
|
+
cosmosNetworks: import("@dynamic-labs/types").GenericNetwork[];
|
|
60
|
+
deepLinkPreference: DeepLinkVariant | undefined;
|
|
61
|
+
eclipseNetworks: import("@dynamic-labs/types").GenericNetwork[];
|
|
62
|
+
evmNetworks: import("@dynamic-labs/types").GenericNetwork[];
|
|
63
|
+
flowNetwork: "mainnet" | "testnet" | undefined;
|
|
64
|
+
mobileExperience: MobileExperience | undefined;
|
|
65
|
+
projectId: string | undefined;
|
|
66
|
+
settings: ProjectSettings;
|
|
67
|
+
solNetworks: import("@dynamic-labs/types").GenericNetwork[];
|
|
68
|
+
starknetNetworks: import("@dynamic-labs/types").GenericNetwork[];
|
|
69
|
+
walletBook: {
|
|
70
|
+
groups: Record<string, {
|
|
71
|
+
name: string;
|
|
72
|
+
key: string;
|
|
73
|
+
brand?: {
|
|
74
|
+
alt?: string | undefined;
|
|
75
|
+
primaryColor?: string | undefined;
|
|
76
|
+
spriteId?: string | undefined;
|
|
77
|
+
} | undefined;
|
|
78
|
+
walletOverrides?: Record<string, {
|
|
79
|
+
brand?: {
|
|
80
|
+
alt?: string | undefined;
|
|
81
|
+
primaryColor?: string | undefined;
|
|
82
|
+
spriteId?: string | undefined;
|
|
83
|
+
} | undefined;
|
|
84
|
+
name?: string | undefined;
|
|
85
|
+
}> | undefined;
|
|
86
|
+
}>;
|
|
87
|
+
wallets: Record<string, {
|
|
88
|
+
name: string;
|
|
89
|
+
brand?: {
|
|
90
|
+
alt?: string | undefined;
|
|
91
|
+
primaryColor?: string | undefined;
|
|
92
|
+
spriteId?: string | undefined;
|
|
93
|
+
} | undefined;
|
|
94
|
+
chainGroup?: string | undefined;
|
|
95
|
+
chains?: string[] | undefined;
|
|
96
|
+
desktop?: {
|
|
97
|
+
chromeId?: string | undefined;
|
|
98
|
+
edgeId?: string | undefined;
|
|
99
|
+
firefoxId?: string | undefined;
|
|
100
|
+
native?: string | undefined;
|
|
101
|
+
operaId?: string | undefined;
|
|
102
|
+
safariId?: string | undefined;
|
|
103
|
+
universal?: string | undefined;
|
|
104
|
+
} | undefined;
|
|
105
|
+
eip6963Config?: {
|
|
106
|
+
rdns: string;
|
|
107
|
+
} | undefined;
|
|
108
|
+
filterFromWalletConnect?: boolean | undefined;
|
|
109
|
+
group?: string | undefined;
|
|
110
|
+
hardwareWallets?: string[] | undefined;
|
|
111
|
+
injectedConfig?: {
|
|
112
|
+
chain: string;
|
|
113
|
+
extensionLocators: {
|
|
114
|
+
value: boolean;
|
|
115
|
+
flag: string;
|
|
116
|
+
}[];
|
|
117
|
+
providerInterface?: string | undefined;
|
|
118
|
+
walletStandard?: {
|
|
119
|
+
features: string[];
|
|
120
|
+
name: string;
|
|
121
|
+
providerId?: string | undefined;
|
|
122
|
+
} | undefined;
|
|
123
|
+
walletStandardLocators?: {
|
|
124
|
+
name: string;
|
|
125
|
+
locator: string;
|
|
126
|
+
}[] | undefined;
|
|
127
|
+
windowLocations?: string[] | undefined;
|
|
128
|
+
}[] | undefined;
|
|
129
|
+
mobile?: {
|
|
130
|
+
android?: string | null | undefined;
|
|
131
|
+
androidId?: string | undefined;
|
|
132
|
+
inAppBrowser?: string | null | undefined;
|
|
133
|
+
ios?: string | null | undefined;
|
|
134
|
+
iosId?: string | undefined;
|
|
135
|
+
native?: string | undefined;
|
|
136
|
+
universal?: string | undefined;
|
|
137
|
+
} | undefined;
|
|
138
|
+
mobileExperience?: "in-app-browser" | "redirect" | undefined;
|
|
139
|
+
shortName?: string | undefined;
|
|
140
|
+
showOnlyIfInstalled?: boolean | undefined;
|
|
141
|
+
switchNetworkOnlyFromWallet?: boolean | undefined;
|
|
142
|
+
walletConnect?: {
|
|
143
|
+
sdks?: string[] | undefined;
|
|
144
|
+
} | undefined;
|
|
145
|
+
walletGroup?: string | undefined;
|
|
146
|
+
walletLimitations?: {
|
|
147
|
+
browserExtension?: {
|
|
148
|
+
unsupportedEvents?: string[] | undefined;
|
|
149
|
+
unsupportedMethods?: string[] | undefined;
|
|
150
|
+
} | undefined;
|
|
151
|
+
mobile?: {
|
|
152
|
+
unsupportedEvents?: string[] | undefined;
|
|
153
|
+
unsupportedMethods?: string[] | undefined;
|
|
154
|
+
} | undefined;
|
|
155
|
+
} | undefined;
|
|
156
|
+
}>;
|
|
157
|
+
};
|
|
158
|
+
walletConnectPreferredChains: `eip155:${number}`[] | undefined;
|
|
159
|
+
walletConnectorEventsEmitter: import("eventemitter3").EventEmitter<import("dist/packages/wallet-connector-core/src/events").WalletConnectorEvents, any>;
|
|
160
|
+
walletUiUtils: WalletUiUtils<import("@dynamic-labs/wallet-connector-core").WalletConnectorCore.WalletConnector>;
|
|
161
|
+
};
|
|
162
|
+
export {};
|
package/src/utils/getWalletConnectorConstructorOptions/getWalletConnectorConstructorOptions.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { walletConnectorEvents } from '@dynamic-labs/wallet-connector-core';
|
|
3
|
+
import { getEnabledProviders } from '../getEnabledProviders/getEnabledProviders.js';
|
|
4
|
+
import { getApiProviders } from '../getApiProviders/getApiProviders.js';
|
|
5
|
+
import { defaultWalletUiUtils } from '../../const.js';
|
|
6
|
+
|
|
7
|
+
const getWalletConnectorConstructorOptions = ({ appLogoUrl, appName, coinbaseWalletPreference, chainRpcProviders, deepLinkPreference, flowNetwork, mobileExperience, networkConfigurations, settings, walletConnectProjectId, walletUiUtils, walletBook, walletConnectPreferredChains, }) => {
|
|
8
|
+
const eclipseNetworkConfigs = (networkConfigurations === null || networkConfigurations === void 0 ? void 0 : networkConfigurations.eclipse) || [];
|
|
9
|
+
const evmNetworkConfigs = (networkConfigurations === null || networkConfigurations === void 0 ? void 0 : networkConfigurations.evm) || [];
|
|
10
|
+
const solanaNetworkConfigs = (networkConfigurations === null || networkConfigurations === void 0 ? void 0 : networkConfigurations.solana) || [];
|
|
11
|
+
const cosmosNetworkConfigs = (networkConfigurations === null || networkConfigurations === void 0 ? void 0 : networkConfigurations.cosmos) || [];
|
|
12
|
+
const starknetNetworkConfigs = (networkConfigurations === null || networkConfigurations === void 0 ? void 0 : networkConfigurations.starknet) || [];
|
|
13
|
+
const apiProviders = getApiProviders(getEnabledProviders(settings.providers));
|
|
14
|
+
const opts = {
|
|
15
|
+
apiProviders,
|
|
16
|
+
appLogoUrl,
|
|
17
|
+
appName,
|
|
18
|
+
chainRpcProviders,
|
|
19
|
+
coinbaseWalletPreference,
|
|
20
|
+
cosmosNetworks: cosmosNetworkConfigs,
|
|
21
|
+
deepLinkPreference,
|
|
22
|
+
eclipseNetworks: eclipseNetworkConfigs,
|
|
23
|
+
evmNetworks: evmNetworkConfigs,
|
|
24
|
+
flowNetwork,
|
|
25
|
+
mobileExperience,
|
|
26
|
+
projectId: walletConnectProjectId,
|
|
27
|
+
settings,
|
|
28
|
+
solNetworks: solanaNetworkConfigs,
|
|
29
|
+
starknetNetworks: starknetNetworkConfigs,
|
|
30
|
+
walletBook,
|
|
31
|
+
walletConnectPreferredChains,
|
|
32
|
+
walletConnectorEventsEmitter: walletConnectorEvents,
|
|
33
|
+
walletUiUtils: walletUiUtils || defaultWalletUiUtils,
|
|
34
|
+
};
|
|
35
|
+
return opts;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export { getWalletConnectorConstructorOptions };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { getWalletConnectorConstructorOptions } from './getWalletConnectorConstructorOptions';
|
package/src/utils/index.d.ts
CHANGED
|
@@ -3,3 +3,4 @@ export { getEnabledProviders } from './getEnabledProviders';
|
|
|
3
3
|
export { getEnabledWallets } from './getEnabledWallets';
|
|
4
4
|
export { getSupportedWallets } from './getSupportedWallets';
|
|
5
5
|
export { getSupportedChainsForWalletConnector } from './getSupportedChainsForWalletConnector';
|
|
6
|
+
export { getWalletConnectorConstructorOptions } from './getWalletConnectorConstructorOptions';
|
|
File without changes
|
|
File without changes
|
|
File without changes
|