@dynamic-labs/utils 2.1.0-alpha.0 → 2.1.0-alpha.10

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.
Files changed (114) hide show
  1. package/CHANGELOG.md +100 -0
  2. package/_virtual/_tslib.cjs +1 -0
  3. package/_virtual/_tslib.js +1 -0
  4. package/package.json +5 -3
  5. package/src/CancellablePromise/CancellablePromise.cjs +1 -0
  6. package/src/CancellablePromise/CancellablePromise.js +1 -0
  7. package/src/DeferredPromise/DeferredPromise.cjs +1 -0
  8. package/src/DeferredPromise/DeferredPromise.js +1 -0
  9. package/src/bufferPolyfill.cjs +15 -0
  10. package/src/bufferPolyfill.d.ts +1 -0
  11. package/src/bufferPolyfill.js +13 -0
  12. package/src/bufferToBase64.cjs +3 -0
  13. package/src/bufferToBase64.d.ts +1 -0
  14. package/src/bufferToBase64.js +3 -0
  15. package/src/ceil/ceil.cjs +1 -0
  16. package/src/ceil/ceil.js +1 -0
  17. package/src/errors/AccountExistsError.cjs +1 -0
  18. package/src/errors/AccountExistsError.js +1 -0
  19. package/src/errors/ChainalysisError.cjs +1 -0
  20. package/src/errors/ChainalysisError.js +1 -0
  21. package/src/errors/CustomError.cjs +1 -0
  22. package/src/errors/CustomError.js +1 -0
  23. package/src/errors/DynamicError.cjs +1 -0
  24. package/src/errors/DynamicError.js +1 -0
  25. package/src/errors/EmailAlreadyExistsError.cjs +1 -0
  26. package/src/errors/EmailAlreadyExistsError.js +1 -0
  27. package/src/errors/EmailProviderError.cjs +1 -0
  28. package/src/errors/EmailProviderError.js +1 -0
  29. package/src/errors/EmailVerificationError.cjs +1 -0
  30. package/src/errors/EmailVerificationError.js +1 -0
  31. package/src/errors/GateBlockedError.cjs +1 -0
  32. package/src/errors/GateBlockedError.js +1 -0
  33. package/src/errors/InsufficientFundsError.cjs +1 -0
  34. package/src/errors/InsufficientFundsError.js +1 -0
  35. package/src/errors/InvalidPhoneNumberError.cjs +1 -0
  36. package/src/errors/InvalidPhoneNumberError.js +1 -0
  37. package/src/errors/MergeAccountsConfirmationError.cjs +16 -0
  38. package/src/errors/MergeAccountsConfirmationError.d.ts +12 -0
  39. package/src/errors/MergeAccountsConfirmationError.js +12 -0
  40. package/src/errors/MissingEnvironmentIdError.cjs +1 -0
  41. package/src/errors/MissingEnvironmentIdError.js +1 -0
  42. package/src/errors/MissingPublicAddressError.cjs +1 -0
  43. package/src/errors/MissingPublicAddressError.js +1 -0
  44. package/src/errors/NoAccessError.cjs +1 -0
  45. package/src/errors/NoAccessError.js +1 -0
  46. package/src/errors/NotSupportedError.cjs +1 -0
  47. package/src/errors/NotSupportedError.js +1 -0
  48. package/src/errors/SmsVerificationError.cjs +1 -0
  49. package/src/errors/SmsVerificationError.js +1 -0
  50. package/src/errors/SocialAccountAlreadyExistsError.cjs +1 -0
  51. package/src/errors/SocialAccountAlreadyExistsError.js +1 -0
  52. package/src/errors/TooManyEmailVerificationsError.cjs +1 -0
  53. package/src/errors/TooManyEmailVerificationsError.js +1 -0
  54. package/src/errors/TransactionGasCannotBeSponsoredError.cjs +1 -0
  55. package/src/errors/TransactionGasCannotBeSponsoredError.js +1 -0
  56. package/src/errors/UserHasAccountWithEmailError.cjs +1 -0
  57. package/src/errors/UserHasAccountWithEmailError.js +1 -0
  58. package/src/errors/UserRejectedTransactionError.cjs +1 -0
  59. package/src/errors/UserRejectedTransactionError.js +1 -0
  60. package/src/errors/UsernameAlreadyExistsError.cjs +1 -0
  61. package/src/errors/UsernameAlreadyExistsError.js +1 -0
  62. package/src/errors/VerificationDataCollectionError.cjs +1 -2
  63. package/src/errors/VerificationDataCollectionError.d.ts +1 -1
  64. package/src/errors/VerificationDataCollectionError.js +1 -2
  65. package/src/errors/WalletNotDeployedError.cjs +1 -0
  66. package/src/errors/WalletNotDeployedError.js +1 -0
  67. package/src/errors/WalletUsedError.cjs +1 -0
  68. package/src/errors/WalletUsedError.js +1 -0
  69. package/src/errors/index.d.ts +1 -0
  70. package/src/formatNumberText/formatNumberText.cjs +1 -0
  71. package/src/formatNumberText/formatNumberText.js +1 -0
  72. package/src/getOrMapViemChain.cjs +2 -1
  73. package/src/getOrMapViemChain.js +2 -1
  74. package/src/getProvidersFromWindow.cjs +1 -0
  75. package/src/getProvidersFromWindow.js +1 -0
  76. package/src/getTLD/getTLD.cjs +1 -0
  77. package/src/getTLD/getTLD.js +1 -0
  78. package/src/handleMobileWalletRedirect/handleMobileWalletRedirect.cjs +2 -0
  79. package/src/handleMobileWalletRedirect/handleMobileWalletRedirect.js +2 -0
  80. package/src/index.cjs +5 -0
  81. package/src/index.d.ts +1 -0
  82. package/src/index.js +3 -0
  83. package/src/isFunction/isFunction.cjs +1 -0
  84. package/src/isFunction/isFunction.js +1 -0
  85. package/src/isLedgerAddressViaVerifiedCredentials.cjs +13 -0
  86. package/src/isLedgerAddressViaVerifiedCredentials.d.ts +2 -0
  87. package/src/isLedgerAddressViaVerifiedCredentials.js +9 -0
  88. package/src/isMobile.cjs +1 -0
  89. package/src/isMobile.js +1 -0
  90. package/src/last.cjs +1 -0
  91. package/src/last.js +1 -0
  92. package/src/localStorageAsync.cjs +1 -0
  93. package/src/localStorageAsync.js +1 -0
  94. package/src/logger/logger.cjs +2 -1
  95. package/src/logger/logger.js +2 -1
  96. package/src/parseChainId.cjs +1 -0
  97. package/src/parseChainId.js +1 -0
  98. package/src/parseEvmNetworks.cjs +1 -0
  99. package/src/parseEvmNetworks.js +1 -0
  100. package/src/pipe/pipe.cjs +1 -0
  101. package/src/pipe/pipe.js +1 -0
  102. package/src/retryableFn.cjs +3 -1
  103. package/src/retryableFn.js +3 -1
  104. package/src/runSafe/runSafe.cjs +1 -0
  105. package/src/runSafe/runSafe.d.ts +1 -1
  106. package/src/runSafe/runSafe.js +1 -0
  107. package/src/sleep/sleep.cjs +1 -0
  108. package/src/sleep/sleep.js +1 -0
  109. package/src/trimEnd/trimEnd.cjs +1 -0
  110. package/src/trimEnd/trimEnd.js +1 -0
  111. package/src/uniq/uniq.cjs +1 -0
  112. package/src/uniq/uniq.js +1 -0
  113. package/src/wrapMethodWithCallback/wrapMethodWithCallback.cjs +1 -0
  114. package/src/wrapMethodWithCallback/wrapMethodWithCallback.js +1 -0
package/CHANGELOG.md CHANGED
@@ -1,4 +1,104 @@
1
1
 
2
+ ## [2.1.0-alpha.10](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.0-alpha.9...v2.1.0-alpha.10) (2024-04-30)
3
+
4
+
5
+ ### Features
6
+
7
+ * bump @coinbase/wallet-sdk to latest beta ([#5388](https://github.com/dynamic-labs/DynamicAuth/issues/5388)) ([9225546](https://github.com/dynamic-labs/DynamicAuth/commit/922554630ccf2ef98bc297521309918f922bc671))
8
+
9
+ ## [2.1.0-alpha.9](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.0-alpha.8...v2.1.0-alpha.9) (2024-04-30)
10
+
11
+
12
+ ### Features
13
+
14
+ * headless create embedded wallet with optional passkey data parameter ([#5487](https://github.com/dynamic-labs/DynamicAuth/issues/5487)) ([891c3d7](https://github.com/dynamic-labs/DynamicAuth/commit/891c3d77a02a019140bcb8dd03b62b1afd69710e))
15
+
16
+ ## [2.1.0-alpha.8](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.0-alpha.7...v2.1.0-alpha.8) (2024-04-26)
17
+
18
+
19
+ ### Bug Fixes
20
+
21
+ * display wallet tabs when linking a wallet ([#5491](https://github.com/dynamic-labs/DynamicAuth/issues/5491)) ([10fd6b4](https://github.com/dynamic-labs/DynamicAuth/commit/10fd6b4d9aec7596338c50e17f79f6be534cf2c1))
22
+ * ensure zerodev viem client handles eth_accounts call ([#5477](https://github.com/dynamic-labs/DynamicAuth/issues/5477)) ([1132e1e](https://github.com/dynamic-labs/DynamicAuth/commit/1132e1e8655b58e81cb56789453ba56a059f52ec))
23
+ * network with keplr ([#5485](https://github.com/dynamic-labs/DynamicAuth/issues/5485)) ([b86f2fc](https://github.com/dynamic-labs/DynamicAuth/commit/b86f2fce491f9752e80a86643916da9ac7fb9276))
24
+ * refetch nameservice data and display properly ([#5476](https://github.com/dynamic-labs/DynamicAuth/issues/5476)) ([2aee798](https://github.com/dynamic-labs/DynamicAuth/commit/2aee798846f69496201bec7aa52e7ec1f370b7c3))
25
+ * use embeddedWallet create response authToken in embeddedWalletCreated ([#5478](https://github.com/dynamic-labs/DynamicAuth/issues/5478)) ([51772da](https://github.com/dynamic-labs/DynamicAuth/commit/51772daf557a72984c757efd8301e2b510dc37f1))
26
+
27
+ ## [2.1.0-alpha.7](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.0-alpha.6...v2.1.0-alpha.7) (2024-04-25)
28
+
29
+
30
+ ### Bug Fixes
31
+
32
+ * restore embedded wallet session iframe element conflict ([#5474](https://github.com/dynamic-labs/DynamicAuth/issues/5474)) ([c157477](https://github.com/dynamic-labs/DynamicAuth/commit/c157477ea126b3130b13b711796bdd06215e7af1))
33
+
34
+ ## [2.1.0-alpha.6](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.0-alpha.5...v2.1.0-alpha.6) (2024-04-24)
35
+
36
+
37
+ ### Bug Fixes
38
+
39
+ * embedded wallets headless session control fixes ([#5469](https://github.com/dynamic-labs/DynamicAuth/issues/5469)) ([92e6c35](https://github.com/dynamic-labs/DynamicAuth/commit/92e6c359d2710fd4f5f5a6fedc4acf6c4bab78ba))
40
+
41
+ ## [2.1.0-alpha.5](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.0-alpha.4...v2.1.0-alpha.5) (2024-04-23)
42
+
43
+
44
+ ### Bug Fixes
45
+
46
+ * get embedded wallet checking the wrong chain enum ([#5458](https://github.com/dynamic-labs/DynamicAuth/issues/5458)) ([ed1c523](https://github.com/dynamic-labs/DynamicAuth/commit/ed1c523ca14cd4d21c00181ab40802f876c02b80))
47
+
48
+ ## [2.1.0-alpha.4](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.0-alpha.3...v2.1.0-alpha.4) (2024-04-23)
49
+
50
+
51
+ ### Features
52
+
53
+ * add email and sms to client auth module ([#5436](https://github.com/dynamic-labs/DynamicAuth/issues/5436)) ([5420476](https://github.com/dynamic-labs/DynamicAuth/commit/5420476d1ba38fd4f987f28e9aefbfb3e61ea2bf))
54
+ * headless create passkeys for embedded wallets ([#5395](https://github.com/dynamic-labs/DynamicAuth/issues/5395)) ([0b64099](https://github.com/dynamic-labs/DynamicAuth/commit/0b6409968457f65886248f0a0879e39ec3803fd0))
55
+
56
+
57
+ ### Bug Fixes
58
+
59
+ * prevent wagmi from reconnect when DynamicContextProvider rerender ([#5446](https://github.com/dynamic-labs/DynamicAuth/issues/5446)) ([33337af](https://github.com/dynamic-labs/DynamicAuth/commit/33337af76786963cb3db7fa7c58c1292c529d0ac))
60
+
61
+ ## [2.1.0-alpha.3](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.0-alpha.2...v2.1.0-alpha.3) (2024-04-23)
62
+
63
+
64
+ ### Features
65
+
66
+ * add merge user accounts flow ([#5429](https://github.com/dynamic-labs/DynamicAuth/issues/5429)) ([41d4239](https://github.com/dynamic-labs/DynamicAuth/commit/41d423906625e28004ba8f20baf57847ed8bf5d0))
67
+
68
+
69
+ ### Bug Fixes
70
+
71
+ * disconnect wallet on lock in connect-only ([#5422](https://github.com/dynamic-labs/DynamicAuth/issues/5422)) ([a26f9fe](https://github.com/dynamic-labs/DynamicAuth/commit/a26f9fe93cf8568f1482e10b831de98c77fb2a2d))
72
+ * useReactiveProxy to stop proxing when it finds a reactive value ([#5428](https://github.com/dynamic-labs/DynamicAuth/issues/5428)) ([838dce9](https://github.com/dynamic-labs/DynamicAuth/commit/838dce9ee953361e41772239a91adb1dd8d40234))
73
+
74
+ ## [2.1.0-alpha.2](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.0-alpha.1...v2.1.0-alpha.2) (2024-04-19)
75
+
76
+
77
+ ### Bug Fixes
78
+
79
+ * buffer polyfill for utils package ([#5404](https://github.com/dynamic-labs/DynamicAuth/issues/5404)) ([bd40441](https://github.com/dynamic-labs/DynamicAuth/commit/bd404414a2e51d79fad86d7603dae89628c225b9))
80
+
81
+ ## [2.1.0-alpha.1](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.0-alpha.0...v2.1.0-alpha.1) (2024-04-18)
82
+
83
+
84
+ ### Features
85
+
86
+ * add frame metadata to demo index page ([#5327](https://github.com/dynamic-labs/DynamicAuth/issues/5327)) ([34a071a](https://github.com/dynamic-labs/DynamicAuth/commit/34a071af8faa8a867ad747ec2a607056a883568d))
87
+ * add MfaChooseDeviceView and MfaSecureDeviceView ([#5343](https://github.com/dynamic-labs/DynamicAuth/issues/5343)) ([4c39b1c](https://github.com/dynamic-labs/DynamicAuth/commit/4c39b1c34b5091190b095770e95a733c8f458ca2)), closes [#5356](https://github.com/dynamic-labs/DynamicAuth/issues/5356)
88
+ * add redirectUri to farcaster connect ([#5373](https://github.com/dynamic-labs/DynamicAuth/issues/5373)) ([ed13fc2](https://github.com/dynamic-labs/DynamicAuth/commit/ed13fc2948e06df0017ac122db54aca44f264a6d))
89
+ * add useMfa hook ([#5337](https://github.com/dynamic-labs/DynamicAuth/issues/5337)) ([a7682ba](https://github.com/dynamic-labs/DynamicAuth/commit/a7682ba10fd0f0809af802e0172154726f1bd857))
90
+ * headless create session and is session active ([#5346](https://github.com/dynamic-labs/DynamicAuth/issues/5346)) ([a787bbc](https://github.com/dynamic-labs/DynamicAuth/commit/a787bbcbb44104d2d0bd263579bd87a78453681d))
91
+ * secure enclave wallet generate one-time code headless ([#5329](https://github.com/dynamic-labs/DynamicAuth/issues/5329)) ([cab80a2](https://github.com/dynamic-labs/DynamicAuth/commit/cab80a2bfa77e48263d47cdcb813c54ef5b831d5))
92
+
93
+
94
+ ### Bug Fixes
95
+
96
+ * always stringify the message before signing a message using walletUiUtils ([#5325](https://github.com/dynamic-labs/DynamicAuth/issues/5325)) ([7abf094](https://github.com/dynamic-labs/DynamicAuth/commit/7abf09456e30ad0657892e9ba58d7391f0f430e6))
97
+ * bitcoin network connector sendBitcoin methods updates ([#5369](https://github.com/dynamic-labs/DynamicAuth/issues/5369)) ([e9bf444](https://github.com/dynamic-labs/DynamicAuth/commit/e9bf444122ee86030d85b84ede96bdfb9772425e))
98
+ * buffer missing when using buffer util function ([#5360](https://github.com/dynamic-labs/DynamicAuth/issues/5360)) ([e998e46](https://github.com/dynamic-labs/DynamicAuth/commit/e998e464bd2671a82aa271b407a7d8fc49a16bd0))
99
+ * embedded solana send transaction shouldn't sign a signed transaction ([#5357](https://github.com/dynamic-labs/DynamicAuth/issues/5357)) ([c2ae2fa](https://github.com/dynamic-labs/DynamicAuth/commit/c2ae2faa509b62fc5ceb345fbc0f0b47217bf4b0))
100
+ * use network.name if vanity name is missing ([#5338](https://github.com/dynamic-labs/DynamicAuth/issues/5338)) ([34ec2ae](https://github.com/dynamic-labs/DynamicAuth/commit/34ec2ae5c4dad5376a3b9c5a07221f68a2f7756c))
101
+
2
102
  ## [2.1.0-alpha.0](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.32...v2.1.0-alpha.0) (2024-04-15)
3
103
 
4
104
  ## [2.0.0-alpha.32](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.31...v2.0.0-alpha.32) (2024-04-15)
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  /******************************************************************************
2
3
  Copyright (c) Microsoft Corporation.
3
4
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/utils",
3
- "version": "2.1.0-alpha.0",
3
+ "version": "2.1.0-alpha.10",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/dynamic-labs/DynamicAuth.git",
@@ -26,9 +26,11 @@
26
26
  "./package.json": "./package.json"
27
27
  },
28
28
  "dependencies": {
29
+ "@dynamic-labs/sdk-api-core": "0.0.432",
29
30
  "tldts": "6.0.16",
30
- "@dynamic-labs/logger": "2.1.0-alpha.0",
31
- "@dynamic-labs/types": "2.1.0-alpha.0"
31
+ "@dynamic-labs/logger": "2.1.0-alpha.10",
32
+ "@dynamic-labs/types": "2.1.0-alpha.10",
33
+ "buffer": "6.0.3"
32
34
  },
33
35
  "peerDependencies": {
34
36
  "viem": "^2.7.6"
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  import { logger } from '../logger/logger.js';
2
3
 
3
4
  /* eslint-disable multiline-comment-style */
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  /**
2
3
  * A DeferredPromise provides methods to manually resolve or reject a Promise.
3
4
  * This is useful in scenarios where you need to resolve or reject a Promise
@@ -0,0 +1,15 @@
1
+ 'use client'
2
+ 'use strict';
3
+
4
+ var _ = require('buffer/');
5
+
6
+ /* eslint-disable */
7
+ /**
8
+ * This is needed for the browser to work with buffer
9
+ */
10
+ if (typeof window !== 'undefined') {
11
+ window.global = globalThis;
12
+ if (!window.Buffer && typeof window.Buffer === 'undefined') {
13
+ Object.assign(window, { Buffer: _.Buffer });
14
+ }
15
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,13 @@
1
+ 'use client'
2
+ import { Buffer } from 'buffer/index.js';
3
+
4
+ /* eslint-disable */
5
+ /**
6
+ * This is needed for the browser to work with buffer
7
+ */
8
+ if (typeof window !== 'undefined') {
9
+ window.global = globalThis;
10
+ if (!window.Buffer && typeof window.Buffer === 'undefined') {
11
+ Object.assign(window, { Buffer });
12
+ }
13
+ }
@@ -1,7 +1,10 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
4
5
 
6
+ require('./bufferPolyfill.cjs');
7
+
5
8
  const bufferToBase64 = (buf) => {
6
9
  const binstr = Array.prototype.map
7
10
  .call(buf, (ch) => String.fromCharCode(ch))
@@ -1 +1,2 @@
1
+ import './bufferPolyfill';
1
2
  export declare const bufferToBase64: (buf: Uint8Array) => string;
@@ -1,3 +1,6 @@
1
+ 'use client'
2
+ import './bufferPolyfill.js';
3
+
1
4
  const bufferToBase64 = (buf) => {
2
5
  const binstr = Array.prototype.map
3
6
  .call(buf, (ch) => String.fromCharCode(ch))
package/src/ceil/ceil.cjs CHANGED
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
package/src/ceil/ceil.js CHANGED
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  const ceil = (value, precision = 0) => {
2
3
  const multiplier = Math.pow(10, precision);
3
4
  return Math.ceil(value * multiplier) / multiplier;
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  import { DynamicError } from './DynamicError.js';
2
3
 
3
4
  class AccountExistsError extends DynamicError {
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  import { DynamicError } from './DynamicError.js';
2
3
 
3
4
  class ChainalysisError extends DynamicError {
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  /**
2
3
  * Extend this class to allow usage of instanceof
3
4
  */
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  import { CustomError } from './CustomError.js';
2
3
 
3
4
  class DynamicError extends CustomError {
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  import { DynamicError } from './DynamicError.js';
2
3
 
3
4
  class EmailAlreadyExistsError extends DynamicError {
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  import { DynamicError } from './DynamicError.js';
2
3
 
3
4
  class EmailProviderError extends DynamicError {
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  import { DynamicError } from './DynamicError.js';
2
3
 
3
4
  class EmailVerificationError extends DynamicError {
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  import { DynamicError } from './DynamicError.js';
2
3
 
3
4
  class GateBlockedError extends DynamicError {
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  import { DynamicError } from './DynamicError.js';
2
3
 
3
4
  class InsufficientFundsError extends DynamicError {
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  import { DynamicError } from './DynamicError.js';
2
3
 
3
4
  class InvalidPhoneNumberError extends DynamicError {
@@ -0,0 +1,16 @@
1
+ 'use client'
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ var DynamicError = require('./DynamicError.cjs');
7
+
8
+ class MergeAccountsConfirmationError extends DynamicError.DynamicError {
9
+ constructor({ code, mergeConflicts, walletAddress, }) {
10
+ super('MergeAccountsConfirmationError', code);
11
+ this.mergeConflicts = mergeConflicts;
12
+ this.walletAddress = walletAddress;
13
+ }
14
+ }
15
+
16
+ exports.MergeAccountsConfirmationError = MergeAccountsConfirmationError;
@@ -0,0 +1,12 @@
1
+ import { MergeConflicts } from '@dynamic-labs/sdk-api-core';
2
+ import { DynamicError } from './DynamicError';
3
+ export type MergeAccountsConfirmationErrorProps = {
4
+ code: string;
5
+ mergeConflicts?: MergeConflicts;
6
+ walletAddress?: string;
7
+ };
8
+ export declare class MergeAccountsConfirmationError extends DynamicError {
9
+ mergeConflicts: MergeConflicts | undefined;
10
+ walletAddress: string | undefined;
11
+ constructor({ code, mergeConflicts, walletAddress, }: MergeAccountsConfirmationErrorProps);
12
+ }
@@ -0,0 +1,12 @@
1
+ 'use client'
2
+ import { DynamicError } from './DynamicError.js';
3
+
4
+ class MergeAccountsConfirmationError extends DynamicError {
5
+ constructor({ code, mergeConflicts, walletAddress, }) {
6
+ super('MergeAccountsConfirmationError', code);
7
+ this.mergeConflicts = mergeConflicts;
8
+ this.walletAddress = walletAddress;
9
+ }
10
+ }
11
+
12
+ export { MergeAccountsConfirmationError };
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  import { DynamicError } from './DynamicError.js';
2
3
 
3
4
  class MissingEnvironmentIdError extends DynamicError {
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  import { DynamicError } from './DynamicError.js';
2
3
 
3
4
  class MissingPublicAddressError extends DynamicError {
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  import { DynamicError } from './DynamicError.js';
2
3
 
3
4
  class NoAccessError extends DynamicError {
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  import { DynamicError } from './DynamicError.js';
2
3
 
3
4
  class NotSupportedError extends DynamicError {
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  import { DynamicError } from './DynamicError.js';
2
3
 
3
4
  class SmsVerificationError extends DynamicError {
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  import { DynamicError } from './DynamicError.js';
2
3
 
3
4
  class SocialAccountAlreadyExistsError extends DynamicError {
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  import { DynamicError } from './DynamicError.js';
2
3
 
3
4
  class TooManyEmailVerificationsError extends DynamicError {
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  import { DynamicError } from './DynamicError.js';
2
3
 
3
4
  class TransactionGasCannotBeSponsoredError extends DynamicError {
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  import { DynamicError } from './DynamicError.js';
2
3
 
3
4
  class UserHasAccountWithEmailError extends DynamicError {
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  import { DynamicError } from './DynamicError.js';
2
3
 
3
4
  class UserRejectedTransactionError extends DynamicError {
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  import { DynamicError } from './DynamicError.js';
2
3
 
3
4
  class UsernameAlreadyExistsError extends DynamicError {
@@ -1,10 +1,9 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
4
5
 
5
6
  var DynamicError = require('./DynamicError.cjs');
6
- require('./InsufficientFundsError.cjs');
7
- require('./TransactionGasCannotBeSponsoredError.cjs');
8
7
 
9
8
  /** Used when trying to get necessary data for verification OTPs */
10
9
  class VerificationDataCollectionError extends DynamicError.DynamicError {
@@ -1,4 +1,4 @@
1
- import { DynamicError } from '.';
1
+ import { DynamicError } from './DynamicError';
2
2
  /** Used when trying to get necessary data for verification OTPs */
3
3
  export declare class VerificationDataCollectionError extends DynamicError {
4
4
  constructor(message: string);
@@ -1,6 +1,5 @@
1
+ 'use client'
1
2
  import { DynamicError } from './DynamicError.js';
2
- import './InsufficientFundsError.js';
3
- import './TransactionGasCannotBeSponsoredError.js';
4
3
 
5
4
  /** Used when trying to get necessary data for verification OTPs */
6
5
  class VerificationDataCollectionError extends DynamicError {
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  import { DynamicError } from './DynamicError.js';
2
3
 
3
4
  class WalletNotDeployedError extends DynamicError {
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  import { DynamicError } from './DynamicError.js';
2
3
 
3
4
  class WalletUsedError extends DynamicError {
@@ -23,3 +23,4 @@ export * from './UserRejectedTransactionError';
23
23
  export * from './TooManyEmailVerificationsError';
24
24
  export * from './VerificationDataCollectionError';
25
25
  export * from './InvalidPhoneNumberError';
26
+ export * from './MergeAccountsConfirmationError';
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  import { ceil } from '../ceil/ceil.js';
2
3
  import { trimEnd } from '../trimEnd/trimEnd.js';
3
4
 
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -52,7 +53,7 @@ const mapChain = (network) => {
52
53
  }
53
54
  : undefined,
54
55
  id: network.chainId,
55
- name: network.vanityName || network.chainName,
56
+ name: network.vanityName || network.name || network.chainName,
56
57
  nativeCurrency: network.nativeCurrency,
57
58
  rpcUrls: {
58
59
  default: { http: network.rpcUrls },
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  import * as chains from 'viem/chains';
2
3
 
3
4
  // eslint-disable-next-line import/no-namespace
@@ -28,7 +29,7 @@ const mapChain = (network) => {
28
29
  }
29
30
  : undefined,
30
31
  id: network.chainId,
31
- name: network.vanityName || network.chainName,
32
+ name: network.vanityName || network.name || network.chainName,
32
33
  nativeCurrency: network.nativeCurrency,
33
34
  rpcUrls: {
34
35
  default: { http: network.rpcUrls },
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  /**
2
3
  * return the destination (value)
3
4
  *
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  import { parse } from 'tldts';
2
3
 
3
4
  const getTLD = () => {
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -7,6 +8,7 @@ require('../errors/TransactionGasCannotBeSponsoredError.cjs');
7
8
  require('../logger/logger.cjs');
8
9
  var isMobile = require('../isMobile.cjs');
9
10
  require('../../_virtual/_tslib.cjs');
11
+ require('../bufferPolyfill.cjs');
10
12
  require('viem/chains');
11
13
  require('tldts');
12
14
 
@@ -1,8 +1,10 @@
1
+ 'use client'
1
2
  import '../errors/InsufficientFundsError.js';
2
3
  import '../errors/TransactionGasCannotBeSponsoredError.js';
3
4
  import '../logger/logger.js';
4
5
  import { isSamsungBrowser } from '../isMobile.js';
5
6
  import '../../_virtual/_tslib.js';
7
+ import '../bufferPolyfill.js';
6
8
  import 'viem/chains';
7
9
  import 'tldts';
8
10
 
package/src/index.cjs CHANGED
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -28,6 +29,7 @@ var UserRejectedTransactionError = require('./errors/UserRejectedTransactionErro
28
29
  var TooManyEmailVerificationsError = require('./errors/TooManyEmailVerificationsError.cjs');
29
30
  var VerificationDataCollectionError = require('./errors/VerificationDataCollectionError.cjs');
30
31
  var InvalidPhoneNumberError = require('./errors/InvalidPhoneNumberError.cjs');
32
+ var MergeAccountsConfirmationError = require('./errors/MergeAccountsConfirmationError.cjs');
31
33
  var CancellablePromise = require('./CancellablePromise/CancellablePromise.cjs');
32
34
  var isFunction = require('./isFunction/isFunction.cjs');
33
35
  var isMobile = require('./isMobile.cjs');
@@ -47,6 +49,7 @@ var pipe = require('./pipe/pipe.cjs');
47
49
  var formatNumberText = require('./formatNumberText/formatNumberText.cjs');
48
50
  var ceil = require('./ceil/ceil.cjs');
49
51
  var trimEnd = require('./trimEnd/trimEnd.cjs');
52
+ var isLedgerAddressViaVerifiedCredentials = require('./isLedgerAddressViaVerifiedCredentials.cjs');
50
53
  var runSafe = require('./runSafe/runSafe.cjs');
51
54
 
52
55
 
@@ -77,6 +80,7 @@ exports.UserRejectedTransactionError = UserRejectedTransactionError.UserRejected
77
80
  exports.TooManyEmailVerificationsError = TooManyEmailVerificationsError.TooManyEmailVerificationsError;
78
81
  exports.VerificationDataCollectionError = VerificationDataCollectionError.VerificationDataCollectionError;
79
82
  exports.InvalidPhoneNumberError = InvalidPhoneNumberError.InvalidPhoneNumberError;
83
+ exports.MergeAccountsConfirmationError = MergeAccountsConfirmationError.MergeAccountsConfirmationError;
80
84
  exports.CancellablePromise = CancellablePromise.CancellablePromise;
81
85
  exports.isFunction = isFunction.isFunction;
82
86
  exports.getAndroidVersion = isMobile.getAndroidVersion;
@@ -110,4 +114,5 @@ exports.pipe = pipe.pipe;
110
114
  exports.formatNumberText = formatNumberText.formatNumberText;
111
115
  exports.ceil = ceil.ceil;
112
116
  exports.trimEnd = trimEnd.trimEnd;
117
+ exports.isLedgerAddressViaVerifiedCredentials = isLedgerAddressViaVerifiedCredentials.isLedgerAddressViaVerifiedCredentials;
113
118
  exports.runSafe = runSafe.runSafe;
package/src/index.d.ts CHANGED
@@ -20,4 +20,5 @@ export * from './pipe';
20
20
  export * from './formatNumberText';
21
21
  export * from './ceil';
22
22
  export * from './trimEnd';
23
+ export * from './isLedgerAddressViaVerifiedCredentials';
23
24
  export { runSafe } from './runSafe';
package/src/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  export { parseChainId } from './parseChainId.js';
2
3
  export { parseEvmNetworks } from './parseEvmNetworks.js';
3
4
  export { AccountExistsError } from './errors/AccountExistsError.js';
@@ -24,6 +25,7 @@ export { UserRejectedTransactionError } from './errors/UserRejectedTransactionEr
24
25
  export { TooManyEmailVerificationsError } from './errors/TooManyEmailVerificationsError.js';
25
26
  export { VerificationDataCollectionError } from './errors/VerificationDataCollectionError.js';
26
27
  export { InvalidPhoneNumberError } from './errors/InvalidPhoneNumberError.js';
28
+ export { MergeAccountsConfirmationError } from './errors/MergeAccountsConfirmationError.js';
27
29
  export { CancellablePromise } from './CancellablePromise/CancellablePromise.js';
28
30
  export { isFunction } from './isFunction/isFunction.js';
29
31
  export { getAndroidVersion, isAndroid, isIOS, isIPad, isIPhone, isIPhone8OrEarlier, isLegacySafari, isMobile, isSamsungBrowser, isWindows } from './isMobile.js';
@@ -43,4 +45,5 @@ export { pipe } from './pipe/pipe.js';
43
45
  export { formatNumberText } from './formatNumberText/formatNumberText.js';
44
46
  export { ceil } from './ceil/ceil.js';
45
47
  export { trimEnd } from './trimEnd/trimEnd.js';
48
+ export { isLedgerAddressViaVerifiedCredentials } from './isLedgerAddressViaVerifiedCredentials.js';
46
49
  export { runSafe } from './runSafe/runSafe.js';
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  // eslint-disable-next-line @typescript-eslint/ban-types
2
3
  const isFunction = (value) => typeof value === 'function';
3
4
 
@@ -0,0 +1,13 @@
1
+ 'use client'
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ const isLedgerAddressViaVerifiedCredentials = (address, verifiedCredentials) => {
7
+ const ledgerWallets = verifiedCredentials
8
+ .filter((v) => { var _a; return ((_a = v.walletProperties) === null || _a === void 0 ? void 0 : _a.hardwareWallet) === 'ledger'; })
9
+ .map((v) => v.address);
10
+ return ledgerWallets.includes(address);
11
+ };
12
+
13
+ exports.isLedgerAddressViaVerifiedCredentials = isLedgerAddressViaVerifiedCredentials;
@@ -0,0 +1,2 @@
1
+ import { JwtVerifiedCredential } from '@dynamic-labs/sdk-api-core';
2
+ export declare const isLedgerAddressViaVerifiedCredentials: (address: string, verifiedCredentials: JwtVerifiedCredential[]) => boolean;
@@ -0,0 +1,9 @@
1
+ 'use client'
2
+ const isLedgerAddressViaVerifiedCredentials = (address, verifiedCredentials) => {
3
+ const ledgerWallets = verifiedCredentials
4
+ .filter((v) => { var _a; return ((_a = v.walletProperties) === null || _a === void 0 ? void 0 : _a.hardwareWallet) === 'ledger'; })
5
+ .map((v) => v.address);
6
+ return ledgerWallets.includes(address);
7
+ };
8
+
9
+ export { isLedgerAddressViaVerifiedCredentials };
package/src/isMobile.cjs CHANGED
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
package/src/isMobile.js CHANGED
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  /**
2
3
  * Sourced from http://detectmobilebrowsers.com/
3
4
  */
package/src/last.cjs CHANGED
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
package/src/last.js CHANGED
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  /**
2
3
  * Retrieves the last item from an array.
3
4
  *
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  import { __awaiter } from '../_virtual/_tslib.js';
2
3
 
3
4
  const getItemAsync = (key) => __awaiter(void 0, void 0, void 0, function* () {
@@ -1,9 +1,10 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
4
5
 
5
6
  var logger$1 = require('@dynamic-labs/logger');
6
7
 
7
- const logger = new logger$1.Logger('magic');
8
+ const logger = new logger$1.Logger('utils');
8
9
 
9
10
  exports.logger = logger;
@@ -1,5 +1,6 @@
1
+ 'use client'
1
2
  import { Logger } from '@dynamic-labs/logger';
2
3
 
3
- const logger = new Logger('magic');
4
+ const logger = new Logger('utils');
4
5
 
5
6
  export { logger };
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  const parseChainId = (chainId) => parseInt(chainId.toString());
2
3
 
3
4
  export { parseChainId };
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  import { parseChainId } from './parseChainId.js';
2
3
 
3
4
  const parseEvmNetworks = (networks) => {
package/src/pipe/pipe.cjs CHANGED
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
package/src/pipe/pipe.js CHANGED
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  /**
2
3
  * Creates a chainable function that allows adding additional transformations
3
4
  * or operations via the `pipe` method, where each function in the chain
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -6,12 +7,13 @@ var _tslib = require('../_virtual/_tslib.cjs');
6
7
  require('./errors/InsufficientFundsError.cjs');
7
8
  require('./errors/TransactionGasCannotBeSponsoredError.cjs');
8
9
  require('./logger/logger.cjs');
10
+ require('./bufferPolyfill.cjs');
9
11
  var sleep = require('./sleep/sleep.cjs');
10
12
  require('viem/chains');
11
13
  require('tldts');
12
14
 
13
15
  const FALLBACK_UNDEFINED = 'FALLBACK_UNDEFINED';
14
- const retryableFn = (fn, options = {}) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
16
+ const retryableFn = (fn_1, ...args_1) => _tslib.__awaiter(void 0, [fn_1, ...args_1], void 0, function* (fn, options = {}) {
15
17
  const { maxRetries = 3, currentRetry = 0, timeoutMs = 100, fallbackValue = new Error('Max retries reached'), retryStrategy = 'timeout-only', retryIntervalMs = 0, logger, } = options;
16
18
  logger === null || logger === void 0 ? void 0 : logger.debug('Configured retryableFn with options: ', {
17
19
  currentRetry,
@@ -1,13 +1,15 @@
1
+ 'use client'
1
2
  import { __awaiter } from '../_virtual/_tslib.js';
2
3
  import './errors/InsufficientFundsError.js';
3
4
  import './errors/TransactionGasCannotBeSponsoredError.js';
4
5
  import './logger/logger.js';
6
+ import './bufferPolyfill.js';
5
7
  import { sleep } from './sleep/sleep.js';
6
8
  import 'viem/chains';
7
9
  import 'tldts';
8
10
 
9
11
  const FALLBACK_UNDEFINED = 'FALLBACK_UNDEFINED';
10
- const retryableFn = (fn, options = {}) => __awaiter(void 0, void 0, void 0, function* () {
12
+ const retryableFn = (fn_1, ...args_1) => __awaiter(void 0, [fn_1, ...args_1], void 0, function* (fn, options = {}) {
11
13
  const { maxRetries = 3, currentRetry = 0, timeoutMs = 100, fallbackValue = new Error('Max retries reached'), retryStrategy = 'timeout-only', retryIntervalMs = 0, logger, } = options;
12
14
  logger === null || logger === void 0 ? void 0 : logger.debug('Configured retryableFn with options: ', {
13
15
  currentRetry,
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -5,4 +5,4 @@
5
5
  * @param {() => Promise<T> | T} callback A function that might throw an error.
6
6
  * @returns {Promise<[T | undefined, E | undefined]>} A tuple with either the result or the error.
7
7
  */
8
- export declare const runSafe: <T, E>(callback: () => T | Promise<T>) => Promise<[T | undefined, E | undefined]>;
8
+ export declare const runSafe: <T, E>(callback: () => Promise<T> | T) => Promise<[T | undefined, E | undefined]>;
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  import { __awaiter } from '../../_virtual/_tslib.js';
2
3
 
3
4
  /**
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  // eslint-disable-next-line prefer-arrow/prefer-arrow-functions
2
3
  function sleep(timeoutMs, valueToResolve) {
3
4
  return new Promise((resolve) => {
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  const trimEnd = (text, char = '') => {
2
3
  let endIndex = text.length - 1;
3
4
  while (endIndex >= 0 && text[endIndex] === char) {
package/src/uniq/uniq.cjs CHANGED
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
package/src/uniq/uniq.js CHANGED
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  /**
2
3
  * Removes duplicate elements from an array.
3
4
  *
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  /**
2
3
  * Wraps an existing method of an object with a callback function. This allows for additional
3
4
  * processing or behavior to be executed around the original method. The original method is