Skip to content

Commit

Permalink
v1.27.1
Browse files Browse the repository at this point in the history
  • Loading branch information
igor-vasilev committed Dec 12, 2021
1 parent c545ddf commit 38e5fa2
Show file tree
Hide file tree
Showing 9 changed files with 426 additions and 34 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Java library for TON Client

[![SDK version](https://img.shields.io/badge/TON%20SDK%20version-1.26.1-green)](https://github.com/tonlabs/TON-SDK/tree/1.26.1)
[![SDK version](https://img.shields.io/badge/TON%20SDK%20version-1.27.1-green)](https://github.com/tonlabs/TON-SDK/tree/1.27.1)

The Library is a binding for [TONOS Client](https://github.com/tonlabs/TON-SDK) written in Java
that act as a bridge between TONOS Client and a Java application. The library includes original
Expand Down Expand Up @@ -42,7 +42,7 @@ Follow installation instructions from https://docs.docker.com/engine/install/
```
$ mvn test
```
- If succeed, you can find "ton-client-binding-1.26.1-jar-with-dependencies.jar" file located under ${Project_basedir}/binding/target
- If succeed, you can find "ton-client-binding-1.27.1-jar-with-dependencies.jar" file located under ${Project_basedir}/binding/target


### Clean
Expand All @@ -60,7 +60,7 @@ To use it in your projects, add the dependency to `pom.xml`
<dependency>
<groupId>com.radiance.tonclient</groupId>
<artifactId>ton-client-binding</artifactId>
<version>1.26.1</version>
<version>1.27.1</version>
</dependency>
...
```
Expand Down
101 changes: 100 additions & 1 deletion binding/api.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.26.1",
"version": "1.27.1",
"modules": [
{
"name": "client",
Expand Down Expand Up @@ -5856,6 +5856,67 @@
"summary": null,
"description": null
},
{
"name": "ParamsOfEncodeInitialData",
"type": "Struct",
"struct_fields": [
{
"name": "abi",
"type": "Optional",
"optional_inner": {
"type": "Ref",
"ref_name": "abi.Abi"
},
"summary": "Contract ABI",
"description": null
},
{
"name": "initial_data",
"type": "Optional",
"optional_inner": {
"type": "Ref",
"ref_name": "Value"
},
"summary": "List of initial values for contract's static variables.",
"description": "`abi` parameter should be provided to set initial data"
},
{
"name": "initial_pubkey",
"type": "Optional",
"optional_inner": {
"type": "String"
},
"summary": "Initial account owner's public key to set into account data",
"description": null
},
{
"name": "boc_cache",
"type": "Optional",
"optional_inner": {
"type": "Ref",
"ref_name": "boc.BocCacheType"
},
"summary": "Cache type to put the result. The BOC itself returned if no cache type provided.",
"description": null
}
],
"summary": null,
"description": null
},
{
"name": "ResultOfEncodeInitialData",
"type": "Struct",
"struct_fields": [
{
"name": "data",
"type": "String",
"summary": "Updated data BOC or BOC handle",
"description": null
}
],
"summary": null,
"description": null
},
{
"name": "ParamsOfDecodeInitialData",
"type": "Struct",
Expand Down Expand Up @@ -6331,6 +6392,44 @@
},
"errors": null
},
{
"name": "encode_initial_data",
"summary": "Encodes initial account data with initial values for the contract's static variables and owner's public key into a data BOC that can be passed to `encode_tvc` function afterwards.",
"description": "This function is analogue of `tvm.buildDataInit` function in Solidity.",
"params": [
{
"name": "context",
"type": "Generic",
"generic_name": "Arc",
"generic_args": [
{
"type": "Ref",
"ref_name": "ClientContext"
}
],
"summary": null,
"description": null
},
{
"name": "params",
"type": "Ref",
"ref_name": "abi.ParamsOfEncodeInitialData",
"summary": null,
"description": null
}
],
"result": {
"type": "Generic",
"generic_name": "ClientResult",
"generic_args": [
{
"type": "Ref",
"ref_name": "abi.ResultOfEncodeInitialData"
}
]
},
"errors": null
},
{
"name": "decode_initial_data",
"summary": "Decodes initial values of a contract's static variables and owner's public key from account initial data This operation is applicable only for initial account data (before deploy). If the contract is already deployed, its data doesn't contain this data section any more.",
Expand Down
2 changes: 1 addition & 1 deletion binding/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.radiance.tonclient</groupId>
<artifactId>ton-client-binding</artifactId>
<version>1.26.1</version>
<version>1.27.1</version>

<name>ton-client-binding</name>
<!-- FIXME change it to the project's website -->
Expand Down
13 changes: 13 additions & 0 deletions binding/src/main/java/com/radiance/tonclient/Abi.java
Original file line number Diff line number Diff line change
Expand Up @@ -1547,6 +1547,19 @@ public CompletableFuture<String> updateInitialData(ABI abi, String data, Object
.thenApply(json -> TONContext.convertValue(json.findValue("data"), String.class));
}

/**
* This function is analogue of `tvm.buildDataInit` function in Solidity.
*
* @param abi
* @param initialData `abi` parameter should be provided to set initial data
* @param initialPubkey
* @param bocCache
*/
public CompletableFuture<String> encodeInitialData(ABI abi, Object initialData, String initialPubkey, Boc.BocCacheType bocCache) {
return context.requestJSON("abi.encode_initial_data", "{"+Stream.of((abi==null?null:("\"abi\":"+abi)),(initialData==null?null:("\"initial_data\":"+initialData)),(initialPubkey==null?null:("\"initial_pubkey\":\""+initialPubkey+"\"")),(bocCache==null?null:("\"boc_cache\":"+bocCache))).filter(_f -> _f != null).collect(Collectors.joining(","))+"}")
.thenApply(json -> TONContext.convertValue(json.findValue("data"), String.class));
}

/**
*
*
Expand Down
2 changes: 1 addition & 1 deletion build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ SET PROJECT_DIR=%~dp0
SET TON_DIR=%PROJECT_DIR%\target\TON-SDK

IF NOT EXIST %TON_DIR% (
git clone --single-branch --branch 1.26.1 https://github.com/tonlabs/TON-SDK.git %TON_DIR%
git clone --single-branch --branch 1.27.1 https://github.com/tonlabs/TON-SDK.git %TON_DIR%
)

cd jni
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
tondir=target/TON-SDK

projectdir=`pwd`
branch=1.26.1
branch=1.27.1
#`git rev-parse --abbrev-ref HEAD`

[ -d "$tondir" ] || git clone --single-branch --branch $branch https://github.com/tonlabs/TON-SDK.git $tondir
Expand Down
Loading

0 comments on commit 38e5fa2

Please sign in to comment.