All Projects → tonlabs → TON-SDK

tonlabs / TON-SDK

Licence: Apache-2.0 license
Core Everscale Client library - develop decentralized applications on Everscale blockchain. 14 programming languages supported.

Programming Languages

rust
11053 projects
solidity
1140 projects
typescript
32286 projects

Projects that are alternatives of or similar to TON-SDK

ton-client-js
Everscale Javascript SDK
Stars: ✭ 60 (-45.45%)
Mutual labels:  free, ton, freeton, everscale
everdev
Everscale Development Environment - Set up all the core Developer tools and work with Everscale blockchain from a single interface
Stars: ✭ 55 (-50%)
Mutual labels:  free, tonos, freeton, everscale
tonos-se
Local Node for Everscale DApp development and testing
Stars: ✭ 29 (-73.64%)
Mutual labels:  free, freeton, everscale
sdk-samples
EVER SDK samples
Stars: ✭ 37 (-66.36%)
Mutual labels:  freeton, everscale
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.
Stars: ✭ 26 (-76.36%)
Mutual labels:  tonos, ton
coindrop
The easiest way to accept donations & tips anywhere
Stars: ✭ 59 (-46.36%)
Mutual labels:  free
ML-University
Machine Learning Open Source University
Stars: ✭ 423 (+284.55%)
Mutual labels:  free
savetheworldwithgo
Build systems with Go examples
Stars: ✭ 81 (-26.36%)
Mutual labels:  free
Rboxlo
Roblox private server
Stars: ✭ 173 (+57.27%)
Mutual labels:  free
dev doctor
Free, opensource, serverless learning platform
Stars: ✭ 34 (-69.09%)
Mutual labels:  free
awesome-learn-by-playing
A collection of tech resources that allow you to learn new things by playing games
Stars: ✭ 95 (-13.64%)
Mutual labels:  free
ForensicsTools
A list of free and open forensics analysis tools and other resources
Stars: ✭ 392 (+256.36%)
Mutual labels:  free
Sofia
Cutomize your discord profile.
Stars: ✭ 18 (-83.64%)
Mutual labels:  free
octobercms-juicy-theme
Clean, simple and responsive landing page build on Vue.js with backend editing
Stars: ✭ 20 (-81.82%)
Mutual labels:  free
singlefile
featured cs:go internal hack, one file and less than 1000 lines.
Stars: ✭ 47 (-57.27%)
Mutual labels:  free
tonix
Tonix provides basic file system functionality, as well as an interactive shell with a Unix-style command line interface.
Stars: ✭ 20 (-81.82%)
Mutual labels:  everscale
add-to-calendar-button
A convenient JavaScript snippet, which lets you create beautiful buttons, where people can add events to their calendars.
Stars: ✭ 697 (+533.64%)
Mutual labels:  free
gpt-j
A GPT-J API to use with python3 to generate text, blogs, code, and more
Stars: ✭ 101 (-8.18%)
Mutual labels:  free
tf-free
Create cloud-native resources on all the major cloud providers, completely free of charge. This project is currently under heavy development.
Stars: ✭ 107 (-2.73%)
Mutual labels:  free
sparrowx
Minimal, SEO-friendly, Jekyll + Netlify CMS Boilerplate.
Stars: ✭ 15 (-86.36%)
Mutual labels:  free

Ever SDK

Core Client Library built on the EVER OS GraphQL API for Everscale DApp development

Get quick help in our telegram channel:

Channel on Telegram

Content Table

Useful links

Quick Start (Javascript)

Error descriptions

JavaScript SDK Types and Methods (API Reference)

Core Types and Methods (API Reference)

Guides

What is Core Everscale 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.

Library works over GraphQL API of EVER OS DApp Server. So, it can be used to interact directly with EVER OS Clouds.

SDKs in other languages (bindings over Ever-SDK)

Binding is a thin client library written on the specific language that acts like a bridge between a client library and an application code written on that language.

Official Javascript(Typescript) SDK

Supported platforms: Node.js, Web, React-Native for IOS/Android

Repository: JavaScript SDK

Community bindings

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

radianceteam/ton-client-go
move-ton/ever-client-go

Java radianceteam/ton-client-java
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
Typescript RSquad/ton-client-ts

How to use library

The simplest way is to use library in then Rust applications because of the native Rust library interface. The Rust interface is clear and well documented.

But what if you are required to use library in languages others than Rust?

You have some options:

  • 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.
  • use bindings already written by TON Labs and community. Below you can find a list of known bindings.
  • 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

Download precompiled binaries

Instead of building library yourself, you can download the latest precompiled binaries from TON Labs 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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].