@dynamic-labs/wallet-connector-core 4.0.0-alpha.44 → 4.0.0-alpha.45
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
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
|
|
2
|
+
## [4.0.0-alpha.45](https://github.com/dynamic-labs/dynamic-auth/compare/v4.0.0-alpha.44...v4.0.0-alpha.45) (2024-12-11)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* don't throw error if wallet no found in walletbook when fetching metadata ([#7579](https://github.com/dynamic-labs/dynamic-auth/issues/7579)) ([93074a1](https://github.com/dynamic-labs/dynamic-auth/commit/93074a11da1b843cd44ad986c7cfd1f243f2a65d))
|
|
8
|
+
|
|
2
9
|
## [4.0.0-alpha.44](https://github.com/dynamic-labs/dynamic-auth/compare/v4.0.0-alpha.43...v4.0.0-alpha.44) (2024-12-09)
|
|
3
10
|
|
|
4
11
|
|
package/package.cjs
CHANGED
package/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/wallet-connector-core",
|
|
3
|
-
"version": "4.0.0-alpha.
|
|
3
|
+
"version": "4.0.0-alpha.45",
|
|
4
4
|
"description": "Core package for utilities and types for handling multiple wallet/chain support Dynamic SDK",
|
|
5
5
|
"author": "Dynamic Labs, Inc.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -21,12 +21,12 @@
|
|
|
21
21
|
"@dynamic-labs/sdk-api-core": "0.0.570"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
|
-
"@dynamic-labs/assert-package-version": "4.0.0-alpha.
|
|
25
|
-
"@dynamic-labs/logger": "4.0.0-alpha.
|
|
26
|
-
"@dynamic-labs/rpc-providers": "4.0.0-alpha.
|
|
27
|
-
"@dynamic-labs/types": "4.0.0-alpha.
|
|
28
|
-
"@dynamic-labs/utils": "4.0.0-alpha.
|
|
29
|
-
"@dynamic-labs/wallet-book": "4.0.0-alpha.
|
|
24
|
+
"@dynamic-labs/assert-package-version": "4.0.0-alpha.45",
|
|
25
|
+
"@dynamic-labs/logger": "4.0.0-alpha.45",
|
|
26
|
+
"@dynamic-labs/rpc-providers": "4.0.0-alpha.45",
|
|
27
|
+
"@dynamic-labs/types": "4.0.0-alpha.45",
|
|
28
|
+
"@dynamic-labs/utils": "4.0.0-alpha.45",
|
|
29
|
+
"@dynamic-labs/wallet-book": "4.0.0-alpha.45",
|
|
30
30
|
"eventemitter3": "5.0.1"
|
|
31
31
|
}
|
|
32
32
|
}
|
|
@@ -19,28 +19,36 @@ const getWalletMetadataFromWalletBook = ({ walletKey, walletBookWallet, walletBo
|
|
|
19
19
|
logger.logger.warn('Wallet book is required');
|
|
20
20
|
return;
|
|
21
21
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
try {
|
|
23
|
+
const wallet = walletBookWallet !== null && walletBookWallet !== void 0 ? walletBookWallet : walletBook.getWalletBookWallet(walletBook$1, walletKey, walletFallback);
|
|
24
|
+
// if no walletBookWallet is provided and no wallet is found in the wallet book, throw an error
|
|
25
|
+
if (!wallet) {
|
|
26
|
+
logger.logger.warn('Wallet not found in wallet book');
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
return {
|
|
30
|
+
brandColor: getValidHexColor.getValidHexColor((_a = wallet === null || wallet === void 0 ? void 0 : wallet.brand) === null || _a === void 0 ? void 0 : _a.primaryColor),
|
|
31
|
+
deepLinks: getDeepLinks.getDeepLinks({
|
|
32
|
+
desktop: wallet === null || wallet === void 0 ? void 0 : wallet.desktop,
|
|
33
|
+
mobile: wallet === null || wallet === void 0 ? void 0 : wallet.mobile,
|
|
34
|
+
}),
|
|
35
|
+
downloadLinks: getDownloadLinks.getDownloadLinks(wallet),
|
|
36
|
+
groupKey: (_b = wallet === null || wallet === void 0 ? void 0 : wallet.chainGroup) !== null && _b !== void 0 ? _b : wallet === null || wallet === void 0 ? void 0 : wallet.walletGroup,
|
|
37
|
+
icon: (_d = getIconUrl.getIconUrl((_c = wallet === null || wallet === void 0 ? void 0 : wallet.brand) === null || _c === void 0 ? void 0 : _c.spriteId)) !== null && _d !== void 0 ? _d : '',
|
|
38
|
+
id: walletKey,
|
|
39
|
+
inAppBrowserUrl: (_f = (_e = wallet.mobile) === null || _e === void 0 ? void 0 : _e.inAppBrowser) !== null && _f !== void 0 ? _f : undefined,
|
|
40
|
+
name: wallet.name,
|
|
41
|
+
rdns: (_g = wallet.eip6963Config) === null || _g === void 0 ? void 0 : _g.rdns,
|
|
42
|
+
supportedHardwareWallets: wallet.hardwareWallets,
|
|
43
|
+
walletLimitations: getWalletLimitations.getWalletLimitations(wallet.walletLimitations),
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
catch (e) {
|
|
47
|
+
logger.logger.warn('Error getting wallet metadata from wallet book', {
|
|
48
|
+
error: e,
|
|
49
|
+
});
|
|
26
50
|
return;
|
|
27
51
|
}
|
|
28
|
-
return {
|
|
29
|
-
brandColor: getValidHexColor.getValidHexColor((_a = wallet === null || wallet === void 0 ? void 0 : wallet.brand) === null || _a === void 0 ? void 0 : _a.primaryColor),
|
|
30
|
-
deepLinks: getDeepLinks.getDeepLinks({
|
|
31
|
-
desktop: wallet === null || wallet === void 0 ? void 0 : wallet.desktop,
|
|
32
|
-
mobile: wallet === null || wallet === void 0 ? void 0 : wallet.mobile,
|
|
33
|
-
}),
|
|
34
|
-
downloadLinks: getDownloadLinks.getDownloadLinks(wallet),
|
|
35
|
-
groupKey: (_b = wallet === null || wallet === void 0 ? void 0 : wallet.chainGroup) !== null && _b !== void 0 ? _b : wallet === null || wallet === void 0 ? void 0 : wallet.walletGroup,
|
|
36
|
-
icon: (_d = getIconUrl.getIconUrl((_c = wallet === null || wallet === void 0 ? void 0 : wallet.brand) === null || _c === void 0 ? void 0 : _c.spriteId)) !== null && _d !== void 0 ? _d : '',
|
|
37
|
-
id: walletKey,
|
|
38
|
-
inAppBrowserUrl: (_f = (_e = wallet.mobile) === null || _e === void 0 ? void 0 : _e.inAppBrowser) !== null && _f !== void 0 ? _f : undefined,
|
|
39
|
-
name: wallet.name,
|
|
40
|
-
rdns: (_g = wallet.eip6963Config) === null || _g === void 0 ? void 0 : _g.rdns,
|
|
41
|
-
supportedHardwareWallets: wallet.hardwareWallets,
|
|
42
|
-
walletLimitations: getWalletLimitations.getWalletLimitations(wallet.walletLimitations),
|
|
43
|
-
};
|
|
44
52
|
};
|
|
45
53
|
|
|
46
54
|
exports.getWalletMetadataFromWalletBook = getWalletMetadataFromWalletBook;
|
|
@@ -15,28 +15,36 @@ const getWalletMetadataFromWalletBook = ({ walletKey, walletBookWallet, walletBo
|
|
|
15
15
|
logger.warn('Wallet book is required');
|
|
16
16
|
return;
|
|
17
17
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
try {
|
|
19
|
+
const wallet = walletBookWallet !== null && walletBookWallet !== void 0 ? walletBookWallet : getWalletBookWallet(walletBook, walletKey, walletFallback);
|
|
20
|
+
// if no walletBookWallet is provided and no wallet is found in the wallet book, throw an error
|
|
21
|
+
if (!wallet) {
|
|
22
|
+
logger.warn('Wallet not found in wallet book');
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
return {
|
|
26
|
+
brandColor: getValidHexColor((_a = wallet === null || wallet === void 0 ? void 0 : wallet.brand) === null || _a === void 0 ? void 0 : _a.primaryColor),
|
|
27
|
+
deepLinks: getDeepLinks({
|
|
28
|
+
desktop: wallet === null || wallet === void 0 ? void 0 : wallet.desktop,
|
|
29
|
+
mobile: wallet === null || wallet === void 0 ? void 0 : wallet.mobile,
|
|
30
|
+
}),
|
|
31
|
+
downloadLinks: getDownloadLinks(wallet),
|
|
32
|
+
groupKey: (_b = wallet === null || wallet === void 0 ? void 0 : wallet.chainGroup) !== null && _b !== void 0 ? _b : wallet === null || wallet === void 0 ? void 0 : wallet.walletGroup,
|
|
33
|
+
icon: (_d = getIconUrl((_c = wallet === null || wallet === void 0 ? void 0 : wallet.brand) === null || _c === void 0 ? void 0 : _c.spriteId)) !== null && _d !== void 0 ? _d : '',
|
|
34
|
+
id: walletKey,
|
|
35
|
+
inAppBrowserUrl: (_f = (_e = wallet.mobile) === null || _e === void 0 ? void 0 : _e.inAppBrowser) !== null && _f !== void 0 ? _f : undefined,
|
|
36
|
+
name: wallet.name,
|
|
37
|
+
rdns: (_g = wallet.eip6963Config) === null || _g === void 0 ? void 0 : _g.rdns,
|
|
38
|
+
supportedHardwareWallets: wallet.hardwareWallets,
|
|
39
|
+
walletLimitations: getWalletLimitations(wallet.walletLimitations),
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
catch (e) {
|
|
43
|
+
logger.warn('Error getting wallet metadata from wallet book', {
|
|
44
|
+
error: e,
|
|
45
|
+
});
|
|
22
46
|
return;
|
|
23
47
|
}
|
|
24
|
-
return {
|
|
25
|
-
brandColor: getValidHexColor((_a = wallet === null || wallet === void 0 ? void 0 : wallet.brand) === null || _a === void 0 ? void 0 : _a.primaryColor),
|
|
26
|
-
deepLinks: getDeepLinks({
|
|
27
|
-
desktop: wallet === null || wallet === void 0 ? void 0 : wallet.desktop,
|
|
28
|
-
mobile: wallet === null || wallet === void 0 ? void 0 : wallet.mobile,
|
|
29
|
-
}),
|
|
30
|
-
downloadLinks: getDownloadLinks(wallet),
|
|
31
|
-
groupKey: (_b = wallet === null || wallet === void 0 ? void 0 : wallet.chainGroup) !== null && _b !== void 0 ? _b : wallet === null || wallet === void 0 ? void 0 : wallet.walletGroup,
|
|
32
|
-
icon: (_d = getIconUrl((_c = wallet === null || wallet === void 0 ? void 0 : wallet.brand) === null || _c === void 0 ? void 0 : _c.spriteId)) !== null && _d !== void 0 ? _d : '',
|
|
33
|
-
id: walletKey,
|
|
34
|
-
inAppBrowserUrl: (_f = (_e = wallet.mobile) === null || _e === void 0 ? void 0 : _e.inAppBrowser) !== null && _f !== void 0 ? _f : undefined,
|
|
35
|
-
name: wallet.name,
|
|
36
|
-
rdns: (_g = wallet.eip6963Config) === null || _g === void 0 ? void 0 : _g.rdns,
|
|
37
|
-
supportedHardwareWallets: wallet.hardwareWallets,
|
|
38
|
-
walletLimitations: getWalletLimitations(wallet.walletLimitations),
|
|
39
|
-
};
|
|
40
48
|
};
|
|
41
49
|
|
|
42
50
|
export { getWalletMetadataFromWalletBook };
|