@dynamic-labs/flow 0.17.0-RC.21 → 0.17.0-RC.23
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 +15 -0
- package/package.json +3 -3
- package/src/FlowWalletConnector.cjs +0 -27
- package/src/FlowWalletConnector.d.ts +0 -5
- package/src/FlowWalletConnector.js +1 -27
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,19 @@
|
|
|
1
1
|
|
|
2
|
+
## [0.17.0-RC.23](https://github.com/dynamic-labs/DynamicAuth/compare/v0.17.0-RC.22...v0.17.0-RC.23) (2023-06-02)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* flow connection status improvements ([#2212](https://github.com/dynamic-labs/DynamicAuth/issues/2212)) ([5225e9f](https://github.com/dynamic-labs/DynamicAuth/commit/5225e9f3f19705cdde3c1d860ddf4e69689a839b))
|
|
8
|
+
* **useSyncPrimaryWallet:** disables the hook while connect state is loaded ([#2193](https://github.com/dynamic-labs/DynamicAuth/issues/2193)) ([d2a69c8](https://github.com/dynamic-labs/DynamicAuth/commit/d2a69c8edfbb2a19305b0fd322e24d909bbf9b4f)), closes [#2155](https://github.com/dynamic-labs/DynamicAuth/issues/2155)
|
|
9
|
+
|
|
10
|
+
## [0.17.0-RC.22](https://github.com/dynamic-labs/DynamicAuth/compare/v0.17.0-RC.21...v0.17.0-RC.22) (2023-06-02)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* social copy update ([#2215](https://github.com/dynamic-labs/DynamicAuth/issues/2215)) ([1fe7316](https://github.com/dynamic-labs/DynamicAuth/commit/1fe7316a94284db7227d5ab09026354269559752))
|
|
16
|
+
|
|
2
17
|
## [0.17.0-RC.21](https://github.com/dynamic-labs/DynamicAuth/compare/v0.17.0-RC.20...v0.17.0-RC.21) (2023-06-02)
|
|
3
18
|
|
|
4
19
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/flow",
|
|
3
|
-
"version": "0.17.0-RC.
|
|
3
|
+
"version": "0.17.0-RC.23",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/dynamic-labs/DynamicAuth.git",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@onflow/fcl": "1.3.2",
|
|
30
|
-
"@dynamic-labs/utils": "0.17.0-RC.
|
|
31
|
-
"@dynamic-labs/wallet-connector-core": "0.17.0-RC.
|
|
30
|
+
"@dynamic-labs/utils": "0.17.0-RC.23",
|
|
31
|
+
"@dynamic-labs/wallet-connector-core": "0.17.0-RC.23"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {}
|
|
34
34
|
}
|
|
@@ -7,31 +7,6 @@ var fcl = require('@onflow/fcl');
|
|
|
7
7
|
var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
|
|
8
8
|
var utils = require('@dynamic-labs/utils');
|
|
9
9
|
|
|
10
|
-
const get = (key) => {
|
|
11
|
-
if (typeof window === 'undefined') {
|
|
12
|
-
return undefined;
|
|
13
|
-
}
|
|
14
|
-
const value = window.localStorage.getItem(key);
|
|
15
|
-
try {
|
|
16
|
-
if (value) {
|
|
17
|
-
return JSON.parse(value);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
catch (e) {
|
|
21
|
-
walletConnectorCore.logger.error(e);
|
|
22
|
-
}
|
|
23
|
-
return undefined;
|
|
24
|
-
};
|
|
25
|
-
const set = (key, value) => {
|
|
26
|
-
if (typeof window !== 'undefined') {
|
|
27
|
-
window.localStorage.setItem(key, JSON.stringify(value));
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
const LOCAL_STORAGE = {
|
|
31
|
-
can: true,
|
|
32
|
-
get: (key) => _tslib.__awaiter(void 0, void 0, void 0, function* () { return get(key); }),
|
|
33
|
-
put: (key, value) => _tslib.__awaiter(void 0, void 0, void 0, function* () { return set(key, value); }),
|
|
34
|
-
};
|
|
35
10
|
class FlowWalletConnector extends walletConnectorCore.WalletConnectorBase {
|
|
36
11
|
constructor({ appName, appLogoUrl, flowNetwork, }) {
|
|
37
12
|
super();
|
|
@@ -64,7 +39,6 @@ class FlowWalletConnector extends walletConnectorCore.WalletConnectorBase {
|
|
|
64
39
|
yield fcl.config()
|
|
65
40
|
.put('app.detail.title', this.appName)
|
|
66
41
|
.put('app.detail.icon', this.appLogoUrl)
|
|
67
|
-
.put('fcl.storage', LOCAL_STORAGE)
|
|
68
42
|
.put('accessNode.api', this.network === 'testnet'
|
|
69
43
|
? 'https://rest-testnet.onflow.org'
|
|
70
44
|
: 'https://rest-mainnet.onflow.org')
|
|
@@ -166,4 +140,3 @@ class FlowWalletConnector extends walletConnectorCore.WalletConnectorBase {
|
|
|
166
140
|
}
|
|
167
141
|
|
|
168
142
|
exports.FlowWalletConnector = FlowWalletConnector;
|
|
169
|
-
exports.LOCAL_STORAGE = LOCAL_STORAGE;
|
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
import { Chain, WalletConnectorBase, WalletEventListeners } from '@dynamic-labs/wallet-connector-core';
|
|
2
|
-
export declare const LOCAL_STORAGE: {
|
|
3
|
-
can: boolean;
|
|
4
|
-
get: (key: string) => Promise<any>;
|
|
5
|
-
put: (key: string, value: any) => Promise<void>;
|
|
6
|
-
};
|
|
7
2
|
export declare abstract class FlowWalletConnector extends WalletConnectorBase {
|
|
8
3
|
protected appName?: string;
|
|
9
4
|
protected appLogoUrl?: string;
|
|
@@ -3,31 +3,6 @@ import { currentUser, config, send, script, decode } from '@onflow/fcl';
|
|
|
3
3
|
import { WalletConnectorBase, logger } from '@dynamic-labs/wallet-connector-core';
|
|
4
4
|
import { DynamicError } from '@dynamic-labs/utils';
|
|
5
5
|
|
|
6
|
-
const get = (key) => {
|
|
7
|
-
if (typeof window === 'undefined') {
|
|
8
|
-
return undefined;
|
|
9
|
-
}
|
|
10
|
-
const value = window.localStorage.getItem(key);
|
|
11
|
-
try {
|
|
12
|
-
if (value) {
|
|
13
|
-
return JSON.parse(value);
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
catch (e) {
|
|
17
|
-
logger.error(e);
|
|
18
|
-
}
|
|
19
|
-
return undefined;
|
|
20
|
-
};
|
|
21
|
-
const set = (key, value) => {
|
|
22
|
-
if (typeof window !== 'undefined') {
|
|
23
|
-
window.localStorage.setItem(key, JSON.stringify(value));
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
const LOCAL_STORAGE = {
|
|
27
|
-
can: true,
|
|
28
|
-
get: (key) => __awaiter(void 0, void 0, void 0, function* () { return get(key); }),
|
|
29
|
-
put: (key, value) => __awaiter(void 0, void 0, void 0, function* () { return set(key, value); }),
|
|
30
|
-
};
|
|
31
6
|
class FlowWalletConnector extends WalletConnectorBase {
|
|
32
7
|
constructor({ appName, appLogoUrl, flowNetwork, }) {
|
|
33
8
|
super();
|
|
@@ -60,7 +35,6 @@ class FlowWalletConnector extends WalletConnectorBase {
|
|
|
60
35
|
yield config()
|
|
61
36
|
.put('app.detail.title', this.appName)
|
|
62
37
|
.put('app.detail.icon', this.appLogoUrl)
|
|
63
|
-
.put('fcl.storage', LOCAL_STORAGE)
|
|
64
38
|
.put('accessNode.api', this.network === 'testnet'
|
|
65
39
|
? 'https://rest-testnet.onflow.org'
|
|
66
40
|
: 'https://rest-mainnet.onflow.org')
|
|
@@ -161,4 +135,4 @@ class FlowWalletConnector extends WalletConnectorBase {
|
|
|
161
135
|
}
|
|
162
136
|
}
|
|
163
137
|
|
|
164
|
-
export { FlowWalletConnector
|
|
138
|
+
export { FlowWalletConnector };
|