@reown/appkit-react-native 0.0.0-feat-multichain-20250724181758 → 0.0.0-feat-multichain-20250725133522
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 +4 -9
- package/lib/commonjs/AppKit.js.map +1 -1
- package/lib/commonjs/AppKitContext.js +1 -2
- package/lib/commonjs/AppKitContext.js.map +1 -1
- package/lib/commonjs/config/animations.js.map +1 -1
- package/lib/commonjs/connectors/WalletConnectConnector.js.map +1 -1
- package/lib/commonjs/hooks/useAccount.js.map +1 -1
- package/lib/commonjs/hooks/useAppKit.js.map +1 -1
- package/lib/commonjs/hooks/useAppKitEvents.js.map +1 -1
- package/lib/commonjs/hooks/useCustomDimensions.js.map +1 -1
- package/lib/commonjs/hooks/useDebounceCallback.js.map +1 -1
- package/lib/commonjs/hooks/useKeyboard.js.map +1 -1
- package/lib/commonjs/hooks/useProvider.js.map +1 -1
- package/lib/commonjs/hooks/useTimeout.js.map +1 -1
- package/lib/commonjs/hooks/useWalletInfo.js.map +1 -1
- package/lib/commonjs/index.js +0 -7
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/modal/w3m-account-button/index.js +0 -1
- package/lib/commonjs/modal/w3m-account-button/index.js.map +1 -1
- package/lib/commonjs/modal/w3m-button/index.js.map +1 -1
- package/lib/commonjs/modal/w3m-connect-button/index.js.map +1 -1
- package/lib/commonjs/modal/w3m-modal/index.js.map +1 -1
- package/lib/commonjs/modal/w3m-modal/styles.js.map +1 -1
- package/lib/commonjs/modal/w3m-network-button/index.js.map +1 -1
- package/lib/commonjs/modal/w3m-router/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-account-activity/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-account-activity/styles.js.map +1 -1
- package/lib/commonjs/partials/w3m-account-activity/utils.js.map +1 -1
- package/lib/commonjs/partials/w3m-account-tokens/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-account-wallet-features/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-account-wallet-features/styles.js.map +1 -1
- package/lib/commonjs/partials/w3m-all-wallets-list/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-all-wallets-list/styles.js.map +1 -1
- package/lib/commonjs/partials/w3m-all-wallets-search/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-all-wallets-search/styles.js.map +1 -1
- package/lib/commonjs/partials/w3m-connecting-body/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-connecting-body/utils.js.map +1 -1
- package/lib/commonjs/partials/w3m-connecting-header/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-connecting-mobile/components/StoreLink.js.map +1 -1
- package/lib/commonjs/partials/w3m-connecting-mobile/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-connecting-mobile/styles.js.map +1 -1
- package/lib/commonjs/partials/w3m-connecting-qrcode/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-connecting-qrcode/styles.js.map +1 -1
- package/lib/commonjs/partials/w3m-connecting-web/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-connecting-web/styles.js.map +1 -1
- package/lib/commonjs/partials/w3m-header/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-header/styles.js.map +1 -1
- package/lib/commonjs/partials/w3m-information-modal/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-information-modal/styles.js.map +1 -1
- package/lib/commonjs/partials/w3m-otp-code/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-otp-code/styles.js.map +1 -1
- package/lib/commonjs/partials/w3m-placeholder/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-selector-modal/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-selector-modal/styles.js.map +1 -1
- package/lib/commonjs/partials/w3m-send-input-address/index.js +0 -1
- package/lib/commonjs/partials/w3m-send-input-address/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-send-input-address/styles.js.map +1 -1
- package/lib/commonjs/partials/w3m-send-input-token/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-send-input-token/styles.js.map +1 -1
- package/lib/commonjs/partials/w3m-send-input-token/utils.js.map +1 -1
- package/lib/commonjs/partials/w3m-snackbar/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-snackbar/styles.js.map +1 -1
- package/lib/commonjs/partials/w3m-swap-details/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-swap-details/styles.js.map +1 -1
- package/lib/commonjs/partials/w3m-swap-details/utils.js.map +1 -1
- package/lib/commonjs/partials/w3m-swap-input/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-swap-input/styles.js.map +1 -1
- package/lib/commonjs/utils/HelpersUtil.js.map +1 -1
- package/lib/commonjs/utils/NetworkUtil.js.map +1 -1
- package/lib/commonjs/utils/UiUtil.js.map +1 -1
- package/lib/commonjs/views/w3m-account-default-view/components/auth-buttons.js.map +1 -1
- package/lib/commonjs/views/w3m-account-default-view/components/upgrade-wallet-button.js.map +1 -1
- package/lib/commonjs/views/w3m-account-default-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-account-default-view/styles.js.map +1 -1
- package/lib/commonjs/views/w3m-account-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-account-view/styles.js.map +1 -1
- package/lib/commonjs/views/w3m-all-wallets-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-all-wallets-view/styles.js.map +1 -1
- package/lib/commonjs/views/w3m-connect-socials-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-connect-socials-view/styles.js.map +1 -1
- package/lib/commonjs/views/w3m-connect-view/components/all-wallet-list.js.map +1 -1
- package/lib/commonjs/views/w3m-connect-view/components/all-wallets-button.js.map +1 -1
- package/lib/commonjs/views/w3m-connect-view/components/connectors-list.js +1 -1
- package/lib/commonjs/views/w3m-connect-view/components/connectors-list.js.map +1 -1
- 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.map +1 -1
- package/lib/commonjs/views/w3m-connect-view/components/social-login-list.js.map +1 -1
- package/lib/commonjs/views/w3m-connect-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-connect-view/styles.js.map +1 -1
- package/lib/commonjs/views/w3m-connect-view/utils.js.map +1 -1
- package/lib/commonjs/views/w3m-connecting-external-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-connecting-external-view/styles.js.map +1 -1
- package/lib/commonjs/views/w3m-connecting-siwe-view/index.js +2 -2
- package/lib/commonjs/views/w3m-connecting-siwe-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-connecting-siwe-view/styles.js.map +1 -1
- package/lib/commonjs/views/w3m-connecting-social-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-connecting-social-view/styles.js.map +1 -1
- package/lib/commonjs/views/w3m-connecting-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-get-wallet-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-get-wallet-view/styles.js.map +1 -1
- package/lib/commonjs/views/w3m-network-switch-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-network-switch-view/styles.js.map +1 -1
- package/lib/commonjs/views/w3m-networks-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-networks-view/styles.js.map +1 -1
- package/lib/commonjs/views/w3m-onramp-checkout-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-onramp-loading-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-onramp-loading-view/styles.js.map +1 -1
- package/lib/commonjs/views/w3m-onramp-settings-view/components/Country.js.map +1 -1
- package/lib/commonjs/views/w3m-onramp-settings-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-onramp-settings-view/styles.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.map +1 -1
- package/lib/commonjs/views/w3m-onramp-transaction-view/styles.js.map +1 -1
- package/lib/commonjs/views/w3m-onramp-view/components/Currency.js +5 -3
- package/lib/commonjs/views/w3m-onramp-view/components/Currency.js.map +1 -1
- package/lib/commonjs/views/w3m-onramp-view/components/CurrencyInput.js +3 -2
- package/lib/commonjs/views/w3m-onramp-view/components/CurrencyInput.js.map +1 -1
- package/lib/commonjs/views/w3m-onramp-view/components/Header.js.map +1 -1
- package/lib/commonjs/views/w3m-onramp-view/components/LoadingView.js +2 -2
- package/lib/commonjs/views/w3m-onramp-view/components/LoadingView.js.map +1 -1
- package/lib/commonjs/views/w3m-onramp-view/components/PaymentButton.js +109 -0
- package/lib/commonjs/views/w3m-onramp-view/components/PaymentButton.js.map +1 -0
- package/lib/commonjs/views/w3m-onramp-view/components/PaymentMethod.js +9 -8
- package/lib/commonjs/views/w3m-onramp-view/components/PaymentMethod.js.map +1 -1
- package/lib/commonjs/views/w3m-onramp-view/components/Quote.js +5 -3
- package/lib/commonjs/views/w3m-onramp-view/components/Quote.js.map +1 -1
- package/lib/commonjs/views/w3m-onramp-view/components/SelectPaymentModal.js +39 -51
- package/lib/commonjs/views/w3m-onramp-view/components/SelectPaymentModal.js.map +1 -1
- package/lib/commonjs/views/w3m-onramp-view/index.js +32 -51
- package/lib/commonjs/views/w3m-onramp-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-onramp-view/styles.js +4 -0
- package/lib/commonjs/views/w3m-onramp-view/styles.js.map +1 -1
- package/lib/commonjs/views/w3m-onramp-view/utils.js +19 -78
- package/lib/commonjs/views/w3m-onramp-view/utils.js.map +1 -1
- package/lib/commonjs/views/w3m-swap-preview-view/index.js.map +1 -1
- 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.map +1 -1
- 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.map +1 -1
- package/lib/commonjs/views/w3m-swap-view/styles.js.map +1 -1
- package/lib/commonjs/views/w3m-transactions-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-unsupported-chain-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-unsupported-chain-view/styles.js.map +1 -1
- package/lib/commonjs/views/w3m-upgrade-email-wallet-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-wallet-compatible-networks-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-wallet-compatible-networks-view/styles.js.map +1 -1
- package/lib/commonjs/views/w3m-wallet-receive-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-wallet-receive-view/styles.js.map +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/components/preview-send-pill.js.map +1 -1
- package/lib/commonjs/views/w3m-wallet-send-preview-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-wallet-send-preview-view/styles.js.map +1 -1
- package/lib/commonjs/views/w3m-wallet-send-select-token-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-wallet-send-select-token-view/styles.js.map +1 -1
- package/lib/commonjs/views/w3m-wallet-send-view/index.js.map +1 -1
- 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.map +1 -1
- package/lib/commonjs/views/w3m-what-is-a-network-view/styles.js.map +1 -1
- package/lib/commonjs/views/w3m-what-is-a-wallet-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-what-is-a-wallet-view/styles.js.map +1 -1
- package/lib/module/AppKit.js +4 -9
- package/lib/module/AppKit.js.map +1 -1
- package/lib/module/AppKitContext.js.map +1 -1
- package/lib/module/config/animations.js.map +1 -1
- package/lib/module/connectors/WalletConnectConnector.js.map +1 -1
- package/lib/module/hooks/useAccount.js.map +1 -1
- package/lib/module/hooks/useAppKit.js.map +1 -1
- package/lib/module/hooks/useAppKitEvents.js.map +1 -1
- package/lib/module/hooks/useCustomDimensions.js.map +1 -1
- package/lib/module/hooks/useDebounceCallback.js.map +1 -1
- package/lib/module/hooks/useKeyboard.js.map +1 -1
- package/lib/module/hooks/useProvider.js.map +1 -1
- package/lib/module/hooks/useTimeout.js.map +1 -1
- package/lib/module/hooks/useWalletInfo.js.map +1 -1
- package/lib/module/index.js +0 -4
- package/lib/module/index.js.map +1 -1
- package/lib/module/modal/w3m-account-button/index.js +0 -2
- package/lib/module/modal/w3m-account-button/index.js.map +1 -1
- package/lib/module/modal/w3m-button/index.js.map +1 -1
- package/lib/module/modal/w3m-connect-button/index.js.map +1 -1
- package/lib/module/modal/w3m-modal/index.js.map +1 -1
- package/lib/module/modal/w3m-modal/styles.js.map +1 -1
- package/lib/module/modal/w3m-network-button/index.js.map +1 -1
- package/lib/module/modal/w3m-router/index.js.map +1 -1
- package/lib/module/partials/w3m-account-activity/index.js.map +1 -1
- package/lib/module/partials/w3m-account-activity/styles.js.map +1 -1
- package/lib/module/partials/w3m-account-activity/utils.js.map +1 -1
- package/lib/module/partials/w3m-account-tokens/index.js.map +1 -1
- package/lib/module/partials/w3m-account-wallet-features/index.js.map +1 -1
- package/lib/module/partials/w3m-account-wallet-features/styles.js.map +1 -1
- package/lib/module/partials/w3m-all-wallets-list/index.js.map +1 -1
- package/lib/module/partials/w3m-all-wallets-list/styles.js.map +1 -1
- package/lib/module/partials/w3m-all-wallets-search/index.js.map +1 -1
- package/lib/module/partials/w3m-all-wallets-search/styles.js.map +1 -1
- package/lib/module/partials/w3m-connecting-body/index.js.map +1 -1
- package/lib/module/partials/w3m-connecting-body/utils.js.map +1 -1
- package/lib/module/partials/w3m-connecting-header/index.js.map +1 -1
- package/lib/module/partials/w3m-connecting-mobile/components/StoreLink.js.map +1 -1
- package/lib/module/partials/w3m-connecting-mobile/index.js.map +1 -1
- package/lib/module/partials/w3m-connecting-mobile/styles.js.map +1 -1
- package/lib/module/partials/w3m-connecting-qrcode/index.js.map +1 -1
- package/lib/module/partials/w3m-connecting-qrcode/styles.js.map +1 -1
- package/lib/module/partials/w3m-connecting-web/index.js.map +1 -1
- package/lib/module/partials/w3m-connecting-web/styles.js.map +1 -1
- package/lib/module/partials/w3m-header/index.js.map +1 -1
- package/lib/module/partials/w3m-header/styles.js.map +1 -1
- package/lib/module/partials/w3m-information-modal/index.js.map +1 -1
- package/lib/module/partials/w3m-information-modal/styles.js.map +1 -1
- package/lib/module/partials/w3m-otp-code/index.js.map +1 -1
- package/lib/module/partials/w3m-otp-code/styles.js.map +1 -1
- package/lib/module/partials/w3m-placeholder/index.js.map +1 -1
- package/lib/module/partials/w3m-selector-modal/index.js.map +1 -1
- package/lib/module/partials/w3m-selector-modal/styles.js.map +1 -1
- package/lib/module/partials/w3m-send-input-address/index.js +0 -1
- package/lib/module/partials/w3m-send-input-address/index.js.map +1 -1
- package/lib/module/partials/w3m-send-input-address/styles.js.map +1 -1
- package/lib/module/partials/w3m-send-input-token/index.js.map +1 -1
- package/lib/module/partials/w3m-send-input-token/styles.js.map +1 -1
- package/lib/module/partials/w3m-send-input-token/utils.js.map +1 -1
- package/lib/module/partials/w3m-snackbar/index.js.map +1 -1
- package/lib/module/partials/w3m-snackbar/styles.js.map +1 -1
- package/lib/module/partials/w3m-swap-details/index.js.map +1 -1
- package/lib/module/partials/w3m-swap-details/styles.js.map +1 -1
- package/lib/module/partials/w3m-swap-details/utils.js.map +1 -1
- package/lib/module/partials/w3m-swap-input/index.js.map +1 -1
- package/lib/module/partials/w3m-swap-input/styles.js.map +1 -1
- package/lib/module/utils/HelpersUtil.js.map +1 -1
- package/lib/module/utils/NetworkUtil.js.map +1 -1
- package/lib/module/utils/UiUtil.js.map +1 -1
- package/lib/module/views/w3m-account-default-view/components/auth-buttons.js.map +1 -1
- package/lib/module/views/w3m-account-default-view/components/upgrade-wallet-button.js.map +1 -1
- package/lib/module/views/w3m-account-default-view/index.js.map +1 -1
- package/lib/module/views/w3m-account-default-view/styles.js.map +1 -1
- package/lib/module/views/w3m-account-view/index.js.map +1 -1
- package/lib/module/views/w3m-account-view/styles.js.map +1 -1
- package/lib/module/views/w3m-all-wallets-view/index.js.map +1 -1
- package/lib/module/views/w3m-all-wallets-view/styles.js.map +1 -1
- package/lib/module/views/w3m-connect-socials-view/index.js.map +1 -1
- package/lib/module/views/w3m-connect-socials-view/styles.js.map +1 -1
- package/lib/module/views/w3m-connect-view/components/all-wallet-list.js.map +1 -1
- package/lib/module/views/w3m-connect-view/components/all-wallets-button.js.map +1 -1
- package/lib/module/views/w3m-connect-view/components/connectors-list.js +1 -1
- package/lib/module/views/w3m-connect-view/components/connectors-list.js.map +1 -1
- 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.map +1 -1
- package/lib/module/views/w3m-connect-view/components/social-login-list.js.map +1 -1
- package/lib/module/views/w3m-connect-view/index.js.map +1 -1
- package/lib/module/views/w3m-connect-view/styles.js.map +1 -1
- package/lib/module/views/w3m-connect-view/utils.js.map +1 -1
- package/lib/module/views/w3m-connecting-external-view/index.js.map +1 -1
- package/lib/module/views/w3m-connecting-external-view/styles.js.map +1 -1
- package/lib/module/views/w3m-connecting-siwe-view/index.js +2 -2
- package/lib/module/views/w3m-connecting-siwe-view/index.js.map +1 -1
- package/lib/module/views/w3m-connecting-siwe-view/styles.js.map +1 -1
- package/lib/module/views/w3m-connecting-social-view/index.js.map +1 -1
- package/lib/module/views/w3m-connecting-social-view/styles.js.map +1 -1
- package/lib/module/views/w3m-connecting-view/index.js.map +1 -1
- package/lib/module/views/w3m-get-wallet-view/index.js.map +1 -1
- package/lib/module/views/w3m-get-wallet-view/styles.js.map +1 -1
- package/lib/module/views/w3m-network-switch-view/index.js.map +1 -1
- package/lib/module/views/w3m-network-switch-view/styles.js.map +1 -1
- package/lib/module/views/w3m-networks-view/index.js.map +1 -1
- package/lib/module/views/w3m-networks-view/styles.js.map +1 -1
- package/lib/module/views/w3m-onramp-checkout-view/index.js.map +1 -1
- package/lib/module/views/w3m-onramp-loading-view/index.js.map +1 -1
- package/lib/module/views/w3m-onramp-loading-view/styles.js.map +1 -1
- package/lib/module/views/w3m-onramp-settings-view/components/Country.js.map +1 -1
- package/lib/module/views/w3m-onramp-settings-view/index.js.map +1 -1
- package/lib/module/views/w3m-onramp-settings-view/styles.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.map +1 -1
- package/lib/module/views/w3m-onramp-transaction-view/styles.js.map +1 -1
- package/lib/module/views/w3m-onramp-view/components/Currency.js +6 -4
- package/lib/module/views/w3m-onramp-view/components/Currency.js.map +1 -1
- package/lib/module/views/w3m-onramp-view/components/CurrencyInput.js +4 -4
- package/lib/module/views/w3m-onramp-view/components/CurrencyInput.js.map +1 -1
- package/lib/module/views/w3m-onramp-view/components/Header.js +1 -2
- package/lib/module/views/w3m-onramp-view/components/Header.js.map +1 -1
- package/lib/module/views/w3m-onramp-view/components/LoadingView.js +2 -2
- package/lib/module/views/w3m-onramp-view/components/LoadingView.js.map +1 -1
- package/lib/module/views/w3m-onramp-view/components/PaymentButton.js +103 -0
- package/lib/module/views/w3m-onramp-view/components/PaymentButton.js.map +1 -0
- package/lib/module/views/w3m-onramp-view/components/PaymentMethod.js +9 -8
- package/lib/module/views/w3m-onramp-view/components/PaymentMethod.js.map +1 -1
- package/lib/module/views/w3m-onramp-view/components/Quote.js +5 -3
- package/lib/module/views/w3m-onramp-view/components/Quote.js.map +1 -1
- package/lib/module/views/w3m-onramp-view/components/SelectPaymentModal.js +42 -55
- package/lib/module/views/w3m-onramp-view/components/SelectPaymentModal.js.map +1 -1
- package/lib/module/views/w3m-onramp-view/index.js +35 -55
- package/lib/module/views/w3m-onramp-view/index.js.map +1 -1
- package/lib/module/views/w3m-onramp-view/styles.js +4 -0
- package/lib/module/views/w3m-onramp-view/styles.js.map +1 -1
- package/lib/module/views/w3m-onramp-view/utils.js +18 -77
- package/lib/module/views/w3m-onramp-view/utils.js.map +1 -1
- package/lib/module/views/w3m-swap-preview-view/index.js.map +1 -1
- 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.map +1 -1
- 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.map +1 -1
- package/lib/module/views/w3m-swap-view/styles.js.map +1 -1
- package/lib/module/views/w3m-transactions-view/index.js.map +1 -1
- package/lib/module/views/w3m-unsupported-chain-view/index.js.map +1 -1
- package/lib/module/views/w3m-unsupported-chain-view/styles.js.map +1 -1
- package/lib/module/views/w3m-upgrade-email-wallet-view/index.js.map +1 -1
- package/lib/module/views/w3m-wallet-compatible-networks-view/index.js.map +1 -1
- package/lib/module/views/w3m-wallet-compatible-networks-view/styles.js.map +1 -1
- package/lib/module/views/w3m-wallet-receive-view/index.js.map +1 -1
- package/lib/module/views/w3m-wallet-receive-view/styles.js.map +1 -1
- 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/components/preview-send-pill.js.map +1 -1
- package/lib/module/views/w3m-wallet-send-preview-view/index.js.map +1 -1
- package/lib/module/views/w3m-wallet-send-preview-view/styles.js.map +1 -1
- package/lib/module/views/w3m-wallet-send-select-token-view/index.js.map +1 -1
- package/lib/module/views/w3m-wallet-send-select-token-view/styles.js.map +1 -1
- package/lib/module/views/w3m-wallet-send-view/index.js.map +1 -1
- 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.map +1 -1
- package/lib/module/views/w3m-what-is-a-network-view/styles.js.map +1 -1
- package/lib/module/views/w3m-what-is-a-wallet-view/index.js.map +1 -1
- package/lib/module/views/w3m-what-is-a-wallet-view/styles.js.map +1 -1
- package/lib/typescript/AppKit.d.ts +2 -3
- package/lib/typescript/AppKit.d.ts.map +1 -1
- package/lib/typescript/AppKitContext.d.ts +1 -1
- package/lib/typescript/index.d.ts +0 -3
- 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/utils/HelpersUtil.d.ts +1 -1
- package/lib/typescript/utils/HelpersUtil.d.ts.map +1 -1
- package/lib/typescript/utils/NetworkUtil.d.ts +1 -1
- package/lib/typescript/utils/NetworkUtil.d.ts.map +1 -1
- package/lib/typescript/views/w3m-onramp-view/components/Currency.d.ts.map +1 -1
- package/lib/typescript/views/w3m-onramp-view/components/CurrencyInput.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/PaymentButton.d.ts +13 -0
- package/lib/typescript/views/w3m-onramp-view/components/PaymentButton.d.ts.map +1 -0
- 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 +2 -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/styles.d.ts +4 -0
- package/lib/typescript/views/w3m-onramp-view/styles.d.ts.map +1 -1
- package/lib/typescript/views/w3m-onramp-view/utils.d.ts +2 -2
- package/lib/typescript/views/w3m-onramp-view/utils.d.ts.map +1 -1
- package/package.json +9 -9
- package/src/AppKit.ts +9 -9
- package/src/index.ts +0 -5
- package/src/modal/w3m-account-button/index.tsx +1 -4
- package/src/utils/HelpersUtil.ts +6 -5
- package/src/utils/NetworkUtil.ts +6 -2
- package/src/views/w3m-connecting-siwe-view/index.tsx +3 -3
- package/src/views/w3m-onramp-view/components/Currency.tsx +3 -4
- package/src/views/w3m-onramp-view/components/CurrencyInput.tsx +33 -28
- package/src/views/w3m-onramp-view/components/Header.tsx +1 -2
- package/src/views/w3m-onramp-view/components/LoadingView.tsx +2 -2
- package/src/views/w3m-onramp-view/components/PaymentButton.tsx +137 -0
- package/src/views/w3m-onramp-view/components/PaymentMethod.tsx +9 -8
- package/src/views/w3m-onramp-view/components/Quote.tsx +5 -2
- package/src/views/w3m-onramp-view/components/SelectPaymentModal.tsx +61 -76
- package/src/views/w3m-onramp-view/index.tsx +38 -67
- package/src/views/w3m-onramp-view/styles.ts +4 -0
- package/src/views/w3m-onramp-view/utils.ts +22 -92
- package/lib/commonjs/client.js +0 -222
- package/lib/commonjs/client.js.map +0 -1
- package/lib/module/client.js +0 -216
- package/lib/module/client.js.map +0 -1
- package/lib/typescript/client.d.ts +0 -85
- package/lib/typescript/client.d.ts.map +0 -1
- package/src/client.ts +0 -335
|
@@ -20,11 +20,11 @@ export function LoadingView() {
|
|
|
20
20
|
|
|
21
21
|
{/* Currency Input Area */}
|
|
22
22
|
<FlexView margin={['m', '0', 'm', '0']}>
|
|
23
|
-
<Shimmer width="100%" height={
|
|
23
|
+
<Shimmer width="100%" height={323} borderRadius={16} />
|
|
24
24
|
</FlexView>
|
|
25
25
|
|
|
26
26
|
{/* Payment Method Button */}
|
|
27
|
-
<Shimmer width="100%" height={64} borderRadius={16} style={styles.
|
|
27
|
+
<Shimmer width="100%" height={64} borderRadius={16} style={styles.paymentButtonMock} />
|
|
28
28
|
|
|
29
29
|
{/* Action Buttons */}
|
|
30
30
|
<FlexView
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BorderRadius,
|
|
3
|
+
FlexView,
|
|
4
|
+
Icon,
|
|
5
|
+
Image,
|
|
6
|
+
LoadingSpinner,
|
|
7
|
+
Pressable,
|
|
8
|
+
Spacing,
|
|
9
|
+
Text,
|
|
10
|
+
useTheme
|
|
11
|
+
} from '@reown/appkit-ui-react-native';
|
|
12
|
+
import { StyleSheet, View } from 'react-native';
|
|
13
|
+
|
|
14
|
+
interface PaymentButtonProps {
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
loading?: boolean;
|
|
17
|
+
title: string;
|
|
18
|
+
subtitle?: string;
|
|
19
|
+
paymentLogo?: string;
|
|
20
|
+
providerLogo?: string;
|
|
21
|
+
onPress: () => void;
|
|
22
|
+
testID?: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function PaymentButton({
|
|
26
|
+
disabled,
|
|
27
|
+
loading,
|
|
28
|
+
title,
|
|
29
|
+
subtitle,
|
|
30
|
+
paymentLogo,
|
|
31
|
+
providerLogo,
|
|
32
|
+
onPress,
|
|
33
|
+
testID
|
|
34
|
+
}: PaymentButtonProps) {
|
|
35
|
+
const Theme = useTheme();
|
|
36
|
+
const backgroundColor = Theme['gray-glass-005'];
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<Pressable
|
|
40
|
+
disabled={disabled || loading}
|
|
41
|
+
onPress={onPress}
|
|
42
|
+
style={styles.pressable}
|
|
43
|
+
testID={testID}
|
|
44
|
+
>
|
|
45
|
+
<FlexView
|
|
46
|
+
style={[styles.container, { backgroundColor }]}
|
|
47
|
+
alignItems="center"
|
|
48
|
+
justifyContent="space-between"
|
|
49
|
+
flexDirection="row"
|
|
50
|
+
>
|
|
51
|
+
<FlexView
|
|
52
|
+
alignItems="center"
|
|
53
|
+
justifyContent="center"
|
|
54
|
+
style={[styles.iconContainer, { backgroundColor: Theme['bg-300'] }]}
|
|
55
|
+
>
|
|
56
|
+
{paymentLogo ? (
|
|
57
|
+
<Image
|
|
58
|
+
source={paymentLogo}
|
|
59
|
+
style={styles.paymentLogo}
|
|
60
|
+
resizeMethod="resize"
|
|
61
|
+
resizeMode="contain"
|
|
62
|
+
/>
|
|
63
|
+
) : (
|
|
64
|
+
<Icon name="card" size="lg" />
|
|
65
|
+
)}
|
|
66
|
+
</FlexView>
|
|
67
|
+
<FlexView
|
|
68
|
+
flexGrow={1}
|
|
69
|
+
flexDirection="column"
|
|
70
|
+
alignItems="flex-start"
|
|
71
|
+
margin={['0', '0', '0', 's']}
|
|
72
|
+
>
|
|
73
|
+
<Text variant="paragraph-400" color="fg-100">
|
|
74
|
+
{title}
|
|
75
|
+
</Text>
|
|
76
|
+
{subtitle && (
|
|
77
|
+
<FlexView flexDirection="row" alignItems="center" margin={['4xs', '0', '0', '0']}>
|
|
78
|
+
{providerLogo && (
|
|
79
|
+
<>
|
|
80
|
+
<Text variant="small-400" color="fg-150">
|
|
81
|
+
via
|
|
82
|
+
</Text>
|
|
83
|
+
<Image
|
|
84
|
+
source={providerLogo}
|
|
85
|
+
style={styles.providerLogo}
|
|
86
|
+
resizeMethod="resize"
|
|
87
|
+
resizeMode="contain"
|
|
88
|
+
/>
|
|
89
|
+
</>
|
|
90
|
+
)}
|
|
91
|
+
<Text variant="small-400" color="fg-150">
|
|
92
|
+
{subtitle}
|
|
93
|
+
</Text>
|
|
94
|
+
</FlexView>
|
|
95
|
+
)}
|
|
96
|
+
</FlexView>
|
|
97
|
+
{loading ? (
|
|
98
|
+
<LoadingSpinner size="md" color="fg-200" style={styles.rightIcon} />
|
|
99
|
+
) : disabled ? (
|
|
100
|
+
<View />
|
|
101
|
+
) : (
|
|
102
|
+
<Icon name="chevronRight" size="md" color="fg-200" style={styles.rightIcon} />
|
|
103
|
+
)}
|
|
104
|
+
</FlexView>
|
|
105
|
+
</Pressable>
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
const styles = StyleSheet.create({
|
|
110
|
+
pressable: {
|
|
111
|
+
borderRadius: BorderRadius.xs
|
|
112
|
+
},
|
|
113
|
+
container: {
|
|
114
|
+
padding: Spacing.s,
|
|
115
|
+
borderRadius: BorderRadius.xs
|
|
116
|
+
},
|
|
117
|
+
iconContainer: {
|
|
118
|
+
height: 40,
|
|
119
|
+
width: 40,
|
|
120
|
+
borderRadius: BorderRadius['3xs']
|
|
121
|
+
},
|
|
122
|
+
paymentLogo: {
|
|
123
|
+
height: 24,
|
|
124
|
+
width: 24
|
|
125
|
+
},
|
|
126
|
+
providerLogo: {
|
|
127
|
+
height: 16,
|
|
128
|
+
width: 16,
|
|
129
|
+
marginHorizontal: Spacing['4xs'],
|
|
130
|
+
borderRadius: BorderRadius['5xs']
|
|
131
|
+
},
|
|
132
|
+
rightIcon: {
|
|
133
|
+
marginRight: Spacing.xs
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
export default PaymentButton;
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
} from '@reown/appkit-ui-react-native';
|
|
13
13
|
import { StyleSheet } from 'react-native';
|
|
14
14
|
|
|
15
|
-
export const ITEM_SIZE =
|
|
15
|
+
export const ITEM_SIZE = 100;
|
|
16
16
|
|
|
17
17
|
interface Props {
|
|
18
18
|
onPress: (item: OnRampPaymentMethod) => void;
|
|
@@ -47,7 +47,7 @@ export function PaymentMethod({ onPress, item, selected, testID }: Props) {
|
|
|
47
47
|
source={item.logos[themeMode ?? 'light']}
|
|
48
48
|
style={styles.logo}
|
|
49
49
|
resizeMethod="resize"
|
|
50
|
-
resizeMode="
|
|
50
|
+
resizeMode="contain"
|
|
51
51
|
/>
|
|
52
52
|
{selected && (
|
|
53
53
|
<IconBox
|
|
@@ -61,7 +61,7 @@ export function PaymentMethod({ onPress, item, selected, testID }: Props) {
|
|
|
61
61
|
/>
|
|
62
62
|
)}
|
|
63
63
|
</FlexView>
|
|
64
|
-
<Text variant="tiny-400" color="fg-100" numberOfLines={
|
|
64
|
+
<Text variant="tiny-400" color="fg-100" numberOfLines={2} style={styles.text}>
|
|
65
65
|
{item.name}
|
|
66
66
|
</Text>
|
|
67
67
|
</Pressable>
|
|
@@ -71,8 +71,7 @@ export function PaymentMethod({ onPress, item, selected, testID }: Props) {
|
|
|
71
71
|
const styles = StyleSheet.create({
|
|
72
72
|
container: {
|
|
73
73
|
height: ITEM_SIZE,
|
|
74
|
-
width:
|
|
75
|
-
justifyContent: 'center',
|
|
74
|
+
width: 85,
|
|
76
75
|
alignItems: 'center'
|
|
77
76
|
},
|
|
78
77
|
logoContainer: {
|
|
@@ -82,8 +81,8 @@ const styles = StyleSheet.create({
|
|
|
82
81
|
marginBottom: Spacing['4xs']
|
|
83
82
|
},
|
|
84
83
|
logo: {
|
|
85
|
-
width:
|
|
86
|
-
height:
|
|
84
|
+
width: 26,
|
|
85
|
+
height: 26
|
|
87
86
|
},
|
|
88
87
|
checkmark: {
|
|
89
88
|
borderRadius: BorderRadius.full,
|
|
@@ -92,6 +91,8 @@ const styles = StyleSheet.create({
|
|
|
92
91
|
right: -10
|
|
93
92
|
},
|
|
94
93
|
text: {
|
|
95
|
-
marginTop: Spacing.xs
|
|
94
|
+
marginTop: Spacing.xs,
|
|
95
|
+
paddingHorizontal: Spacing['3xs'],
|
|
96
|
+
textAlign: 'center'
|
|
96
97
|
}
|
|
97
98
|
});
|
|
@@ -20,17 +20,19 @@ interface Props {
|
|
|
20
20
|
logoURL?: string;
|
|
21
21
|
onQuotePress: (item: OnRampQuote) => void;
|
|
22
22
|
selected?: boolean;
|
|
23
|
+
testID?: string;
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
export const ITEM_HEIGHT = 64;
|
|
26
27
|
|
|
27
|
-
export function Quote({ item, logoURL, onQuotePress, selected, tagText }: Props) {
|
|
28
|
+
export function Quote({ item, logoURL, onQuotePress, selected, tagText, testID }: Props) {
|
|
28
29
|
const Theme = useTheme();
|
|
29
30
|
|
|
30
31
|
return (
|
|
31
32
|
<Pressable
|
|
32
33
|
style={[styles.container, selected && { borderColor: Theme['accent-100'] }]}
|
|
33
34
|
onPress={() => onQuotePress(item)}
|
|
35
|
+
testID={testID}
|
|
34
36
|
>
|
|
35
37
|
<FlexView
|
|
36
38
|
justifyContent="space-between"
|
|
@@ -60,7 +62,8 @@ export function Quote({ item, logoURL, onQuotePress, selected, tagText }: Props)
|
|
|
60
62
|
)}
|
|
61
63
|
</FlexView>
|
|
62
64
|
<Text variant="tiny-500">
|
|
63
|
-
{NumberUtil.roundNumber(item.destinationAmount, 6, 5)}
|
|
65
|
+
{NumberUtil.roundNumber(item.destinationAmount, 6, 5)}{' '}
|
|
66
|
+
{item.destinationCurrencyCode?.split('_')[0]}
|
|
64
67
|
</Text>
|
|
65
68
|
</FlexView>
|
|
66
69
|
</FlexView>
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
/* eslint-disable valtio/state-snapshot-rule */
|
|
1
2
|
import { useSnapshot } from 'valtio';
|
|
2
|
-
import { useRef, useState, useMemo } from 'react';
|
|
3
|
+
import { useRef, useState, useMemo, useEffect } from 'react';
|
|
3
4
|
import Modal from 'react-native-modal';
|
|
4
|
-
import {
|
|
5
|
+
import { FlatList, StyleSheet, View } from 'react-native';
|
|
5
6
|
import {
|
|
6
7
|
FlexView,
|
|
7
8
|
IconLink,
|
|
@@ -9,7 +10,6 @@ import {
|
|
|
9
10
|
Text,
|
|
10
11
|
useTheme,
|
|
11
12
|
Separator,
|
|
12
|
-
LoadingSpinner,
|
|
13
13
|
BorderRadius
|
|
14
14
|
} from '@reown/appkit-ui-react-native';
|
|
15
15
|
import {
|
|
@@ -17,9 +17,8 @@ import {
|
|
|
17
17
|
type OnRampPaymentMethod,
|
|
18
18
|
type OnRampQuote
|
|
19
19
|
} from '@reown/appkit-core-react-native';
|
|
20
|
-
import { Placeholder } from '../../../partials/w3m-placeholder';
|
|
21
20
|
import { Quote, ITEM_HEIGHT as QUOTE_ITEM_HEIGHT } from './Quote';
|
|
22
|
-
import { PaymentMethod
|
|
21
|
+
import { PaymentMethod } from './PaymentMethod';
|
|
23
22
|
|
|
24
23
|
interface SelectPaymentModalProps {
|
|
25
24
|
title?: string;
|
|
@@ -31,124 +30,110 @@ const SEPARATOR_HEIGHT = Spacing.s;
|
|
|
31
30
|
|
|
32
31
|
export function SelectPaymentModal({ title, visible, onClose }: SelectPaymentModalProps) {
|
|
33
32
|
const Theme = useTheme();
|
|
34
|
-
const { selectedQuote, quotes } = useSnapshot(OnRampController.state);
|
|
33
|
+
const { selectedQuote, quotes, selectedPaymentMethod } = useSnapshot(OnRampController.state);
|
|
34
|
+
|
|
35
35
|
const paymentMethodsRef = useRef<FlatList>(null);
|
|
36
36
|
const [paymentMethods, setPaymentMethods] = useState<OnRampPaymentMethod[]>(
|
|
37
37
|
OnRampController.state.paymentMethods
|
|
38
38
|
);
|
|
39
39
|
|
|
40
|
+
const [activePaymentMethod, setActivePaymentMethod] = useState<OnRampPaymentMethod | undefined>(
|
|
41
|
+
OnRampController.state.selectedPaymentMethod
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
const availablePaymentMethods = useMemo(() => {
|
|
45
|
+
return paymentMethods.filter(
|
|
46
|
+
paymentMethod =>
|
|
47
|
+
quotes?.some(quote => quote.paymentMethodType === paymentMethod.paymentMethod)
|
|
48
|
+
);
|
|
49
|
+
}, [paymentMethods, quotes]);
|
|
50
|
+
|
|
51
|
+
const availableQuotes = useMemo(() => {
|
|
52
|
+
return quotes?.filter(quote => activePaymentMethod?.paymentMethod === quote.paymentMethodType);
|
|
53
|
+
}, [quotes, activePaymentMethod]);
|
|
54
|
+
|
|
40
55
|
const sortedQuotes = useMemo(() => {
|
|
41
|
-
if (!selectedQuote) {
|
|
42
|
-
return
|
|
56
|
+
if (!selectedQuote || selectedQuote.paymentMethodType !== activePaymentMethod?.paymentMethod) {
|
|
57
|
+
return availableQuotes;
|
|
43
58
|
}
|
|
44
59
|
|
|
45
60
|
return [
|
|
46
61
|
selectedQuote,
|
|
47
|
-
|
|
48
|
-
...(
|
|
62
|
+
|
|
63
|
+
...(availableQuotes?.filter(
|
|
64
|
+
quote => quote.serviceProvider !== selectedQuote.serviceProvider
|
|
65
|
+
) ?? [])
|
|
49
66
|
];
|
|
50
|
-
}, [
|
|
67
|
+
}, [availableQuotes, selectedQuote, activePaymentMethod]);
|
|
51
68
|
|
|
52
69
|
const renderSeparator = () => {
|
|
53
70
|
return <View style={{ height: SEPARATOR_HEIGHT }} />;
|
|
54
71
|
};
|
|
55
72
|
|
|
56
73
|
const handleQuotePress = (quote: OnRampQuote) => {
|
|
57
|
-
if (
|
|
74
|
+
if (activePaymentMethod) {
|
|
75
|
+
OnRampController.clearError();
|
|
58
76
|
OnRampController.setSelectedQuote(quote);
|
|
77
|
+
OnRampController.setSelectedPaymentMethod(activePaymentMethod);
|
|
59
78
|
}
|
|
60
79
|
onClose();
|
|
61
80
|
};
|
|
62
81
|
|
|
63
82
|
const handlePaymentMethodPress = (paymentMethod: OnRampPaymentMethod) => {
|
|
64
|
-
|
|
65
|
-
paymentMethod.paymentMethod !== OnRampController.state.selectedPaymentMethod?.paymentMethod
|
|
66
|
-
) {
|
|
67
|
-
OnRampController.setSelectedPaymentMethod(paymentMethod);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
const visibleItemsCount = Math.round(Dimensions.get('window').width / ITEM_SIZE);
|
|
71
|
-
|
|
72
|
-
// Switch payment method to the top if there are more than visibleItemsCount payment methods
|
|
73
|
-
if (OnRampController.state.paymentMethods.length > visibleItemsCount) {
|
|
74
|
-
const paymentIndex = paymentMethods.findIndex(
|
|
75
|
-
method => method.paymentMethod === paymentMethod.paymentMethod
|
|
76
|
-
);
|
|
77
|
-
|
|
78
|
-
// Switch payment if its not visible
|
|
79
|
-
if (paymentIndex + 1 > visibleItemsCount - 1) {
|
|
80
|
-
const realIndex = OnRampController.state.paymentMethods.findIndex(
|
|
81
|
-
method => method.paymentMethod === paymentMethod.paymentMethod
|
|
82
|
-
);
|
|
83
|
-
|
|
84
|
-
const newPaymentMethods = [
|
|
85
|
-
paymentMethod,
|
|
86
|
-
...OnRampController.state.paymentMethods.slice(0, realIndex),
|
|
87
|
-
...OnRampController.state.paymentMethods.slice(realIndex + 1)
|
|
88
|
-
];
|
|
89
|
-
setPaymentMethods(newPaymentMethods);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
paymentMethodsRef.current?.scrollToIndex({
|
|
93
|
-
index: 0,
|
|
94
|
-
animated: true
|
|
95
|
-
});
|
|
83
|
+
setActivePaymentMethod(paymentMethod);
|
|
96
84
|
};
|
|
97
85
|
|
|
98
|
-
const renderQuote = ({ item }: { item: OnRampQuote }) => {
|
|
86
|
+
const renderQuote = ({ item, index }: { item: OnRampQuote; index: number }) => {
|
|
99
87
|
const logoURL = OnRampController.getServiceProviderImage(item.serviceProvider);
|
|
100
|
-
const
|
|
101
|
-
|
|
102
|
-
OnRampController.state.
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
88
|
+
const isSelected =
|
|
89
|
+
item.serviceProvider === OnRampController.state.selectedQuote?.serviceProvider &&
|
|
90
|
+
item.paymentMethodType === OnRampController.state.selectedQuote?.paymentMethodType;
|
|
91
|
+
|
|
92
|
+
const isRecommended =
|
|
93
|
+
availableQuotes?.findIndex(quote => quote.serviceProvider === item.serviceProvider) === 0 &&
|
|
94
|
+
availableQuotes?.length > 1;
|
|
95
|
+
const tagText = isRecommended ? 'Recommended' : item.lowKyc ? 'Low KYC' : undefined;
|
|
106
96
|
|
|
107
97
|
return (
|
|
108
98
|
<Quote
|
|
109
99
|
item={item}
|
|
110
|
-
selected={
|
|
100
|
+
selected={isSelected}
|
|
111
101
|
logoURL={logoURL}
|
|
112
102
|
onQuotePress={() => handleQuotePress(item)}
|
|
113
103
|
tagText={tagText}
|
|
114
|
-
|
|
115
|
-
);
|
|
116
|
-
};
|
|
117
|
-
|
|
118
|
-
const renderEmpty = () => {
|
|
119
|
-
return OnRampController.state.quotesLoading ? (
|
|
120
|
-
<FlexView
|
|
121
|
-
alignItems="center"
|
|
122
|
-
justifyContent="center"
|
|
123
|
-
padding="2xl"
|
|
124
|
-
style={styles.emptyContainer}
|
|
125
|
-
>
|
|
126
|
-
<LoadingSpinner />
|
|
127
|
-
</FlexView>
|
|
128
|
-
) : (
|
|
129
|
-
<Placeholder
|
|
130
|
-
title="No providers available"
|
|
131
|
-
description="Please select a different payment method or increase the amount"
|
|
132
|
-
icon="warningCircle"
|
|
104
|
+
testID={`quote-item-${index}`}
|
|
133
105
|
/>
|
|
134
106
|
);
|
|
135
107
|
};
|
|
136
108
|
|
|
137
109
|
const renderPaymentMethod = ({ item }: { item: OnRampPaymentMethod }) => {
|
|
138
110
|
const parsedItem = item as OnRampPaymentMethod;
|
|
139
|
-
const
|
|
140
|
-
parsedItem.paymentMethod === OnRampController.state.selectedPaymentMethod?.paymentMethod;
|
|
111
|
+
const isSelected = parsedItem.paymentMethod === activePaymentMethod?.paymentMethod;
|
|
141
112
|
|
|
142
113
|
return (
|
|
143
114
|
<PaymentMethod
|
|
144
115
|
item={parsedItem}
|
|
145
116
|
onPress={() => handlePaymentMethodPress(parsedItem)}
|
|
146
|
-
selected={
|
|
117
|
+
selected={isSelected}
|
|
147
118
|
testID={`payment-method-item-${parsedItem.paymentMethod}`}
|
|
148
119
|
/>
|
|
149
120
|
);
|
|
150
121
|
};
|
|
151
122
|
|
|
123
|
+
useEffect(() => {
|
|
124
|
+
if (visible && OnRampController.state.selectedPaymentMethod) {
|
|
125
|
+
const methods = [
|
|
126
|
+
OnRampController.state.selectedPaymentMethod,
|
|
127
|
+
...OnRampController.state.paymentMethods.filter(
|
|
128
|
+
m => m.paymentMethod !== OnRampController.state.selectedPaymentMethod?.paymentMethod
|
|
129
|
+
)
|
|
130
|
+
];
|
|
131
|
+
//Update payment methods order
|
|
132
|
+
setPaymentMethods(methods);
|
|
133
|
+
setActivePaymentMethod(OnRampController.state.selectedPaymentMethod);
|
|
134
|
+
}
|
|
135
|
+
}, [visible]);
|
|
136
|
+
|
|
152
137
|
return (
|
|
153
138
|
<Modal
|
|
154
139
|
isVisible={visible}
|
|
@@ -176,7 +161,7 @@ export function SelectPaymentModal({ title, visible, onClose }: SelectPaymentMod
|
|
|
176
161
|
</Text>
|
|
177
162
|
<FlexView>
|
|
178
163
|
<FlatList
|
|
179
|
-
data={
|
|
164
|
+
data={availablePaymentMethods}
|
|
180
165
|
renderItem={renderPaymentMethod}
|
|
181
166
|
ref={paymentMethodsRef}
|
|
182
167
|
style={styles.paymentMethodsContainer}
|
|
@@ -195,10 +180,10 @@ export function SelectPaymentModal({ title, visible, onClose }: SelectPaymentMod
|
|
|
195
180
|
data={sortedQuotes}
|
|
196
181
|
bounces={false}
|
|
197
182
|
renderItem={renderQuote}
|
|
183
|
+
extraData={selectedPaymentMethod}
|
|
198
184
|
contentContainerStyle={styles.listContent}
|
|
199
185
|
ItemSeparatorComponent={renderSeparator}
|
|
200
186
|
fadingEdgeLength={20}
|
|
201
|
-
ListEmptyComponent={renderEmpty}
|
|
202
187
|
keyExtractor={item => `${item.serviceProvider}-${item.paymentMethodType}`}
|
|
203
188
|
getItemLayout={(_, index) => ({
|
|
204
189
|
length: QUOTE_ITEM_HEIGHT + SEPARATOR_HEIGHT,
|
|
@@ -16,21 +16,19 @@ import {
|
|
|
16
16
|
Button,
|
|
17
17
|
FlexView,
|
|
18
18
|
Image,
|
|
19
|
-
ListItem,
|
|
20
19
|
Text,
|
|
21
20
|
TokenButton,
|
|
22
21
|
useTheme
|
|
23
22
|
} from '@reown/appkit-ui-react-native';
|
|
24
23
|
import { NumberUtil, StringUtil } from '@reown/appkit-common-react-native';
|
|
25
24
|
import { SelectorModal } from '../../partials/w3m-selector-modal';
|
|
26
|
-
import { Currency } from './components/Currency';
|
|
27
|
-
import { getPurchaseCurrencies,
|
|
25
|
+
import { Currency, ITEM_HEIGHT as CURRENCY_ITEM_HEIGHT } from './components/Currency';
|
|
26
|
+
import { getPurchaseCurrencies, getQuotesDebounced } from './utils';
|
|
28
27
|
import { CurrencyInput } from './components/CurrencyInput';
|
|
29
28
|
import { SelectPaymentModal } from './components/SelectPaymentModal';
|
|
30
|
-
import { ITEM_HEIGHT as CURRENCY_ITEM_HEIGHT } from './components/Currency';
|
|
31
29
|
import { Header } from './components/Header';
|
|
32
|
-
import { UiUtil } from '../../utils/UiUtil';
|
|
33
30
|
import { LoadingView } from './components/LoadingView';
|
|
31
|
+
import PaymentButton from './components/PaymentButton';
|
|
34
32
|
import styles from './styles';
|
|
35
33
|
|
|
36
34
|
const MemoizedCurrency = memo(Currency);
|
|
@@ -42,10 +40,10 @@ export function OnRampView() {
|
|
|
42
40
|
const {
|
|
43
41
|
purchaseCurrency,
|
|
44
42
|
paymentCurrency,
|
|
45
|
-
paymentMethods,
|
|
46
43
|
selectedPaymentMethod,
|
|
47
44
|
paymentAmount,
|
|
48
45
|
quotesLoading,
|
|
46
|
+
quotes,
|
|
49
47
|
selectedQuote,
|
|
50
48
|
error,
|
|
51
49
|
loading,
|
|
@@ -56,8 +54,6 @@ export function OnRampView() {
|
|
|
56
54
|
const [searchValue, setSearchValue] = useState('');
|
|
57
55
|
const [isCurrencyModalVisible, setIsCurrencyModalVisible] = useState(false);
|
|
58
56
|
const [isPaymentMethodModalVisible, setIsPaymentMethodModalVisible] = useState(false);
|
|
59
|
-
const providerImage = OnRampController.getServiceProviderImage(selectedQuote?.serviceProvider);
|
|
60
|
-
const suggestedValues = getCurrencySuggestedValues(paymentCurrency);
|
|
61
57
|
const purchaseCurrencyCode =
|
|
62
58
|
purchaseCurrency?.currencyCode?.split('_')[0] ?? purchaseCurrency?.currencyCode;
|
|
63
59
|
const networkImage = activeNetwork ? networkImages[activeNetwork.id] : undefined;
|
|
@@ -68,24 +64,41 @@ export function OnRampView() {
|
|
|
68
64
|
}
|
|
69
65
|
}, []);
|
|
70
66
|
|
|
71
|
-
const
|
|
72
|
-
if (
|
|
73
|
-
return
|
|
67
|
+
const getPaymentButtonTitle = () => {
|
|
68
|
+
if (selectedPaymentMethod) {
|
|
69
|
+
return selectedPaymentMethod.name;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if (quotesLoading) {
|
|
73
|
+
return 'Loading quotes';
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
if (!paymentAmount) {
|
|
77
|
-
return 'Enter
|
|
76
|
+
if (!paymentAmount || quotes?.length === 0) {
|
|
77
|
+
return 'Enter a valid amount';
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
return '';
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
const getPaymentButtonSubtitle = () => {
|
|
84
|
+
if (selectedQuote) {
|
|
85
|
+
return StringUtil.capitalize(selectedQuote?.serviceProvider);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
if (selectedPaymentMethod) {
|
|
89
|
+
if (quotesLoading) {
|
|
90
|
+
return 'Loading quotes';
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
if (!paymentAmount || quotes?.length === 0) {
|
|
94
|
+
return 'Enter a valid amount';
|
|
95
|
+
}
|
|
82
96
|
}
|
|
83
97
|
|
|
84
|
-
return
|
|
98
|
+
return undefined;
|
|
85
99
|
};
|
|
86
100
|
|
|
87
101
|
const onValueChange = (value: number) => {
|
|
88
|
-
UiUtil.animateChange();
|
|
89
102
|
if (!value) {
|
|
90
103
|
OnRampController.abortGetQuotes();
|
|
91
104
|
OnRampController.setPaymentAmount(0);
|
|
@@ -96,13 +109,7 @@ export function OnRampView() {
|
|
|
96
109
|
}
|
|
97
110
|
|
|
98
111
|
OnRampController.setPaymentAmount(value);
|
|
99
|
-
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
const onSuggestedValuePress = (value: number) => {
|
|
103
|
-
UiUtil.animateChange();
|
|
104
|
-
OnRampController.setPaymentAmount(value);
|
|
105
|
-
getQuotes();
|
|
112
|
+
getQuotesDebounced();
|
|
106
113
|
};
|
|
107
114
|
|
|
108
115
|
const handleSearch = (value: string) => {
|
|
@@ -142,10 +149,6 @@ export function OnRampView() {
|
|
|
142
149
|
setIsPaymentMethodModalVisible(false);
|
|
143
150
|
};
|
|
144
151
|
|
|
145
|
-
useEffect(() => {
|
|
146
|
-
getQuotes();
|
|
147
|
-
}, [selectedPaymentMethod, getQuotes]);
|
|
148
|
-
|
|
149
152
|
useEffect(() => {
|
|
150
153
|
if (error?.type === ConstantsUtil.ONRAMP_ERROR_TYPES.FAILED_TO_LOAD) {
|
|
151
154
|
SnackController.showInternalError({
|
|
@@ -196,8 +199,6 @@ export function OnRampView() {
|
|
|
196
199
|
value={paymentAmount?.toString()}
|
|
197
200
|
symbol={paymentCurrency?.currencyCode}
|
|
198
201
|
error={error?.message}
|
|
199
|
-
suggestedValues={suggestedValues}
|
|
200
|
-
onSuggestedValuePress={onSuggestedValuePress}
|
|
201
202
|
isAmountError={
|
|
202
203
|
error?.type === ConstantsUtil.ONRAMP_ERROR_TYPES.AMOUNT_TOO_LOW ||
|
|
203
204
|
error?.type === ConstantsUtil.ONRAMP_ERROR_TYPES.AMOUNT_TOO_HIGH ||
|
|
@@ -212,46 +213,16 @@ export function OnRampView() {
|
|
|
212
213
|
onValueChange={onValueChange}
|
|
213
214
|
style={styles.currencyInput}
|
|
214
215
|
/>
|
|
215
|
-
<
|
|
216
|
-
|
|
217
|
-
|
|
216
|
+
<PaymentButton
|
|
217
|
+
title={getPaymentButtonTitle()}
|
|
218
|
+
subtitle={getPaymentButtonSubtitle()}
|
|
219
|
+
paymentLogo={selectedPaymentMethod?.logos[themeMode ?? 'light']}
|
|
220
|
+
providerLogo={OnRampController.getServiceProviderImage(selectedQuote?.serviceProvider)}
|
|
221
|
+
disabled={!paymentAmount || quotes?.length === 0}
|
|
218
222
|
loading={quotesLoading || loading}
|
|
219
223
|
onPress={() => setIsPaymentMethodModalVisible(true)}
|
|
220
|
-
style={styles.paymentMethodButton}
|
|
221
|
-
imageSrc={selectedPaymentMethod?.logos[themeMode ?? 'light']}
|
|
222
|
-
imageStyle={styles.paymentMethodImage}
|
|
223
|
-
imageContainerStyle={[
|
|
224
|
-
styles.paymentMethodImageContainer,
|
|
225
|
-
{ backgroundColor: Theme['gray-glass-010'] }
|
|
226
|
-
]}
|
|
227
|
-
disabled={!selectedPaymentMethod || !paymentAmount}
|
|
228
224
|
testID="payment-method-button"
|
|
229
|
-
|
|
230
|
-
<FlexView>
|
|
231
|
-
{selectedPaymentMethod?.name && (
|
|
232
|
-
<Text variant="paragraph-400" color="fg-100">
|
|
233
|
-
{selectedPaymentMethod.name}
|
|
234
|
-
</Text>
|
|
235
|
-
)}
|
|
236
|
-
{getProviderButtonText() && (
|
|
237
|
-
<FlexView flexDirection="row" alignItems="center" margin={['3xs', '0', '0', '0']}>
|
|
238
|
-
<Text variant="small-400" color="fg-150">
|
|
239
|
-
{getProviderButtonText()}
|
|
240
|
-
</Text>
|
|
241
|
-
{selectedQuote && (
|
|
242
|
-
<>
|
|
243
|
-
{providerImage && (
|
|
244
|
-
<Image source={providerImage} style={styles.providerImage} />
|
|
245
|
-
)}
|
|
246
|
-
<Text variant="small-400" color="fg-150">
|
|
247
|
-
{StringUtil.capitalize(selectedQuote?.serviceProvider)}
|
|
248
|
-
</Text>
|
|
249
|
-
</>
|
|
250
|
-
)}
|
|
251
|
-
</FlexView>
|
|
252
|
-
)}
|
|
253
|
-
</FlexView>
|
|
254
|
-
</ListItem>
|
|
225
|
+
/>
|
|
255
226
|
<FlexView
|
|
256
227
|
flexDirection="row"
|
|
257
228
|
alignItems="center"
|