@reown/appkit-react-native 2.0.0-alpha.2 → 2.0.0-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (493) hide show
  1. package/lib/commonjs/AppKit.js +64 -66
  2. package/lib/commonjs/AppKit.js.map +1 -1
  3. package/lib/commonjs/AppKitContext.js +4 -5
  4. package/lib/commonjs/AppKitContext.js.map +1 -1
  5. package/lib/commonjs/connectors/WalletConnectConnector.js +15 -3
  6. package/lib/commonjs/connectors/WalletConnectConnector.js.map +1 -1
  7. package/lib/commonjs/hooks/useAppKitEvents.js.map +1 -1
  8. package/lib/commonjs/hooks/useProvider.js +29 -10
  9. package/lib/commonjs/hooks/useProvider.js.map +1 -1
  10. package/lib/commonjs/hooks/useRouteTransition.js +83 -0
  11. package/lib/commonjs/hooks/useRouteTransition.js.map +1 -0
  12. package/lib/commonjs/index.js.map +1 -1
  13. package/lib/commonjs/modal/w3m-account-button/index.js +1 -1
  14. package/lib/commonjs/modal/w3m-account-button/index.js.map +1 -1
  15. package/lib/commonjs/modal/w3m-modal/index.js +11 -32
  16. package/lib/commonjs/modal/w3m-modal/index.js.map +1 -1
  17. package/lib/commonjs/modal/w3m-modal/styles.js +0 -4
  18. package/lib/commonjs/modal/w3m-modal/styles.js.map +1 -1
  19. package/lib/commonjs/modal/w3m-network-button/index.js +1 -1
  20. package/lib/commonjs/modal/w3m-network-button/index.js.map +1 -1
  21. package/lib/commonjs/modal/w3m-router/index.js +16 -1
  22. package/lib/commonjs/modal/w3m-router/index.js.map +1 -1
  23. package/lib/commonjs/partials/w3m-account-activity/index.js +8 -8
  24. package/lib/commonjs/partials/w3m-account-activity/index.js.map +1 -1
  25. package/lib/commonjs/partials/w3m-account-tokens/index.js +5 -5
  26. package/lib/commonjs/partials/w3m-account-tokens/index.js.map +1 -1
  27. package/lib/commonjs/partials/w3m-account-wallet-features/index.js +5 -5
  28. package/lib/commonjs/partials/w3m-account-wallet-features/index.js.map +1 -1
  29. package/lib/commonjs/partials/w3m-all-wallets-search/index.js.map +1 -1
  30. package/lib/commonjs/partials/w3m-connecting-body/index.js +2 -2
  31. package/lib/commonjs/partials/w3m-connecting-body/index.js.map +1 -1
  32. package/lib/commonjs/partials/w3m-connecting-mobile/index.js +12 -13
  33. package/lib/commonjs/partials/w3m-connecting-mobile/index.js.map +1 -1
  34. package/lib/commonjs/partials/w3m-connecting-qrcode/index.js +27 -12
  35. package/lib/commonjs/partials/w3m-connecting-qrcode/index.js.map +1 -1
  36. package/lib/commonjs/partials/w3m-connecting-web/index.js +10 -11
  37. package/lib/commonjs/partials/w3m-connecting-web/index.js.map +1 -1
  38. package/lib/commonjs/partials/w3m-header/index.js +7 -15
  39. package/lib/commonjs/partials/w3m-header/index.js.map +1 -1
  40. package/lib/commonjs/partials/w3m-information-modal/index.js +34 -32
  41. package/lib/commonjs/partials/w3m-information-modal/index.js.map +1 -1
  42. package/lib/commonjs/partials/w3m-information-modal/styles.js +6 -4
  43. package/lib/commonjs/partials/w3m-information-modal/styles.js.map +1 -1
  44. package/lib/commonjs/partials/w3m-placeholder/index.js +5 -5
  45. package/lib/commonjs/partials/w3m-placeholder/index.js.map +1 -1
  46. package/lib/commonjs/partials/w3m-selector-modal/index.js +65 -67
  47. package/lib/commonjs/partials/w3m-selector-modal/index.js.map +1 -1
  48. package/lib/commonjs/partials/w3m-selector-modal/styles.js +1 -0
  49. package/lib/commonjs/partials/w3m-selector-modal/styles.js.map +1 -1
  50. package/lib/commonjs/partials/w3m-send-input-token/index.js +2 -2
  51. package/lib/commonjs/partials/w3m-send-input-token/index.js.map +1 -1
  52. package/lib/commonjs/partials/w3m-swap-input/index.js +2 -2
  53. package/lib/commonjs/partials/w3m-swap-input/index.js.map +1 -1
  54. package/lib/commonjs/types.js +6 -0
  55. package/lib/commonjs/types.js.map +1 -0
  56. package/lib/commonjs/utils/HelpersUtil.js.map +1 -1
  57. package/lib/commonjs/utils/RouterUtil.js +52 -0
  58. package/lib/commonjs/utils/RouterUtil.js.map +1 -0
  59. package/lib/commonjs/utils/UiUtil.js +10 -19
  60. package/lib/commonjs/utils/UiUtil.js.map +1 -1
  61. package/lib/commonjs/views/w3m-account-default-view/components/auth-buttons.js +2 -2
  62. package/lib/commonjs/views/w3m-account-default-view/components/auth-buttons.js.map +1 -1
  63. package/lib/commonjs/views/w3m-account-default-view/index.js +17 -17
  64. package/lib/commonjs/views/w3m-account-default-view/index.js.map +1 -1
  65. package/lib/commonjs/views/w3m-account-view/index.js +1 -1
  66. package/lib/commonjs/views/w3m-account-view/index.js.map +1 -1
  67. package/lib/commonjs/views/w3m-all-wallets-view/index.js +4 -4
  68. package/lib/commonjs/views/w3m-all-wallets-view/index.js.map +1 -1
  69. package/lib/commonjs/views/w3m-connect-view/components/all-wallet-list.js +1 -1
  70. package/lib/commonjs/views/w3m-connect-view/components/all-wallet-list.js.map +1 -1
  71. package/lib/commonjs/views/w3m-connect-view/components/custom-wallet-list.js +1 -1
  72. package/lib/commonjs/views/w3m-connect-view/components/custom-wallet-list.js.map +1 -1
  73. package/lib/commonjs/views/w3m-connect-view/components/recent-wallet-list.js +1 -1
  74. package/lib/commonjs/views/w3m-connect-view/components/recent-wallet-list.js.map +1 -1
  75. package/lib/commonjs/views/w3m-connect-view/components/social-login-list.js +4 -4
  76. package/lib/commonjs/views/w3m-connect-view/components/social-login-list.js.map +1 -1
  77. package/lib/commonjs/views/w3m-connect-view/index.js +8 -8
  78. package/lib/commonjs/views/w3m-connect-view/index.js.map +1 -1
  79. package/lib/commonjs/views/w3m-connecting-external-view/index.js +7 -8
  80. package/lib/commonjs/views/w3m-connecting-external-view/index.js.map +1 -1
  81. package/lib/commonjs/views/w3m-connecting-siwe-view/index.js +6 -11
  82. package/lib/commonjs/views/w3m-connecting-siwe-view/index.js.map +1 -1
  83. package/lib/commonjs/views/w3m-connecting-social-view/index.js +8 -10
  84. package/lib/commonjs/views/w3m-connecting-social-view/index.js.map +1 -1
  85. package/lib/commonjs/views/w3m-connecting-view/index.js +7 -7
  86. package/lib/commonjs/views/w3m-connecting-view/index.js.map +1 -1
  87. package/lib/commonjs/views/w3m-get-wallet-view/index.js.map +1 -1
  88. package/lib/commonjs/views/w3m-network-switch-view/index.js +6 -5
  89. package/lib/commonjs/views/w3m-network-switch-view/index.js.map +1 -1
  90. package/lib/commonjs/views/w3m-networks-view/index.js +5 -8
  91. package/lib/commonjs/views/w3m-networks-view/index.js.map +1 -1
  92. package/lib/commonjs/views/w3m-onramp-checkout-view/index.js +16 -16
  93. package/lib/commonjs/views/w3m-onramp-checkout-view/index.js.map +1 -1
  94. package/lib/commonjs/views/w3m-onramp-settings-view/components/Country.js +4 -4
  95. package/lib/commonjs/views/w3m-onramp-settings-view/components/Country.js.map +1 -1
  96. package/lib/commonjs/views/w3m-onramp-settings-view/index.js +4 -4
  97. package/lib/commonjs/views/w3m-onramp-settings-view/index.js.map +1 -1
  98. package/lib/commonjs/views/w3m-onramp-settings-view/utils.js.map +1 -1
  99. package/lib/commonjs/views/w3m-onramp-transaction-view/index.js +5 -5
  100. package/lib/commonjs/views/w3m-onramp-transaction-view/index.js.map +1 -1
  101. package/lib/commonjs/views/w3m-onramp-view/components/Currency.js +2 -2
  102. package/lib/commonjs/views/w3m-onramp-view/components/Currency.js.map +1 -1
  103. package/lib/commonjs/views/w3m-onramp-view/components/CurrencyInput.js +2 -2
  104. package/lib/commonjs/views/w3m-onramp-view/components/CurrencyInput.js.map +1 -1
  105. package/lib/commonjs/views/w3m-onramp-view/components/Header.js +5 -6
  106. package/lib/commonjs/views/w3m-onramp-view/components/Header.js.map +1 -1
  107. package/lib/commonjs/views/w3m-onramp-view/components/PaymentButton.js +4 -4
  108. package/lib/commonjs/views/w3m-onramp-view/components/PaymentButton.js.map +1 -1
  109. package/lib/commonjs/views/w3m-onramp-view/components/PaymentMethod.js +2 -2
  110. package/lib/commonjs/views/w3m-onramp-view/components/PaymentMethod.js.map +1 -1
  111. package/lib/commonjs/views/w3m-onramp-view/components/Quote.js +4 -4
  112. package/lib/commonjs/views/w3m-onramp-view/components/Quote.js.map +1 -1
  113. package/lib/commonjs/views/w3m-onramp-view/components/SelectPaymentModal.js +68 -70
  114. package/lib/commonjs/views/w3m-onramp-view/components/SelectPaymentModal.js.map +1 -1
  115. package/lib/commonjs/views/w3m-onramp-view/index.js +1 -1
  116. package/lib/commonjs/views/w3m-onramp-view/index.js.map +1 -1
  117. package/lib/commonjs/views/w3m-swap-preview-view/index.js +1 -14
  118. package/lib/commonjs/views/w3m-swap-preview-view/index.js.map +1 -1
  119. package/lib/commonjs/views/w3m-swap-preview-view/styles.js +3 -0
  120. package/lib/commonjs/views/w3m-swap-preview-view/styles.js.map +1 -1
  121. package/lib/commonjs/views/w3m-swap-view/components/select-token-view/index.js +4 -3
  122. package/lib/commonjs/views/w3m-swap-view/components/select-token-view/index.js.map +1 -1
  123. package/lib/commonjs/views/w3m-swap-view/components/select-token-view/styles.js +1 -2
  124. package/lib/commonjs/views/w3m-swap-view/components/select-token-view/styles.js.map +1 -1
  125. package/lib/commonjs/views/w3m-swap-view/components/select-token-view/utils.js.map +1 -1
  126. package/lib/commonjs/views/w3m-swap-view/index.js +13 -23
  127. package/lib/commonjs/views/w3m-swap-view/index.js.map +1 -1
  128. package/lib/commonjs/views/w3m-swap-view/styles.js +5 -1
  129. package/lib/commonjs/views/w3m-swap-view/styles.js.map +1 -1
  130. package/lib/commonjs/views/w3m-unsupported-chain-view/index.js +2 -4
  131. package/lib/commonjs/views/w3m-unsupported-chain-view/index.js.map +1 -1
  132. package/lib/commonjs/views/w3m-wallet-compatible-networks-view/index.js +2 -1
  133. package/lib/commonjs/views/w3m-wallet-compatible-networks-view/index.js.map +1 -1
  134. package/lib/commonjs/views/w3m-wallet-receive-view/index.js +2 -2
  135. package/lib/commonjs/views/w3m-wallet-receive-view/index.js.map +1 -1
  136. package/lib/commonjs/views/w3m-wallet-send-preview-view/components/preview-send-details.js +1 -1
  137. package/lib/commonjs/views/w3m-wallet-send-preview-view/components/preview-send-details.js.map +1 -1
  138. package/lib/commonjs/views/w3m-wallet-send-select-token-view/index.js +1 -1
  139. package/lib/commonjs/views/w3m-wallet-send-select-token-view/index.js.map +1 -1
  140. package/lib/commonjs/views/w3m-wallet-send-view/index.js +4 -12
  141. package/lib/commonjs/views/w3m-wallet-send-view/index.js.map +1 -1
  142. package/lib/commonjs/views/w3m-wallet-send-view/styles.js +3 -0
  143. package/lib/commonjs/views/w3m-wallet-send-view/styles.js.map +1 -1
  144. package/lib/module/AppKit.js +65 -67
  145. package/lib/module/AppKit.js.map +1 -1
  146. package/lib/module/AppKitContext.js +2 -3
  147. package/lib/module/AppKitContext.js.map +1 -1
  148. package/lib/module/connectors/WalletConnectConnector.js +16 -4
  149. package/lib/module/connectors/WalletConnectConnector.js.map +1 -1
  150. package/lib/module/hooks/useAppKitEvents.js.map +1 -1
  151. package/lib/module/hooks/useProvider.js +30 -10
  152. package/lib/module/hooks/useProvider.js.map +1 -1
  153. package/lib/module/hooks/useRouteTransition.js +79 -0
  154. package/lib/module/hooks/useRouteTransition.js.map +1 -0
  155. package/lib/module/index.js.map +1 -1
  156. package/lib/module/modal/w3m-account-button/index.js +2 -2
  157. package/lib/module/modal/w3m-account-button/index.js.map +1 -1
  158. package/lib/module/modal/w3m-modal/index.js +12 -33
  159. package/lib/module/modal/w3m-modal/index.js.map +1 -1
  160. package/lib/module/modal/w3m-modal/styles.js +0 -4
  161. package/lib/module/modal/w3m-modal/styles.js.map +1 -1
  162. package/lib/module/modal/w3m-network-button/index.js +2 -2
  163. package/lib/module/modal/w3m-network-button/index.js.map +1 -1
  164. package/lib/module/modal/w3m-router/index.js +17 -2
  165. package/lib/module/modal/w3m-router/index.js.map +1 -1
  166. package/lib/module/partials/w3m-account-activity/index.js +9 -9
  167. package/lib/module/partials/w3m-account-activity/index.js.map +1 -1
  168. package/lib/module/partials/w3m-account-tokens/index.js +6 -6
  169. package/lib/module/partials/w3m-account-tokens/index.js.map +1 -1
  170. package/lib/module/partials/w3m-account-wallet-features/index.js +5 -5
  171. package/lib/module/partials/w3m-account-wallet-features/index.js.map +1 -1
  172. package/lib/module/partials/w3m-all-wallets-list/index.js.map +1 -1
  173. package/lib/module/partials/w3m-all-wallets-search/index.js.map +1 -1
  174. package/lib/module/partials/w3m-connecting-body/index.js +2 -2
  175. package/lib/module/partials/w3m-connecting-body/index.js.map +1 -1
  176. package/lib/module/partials/w3m-connecting-mobile/index.js +13 -14
  177. package/lib/module/partials/w3m-connecting-mobile/index.js.map +1 -1
  178. package/lib/module/partials/w3m-connecting-qrcode/index.js +28 -13
  179. package/lib/module/partials/w3m-connecting-qrcode/index.js.map +1 -1
  180. package/lib/module/partials/w3m-connecting-web/index.js +11 -12
  181. package/lib/module/partials/w3m-connecting-web/index.js.map +1 -1
  182. package/lib/module/partials/w3m-header/index.js +8 -16
  183. package/lib/module/partials/w3m-header/index.js.map +1 -1
  184. package/lib/module/partials/w3m-information-modal/index.js +33 -31
  185. package/lib/module/partials/w3m-information-modal/index.js.map +1 -1
  186. package/lib/module/partials/w3m-information-modal/styles.js +7 -5
  187. package/lib/module/partials/w3m-information-modal/styles.js.map +1 -1
  188. package/lib/module/partials/w3m-placeholder/index.js +5 -5
  189. package/lib/module/partials/w3m-placeholder/index.js.map +1 -1
  190. package/lib/module/partials/w3m-selector-modal/index.js +66 -68
  191. package/lib/module/partials/w3m-selector-modal/index.js.map +1 -1
  192. package/lib/module/partials/w3m-selector-modal/styles.js +1 -0
  193. package/lib/module/partials/w3m-selector-modal/styles.js.map +1 -1
  194. package/lib/module/partials/w3m-send-input-token/index.js +2 -2
  195. package/lib/module/partials/w3m-send-input-token/index.js.map +1 -1
  196. package/lib/module/partials/w3m-swap-input/index.js +2 -2
  197. package/lib/module/partials/w3m-swap-input/index.js.map +1 -1
  198. package/lib/module/types.js +4 -0
  199. package/lib/module/types.js.map +1 -0
  200. package/lib/module/utils/HelpersUtil.js.map +1 -1
  201. package/lib/module/utils/NetworkUtil.js.map +1 -1
  202. package/lib/module/utils/RouterUtil.js +48 -0
  203. package/lib/module/utils/RouterUtil.js.map +1 -0
  204. package/lib/module/utils/UiUtil.js +12 -20
  205. package/lib/module/utils/UiUtil.js.map +1 -1
  206. package/lib/module/views/w3m-account-default-view/components/auth-buttons.js +2 -2
  207. package/lib/module/views/w3m-account-default-view/components/auth-buttons.js.map +1 -1
  208. package/lib/module/views/w3m-account-default-view/index.js +19 -19
  209. package/lib/module/views/w3m-account-default-view/index.js.map +1 -1
  210. package/lib/module/views/w3m-account-view/index.js +2 -2
  211. package/lib/module/views/w3m-account-view/index.js.map +1 -1
  212. package/lib/module/views/w3m-all-wallets-view/index.js +5 -5
  213. package/lib/module/views/w3m-all-wallets-view/index.js.map +1 -1
  214. package/lib/module/views/w3m-connect-view/components/all-wallet-list.js +2 -2
  215. package/lib/module/views/w3m-connect-view/components/all-wallet-list.js.map +1 -1
  216. package/lib/module/views/w3m-connect-view/components/custom-wallet-list.js +2 -2
  217. package/lib/module/views/w3m-connect-view/components/custom-wallet-list.js.map +1 -1
  218. package/lib/module/views/w3m-connect-view/components/recent-wallet-list.js +2 -2
  219. package/lib/module/views/w3m-connect-view/components/recent-wallet-list.js.map +1 -1
  220. package/lib/module/views/w3m-connect-view/components/social-login-list.js +4 -4
  221. package/lib/module/views/w3m-connect-view/components/social-login-list.js.map +1 -1
  222. package/lib/module/views/w3m-connect-view/index.js +8 -8
  223. package/lib/module/views/w3m-connect-view/index.js.map +1 -1
  224. package/lib/module/views/w3m-connecting-external-view/index.js +9 -10
  225. package/lib/module/views/w3m-connecting-external-view/index.js.map +1 -1
  226. package/lib/module/views/w3m-connecting-siwe-view/index.js +8 -13
  227. package/lib/module/views/w3m-connecting-siwe-view/index.js.map +1 -1
  228. package/lib/module/views/w3m-connecting-social-view/index.js +10 -12
  229. package/lib/module/views/w3m-connecting-social-view/index.js.map +1 -1
  230. package/lib/module/views/w3m-connecting-view/index.js +9 -9
  231. package/lib/module/views/w3m-connecting-view/index.js.map +1 -1
  232. package/lib/module/views/w3m-get-wallet-view/index.js.map +1 -1
  233. package/lib/module/views/w3m-network-switch-view/index.js +9 -7
  234. package/lib/module/views/w3m-network-switch-view/index.js.map +1 -1
  235. package/lib/module/views/w3m-networks-view/index.js +7 -10
  236. package/lib/module/views/w3m-networks-view/index.js.map +1 -1
  237. package/lib/module/views/w3m-onramp-checkout-view/index.js +17 -17
  238. package/lib/module/views/w3m-onramp-checkout-view/index.js.map +1 -1
  239. package/lib/module/views/w3m-onramp-settings-view/components/Country.js +4 -4
  240. package/lib/module/views/w3m-onramp-settings-view/components/Country.js.map +1 -1
  241. package/lib/module/views/w3m-onramp-settings-view/index.js +4 -4
  242. package/lib/module/views/w3m-onramp-settings-view/index.js.map +1 -1
  243. package/lib/module/views/w3m-onramp-settings-view/utils.js.map +1 -1
  244. package/lib/module/views/w3m-onramp-transaction-view/index.js +5 -5
  245. package/lib/module/views/w3m-onramp-transaction-view/index.js.map +1 -1
  246. package/lib/module/views/w3m-onramp-view/components/Currency.js +2 -2
  247. package/lib/module/views/w3m-onramp-view/components/Currency.js.map +1 -1
  248. package/lib/module/views/w3m-onramp-view/components/CurrencyInput.js +2 -2
  249. package/lib/module/views/w3m-onramp-view/components/CurrencyInput.js.map +1 -1
  250. package/lib/module/views/w3m-onramp-view/components/Header.js +5 -6
  251. package/lib/module/views/w3m-onramp-view/components/Header.js.map +1 -1
  252. package/lib/module/views/w3m-onramp-view/components/PaymentButton.js +4 -4
  253. package/lib/module/views/w3m-onramp-view/components/PaymentButton.js.map +1 -1
  254. package/lib/module/views/w3m-onramp-view/components/PaymentMethod.js +2 -2
  255. package/lib/module/views/w3m-onramp-view/components/PaymentMethod.js.map +1 -1
  256. package/lib/module/views/w3m-onramp-view/components/Quote.js +4 -4
  257. package/lib/module/views/w3m-onramp-view/components/Quote.js.map +1 -1
  258. package/lib/module/views/w3m-onramp-view/components/SelectPaymentModal.js +68 -69
  259. package/lib/module/views/w3m-onramp-view/components/SelectPaymentModal.js.map +1 -1
  260. package/lib/module/views/w3m-onramp-view/index.js +2 -2
  261. package/lib/module/views/w3m-onramp-view/index.js.map +1 -1
  262. package/lib/module/views/w3m-swap-preview-view/index.js +3 -16
  263. package/lib/module/views/w3m-swap-preview-view/index.js.map +1 -1
  264. package/lib/module/views/w3m-swap-preview-view/styles.js +3 -0
  265. package/lib/module/views/w3m-swap-preview-view/styles.js.map +1 -1
  266. package/lib/module/views/w3m-swap-view/components/select-token-view/index.js +5 -4
  267. package/lib/module/views/w3m-swap-view/components/select-token-view/index.js.map +1 -1
  268. package/lib/module/views/w3m-swap-view/components/select-token-view/styles.js +1 -2
  269. package/lib/module/views/w3m-swap-view/components/select-token-view/styles.js.map +1 -1
  270. package/lib/module/views/w3m-swap-view/components/select-token-view/utils.js.map +1 -1
  271. package/lib/module/views/w3m-swap-view/index.js +14 -24
  272. package/lib/module/views/w3m-swap-view/index.js.map +1 -1
  273. package/lib/module/views/w3m-swap-view/styles.js +5 -1
  274. package/lib/module/views/w3m-swap-view/styles.js.map +1 -1
  275. package/lib/module/views/w3m-unsupported-chain-view/index.js +4 -6
  276. package/lib/module/views/w3m-unsupported-chain-view/index.js.map +1 -1
  277. package/lib/module/views/w3m-wallet-compatible-networks-view/index.js +3 -2
  278. package/lib/module/views/w3m-wallet-compatible-networks-view/index.js.map +1 -1
  279. package/lib/module/views/w3m-wallet-receive-view/index.js +3 -3
  280. package/lib/module/views/w3m-wallet-receive-view/index.js.map +1 -1
  281. package/lib/module/views/w3m-wallet-send-preview-view/components/preview-send-details.js +2 -2
  282. package/lib/module/views/w3m-wallet-send-preview-view/components/preview-send-details.js.map +1 -1
  283. package/lib/module/views/w3m-wallet-send-select-token-view/index.js +2 -2
  284. package/lib/module/views/w3m-wallet-send-select-token-view/index.js.map +1 -1
  285. package/lib/module/views/w3m-wallet-send-view/index.js +6 -14
  286. package/lib/module/views/w3m-wallet-send-view/index.js.map +1 -1
  287. package/lib/module/views/w3m-wallet-send-view/styles.js +3 -0
  288. package/lib/module/views/w3m-wallet-send-view/styles.js.map +1 -1
  289. package/lib/typescript/AppKit.d.ts +6 -25
  290. package/lib/typescript/AppKit.d.ts.map +1 -1
  291. package/lib/typescript/AppKitContext.d.ts +3 -2
  292. package/lib/typescript/AppKitContext.d.ts.map +1 -1
  293. package/lib/typescript/connectors/WalletConnectConnector.d.ts +1 -1
  294. package/lib/typescript/connectors/WalletConnectConnector.d.ts.map +1 -1
  295. package/lib/typescript/hooks/useAppKitEvents.d.ts +4 -3
  296. package/lib/typescript/hooks/useAppKitEvents.d.ts.map +1 -1
  297. package/lib/typescript/hooks/useProvider.d.ts +28 -1
  298. package/lib/typescript/hooks/useProvider.d.ts.map +1 -1
  299. package/lib/typescript/hooks/useRouteTransition.d.ts +16 -0
  300. package/lib/typescript/hooks/useRouteTransition.d.ts.map +1 -0
  301. package/lib/typescript/index.d.ts +1 -0
  302. package/lib/typescript/index.d.ts.map +1 -1
  303. package/lib/typescript/modal/w3m-account-button/index.d.ts.map +1 -1
  304. package/lib/typescript/modal/w3m-modal/index.d.ts.map +1 -1
  305. package/lib/typescript/modal/w3m-modal/styles.d.ts +0 -4
  306. package/lib/typescript/modal/w3m-modal/styles.d.ts.map +1 -1
  307. package/lib/typescript/modal/w3m-network-button/index.d.ts.map +1 -1
  308. package/lib/typescript/modal/w3m-router/index.d.ts.map +1 -1
  309. package/lib/typescript/partials/w3m-account-activity/index.d.ts.map +1 -1
  310. package/lib/typescript/partials/w3m-account-tokens/index.d.ts.map +1 -1
  311. package/lib/typescript/partials/w3m-all-wallets-list/index.d.ts +1 -1
  312. package/lib/typescript/partials/w3m-all-wallets-list/index.d.ts.map +1 -1
  313. package/lib/typescript/partials/w3m-all-wallets-search/index.d.ts +1 -1
  314. package/lib/typescript/partials/w3m-all-wallets-search/index.d.ts.map +1 -1
  315. package/lib/typescript/partials/w3m-connecting-header/index.d.ts +1 -1
  316. package/lib/typescript/partials/w3m-connecting-header/index.d.ts.map +1 -1
  317. package/lib/typescript/partials/w3m-connecting-mobile/index.d.ts.map +1 -1
  318. package/lib/typescript/partials/w3m-connecting-qrcode/index.d.ts.map +1 -1
  319. package/lib/typescript/partials/w3m-connecting-web/index.d.ts.map +1 -1
  320. package/lib/typescript/partials/w3m-header/index.d.ts.map +1 -1
  321. package/lib/typescript/partials/w3m-information-modal/index.d.ts.map +1 -1
  322. package/lib/typescript/partials/w3m-information-modal/styles.d.ts +2 -0
  323. package/lib/typescript/partials/w3m-information-modal/styles.d.ts.map +1 -1
  324. package/lib/typescript/partials/w3m-selector-modal/index.d.ts.map +1 -1
  325. package/lib/typescript/partials/w3m-selector-modal/styles.d.ts +1 -0
  326. package/lib/typescript/partials/w3m-selector-modal/styles.d.ts.map +1 -1
  327. package/lib/typescript/partials/w3m-swap-input/index.d.ts +1 -1
  328. package/lib/typescript/partials/w3m-swap-input/index.d.ts.map +1 -1
  329. package/lib/typescript/types.d.ts +156 -0
  330. package/lib/typescript/types.d.ts.map +1 -0
  331. package/lib/typescript/utils/HelpersUtil.d.ts +3 -3
  332. package/lib/typescript/utils/HelpersUtil.d.ts.map +1 -1
  333. package/lib/typescript/utils/NetworkUtil.d.ts +1 -2
  334. package/lib/typescript/utils/NetworkUtil.d.ts.map +1 -1
  335. package/lib/typescript/utils/RouterUtil.d.ts +9 -0
  336. package/lib/typescript/utils/RouterUtil.d.ts.map +1 -0
  337. package/lib/typescript/utils/UiUtil.d.ts +2 -6
  338. package/lib/typescript/utils/UiUtil.d.ts.map +1 -1
  339. package/lib/typescript/views/w3m-account-default-view/index.d.ts.map +1 -1
  340. package/lib/typescript/views/w3m-account-view/index.d.ts.map +1 -1
  341. package/lib/typescript/views/w3m-all-wallets-view/index.d.ts.map +1 -1
  342. package/lib/typescript/views/w3m-connect-view/components/all-wallet-list.d.ts +1 -1
  343. package/lib/typescript/views/w3m-connect-view/components/all-wallet-list.d.ts.map +1 -1
  344. package/lib/typescript/views/w3m-connect-view/components/custom-wallet-list.d.ts +1 -1
  345. package/lib/typescript/views/w3m-connect-view/components/custom-wallet-list.d.ts.map +1 -1
  346. package/lib/typescript/views/w3m-connect-view/components/recent-wallet-list.d.ts +1 -1
  347. package/lib/typescript/views/w3m-connect-view/components/recent-wallet-list.d.ts.map +1 -1
  348. package/lib/typescript/views/w3m-connect-view/index.d.ts.map +1 -1
  349. package/lib/typescript/views/w3m-connect-view/utils.d.ts +1 -1
  350. package/lib/typescript/views/w3m-connect-view/utils.d.ts.map +1 -1
  351. package/lib/typescript/views/w3m-connecting-external-view/index.d.ts.map +1 -1
  352. package/lib/typescript/views/w3m-connecting-siwe-view/index.d.ts.map +1 -1
  353. package/lib/typescript/views/w3m-connecting-social-view/index.d.ts.map +1 -1
  354. package/lib/typescript/views/w3m-get-wallet-view/index.d.ts.map +1 -1
  355. package/lib/typescript/views/w3m-network-switch-view/index.d.ts.map +1 -1
  356. package/lib/typescript/views/w3m-networks-view/index.d.ts.map +1 -1
  357. package/lib/typescript/views/w3m-onramp-checkout-view/index.d.ts.map +1 -1
  358. package/lib/typescript/views/w3m-onramp-settings-view/components/Country.d.ts +1 -1
  359. package/lib/typescript/views/w3m-onramp-settings-view/components/Country.d.ts.map +1 -1
  360. package/lib/typescript/views/w3m-onramp-settings-view/index.d.ts.map +1 -1
  361. package/lib/typescript/views/w3m-onramp-settings-view/utils.d.ts +1 -1
  362. package/lib/typescript/views/w3m-onramp-settings-view/utils.d.ts.map +1 -1
  363. package/lib/typescript/views/w3m-onramp-view/components/Currency.d.ts +1 -1
  364. package/lib/typescript/views/w3m-onramp-view/components/Currency.d.ts.map +1 -1
  365. package/lib/typescript/views/w3m-onramp-view/components/Header.d.ts.map +1 -1
  366. package/lib/typescript/views/w3m-onramp-view/components/PaymentMethod.d.ts +1 -1
  367. package/lib/typescript/views/w3m-onramp-view/components/PaymentMethod.d.ts.map +1 -1
  368. package/lib/typescript/views/w3m-onramp-view/components/Quote.d.ts +1 -1
  369. package/lib/typescript/views/w3m-onramp-view/components/Quote.d.ts.map +1 -1
  370. package/lib/typescript/views/w3m-onramp-view/components/SelectPaymentModal.d.ts.map +1 -1
  371. package/lib/typescript/views/w3m-onramp-view/index.d.ts.map +1 -1
  372. package/lib/typescript/views/w3m-onramp-view/utils.d.ts +1 -1
  373. package/lib/typescript/views/w3m-onramp-view/utils.d.ts.map +1 -1
  374. package/lib/typescript/views/w3m-swap-preview-view/index.d.ts.map +1 -1
  375. package/lib/typescript/views/w3m-swap-preview-view/styles.d.ts +3 -0
  376. package/lib/typescript/views/w3m-swap-preview-view/styles.d.ts.map +1 -1
  377. package/lib/typescript/views/w3m-swap-view/components/select-token-view/index.d.ts +4 -2
  378. package/lib/typescript/views/w3m-swap-view/components/select-token-view/index.d.ts.map +1 -1
  379. package/lib/typescript/views/w3m-swap-view/components/select-token-view/styles.d.ts +0 -1
  380. package/lib/typescript/views/w3m-swap-view/components/select-token-view/styles.d.ts.map +1 -1
  381. package/lib/typescript/views/w3m-swap-view/components/select-token-view/utils.d.ts +1 -1
  382. package/lib/typescript/views/w3m-swap-view/components/select-token-view/utils.d.ts.map +1 -1
  383. package/lib/typescript/views/w3m-swap-view/index.d.ts.map +1 -1
  384. package/lib/typescript/views/w3m-swap-view/styles.d.ts +5 -1
  385. package/lib/typescript/views/w3m-swap-view/styles.d.ts.map +1 -1
  386. package/lib/typescript/views/w3m-unsupported-chain-view/index.d.ts.map +1 -1
  387. package/lib/typescript/views/w3m-wallet-compatible-networks-view/index.d.ts.map +1 -1
  388. package/lib/typescript/views/w3m-wallet-receive-view/index.d.ts.map +1 -1
  389. package/lib/typescript/views/w3m-wallet-send-select-token-view/index.d.ts.map +1 -1
  390. package/lib/typescript/views/w3m-wallet-send-view/index.d.ts.map +1 -1
  391. package/lib/typescript/views/w3m-wallet-send-view/styles.d.ts +3 -0
  392. package/lib/typescript/views/w3m-wallet-send-view/styles.d.ts.map +1 -1
  393. package/package.json +5 -6
  394. package/src/AppKit.ts +87 -110
  395. package/src/AppKitContext.tsx +2 -2
  396. package/src/connectors/WalletConnectConnector.ts +20 -5
  397. package/src/hooks/useAppKitEvents.ts +2 -5
  398. package/src/hooks/useProvider.ts +30 -9
  399. package/src/hooks/useRouteTransition.ts +95 -0
  400. package/src/index.ts +1 -0
  401. package/src/modal/w3m-account-button/index.tsx +3 -2
  402. package/src/modal/w3m-modal/index.tsx +12 -39
  403. package/src/modal/w3m-modal/styles.ts +0 -4
  404. package/src/modal/w3m-network-button/index.tsx +2 -1
  405. package/src/modal/w3m-router/index.tsx +17 -2
  406. package/src/partials/w3m-account-activity/index.tsx +9 -8
  407. package/src/partials/w3m-account-tokens/index.tsx +4 -3
  408. package/src/partials/w3m-account-wallet-features/index.tsx +6 -6
  409. package/src/partials/w3m-all-wallets-list/index.tsx +2 -2
  410. package/src/partials/w3m-all-wallets-search/index.tsx +2 -6
  411. package/src/partials/w3m-connecting-body/index.tsx +2 -2
  412. package/src/partials/w3m-connecting-header/index.tsx +1 -1
  413. package/src/partials/w3m-connecting-mobile/index.tsx +13 -14
  414. package/src/partials/w3m-connecting-qrcode/index.tsx +18 -14
  415. package/src/partials/w3m-connecting-web/index.tsx +11 -13
  416. package/src/partials/w3m-header/index.tsx +4 -15
  417. package/src/partials/w3m-information-modal/index.tsx +28 -32
  418. package/src/partials/w3m-information-modal/styles.ts +7 -5
  419. package/src/partials/w3m-placeholder/index.tsx +8 -8
  420. package/src/partials/w3m-selector-modal/index.tsx +64 -68
  421. package/src/partials/w3m-selector-modal/styles.ts +1 -0
  422. package/src/partials/w3m-send-input-token/index.tsx +2 -2
  423. package/src/partials/w3m-swap-input/index.tsx +3 -4
  424. package/src/types.ts +187 -0
  425. package/src/utils/HelpersUtil.ts +3 -2
  426. package/src/utils/NetworkUtil.ts +1 -1
  427. package/src/utils/RouterUtil.ts +50 -0
  428. package/src/utils/UiUtil.ts +13 -29
  429. package/src/views/w3m-account-default-view/components/auth-buttons.tsx +2 -2
  430. package/src/views/w3m-account-default-view/index.tsx +25 -24
  431. package/src/views/w3m-account-view/index.tsx +2 -1
  432. package/src/views/w3m-all-wallets-view/index.tsx +6 -11
  433. package/src/views/w3m-connect-view/components/all-wallet-list.tsx +4 -4
  434. package/src/views/w3m-connect-view/components/custom-wallet-list.tsx +4 -4
  435. package/src/views/w3m-connect-view/components/recent-wallet-list.tsx +3 -7
  436. package/src/views/w3m-connect-view/components/social-login-list.tsx +4 -4
  437. package/src/views/w3m-connect-view/index.tsx +12 -13
  438. package/src/views/w3m-connect-view/utils.ts +1 -1
  439. package/src/views/w3m-connecting-external-view/index.tsx +9 -10
  440. package/src/views/w3m-connecting-siwe-view/index.tsx +5 -11
  441. package/src/views/w3m-connecting-social-view/index.tsx +10 -12
  442. package/src/views/w3m-connecting-view/index.tsx +10 -10
  443. package/src/views/w3m-get-wallet-view/index.tsx +2 -1
  444. package/src/views/w3m-network-switch-view/index.tsx +10 -8
  445. package/src/views/w3m-networks-view/index.tsx +6 -11
  446. package/src/views/w3m-onramp-checkout-view/index.tsx +17 -16
  447. package/src/views/w3m-onramp-settings-view/components/Country.tsx +6 -4
  448. package/src/views/w3m-onramp-settings-view/index.tsx +6 -9
  449. package/src/views/w3m-onramp-settings-view/utils.ts +2 -5
  450. package/src/views/w3m-onramp-transaction-view/index.tsx +6 -6
  451. package/src/views/w3m-onramp-view/components/Currency.tsx +3 -3
  452. package/src/views/w3m-onramp-view/components/CurrencyInput.tsx +2 -2
  453. package/src/views/w3m-onramp-view/components/Header.tsx +4 -6
  454. package/src/views/w3m-onramp-view/components/PaymentButton.tsx +4 -4
  455. package/src/views/w3m-onramp-view/components/PaymentMethod.tsx +4 -3
  456. package/src/views/w3m-onramp-view/components/Quote.tsx +4 -5
  457. package/src/views/w3m-onramp-view/components/SelectPaymentModal.tsx +51 -61
  458. package/src/views/w3m-onramp-view/index.tsx +8 -4
  459. package/src/views/w3m-swap-preview-view/index.tsx +4 -23
  460. package/src/views/w3m-swap-preview-view/styles.ts +3 -0
  461. package/src/views/w3m-swap-view/components/select-token-view/index.tsx +17 -7
  462. package/src/views/w3m-swap-view/components/select-token-view/styles.ts +1 -2
  463. package/src/views/w3m-swap-view/components/select-token-view/utils.ts +2 -1
  464. package/src/views/w3m-swap-view/index.tsx +12 -26
  465. package/src/views/w3m-swap-view/styles.ts +5 -1
  466. package/src/views/w3m-unsupported-chain-view/index.tsx +4 -5
  467. package/src/views/w3m-wallet-compatible-networks-view/index.tsx +3 -2
  468. package/src/views/w3m-wallet-receive-view/index.tsx +6 -2
  469. package/src/views/w3m-wallet-send-preview-view/components/preview-send-details.tsx +2 -2
  470. package/src/views/w3m-wallet-send-select-token-view/index.tsx +2 -1
  471. package/src/views/w3m-wallet-send-view/index.tsx +5 -10
  472. package/src/views/w3m-wallet-send-view/styles.ts +3 -0
  473. package/lib/commonjs/config/animations.js +0 -9
  474. package/lib/commonjs/config/animations.js.map +0 -1
  475. package/lib/commonjs/partials/w3m-otp-code/index.js +0 -89
  476. package/lib/commonjs/partials/w3m-otp-code/index.js.map +0 -1
  477. package/lib/commonjs/partials/w3m-otp-code/styles.js +0 -21
  478. package/lib/commonjs/partials/w3m-otp-code/styles.js.map +0 -1
  479. package/lib/module/config/animations.js +0 -9
  480. package/lib/module/config/animations.js.map +0 -1
  481. package/lib/module/partials/w3m-otp-code/index.js +0 -84
  482. package/lib/module/partials/w3m-otp-code/index.js.map +0 -1
  483. package/lib/module/partials/w3m-otp-code/styles.js +0 -17
  484. package/lib/module/partials/w3m-otp-code/styles.js.map +0 -1
  485. package/lib/typescript/config/animations.d.ts +0 -2
  486. package/lib/typescript/config/animations.d.ts.map +0 -1
  487. package/lib/typescript/partials/w3m-otp-code/index.d.ts +0 -16
  488. package/lib/typescript/partials/w3m-otp-code/index.d.ts.map +0 -1
  489. package/lib/typescript/partials/w3m-otp-code/styles.d.ts +0 -14
  490. package/lib/typescript/partials/w3m-otp-code/styles.d.ts.map +0 -1
  491. package/src/config/animations.ts +0 -7
  492. package/src/partials/w3m-otp-code/index.tsx +0 -81
  493. package/src/partials/w3m-otp-code/styles.ts +0 -15
package/src/AppKit.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import {
2
- type Features,
3
2
  EventsController,
4
3
  ModalController,
5
4
  ConnectionsController,
@@ -7,9 +6,8 @@ import {
7
6
  RouterController,
8
7
  TransactionsController,
9
8
  StorageUtil,
10
- type OptionsControllerState,
11
9
  ThemeController,
12
- ConnectionController,
10
+ WcController,
13
11
  SwapController,
14
12
  OnRampController,
15
13
  CoreHelperUtil,
@@ -23,18 +21,12 @@ import {
23
21
  type ProposalNamespaces,
24
22
  type ConnectorType,
25
23
  type Namespaces,
26
- type Metadata,
27
24
  type CaipNetworkId,
28
25
  type AppKitNetwork,
29
26
  type Provider,
30
- type ThemeVariables,
31
- type ThemeMode,
32
27
  type WalletInfo,
33
- type Network,
34
28
  type ChainNamespace,
35
- type Storage,
36
29
  type AppKitConnectOptions,
37
- type AppKitSIWEClient,
38
30
  type ConnectionProperties,
39
31
  type AccountType,
40
32
  type AppKitOpenOptions,
@@ -46,29 +38,8 @@ import { SIWEController } from '@reown/appkit-siwe-react-native';
46
38
  import { WalletConnectConnector } from './connectors/WalletConnectConnector';
47
39
  import { WcHelpersUtil } from './utils/HelpersUtil';
48
40
  import { NetworkUtil } from './utils/NetworkUtil';
49
-
50
- interface AppKitConfig {
51
- projectId: string;
52
- metadata: Metadata;
53
- adapters: BlockchainAdapter[];
54
- networks: Network[];
55
- storage: Storage;
56
- extraConnectors?: WalletConnector[];
57
- clipboardClient?: OptionsControllerState['clipboardClient'];
58
- includeWalletIds?: OptionsControllerState['includeWalletIds'];
59
- excludeWalletIds?: OptionsControllerState['excludeWalletIds'];
60
- featuredWalletIds?: OptionsControllerState['featuredWalletIds'];
61
- customWallets?: OptionsControllerState['customWallets'];
62
- tokens?: OptionsControllerState['tokens']; //TODO: check if needed in OptionsController
63
- enableAnalytics?: OptionsControllerState['enableAnalytics'];
64
- debug?: OptionsControllerState['debug'];
65
- themeMode?: ThemeMode;
66
- themeVariables?: ThemeVariables;
67
- siweConfig?: AppKitSIWEClient;
68
- defaultNetwork?: Network;
69
- features?: Features;
70
- // chainImages?: Record<number, string>; //TODO: rename to networkImages
71
- }
41
+ import { RouterUtil } from './utils/RouterUtil';
42
+ import { type AppKitConfig } from './types';
72
43
 
73
44
  export class AppKit {
74
45
  private projectId: string;
@@ -114,7 +85,10 @@ export class AppKit {
114
85
  });
115
86
 
116
87
  this.networks = networksWithAdapters;
117
- this.namespaces = WcHelpersUtil.createNamespaces(this.networks) as ProposalNamespaces;
88
+ this.namespaces = WcHelpersUtil.createNamespaces(
89
+ this.networks,
90
+ config.universalProviderConfigOverride
91
+ ) as ProposalNamespaces;
118
92
  this.config = config;
119
93
  this.extraConnectors = config.extraConnectors || [];
120
94
 
@@ -143,47 +117,59 @@ export class AppKit {
143
117
  siweConfig: this.config?.siweConfig
144
118
  });
145
119
 
146
- const walletInfo = connector.getWalletInfo();
147
- const properties = connector.getProperties();
120
+ this.processConnection(connector, approvedNamespaces);
148
121
 
149
- if (!approvedNamespaces || Object.keys(approvedNamespaces).length === 0) {
150
- throw new Error('Connection cancelled or failed: No approved namespaces returned.');
122
+ // Save connector type and namespaces in storage
123
+ if (approvedNamespaces && Object.keys(approvedNamespaces).length > 0) {
124
+ await StorageUtil.setConnectedConnectors({
125
+ type: connector.type,
126
+ namespaces: Object.keys(approvedNamespaces)
127
+ });
151
128
  }
129
+ } catch (error) {
130
+ console.warn('Connection failed:', error);
131
+ throw error;
132
+ }
133
+ }
152
134
 
153
- // Setup adapters and subscribe to adapter events
154
- const approvedAdapters = this.setupAdaptersAndSubscribe(
155
- connector,
156
- Object.keys(approvedNamespaces)
157
- );
135
+ private processConnection(
136
+ connector: WalletConnector,
137
+ namespaces?: Namespaces,
138
+ shouldCloseModal: boolean = true
139
+ ) {
140
+ if (!namespaces || Object.keys(namespaces).length === 0) {
141
+ throw new Error('No namespaces provided');
142
+ }
158
143
 
159
- // Check if any compatible adapters were found for the *approved* namespaces
160
- if (approvedAdapters.length === 0) {
161
- //TODO: handle case where devs want to connect to a namespace that has no adapters. Could use the provider directly.
162
- throw new Error('No compatible adapters found for the approved namespaces');
163
- }
144
+ const walletInfo = connector.getWalletInfo();
145
+ const properties = connector.getProperties();
164
146
 
165
- // Store the connection details for the successfully connected adapters
166
- this.setConnection(approvedAdapters, approvedNamespaces, walletInfo, properties);
147
+ const initializedAdapters = this.setupAdaptersAndSubscribe(connector, Object.keys(namespaces));
167
148
 
168
- // Store connector type and namespaces in storage
169
- await StorageUtil.setConnectedConnectors({
170
- type: connector.type,
171
- namespaces: Object.keys(approvedNamespaces)
172
- });
149
+ if (initializedAdapters.length === 0) {
150
+ console.warn('No compatible adapters found for namespaces:', Object.keys(namespaces));
173
151
 
174
- this.syncAccounts(approvedAdapters);
152
+ return;
153
+ }
175
154
 
176
- if (
177
- OptionsController.state.isSiweEnabled &&
178
- ConnectionsController.state.activeNamespace === 'eip155'
179
- ) {
180
- this.handleSiweChange({ isConnection: true });
181
- } else {
182
- ModalController.close();
183
- }
184
- } catch (error) {
185
- console.warn('Connection failed:', error);
186
- throw error;
155
+ // Store the connection details
156
+ this.setConnection(initializedAdapters, namespaces, walletInfo, properties);
157
+
158
+ // Sync accounts
159
+ this.syncAccounts(initializedAdapters);
160
+
161
+ // Handle SIWE if enabled
162
+ this.handleSiweConnectionIfEnabled(shouldCloseModal);
163
+ }
164
+
165
+ private handleSiweConnectionIfEnabled(shouldCloseModal: boolean = true): void {
166
+ if (
167
+ OptionsController.state.isSiweEnabled &&
168
+ ConnectionsController.state.activeNamespace === 'eip155'
169
+ ) {
170
+ this.handleSiweChange({ isConnection: true });
171
+ } else if (shouldCloseModal) {
172
+ ModalController.close();
187
173
  }
188
174
  }
189
175
 
@@ -218,7 +204,7 @@ export class AppKit {
218
204
  SwapController.resetState();
219
205
  SendController.resetState();
220
206
  OnRampController.resetState();
221
- ConnectionController.disconnect();
207
+ WcController.resetState();
222
208
 
223
209
  if (ConnectionsController.state.activeNamespace === undefined) {
224
210
  ConnectionsController.setActiveNamespace(
@@ -296,8 +282,33 @@ export class AppKit {
296
282
  ModalController.open(options);
297
283
  }
298
284
 
299
- close() {
285
+ async close() {
300
286
  ModalController.close();
287
+
288
+ if (OptionsController.state.isSiweEnabled && ConnectionsController.state.isConnected) {
289
+ const session = await SIWEController.getSession();
290
+ if (
291
+ !session &&
292
+ SIWEController.state.status !== 'success' &&
293
+ ConnectionsController.state.activeNamespace === 'eip155' &&
294
+ !!ConnectionsController.state.activeAddress
295
+ ) {
296
+ await this.disconnect();
297
+ }
298
+ }
299
+
300
+ RouterUtil.checkOnRampBack();
301
+ RouterUtil.checkSocialLoginBack();
302
+ }
303
+
304
+ back() {
305
+ if (RouterController.state.history.length > 1) {
306
+ RouterUtil.checkBack();
307
+
308
+ return RouterController.goBack();
309
+ }
310
+
311
+ return this.close();
301
312
  }
302
313
 
303
314
  async switchAccountType(namespace: ChainNamespace, type: AccountType, network: AppKitNetwork) {
@@ -357,13 +368,12 @@ export class AppKit {
357
368
  return this.walletConnectConnector;
358
369
  }
359
370
 
360
- //TODO: reuse logic with connect method
361
371
  /**
362
372
  * Initializes connectors based on stored connection data.
363
373
  * This attempts to restore previous sessions.
364
374
  */
365
375
  private async initConnectors() {
366
- const connectedConnectors = await StorageUtil.getConnectedConnectors(); // Fetch stored connectors
376
+ const connectedConnectors = await StorageUtil.getConnectedConnectors();
367
377
  if (connectedConnectors.length > 0) {
368
378
  ModalController.setLoading(true);
369
379
 
@@ -372,31 +382,8 @@ export class AppKit {
372
382
  const connector = await this.createConnector(connected.type);
373
383
 
374
384
  const namespaces = connector.getNamespaces();
375
- const walletInfo = connector.getWalletInfo();
376
- const properties = connector.getProperties();
377
-
378
- if (namespaces && Object.keys(namespaces).length > 0) {
379
- // Ensure namespaces is not empty
380
- // Setup adapters and subscribe to events
381
- const initializedAdapters = this.setupAdaptersAndSubscribe(
382
- connector,
383
- Object.keys(namespaces)
384
- );
385
-
386
- // If adapters were successfully initialized, store the connection details
387
- if (initializedAdapters.length > 0) {
388
- this.setConnection(initializedAdapters, namespaces, walletInfo, properties);
389
- }
390
-
391
- this.syncAccounts(initializedAdapters);
392
-
393
- if (
394
- OptionsController.state.isSiweEnabled &&
395
- ConnectionsController.state.activeNamespace === 'eip155'
396
- ) {
397
- this.handleSiweChange({ isConnection: true });
398
- }
399
- }
385
+
386
+ this.processConnection(connector, namespaces, false);
400
387
  } catch (error) {
401
388
  // Use console.warn for non-critical initialization failures
402
389
  console.warn(`Failed to initialize connector type ${connected.type}:`, error);
@@ -423,7 +410,7 @@ export class AppKit {
423
410
  }
424
411
 
425
412
  adapters.forEach(adapter => {
426
- adapter.setConnector(connector);
413
+ adapter.init({ connector });
427
414
  this.subscribeToAdapterEvents(adapter);
428
415
  });
429
416
 
@@ -543,9 +530,7 @@ export class AppKit {
543
530
  private subscribeToAdapterEvents(adapter: BlockchainAdapter): void {
544
531
  adapter.on('accountsChanged', ({ accounts }) => {
545
532
  const namespace = adapter.getSupportedNamespace();
546
- //eslint-disable-next-line no-console
547
- console.log('accountsChanged', accounts, namespace);
548
- //TODO: check this
533
+ ConnectionsController.updateAccounts(namespace, accounts);
549
534
 
550
535
  if (namespace === 'eip155') {
551
536
  this.handleSiweChange({ isAccountChange: true });
@@ -579,7 +564,6 @@ export class AppKit {
579
564
  this.disconnect(namespace, false);
580
565
  });
581
566
 
582
- //TODO: Add types to this events
583
567
  adapter.on('balanceChanged', ({ address, balance }) => {
584
568
  //eslint-disable-next-line no-console
585
569
  console.log('balanceChanged', address, balance);
@@ -597,7 +581,6 @@ export class AppKit {
597
581
  this.setExcludedWallets(options);
598
582
  this.setCustomWallets(options);
599
583
  OptionsController.setFeaturedWalletIds(options.featuredWalletIds);
600
- OptionsController.setTokens(options.tokens);
601
584
  OptionsController.setEnableAnalytics(options.enableAnalytics);
602
585
  OptionsController.setDebug(options.debug);
603
586
  OptionsController.setFeatures(options.features);
@@ -645,8 +628,6 @@ export class AppKit {
645
628
 
646
629
  private async initRecentWallets(options: AppKitConfig) {
647
630
  const wallets = await StorageUtil.getRecentWallets();
648
- const connectedWalletImage = await StorageUtil.getConnectedWalletImageUrl();
649
-
650
631
  const filteredWallets = wallets.filter(wallet => {
651
632
  const { includeWalletIds, excludeWalletIds } = options;
652
633
  if (includeWalletIds) {
@@ -659,11 +640,7 @@ export class AppKit {
659
640
  return true;
660
641
  });
661
642
 
662
- ConnectionController.setRecentWallets(filteredWallets);
663
-
664
- if (connectedWalletImage) {
665
- ConnectionController.setConnectedWalletImageUrl(connectedWalletImage);
666
- }
643
+ WcController.setRecentWallets(filteredWallets);
667
644
  }
668
645
 
669
646
  private setExcludedWallets(options: AppKitConfig) {
@@ -673,7 +650,7 @@ export class AppKit {
673
650
  const excludeCoinbase = !this.extraConnectors.some(connector => connector.type === 'coinbase');
674
651
 
675
652
  if (excludeCoinbase) {
676
- excludedWallets.push(ConstantsUtil.COINBASE_EXPLORER_ID);
653
+ excludedWallets.push(ConstantsUtil.COINBASE_CUSTOM_WALLET.id);
677
654
  }
678
655
 
679
656
  OptionsController.setExcludeWalletIds(excludedWallets);
@@ -743,7 +720,7 @@ export class AppKit {
743
720
  // If it's connected but there's no session, show sign view
744
721
  return this.onSiweNavigation();
745
722
  } else if (isConnection) {
746
- //Connected with 1CA
723
+ // Connected with 1CA
747
724
  ModalController.close();
748
725
  }
749
726
  }
@@ -16,8 +16,7 @@ export const AppKitProvider: React.FC<AppKitProviderProps> = ({ children, instan
16
16
  return <AppKitContext.Provider value={{ appKit: instance }}>{children}</AppKitContext.Provider>;
17
17
  };
18
18
 
19
- //TODO: rename this so it doesn't conflict with the useAppKit hook in the hooks folder
20
- export const useAppKit = () => {
19
+ export const useInternalAppKit = () => {
21
20
  const context = useContext(AppKitContext);
22
21
  if (context === undefined) {
23
22
  throw new Error('useAppKit must be used within an AppKitProvider');
@@ -32,6 +31,7 @@ export const useAppKit = () => {
32
31
  disconnect: context.appKit.disconnect.bind(context.appKit),
33
32
  open: context.appKit.open.bind(context.appKit),
34
33
  close: context.appKit.close.bind(context.appKit),
34
+ back: context.appKit.back.bind(context.appKit),
35
35
  switchNetwork: context.appKit.switchNetwork.bind(context.appKit),
36
36
  getProvider: context.appKit.getProvider.bind(context.appKit),
37
37
  switchAccountType: context.appKit.switchAccountType.bind(context.appKit)
@@ -1,4 +1,4 @@
1
- import { ConnectionController } from '@reown/appkit-core-react-native';
1
+ import { WcController } from '@reown/appkit-core-react-native';
2
2
  import { UniversalProvider, type IUniversalProvider } from '@walletconnect/universal-provider';
3
3
  import {
4
4
  WalletConnector,
@@ -11,7 +11,8 @@ import {
11
11
  type ConnectOptions,
12
12
  type ConnectorInitOptions,
13
13
  type Metadata,
14
- type ConnectionProperties
14
+ type ConnectionProperties,
15
+ type RequestArguments
15
16
  } from '@reown/appkit-common-react-native';
16
17
  import { getDidAddress, getDidChainId, SIWEController } from '@reown/appkit-siwe-react-native';
17
18
 
@@ -95,7 +96,7 @@ export class WalletConnectConnector extends WalletConnector {
95
96
  override async connect(opts: ConnectOptions) {
96
97
  const { siweConfig, namespaces, defaultChain, universalLink } = opts;
97
98
  function onUri(uri: string) {
98
- ConnectionController.setWcUri(uri);
99
+ WcController.setWcUri(uri);
99
100
  }
100
101
 
101
102
  const provider = this.getProvider() as IUniversalProvider;
@@ -201,11 +202,25 @@ export class WalletConnectConnector extends WalletConnector {
201
202
  return this.namespaces;
202
203
  }
203
204
 
204
- override getProvider(): Provider {
205
+ override getProvider(namespace?: ChainNamespace): Provider {
205
206
  if (!this.provider) {
206
207
  throw new Error('WalletConnectConnector: Provider not initialized. Call init() first.');
207
208
  }
208
209
 
210
+ const provider = this.provider as IUniversalProvider;
211
+
212
+ if (namespace) {
213
+ const _chainId = this.getChainId(namespace);
214
+
215
+ // @ts-ignore
216
+ return {
217
+ ...provider,
218
+ request: (args: RequestArguments, chainId?: CaipNetworkId) => {
219
+ return provider.request(args, chainId || _chainId);
220
+ }
221
+ };
222
+ }
223
+
209
224
  return this.provider;
210
225
  }
211
226
 
@@ -238,7 +253,7 @@ export class WalletConnectConnector extends WalletConnector {
238
253
 
239
254
  const chainId = (this.provider as IUniversalProvider).rpcProviders[
240
255
  namespace
241
- ]?.getDefaultChain();
256
+ ]?.getDefaultChain?.();
242
257
 
243
258
  if (!chainId) {
244
259
  return undefined;
@@ -1,10 +1,7 @@
1
1
  import { useEffect } from 'react';
2
2
  import { useSnapshot } from 'valtio';
3
- import {
4
- EventsController,
5
- type EventName,
6
- type EventsControllerState
7
- } from '@reown/appkit-core-react-native';
3
+ import { EventsController, type EventsControllerState } from '@reown/appkit-core-react-native';
4
+ import { type EventName } from '@reown/appkit-common-react-native';
8
5
  import { useAppKit } from './useAppKit';
9
6
 
10
7
  export function useAppKitEvents(callback?: (newEvent: EventsControllerState) => void) {
@@ -2,24 +2,45 @@ import { useSnapshot } from 'valtio';
2
2
  import { ConnectionsController } from '@reown/appkit-core-react-native';
3
3
  import type { Provider, ChainNamespace } from '@reown/appkit-common-react-native';
4
4
 
5
+ /**
6
+ * Interface representing the result of the useProvider hook
7
+ */
5
8
  interface ProviderResult {
9
+ /** The active connection provider instance */
6
10
  provider?: Provider;
11
+ /** The chain namespace supported by the provider */
7
12
  providerType?: ChainNamespace;
8
13
  }
9
14
 
10
- export function useProvider(namespace?: ChainNamespace): ProviderResult {
11
- const { connections, activeNamespace } = useSnapshot(ConnectionsController.state);
12
-
13
- const targetNamespace = namespace ?? activeNamespace;
14
-
15
- if (!targetNamespace) return { provider: undefined, providerType: undefined };
16
-
17
- const connection = connections.get(targetNamespace);
15
+ /**
16
+ * Hook that returns the active connection provider and its supported chain namespace.
17
+ *
18
+ * This hook accesses the current connection and returns the provider instance along with its supported namespace.
19
+ *
20
+ * @returns {ProviderResult} An object containing:
21
+ * - `provider`: The active connection provider instance, or undefined if no connection exists
22
+ * - `providerType`: The chain namespace supported by the provider, or undefined if no connection exists
23
+ *
24
+ * @example
25
+ * ```typescript
26
+ * const { provider, providerType } = useProvider();
27
+ *
28
+ * if (provider) {
29
+ * // Use the provider for blockchain operations
30
+ * const balance = await provider.request({
31
+ * method: 'eth_getBalance',
32
+ * params: [address, 'latest']
33
+ * });
34
+ * }
35
+ * ```
36
+ */
37
+ export function useProvider(): ProviderResult {
38
+ const { connection } = useSnapshot(ConnectionsController.state);
18
39
 
19
40
  if (!connection) return { provider: undefined, providerType: undefined };
20
41
 
21
42
  return {
22
- provider: connection.adapter.connector?.getProvider(),
43
+ provider: connection.adapter.getProvider(),
23
44
  providerType: connection.adapter.getSupportedNamespace()
24
45
  };
25
46
  }
@@ -0,0 +1,95 @@
1
+ import { useCallback, useRef, useEffect } from 'react';
2
+ import { Animated, Dimensions } from 'react-native';
3
+
4
+ const { width: screenWidth } = Dimensions.get('window');
5
+
6
+ export interface RouteTransitionConfig {
7
+ duration?: number;
8
+ useNativeDriver?: boolean;
9
+ }
10
+
11
+ export function useRouteTransition(config: RouteTransitionConfig = {}) {
12
+ const { duration = 300, useNativeDriver = true } = config;
13
+
14
+ const fadeAnim = useRef(new Animated.Value(1)).current;
15
+ const slideAnim = useRef(new Animated.Value(0)).current;
16
+ const isAnimating = useRef(false);
17
+ const currentAnimation = useRef<Animated.CompositeAnimation | null>(null);
18
+
19
+ const animateTransition = useCallback(
20
+ (direction: 'forward' | 'backward' | 'none') => {
21
+ if (isAnimating.current || direction === 'none') {
22
+ return Promise.resolve();
23
+ }
24
+
25
+ if (currentAnimation.current) {
26
+ currentAnimation.current.stop();
27
+ }
28
+
29
+ isAnimating.current = true;
30
+
31
+ return new Promise<void>(resolve => {
32
+ const startPosition =
33
+ direction === 'forward'
34
+ ? screenWidth * 0.02 // Start from right for forward
35
+ : -screenWidth * 0.02; // Start from left for backward
36
+
37
+ // Immediately set starting position and fade out
38
+ fadeAnim.setValue(0);
39
+ slideAnim.setValue(startPosition);
40
+
41
+ // Animate to final position with fade in
42
+ const animation = Animated.parallel([
43
+ Animated.timing(fadeAnim, {
44
+ toValue: 1,
45
+ duration,
46
+ useNativeDriver
47
+ }),
48
+ Animated.timing(slideAnim, {
49
+ toValue: 0, // Slide to center
50
+ duration,
51
+ useNativeDriver
52
+ })
53
+ ]);
54
+
55
+ currentAnimation.current = animation;
56
+
57
+ animation.start(({ finished }) => {
58
+ if (finished) {
59
+ isAnimating.current = false;
60
+ currentAnimation.current = null;
61
+ resolve();
62
+ }
63
+ });
64
+ });
65
+ },
66
+ [fadeAnim, slideAnim, duration, useNativeDriver]
67
+ );
68
+
69
+ const getAnimatedStyle = useCallback(
70
+ () => ({
71
+ opacity: fadeAnim,
72
+ transform: [{ translateX: slideAnim }]
73
+ }),
74
+ [fadeAnim, slideAnim]
75
+ );
76
+
77
+ useEffect(() => {
78
+ fadeAnim.setValue(1);
79
+ slideAnim.setValue(0);
80
+
81
+ return () => {
82
+ if (currentAnimation.current) {
83
+ currentAnimation.current.stop();
84
+ currentAnimation.current = null;
85
+ }
86
+ isAnimating.current = false;
87
+ };
88
+ }, [fadeAnim, slideAnim]);
89
+
90
+ return {
91
+ animateTransition,
92
+ getAnimatedStyle,
93
+ isAnimating: isAnimating.current
94
+ };
95
+ }
package/src/index.ts CHANGED
@@ -17,6 +17,7 @@ export { AppKit } from './modal/w3m-modal';
17
17
  /********** Types **********/
18
18
  export type * from '@reown/appkit-core-react-native';
19
19
  export type { AppKitNetwork, Storage } from '@reown/appkit-common-react-native';
20
+ export type { AppKitConfig } from './types';
20
21
 
21
22
  /****** Hooks *******/
22
23
  export { useAppKit } from './hooks/useAppKit';
@@ -5,7 +5,8 @@ import {
5
5
  ModalController,
6
6
  ThemeController,
7
7
  ConnectionsController,
8
- AssetController
8
+ AssetController,
9
+ AssetUtil
9
10
  } from '@reown/appkit-core-react-native';
10
11
  import { AccountButton as AccountButtonUI, ThemeProvider } from '@reown/appkit-ui-react-native';
11
12
 
@@ -26,7 +27,7 @@ export function AccountButton({ balance, disabled, style, testID }: AccountButto
26
27
  identity
27
28
  } = useSnapshot(ConnectionsController.state);
28
29
 
29
- const networkImage = activeNetwork ? networkImages[activeNetwork.id] : undefined;
30
+ const networkImage = AssetUtil.getNetworkImage(activeNetwork, networkImages);
30
31
  const showBalance = balance === 'show';
31
32
 
32
33
  return (