Skip to content

Commit

Permalink
Merge pull request #338 from tonlabs/1.7.0-rc
Browse files Browse the repository at this point in the history
Version 1.7.0
  • Loading branch information
d3p authored Feb 9, 2021
2 parents 4d34e4d + ab99ed5 commit ef19c55
Show file tree
Hide file tree
Showing 61 changed files with 4,923 additions and 559 deletions.
77 changes: 48 additions & 29 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,25 @@
# Release Notes
All notable changes to this project will be documented in this file.

## 1.7.0 Feb 9, 2021
### New
- BOC cache management functions were introduced:
- `boc.cache_set`,
- `boc.cache_get`
- `boc.cache_unpin`
- Now functions that take boc as a parameter can also take a reference to boc cash instead so that it deсreases the number of boc serialization
and deserializations which drastically improves performance of `run_tvm` and `run_executor` expecially in case of numerous calls on the same data.
- `boc_cache` parameter in `tvm.run_tvm` and `tvm.run_executor` functions to save resulting messages and account BOCs into cache.
- `return_updated_account` flag parameter introduced in `tvm.run_tvm` and `tvm.run_executor` functions to return updated account state. Important: by default this flag is `false` and account data is not returned.
- `abi.encode_internal_message` function to encode an internal ABI-compatible message.
- **Debot Module**:
- Support for get-methods and external calls in debots.
Debots can send external inbound messages to destination contracts (signed - for external calls and unsigned - for get-methods) using native language syntax without actions.
- Built-in debot interfaces (interfaces implemented by DEngine).
Added two built-in interfaces: base64 and Sdk.
- Added `DebotInterfaceExecutor` to automatically route messages to destination interfaces.
- Debot's `fetch` function is optional now. New debots can implement only `start` function.

## 1.6.3 Feb 4, 2021
### Fixed
- Expired message wasn't retried if local execution succeeded.
Expand All @@ -20,7 +39,7 @@ All notable changes to this project will be documented in this file.
- `aggregate_collection` function as a wrapper for GraphQL aggregation queries.
- `batch_query` function performs multiple queries per single fetch.
- Active endpoint invalidation in case of network error occurring.
- `network.network_retries_count` config parameter is deprecated. `network.max_reconnect_timeout` is introduced that allows to specify maximum network resolving timeout. Default value is 2 min.
- `network.network_retries_count` config parameter is deprecated. `network.max_reconnect_timeout` is introduced that allows to specify maximum network resolving timeout. Default value is 2 min.
- `initial_pubkey` field in `DeploySet` to specify public key instead of one from TVC file or provided by signer.
- Support for debot interfaces:
- `send` Browser Callback to send messages with interface calls to Browser.
Expand All @@ -37,7 +56,7 @@ All notable changes to this project will be documented in this file.
- `net` module functions waits for `net.resume` call instead of returning error if called while the module is suspended

### Documentation
- How to work with `Application Objects` [specification](docs/app_objects.md) added
- How to work with `Application Objects` [specification](docs/app_objects.md) added

## 1.5.1 Dec 28, 2020

Expand All @@ -49,7 +68,7 @@ All notable changes to this project will be documented in this file.
### New
- `reconnect_timeout` parameter in `NetworkConfig`.
- `endpoints` parameter in `NetworkConfig`. It contains the list of available server addresses to connect.
SDK will use one them with the least connect time. `server_address` parameter is still supported but
SDK will use one them with the least connect time. `server_address` parameter is still supported but
`endpoints` is prevailing.
- `net.fetch_endpoints` function to receive available endpoints from server.
- `net.set_endpoints` function to set endpoints list for using on next reconnect.
Expand All @@ -75,33 +94,33 @@ SDK will use one them with the least connect time. `server_address` parameter is
- **Debot Module:**
- Invoked debot terminated correctly after error occurred during
execution of one of its actions. Initial prev_state of invoked debot
changed to STATE_EXIT.
changed to STATE_EXIT.
- Fixed double jumping to current context in invoker debot after
returning control to it from invoked debot.
- Fixed conversation of exception codes thrown by debots to their user-friendly description.

## 1.3.0 Dec 8, 2020

### Featured
- `net.query` method . Performs custom graphql query that can be copied directly from the playground.
- `net.query` method . Performs custom graphql query that can be copied directly from the playground.
- `net.suspend` and `net.resume` methods for disabling and enabling network activity. One of the possible use-cases is to manage subscriptions when a mobile application is brought to the background and into the foreground again.
- Smart summary and description doc separation.
- ts-generator includes doc comments in JSDoc format.

## 1.2.0 Nov 26, 2020

### Featured
- **UNSTABLE API. This API is experimental. It can be changed in the next releases**.
`debot` module was added with debot engine functions, such as : `start`, `fetch`, `execute`, `remove`. See the `debot` module documentation for more info.
Check our tests for code examples.

- External signing was supported for message encoding: `SigningBox` type for `Signer` enum was supported.
Now it is possible to sign messages with externally implemented signing box interface without private key disclosure to the library. Can be used in case of signing via HSM API or via cold wallet - when there is no access to the private key.
It is also possible to create a Signing Box instance inside SDK - from a key pair passed into the library with `get_signing_box` method. It can be used for some test cases. Also it increases security - you need to pass your keys one time only.
Check the `crypto` module documentation for `SigningBoxHandle` type and `register_signing_box`, `get_signing_box`, `signing_box_get_public_key`, `signing_box_sign`.
Check our tests for code examples.
- **UNSTABLE API. This API is experimental. It can be changed in the next releases**.
`debot` module was added with debot engine functions, such as : `start`, `fetch`, `execute`, `remove`. See the `debot` module documentation for more info.
Check our tests for code examples.

- External signing was supported for message encoding: `SigningBox` type for `Signer` enum was supported.
Now it is possible to sign messages with externally implemented signing box interface without private key disclosure to the library. Can be used in case of signing via HSM API or via cold wallet - when there is no access to the private key.

It is also possible to create a Signing Box instance inside SDK - from a key pair passed into the library with `get_signing_box` method. It can be used for some test cases. Also it increases security - you need to pass your keys one time only.

Check the `crypto` module documentation for `SigningBoxHandle` type and `register_signing_box`, `get_signing_box`, `signing_box_get_public_key`, `signing_box_sign`.
Check our tests for code examples.

### Fixed
- panic after `tc_destroy_context` call. Now all contexts use global async runtime
Expand All @@ -123,23 +142,23 @@ instead of prev `[].into()`
## 1.1.0 Nov 3, 2020

### New
- ChaCha20 encryption support `crypto.chacha20`.
- ChaCha20 encryption support `crypto.chacha20`.
- `boc.parse_shardstate` function for shardstates parsing.
- `boc.get_boc_hash` function for calculating BOC root hash
- `client.build_info` fully defined and documented.
- `processing.wait_for_transaction` and `processing.process_message` functions execute contract
- `processing.wait_for_transaction` and `processing.process_message` functions execute contract
locally in case if transaction waiting fails in order to resolve the contract execution error
- `run_executor`, `run_tvm` now return `exit_arg` in case of TVM errors.
- `run_executor`, `run_tvm` now return `exit_arg` in case of TVM errors.
- Create the `build_info.json` on the build stage.
- `Abi::Contract` variant as an alias to deprecated `Abi::Serialized`
- `Abi::Json` variant to specify an ABI as a raw JSON string.
- `api.json` now contains details about numeric types: Number and BigInt are now
- `Abi::Json` variant to specify an ABI as a raw JSON string.
- `api.json` now contains details about numeric types: Number and BigInt are now
have new fields `number_type` and `number_size`.
- `api.json` ref type names are fully qualified now in form of `module.type`,
for example `abi.Signer`.

### Fixed
- TS generator fix some field names that is an invalid JS identifiers.
- TS generator fix some field names that is an invalid JS identifiers.
- Use `install_name_tool` to fix loading library paths at `libton_client.dylib`.
- `api.json` is reduced, so it can't contains tuple types, only structs.
All types are exactly match to JSON.
Expand Down Expand Up @@ -217,18 +236,18 @@ produce the same result as node
## 0.25.4 Aug 5, 2020
### Fixed
- `waitForTransaction` didn't use prev_alt_ref for block walking

## 0.25.3 Jul 30, 2020
### New
- All methods that require contract's code/data can use field `boc`
in account document to extract code and data
- All methods that require contract's code/data can use field `boc`
in account document to extract code and data
(instead of `code` and `data` fields).
- Optional `bocBase64` parameter of method `tvm.get` that can be used
instead of `codeBase64` and `dataBase64`.
- Optional `bocBase64` parameter of method `tvm.get` that can be used
instead of `codeBase64` and `dataBase64`.

## 0.25.2 Jul 29, 2020
### New
- `error.data` object extended with fields `address`, `function_name`, `account_balance`,
- `error.data` object extended with fields `address`, `function_name`, `account_balance`,
`account_address`, `query_url`, `config_server` for appropriate errors

## 0.25.0 Jul 8, 2020
Expand All @@ -238,7 +257,7 @@ produce the same result as node
- time sync check while initializing
- parallel requests on different contexts don't block each other. Requests on the same context
remain sequential
- new transaction wait mechanism. All account's shard blocks are checked for transaction to
- new transaction wait mechanism. All account's shard blocks are checked for transaction to
guarantee message expiration
- `contracts.wait.transaction` function for awaiting previously sent message processing
- `contracts.send.message` returns message processing state for `contracts.wait.transaction` function
Expand Down
48 changes: 36 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

**Community links:**

[![Channel on Telegram](https://img.shields.io/badge/chat-on%20telegram-9cf.svg)](https://t.me/freeton_sdk) [![Gitter](https://badges.gitter.im/ton-sdk/community.svg)](https://gitter.im/ton-sdk/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
[![Channel on Telegram](https://img.shields.io/badge/chat-on%20telegram-9cf.svg)](https://t.me/freeton_sdk)

**Documentation**

Expand Down Expand Up @@ -44,7 +44,7 @@ a client library and an application code written on that language.
Platforms: Node.js, Web, React-Native for IOS/Android
- [ton-client-js](https://github.com/tonlabs/ton-client-js)

## Communinty bindings
## Community bindings

Language | Repo
-------- | --------------
Expand Down Expand Up @@ -95,7 +95,7 @@ Look at the example below:
```rust
#[derive(Default)]
struct ParamsOfFoo {
pub foo: String,
pub foo: String,
}

pub fn foo(params: ParamsOfFoo)
Expand All @@ -105,7 +105,7 @@ pub fn foo(params: ParamsOfFoo)

```rust
foo(ParamsOfFoo {
foo: "foo".into(),
foo: "foo".into(),
});
```

Expand All @@ -114,8 +114,8 @@ foo(ParamsOfFoo {
```rust
#[derive(Default)]
struct ParamsOfFoo {
pub foo: String,
pub bar: Option<String>,
pub foo: String,
pub bar: Option<String>,
}
```

Expand All @@ -124,17 +124,14 @@ From the perspective of JSON-interface it isn't breaking change because the new
4) To avoid such problems we recommend to use default implementation inside structure initialisation:

```rust
oo(ParamsOfFoo {
foo: "foo".into(),
..Default::default(),
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.
Expand All @@ -151,6 +148,33 @@ Note that the build script generates binaries compatible with the platform used

**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`:

```shell
cd toncli
cargo run api -o ../tools
```

Rebuild `docs`:

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

Rebuild `modules.ts`:

```shell
cd tools
npm i
tsc
node index binding -l ts -o ../../ton-client-js/packages/core/src
```

# Download precompiled binaries

Instead of building library yourself, you can download the __latest__ precompiled binaries from
Expand Down
2 changes: 1 addition & 1 deletion api/derive/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "api_derive"
version = "1.6.3"
version = "1.7.0"
authors = ["TON DEV SOLUTIONS LTD <[email protected]>"]
edition = "2018"

Expand Down
2 changes: 1 addition & 1 deletion api/info/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "api_info"
version = "1.6.3"
version = "1.7.0"
authors = ["TON DEV SOLUTIONS LTD <[email protected]>"]
edition = "2018"

Expand Down
2 changes: 1 addition & 1 deletion api/test/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "api_test"
version = "1.6.3"
version = "1.7.0"
authors = ["TON DEV SOLUTIONS LTD <[email protected]>"]
edition = "2018"

Expand Down
Loading

0 comments on commit ef19c55

Please sign in to comment.