Skip to main content

Telegram EVM Wallet

Creating an EVM wallet on Telegram.

We would be creating a telegram EVM (Ethereum Virtual Machine) wallet that has the following features.

  • Wallet Address
  • Seed Phrase
  • Private Key

This telegram wallet can perform all operations our evm wallets can perform such as Metamask,Trust Wallet e.t.c.

Start

Create a folder and run this on the terminal :

Starting a node project
npm init --y

this is used if your response are all going to be yes if not this should be used.

Starting a node project
npm init 

Telegraf

Telegraf is a library that makes it simple for you to develop your own Telegram bots using JavaScript or TypeScript.

Inside the folder created previously run this on the terminal :
Viem
npm i telegraf

After it's done installing you can now Import it in your project.

Importing telegraf in bot.js
// Import telegraf
const { Telegraf } = require('telegraf');

Learn More Telegraf.

Create a bot account

Create a bot account on telegram through bot father:

contact BotFather

Create a telegram bot through the following steps:

  • Open the Telegram messaging app.
  • Search for @BotFather and select it.
  • Click “Start” to activate BotFather bot.
  • Send /newbot to create a new Telegram bot.
  • Enter a name for the bot and give it a unique username.

Connect your code to your telegram bot

adding your Bot Tokens in bot.js
const { Telegraf, Markup, session } = require('telegraf');
const bot = new Telegraf("Bot Tokens");
//const bot = new Telegraf("616046536:AAG8jLThVpF_MS44sggqwC_4uqrRP6wUnM");

Learn More Wagmi.

Thirdweb

Create a folder and run this on the terminal :

Wagmi
npm i @thirdweb-dev/react @thirdweb-dev/sdk ethers@^5

After it's done installing you can now Import it in your project.

Importing Thirdweb in Node.js
import { useContractRead, useContract } from "@thirdweb-dev/react";

function App() {
const { data: contract } = useContract("{{contract_address}}");
const { data, isLoading, error } = useContractRead(contract, "functionName");
}

Learn More Thirdweb.