@dynamic-labs/multi-wallet 4.33.0 → 4.35.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 +19 -0
- package/README.md +91 -4
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +8 -8
- package/src/utils/getApiProviders/getApiProviders.d.ts +2 -0
- package/src/utils/getWalletConnectorConstructorOptions/getWalletConnectorConstructorOptions.cjs +2 -0
- package/src/utils/getWalletConnectorConstructorOptions/getWalletConnectorConstructorOptions.d.ts +3 -0
- package/src/utils/getWalletConnectorConstructorOptions/getWalletConnectorConstructorOptions.js +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,23 @@
|
|
|
1
1
|
|
|
2
|
+
## [4.35.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.34.0...v4.35.0) (2025-10-02)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* update Bitget wallet logo with new SVG design ([#9615](https://github.com/dynamic-labs/dynamic-auth/issues/9615)) ([3b84f92](https://github.com/dynamic-labs/dynamic-auth/commit/3b84f9237d9a85ca334576aa9e986c73c7fa5973))
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* connecting global wallets via wallet connect ([#9608](https://github.com/dynamic-labs/dynamic-auth/issues/9608)) ([7b7767d](https://github.com/dynamic-labs/dynamic-auth/commit/7b7767dc322756edfe51f935155b0af2ebc52b6e))
|
|
13
|
+
|
|
14
|
+
## [4.34.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.33.0...v4.34.0) (2025-09-30)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* add getMultichainBalances to react-native ([#9593](https://github.com/dynamic-labs/dynamic-auth/issues/9593)) ([2e482c3](https://github.com/dynamic-labs/dynamic-auth/commit/2e482c3a3d17e4570173c3ca6e27d83c9fac7265))
|
|
20
|
+
|
|
2
21
|
## [4.33.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.32.1...v4.33.0) (2025-09-26)
|
|
3
22
|
|
|
4
23
|
|
package/README.md
CHANGED
|
@@ -1,7 +1,94 @@
|
|
|
1
|
-
# multi-wallet
|
|
1
|
+
# @dynamic-labs/multi-wallet
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## Overview
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
The multi-wallet package provides utility functions for filtering and configuring wallet connectors in the Dynamic Labs SDK. It contains helper functions used by the main SDK to determine which wallets should be available based on project settings and enabled chains.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## Key Features
|
|
8
|
+
|
|
9
|
+
- **Wallet filtering**: Filters wallet connectors based on enabled chains and project settings
|
|
10
|
+
- **Configuration building**: Creates configuration objects needed to instantiate wallet connectors
|
|
11
|
+
- **Message generation**: Generates standardized messages for wallet signature operations
|
|
12
|
+
- **Provider filtering**: Determines which authentication providers are enabled
|
|
13
|
+
|
|
14
|
+
## Core Functions
|
|
15
|
+
|
|
16
|
+
### `getSupportedWallets(opts)`
|
|
17
|
+
|
|
18
|
+
Main function that returns a filtered list of available wallet connectors based on:
|
|
19
|
+
|
|
20
|
+
- Project settings and enabled providers
|
|
21
|
+
- Platform compatibility (mobile/desktop)
|
|
22
|
+
- Wallet availability and installation status
|
|
23
|
+
- User preferences and disabled connectors
|
|
24
|
+
|
|
25
|
+
### `getWalletConnectorConstructorOptions(params)`
|
|
26
|
+
|
|
27
|
+
Builds configuration options for wallet connector constructors, including:
|
|
28
|
+
|
|
29
|
+
- Network configurations for all supported chains
|
|
30
|
+
- API providers and RPC configurations
|
|
31
|
+
- Authentication modes and UI utilities
|
|
32
|
+
- WalletConnect project settings
|
|
33
|
+
|
|
34
|
+
### `getEnabledWallets(props)`
|
|
35
|
+
|
|
36
|
+
Filters wallet connectors based on enabled chains. Takes an object with:
|
|
37
|
+
|
|
38
|
+
- `enabledChains`: Array of Chain types that are enabled
|
|
39
|
+
- `getSupportedWalletOpts`: Configuration options for getting supported wallets
|
|
40
|
+
|
|
41
|
+
### `generateMessageToSign(params)`
|
|
42
|
+
|
|
43
|
+
Creates standardized messages for wallet signing operations. Takes a `MessageParameters` object with fields like:
|
|
44
|
+
|
|
45
|
+
- `blockchain`: The blockchain type (Chain)
|
|
46
|
+
- `domain`: The domain requesting the signature
|
|
47
|
+
- `nonce`: Unique nonce for the request
|
|
48
|
+
- `publicKey`: User's public key
|
|
49
|
+
- `uri`: URI of the requesting application
|
|
50
|
+
- Additional optional fields for chainId, statement, resources, etc.
|
|
51
|
+
|
|
52
|
+
### `getEnabledProviders(providers)`
|
|
53
|
+
|
|
54
|
+
Filters providers to return only those that are enabled (have `enabledAt` set, or are MagicLink with `providerProjectId`, or are Turnkey).
|
|
55
|
+
|
|
56
|
+
### `getSupportedChainsForWalletConnector(walletBook, walletConnector)`
|
|
57
|
+
|
|
58
|
+
Returns the supported chains for a specific wallet connector by combining information from the wallet book and the connector's native supported chains.
|
|
59
|
+
|
|
60
|
+
## Usage
|
|
61
|
+
|
|
62
|
+
```typescript
|
|
63
|
+
import { getSupportedWallets } from '@dynamic-labs/multi-wallet';
|
|
64
|
+
|
|
65
|
+
const wallets = getSupportedWallets({
|
|
66
|
+
settings: projectSettings,
|
|
67
|
+
walletConnectorsProp: walletConnectors,
|
|
68
|
+
walletBook: walletBookData,
|
|
69
|
+
chainRpcProviders: rpcProviders,
|
|
70
|
+
// ... other options
|
|
71
|
+
});
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Usage in Dynamic SDK
|
|
75
|
+
|
|
76
|
+
This package is primarily used internally by the Dynamic SDK React Core package. The main usage patterns are:
|
|
77
|
+
|
|
78
|
+
- **Wallet List Building**: `getEnabledWallets` is used to filter available wallets based on enabled chains
|
|
79
|
+
- **Configuration Setup**: `getWalletConnectorConstructorOptions` builds the options needed to create wallet connector instances
|
|
80
|
+
- **Message Signing**: `generateMessageToSign` creates SIWE-compliant messages for wallet authentication
|
|
81
|
+
|
|
82
|
+
## Development
|
|
83
|
+
|
|
84
|
+
### Running unit tests
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
npx nx test multi-wallet
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Building the package
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
npx nx build multi-wallet
|
|
94
|
+
```
|
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.
|
|
3
|
+
"version": "4.35.0",
|
|
4
4
|
"dependencies": {
|
|
5
|
-
"@dynamic-labs/sdk-api-core": "0.0.
|
|
5
|
+
"@dynamic-labs/sdk-api-core": "0.0.791",
|
|
6
6
|
"tslib": "2.4.1",
|
|
7
|
-
"@dynamic-labs/assert-package-version": "4.
|
|
8
|
-
"@dynamic-labs/rpc-providers": "4.
|
|
9
|
-
"@dynamic-labs/types": "4.
|
|
10
|
-
"@dynamic-labs/utils": "4.
|
|
11
|
-
"@dynamic-labs/wallet-book": "4.
|
|
12
|
-
"@dynamic-labs/wallet-connector-core": "4.
|
|
7
|
+
"@dynamic-labs/assert-package-version": "4.35.0",
|
|
8
|
+
"@dynamic-labs/rpc-providers": "4.35.0",
|
|
9
|
+
"@dynamic-labs/types": "4.35.0",
|
|
10
|
+
"@dynamic-labs/utils": "4.35.0",
|
|
11
|
+
"@dynamic-labs/wallet-book": "4.35.0",
|
|
12
|
+
"@dynamic-labs/wallet-connector-core": "4.35.0"
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
15
|
"@walletconnect/types": "2.21.5"
|
|
@@ -20,6 +20,7 @@ export declare const getApiProviders: (providers: Provider[]) => {
|
|
|
20
20
|
blocto?: Provider | undefined;
|
|
21
21
|
banxa?: Provider | undefined;
|
|
22
22
|
coinbaseOnramp?: Provider | undefined;
|
|
23
|
+
cryptoDotCom?: Provider | undefined;
|
|
23
24
|
dynamic?: Provider | undefined;
|
|
24
25
|
alchemy?: Provider | undefined;
|
|
25
26
|
zerodev?: Provider | undefined;
|
|
@@ -36,4 +37,5 @@ export declare const getApiProviders: (providers: Provider[]) => {
|
|
|
36
37
|
kraken?: Provider | undefined;
|
|
37
38
|
blockaid?: Provider | undefined;
|
|
38
39
|
passkey?: Provider | undefined;
|
|
40
|
+
okta?: Provider | undefined;
|
|
39
41
|
};
|
package/src/utils/getWalletConnectorConstructorOptions/getWalletConnectorConstructorOptions.cjs
CHANGED
|
@@ -15,6 +15,7 @@ const getWalletConnectorConstructorOptions = ({ appLogoUrl, appName, authMode, c
|
|
|
15
15
|
const cosmosNetworkConfigs = (networkConfigurations === null || networkConfigurations === void 0 ? void 0 : networkConfigurations.cosmos) || [];
|
|
16
16
|
const starknetNetworkConfigs = (networkConfigurations === null || networkConfigurations === void 0 ? void 0 : networkConfigurations.starknet) || [];
|
|
17
17
|
const suiNetworkConfigs = (networkConfigurations === null || networkConfigurations === void 0 ? void 0 : networkConfigurations.sui) || [];
|
|
18
|
+
const tronNetworkConfigs = (networkConfigurations === null || networkConfigurations === void 0 ? void 0 : networkConfigurations.tron) || [];
|
|
18
19
|
const apiProviders = getApiProviders.getApiProviders(getEnabledProviders.getEnabledProviders(settings.providers));
|
|
19
20
|
const opts = {
|
|
20
21
|
apiProviders,
|
|
@@ -34,6 +35,7 @@ const getWalletConnectorConstructorOptions = ({ appLogoUrl, appName, authMode, c
|
|
|
34
35
|
solNetworks: solanaNetworkConfigs,
|
|
35
36
|
starknetNetworks: starknetNetworkConfigs,
|
|
36
37
|
suiNetworks: suiNetworkConfigs,
|
|
38
|
+
tronNetworks: tronNetworkConfigs,
|
|
37
39
|
useMetamaskSdk,
|
|
38
40
|
walletBook,
|
|
39
41
|
walletConnectPreferredChains,
|
package/src/utils/getWalletConnectorConstructorOptions/getWalletConnectorConstructorOptions.d.ts
CHANGED
|
@@ -42,6 +42,7 @@ export declare const getWalletConnectorConstructorOptions: ({ appLogoUrl, appNam
|
|
|
42
42
|
blocto?: import("@dynamic-labs/sdk-api-core").Provider | undefined;
|
|
43
43
|
banxa?: import("@dynamic-labs/sdk-api-core").Provider | undefined;
|
|
44
44
|
coinbaseOnramp?: import("@dynamic-labs/sdk-api-core").Provider | undefined;
|
|
45
|
+
cryptoDotCom?: import("@dynamic-labs/sdk-api-core").Provider | undefined;
|
|
45
46
|
dynamic?: import("@dynamic-labs/sdk-api-core").Provider | undefined;
|
|
46
47
|
alchemy?: import("@dynamic-labs/sdk-api-core").Provider | undefined;
|
|
47
48
|
zerodev?: import("@dynamic-labs/sdk-api-core").Provider | undefined;
|
|
@@ -58,6 +59,7 @@ export declare const getWalletConnectorConstructorOptions: ({ appLogoUrl, appNam
|
|
|
58
59
|
kraken?: import("@dynamic-labs/sdk-api-core").Provider | undefined;
|
|
59
60
|
blockaid?: import("@dynamic-labs/sdk-api-core").Provider | undefined;
|
|
60
61
|
passkey?: import("@dynamic-labs/sdk-api-core").Provider | undefined;
|
|
62
|
+
okta?: import("@dynamic-labs/sdk-api-core").Provider | undefined;
|
|
61
63
|
};
|
|
62
64
|
appLogoUrl: string | undefined;
|
|
63
65
|
appName: string | undefined;
|
|
@@ -75,6 +77,7 @@ export declare const getWalletConnectorConstructorOptions: ({ appLogoUrl, appNam
|
|
|
75
77
|
solNetworks: import("@dynamic-labs/types").GenericNetwork[];
|
|
76
78
|
starknetNetworks: import("@dynamic-labs/types").GenericNetwork[];
|
|
77
79
|
suiNetworks: import("@dynamic-labs/types").GenericNetwork[];
|
|
80
|
+
tronNetworks: import("@dynamic-labs/types").GenericNetwork[];
|
|
78
81
|
useMetamaskSdk: boolean;
|
|
79
82
|
walletBook: {
|
|
80
83
|
groups: Record<string, {
|
package/src/utils/getWalletConnectorConstructorOptions/getWalletConnectorConstructorOptions.js
CHANGED
|
@@ -11,6 +11,7 @@ const getWalletConnectorConstructorOptions = ({ appLogoUrl, appName, authMode, c
|
|
|
11
11
|
const cosmosNetworkConfigs = (networkConfigurations === null || networkConfigurations === void 0 ? void 0 : networkConfigurations.cosmos) || [];
|
|
12
12
|
const starknetNetworkConfigs = (networkConfigurations === null || networkConfigurations === void 0 ? void 0 : networkConfigurations.starknet) || [];
|
|
13
13
|
const suiNetworkConfigs = (networkConfigurations === null || networkConfigurations === void 0 ? void 0 : networkConfigurations.sui) || [];
|
|
14
|
+
const tronNetworkConfigs = (networkConfigurations === null || networkConfigurations === void 0 ? void 0 : networkConfigurations.tron) || [];
|
|
14
15
|
const apiProviders = getApiProviders(getEnabledProviders(settings.providers));
|
|
15
16
|
const opts = {
|
|
16
17
|
apiProviders,
|
|
@@ -30,6 +31,7 @@ const getWalletConnectorConstructorOptions = ({ appLogoUrl, appName, authMode, c
|
|
|
30
31
|
solNetworks: solanaNetworkConfigs,
|
|
31
32
|
starknetNetworks: starknetNetworkConfigs,
|
|
32
33
|
suiNetworks: suiNetworkConfigs,
|
|
34
|
+
tronNetworks: tronNetworkConfigs,
|
|
33
35
|
useMetamaskSdk,
|
|
34
36
|
walletBook,
|
|
35
37
|
walletConnectPreferredChains,
|