@reown/appkit-react-native 2.0.0-alpha.2 → 2.0.0-alpha.4
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/lib/commonjs/AppKit.js +153 -87
- package/lib/commonjs/AppKit.js.map +1 -1
- package/lib/commonjs/AppKitContext.js +4 -5
- package/lib/commonjs/AppKitContext.js.map +1 -1
- package/lib/commonjs/connectors/WalletConnectConnector.js +17 -6
- package/lib/commonjs/connectors/WalletConnectConnector.js.map +1 -1
- package/lib/commonjs/hooks/useAppKitEvents.js.map +1 -1
- package/lib/commonjs/hooks/useProvider.js +29 -10
- package/lib/commonjs/hooks/useProvider.js.map +1 -1
- package/lib/commonjs/hooks/useRouteTransition.js +89 -0
- package/lib/commonjs/hooks/useRouteTransition.js.map +1 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/modal/w3m-account-button/index.js +1 -1
- package/lib/commonjs/modal/w3m-account-button/index.js.map +1 -1
- package/lib/commonjs/modal/w3m-modal/index.js +22 -52
- package/lib/commonjs/modal/w3m-modal/index.js.map +1 -1
- package/lib/commonjs/modal/w3m-modal/styles.js +1 -6
- package/lib/commonjs/modal/w3m-modal/styles.js.map +1 -1
- package/lib/commonjs/modal/w3m-network-button/index.js +1 -1
- package/lib/commonjs/modal/w3m-network-button/index.js.map +1 -1
- package/lib/commonjs/modal/w3m-router/index.js +16 -1
- package/lib/commonjs/modal/w3m-router/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-account-activity/index.js +8 -8
- package/lib/commonjs/partials/w3m-account-activity/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-account-tokens/index.js +5 -5
- package/lib/commonjs/partials/w3m-account-tokens/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-account-wallet-features/index.js +7 -10
- package/lib/commonjs/partials/w3m-account-wallet-features/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-all-wallets-list/components/Loading.js +113 -0
- package/lib/commonjs/partials/w3m-all-wallets-list/components/Loading.js.map +1 -0
- package/lib/commonjs/partials/w3m-all-wallets-list/components/WalletItem.js +47 -0
- package/lib/commonjs/partials/w3m-all-wallets-list/components/WalletItem.js.map +1 -0
- package/lib/commonjs/partials/w3m-all-wallets-list/index.js +24 -55
- package/lib/commonjs/partials/w3m-all-wallets-list/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-all-wallets-list/styles.js +3 -5
- package/lib/commonjs/partials/w3m-all-wallets-list/styles.js.map +1 -1
- package/lib/commonjs/partials/w3m-all-wallets-search/index.js +24 -46
- package/lib/commonjs/partials/w3m-all-wallets-search/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-all-wallets-search/styles.js +2 -5
- package/lib/commonjs/partials/w3m-all-wallets-search/styles.js.map +1 -1
- package/lib/commonjs/partials/w3m-connecting-body/index.js +2 -2
- package/lib/commonjs/partials/w3m-connecting-body/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-connecting-mobile/index.js +17 -16
- package/lib/commonjs/partials/w3m-connecting-mobile/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-connecting-qrcode/components/ReownButton.js +36 -0
- package/lib/commonjs/partials/w3m-connecting-qrcode/components/ReownButton.js.map +1 -0
- package/lib/commonjs/partials/w3m-connecting-qrcode/index.js +10 -13
- package/lib/commonjs/partials/w3m-connecting-qrcode/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-connecting-qrcode/styles.js +3 -0
- package/lib/commonjs/partials/w3m-connecting-qrcode/styles.js.map +1 -1
- package/lib/commonjs/partials/w3m-connecting-web/index.js +14 -12
- package/lib/commonjs/partials/w3m-connecting-web/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-header/index.js +8 -16
- package/lib/commonjs/partials/w3m-header/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-information-modal/index.js +34 -32
- package/lib/commonjs/partials/w3m-information-modal/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-information-modal/styles.js +6 -4
- package/lib/commonjs/partials/w3m-information-modal/styles.js.map +1 -1
- package/lib/commonjs/partials/w3m-placeholder/index.js +5 -5
- package/lib/commonjs/partials/w3m-placeholder/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-selector-modal/index.js +65 -67
- package/lib/commonjs/partials/w3m-selector-modal/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-selector-modal/styles.js +1 -0
- package/lib/commonjs/partials/w3m-selector-modal/styles.js.map +1 -1
- package/lib/commonjs/partials/w3m-send-input-token/index.js +2 -2
- package/lib/commonjs/partials/w3m-send-input-token/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-swap-input/index.js +2 -2
- package/lib/commonjs/partials/w3m-swap-input/index.js.map +1 -1
- package/lib/commonjs/types.js +6 -0
- package/lib/commonjs/types.js.map +1 -0
- package/lib/commonjs/utils/HelpersUtil.js +20 -0
- package/lib/commonjs/utils/HelpersUtil.js.map +1 -1
- package/lib/commonjs/utils/NetworkUtil.js +2 -2
- package/lib/commonjs/utils/NetworkUtil.js.map +1 -1
- package/lib/commonjs/utils/RouterUtil.js +52 -0
- package/lib/commonjs/utils/RouterUtil.js.map +1 -0
- package/lib/commonjs/utils/UiUtil.js +14 -19
- package/lib/commonjs/utils/UiUtil.js.map +1 -1
- package/lib/commonjs/views/w3m-account-default-view/components/auth-buttons.js +2 -2
- package/lib/commonjs/views/w3m-account-default-view/components/auth-buttons.js.map +1 -1
- package/lib/commonjs/views/w3m-account-default-view/index.js +18 -19
- package/lib/commonjs/views/w3m-account-default-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-account-view/index.js +3 -19
- package/lib/commonjs/views/w3m-account-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-all-wallets-view/index.js +18 -9
- package/lib/commonjs/views/w3m-all-wallets-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-connect-socials-view/index.js +1 -2
- package/lib/commonjs/views/w3m-connect-socials-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-connect-view/components/all-wallet-list.js +5 -2
- package/lib/commonjs/views/w3m-connect-view/components/all-wallet-list.js.map +1 -1
- package/lib/commonjs/views/w3m-connect-view/components/custom-wallet-list.js +9 -3
- package/lib/commonjs/views/w3m-connect-view/components/custom-wallet-list.js.map +1 -1
- package/lib/commonjs/views/w3m-connect-view/components/recent-wallet-list.js +5 -2
- package/lib/commonjs/views/w3m-connect-view/components/recent-wallet-list.js.map +1 -1
- package/lib/commonjs/views/w3m-connect-view/components/social-login-list.js +4 -4
- package/lib/commonjs/views/w3m-connect-view/components/social-login-list.js.map +1 -1
- package/lib/commonjs/views/w3m-connect-view/index.js +9 -10
- package/lib/commonjs/views/w3m-connect-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-connecting-external-view/index.js +32 -17
- package/lib/commonjs/views/w3m-connecting-external-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-connecting-siwe-view/index.js +6 -11
- package/lib/commonjs/views/w3m-connecting-siwe-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-connecting-social-view/index.js +10 -13
- package/lib/commonjs/views/w3m-connecting-social-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-connecting-view/index.js +9 -11
- package/lib/commonjs/views/w3m-connecting-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-get-wallet-view/index.js +6 -3
- package/lib/commonjs/views/w3m-get-wallet-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-network-switch-view/index.js +6 -5
- package/lib/commonjs/views/w3m-network-switch-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-networks-view/index.js +9 -12
- package/lib/commonjs/views/w3m-networks-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-onramp-checkout-view/index.js +16 -16
- package/lib/commonjs/views/w3m-onramp-checkout-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-onramp-loading-view/index.js +1 -2
- package/lib/commonjs/views/w3m-onramp-loading-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-onramp-settings-view/components/Country.js +4 -4
- package/lib/commonjs/views/w3m-onramp-settings-view/components/Country.js.map +1 -1
- package/lib/commonjs/views/w3m-onramp-settings-view/index.js +4 -4
- package/lib/commonjs/views/w3m-onramp-settings-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-onramp-settings-view/utils.js.map +1 -1
- package/lib/commonjs/views/w3m-onramp-transaction-view/index.js +5 -5
- package/lib/commonjs/views/w3m-onramp-transaction-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-onramp-view/components/Currency.js +2 -2
- package/lib/commonjs/views/w3m-onramp-view/components/Currency.js.map +1 -1
- package/lib/commonjs/views/w3m-onramp-view/components/CurrencyInput.js +2 -2
- package/lib/commonjs/views/w3m-onramp-view/components/CurrencyInput.js.map +1 -1
- package/lib/commonjs/views/w3m-onramp-view/components/Header.js +5 -6
- package/lib/commonjs/views/w3m-onramp-view/components/Header.js.map +1 -1
- package/lib/commonjs/views/w3m-onramp-view/components/PaymentButton.js +4 -4
- package/lib/commonjs/views/w3m-onramp-view/components/PaymentButton.js.map +1 -1
- package/lib/commonjs/views/w3m-onramp-view/components/PaymentMethod.js +2 -2
- package/lib/commonjs/views/w3m-onramp-view/components/PaymentMethod.js.map +1 -1
- package/lib/commonjs/views/w3m-onramp-view/components/Quote.js +4 -4
- package/lib/commonjs/views/w3m-onramp-view/components/Quote.js.map +1 -1
- package/lib/commonjs/views/w3m-onramp-view/components/SelectPaymentModal.js +68 -70
- package/lib/commonjs/views/w3m-onramp-view/components/SelectPaymentModal.js.map +1 -1
- package/lib/commonjs/views/w3m-onramp-view/index.js +1 -1
- package/lib/commonjs/views/w3m-onramp-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-swap-preview-view/index.js +2 -16
- package/lib/commonjs/views/w3m-swap-preview-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-swap-preview-view/styles.js +3 -0
- package/lib/commonjs/views/w3m-swap-preview-view/styles.js.map +1 -1
- package/lib/commonjs/views/w3m-swap-view/components/select-token-view/index.js +5 -5
- package/lib/commonjs/views/w3m-swap-view/components/select-token-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-swap-view/components/select-token-view/styles.js +1 -2
- package/lib/commonjs/views/w3m-swap-view/components/select-token-view/styles.js.map +1 -1
- package/lib/commonjs/views/w3m-swap-view/components/select-token-view/utils.js.map +1 -1
- package/lib/commonjs/views/w3m-swap-view/index.js +14 -25
- package/lib/commonjs/views/w3m-swap-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-swap-view/styles.js +5 -1
- package/lib/commonjs/views/w3m-swap-view/styles.js.map +1 -1
- package/lib/commonjs/views/w3m-unsupported-chain-view/index.js +2 -4
- package/lib/commonjs/views/w3m-unsupported-chain-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-wallet-compatible-networks-view/index.js +3 -3
- package/lib/commonjs/views/w3m-wallet-compatible-networks-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-wallet-receive-view/index.js +3 -4
- package/lib/commonjs/views/w3m-wallet-receive-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-wallet-send-preview-view/components/preview-send-details.js +1 -1
- package/lib/commonjs/views/w3m-wallet-send-preview-view/components/preview-send-details.js.map +1 -1
- package/lib/commonjs/views/w3m-wallet-send-preview-view/index.js +1 -2
- package/lib/commonjs/views/w3m-wallet-send-preview-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-wallet-send-select-token-view/index.js +2 -3
- package/lib/commonjs/views/w3m-wallet-send-select-token-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-wallet-send-view/index.js +5 -14
- package/lib/commonjs/views/w3m-wallet-send-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-wallet-send-view/styles.js +3 -0
- package/lib/commonjs/views/w3m-wallet-send-view/styles.js.map +1 -1
- package/lib/commonjs/views/w3m-what-is-a-network-view/index.js +1 -2
- package/lib/commonjs/views/w3m-what-is-a-network-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-what-is-a-wallet-view/index.js +1 -2
- package/lib/commonjs/views/w3m-what-is-a-wallet-view/index.js.map +1 -1
- package/lib/module/AppKit.js +154 -88
- package/lib/module/AppKit.js.map +1 -1
- package/lib/module/AppKitContext.js +2 -3
- package/lib/module/AppKitContext.js.map +1 -1
- package/lib/module/connectors/WalletConnectConnector.js +18 -7
- package/lib/module/connectors/WalletConnectConnector.js.map +1 -1
- package/lib/module/hooks/useAppKitEvents.js.map +1 -1
- package/lib/module/hooks/useProvider.js +30 -10
- package/lib/module/hooks/useProvider.js.map +1 -1
- package/lib/module/hooks/useRouteTransition.js +85 -0
- package/lib/module/hooks/useRouteTransition.js.map +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/modal/w3m-account-button/index.js +2 -2
- package/lib/module/modal/w3m-account-button/index.js.map +1 -1
- package/lib/module/modal/w3m-modal/index.js +24 -54
- package/lib/module/modal/w3m-modal/index.js.map +1 -1
- package/lib/module/modal/w3m-modal/styles.js +1 -6
- package/lib/module/modal/w3m-modal/styles.js.map +1 -1
- package/lib/module/modal/w3m-network-button/index.js +2 -2
- package/lib/module/modal/w3m-network-button/index.js.map +1 -1
- package/lib/module/modal/w3m-router/index.js +17 -2
- package/lib/module/modal/w3m-router/index.js.map +1 -1
- package/lib/module/partials/w3m-account-activity/index.js +9 -9
- package/lib/module/partials/w3m-account-activity/index.js.map +1 -1
- package/lib/module/partials/w3m-account-tokens/index.js +6 -6
- package/lib/module/partials/w3m-account-tokens/index.js.map +1 -1
- package/lib/module/partials/w3m-account-wallet-features/index.js +7 -10
- package/lib/module/partials/w3m-account-wallet-features/index.js.map +1 -1
- package/lib/module/partials/w3m-all-wallets-list/components/Loading.js +109 -0
- package/lib/module/partials/w3m-all-wallets-list/components/Loading.js.map +1 -0
- package/lib/module/partials/w3m-all-wallets-list/components/WalletItem.js +42 -0
- package/lib/module/partials/w3m-all-wallets-list/components/WalletItem.js.map +1 -0
- package/lib/module/partials/w3m-all-wallets-list/index.js +26 -57
- package/lib/module/partials/w3m-all-wallets-list/index.js.map +1 -1
- package/lib/module/partials/w3m-all-wallets-list/styles.js +3 -5
- package/lib/module/partials/w3m-all-wallets-list/styles.js.map +1 -1
- package/lib/module/partials/w3m-all-wallets-search/index.js +26 -48
- package/lib/module/partials/w3m-all-wallets-search/index.js.map +1 -1
- package/lib/module/partials/w3m-all-wallets-search/styles.js +2 -5
- package/lib/module/partials/w3m-all-wallets-search/styles.js.map +1 -1
- package/lib/module/partials/w3m-connecting-body/index.js +2 -2
- package/lib/module/partials/w3m-connecting-body/index.js.map +1 -1
- package/lib/module/partials/w3m-connecting-mobile/index.js +18 -17
- package/lib/module/partials/w3m-connecting-mobile/index.js.map +1 -1
- package/lib/module/partials/w3m-connecting-qrcode/components/ReownButton.js +32 -0
- package/lib/module/partials/w3m-connecting-qrcode/components/ReownButton.js.map +1 -0
- package/lib/module/partials/w3m-connecting-qrcode/index.js +11 -14
- package/lib/module/partials/w3m-connecting-qrcode/index.js.map +1 -1
- package/lib/module/partials/w3m-connecting-qrcode/styles.js +3 -0
- package/lib/module/partials/w3m-connecting-qrcode/styles.js.map +1 -1
- package/lib/module/partials/w3m-connecting-web/index.js +15 -13
- package/lib/module/partials/w3m-connecting-web/index.js.map +1 -1
- package/lib/module/partials/w3m-header/index.js +9 -17
- package/lib/module/partials/w3m-header/index.js.map +1 -1
- package/lib/module/partials/w3m-information-modal/index.js +33 -31
- package/lib/module/partials/w3m-information-modal/index.js.map +1 -1
- package/lib/module/partials/w3m-information-modal/styles.js +7 -5
- package/lib/module/partials/w3m-information-modal/styles.js.map +1 -1
- package/lib/module/partials/w3m-placeholder/index.js +5 -5
- package/lib/module/partials/w3m-placeholder/index.js.map +1 -1
- package/lib/module/partials/w3m-selector-modal/index.js +66 -68
- package/lib/module/partials/w3m-selector-modal/index.js.map +1 -1
- package/lib/module/partials/w3m-selector-modal/styles.js +1 -0
- package/lib/module/partials/w3m-selector-modal/styles.js.map +1 -1
- package/lib/module/partials/w3m-send-input-token/index.js +2 -2
- package/lib/module/partials/w3m-send-input-token/index.js.map +1 -1
- package/lib/module/partials/w3m-swap-input/index.js +2 -2
- package/lib/module/partials/w3m-swap-input/index.js.map +1 -1
- package/lib/module/types.js +4 -0
- package/lib/module/types.js.map +1 -0
- package/lib/module/utils/HelpersUtil.js +21 -1
- package/lib/module/utils/HelpersUtil.js.map +1 -1
- package/lib/module/utils/NetworkUtil.js +2 -2
- package/lib/module/utils/NetworkUtil.js.map +1 -1
- package/lib/module/utils/RouterUtil.js +48 -0
- package/lib/module/utils/RouterUtil.js.map +1 -0
- package/lib/module/utils/UiUtil.js +16 -20
- package/lib/module/utils/UiUtil.js.map +1 -1
- package/lib/module/views/w3m-account-default-view/components/auth-buttons.js +2 -2
- package/lib/module/views/w3m-account-default-view/components/auth-buttons.js.map +1 -1
- package/lib/module/views/w3m-account-default-view/index.js +20 -21
- package/lib/module/views/w3m-account-default-view/index.js.map +1 -1
- package/lib/module/views/w3m-account-view/index.js +5 -21
- package/lib/module/views/w3m-account-view/index.js.map +1 -1
- package/lib/module/views/w3m-all-wallets-view/index.js +19 -10
- package/lib/module/views/w3m-all-wallets-view/index.js.map +1 -1
- package/lib/module/views/w3m-connect-socials-view/index.js +1 -2
- package/lib/module/views/w3m-connect-socials-view/index.js.map +1 -1
- package/lib/module/views/w3m-connect-view/components/all-wallet-list.js +6 -3
- package/lib/module/views/w3m-connect-view/components/all-wallet-list.js.map +1 -1
- package/lib/module/views/w3m-connect-view/components/custom-wallet-list.js +10 -4
- package/lib/module/views/w3m-connect-view/components/custom-wallet-list.js.map +1 -1
- package/lib/module/views/w3m-connect-view/components/recent-wallet-list.js +6 -3
- package/lib/module/views/w3m-connect-view/components/recent-wallet-list.js.map +1 -1
- package/lib/module/views/w3m-connect-view/components/social-login-list.js +4 -4
- package/lib/module/views/w3m-connect-view/components/social-login-list.js.map +1 -1
- package/lib/module/views/w3m-connect-view/index.js +9 -10
- package/lib/module/views/w3m-connect-view/index.js.map +1 -1
- package/lib/module/views/w3m-connecting-external-view/index.js +35 -20
- package/lib/module/views/w3m-connecting-external-view/index.js.map +1 -1
- package/lib/module/views/w3m-connecting-siwe-view/index.js +8 -13
- package/lib/module/views/w3m-connecting-siwe-view/index.js.map +1 -1
- package/lib/module/views/w3m-connecting-social-view/index.js +12 -15
- package/lib/module/views/w3m-connecting-social-view/index.js.map +1 -1
- package/lib/module/views/w3m-connecting-view/index.js +11 -13
- package/lib/module/views/w3m-connecting-view/index.js.map +1 -1
- package/lib/module/views/w3m-get-wallet-view/index.js +7 -4
- package/lib/module/views/w3m-get-wallet-view/index.js.map +1 -1
- package/lib/module/views/w3m-network-switch-view/index.js +9 -7
- package/lib/module/views/w3m-network-switch-view/index.js.map +1 -1
- package/lib/module/views/w3m-networks-view/index.js +11 -14
- package/lib/module/views/w3m-networks-view/index.js.map +1 -1
- package/lib/module/views/w3m-onramp-checkout-view/index.js +17 -17
- package/lib/module/views/w3m-onramp-checkout-view/index.js.map +1 -1
- package/lib/module/views/w3m-onramp-loading-view/index.js +1 -2
- package/lib/module/views/w3m-onramp-loading-view/index.js.map +1 -1
- package/lib/module/views/w3m-onramp-settings-view/components/Country.js +4 -4
- package/lib/module/views/w3m-onramp-settings-view/components/Country.js.map +1 -1
- package/lib/module/views/w3m-onramp-settings-view/index.js +4 -4
- package/lib/module/views/w3m-onramp-settings-view/index.js.map +1 -1
- package/lib/module/views/w3m-onramp-settings-view/utils.js.map +1 -1
- package/lib/module/views/w3m-onramp-transaction-view/index.js +5 -5
- package/lib/module/views/w3m-onramp-transaction-view/index.js.map +1 -1
- package/lib/module/views/w3m-onramp-view/components/Currency.js +2 -2
- package/lib/module/views/w3m-onramp-view/components/Currency.js.map +1 -1
- package/lib/module/views/w3m-onramp-view/components/CurrencyInput.js +2 -2
- package/lib/module/views/w3m-onramp-view/components/CurrencyInput.js.map +1 -1
- package/lib/module/views/w3m-onramp-view/components/Header.js +5 -6
- package/lib/module/views/w3m-onramp-view/components/Header.js.map +1 -1
- package/lib/module/views/w3m-onramp-view/components/PaymentButton.js +4 -4
- package/lib/module/views/w3m-onramp-view/components/PaymentButton.js.map +1 -1
- package/lib/module/views/w3m-onramp-view/components/PaymentMethod.js +2 -2
- package/lib/module/views/w3m-onramp-view/components/PaymentMethod.js.map +1 -1
- package/lib/module/views/w3m-onramp-view/components/Quote.js +4 -4
- package/lib/module/views/w3m-onramp-view/components/Quote.js.map +1 -1
- package/lib/module/views/w3m-onramp-view/components/SelectPaymentModal.js +68 -69
- package/lib/module/views/w3m-onramp-view/components/SelectPaymentModal.js.map +1 -1
- package/lib/module/views/w3m-onramp-view/index.js +2 -2
- package/lib/module/views/w3m-onramp-view/index.js.map +1 -1
- package/lib/module/views/w3m-swap-preview-view/index.js +3 -17
- package/lib/module/views/w3m-swap-preview-view/index.js.map +1 -1
- package/lib/module/views/w3m-swap-preview-view/styles.js +3 -0
- package/lib/module/views/w3m-swap-preview-view/styles.js.map +1 -1
- package/lib/module/views/w3m-swap-view/components/select-token-view/index.js +6 -6
- package/lib/module/views/w3m-swap-view/components/select-token-view/index.js.map +1 -1
- package/lib/module/views/w3m-swap-view/components/select-token-view/styles.js +1 -2
- package/lib/module/views/w3m-swap-view/components/select-token-view/styles.js.map +1 -1
- package/lib/module/views/w3m-swap-view/components/select-token-view/utils.js.map +1 -1
- package/lib/module/views/w3m-swap-view/index.js +14 -25
- package/lib/module/views/w3m-swap-view/index.js.map +1 -1
- package/lib/module/views/w3m-swap-view/styles.js +5 -1
- package/lib/module/views/w3m-swap-view/styles.js.map +1 -1
- package/lib/module/views/w3m-unsupported-chain-view/index.js +4 -6
- package/lib/module/views/w3m-unsupported-chain-view/index.js.map +1 -1
- package/lib/module/views/w3m-wallet-compatible-networks-view/index.js +4 -4
- package/lib/module/views/w3m-wallet-compatible-networks-view/index.js.map +1 -1
- package/lib/module/views/w3m-wallet-receive-view/index.js +4 -5
- package/lib/module/views/w3m-wallet-receive-view/index.js.map +1 -1
- package/lib/module/views/w3m-wallet-send-preview-view/components/preview-send-details.js +2 -2
- package/lib/module/views/w3m-wallet-send-preview-view/components/preview-send-details.js.map +1 -1
- package/lib/module/views/w3m-wallet-send-preview-view/index.js +1 -2
- package/lib/module/views/w3m-wallet-send-preview-view/index.js.map +1 -1
- package/lib/module/views/w3m-wallet-send-select-token-view/index.js +3 -4
- package/lib/module/views/w3m-wallet-send-select-token-view/index.js.map +1 -1
- package/lib/module/views/w3m-wallet-send-view/index.js +6 -15
- package/lib/module/views/w3m-wallet-send-view/index.js.map +1 -1
- package/lib/module/views/w3m-wallet-send-view/styles.js +3 -0
- package/lib/module/views/w3m-wallet-send-view/styles.js.map +1 -1
- package/lib/module/views/w3m-what-is-a-network-view/index.js +1 -2
- package/lib/module/views/w3m-what-is-a-network-view/index.js.map +1 -1
- package/lib/module/views/w3m-what-is-a-wallet-view/index.js +1 -2
- package/lib/module/views/w3m-what-is-a-wallet-view/index.js.map +1 -1
- package/lib/typescript/AppKit.d.ts +13 -27
- package/lib/typescript/AppKit.d.ts.map +1 -1
- package/lib/typescript/AppKitContext.d.ts +4 -3
- package/lib/typescript/AppKitContext.d.ts.map +1 -1
- package/lib/typescript/connectors/WalletConnectConnector.d.ts +1 -1
- package/lib/typescript/connectors/WalletConnectConnector.d.ts.map +1 -1
- package/lib/typescript/hooks/useAppKitEvents.d.ts +4 -3
- package/lib/typescript/hooks/useAppKitEvents.d.ts.map +1 -1
- package/lib/typescript/hooks/useProvider.d.ts +28 -1
- package/lib/typescript/hooks/useProvider.d.ts.map +1 -1
- package/lib/typescript/hooks/useRouteTransition.d.ts +16 -0
- package/lib/typescript/hooks/useRouteTransition.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +1 -0
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/modal/w3m-account-button/index.d.ts.map +1 -1
- package/lib/typescript/modal/w3m-modal/index.d.ts.map +1 -1
- package/lib/typescript/modal/w3m-modal/styles.d.ts +0 -5
- package/lib/typescript/modal/w3m-modal/styles.d.ts.map +1 -1
- package/lib/typescript/modal/w3m-network-button/index.d.ts.map +1 -1
- package/lib/typescript/modal/w3m-router/index.d.ts.map +1 -1
- package/lib/typescript/partials/w3m-account-activity/index.d.ts.map +1 -1
- package/lib/typescript/partials/w3m-account-tokens/index.d.ts.map +1 -1
- package/lib/typescript/partials/w3m-account-wallet-features/index.d.ts +1 -4
- package/lib/typescript/partials/w3m-account-wallet-features/index.d.ts.map +1 -1
- package/lib/typescript/partials/w3m-all-wallets-list/components/Loading.d.ts +10 -0
- package/lib/typescript/partials/w3m-all-wallets-list/components/Loading.d.ts.map +1 -0
- package/lib/typescript/partials/w3m-all-wallets-list/components/WalletItem.d.ts +15 -0
- package/lib/typescript/partials/w3m-all-wallets-list/components/WalletItem.d.ts.map +1 -0
- package/lib/typescript/partials/w3m-all-wallets-list/index.d.ts +3 -2
- package/lib/typescript/partials/w3m-all-wallets-list/index.d.ts.map +1 -1
- package/lib/typescript/partials/w3m-all-wallets-list/styles.d.ts +2 -4
- package/lib/typescript/partials/w3m-all-wallets-list/styles.d.ts.map +1 -1
- package/lib/typescript/partials/w3m-all-wallets-search/index.d.ts +3 -2
- package/lib/typescript/partials/w3m-all-wallets-search/index.d.ts.map +1 -1
- package/lib/typescript/partials/w3m-all-wallets-search/styles.d.ts +1 -4
- package/lib/typescript/partials/w3m-all-wallets-search/styles.d.ts.map +1 -1
- package/lib/typescript/partials/w3m-connecting-header/index.d.ts +1 -1
- package/lib/typescript/partials/w3m-connecting-header/index.d.ts.map +1 -1
- package/lib/typescript/partials/w3m-connecting-mobile/index.d.ts.map +1 -1
- package/lib/typescript/partials/w3m-connecting-qrcode/components/ReownButton.d.ts +7 -0
- package/lib/typescript/partials/w3m-connecting-qrcode/components/ReownButton.d.ts.map +1 -0
- package/lib/typescript/partials/w3m-connecting-qrcode/index.d.ts.map +1 -1
- package/lib/typescript/partials/w3m-connecting-qrcode/styles.d.ts +3 -0
- package/lib/typescript/partials/w3m-connecting-qrcode/styles.d.ts.map +1 -1
- package/lib/typescript/partials/w3m-header/index.d.ts.map +1 -1
- package/lib/typescript/partials/w3m-information-modal/index.d.ts.map +1 -1
- package/lib/typescript/partials/w3m-information-modal/styles.d.ts +2 -0
- package/lib/typescript/partials/w3m-information-modal/styles.d.ts.map +1 -1
- package/lib/typescript/partials/w3m-selector-modal/index.d.ts.map +1 -1
- package/lib/typescript/partials/w3m-selector-modal/styles.d.ts +1 -0
- package/lib/typescript/partials/w3m-selector-modal/styles.d.ts.map +1 -1
- package/lib/typescript/partials/w3m-swap-input/index.d.ts +1 -1
- package/lib/typescript/partials/w3m-swap-input/index.d.ts.map +1 -1
- package/lib/typescript/types.d.ts +156 -0
- package/lib/typescript/types.d.ts.map +1 -0
- package/lib/typescript/utils/HelpersUtil.d.ts +5 -3
- package/lib/typescript/utils/HelpersUtil.d.ts.map +1 -1
- package/lib/typescript/utils/NetworkUtil.d.ts +2 -3
- package/lib/typescript/utils/NetworkUtil.d.ts.map +1 -1
- package/lib/typescript/utils/RouterUtil.d.ts +9 -0
- package/lib/typescript/utils/RouterUtil.d.ts.map +1 -0
- package/lib/typescript/utils/UiUtil.d.ts +2 -6
- package/lib/typescript/utils/UiUtil.d.ts.map +1 -1
- package/lib/typescript/views/w3m-account-default-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-account-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-all-wallets-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-connect-socials-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-connect-view/components/all-wallet-list.d.ts +1 -1
- package/lib/typescript/views/w3m-connect-view/components/all-wallet-list.d.ts.map +1 -1
- package/lib/typescript/views/w3m-connect-view/components/custom-wallet-list.d.ts +1 -1
- package/lib/typescript/views/w3m-connect-view/components/custom-wallet-list.d.ts.map +1 -1
- package/lib/typescript/views/w3m-connect-view/components/recent-wallet-list.d.ts +1 -1
- package/lib/typescript/views/w3m-connect-view/components/recent-wallet-list.d.ts.map +1 -1
- package/lib/typescript/views/w3m-connect-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-connect-view/utils.d.ts +1 -1
- package/lib/typescript/views/w3m-connect-view/utils.d.ts.map +1 -1
- package/lib/typescript/views/w3m-connecting-external-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-connecting-siwe-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-connecting-social-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-connecting-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-get-wallet-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-network-switch-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-networks-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-onramp-checkout-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-onramp-loading-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-onramp-settings-view/components/Country.d.ts +1 -1
- package/lib/typescript/views/w3m-onramp-settings-view/components/Country.d.ts.map +1 -1
- package/lib/typescript/views/w3m-onramp-settings-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-onramp-settings-view/utils.d.ts +1 -1
- package/lib/typescript/views/w3m-onramp-settings-view/utils.d.ts.map +1 -1
- package/lib/typescript/views/w3m-onramp-view/components/Currency.d.ts +1 -1
- package/lib/typescript/views/w3m-onramp-view/components/Currency.d.ts.map +1 -1
- package/lib/typescript/views/w3m-onramp-view/components/Header.d.ts.map +1 -1
- package/lib/typescript/views/w3m-onramp-view/components/PaymentMethod.d.ts +1 -1
- package/lib/typescript/views/w3m-onramp-view/components/PaymentMethod.d.ts.map +1 -1
- package/lib/typescript/views/w3m-onramp-view/components/Quote.d.ts +1 -1
- package/lib/typescript/views/w3m-onramp-view/components/Quote.d.ts.map +1 -1
- package/lib/typescript/views/w3m-onramp-view/components/SelectPaymentModal.d.ts.map +1 -1
- package/lib/typescript/views/w3m-onramp-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-onramp-view/utils.d.ts +1 -1
- package/lib/typescript/views/w3m-onramp-view/utils.d.ts.map +1 -1
- package/lib/typescript/views/w3m-swap-preview-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-swap-preview-view/styles.d.ts +3 -0
- package/lib/typescript/views/w3m-swap-preview-view/styles.d.ts.map +1 -1
- package/lib/typescript/views/w3m-swap-view/components/select-token-view/index.d.ts +4 -2
- package/lib/typescript/views/w3m-swap-view/components/select-token-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-swap-view/components/select-token-view/styles.d.ts +0 -1
- package/lib/typescript/views/w3m-swap-view/components/select-token-view/styles.d.ts.map +1 -1
- package/lib/typescript/views/w3m-swap-view/components/select-token-view/utils.d.ts +1 -1
- package/lib/typescript/views/w3m-swap-view/components/select-token-view/utils.d.ts.map +1 -1
- package/lib/typescript/views/w3m-swap-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-swap-view/styles.d.ts +5 -1
- package/lib/typescript/views/w3m-swap-view/styles.d.ts.map +1 -1
- package/lib/typescript/views/w3m-unsupported-chain-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-wallet-compatible-networks-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-wallet-receive-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-wallet-send-preview-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-wallet-send-select-token-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-wallet-send-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-wallet-send-view/styles.d.ts +3 -0
- package/lib/typescript/views/w3m-wallet-send-view/styles.d.ts.map +1 -1
- package/lib/typescript/views/w3m-what-is-a-network-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-what-is-a-wallet-view/index.d.ts.map +1 -1
- package/package.json +5 -6
- package/src/AppKit.ts +206 -133
- package/src/AppKitContext.tsx +2 -2
- package/src/connectors/WalletConnectConnector.ts +23 -8
- package/src/hooks/useAppKitEvents.ts +2 -5
- package/src/hooks/useProvider.ts +30 -9
- package/src/hooks/useRouteTransition.ts +102 -0
- package/src/index.ts +1 -0
- package/src/modal/w3m-account-button/index.tsx +3 -2
- package/src/modal/w3m-modal/index.tsx +24 -60
- package/src/modal/w3m-modal/styles.ts +1 -6
- package/src/modal/w3m-network-button/index.tsx +2 -1
- package/src/modal/w3m-router/index.tsx +17 -2
- package/src/partials/w3m-account-activity/index.tsx +9 -8
- package/src/partials/w3m-account-tokens/index.tsx +4 -3
- package/src/partials/w3m-account-wallet-features/index.tsx +8 -14
- package/src/partials/w3m-all-wallets-list/components/Loading.tsx +47 -0
- package/src/partials/w3m-all-wallets-list/components/WalletItem.tsx +47 -0
- package/src/partials/w3m-all-wallets-list/index.tsx +31 -63
- package/src/partials/w3m-all-wallets-list/styles.ts +3 -5
- package/src/partials/w3m-all-wallets-search/index.tsx +28 -58
- package/src/partials/w3m-all-wallets-search/styles.ts +2 -5
- package/src/partials/w3m-connecting-body/index.tsx +2 -2
- package/src/partials/w3m-connecting-header/index.tsx +1 -1
- package/src/partials/w3m-connecting-mobile/index.tsx +19 -18
- package/src/partials/w3m-connecting-qrcode/components/ReownButton.tsx +20 -0
- package/src/partials/w3m-connecting-qrcode/index.tsx +18 -16
- package/src/partials/w3m-connecting-qrcode/styles.ts +3 -0
- package/src/partials/w3m-connecting-web/index.tsx +15 -15
- package/src/partials/w3m-header/index.tsx +5 -16
- package/src/partials/w3m-information-modal/index.tsx +28 -32
- package/src/partials/w3m-information-modal/styles.ts +7 -5
- package/src/partials/w3m-placeholder/index.tsx +8 -8
- package/src/partials/w3m-selector-modal/index.tsx +64 -68
- package/src/partials/w3m-selector-modal/styles.ts +1 -0
- package/src/partials/w3m-send-input-token/index.tsx +2 -2
- package/src/partials/w3m-swap-input/index.tsx +3 -4
- package/src/types.ts +187 -0
- package/src/utils/HelpersUtil.ts +33 -2
- package/src/utils/NetworkUtil.ts +4 -4
- package/src/utils/RouterUtil.ts +50 -0
- package/src/utils/UiUtil.ts +17 -29
- package/src/views/w3m-account-default-view/components/auth-buttons.tsx +2 -2
- package/src/views/w3m-account-default-view/index.tsx +27 -26
- package/src/views/w3m-account-view/index.tsx +6 -21
- package/src/views/w3m-all-wallets-view/index.tsx +29 -15
- package/src/views/w3m-connect-socials-view/index.tsx +1 -2
- package/src/views/w3m-connect-view/components/all-wallet-list.tsx +7 -5
- package/src/views/w3m-connect-view/components/custom-wallet-list.tsx +15 -7
- package/src/views/w3m-connect-view/components/recent-wallet-list.tsx +6 -4
- package/src/views/w3m-connect-view/components/social-login-list.tsx +4 -4
- package/src/views/w3m-connect-view/index.tsx +20 -16
- package/src/views/w3m-connect-view/utils.ts +1 -1
- package/src/views/w3m-connecting-external-view/index.tsx +31 -18
- package/src/views/w3m-connecting-siwe-view/index.tsx +5 -11
- package/src/views/w3m-connecting-social-view/index.tsx +19 -15
- package/src/views/w3m-connecting-view/index.tsx +12 -14
- package/src/views/w3m-get-wallet-view/index.tsx +6 -4
- package/src/views/w3m-network-switch-view/index.tsx +10 -8
- package/src/views/w3m-networks-view/index.tsx +14 -15
- package/src/views/w3m-onramp-checkout-view/index.tsx +17 -16
- package/src/views/w3m-onramp-loading-view/index.tsx +8 -2
- package/src/views/w3m-onramp-settings-view/components/Country.tsx +6 -4
- package/src/views/w3m-onramp-settings-view/index.tsx +6 -9
- package/src/views/w3m-onramp-settings-view/utils.ts +2 -5
- package/src/views/w3m-onramp-transaction-view/index.tsx +6 -6
- package/src/views/w3m-onramp-view/components/Currency.tsx +3 -3
- package/src/views/w3m-onramp-view/components/CurrencyInput.tsx +2 -2
- package/src/views/w3m-onramp-view/components/Header.tsx +4 -6
- package/src/views/w3m-onramp-view/components/PaymentButton.tsx +4 -4
- package/src/views/w3m-onramp-view/components/PaymentMethod.tsx +4 -3
- package/src/views/w3m-onramp-view/components/Quote.tsx +4 -5
- package/src/views/w3m-onramp-view/components/SelectPaymentModal.tsx +51 -61
- package/src/views/w3m-onramp-view/index.tsx +8 -4
- package/src/views/w3m-swap-preview-view/index.tsx +5 -17
- package/src/views/w3m-swap-preview-view/styles.ts +3 -0
- package/src/views/w3m-swap-view/components/select-token-view/index.tsx +19 -9
- package/src/views/w3m-swap-view/components/select-token-view/styles.ts +1 -2
- package/src/views/w3m-swap-view/components/select-token-view/utils.ts +2 -1
- package/src/views/w3m-swap-view/index.tsx +18 -27
- package/src/views/w3m-swap-view/styles.ts +5 -1
- package/src/views/w3m-unsupported-chain-view/index.tsx +4 -5
- package/src/views/w3m-wallet-compatible-networks-view/index.tsx +10 -4
- package/src/views/w3m-wallet-receive-view/index.tsx +8 -4
- package/src/views/w3m-wallet-send-preview-view/components/preview-send-details.tsx +2 -2
- package/src/views/w3m-wallet-send-preview-view/index.tsx +10 -2
- package/src/views/w3m-wallet-send-select-token-view/index.tsx +9 -3
- package/src/views/w3m-wallet-send-view/index.tsx +5 -11
- package/src/views/w3m-wallet-send-view/styles.ts +3 -0
- package/src/views/w3m-what-is-a-network-view/index.tsx +1 -2
- package/src/views/w3m-what-is-a-wallet-view/index.tsx +1 -2
- package/lib/commonjs/config/animations.js +0 -9
- package/lib/commonjs/config/animations.js.map +0 -1
- package/lib/commonjs/hooks/useCustomDimensions.js +0 -33
- package/lib/commonjs/hooks/useCustomDimensions.js.map +0 -1
- package/lib/commonjs/partials/w3m-otp-code/index.js +0 -89
- package/lib/commonjs/partials/w3m-otp-code/index.js.map +0 -1
- package/lib/commonjs/partials/w3m-otp-code/styles.js +0 -21
- package/lib/commonjs/partials/w3m-otp-code/styles.js.map +0 -1
- package/lib/module/config/animations.js +0 -9
- package/lib/module/config/animations.js.map +0 -1
- package/lib/module/hooks/useCustomDimensions.js +0 -30
- package/lib/module/hooks/useCustomDimensions.js.map +0 -1
- package/lib/module/partials/w3m-otp-code/index.js +0 -84
- package/lib/module/partials/w3m-otp-code/index.js.map +0 -1
- package/lib/module/partials/w3m-otp-code/styles.js +0 -17
- package/lib/module/partials/w3m-otp-code/styles.js.map +0 -1
- package/lib/typescript/config/animations.d.ts +0 -2
- package/lib/typescript/config/animations.d.ts.map +0 -1
- package/lib/typescript/hooks/useCustomDimensions.d.ts +0 -11
- package/lib/typescript/hooks/useCustomDimensions.d.ts.map +0 -1
- package/lib/typescript/partials/w3m-otp-code/index.d.ts +0 -16
- package/lib/typescript/partials/w3m-otp-code/index.d.ts.map +0 -1
- package/lib/typescript/partials/w3m-otp-code/styles.d.ts +0 -14
- package/lib/typescript/partials/w3m-otp-code/styles.d.ts.map +0 -1
- package/src/config/animations.ts +0 -7
- package/src/hooks/useCustomDimensions.ts +0 -21
- package/src/partials/w3m-otp-code/index.tsx +0 -81
- package/src/partials/w3m-otp-code/styles.ts +0 -15
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/views/w3m-wallet-send-preview-view/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/views/w3m-wallet-send-preview-view/index.tsx"],"names":[],"mappings":"AAsBA,wBAAgB,qBAAqB,4CAgHpC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/views/w3m-wallet-send-select-token-view/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/views/w3m-wallet-send-select-token-view/index.tsx"],"names":[],"mappings":"AAsBA,wBAAgB,yBAAyB,4CA+DxC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/views/w3m-wallet-send-view/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/views/w3m-wallet-send-view/index.tsx"],"names":[],"mappings":"AAeA,wBAAgB,cAAc,4CAwG7B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/views/w3m-wallet-send-view/styles.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/views/w3m-wallet-send-view/styles.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAGA,wBAoBG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/views/w3m-what-is-a-network-view/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/views/w3m-what-is-a-network-view/index.tsx"],"names":[],"mappings":"AAIA,wBAAgB,kBAAkB,4CA2CjC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/views/w3m-what-is-a-wallet-view/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/views/w3m-what-is-a-wallet-view/index.tsx"],"names":[],"mappings":"AAKA,wBAAgB,iBAAiB,4CA6DhC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reown/appkit-react-native",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.4",
|
|
4
4
|
"main": "lib/commonjs/index.js",
|
|
5
5
|
"types": "lib/typescript/index.d.ts",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -38,12 +38,11 @@
|
|
|
38
38
|
"access": "public"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@reown/appkit-common-react-native": "2.0.0-alpha.
|
|
42
|
-
"@reown/appkit-core-react-native": "2.0.0-alpha.
|
|
43
|
-
"@reown/appkit-siwe-react-native": "2.0.0-alpha.
|
|
44
|
-
"@reown/appkit-ui-react-native": "2.0.0-alpha.
|
|
41
|
+
"@reown/appkit-common-react-native": "2.0.0-alpha.4",
|
|
42
|
+
"@reown/appkit-core-react-native": "2.0.0-alpha.4",
|
|
43
|
+
"@reown/appkit-siwe-react-native": "2.0.0-alpha.4",
|
|
44
|
+
"@reown/appkit-ui-react-native": "2.0.0-alpha.4",
|
|
45
45
|
"@walletconnect/universal-provider": "2.21.5",
|
|
46
|
-
"react-native-modal": ">=13",
|
|
47
46
|
"valtio": "2.1.5"
|
|
48
47
|
},
|
|
49
48
|
"peerDependencies": {
|
package/src/AppKit.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { subscribeKey } from 'valtio/utils';
|
|
1
2
|
import {
|
|
2
|
-
type Features,
|
|
3
3
|
EventsController,
|
|
4
4
|
ModalController,
|
|
5
5
|
ConnectionsController,
|
|
@@ -7,14 +7,14 @@ import {
|
|
|
7
7
|
RouterController,
|
|
8
8
|
TransactionsController,
|
|
9
9
|
StorageUtil,
|
|
10
|
-
type OptionsControllerState,
|
|
11
10
|
ThemeController,
|
|
12
|
-
|
|
11
|
+
WcController,
|
|
13
12
|
SwapController,
|
|
14
13
|
OnRampController,
|
|
15
14
|
CoreHelperUtil,
|
|
16
15
|
SendController,
|
|
17
|
-
BlockchainApiController
|
|
16
|
+
BlockchainApiController,
|
|
17
|
+
WalletUtil
|
|
18
18
|
} from '@reown/appkit-core-react-native';
|
|
19
19
|
|
|
20
20
|
import {
|
|
@@ -23,52 +23,26 @@ import {
|
|
|
23
23
|
type ProposalNamespaces,
|
|
24
24
|
type ConnectorType,
|
|
25
25
|
type Namespaces,
|
|
26
|
-
type Metadata,
|
|
27
26
|
type CaipNetworkId,
|
|
28
27
|
type AppKitNetwork,
|
|
29
28
|
type Provider,
|
|
30
|
-
type ThemeVariables,
|
|
31
|
-
type ThemeMode,
|
|
32
29
|
type WalletInfo,
|
|
33
|
-
type Network,
|
|
34
30
|
type ChainNamespace,
|
|
35
|
-
type Storage,
|
|
36
31
|
type AppKitConnectOptions,
|
|
37
|
-
type AppKitSIWEClient,
|
|
38
32
|
type ConnectionProperties,
|
|
39
33
|
type AccountType,
|
|
40
34
|
type AppKitOpenOptions,
|
|
41
35
|
ConstantsUtil,
|
|
42
|
-
type Connection
|
|
36
|
+
type Connection,
|
|
37
|
+
type WcWallet
|
|
43
38
|
} from '@reown/appkit-common-react-native';
|
|
44
39
|
import { SIWEController } from '@reown/appkit-siwe-react-native';
|
|
45
40
|
|
|
46
41
|
import { WalletConnectConnector } from './connectors/WalletConnectConnector';
|
|
47
42
|
import { WcHelpersUtil } from './utils/HelpersUtil';
|
|
48
43
|
import { NetworkUtil } from './utils/NetworkUtil';
|
|
49
|
-
|
|
50
|
-
|
|
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
|
-
}
|
|
44
|
+
import { RouterUtil } from './utils/RouterUtil';
|
|
45
|
+
import { type AppKitConfig } from './types';
|
|
72
46
|
|
|
73
47
|
export class AppKit {
|
|
74
48
|
private projectId: string;
|
|
@@ -78,6 +52,7 @@ export class AppKit {
|
|
|
78
52
|
private config: AppKitConfig;
|
|
79
53
|
private extraConnectors: WalletConnector[];
|
|
80
54
|
private walletConnectConnector?: WalletConnector;
|
|
55
|
+
private balanceIntervalId?: ReturnType<typeof setInterval>;
|
|
81
56
|
|
|
82
57
|
constructor(config: AppKitConfig) {
|
|
83
58
|
this.projectId = config.projectId;
|
|
@@ -114,12 +89,16 @@ export class AppKit {
|
|
|
114
89
|
});
|
|
115
90
|
|
|
116
91
|
this.networks = networksWithAdapters;
|
|
117
|
-
this.namespaces = WcHelpersUtil.createNamespaces(
|
|
92
|
+
this.namespaces = WcHelpersUtil.createNamespaces(
|
|
93
|
+
this.networks,
|
|
94
|
+
config.universalProviderConfigOverride
|
|
95
|
+
) as ProposalNamespaces;
|
|
118
96
|
this.config = config;
|
|
119
97
|
this.extraConnectors = config.extraConnectors || [];
|
|
120
98
|
|
|
121
99
|
this.initControllers(config);
|
|
122
100
|
this.initConnectors();
|
|
101
|
+
this.watchBalance();
|
|
123
102
|
}
|
|
124
103
|
|
|
125
104
|
/**
|
|
@@ -127,59 +106,42 @@ export class AppKit {
|
|
|
127
106
|
* @param type - The type of connector to use.
|
|
128
107
|
* @param options - Optional connection options.
|
|
129
108
|
*/
|
|
130
|
-
async connect(
|
|
109
|
+
async connect(options?: AppKitConnectOptions): Promise<void> {
|
|
131
110
|
try {
|
|
132
|
-
const {
|
|
133
|
-
const connector = await this.createConnector(type);
|
|
134
|
-
|
|
135
|
-
const chain =
|
|
136
|
-
defaultChain ??
|
|
137
|
-
NetworkUtil.getDefaultChainId(this.namespaces, OptionsController.state.defaultNetwork);
|
|
111
|
+
const { wallet, walletId } = options ?? {};
|
|
138
112
|
|
|
139
|
-
|
|
140
|
-
namespaces: namespaces ?? this.namespaces,
|
|
141
|
-
defaultChain: chain,
|
|
142
|
-
universalLink,
|
|
143
|
-
siweConfig: this.config?.siweConfig
|
|
144
|
-
});
|
|
113
|
+
let targetWallet: WcWallet | undefined;
|
|
145
114
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
throw new Error('Connection cancelled or failed: No approved namespaces returned.');
|
|
115
|
+
if (walletId) {
|
|
116
|
+
targetWallet = WalletUtil.getWallet(walletId);
|
|
117
|
+
} else if (wallet) {
|
|
118
|
+
targetWallet = wallet;
|
|
151
119
|
}
|
|
152
120
|
|
|
153
|
-
|
|
154
|
-
const approvedAdapters = this.setupAdaptersAndSubscribe(
|
|
155
|
-
connector,
|
|
156
|
-
Object.keys(approvedNamespaces)
|
|
157
|
-
);
|
|
121
|
+
const connectorType = WcHelpersUtil.getConnectorTypeByWallet(targetWallet);
|
|
158
122
|
|
|
159
|
-
|
|
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
|
-
}
|
|
123
|
+
const connector = await this.createConnector(connectorType);
|
|
164
124
|
|
|
165
|
-
|
|
166
|
-
|
|
125
|
+
const chain = NetworkUtil.getDefaultNetwork(
|
|
126
|
+
this.namespaces,
|
|
127
|
+
OptionsController.state.defaultNetwork
|
|
128
|
+
);
|
|
167
129
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
130
|
+
const approvedNamespaces = await connector.connect({
|
|
131
|
+
namespaces: this.namespaces,
|
|
132
|
+
defaultNetwork: chain,
|
|
133
|
+
universalLink: targetWallet?.link_mode ?? undefined,
|
|
134
|
+
siweConfig: this.config?.siweConfig
|
|
172
135
|
});
|
|
173
136
|
|
|
174
|
-
this.
|
|
137
|
+
this.processConnection(connector, approvedNamespaces);
|
|
175
138
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
ModalController.close();
|
|
139
|
+
// Save connector type and namespaces in storage
|
|
140
|
+
if (approvedNamespaces && Object.keys(approvedNamespaces).length > 0) {
|
|
141
|
+
await StorageUtil.setConnectedConnectors({
|
|
142
|
+
type: connector.type,
|
|
143
|
+
namespaces: Object.keys(approvedNamespaces)
|
|
144
|
+
});
|
|
183
145
|
}
|
|
184
146
|
} catch (error) {
|
|
185
147
|
console.warn('Connection failed:', error);
|
|
@@ -187,6 +149,47 @@ export class AppKit {
|
|
|
187
149
|
}
|
|
188
150
|
}
|
|
189
151
|
|
|
152
|
+
private processConnection(
|
|
153
|
+
connector: WalletConnector,
|
|
154
|
+
namespaces?: Namespaces,
|
|
155
|
+
shouldCloseModal: boolean = true
|
|
156
|
+
) {
|
|
157
|
+
if (!namespaces || Object.keys(namespaces).length === 0) {
|
|
158
|
+
throw new Error('No namespaces provided');
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
const walletInfo = connector.getWalletInfo();
|
|
162
|
+
const properties = connector.getProperties();
|
|
163
|
+
|
|
164
|
+
const initializedAdapters = this.setupAdaptersAndSubscribe(connector, Object.keys(namespaces));
|
|
165
|
+
|
|
166
|
+
if (initializedAdapters.length === 0) {
|
|
167
|
+
console.warn('No compatible adapters found for namespaces:', Object.keys(namespaces));
|
|
168
|
+
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
// Store the connection details
|
|
173
|
+
this.setConnection(initializedAdapters, namespaces, walletInfo, properties);
|
|
174
|
+
|
|
175
|
+
// Sync accounts
|
|
176
|
+
this.syncAccounts(initializedAdapters);
|
|
177
|
+
|
|
178
|
+
// Handle SIWE if enabled
|
|
179
|
+
this.handleSiweConnectionIfEnabled(shouldCloseModal);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
private handleSiweConnectionIfEnabled(shouldCloseModal: boolean = true): void {
|
|
183
|
+
if (
|
|
184
|
+
OptionsController.state.isSiweEnabled &&
|
|
185
|
+
ConnectionsController.state.activeNamespace === 'eip155'
|
|
186
|
+
) {
|
|
187
|
+
this.handleSiweChange({ isConnection: true });
|
|
188
|
+
} else if (shouldCloseModal) {
|
|
189
|
+
ModalController.close();
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
190
193
|
/**
|
|
191
194
|
* Disconnects from a given namespace.
|
|
192
195
|
* @param namespace - The namespace to disconnect from.
|
|
@@ -218,7 +221,7 @@ export class AppKit {
|
|
|
218
221
|
SwapController.resetState();
|
|
219
222
|
SendController.resetState();
|
|
220
223
|
OnRampController.resetState();
|
|
221
|
-
|
|
224
|
+
WcController.resetState();
|
|
222
225
|
|
|
223
226
|
if (ConnectionsController.state.activeNamespace === undefined) {
|
|
224
227
|
ConnectionsController.setActiveNamespace(
|
|
@@ -296,8 +299,33 @@ export class AppKit {
|
|
|
296
299
|
ModalController.open(options);
|
|
297
300
|
}
|
|
298
301
|
|
|
299
|
-
close() {
|
|
302
|
+
async close() {
|
|
300
303
|
ModalController.close();
|
|
304
|
+
|
|
305
|
+
if (OptionsController.state.isSiweEnabled && ConnectionsController.state.isConnected) {
|
|
306
|
+
const session = await SIWEController.getSession();
|
|
307
|
+
if (
|
|
308
|
+
!session &&
|
|
309
|
+
SIWEController.state.status !== 'success' &&
|
|
310
|
+
ConnectionsController.state.activeNamespace === 'eip155' &&
|
|
311
|
+
!!ConnectionsController.state.activeAddress
|
|
312
|
+
) {
|
|
313
|
+
await this.disconnect();
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
RouterUtil.checkOnRampBack();
|
|
318
|
+
RouterUtil.checkSocialLoginBack();
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
back() {
|
|
322
|
+
if (RouterController.state.history.length > 1) {
|
|
323
|
+
RouterUtil.checkBack();
|
|
324
|
+
|
|
325
|
+
return RouterController.goBack();
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
return this.close();
|
|
301
329
|
}
|
|
302
330
|
|
|
303
331
|
async switchAccountType(namespace: ChainNamespace, type: AccountType, network: AppKitNetwork) {
|
|
@@ -310,7 +338,7 @@ export class AppKit {
|
|
|
310
338
|
ConnectionsController.fetchBalance();
|
|
311
339
|
|
|
312
340
|
// Sync balances from adapter
|
|
313
|
-
this.
|
|
341
|
+
this.syncNativeBalance(adapter, network);
|
|
314
342
|
|
|
315
343
|
EventsController.sendEvent({
|
|
316
344
|
type: 'track',
|
|
@@ -357,13 +385,12 @@ export class AppKit {
|
|
|
357
385
|
return this.walletConnectConnector;
|
|
358
386
|
}
|
|
359
387
|
|
|
360
|
-
//TODO: reuse logic with connect method
|
|
361
388
|
/**
|
|
362
389
|
* Initializes connectors based on stored connection data.
|
|
363
390
|
* This attempts to restore previous sessions.
|
|
364
391
|
*/
|
|
365
392
|
private async initConnectors() {
|
|
366
|
-
const connectedConnectors = await StorageUtil.getConnectedConnectors();
|
|
393
|
+
const connectedConnectors = await StorageUtil.getConnectedConnectors();
|
|
367
394
|
if (connectedConnectors.length > 0) {
|
|
368
395
|
ModalController.setLoading(true);
|
|
369
396
|
|
|
@@ -372,31 +399,8 @@ export class AppKit {
|
|
|
372
399
|
const connector = await this.createConnector(connected.type);
|
|
373
400
|
|
|
374
401
|
const namespaces = connector.getNamespaces();
|
|
375
|
-
|
|
376
|
-
|
|
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
|
-
}
|
|
402
|
+
|
|
403
|
+
this.processConnection(connector, namespaces, false);
|
|
400
404
|
} catch (error) {
|
|
401
405
|
// Use console.warn for non-critical initialization failures
|
|
402
406
|
console.warn(`Failed to initialize connector type ${connected.type}:`, error);
|
|
@@ -423,7 +427,7 @@ export class AppKit {
|
|
|
423
427
|
}
|
|
424
428
|
|
|
425
429
|
adapters.forEach(adapter => {
|
|
426
|
-
adapter.
|
|
430
|
+
adapter.init({ connector });
|
|
427
431
|
this.subscribeToAdapterEvents(adapter);
|
|
428
432
|
});
|
|
429
433
|
|
|
@@ -447,12 +451,12 @@ export class AppKit {
|
|
|
447
451
|
n => n.id?.toString() === connection?.caipNetwork?.split(':')[1]
|
|
448
452
|
);
|
|
449
453
|
|
|
450
|
-
this.
|
|
454
|
+
this.syncNativeBalance(adapter, network);
|
|
451
455
|
this.syncIdentity(namespace, connection);
|
|
452
456
|
});
|
|
453
457
|
}
|
|
454
458
|
|
|
455
|
-
private
|
|
459
|
+
private syncNativeBalance(adapter: BlockchainAdapter, network?: AppKitNetwork) {
|
|
456
460
|
if (adapter && network) {
|
|
457
461
|
const accounts = adapter.getAccounts();
|
|
458
462
|
if (accounts && accounts.length > 0) {
|
|
@@ -501,6 +505,58 @@ export class AppKit {
|
|
|
501
505
|
}
|
|
502
506
|
}
|
|
503
507
|
|
|
508
|
+
private async refreshBalance(fetchAllBalances: boolean = false) {
|
|
509
|
+
try {
|
|
510
|
+
if (fetchAllBalances) {
|
|
511
|
+
ConnectionsController.fetchBalance();
|
|
512
|
+
}
|
|
513
|
+
const ns = ConnectionsController.state.activeNamespace;
|
|
514
|
+
const network = ConnectionsController.state.activeNetwork;
|
|
515
|
+
if (ns && network) {
|
|
516
|
+
const adapter = this.getAdapterByNamespace(ns);
|
|
517
|
+
if (adapter) {
|
|
518
|
+
this.syncNativeBalance(adapter, network);
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
} catch {
|
|
522
|
+
// ignore
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
private startBalancePolling(fetchAllBalances: boolean = false) {
|
|
527
|
+
if (this.balanceIntervalId) return;
|
|
528
|
+
// immediate fetch
|
|
529
|
+
this.refreshBalance(fetchAllBalances);
|
|
530
|
+
this.balanceIntervalId = setInterval(() => this.refreshBalance(fetchAllBalances), 10000);
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
private stopBalancePolling() {
|
|
534
|
+
if (this.balanceIntervalId) {
|
|
535
|
+
clearInterval(this.balanceIntervalId);
|
|
536
|
+
this.balanceIntervalId = undefined;
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
private watchBalance() {
|
|
541
|
+
// watch balance when user is on account or account default view
|
|
542
|
+
const recomputePolling = () => {
|
|
543
|
+
const open = ModalController.state.open;
|
|
544
|
+
const view = RouterController.state.view;
|
|
545
|
+
|
|
546
|
+
if (open && (view === 'Account' || view === 'AccountDefault')) {
|
|
547
|
+
// fetch all balances when user is using embedded wallet
|
|
548
|
+
this.startBalancePolling(view === 'Account');
|
|
549
|
+
} else {
|
|
550
|
+
this.stopBalancePolling();
|
|
551
|
+
}
|
|
552
|
+
};
|
|
553
|
+
|
|
554
|
+
recomputePolling();
|
|
555
|
+
|
|
556
|
+
subscribeKey(RouterController.state, 'view', () => recomputePolling());
|
|
557
|
+
subscribeKey(ModalController.state, 'open', () => recomputePolling());
|
|
558
|
+
}
|
|
559
|
+
|
|
504
560
|
private setConnection(
|
|
505
561
|
adapters: BlockchainAdapter[],
|
|
506
562
|
approvedNamespaces: Namespaces,
|
|
@@ -543,9 +599,7 @@ export class AppKit {
|
|
|
543
599
|
private subscribeToAdapterEvents(adapter: BlockchainAdapter): void {
|
|
544
600
|
adapter.on('accountsChanged', ({ accounts }) => {
|
|
545
601
|
const namespace = adapter.getSupportedNamespace();
|
|
546
|
-
|
|
547
|
-
console.log('accountsChanged', accounts, namespace);
|
|
548
|
-
//TODO: check this
|
|
602
|
+
ConnectionsController.updateAccounts(namespace, accounts);
|
|
549
603
|
|
|
550
604
|
if (namespace === 'eip155') {
|
|
551
605
|
this.handleSiweChange({ isAccountChange: true });
|
|
@@ -553,22 +607,34 @@ export class AppKit {
|
|
|
553
607
|
});
|
|
554
608
|
|
|
555
609
|
adapter.on('chainChanged', ({ chainId }) => {
|
|
556
|
-
//eslint-disable-next-line no-console
|
|
557
|
-
console.log('chainChanged', chainId);
|
|
558
610
|
const namespace = adapter.getSupportedNamespace();
|
|
559
611
|
const chain = `${namespace}:${chainId}` as CaipNetworkId;
|
|
560
612
|
ConnectionsController.setActiveNetwork(namespace, chain);
|
|
561
613
|
const connection = ConnectionsController.state.connections.get(namespace);
|
|
562
614
|
const isAuth = !!connection?.properties?.provider;
|
|
563
615
|
|
|
616
|
+
const activeNamespace = ConnectionsController.state.activeNamespace;
|
|
617
|
+
|
|
564
618
|
const network = this.networks.find(n => n.id?.toString() === chainId);
|
|
565
|
-
this.
|
|
619
|
+
this.syncNativeBalance(adapter, network);
|
|
566
620
|
SendController.resetState();
|
|
567
621
|
|
|
622
|
+
// Refresh balance for embedded wallets
|
|
568
623
|
if (isAuth) {
|
|
569
624
|
ConnectionsController.fetchBalance();
|
|
570
625
|
}
|
|
571
626
|
|
|
627
|
+
// Refresh transactions only when the active network changes
|
|
628
|
+
if (namespace === activeNamespace) {
|
|
629
|
+
const address = connection?.accounts?.find(account =>
|
|
630
|
+
account.startsWith(`${namespace}:${chainId}`)
|
|
631
|
+
);
|
|
632
|
+
if (address) {
|
|
633
|
+
TransactionsController.fetchTransactions(address, true);
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
// Check if user needs to sign in again
|
|
572
638
|
if (namespace === 'eip155') {
|
|
573
639
|
this.handleSiweChange({ isNetworkChange: true });
|
|
574
640
|
}
|
|
@@ -579,10 +645,7 @@ export class AppKit {
|
|
|
579
645
|
this.disconnect(namespace, false);
|
|
580
646
|
});
|
|
581
647
|
|
|
582
|
-
//TODO: Add types to this events
|
|
583
648
|
adapter.on('balanceChanged', ({ address, balance }) => {
|
|
584
|
-
//eslint-disable-next-line no-console
|
|
585
|
-
console.log('balanceChanged', address, balance);
|
|
586
649
|
const namespace = adapter.getSupportedNamespace();
|
|
587
650
|
ConnectionsController.updateBalance(namespace, address, balance);
|
|
588
651
|
});
|
|
@@ -597,10 +660,10 @@ export class AppKit {
|
|
|
597
660
|
this.setExcludedWallets(options);
|
|
598
661
|
this.setCustomWallets(options);
|
|
599
662
|
OptionsController.setFeaturedWalletIds(options.featuredWalletIds);
|
|
600
|
-
OptionsController.setTokens(options.tokens);
|
|
601
663
|
OptionsController.setEnableAnalytics(options.enableAnalytics);
|
|
602
664
|
OptionsController.setDebug(options.debug);
|
|
603
665
|
OptionsController.setFeatures(options.features);
|
|
666
|
+
OptionsController.setRequestedNetworks(this.networks);
|
|
604
667
|
|
|
605
668
|
if (options.defaultNetwork) {
|
|
606
669
|
const network = NetworkUtil.formatNetwork(options.defaultNetwork, this.projectId);
|
|
@@ -645,25 +708,22 @@ export class AppKit {
|
|
|
645
708
|
|
|
646
709
|
private async initRecentWallets(options: AppKitConfig) {
|
|
647
710
|
const wallets = await StorageUtil.getRecentWallets();
|
|
648
|
-
const connectedWalletImage = await StorageUtil.getConnectedWalletImageUrl();
|
|
649
|
-
|
|
650
711
|
const filteredWallets = wallets.filter(wallet => {
|
|
651
712
|
const { includeWalletIds, excludeWalletIds } = options;
|
|
652
|
-
|
|
713
|
+
|
|
714
|
+
if (includeWalletIds?.length) {
|
|
653
715
|
return includeWalletIds.includes(wallet.id);
|
|
654
716
|
}
|
|
655
|
-
if (excludeWalletIds) {
|
|
717
|
+
if (excludeWalletIds?.length) {
|
|
656
718
|
return !excludeWalletIds.includes(wallet.id);
|
|
657
719
|
}
|
|
658
720
|
|
|
659
|
-
return
|
|
721
|
+
return this.networks.some(
|
|
722
|
+
network => wallet.chains?.some(chain => network.caipNetworkId === chain)
|
|
723
|
+
);
|
|
660
724
|
});
|
|
661
725
|
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
if (connectedWalletImage) {
|
|
665
|
-
ConnectionController.setConnectedWalletImageUrl(connectedWalletImage);
|
|
666
|
-
}
|
|
726
|
+
WcController.setRecentWallets(filteredWallets);
|
|
667
727
|
}
|
|
668
728
|
|
|
669
729
|
private setExcludedWallets(options: AppKitConfig) {
|
|
@@ -673,7 +733,7 @@ export class AppKit {
|
|
|
673
733
|
const excludeCoinbase = !this.extraConnectors.some(connector => connector.type === 'coinbase');
|
|
674
734
|
|
|
675
735
|
if (excludeCoinbase) {
|
|
676
|
-
excludedWallets.push(ConstantsUtil.
|
|
736
|
+
excludedWallets.push(ConstantsUtil.COINBASE_CUSTOM_WALLET.id);
|
|
677
737
|
}
|
|
678
738
|
|
|
679
739
|
OptionsController.setExcludeWalletIds(excludedWallets);
|
|
@@ -684,8 +744,12 @@ export class AppKit {
|
|
|
684
744
|
|
|
685
745
|
const customList = [...(customWallets ?? [])];
|
|
686
746
|
|
|
687
|
-
const
|
|
747
|
+
const isSolanaEnabled =
|
|
688
748
|
adapters.some(adapter => adapter.getSupportedNamespace() === 'solana') &&
|
|
749
|
+
this.networks.some(network => network.chainNamespace === 'solana');
|
|
750
|
+
|
|
751
|
+
const addPhantom =
|
|
752
|
+
isSolanaEnabled &&
|
|
689
753
|
extraConnectors?.some(connector => connector.type.toLowerCase() === 'phantom') &&
|
|
690
754
|
!customList.some(wallet => wallet.id === ConstantsUtil.PHANTOM_CUSTOM_WALLET.id);
|
|
691
755
|
|
|
@@ -693,6 +757,15 @@ export class AppKit {
|
|
|
693
757
|
customList.push(ConstantsUtil.PHANTOM_CUSTOM_WALLET);
|
|
694
758
|
}
|
|
695
759
|
|
|
760
|
+
const addSolflare =
|
|
761
|
+
isSolanaEnabled &&
|
|
762
|
+
extraConnectors?.some(connector => connector.type.toLowerCase() === 'solflare') &&
|
|
763
|
+
!customList.some(wallet => wallet.id === ConstantsUtil.SOLFLARE_CUSTOM_WALLET.id);
|
|
764
|
+
|
|
765
|
+
if (addSolflare) {
|
|
766
|
+
customList.push(ConstantsUtil.SOLFLARE_CUSTOM_WALLET);
|
|
767
|
+
}
|
|
768
|
+
|
|
696
769
|
OptionsController.setCustomWallets(customList);
|
|
697
770
|
}
|
|
698
771
|
|
|
@@ -743,7 +816,7 @@ export class AppKit {
|
|
|
743
816
|
// If it's connected but there's no session, show sign view
|
|
744
817
|
return this.onSiweNavigation();
|
|
745
818
|
} else if (isConnection) {
|
|
746
|
-
//Connected with 1CA
|
|
819
|
+
// Connected with 1CA
|
|
747
820
|
ModalController.close();
|
|
748
821
|
}
|
|
749
822
|
}
|
package/src/AppKitContext.tsx
CHANGED
|
@@ -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
|
-
|
|
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)
|