@dynamic-labs/utils 1.1.0-alpha.2 → 1.1.0-alpha.4
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 +24 -0
- package/package.json +3 -3
- package/src/localStorageAsync.cjs +11 -2
- package/src/localStorageAsync.d.ts +2 -2
- package/src/localStorageAsync.js +11 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,28 @@
|
|
|
1
1
|
|
|
2
|
+
## [1.1.0-alpha.4](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.3...v1.1.0-alpha.4) (2023-12-21)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* add bitcoin integration ([#4216](https://github.com/dynamic-labs/DynamicAuth/issues/4216)) ([9584f1c](https://github.com/dynamic-labs/DynamicAuth/commit/9584f1cc3133835049ad1c53da980192263b8f21))
|
|
8
|
+
* add default footer to wallet list when tos and pp not enabled ([#4224](https://github.com/dynamic-labs/DynamicAuth/issues/4224)) ([0ad81c4](https://github.com/dynamic-labs/DynamicAuth/commit/0ad81c409bcb4aafb0dc565685525d620a95efce))
|
|
9
|
+
* adds useConnectWithEmailOtp ([#4234](https://github.com/dynamic-labs/DynamicAuth/issues/4234)) ([4a4e50a](https://github.com/dynamic-labs/DynamicAuth/commit/4a4e50ac8651c2a249d5125ae6bcf49aaf49be8c))
|
|
10
|
+
|
|
11
|
+
## [1.1.0-alpha.3](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.2...v1.1.0-alpha.3) (2023-12-19)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* add Flow support in magic wallet connector ([#4158](https://github.com/dynamic-labs/DynamicAuth/issues/4158)) ([fbbaea7](https://github.com/dynamic-labs/DynamicAuth/commit/fbbaea76b36ceb693f6bd4f2404dfa1204e61492))
|
|
17
|
+
* add showDynamicUserProfile to DynamicContext ([#4214](https://github.com/dynamic-labs/DynamicAuth/issues/4214)) ([2aeb8e3](https://github.com/dynamic-labs/DynamicAuth/commit/2aeb8e3c45a3d9f87bd9196ea9b46927e02eb633))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* add shortname to braveevm to allow for lookups by name as well as key ([#4213](https://github.com/dynamic-labs/DynamicAuth/issues/4213)) ([969b089](https://github.com/dynamic-labs/DynamicAuth/commit/969b089be516fb57fcdc941f908c078998eb4ec0))
|
|
23
|
+
* solflare connect ([#4215](https://github.com/dynamic-labs/DynamicAuth/issues/4215)) ([9a4164e](https://github.com/dynamic-labs/DynamicAuth/commit/9a4164e53198f33ef7201cd4e1eff745a09e9701))
|
|
24
|
+
* wagmi attempt to connect to primary wallet first ([#4206](https://github.com/dynamic-labs/DynamicAuth/issues/4206)) ([9e5fc8e](https://github.com/dynamic-labs/DynamicAuth/commit/9e5fc8ef026628935ac32d3bb0c22bda35057e5d))
|
|
25
|
+
|
|
2
26
|
## [1.1.0-alpha.2](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.1...v1.1.0-alpha.2) (2023-12-18)
|
|
3
27
|
|
|
4
28
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/utils",
|
|
3
|
-
"version": "1.1.0-alpha.
|
|
3
|
+
"version": "1.1.0-alpha.4",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/dynamic-labs/DynamicAuth.git",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"viem": "^1.19.13"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@dynamic-labs/logger": "1.1.0-alpha.
|
|
33
|
-
"@dynamic-labs/types": "1.1.0-alpha.
|
|
32
|
+
"@dynamic-labs/logger": "1.1.0-alpha.4",
|
|
33
|
+
"@dynamic-labs/types": "1.1.0-alpha.4"
|
|
34
34
|
}
|
|
35
35
|
}
|
|
@@ -8,13 +8,22 @@ const getItemAsync = (key) => _tslib.__awaiter(void 0, void 0, void 0, function*
|
|
|
8
8
|
if (typeof window === 'undefined') {
|
|
9
9
|
return undefined;
|
|
10
10
|
}
|
|
11
|
-
|
|
11
|
+
const value = window.localStorage.getItem(key);
|
|
12
|
+
if (!value) {
|
|
13
|
+
return undefined;
|
|
14
|
+
}
|
|
15
|
+
try {
|
|
16
|
+
return JSON.parse(value);
|
|
17
|
+
}
|
|
18
|
+
catch (error) {
|
|
19
|
+
return value;
|
|
20
|
+
}
|
|
12
21
|
});
|
|
13
22
|
const setItemAsync = (key, value) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
14
23
|
if (typeof window === 'undefined') {
|
|
15
24
|
return undefined;
|
|
16
25
|
}
|
|
17
|
-
|
|
26
|
+
window.localStorage.setItem(key, JSON.stringify(value));
|
|
18
27
|
});
|
|
19
28
|
const removeItemAsync = (key) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
20
29
|
if (typeof window === 'undefined') {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const getItemAsync: (key: string) => Promise<
|
|
2
|
-
export declare const setItemAsync: (key: string, value:
|
|
1
|
+
export declare const getItemAsync: <T = string>(key: string) => Promise<T | undefined>;
|
|
2
|
+
export declare const setItemAsync: <T = string>(key: string, value: T) => Promise<void>;
|
|
3
3
|
export declare const removeItemAsync: (key: string) => Promise<void>;
|
package/src/localStorageAsync.js
CHANGED
|
@@ -4,13 +4,22 @@ const getItemAsync = (key) => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
4
4
|
if (typeof window === 'undefined') {
|
|
5
5
|
return undefined;
|
|
6
6
|
}
|
|
7
|
-
|
|
7
|
+
const value = window.localStorage.getItem(key);
|
|
8
|
+
if (!value) {
|
|
9
|
+
return undefined;
|
|
10
|
+
}
|
|
11
|
+
try {
|
|
12
|
+
return JSON.parse(value);
|
|
13
|
+
}
|
|
14
|
+
catch (error) {
|
|
15
|
+
return value;
|
|
16
|
+
}
|
|
8
17
|
});
|
|
9
18
|
const setItemAsync = (key, value) => __awaiter(void 0, void 0, void 0, function* () {
|
|
10
19
|
if (typeof window === 'undefined') {
|
|
11
20
|
return undefined;
|
|
12
21
|
}
|
|
13
|
-
|
|
22
|
+
window.localStorage.setItem(key, JSON.stringify(value));
|
|
14
23
|
});
|
|
15
24
|
const removeItemAsync = (key) => __awaiter(void 0, void 0, void 0, function* () {
|
|
16
25
|
if (typeof window === 'undefined') {
|