@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
|
@@ -7,12 +7,13 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { useCallback, useMemo } from 'react';
|
|
10
|
-
import type { FC, ReactNode
|
|
10
|
+
import type { FC, ReactNode } from 'react';
|
|
11
11
|
import type { SendTransactionParameters, SendTransactionReturnType } from '@ton/appkit';
|
|
12
12
|
|
|
13
|
+
import { useI18n } from '../../../settings/hooks/use-i18n';
|
|
13
14
|
import { SendProvider, useSendContext } from '../transaction-provider';
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
15
|
+
import { Button } from '../../../../components/ui/button';
|
|
16
|
+
import type { ButtonProps } from '../../../../components/ui/button';
|
|
16
17
|
|
|
17
18
|
export interface SendRenderProps {
|
|
18
19
|
isLoading: boolean;
|
|
@@ -27,7 +28,7 @@ export type SendRequest =
|
|
|
27
28
|
| (() => SendTransactionParameters)
|
|
28
29
|
| (() => Promise<SendTransactionParameters>);
|
|
29
30
|
|
|
30
|
-
export interface SendProps extends Omit<
|
|
31
|
+
export interface SendProps extends Omit<ButtonProps, 'children' | 'onError'> {
|
|
31
32
|
/** The transaction request parameters */
|
|
32
33
|
request: SendRequest;
|
|
33
34
|
/** Callback when an error occurs */
|
|
@@ -40,7 +41,7 @@ export interface SendProps extends Omit<ComponentProps<'button'>, 'children' | '
|
|
|
40
41
|
children?: (props: SendRenderProps) => ReactNode;
|
|
41
42
|
}
|
|
42
43
|
|
|
43
|
-
interface SendContentProps extends Omit<
|
|
44
|
+
interface SendContentProps extends Omit<ButtonProps, 'children'> {
|
|
44
45
|
text?: ReactNode;
|
|
45
46
|
children?: (props: SendRenderProps) => ReactNode;
|
|
46
47
|
}
|
package/src/features/transaction/components/transaction-progress/transaction-progress-icons.tsx
CHANGED
|
@@ -10,6 +10,7 @@ import type { ComponentProps, FC } from 'react';
|
|
|
10
10
|
import clsx from 'clsx';
|
|
11
11
|
import type { TransactionStatus } from '@ton/appkit';
|
|
12
12
|
|
|
13
|
+
import { FailedIcon, SpinnerIcon, SuccessIcon } from '../../../../components/ui/icons';
|
|
13
14
|
import styles from './transaction-progress.module.css';
|
|
14
15
|
|
|
15
16
|
export interface TransactionProgressIconsProps extends ComponentProps<'svg'> {
|
|
@@ -17,64 +18,19 @@ export interface TransactionProgressIconsProps extends ComponentProps<'svg'> {
|
|
|
17
18
|
isError: boolean;
|
|
18
19
|
}
|
|
19
20
|
|
|
20
|
-
const
|
|
21
|
-
<svg
|
|
22
|
-
className={clsx(styles.spinner, className)}
|
|
23
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
24
|
-
width="48"
|
|
25
|
-
height="48"
|
|
26
|
-
viewBox="0 0 24 24"
|
|
27
|
-
fill="none"
|
|
28
|
-
stroke="currentColor"
|
|
29
|
-
strokeWidth="2"
|
|
30
|
-
strokeLinecap="round"
|
|
31
|
-
strokeLinejoin="round"
|
|
32
|
-
>
|
|
33
|
-
<path d="M21 12a9 9 0 1 1-6.219-8.56" />
|
|
34
|
-
</svg>
|
|
35
|
-
);
|
|
21
|
+
const STATUS_ICON_SIZE = 48;
|
|
36
22
|
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
stroke="currentColor"
|
|
46
|
-
strokeWidth="2"
|
|
47
|
-
strokeLinecap="round"
|
|
48
|
-
strokeLinejoin="round"
|
|
49
|
-
>
|
|
50
|
-
<path d="M22 11.08V12a10 10 0 1 1-5.93-9.14" />
|
|
51
|
-
<polyline points="22 4 12 14.01 9 11.01" />
|
|
52
|
-
</svg>
|
|
53
|
-
);
|
|
23
|
+
export const TransactionProgressIcon: FC<TransactionProgressIconsProps> = ({
|
|
24
|
+
status,
|
|
25
|
+
isError,
|
|
26
|
+
className,
|
|
27
|
+
...props
|
|
28
|
+
}) => {
|
|
29
|
+
if (status === 'completed')
|
|
30
|
+
return <SuccessIcon size={STATUS_ICON_SIZE} className={clsx(styles.success, className)} {...props} />;
|
|
54
31
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
className={clsx(styles.failed, className)}
|
|
58
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
59
|
-
width="48"
|
|
60
|
-
height="48"
|
|
61
|
-
viewBox="0 0 24 24"
|
|
62
|
-
fill="none"
|
|
63
|
-
stroke="currentColor"
|
|
64
|
-
strokeWidth="2"
|
|
65
|
-
strokeLinecap="round"
|
|
66
|
-
strokeLinejoin="round"
|
|
67
|
-
>
|
|
68
|
-
<circle cx="12" cy="12" r="10" />
|
|
69
|
-
<line x1="15" y1="9" x2="9" y2="15" />
|
|
70
|
-
<line x1="9" y1="9" x2="15" y2="15" />
|
|
71
|
-
</svg>
|
|
72
|
-
);
|
|
32
|
+
if (status === 'failed' || isError)
|
|
33
|
+
return <FailedIcon size={STATUS_ICON_SIZE} className={clsx(styles.failed, className)} {...props} />;
|
|
73
34
|
|
|
74
|
-
|
|
75
|
-
if (status === 'completed') return <SuccessIcon {...props} />;
|
|
76
|
-
|
|
77
|
-
if (status === 'failed' || isError) return <FailedIcon {...props} />;
|
|
78
|
-
|
|
79
|
-
return <SpinnerIcon {...props} />;
|
|
35
|
+
return <SpinnerIcon size={STATUS_ICON_SIZE} className={clsx(styles.spinner, className)} {...props} />;
|
|
80
36
|
};
|
|
@@ -10,7 +10,7 @@ import { useMemo } from 'react';
|
|
|
10
10
|
import type { FC, ReactNode, ComponentProps } from 'react';
|
|
11
11
|
import { clsx } from 'clsx';
|
|
12
12
|
|
|
13
|
-
import { useI18n } from '
|
|
13
|
+
import { useI18n } from '../../../settings/hooks/use-i18n';
|
|
14
14
|
import { TransactionProgressProvider, useTransactionProgressContext } from './transaction-progress-provider';
|
|
15
15
|
import type { TransactionProgressContextValue } from './transaction-progress-provider';
|
|
16
16
|
import { TransactionProgressIcon } from './transaction-progress-icons';
|
|
@@ -19,7 +19,7 @@ import { sendTransactionMutationOptions } from '@ton/appkit/queries';
|
|
|
19
19
|
|
|
20
20
|
import { useMutation } from '../../../libs/query';
|
|
21
21
|
import type { UseMutationReturnType } from '../../../libs/query';
|
|
22
|
-
import { useAppKit } from '
|
|
22
|
+
import { useAppKit } from '../../settings';
|
|
23
23
|
|
|
24
24
|
export type UseSendTransactionParameters<context = unknown> = SendTransactionOptions<context>;
|
|
25
25
|
|
|
@@ -16,7 +16,8 @@ import { getTransactionStatusQueryOptions } from '@ton/appkit/queries';
|
|
|
16
16
|
|
|
17
17
|
import { useQuery } from '../../../libs/query';
|
|
18
18
|
import type { UseQueryReturnType } from '../../../libs/query';
|
|
19
|
-
import { useAppKit } from '
|
|
19
|
+
import { useAppKit } from '../../settings';
|
|
20
|
+
import { useNetwork } from '../../network';
|
|
20
21
|
|
|
21
22
|
export type UseTransactionStatusParameters<selectData = GetTransactionStatusData> = GetTransactionStatusParameters &
|
|
22
23
|
GetTransactionStatusQueryConfig<selectData>;
|
|
@@ -50,6 +51,9 @@ export const useTransactionStatus = <selectData = GetTransactionStatusData>(
|
|
|
50
51
|
parameters: UseTransactionStatusParameters<selectData>,
|
|
51
52
|
): UseTransactionStatusReturnType<selectData> => {
|
|
52
53
|
const appKit = useAppKit();
|
|
54
|
+
const walletNetwork = useNetwork();
|
|
53
55
|
|
|
54
|
-
return useQuery(
|
|
56
|
+
return useQuery(
|
|
57
|
+
getTransactionStatusQueryOptions(appKit, { ...parameters, network: parameters.network ?? walletNetwork }),
|
|
58
|
+
);
|
|
55
59
|
};
|
|
@@ -19,7 +19,7 @@ import { transferTonMutationOptions } from '@ton/appkit/queries';
|
|
|
19
19
|
|
|
20
20
|
import { useMutation } from '../../../libs/query';
|
|
21
21
|
import type { UseMutationReturnType } from '../../../libs/query';
|
|
22
|
-
import { useAppKit } from '
|
|
22
|
+
import { useAppKit } from '../../settings';
|
|
23
23
|
|
|
24
24
|
export type UseTransferTonParameters<context = unknown> = TransferTonOptions<context>;
|
|
25
25
|
|
|
@@ -10,7 +10,7 @@ import { useEffect } from 'react';
|
|
|
10
10
|
import { watchTransactionsByAddress, hasStreamingProvider, resolveNetwork } from '@ton/appkit';
|
|
11
11
|
import type { WatchTransactionsByAddressOptions, TransactionsUpdate } from '@ton/appkit';
|
|
12
12
|
|
|
13
|
-
import { useAppKit } from '
|
|
13
|
+
import { useAppKit } from '../../settings';
|
|
14
14
|
|
|
15
15
|
export type UseWatchTransactionsByAddressParameters = Partial<WatchTransactionsByAddressOptions>;
|
|
16
16
|
|
|
@@ -12,7 +12,7 @@ import type { ConnectData, ConnectErrorType, ConnectOptions, ConnectVariables }
|
|
|
12
12
|
|
|
13
13
|
import { useMutation } from '../../../libs/query';
|
|
14
14
|
import type { UseMutationReturnType } from '../../../libs/query';
|
|
15
|
-
import { useAppKit } from '
|
|
15
|
+
import { useAppKit } from '../../settings';
|
|
16
16
|
|
|
17
17
|
export type UseConnectParameters<context = unknown> = ConnectOptions<context>;
|
|
18
18
|
|
|
@@ -10,7 +10,7 @@ import { useSyncExternalStore, useCallback } from 'react';
|
|
|
10
10
|
import { getConnectedWallets, watchConnectedWallets } from '@ton/appkit';
|
|
11
11
|
import type { GetConnectedWalletsReturnType } from '@ton/appkit';
|
|
12
12
|
|
|
13
|
-
import { useAppKit } from '
|
|
13
|
+
import { useAppKit } from '../../settings';
|
|
14
14
|
|
|
15
15
|
export type UseConnectedWalletsReturnType = GetConnectedWalletsReturnType;
|
|
16
16
|
|
|
@@ -10,7 +10,7 @@ import { useSyncExternalStore, useCallback } from 'react';
|
|
|
10
10
|
import { getConnectorById, watchConnectorById } from '@ton/appkit';
|
|
11
11
|
import type { Connector } from '@ton/appkit';
|
|
12
12
|
|
|
13
|
-
import { useAppKit } from '
|
|
13
|
+
import { useAppKit } from '../../settings';
|
|
14
14
|
|
|
15
15
|
export const useConnectorById = (id: string): Connector | undefined => {
|
|
16
16
|
const appKit = useAppKit();
|
|
@@ -10,7 +10,7 @@ import { useSyncExternalStore, useCallback } from 'react';
|
|
|
10
10
|
import { getConnectors, watchConnectors } from '@ton/appkit';
|
|
11
11
|
import type { GetConnectorsReturnType } from '@ton/appkit';
|
|
12
12
|
|
|
13
|
-
import { useAppKit } from '
|
|
13
|
+
import { useAppKit } from '../../settings';
|
|
14
14
|
|
|
15
15
|
export type UseConnectorsReturnType = GetConnectorsReturnType;
|
|
16
16
|
|
|
@@ -14,7 +14,7 @@ import type { DisconnectData, DisconnectErrorType, DisconnectOptions, Disconnect
|
|
|
14
14
|
|
|
15
15
|
import { useMutation } from '../../../libs/query';
|
|
16
16
|
import type { UseMutationReturnType } from '../../../libs/query';
|
|
17
|
-
import { useAppKit } from '
|
|
17
|
+
import { useAppKit } from '../../settings';
|
|
18
18
|
|
|
19
19
|
export type UseDisconnectParameters<context = unknown> = DisconnectOptions<context>;
|
|
20
20
|
|
|
@@ -10,7 +10,7 @@ import { useSyncExternalStore, useCallback } from 'react';
|
|
|
10
10
|
import { getSelectedWallet, watchSelectedWallet, setSelectedWalletId } from '@ton/appkit';
|
|
11
11
|
import type { GetSelectedWalletReturnType } from '@ton/appkit';
|
|
12
12
|
|
|
13
|
-
import { useAppKit } from '
|
|
13
|
+
import { useAppKit } from '../../settings';
|
|
14
14
|
|
|
15
15
|
export type UseSelectedWalletReturnType = readonly [GetSelectedWalletReturnType, (walletId: string | null) => void];
|
|
16
16
|
|
|
@@ -0,0 +1,69 @@
|
|
|
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, useRef } from 'react';
|
|
10
|
+
import { debounce } from '@ton/appkit';
|
|
11
|
+
import type { DebounceOptions } from '@ton/appkit';
|
|
12
|
+
|
|
13
|
+
import { useUnmount } from './use-unmount';
|
|
14
|
+
|
|
15
|
+
interface ControlFunctions {
|
|
16
|
+
cancel: () => void;
|
|
17
|
+
flush: () => void;
|
|
18
|
+
isPending: () => boolean;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
22
|
+
export type DebouncedState<T extends (...args: any[]) => ReturnType<T>> = ((
|
|
23
|
+
...args: Parameters<T>
|
|
24
|
+
) => ReturnType<T> | void) &
|
|
25
|
+
ControlFunctions;
|
|
26
|
+
|
|
27
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
28
|
+
export function useDebounceCallback<T extends (...args: any[]) => ReturnType<T>>(
|
|
29
|
+
func: T,
|
|
30
|
+
delay = 500,
|
|
31
|
+
options?: DebounceOptions,
|
|
32
|
+
): DebouncedState<T> {
|
|
33
|
+
const debouncedFunc = useRef<ReturnType<typeof debounce> | null>(null);
|
|
34
|
+
|
|
35
|
+
useUnmount(() => {
|
|
36
|
+
if (debouncedFunc.current) {
|
|
37
|
+
debouncedFunc.current.cancel();
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
const debounced = useMemo(() => {
|
|
42
|
+
const debouncedFuncInstance = debounce(func, delay, options);
|
|
43
|
+
|
|
44
|
+
const wrappedFunc: DebouncedState<T> = (...args: Parameters<T>) => {
|
|
45
|
+
return debouncedFuncInstance(...args);
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
wrappedFunc.cancel = () => {
|
|
49
|
+
debouncedFuncInstance.cancel();
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
wrappedFunc.isPending = () => {
|
|
53
|
+
return !!debouncedFunc.current;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
wrappedFunc.flush = () => {
|
|
57
|
+
return debouncedFuncInstance.flush();
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
return wrappedFunc;
|
|
61
|
+
}, [func, delay, options]);
|
|
62
|
+
|
|
63
|
+
// Update the debounced function ref whenever func, wait, or options change
|
|
64
|
+
useEffect(() => {
|
|
65
|
+
debouncedFunc.current = debounce(func, delay, options);
|
|
66
|
+
}, [func, delay, options]);
|
|
67
|
+
|
|
68
|
+
return debounced;
|
|
69
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
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 { useRef, useState } from 'react';
|
|
10
|
+
import type { DebounceOptions } from '@ton/appkit';
|
|
11
|
+
|
|
12
|
+
import type { DebouncedState } from './use-debounce-callback';
|
|
13
|
+
import { useDebounceCallback } from './use-debounce-callback';
|
|
14
|
+
|
|
15
|
+
interface UseDebounceValueOptions<T> extends DebounceOptions {
|
|
16
|
+
equalityFn?: (left: T, right: T) => boolean;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const useDebounceValue = <T>(
|
|
20
|
+
initialValue: T | (() => T),
|
|
21
|
+
delay: number,
|
|
22
|
+
options?: UseDebounceValueOptions<T>,
|
|
23
|
+
): [T, DebouncedState<(value: T) => void>] => {
|
|
24
|
+
const eq = options?.equalityFn ?? ((left: T, right: T) => left === right);
|
|
25
|
+
const unwrappedInitialValue = initialValue instanceof Function ? initialValue() : initialValue;
|
|
26
|
+
const [debouncedValue, setDebouncedValue] = useState<T>(unwrappedInitialValue);
|
|
27
|
+
const previousValueRef = useRef<T | undefined>(unwrappedInitialValue);
|
|
28
|
+
|
|
29
|
+
const updateDebouncedValue = useDebounceCallback(setDebouncedValue, delay, options);
|
|
30
|
+
|
|
31
|
+
// Update the debounced value if the initial value changes
|
|
32
|
+
if (!eq(previousValueRef.current as T, unwrappedInitialValue)) {
|
|
33
|
+
updateDebouncedValue(unwrappedInitialValue);
|
|
34
|
+
previousValueRef.current = unwrappedInitialValue;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return [debouncedValue, updateDebouncedValue];
|
|
38
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
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, useRef } from 'react';
|
|
10
|
+
|
|
11
|
+
export const useUnmount = (func: () => void) => {
|
|
12
|
+
const funcRef = useRef(func);
|
|
13
|
+
funcRef.current = func;
|
|
14
|
+
|
|
15
|
+
useEffect(() => () => funcRef.current(), []);
|
|
16
|
+
};
|
package/src/index.ts
CHANGED
|
@@ -7,17 +7,27 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
export { AppKitProvider } from './providers/app-kit-provider';
|
|
10
|
-
export { useAppKit } from './hooks/use-app-kit';
|
|
11
|
-
export { useAppKitTheme } from './hooks/use-app-kit-theme';
|
|
12
10
|
export { I18nProvider } from './providers/i18n-provider';
|
|
13
|
-
export { useI18n } from './hooks/use-i18n';
|
|
14
11
|
|
|
15
12
|
export * from '@ton/appkit';
|
|
16
13
|
|
|
17
|
-
export * from './components/block';
|
|
18
|
-
export * from './components/
|
|
19
|
-
export * from './components/
|
|
20
|
-
export * from './components/
|
|
14
|
+
export * from './components/ui/block';
|
|
15
|
+
export * from './components/ui/info-block';
|
|
16
|
+
export * from './components/ui/button';
|
|
17
|
+
export * from './components/ui/logo';
|
|
18
|
+
export * from './components/ui/modal';
|
|
19
|
+
export * from './components/ui/skeleton';
|
|
20
|
+
export * from './components/ui/input';
|
|
21
|
+
export * from './components/shared/token-select-modal';
|
|
22
|
+
export * from './components/ui/tabs';
|
|
23
|
+
export * from './components/ui/centered-amount-input';
|
|
24
|
+
export * from './components/shared/amount-presets';
|
|
25
|
+
export * from './components/ui/collapsible';
|
|
26
|
+
export * from './components/ui/select';
|
|
27
|
+
export * from './components/shared/low-balance-modal';
|
|
28
|
+
export * from './components/shared/settings-button';
|
|
29
|
+
export * from './components/shared/option-switcher';
|
|
30
|
+
export * from './components/ui/icons';
|
|
21
31
|
|
|
22
32
|
export * from './features/balances';
|
|
23
33
|
export * from './features/jettons';
|
|
@@ -25,6 +35,9 @@ export * from './features/network';
|
|
|
25
35
|
export * from './features/nft';
|
|
26
36
|
export * from './features/transaction';
|
|
27
37
|
export * from './features/wallets';
|
|
38
|
+
export * from './features/settings';
|
|
28
39
|
export * from './features/swap';
|
|
29
40
|
export * from './features/signing';
|
|
30
41
|
export * from './features/staking';
|
|
42
|
+
|
|
43
|
+
export * from './types/appkit-ui-token';
|
package/src/locales/en.ts
CHANGED
|
@@ -37,4 +37,86 @@ export default {
|
|
|
37
37
|
nft: {
|
|
38
38
|
onSale: 'On Sale',
|
|
39
39
|
},
|
|
40
|
+
|
|
41
|
+
// Token select modal (shared between swap, etc.)
|
|
42
|
+
tokenSelect: {
|
|
43
|
+
emptyNoMatch: "We didn't find any tokens.",
|
|
44
|
+
emptyTryAddress: 'Try searching by address.',
|
|
45
|
+
emptyForNetwork: 'No tokens available for the selected network.',
|
|
46
|
+
},
|
|
47
|
+
|
|
48
|
+
// Shared DeFi error messages (rendered by `mapDefiError`)
|
|
49
|
+
defi: {
|
|
50
|
+
unsupportedNetwork: 'Network is not supported',
|
|
51
|
+
networkError: 'Network error, please try again',
|
|
52
|
+
providerNotFound: 'Provider not found',
|
|
53
|
+
noDefaultProvider: 'No provider configured',
|
|
54
|
+
invalidProvider: 'Invalid provider',
|
|
55
|
+
invalidParams: 'Invalid parameters',
|
|
56
|
+
},
|
|
57
|
+
|
|
58
|
+
// Swap
|
|
59
|
+
swap: {
|
|
60
|
+
pay: 'Pay',
|
|
61
|
+
receive: 'Receive',
|
|
62
|
+
max: 'MAX',
|
|
63
|
+
continue: 'Continue',
|
|
64
|
+
enterAmount: 'Enter an amount',
|
|
65
|
+
insufficientBalance: 'Insufficient balance',
|
|
66
|
+
tooManyDecimals: 'Too many decimal places',
|
|
67
|
+
quoteError: 'Unable to get a quote',
|
|
68
|
+
invalidQuote: 'Quote is invalid',
|
|
69
|
+
insufficientLiquidity: 'Insufficient liquidity for this swap',
|
|
70
|
+
quoteExpired: 'Quote expired, please try again',
|
|
71
|
+
buildTxFailed: "Couldn't build the swap transaction",
|
|
72
|
+
selectToken: 'Select Token',
|
|
73
|
+
searchToken: 'Search...',
|
|
74
|
+
settings: 'Swap settings',
|
|
75
|
+
slippage: 'Slippage',
|
|
76
|
+
slippageError: 'The maximum slippage tolerance cannot be more than 50%. The recommended range is 1%',
|
|
77
|
+
slippageWarning: 'High slippage tolerance increases the risk of an unfavorable trade',
|
|
78
|
+
provider: 'Provider',
|
|
79
|
+
save: 'Save',
|
|
80
|
+
minReceived: 'Min Received',
|
|
81
|
+
},
|
|
82
|
+
|
|
83
|
+
// Low balance modal (shared between swap, staking, etc.)
|
|
84
|
+
lowBalance: {
|
|
85
|
+
title: 'Not enough TON',
|
|
86
|
+
messageReduce:
|
|
87
|
+
'This operation requires ~{{ amount }} TON which exceeds your TON balance. Reduce the amount to continue.',
|
|
88
|
+
messageTopup:
|
|
89
|
+
'This operation needs ~{{ amount }} TON to cover network fees. Top up your TON balance to continue.',
|
|
90
|
+
change: 'Change amount',
|
|
91
|
+
cancel: 'Cancel',
|
|
92
|
+
close: 'Close',
|
|
93
|
+
},
|
|
94
|
+
|
|
95
|
+
// Staking
|
|
96
|
+
staking: {
|
|
97
|
+
stake: 'Stake',
|
|
98
|
+
unstake: 'Unstake',
|
|
99
|
+
continue: 'Stake',
|
|
100
|
+
insufficientBalance: 'Insufficient balance',
|
|
101
|
+
tooManyDecimals: 'Too many decimal places',
|
|
102
|
+
quoteError: 'Unable to get a quote',
|
|
103
|
+
invalidParams: 'Invalid staking parameters',
|
|
104
|
+
unsupportedOperation: 'Operation not supported by this provider',
|
|
105
|
+
youGet: 'You get',
|
|
106
|
+
currentApy: 'Current APY',
|
|
107
|
+
max: 'MAX',
|
|
108
|
+
exchangeRate: 'Exchange rate',
|
|
109
|
+
stakedBalance: 'Staked balance',
|
|
110
|
+
unstakeType: 'Unstake type',
|
|
111
|
+
maximumReward: 'Maximum reward',
|
|
112
|
+
instant: 'Instant',
|
|
113
|
+
instantLimit: 'Limit: {{ limit }}',
|
|
114
|
+
maximumRewardLimit: 'Next cycle',
|
|
115
|
+
whenAvailable: 'When available',
|
|
116
|
+
whenAvailableLimit: 'No limits',
|
|
117
|
+
yourBalance: 'Your balance',
|
|
118
|
+
provider: 'Provider',
|
|
119
|
+
settings: 'Staking settings',
|
|
120
|
+
save: 'Save',
|
|
121
|
+
},
|
|
40
122
|
} as const;
|
|
@@ -0,0 +1,88 @@
|
|
|
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 { Network } from '@ton/appkit';
|
|
10
|
+
|
|
11
|
+
import type { AppkitUIToken } from '../../types/appkit-ui-token';
|
|
12
|
+
|
|
13
|
+
export const STORY_TOKENS: AppkitUIToken[] = [
|
|
14
|
+
{
|
|
15
|
+
symbol: 'TON',
|
|
16
|
+
name: 'Toncoin',
|
|
17
|
+
decimals: 9,
|
|
18
|
+
address: 'ton',
|
|
19
|
+
network: Network.mainnet(),
|
|
20
|
+
logo: 'https://asset.ston.fi/img/EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM9c/c8d21a3d93f9b574381e0a8d8f16d48b325dd8f54ce172f599c1e9d6c62f03f7',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
symbol: 'USD₮',
|
|
24
|
+
name: 'Tether USD',
|
|
25
|
+
decimals: 6,
|
|
26
|
+
address: 'EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs',
|
|
27
|
+
network: Network.mainnet(),
|
|
28
|
+
rate: '1',
|
|
29
|
+
logo: 'https://asset.ston.fi/img/EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs/1a87edfee9a28b05578853952e5effb8cc30af1e0fb90043aa2ce19dce490849',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
symbol: 'STON',
|
|
33
|
+
name: 'STON',
|
|
34
|
+
decimals: 9,
|
|
35
|
+
address: 'EQA2kCVNwVsil2EM2mB0SkXytxCqQjS4mttjDpnXmwG9T6bO',
|
|
36
|
+
network: Network.mainnet(),
|
|
37
|
+
logo: 'https://asset.ston.fi/img/EQA2kCVNwVsil2EM2mB0SkXytxCqQjS4mttjDpnXmwG9T6bO/7c9798ce1e64707fb4cb8f025d4060f66b386ed381b50498e3b88731cedeffe8',
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
symbol: 'XAUt0',
|
|
41
|
+
name: 'Tether Gold',
|
|
42
|
+
decimals: 6,
|
|
43
|
+
address: 'EQA1R_LuQCLHlMgOo1S4G7Y7W1cd0FrAkbA10Zq7rddKxi9k',
|
|
44
|
+
network: Network.mainnet(),
|
|
45
|
+
logo: 'https://asset.ston.fi/img/EQA1R_LuQCLHlMgOo1S4G7Y7W1cd0FrAkbA10Zq7rddKxi9k/4aaaa7c30d7811bced81ded6bc116dcc82a78c6aea53d6012fd586a5826963ad',
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
symbol: 'USDe',
|
|
49
|
+
name: 'Ethena USDe',
|
|
50
|
+
decimals: 6,
|
|
51
|
+
address: 'EQAIb6KmdfdDR7CN1GBqVJuP25iCnLKCvBlJ07Evuu2dzP5f',
|
|
52
|
+
network: Network.mainnet(),
|
|
53
|
+
rate: '1',
|
|
54
|
+
logo: 'https://asset.ston.fi/img/EQAIb6KmdfdDR7CN1GBqVJuP25iCnLKCvBlJ07Evuu2dzP5f/dbcc67993cd4aad4845a97a4a9722c6cb618123997c8112c29d4932b2739c4cd',
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
symbol: 'tsTON',
|
|
58
|
+
name: 'Tonstakers TON',
|
|
59
|
+
decimals: 9,
|
|
60
|
+
address: 'EQC98_qAmNEptUtPc7W6xdHh_ZHrBUFpw5Ft_IzNU20QAJav',
|
|
61
|
+
network: Network.mainnet(),
|
|
62
|
+
logo: 'https://asset.ston.fi/img/EQC98_qAmNEptUtPc7W6xdHh_ZHrBUFpw5Ft_IzNU20QAJav/38f530facb209e4696b8aef17af51df94d16bd879926c517b07d25841da287b7',
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
symbol: 'GEMSTON',
|
|
66
|
+
name: 'GEMSTON',
|
|
67
|
+
decimals: 9,
|
|
68
|
+
address: 'EQBX6K9aXVl3nXINCyPPL86C4ONVmQ8vK360u6dykFKXpHCa',
|
|
69
|
+
network: Network.mainnet(),
|
|
70
|
+
logo: 'https://asset.ston.fi/img/EQBX6K9aXVl3nXINCyPPL86C4ONVmQ8vK360u6dykFKXpHCa/c6ab1e58e3b9b58a7429d38b7feab731afae2f66dc301a6c42041fdf7e9d7c9c',
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
symbol: 'UTYA',
|
|
74
|
+
name: 'Utya',
|
|
75
|
+
decimals: 9,
|
|
76
|
+
address: 'EQBaCgUwOoc6gHCNln_oJzb0mVs79YG7wYoavh-o1ItaneLA',
|
|
77
|
+
network: Network.mainnet(),
|
|
78
|
+
logo: 'https://asset.ston.fi/img/EQBaCgUwOoc6gHCNln_oJzb0mVs79YG7wYoavh-o1ItaneLA/727e6cc971afdfa8ed9c698d0909eee9de344a0b6766ff5e4ddcc3323449d6f6',
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
symbol: 'WETH',
|
|
82
|
+
name: 'Wrapped Ether',
|
|
83
|
+
decimals: 18,
|
|
84
|
+
address: 'EQBTkLAhEteZCRgRe_xMs5ZE0bMrduYxKbyzGCpXXW8dRWOT',
|
|
85
|
+
network: Network.mainnet(),
|
|
86
|
+
logo: 'https://asset.ston.fi/img/EQBTkLAhEteZCRgRe_xMs5ZE0bMrduYxKbyzGCpXXW8dRWOT/6267787665c30c2500dbde048e2f8a6a6d7ec58633ea038723f4ce1fab337ccb',
|
|
87
|
+
},
|
|
88
|
+
];
|
|
@@ -0,0 +1,26 @@
|
|
|
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 { Network } from '@ton/appkit';
|
|
10
|
+
|
|
11
|
+
export interface AppkitUIToken {
|
|
12
|
+
/** Token symbol, e.g. "TON" */
|
|
13
|
+
symbol: string;
|
|
14
|
+
/** Full token name, e.g. "Toncoin" */
|
|
15
|
+
name: string;
|
|
16
|
+
/** Number of decimals for the token */
|
|
17
|
+
decimals: number;
|
|
18
|
+
/** Jetton contract address (use "ton" for TON) */
|
|
19
|
+
address: string;
|
|
20
|
+
/** Optional token logo */
|
|
21
|
+
logo?: string;
|
|
22
|
+
/** Optional exchange rate: 1 token = rate fiat units (used for fiat value display) */
|
|
23
|
+
rate?: string;
|
|
24
|
+
/** Network the token belongs to. */
|
|
25
|
+
network: Network;
|
|
26
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
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 { DefiError } from '@ton/appkit';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Map a thrown error to an i18n key from the `defi.*` namespace.
|
|
13
|
+
* Returns `null` when the error isn't a {@link DefiError} or the code isn't recognised —
|
|
14
|
+
* callers should decide on their own fallback (usually a domain-specific key).
|
|
15
|
+
*/
|
|
16
|
+
export const mapDefiError = (error: unknown): string | null => {
|
|
17
|
+
if (!(error instanceof DefiError)) return null;
|
|
18
|
+
|
|
19
|
+
switch (error.code) {
|
|
20
|
+
case DefiError.UNSUPPORTED_NETWORK:
|
|
21
|
+
return 'defi.unsupportedNetwork';
|
|
22
|
+
case DefiError.NETWORK_ERROR:
|
|
23
|
+
return 'defi.networkError';
|
|
24
|
+
case DefiError.PROVIDER_NOT_FOUND:
|
|
25
|
+
return 'defi.providerNotFound';
|
|
26
|
+
case DefiError.NO_DEFAULT_PROVIDER:
|
|
27
|
+
return 'defi.noDefaultProvider';
|
|
28
|
+
case DefiError.INVALID_PROVIDER:
|
|
29
|
+
return 'defi.invalidProvider';
|
|
30
|
+
case DefiError.INVALID_PARAMS:
|
|
31
|
+
return 'defi.invalidParams';
|
|
32
|
+
default:
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
};
|