@ton/appkit-react 0.0.6-alpha.2 → 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,48 @@
|
|
|
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 type { SwapQuote, SwapProvider } from '@ton/appkit';
|
|
11
|
+
|
|
12
|
+
import { InfoBlock } from '../../../../components/ui/info-block';
|
|
13
|
+
import { useI18n } from '../../../settings/hooks/use-i18n';
|
|
14
|
+
import type { AppkitUIToken } from '../../../../types/appkit-ui-token';
|
|
15
|
+
import { getDisplayAmount } from '../../utils/get-display-amount';
|
|
16
|
+
|
|
17
|
+
export interface SwapInfoProps extends ComponentProps<typeof InfoBlock.Container> {
|
|
18
|
+
toToken: AppkitUIToken | null;
|
|
19
|
+
slippage: number;
|
|
20
|
+
provider?: SwapProvider;
|
|
21
|
+
quote?: SwapQuote;
|
|
22
|
+
isQuoteLoading?: boolean;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export const SwapInfo: FC<SwapInfoProps> = ({ quote, provider, toToken, slippage, isQuoteLoading, ...props }) => {
|
|
26
|
+
const { t } = useI18n();
|
|
27
|
+
|
|
28
|
+
const minReceived = `${getDisplayAmount(quote?.minReceived, toToken?.decimals)} ${toToken?.symbol || ''}`;
|
|
29
|
+
const providerName = provider?.getMetadata().name;
|
|
30
|
+
const slippagePercent = `${(slippage / 100).toFixed(2)}%`;
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<InfoBlock.Container {...props}>
|
|
34
|
+
<InfoBlock.Row>
|
|
35
|
+
<InfoBlock.Label>{t('swap.minReceived')}</InfoBlock.Label>
|
|
36
|
+
{isQuoteLoading ? <InfoBlock.ValueSkeleton /> : <InfoBlock.Value>{minReceived}</InfoBlock.Value>}
|
|
37
|
+
</InfoBlock.Row>
|
|
38
|
+
<InfoBlock.Row>
|
|
39
|
+
<InfoBlock.Label>{t('swap.slippage')}</InfoBlock.Label>
|
|
40
|
+
<InfoBlock.Value>{slippagePercent}</InfoBlock.Value>
|
|
41
|
+
</InfoBlock.Row>
|
|
42
|
+
<InfoBlock.Row>
|
|
43
|
+
<InfoBlock.Label>{t('swap.provider')}</InfoBlock.Label>
|
|
44
|
+
{providerName ? <InfoBlock.Value>{providerName}</InfoBlock.Value> : <InfoBlock.ValueSkeleton />}
|
|
45
|
+
</InfoBlock.Row>
|
|
46
|
+
</InfoBlock.Container>
|
|
47
|
+
);
|
|
48
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
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
|
+
export { SwapSettingsModal } from './swap-settings-modal';
|
|
10
|
+
export type { SwapSettingsModalProps } from './swap-settings-modal';
|
|
@@ -0,0 +1,92 @@
|
|
|
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 { useEffect, useMemo, useState } from 'react';
|
|
10
|
+
import type { FC } from 'react';
|
|
11
|
+
import type { SwapProvider } from '@ton/appkit';
|
|
12
|
+
|
|
13
|
+
import { Modal } from '../../../../components/ui/modal/modal';
|
|
14
|
+
import { Button } from '../../../../components/ui/button';
|
|
15
|
+
import { OptionSwitcher } from '../../../../components/shared/option-switcher';
|
|
16
|
+
import { useI18n } from '../../../settings/hooks/use-i18n';
|
|
17
|
+
import styles from './swap-settings-modal.module.css';
|
|
18
|
+
|
|
19
|
+
/** Preset slippage values in basis points */
|
|
20
|
+
const SLIPPAGE_PRESETS = [50, 100, 200] as const;
|
|
21
|
+
|
|
22
|
+
const formatSlippage = (bps: number): string => `${(bps / 100).toFixed(2)}%`;
|
|
23
|
+
|
|
24
|
+
const SLIPPAGE_OPTIONS = SLIPPAGE_PRESETS.map((bps) => ({ value: String(bps), label: formatSlippage(bps) }));
|
|
25
|
+
|
|
26
|
+
export interface SwapSettingsModalProps {
|
|
27
|
+
open: boolean;
|
|
28
|
+
onClose: () => void;
|
|
29
|
+
slippage: number;
|
|
30
|
+
onSlippageChange: (bps: number) => void;
|
|
31
|
+
provider: SwapProvider | undefined;
|
|
32
|
+
providers: SwapProvider[];
|
|
33
|
+
onProviderChange: (providerId: string) => void;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export const SwapSettingsModal: FC<SwapSettingsModalProps> = ({
|
|
37
|
+
open,
|
|
38
|
+
onClose,
|
|
39
|
+
slippage,
|
|
40
|
+
onSlippageChange,
|
|
41
|
+
provider,
|
|
42
|
+
providers,
|
|
43
|
+
onProviderChange,
|
|
44
|
+
}) => {
|
|
45
|
+
const { t } = useI18n();
|
|
46
|
+
|
|
47
|
+
const [stagedProviderId, setStagedProviderId] = useState<string | undefined>(provider?.providerId);
|
|
48
|
+
const [stagedSlippage, setStagedSlippage] = useState(slippage);
|
|
49
|
+
|
|
50
|
+
// Reset the staged values each time the modal reopens so values from an abandoned
|
|
51
|
+
// session don't leak into the next one.
|
|
52
|
+
useEffect(() => {
|
|
53
|
+
if (open) {
|
|
54
|
+
setStagedProviderId(provider?.providerId);
|
|
55
|
+
setStagedSlippage(slippage);
|
|
56
|
+
}
|
|
57
|
+
}, [open, provider?.providerId, slippage]);
|
|
58
|
+
|
|
59
|
+
const providerOptions = useMemo(
|
|
60
|
+
() => providers.map((p) => ({ value: p.providerId, label: p.getMetadata().name })),
|
|
61
|
+
[providers],
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
const handleSave = () => {
|
|
65
|
+
if (stagedSlippage !== slippage) onSlippageChange(stagedSlippage);
|
|
66
|
+
if (stagedProviderId && stagedProviderId !== provider?.providerId) onProviderChange(stagedProviderId);
|
|
67
|
+
onClose();
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
return (
|
|
71
|
+
<Modal open={open} onOpenChange={(isOpen) => !isOpen && onClose()} title={t('swap.settings')}>
|
|
72
|
+
<div className={styles.rows}>
|
|
73
|
+
<div className={styles.row}>
|
|
74
|
+
<span className={styles.label}>{t('swap.provider')}</span>
|
|
75
|
+
<OptionSwitcher value={stagedProviderId} options={providerOptions} onChange={setStagedProviderId} />
|
|
76
|
+
</div>
|
|
77
|
+
<div className={styles.row}>
|
|
78
|
+
<span className={styles.label}>{t('swap.slippage')}</span>
|
|
79
|
+
<OptionSwitcher
|
|
80
|
+
value={String(stagedSlippage)}
|
|
81
|
+
options={SLIPPAGE_OPTIONS}
|
|
82
|
+
onChange={(v) => setStagedSlippage(Number(v))}
|
|
83
|
+
/>
|
|
84
|
+
</div>
|
|
85
|
+
</div>
|
|
86
|
+
|
|
87
|
+
<Button className={styles.saveButton} variant="fill" size="l" fullWidth onClick={handleSave}>
|
|
88
|
+
{t('swap.save')}
|
|
89
|
+
</Button>
|
|
90
|
+
</Modal>
|
|
91
|
+
);
|
|
92
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
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
|
+
export { SwapTokenSelectModal } from './swap-token-select-modal';
|
|
10
|
+
export type { SwapTokenSelectModalProps } from './swap-token-select-modal';
|
|
@@ -0,0 +1,21 @@
|
|
|
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 } from 'react';
|
|
10
|
+
|
|
11
|
+
import { TokenSelectModal } from '../../../../components/shared/token-select-modal';
|
|
12
|
+
import type { TokenSelectModalProps } from '../../../../components/shared/token-select-modal';
|
|
13
|
+
import { useI18n } from '../../../settings/hooks/use-i18n';
|
|
14
|
+
|
|
15
|
+
export type SwapTokenSelectModalProps = Omit<TokenSelectModalProps, 'title' | 'searchPlaceholder'>;
|
|
16
|
+
|
|
17
|
+
export const SwapTokenSelectModal: FC<SwapTokenSelectModalProps> = (props) => {
|
|
18
|
+
const { t } = useI18n();
|
|
19
|
+
|
|
20
|
+
return <TokenSelectModal {...props} title={t('swap.selectToken')} searchPlaceholder={t('swap.searchToken')} />;
|
|
21
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
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, ReactNode, ComponentProps } from 'react';
|
|
10
|
+
|
|
11
|
+
import type { SwapWidgetRenderProps } from '../swap-widget-ui';
|
|
12
|
+
import { SwapWidgetUI } from '../swap-widget-ui';
|
|
13
|
+
import { SwapWidgetProvider, useSwapContext } from '../swap-widget-provider';
|
|
14
|
+
import type { SwapProviderProps } from '../swap-widget-provider';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Props for the SwapWidget component.
|
|
18
|
+
* Inherits all configuration from SwapProviderProps.
|
|
19
|
+
*/
|
|
20
|
+
export interface SwapWidgetProps extends Omit<SwapProviderProps, 'children'>, Omit<ComponentProps<'div'>, 'children'> {
|
|
21
|
+
/**
|
|
22
|
+
* Custom render function.
|
|
23
|
+
* When provided, it replaces the default widget UI and gives full control over the rendering.
|
|
24
|
+
* Accesses all state and actions from the swap context.
|
|
25
|
+
*/
|
|
26
|
+
children?: (props: SwapWidgetRenderProps) => ReactNode;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const SwapWidgetContent: FC<
|
|
30
|
+
{ children?: (props: SwapWidgetRenderProps) => ReactNode } & Omit<ComponentProps<'div'>, 'children'>
|
|
31
|
+
> = ({ children, ...rest }) => {
|
|
32
|
+
const ctx = useSwapContext();
|
|
33
|
+
|
|
34
|
+
if (children) {
|
|
35
|
+
return <>{children({ ...ctx, ...rest })}</>;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return <SwapWidgetUI {...ctx} {...rest} />;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* A high-level component that provides a complete swap interface.
|
|
43
|
+
*
|
|
44
|
+
* It manages the token selection, quote fetching, and transaction building
|
|
45
|
+
* for swaps between TON and Jettons. It can be used as a standalone widget
|
|
46
|
+
* with default UI or customized using a render function.
|
|
47
|
+
*/
|
|
48
|
+
export const SwapWidget: FC<SwapWidgetProps> = ({
|
|
49
|
+
children,
|
|
50
|
+
tokens,
|
|
51
|
+
network,
|
|
52
|
+
fiatSymbol,
|
|
53
|
+
defaultFromSymbol,
|
|
54
|
+
defaultToSymbol,
|
|
55
|
+
defaultSlippage,
|
|
56
|
+
...rest
|
|
57
|
+
}) => {
|
|
58
|
+
return (
|
|
59
|
+
<SwapWidgetProvider
|
|
60
|
+
tokens={tokens}
|
|
61
|
+
network={network}
|
|
62
|
+
fiatSymbol={fiatSymbol}
|
|
63
|
+
defaultFromSymbol={defaultFromSymbol}
|
|
64
|
+
defaultToSymbol={defaultToSymbol}
|
|
65
|
+
defaultSlippage={defaultSlippage}
|
|
66
|
+
>
|
|
67
|
+
<SwapWidgetContent {...rest}>{children}</SwapWidgetContent>
|
|
68
|
+
</SwapWidgetProvider>
|
|
69
|
+
);
|
|
70
|
+
};
|
|
@@ -0,0 +1,379 @@
|
|
|
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 { createContext, useCallback, useContext, useMemo, useState } from 'react';
|
|
10
|
+
import type { FC, PropsWithChildren } from 'react';
|
|
11
|
+
import { formatUnits } from '@ton/appkit';
|
|
12
|
+
import type { Network } from '@ton/appkit';
|
|
13
|
+
import type { GetSwapQuoteData } from '@ton/appkit/queries';
|
|
14
|
+
import type { SwapProvider } from '@ton/appkit';
|
|
15
|
+
import { getTonShortfall } from '@ton/appkit';
|
|
16
|
+
import type { TonShortfall } from '@ton/appkit';
|
|
17
|
+
import { calcMaxSpendable } from '@ton/appkit';
|
|
18
|
+
|
|
19
|
+
import { useSwapQuote } from '../../hooks/use-swap-quote';
|
|
20
|
+
import { useSwapProvider } from '../../hooks/use-swap-provider';
|
|
21
|
+
import { useSwapProviders } from '../../hooks/use-swap-providers';
|
|
22
|
+
import { useBuildSwapTransaction } from '../../hooks/use-build-swap-transaction';
|
|
23
|
+
import { useAddress } from '../../../wallets';
|
|
24
|
+
import { useBalance } from '../../../balances/hooks/use-balance';
|
|
25
|
+
import { useNetwork } from '../../../network';
|
|
26
|
+
import { useSendTransaction } from '../../../transaction/hooks/use-send-transaction';
|
|
27
|
+
import { useDebounceValue } from '../../../../hooks/use-debounce-value';
|
|
28
|
+
import type { AppkitUIToken } from '../../../../types/appkit-ui-token';
|
|
29
|
+
import { mapSwapWidgetTokens } from '../../utils/map-swap-widget-tokens';
|
|
30
|
+
import { useSwapTokenState } from './use-swap-token-state';
|
|
31
|
+
import { useSwapBalances } from './use-swap-balances';
|
|
32
|
+
import { useSwapValidation } from './use-swap-validation';
|
|
33
|
+
|
|
34
|
+
export type { AppkitUIToken };
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Context type for the SwapWidget.
|
|
38
|
+
* Provides all necessary state and actions for building custom swap UIs.
|
|
39
|
+
*/
|
|
40
|
+
export interface SwapContextType {
|
|
41
|
+
/** Full list of available tokens for swapping */
|
|
42
|
+
tokens: AppkitUIToken[];
|
|
43
|
+
/** Currently selected source token */
|
|
44
|
+
fromToken: AppkitUIToken | null;
|
|
45
|
+
/** Currently selected target token */
|
|
46
|
+
toToken: AppkitUIToken | null;
|
|
47
|
+
/** Amount the user wants to swap (string to preserve input UX) */
|
|
48
|
+
fromAmount: string;
|
|
49
|
+
/** Calculated receive amount from the current quote */
|
|
50
|
+
toAmount: string;
|
|
51
|
+
/** Fiat currency symbol for price display, e.g. "$" */
|
|
52
|
+
fiatSymbol: string;
|
|
53
|
+
/** User's balance of the "from" token */
|
|
54
|
+
fromBalance: string | undefined;
|
|
55
|
+
/** User's balance of the "to" token */
|
|
56
|
+
toBalance: string | undefined;
|
|
57
|
+
/** True while the "from" balance is being fetched */
|
|
58
|
+
isFromBalanceLoading: boolean;
|
|
59
|
+
/** True while the "to" balance is being fetched */
|
|
60
|
+
isToBalanceLoading: boolean;
|
|
61
|
+
/** Whether the user can proceed with the swap (checks balance, amount, quote) */
|
|
62
|
+
canSubmit: boolean;
|
|
63
|
+
/** Raw swap quote from the provider */
|
|
64
|
+
quote: GetSwapQuoteData | undefined;
|
|
65
|
+
/** True while the quote is being fetched from the API */
|
|
66
|
+
isQuoteLoading: boolean;
|
|
67
|
+
/** Current validation or fetch error, null when everything is ok */
|
|
68
|
+
error: string | null;
|
|
69
|
+
/** Slippage tolerance in basis points (100 = 1%) */
|
|
70
|
+
slippage: number;
|
|
71
|
+
/** Currently selected swap provider (defaults to the first registered one) */
|
|
72
|
+
swapProvider: SwapProvider | undefined;
|
|
73
|
+
/** All registered swap providers */
|
|
74
|
+
swapProviders: SwapProvider[];
|
|
75
|
+
/** Updates the selected swap provider */
|
|
76
|
+
setSwapProviderId: (providerId: string) => void;
|
|
77
|
+
/** Updates the source token */
|
|
78
|
+
setFromToken: (token: AppkitUIToken) => void;
|
|
79
|
+
/** Updates the target token */
|
|
80
|
+
setToToken: (token: AppkitUIToken) => void;
|
|
81
|
+
/** Updates the swap amount */
|
|
82
|
+
setFromAmount: (amount: string) => void;
|
|
83
|
+
/** Updates the slippage tolerance */
|
|
84
|
+
setSlippage: (slippage: number) => void;
|
|
85
|
+
/** Swaps source and target tokens */
|
|
86
|
+
onFlip: () => void;
|
|
87
|
+
/** Sets the "from" amount to the maximum available balance */
|
|
88
|
+
onMaxClick: () => void;
|
|
89
|
+
/** Executes the swap transaction */
|
|
90
|
+
sendSwapTransaction: () => Promise<void>;
|
|
91
|
+
/** True while a transaction is being built or sent */
|
|
92
|
+
isSendingTransaction: boolean;
|
|
93
|
+
/** True when the built transaction outflow exceeds the user's TON balance */
|
|
94
|
+
isLowBalanceWarningOpen: boolean;
|
|
95
|
+
/** `reduce` when the outgoing token is TON (user can fix by changing amount), `topup` otherwise. */
|
|
96
|
+
lowBalanceMode: 'reduce' | 'topup';
|
|
97
|
+
/** Required TON amount for the pending operation, formatted as a decimal string. Empty when no pending op. */
|
|
98
|
+
lowBalanceRequiredTon: string;
|
|
99
|
+
/** Replace the input with a value that fits into the current TON balance and close the warning */
|
|
100
|
+
onLowBalanceChange: () => void;
|
|
101
|
+
/** Dismiss the low-balance warning without changing the input */
|
|
102
|
+
onLowBalanceCancel: () => void;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export const SwapContext = createContext<SwapContextType>({
|
|
106
|
+
tokens: [],
|
|
107
|
+
fromToken: null,
|
|
108
|
+
toToken: null,
|
|
109
|
+
fromAmount: '',
|
|
110
|
+
toAmount: '',
|
|
111
|
+
fiatSymbol: '$',
|
|
112
|
+
fromBalance: undefined,
|
|
113
|
+
toBalance: undefined,
|
|
114
|
+
isFromBalanceLoading: false,
|
|
115
|
+
isToBalanceLoading: false,
|
|
116
|
+
canSubmit: false,
|
|
117
|
+
quote: undefined,
|
|
118
|
+
isQuoteLoading: false,
|
|
119
|
+
error: null,
|
|
120
|
+
slippage: 50,
|
|
121
|
+
swapProvider: undefined,
|
|
122
|
+
swapProviders: [],
|
|
123
|
+
setSwapProviderId: () => {},
|
|
124
|
+
setFromToken: () => {},
|
|
125
|
+
setToToken: () => {},
|
|
126
|
+
setFromAmount: () => {},
|
|
127
|
+
setSlippage: () => {},
|
|
128
|
+
onFlip: () => {},
|
|
129
|
+
onMaxClick: () => {},
|
|
130
|
+
sendSwapTransaction: () => Promise.resolve(),
|
|
131
|
+
isSendingTransaction: false,
|
|
132
|
+
isLowBalanceWarningOpen: false,
|
|
133
|
+
lowBalanceMode: 'reduce',
|
|
134
|
+
lowBalanceRequiredTon: '',
|
|
135
|
+
onLowBalanceChange: () => {},
|
|
136
|
+
onLowBalanceCancel: () => {},
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Hook to access the swap context.
|
|
141
|
+
* Must be used within a SwapWidgetProvider (or SwapWidget).
|
|
142
|
+
*/
|
|
143
|
+
export function useSwapContext() {
|
|
144
|
+
return useContext(SwapContext);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Props for the SwapWidgetProvider.
|
|
149
|
+
*/
|
|
150
|
+
export interface SwapProviderProps extends PropsWithChildren {
|
|
151
|
+
/** Full list of tokens available for swapping in the UI */
|
|
152
|
+
tokens: AppkitUIToken[];
|
|
153
|
+
/** Network to use for quote fetching. When omitted, uses the selected wallet's network. */
|
|
154
|
+
network?: Network;
|
|
155
|
+
/** Fiat currency symbol for price display, defaults to "$" */
|
|
156
|
+
fiatSymbol?: string;
|
|
157
|
+
/** Ticker of the token pre-selected for the source */
|
|
158
|
+
defaultFromSymbol?: string;
|
|
159
|
+
/** Ticker of the token pre-selected for the target */
|
|
160
|
+
defaultToSymbol?: string;
|
|
161
|
+
/** Initial slippage in basis points (100 = 1%), defaults to 100 (1%) */
|
|
162
|
+
defaultSlippage?: number;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export const SwapWidgetProvider: FC<SwapProviderProps> = ({
|
|
166
|
+
children,
|
|
167
|
+
tokens,
|
|
168
|
+
network: networkProp,
|
|
169
|
+
fiatSymbol = '$',
|
|
170
|
+
defaultFromSymbol,
|
|
171
|
+
defaultToSymbol,
|
|
172
|
+
defaultSlippage = 100,
|
|
173
|
+
}) => {
|
|
174
|
+
// Input prep — derived from props, consumed by local-state hooks below.
|
|
175
|
+
const mappedTokens = useMemo(() => mapSwapWidgetTokens(tokens), [tokens]);
|
|
176
|
+
|
|
177
|
+
// 2. Queries and external readers (hoisted: `network` gates token filtering for local state below)
|
|
178
|
+
const walletNetwork = useNetwork();
|
|
179
|
+
const network = networkProp ?? walletNetwork;
|
|
180
|
+
|
|
181
|
+
const networkFilteredTokens = useMemo(
|
|
182
|
+
() => (network ? mappedTokens.filter((t) => t.network.chainId === network.chainId) : mappedTokens),
|
|
183
|
+
[mappedTokens, network],
|
|
184
|
+
);
|
|
185
|
+
|
|
186
|
+
// 1. Local state
|
|
187
|
+
const { fromToken, toToken, fromAmount, setFromToken, setToToken, setFromAmount, onFlip } = useSwapTokenState({
|
|
188
|
+
mappedTokens: networkFilteredTokens,
|
|
189
|
+
defaultFromSymbol,
|
|
190
|
+
defaultToSymbol,
|
|
191
|
+
});
|
|
192
|
+
const [slippage, setSlippage] = useState(defaultSlippage);
|
|
193
|
+
const [fromAmountDebounced] = useDebounceValue(fromAmount, 500);
|
|
194
|
+
const [pendingSwap, setPendingSwap] = useState<TonShortfall | undefined>(undefined);
|
|
195
|
+
const address = useAddress();
|
|
196
|
+
const [swapProvider, setSwapProviderId] = useSwapProvider();
|
|
197
|
+
const swapProviders = useSwapProviders();
|
|
198
|
+
|
|
199
|
+
// Stabilized query inputs — kept next to the query that consumes them.
|
|
200
|
+
const fromTokenParam = useMemo(
|
|
201
|
+
() =>
|
|
202
|
+
fromToken
|
|
203
|
+
? {
|
|
204
|
+
address: fromToken.address,
|
|
205
|
+
decimals: fromToken.decimals,
|
|
206
|
+
symbol: fromToken.symbol,
|
|
207
|
+
name: fromToken.name,
|
|
208
|
+
}
|
|
209
|
+
: undefined,
|
|
210
|
+
[fromToken],
|
|
211
|
+
);
|
|
212
|
+
const toTokenParam = useMemo(
|
|
213
|
+
() =>
|
|
214
|
+
toToken
|
|
215
|
+
? { address: toToken.address, decimals: toToken.decimals, symbol: toToken.symbol, name: toToken.name }
|
|
216
|
+
: undefined,
|
|
217
|
+
[toToken],
|
|
218
|
+
);
|
|
219
|
+
|
|
220
|
+
const isNetworkSupported = useMemo(
|
|
221
|
+
() =>
|
|
222
|
+
!swapProvider || !network || swapProvider.getSupportedNetworks().some((n) => n.chainId === network.chainId),
|
|
223
|
+
[swapProvider, network],
|
|
224
|
+
);
|
|
225
|
+
|
|
226
|
+
const {
|
|
227
|
+
data: quote,
|
|
228
|
+
isFetching: isQuoteFetching,
|
|
229
|
+
error: quoteError,
|
|
230
|
+
} = useSwapQuote({
|
|
231
|
+
from: fromTokenParam,
|
|
232
|
+
to: toTokenParam,
|
|
233
|
+
amount: fromAmountDebounced,
|
|
234
|
+
network,
|
|
235
|
+
slippageBps: slippage,
|
|
236
|
+
providerId: swapProvider?.providerId,
|
|
237
|
+
query: { enabled: isNetworkSupported },
|
|
238
|
+
});
|
|
239
|
+
// Also show "loading" while the user is still typing (debounce in-flight) so the UI doesn't flash
|
|
240
|
+
// the previous quote as if it were final.
|
|
241
|
+
const isQuoteLoading = isQuoteFetching || fromAmount !== fromAmountDebounced;
|
|
242
|
+
const { fromBalance, toBalance, isFromBalanceLoading, isToBalanceLoading } = useSwapBalances({
|
|
243
|
+
fromToken,
|
|
244
|
+
toToken,
|
|
245
|
+
ownerAddress: address ?? undefined,
|
|
246
|
+
network,
|
|
247
|
+
});
|
|
248
|
+
const { data: tonBalance } = useBalance({ network, query: { refetchInterval: 5000 } });
|
|
249
|
+
|
|
250
|
+
// 3. Derivations
|
|
251
|
+
const toAmount = quote?.toAmount ?? '';
|
|
252
|
+
const { error, canSubmit } = useSwapValidation({
|
|
253
|
+
fromAmount,
|
|
254
|
+
fromAmountDebounced,
|
|
255
|
+
fromToken,
|
|
256
|
+
toToken,
|
|
257
|
+
fromBalance,
|
|
258
|
+
quoteError,
|
|
259
|
+
isNetworkSupported,
|
|
260
|
+
});
|
|
261
|
+
const isLowBalanceWarningOpen = pendingSwap !== undefined;
|
|
262
|
+
const lowBalanceMode: 'reduce' | 'topup' = pendingSwap?.mode ?? 'reduce';
|
|
263
|
+
const lowBalanceRequiredTon = useMemo(() => {
|
|
264
|
+
if (!pendingSwap) return '';
|
|
265
|
+
return formatUnits(pendingSwap.requiredNanos, 9);
|
|
266
|
+
}, [pendingSwap]);
|
|
267
|
+
|
|
268
|
+
// 4. Mutations
|
|
269
|
+
const { mutateAsync: buildTransaction, isPending: isBuildingTransaction } = useBuildSwapTransaction();
|
|
270
|
+
const { mutateAsync: sendTransaction, isPending: isSendingPending } = useSendTransaction();
|
|
271
|
+
const isSendingTransaction = isBuildingTransaction || isSendingPending;
|
|
272
|
+
|
|
273
|
+
// 5. Callbacks
|
|
274
|
+
const handleMaxClick = useCallback(() => {
|
|
275
|
+
if (!fromBalance || !fromToken) return;
|
|
276
|
+
setFromAmount(calcMaxSpendable({ balance: fromBalance, token: fromToken, feeReserveNanos: 350_000_000n }));
|
|
277
|
+
}, [fromBalance, fromToken, setFromAmount]);
|
|
278
|
+
|
|
279
|
+
const sendSwapTransaction = useCallback(async () => {
|
|
280
|
+
if (!quote || !address || !fromToken) return;
|
|
281
|
+
|
|
282
|
+
const tx = await buildTransaction({ quote, userAddress: address });
|
|
283
|
+
|
|
284
|
+
const shortfall = getTonShortfall({
|
|
285
|
+
messages: tx.messages,
|
|
286
|
+
tonBalance,
|
|
287
|
+
fromToken,
|
|
288
|
+
fromAmount,
|
|
289
|
+
});
|
|
290
|
+
|
|
291
|
+
if (shortfall) {
|
|
292
|
+
setPendingSwap(shortfall);
|
|
293
|
+
return;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
await sendTransaction(tx);
|
|
297
|
+
}, [quote, address, fromToken, fromAmount, buildTransaction, sendTransaction, tonBalance]);
|
|
298
|
+
|
|
299
|
+
const onLowBalanceChange = useCallback(() => {
|
|
300
|
+
if (!pendingSwap || pendingSwap.mode !== 'reduce') return;
|
|
301
|
+
setFromAmount(pendingSwap.suggestedFromAmount);
|
|
302
|
+
setPendingSwap(undefined);
|
|
303
|
+
}, [pendingSwap, setFromAmount]);
|
|
304
|
+
|
|
305
|
+
const onLowBalanceCancel = useCallback(() => {
|
|
306
|
+
setPendingSwap(undefined);
|
|
307
|
+
}, []);
|
|
308
|
+
|
|
309
|
+
const value = useMemo(
|
|
310
|
+
() => ({
|
|
311
|
+
tokens: networkFilteredTokens,
|
|
312
|
+
fromToken,
|
|
313
|
+
toToken,
|
|
314
|
+
fromAmount,
|
|
315
|
+
toAmount,
|
|
316
|
+
fiatSymbol,
|
|
317
|
+
fromBalance,
|
|
318
|
+
toBalance,
|
|
319
|
+
isFromBalanceLoading,
|
|
320
|
+
isToBalanceLoading,
|
|
321
|
+
canSubmit,
|
|
322
|
+
quote,
|
|
323
|
+
isQuoteLoading,
|
|
324
|
+
error,
|
|
325
|
+
slippage,
|
|
326
|
+
swapProvider,
|
|
327
|
+
swapProviders,
|
|
328
|
+
setSwapProviderId,
|
|
329
|
+
setFromToken,
|
|
330
|
+
setToToken,
|
|
331
|
+
setFromAmount,
|
|
332
|
+
setSlippage,
|
|
333
|
+
onFlip,
|
|
334
|
+
onMaxClick: handleMaxClick,
|
|
335
|
+
sendSwapTransaction,
|
|
336
|
+
isSendingTransaction,
|
|
337
|
+
isLowBalanceWarningOpen,
|
|
338
|
+
lowBalanceMode,
|
|
339
|
+
lowBalanceRequiredTon,
|
|
340
|
+
onLowBalanceChange,
|
|
341
|
+
onLowBalanceCancel,
|
|
342
|
+
}),
|
|
343
|
+
[
|
|
344
|
+
networkFilteredTokens,
|
|
345
|
+
fromToken,
|
|
346
|
+
toToken,
|
|
347
|
+
fromAmount,
|
|
348
|
+
toAmount,
|
|
349
|
+
fiatSymbol,
|
|
350
|
+
fromBalance,
|
|
351
|
+
toBalance,
|
|
352
|
+
isFromBalanceLoading,
|
|
353
|
+
isToBalanceLoading,
|
|
354
|
+
canSubmit,
|
|
355
|
+
quote,
|
|
356
|
+
isQuoteLoading,
|
|
357
|
+
error,
|
|
358
|
+
slippage,
|
|
359
|
+
swapProvider,
|
|
360
|
+
swapProviders,
|
|
361
|
+
setSwapProviderId,
|
|
362
|
+
setFromToken,
|
|
363
|
+
setToToken,
|
|
364
|
+
setFromAmount,
|
|
365
|
+
setSlippage,
|
|
366
|
+
onFlip,
|
|
367
|
+
handleMaxClick,
|
|
368
|
+
sendSwapTransaction,
|
|
369
|
+
isSendingTransaction,
|
|
370
|
+
isLowBalanceWarningOpen,
|
|
371
|
+
lowBalanceMode,
|
|
372
|
+
lowBalanceRequiredTon,
|
|
373
|
+
onLowBalanceChange,
|
|
374
|
+
onLowBalanceCancel,
|
|
375
|
+
],
|
|
376
|
+
);
|
|
377
|
+
|
|
378
|
+
return <SwapContext.Provider value={value}>{children}</SwapContext.Provider>;
|
|
379
|
+
};
|