@reown/appkit-react-native 0.0.0-feat-multichain-20250818154639 → 0.0.0-feat-multichain-20250903132047
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 +55 -40
- package/lib/commonjs/AppKit.js.map +1 -1
- package/lib/commonjs/connectors/WalletConnectConnector.js +6 -3
- package/lib/commonjs/connectors/WalletConnectConnector.js.map +1 -1
- package/lib/commonjs/modal/w3m-modal/index.js +1 -6
- package/lib/commonjs/modal/w3m-modal/index.js.map +1 -1
- package/lib/commonjs/modal/w3m-router/index.js +7 -4
- package/lib/commonjs/modal/w3m-router/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-all-wallets-list/components/Loading.js +7 -97
- package/lib/commonjs/partials/w3m-all-wallets-list/components/Loading.js.map +1 -1
- package/lib/commonjs/partials/w3m-all-wallets-list/components/WalletItem.js +2 -8
- package/lib/commonjs/partials/w3m-all-wallets-list/components/WalletItem.js.map +1 -1
- package/lib/commonjs/partials/w3m-all-wallets-list/components/WalletList.js +90 -0
- package/lib/commonjs/partials/w3m-all-wallets-list/components/WalletList.js.map +1 -0
- package/lib/commonjs/partials/w3m-all-wallets-list/index.js +7 -43
- package/lib/commonjs/partials/w3m-all-wallets-list/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-all-wallets-list/styles.js +7 -4
- package/lib/commonjs/partials/w3m-all-wallets-list/styles.js.map +1 -1
- package/lib/commonjs/partials/w3m-all-wallets-search/index.js +7 -39
- package/lib/commonjs/partials/w3m-all-wallets-search/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-connecting-mobile/index.js +4 -4
- package/lib/commonjs/partials/w3m-connecting-mobile/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-connecting-mobile/styles.js +2 -1
- package/lib/commonjs/partials/w3m-connecting-mobile/styles.js.map +1 -1
- package/lib/commonjs/partials/w3m-connecting-qrcode/index.js +6 -1
- package/lib/commonjs/partials/w3m-connecting-qrcode/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-connecting-web/index.js +1 -0
- package/lib/commonjs/partials/w3m-connecting-web/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-connecting-web/styles.js +3 -0
- package/lib/commonjs/partials/w3m-connecting-web/styles.js.map +1 -1
- package/lib/commonjs/partials/w3m-header/index.js +4 -3
- package/lib/commonjs/partials/w3m-header/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-selector-modal/index.js +69 -56
- package/lib/commonjs/partials/w3m-selector-modal/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-selector-modal/styles.js +9 -11
- package/lib/commonjs/partials/w3m-selector-modal/styles.js.map +1 -1
- package/lib/commonjs/views/w3m-account-default-view/index.js +2 -2
- package/lib/commonjs/views/w3m-all-wallets-view/index.js +5 -22
- package/lib/commonjs/views/w3m-all-wallets-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-connect-view/index.js +1 -1
- package/lib/commonjs/views/w3m-connect-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-connecting-external-view/index.js +4 -4
- package/lib/commonjs/views/w3m-connecting-external-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-connecting-external-view/styles.js +2 -1
- package/lib/commonjs/views/w3m-connecting-external-view/styles.js.map +1 -1
- package/lib/commonjs/views/w3m-connecting-siwe-view/index.js +56 -54
- package/lib/commonjs/views/w3m-connecting-siwe-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-connecting-siwe-view/styles.js +3 -7
- package/lib/commonjs/views/w3m-connecting-siwe-view/styles.js.map +1 -1
- package/lib/commonjs/views/w3m-connecting-social-view/index.js +36 -30
- package/lib/commonjs/views/w3m-connecting-social-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-connecting-social-view/styles.js +3 -0
- package/lib/commonjs/views/w3m-connecting-social-view/styles.js.map +1 -1
- package/lib/commonjs/views/w3m-networks-view/index.js +7 -4
- package/lib/commonjs/views/w3m-networks-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-onramp-checkout-view/index.js +160 -152
- package/lib/commonjs/views/w3m-onramp-checkout-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-onramp-loading-view/index.js +4 -4
- package/lib/commonjs/views/w3m-onramp-loading-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-onramp-loading-view/styles.js +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 +3 -2
- package/lib/commonjs/views/w3m-onramp-settings-view/components/Country.js.map +1 -1
- package/lib/commonjs/views/w3m-onramp-settings-view/index.js +6 -4
- package/lib/commonjs/views/w3m-onramp-settings-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-onramp-settings-view/styles.js +4 -1
- package/lib/commonjs/views/w3m-onramp-settings-view/styles.js.map +1 -1
- package/lib/commonjs/views/w3m-onramp-view/components/Currency.js +3 -2
- package/lib/commonjs/views/w3m-onramp-view/components/Currency.js.map +1 -1
- package/lib/commonjs/views/w3m-onramp-view/components/Header.js +1 -1
- package/lib/commonjs/views/w3m-onramp-view/components/SelectPaymentModal.js +5 -2
- package/lib/commonjs/views/w3m-onramp-view/components/SelectPaymentModal.js.map +1 -1
- package/lib/commonjs/views/w3m-onramp-view/index.js +4 -3
- package/lib/commonjs/views/w3m-onramp-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-onramp-view/styles.js +3 -0
- package/lib/commonjs/views/w3m-onramp-view/styles.js.map +1 -1
- package/lib/commonjs/views/w3m-swap-preview-view/styles.js +0 -3
- package/lib/commonjs/views/w3m-swap-preview-view/styles.js.map +1 -1
- package/lib/commonjs/views/w3m-swap-view/components/select-token-modal/index.js +157 -0
- package/lib/commonjs/views/w3m-swap-view/components/select-token-modal/index.js.map +1 -0
- package/lib/commonjs/views/w3m-swap-view/components/{select-token-view → select-token-modal}/styles.js +6 -2
- package/lib/commonjs/views/w3m-swap-view/components/select-token-modal/styles.js.map +1 -0
- package/lib/commonjs/views/w3m-swap-view/components/select-token-modal/utils.js.map +1 -0
- package/lib/commonjs/views/w3m-swap-view/index.js +9 -12
- package/lib/commonjs/views/w3m-swap-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-swap-view/styles.js +0 -8
- package/lib/commonjs/views/w3m-swap-view/styles.js.map +1 -1
- package/lib/commonjs/views/w3m-unsupported-chain-view/index.js +5 -11
- package/lib/commonjs/views/w3m-unsupported-chain-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-unsupported-chain-view/styles.js +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 +2 -4
- 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 +1 -2
- package/lib/commonjs/views/w3m-wallet-compatible-networks-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-wallet-send-select-token-view/index.js +4 -2
- 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 -2
- package/lib/commonjs/views/w3m-wallet-send-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-wallet-send-view/styles.js +0 -3
- package/lib/commonjs/views/w3m-wallet-send-view/styles.js.map +1 -1
- package/lib/module/AppKit.js +55 -40
- package/lib/module/AppKit.js.map +1 -1
- package/lib/module/connectors/WalletConnectConnector.js +6 -3
- package/lib/module/connectors/WalletConnectConnector.js.map +1 -1
- package/lib/module/modal/w3m-modal/index.js +2 -7
- package/lib/module/modal/w3m-modal/index.js.map +1 -1
- package/lib/module/modal/w3m-router/index.js +7 -4
- package/lib/module/modal/w3m-router/index.js.map +1 -1
- package/lib/module/partials/w3m-all-wallets-list/components/Loading.js +8 -98
- package/lib/module/partials/w3m-all-wallets-list/components/Loading.js.map +1 -1
- package/lib/module/partials/w3m-all-wallets-list/components/WalletItem.js +2 -8
- package/lib/module/partials/w3m-all-wallets-list/components/WalletItem.js.map +1 -1
- package/lib/module/partials/w3m-all-wallets-list/components/WalletList.js +86 -0
- package/lib/module/partials/w3m-all-wallets-list/components/WalletList.js.map +1 -0
- package/lib/module/partials/w3m-all-wallets-list/index.js +7 -43
- package/lib/module/partials/w3m-all-wallets-list/index.js.map +1 -1
- package/lib/module/partials/w3m-all-wallets-list/styles.js +7 -4
- package/lib/module/partials/w3m-all-wallets-list/styles.js.map +1 -1
- package/lib/module/partials/w3m-all-wallets-search/index.js +8 -40
- package/lib/module/partials/w3m-all-wallets-search/index.js.map +1 -1
- package/lib/module/partials/w3m-connecting-mobile/index.js +4 -4
- package/lib/module/partials/w3m-connecting-mobile/index.js.map +1 -1
- package/lib/module/partials/w3m-connecting-mobile/styles.js +2 -1
- package/lib/module/partials/w3m-connecting-mobile/styles.js.map +1 -1
- package/lib/module/partials/w3m-connecting-qrcode/index.js +6 -1
- package/lib/module/partials/w3m-connecting-qrcode/index.js.map +1 -1
- package/lib/module/partials/w3m-connecting-web/index.js +1 -0
- package/lib/module/partials/w3m-connecting-web/index.js.map +1 -1
- package/lib/module/partials/w3m-connecting-web/styles.js +3 -0
- package/lib/module/partials/w3m-connecting-web/styles.js.map +1 -1
- package/lib/module/partials/w3m-header/index.js +4 -3
- package/lib/module/partials/w3m-header/index.js.map +1 -1
- package/lib/module/partials/w3m-selector-modal/index.js +71 -58
- package/lib/module/partials/w3m-selector-modal/index.js.map +1 -1
- package/lib/module/partials/w3m-selector-modal/styles.js +9 -11
- package/lib/module/partials/w3m-selector-modal/styles.js.map +1 -1
- package/lib/module/views/w3m-account-default-view/index.js +2 -2
- package/lib/module/views/w3m-all-wallets-view/index.js +6 -23
- package/lib/module/views/w3m-all-wallets-view/index.js.map +1 -1
- package/lib/module/views/w3m-connect-view/index.js +1 -1
- package/lib/module/views/w3m-connect-view/index.js.map +1 -1
- package/lib/module/views/w3m-connecting-external-view/index.js +4 -4
- package/lib/module/views/w3m-connecting-external-view/index.js.map +1 -1
- package/lib/module/views/w3m-connecting-external-view/styles.js +2 -1
- package/lib/module/views/w3m-connecting-external-view/styles.js.map +1 -1
- package/lib/module/views/w3m-connecting-siwe-view/index.js +58 -56
- package/lib/module/views/w3m-connecting-siwe-view/index.js.map +1 -1
- package/lib/module/views/w3m-connecting-siwe-view/styles.js +3 -7
- package/lib/module/views/w3m-connecting-siwe-view/styles.js.map +1 -1
- package/lib/module/views/w3m-connecting-social-view/index.js +36 -30
- package/lib/module/views/w3m-connecting-social-view/index.js.map +1 -1
- package/lib/module/views/w3m-connecting-social-view/styles.js +3 -0
- package/lib/module/views/w3m-connecting-social-view/styles.js.map +1 -1
- package/lib/module/views/w3m-networks-view/index.js +8 -5
- package/lib/module/views/w3m-networks-view/index.js.map +1 -1
- package/lib/module/views/w3m-onramp-checkout-view/index.js +162 -154
- package/lib/module/views/w3m-onramp-checkout-view/index.js.map +1 -1
- package/lib/module/views/w3m-onramp-loading-view/index.js +4 -4
- package/lib/module/views/w3m-onramp-loading-view/index.js.map +1 -1
- package/lib/module/views/w3m-onramp-loading-view/styles.js +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 +3 -2
- package/lib/module/views/w3m-onramp-settings-view/components/Country.js.map +1 -1
- package/lib/module/views/w3m-onramp-settings-view/index.js +6 -4
- package/lib/module/views/w3m-onramp-settings-view/index.js.map +1 -1
- package/lib/module/views/w3m-onramp-settings-view/styles.js +4 -1
- package/lib/module/views/w3m-onramp-settings-view/styles.js.map +1 -1
- package/lib/module/views/w3m-onramp-view/components/Currency.js +3 -2
- package/lib/module/views/w3m-onramp-view/components/Currency.js.map +1 -1
- package/lib/module/views/w3m-onramp-view/components/Header.js +1 -1
- package/lib/module/views/w3m-onramp-view/components/SelectPaymentModal.js +6 -3
- package/lib/module/views/w3m-onramp-view/components/SelectPaymentModal.js.map +1 -1
- package/lib/module/views/w3m-onramp-view/index.js +4 -3
- package/lib/module/views/w3m-onramp-view/index.js.map +1 -1
- package/lib/module/views/w3m-onramp-view/styles.js +3 -0
- package/lib/module/views/w3m-onramp-view/styles.js.map +1 -1
- package/lib/module/views/w3m-swap-preview-view/styles.js +0 -3
- package/lib/module/views/w3m-swap-preview-view/styles.js.map +1 -1
- package/lib/module/views/w3m-swap-view/components/select-token-modal/index.js +152 -0
- package/lib/module/views/w3m-swap-view/components/select-token-modal/index.js.map +1 -0
- package/lib/module/views/w3m-swap-view/components/{select-token-view → select-token-modal}/styles.js +6 -2
- package/lib/module/views/w3m-swap-view/components/select-token-modal/styles.js.map +1 -0
- package/lib/module/views/w3m-swap-view/components/select-token-modal/utils.js.map +1 -0
- package/lib/module/views/w3m-swap-view/index.js +10 -13
- package/lib/module/views/w3m-swap-view/index.js.map +1 -1
- package/lib/module/views/w3m-swap-view/styles.js +0 -8
- package/lib/module/views/w3m-swap-view/styles.js.map +1 -1
- package/lib/module/views/w3m-unsupported-chain-view/index.js +7 -13
- package/lib/module/views/w3m-unsupported-chain-view/index.js.map +1 -1
- package/lib/module/views/w3m-unsupported-chain-view/styles.js +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 +3 -5
- 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 +1 -2
- package/lib/module/views/w3m-wallet-compatible-networks-view/index.js.map +1 -1
- package/lib/module/views/w3m-wallet-send-select-token-view/index.js +4 -2
- 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 +5 -2
- package/lib/module/views/w3m-wallet-send-view/index.js.map +1 -1
- package/lib/module/views/w3m-wallet-send-view/styles.js +0 -3
- package/lib/module/views/w3m-wallet-send-view/styles.js.map +1 -1
- package/lib/typescript/AppKit.d.ts +1 -1
- package/lib/typescript/AppKit.d.ts.map +1 -1
- package/lib/typescript/connectors/WalletConnectConnector.d.ts.map +1 -1
- package/lib/typescript/modal/w3m-modal/index.d.ts.map +1 -1
- package/lib/typescript/modal/w3m-router/index.d.ts.map +1 -1
- package/lib/typescript/partials/w3m-all-wallets-list/components/Loading.d.ts +2 -4
- package/lib/typescript/partials/w3m-all-wallets-list/components/Loading.d.ts.map +1 -1
- package/lib/typescript/partials/w3m-all-wallets-list/components/WalletItem.d.ts +1 -3
- package/lib/typescript/partials/w3m-all-wallets-list/components/WalletItem.d.ts.map +1 -1
- package/lib/typescript/partials/w3m-all-wallets-list/components/WalletList.d.ts +12 -0
- package/lib/typescript/partials/w3m-all-wallets-list/components/WalletList.d.ts.map +1 -0
- package/lib/typescript/partials/w3m-all-wallets-list/index.d.ts +1 -3
- 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 +6 -3
- 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 +1 -4
- package/lib/typescript/partials/w3m-all-wallets-search/index.d.ts.map +1 -1
- package/lib/typescript/partials/w3m-connecting-mobile/styles.d.ts +1 -0
- package/lib/typescript/partials/w3m-connecting-mobile/styles.d.ts.map +1 -1
- package/lib/typescript/partials/w3m-connecting-qrcode/index.d.ts.map +1 -1
- package/lib/typescript/partials/w3m-connecting-web/styles.d.ts +3 -0
- package/lib/typescript/partials/w3m-connecting-web/styles.d.ts.map +1 -1
- package/lib/typescript/partials/w3m-header/index.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 +6 -8
- package/lib/typescript/partials/w3m-selector-modal/styles.d.ts.map +1 -1
- package/lib/typescript/views/w3m-all-wallets-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-connecting-external-view/styles.d.ts +1 -0
- package/lib/typescript/views/w3m-connecting-external-view/styles.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-siwe-view/styles.d.ts +3 -7
- package/lib/typescript/views/w3m-connecting-siwe-view/styles.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-social-view/styles.d.ts +3 -0
- package/lib/typescript/views/w3m-connecting-social-view/styles.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 +3 -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/styles.d.ts +4 -1
- package/lib/typescript/views/w3m-onramp-settings-view/styles.d.ts.map +1 -1
- package/lib/typescript/views/w3m-onramp-view/components/Currency.d.ts +3 -1
- package/lib/typescript/views/w3m-onramp-view/components/Currency.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 +3 -0
- package/lib/typescript/views/w3m-onramp-view/styles.d.ts.map +1 -1
- package/lib/typescript/views/w3m-swap-preview-view/styles.d.ts +0 -3
- 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 → select-token-modal}/index.d.ts +2 -1
- package/lib/typescript/views/w3m-swap-view/components/select-token-modal/index.d.ts.map +1 -0
- package/lib/typescript/views/w3m-swap-view/components/{select-token-view → select-token-modal}/styles.d.ts +6 -2
- package/lib/typescript/views/w3m-swap-view/components/{select-token-view → select-token-modal}/styles.d.ts.map +1 -1
- package/lib/typescript/views/w3m-swap-view/components/select-token-modal/utils.d.ts.map +1 -0
- package/lib/typescript/views/w3m-swap-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-swap-view/styles.d.ts +0 -8
- 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-upgrade-email-wallet-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-wallet-send-view/styles.d.ts +0 -3
- package/lib/typescript/views/w3m-wallet-send-view/styles.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/AppKit.ts +64 -43
- package/src/connectors/WalletConnectConnector.ts +7 -4
- package/src/modal/w3m-modal/index.tsx +2 -3
- package/src/modal/w3m-router/index.tsx +3 -4
- package/src/partials/w3m-all-wallets-list/components/Loading.tsx +4 -35
- package/src/partials/w3m-all-wallets-list/components/WalletItem.tsx +3 -12
- package/src/partials/w3m-all-wallets-list/components/WalletList.tsx +95 -0
- package/src/partials/w3m-all-wallets-list/index.tsx +8 -43
- package/src/partials/w3m-all-wallets-list/styles.ts +7 -4
- package/src/partials/w3m-all-wallets-search/index.tsx +6 -47
- package/src/partials/w3m-connecting-mobile/index.tsx +8 -8
- package/src/partials/w3m-connecting-mobile/styles.ts +2 -1
- package/src/partials/w3m-connecting-qrcode/index.tsx +4 -1
- package/src/partials/w3m-connecting-web/index.tsx +1 -1
- package/src/partials/w3m-connecting-web/styles.ts +3 -0
- package/src/partials/w3m-header/index.tsx +6 -3
- package/src/partials/w3m-selector-modal/index.tsx +80 -60
- package/src/partials/w3m-selector-modal/styles.ts +9 -11
- package/src/views/w3m-account-default-view/index.tsx +2 -2
- package/src/views/w3m-all-wallets-view/index.tsx +9 -32
- package/src/views/w3m-connect-view/index.tsx +1 -1
- package/src/views/w3m-connecting-external-view/index.tsx +8 -8
- package/src/views/w3m-connecting-external-view/styles.ts +2 -1
- package/src/views/w3m-connecting-siwe-view/index.tsx +49 -42
- package/src/views/w3m-connecting-siwe-view/styles.ts +3 -7
- package/src/views/w3m-connecting-social-view/index.tsx +30 -27
- package/src/views/w3m-connecting-social-view/styles.ts +3 -0
- package/src/views/w3m-networks-view/index.tsx +6 -8
- package/src/views/w3m-onramp-checkout-view/index.tsx +147 -143
- package/src/views/w3m-onramp-loading-view/index.tsx +3 -7
- package/src/views/w3m-onramp-loading-view/styles.ts +1 -1
- package/src/views/w3m-onramp-settings-view/components/Country.tsx +8 -3
- package/src/views/w3m-onramp-settings-view/index.tsx +4 -2
- package/src/views/w3m-onramp-settings-view/styles.ts +4 -1
- package/src/views/w3m-onramp-view/components/Currency.tsx +4 -3
- package/src/views/w3m-onramp-view/components/Header.tsx +1 -1
- package/src/views/w3m-onramp-view/components/SelectPaymentModal.tsx +6 -3
- package/src/views/w3m-onramp-view/index.tsx +3 -2
- package/src/views/w3m-onramp-view/styles.ts +3 -0
- package/src/views/w3m-swap-preview-view/styles.ts +0 -3
- package/src/views/w3m-swap-view/components/select-token-modal/index.tsx +183 -0
- package/src/views/w3m-swap-view/components/{select-token-view → select-token-modal}/styles.ts +6 -2
- package/src/views/w3m-swap-view/index.tsx +8 -7
- package/src/views/w3m-swap-view/styles.ts +0 -8
- package/src/views/w3m-unsupported-chain-view/index.tsx +4 -6
- package/src/views/w3m-unsupported-chain-view/styles.ts +1 -1
- package/src/views/w3m-upgrade-email-wallet-view/index.tsx +3 -5
- package/src/views/w3m-wallet-compatible-networks-view/index.tsx +1 -1
- package/src/views/w3m-wallet-send-select-token-view/index.tsx +2 -2
- package/src/views/w3m-wallet-send-view/index.tsx +2 -2
- package/src/views/w3m-wallet-send-view/styles.ts +0 -3
- package/lib/commonjs/views/w3m-network-switch-view/index.js +0 -127
- package/lib/commonjs/views/w3m-network-switch-view/index.js.map +0 -1
- package/lib/commonjs/views/w3m-network-switch-view/styles.js +0 -31
- package/lib/commonjs/views/w3m-network-switch-view/styles.js.map +0 -1
- package/lib/commonjs/views/w3m-swap-view/components/select-token-view/index.js +0 -145
- package/lib/commonjs/views/w3m-swap-view/components/select-token-view/index.js.map +0 -1
- package/lib/commonjs/views/w3m-swap-view/components/select-token-view/styles.js.map +0 -1
- package/lib/commonjs/views/w3m-swap-view/components/select-token-view/utils.js.map +0 -1
- package/lib/module/views/w3m-network-switch-view/index.js +0 -123
- package/lib/module/views/w3m-network-switch-view/index.js.map +0 -1
- package/lib/module/views/w3m-network-switch-view/styles.js +0 -27
- package/lib/module/views/w3m-network-switch-view/styles.js.map +0 -1
- package/lib/module/views/w3m-swap-view/components/select-token-view/index.js +0 -140
- package/lib/module/views/w3m-swap-view/components/select-token-view/index.js.map +0 -1
- package/lib/module/views/w3m-swap-view/components/select-token-view/styles.js.map +0 -1
- package/lib/module/views/w3m-swap-view/components/select-token-view/utils.js.map +0 -1
- package/lib/typescript/views/w3m-network-switch-view/index.d.ts +0 -2
- package/lib/typescript/views/w3m-network-switch-view/index.d.ts.map +0 -1
- package/lib/typescript/views/w3m-network-switch-view/styles.d.ts +0 -24
- package/lib/typescript/views/w3m-network-switch-view/styles.d.ts.map +0 -1
- package/lib/typescript/views/w3m-swap-view/components/select-token-view/index.d.ts.map +0 -1
- package/lib/typescript/views/w3m-swap-view/components/select-token-view/utils.d.ts.map +0 -1
- package/src/views/w3m-network-switch-view/index.tsx +0 -132
- package/src/views/w3m-network-switch-view/styles.ts +0 -23
- package/src/views/w3m-swap-view/components/select-token-view/index.tsx +0 -176
- /package/lib/commonjs/views/w3m-swap-view/components/{select-token-view → select-token-modal}/utils.js +0 -0
- /package/lib/module/views/w3m-swap-view/components/{select-token-view → select-token-modal}/utils.js +0 -0
- /package/lib/typescript/views/w3m-swap-view/components/{select-token-view → select-token-modal}/utils.d.ts +0 -0
- /package/src/views/w3m-swap-view/components/{select-token-view → select-token-modal}/utils.ts +0 -0
package/src/AppKit.ts
CHANGED
|
@@ -14,7 +14,8 @@ import {
|
|
|
14
14
|
CoreHelperUtil,
|
|
15
15
|
SendController,
|
|
16
16
|
BlockchainApiController,
|
|
17
|
-
WalletUtil
|
|
17
|
+
WalletUtil,
|
|
18
|
+
type RouterControllerState
|
|
18
19
|
} from '@reown/appkit-core-react-native';
|
|
19
20
|
|
|
20
21
|
import {
|
|
@@ -149,7 +150,7 @@ export class AppKit {
|
|
|
149
150
|
}
|
|
150
151
|
}
|
|
151
152
|
|
|
152
|
-
private processConnection(
|
|
153
|
+
private async processConnection(
|
|
153
154
|
connector: WalletConnector,
|
|
154
155
|
namespaces?: Namespaces,
|
|
155
156
|
shouldCloseModal: boolean = true
|
|
@@ -173,7 +174,7 @@ export class AppKit {
|
|
|
173
174
|
this.setConnection(initializedAdapters, namespaces, walletInfo, properties);
|
|
174
175
|
|
|
175
176
|
// Sync accounts
|
|
176
|
-
this.syncAccounts(initializedAdapters);
|
|
177
|
+
await this.syncAccounts(initializedAdapters);
|
|
177
178
|
|
|
178
179
|
// Handle SIWE if enabled
|
|
179
180
|
this.handleSiweConnectionIfEnabled(shouldCloseModal);
|
|
@@ -310,10 +311,14 @@ export class AppKit {
|
|
|
310
311
|
ConnectionsController.state.activeNamespace === 'eip155' &&
|
|
311
312
|
!!ConnectionsController.state.activeAddress
|
|
312
313
|
) {
|
|
313
|
-
await this.disconnect();
|
|
314
|
+
return await this.disconnect();
|
|
314
315
|
}
|
|
315
316
|
}
|
|
316
317
|
|
|
318
|
+
if (RouterController.state.view === 'UnsupportedChain') {
|
|
319
|
+
return await this.disconnect();
|
|
320
|
+
}
|
|
321
|
+
|
|
317
322
|
RouterUtil.checkOnRampBack();
|
|
318
323
|
RouterUtil.checkSocialLoginBack();
|
|
319
324
|
}
|
|
@@ -332,11 +337,16 @@ export class AppKit {
|
|
|
332
337
|
const adapter = this.getAdapterByNamespace(namespace);
|
|
333
338
|
if (!adapter) throw new Error('No active adapter');
|
|
334
339
|
|
|
335
|
-
ConnectionsController.setAccountType(namespace, type);
|
|
340
|
+
const address = ConnectionsController.setAccountType(namespace, type);
|
|
336
341
|
|
|
337
342
|
// Get balances from API
|
|
338
343
|
ConnectionsController.fetchBalance();
|
|
339
344
|
|
|
345
|
+
// Fetch transactions for the new account
|
|
346
|
+
if (address) {
|
|
347
|
+
TransactionsController.fetchTransactions(address, true);
|
|
348
|
+
}
|
|
349
|
+
|
|
340
350
|
// Sync balances from adapter
|
|
341
351
|
this.syncNativeBalance(adapter, network);
|
|
342
352
|
|
|
@@ -400,7 +410,7 @@ export class AppKit {
|
|
|
400
410
|
|
|
401
411
|
const namespaces = connector.getNamespaces();
|
|
402
412
|
|
|
403
|
-
this.processConnection(connector, namespaces, false);
|
|
413
|
+
await this.processConnection(connector, namespaces, false);
|
|
404
414
|
} catch (error) {
|
|
405
415
|
// Use console.warn for non-critical initialization failures
|
|
406
416
|
console.warn(`Failed to initialize connector type ${connected.type}:`, error);
|
|
@@ -599,22 +609,27 @@ export class AppKit {
|
|
|
599
609
|
private subscribeToAdapterEvents(adapter: BlockchainAdapter): void {
|
|
600
610
|
adapter.on('accountsChanged', ({ accounts }) => {
|
|
601
611
|
const namespace = adapter.getSupportedNamespace();
|
|
602
|
-
ConnectionsController.updateAccounts(namespace, accounts);
|
|
612
|
+
const hasChanged = ConnectionsController.updateAccounts(namespace, accounts);
|
|
603
613
|
|
|
604
|
-
if (namespace === 'eip155') {
|
|
614
|
+
if (hasChanged && namespace === 'eip155') {
|
|
605
615
|
this.handleSiweChange({ isAccountChange: true });
|
|
606
616
|
}
|
|
607
617
|
});
|
|
608
618
|
|
|
609
|
-
adapter.on('chainChanged', ({ chainId }) => {
|
|
619
|
+
adapter.on('chainChanged', async ({ chainId }) => {
|
|
620
|
+
const isSupported = this.networks.some(network => network.id?.toString() === chainId);
|
|
621
|
+
if (!isSupported) {
|
|
622
|
+
return this.navigate('UnsupportedChain');
|
|
623
|
+
}
|
|
624
|
+
|
|
610
625
|
const namespace = adapter.getSupportedNamespace();
|
|
611
626
|
const chain = `${namespace}:${chainId}` as CaipNetworkId;
|
|
612
627
|
ConnectionsController.setActiveNetwork(namespace, chain);
|
|
628
|
+
ConnectionsController.setActiveNamespace(namespace);
|
|
629
|
+
|
|
613
630
|
const connection = ConnectionsController.state.connections.get(namespace);
|
|
614
631
|
const isAuth = !!connection?.properties?.provider;
|
|
615
632
|
|
|
616
|
-
const activeNamespace = ConnectionsController.state.activeNamespace;
|
|
617
|
-
|
|
618
633
|
const network = this.networks.find(n => n.id?.toString() === chainId);
|
|
619
634
|
this.syncNativeBalance(adapter, network);
|
|
620
635
|
SendController.resetState();
|
|
@@ -624,19 +639,16 @@ export class AppKit {
|
|
|
624
639
|
ConnectionsController.fetchBalance();
|
|
625
640
|
}
|
|
626
641
|
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
);
|
|
632
|
-
if (address) {
|
|
633
|
-
TransactionsController.fetchTransactions(address, true);
|
|
634
|
-
}
|
|
642
|
+
const address = connection?.accounts?.find(account =>
|
|
643
|
+
account.startsWith(`${namespace}:${chainId}`)
|
|
644
|
+
);
|
|
645
|
+
if (address) {
|
|
646
|
+
TransactionsController.fetchTransactions(address, true);
|
|
635
647
|
}
|
|
636
648
|
|
|
637
649
|
// Check if user needs to sign in again
|
|
638
650
|
if (namespace === 'eip155') {
|
|
639
|
-
this.handleSiweChange({ isNetworkChange: true });
|
|
651
|
+
await this.handleSiweChange({ isNetworkChange: true });
|
|
640
652
|
}
|
|
641
653
|
});
|
|
642
654
|
|
|
@@ -685,6 +697,7 @@ export class AppKit {
|
|
|
685
697
|
|
|
686
698
|
if (options.siweConfig) {
|
|
687
699
|
SIWEController.setSIWEClient(options.siweConfig);
|
|
700
|
+
OptionsController.setIsSiweEnabled(options.siweConfig.options.enabled);
|
|
688
701
|
}
|
|
689
702
|
|
|
690
703
|
if (
|
|
@@ -779,11 +792,15 @@ export class AppKit {
|
|
|
779
792
|
await this.initRecentWallets(options);
|
|
780
793
|
}
|
|
781
794
|
|
|
782
|
-
private
|
|
795
|
+
private navigate = (routeName: RouterControllerState['view']) => {
|
|
796
|
+
if (RouterController.state.view === routeName) {
|
|
797
|
+
return;
|
|
798
|
+
}
|
|
799
|
+
|
|
783
800
|
if (ModalController.state.open) {
|
|
784
|
-
RouterController.push(
|
|
801
|
+
RouterController.push(routeName);
|
|
785
802
|
} else {
|
|
786
|
-
ModalController.open({ view:
|
|
803
|
+
ModalController.open({ view: routeName });
|
|
787
804
|
}
|
|
788
805
|
};
|
|
789
806
|
|
|
@@ -796,29 +813,33 @@ export class AppKit {
|
|
|
796
813
|
const { enabled, signOutOnAccountChange, signOutOnNetworkChange } =
|
|
797
814
|
SIWEController.state._client?.options ?? {};
|
|
798
815
|
|
|
799
|
-
if (enabled) {
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
// If the address has changed and signOnAccountChange is enabled, sign out
|
|
804
|
-
await SIWEController.signOut();
|
|
816
|
+
if (!enabled || RouterController.state.view === 'ConnectingSiwe') {
|
|
817
|
+
// Do nothing if view is connecting siwe or siwe is not enabled
|
|
818
|
+
return;
|
|
819
|
+
}
|
|
805
820
|
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
await SIWEController.signOut();
|
|
821
|
+
const session = await SIWEController.getSession();
|
|
822
|
+
if (session && isAccountChange) {
|
|
823
|
+
if (signOutOnAccountChange) {
|
|
824
|
+
// If the address has changed and signOnAccountChange is enabled, sign out
|
|
825
|
+
await SIWEController.signOut();
|
|
812
826
|
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
827
|
+
return this.navigate('ConnectingSiwe');
|
|
828
|
+
}
|
|
829
|
+
} else if (session && isNetworkChange) {
|
|
830
|
+
if (signOutOnNetworkChange) {
|
|
831
|
+
// If the network has changed and signOnNetworkChange is enabled, sign out
|
|
832
|
+
await SIWEController.signOut();
|
|
833
|
+
|
|
834
|
+
return this.navigate('ConnectingSiwe');
|
|
821
835
|
}
|
|
836
|
+
} else if (!session) {
|
|
837
|
+
// If it's connected but there's no session, show sign view
|
|
838
|
+
|
|
839
|
+
return this.navigate('ConnectingSiwe');
|
|
840
|
+
} else if (isConnection) {
|
|
841
|
+
// Already connected with 1CA
|
|
842
|
+
ModalController.close();
|
|
822
843
|
}
|
|
823
844
|
}
|
|
824
845
|
}
|
|
@@ -207,13 +207,16 @@ export class WalletConnectConnector extends WalletConnector {
|
|
|
207
207
|
throw new Error('WalletConnectConnector: Provider not initialized. Call init() first.');
|
|
208
208
|
}
|
|
209
209
|
|
|
210
|
-
const provider = this.provider
|
|
210
|
+
const provider = this.provider;
|
|
211
211
|
|
|
212
212
|
if (namespace) {
|
|
213
|
-
// @ts-ignore
|
|
214
213
|
return {
|
|
215
|
-
...provider,
|
|
216
|
-
|
|
214
|
+
...this.provider,
|
|
215
|
+
connect: async (params?: any) => provider.connect(params) as Promise<any>,
|
|
216
|
+
disconnect: provider.disconnect.bind(provider),
|
|
217
|
+
on: provider.on.bind(provider),
|
|
218
|
+
off: provider.off.bind(provider),
|
|
219
|
+
request: async (args: RequestArguments, chainId?: CaipNetworkId) => {
|
|
217
220
|
const _chainId = this.getChainId(namespace);
|
|
218
221
|
|
|
219
222
|
return provider.request(args, chainId || _chainId);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useSnapshot } from 'valtio';
|
|
2
2
|
import { useCallback, useEffect } from 'react';
|
|
3
|
-
import { Card, Modal, ThemeProvider
|
|
3
|
+
import { Card, Modal, ThemeProvider } from '@reown/appkit-ui-react-native';
|
|
4
4
|
import {
|
|
5
5
|
ApiController,
|
|
6
6
|
EventsController,
|
|
@@ -21,7 +21,6 @@ export function AppKit() {
|
|
|
21
21
|
const { open } = useSnapshot(ModalController.state);
|
|
22
22
|
const { themeMode, themeVariables } = useSnapshot(ThemeController.state);
|
|
23
23
|
const { projectId } = useSnapshot(OptionsController.state);
|
|
24
|
-
const { maxHeight } = useCustomDimensions();
|
|
25
24
|
|
|
26
25
|
const handleBackPress = () => {
|
|
27
26
|
if (RouterController.state.history.length > 1) {
|
|
@@ -54,7 +53,7 @@ export function AppKit() {
|
|
|
54
53
|
onBackdropPress={handleModalClose}
|
|
55
54
|
testID="w3m-modal"
|
|
56
55
|
>
|
|
57
|
-
<Card style={
|
|
56
|
+
<Card style={styles.card}>
|
|
58
57
|
<Header />
|
|
59
58
|
<AppKitRouter />
|
|
60
59
|
<Snackbar />
|
|
@@ -13,7 +13,6 @@ import { ConnectingSocialView } from '../../views/w3m-connecting-social-view';
|
|
|
13
13
|
import { ConnectingSiweView } from '../../views/w3m-connecting-siwe-view';
|
|
14
14
|
import { GetWalletView } from '../../views/w3m-get-wallet-view';
|
|
15
15
|
import { NetworksView } from '../../views/w3m-networks-view';
|
|
16
|
-
import { NetworkSwitchView } from '../../views/w3m-network-switch-view';
|
|
17
16
|
import { OnRampLoadingView } from '../../views/w3m-onramp-loading-view';
|
|
18
17
|
import { OnRampView } from '../../views/w3m-onramp-view';
|
|
19
18
|
import { OnRampCheckoutView } from '../../views/w3m-onramp-checkout-view';
|
|
@@ -35,9 +34,11 @@ import { UiUtil } from '../../utils/UiUtil';
|
|
|
35
34
|
import { useRouteTransition } from '../../hooks/useRouteTransition';
|
|
36
35
|
|
|
37
36
|
import { Animated } from 'react-native';
|
|
37
|
+
import { useCustomDimensions } from '@reown/appkit-ui-react-native';
|
|
38
38
|
|
|
39
39
|
export function AppKitRouter() {
|
|
40
40
|
const { view } = useSnapshot(RouterController.state);
|
|
41
|
+
const { maxHeight } = useCustomDimensions();
|
|
41
42
|
const { animateTransition, getAnimatedStyle } = useRouteTransition({
|
|
42
43
|
duration: 300,
|
|
43
44
|
useNativeDriver: true
|
|
@@ -83,8 +84,6 @@ export function AppKitRouter() {
|
|
|
83
84
|
return OnRampSettingsView;
|
|
84
85
|
case 'OnRampLoading':
|
|
85
86
|
return OnRampLoadingView;
|
|
86
|
-
case 'SwitchNetwork':
|
|
87
|
-
return NetworkSwitchView;
|
|
88
87
|
case 'OnRampTransaction':
|
|
89
88
|
return OnRampTransactionView;
|
|
90
89
|
case 'Swap':
|
|
@@ -117,7 +116,7 @@ export function AppKitRouter() {
|
|
|
117
116
|
}, [view]);
|
|
118
117
|
|
|
119
118
|
return (
|
|
120
|
-
<Animated.View style={[getAnimatedStyle()]}>
|
|
119
|
+
<Animated.View style={[getAnimatedStyle(), { maxHeight }]}>
|
|
121
120
|
<ViewComponent />
|
|
122
121
|
</Animated.View>
|
|
123
122
|
);
|
|
@@ -1,44 +1,13 @@
|
|
|
1
|
-
import { CardSelectLoader, FlexView, useCustomDimensions } from '@reown/appkit-ui-react-native';
|
|
2
1
|
import { memo } from 'react';
|
|
3
|
-
import {
|
|
2
|
+
import { WalletList } from './WalletList';
|
|
4
3
|
|
|
5
4
|
interface LoadingProps {
|
|
6
|
-
|
|
7
|
-
containerStyle?: StyleProp<ViewStyle>;
|
|
5
|
+
loadingItems?: number;
|
|
8
6
|
}
|
|
9
7
|
|
|
10
|
-
function _Loading({
|
|
11
|
-
const { maxWidth, maxHeight } = useCustomDimensions();
|
|
12
|
-
|
|
8
|
+
function _Loading({ loadingItems = 20 }: LoadingProps) {
|
|
13
9
|
return (
|
|
14
|
-
<
|
|
15
|
-
flexDirection="row"
|
|
16
|
-
flexWrap="wrap"
|
|
17
|
-
alignSelf="center"
|
|
18
|
-
padding={['0', '0', 's', 'xs']}
|
|
19
|
-
style={{ maxWidth, maxHeight }}
|
|
20
|
-
>
|
|
21
|
-
<CardSelectLoader style={[containerStyle, { width: itemWidth }]} />
|
|
22
|
-
<CardSelectLoader style={[containerStyle, { width: itemWidth }]} />
|
|
23
|
-
<CardSelectLoader style={[containerStyle, { width: itemWidth }]} />
|
|
24
|
-
<CardSelectLoader style={[containerStyle, { width: itemWidth }]} />
|
|
25
|
-
<CardSelectLoader style={[containerStyle, { width: itemWidth }]} />
|
|
26
|
-
<CardSelectLoader style={[containerStyle, { width: itemWidth }]} />
|
|
27
|
-
<CardSelectLoader style={[containerStyle, { width: itemWidth }]} />
|
|
28
|
-
<CardSelectLoader style={[containerStyle, { width: itemWidth }]} />
|
|
29
|
-
<CardSelectLoader style={[containerStyle, { width: itemWidth }]} />
|
|
30
|
-
<CardSelectLoader style={[containerStyle, { width: itemWidth }]} />
|
|
31
|
-
<CardSelectLoader style={[containerStyle, { width: itemWidth }]} />
|
|
32
|
-
<CardSelectLoader style={[containerStyle, { width: itemWidth }]} />
|
|
33
|
-
<CardSelectLoader style={[containerStyle, { width: itemWidth }]} />
|
|
34
|
-
<CardSelectLoader style={[containerStyle, { width: itemWidth }]} />
|
|
35
|
-
<CardSelectLoader style={[containerStyle, { width: itemWidth }]} />
|
|
36
|
-
<CardSelectLoader style={[containerStyle, { width: itemWidth }]} />
|
|
37
|
-
<CardSelectLoader style={[containerStyle, { width: itemWidth }]} />
|
|
38
|
-
<CardSelectLoader style={[containerStyle, { width: itemWidth }]} />
|
|
39
|
-
<CardSelectLoader style={[containerStyle, { width: itemWidth }]} />
|
|
40
|
-
<CardSelectLoader style={[containerStyle, { width: itemWidth }]} />
|
|
41
|
-
</FlexView>
|
|
10
|
+
<WalletList data={[]} onItemPress={() => {}} isLoading={true} loadingItems={loadingItems} />
|
|
42
11
|
);
|
|
43
12
|
}
|
|
44
13
|
|
|
@@ -6,34 +6,25 @@ import type { StyleProp, ViewStyle } from 'react-native';
|
|
|
6
6
|
import { memo } from 'react';
|
|
7
7
|
|
|
8
8
|
interface WalletItemProps {
|
|
9
|
-
containerStyle?: StyleProp<ViewStyle>;
|
|
10
9
|
item: WcWallet;
|
|
11
|
-
itemWidth?: number;
|
|
12
10
|
imageHeaders?: Record<string, string>;
|
|
13
11
|
onItemPress: (wallet: WcWallet) => void;
|
|
14
12
|
style?: StyleProp<ViewStyle>;
|
|
15
13
|
}
|
|
16
14
|
|
|
17
|
-
export function WalletItem({
|
|
18
|
-
containerStyle,
|
|
19
|
-
item,
|
|
20
|
-
itemWidth,
|
|
21
|
-
imageHeaders,
|
|
22
|
-
onItemPress,
|
|
23
|
-
style
|
|
24
|
-
}: WalletItemProps) {
|
|
15
|
+
export function WalletItem({ item, imageHeaders, onItemPress, style }: WalletItemProps) {
|
|
25
16
|
const { walletImages } = useSnapshot(AssetController.state);
|
|
26
17
|
const isInstalled = ApiController.state.installed.find(wallet => wallet?.id === item?.id);
|
|
27
18
|
const imageSrc = AssetUtil.getWalletImage(item, walletImages);
|
|
28
19
|
|
|
29
20
|
if (!item?.id) {
|
|
30
|
-
return <CardSelectLoader style={
|
|
21
|
+
return <CardSelectLoader style={style} />;
|
|
31
22
|
}
|
|
32
23
|
|
|
33
24
|
return (
|
|
34
25
|
<CardSelect
|
|
35
26
|
imageSrc={imageSrc}
|
|
36
|
-
style={
|
|
27
|
+
style={style}
|
|
37
28
|
imageHeaders={imageHeaders}
|
|
38
29
|
name={item?.name ?? 'Unknown'}
|
|
39
30
|
onPress={() => onItemPress(item)}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { FlatList, StyleSheet } from 'react-native';
|
|
2
|
+
import { WalletItem } from './WalletItem';
|
|
3
|
+
import {
|
|
4
|
+
CardSelectHeight,
|
|
5
|
+
Spacing,
|
|
6
|
+
useCustomDimensions,
|
|
7
|
+
CardSelectLoader,
|
|
8
|
+
CardSelectWidth
|
|
9
|
+
} from '@reown/appkit-ui-react-native';
|
|
10
|
+
import { ApiController } from '@reown/appkit-core-react-native';
|
|
11
|
+
import type { WcWallet } from '@reown/appkit-common-react-native';
|
|
12
|
+
|
|
13
|
+
const imageHeaders = ApiController._getApiHeaders();
|
|
14
|
+
|
|
15
|
+
const ITEM_HEIGHT = CardSelectHeight;
|
|
16
|
+
const ITEM_WIDTH = CardSelectWidth;
|
|
17
|
+
const ITEM_HEIGHT_WITH_GAP = ITEM_HEIGHT + Spacing['3xs'];
|
|
18
|
+
|
|
19
|
+
interface Props {
|
|
20
|
+
data: WcWallet[];
|
|
21
|
+
onItemPress: (wallet: WcWallet) => void;
|
|
22
|
+
onEndReached?: () => void;
|
|
23
|
+
onEndReachedThreshold?: number;
|
|
24
|
+
isLoading?: boolean;
|
|
25
|
+
loadingItems?: number;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function WalletList({
|
|
29
|
+
data,
|
|
30
|
+
onItemPress,
|
|
31
|
+
onEndReached,
|
|
32
|
+
onEndReachedThreshold,
|
|
33
|
+
isLoading = false,
|
|
34
|
+
loadingItems = 20
|
|
35
|
+
}: Props) {
|
|
36
|
+
const { padding, maxHeight } = useCustomDimensions();
|
|
37
|
+
|
|
38
|
+
// Create loading data if isLoading is true
|
|
39
|
+
const displayData = isLoading
|
|
40
|
+
? Array.from({ length: loadingItems }, (_, index) => ({ id: `loading-${index}` }) as WcWallet)
|
|
41
|
+
: data;
|
|
42
|
+
|
|
43
|
+
return (
|
|
44
|
+
<FlatList
|
|
45
|
+
fadingEdgeLength={20}
|
|
46
|
+
bounces={false}
|
|
47
|
+
numColumns={4}
|
|
48
|
+
data={displayData}
|
|
49
|
+
style={[styles.list, { height: maxHeight }]}
|
|
50
|
+
columnWrapperStyle={styles.columnWrapperStyle}
|
|
51
|
+
renderItem={({ item }) => {
|
|
52
|
+
if (isLoading) {
|
|
53
|
+
return <CardSelectLoader style={styles.itemContainer} />;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
return (
|
|
57
|
+
<WalletItem
|
|
58
|
+
item={item}
|
|
59
|
+
imageHeaders={imageHeaders}
|
|
60
|
+
onItemPress={onItemPress}
|
|
61
|
+
style={styles.itemContainer}
|
|
62
|
+
/>
|
|
63
|
+
);
|
|
64
|
+
}}
|
|
65
|
+
contentContainerStyle={[styles.contentContainer, { paddingHorizontal: padding }]}
|
|
66
|
+
onEndReached={onEndReached}
|
|
67
|
+
onEndReachedThreshold={onEndReachedThreshold}
|
|
68
|
+
keyExtractor={(item, index) => item?.id ?? `item-${index}`}
|
|
69
|
+
getItemLayout={(_, index) => ({
|
|
70
|
+
length: ITEM_HEIGHT_WITH_GAP,
|
|
71
|
+
offset: ITEM_HEIGHT_WITH_GAP * index,
|
|
72
|
+
index
|
|
73
|
+
})}
|
|
74
|
+
/>
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const styles = StyleSheet.create({
|
|
79
|
+
list: {
|
|
80
|
+
paddingTop: Spacing['3xs']
|
|
81
|
+
},
|
|
82
|
+
contentContainer: {
|
|
83
|
+
paddingBottom: Spacing['4xl'],
|
|
84
|
+
paddingTop: Spacing['3xs'],
|
|
85
|
+
gap: Spacing['3xs'],
|
|
86
|
+
alignItems: 'center'
|
|
87
|
+
},
|
|
88
|
+
columnWrapperStyle: {
|
|
89
|
+
justifyContent: 'space-around'
|
|
90
|
+
},
|
|
91
|
+
itemContainer: {
|
|
92
|
+
width: '23%',
|
|
93
|
+
minWidth: ITEM_WIDTH
|
|
94
|
+
}
|
|
95
|
+
});
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { useEffect, useState } from 'react';
|
|
2
2
|
import { useSnapshot } from 'valtio';
|
|
3
|
-
import { FlatList } from 'react-native';
|
|
4
3
|
import {
|
|
5
4
|
ApiController,
|
|
6
5
|
OptionsController,
|
|
@@ -8,36 +7,23 @@ import {
|
|
|
8
7
|
type OptionsControllerState
|
|
9
8
|
} from '@reown/appkit-core-react-native';
|
|
10
9
|
import { type WcWallet } from '@reown/appkit-common-react-native';
|
|
11
|
-
import { CardSelectHeight, Spacing, useCustomDimensions } from '@reown/appkit-ui-react-native';
|
|
12
10
|
import styles from './styles';
|
|
13
11
|
import { Placeholder } from '../w3m-placeholder';
|
|
14
12
|
import { Loading } from './components/Loading';
|
|
15
|
-
|
|
13
|
+
|
|
14
|
+
import { WalletList } from './components/WalletList';
|
|
16
15
|
|
|
17
16
|
interface AllWalletsListProps {
|
|
18
|
-
columns: number;
|
|
19
17
|
onItemPress: (wallet: WcWallet) => void;
|
|
20
|
-
itemWidth?: number;
|
|
21
18
|
headerHeight?: number;
|
|
22
19
|
}
|
|
23
20
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
export function AllWalletsList({
|
|
27
|
-
columns,
|
|
28
|
-
itemWidth,
|
|
29
|
-
onItemPress,
|
|
30
|
-
headerHeight = 0
|
|
31
|
-
}: AllWalletsListProps) {
|
|
21
|
+
export function AllWalletsList({ onItemPress }: AllWalletsListProps) {
|
|
32
22
|
const [loading, setLoading] = useState<boolean>(ApiController.state.wallets.length === 0);
|
|
33
23
|
const [loadingError, setLoadingError] = useState<boolean>(false);
|
|
34
24
|
const [pageLoading, setPageLoading] = useState<boolean>(false);
|
|
35
|
-
const { maxHeight, padding } = useCustomDimensions();
|
|
36
25
|
const { installed, featured, recommended, wallets } = useSnapshot(ApiController.state);
|
|
37
26
|
const { customWallets } = useSnapshot(OptionsController.state) as OptionsControllerState;
|
|
38
|
-
const imageHeaders = ApiController._getApiHeaders();
|
|
39
|
-
const preloadedWallets = installed.length + featured.length + recommended.length;
|
|
40
|
-
const loadingItems = columns - ((100 + preloadedWallets) % columns);
|
|
41
27
|
|
|
42
28
|
const combinedWallets = [
|
|
43
29
|
...(customWallets ?? []),
|
|
@@ -52,6 +38,8 @@ export function AllWalletsList({
|
|
|
52
38
|
new Map(combinedWallets.map(wallet => [wallet?.id, wallet])).values()
|
|
53
39
|
).filter(wallet => wallet?.id); // Filter out any undefined wallets
|
|
54
40
|
|
|
41
|
+
const loadingItems = 4 - ((100 + uniqueWallets.length) % 4);
|
|
42
|
+
|
|
55
43
|
const walletList = [
|
|
56
44
|
...uniqueWallets,
|
|
57
45
|
...(pageLoading ? (Array.from({ length: loadingItems }) as WcWallet[]) : [])
|
|
@@ -95,7 +83,7 @@ export function AllWalletsList({
|
|
|
95
83
|
}, []);
|
|
96
84
|
|
|
97
85
|
if (loading) {
|
|
98
|
-
return <Loading
|
|
86
|
+
return <Loading loadingItems={20} />;
|
|
99
87
|
}
|
|
100
88
|
|
|
101
89
|
if (loadingError) {
|
|
@@ -114,34 +102,11 @@ export function AllWalletsList({
|
|
|
114
102
|
}
|
|
115
103
|
|
|
116
104
|
return (
|
|
117
|
-
<
|
|
118
|
-
key={columns}
|
|
119
|
-
fadingEdgeLength={20}
|
|
120
|
-
bounces={false}
|
|
121
|
-
numColumns={columns}
|
|
105
|
+
<WalletList
|
|
122
106
|
data={walletList}
|
|
123
|
-
renderItem={({ item }) => (
|
|
124
|
-
<WalletItem
|
|
125
|
-
item={item}
|
|
126
|
-
itemWidth={itemWidth}
|
|
127
|
-
imageHeaders={imageHeaders}
|
|
128
|
-
onItemPress={onItemPress}
|
|
129
|
-
style={styles.itemContainer}
|
|
130
|
-
/>
|
|
131
|
-
)}
|
|
132
|
-
style={{ maxHeight: maxHeight - headerHeight - Spacing['4xl'] }}
|
|
133
|
-
contentContainerStyle={[
|
|
134
|
-
styles.contentContainer,
|
|
135
|
-
{ paddingHorizontal: padding + Spacing['2xs'] }
|
|
136
|
-
]}
|
|
137
107
|
onEndReached={fetchNextPage}
|
|
138
108
|
onEndReachedThreshold={2}
|
|
139
|
-
|
|
140
|
-
getItemLayout={(_, index) => ({
|
|
141
|
-
length: ITEM_HEIGHT,
|
|
142
|
-
offset: ITEM_HEIGHT * index,
|
|
143
|
-
index
|
|
144
|
-
})}
|
|
109
|
+
onItemPress={onItemPress}
|
|
145
110
|
/>
|
|
146
111
|
);
|
|
147
112
|
}
|
|
@@ -4,12 +4,15 @@ import { StyleSheet } from 'react-native';
|
|
|
4
4
|
export default StyleSheet.create({
|
|
5
5
|
contentContainer: {
|
|
6
6
|
paddingBottom: Spacing['4xl'],
|
|
7
|
-
paddingTop: Spacing['3xs']
|
|
7
|
+
paddingTop: Spacing['3xs'],
|
|
8
|
+
gap: Spacing['3xs'],
|
|
9
|
+
alignItems: 'center'
|
|
10
|
+
},
|
|
11
|
+
columnWrapperStyle: {
|
|
12
|
+
justifyContent: 'space-around'
|
|
8
13
|
},
|
|
9
14
|
itemContainer: {
|
|
10
|
-
|
|
11
|
-
justifyContent: 'center',
|
|
12
|
-
margin: Spacing['4xs']
|
|
15
|
+
width: '23%'
|
|
13
16
|
},
|
|
14
17
|
pageLoader: {
|
|
15
18
|
marginTop: Spacing.xl
|
|
@@ -1,36 +1,23 @@
|
|
|
1
1
|
import { useCallback, useEffect, useState } from 'react';
|
|
2
|
-
import { FlatList } from 'react-native';
|
|
3
2
|
import { ApiController, SnackController } from '@reown/appkit-core-react-native';
|
|
4
3
|
import { type WcWallet } from '@reown/appkit-common-react-native';
|
|
5
|
-
import {
|
|
4
|
+
import { useCustomDimensions } from '@reown/appkit-ui-react-native';
|
|
6
5
|
import { Placeholder } from '../w3m-placeholder';
|
|
7
6
|
import styles from './styles';
|
|
8
7
|
|
|
9
8
|
import { Loading } from '../w3m-all-wallets-list/components/Loading';
|
|
10
|
-
import {
|
|
9
|
+
import { WalletList } from '../w3m-all-wallets-list/components/WalletList';
|
|
11
10
|
|
|
12
11
|
export interface AllWalletsSearchProps {
|
|
13
|
-
columns: number;
|
|
14
12
|
onItemPress: (wallet: WcWallet) => void;
|
|
15
|
-
itemWidth?: number;
|
|
16
13
|
searchQuery?: string;
|
|
17
|
-
headerHeight?: number;
|
|
18
14
|
}
|
|
19
15
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
export function AllWalletsSearch({
|
|
23
|
-
searchQuery,
|
|
24
|
-
columns,
|
|
25
|
-
itemWidth,
|
|
26
|
-
onItemPress,
|
|
27
|
-
headerHeight = 0
|
|
28
|
-
}: AllWalletsSearchProps) {
|
|
16
|
+
export function AllWalletsSearch({ searchQuery, onItemPress }: AllWalletsSearchProps) {
|
|
29
17
|
const [loading, setLoading] = useState<boolean>(false);
|
|
30
18
|
const [loadingError, setLoadingError] = useState<boolean>(false);
|
|
31
19
|
const [prevSearchQuery, setPrevSearchQuery] = useState<string>('');
|
|
32
|
-
const
|
|
33
|
-
const { maxHeight, padding, isLandscape } = useCustomDimensions();
|
|
20
|
+
const { isLandscape } = useCustomDimensions();
|
|
34
21
|
|
|
35
22
|
const emptyTemplate = () => {
|
|
36
23
|
return (
|
|
@@ -63,7 +50,7 @@ export function AllWalletsSearch({
|
|
|
63
50
|
}, [searchQuery, prevSearchQuery, searchFetch]);
|
|
64
51
|
|
|
65
52
|
if (loading) {
|
|
66
|
-
return <Loading
|
|
53
|
+
return <Loading loadingItems={20} />;
|
|
67
54
|
}
|
|
68
55
|
|
|
69
56
|
if (loadingError) {
|
|
@@ -85,33 +72,5 @@ export function AllWalletsSearch({
|
|
|
85
72
|
return emptyTemplate();
|
|
86
73
|
}
|
|
87
74
|
|
|
88
|
-
return
|
|
89
|
-
<FlatList
|
|
90
|
-
key={columns}
|
|
91
|
-
fadingEdgeLength={20}
|
|
92
|
-
bounces={false}
|
|
93
|
-
numColumns={columns}
|
|
94
|
-
data={ApiController.state.search}
|
|
95
|
-
renderItem={({ item }) => (
|
|
96
|
-
<WalletItem
|
|
97
|
-
item={item}
|
|
98
|
-
itemWidth={itemWidth}
|
|
99
|
-
imageHeaders={imageHeaders}
|
|
100
|
-
onItemPress={onItemPress}
|
|
101
|
-
style={styles.itemContainer}
|
|
102
|
-
/>
|
|
103
|
-
)}
|
|
104
|
-
style={{ maxHeight: maxHeight - headerHeight - Spacing['2xl'] }}
|
|
105
|
-
contentContainerStyle={[
|
|
106
|
-
styles.contentContainer,
|
|
107
|
-
{ paddingHorizontal: padding + Spacing['2xs'] }
|
|
108
|
-
]}
|
|
109
|
-
keyExtractor={item => item.id}
|
|
110
|
-
getItemLayout={(_, index) => ({
|
|
111
|
-
length: ITEM_HEIGHT,
|
|
112
|
-
offset: ITEM_HEIGHT * index,
|
|
113
|
-
index
|
|
114
|
-
})}
|
|
115
|
-
/>
|
|
116
|
-
);
|
|
75
|
+
return <WalletList onItemPress={onItemPress} data={ApiController.state.search} />;
|
|
117
76
|
}
|