@dynamic-labs/wallet-book 1.1.0-alpha.15 → 1.1.0-alpha.16
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 +8 -0
- package/package.json +3 -3
- package/src/build/sources/walletConnect/index.d.ts +10 -10
- package/src/components/WalletIcon.cjs +1 -1
- package/src/components/WalletIcon.js +1 -1
- package/src/helpers/getWalletBookWallet.cjs +18 -6
- package/src/helpers/getWalletBookWallet.js +18 -6
- package/src/helpers/normalizeWalletName.cjs +7 -0
- package/src/helpers/normalizeWalletName.js +3 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
|
|
2
|
+
## [1.1.0-alpha.16](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.15...v1.1.0-alpha.16) (2024-01-30)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* add fallback to getWalletBookWallet for customers still passing in name, add deprecation warn ([#4518](https://github.com/dynamic-labs/DynamicAuth/issues/4518)) ([b233ea1](https://github.com/dynamic-labs/DynamicAuth/commit/b233ea1cd640d8d9d94c52ab230787f3d869151a))
|
|
8
|
+
* handle braavos network change to account which doesn not exist ([#4519](https://github.com/dynamic-labs/DynamicAuth/issues/4519)) ([486020f](https://github.com/dynamic-labs/DynamicAuth/commit/486020fb09a274388ba34c8d1b37ac3a1ff3dba6))
|
|
9
|
+
|
|
2
10
|
## [1.1.0-alpha.15](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.14...v1.1.0-alpha.15) (2024-01-28)
|
|
3
11
|
|
|
4
12
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/wallet-book",
|
|
3
|
-
"version": "1.1.0-alpha.
|
|
3
|
+
"version": "1.1.0-alpha.16",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/dynamic-labs/DynamicAuth.git",
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"zod": "3.22.4",
|
|
29
|
-
"@dynamic-labs/logger": "1.1.0-alpha.
|
|
30
|
-
"@dynamic-labs/utils": "1.1.0-alpha.
|
|
29
|
+
"@dynamic-labs/logger": "1.1.0-alpha.16",
|
|
30
|
+
"@dynamic-labs/utils": "1.1.0-alpha.16",
|
|
31
31
|
"util": "0.12.5"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
@@ -1,12 +1,4 @@
|
|
|
1
1
|
export declare const walletConnectSourceData: Record<string, {
|
|
2
|
-
id: string;
|
|
3
|
-
metadata: {
|
|
4
|
-
shortName: string | null;
|
|
5
|
-
colors: {
|
|
6
|
-
primary: string | null;
|
|
7
|
-
secondary: string | null;
|
|
8
|
-
};
|
|
9
|
-
};
|
|
10
2
|
name: string;
|
|
11
3
|
chains: string[];
|
|
12
4
|
desktop: {
|
|
@@ -36,6 +28,7 @@ export declare const walletConnectSourceData: Record<string, {
|
|
|
36
28
|
category: string | null;
|
|
37
29
|
description: string | null;
|
|
38
30
|
homepage: string;
|
|
31
|
+
id: string;
|
|
39
32
|
image_id: string;
|
|
40
33
|
image_url: {
|
|
41
34
|
lg: string;
|
|
@@ -46,15 +39,22 @@ export declare const walletConnectSourceData: Record<string, {
|
|
|
46
39
|
injected_id: string;
|
|
47
40
|
namespace: string;
|
|
48
41
|
}[] | null;
|
|
42
|
+
metadata: {
|
|
43
|
+
shortName: string | null;
|
|
44
|
+
colors: {
|
|
45
|
+
primary: string | null;
|
|
46
|
+
secondary: string | null;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
49
|
slug: string;
|
|
50
50
|
updatedAt: string;
|
|
51
51
|
versions: string[];
|
|
52
52
|
supported_standards?: {
|
|
53
53
|
id: string;
|
|
54
|
-
title: string;
|
|
55
|
-
url: string;
|
|
56
54
|
standard_id: number;
|
|
57
55
|
standard_prefix: string;
|
|
56
|
+
title: string;
|
|
57
|
+
url: string;
|
|
58
58
|
}[] | undefined;
|
|
59
59
|
}>;
|
|
60
60
|
export declare const walletConnectTransformedData: Promise<Record<string, {
|
|
@@ -5,8 +5,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var _tslib = require('../../_virtual/_tslib.cjs');
|
|
6
6
|
var react = require('react');
|
|
7
7
|
var getWalletIconUrl = require('../helpers/getWalletIconUrl.cjs');
|
|
8
|
-
var findWalletBookWallet = require('../helpers/findWalletBookWallet.cjs');
|
|
9
8
|
require('../helpers/logger.cjs');
|
|
9
|
+
var findWalletBookWallet = require('../helpers/findWalletBookWallet.cjs');
|
|
10
10
|
require('@dynamic-labs/utils');
|
|
11
11
|
require('../schemas/walletConnectSourceSchema.cjs');
|
|
12
12
|
require('../schemas/walletBookSchema.cjs');
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { __rest } from '../../_virtual/_tslib.js';
|
|
2
2
|
import { useState, createElement, Fragment } from 'react';
|
|
3
3
|
import { getWalletIconUrl, getDefaultWalletIconUrl } from '../helpers/getWalletIconUrl.js';
|
|
4
|
-
import { findWalletBookWallet } from '../helpers/findWalletBookWallet.js';
|
|
5
4
|
import '../helpers/logger.js';
|
|
5
|
+
import { findWalletBookWallet } from '../helpers/findWalletBookWallet.js';
|
|
6
6
|
import '@dynamic-labs/utils';
|
|
7
7
|
import '../schemas/walletConnectSourceSchema.js';
|
|
8
8
|
import '../schemas/walletBookSchema.js';
|
|
@@ -2,13 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var normalizeWalletName = require('./normalizeWalletName.cjs');
|
|
6
|
+
var logger = require('./logger.cjs');
|
|
7
|
+
|
|
5
8
|
const getWalletBookWallet = (walletBook, walletKey) => {
|
|
6
|
-
var _a, _b;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
var _a, _b, _c;
|
|
10
|
+
if (!walletKey)
|
|
11
|
+
throw new Error('Wallet key is required. Please pass in a wallet key to getWalletBookWallet');
|
|
12
|
+
const walletDataFromKeyLookup = (_a = walletBook === null || walletBook === void 0 ? void 0 : walletBook.wallets) === null || _a === void 0 ? void 0 : _a[walletKey];
|
|
13
|
+
if (!walletDataFromKeyLookup) {
|
|
14
|
+
// adds fallback support. normalizeWalletName will be removed in v2
|
|
15
|
+
const normalizedWalletKey = normalizeWalletName.normalizeWalletName(walletKey);
|
|
16
|
+
const walletDataFromNormalizedKeyLookup = (_b = walletBook === null || walletBook === void 0 ? void 0 : walletBook.wallets) === null || _b === void 0 ? void 0 : _b[normalizedWalletKey];
|
|
17
|
+
if (walletDataFromNormalizedKeyLookup) {
|
|
18
|
+
logger.logger.warn(`deprecated: using walletName: ${walletKey} to look up wallet data is deprecated. use connector.key instead ${normalizedWalletKey}`);
|
|
19
|
+
return walletDataFromNormalizedKeyLookup;
|
|
20
|
+
}
|
|
21
|
+
throw new Error(`Wallet ${normalizedWalletKey} not found in wallet book (${Object.keys((_c = walletBook === null || walletBook === void 0 ? void 0 : walletBook.wallets) !== null && _c !== void 0 ? _c : {}).length} wallets found)`);
|
|
22
|
+
}
|
|
23
|
+
return walletDataFromKeyLookup;
|
|
12
24
|
};
|
|
13
25
|
|
|
14
26
|
exports.getWalletBookWallet = getWalletBookWallet;
|
|
@@ -1,10 +1,22 @@
|
|
|
1
|
+
import { normalizeWalletName } from './normalizeWalletName.js';
|
|
2
|
+
import { logger } from './logger.js';
|
|
3
|
+
|
|
1
4
|
const getWalletBookWallet = (walletBook, walletKey) => {
|
|
2
|
-
var _a, _b;
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
var _a, _b, _c;
|
|
6
|
+
if (!walletKey)
|
|
7
|
+
throw new Error('Wallet key is required. Please pass in a wallet key to getWalletBookWallet');
|
|
8
|
+
const walletDataFromKeyLookup = (_a = walletBook === null || walletBook === void 0 ? void 0 : walletBook.wallets) === null || _a === void 0 ? void 0 : _a[walletKey];
|
|
9
|
+
if (!walletDataFromKeyLookup) {
|
|
10
|
+
// adds fallback support. normalizeWalletName will be removed in v2
|
|
11
|
+
const normalizedWalletKey = normalizeWalletName(walletKey);
|
|
12
|
+
const walletDataFromNormalizedKeyLookup = (_b = walletBook === null || walletBook === void 0 ? void 0 : walletBook.wallets) === null || _b === void 0 ? void 0 : _b[normalizedWalletKey];
|
|
13
|
+
if (walletDataFromNormalizedKeyLookup) {
|
|
14
|
+
logger.warn(`deprecated: using walletName: ${walletKey} to look up wallet data is deprecated. use connector.key instead ${normalizedWalletKey}`);
|
|
15
|
+
return walletDataFromNormalizedKeyLookup;
|
|
16
|
+
}
|
|
17
|
+
throw new Error(`Wallet ${normalizedWalletKey} not found in wallet book (${Object.keys((_c = walletBook === null || walletBook === void 0 ? void 0 : walletBook.wallets) !== null && _c !== void 0 ? _c : {}).length} wallets found)`);
|
|
18
|
+
}
|
|
19
|
+
return walletDataFromKeyLookup;
|
|
8
20
|
};
|
|
9
21
|
|
|
10
22
|
export { getWalletBookWallet };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const normalizeWalletName = (name) => { var _a; return (_a = name === null || name === void 0 ? void 0 : name.toLowerCase().replace(/\W/g, '')) !== null && _a !== void 0 ? _a : 'undefined-wallet'; };
|
|
6
|
+
|
|
7
|
+
exports.normalizeWalletName = normalizeWalletName;
|