@dynamic-labs/wallet-book 1.0.6 → 1.0.8
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/package.json +4 -2
- package/src/build/sources/walletConnect/index.d.ts +8 -8
- package/src/components/WalletIcon.cjs +1 -0
- package/src/components/WalletIcon.js +1 -0
- package/src/hooks/useWalletBookCdn.cjs +22 -16
- package/src/hooks/useWalletBookCdn.js +22 -16
- package/src/hooks/useWalletBookContext.cjs +1 -0
- package/src/hooks/useWalletBookContext.js +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,23 @@
|
|
|
1
1
|
|
|
2
|
+
### [1.0.8](https://github.com/dynamic-labs/DynamicAuth/compare/v1.0.7...v1.0.8) (2024-01-26)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* pass id to wagmi chain override ([#4512](https://github.com/dynamic-labs/DynamicAuth/issues/4512)) ([#4514](https://github.com/dynamic-labs/DynamicAuth/issues/4514)) ([0e6da01](https://github.com/dynamic-labs/DynamicAuth/commit/0e6da0108d30b9ae65062126f4a41543740acc87))
|
|
8
|
+
|
|
9
|
+
### [1.0.7](https://github.com/dynamic-labs/DynamicAuth/compare/v1.0.6...v1.0.7) (2024-01-25)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* add support for newest backpack extension ([66786ce](https://github.com/dynamic-labs/DynamicAuth/commit/66786ceb7927046c1cdb439888271f3070ca93a4))
|
|
15
|
+
* broken help icon in create passkey view ([2e38ea5](https://github.com/dynamic-labs/DynamicAuth/commit/2e38ea580e55f3349a2d3040d7b07bb2923631f7))
|
|
16
|
+
* connect to wallet with wallet connect even if network is not supported ([#4465](https://github.com/dynamic-labs/DynamicAuth/issues/4465)) ([#4472](https://github.com/dynamic-labs/DynamicAuth/issues/4472)) ([8270b94](https://github.com/dynamic-labs/DynamicAuth/commit/8270b9468c289e7c49cd2ef104fb73dfaaa9f41c))
|
|
17
|
+
* infinite loop when connecting with trust wallet ([#4448](https://github.com/dynamic-labs/DynamicAuth/issues/4448)) ([#4450](https://github.com/dynamic-labs/DynamicAuth/issues/4450)) ([c5ffee6](https://github.com/dynamic-labs/DynamicAuth/commit/c5ffee67a6a95ee62e779da69ce311c90575388f))
|
|
18
|
+
* logging in with an email linked to a third party wallet gets stu… ([#4422](https://github.com/dynamic-labs/DynamicAuth/issues/4422)) ([995889b](https://github.com/dynamic-labs/DynamicAuth/commit/995889b5d03bcbafecd6959c52a88db8d9db940e))
|
|
19
|
+
* switching wallet in extension caused connected flag to be false ([#4464](https://github.com/dynamic-labs/DynamicAuth/issues/4464)) ([a53dc1a](https://github.com/dynamic-labs/DynamicAuth/commit/a53dc1a9869a270c98753041cfbd587855629af4)), closes [#4454](https://github.com/dynamic-labs/DynamicAuth/issues/4454)
|
|
20
|
+
|
|
2
21
|
### [1.0.6](https://github.com/dynamic-labs/DynamicAuth/compare/v1.0.5...v1.0.6) (2024-01-18)
|
|
3
22
|
|
|
4
23
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/wallet-book",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.8",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/dynamic-labs/DynamicAuth.git",
|
|
@@ -26,7 +26,9 @@
|
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"zod": "3.22.4",
|
|
29
|
-
"@dynamic-labs/logger": "1.0.
|
|
29
|
+
"@dynamic-labs/logger": "1.0.8",
|
|
30
|
+
"@dynamic-labs/utils": "1.0.8",
|
|
31
|
+
"util": "0.12.5"
|
|
30
32
|
},
|
|
31
33
|
"peerDependencies": {
|
|
32
34
|
"react": "^17.0.2 || ^18.0.0",
|
|
@@ -11,13 +11,6 @@ export declare const walletConnectSourceData: Record<string, {
|
|
|
11
11
|
universal: string | null;
|
|
12
12
|
};
|
|
13
13
|
sdks: string[];
|
|
14
|
-
metadata: {
|
|
15
|
-
shortName: string | null;
|
|
16
|
-
colors: {
|
|
17
|
-
primary: string | null;
|
|
18
|
-
secondary: string | null;
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
14
|
app: {
|
|
22
15
|
android: string | null;
|
|
23
16
|
ios: string | null;
|
|
@@ -46,14 +39,21 @@ 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
|
-
title: string;
|
|
54
53
|
id: string;
|
|
55
54
|
standard_id: number;
|
|
56
55
|
standard_prefix: string;
|
|
56
|
+
title: string;
|
|
57
57
|
url: string;
|
|
58
58
|
}[] | undefined;
|
|
59
59
|
}>;
|
|
@@ -7,6 +7,7 @@ var react = require('react');
|
|
|
7
7
|
var getWalletIconUrl = require('../helpers/getWalletIconUrl.cjs');
|
|
8
8
|
var findWalletBookWallet = require('../helpers/findWalletBookWallet.cjs');
|
|
9
9
|
require('../helpers/logger.cjs');
|
|
10
|
+
require('@dynamic-labs/utils');
|
|
10
11
|
require('../schemas/walletConnectSourceSchema.cjs');
|
|
11
12
|
require('../schemas/walletBookSchema.cjs');
|
|
12
13
|
require('../schemas/walletSchema.cjs');
|
|
@@ -3,6 +3,7 @@ import { useState, createElement, Fragment } from 'react';
|
|
|
3
3
|
import { getWalletIconUrl, getDefaultWalletIconUrl } from '../helpers/getWalletIconUrl.js';
|
|
4
4
|
import { findWalletBookWallet } from '../helpers/findWalletBookWallet.js';
|
|
5
5
|
import '../helpers/logger.js';
|
|
6
|
+
import '@dynamic-labs/utils';
|
|
6
7
|
import '../schemas/walletConnectSourceSchema.js';
|
|
7
8
|
import '../schemas/walletBookSchema.js';
|
|
8
9
|
import '../schemas/walletSchema.js';
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var _tslib = require('../../_virtual/_tslib.cjs');
|
|
6
6
|
var react = require('react');
|
|
7
|
+
var utils = require('@dynamic-labs/utils');
|
|
7
8
|
require('../schemas/walletConnectSourceSchema.cjs');
|
|
8
9
|
var walletBookSchema = require('../schemas/walletBookSchema.cjs');
|
|
9
10
|
require('../schemas/walletSchema.cjs');
|
|
@@ -16,23 +17,28 @@ const useWalletBookCdn = () => {
|
|
|
16
17
|
react.useEffect(() => {
|
|
17
18
|
const fetchWalletBook = () => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
18
19
|
const url = getWalletBookCdnUrl.getWalletBookCdnUrl();
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
const fn = () => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
21
|
+
const res = yield fetch(url, { mode: 'cors' });
|
|
22
|
+
if (res.ok) {
|
|
23
|
+
const json = yield res.json();
|
|
24
|
+
try {
|
|
25
|
+
const parsedData = walletBookSchema.walletBookSchema.parse(json);
|
|
26
|
+
return parsedData;
|
|
27
|
+
}
|
|
28
|
+
catch (e) {
|
|
29
|
+
logger.logger.error('Error parsing wallet book data', e, json);
|
|
30
|
+
throw e;
|
|
31
|
+
}
|
|
24
32
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
data = walletBookSchema.walletBookSchema.parse(walletBookFallbacks["default"]);
|
|
35
|
-
}
|
|
33
|
+
throw new Error(`Failed to fetch wallet book data from ${url} with status code ${res.status}`);
|
|
34
|
+
});
|
|
35
|
+
const data = yield utils.retryableFn(fn, {
|
|
36
|
+
fallbackValue: walletBookSchema.walletBookSchema.parse(walletBookFallbacks["default"]),
|
|
37
|
+
logger: logger.logger.createLogger('useWalletBookCdn'),
|
|
38
|
+
maxRetries: 3,
|
|
39
|
+
retryStrategy: 'timeout-and-rejection',
|
|
40
|
+
timeoutMs: 30000,
|
|
41
|
+
});
|
|
36
42
|
setWalletBook(data);
|
|
37
43
|
});
|
|
38
44
|
fetchWalletBook();
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { __awaiter } from '../../_virtual/_tslib.js';
|
|
2
2
|
import { useState, useEffect } from 'react';
|
|
3
|
+
import { retryableFn } from '@dynamic-labs/utils';
|
|
3
4
|
import '../schemas/walletConnectSourceSchema.js';
|
|
4
5
|
import { walletBookSchema } from '../schemas/walletBookSchema.js';
|
|
5
6
|
import '../schemas/walletSchema.js';
|
|
@@ -12,23 +13,28 @@ const useWalletBookCdn = () => {
|
|
|
12
13
|
useEffect(() => {
|
|
13
14
|
const fetchWalletBook = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
14
15
|
const url = getWalletBookCdnUrl();
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
const fn = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
17
|
+
const res = yield fetch(url, { mode: 'cors' });
|
|
18
|
+
if (res.ok) {
|
|
19
|
+
const json = yield res.json();
|
|
20
|
+
try {
|
|
21
|
+
const parsedData = walletBookSchema.parse(json);
|
|
22
|
+
return parsedData;
|
|
23
|
+
}
|
|
24
|
+
catch (e) {
|
|
25
|
+
logger.error('Error parsing wallet book data', e, json);
|
|
26
|
+
throw e;
|
|
27
|
+
}
|
|
20
28
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
data = walletBookSchema.parse(walletBookFallbacks);
|
|
31
|
-
}
|
|
29
|
+
throw new Error(`Failed to fetch wallet book data from ${url} with status code ${res.status}`);
|
|
30
|
+
});
|
|
31
|
+
const data = yield retryableFn(fn, {
|
|
32
|
+
fallbackValue: walletBookSchema.parse(walletBookFallbacks),
|
|
33
|
+
logger: logger.createLogger('useWalletBookCdn'),
|
|
34
|
+
maxRetries: 3,
|
|
35
|
+
retryStrategy: 'timeout-and-rejection',
|
|
36
|
+
timeoutMs: 30000,
|
|
37
|
+
});
|
|
32
38
|
setWalletBook(data);
|
|
33
39
|
});
|
|
34
40
|
fetchWalletBook();
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var react = require('react');
|
|
6
6
|
require('../helpers/logger.cjs');
|
|
7
|
+
require('@dynamic-labs/utils');
|
|
7
8
|
require('../schemas/walletConnectSourceSchema.cjs');
|
|
8
9
|
require('../schemas/walletBookSchema.cjs');
|
|
9
10
|
require('../schemas/walletSchema.cjs');
|