Skip to content

Commit

Permalink
v1.35.1
Browse files Browse the repository at this point in the history
  • Loading branch information
igor-vasilev committed Jul 3, 2022
1 parent 53a575e commit 53f6734
Show file tree
Hide file tree
Showing 11 changed files with 352 additions and 404 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 Everscale Client

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

The Library is a binding for [Everscale Client](https://github.com/tonlabs/EVER-SDK) written in Java
that act as a bridge between Everscale 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 "everscale-client-binding-1.34.3-jar-with-dependencies.jar" file located under ${Project_basedir}/binding/target
- If succeed, you can find "everscale-client-binding-1.35.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>everscale-client-binding</artifactId>
<version>1.34.3</version>
<version>1.35.1</version>
</dependency>
...
```
Expand Down
102 changes: 101 additions & 1 deletion binding/api.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.34.3",
"version": "1.35.0",
"modules": [
{
"name": "client",
Expand Down Expand Up @@ -5374,6 +5374,13 @@
"value": "314",
"summary": null,
"description": null
},
{
"name": "InvalidFunctionName",
"type": "Number",
"value": "315",
"summary": null,
"description": null
}
],
"summary": null,
Expand Down Expand Up @@ -6950,6 +6957,52 @@
],
"summary": null,
"description": null
},
{
"name": "ParamsOfCalcFunctionId",
"type": "Struct",
"struct_fields": [
{
"name": "abi",
"type": "Ref",
"ref_name": "abi.Abi",
"summary": "Contract ABI.",
"description": null
},
{
"name": "function_name",
"type": "String",
"summary": "Contract function name",
"description": null
},
{
"name": "output",
"type": "Optional",
"optional_inner": {
"type": "Boolean"
},
"summary": "If set to `true` output function ID will be returned which is used in contract response. Default is `false`",
"description": null
}
],
"summary": null,
"description": null
},
{
"name": "ResultOfCalcFunctionId",
"type": "Struct",
"struct_fields": [
{
"name": "function_id",
"type": "Number",
"number_type": "UInt",
"number_size": 32,
"summary": "Contract function ID",
"description": null
}
],
"summary": null,
"description": null
}
],
"functions": [
Expand Down Expand Up @@ -7484,6 +7537,44 @@
]
},
"errors": null
},
{
"name": "calc_function_id",
"summary": "Calculates contract function ID by contract ABI",
"description": null,
"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.ParamsOfCalcFunctionId",
"summary": null,
"description": null
}
],
"result": {
"type": "Generic",
"generic_name": "ClientResult",
"generic_args": [
{
"type": "Ref",
"ref_name": "abi.ResultOfCalcFunctionId"
}
]
},
"errors": null
}
]
},
Expand Down Expand Up @@ -10512,6 +10603,15 @@
},
"summary": "transaction logical time",
"description": null
},
{
"name": "chksig_always_succeed",
"type": "Optional",
"optional_inner": {
"type": "Boolean"
},
"summary": "Overrides standard TVM behaviour. If set to `true` then CHKSIG always will return `true`.",
"description": null
}
],
"summary": null,
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>everscale-client-binding</artifactId>
<version>1.34.3</version>
<version>1.35.1</version>

<name>everscale-client-binding</name>
<!-- FIXME change it to the project's website -->
Expand Down
12 changes: 12 additions & 0 deletions binding/src/main/java/com/radiance/tonclient/Abi.java
Original file line number Diff line number Diff line change
Expand Up @@ -1599,4 +1599,16 @@ public CompletableFuture<String> encodeBoc(AbiParam[] params, Object data, Boc.B
.thenApply(json -> TONContext.convertValue(json.findValue("boc"), String.class));
}

/**
*
*
* @param abi
* @param functionName
* @param output
*/
public CompletableFuture<Number> calcFunctionId(ABI abi, String functionName, Boolean output) {
return context.requestJSON("abi.calc_function_id", "{"+Stream.of((abi==null?null:("\"abi\":"+abi)),(functionName==null?null:("\"function_name\":\""+functionName+"\"")),(output==null?null:("\"output\":"+output))).filter(_f -> _f != null).collect(Collectors.joining(","))+"}")
.thenApply(json -> TONContext.convertValue(json.findValue("function_id"), Number.class));
}

}
30 changes: 29 additions & 1 deletion binding/src/main/java/com/radiance/tonclient/Tvm.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,19 @@ public class Tvm {
*/
public static class ExecutionOptions {

public ExecutionOptions(String blockchainConfig, Number blockTime, Long blockLt, Long transactionLt, Boolean chksigAlwaysSucceed) {

this.blockchainConfig = blockchainConfig;

this.blockTime = blockTime;

this.blockLt = blockLt;

this.transactionLt = transactionLt;

this.chksigAlwaysSucceed = chksigAlwaysSucceed;

}
public ExecutionOptions(String blockchainConfig, Number blockTime, Long blockLt, Long transactionLt) {

this.blockchainConfig = blockchainConfig;
Expand Down Expand Up @@ -112,10 +125,25 @@ public void setTransactionLt(Long value) {
this.transactionLt = value;
}

@JsonProperty("chksig_always_succeed")
private Boolean chksigAlwaysSucceed;
/**
*
*/
public Boolean getChksigAlwaysSucceed() {
return chksigAlwaysSucceed;
}
/**
*
*/
public void setChksigAlwaysSucceed(Boolean value) {
this.chksigAlwaysSucceed = value;
}


@Override
public String toString() {
return "{"+Stream.of((blockchainConfig==null?null:("\"blockchain_config\":\""+blockchainConfig+"\"")),(blockTime==null?null:("\"block_time\":"+blockTime)),(blockLt==null?null:("\"block_lt\":"+blockLt)),(transactionLt==null?null:("\"transaction_lt\":"+transactionLt))).filter(_f -> _f != null).collect(Collectors.joining(","))+"}";
return "{"+Stream.of((blockchainConfig==null?null:("\"blockchain_config\":\""+blockchainConfig+"\"")),(blockTime==null?null:("\"block_time\":"+blockTime)),(blockLt==null?null:("\"block_lt\":"+blockLt)),(transactionLt==null?null:("\"transaction_lt\":"+transactionLt)),(chksigAlwaysSucceed==null?null:("\"chksig_always_succeed\":"+chksigAlwaysSucceed))).filter(_f -> _f != null).collect(Collectors.joining(","))+"}";
}
}
public static abstract class AccountForExecutor {
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.34.3 https://github.com/tonlabs/TON-SDK.git %TON_DIR%
git clone --single-branch --branch 1.35.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.34.3
branch=1.35.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
2 changes: 1 addition & 1 deletion examples/Crypto/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<dependency>
<groupId>com.radiance.tonclient</groupId>
<artifactId>everscale-client-binding</artifactId>
<version>1.34.3</version>
<version>1.35.1</version>
</dependency>

<dependency>
Expand Down
Loading

0 comments on commit 53f6734

Please sign in to comment.