Two distinct connection methods depend on whether you want to set Coin98 Wallet as the default.
3.1.1. Set Coin98 Wallet as default
Clicking "Connect Wallet" via TON SDK automatically opens the Coin98 app without any wallet selection, forcing exclusive use of Coin98 Telegram Wallet;
If you agree, proceed with integration. To open a modal window for a specific wallet, use the openSingleWalletModal() method with the wallet's appName as a parameter (refer to wallets-list.json file)
import { useTonConnectUI } from '@tonconnect/ui-react';
const MyComponent = () => {
const [tonConnectUI] = useTonConnectUI();
const handleConnect = async () => {
// Connect using the specific wallet "coin98-telegram-wallet-bot"
// Set Coin98 Telegram Wallet as default
return tonConnectUI.openSingleWalletModal('coin98-telegram-wallet-bot');
};
return (
<div>
<button onClick={handleConnect}>Connect Wallet</button>
</div>
);
};
export default MyComponent;
3.1.2. Do not set Coin98 Wallet as default
Calling connect method opens TON's modal, allowing users to choose from multiple wallets; to use Coin98 Telegram, select the Coin98 Telegram Wallet option.
To open a modal window for a specific wallet, use the openSingleWalletModal() method with the wallet's appName as a parameter (refer to wallets-list.json file)