@ton/appkit-react 0.0.6-alpha.3 → 1.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +40 -9
- package/dist/esm/components/shared/amount-presets/amount-presets.js +8 -0
- package/dist/esm/components/shared/amount-presets/amount-presets.js.map +1 -0
- package/dist/esm/components/shared/amount-presets/amount-presets.module.css +20 -0
- package/dist/esm/components/shared/amount-presets/index.js +9 -0
- package/dist/esm/components/shared/amount-presets/index.js.map +1 -0
- package/dist/esm/components/shared/button-with-connect/button-with-connect.js +16 -0
- package/dist/esm/components/shared/button-with-connect/button-with-connect.js.map +1 -0
- package/dist/esm/components/shared/button-with-connect/index.js +9 -0
- package/dist/esm/components/shared/button-with-connect/index.js.map +1 -0
- package/dist/esm/components/{ton-icon → shared/low-balance-modal}/index.js +1 -1
- package/dist/esm/components/shared/low-balance-modal/index.js.map +1 -0
- package/dist/esm/components/shared/low-balance-modal/low-balance-modal.js +11 -0
- package/dist/esm/components/shared/low-balance-modal/low-balance-modal.js.map +1 -0
- package/dist/esm/components/shared/low-balance-modal/low-balance-modal.module.css +21 -0
- package/dist/esm/components/shared/option-switcher/index.js +9 -0
- package/dist/esm/components/shared/option-switcher/index.js.map +1 -0
- package/dist/esm/components/shared/option-switcher/option-switcher.js +14 -0
- package/dist/esm/components/shared/option-switcher/option-switcher.js.map +1 -0
- package/dist/esm/components/shared/option-switcher/option-switcher.module.css +18 -0
- package/dist/esm/components/shared/settings-button/index.js +9 -0
- package/dist/esm/components/shared/settings-button/index.js.map +1 -0
- package/dist/esm/components/shared/settings-button/settings-button.js +9 -0
- package/dist/esm/components/shared/settings-button/settings-button.js.map +1 -0
- package/dist/esm/components/shared/settings-button/settings-button.module.css +11 -0
- package/dist/esm/components/shared/token-select-modal/index.js +9 -0
- package/dist/esm/components/shared/token-select-modal/index.js.map +1 -0
- package/dist/esm/components/shared/token-select-modal/token-select-modal.js +36 -0
- package/dist/esm/components/shared/token-select-modal/token-select-modal.js.map +1 -0
- package/dist/esm/components/shared/token-select-modal/token-select-modal.module.css +27 -0
- package/dist/esm/components/ui/amount-reversed/amount-reversed.js +13 -0
- package/dist/esm/components/ui/amount-reversed/amount-reversed.js.map +1 -0
- package/dist/esm/components/ui/amount-reversed/amount-reversed.module.css +34 -0
- package/dist/esm/components/ui/amount-reversed/index.js +9 -0
- package/dist/esm/components/ui/amount-reversed/index.js.map +1 -0
- package/dist/esm/components/ui/block/block.js.map +1 -0
- package/dist/esm/components/{block → ui/block}/block.module.css +1 -1
- package/dist/esm/components/ui/block/index.js.map +1 -0
- package/dist/esm/components/ui/button/button.js +31 -0
- package/dist/esm/components/ui/button/button.js.map +1 -0
- package/dist/esm/components/ui/button/button.module.css +137 -0
- package/dist/esm/components/ui/button/index.js.map +1 -0
- package/dist/esm/components/ui/centered-amount-input/centered-amount-input.js +51 -0
- package/dist/esm/components/ui/centered-amount-input/centered-amount-input.js.map +1 -0
- package/dist/esm/components/ui/centered-amount-input/centered-amount-input.module.css +69 -0
- package/dist/esm/components/ui/centered-amount-input/index.js +9 -0
- package/dist/esm/components/ui/centered-amount-input/index.js.map +1 -0
- package/dist/esm/components/ui/collapsible/collapsible.js +34 -0
- package/dist/esm/components/ui/collapsible/collapsible.js.map +1 -0
- package/dist/esm/components/ui/collapsible/collapsible.module.css +4 -0
- package/dist/esm/components/ui/collapsible/index.js +9 -0
- package/dist/esm/components/ui/collapsible/index.js.map +1 -0
- package/dist/esm/components/ui/dialog/dialog.js +67 -0
- package/dist/esm/components/ui/dialog/dialog.js.map +1 -0
- package/dist/esm/components/ui/dialog/index.js +9 -0
- package/dist/esm/components/ui/dialog/index.js.map +1 -0
- package/dist/esm/components/ui/dialog/use-dialog-context.js +16 -0
- package/dist/esm/components/ui/dialog/use-dialog-context.js.map +1 -0
- package/dist/esm/components/ui/icons/chevron-down-icon.js +4 -0
- package/dist/esm/components/ui/icons/chevron-down-icon.js.map +1 -0
- package/dist/esm/components/ui/icons/chevrons-icon.js +4 -0
- package/dist/esm/components/ui/icons/chevrons-icon.js.map +1 -0
- package/dist/esm/components/ui/icons/close-icon.js +4 -0
- package/dist/esm/components/ui/icons/close-icon.js.map +1 -0
- package/dist/esm/components/ui/icons/failed-icon.js +4 -0
- package/dist/esm/components/ui/icons/failed-icon.js.map +1 -0
- package/dist/esm/components/ui/icons/flip-icon.js +4 -0
- package/dist/esm/components/ui/icons/flip-icon.js.map +1 -0
- package/dist/esm/components/ui/icons/image-icon.js +4 -0
- package/dist/esm/components/ui/icons/image-icon.js.map +1 -0
- package/dist/esm/components/ui/icons/index.js +21 -0
- package/dist/esm/components/ui/icons/index.js.map +1 -0
- package/dist/esm/components/ui/icons/search-icon.js +4 -0
- package/dist/esm/components/ui/icons/search-icon.js.map +1 -0
- package/dist/esm/components/ui/icons/sliders-icon.js +4 -0
- package/dist/esm/components/ui/icons/sliders-icon.js.map +1 -0
- package/dist/esm/components/ui/icons/spinner-icon.js +4 -0
- package/dist/esm/components/ui/icons/spinner-icon.js.map +1 -0
- package/dist/esm/components/ui/icons/success-icon.js +4 -0
- package/dist/esm/components/ui/icons/success-icon.js.map +1 -0
- package/dist/esm/components/ui/icons/ton-icon.js +5 -0
- package/dist/esm/components/ui/icons/ton-icon.js.map +1 -0
- package/dist/esm/components/ui/icons/types.js +10 -0
- package/dist/esm/components/ui/icons/types.js.map +1 -0
- package/dist/esm/components/ui/icons/verified-icon.js +4 -0
- package/dist/esm/components/ui/icons/verified-icon.js.map +1 -0
- package/dist/esm/components/ui/info-block/index.js +9 -0
- package/dist/esm/components/ui/info-block/index.js.map +1 -0
- package/dist/esm/components/ui/info-block/info-block.js +31 -0
- package/dist/esm/components/ui/info-block/info-block.js.map +1 -0
- package/dist/esm/components/ui/info-block/info-block.module.css +30 -0
- package/dist/esm/components/ui/input/index.js +9 -0
- package/dist/esm/components/ui/input/index.js.map +1 -0
- package/dist/esm/components/ui/input/input.js +62 -0
- package/dist/esm/components/ui/input/input.js.map +1 -0
- package/dist/esm/components/ui/input/input.module.css +147 -0
- package/dist/esm/components/ui/input/use-input-resize.js +56 -0
- package/dist/esm/components/ui/input/use-input-resize.js.map +1 -0
- package/dist/esm/components/ui/logo/index.js +9 -0
- package/dist/esm/components/ui/logo/index.js.map +1 -0
- package/dist/esm/components/ui/logo/logo.js +54 -0
- package/dist/esm/components/ui/logo/logo.js.map +1 -0
- package/dist/esm/components/{circle-icon/circle-icon.module.css → ui/logo/logo.module.css} +6 -6
- package/dist/esm/components/ui/logo/use-image-loading-status.js +44 -0
- package/dist/esm/components/ui/logo/use-image-loading-status.js.map +1 -0
- package/dist/esm/components/ui/modal/index.js +9 -0
- package/dist/esm/components/ui/modal/index.js.map +1 -0
- package/dist/esm/components/ui/modal/modal.js +9 -0
- package/dist/esm/components/ui/modal/modal.js.map +1 -0
- package/dist/esm/components/ui/modal/modal.module.css +71 -0
- package/dist/esm/components/ui/select/index.js +9 -0
- package/dist/esm/components/ui/select/index.js.map +1 -0
- package/dist/esm/components/ui/select/select.js +147 -0
- package/dist/esm/components/ui/select/select.js.map +1 -0
- package/dist/esm/components/ui/select/select.module.css +37 -0
- package/dist/esm/components/ui/select/use-select-context.js +16 -0
- package/dist/esm/components/ui/select/use-select-context.js.map +1 -0
- package/dist/esm/components/ui/skeleton/index.js +9 -0
- package/dist/esm/components/ui/skeleton/index.js.map +1 -0
- package/dist/esm/components/ui/skeleton/skeleton.js +16 -0
- package/dist/esm/components/ui/skeleton/skeleton.js.map +1 -0
- package/dist/esm/components/ui/skeleton/skeleton.module.css +25 -0
- package/dist/esm/components/ui/tabs/index.js +9 -0
- package/dist/esm/components/ui/tabs/index.js.map +1 -0
- package/dist/esm/components/ui/tabs/tabs.js +43 -0
- package/dist/esm/components/ui/tabs/tabs.js.map +1 -0
- package/dist/esm/components/ui/tabs/tabs.module.css +32 -0
- package/dist/esm/features/balances/components/balance-badge/balance-badge.js +3 -3
- package/dist/esm/features/balances/components/balance-badge/balance-badge.js.map +1 -1
- package/dist/esm/features/balances/components/balance-badge/balance-badge.module.css +2 -2
- package/dist/esm/features/balances/components/currency-item/currency-item.js +3 -2
- package/dist/esm/features/balances/components/currency-item/currency-item.js.map +1 -1
- package/dist/esm/features/balances/components/currency-item/currency-item.module.css +5 -11
- package/dist/esm/features/balances/components/send-jetton-button/send-jetton-button.js +1 -2
- package/dist/esm/features/balances/components/send-jetton-button/send-jetton-button.js.map +1 -1
- package/dist/esm/features/balances/components/send-ton-button/send-ton-button.js +1 -2
- package/dist/esm/features/balances/components/send-ton-button/send-ton-button.js.map +1 -1
- package/dist/esm/features/balances/hooks/use-balance-by-address.js +4 -2
- package/dist/esm/features/balances/hooks/use-balance-by-address.js.map +1 -1
- package/dist/esm/features/balances/hooks/use-watch-balance-by-address.js +1 -1
- package/dist/esm/features/balances/hooks/use-watch-balance-by-address.js.map +1 -1
- package/dist/esm/features/jettons/hooks/use-jetton-balance-by-address.js +4 -2
- package/dist/esm/features/jettons/hooks/use-jetton-balance-by-address.js.map +1 -1
- package/dist/esm/features/jettons/hooks/use-jetton-info.js +4 -2
- package/dist/esm/features/jettons/hooks/use-jetton-info.js.map +1 -1
- package/dist/esm/features/jettons/hooks/use-jetton-wallet-address.js +4 -2
- package/dist/esm/features/jettons/hooks/use-jetton-wallet-address.js.map +1 -1
- package/dist/esm/features/jettons/hooks/use-jettons-by-address.js +4 -2
- package/dist/esm/features/jettons/hooks/use-jettons-by-address.js.map +1 -1
- package/dist/esm/features/jettons/hooks/use-transfer-jetton.js +1 -1
- package/dist/esm/features/jettons/hooks/use-transfer-jetton.js.map +1 -1
- package/dist/esm/features/jettons/hooks/use-watch-jettons-by-address.js +1 -1
- package/dist/esm/features/jettons/hooks/use-watch-jettons-by-address.js.map +1 -1
- package/dist/esm/features/network/hooks/use-block-number.js +4 -2
- package/dist/esm/features/network/hooks/use-block-number.js.map +1 -1
- package/dist/esm/features/network/hooks/use-default-network.js +1 -1
- package/dist/esm/features/network/hooks/use-default-network.js.map +1 -1
- package/dist/esm/features/network/hooks/use-networks.js +1 -1
- package/dist/esm/features/network/hooks/use-networks.js.map +1 -1
- package/dist/esm/features/nft/components/nft-item/nft-item.js +3 -3
- package/dist/esm/features/nft/components/nft-item/nft-item.js.map +1 -1
- package/dist/esm/features/nft/components/nft-item/nft-item.module.css +4 -6
- package/dist/esm/features/nft/hooks/use-nft.js +4 -2
- package/dist/esm/features/nft/hooks/use-nft.js.map +1 -1
- package/dist/esm/features/nft/hooks/use-nfts-by-address.js +4 -2
- package/dist/esm/features/nft/hooks/use-nfts-by-address.js.map +1 -1
- package/dist/esm/features/nft/hooks/use-transfer-nft.js +1 -1
- package/dist/esm/features/nft/hooks/use-transfer-nft.js.map +1 -1
- package/dist/esm/features/settings/hooks/use-app-kit-theme.js.map +1 -0
- package/dist/esm/{hooks → features/settings/hooks}/use-app-kit.js +1 -1
- package/dist/esm/features/settings/hooks/use-app-kit.js.map +1 -0
- package/dist/esm/{hooks → features/settings/hooks}/use-i18n.js +1 -1
- package/dist/esm/features/settings/hooks/use-i18n.js.map +1 -0
- package/dist/esm/features/settings/index.js +11 -0
- package/dist/esm/features/settings/index.js.map +1 -0
- package/dist/esm/features/signing/hooks/use-sign-binary.js +1 -1
- package/dist/esm/features/signing/hooks/use-sign-binary.js.map +1 -1
- package/dist/esm/features/signing/hooks/use-sign-cell.js +1 -1
- package/dist/esm/features/signing/hooks/use-sign-cell.js.map +1 -1
- package/dist/esm/features/signing/hooks/use-sign-text.js +1 -1
- package/dist/esm/features/signing/hooks/use-sign-text.js.map +1 -1
- package/dist/esm/features/staking/components/select-unstake-mode/index.js +9 -0
- package/dist/esm/features/staking/components/select-unstake-mode/index.js.map +1 -0
- package/dist/esm/features/staking/components/select-unstake-mode/select-unstake-mode.js +55 -0
- package/dist/esm/features/staking/components/select-unstake-mode/select-unstake-mode.js.map +1 -0
- package/dist/esm/features/staking/components/select-unstake-mode/select-unstake-mode.module.css +115 -0
- package/dist/esm/features/staking/components/staking-balance-block/index.js +9 -0
- package/dist/esm/features/staking/components/staking-balance-block/index.js.map +1 -0
- package/dist/esm/features/staking/components/staking-balance-block/staking-balance-block.js +25 -0
- package/dist/esm/features/staking/components/staking-balance-block/staking-balance-block.js.map +1 -0
- package/dist/esm/features/staking/components/staking-balance-block/staking-balance-block.module.css +40 -0
- package/dist/esm/features/staking/components/staking-info/index.js +9 -0
- package/dist/esm/features/staking/components/staking-info/index.js.map +1 -0
- package/dist/esm/features/staking/components/staking-info/staking-info.js +13 -0
- package/dist/esm/features/staking/components/staking-info/staking-info.js.map +1 -0
- package/dist/esm/features/staking/components/staking-info/utils.js +13 -0
- package/dist/esm/features/staking/components/staking-info/utils.js.map +1 -0
- package/dist/esm/features/staking/components/staking-settings-modal/index.js +9 -0
- package/dist/esm/features/staking/components/staking-settings-modal/index.js.map +1 -0
- package/dist/esm/features/staking/components/staking-settings-modal/staking-settings-modal.js +38 -0
- package/dist/esm/features/staking/components/staking-settings-modal/staking-settings-modal.js.map +1 -0
- package/dist/esm/features/staking/components/staking-settings-modal/staking-settings-modal.module.css +24 -0
- package/dist/esm/features/staking/components/staking-widget/index.js +9 -0
- package/dist/esm/features/staking/components/staking-widget/index.js.map +1 -0
- package/dist/esm/features/staking/components/staking-widget/staking-widget.js +21 -0
- package/dist/esm/features/staking/components/staking-widget/staking-widget.js.map +1 -0
- package/dist/esm/features/staking/components/staking-widget-provider/index.js +9 -0
- package/dist/esm/features/staking/components/staking-widget-provider/index.js.map +1 -0
- package/dist/esm/features/staking/components/staking-widget-provider/staking-widget-provider.js +274 -0
- package/dist/esm/features/staking/components/staking-widget-provider/staking-widget-provider.js.map +1 -0
- package/dist/esm/features/staking/components/staking-widget-provider/use-staking-validation.js +48 -0
- package/dist/esm/features/staking/components/staking-widget-provider/use-staking-validation.js.map +1 -0
- package/dist/esm/features/staking/components/staking-widget-ui/index.js +9 -0
- package/dist/esm/features/staking/components/staking-widget-ui/index.js.map +1 -0
- package/dist/esm/features/staking/components/staking-widget-ui/staking-widget-ui.js +36 -0
- package/dist/esm/features/staking/components/staking-widget-ui/staking-widget-ui.js.map +1 -0
- package/dist/esm/features/staking/components/staking-widget-ui/staking-widget-ui.module.css +31 -0
- package/dist/esm/features/staking/hooks/use-build-stake-transaction.js +1 -1
- package/dist/esm/features/staking/hooks/use-build-stake-transaction.js.map +1 -1
- package/dist/esm/features/staking/hooks/use-staked-balance.js +4 -2
- package/dist/esm/features/staking/hooks/use-staked-balance.js.map +1 -1
- package/dist/esm/features/staking/hooks/use-staking-provider-info.js +10 -2
- package/dist/esm/features/staking/hooks/use-staking-provider-info.js.map +1 -1
- package/dist/esm/features/staking/hooks/use-staking-provider-metadata.js +28 -0
- package/dist/esm/features/staking/hooks/use-staking-provider-metadata.js.map +1 -0
- package/dist/esm/features/staking/hooks/use-staking-provider.js +30 -0
- package/dist/esm/features/staking/hooks/use-staking-provider.js.map +1 -0
- package/dist/esm/features/staking/hooks/use-staking-providers.js +12 -6
- package/dist/esm/features/staking/hooks/use-staking-providers.js.map +1 -1
- package/dist/esm/features/staking/hooks/use-staking-quote.js +4 -2
- package/dist/esm/features/staking/hooks/use-staking-quote.js.map +1 -1
- package/dist/esm/features/staking/index.js +10 -1
- package/dist/esm/features/staking/index.js.map +1 -1
- package/dist/esm/features/staking/utils/map-staking-error.js +25 -0
- package/dist/esm/features/staking/utils/map-staking-error.js.map +1 -0
- package/dist/esm/features/swap/components/swap-field/index.js +9 -0
- package/dist/esm/features/swap/components/swap-field/index.js.map +1 -0
- package/dist/esm/features/swap/components/swap-field/swap-field.js +17 -0
- package/dist/esm/features/swap/components/swap-field/swap-field.js.map +1 -0
- package/dist/esm/features/swap/components/swap-field/swap-field.module.css +65 -0
- package/dist/esm/features/swap/components/swap-flip-button/index.js +9 -0
- package/dist/esm/features/swap/components/swap-flip-button/index.js.map +1 -0
- package/dist/esm/features/swap/components/swap-flip-button/swap-flip-button.js +9 -0
- package/dist/esm/features/swap/components/swap-flip-button/swap-flip-button.js.map +1 -0
- package/dist/esm/features/swap/components/swap-flip-button/swap-flip-button.module.css +32 -0
- package/dist/esm/features/swap/components/swap-info/index.js +9 -0
- package/dist/esm/features/swap/components/swap-info/index.js.map +1 -0
- package/dist/esm/features/swap/components/swap-info/swap-info.js +12 -0
- package/dist/esm/features/swap/components/swap-info/swap-info.js.map +1 -0
- package/dist/esm/features/swap/components/swap-settings-modal/index.js +9 -0
- package/dist/esm/features/swap/components/swap-settings-modal/index.js.map +1 -0
- package/dist/esm/features/swap/components/swap-settings-modal/swap-settings-modal.js +41 -0
- package/dist/esm/features/swap/components/swap-settings-modal/swap-settings-modal.js.map +1 -0
- package/dist/esm/features/swap/components/swap-settings-modal/swap-settings-modal.module.css +24 -0
- package/dist/esm/features/swap/components/swap-token-select-modal/index.js +9 -0
- package/dist/esm/features/swap/components/swap-token-select-modal/index.js.map +1 -0
- package/dist/esm/features/swap/components/swap-token-select-modal/swap-token-select-modal.js +8 -0
- package/dist/esm/features/swap/components/swap-token-select-modal/swap-token-select-modal.js.map +1 -0
- package/dist/esm/features/swap/components/swap-token-select-modal/swap-token-select-modal.module.css +67 -0
- package/dist/esm/{components/circle-icon → features/swap/components/swap-widget}/index.js +1 -1
- package/dist/esm/features/swap/components/swap-widget/index.js.map +1 -0
- package/dist/esm/features/swap/components/swap-widget/swap-widget.js +21 -0
- package/dist/esm/features/swap/components/swap-widget/swap-widget.js.map +1 -0
- package/dist/esm/features/swap/components/swap-widget-provider/index.js +9 -0
- package/dist/esm/features/swap/components/swap-widget-provider/index.js.map +1 -0
- package/dist/esm/features/swap/components/swap-widget-provider/swap-widget-provider.js +237 -0
- package/dist/esm/features/swap/components/swap-widget-provider/swap-widget-provider.js.map +1 -0
- package/dist/esm/features/swap/components/swap-widget-provider/use-swap-balances.js +38 -0
- package/dist/esm/features/swap/components/swap-widget-provider/use-swap-balances.js.map +1 -0
- package/dist/esm/features/swap/components/swap-widget-provider/use-swap-token-state.js +62 -0
- package/dist/esm/features/swap/components/swap-widget-provider/use-swap-token-state.js.map +1 -0
- package/dist/esm/features/swap/components/swap-widget-provider/use-swap-validation.js +28 -0
- package/dist/esm/features/swap/components/swap-widget-provider/use-swap-validation.js.map +1 -0
- package/dist/esm/features/swap/components/swap-widget-ui/index.js +9 -0
- package/dist/esm/features/swap/components/swap-widget-ui/index.js.map +1 -0
- package/dist/esm/features/swap/components/swap-widget-ui/swap-widget-ui.js +49 -0
- package/dist/esm/features/swap/components/swap-widget-ui/swap-widget-ui.js.map +1 -0
- package/dist/esm/features/swap/components/swap-widget-ui/swap-widget-ui.module.css +51 -0
- package/dist/esm/features/swap/components/token-selector/index.js +9 -0
- package/dist/esm/features/swap/components/token-selector/index.js.map +1 -0
- package/dist/esm/features/swap/components/token-selector/token-selector.js +13 -0
- package/dist/esm/features/swap/components/token-selector/token-selector.js.map +1 -0
- package/dist/esm/features/swap/components/token-selector/token-selector.module.css +12 -0
- package/dist/esm/features/swap/hooks/use-build-swap-transaction.js +4 -1
- package/dist/esm/features/swap/hooks/use-build-swap-transaction.js.map +1 -1
- package/dist/esm/features/swap/hooks/use-swap-provider.js +34 -0
- package/dist/esm/features/swap/hooks/use-swap-provider.js.map +1 -0
- package/dist/esm/features/swap/hooks/use-swap-providers.js +24 -0
- package/dist/esm/features/swap/hooks/use-swap-providers.js.map +1 -0
- package/dist/esm/features/swap/hooks/use-swap-quote.js +7 -2
- package/dist/esm/features/swap/hooks/use-swap-quote.js.map +1 -1
- package/dist/esm/features/swap/index.js +8 -0
- package/dist/esm/features/swap/index.js.map +1 -1
- package/dist/esm/features/swap/utils/get-display-amount.js +19 -0
- package/dist/esm/features/swap/utils/get-display-amount.js.map +1 -0
- package/dist/esm/features/swap/utils/map-swap-error.js +29 -0
- package/dist/esm/features/swap/utils/map-swap-error.js.map +1 -0
- package/dist/esm/features/swap/utils/map-swap-widget-tokens.js +26 -0
- package/dist/esm/features/swap/utils/map-swap-widget-tokens.js.map +1 -0
- package/dist/esm/features/transaction/components/transaction/send.js +2 -2
- package/dist/esm/features/transaction/components/transaction/send.js.map +1 -1
- package/dist/esm/features/transaction/components/transaction-progress/transaction-progress-icons.js +7 -8
- package/dist/esm/features/transaction/components/transaction-progress/transaction-progress-icons.js.map +1 -1
- package/dist/esm/features/transaction/components/transaction-progress/transaction-progress.js +1 -1
- package/dist/esm/features/transaction/components/transaction-progress/transaction-progress.js.map +1 -1
- package/dist/esm/features/transaction/components/transaction-progress/transaction-progress.module.css +3 -3
- package/dist/esm/features/transaction/hooks/use-send-transaction.js +1 -1
- package/dist/esm/features/transaction/hooks/use-send-transaction.js.map +1 -1
- package/dist/esm/features/transaction/hooks/use-transaction-status.js +4 -2
- package/dist/esm/features/transaction/hooks/use-transaction-status.js.map +1 -1
- package/dist/esm/features/transaction/hooks/use-transfer-ton.js +1 -1
- package/dist/esm/features/transaction/hooks/use-transfer-ton.js.map +1 -1
- package/dist/esm/features/transaction/hooks/use-watch-transactions-by-address.js +1 -1
- package/dist/esm/features/transaction/hooks/use-watch-transactions-by-address.js.map +1 -1
- package/dist/esm/features/wallets/hooks/use-connect.js +1 -1
- package/dist/esm/features/wallets/hooks/use-connect.js.map +1 -1
- package/dist/esm/features/wallets/hooks/use-connected-wallets.js +1 -1
- package/dist/esm/features/wallets/hooks/use-connected-wallets.js.map +1 -1
- package/dist/esm/features/wallets/hooks/use-connector-by-id.js +1 -1
- package/dist/esm/features/wallets/hooks/use-connector-by-id.js.map +1 -1
- package/dist/esm/features/wallets/hooks/use-connectors.js +1 -1
- package/dist/esm/features/wallets/hooks/use-connectors.js.map +1 -1
- package/dist/esm/features/wallets/hooks/use-disconnect.js +1 -1
- package/dist/esm/features/wallets/hooks/use-disconnect.js.map +1 -1
- package/dist/esm/features/wallets/hooks/use-selected-wallet.js +1 -1
- package/dist/esm/features/wallets/hooks/use-selected-wallet.js.map +1 -1
- package/dist/esm/hooks/use-debounce-callback.js +41 -0
- package/dist/esm/hooks/use-debounce-callback.js.map +1 -0
- package/dist/esm/hooks/use-debounce-value.js +23 -0
- package/dist/esm/hooks/use-debounce-value.js.map +1 -0
- package/dist/esm/hooks/use-unmount.js +14 -0
- package/dist/esm/hooks/use-unmount.js.map +1 -0
- package/dist/esm/index.js +19 -7
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/locales/en.js +75 -0
- package/dist/esm/locales/en.js.map +1 -1
- package/dist/esm/styles/index.css +106 -60
- package/dist/esm/styles/typography.module.css +104 -54
- package/dist/esm/tsconfig.build.tsbuildinfo +1 -1
- package/dist/esm/types/appkit-ui-token.js +9 -0
- package/dist/esm/types/appkit-ui-token.js.map +1 -0
- package/dist/esm/utils/map-defi-error.js +34 -0
- package/dist/esm/utils/map-defi-error.js.map +1 -0
- package/dist/esm/utils/validate-amount.js +30 -0
- package/dist/esm/utils/validate-amount.js.map +1 -0
- package/dist/types/components/shared/amount-presets/amount-presets.d.ts +20 -0
- package/dist/types/components/shared/amount-presets/amount-presets.d.ts.map +1 -0
- package/dist/types/components/shared/amount-presets/index.d.ts +10 -0
- package/dist/types/components/shared/amount-presets/index.d.ts.map +1 -0
- package/dist/types/components/shared/button-with-connect/button-with-connect.d.ts +11 -0
- package/dist/types/components/shared/button-with-connect/button-with-connect.d.ts.map +1 -0
- package/dist/types/components/{ton-icon → shared/button-with-connect}/index.d.ts +1 -1
- package/dist/types/components/shared/button-with-connect/index.d.ts.map +1 -0
- package/dist/types/components/shared/low-balance-modal/index.d.ts +10 -0
- package/dist/types/components/shared/low-balance-modal/index.d.ts.map +1 -0
- package/dist/types/components/shared/low-balance-modal/low-balance-modal.d.ts +23 -0
- package/dist/types/components/shared/low-balance-modal/low-balance-modal.d.ts.map +1 -0
- package/dist/types/components/shared/option-switcher/index.d.ts +9 -0
- package/dist/types/components/shared/option-switcher/index.d.ts.map +1 -0
- package/dist/types/components/shared/option-switcher/option-switcher.d.ts +28 -0
- package/dist/types/components/shared/option-switcher/option-switcher.d.ts.map +1 -0
- package/dist/types/components/shared/settings-button/index.d.ts +9 -0
- package/dist/types/components/shared/settings-button/index.d.ts.map +1 -0
- package/dist/types/components/shared/settings-button/settings-button.d.ts +14 -0
- package/dist/types/components/shared/settings-button/settings-button.d.ts.map +1 -0
- package/dist/types/components/shared/token-select-modal/index.d.ts +10 -0
- package/dist/types/components/shared/token-select-modal/index.d.ts.map +1 -0
- package/dist/types/components/shared/token-select-modal/token-select-modal.d.ts +19 -0
- package/dist/types/components/shared/token-select-modal/token-select-modal.d.ts.map +1 -0
- package/dist/types/components/ui/amount-reversed/amount-reversed.d.ts +19 -0
- package/dist/types/components/ui/amount-reversed/amount-reversed.d.ts.map +1 -0
- package/dist/types/components/ui/amount-reversed/index.d.ts +10 -0
- package/dist/types/components/ui/amount-reversed/index.d.ts.map +1 -0
- package/dist/types/components/ui/block/block.d.ts.map +1 -0
- package/dist/types/components/ui/block/index.d.ts.map +1 -0
- package/dist/types/components/ui/button/button.d.ts +31 -0
- package/dist/types/components/ui/button/button.d.ts.map +1 -0
- package/dist/types/components/ui/button/index.d.ts +10 -0
- package/dist/types/components/ui/button/index.d.ts.map +1 -0
- package/dist/types/components/ui/centered-amount-input/centered-amount-input.d.ts +17 -0
- package/dist/types/components/ui/centered-amount-input/centered-amount-input.d.ts.map +1 -0
- package/dist/types/components/ui/centered-amount-input/index.d.ts +10 -0
- package/dist/types/components/ui/centered-amount-input/index.d.ts.map +1 -0
- package/dist/types/components/{button/button.d.ts → ui/collapsible/collapsible.d.ts} +5 -2
- package/dist/types/components/ui/collapsible/collapsible.d.ts.map +1 -0
- package/dist/types/components/ui/collapsible/index.d.ts +10 -0
- package/dist/types/components/ui/collapsible/index.d.ts.map +1 -0
- package/dist/types/components/ui/dialog/dialog.d.ts +27 -0
- package/dist/types/components/ui/dialog/dialog.d.ts.map +1 -0
- package/dist/types/components/ui/dialog/index.d.ts +9 -0
- package/dist/types/components/ui/dialog/index.d.ts.map +1 -0
- package/dist/types/components/ui/dialog/use-dialog-context.d.ts +15 -0
- package/dist/types/components/ui/dialog/use-dialog-context.d.ts.map +1 -0
- package/dist/types/components/ui/icons/chevron-down-icon.d.ts +11 -0
- package/dist/types/components/ui/icons/chevron-down-icon.d.ts.map +1 -0
- package/dist/types/components/ui/icons/chevrons-icon.d.ts +11 -0
- package/dist/types/components/ui/icons/chevrons-icon.d.ts.map +1 -0
- package/dist/types/components/ui/icons/close-icon.d.ts +11 -0
- package/dist/types/components/ui/icons/close-icon.d.ts.map +1 -0
- package/dist/types/components/ui/icons/failed-icon.d.ts +11 -0
- package/dist/types/components/ui/icons/failed-icon.d.ts.map +1 -0
- package/dist/types/components/ui/icons/flip-icon.d.ts +11 -0
- package/dist/types/components/ui/icons/flip-icon.d.ts.map +1 -0
- package/dist/types/components/ui/icons/image-icon.d.ts +11 -0
- package/dist/types/components/ui/icons/image-icon.d.ts.map +1 -0
- package/dist/types/components/ui/icons/index.d.ts +21 -0
- package/dist/types/components/ui/icons/index.d.ts.map +1 -0
- package/dist/types/components/ui/icons/search-icon.d.ts +11 -0
- package/dist/types/components/ui/icons/search-icon.d.ts.map +1 -0
- package/dist/types/components/ui/icons/sliders-icon.d.ts +11 -0
- package/dist/types/components/ui/icons/sliders-icon.d.ts.map +1 -0
- package/dist/types/components/ui/icons/spinner-icon.d.ts +11 -0
- package/dist/types/components/ui/icons/spinner-icon.d.ts.map +1 -0
- package/dist/types/components/ui/icons/success-icon.d.ts +11 -0
- package/dist/types/components/ui/icons/success-icon.d.ts.map +1 -0
- package/dist/types/components/ui/icons/ton-icon.d.ts +12 -0
- package/dist/types/components/ui/icons/ton-icon.d.ts.map +1 -0
- package/dist/types/components/ui/icons/types.d.ts +20 -0
- package/dist/types/components/ui/icons/types.d.ts.map +1 -0
- package/dist/types/components/ui/icons/verified-icon.d.ts +11 -0
- package/dist/types/components/ui/icons/verified-icon.d.ts.map +1 -0
- package/dist/types/components/ui/info-block/index.d.ts +9 -0
- package/dist/types/components/ui/info-block/index.d.ts.map +1 -0
- package/dist/types/components/ui/info-block/info-block.d.ts +18 -0
- package/dist/types/components/ui/info-block/info-block.d.ts.map +1 -0
- package/dist/types/components/ui/input/index.d.ts +9 -0
- package/dist/types/components/ui/input/index.d.ts.map +1 -0
- package/dist/types/components/ui/input/input.d.ts +40 -0
- package/dist/types/components/ui/input/input.d.ts.map +1 -0
- package/dist/types/components/ui/input/use-input-resize.d.ts +31 -0
- package/dist/types/components/ui/input/use-input-resize.d.ts.map +1 -0
- package/dist/types/components/ui/logo/index.d.ts +9 -0
- package/dist/types/components/ui/logo/index.d.ts.map +1 -0
- package/dist/types/components/ui/logo/logo.d.ts +16 -0
- package/dist/types/components/ui/logo/logo.d.ts.map +1 -0
- package/dist/types/components/ui/logo/use-image-loading-status.d.ts +10 -0
- package/dist/types/components/ui/logo/use-image-loading-status.d.ts.map +1 -0
- package/dist/types/components/ui/modal/index.d.ts +9 -0
- package/dist/types/components/ui/modal/index.d.ts.map +1 -0
- package/dist/types/components/ui/modal/modal.d.ts +32 -0
- package/dist/types/components/ui/modal/modal.d.ts.map +1 -0
- package/dist/types/components/ui/select/index.d.ts +9 -0
- package/dist/types/components/ui/select/index.d.ts.map +1 -0
- package/dist/types/components/ui/select/select.d.ts +44 -0
- package/dist/types/components/ui/select/select.d.ts.map +1 -0
- package/dist/types/components/ui/select/use-select-context.d.ts +20 -0
- package/dist/types/components/ui/select/use-select-context.d.ts.map +1 -0
- package/dist/types/components/ui/skeleton/index.d.ts +10 -0
- package/dist/types/components/ui/skeleton/index.d.ts.map +1 -0
- package/dist/types/components/ui/skeleton/skeleton.d.ts +14 -0
- package/dist/types/components/ui/skeleton/skeleton.d.ts.map +1 -0
- package/dist/types/components/ui/tabs/index.d.ts +10 -0
- package/dist/types/components/ui/tabs/index.d.ts.map +1 -0
- package/dist/types/components/ui/tabs/tabs.d.ts +30 -0
- package/dist/types/components/ui/tabs/tabs.d.ts.map +1 -0
- package/dist/types/features/balances/components/balance-badge/balance-badge.d.ts +1 -1
- package/dist/types/features/balances/components/currency-item/currency-item.d.ts.map +1 -1
- package/dist/types/features/balances/components/send-jetton-button/send-jetton-button.d.ts.map +1 -1
- package/dist/types/features/balances/components/send-ton-button/send-ton-button.d.ts.map +1 -1
- package/dist/types/features/balances/hooks/use-balance-by-address.d.ts.map +1 -1
- package/dist/types/features/jettons/hooks/use-jetton-balance-by-address.d.ts.map +1 -1
- package/dist/types/features/jettons/hooks/use-jetton-info.d.ts.map +1 -1
- package/dist/types/features/jettons/hooks/use-jetton-wallet-address.d.ts.map +1 -1
- package/dist/types/features/jettons/hooks/use-jettons-by-address.d.ts.map +1 -1
- package/dist/types/features/network/hooks/use-block-number.d.ts.map +1 -1
- package/dist/types/features/nft/components/nft-item/nft-item.d.ts.map +1 -1
- package/dist/types/features/nft/hooks/use-nft.d.ts.map +1 -1
- package/dist/types/features/nft/hooks/use-nfts-by-address.d.ts.map +1 -1
- package/dist/types/features/settings/hooks/use-app-kit-theme.d.ts.map +1 -0
- package/dist/types/features/settings/hooks/use-app-kit.d.ts.map +1 -0
- package/dist/types/{hooks → features/settings/hooks}/use-i18n.d.ts +1 -1
- package/dist/types/features/settings/hooks/use-i18n.d.ts.map +1 -0
- package/dist/types/features/settings/index.d.ts +11 -0
- package/dist/types/features/settings/index.d.ts.map +1 -0
- package/dist/types/features/staking/components/select-unstake-mode/index.d.ts +10 -0
- package/dist/types/features/staking/components/select-unstake-mode/index.d.ts.map +1 -0
- package/dist/types/features/staking/components/select-unstake-mode/select-unstake-mode.d.ts +17 -0
- package/dist/types/features/staking/components/select-unstake-mode/select-unstake-mode.d.ts.map +1 -0
- package/dist/types/features/staking/components/staking-balance-block/index.d.ts +9 -0
- package/dist/types/features/staking/components/staking-balance-block/index.d.ts.map +1 -0
- package/dist/types/features/staking/components/staking-balance-block/staking-balance-block.d.ts +21 -0
- package/dist/types/features/staking/components/staking-balance-block/staking-balance-block.d.ts.map +1 -0
- package/dist/types/features/staking/components/staking-info/index.d.ts +10 -0
- package/dist/types/features/staking/components/staking-info/index.d.ts.map +1 -0
- package/dist/types/features/staking/components/staking-info/staking-info.d.ts +21 -0
- package/dist/types/features/staking/components/staking-info/staking-info.d.ts.map +1 -0
- package/dist/types/features/staking/components/staking-info/utils.d.ts +9 -0
- package/dist/types/features/staking/components/staking-info/utils.d.ts.map +1 -0
- package/dist/types/features/staking/components/staking-settings-modal/index.d.ts +9 -0
- package/dist/types/features/staking/components/staking-settings-modal/index.d.ts.map +1 -0
- package/dist/types/features/staking/components/staking-settings-modal/staking-settings-modal.d.ts +19 -0
- package/dist/types/features/staking/components/staking-settings-modal/staking-settings-modal.d.ts.map +1 -0
- package/dist/types/features/staking/components/staking-widget/index.d.ts +9 -0
- package/dist/types/features/staking/components/staking-widget/index.d.ts.map +1 -0
- package/dist/types/features/staking/components/staking-widget/staking-widget.d.ts +30 -0
- package/dist/types/features/staking/components/staking-widget/staking-widget.d.ts.map +1 -0
- package/dist/types/features/staking/components/staking-widget-provider/index.d.ts +9 -0
- package/dist/types/features/staking/components/staking-widget-provider/index.d.ts.map +1 -0
- package/dist/types/features/staking/components/staking-widget-provider/staking-widget-provider.d.ts +98 -0
- package/dist/types/features/staking/components/staking-widget-provider/staking-widget-provider.d.ts.map +1 -0
- package/dist/types/features/staking/components/staking-widget-provider/use-staking-validation.d.ts +26 -0
- package/dist/types/features/staking/components/staking-widget-provider/use-staking-validation.d.ts.map +1 -0
- package/dist/types/features/staking/components/staking-widget-ui/index.d.ts +9 -0
- package/dist/types/features/staking/components/staking-widget-ui/index.d.ts.map +1 -0
- package/dist/types/features/staking/components/staking-widget-ui/staking-widget-ui.d.ts +12 -0
- package/dist/types/features/staking/components/staking-widget-ui/staking-widget-ui.d.ts.map +1 -0
- package/dist/types/features/staking/hooks/use-staked-balance.d.ts.map +1 -1
- package/dist/types/features/staking/hooks/use-staking-provider-info.d.ts.map +1 -1
- package/dist/types/features/staking/hooks/use-staking-provider-metadata.d.ts +15 -0
- package/dist/types/features/staking/hooks/use-staking-provider-metadata.d.ts.map +1 -0
- package/dist/types/features/staking/hooks/use-staking-provider.d.ts +14 -0
- package/dist/types/features/staking/hooks/use-staking-provider.d.ts.map +1 -0
- package/dist/types/features/staking/hooks/use-staking-providers.d.ts +4 -6
- package/dist/types/features/staking/hooks/use-staking-providers.d.ts.map +1 -1
- package/dist/types/features/staking/hooks/use-staking-quote.d.ts.map +1 -1
- package/dist/types/features/staking/index.d.ts +10 -1
- package/dist/types/features/staking/index.d.ts.map +1 -1
- package/dist/types/features/staking/utils/map-staking-error.d.ts +13 -0
- package/dist/types/features/staking/utils/map-staking-error.d.ts.map +1 -0
- package/dist/types/features/swap/components/swap-field/index.d.ts +9 -0
- package/dist/types/features/swap/components/swap-field/index.d.ts.map +1 -0
- package/dist/types/features/swap/components/swap-field/swap-field.d.ts +25 -0
- package/dist/types/features/swap/components/swap-field/swap-field.d.ts.map +1 -0
- package/dist/types/features/swap/components/swap-flip-button/index.d.ts +9 -0
- package/dist/types/features/swap/components/swap-flip-button/index.d.ts.map +1 -0
- package/dist/types/features/swap/components/swap-flip-button/swap-flip-button.d.ts +14 -0
- package/dist/types/features/swap/components/swap-flip-button/swap-flip-button.d.ts.map +1 -0
- package/dist/types/features/swap/components/swap-info/index.d.ts +9 -0
- package/dist/types/features/swap/components/swap-info/index.d.ts.map +1 -0
- package/dist/types/features/swap/components/swap-info/swap-info.d.ts +20 -0
- package/dist/types/features/swap/components/swap-info/swap-info.d.ts.map +1 -0
- package/dist/types/features/swap/components/swap-settings-modal/index.d.ts +10 -0
- package/dist/types/features/swap/components/swap-settings-modal/index.d.ts.map +1 -0
- package/dist/types/features/swap/components/swap-settings-modal/swap-settings-modal.d.ts +20 -0
- package/dist/types/features/swap/components/swap-settings-modal/swap-settings-modal.d.ts.map +1 -0
- package/dist/types/features/swap/components/swap-token-select-modal/index.d.ts +10 -0
- package/dist/types/features/swap/components/swap-token-select-modal/index.d.ts.map +1 -0
- package/dist/types/features/swap/components/swap-token-select-modal/swap-token-select-modal.d.ts +12 -0
- package/dist/types/features/swap/components/swap-token-select-modal/swap-token-select-modal.d.ts.map +1 -0
- package/dist/types/{components/circle-icon → features/swap/components/swap-widget}/index.d.ts +1 -1
- package/dist/types/features/swap/components/swap-widget/index.d.ts.map +1 -0
- package/dist/types/features/swap/components/swap-widget/swap-widget.d.ts +31 -0
- package/dist/types/features/swap/components/swap-widget/swap-widget.d.ts.map +1 -0
- package/dist/types/features/swap/components/swap-widget-provider/index.d.ts +9 -0
- package/dist/types/features/swap/components/swap-widget-provider/index.d.ts.map +1 -0
- package/dist/types/features/swap/components/swap-widget-provider/swap-widget-provider.d.ts +106 -0
- package/dist/types/features/swap/components/swap-widget-provider/swap-widget-provider.d.ts.map +1 -0
- package/dist/types/features/swap/components/swap-widget-provider/use-swap-balances.d.ts +23 -0
- package/dist/types/features/swap/components/swap-widget-provider/use-swap-balances.d.ts.map +1 -0
- package/dist/types/features/swap/components/swap-widget-provider/use-swap-token-state.d.ts +24 -0
- package/dist/types/features/swap/components/swap-widget-provider/use-swap-token-state.d.ts.map +1 -0
- package/dist/types/features/swap/components/swap-widget-provider/use-swap-validation.d.ts +23 -0
- package/dist/types/features/swap/components/swap-widget-provider/use-swap-validation.d.ts.map +1 -0
- package/dist/types/features/swap/components/swap-widget-ui/index.d.ts +9 -0
- package/dist/types/features/swap/components/swap-widget-ui/index.d.ts.map +1 -0
- package/dist/types/features/swap/components/swap-widget-ui/swap-widget-ui.d.ts +12 -0
- package/dist/types/features/swap/components/swap-widget-ui/swap-widget-ui.d.ts.map +1 -0
- package/dist/types/features/swap/components/token-selector/index.d.ts +9 -0
- package/dist/types/features/swap/components/token-selector/index.d.ts.map +1 -0
- package/dist/types/features/swap/components/token-selector/token-selector.d.ts +15 -0
- package/dist/types/features/swap/components/token-selector/token-selector.d.ts.map +1 -0
- package/dist/types/features/swap/hooks/use-build-swap-transaction.d.ts +3 -0
- package/dist/types/features/swap/hooks/use-build-swap-transaction.d.ts.map +1 -1
- package/dist/types/features/swap/hooks/use-swap-provider.d.ts +15 -0
- package/dist/types/features/swap/hooks/use-swap-provider.d.ts.map +1 -0
- package/dist/types/features/swap/hooks/use-swap-providers.d.ts +14 -0
- package/dist/types/features/swap/hooks/use-swap-providers.d.ts.map +1 -0
- package/dist/types/features/swap/hooks/use-swap-quote.d.ts +3 -0
- package/dist/types/features/swap/hooks/use-swap-quote.d.ts.map +1 -1
- package/dist/types/features/swap/index.d.ts +8 -0
- package/dist/types/features/swap/index.d.ts.map +1 -1
- package/dist/types/features/swap/utils/get-display-amount.d.ts +13 -0
- package/dist/types/features/swap/utils/get-display-amount.d.ts.map +1 -0
- package/dist/types/features/swap/utils/map-swap-error.d.ts +13 -0
- package/dist/types/features/swap/utils/map-swap-error.d.ts.map +1 -0
- package/dist/types/features/swap/utils/map-swap-widget-tokens.d.ts +10 -0
- package/dist/types/features/swap/utils/map-swap-widget-tokens.d.ts.map +1 -0
- package/dist/types/features/transaction/components/transaction/send.d.ts +3 -2
- package/dist/types/features/transaction/components/transaction/send.d.ts.map +1 -1
- package/dist/types/features/transaction/components/transaction-progress/transaction-progress-icons.d.ts.map +1 -1
- package/dist/types/features/transaction/hooks/use-transaction-status.d.ts.map +1 -1
- package/dist/types/hooks/use-debounce-callback.d.ts +17 -0
- package/dist/types/hooks/use-debounce-callback.d.ts.map +1 -0
- package/dist/types/hooks/use-debounce-value.d.ts +15 -0
- package/dist/types/hooks/use-debounce-value.d.ts.map +1 -0
- package/dist/types/hooks/use-unmount.d.ts +9 -0
- package/dist/types/hooks/use-unmount.d.ts.map +1 -0
- package/dist/types/index.d.ts +19 -7
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/libs/i18n.d.ts +70 -0
- package/dist/types/libs/i18n.d.ts.map +1 -1
- package/dist/types/locales/en.d.ts +70 -0
- package/dist/types/locales/en.d.ts.map +1 -1
- package/dist/types/types/appkit-ui-token.d.ts +25 -0
- package/dist/types/types/appkit-ui-token.d.ts.map +1 -0
- package/dist/types/utils/map-defi-error.d.ts +14 -0
- package/dist/types/utils/map-defi-error.d.ts.map +1 -0
- package/dist/types/utils/validate-amount.d.ts +18 -0
- package/dist/types/utils/validate-amount.d.ts.map +1 -0
- package/package.json +4 -4
- package/src/components/shared/amount-presets/amount-presets.tsx +50 -0
- package/src/components/shared/amount-presets/index.ts +10 -0
- package/src/components/shared/button-with-connect/button-with-connect.tsx +37 -0
- package/src/components/shared/button-with-connect/index.ts +9 -0
- package/src/components/shared/low-balance-modal/index.ts +10 -0
- package/src/components/shared/low-balance-modal/low-balance-modal.tsx +58 -0
- package/src/components/{button → shared/option-switcher}/index.ts +1 -1
- package/src/components/shared/option-switcher/option-switcher.tsx +55 -0
- package/src/components/{ton-icon → shared/settings-button}/index.ts +1 -1
- package/src/components/shared/settings-button/settings-button.tsx +33 -0
- package/src/components/shared/token-select-modal/index.ts +10 -0
- package/src/components/shared/token-select-modal/token-select-modal.tsx +103 -0
- package/src/components/ui/amount-reversed/amount-reversed.tsx +65 -0
- package/src/components/ui/amount-reversed/index.ts +10 -0
- package/src/components/ui/button/button.tsx +100 -0
- package/{dist/types/components/button/index.d.ts → src/components/ui/button/index.ts} +2 -1
- package/src/components/ui/centered-amount-input/centered-amount-input.tsx +118 -0
- package/src/components/ui/centered-amount-input/index.ts +10 -0
- package/src/components/ui/collapsible/collapsible.tsx +54 -0
- package/src/components/ui/collapsible/index.ts +10 -0
- package/src/components/ui/dialog/dialog.tsx +105 -0
- package/src/components/{circle-icon → ui/dialog}/index.ts +1 -1
- package/src/components/ui/dialog/use-dialog-context.ts +23 -0
- package/src/components/ui/icons/chevron-down-icon.tsx +26 -0
- package/src/components/ui/icons/chevrons-icon.tsx +39 -0
- package/src/components/ui/icons/close-icon.tsx +32 -0
- package/src/components/ui/icons/failed-icon.tsx +32 -0
- package/src/components/ui/icons/flip-icon.tsx +39 -0
- package/src/components/ui/icons/image-icon.tsx +32 -0
- package/src/components/ui/icons/index.ts +21 -0
- package/src/components/ui/icons/search-icon.tsx +29 -0
- package/src/components/ui/icons/sliders-icon.tsx +31 -0
- package/src/components/ui/icons/spinner-icon.tsx +30 -0
- package/src/components/ui/icons/success-icon.tsx +31 -0
- package/src/components/ui/icons/ton-icon.tsx +50 -0
- package/src/components/ui/icons/types.ts +22 -0
- package/src/components/ui/icons/verified-icon.tsx +30 -0
- package/src/components/ui/info-block/index.ts +9 -0
- package/src/components/ui/info-block/info-block.tsx +47 -0
- package/src/components/ui/input/index.ts +9 -0
- package/src/components/ui/input/input.tsx +194 -0
- package/src/components/ui/input/use-input-resize.ts +96 -0
- package/src/components/ui/logo/index.ts +9 -0
- package/src/components/ui/logo/logo.tsx +106 -0
- package/src/components/ui/logo/use-image-loading-status.ts +50 -0
- package/src/components/ui/modal/index.ts +9 -0
- package/src/components/ui/modal/modal.tsx +57 -0
- package/src/components/ui/select/index.ts +9 -0
- package/src/components/ui/select/select.tsx +274 -0
- package/src/components/ui/select/use-select-context.ts +28 -0
- package/src/components/ui/skeleton/index.ts +10 -0
- package/src/components/ui/skeleton/skeleton.tsx +33 -0
- package/src/components/ui/tabs/index.ts +10 -0
- package/src/components/ui/tabs/tabs.tsx +116 -0
- package/src/features/balances/components/balance-badge/balance-badge.tsx +3 -3
- package/src/features/balances/components/currency-item/currency-item.tsx +12 -15
- package/src/features/balances/components/send-jetton-button/send-jetton-button.tsx +1 -2
- package/src/features/balances/components/send-ton-button/send-ton-button.tsx +1 -2
- package/src/features/balances/hooks/use-balance-by-address.ts +6 -2
- package/src/features/balances/hooks/use-watch-balance-by-address.ts +1 -1
- package/src/features/jettons/hooks/use-jetton-balance-by-address.ts +6 -2
- package/src/features/jettons/hooks/use-jetton-info.ts +4 -2
- package/src/features/jettons/hooks/use-jetton-wallet-address.ts +6 -2
- package/src/features/jettons/hooks/use-jettons-by-address.ts +6 -2
- package/src/features/jettons/hooks/use-transfer-jetton.ts +1 -1
- package/src/features/jettons/hooks/use-watch-jettons-by-address.ts +1 -1
- package/src/features/network/hooks/use-block-number.ts +6 -2
- package/src/features/network/hooks/use-default-network.ts +1 -1
- package/src/features/network/hooks/use-networks.ts +1 -1
- package/src/features/nft/components/nft-item/nft-item.tsx +3 -13
- package/src/features/nft/hooks/use-nft.ts +4 -2
- package/src/features/nft/hooks/use-nfts-by-address.ts +4 -2
- package/src/features/nft/hooks/use-transfer-nft.ts +1 -1
- package/src/{hooks → features/settings/hooks}/use-app-kit.ts +1 -1
- package/src/{hooks → features/settings/hooks}/use-i18n.ts +1 -1
- package/src/features/settings/index.ts +11 -0
- package/src/features/signing/hooks/use-sign-binary.ts +1 -1
- package/src/features/signing/hooks/use-sign-cell.ts +1 -1
- package/src/features/signing/hooks/use-sign-text.ts +1 -1
- package/src/features/staking/components/select-unstake-mode/index.ts +10 -0
- package/src/features/staking/components/select-unstake-mode/select-unstake-mode.tsx +128 -0
- package/src/features/staking/components/staking-balance-block/index.ts +9 -0
- package/src/features/staking/components/staking-balance-block/staking-balance-block.tsx +90 -0
- package/src/features/staking/components/staking-info/index.ts +10 -0
- package/src/features/staking/components/staking-info/staking-info.tsx +95 -0
- package/src/features/staking/components/staking-info/utils.ts +15 -0
- package/src/features/staking/components/staking-settings-modal/index.ts +9 -0
- package/src/features/staking/components/staking-settings-modal/staking-settings-modal.tsx +76 -0
- package/src/features/staking/components/staking-widget/index.ts +9 -0
- package/src/features/staking/components/staking-widget/staking-widget.tsx +54 -0
- package/src/features/staking/components/staking-widget-provider/index.ts +9 -0
- package/src/features/staking/components/staking-widget-provider/staking-widget-provider.tsx +421 -0
- package/src/features/staking/components/staking-widget-provider/use-staking-validation.ts +79 -0
- package/src/features/staking/components/staking-widget-ui/index.ts +9 -0
- package/src/features/staking/components/staking-widget-ui/staking-widget-ui.tsx +199 -0
- package/src/features/staking/hooks/use-build-stake-transaction.ts +1 -1
- package/src/features/staking/hooks/use-staked-balance.ts +7 -2
- package/src/features/staking/hooks/use-staking-provider-info.ts +13 -2
- package/src/features/staking/hooks/use-staking-provider-metadata.ts +34 -0
- package/src/features/staking/hooks/use-staking-provider.ts +42 -0
- package/src/features/staking/hooks/use-staking-providers.ts +20 -20
- package/src/features/staking/hooks/use-staking-quote.ts +7 -2
- package/src/features/staking/index.ts +15 -5
- package/src/features/staking/utils/map-staking-error.ts +28 -0
- package/src/features/swap/components/swap-field/index.ts +9 -0
- package/src/features/swap/components/swap-field/swap-field.tsx +114 -0
- package/src/features/swap/components/swap-flip-button/index.ts +9 -0
- package/src/features/swap/components/swap-flip-button/swap-flip-button.tsx +29 -0
- package/src/features/swap/components/swap-info/index.ts +9 -0
- package/src/features/swap/components/swap-info/swap-info.tsx +48 -0
- package/src/features/swap/components/swap-settings-modal/index.ts +10 -0
- package/src/features/swap/components/swap-settings-modal/swap-settings-modal.tsx +92 -0
- package/src/features/swap/components/swap-token-select-modal/index.ts +10 -0
- package/src/features/swap/components/swap-token-select-modal/swap-token-select-modal.tsx +21 -0
- package/src/features/swap/components/swap-widget/index.ts +9 -0
- package/src/features/swap/components/swap-widget/swap-widget.tsx +70 -0
- package/src/features/swap/components/swap-widget-provider/index.ts +9 -0
- package/src/features/swap/components/swap-widget-provider/swap-widget-provider.tsx +379 -0
- package/src/features/swap/components/swap-widget-provider/use-swap-balances.ts +53 -0
- package/src/features/swap/components/swap-widget-provider/use-swap-token-state.ts +96 -0
- package/src/features/swap/components/swap-widget-provider/use-swap-validation.ts +51 -0
- package/src/features/swap/components/swap-widget-ui/index.ts +9 -0
- package/src/features/swap/components/swap-widget-ui/swap-widget-ui.tsx +168 -0
- package/src/features/swap/components/token-selector/index.ts +9 -0
- package/src/features/swap/components/token-selector/token-selector.tsx +35 -0
- package/src/features/swap/hooks/use-build-swap-transaction.ts +4 -1
- package/src/features/swap/hooks/use-swap-provider.ts +49 -0
- package/src/features/swap/hooks/use-swap-providers.ts +35 -0
- package/src/features/swap/hooks/use-swap-quote.ts +7 -2
- package/src/features/swap/index.ts +9 -0
- package/src/features/swap/utils/get-display-amount.ts +21 -0
- package/src/features/swap/utils/map-swap-error.ts +32 -0
- package/src/features/swap/utils/map-swap-widget-tokens.ts +34 -0
- package/src/features/transaction/components/transaction/send.tsx +6 -5
- package/src/features/transaction/components/transaction-progress/transaction-progress-icons.tsx +13 -57
- package/src/features/transaction/components/transaction-progress/transaction-progress.tsx +1 -1
- package/src/features/transaction/hooks/use-send-transaction.ts +1 -1
- package/src/features/transaction/hooks/use-transaction-status.ts +6 -2
- package/src/features/transaction/hooks/use-transfer-ton.ts +1 -1
- package/src/features/transaction/hooks/use-watch-transactions-by-address.ts +1 -1
- package/src/features/wallets/hooks/use-connect.ts +1 -1
- package/src/features/wallets/hooks/use-connected-wallets.ts +1 -1
- package/src/features/wallets/hooks/use-connector-by-id.ts +1 -1
- package/src/features/wallets/hooks/use-connectors.ts +1 -1
- package/src/features/wallets/hooks/use-disconnect.ts +1 -1
- package/src/features/wallets/hooks/use-selected-wallet.ts +1 -1
- package/src/hooks/use-debounce-callback.ts +69 -0
- package/src/hooks/use-debounce-value.ts +38 -0
- package/src/hooks/use-unmount.ts +16 -0
- package/src/index.ts +20 -7
- package/src/locales/en.ts +82 -0
- package/src/storybook/fixtures/tokens.ts +88 -0
- package/src/types/appkit-ui-token.ts +26 -0
- package/src/utils/map-defi-error.ts +35 -0
- package/src/utils/validate-amount.ts +28 -0
- package/dist/esm/components/block/block.js.map +0 -1
- package/dist/esm/components/block/index.js.map +0 -1
- package/dist/esm/components/button/button.js +0 -7
- package/dist/esm/components/button/button.js.map +0 -1
- package/dist/esm/components/button/button.module.css +0 -38
- package/dist/esm/components/button/index.js.map +0 -1
- package/dist/esm/components/circle-icon/circle-icon.js +0 -8
- package/dist/esm/components/circle-icon/circle-icon.js.map +0 -1
- package/dist/esm/components/circle-icon/index.js.map +0 -1
- package/dist/esm/components/ton-icon/index.js.map +0 -1
- package/dist/esm/components/ton-icon/ton-icon.js +0 -8
- package/dist/esm/components/ton-icon/ton-icon.js.map +0 -1
- package/dist/esm/hooks/use-app-kit-theme.js.map +0 -1
- package/dist/esm/hooks/use-app-kit.js.map +0 -1
- package/dist/esm/hooks/use-i18n.js.map +0 -1
- package/dist/types/components/block/block.d.ts.map +0 -1
- package/dist/types/components/block/index.d.ts.map +0 -1
- package/dist/types/components/button/button.d.ts.map +0 -1
- package/dist/types/components/button/index.d.ts.map +0 -1
- package/dist/types/components/circle-icon/circle-icon.d.ts +0 -16
- package/dist/types/components/circle-icon/circle-icon.d.ts.map +0 -1
- package/dist/types/components/circle-icon/index.d.ts.map +0 -1
- package/dist/types/components/ton-icon/index.d.ts.map +0 -1
- package/dist/types/components/ton-icon/ton-icon.d.ts +0 -14
- package/dist/types/components/ton-icon/ton-icon.d.ts.map +0 -1
- package/dist/types/hooks/use-app-kit-theme.d.ts.map +0 -1
- package/dist/types/hooks/use-app-kit.d.ts.map +0 -1
- package/dist/types/hooks/use-i18n.d.ts.map +0 -1
- package/src/components/button/button.tsx +0 -16
- package/src/components/circle-icon/circle-icon.tsx +0 -34
- package/src/components/ton-icon/ton-icon.tsx +0 -46
- /package/dist/esm/components/{block → ui/block}/block.js +0 -0
- /package/dist/esm/components/{block → ui/block}/index.js +0 -0
- /package/dist/esm/components/{button → ui/button}/index.js +0 -0
- /package/dist/esm/{hooks → features/settings/hooks}/use-app-kit-theme.js +0 -0
- /package/dist/types/components/{block → ui/block}/block.d.ts +0 -0
- /package/dist/types/components/{block → ui/block}/index.d.ts +0 -0
- /package/dist/types/{hooks → features/settings/hooks}/use-app-kit-theme.d.ts +0 -0
- /package/dist/types/{hooks → features/settings/hooks}/use-app-kit.d.ts +0 -0
- /package/src/components/{block → ui/block}/block.tsx +0 -0
- /package/src/components/{block → ui/block}/index.ts +0 -0
- /package/src/{hooks → features/settings/hooks}/use-app-kit-theme.ts +0 -0
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) TonTech.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { useMemo, useState } from 'react';
|
|
10
|
+
import type { ComponentProps, FC, ReactNode } from 'react';
|
|
11
|
+
import type { StakingQuoteDirection } from '@ton/appkit';
|
|
12
|
+
import clsx from 'clsx';
|
|
13
|
+
|
|
14
|
+
import { CenteredAmountInput } from '../../../../components/ui/centered-amount-input';
|
|
15
|
+
import { Tabs, TabsList, TabsTrigger, TabsContent } from '../../../../components/ui/tabs';
|
|
16
|
+
import { useI18n } from '../../../settings/hooks/use-i18n';
|
|
17
|
+
import { StakingBalanceBlock } from '../staking-balance-block';
|
|
18
|
+
import { StakingInfo } from '../staking-info';
|
|
19
|
+
import { SelectUnstakeMode } from '../select-unstake-mode';
|
|
20
|
+
import { StakingSettingsModal } from '../staking-settings-modal';
|
|
21
|
+
import styles from './staking-widget-ui.module.css';
|
|
22
|
+
import type { StakingContextType } from '../staking-widget-provider';
|
|
23
|
+
import { ButtonWithConnect } from '../../../../components/shared/button-with-connect';
|
|
24
|
+
import { AmountReversed } from '../../../../components/ui/amount-reversed';
|
|
25
|
+
import { LowBalanceModal } from '../../../../components/shared/low-balance-modal';
|
|
26
|
+
import { SettingsButton } from '../../../../components/shared/settings-button';
|
|
27
|
+
|
|
28
|
+
export type StakingWidgetRenderProps = StakingContextType & ComponentProps<'div'>;
|
|
29
|
+
|
|
30
|
+
export const StakingWidgetUI: FC<StakingWidgetRenderProps> = ({
|
|
31
|
+
amount,
|
|
32
|
+
canSubmit,
|
|
33
|
+
isQuoteLoading,
|
|
34
|
+
error,
|
|
35
|
+
providerInfo,
|
|
36
|
+
providerMetadata,
|
|
37
|
+
stakingProvider,
|
|
38
|
+
stakingProviders,
|
|
39
|
+
setStakingProviderId,
|
|
40
|
+
network,
|
|
41
|
+
isProviderInfoLoading,
|
|
42
|
+
setAmount,
|
|
43
|
+
direction,
|
|
44
|
+
quote,
|
|
45
|
+
sendTransaction,
|
|
46
|
+
isSendingTransaction,
|
|
47
|
+
unstakeMode,
|
|
48
|
+
setUnstakeMode,
|
|
49
|
+
stakedBalance,
|
|
50
|
+
isStakedBalanceLoading,
|
|
51
|
+
onChangeDirection,
|
|
52
|
+
isReversed,
|
|
53
|
+
toggleReversed,
|
|
54
|
+
reversedAmount,
|
|
55
|
+
onMaxClick,
|
|
56
|
+
balance,
|
|
57
|
+
isBalanceLoading,
|
|
58
|
+
isLowBalanceWarningOpen,
|
|
59
|
+
lowBalanceMode,
|
|
60
|
+
lowBalanceRequiredTon,
|
|
61
|
+
onLowBalanceChange,
|
|
62
|
+
onLowBalanceCancel,
|
|
63
|
+
className,
|
|
64
|
+
...props
|
|
65
|
+
}) => {
|
|
66
|
+
const { t } = useI18n();
|
|
67
|
+
|
|
68
|
+
const [isSettingsOpen, setIsSettingsOpen] = useState(false);
|
|
69
|
+
|
|
70
|
+
const receiveToken = providerMetadata?.receiveToken;
|
|
71
|
+
const stakeToken = providerMetadata?.stakeToken;
|
|
72
|
+
|
|
73
|
+
const buttonText = useMemo(() => {
|
|
74
|
+
if (error) return t(error);
|
|
75
|
+
return direction === 'stake' ? t('staking.continue') : t('staking.unstake');
|
|
76
|
+
}, [error, direction, t]);
|
|
77
|
+
|
|
78
|
+
const submitActions: ReactNode = (
|
|
79
|
+
<div className={styles.actions}>
|
|
80
|
+
<ButtonWithConnect
|
|
81
|
+
variant="fill"
|
|
82
|
+
size="l"
|
|
83
|
+
fullWidth
|
|
84
|
+
disabled={!canSubmit || isQuoteLoading || isSendingTransaction}
|
|
85
|
+
onClick={sendTransaction}
|
|
86
|
+
>
|
|
87
|
+
{buttonText}
|
|
88
|
+
</ButtonWithConnect>
|
|
89
|
+
<SettingsButton onClick={() => setIsSettingsOpen(true)} />
|
|
90
|
+
</div>
|
|
91
|
+
);
|
|
92
|
+
|
|
93
|
+
return (
|
|
94
|
+
<div className={clsx(styles.widget, className)} {...props}>
|
|
95
|
+
<Tabs defaultValue={direction} onValueChange={(value) => onChangeDirection(value as StakingQuoteDirection)}>
|
|
96
|
+
<TabsList>
|
|
97
|
+
<TabsTrigger value="stake">{t('staking.stake')}</TabsTrigger>
|
|
98
|
+
<TabsTrigger value="unstake">{t('staking.unstake')}</TabsTrigger>
|
|
99
|
+
</TabsList>
|
|
100
|
+
|
|
101
|
+
{/* ── STAKE TAB ── */}
|
|
102
|
+
<TabsContent className={styles.tab} value="stake">
|
|
103
|
+
<div className={styles.content}>
|
|
104
|
+
<div className={styles.inputSection}>
|
|
105
|
+
<CenteredAmountInput value={amount} onValueChange={setAmount} ticker={stakeToken?.ticker} />
|
|
106
|
+
{receiveToken && (
|
|
107
|
+
<AmountReversed
|
|
108
|
+
value={reversedAmount}
|
|
109
|
+
ticker={receiveToken.ticker}
|
|
110
|
+
decimals={receiveToken.decimals}
|
|
111
|
+
/>
|
|
112
|
+
)}
|
|
113
|
+
</div>
|
|
114
|
+
|
|
115
|
+
<StakingBalanceBlock
|
|
116
|
+
direction="stake"
|
|
117
|
+
providerMetadata={providerMetadata}
|
|
118
|
+
stakedBalance={stakedBalance?.stakedBalance}
|
|
119
|
+
isStakedBalanceLoading={isStakedBalanceLoading}
|
|
120
|
+
balance={balance}
|
|
121
|
+
isBalanceLoading={isBalanceLoading}
|
|
122
|
+
onMaxClick={onMaxClick}
|
|
123
|
+
/>
|
|
124
|
+
|
|
125
|
+
{submitActions}
|
|
126
|
+
</div>
|
|
127
|
+
</TabsContent>
|
|
128
|
+
|
|
129
|
+
{/* ── UNSTAKE TAB ── */}
|
|
130
|
+
<TabsContent className={styles.tab} value="unstake">
|
|
131
|
+
<div className={styles.content}>
|
|
132
|
+
<div className={styles.inputSection}>
|
|
133
|
+
<CenteredAmountInput
|
|
134
|
+
value={amount}
|
|
135
|
+
onValueChange={setAmount}
|
|
136
|
+
ticker={!isReversed && receiveToken ? receiveToken.ticker : stakeToken?.ticker}
|
|
137
|
+
/>
|
|
138
|
+
{receiveToken && (
|
|
139
|
+
<AmountReversed
|
|
140
|
+
value={reversedAmount}
|
|
141
|
+
ticker={isReversed ? receiveToken.ticker : (stakeToken?.ticker ?? '')}
|
|
142
|
+
decimals={isReversed ? receiveToken.decimals : stakeToken?.decimals}
|
|
143
|
+
onChangeDirection={
|
|
144
|
+
providerMetadata?.supportsReversedQuote ? toggleReversed : undefined
|
|
145
|
+
}
|
|
146
|
+
/>
|
|
147
|
+
)}
|
|
148
|
+
</div>
|
|
149
|
+
|
|
150
|
+
<StakingBalanceBlock
|
|
151
|
+
direction="unstake"
|
|
152
|
+
providerMetadata={providerMetadata}
|
|
153
|
+
stakedBalance={stakedBalance?.stakedBalance}
|
|
154
|
+
isStakedBalanceLoading={isStakedBalanceLoading}
|
|
155
|
+
balance={balance}
|
|
156
|
+
isBalanceLoading={isBalanceLoading}
|
|
157
|
+
onMaxClick={onMaxClick}
|
|
158
|
+
/>
|
|
159
|
+
|
|
160
|
+
{submitActions}
|
|
161
|
+
|
|
162
|
+
<SelectUnstakeMode
|
|
163
|
+
value={unstakeMode}
|
|
164
|
+
onValueChange={setUnstakeMode}
|
|
165
|
+
providerInfo={providerInfo}
|
|
166
|
+
providerMetadata={providerMetadata}
|
|
167
|
+
/>
|
|
168
|
+
</div>
|
|
169
|
+
</TabsContent>
|
|
170
|
+
|
|
171
|
+
<StakingInfo
|
|
172
|
+
quote={quote}
|
|
173
|
+
isQuoteLoading={isQuoteLoading}
|
|
174
|
+
providerInfo={providerInfo}
|
|
175
|
+
providerMetadata={providerMetadata}
|
|
176
|
+
isProviderInfoLoading={isProviderInfoLoading}
|
|
177
|
+
direction={direction}
|
|
178
|
+
/>
|
|
179
|
+
</Tabs>
|
|
180
|
+
|
|
181
|
+
<LowBalanceModal
|
|
182
|
+
open={isLowBalanceWarningOpen}
|
|
183
|
+
mode={lowBalanceMode}
|
|
184
|
+
requiredTon={lowBalanceRequiredTon}
|
|
185
|
+
onChange={onLowBalanceChange}
|
|
186
|
+
onCancel={onLowBalanceCancel}
|
|
187
|
+
/>
|
|
188
|
+
|
|
189
|
+
<StakingSettingsModal
|
|
190
|
+
open={isSettingsOpen}
|
|
191
|
+
onClose={() => setIsSettingsOpen(false)}
|
|
192
|
+
provider={stakingProvider}
|
|
193
|
+
providers={stakingProviders}
|
|
194
|
+
onProviderChange={setStakingProviderId}
|
|
195
|
+
network={network}
|
|
196
|
+
/>
|
|
197
|
+
</div>
|
|
198
|
+
);
|
|
199
|
+
};
|
|
@@ -14,7 +14,7 @@ import type {
|
|
|
14
14
|
BuildStakeTransactionVariables,
|
|
15
15
|
} from '@ton/appkit/queries';
|
|
16
16
|
|
|
17
|
-
import { useAppKit } from '
|
|
17
|
+
import { useAppKit } from '../../settings';
|
|
18
18
|
import { useMutation } from '../../../libs/query';
|
|
19
19
|
|
|
20
20
|
export type UseBuildStakeTransactionReturnType<context = unknown> = UseMutationResult<
|
|
@@ -9,9 +9,10 @@
|
|
|
9
9
|
import { getStakedBalanceQueryOptions } from '@ton/appkit/queries';
|
|
10
10
|
import type { GetStakedBalanceData, GetStakedBalanceErrorType, GetStakedBalanceQueryConfig } from '@ton/appkit/queries';
|
|
11
11
|
|
|
12
|
-
import { useAppKit } from '
|
|
12
|
+
import { useAppKit } from '../../settings';
|
|
13
13
|
import { useQuery } from '../../../libs/query';
|
|
14
14
|
import type { UseQueryReturnType } from '../../../libs/query';
|
|
15
|
+
import { useNetwork } from '../../network';
|
|
15
16
|
|
|
16
17
|
export type UseStakedBalanceParameters<selectData = GetStakedBalanceData> = GetStakedBalanceQueryConfig<selectData>;
|
|
17
18
|
export type UseStakedBalanceReturnType<selectData = GetStakedBalanceData> = UseQueryReturnType<
|
|
@@ -26,5 +27,9 @@ export const useStakedBalance = <selectData = GetStakedBalanceData>(
|
|
|
26
27
|
parameters: UseStakedBalanceParameters<selectData> = {},
|
|
27
28
|
): UseStakedBalanceReturnType<selectData> => {
|
|
28
29
|
const appKit = useAppKit();
|
|
29
|
-
|
|
30
|
+
const walletNetwork = useNetwork();
|
|
31
|
+
|
|
32
|
+
return useQuery(
|
|
33
|
+
getStakedBalanceQueryOptions(appKit, { ...parameters, network: parameters.network ?? walletNetwork }),
|
|
34
|
+
);
|
|
30
35
|
};
|
|
@@ -13,9 +13,11 @@ import type {
|
|
|
13
13
|
GetStakingProviderInfoQueryConfig,
|
|
14
14
|
} from '@ton/appkit/queries';
|
|
15
15
|
|
|
16
|
-
import { useAppKit } from '
|
|
16
|
+
import { useAppKit } from '../../settings';
|
|
17
17
|
import { useQuery } from '../../../libs/query';
|
|
18
18
|
import type { UseQueryReturnType } from '../../../libs/query';
|
|
19
|
+
import { useNetwork } from '../../network';
|
|
20
|
+
import { useStakingProvider } from './use-staking-provider';
|
|
19
21
|
|
|
20
22
|
export type UseStakingProviderInfoParameters<selectData = GetStakingProviderInfoData> =
|
|
21
23
|
GetStakingProviderInfoQueryConfig<selectData>;
|
|
@@ -31,5 +33,14 @@ export const useStakingProviderInfo = <selectData = GetStakingProviderInfoData>(
|
|
|
31
33
|
parameters: UseStakingProviderInfoParameters<selectData> = {},
|
|
32
34
|
): UseStakingProviderInfoReturnType<selectData> => {
|
|
33
35
|
const appKit = useAppKit();
|
|
34
|
-
|
|
36
|
+
const walletNetwork = useNetwork();
|
|
37
|
+
const provider = useStakingProvider({ id: parameters.providerId });
|
|
38
|
+
|
|
39
|
+
return useQuery(
|
|
40
|
+
getStakingProviderInfoQueryOptions(appKit, {
|
|
41
|
+
providerId: provider?.providerId,
|
|
42
|
+
...parameters,
|
|
43
|
+
network: parameters.network ?? walletNetwork,
|
|
44
|
+
}),
|
|
45
|
+
);
|
|
35
46
|
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) TonTech.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { getStakingProviderMetadata, resolveNetwork } from '@ton/appkit';
|
|
10
|
+
import type { GetStakingProviderMetadataOptions, GetStakingProviderMetadataReturnType } from '@ton/appkit';
|
|
11
|
+
import { useMemo } from 'react';
|
|
12
|
+
|
|
13
|
+
import { useAppKit } from '../../settings';
|
|
14
|
+
import { useStakingProvider } from './use-staking-provider';
|
|
15
|
+
|
|
16
|
+
export type UseStakingProviderMetadataParameters = GetStakingProviderMetadataOptions;
|
|
17
|
+
export type UseStakingProviderMetadataReturnType = GetStakingProviderMetadataReturnType;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Hook to get static staking provider metadata
|
|
21
|
+
*/
|
|
22
|
+
export const useStakingProviderMetadata = (parameters: UseStakingProviderMetadataParameters = {}) => {
|
|
23
|
+
const appKit = useAppKit();
|
|
24
|
+
const provider = useStakingProvider({ id: parameters.providerId });
|
|
25
|
+
const network = resolveNetwork(appKit, parameters.network);
|
|
26
|
+
|
|
27
|
+
return useMemo(() => {
|
|
28
|
+
try {
|
|
29
|
+
return getStakingProviderMetadata(appKit, { ...parameters, network });
|
|
30
|
+
} catch {
|
|
31
|
+
return undefined;
|
|
32
|
+
}
|
|
33
|
+
}, [appKit, network, parameters.providerId, provider?.providerId]);
|
|
34
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) TonTech.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { useSyncExternalStore, useCallback } from 'react';
|
|
10
|
+
import { getStakingProvider, watchStakingProviders } from '@ton/appkit';
|
|
11
|
+
import type { GetStakingProviderOptions, GetStakingProviderReturnType } from '@ton/appkit';
|
|
12
|
+
|
|
13
|
+
import { useAppKit } from '../../settings/hooks/use-app-kit';
|
|
14
|
+
|
|
15
|
+
export type UseStakingProviderReturnType = GetStakingProviderReturnType;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Hook to get staking provider
|
|
19
|
+
*/
|
|
20
|
+
export const useStakingProvider = (
|
|
21
|
+
options: GetStakingProviderOptions = {},
|
|
22
|
+
): UseStakingProviderReturnType | undefined => {
|
|
23
|
+
const appKit = useAppKit();
|
|
24
|
+
const { id } = options;
|
|
25
|
+
|
|
26
|
+
const subscribe = useCallback(
|
|
27
|
+
(onChange: () => void) => {
|
|
28
|
+
return watchStakingProviders(appKit, { onChange });
|
|
29
|
+
},
|
|
30
|
+
[appKit],
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
const getSnapshot = useCallback(() => {
|
|
34
|
+
try {
|
|
35
|
+
return getStakingProvider(appKit, { id });
|
|
36
|
+
} catch {
|
|
37
|
+
return undefined;
|
|
38
|
+
}
|
|
39
|
+
}, [appKit, id]);
|
|
40
|
+
|
|
41
|
+
return useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
|
|
42
|
+
};
|
|
@@ -6,30 +6,30 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
GetStakingProvidersErrorType,
|
|
13
|
-
GetStakingProvidersQueryConfig,
|
|
14
|
-
} from '@ton/appkit/queries';
|
|
9
|
+
import { useSyncExternalStore, useCallback } from 'react';
|
|
10
|
+
import { getStakingProviders, watchStakingProviders } from '@ton/appkit';
|
|
11
|
+
import type { GetStakingProvidersReturnType } from '@ton/appkit';
|
|
15
12
|
|
|
16
|
-
import { useAppKit } from '
|
|
17
|
-
import { useQuery } from '../../../libs/query';
|
|
18
|
-
import type { UseQueryReturnType } from '../../../libs/query';
|
|
13
|
+
import { useAppKit } from '../../settings';
|
|
19
14
|
|
|
20
|
-
export type
|
|
21
|
-
GetStakingProvidersQueryConfig<selectData>;
|
|
22
|
-
export type UseStakingProvidersReturnType<selectData = GetStakingProvidersData> = UseQueryReturnType<
|
|
23
|
-
selectData,
|
|
24
|
-
GetStakingProvidersErrorType
|
|
25
|
-
>;
|
|
15
|
+
export type UseStakingProvidersReturnType = GetStakingProvidersReturnType;
|
|
26
16
|
|
|
27
17
|
/**
|
|
28
|
-
* Hook to get
|
|
18
|
+
* Hook to get all registered staking providers.
|
|
29
19
|
*/
|
|
30
|
-
export const useStakingProviders =
|
|
31
|
-
parameters: UseStakingProvidersParameters<selectData> = {},
|
|
32
|
-
): UseStakingProvidersReturnType<selectData> => {
|
|
20
|
+
export const useStakingProviders = (): UseStakingProvidersReturnType => {
|
|
33
21
|
const appKit = useAppKit();
|
|
34
|
-
|
|
22
|
+
|
|
23
|
+
const subscribe = useCallback(
|
|
24
|
+
(onChange: () => void) => {
|
|
25
|
+
return watchStakingProviders(appKit, { onChange });
|
|
26
|
+
},
|
|
27
|
+
[appKit],
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
const getSnapshot = useCallback(() => {
|
|
31
|
+
return getStakingProviders(appKit);
|
|
32
|
+
}, [appKit]);
|
|
33
|
+
|
|
34
|
+
return useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
|
|
35
35
|
};
|
|
@@ -9,9 +9,10 @@
|
|
|
9
9
|
import { getStakingQuoteQueryOptions } from '@ton/appkit/queries';
|
|
10
10
|
import type { GetStakingQuoteData, GetStakingQuoteErrorType, GetStakingQuoteQueryConfig } from '@ton/appkit/queries';
|
|
11
11
|
|
|
12
|
-
import { useAppKit } from '
|
|
12
|
+
import { useAppKit } from '../../settings';
|
|
13
13
|
import { useQuery } from '../../../libs/query';
|
|
14
14
|
import type { UseQueryReturnType } from '../../../libs/query';
|
|
15
|
+
import { useNetwork } from '../../network';
|
|
15
16
|
|
|
16
17
|
export type UseStakingQuoteParameters<selectData = GetStakingQuoteData> = GetStakingQuoteQueryConfig<selectData>;
|
|
17
18
|
export type UseStakingQuoteReturnType<selectData = GetStakingQuoteData> = UseQueryReturnType<
|
|
@@ -26,5 +27,9 @@ export const useStakingQuote = <selectData = GetStakingQuoteData>(
|
|
|
26
27
|
parameters: UseStakingQuoteParameters<selectData> = {},
|
|
27
28
|
): UseStakingQuoteReturnType<selectData> => {
|
|
28
29
|
const appKit = useAppKit();
|
|
29
|
-
|
|
30
|
+
const walletNetwork = useNetwork();
|
|
31
|
+
|
|
32
|
+
return useQuery(
|
|
33
|
+
getStakingQuoteQueryOptions(appKit, { ...parameters, network: parameters.network ?? walletNetwork }),
|
|
34
|
+
);
|
|
30
35
|
};
|
|
@@ -8,11 +8,8 @@
|
|
|
8
8
|
|
|
9
9
|
export { UnstakeMode, type UnstakeModes } from '@ton/appkit';
|
|
10
10
|
|
|
11
|
-
export {
|
|
12
|
-
|
|
13
|
-
type UseStakingProvidersParameters,
|
|
14
|
-
type UseStakingProvidersReturnType,
|
|
15
|
-
} from './hooks/use-staking-providers';
|
|
11
|
+
export { useStakingProviders, type UseStakingProvidersReturnType } from './hooks/use-staking-providers';
|
|
12
|
+
export { useStakingProvider, type UseStakingProviderReturnType } from './hooks/use-staking-provider';
|
|
16
13
|
export {
|
|
17
14
|
useStakingQuote,
|
|
18
15
|
type UseStakingQuoteParameters,
|
|
@@ -28,4 +25,17 @@ export {
|
|
|
28
25
|
type UseStakingProviderInfoParameters,
|
|
29
26
|
type UseStakingProviderInfoReturnType,
|
|
30
27
|
} from './hooks/use-staking-provider-info';
|
|
28
|
+
export {
|
|
29
|
+
useStakingProviderMetadata,
|
|
30
|
+
type UseStakingProviderMetadataParameters,
|
|
31
|
+
type UseStakingProviderMetadataReturnType,
|
|
32
|
+
} from './hooks/use-staking-provider-metadata';
|
|
31
33
|
export { useBuildStakeTransaction, type UseBuildStakeTransactionReturnType } from './hooks/use-build-stake-transaction';
|
|
34
|
+
|
|
35
|
+
export * from './components/staking-widget';
|
|
36
|
+
export * from './components/staking-widget-ui';
|
|
37
|
+
export * from './components/staking-widget-provider';
|
|
38
|
+
export * from './components/staking-balance-block';
|
|
39
|
+
export * from './components/staking-info';
|
|
40
|
+
export * from './components/select-unstake-mode';
|
|
41
|
+
export * from './components/staking-settings-modal';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) TonTech.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { StakingError, StakingErrorCode } from '@ton/appkit';
|
|
10
|
+
|
|
11
|
+
import { mapDefiError } from '../../../utils/map-defi-error';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Map a thrown staking error to an i18n key. Tries staking-specific codes first, falls back to the
|
|
15
|
+
* shared {@link mapDefiError} for base DeFi codes, and finally to a generic `staking.quoteError`.
|
|
16
|
+
*/
|
|
17
|
+
export const mapStakingError = (error: unknown): string => {
|
|
18
|
+
if (error instanceof StakingError) {
|
|
19
|
+
switch (error.code) {
|
|
20
|
+
case StakingErrorCode.InvalidParams:
|
|
21
|
+
return 'staking.invalidParams';
|
|
22
|
+
case StakingErrorCode.UnsupportedOperation:
|
|
23
|
+
return 'staking.unsupportedOperation';
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return mapDefiError(error) ?? 'staking.quoteError';
|
|
28
|
+
};
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) TonTech.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import type { FC, ComponentProps } from 'react';
|
|
10
|
+
import { calcFiatValue, formatLargeValue } from '@ton/appkit';
|
|
11
|
+
import clsx from 'clsx';
|
|
12
|
+
|
|
13
|
+
import { useI18n } from '../../../settings/hooks/use-i18n';
|
|
14
|
+
import { Input } from '../../../../components/ui/input/input';
|
|
15
|
+
import { Skeleton } from '../../../../components/ui/skeleton';
|
|
16
|
+
import { TokenSelector } from '../token-selector/token-selector';
|
|
17
|
+
import type { AppkitUIToken } from '../../../../types/appkit-ui-token';
|
|
18
|
+
import { getDisplayAmount } from '../../utils/get-display-amount';
|
|
19
|
+
import styles from './swap-field.module.css';
|
|
20
|
+
|
|
21
|
+
export interface SwapFieldProps extends Omit<ComponentProps<typeof Input.Container>, 'children'> {
|
|
22
|
+
type: 'pay' | 'receive';
|
|
23
|
+
amount: string;
|
|
24
|
+
token?: AppkitUIToken;
|
|
25
|
+
onAmountChange?: (value: string) => void;
|
|
26
|
+
balance?: string;
|
|
27
|
+
isBalanceLoading?: boolean;
|
|
28
|
+
loading?: boolean;
|
|
29
|
+
onMaxClick?: () => void;
|
|
30
|
+
onTokenSelectorClick?: () => void;
|
|
31
|
+
isWalletConnected?: boolean;
|
|
32
|
+
fiatSymbol?: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export const SwapField: FC<SwapFieldProps> = ({
|
|
36
|
+
type,
|
|
37
|
+
token,
|
|
38
|
+
amount,
|
|
39
|
+
onAmountChange,
|
|
40
|
+
balance,
|
|
41
|
+
isBalanceLoading,
|
|
42
|
+
loading,
|
|
43
|
+
onMaxClick,
|
|
44
|
+
onTokenSelectorClick,
|
|
45
|
+
isWalletConnected,
|
|
46
|
+
fiatSymbol = '$',
|
|
47
|
+
className,
|
|
48
|
+
...props
|
|
49
|
+
}) => {
|
|
50
|
+
const { t } = useI18n();
|
|
51
|
+
|
|
52
|
+
const tokenSymbol = token?.symbol;
|
|
53
|
+
const displayBalance = getDisplayAmount(balance, token?.decimals);
|
|
54
|
+
|
|
55
|
+
return (
|
|
56
|
+
<Input.Container
|
|
57
|
+
className={clsx(styles.container, className)}
|
|
58
|
+
size="l"
|
|
59
|
+
variant="unstyled"
|
|
60
|
+
loading={loading}
|
|
61
|
+
resizable
|
|
62
|
+
{...props}
|
|
63
|
+
>
|
|
64
|
+
<Input.Header className={styles.header}>
|
|
65
|
+
<Input.Title className={styles.title}>{type === 'pay' ? t('swap.pay') : t('swap.receive')}</Input.Title>
|
|
66
|
+
</Input.Header>
|
|
67
|
+
|
|
68
|
+
<Input.Field className={styles.field}>
|
|
69
|
+
<Input.Input
|
|
70
|
+
placeholder="0"
|
|
71
|
+
value={amount}
|
|
72
|
+
onChange={onAmountChange && ((e) => onAmountChange(e.target.value))}
|
|
73
|
+
disabled={type === 'receive'}
|
|
74
|
+
/>
|
|
75
|
+
<Input.Slot side="right">
|
|
76
|
+
<TokenSelector symbol={tokenSymbol} icon={token?.logo} onClick={onTokenSelectorClick} />
|
|
77
|
+
</Input.Slot>
|
|
78
|
+
</Input.Field>
|
|
79
|
+
|
|
80
|
+
<Input.Caption className={styles.caption}>
|
|
81
|
+
<div className={styles.balanceLine}>
|
|
82
|
+
<span>
|
|
83
|
+
{token?.rate &&
|
|
84
|
+
`${fiatSymbol} ${formatLargeValue(calcFiatValue(amount || '0', token.rate), 2, 2)}`}
|
|
85
|
+
</span>
|
|
86
|
+
{type === 'pay' && token && (
|
|
87
|
+
<span className={styles.balanceWrapper}>
|
|
88
|
+
{isBalanceLoading ? (
|
|
89
|
+
<Skeleton className={styles.skeletonText} />
|
|
90
|
+
) : (
|
|
91
|
+
<>
|
|
92
|
+
<button className={styles.maxButton} onClick={onMaxClick} type="button">
|
|
93
|
+
<span className={styles.max}>{t('swap.max')}</span> {displayBalance}{' '}
|
|
94
|
+
{tokenSymbol}
|
|
95
|
+
</button>
|
|
96
|
+
</>
|
|
97
|
+
)}
|
|
98
|
+
</span>
|
|
99
|
+
)}
|
|
100
|
+
|
|
101
|
+
{type === 'receive' && token && (
|
|
102
|
+
<span className={styles.balanceWrapper}>
|
|
103
|
+
{isBalanceLoading ? (
|
|
104
|
+
<Skeleton className={styles.skeletonText} />
|
|
105
|
+
) : (
|
|
106
|
+
`${displayBalance} ${tokenSymbol}`
|
|
107
|
+
)}
|
|
108
|
+
</span>
|
|
109
|
+
)}
|
|
110
|
+
</div>
|
|
111
|
+
</Input.Caption>
|
|
112
|
+
</Input.Container>
|
|
113
|
+
);
|
|
114
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) TonTech.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import type { ComponentProps, FC } from 'react';
|
|
10
|
+
import clsx from 'clsx';
|
|
11
|
+
|
|
12
|
+
import styles from './swap-flip-button.module.css';
|
|
13
|
+
import { Button } from '../../../../components/ui/button';
|
|
14
|
+
import { FlipIcon } from '../../../../components/ui/icons';
|
|
15
|
+
|
|
16
|
+
export interface SwapFlipButtonProps extends ComponentProps<'div'> {
|
|
17
|
+
onClick?: () => void;
|
|
18
|
+
rotated?: boolean;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const SwapFlipButton: FC<SwapFlipButtonProps> = ({ onClick, rotated, className, ...props }) => {
|
|
22
|
+
return (
|
|
23
|
+
<div className={clsx(styles.container, className)} {...props}>
|
|
24
|
+
<Button className={clsx(styles.flipButton, rotated && styles.rotated)} onClick={onClick}>
|
|
25
|
+
<FlipIcon />
|
|
26
|
+
</Button>
|
|
27
|
+
</div>
|
|
28
|
+
);
|
|
29
|
+
};
|