Asset Chain Telegram Mini App Demo
This project shows builders how to develop Telegram Mini Apps on Asset Chain. It uses Next.js, wagmi for Asset Chain wallet connections, and various injected providers for ease of use.
Table of content
Getting Started
Clone the Repository:
Install Dependencies: Run the following command to install the necessary packages:
Start the Development Server: Run the server locally:
Environment Variables:
Rename
.env.example
to.env.local
and configure the following parameters:
Connecting to Injected Providers
To connect the app with different Ethereum wallet providers, you can modify the default connector in your src/hooks/useEvmWallet.tsx
file based on your needs.
Injected Providers Setup
Use Injected Provider: This sets the default connector to detect and use any wallet injected into the browser, such as MetaMask or Coinbase Wallet.
Use Coinbase Provider: To connect with Coinbase Wallet, change the configuration:
Use MetaMask Provider: If you prefer MetaMask as your default wallet provider, configure it like so:
Use WalletConnect Provider: To integrate WalletConnect, which supports mobile wallets, adjust the default connector to:
Network Configuration
Explanation
defaultChainId
: Sets the initial chain ID configuration for connecting.AssetChainMainnet.id
: The default chain ID is currently set to the AssetChain mainnet ID. This is useful for production use.AssetChainTestnet.id
: You can switch to the testnet for testing and development purposes by changing the comment.
With this setup, you'll be able to connect your Telegram mini app to various Asset Chain, giving your users flexibility in interacting with blockchain-enabled features.
Contributing
See CONTRIBUTING.md for contribution and pull request protocol. We expect contributors to follow our guide when submitting code or comments.
License
This project is licensed under the GNU General Public License v3.0. See the LICENSE file for details.
Contact
For questions or suggestions, just say Hi on Telegram. We're always glad to help.
Last updated