• Stars
    star
    171
  • Rank 222,266 (Top 5 %)
  • Language
    Rust
  • License
    Apache License 2.0
  • Created over 5 years ago
  • Updated about 1 month ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Client Libraries in 13 languages for Everscale, TON, Venom and other TVM blockchains

Ever SDK

Client libraries in 13 programming languages for DApp development in TVM blockchains (Everscale, TON, Venom Blockchain, etc).

Libraries works over GraphQL API. So, they can be used to interact directly with Evercloud, SE or Dapp Server.

Get quick help in our telegram channel:

Channel on Telegram

Use-cases

With Ever-SDK you can implement logic of any complexity on TVM compatible blockchains (Everscale, TON, Venom, Gosh, etc).

  • Create and send messages to blockchain
  • Process messages reliably (supports retries and message expiration mechanics)
  • Supports Everscale Solidity and ABI compatible contracts
  • Emulate transactions locally
  • Run get methods
  • Get account state
  • Query blockchain data (blocks, transactions, messages)
  • Subscripe to events and any other blockchain updates (literally)
  • Sign data/check signature, calculate hashes (sha256, sha512), encrypt/decrypt data
  • Validate addresses
  • Work with blockchain native types (bag of cells or BOCs): encode, decode, calculate hash, etc
  • Works on top of GraphQL API and compatible with Evernode-SE/DS, Evercloud.

Supported languages

Official Javascript(Typescript) SDK

Repository: JavaScript SDK

You need to install core package and the package with binary for your platform. See the documentation.

Platform Package
core package for all platforms @eversdk/core
Node.js @eversdk/lib-node
Web @eversdk/lib-web
React-Native @eversdk/lib-react-native
React-Native with JSI support @eversdk/lib-react-native-jsi

Community SDKs

Language Repository
Clojure serge-medvedev/tonos-client-clojure
Dart freetonsurfer/ton_client_dart
Golang

radianceteam/ton-client-go
markgenuine/ever-client-go

Java

radianceteam/ton-client-java
laugan/java4ever-binding

Kotlin mdorofeev/ton-client-kotlin
Lua serge-medvedev/tonos-client-lua
.NET

radianceteam/ton-client-dotnet
everscale-actions/everscale-dotnet
vcvetkovs/TonSdk
staszx/Ton.Sdk

PHP

extraton/php-ton-client
radianceteam/ton-client-php

Python move-ton/ton-client-py
Ruby

radianceteam/ton-client-ruby
nerzh/ton-client-ruby

Scala

slavaschmidt/ton-sdk-client-scala-binding/
radianceteam/ton-client-scala

Swift nerzh/ton-client-swift

Quick Start

Get your endpoing at dashboard.evercloud.dev

See the list of available TVM networks: https://docs.evercloud.dev/products/evercloud/networks-endpoints

Quick Start (Javascript binding)

Error descriptions

JavaScript SDK Types and Methods (API Reference)

Core Types and Methods (API Reference)

Guides

What is Core Client Library

Core Client Library is written in Rust that can be dynamically linked. It provides all heavy-computation components and functions, such as TON Virtual Machine, TON Transaction Executor, ABI-related functions, boc-related functions, crypto functions.

The decision to create the Rust library was made after a period of time using pure JavaScript to implement these use cases.

We ended up with very slow work of pure JavaScript and decided to move all this to Rust library and link it to Javascript as a compiled binary including a wasm module for browser applications.

Also this approach provided an opportunity to easily create bindings for any programming language and platform, thus, to make it possible to develop distributed applications (DApps) for any possible use-cases, such as: mobile DApps, web DApps, server-side DApps, enterprise DApp etc.

Client Library exposes all the functionality through a few of exported functions. All interaction with library is performed using JSON-RPC like protocol.

If you did not find the language you need

  • use library module json_interface which provides access to library functions through JSON-RPC interface. This interface exports several extern "C" functions. So you can build a dynamic or static link library and link it to your application as any other external libraries. The JSON Interface is fully "C" compliant. You can find description in section JSON Interface.
  • write your own binding to chosen language and share it with community.

If you choose using JSON Interface please read this document JSON Interface.
Here you can find directions how to use json_interface and write your own binding.

How to avoid Soft Breaking Problems

Soft Breaking is API changes that include only new optional fields in the existing structures. This changes are fully backward compatible for JSON Interface.

But in Rust such changes can produce some problems with an old client code.

Look at the example below:

  1. There is an API v1.0 function foo and the corresponding params structure:
#[derive(Default)]
struct ParamsOfFoo {
    pub foo: String,
}

pub fn foo(params: ParamsOfFoo)
  1. Application uses this function in this way:
foo(ParamsOfFoo {
    foo: "foo".into(),
});
  1. API v.1.1 introduces new field in ParamsOfFoo:
#[derive(Default)]
struct ParamsOfFoo {
    pub foo: String,
    pub bar: Option<String>,
}

From the perspective of JSON-interface it isn't breaking change because the new parameter is optional. But code snippet (2) will produce Rust compilation error.

  1. To avoid such problems we recommend to use default implementation inside structure initialisation:
foo(ParamsOfFoo {
    foo: "foo".into(),
    ..Default::default(),
});

For all Ton Client API structures Default trait is implemented.

Build client library

The best way to build client libraries is to use build scripts from this repo.

Note: The scripts are written in JavaScript so you have to install Node.js (v.10 or newer) to run them. Also make sure you have the latest version of Rust installed.

To build a binary for a specific target (or binding), navigate to the relevant folder and run node build.js.

The resulting binaries are placed to bin folder in the gz-compressed format.

Note that the build script generates binaries compatible with the platform used to run the script. For example, if you run it on Mac OS, you get binaries targeted at Darwin (macOS) platform.

Note: You need latest version of rust. Upgrade it with rustup update command. Check version with rustc --version, it should be above or equal to 1.47.0.

Build artifacts

Rebuild api.json:

cd toncli
cargo run api -o ../tools

Rebuild docs:

cd tools
npm i
tsc
node index docs -o ../docs

Rebuild modules.ts:

cd tools
npm i
tsc
node index binding -l ts -o ../../ever-sdk-js/packages/core/src

Run tests

To run test suite use standard Rust test command

cargo test

SDK tests need EVER OS API endpoint to run on. Such an API is exposed by a DApp Server which runs in real networks and by local blockchain Evernode SE.

Evernode SE is used by default with address http://localhost and port 80. If you launch it on another port you need to specify it explicitly like this: http://localhost:port. If you have Evernode SE running on another address or you need to run tests on a real Everscale network use the following environment variables to override the default parameters

TON_USE_SE: true/false - flag defining if tests run against Evernode SE or a real network (DApp Server)
TON_NETWORK_ADDRESS - Dapp server or Evernode SE addresses separated by comma.
TON_GIVER_SECRET - Giver secret key. If not defined, default Evernode SE giver keys are used
TON_GIVER_ADDRESS - Address of the giver to use for prepaying accounts before deploying test contracts. If not defined, the address is calculated using `GiverV2.tvc` and configured public key
EVERCLOUD_AUTH_PROJECT – Evercloud project id used to authorise tests that requires main net interaction 

Download precompiled binaries

Instead of building library yourself, you can download the latest precompiled binaries from EverX SDK Binaries Store.

Platform Major Download links
Win32 0 ton_client.lib, ton_client.dll
1 ton_client.lib, ton_client.dll
macOS 0 libton_client.dylib
1 (x86_64)libton_client.dylib
1 (aarch64)libton_client.dylib
Linux 0 libton_client.so
1 libton_client.so

If you want an older version of library (e.g. 0.25.0 for macOS), you need to choose a link to your platform from the list above and replace 0 with a version: https://binaries.tonlabs.io/tonclient_0_25_0_darwin.gz

Downloaded archive is gzipped file

More Repositories

1

TVM-Solidity-Compiler

Solidity compiler for TVM
C++
124
star
2

everdev

TVM Development Environment - Set up all the core Developer tools and work with TVM blockchains(Everscale, TON, Venom) from a single interface
TypeScript
109
star
3

main.ton.dev

Everscale main network configuration
Shell
102
star
4

ever-sdk-js

Javascript SDK for TVM blockchains (Everscale, TON, Venom, etc)
TypeScript
95
star
5

samples

Samples of Free TON smart contracts in Solidity, C++ and C
Solidity
95
star
6

ever-node

Everscale/Venom node in Rust
Rust
94
star
7

ever-cli

Command line tool for TVM compatible networks (Everscale, TON, Venom, Gosh, etc)
Rust
82
star
8

TVM-Compiler

Clang compiler for TVM
C++
59
star
9

evernode-se

Local Node for DApp development and testing in TVM blockchains (Everscale, TON, Venom, etc)
Rust
50
star
10

sdk-samples

EVER SDK samples
JavaScript
44
star
11

ton-labs-contracts

Smart contracts for TON blockchain.
Solidity
41
star
12

ever-vm

Everscale/Venom Virtual Machine implementation in Rust
Rust
37
star
13

evernode-ds

Community version of Evernode Platform (client supernode with GraphQL API) for TVM blockchains (Everscale, Venom, TON, Gosh) that exposes GraphQL API.
Solidity
34
star
14

gosh

Git Open Source Hodler
TypeScript
29
star
15

ton-dev-cli

Tondev CLI is the core SDK tool designed to facilitate the component installation, usage and update processes. In particular, it allows compiling smart contracts in Solidity and running them in the local node or TON testnet.
JavaScript
26
star
16

flex

FLEX is a fast decentralized exchange with a limit order book built on the Everscale blockchain.
HTML
24
star
17

TestSuite4

TestSuite4 is a framework designed to simplify development and testing of TON Contracts. It includes light-weight emulator of blockchain making it easy to develop contracts.
Python
24
star
18

tonix

Tonix provides basic file system functionality, as well as an interactive shell with a Unix-style command line interface.
Solidity
23
star
19

ever-abi

Application Binary Interface implementation for TVM compatible blockchains (Everscale, Venom, TON, Gosh, etc)
Rust
22
star
20

ton-client-node-js

TON Javascript API for Node.js
JavaScript
22
star
21

UIKit

UI components kit
TypeScript
22
star
22

rustnet.ton.dev

Shell
22
star
23

TVM-linker

TVM linker takes TVM assembly source code of TVM smart contract, compiles it and links its parts, adds standard selector and runtime and stores it into binary TVC file
Rust
22
star
24

debots

Debots
Solidity
18
star
25

ton-client-rs

TON Labs SDK Client Library for Rust
Rust
16
star
26

ever-node-tools

Tools for Everscale/Venom node
Rust
15
star
27

net.ton.dev

net.ton.dev
Shell
15
star
28

ever-block

Blockсhain-specific data types for Everscale/Venom nodes in Rust
Rust
14
star
29

ever-types

Fundamental data types for Eversvale/Venom node in Rust
Rust
14
star
30

True-NFT

TypeScript
14
star
31

DeBot-IS-consortium

DeBot Interface Specifications (IS) Consortium. IS a place where community defines interfaces every DeBot browser should support.
Solidity
14
star
32

ever-appkit-js

Free TON Javascript Application Kit
TypeScript
11
star
33

ever-executor

Transaction executor for Everscale/Venom nodes in Rust
Rust
11
star
34

ton-client-web-js

TON Labs SDK Client Library for Web Browsers
JavaScript
11
star
35

ever-adnl

ADNL protocol implementation in Rust
Rust
10
star
36

ever-overlay

Overlay protocol implementation in Rust
Rust
9
star
37

ton-client-react-native-js

TON Labs Client Library for React Native
JavaScript
9
star
38

ever-tl

Serialization/deserialization of TL-based data types
Rust
9
star
39

ever-rldp

RLDP protocol implementation in Rust
Rust
7
star
40

ever-dht

DHT protocol implementation in Rust
Rust
7
star
41

everdev-vscode

Access core EVER OS functionality from VS Code IDE
TypeScript
6
star
42

Surf-Releases

The repository with builds of Surf
5
star
43

eversdk-ton

Main eversdk typescript monorepo
TypeScript
5
star
44

TonNfcClientSwift

Swift
5
star
45

ever-block-json

Rust
4
star
46

debot-engine

DeBot Engine library
Rust
4
star
47

ever-crypto

Cryptographic primitives for Everscale/Venom nodes in Rust
Rust
4
star
48

ton-nfc-client

TypeScript
4
star
49

TonNfcClientAndroid

Java
3
star
50

Evernode-NQ

Everscale Decentralized Notifications
JavaScript
3
star
51

surf-external

Solidity
3
star
52

ever-assembler

Rust
3
star
53

tor-service

Python
3
star
54

TON-Surf-Localization

TypeScript
3
star
55

common

Common files used for build and runtime
Rust
2
star
56

contests-v2

JavaScript
2
star
57

flex-sdk-js

Flex Javascript SDK
TypeScript
2
star
58

ipcnv

Simple ip address conversion tool
Go
2
star
59

ton-labs-node-storage

Rust
2
star
60

tondev

TypeScript
2
star
61

lockfree

Rust
2
star
62

admin-tool

C++
2
star
63

react-navigation-surf

Custom navigation used in TON Surf application
JavaScript
2
star
64

ever-bls-lib

Rust
1
star
65

stTONs

Depool stake tokens contract
C++
1
star
66

chess-match-making

A set of auxilary smart-contracts providing assistance in all aspects of chess matches facilitation
Solidity
1
star
67

ever-struct

frequently used structures
Rust
1
star
68

TIP

Repository for TON Improvement Proposals
1
star
69

electron-forge-maker-appimage

AppImage maker for Electron Forge
TypeScript
1
star
70

ever-q-server

GraphQL API for TVM networks (Everscale, TON, Venom, Gosh, etc)
TypeScript
1
star
71

dapp-services-ranger

Ranger Service (part of DAppServices)
TypeScript
1
star
72

wallet-sdk-js

Manage you wallet: EVERs, fungible tokens and NFTs
Solidity
1
star