Skip to main content
SDK for Telegram-based Solana deposits. Deposit SOL for any Telegram username, which can later be claimed by the verified account owner through Loyal Mini App on Telegram.

Installation

bun add @loyal-labs/transactions
# or
npm install @loyal-labs/transactions

Peer Dependencies

This SDK requires the following peer dependencies:
bun add @coral-xyz/anchor @solana/web3.js

Quick Start

import { Connection } from "@solana/web3.js";
import { LoyalTransactionsClient, solToLamports } from "@loyal-labs/transactions";

const connection = new Connection("https://api.devnet.solana.com");
const client = LoyalTransactionsClient.fromKeypair(connection, myKeypair);

const result = await client.deposit({
  username: "alice",
  amountLamports: solToLamports(0.1), // 0.1 SOL
});

console.log("Transaction:", result.signature);
console.log("Deposited:", result.deposit.amount, "lamports");