Code Monkey home page Code Monkey logo

tonapi-go's Introduction

Description

This repository contains TonAPI SDK and examples.

The native TON's RPC is very low-level. And it is not suitable for building applications on top of it.

TonAPI aims at speeding up development of TON-based applications and provides an API centered around high-level concepts like Jettons, NFTs and so on, keeping a way to access low-level details.

Check out more details at TonAPI Documentation.

TonAPI SDK Example

Development of TON-based applications is much easier with TonAPI SDK:

package main

import (
	"context"
	"fmt"
	"log"

	"github.com/tonkeeper/tonapi-go"
)

func main() {
	client, err := tonapi.New()
	if err != nil {
		log.Fatal(err)
	}
	account, err := client.GetAccount(context.Background(), tonapi.GetAccountParams{AccountID: "EQBszTJahYw3lpP64ryqscKQaDGk4QpsO7RO6LYVvKHSINS0"})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("Account: %v\n", account.Balance)
}

Take a look at TonAPI SDK examples.

Rest API

You can always find the latest version of TonAPI Rest API documentation at TonAPI Documentation.

TonAPI SDK example shows how to work with Rest API in golang.

Streaming API

Usually, an application needs to monitor the blockchain for specific events and act accordingly.
TonAPI offers two ways to do it: SSE and Websocket.

The advantage of Websocket is that Websocket can be reconfigured dynamically to subscribe/unsubscribe to/from specific events. Where SSE has to reconnect to TonAPI to change the list of events it is subscribed to.

Take a look at SSE example and Websocket example to see how to work with TonAPI Streaming API in golang.

More details can be found at TonAPI Streaming API Documentation.

tonapi-go's People

Contributors

aleksej-paschenko avatar dependabot[bot] avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.