Tonpay SDK
  • Home
  • Supported currencies
  • 🌐JavaScript
    • Getting started
    • Initialization
    • Interacting with Store
    • Interacting with Invoice
  • 🐍Python
    • Getting started
    • Initialization
    • Interacting with Store
    • Interacting with Invoice
Powered by GitBook
On this page

Was this helpful?

  1. JavaScript

Initialization

PreviousGetting startedNextInteracting with Store

Last updated 2 years ago

Was this helpful?

Before you can interact with entities like Store an Invoice, you need to initialize the SDK. This can be done in just one line of code:

const tonpay = Tonpay.create(
    "testnet", // or "mainnet"
    // sender that is responsible for sending the transactions
    { send: async ({ to, value, body, init }: SenderArguments) => {} }
);

Done! Now you can access everything that our SDK provides using the tonpay object.

It's highly recommended to use Ton Connect 2.0 as it's a network-wide standard.

Short FAQ

You may be wondering - "what is sender?". The answer is simple - sender is an entity that is responsible for sending transactions to the TON Blockchain. You might want to use for this (if you're using React, take a look at our ), or implement a custom sender that uses your seed phrase to sign transactions and send them.

🌐
TON Connect 2.0
collection of hooks