@dynamic-labs/utils 1.1.0-alpha.14 → 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 CHANGED
@@ -1,4 +1,31 @@
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
+
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)
11
+
12
+
13
+ ### Features
14
+
15
+ * add wallet group override to wallet book ([#4488](https://github.com/dynamic-labs/DynamicAuth/issues/4488)) ([cb19ad3](https://github.com/dynamic-labs/DynamicAuth/commit/cb19ad3ea82de488752ceceeaf0e1458a388df6e))
16
+ * enable solana embedded wallets ([#4457](https://github.com/dynamic-labs/DynamicAuth/issues/4457)) ([b0c47f4](https://github.com/dynamic-labs/DynamicAuth/commit/b0c47f4475baa12f52076da46ef993c13bd2c243))
17
+ * group ArgentX wallets ([#4495](https://github.com/dynamic-labs/DynamicAuth/issues/4495)) ([b10d79a](https://github.com/dynamic-labs/DynamicAuth/commit/b10d79a668efecedca37ddb358e6adf95319650d))
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * add support for newest backpack extension ([#4468](https://github.com/dynamic-labs/DynamicAuth/issues/4468)) ([a219f32](https://github.com/dynamic-labs/DynamicAuth/commit/a219f325be672599e50b07f6751234a7fc98286e))
23
+ * bump timeout for slower connections ([#4475](https://github.com/dynamic-labs/DynamicAuth/issues/4475)) ([7a07ff5](https://github.com/dynamic-labs/DynamicAuth/commit/7a07ff589eaaf3b28a94d277df3eedabbca60702))
24
+ * change out getWalletBookWallet for findWalletBookWallet to avoid throwing during lookup ([#4477](https://github.com/dynamic-labs/DynamicAuth/issues/4477)) ([4648040](https://github.com/dynamic-labs/DynamicAuth/commit/4648040c166e73dd2c31b0e27897713339436c2f))
25
+ * connect to wallet with wallet connect even if network is not supported ([#4465](https://github.com/dynamic-labs/DynamicAuth/issues/4465)) ([9dbca3e](https://github.com/dynamic-labs/DynamicAuth/commit/9dbca3eb4d4990ee4be642677c1604170b425dc3))
26
+ * pass id to wagmi chain override ([#4512](https://github.com/dynamic-labs/DynamicAuth/issues/4512)) ([2bf2f04](https://github.com/dynamic-labs/DynamicAuth/commit/2bf2f0487f5b1be936dd279107c11fe5d2b42666))
27
+ * switching wallet in extension caused connected flag to be false temporarily ([#4454](https://github.com/dynamic-labs/DynamicAuth/issues/4454)) ([3650f6e](https://github.com/dynamic-labs/DynamicAuth/commit/3650f6ec471a7c779f4d304ab94c9350dd55055b))
28
+
2
29
  ## [1.1.0-alpha.14](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.13...v1.1.0-alpha.14) (2024-01-23)
3
30
 
4
31
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/utils",
3
- "version": "1.1.0-alpha.14",
3
+ "version": "1.1.0-alpha.16",
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 || ^2.2.0"
30
30
  },
31
31
  "dependencies": {
32
- "@dynamic-labs/logger": "1.1.0-alpha.14",
33
- "@dynamic-labs/types": "1.1.0-alpha.14"
32
+ "@dynamic-labs/logger": "1.1.0-alpha.16",
33
+ "@dynamic-labs/types": "1.1.0-alpha.16"
34
34
  }
35
35
  }
package/src/index.cjs CHANGED
@@ -36,6 +36,7 @@ var retryableFn = require('./retryableFn.cjs');
36
36
  var wrapMethodWithCallback = require('./wrapMethodWithCallback/wrapMethodWithCallback.cjs');
37
37
  var DeferredPromise = require('./DeferredPromise/DeferredPromise.cjs');
38
38
  var handleMobileWalletRedirect = require('./handleMobileWalletRedirect/handleMobileWalletRedirect.cjs');
39
+ var uniq = require('./uniq/uniq.cjs');
39
40
 
40
41
 
41
42
 
@@ -87,3 +88,4 @@ exports.retryableFn = retryableFn.retryableFn;
87
88
  exports.wrapMethodWithCallback = wrapMethodWithCallback.wrapMethodWithCallback;
88
89
  exports.DeferredPromise = DeferredPromise.DeferredPromise;
89
90
  exports.handleMobileWalletRedirect = handleMobileWalletRedirect.handleMobileWalletRedirect;
91
+ exports.uniq = uniq.uniq;
package/src/index.d.ts CHANGED
@@ -14,3 +14,4 @@ export * from './retryableFn';
14
14
  export * from './wrapMethodWithCallback';
15
15
  export * from './DeferredPromise';
16
16
  export * from './handleMobileWalletRedirect';
17
+ export * from './uniq';
package/src/index.js CHANGED
@@ -32,3 +32,4 @@ export { FALLBACK_UNDEFINED, retryableFn } from './retryableFn.js';
32
32
  export { wrapMethodWithCallback } from './wrapMethodWithCallback/wrapMethodWithCallback.js';
33
33
  export { DeferredPromise } from './DeferredPromise/DeferredPromise.js';
34
34
  export { handleMobileWalletRedirect } from './handleMobileWalletRedirect/handleMobileWalletRedirect.js';
35
+ export { uniq } from './uniq/uniq.js';
@@ -8,6 +8,7 @@ const parseEvmNetworks = (networks) => {
8
8
  const clone = networks.slice();
9
9
  return clone.map((network) => {
10
10
  network.chainId = parseChainId.parseChainId(network.chainId);
11
+ network.networkId = parseChainId.parseChainId(network.networkId);
11
12
  return network;
12
13
  });
13
14
  };
@@ -4,6 +4,7 @@ const parseEvmNetworks = (networks) => {
4
4
  const clone = networks.slice();
5
5
  return clone.map((network) => {
6
6
  network.chainId = parseChainId(network.chainId);
7
+ network.networkId = parseChainId(network.networkId);
7
8
  return network;
8
9
  });
9
10
  };
@@ -0,0 +1 @@
1
+ export { uniq } from './uniq';
@@ -0,0 +1,32 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ /**
6
+ * Removes duplicate elements from an array.
7
+ *
8
+ * @param {T[]} array - The array to filter for unique elements.
9
+ * @template T - The type of elements in the array.
10
+ * @returns {T[]} A new array containing only the unique elements of the given array.
11
+ *
12
+ * @example
13
+ * // returns [1, 2, 3, 4, 5]
14
+ * uniq([1, 2, 2, 3, 4, 4, 5]);
15
+ *
16
+ * @example
17
+ * // returns ['apple', 'banana', 'orange']
18
+ * uniq(['apple', 'banana', 'apple', 'orange']);
19
+ *
20
+ */
21
+ const uniq = (array) => {
22
+ const seen = new Set();
23
+ return array.filter((item) => {
24
+ if (seen.has(item)) {
25
+ return false;
26
+ }
27
+ seen.add(item);
28
+ return true;
29
+ });
30
+ };
31
+
32
+ exports.uniq = uniq;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Removes duplicate elements from an array.
3
+ *
4
+ * @param {T[]} array - The array to filter for unique elements.
5
+ * @template T - The type of elements in the array.
6
+ * @returns {T[]} A new array containing only the unique elements of the given array.
7
+ *
8
+ * @example
9
+ * // returns [1, 2, 3, 4, 5]
10
+ * uniq([1, 2, 2, 3, 4, 4, 5]);
11
+ *
12
+ * @example
13
+ * // returns ['apple', 'banana', 'orange']
14
+ * uniq(['apple', 'banana', 'apple', 'orange']);
15
+ *
16
+ */
17
+ export declare const uniq: <T>(array: T[]) => T[];
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Removes duplicate elements from an array.
3
+ *
4
+ * @param {T[]} array - The array to filter for unique elements.
5
+ * @template T - The type of elements in the array.
6
+ * @returns {T[]} A new array containing only the unique elements of the given array.
7
+ *
8
+ * @example
9
+ * // returns [1, 2, 3, 4, 5]
10
+ * uniq([1, 2, 2, 3, 4, 4, 5]);
11
+ *
12
+ * @example
13
+ * // returns ['apple', 'banana', 'orange']
14
+ * uniq(['apple', 'banana', 'apple', 'orange']);
15
+ *
16
+ */
17
+ const uniq = (array) => {
18
+ const seen = new Set();
19
+ return array.filter((item) => {
20
+ if (seen.has(item)) {
21
+ return false;
22
+ }
23
+ seen.add(item);
24
+ return true;
25
+ });
26
+ };
27
+
28
+ export { uniq };