@ton-api/client
Overview
This SDK, automatically generated, facilitates access to endpoints provided by tonapi.io. For detailed API information, visit the documentation.
To utilize tonapi, please set up an account.
Getting started
Install the package using npm or yarn:
npm install @ton-api/client
yarn add @ton-api/client
Install the required peer dependencies:
npm install @ton/core
yarn add @ton/core
Usage
Below is an example of how to use the SDK in your JavaScript project:
import { TonApiClient, Api } from '@ton-api/client';
const http = new TonApiClient({
baseUrl: 'https://tonapi.io',
apiKey: YOUR_TOKEN
});
const client = new Api(http);
const events = await client.accounts.getAccountEvents(address, { limit: 50 });
const collection = await client.nft.getNftCollection(address);
const jetton = await client.jettons.getJettonInfo(address);