@dynamic-labs/utils 0.19.0-alpha.0 → 0.19.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.
- package/CHANGELOG.md +233 -0
- package/package.json +7 -4
- package/src/CancellablePromise/CancellablePromise.cjs +128 -26
- package/src/CancellablePromise/CancellablePromise.d.ts +54 -9
- package/src/CancellablePromise/CancellablePromise.js +128 -26
- package/src/CancellablePromise/index.d.ts +1 -1
- package/src/bigIntToHex/bigIntToHex.cjs +15 -0
- package/src/bigIntToHex/bigIntToHex.d.ts +1 -0
- package/src/bigIntToHex/bigIntToHex.js +11 -0
- package/src/bigIntToHex/index.d.ts +1 -0
- package/src/bufferToBase64.cjs +5 -5
- package/src/bufferToBase64.d.ts +1 -1
- package/src/bufferToBase64.js +5 -5
- package/src/errors/AccountExistsError.cjs +6 -6
- package/src/errors/AccountExistsError.d.ts +13 -13
- package/src/errors/AccountExistsError.js +6 -6
- package/src/errors/ChainalysisError.cjs +5 -5
- package/src/errors/ChainalysisError.d.ts +5 -5
- package/src/errors/ChainalysisError.js +5 -5
- package/src/errors/CustomError.cjs +16 -16
- package/src/errors/CustomError.d.ts +11 -11
- package/src/errors/CustomError.js +16 -16
- package/src/errors/DynamicError.cjs +1 -1
- package/src/errors/DynamicError.d.ts +3 -3
- package/src/errors/DynamicError.js +1 -1
- package/src/errors/EmailAlreadyExistsError.cjs +4 -4
- package/src/errors/EmailAlreadyExistsError.d.ts +4 -4
- package/src/errors/EmailAlreadyExistsError.js +4 -4
- package/src/errors/EmailProviderError.cjs +4 -4
- package/src/errors/EmailProviderError.d.ts +4 -4
- package/src/errors/EmailProviderError.js +4 -4
- package/src/errors/EmailVerificationError.cjs +4 -4
- package/src/errors/EmailVerificationError.d.ts +4 -4
- package/src/errors/EmailVerificationError.js +4 -4
- package/src/errors/GateBlockedError.cjs +5 -5
- package/src/errors/GateBlockedError.d.ts +5 -5
- package/src/errors/GateBlockedError.js +5 -5
- package/src/errors/MissingEnvironmentIdError.cjs +4 -4
- package/src/errors/MissingEnvironmentIdError.d.ts +4 -4
- package/src/errors/MissingEnvironmentIdError.js +4 -4
- package/src/errors/NoAccessError.cjs +6 -6
- package/src/errors/NoAccessError.d.ts +9 -9
- package/src/errors/NoAccessError.js +6 -6
- package/src/errors/NotSupportedError.cjs +1 -1
- package/src/errors/NotSupportedError.d.ts +3 -3
- package/src/errors/NotSupportedError.js +1 -1
- package/src/errors/SocialAccountAlreadyExistsError.cjs +13 -0
- package/src/errors/SocialAccountAlreadyExistsError.d.ts +4 -0
- package/src/errors/SocialAccountAlreadyExistsError.js +9 -0
- package/src/errors/UserHasAccountWithEmailError.cjs +14 -0
- package/src/errors/UserHasAccountWithEmailError.d.ts +5 -0
- package/src/errors/UserHasAccountWithEmailError.js +10 -0
- package/src/errors/UsernameAlreadyExistsError.cjs +4 -4
- package/src/errors/UsernameAlreadyExistsError.d.ts +4 -4
- package/src/errors/UsernameAlreadyExistsError.js +4 -4
- package/src/errors/WalletNotDeployedError.cjs +4 -4
- package/src/errors/WalletNotDeployedError.d.ts +4 -4
- package/src/errors/WalletNotDeployedError.js +4 -4
- package/src/errors/WalletUsedError.cjs +4 -4
- package/src/errors/WalletUsedError.d.ts +4 -4
- package/src/errors/WalletUsedError.js +4 -4
- package/src/errors/index.d.ts +16 -14
- package/src/getOrMapViemChain.cjs +77 -0
- package/src/getOrMapViemChain.d.ts +11 -0
- package/src/getOrMapViemChain.js +51 -0
- package/src/getPathFromObject.cjs +34 -0
- package/src/getPathFromObject.d.ts +8 -0
- package/src/getPathFromObject.js +30 -0
- package/src/index.cjs +19 -0
- package/src/index.d.ts +14 -8
- package/src/index.js +9 -1
- package/src/isBigInt/index.d.ts +1 -0
- package/src/isBigInt/isBigInt.cjs +7 -0
- package/src/isBigInt/isBigInt.d.ts +1 -0
- package/src/isBigInt/isBigInt.js +3 -0
- package/src/isFunction/index.d.ts +1 -1
- package/src/isFunction/isFunction.cjs +1 -1
- package/src/isFunction/isFunction.d.ts +1 -1
- package/src/isFunction/isFunction.js +1 -1
- package/src/isMobile.cjs +111 -56
- package/src/isMobile.d.ts +16 -15
- package/src/isMobile.js +111 -57
- package/src/last.cjs +21 -0
- package/src/last.d.ts +15 -0
- package/src/last.js +17 -0
- package/src/localStorageAsync.cjs +17 -17
- package/src/localStorageAsync.d.ts +3 -3
- package/src/localStorageAsync.js +17 -17
- package/src/logger/index.d.ts +1 -0
- package/src/logger/logger.cjs +9 -0
- package/src/logger/logger.d.ts +2 -0
- package/src/logger/logger.js +5 -0
- package/src/parseChainId.d.ts +1 -1
- package/src/parseEvmNetworks.cjs +6 -6
- package/src/parseEvmNetworks.d.ts +2 -2
- package/src/parseEvmNetworks.js +6 -6
- package/src/sleep/index.d.ts +1 -0
- package/src/sleep/sleep.cjs +12 -0
- package/src/sleep/sleep.d.ts +11 -0
- package/src/sleep/sleep.js +8 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,237 @@
|
|
|
1
1
|
|
|
2
|
+
## [0.19.0-alpha.10](https://github.com/dynamic-labs/DynamicAuth/compare/v0.19.0-alpha.9...v0.19.0-alpha.10) (2023-09-28)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### ⚠ BREAKING CHANGES
|
|
6
|
+
|
|
7
|
+
* change magic walletProvider from custodialService to embeddedWallet (#3429)
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* allow passkey setup after social sign in ([#3410](https://github.com/dynamic-labs/DynamicAuth/issues/3410)) ([d225a63](https://github.com/dynamic-labs/DynamicAuth/commit/d225a63544284422589990c4e872430f7eb88f07))
|
|
12
|
+
* create useEmbeddedWallet hook to trigger embedded wallet creation ([#3437](https://github.com/dynamic-labs/DynamicAuth/issues/3437)) ([d79c558](https://github.com/dynamic-labs/DynamicAuth/commit/d79c558d31deacb293823c2fe42d006d0645b470))
|
|
13
|
+
* **passkey:** direct user to passkey intro view when enabled ([#3393](https://github.com/dynamic-labs/DynamicAuth/issues/3393)) ([e02e0dc](https://github.com/dynamic-labs/DynamicAuth/commit/e02e0dcaa87dbbd56665868ff637156cea23f574))
|
|
14
|
+
* **wcv2:** add support for dynamic network configuration to wallet connect ([#3332](https://github.com/dynamic-labs/DynamicAuth/issues/3332)) ([a285360](https://github.com/dynamic-labs/DynamicAuth/commit/a2853606e1065a252cab37fa693db1c51cd3ac55))
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* don't filter out disabled providers in settings so we can access their data ([#3407](https://github.com/dynamic-labs/DynamicAuth/issues/3407)) ([0f68e88](https://github.com/dynamic-labs/DynamicAuth/commit/0f68e887fed40777c8e539b20e9598edf76e612b))
|
|
20
|
+
* don't show error until passkey enabled check promise is fulfilled ([#3446](https://github.com/dynamic-labs/DynamicAuth/issues/3446)) ([101ac98](https://github.com/dynamic-labs/DynamicAuth/commit/101ac980aa56a1cd3d3fdda68ddac6ad7779727e))
|
|
21
|
+
* **DYN-2732:** wait for networks to fetch ([#3431](https://github.com/dynamic-labs/DynamicAuth/issues/3431)) ([e66e86c](https://github.com/dynamic-labs/DynamicAuth/commit/e66e86cefd826b04dcde3474e0ed169b41f7b715))
|
|
22
|
+
* error handling for non-supported devices ([#3397](https://github.com/dynamic-labs/DynamicAuth/issues/3397)) ([e5cc7e6](https://github.com/dynamic-labs/DynamicAuth/commit/e5cc7e65c05da132c325c57cf06e33cac86440f9))
|
|
23
|
+
* error handling when creating passkey ([#3416](https://github.com/dynamic-labs/DynamicAuth/issues/3416)) ([3274df4](https://github.com/dynamic-labs/DynamicAuth/commit/3274df4f7bd2a00ad0776392f55a8493c9bc2b60))
|
|
24
|
+
* passkey icon breaks line into 2 on mobile ([#3426](https://github.com/dynamic-labs/DynamicAuth/issues/3426)) ([2dd045b](https://github.com/dynamic-labs/DynamicAuth/commit/2dd045b04d4cc4806e653c10a22412d8a5c3b9fc))
|
|
25
|
+
* set primary wallet id when passkey is already set up ([#3419](https://github.com/dynamic-labs/DynamicAuth/issues/3419)) ([496555f](https://github.com/dynamic-labs/DynamicAuth/commit/496555fd8e239601880a3fcd38519d09b3c35bd5))
|
|
26
|
+
* signing messages with backpack ([#3398](https://github.com/dynamic-labs/DynamicAuth/issues/3398)) ([a68d3da](https://github.com/dynamic-labs/DynamicAuth/commit/a68d3da97e2b2c8f555d9126e0ab400343d7bec1))
|
|
27
|
+
* social signing icon loading after logout ([#3417](https://github.com/dynamic-labs/DynamicAuth/issues/3417)) ([3ac0f19](https://github.com/dynamic-labs/DynamicAuth/commit/3ac0f194f9a55795718fb6ca6f44ab2fe87eeb06))
|
|
28
|
+
* trigger passkey flow after email kyc verification ([#3434](https://github.com/dynamic-labs/DynamicAuth/issues/3434)) ([a6fc353](https://github.com/dynamic-labs/DynamicAuth/commit/a6fc353f6dfe9fd5ee67139a8fae6c37c947cd14))
|
|
29
|
+
* trigger passkey flow after onboarding ([#3428](https://github.com/dynamic-labs/DynamicAuth/issues/3428)) ([fa81643](https://github.com/dynamic-labs/DynamicAuth/commit/fa81643575c0fe6174e6521810fcdf139dc259e6))
|
|
30
|
+
* **turnkey:** sign message with viem and current address ([#3433](https://github.com/dynamic-labs/DynamicAuth/issues/3433)) ([025ffac](https://github.com/dynamic-labs/DynamicAuth/commit/025ffac4a9bf1e4526894f242c1cd882c0e10b45))
|
|
31
|
+
* use correct authenticator type in passkey creation params ([#3411](https://github.com/dynamic-labs/DynamicAuth/issues/3411)) ([eefbf01](https://github.com/dynamic-labs/DynamicAuth/commit/eefbf01aa7962e95db80ff19676fa582da756d11))
|
|
32
|
+
* **use-element-by-id:** include pointer events style rule to ensure modal is interactive ([#3396](https://github.com/dynamic-labs/DynamicAuth/issues/3396)) ([15077d4](https://github.com/dynamic-labs/DynamicAuth/commit/15077d4752379924f35ff889b05f03bdf6c051bf))
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
* change magic walletProvider from custodialService to embeddedWallet ([#3429](https://github.com/dynamic-labs/DynamicAuth/issues/3429)) ([c617439](https://github.com/dynamic-labs/DynamicAuth/commit/c617439d745cff81d415a042d2187a98b29318da))
|
|
36
|
+
|
|
37
|
+
## [0.19.0-alpha.9](https://github.com/dynamic-labs/DynamicAuth/compare/v0.19.0-alpha.8...v0.19.0-alpha.9) (2023-09-21)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
### Features
|
|
41
|
+
|
|
42
|
+
* allow enabling multi wallet in connect-only mode ([#3367](https://github.com/dynamic-labs/DynamicAuth/issues/3367)) ([8ef68a2](https://github.com/dynamic-labs/DynamicAuth/commit/8ef68a295738db5353fcddc54985744313a5474b))
|
|
43
|
+
* move injected wallets configuration to the cdn ([#3077](https://github.com/dynamic-labs/DynamicAuth/issues/3077)) ([291183b](https://github.com/dynamic-labs/DynamicAuth/commit/291183b8daf124577d1049152a2556b6f2a85758))
|
|
44
|
+
* passkey setup completed view ([#3358](https://github.com/dynamic-labs/DynamicAuth/issues/3358)) ([020faf6](https://github.com/dynamic-labs/DynamicAuth/commit/020faf63815e232c64ac8626f747b2997adbaa02))
|
|
45
|
+
* **rohithv/gvty-326:** check if email is real before sending ([#3361](https://github.com/dynamic-labs/DynamicAuth/issues/3361)) ([db554f3](https://github.com/dynamic-labs/DynamicAuth/commit/db554f344707e3c3701012ecc09b67be2aaebba4))
|
|
46
|
+
* safe guard wrong locale override keys ([#3329](https://github.com/dynamic-labs/DynamicAuth/issues/3329)) ([b2cf96b](https://github.com/dynamic-labs/DynamicAuth/commit/b2cf96b55fdd2705335ad942fe8e1c1109bf4134))
|
|
47
|
+
* secure account with passkey view ([#3356](https://github.com/dynamic-labs/DynamicAuth/issues/3356)) ([9d58c44](https://github.com/dynamic-labs/DynamicAuth/commit/9d58c4472f1967ff5201bae6556c7d88a33d6276))
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
### Bug Fixes
|
|
51
|
+
|
|
52
|
+
* better handling of window opener to mitigate window opener for social linking ([#3379](https://github.com/dynamic-labs/DynamicAuth/issues/3379)) ([e784061](https://github.com/dynamic-labs/DynamicAuth/commit/e784061ab190d314976213e321516bbb256627e7))
|
|
53
|
+
* change buttom copy when cannot link a wallet ([#3364](https://github.com/dynamic-labs/DynamicAuth/issues/3364)) ([5428a60](https://github.com/dynamic-labs/DynamicAuth/commit/5428a60abcbbd9c47e9227a53610ee5975bac379))
|
|
54
|
+
* **DynamicWidget:** goToInitialView when closing send balance ([#3333](https://github.com/dynamic-labs/DynamicAuth/issues/3333)) ([7ea40ec](https://github.com/dynamic-labs/DynamicAuth/commit/7ea40ec3827c40e3340e5ecfa2153e59c05a79f1))
|
|
55
|
+
* **EmailMagicWalletConnector:** to only cancel the verification if user clicks back ([#3374](https://github.com/dynamic-labs/DynamicAuth/issues/3374)) ([1111a18](https://github.com/dynamic-labs/DynamicAuth/commit/1111a186b7b84066e89d385c0bd9c064d0326eae))
|
|
56
|
+
* **embedded-wallet:** display sign typed data message ([#3316](https://github.com/dynamic-labs/DynamicAuth/issues/3316)) ([0014c8b](https://github.com/dynamic-labs/DynamicAuth/commit/0014c8b4250cf9db92b554f02b4e46f3aba2d943))
|
|
57
|
+
* missing translation keys ([#3325](https://github.com/dynamic-labs/DynamicAuth/issues/3325)) ([0e7c383](https://github.com/dynamic-labs/DynamicAuth/commit/0e7c3838a0eb8b49298e59b2919e16994a2d6b19))
|
|
58
|
+
* only set scope/prompt in oauth query params when they're defined ([#3324](https://github.com/dynamic-labs/DynamicAuth/issues/3324)) ([9e8aa2d](https://github.com/dynamic-labs/DynamicAuth/commit/9e8aa2d186fff563607dc836017b918af79718ce))
|
|
59
|
+
* pass the network param on wallet transfers ([#3307](https://github.com/dynamic-labs/DynamicAuth/issues/3307)) ([faf89fd](https://github.com/dynamic-labs/DynamicAuth/commit/faf89fdbfa690a87ae91d7f09c3647b4160b53ad))
|
|
60
|
+
* send primaryWalletId when available to unlinkOauth ([#3342](https://github.com/dynamic-labs/DynamicAuth/issues/3342)) ([0da0ae2](https://github.com/dynamic-labs/DynamicAuth/commit/0da0ae23040f7683000223109446a516c6d7b212))
|
|
61
|
+
* twitter sign-in with dynamic ([#3313](https://github.com/dynamic-labs/DynamicAuth/issues/3313)) ([c77dae4](https://github.com/dynamic-labs/DynamicAuth/commit/c77dae41dbdc02c84f3d3f5f3338136efd5766f9))
|
|
62
|
+
* use social profile photo for profile icon whenever available ([#3298](https://github.com/dynamic-labs/DynamicAuth/issues/3298)) ([143303b](https://github.com/dynamic-labs/DynamicAuth/commit/143303ba5e24d16aaa362f1888e3942bdef59602))
|
|
63
|
+
* wallet transition in the bridge ([#3270](https://github.com/dynamic-labs/DynamicAuth/issues/3270)) ([143cf47](https://github.com/dynamic-labs/DynamicAuth/commit/143cf47e0cd4806780f5b3f527ace2d6c0208534)), closes [#3268](https://github.com/dynamic-labs/DynamicAuth/issues/3268) [#3243](https://github.com/dynamic-labs/DynamicAuth/issues/3243)
|
|
64
|
+
* **wallet-connect:** prevent connector from connecting after logout ([#3345](https://github.com/dynamic-labs/DynamicAuth/issues/3345)) ([9bada77](https://github.com/dynamic-labs/DynamicAuth/commit/9bada7775c5ac7a4fdb5ad8d4d21691335e06936))
|
|
65
|
+
|
|
66
|
+
## [0.19.0-alpha.8](https://github.com/dynamic-labs/DynamicAuth/compare/v0.19.0-alpha.7...v0.19.0-alpha.8) (2023-09-11)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
### Features
|
|
70
|
+
|
|
71
|
+
* add onSignedMessage callback ([#3118](https://github.com/dynamic-labs/DynamicAuth/issues/3118)) ([acc36f6](https://github.com/dynamic-labs/DynamicAuth/commit/acc36f6cf584eb05a019027475a6e2e413fd6bd5))
|
|
72
|
+
* add social sign-in without embedded wallet ([#3172](https://github.com/dynamic-labs/DynamicAuth/issues/3172)) ([ff1acc6](https://github.com/dynamic-labs/DynamicAuth/commit/ff1acc6d9753ba745ac01c5ef6d26f2e4291b752))
|
|
73
|
+
* show default wallet icon when image breaks ([#3234](https://github.com/dynamic-labs/DynamicAuth/issues/3234)) ([657e6bb](https://github.com/dynamic-labs/DynamicAuth/commit/657e6bbc1cdcd840562d25194a827ea833237c1a))
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
### Bug Fixes
|
|
77
|
+
|
|
78
|
+
* catch error sending sdkSettings and log warning ([#3274](https://github.com/dynamic-labs/DynamicAuth/issues/3274)) ([fcbe01b](https://github.com/dynamic-labs/DynamicAuth/commit/fcbe01bc733a73f38aebd6ffb0969b040dd2f781))
|
|
79
|
+
* detect if oauth popup is blocked and throw error ([#3250](https://github.com/dynamic-labs/DynamicAuth/issues/3250)) ([b87ddf3](https://github.com/dynamic-labs/DynamicAuth/commit/b87ddf399104e29c56566abbbecab6ff947992d6))
|
|
80
|
+
* display error message to user if social account already exits ([#3258](https://github.com/dynamic-labs/DynamicAuth/issues/3258)) ([bb52cb4](https://github.com/dynamic-labs/DynamicAuth/commit/bb52cb4ae42d89310d435584ed4ece126f9b6a4a))
|
|
81
|
+
* don't call callbacks if window closed due to oauth process complete ([#3252](https://github.com/dynamic-labs/DynamicAuth/issues/3252)) ([09a3c73](https://github.com/dynamic-labs/DynamicAuth/commit/09a3c73446aa337f24e0875cd4a0af617ea8ca84))
|
|
82
|
+
* issue where unexpected token would occur when bundlers defined process.env ([#3283](https://github.com/dynamic-labs/DynamicAuth/issues/3283)) ([d31d0a4](https://github.com/dynamic-labs/DynamicAuth/commit/d31d0a4011256f59cb3760acdc2c3dfe6c5b504a))
|
|
83
|
+
* login view layout updates ([#3231](https://github.com/dynamic-labs/DynamicAuth/issues/3231)) ([7762d06](https://github.com/dynamic-labs/DynamicAuth/commit/7762d067bdd4b3f313a15308262f18dac0b961ab))
|
|
84
|
+
* **MagicWalletConnector:** remove async from getWeb3Provider method ([#3230](https://github.com/dynamic-labs/DynamicAuth/issues/3230)) ([69356e9](https://github.com/dynamic-labs/DynamicAuth/commit/69356e9b0bd1800acdf24fc96c72b094b595eaa7))
|
|
85
|
+
* remove react component props from sending to sdk api ([#3282](https://github.com/dynamic-labs/DynamicAuth/issues/3282)) ([b0d8f2b](https://github.com/dynamic-labs/DynamicAuth/commit/b0d8f2b9dd0856a5a7bd862f6c3499b65ec29f64))
|
|
86
|
+
* seprate ls checks for dynamiccontext and wagmi settings ([#3275](https://github.com/dynamic-labs/DynamicAuth/issues/3275)) ([aa4e756](https://github.com/dynamic-labs/DynamicAuth/commit/aa4e756a10310ce216b5942d0d6845f7092a89a2))
|
|
87
|
+
* use context to handle social sign-in and display message while processing ([#3216](https://github.com/dynamic-labs/DynamicAuth/issues/3216)) ([0e3ce73](https://github.com/dynamic-labs/DynamicAuth/commit/0e3ce73eafbb8d5725377c9a8cbd86a82d6c525f))
|
|
88
|
+
* **wallet-connect-v2:** use appropriate default chain id with WC v2 ([#3218](https://github.com/dynamic-labs/DynamicAuth/issues/3218)) ([2e6e7be](https://github.com/dynamic-labs/DynamicAuth/commit/2e6e7beb801ea5a8dc7429970bcd1e705610d605))
|
|
89
|
+
|
|
90
|
+
## [0.19.0-alpha.7](https://github.com/dynamic-labs/DynamicAuth/compare/v0.19.0-alpha.6...v0.19.0-alpha.7) (2023-08-31)
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
### Features
|
|
94
|
+
|
|
95
|
+
* include deepLinkPreference option for wallet connect deep linking mode ([#3174](https://github.com/dynamic-labs/DynamicAuth/issues/3174)) ([f715948](https://github.com/dynamic-labs/DynamicAuth/commit/f715948050ddab52373ab742ea47cfc0879842ae))
|
|
96
|
+
* add option to disable the locked wallet view ([#3184](https://github.com/dynamic-labs/DynamicAuth/issues/3184)) ([d9a1290](https://github.com/dynamic-labs/DynamicAuth/commit/d9a1290214b7f86337abb544acd96f65ffe37759))
|
|
97
|
+
* migrate starknet version to v5 ([#3153](https://github.com/dynamic-labs/DynamicAuth/issues/3153)) ([b674011](https://github.com/dynamic-labs/DynamicAuth/commit/b67401133bf75d416118b51be11e3f099d2e2cda))
|
|
98
|
+
* add editable text with react i18next ([#3170](https://github.com/dynamic-labs/DynamicAuth/issues/3170)) ([a46b2ca](https://github.com/dynamic-labs/DynamicAuth/commit/a46b2ca880a4e14356024d2936920f72c8bc447e))
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
### Bug Fixes
|
|
102
|
+
|
|
103
|
+
* allow to select L2 wallet after changing L1 network ([#3158](https://github.com/dynamic-labs/DynamicAuth/issues/3158)) ([cf68472](https://github.com/dynamic-labs/DynamicAuth/commit/cf6847270181f7fd33537ac1ff2a03e70b67daf2))
|
|
104
|
+
* allow user to cancel magic login to choose another email ([#3123](https://github.com/dynamic-labs/DynamicAuth/issues/3123)) ([cd73d6d](https://github.com/dynamic-labs/DynamicAuth/commit/cd73d6d0500c313dda01bca6245c52d2d8fca93a))
|
|
105
|
+
* verify email OTP when email is updated ([#3168](https://github.com/dynamic-labs/DynamicAuth/issues/3168)) ([641eeb6](https://github.com/dynamic-labs/DynamicAuth/commit/641eeb685b0c9d77cc72912f29b137c699c192f0))
|
|
106
|
+
* end connector session when unlinking in bridge ([#3120](https://github.com/dynamic-labs/DynamicAuth/issues/3120)) ([4c15da2](https://github.com/dynamic-labs/DynamicAuth/commit/4c15da27646c7bd176f6080dee6d76833e30f8a1))
|
|
107
|
+
* improves loading the sdk setting once per session ([#3189](https://github.com/dynamic-labs/DynamicAuth/issues/3189)) ([c9b0241](https://github.com/dynamic-labs/DynamicAuth/commit/c9b0241da28d2a73c90fd7643280c8632772c90b))
|
|
108
|
+
* update wallet address when switching network on bridge ([#3171](https://github.com/dynamic-labs/DynamicAuth/issues/3171)) ([f35f35e](https://github.com/dynamic-labs/DynamicAuth/commit/f35f35e632bcf88794884b66e0466cdf2e924812))
|
|
109
|
+
* updates the user email when updateUserWithModal method is used ([#3186](https://github.com/dynamic-labs/DynamicAuth/issues/3186)) ([8c71863](https://github.com/dynamic-labs/DynamicAuth/commit/8c718632cef0165328b929c27b6eef313641458d))
|
|
110
|
+
* sign message for embedded wallet when auth mode is connect only ([#3185](https://github.com/dynamic-labs/DynamicAuth/issues/3185)) ([0e3859c](https://github.com/dynamic-labs/DynamicAuth/commit/0e3859cfc738d3ecf8f19976e5cdaebc0c4f01c9))
|
|
111
|
+
* sync wagmi with wallet connector ([#3149](https://github.com/dynamic-labs/DynamicAuth/issues/3149)) ([3216e15](https://github.com/dynamic-labs/DynamicAuth/commit/3216e1570ac12ded6b3ce50b7efb762fe6814815))
|
|
112
|
+
|
|
113
|
+
## [0.19.0-alpha.6](https://github.com/dynamic-labs/DynamicAuth/compare/v0.19.0-alpha.5...v0.19.0-alpha.6) (2023-08-25)
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
### Features
|
|
117
|
+
|
|
118
|
+
* optionally split up email and social and change their display order in login view ([#3125](https://github.com/dynamic-labs/DynamicAuth/issues/3125)) ([ee82d26](https://github.com/dynamic-labs/DynamicAuth/commit/ee82d264eb3cb7f4ca7eb33369ef5409fe6860e4))
|
|
119
|
+
* post a connection request for second wallet ([#3113](https://github.com/dynamic-labs/DynamicAuth/issues/3113)) ([630aefa](https://github.com/dynamic-labs/DynamicAuth/commit/630aefa5ce83278082db1e3cd419c03e4fd081c7))
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
### Bug Fixes
|
|
123
|
+
|
|
124
|
+
* fix bug where user was not able to confirm last wallet transfer ([#3102](https://github.com/dynamic-labs/DynamicAuth/issues/3102)) ([453b4c2](https://github.com/dynamic-labs/DynamicAuth/commit/453b4c20ea8f09d92dda11cdf92ddab562096d6f))
|
|
125
|
+
* fix github social linking icon on dark mode ([#3126](https://github.com/dynamic-labs/DynamicAuth/issues/3126)) ([6a8f3e3](https://github.com/dynamic-labs/DynamicAuth/commit/6a8f3e3d6e43d76b428e169fd5ead9ee0e2ec43d))
|
|
126
|
+
* fix issue with detecting oauth window closed before finishing linking ([#3124](https://github.com/dynamic-labs/DynamicAuth/issues/3124)) ([6a80ee9](https://github.com/dynamic-labs/DynamicAuth/commit/6a80ee97deb54e5b62bf2285d71b03c36802c5d2))
|
|
127
|
+
* stop calling handleLogOut prematurely ([#3135](https://github.com/dynamic-labs/DynamicAuth/issues/3135)) ([e7c81ad](https://github.com/dynamic-labs/DynamicAuth/commit/e7c81ad7e9e9cff03e5d2ca1e0fb7cfea083d06e))
|
|
128
|
+
|
|
129
|
+
## [0.19.0-alpha.5](https://github.com/dynamic-labs/DynamicAuth/compare/v0.19.0-alpha.4...v0.19.0-alpha.5) (2023-08-24)
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
### Bug Fixes
|
|
133
|
+
|
|
134
|
+
* send wagmi settings only once when DynamicWagmiConnector loads ([#3103](https://github.com/dynamic-labs/DynamicAuth/issues/3103)) ([8bba505](https://github.com/dynamic-labs/DynamicAuth/commit/8bba505f84f6f3567743397a3f1274a3840a7700))
|
|
135
|
+
|
|
136
|
+
## [0.19.0-alpha.4](https://github.com/dynamic-labs/DynamicAuth/compare/v0.19.0-alpha.3...v0.19.0-alpha.4) (2023-08-23)
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
### Features
|
|
140
|
+
|
|
141
|
+
* **GVTY-142:** support both emailOnly and dynamic as login with email provider ([#3025](https://github.com/dynamic-labs/DynamicAuth/issues/3025)) ([a4c43d3](https://github.com/dynamic-labs/DynamicAuth/commit/a4c43d36c44026df747530bc60193e73b77b9020))
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
### Bug Fixes
|
|
145
|
+
|
|
146
|
+
* jumps when entering OTP code on IOS ([#3036](https://github.com/dynamic-labs/DynamicAuth/issues/3036)) ([f87eade](https://github.com/dynamic-labs/DynamicAuth/commit/f87eadeab9b7ea0c3f55d5d6d682a916868f2a58))
|
|
147
|
+
* log user out when magic session expires ([#3085](https://github.com/dynamic-labs/DynamicAuth/issues/3085)) ([fd5a328](https://github.com/dynamic-labs/DynamicAuth/commit/fd5a328dc41074c05413e0da82e82bb41bc803a1))
|
|
148
|
+
* switching network after connecting L1 wallet breaks bridge flow ([#3054](https://github.com/dynamic-labs/DynamicAuth/issues/3054)) ([e119f2b](https://github.com/dynamic-labs/DynamicAuth/commit/e119f2b23f3e6eedb0d2798dcf025bd401d78002))
|
|
149
|
+
|
|
150
|
+
## [0.19.0-alpha.3](https://github.com/dynamic-labs/DynamicAuth/compare/v0.19.0-alpha.2...v0.19.0-alpha.3) (2023-08-22)
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
### Bug Fixes
|
|
154
|
+
|
|
155
|
+
* multiwallet toolkit toggle not persisted after page refresh ([#3070](https://github.com/dynamic-labs/DynamicAuth/issues/3070)) ([ca454a7](https://github.com/dynamic-labs/DynamicAuth/commit/ca454a7aace415dbfaeef3f16f8e0d5b79b2d142))
|
|
156
|
+
|
|
157
|
+
## [0.19.0-alpha.2](https://github.com/dynamic-labs/DynamicAuth/compare/v0.19.0-alpha.1...v0.19.0-alpha.2) (2023-08-21)
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
### ⚠ BREAKING CHANGES
|
|
161
|
+
|
|
162
|
+
* useSocialAccounts: error type changed from string to SocialOAuthError:
|
|
163
|
+
export type SocialOAuthError = {
|
|
164
|
+
code: SocialOAuthErrorCode;
|
|
165
|
+
message: string;
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
### Features
|
|
169
|
+
|
|
170
|
+
* add ErrorPage when user tries to transfer the last wallet out account when preventOrphanedAccounts is true ([#2919](https://github.com/dynamic-labs/DynamicAuth/issues/2919)) ([7144211](https://github.com/dynamic-labs/DynamicAuth/commit/71442116851ddb22911b7809b45f9c3a49989fdf)), closes [#2924](https://github.com/dynamic-labs/DynamicAuth/issues/2924) [#2956](https://github.com/dynamic-labs/DynamicAuth/issues/2956) [#2960](https://github.com/dynamic-labs/DynamicAuth/issues/2960)
|
|
171
|
+
* add onEmailVerificationX callbacks ([#2859](https://github.com/dynamic-labs/DynamicAuth/issues/2859)) ([1c1c66d](https://github.com/dynamic-labs/DynamicAuth/commit/1c1c66dc47fb1966a2ef8102957dd06b42c9f7dc))
|
|
172
|
+
* add UserFieldEditorView component ([#2873](https://github.com/dynamic-labs/DynamicAuth/issues/2873)) ([7a6d1d7](https://github.com/dynamic-labs/DynamicAuth/commit/7a6d1d7057422e4ff5f4efebbf8f08eb7398c51d))
|
|
173
|
+
* e2e refresh on unsupported network ([#2915](https://github.com/dynamic-labs/DynamicAuth/issues/2915)) ([8504c73](https://github.com/dynamic-labs/DynamicAuth/commit/8504c73d75a057c695fe86b25d8bf42ff071efb4))
|
|
174
|
+
* introduces updateUserWithModal ([#2972](https://github.com/dynamic-labs/DynamicAuth/issues/2972)) ([883f500](https://github.com/dynamic-labs/DynamicAuth/commit/883f500f35e5db9dcaf073e049f67672e0115670))
|
|
175
|
+
* update wallet locked view ([#2892](https://github.com/dynamic-labs/DynamicAuth/issues/2892)) ([e3aaaca](https://github.com/dynamic-labs/DynamicAuth/commit/e3aaaca50c6335498b9e3938674b37524a001b49))
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
### Bug Fixes
|
|
179
|
+
|
|
180
|
+
* input's css hiding submit button and label on autocomplete ([#2916](https://github.com/dynamic-labs/DynamicAuth/issues/2916)) ([d07acfc](https://github.com/dynamic-labs/DynamicAuth/commit/d07acfc627dd72fea690c0492190c995be9e6b2c))
|
|
181
|
+
* always enable magic connectors when enabled ([#3014](https://github.com/dynamic-labs/DynamicAuth/issues/3014)) ([ce33b43](https://github.com/dynamic-labs/DynamicAuth/commit/ce33b4336397d5d77863ce32746dc4e975d16f6a))
|
|
182
|
+
* **captcha:** complete sign in with magic and blocto ([#2967](https://github.com/dynamic-labs/DynamicAuth/issues/2967)) ([07e4cf7](https://github.com/dynamic-labs/DynamicAuth/commit/07e4cf7d3f8158e04ed6f78d1cc11b499da50eea))
|
|
183
|
+
* ensure social sign in embedded wallets sync correctly with wagmi ([#3043](https://github.com/dynamic-labs/DynamicAuth/issues/3043)) ([e139d38](https://github.com/dynamic-labs/DynamicAuth/commit/e139d38056bc2f20adbeff458ff6a9731e44a677))
|
|
184
|
+
* fix twitter linking ([#2918](https://github.com/dynamic-labs/DynamicAuth/issues/2918)) ([1511924](https://github.com/dynamic-labs/DynamicAuth/commit/1511924c89bb3bc12a290695a43f5db9e7d475f4))
|
|
185
|
+
* guard against null or undefined provider value when logging in with magic ([#3021](https://github.com/dynamic-labs/DynamicAuth/issues/3021)) ([7c1580a](https://github.com/dynamic-labs/DynamicAuth/commit/7c1580a782f0d6b30931a7f9c84f96416a7236cf))
|
|
186
|
+
* **GVTY-195:** issues with mergeUserAccountsView ([#2943](https://github.com/dynamic-labs/DynamicAuth/issues/2943)) ([b290132](https://github.com/dynamic-labs/DynamicAuth/commit/b29013269df539b4901f1f5fc688905f0f50548e))
|
|
187
|
+
* issue where walletconnectors are instantiated without walletbook ([#3020](https://github.com/dynamic-labs/DynamicAuth/issues/3020)) ([bb91c24](https://github.com/dynamic-labs/DynamicAuth/commit/bb91c24d4f03966f96c960eb04891846807ed49d))
|
|
188
|
+
* **Magic:** improve gas estimate for transactions ([#2929](https://github.com/dynamic-labs/DynamicAuth/issues/2929)) ([13dcb7a](https://github.com/dynamic-labs/DynamicAuth/commit/13dcb7a40a75e088fea81d51865dddf5391bcf83))
|
|
189
|
+
* missing enable isVerificationInProgress ([#2893](https://github.com/dynamic-labs/DynamicAuth/issues/2893)) ([bcd76a5](https://github.com/dynamic-labs/DynamicAuth/commit/bcd76a5b55f9e85872ff3dd9f5353b39ca47053b))
|
|
190
|
+
* **networks:** merge custom network after API networks ([#2925](https://github.com/dynamic-labs/DynamicAuth/issues/2925)) ([c2f53ca](https://github.com/dynamic-labs/DynamicAuth/commit/c2f53ca9ee3485ed26be4e7d7d255dbdb5a952d4))
|
|
191
|
+
* onBeforeConnectSuccessConfirmation is being called multiple times on network change ([#2917](https://github.com/dynamic-labs/DynamicAuth/issues/2917)) ([f873ca4](https://github.com/dynamic-labs/DynamicAuth/commit/f873ca47118796f277e37f5decf810503ee740bd))
|
|
192
|
+
* only use the production api environment of magicLink ([#3022](https://github.com/dynamic-labs/DynamicAuth/issues/3022)) ([cd86753](https://github.com/dynamic-labs/DynamicAuth/commit/cd867534262b8f77f5fa37344182181a7ea8d3c2))
|
|
193
|
+
* **QNTM-249:** broken email update when user is authenticated ([#2931](https://github.com/dynamic-labs/DynamicAuth/issues/2931)) ([5471ab1](https://github.com/dynamic-labs/DynamicAuth/commit/5471ab1b51f9bffdf1e36e1c2fac1fb9af06a067))
|
|
194
|
+
* reformat social sign-in text ([#2956](https://github.com/dynamic-labs/DynamicAuth/issues/2956)) ([0e149db](https://github.com/dynamic-labs/DynamicAuth/commit/0e149db5b661347145928f4de6ce932604ed7184))
|
|
195
|
+
* remove unused provider variable from OKX.spec.ts ([#2959](https://github.com/dynamic-labs/DynamicAuth/issues/2959)) ([6bc9d4d](https://github.com/dynamic-labs/DynamicAuth/commit/6bc9d4d51795ff46779650d929d8e0df3179e0b1))
|
|
196
|
+
* set error if user closes oauth window or if it times out ([#3050](https://github.com/dynamic-labs/DynamicAuth/issues/3050)) ([ef2b189](https://github.com/dynamic-labs/DynamicAuth/commit/ef2b189cbf650bf82382e538e7ce653fb677a22f))
|
|
197
|
+
* switching network in connected state should update wallets to connect list ([#2989](https://github.com/dynamic-labs/DynamicAuth/issues/2989)) ([f0553fd](https://github.com/dynamic-labs/DynamicAuth/commit/f0553fd24c27204e9ec7b7c12d6589ce92910553))
|
|
198
|
+
* sync wagmi correctly in connect-only mode ([#2990](https://github.com/dynamic-labs/DynamicAuth/issues/2990)) ([d15b6d5](https://github.com/dynamic-labs/DynamicAuth/commit/d15b6d5eb7349e872138d4394a1a155fdb67e6b4))
|
|
199
|
+
* **transactions:** send transaction with auto nonce ([#3049](https://github.com/dynamic-labs/DynamicAuth/issues/3049)) ([769cdce](https://github.com/dynamic-labs/DynamicAuth/commit/769cdce50fba786c94ac139fc031073513bbec3a))
|
|
200
|
+
* use ETH currency symbol for STARK chains ([#3005](https://github.com/dynamic-labs/DynamicAuth/issues/3005)) ([a43f184](https://github.com/dynamic-labs/DynamicAuth/commit/a43f184121463844a0934189290c8251db36d3dc))
|
|
201
|
+
* useSyncPrimaryWallet overrides views with "wallet-locked-view" ([#2861](https://github.com/dynamic-labs/DynamicAuth/issues/2861)) ([a21d9e4](https://github.com/dynamic-labs/DynamicAuth/commit/a21d9e42a900201b8f4039038ced50d59c763e8a))
|
|
202
|
+
* **wallet-list:** update key to distinguish wallet and wallet group ([#2909](https://github.com/dynamic-labs/DynamicAuth/issues/2909)) ([ce5055f](https://github.com/dynamic-labs/DynamicAuth/commit/ce5055febab9b8a479505d3f21b1cdf2b5091fd7))
|
|
203
|
+
|
|
204
|
+
## [0.19.0-alpha.1](https://github.com/dynamic-labs/DynamicAuth/compare/v0.19.0-alpha.0...v0.19.0-alpha.1) (2023-08-10)
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
### Features
|
|
208
|
+
|
|
209
|
+
* cleaning up email input field - delete continue button ([#2833](https://github.com/dynamic-labs/DynamicAuth/issues/2833)) ([baa399e](https://github.com/dynamic-labs/DynamicAuth/commit/baa399e387bce9570a7e7774d68dc3c92f86be1b))
|
|
210
|
+
* disable social buttons after provider is selected ([#2875](https://github.com/dynamic-labs/DynamicAuth/issues/2875)) ([6296ce1](https://github.com/dynamic-labs/DynamicAuth/commit/6296ce13062a8589cf6fb4741957dc9bf84552a2))
|
|
211
|
+
* **GVTY-65:** Allow Merging accounts when duplicated email in KYC step ([#2772](https://github.com/dynamic-labs/DynamicAuth/issues/2772)) ([8efb6ae](https://github.com/dynamic-labs/DynamicAuth/commit/8efb6aecc9445ef1798a5c6358eac27b16f661b6))
|
|
212
|
+
* hide network from nav if hideNetworkInDynamicWidget setting is true ([#2842](https://github.com/dynamic-labs/DynamicAuth/issues/2842)) ([f3dc9ba](https://github.com/dynamic-labs/DynamicAuth/commit/f3dc9ba987781d5d0540336f351bb9f148400eac))
|
|
213
|
+
* show email submit button on focus ([#2860](https://github.com/dynamic-labs/DynamicAuth/issues/2860)) ([87d8ae0](https://github.com/dynamic-labs/DynamicAuth/commit/87d8ae0806425a25835efda5f9b9abc58e5de18e))
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
### Bug Fixes
|
|
217
|
+
|
|
218
|
+
* account already exist message not displaying automatically ([#2896](https://github.com/dynamic-labs/DynamicAuth/issues/2896)) ([ba56c93](https://github.com/dynamic-labs/DynamicAuth/commit/ba56c936546428b0a1111ab5ef6e8d0d9a463bb5))
|
|
219
|
+
* array of dynamicWagmiSettings not being sent, must be turned into object ([#2835](https://github.com/dynamic-labs/DynamicAuth/issues/2835)) ([092c45a](https://github.com/dynamic-labs/DynamicAuth/commit/092c45afd3676fbd7c3d28f51818470de7f95768))
|
|
220
|
+
* change network modal doesn't pop on secondary wallet, when primaryWallet was disconnected ([#2817](https://github.com/dynamic-labs/DynamicAuth/issues/2817)) ([b68c156](https://github.com/dynamic-labs/DynamicAuth/commit/b68c1565f936d2f4275b104a0881ba5720101abd))
|
|
221
|
+
* connectSuccess callback is not being called when connecting new wallet after unlink ([#2814](https://github.com/dynamic-labs/DynamicAuth/issues/2814)) ([d5b34d8](https://github.com/dynamic-labs/DynamicAuth/commit/d5b34d8a073436ce39280766608578fd97567fac))
|
|
222
|
+
* css variables are being ignored for ConnectButton component ([#2869](https://github.com/dynamic-labs/DynamicAuth/issues/2869)) ([a54fb46](https://github.com/dynamic-labs/DynamicAuth/commit/a54fb46648758001450a33e6d86cf04765507701))
|
|
223
|
+
* css variables for the ConnectButton are being ignored ([#2856](https://github.com/dynamic-labs/DynamicAuth/issues/2856)) ([65a342f](https://github.com/dynamic-labs/DynamicAuth/commit/65a342f828b6a16f714fc6b6e2066e1b742b2c0a))
|
|
224
|
+
* don't let user update email if it's linked to an embedded wallet ([#2883](https://github.com/dynamic-labs/DynamicAuth/issues/2883)) ([99aa303](https://github.com/dynamic-labs/DynamicAuth/commit/99aa3033e62c0dee14657cb811db8d5b3597f7de))
|
|
225
|
+
* **GVTY-150:** blocto pop up to sign after disconnect ([#2854](https://github.com/dynamic-labs/DynamicAuth/issues/2854)) ([df5481b](https://github.com/dynamic-labs/DynamicAuth/commit/df5481b2d5438848ad96cdee402f40b520bead08))
|
|
226
|
+
* **GVTY-155:** update to the new design ([#2889](https://github.com/dynamic-labs/DynamicAuth/issues/2889)) ([31f7f54](https://github.com/dynamic-labs/DynamicAuth/commit/31f7f54444c623fe7d5bcf8a42f94ee22eedc3e1))
|
|
227
|
+
* **GVTY-159:** email update view not showing email used error ([#2887](https://github.com/dynamic-labs/DynamicAuth/issues/2887)) ([bd40e4c](https://github.com/dynamic-labs/DynamicAuth/commit/bd40e4c77cda42752d44e42b98bfcea4cfd77a80))
|
|
228
|
+
* **OTPOverviewView:** enable close only on close button click ([#2877](https://github.com/dynamic-labs/DynamicAuth/issues/2877)) ([2be23e7](https://github.com/dynamic-labs/DynamicAuth/commit/2be23e7ddefe67c971d863ad9069ac5b8a74f4e5))
|
|
229
|
+
* **transaction:** improve gas estimate in transaction confirmation ([#2767](https://github.com/dynamic-labs/DynamicAuth/issues/2767)) ([7180ae5](https://github.com/dynamic-labs/DynamicAuth/commit/7180ae50559f924ae9769b2b8d87eadc6604c754))
|
|
230
|
+
* use findSocialIcon instead getSocialIcon to avoid render errors ([#2834](https://github.com/dynamic-labs/DynamicAuth/issues/2834)) ([2c57f98](https://github.com/dynamic-labs/DynamicAuth/commit/2c57f98fd5c461ae4acbe2836f719ebe18bc21fc))
|
|
231
|
+
* **useWalletConnectorEvent:** ensure connector is initialized ([#2849](https://github.com/dynamic-labs/DynamicAuth/issues/2849)) ([9137131](https://github.com/dynamic-labs/DynamicAuth/commit/913713166af8a6e6cc15a8e362e57b328fc0a76f))
|
|
232
|
+
* **wcv2:** simulate chain change event in switchNetwork ([#2809](https://github.com/dynamic-labs/DynamicAuth/issues/2809)) ([2329b80](https://github.com/dynamic-labs/DynamicAuth/commit/2329b808f57644cebb664be536bc41e256d108d8))
|
|
233
|
+
* wrong wallet list is showing after disconnecting and network change ([#2815](https://github.com/dynamic-labs/DynamicAuth/issues/2815)) ([6cae101](https://github.com/dynamic-labs/DynamicAuth/commit/6cae1019f40be4ffe7ab0426aa159c652a770a82))
|
|
234
|
+
|
|
2
235
|
## [0.19.0-alpha.0](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.0-RC.25...v0.19.0-alpha.0) (2023-08-01)
|
|
3
236
|
|
|
4
237
|
## [0.18.0-RC.25](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.0-RC.24...v0.18.0-RC.25) (2023-08-01)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/utils",
|
|
3
|
-
"version": "0.19.0-alpha.
|
|
3
|
+
"version": "0.19.0-alpha.10",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/dynamic-labs/DynamicAuth.git",
|
|
@@ -25,8 +25,11 @@
|
|
|
25
25
|
},
|
|
26
26
|
"./package.json": "./package.json"
|
|
27
27
|
},
|
|
28
|
-
"
|
|
29
|
-
"
|
|
28
|
+
"peerDependencies": {
|
|
29
|
+
"viem": "^1.5.3"
|
|
30
30
|
},
|
|
31
|
-
"
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@dynamic-labs/logger": "0.19.0-alpha.10",
|
|
33
|
+
"@dynamic-labs/types": "0.19.0-alpha.10"
|
|
34
|
+
}
|
|
32
35
|
}
|
|
@@ -2,32 +2,134 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
5
|
+
var logger = require('../logger/logger.cjs');
|
|
6
|
+
|
|
7
|
+
/* eslint-disable multiline-comment-style */
|
|
8
|
+
const defaultCancel = () => {
|
|
9
|
+
logger.logger.error("Tried to cancel CancellablePromise without ever assigning it's '_cancel' method");
|
|
10
|
+
};
|
|
11
|
+
/** An extension of Promise that allows you to explicitly cancel a promise with an external reference to it.
|
|
12
|
+
* Cancelling CancellablePromise causes it to reject with reason set to the parameter passed to the cancel method.
|
|
13
|
+
* When CancellablePromise rejects, it provides a boolean to indicate whether it was cancelled, alongside the reason.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* // Cancelling this promise
|
|
17
|
+
* const promise = new CancellablePromise(() => {}).onCancel(console.log)
|
|
18
|
+
* promise.cancel('User cancelled')
|
|
19
|
+
*
|
|
20
|
+
* // Setting up listeners for resolve, cancel and reject
|
|
21
|
+
* // (notice calling catch after onCancel prevents catch from being called by cancellation)
|
|
22
|
+
* new CancellablePromise(() => {})
|
|
23
|
+
* .then(() => console.log('Promise resolved'))
|
|
24
|
+
* .onCancel(() => console.log('Promise was cancelled'))
|
|
25
|
+
* .catch(() => console.log('Promise was rejected but NOT cancelled'))
|
|
26
|
+
*
|
|
27
|
+
* // Telling whether catch was cause of cancel or not
|
|
28
|
+
* new CancellablePromise(() => {})
|
|
29
|
+
* .then(() => console.log('Promise resolved'))
|
|
30
|
+
* .catch(({ reason, wasCancelled }) => console.log('Promise was rejected. Cancelled: ' + wasCancelled))
|
|
31
|
+
*/
|
|
32
|
+
class CancellablePromise extends Promise {
|
|
33
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
34
|
+
internalCancel(reason) {
|
|
35
|
+
defaultCancel();
|
|
36
|
+
}
|
|
37
|
+
constructor(executor) {
|
|
38
|
+
let superReject = defaultCancel;
|
|
39
|
+
let superResolve = () => { };
|
|
40
|
+
super((resolve, reject) => {
|
|
41
|
+
superReject = reject;
|
|
42
|
+
superResolve = resolve;
|
|
43
|
+
});
|
|
44
|
+
this.internalIsCancelled = false;
|
|
45
|
+
this.isSettled = false;
|
|
46
|
+
executor((value) => {
|
|
47
|
+
if (!this.isCancelled && !this.isSettled)
|
|
48
|
+
superResolve(value);
|
|
49
|
+
this.isSettled = true;
|
|
50
|
+
}, (reason) => {
|
|
51
|
+
if (!this.isCancelled && !this.isSettled)
|
|
52
|
+
superReject(reason);
|
|
53
|
+
this.isSettled = true;
|
|
54
|
+
});
|
|
55
|
+
this.internalCancel = superReject;
|
|
56
|
+
}
|
|
57
|
+
/** Whether this CancellablePromise was cancelled. */
|
|
58
|
+
get isCancelled() {
|
|
59
|
+
return this.internalIsCancelled;
|
|
60
|
+
}
|
|
61
|
+
/** Cancels the promise. This causes the promise to reject with { wasCancelled: true, reason: reason }
|
|
62
|
+
* where the reason is the provided argument.
|
|
63
|
+
* @returns The cancelled promise.
|
|
64
|
+
*/
|
|
65
|
+
cancel(reason) {
|
|
66
|
+
if (this.isSettled)
|
|
67
|
+
return this;
|
|
68
|
+
this.internalIsCancelled = true;
|
|
69
|
+
this.internalCancel(reason);
|
|
70
|
+
this.isSettled = true;
|
|
71
|
+
return this;
|
|
72
|
+
}
|
|
73
|
+
internalOnCancel(listener, options) {
|
|
74
|
+
const newPromise = new CancellablePromise((resolve, reject) => {
|
|
75
|
+
this.internalThen(resolve, ({ wasCancelled, reason }) => {
|
|
76
|
+
if (wasCancelled)
|
|
77
|
+
resolve(listener(reason));
|
|
78
|
+
else
|
|
79
|
+
reject(reason);
|
|
80
|
+
}, { ignoreOnCancel: true });
|
|
81
|
+
});
|
|
82
|
+
/** Tie the new promise's cancel to this promise's cancel */
|
|
83
|
+
if (!(options === null || options === void 0 ? void 0 : options.ignoreOnCancel)) {
|
|
84
|
+
newPromise.internalOnCancel((reason) => {
|
|
85
|
+
this.cancel(reason);
|
|
86
|
+
}, { ignoreOnCancel: true });
|
|
87
|
+
}
|
|
88
|
+
return newPromise;
|
|
89
|
+
}
|
|
90
|
+
/** Allows reacting to this CancellablePromise being cancelled */
|
|
91
|
+
onCancel(listener) {
|
|
92
|
+
return this.internalOnCancel(listener);
|
|
93
|
+
}
|
|
94
|
+
internalThen(onFulfilled, onRejected, options) {
|
|
95
|
+
/** Create a catch handler that is undefined if the received callback is undefined */
|
|
96
|
+
const catchHandler = onRejected
|
|
97
|
+
? (reason) => onRejected({ reason, wasCancelled: this.isCancelled })
|
|
98
|
+
: onRejected;
|
|
99
|
+
// /** Create the CancellablePromise we will returned, associated to the then promise */
|
|
100
|
+
const newPromise = CancellablePromise.fromPromise(super.then(onFulfilled, catchHandler));
|
|
101
|
+
/** Tie the new promise's cancel to this promise's cancel */
|
|
102
|
+
if (!(options === null || options === void 0 ? void 0 : options.ignoreOnCancel)) {
|
|
103
|
+
newPromise.internalOnCancel((reason) => {
|
|
104
|
+
this.cancel(reason);
|
|
105
|
+
}, { ignoreOnCancel: true });
|
|
106
|
+
}
|
|
107
|
+
return newPromise;
|
|
108
|
+
}
|
|
109
|
+
then(onFulfilled, onRejected) {
|
|
110
|
+
return this.internalThen(onFulfilled, onRejected);
|
|
111
|
+
}
|
|
112
|
+
catch(onRejected) {
|
|
113
|
+
return this.then(undefined, onRejected);
|
|
114
|
+
}
|
|
115
|
+
finally(onFinally) {
|
|
116
|
+
return this.then((value) => {
|
|
117
|
+
onFinally === null || onFinally === void 0 ? void 0 : onFinally();
|
|
118
|
+
return value;
|
|
119
|
+
}, (reason) => {
|
|
120
|
+
onFinally === null || onFinally === void 0 ? void 0 : onFinally();
|
|
121
|
+
throw reason;
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
/** Generates a CancellablePromise from a Promise. If a CancellablePromise is passed, it's returned unscathed.
|
|
125
|
+
* WARNING: unless you attach a method to reject the original Promise with the "onCancel" param.
|
|
126
|
+
* cancelling the resulting CancellablePromise does NOT affect the original Promise. */
|
|
127
|
+
static fromPromise(promise) {
|
|
128
|
+
if ('internalIsCancelled' in promise)
|
|
129
|
+
return promise;
|
|
130
|
+
const newPromise = new CancellablePromise((resolve, reject) => promise.then(resolve, reject));
|
|
131
|
+
return newPromise;
|
|
132
|
+
}
|
|
31
133
|
}
|
|
32
134
|
|
|
33
135
|
exports.CancellablePromise = CancellablePromise;
|
|
@@ -1,9 +1,54 @@
|
|
|
1
|
-
type Executor<T> = (resolve: (value: T | PromiseLike<T>) => void, reject: (reason?: unknown) => void) => void;
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
type Executor<T> = (resolve: (value: T | PromiseLike<T>) => void, reject: (reason?: unknown) => void) => void;
|
|
2
|
+
type CancelListener<TResult = never> = (reason?: unknown) => TResult;
|
|
3
|
+
/** An extension of Promise that allows you to explicitly cancel a promise with an external reference to it.
|
|
4
|
+
* Cancelling CancellablePromise causes it to reject with reason set to the parameter passed to the cancel method.
|
|
5
|
+
* When CancellablePromise rejects, it provides a boolean to indicate whether it was cancelled, alongside the reason.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* // Cancelling this promise
|
|
9
|
+
* const promise = new CancellablePromise(() => {}).onCancel(console.log)
|
|
10
|
+
* promise.cancel('User cancelled')
|
|
11
|
+
*
|
|
12
|
+
* // Setting up listeners for resolve, cancel and reject
|
|
13
|
+
* // (notice calling catch after onCancel prevents catch from being called by cancellation)
|
|
14
|
+
* new CancellablePromise(() => {})
|
|
15
|
+
* .then(() => console.log('Promise resolved'))
|
|
16
|
+
* .onCancel(() => console.log('Promise was cancelled'))
|
|
17
|
+
* .catch(() => console.log('Promise was rejected but NOT cancelled'))
|
|
18
|
+
*
|
|
19
|
+
* // Telling whether catch was cause of cancel or not
|
|
20
|
+
* new CancellablePromise(() => {})
|
|
21
|
+
* .then(() => console.log('Promise resolved'))
|
|
22
|
+
* .catch(({ reason, wasCancelled }) => console.log('Promise was rejected. Cancelled: ' + wasCancelled))
|
|
23
|
+
*/
|
|
24
|
+
export declare class CancellablePromise<T> extends Promise<T> {
|
|
25
|
+
private internalIsCancelled;
|
|
26
|
+
private isSettled;
|
|
27
|
+
private internalCancel;
|
|
28
|
+
constructor(executor: Executor<T>);
|
|
29
|
+
/** Whether this CancellablePromise was cancelled. */
|
|
30
|
+
get isCancelled(): boolean;
|
|
31
|
+
/** Cancels the promise. This causes the promise to reject with { wasCancelled: true, reason: reason }
|
|
32
|
+
* where the reason is the provided argument.
|
|
33
|
+
* @returns The cancelled promise.
|
|
34
|
+
*/
|
|
35
|
+
cancel(reason?: unknown): this;
|
|
36
|
+
private internalOnCancel;
|
|
37
|
+
/** Allows reacting to this CancellablePromise being cancelled */
|
|
38
|
+
onCancel<TResult = never>(listener: CancelListener<TResult>): CancellablePromise<T | TResult>;
|
|
39
|
+
private internalThen;
|
|
40
|
+
then<TResult1 = T, TResult2 = never>(onFulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null, onRejected?: ((reason: {
|
|
41
|
+
reason: unknown;
|
|
42
|
+
wasCancelled: boolean;
|
|
43
|
+
}) => TResult2 | PromiseLike<TResult2>) | null): CancellablePromise<TResult1 | TResult2>;
|
|
44
|
+
catch<TResult = never>(onRejected?: ((reason: {
|
|
45
|
+
reason: unknown;
|
|
46
|
+
wasCancelled: boolean;
|
|
47
|
+
}) => TResult | PromiseLike<TResult>) | null): CancellablePromise<T | TResult>;
|
|
48
|
+
finally(onFinally?: (() => void) | null): CancellablePromise<T>;
|
|
49
|
+
/** Generates a CancellablePromise from a Promise. If a CancellablePromise is passed, it's returned unscathed.
|
|
50
|
+
* WARNING: unless you attach a method to reject the original Promise with the "onCancel" param.
|
|
51
|
+
* cancelling the resulting CancellablePromise does NOT affect the original Promise. */
|
|
52
|
+
static fromPromise<T>(promise: Promise<T> | CancellablePromise<T>): CancellablePromise<T>;
|
|
53
|
+
}
|
|
54
|
+
export {};
|