Initialization

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 TON Connect 2.0 for this (if you're using React, take a look at our collection of hooks), or implement a custom sender that uses your seed phrase to sign transactions and send them.

Last updated

Was this helpful?