Skip to content

startfellows/tonapi-sdk-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tonapi-sdk-js

Overview

This SDK, automatically generated, facilitates access to endpoints provided by tonapi.io. For detailed API information, visit the swagger documentation.

To utilize tonapi, please set up an account.

Installation

Install the package using npm or yarn:

npm install tonapi-sdk-js
# or
yarn add tonapi-sdk-js

Usage

Below is an example of how to use the SDK in your JavaScript project:

// client.js

import { HttpClient, Api } from 'tonapi-sdk-js';

// Configure the HTTP client with your host and token
const httpClient = new HttpClient({
    baseUrl: 'https://tonapi.io',
    baseApiParams: {
        headers: {
            Authorization: `Bearer ${YOUR_TOKEN}`,
            'Content-type': 'application/json'
        }
    }
});

// Initialize the API client
const client = new Api(httpClient);

// Fetch a typed array of account events
const events = await client.accounts.getAccountEvents(address, { limit: 50 });

// Retrieve an NFT collection
const collection = await client.nft.getNftCollection(address);

// Obtain information about a specific jetton
const jetton = await client.jettons.getJettonInfo(address);

About

Autogenerated SDK for tonapi.io

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •