Gathering detailed insights and metrics for @tmawallet/sdk
Gathering detailed insights and metrics for @tmawallet/sdk
Gathering detailed insights and metrics for @tmawallet/sdk
Gathering detailed insights and metrics for @tmawallet/sdk
npm install @tmawallet/sdk
Typescript
Module System
Node Version
NPM Version
TypeScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
6 Stars
7 Commits
1 Branches
1 Contributors
Updated on Mar 11, 2025
Latest Version
2.1.9
Package Id
@tmawallet/sdk@2.1.9
Unpacked Size
59.85 kB
Size
14.91 kB
File Count
59
NPM Version
10.9.2
Node Version
23.8.0
Published on
Feb 26, 2025
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
4
2
3
To get API keys: https://dash.tmawallet.com/
Examples for EVM and Solana are below.
TMAWallet is a wallet-as-a-service SDK designed to simplify wallet integration for Telegram mini-apps. Built using Multi-Party Computation (MPC) technology, TMAWallet provides a secure and seamless solution for developers to embed blockchain wallets directly into Telegram-based applications. With a focus on both ease of use and security, TMAWallet empowers developers to create decentralized applications (dApps) with minimal friction for end-users.
Most wallets available today are custodial, semi-custodial, or rely on your phone to stay functional—lose your phone, lose your wallet. TMA Wallet is built differently.
1npm install --save @tmawallet/sdk
1import { TMAWalletClient } from '@tmawallet/sdk'; 2import { TMAWalletEVM } from '@tmawallet/sdk/dist/wallets/TMAWallet.EVM'; 3 4import { ethers } from 'ethers'; 5 6const myApiKey = '1234567812345678'; // Replace with your API key from the TMA Wallet Dashboard 7 8const client = new TMAWalletClient(myApiKey); 9const evmWallet = new TMAWalletEVM(client); 10 11await evmWallet.authenticate(); // Automatically loads an existing user and wallet, or creates a new one if needed 12 13console.log('Your wallet address: ', evmWallet.walletAddress); 14 15const provider = new ethers.JsonRpcProvider(); 16const signer = evmWallet.getEthersSigner(provider); // Use TMA Wallet seamlessly with ethers.js and any provider 17 18const tx = await signer.sendTransaction({ 19 to: '0x...', 20 value: ethers.parseEther('1'), 21});
1import { TMAWalletClient } from '@tmawallet/sdk'; 2import { TMAWalletSolana } from '@tmawallet/sdk/dist/wallets/TMAWallet.Solana'; 3import { 4 createSolanaRpc, 5 createTransactionMessage, 6 setTransactionMessageFeePayer, 7 signTransaction, 8} from '@solana/web3.js'; 9 10const myApiKey = '1234567812345678'; // Replace with your API key from the TMA Wallet Dashboard 11 12const client = new TMAWalletClient(myApiKey); 13const solanaWallet = new TMAWalletSolana(client); 14 15await solanaWallet.authenticate(); // Automatically loads an existing user and wallet, or creates a new one if needed 16 17console.log('Your wallet address: ', solanaWallet.walletAddress); 18 19const rpc = createSolanaRpc('https://api.devnet.solana.com'); // replace with your RPC 20const signer = await solanaWallet.getSolanaSigner(); 21 22const transactionMessage = createTransactionMessage({ version: 0 }); 23const feePayerAddress = solanaWallet.walletAddress; 24const transactionMessageWithFeePayer = setTransactionMessageFeePayer(feePayerAddress, transactionMessage); 25 26// Attempting to sign the transaction message without a lifetime will throw a type error 27const signedTransaction = await signTransaction([signer], transactionMessageWithFeePayer); 28 29const txHash = await rpc.sendTransaction(signedTransaction);
Yes, it is safe. TMA Wallet is built using Multi-Party Computation (MPC) technology, which ensures that neither our servers (nor yours), nor any third party (e.g., Telegram), have access to the user’s private key.
Our solution is blockchain agnostic. As far as your blockchain supports private key based wallets, you can use TMA Wallet with it.
In this SDK we provide out-of-the-box ethers.js support and @solana/web3.js support, so you can use any blockchain that ethers.js supports (basically, any EVM-compatible blockchain) and Solana.
If you want to use any other blockchain (or maybe even non-blockchain solution at all), you can do it by directly using accessPrivateKey
method.
It works in six steps:
ClientPublicKey
and ClientSecretKey
32-byte keys on the user's device and save them in the Telegram CloudStorage.ClientPublicKey
to the server along with Telegram-signed initData
(current user's authorization data).IntermediaryKey
by signing (ClientPublicKey
+ telegramUserId
) with ServerSecretKey
(unique for your project).IntermediaryKey
is sent back to the device and decrypted.IntermediaryKey
is signed by ClientSecretKey
and used as a WalletPrivateKey
.Yes, user can access their wallet from any other device where they have the same Telegram account.
While user still has access to their Telegram account, they can get access to their wallet.
Yes, user can backup their wallet if you allow them to export WalletPrivateKey
in your interface. However, please consider that wallet backup is usually used for the wallets that could not be recovered in case of device loss. As far as TMA Wallet tied to the Telegram account, it could be easily recovered in case of device loss. But anyway, we won't stop you from allowing users to export WalletPrivateKey
if you really need it.
No vulnerabilities found.
No security vulnerabilities found.