@dynamic-labs/wallet-connector-core 1.1.0-alpha.9 → 1.1.0
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 +198 -0
- package/_virtual/_tslib.cjs +6 -1
- package/_virtual/_tslib.js +6 -1
- package/package.json +10 -6
- package/src/index.cjs +12 -2
- package/src/index.d.ts +1 -0
- package/src/index.js +6 -1
- package/src/lib/IBitcoinWalletConnector.d.ts +24 -0
- package/src/lib/IEmailOTPWalletConnector.d.ts +1 -0
- package/src/lib/IHardwareWalletConnector.d.ts +4 -0
- package/src/lib/IPasskeyWalletConnector.d.ts +7 -3
- package/src/lib/IPhantomRedirectConnector.d.ts +7 -0
- package/src/lib/WalletConnector.cjs +16 -0
- package/src/lib/WalletConnector.d.ts +13 -1
- package/src/lib/WalletConnector.js +16 -0
- package/src/lib/index.d.ts +3 -0
- package/src/types.d.ts +5 -0
- package/src/utils/eventListenerHandlers.cjs +37 -0
- package/src/utils/eventListenerHandlers.d.ts +7 -0
- package/src/utils/eventListenerHandlers.js +33 -0
- package/src/utils/getRpcUrlForChain/getRpcUrlForChain.cjs +14 -0
- package/src/utils/getRpcUrlForChain/getRpcUrlForChain.d.ts +5 -0
- package/src/utils/getRpcUrlForChain/getRpcUrlForChain.js +10 -0
- package/src/utils/getRpcUrlForChain/index.d.ts +1 -0
- package/src/utils/index.d.ts +6 -1
- package/src/utils/isBitcoinConnector/index.d.ts +1 -0
- package/src/utils/isBitcoinConnector/isBitcoinConnector.cjs +7 -0
- package/src/utils/isBitcoinConnector/isBitcoinConnector.d.ts +2 -0
- package/src/utils/isBitcoinConnector/isBitcoinConnector.js +3 -0
- package/src/utils/isEmailWalletConnector/isEmailWalletConnector.cjs +1 -1
- package/src/utils/isEmailWalletConnector/isEmailWalletConnector.js +1 -1
- package/src/utils/isHardwareWalletConnector/index.d.ts +1 -0
- package/src/utils/isHardwareWalletConnector/isHardwareWalletConnector.cjs +7 -0
- package/src/utils/isHardwareWalletConnector/isHardwareWalletConnector.d.ts +2 -0
- package/src/utils/isHardwareWalletConnector/isHardwareWalletConnector.js +3 -0
- package/src/utils/isHex/index.d.ts +1 -0
- package/src/utils/isHex/isHex.cjs +13 -0
- package/src/utils/isHex/isHex.d.ts +1 -0
- package/src/utils/isHex/isHex.js +9 -0
- package/src/utils/isPhantomRedirectConnector/index.d.ts +1 -0
- package/src/utils/isPhantomRedirectConnector/isPhantomRedirectConnector.cjs +8 -0
- package/src/utils/isPhantomRedirectConnector/isPhantomRedirectConnector.d.ts +2 -0
- package/src/utils/isPhantomRedirectConnector/isPhantomRedirectConnector.js +4 -0
- package/src/utils/PhantomLedgerWalletName.cjs +0 -11
- package/src/utils/PhantomLedgerWalletName.d.ts +0 -5
- package/src/utils/PhantomLedgerWalletName.js +0 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,202 @@
|
|
|
1
1
|
|
|
2
|
+
## [1.1.0](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.25...v1.1.0) (2024-02-07)
|
|
3
|
+
|
|
4
|
+
Check out our changelog here: https://docs.dynamic.xyz/changelog/v1-1
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* add retry when using magic ([#4579](https://github.com/dynamic-labs/DynamicAuth/issues/4579)) ([183561c](https://github.com/dynamic-labs/DynamicAuth/commit/183561cc64f083fd1489c38a8cc8b1c4c51d2924))
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* bug where deprecated fields were still being used in the SDK ([#4604](https://github.com/dynamic-labs/DynamicAuth/issues/4604)) ([4fd15fc](https://github.com/dynamic-labs/DynamicAuth/commit/4fd15fc4daa9c5b7bbc81ce05a3b046c80a6d5b4))
|
|
15
|
+
* log magic RPC error and update magic network error ([#4606](https://github.com/dynamic-labs/DynamicAuth/issues/4606)) ([2206961](https://github.com/dynamic-labs/DynamicAuth/commit/22069618a317bc40b1a17fd521eadf0956983de4))
|
|
16
|
+
* onConnect is properly called for additional connected wallets ([#4607](https://github.com/dynamic-labs/DynamicAuth/issues/4607)) ([23241f4](https://github.com/dynamic-labs/DynamicAuth/commit/23241f4d5dc91ac9ca1251710161efbfce42dc40))
|
|
17
|
+
|
|
18
|
+
## [1.1.0-alpha.25](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.24...v1.1.0-alpha.25) (2024-02-05)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Features
|
|
22
|
+
|
|
23
|
+
* add signin with coinbase to sdk ([#4581](https://github.com/dynamic-labs/DynamicAuth/issues/4581)) ([08a31ed](https://github.com/dynamic-labs/DynamicAuth/commit/08a31ed3552c48645b398881f184440800af21ec))
|
|
24
|
+
* exposing hook for creating either one-time code or passkeys authenticators ([#4591](https://github.com/dynamic-labs/DynamicAuth/issues/4591)) ([864d755](https://github.com/dynamic-labs/DynamicAuth/commit/864d75576152a10f73f5901bc06e2d66892b63ab))
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
### Bug Fixes
|
|
28
|
+
|
|
29
|
+
* solana wallet sign message with one-time code session ([#4588](https://github.com/dynamic-labs/DynamicAuth/issues/4588)) ([a738d10](https://github.com/dynamic-labs/DynamicAuth/commit/a738d10814dc5058158b9c0c59a399a375c69c10))
|
|
30
|
+
|
|
31
|
+
## [1.1.0-alpha.24](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.23...v1.1.0-alpha.24) (2024-02-02)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
### Bug Fixes
|
|
35
|
+
|
|
36
|
+
* remove isFullyConnected when unable to restore wallet ([#4575](https://github.com/dynamic-labs/DynamicAuth/issues/4575)) ([4504ff0](https://github.com/dynamic-labs/DynamicAuth/commit/4504ff03f594cd9a60055e6f52b7ea8001542bbe))
|
|
37
|
+
|
|
38
|
+
## [1.1.0-alpha.23](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.22...v1.1.0-alpha.23) (2024-02-01)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
### Features
|
|
42
|
+
|
|
43
|
+
* bitcoin signPsbt ([3c964de](https://github.com/dynamic-labs/DynamicAuth/commit/3c964dea8a55debaf184c5a94f0f5fabdda3c877))
|
|
44
|
+
* embedded wallet email auth flow ([#4353](https://github.com/dynamic-labs/DynamicAuth/issues/4353)) ([4875da3](https://github.com/dynamic-labs/DynamicAuth/commit/4875da32c47c27facef1b1cdbdc214566bbfd171))
|
|
45
|
+
|
|
46
|
+
## [1.1.0-alpha.22](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.21...v1.1.0-alpha.22) (2024-02-01)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
### Bug Fixes
|
|
50
|
+
|
|
51
|
+
* onAuthFlowClose not being called ([#4563](https://github.com/dynamic-labs/DynamicAuth/issues/4563)) ([c4b2648](https://github.com/dynamic-labs/DynamicAuth/commit/c4b264885b7dba6e204ef49bf642d25c7d287b04))
|
|
52
|
+
|
|
53
|
+
## [1.1.0-alpha.21](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.20...v1.1.0-alpha.21) (2024-02-01)
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
### Features
|
|
57
|
+
|
|
58
|
+
* add phantom redirect handling context ([#4479](https://github.com/dynamic-labs/DynamicAuth/issues/4479)) ([e0218ee](https://github.com/dynamic-labs/DynamicAuth/commit/e0218eec1a67787f5c0e7483d542a5f773e911ef))
|
|
59
|
+
* add signPsbt method to bitcoin wallet connectors ([dfdc0fe](https://github.com/dynamic-labs/DynamicAuth/commit/dfdc0fe0e6894c1307b286e89b43a4c58a8808f3))
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
### Bug Fixes
|
|
63
|
+
|
|
64
|
+
* relax passkey feature detection check in sdk to avoid false nega… ([#4556](https://github.com/dynamic-labs/DynamicAuth/issues/4556)) ([4554f7d](https://github.com/dynamic-labs/DynamicAuth/commit/4554f7d7c5339859481cdecca95a9c07fae4ba5c))
|
|
65
|
+
* workaround braavos undefined selectedWallet on chainChange event ([#4552](https://github.com/dynamic-labs/DynamicAuth/issues/4552)) ([aa35df0](https://github.com/dynamic-labs/DynamicAuth/commit/aa35df0e894feafa0606aa1c87bd3d3879ebc594))
|
|
66
|
+
|
|
67
|
+
## [1.1.0-alpha.20](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.19...v1.1.0-alpha.20) (2024-01-31)
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
### Bug Fixes
|
|
71
|
+
|
|
72
|
+
* return all enabled chains in getSupportedNetworks instead of undefined ([#4547](https://github.com/dynamic-labs/DynamicAuth/issues/4547)) ([08e7889](https://github.com/dynamic-labs/DynamicAuth/commit/08e78896e045f24bbd96e39416a7f58006929da0))
|
|
73
|
+
* show modal for existing social account from other signin provider ([#4535](https://github.com/dynamic-labs/DynamicAuth/issues/4535)) ([282914a](https://github.com/dynamic-labs/DynamicAuth/commit/282914ac94b3ef5bd66e0b2265d9e414203a7406))
|
|
74
|
+
|
|
75
|
+
## [1.1.0-alpha.19](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.18...v1.1.0-alpha.19) (2024-01-31)
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
### Features
|
|
79
|
+
|
|
80
|
+
* add PhantomRedirect connector ([#4467](https://github.com/dynamic-labs/DynamicAuth/issues/4467)) ([75d6c95](https://github.com/dynamic-labs/DynamicAuth/commit/75d6c95940fcec185a699c2100b3e2d21a8233d5))
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
### Bug Fixes
|
|
84
|
+
|
|
85
|
+
* lock starknet to 5.25.0 since 5.27.0 breaks the build ([#4541](https://github.com/dynamic-labs/DynamicAuth/issues/4541)) ([00b4799](https://github.com/dynamic-labs/DynamicAuth/commit/00b479977f768cb067480e2e565eabf45e1000a2))
|
|
86
|
+
|
|
87
|
+
## [1.1.0-alpha.18](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.17...v1.1.0-alpha.18) (2024-01-30)
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
### Bug Fixes
|
|
91
|
+
|
|
92
|
+
* catch email_associated_with_different_provider from response ([#4532](https://github.com/dynamic-labs/DynamicAuth/issues/4532)) ([52be1b4](https://github.com/dynamic-labs/DynamicAuth/commit/52be1b45af46c2b70972b99d73387eb4d7161ec6))
|
|
93
|
+
|
|
94
|
+
## [1.1.0-alpha.17](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.16...v1.1.0-alpha.17) (2024-01-30)
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
### Features
|
|
98
|
+
|
|
99
|
+
* add sendRawTransaction to BitcoinWalletConnector ([2e86c5a](https://github.com/dynamic-labs/DynamicAuth/commit/2e86c5a5245bd0fc29162ef1f7fe2fbd65245fe1))
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
### Bug Fixes
|
|
103
|
+
|
|
104
|
+
* properly handle AccountExistsError for signInOAuth ([#4529](https://github.com/dynamic-labs/DynamicAuth/issues/4529)) ([d37fdc3](https://github.com/dynamic-labs/DynamicAuth/commit/d37fdc310fe4b70f8948fd5ed3d058342afbe08f))
|
|
105
|
+
|
|
106
|
+
## [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)
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
### Bug Fixes
|
|
110
|
+
|
|
111
|
+
* 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))
|
|
112
|
+
* 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))
|
|
113
|
+
|
|
114
|
+
## [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)
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
### Features
|
|
118
|
+
|
|
119
|
+
* 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))
|
|
120
|
+
* enable solana embedded wallets ([#4457](https://github.com/dynamic-labs/DynamicAuth/issues/4457)) ([b0c47f4](https://github.com/dynamic-labs/DynamicAuth/commit/b0c47f4475baa12f52076da46ef993c13bd2c243))
|
|
121
|
+
* group ArgentX wallets ([#4495](https://github.com/dynamic-labs/DynamicAuth/issues/4495)) ([b10d79a](https://github.com/dynamic-labs/DynamicAuth/commit/b10d79a668efecedca37ddb358e6adf95319650d))
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
### Bug Fixes
|
|
125
|
+
|
|
126
|
+
* add support for newest backpack extension ([#4468](https://github.com/dynamic-labs/DynamicAuth/issues/4468)) ([a219f32](https://github.com/dynamic-labs/DynamicAuth/commit/a219f325be672599e50b07f6751234a7fc98286e))
|
|
127
|
+
* bump timeout for slower connections ([#4475](https://github.com/dynamic-labs/DynamicAuth/issues/4475)) ([7a07ff5](https://github.com/dynamic-labs/DynamicAuth/commit/7a07ff589eaaf3b28a94d277df3eedabbca60702))
|
|
128
|
+
* 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))
|
|
129
|
+
* 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))
|
|
130
|
+
* pass id to wagmi chain override ([#4512](https://github.com/dynamic-labs/DynamicAuth/issues/4512)) ([2bf2f04](https://github.com/dynamic-labs/DynamicAuth/commit/2bf2f0487f5b1be936dd279107c11fe5d2b42666))
|
|
131
|
+
* 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))
|
|
132
|
+
|
|
133
|
+
## [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)
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
### Features
|
|
137
|
+
|
|
138
|
+
* add wallet-book retryable ([#4462](https://github.com/dynamic-labs/DynamicAuth/issues/4462)) ([513b1a6](https://github.com/dynamic-labs/DynamicAuth/commit/513b1a67d6c49624398ad4b0cdca4f5618c9583f))
|
|
139
|
+
|
|
140
|
+
## [1.1.0-alpha.13](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.12...v1.1.0-alpha.13) (2024-01-23)
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
### Features
|
|
144
|
+
|
|
145
|
+
* add createWalletClientFromWallet helper function ([#4416](https://github.com/dynamic-labs/DynamicAuth/issues/4416)) ([b384898](https://github.com/dynamic-labs/DynamicAuth/commit/b384898061bb3f9b38b2ed670b6650cfc1d4b429))
|
|
146
|
+
* add hardware wallets to wallet book ([#4445](https://github.com/dynamic-labs/DynamicAuth/issues/4445)) ([66c0f5b](https://github.com/dynamic-labs/DynamicAuth/commit/66c0f5b29a6a700099bb95a6f7622f6178e0bccf))
|
|
147
|
+
* add support for Argent Web and Mobile ([#4328](https://github.com/dynamic-labs/DynamicAuth/issues/4328)) ([bce20b8](https://github.com/dynamic-labs/DynamicAuth/commit/bce20b8f35a8630f2621f53a541a1acb06a38fc0))
|
|
148
|
+
* enable ledger for glow, solflare and backpack ([#4392](https://github.com/dynamic-labs/DynamicAuth/issues/4392)) ([fa7b992](https://github.com/dynamic-labs/DynamicAuth/commit/fa7b992f87ebc43560f87b43ac56f2cd9909b306))
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
### Bug Fixes
|
|
152
|
+
|
|
153
|
+
* breaking changes script ([#4440](https://github.com/dynamic-labs/DynamicAuth/issues/4440)) ([446173d](https://github.com/dynamic-labs/DynamicAuth/commit/446173d074d652d81856c6412e304b46b1565320))
|
|
154
|
+
* broken help icon in create passkey view ([#4428](https://github.com/dynamic-labs/DynamicAuth/issues/4428)) ([e0ffc02](https://github.com/dynamic-labs/DynamicAuth/commit/e0ffc02ffea34b7ac3198ff6e1baf7f9907acddd))
|
|
155
|
+
* infinite loop when connecting with trust wallet ([#4448](https://github.com/dynamic-labs/DynamicAuth/issues/4448)) ([4e20edf](https://github.com/dynamic-labs/DynamicAuth/commit/4e20edf9abaabf20e5e9f9167b44d7f691e844f1))
|
|
156
|
+
* render wagmi elements based on react version ([#4453](https://github.com/dynamic-labs/DynamicAuth/issues/4453)) ([43c624c](https://github.com/dynamic-labs/DynamicAuth/commit/43c624ca996b0c51de1454910f19fdf908149938))
|
|
157
|
+
|
|
158
|
+
## [1.1.0-alpha.12](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.11...v1.1.0-alpha.12) (2024-01-18)
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
### Features
|
|
162
|
+
|
|
163
|
+
* expose setAuthMode method ([#4419](https://github.com/dynamic-labs/DynamicAuth/issues/4419)) ([7d156b3](https://github.com/dynamic-labs/DynamicAuth/commit/7d156b3e0eab9b9a80f70ff1c5201d90693ae755))
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
### Bug Fixes
|
|
167
|
+
|
|
168
|
+
* call onUnlinkSuccess in headless mode too ([#4412](https://github.com/dynamic-labs/DynamicAuth/issues/4412)) ([4c76af9](https://github.com/dynamic-labs/DynamicAuth/commit/4c76af9ac7c7b43883742d1289558dfcb5d612ca))
|
|
169
|
+
* correctly map keplr chain ids from project settings ([#4418](https://github.com/dynamic-labs/DynamicAuth/issues/4418)) ([7046364](https://github.com/dynamic-labs/DynamicAuth/commit/7046364a316f7551f0b995eaae7afea13502eb9b))
|
|
170
|
+
* logging in with an email linked to a third party wallet gets stuck on otp view ([#4407](https://github.com/dynamic-labs/DynamicAuth/issues/4407)) ([35bf142](https://github.com/dynamic-labs/DynamicAuth/commit/35bf142e74efeef866dbd7b8157a049cd36eeccb))
|
|
171
|
+
|
|
172
|
+
## [1.1.0-alpha.11](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.10...v1.1.0-alpha.11) (2024-01-17)
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
### Features
|
|
176
|
+
|
|
177
|
+
* add Leather wallet and BtcKit connector ([#4335](https://github.com/dynamic-labs/DynamicAuth/issues/4335)) ([fe3316b](https://github.com/dynamic-labs/DynamicAuth/commit/fe3316b5be9ef17eea885e99cf925ccd0f271da7))
|
|
178
|
+
* add solana injected wallet configuration to walletbook ([#4375](https://github.com/dynamic-labs/DynamicAuth/issues/4375)) ([3677ce5](https://github.com/dynamic-labs/DynamicAuth/commit/3677ce5ff40d0c00bfaf0daa0d5d67bc40706ee0))
|
|
179
|
+
* add support for unisat wallet ([#4355](https://github.com/dynamic-labs/DynamicAuth/issues/4355)) ([5b7d6b0](https://github.com/dynamic-labs/DynamicAuth/commit/5b7d6b0a9ea84811a8252b3cdf30a3a8e410180c))
|
|
180
|
+
* add walletbook configurations for solana injected wallets ([#4360](https://github.com/dynamic-labs/DynamicAuth/issues/4360)) ([cdc8e5f](https://github.com/dynamic-labs/DynamicAuth/commit/cdc8e5f4878cb84e26e5b33299aa8547b84b6667))
|
|
181
|
+
* passkey renaming frontend ([#4331](https://github.com/dynamic-labs/DynamicAuth/issues/4331)) ([4551013](https://github.com/dynamic-labs/DynamicAuth/commit/4551013d577c914cb3aedfe458ab9eaa018aceb4))
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
### Bug Fixes
|
|
185
|
+
|
|
186
|
+
* correctly update wallets connected flag after wallet switch ([#4397](https://github.com/dynamic-labs/DynamicAuth/issues/4397)) ([543a830](https://github.com/dynamic-labs/DynamicAuth/commit/543a830574f0d5a78fedbb9b18233e8dfbaddd86))
|
|
187
|
+
* export modal header ([#4401](https://github.com/dynamic-labs/DynamicAuth/issues/4401)) ([77cf016](https://github.com/dynamic-labs/DynamicAuth/commit/77cf016fc742458988864647870149a56e991ee4))
|
|
188
|
+
* trigger onAuthSuccess before embedded wallet creation ([4aa341a](https://github.com/dynamic-labs/DynamicAuth/commit/4aa341a1d08332a121daddb7c2dcb09a804a4de7))
|
|
189
|
+
* ui issues on react 17 ([#4373](https://github.com/dynamic-labs/DynamicAuth/issues/4373)) ([93096d6](https://github.com/dynamic-labs/DynamicAuth/commit/93096d6017816a4f0ed299bf618b130d90c81514))
|
|
190
|
+
|
|
191
|
+
## [1.1.0-alpha.10](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.9...v1.1.0-alpha.10) (2024-01-06)
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
### Bug Fixes
|
|
195
|
+
|
|
196
|
+
* pass flow network to magic client ([#4322](https://github.com/dynamic-labs/DynamicAuth/issues/4322)) ([f3adccf](https://github.com/dynamic-labs/DynamicAuth/commit/f3adccf9f8d835f6b04e4767acd0fbd2ac238379))
|
|
197
|
+
* prevent error message when mobile wallet app is open ([#4301](https://github.com/dynamic-labs/DynamicAuth/issues/4301)) ([2a66dcf](https://github.com/dynamic-labs/DynamicAuth/commit/2a66dcfaf8100b3d910c559d35d8b731b1cb380e))
|
|
198
|
+
* turnkeyWalletConnector is not an email otp connector and uses dynamic otp ([#4313](https://github.com/dynamic-labs/DynamicAuth/issues/4313)) ([e4ea56f](https://github.com/dynamic-labs/DynamicAuth/commit/e4ea56f40fdf97b3f5440b016ebd95501089cebe))
|
|
199
|
+
|
|
2
200
|
## [1.1.0-alpha.9](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.8...v1.1.0-alpha.9) (2024-01-04)
|
|
3
201
|
|
|
4
202
|
|
package/_virtual/_tslib.cjs
CHANGED
|
@@ -31,7 +31,12 @@ function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
|
31
31
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
32
32
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
33
33
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
34
|
-
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
37
|
+
var e = new Error(message);
|
|
38
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
39
|
+
};
|
|
35
40
|
|
|
36
41
|
exports.__awaiter = __awaiter;
|
|
37
42
|
exports.__classPrivateFieldGet = __classPrivateFieldGet;
|
package/_virtual/_tslib.js
CHANGED
|
@@ -27,6 +27,11 @@ function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
|
27
27
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
28
28
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
29
29
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
30
|
-
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
33
|
+
var e = new Error(message);
|
|
34
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
35
|
+
};
|
|
31
36
|
|
|
32
37
|
export { __awaiter, __classPrivateFieldGet };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/wallet-connector-core",
|
|
3
|
-
"version": "1.1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/dynamic-labs/DynamicAuth.git",
|
|
@@ -25,12 +25,16 @@
|
|
|
25
25
|
},
|
|
26
26
|
"./package.json": "./package.json"
|
|
27
27
|
},
|
|
28
|
+
"devDependency": {
|
|
29
|
+
"@dynamic-labs/sdk-api": "0.0.363"
|
|
30
|
+
},
|
|
28
31
|
"peerDependencies": {
|
|
29
|
-
"@dynamic-labs/logger": "1.1.0
|
|
30
|
-
"@dynamic-labs/rpc-providers": "1.1.0
|
|
31
|
-
"@dynamic-labs/sdk-api": "0.0.
|
|
32
|
-
"@dynamic-labs/
|
|
33
|
-
"@dynamic-labs/
|
|
32
|
+
"@dynamic-labs/logger": "1.1.0",
|
|
33
|
+
"@dynamic-labs/rpc-providers": "1.1.0",
|
|
34
|
+
"@dynamic-labs/sdk-api": "0.0.363",
|
|
35
|
+
"@dynamic-labs/types": "1.1.0",
|
|
36
|
+
"@dynamic-labs/utils": "1.1.0",
|
|
37
|
+
"@dynamic-labs/wallet-book": "1.1.0",
|
|
34
38
|
"eventemitter3": "5.0.1"
|
|
35
39
|
}
|
|
36
40
|
}
|
package/src/index.cjs
CHANGED
|
@@ -14,7 +14,6 @@ var encoding = require('./utils/encoding.cjs');
|
|
|
14
14
|
var getWalletConnectorByKey = require('./utils/getWalletConnectorByKey.cjs');
|
|
15
15
|
var shouldLowercaseAddress = require('./utils/shouldLowercaseAddress.cjs');
|
|
16
16
|
var normalizeWalletName = require('./utils/normalizeWalletName/normalizeWalletName.cjs');
|
|
17
|
-
var PhantomLedgerWalletName = require('./utils/PhantomLedgerWalletName.cjs');
|
|
18
17
|
var walletConnectDeepLinks = require('./utils/walletConnectDeepLinks/walletConnectDeepLinks.cjs');
|
|
19
18
|
var performPlatformSpecificConnectionMethod = require('./utils/walletConnectDeepLinks/performPlatformSpecificConnectionMethod.cjs');
|
|
20
19
|
var isEmbeddedConnector = require('./utils/isEmbeddedConnector/isEmbeddedConnector.cjs');
|
|
@@ -23,6 +22,12 @@ var isBloctoConnector = require('./utils/isBloctoConnector/isBloctoConnector.cjs
|
|
|
23
22
|
var isPasskeyWalletConnector = require('./utils/isPasskeyWalletConnector/isPasskeyWalletConnector.cjs');
|
|
24
23
|
var isSmartWalletConnector = require('./utils/isSmartWalletConnector/isSmartWalletConnector.cjs');
|
|
25
24
|
var isAccountAbstractionConnector = require('./utils/isAccountAbstractionConnector/isAccountAbstractionConnector.cjs');
|
|
25
|
+
var isBitcoinConnector = require('./utils/isBitcoinConnector/isBitcoinConnector.cjs');
|
|
26
|
+
var isHardwareWalletConnector = require('./utils/isHardwareWalletConnector/isHardwareWalletConnector.cjs');
|
|
27
|
+
var eventListenerHandlers = require('./utils/eventListenerHandlers.cjs');
|
|
28
|
+
var isHex = require('./utils/isHex/isHex.cjs');
|
|
29
|
+
var isPhantomRedirectConnector = require('./utils/isPhantomRedirectConnector/isPhantomRedirectConnector.cjs');
|
|
30
|
+
var getRpcUrlForChain = require('./utils/getRpcUrlForChain/getRpcUrlForChain.cjs');
|
|
26
31
|
|
|
27
32
|
|
|
28
33
|
|
|
@@ -42,7 +47,6 @@ exports.utf8ToHex = encoding.utf8ToHex;
|
|
|
42
47
|
exports.getWalletConnectorByKey = getWalletConnectorByKey.getWalletConnectorByKey;
|
|
43
48
|
exports.shouldLowercaseAddress = shouldLowercaseAddress.shouldLowercaseAddress;
|
|
44
49
|
exports.normalizeWalletName = normalizeWalletName.normalizeWalletName;
|
|
45
|
-
exports.PhantomLedgerWalletName = PhantomLedgerWalletName.PhantomLedgerWalletName;
|
|
46
50
|
exports.getDeepLink = walletConnectDeepLinks.getDeepLink;
|
|
47
51
|
exports.performPlatformSpecificConnectionMethod = performPlatformSpecificConnectionMethod.performPlatformSpecificConnectionMethod;
|
|
48
52
|
exports.isEmbeddedConnector = isEmbeddedConnector.isEmbeddedConnector;
|
|
@@ -51,3 +55,9 @@ exports.isBloctoConnector = isBloctoConnector.isBloctoConnector;
|
|
|
51
55
|
exports.isPasskeyWalletConnector = isPasskeyWalletConnector.isPasskeyWalletConnector;
|
|
52
56
|
exports.isSmartWalletConnector = isSmartWalletConnector.isSmartWalletConnector;
|
|
53
57
|
exports.isAccountAbstractionConnector = isAccountAbstractionConnector.isAccountAbstractionConnector;
|
|
58
|
+
exports.isBitcoinConnector = isBitcoinConnector.isBitcoinConnector;
|
|
59
|
+
exports.isHardwareWalletConnector = isHardwareWalletConnector.isHardwareWalletConnector;
|
|
60
|
+
exports.eventListenerHandlers = eventListenerHandlers.eventListenerHandlers;
|
|
61
|
+
exports.isHex = isHex.isHex;
|
|
62
|
+
exports.isPhantomRedirectConnector = isPhantomRedirectConnector.isPhantomRedirectConnector;
|
|
63
|
+
exports.getRpcUrlForChain = getRpcUrlForChain.getRpcUrlForChain;
|
package/src/index.d.ts
CHANGED
package/src/index.js
CHANGED
|
@@ -10,7 +10,6 @@ export { addHexPrefix, bufferToHex, utf8ToHex } from './utils/encoding.js';
|
|
|
10
10
|
export { getWalletConnectorByKey } from './utils/getWalletConnectorByKey.js';
|
|
11
11
|
export { shouldLowercaseAddress } from './utils/shouldLowercaseAddress.js';
|
|
12
12
|
export { normalizeWalletName } from './utils/normalizeWalletName/normalizeWalletName.js';
|
|
13
|
-
export { PhantomLedgerWalletName } from './utils/PhantomLedgerWalletName.js';
|
|
14
13
|
export { getDeepLink } from './utils/walletConnectDeepLinks/walletConnectDeepLinks.js';
|
|
15
14
|
export { performPlatformSpecificConnectionMethod } from './utils/walletConnectDeepLinks/performPlatformSpecificConnectionMethod.js';
|
|
16
15
|
export { isEmbeddedConnector } from './utils/isEmbeddedConnector/isEmbeddedConnector.js';
|
|
@@ -19,3 +18,9 @@ export { isBloctoConnector } from './utils/isBloctoConnector/isBloctoConnector.j
|
|
|
19
18
|
export { isPasskeyWalletConnector } from './utils/isPasskeyWalletConnector/isPasskeyWalletConnector.js';
|
|
20
19
|
export { isSmartWalletConnector } from './utils/isSmartWalletConnector/isSmartWalletConnector.js';
|
|
21
20
|
export { isAccountAbstractionConnector } from './utils/isAccountAbstractionConnector/isAccountAbstractionConnector.js';
|
|
21
|
+
export { isBitcoinConnector } from './utils/isBitcoinConnector/isBitcoinConnector.js';
|
|
22
|
+
export { isHardwareWalletConnector } from './utils/isHardwareWalletConnector/isHardwareWalletConnector.js';
|
|
23
|
+
export { eventListenerHandlers } from './utils/eventListenerHandlers.js';
|
|
24
|
+
export { isHex } from './utils/isHex/isHex.js';
|
|
25
|
+
export { isPhantomRedirectConnector } from './utils/isPhantomRedirectConnector/isPhantomRedirectConnector.js';
|
|
26
|
+
export { getRpcUrlForChain } from './utils/getRpcUrlForChain/getRpcUrlForChain.js';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { WalletConnectorBase } from '.';
|
|
2
|
+
type BitcoinTransaction = {
|
|
3
|
+
amount: bigint;
|
|
4
|
+
recipientAddress: string;
|
|
5
|
+
};
|
|
6
|
+
export type BitcoinSignPsbtRequest = {
|
|
7
|
+
allowedSighash: number[];
|
|
8
|
+
unsignedPsbtBase64: string;
|
|
9
|
+
signature?: BitcoinSignPsbtRequestSignature[];
|
|
10
|
+
};
|
|
11
|
+
export type BitcoinSignPsbtRequestSignature = {
|
|
12
|
+
address: string;
|
|
13
|
+
signingIndexes: number[] | undefined;
|
|
14
|
+
disableAddressValidation?: boolean;
|
|
15
|
+
};
|
|
16
|
+
export type BitcoinSignPsbtResponse = {
|
|
17
|
+
signedPsbt: string;
|
|
18
|
+
};
|
|
19
|
+
export interface IBitcoinWalletConnector extends WalletConnectorBase {
|
|
20
|
+
sendBitcoin(transaction: BitcoinTransaction): Promise<string | undefined>;
|
|
21
|
+
sendRawTransaction(transactionHex: string): Promise<string | undefined>;
|
|
22
|
+
signPsbt(request: BitcoinSignPsbtRequest): Promise<BitcoinSignPsbtResponse | undefined>;
|
|
23
|
+
}
|
|
24
|
+
export {};
|
|
@@ -12,17 +12,21 @@ export interface WebAuthnAttestation {
|
|
|
12
12
|
export type RecoveryWebAuthnAttestation = WebAuthnAttestation & {
|
|
13
13
|
organizationId: string;
|
|
14
14
|
};
|
|
15
|
+
export type AuthenticatorType = 'passkey' | 'email';
|
|
15
16
|
export interface IPasskeyWalletConnector extends WalletConnectorBase {
|
|
16
17
|
getWebAuthnAttestation(): Promise<WebAuthnAttestation>;
|
|
17
|
-
|
|
18
|
+
getAuthenticatorHandler: () => AuthenticatorRecoveryHandler;
|
|
18
19
|
getExportHandler: () => ExportHandler;
|
|
19
20
|
}
|
|
20
|
-
export interface
|
|
21
|
-
initRecovery: (iframeContainer: HTMLElement, iframeElementId: string) => Promise<string | null>;
|
|
21
|
+
export interface AuthenticatorRecoveryHandler {
|
|
22
|
+
initRecovery: (authType: AuthenticatorType, iframeContainer: HTMLElement, iframeElementId: string, sessionExpiration?: number) => Promise<string | null>;
|
|
22
23
|
verifyRecoveryCode: (recoveryBundle: string, organizationId?: string) => Promise<unknown>;
|
|
23
24
|
completeRecovery: (recoveryParams: RecoveryWebAuthnAttestation) => Promise<unknown>;
|
|
25
|
+
addPasskeyAuthenticator: (passkeyAuthenticatorParams: RecoveryWebAuthnAttestation) => Promise<unknown>;
|
|
24
26
|
clear: () => void;
|
|
27
|
+
isSessionActive: () => boolean;
|
|
25
28
|
get publicKey(): string | undefined | null;
|
|
29
|
+
get recoveryType(): AuthenticatorType | undefined | null;
|
|
26
30
|
set recoveryUserId(recoveryUserId: string);
|
|
27
31
|
}
|
|
28
32
|
export interface ExportHandler {
|
|
@@ -180,6 +180,22 @@ class WalletConnectorBase extends EventEmitter__default["default"] {
|
|
|
180
180
|
fetchPublicAddress(opts) {
|
|
181
181
|
return Promise.resolve(undefined);
|
|
182
182
|
}
|
|
183
|
+
/**
|
|
184
|
+
* Gets the additional addresses of the wallet, given the main address
|
|
185
|
+
*
|
|
186
|
+
* @default Promise<[]>
|
|
187
|
+
*/
|
|
188
|
+
getAdditionalAddresses(mainAddress) {
|
|
189
|
+
return Promise.resolve([]);
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Sets the additional addresses of the wallet, given the main address
|
|
193
|
+
*
|
|
194
|
+
* @default Promise<void>
|
|
195
|
+
*/
|
|
196
|
+
setAdditionalAddresses(mainAddress, additionalAddresses) {
|
|
197
|
+
return Promise.resolve();
|
|
198
|
+
}
|
|
183
199
|
/**
|
|
184
200
|
* Gets the balance of the wallet
|
|
185
201
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import EventEmitter from 'eventemitter3';
|
|
2
2
|
import { ChainRpcProviders } from '@dynamic-labs/rpc-providers';
|
|
3
3
|
import { WalletBookSchema } from '@dynamic-labs/wallet-book';
|
|
4
|
-
import type { JwtVerifiedCredential } from '@dynamic-labs/sdk-api';
|
|
4
|
+
import type { JwtVerifiedCredential, WalletAdditionalAddress } from '@dynamic-labs/sdk-api';
|
|
5
5
|
import { WalletBookSingleton } from './WalletBookSingleton';
|
|
6
6
|
import { WalletConnectorExtension } from './WalletConnectorExtension';
|
|
7
7
|
import { WalletConnectorCore } from './types';
|
|
@@ -120,6 +120,18 @@ export declare abstract class WalletConnectorBase extends EventEmitter<WalletCon
|
|
|
120
120
|
* @default Promise<undefined>
|
|
121
121
|
*/
|
|
122
122
|
fetchPublicAddress(opts?: FetchPublicAddressOpts): Promise<string | undefined>;
|
|
123
|
+
/**
|
|
124
|
+
* Gets the additional addresses of the wallet, given the main address
|
|
125
|
+
*
|
|
126
|
+
* @default Promise<[]>
|
|
127
|
+
*/
|
|
128
|
+
getAdditionalAddresses(mainAddress?: string): Promise<WalletAdditionalAddress[]>;
|
|
129
|
+
/**
|
|
130
|
+
* Sets the additional addresses of the wallet, given the main address
|
|
131
|
+
*
|
|
132
|
+
* @default Promise<void>
|
|
133
|
+
*/
|
|
134
|
+
setAdditionalAddresses(mainAddress: string, additionalAddresses: WalletAdditionalAddress[]): Promise<void>;
|
|
123
135
|
/**
|
|
124
136
|
* Gets the balance of the wallet
|
|
125
137
|
*
|
|
@@ -172,6 +172,22 @@ class WalletConnectorBase extends EventEmitter {
|
|
|
172
172
|
fetchPublicAddress(opts) {
|
|
173
173
|
return Promise.resolve(undefined);
|
|
174
174
|
}
|
|
175
|
+
/**
|
|
176
|
+
* Gets the additional addresses of the wallet, given the main address
|
|
177
|
+
*
|
|
178
|
+
* @default Promise<[]>
|
|
179
|
+
*/
|
|
180
|
+
getAdditionalAddresses(mainAddress) {
|
|
181
|
+
return Promise.resolve([]);
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Sets the additional addresses of the wallet, given the main address
|
|
185
|
+
*
|
|
186
|
+
* @default Promise<void>
|
|
187
|
+
*/
|
|
188
|
+
setAdditionalAddresses(mainAddress, additionalAddresses) {
|
|
189
|
+
return Promise.resolve();
|
|
190
|
+
}
|
|
175
191
|
/**
|
|
176
192
|
* Gets the balance of the wallet
|
|
177
193
|
*
|
package/src/lib/index.d.ts
CHANGED
|
@@ -5,3 +5,6 @@ export * from './types';
|
|
|
5
5
|
export * from './IPasskeyWalletConnector';
|
|
6
6
|
export * from './SmartWalletConnector';
|
|
7
7
|
export * from './IAccountAbstractionWalletConnector';
|
|
8
|
+
export * from './IBitcoinWalletConnector';
|
|
9
|
+
export * from './IHardwareWalletConnector';
|
|
10
|
+
export * from './IPhantomRedirectConnector';
|
package/src/types.d.ts
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _tslib = require('../../_virtual/_tslib.cjs');
|
|
6
|
+
var isHex = require('./isHex/isHex.cjs');
|
|
7
|
+
|
|
8
|
+
const eventListenerHandlers = (walletConnector) => {
|
|
9
|
+
const handleAccountChange = (accounts) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
10
|
+
if (accounts.length === 0) {
|
|
11
|
+
walletConnector.emit('disconnect');
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
walletConnector.emit('accountChange', { accounts });
|
|
15
|
+
});
|
|
16
|
+
const handleChainChange = (chain) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
17
|
+
const chainStr = isHex.isHex(chain)
|
|
18
|
+
? parseInt(chain, 16).toString()
|
|
19
|
+
: chain.toString();
|
|
20
|
+
walletConnector.emit('chainChange', {
|
|
21
|
+
chain: chainStr,
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
const handleDisconnect = (error) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
25
|
+
if ((error === null || error === void 0 ? void 0 : error.code) === 1013) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
walletConnector.emit('disconnect');
|
|
29
|
+
});
|
|
30
|
+
return {
|
|
31
|
+
handleAccountChange,
|
|
32
|
+
handleChainChange,
|
|
33
|
+
handleDisconnect,
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
exports.eventListenerHandlers = eventListenerHandlers;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { WalletConnector } from '../lib';
|
|
2
|
+
import { AccountChangeEventHandler, ChainChangeEventHandler, DisconnectEventHandler } from '../types';
|
|
3
|
+
export declare const eventListenerHandlers: (walletConnector: WalletConnector) => {
|
|
4
|
+
handleAccountChange: AccountChangeEventHandler;
|
|
5
|
+
handleChainChange: ChainChangeEventHandler;
|
|
6
|
+
handleDisconnect: DisconnectEventHandler;
|
|
7
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { __awaiter } from '../../_virtual/_tslib.js';
|
|
2
|
+
import { isHex } from './isHex/isHex.js';
|
|
3
|
+
|
|
4
|
+
const eventListenerHandlers = (walletConnector) => {
|
|
5
|
+
const handleAccountChange = (accounts) => __awaiter(void 0, void 0, void 0, function* () {
|
|
6
|
+
if (accounts.length === 0) {
|
|
7
|
+
walletConnector.emit('disconnect');
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
walletConnector.emit('accountChange', { accounts });
|
|
11
|
+
});
|
|
12
|
+
const handleChainChange = (chain) => __awaiter(void 0, void 0, void 0, function* () {
|
|
13
|
+
const chainStr = isHex(chain)
|
|
14
|
+
? parseInt(chain, 16).toString()
|
|
15
|
+
: chain.toString();
|
|
16
|
+
walletConnector.emit('chainChange', {
|
|
17
|
+
chain: chainStr,
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
const handleDisconnect = (error) => __awaiter(void 0, void 0, void 0, function* () {
|
|
21
|
+
if ((error === null || error === void 0 ? void 0 : error.code) === 1013) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
walletConnector.emit('disconnect');
|
|
25
|
+
});
|
|
26
|
+
return {
|
|
27
|
+
handleAccountChange,
|
|
28
|
+
handleChainChange,
|
|
29
|
+
handleDisconnect,
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export { eventListenerHandlers };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const getRpcUrlForChain = ({ networks, chainId, }) => {
|
|
6
|
+
var _a;
|
|
7
|
+
const network = networks.find((network) => network.chainId === chainId);
|
|
8
|
+
if (!network) {
|
|
9
|
+
return undefined;
|
|
10
|
+
}
|
|
11
|
+
return ((_a = network.privateCustomerRpcUrls) === null || _a === void 0 ? void 0 : _a[0]) || network.rpcUrls[0];
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
exports.getRpcUrlForChain = getRpcUrlForChain;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
const getRpcUrlForChain = ({ networks, chainId, }) => {
|
|
2
|
+
var _a;
|
|
3
|
+
const network = networks.find((network) => network.chainId === chainId);
|
|
4
|
+
if (!network) {
|
|
5
|
+
return undefined;
|
|
6
|
+
}
|
|
7
|
+
return ((_a = network.privateCustomerRpcUrls) === null || _a === void 0 ? void 0 : _a[0]) || network.rpcUrls[0];
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export { getRpcUrlForChain };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { getRpcUrlForChain } from './getRpcUrlForChain';
|
package/src/utils/index.d.ts
CHANGED
|
@@ -9,7 +9,6 @@ export * from './encoding';
|
|
|
9
9
|
export * from './getWalletConnectorByKey';
|
|
10
10
|
export * from './shouldLowercaseAddress';
|
|
11
11
|
export * from './normalizeWalletName';
|
|
12
|
-
export * from './PhantomLedgerWalletName';
|
|
13
12
|
export * from './walletConnectDeepLinks';
|
|
14
13
|
export * from './isEmbeddedConnector';
|
|
15
14
|
export * from './isMagicConnector';
|
|
@@ -17,3 +16,9 @@ export * from './isBloctoConnector';
|
|
|
17
16
|
export * from './isPasskeyWalletConnector';
|
|
18
17
|
export * from './isSmartWalletConnector';
|
|
19
18
|
export * from './isAccountAbstractionConnector';
|
|
19
|
+
export * from './isBitcoinConnector';
|
|
20
|
+
export * from './isHardwareWalletConnector';
|
|
21
|
+
export * from './eventListenerHandlers';
|
|
22
|
+
export * from './isHex';
|
|
23
|
+
export * from './isPhantomRedirectConnector';
|
|
24
|
+
export * from './getRpcUrlForChain';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { isBitcoinConnector } from './isBitcoinConnector';
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const isEmailWalletConnector = (walletConnector) => Boolean(walletConnector.
|
|
5
|
+
const isEmailWalletConnector = (walletConnector) => Boolean(walletConnector.clearEmail);
|
|
6
6
|
|
|
7
7
|
exports.isEmailWalletConnector = isEmailWalletConnector;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { isHardwareWalletConnector } from './isHardwareWalletConnector';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { isHex } from './isHex';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const isHex = (value) => {
|
|
6
|
+
if (!value)
|
|
7
|
+
return false;
|
|
8
|
+
if (typeof value !== 'string')
|
|
9
|
+
return false;
|
|
10
|
+
return /^0x[0-9a-fA-F]*$/.test(value);
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
exports.isHex = isHex;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const isHex: (value: unknown) => value is `0x${string}`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './isPhantomRedirectConnector';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const isPhantomRedirectConnector = (connector) => connector.key === 'phantom' &&
|
|
6
|
+
connector.extractSignature !== undefined;
|
|
7
|
+
|
|
8
|
+
exports.isPhantomRedirectConnector = isPhantomRedirectConnector;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* I'm exporting the walletName to use it for DYN-1447. As we only need the wallet name,
|
|
7
|
-
* exporting it in this way, we avoid to instantiate the whole PhantomLedger class every time.
|
|
8
|
-
*/
|
|
9
|
-
const PhantomLedgerWalletName = 'Phantom Ledger';
|
|
10
|
-
|
|
11
|
-
exports.PhantomLedgerWalletName = PhantomLedgerWalletName;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* I'm exporting the walletName to use it for DYN-1447. As we only need the wallet name,
|
|
3
|
-
* exporting it in this way, we avoid to instantiate the whole PhantomLedger class every time.
|
|
4
|
-
*/
|
|
5
|
-
const PhantomLedgerWalletName = 'Phantom Ledger';
|
|
6
|
-
|
|
7
|
-
export { PhantomLedgerWalletName };
|