A developer toolkit for integrating TON blockchain payments into web applications, Telegram Mini Apps, and backend services. Handles TON coin and Jetton transfers with transaction tracking and webhook support.
- Accept TON coin and Jetton tokens
- React and vanilla JavaScript UI components
- Integration with TON Connect protocol
- Transaction status monitoring and webhooks
- Non-custodial architecture
# API only
npm install @ton-pay/api
# React UI components (requires @tonconnect/ui-react)
npm install @ton-pay/ui-react @tonconnect/ui-react
# Vanilla JS UI components (optional, for non-React apps)
npm install @ton-pay/uiimport { TonConnectUIProvider } from "@tonconnect/ui-react";
export function App() {
return (
<TonConnectUIProvider manifestUrl="/tonconnect-manifest.json">
<YourApp />
</TonConnectUIProvider>
);
}import { TonPayButton, useTonPay } from "@ton-pay/ui-react";
import { createTonPayTransfer } from "@ton-pay/api";
export default function PayButton() {
const { pay } = useTonPay();
return (
<TonPayButton
handlePay={async () => {
const result = await pay(async (senderAddr) => {
const { message, reference, bodyBase64Hash } =
await createTonPayTransfer(
{
amount: 12.34,
asset: "TON",
recipientAddr: "EQC...RECIPIENT", // Optional if API key provided
senderAddr,
commentToSender: "Order #123",
},
{ chain: "testnet", apiKey: process.env.TONPAY_API_KEY }
);
return { message, reference, bodyBase64Hash };
});
console.log(result.txResult);
console.log(result.reference, result.bodyBase64Hash);
}}
/>
);
}Full documentation: docs.ton.org/ecosystem/ton-pay
Compatible with all TON Connect protocol wallets:
- Tonkeeper (iOS, Android, Web, Desktop)
- MyTonWallet (iOS, Android, Desktop)
- Tonhub (iOS, Android)
- OpenMask (Web Extension)
- TON Wallet (Web, Desktop)
- Wallet Bot (Telegram)
This monorepo contains the following packages:
@ton-pay/api— Core API utilities for building transfer messages and querying status@ton-pay/ui-react— React components and hooks@ton-pay/ui— Vanilla JS UI components for non-React applications
Licensed under the Apache License 2.0. See the LICENSE file for details.
Contributions are welcome. Please submit a Pull Request.
- Documentation: docs.ton.org/ecosystem/ton-pay
- Issues: GitHub Issues
- Repository: github.com/RSquad/ton-pay