@dynamic-labs/utils 0.19.0-alpha.12 → 0.19.0-alpha.13

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,20 @@
1
1
 
2
+ ## [0.19.0-alpha.13](https://github.com/dynamic-labs/DynamicAuth/compare/v0.19.0-alpha.12...v0.19.0-alpha.13) (2023-10-04)
3
+
4
+
5
+ ### Features
6
+
7
+ * add ethers 5/6 util methods for converting connectors to ethers classes ([#3435](https://github.com/dynamic-labs/DynamicAuth/issues/3435)) ([5f4da48](https://github.com/dynamic-labs/DynamicAuth/commit/5f4da48526dbce4be2d437fc93f4cc8ddded73c5))
8
+ * show goerli icon on network button and a warning message ([#3494](https://github.com/dynamic-labs/DynamicAuth/issues/3494)) ([64851a3](https://github.com/dynamic-labs/DynamicAuth/commit/64851a3d60ba19dd164690dcb26056cad2d22e61))
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * fix broken test ([#3520](https://github.com/dynamic-labs/DynamicAuth/issues/3520)) ([d7a3bd4](https://github.com/dynamic-labs/DynamicAuth/commit/d7a3bd4c71309a2df8106cae3f8f03f4aaedaa56))
14
+ * **handleWalletsToConnect:** require wallet connector in the props ([#3512](https://github.com/dynamic-labs/DynamicAuth/issues/3512)) ([ddc0d19](https://github.com/dynamic-labs/DynamicAuth/commit/ddc0d19c9996f4fd52d19aad837fdf1e632d1b3d))
15
+ * use providers redirect url in getOauthLoginUrl function ([#3519](https://github.com/dynamic-labs/DynamicAuth/issues/3519)) ([3f8601d](https://github.com/dynamic-labs/DynamicAuth/commit/3f8601d47d2fc6aa65f3a6890b1b9a4b93c9e9f6))
16
+ * **wagmi-connector:** set websocket rpc to wagmi client ([#3474](https://github.com/dynamic-labs/DynamicAuth/issues/3474)) ([c94a43e](https://github.com/dynamic-labs/DynamicAuth/commit/c94a43ea9be11352313eafb2cd42c5f4941562a3))
17
+
2
18
  ## [0.19.0-alpha.12](https://github.com/dynamic-labs/DynamicAuth/compare/v0.19.0-alpha.11...v0.19.0-alpha.12) (2023-10-03)
3
19
 
4
20
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/utils",
3
- "version": "0.19.0-alpha.12",
3
+ "version": "0.19.0-alpha.13",
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.5.3"
30
30
  },
31
31
  "dependencies": {
32
- "@dynamic-labs/logger": "0.19.0-alpha.12",
33
- "@dynamic-labs/types": "0.19.0-alpha.12"
32
+ "@dynamic-labs/logger": "0.19.0-alpha.13",
33
+ "@dynamic-labs/types": "0.19.0-alpha.13"
34
34
  }
35
35
  }
@@ -5,13 +5,12 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  /**
6
6
  * return the destination (value)
7
7
  *
8
- * @param {object} obj - object to search for the item
9
8
  * @param {string} path - path in the obj to the item
10
9
  * @returns {T[]} - array of found items
11
10
  */
12
- const getPathFromObject = (obj, path) => {
11
+ const getProvidersFromWindow = (path) => {
13
12
  const splitPath = path.split('.');
14
- let result = obj;
13
+ let result = window;
15
14
  const foundProviders = [];
16
15
  for (const [index, p] of Object.entries(splitPath)) {
17
16
  result = result[p];
@@ -24,11 +23,16 @@ const getPathFromObject = (obj, path) => {
24
23
  result.forEach((p) => foundProviders.push(p));
25
24
  }
26
25
  else {
27
- foundProviders.push(result);
26
+ if (result.providers) {
27
+ result.providers.forEach((p) => foundProviders.push(p));
28
+ }
29
+ else {
30
+ foundProviders.push(result);
31
+ }
28
32
  }
29
33
  }
30
34
  }
31
35
  return foundProviders;
32
36
  };
33
37
 
34
- exports.getPathFromObject = getPathFromObject;
38
+ exports.getProvidersFromWindow = getProvidersFromWindow;
@@ -1,8 +1,7 @@
1
1
  /**
2
2
  * return the destination (value)
3
3
  *
4
- * @param {object} obj - object to search for the item
5
4
  * @param {string} path - path in the obj to the item
6
5
  * @returns {T[]} - array of found items
7
6
  */
8
- export declare const getPathFromObject: <T>(obj: object, path: string) => T[];
7
+ export declare const getProvidersFromWindow: <T>(path: string) => T[];
@@ -1,13 +1,12 @@
1
1
  /**
2
2
  * return the destination (value)
3
3
  *
4
- * @param {object} obj - object to search for the item
5
4
  * @param {string} path - path in the obj to the item
6
5
  * @returns {T[]} - array of found items
7
6
  */
8
- const getPathFromObject = (obj, path) => {
7
+ const getProvidersFromWindow = (path) => {
9
8
  const splitPath = path.split('.');
10
- let result = obj;
9
+ let result = window;
11
10
  const foundProviders = [];
12
11
  for (const [index, p] of Object.entries(splitPath)) {
13
12
  result = result[p];
@@ -20,11 +19,16 @@ const getPathFromObject = (obj, path) => {
20
19
  result.forEach((p) => foundProviders.push(p));
21
20
  }
22
21
  else {
23
- foundProviders.push(result);
22
+ if (result.providers) {
23
+ result.providers.forEach((p) => foundProviders.push(p));
24
+ }
25
+ else {
26
+ foundProviders.push(result);
27
+ }
24
28
  }
25
29
  }
26
30
  }
27
31
  return foundProviders;
28
32
  };
29
33
 
30
- export { getPathFromObject };
34
+ export { getProvidersFromWindow };
package/src/index.cjs CHANGED
@@ -26,7 +26,7 @@ var isMobile = require('./isMobile.cjs');
26
26
  var localStorageAsync = require('./localStorageAsync.cjs');
27
27
  var bufferToBase64 = require('./bufferToBase64.cjs');
28
28
  var last = require('./last.cjs');
29
- var getPathFromObject = require('./getPathFromObject.cjs');
29
+ var getProvidersFromWindow = require('./getProvidersFromWindow.cjs');
30
30
  var sleep = require('./sleep/sleep.cjs');
31
31
  var getOrMapViemChain = require('./getOrMapViemChain.cjs');
32
32
  var bigIntToHex = require('./bigIntToHex/bigIntToHex.cjs');
@@ -69,7 +69,7 @@ exports.removeItemAsync = localStorageAsync.removeItemAsync;
69
69
  exports.setItemAsync = localStorageAsync.setItemAsync;
70
70
  exports.bufferToBase64 = bufferToBase64.bufferToBase64;
71
71
  exports.last = last.last;
72
- exports.getPathFromObject = getPathFromObject.getPathFromObject;
72
+ exports.getProvidersFromWindow = getProvidersFromWindow.getProvidersFromWindow;
73
73
  exports.sleep = sleep.sleep;
74
74
  exports.getChain = getOrMapViemChain.getChain;
75
75
  exports.getOrMapViemChain = getOrMapViemChain.getOrMapViemChain;
package/src/index.d.ts CHANGED
@@ -7,7 +7,7 @@ export * from './isMobile';
7
7
  export * from './localStorageAsync';
8
8
  export * from './bufferToBase64';
9
9
  export * from './last';
10
- export * from './getPathFromObject';
10
+ export * from './getProvidersFromWindow';
11
11
  export * from './sleep';
12
12
  export * from './getOrMapViemChain';
13
13
  export * from './bigIntToHex';
package/src/index.js CHANGED
@@ -22,7 +22,7 @@ export { getAndroidVersion, isAndroid, isIOS, isIPad, isIPhone, isIPhone8OrEarli
22
22
  export { getItemAsync, removeItemAsync, setItemAsync } from './localStorageAsync.js';
23
23
  export { bufferToBase64 } from './bufferToBase64.js';
24
24
  export { last } from './last.js';
25
- export { getPathFromObject } from './getPathFromObject.js';
25
+ export { getProvidersFromWindow } from './getProvidersFromWindow.js';
26
26
  export { sleep } from './sleep/sleep.js';
27
27
  export { getChain, getOrMapViemChain, mapChain } from './getOrMapViemChain.js';
28
28
  export { bigIntToHex } from './bigIntToHex/bigIntToHex.js';