Implementation
SDK implementation guide.
1. Import dependencies in your project
import { ArgentTMA, SessionAccountInterface } from '@argent/tma-wallet';2. Initialize the ArgentTMA object
const argentTMA = ArgentTMA.init({
environment: "sepolia", // "sepolia" | "mainnet" (Whitelisting required)
appName: "My TG Mini Test Dapp", // Your Telegram app name
appTelegramUrl: "<https://t.me/my_telegram_bot/app_name>", // Your Telegram app URL
sessionParams: {
allowedMethods: [
// List of contracts/methods allowed to be called by the session key
{
contract:
"0x036133c88c1954413150db74c26243e2af77170a4032934b275708d84ec5452f", // contract address
selector: "increment", //function selector
}
],
validityDays: 90 // session validity (in days) - default: 90
},
});3. Request a connection
4. Check connection status
5. Connect to the wallet
6. Interact with Starknet using the account
7. Check account session status
8. Request approval
9. Clear session
Last updated
Was this helpful?