@dynamic-labs/multi-wallet 0.17.0-RC.18 → 0.17.0-RC.19
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 +11 -0
- package/package.json +9 -9
- package/src/multi-wallet.cjs +4 -10
- package/src/multi-wallet.js +5 -11
- package/src/utils/getApiProviders.d.ts +10 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
|
|
2
|
+
## [0.17.0-RC.19](https://github.com/dynamic-labs/DynamicAuth/compare/v0.17.0-RC.18...v0.17.0-RC.19) (2023-05-30)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* add SocialWrongAccountView ([#2153](https://github.com/dynamic-labs/DynamicAuth/issues/2153)) ([531a29d](https://github.com/dynamic-labs/DynamicAuth/commit/531a29d7d87739d974ecc35c57ef0d333a5e7451))
|
|
8
|
+
* do not show unlink button for embedded wallets ([#2169](https://github.com/dynamic-labs/DynamicAuth/issues/2169)) ([f813058](https://github.com/dynamic-labs/DynamicAuth/commit/f8130585c82c7ae73d1e32e107f67ec86b4edb89))
|
|
9
|
+
* **DYN-2402:** coinbase issues after disconnecting ([#2149](https://github.com/dynamic-labs/DynamicAuth/issues/2149)) ([91d49fb](https://github.com/dynamic-labs/DynamicAuth/commit/91d49fb7f8c6fca3ab03098f3fba53d277c836ad))
|
|
10
|
+
* handle user reconnecting with wrong social account ([#2157](https://github.com/dynamic-labs/DynamicAuth/issues/2157)) ([4f7c6df](https://github.com/dynamic-labs/DynamicAuth/commit/4f7c6dff7df9a7966a644bf2510cb3825b2c6408))
|
|
11
|
+
* **social:** handle reconnect ([#2131](https://github.com/dynamic-labs/DynamicAuth/issues/2131)) ([2b3e5fb](https://github.com/dynamic-labs/DynamicAuth/commit/2b3e5fbb72bb7dafee3bd0bbfa73fae444055410))
|
|
12
|
+
|
|
2
13
|
## [0.17.0-RC.18](https://github.com/dynamic-labs/DynamicAuth/compare/v0.17.0-RC.17...v0.17.0-RC.18) (2023-05-19)
|
|
3
14
|
|
|
4
15
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/multi-wallet",
|
|
3
|
-
"version": "0.17.0-RC.
|
|
3
|
+
"version": "0.17.0-RC.19",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/dynamic-labs/DynamicAuth.git",
|
|
@@ -8,16 +8,16 @@
|
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"@dynamic-labs/sdk-api": "0.0.198",
|
|
11
|
-
"@dynamic-labs/wallet-book": "
|
|
12
|
-
"ethers": "
|
|
13
|
-
"tslib": "
|
|
14
|
-
"@dynamic-labs/rpc-providers": "0.17.0-RC.
|
|
15
|
-
"@dynamic-labs/types": "0.17.0-RC.
|
|
16
|
-
"@dynamic-labs/utils": "0.17.0-RC.
|
|
17
|
-
"@dynamic-labs/wallet-connector-core": "0.17.0-RC.
|
|
11
|
+
"@dynamic-labs/wallet-book": "0.0.18",
|
|
12
|
+
"ethers": "5.7.2",
|
|
13
|
+
"tslib": "2.4.1",
|
|
14
|
+
"@dynamic-labs/rpc-providers": "0.17.0-RC.19",
|
|
15
|
+
"@dynamic-labs/types": "0.17.0-RC.19",
|
|
16
|
+
"@dynamic-labs/utils": "0.17.0-RC.19",
|
|
17
|
+
"@dynamic-labs/wallet-connector-core": "0.17.0-RC.19"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@walletconnect/types": "
|
|
20
|
+
"@walletconnect/types": "2.4.2"
|
|
21
21
|
},
|
|
22
22
|
"description": "Multi-wallet is a toolkit for working with many different wallets to create and verify signatures",
|
|
23
23
|
"bugs": {
|
package/src/multi-wallet.cjs
CHANGED
|
@@ -72,10 +72,10 @@ const filterWalletsForPlatform = (wallets) => wallets.filter((wallet) => {
|
|
|
72
72
|
return true;
|
|
73
73
|
}
|
|
74
74
|
else {
|
|
75
|
-
return handleMobileWalletFilter(metadata);
|
|
75
|
+
return handleMobileWalletFilter(wallet.name, metadata);
|
|
76
76
|
}
|
|
77
77
|
});
|
|
78
|
-
const handleMobileWalletFilter = (metadata) => {
|
|
78
|
+
const handleMobileWalletFilter = (walletName, metadata) => {
|
|
79
79
|
if (!metadata.mobile)
|
|
80
80
|
return false;
|
|
81
81
|
/**
|
|
@@ -86,20 +86,14 @@ const handleMobileWalletFilter = (metadata) => {
|
|
|
86
86
|
*/
|
|
87
87
|
const hasWalletConnectLink = Boolean(metadata.mobile.universal) || Boolean(metadata.mobile.native);
|
|
88
88
|
const isWalletConnectWallet = metadata.walletConnect !== undefined;
|
|
89
|
-
/**
|
|
90
|
-
* wallets-links.json is the source of truth for wallet support on mobile platforms.
|
|
91
|
-
* if a wallet has a non-empty value for ios, that means that wallet has an ios app
|
|
92
|
-
* and we support that app. the same goes for android
|
|
93
|
-
*/
|
|
94
89
|
if (utils.isIPad() || utils.isIPhone()) {
|
|
95
|
-
const hasIOSLink =
|
|
90
|
+
const hasIOSLink = Boolean(walletBook.getWalletLinks(walletName).ios);
|
|
96
91
|
return !isWalletConnectWallet
|
|
97
92
|
? hasIOSLink
|
|
98
93
|
: hasIOSLink && hasWalletConnectLink;
|
|
99
|
-
// It is an android device
|
|
100
94
|
}
|
|
101
95
|
else {
|
|
102
|
-
const hasAndroidLink =
|
|
96
|
+
const hasAndroidLink = Boolean(walletBook.getWalletLinks(walletName).android);
|
|
103
97
|
return !isWalletConnectWallet
|
|
104
98
|
? hasAndroidLink
|
|
105
99
|
: hasAndroidLink && hasWalletConnectLink;
|
package/src/multi-wallet.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isEmailWalletConnector } from '@dynamic-labs/wallet-connector-core';
|
|
2
|
-
import { getWalletBookWallet } from '@dynamic-labs/wallet-book';
|
|
2
|
+
import { getWalletBookWallet, getWalletLinks } from '@dynamic-labs/wallet-book';
|
|
3
3
|
import { isMobile, isIPad, isIPhone } from '@dynamic-labs/utils';
|
|
4
4
|
import { getApiProviders } from './utils/getApiProviders.js';
|
|
5
5
|
|
|
@@ -68,10 +68,10 @@ const filterWalletsForPlatform = (wallets) => wallets.filter((wallet) => {
|
|
|
68
68
|
return true;
|
|
69
69
|
}
|
|
70
70
|
else {
|
|
71
|
-
return handleMobileWalletFilter(metadata);
|
|
71
|
+
return handleMobileWalletFilter(wallet.name, metadata);
|
|
72
72
|
}
|
|
73
73
|
});
|
|
74
|
-
const handleMobileWalletFilter = (metadata) => {
|
|
74
|
+
const handleMobileWalletFilter = (walletName, metadata) => {
|
|
75
75
|
if (!metadata.mobile)
|
|
76
76
|
return false;
|
|
77
77
|
/**
|
|
@@ -82,20 +82,14 @@ const handleMobileWalletFilter = (metadata) => {
|
|
|
82
82
|
*/
|
|
83
83
|
const hasWalletConnectLink = Boolean(metadata.mobile.universal) || Boolean(metadata.mobile.native);
|
|
84
84
|
const isWalletConnectWallet = metadata.walletConnect !== undefined;
|
|
85
|
-
/**
|
|
86
|
-
* wallets-links.json is the source of truth for wallet support on mobile platforms.
|
|
87
|
-
* if a wallet has a non-empty value for ios, that means that wallet has an ios app
|
|
88
|
-
* and we support that app. the same goes for android
|
|
89
|
-
*/
|
|
90
85
|
if (isIPad() || isIPhone()) {
|
|
91
|
-
const hasIOSLink =
|
|
86
|
+
const hasIOSLink = Boolean(getWalletLinks(walletName).ios);
|
|
92
87
|
return !isWalletConnectWallet
|
|
93
88
|
? hasIOSLink
|
|
94
89
|
: hasIOSLink && hasWalletConnectLink;
|
|
95
|
-
// It is an android device
|
|
96
90
|
}
|
|
97
91
|
else {
|
|
98
|
-
const hasAndroidLink =
|
|
92
|
+
const hasAndroidLink = Boolean(getWalletLinks(walletName).android);
|
|
99
93
|
return !isWalletConnectWallet
|
|
100
94
|
? hasAndroidLink
|
|
101
95
|
: hasAndroidLink && hasWalletConnectLink;
|
|
@@ -2,9 +2,16 @@ import { Provider, ProviderEnum } from '@dynamic-labs/sdk-api';
|
|
|
2
2
|
export declare const getApiProviders: (providers: Provider[]) => {
|
|
3
3
|
emailOnly?: Provider | undefined;
|
|
4
4
|
magicLink?: Provider | undefined;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
twitter?: Provider | undefined;
|
|
5
|
+
apple?: Provider | undefined;
|
|
6
|
+
bitbucket?: Provider | undefined;
|
|
8
7
|
discord?: Provider | undefined;
|
|
8
|
+
facebook?: Provider | undefined;
|
|
9
9
|
github?: Provider | undefined;
|
|
10
|
+
gitlab?: Provider | undefined;
|
|
11
|
+
google?: Provider | undefined;
|
|
12
|
+
instagram?: Provider | undefined;
|
|
13
|
+
linkedin?: Provider | undefined;
|
|
14
|
+
microsoft?: Provider | undefined;
|
|
15
|
+
twitch?: Provider | undefined;
|
|
16
|
+
twitter?: Provider | undefined;
|
|
10
17
|
};
|