Giter VIP home page Giter VIP logo

tonlib-go's Introduction

TONLIB Golang library

Go Report Card GoDoc

TONLIB Golang library for accessing Telegram Open Network with liteclient protocol, which is based itself on tdlib library. Warning: this repository is under active development, not ready for production use

Install

$ go get -u github.com/mercuryoio/tonlib-go

Usage

import "github.com/mercuryoio/tonlib-go"

Supported methods

  • createNewKey
  • deleteKey
  • exportKey
  • exportPemKey
  • exportEncryptedKey
  • importKey
  • importPemKey
  • importEncryptedKey
  • changeLocalPassword
  • unpackAccountAddress
  • packAccountAddress
  • wallet.init
  • wallet.getAccountAddress
  • wallet.getAccountState
  • wallet.sendGrams
  • raw.sendMessage
  • raw.getTransactions
  • raw.getAccountState
  • generic.sendGrams
  • getLogStream
  • sync
  • CreateAndSendMessage
  • generic.createSendGramsQuery
  • query.send
  • query.forge
  • query.estimateFees
  • query.getInfo
  • smc.load
  • smc.getCode
  • smc.getData
  • smc.getState
  • smc.runGetMethod

Examples

Create new client

    cln, err := NewClient(getTestConfig(), Config{})
    if err != nil {
        t.Errorf("Init client error: %v. ", err)
    }
    defer cln.Destroy()

Create new private key

    _, err = cln.CreatePrivateKey([]byte(TEST_PASSWORD))
    if err != nil {
        t.Errorf("Ton create key error: %v. ", err)
    }

Get wallet address

    _, err = cln.WalletGetAddress(pKey.PublicKey)
    if err != nil {
        t.Errorf("Ton get wallet address error: %v. ", err)
    }

CLI:

To install sample cli application:

$ go get -u github.com/mercuryoio/tonlib-go/cmd/tongo

To run sample cli app your have to set LD_LIBRARY_PATH:

For linux export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:<path2repository>/lib/linux

For MacOS export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:<path2repository>/lib/darwin

Developers

Mercuryo.io

Contribute

PRs are welcome!

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.