diff --git a/CHANGELOG.md b/CHANGELOG.md
index ebe0ae7..e4e001c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,11 +1,20 @@
+### 3.1.2
+
+- Better support for AppObjects
+
+### 3.0.4
+
+- Fixes for multi-threading work
+- Some optimizations
+
### 3.0.0
-- Updated baseline JDK -> 21
+- Updated baseline JDK -> 22
- Updated **EVER-SDK** generated code -> **1.45.0**
- Supported `server-code` data in EVER-SDK error handling, inconsistencies with different GQL versions are now ignorable
- Fixes for subscriptions workflow
- Updated Jackson -> 2.16.1
-- Updated Gradle -> 8.6
+- Updated Gradle -> 8.8
Tests:
diff --git a/README.md b/README.md
index e7645d7..38c5798 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
# EVER-SDK for Java
-[](https://shields.io/)
+[](https://shields.io/)
[](https://github.com/tonlabs/ever-sdk)
[](https://shields.io/)
@@ -31,7 +31,7 @@ that is based on this binding for easier work with TVM blockchains.
#### Prerequisites
-* Install **JDK 21** ([link](https://adoptium.net/temurin/releases?version=20))
+* Install **JDK 22** ([link](https://adoptium.net/temurin/releases?version=20))
#### Add java4ever to your Maven of Gradle setup:
@@ -39,7 +39,7 @@ that is based on this binding for easier work with TVM blockchains.
```groovy
dependencies {
- implementation 'tech.deplant.java4ever:java4ever-binding:3.0.0'
+ implementation 'tech.deplant.java4ever:java4ever-binding:3.1.2'
}
```
@@ -50,34 +50,72 @@ dependencies {
tech.deplant.java4ever
java4ever-binding
- 3.0.0
+ 3.1.2
```
-### Creating EVER-SDK Context
+## Examples and Guides
-If you use default EVER-SDK lib (_latest EVER-SDK that is included in the distribution_),
-you can create EverSdkContext object as following:
+### Setting up SDK
+**SDK** setup consists of two steps:
+1. Loading EVER-SDK library (should be done once)
+2. Creating context/session with certain config (should be done for every new endpoint or config change)
+
+Both steps are described below.
+
+#### Loading EVER-SDK library
+
+To load EVER-SDK connection to JVM, use `EverSdk.load()` static method.
+Loaded EVER-SDK is a singleton, you can't use other version of library simultaneously.
+Java4Ever stores wrapped copy of actual EVER-SDK libraries in its resources. To load wrapped library, run:
+```java
+EverSdk.load();
+```
+**Note: We found problems with loading library from resources using Spring's fatJar bundles. Please, use alternative loaders if you use fatJar too.**
+
+If you want to use custom binaries or version, you should use other loaders.
+All loaders are just ways to reach library, so you should get/build `ton_client` library first.
+You can find EverX [precompiled EVER-SDK files](https://github.com/tonlabs/ever-sdk/blob/master/README.md#download-precompiled-binaries) here.
+Here are the examples of loader options:
```java
-EverSdkContext ctx = EverSdkContext.builder()
- .setConfigJson(configJson)
- .buildNew();
+// loads library from path saved in environment variable
+EverSdk.load(AbsolutePathLoader.ofSystemEnv("TON_CLIENT_LIB"));
+// loads library from ~ (user home)
+EverSdk.load(AbsolutePathLoader.ofUserDir("libton_client.so"));
+// loads from any absolute path
+EverSdk.load(new AbsolutePathLoader(Path.of("/home/ton/lib/libton_client.so")));
+// loads library from java.library.path JVM argument
+EverSdk.load(new JavaLibraryPathLoader("ton_client"));
```
-To use custom one, specify it in buildNew() method:
+#### Creating config context and specifying endpoints
+
+Context configuration is needed to provide EVER-SDK library with your endpoints, timeouts and other settings.
+You can find a list of endpoints here: https://docs.evercloud.dev/products/evercloud/networks-endpoints
+If you're working with Everscale mainnet, here you can register your app and receive "ProjectID" part of the URL: https://dashboard.evercloud.dev/
```java
-EverSdkContext ctx = EverSdkContext.builder()
- .setConfigJson(configJson)
- .buildNew(new AbsolutePathLoader(Path.of("\home\ton\lib\libton_client.so")));
+// creates default EVER-SDK context without specifying endpoints
+int contextId1 = EverSdk.createDefault();
+// creates default EVER-SDK with specified endpoint
+int contextId2 = EverSdk.createWithEndpoint("http://localhost/graphql");
+// creates EVER-SDK context from ready JSON string
+int contextId4 = EverSdk.createWithJson(configJsonString);
```
-Variants of loading ton_client lib:
-* `AbsolutePathLoader.ofSystemEnv("TON_CLIENT_LIB")` - path from Environment variable
-* `AbsolutePathLoader.ofUserDir("libton_client.so")` - file from ~ (user home)
-* `new AbsolutePathLoader(Path.of("\home\ton\lib\libton_client.so"))` - any absolute path
-* `new JavaLibraryPathLoader("ton_client");` - gets library from java.library.path JVM argument
+Save your contextId, you will use this id to call EVER-SDK methods.
+
+#### Configuring SDK with Builder
+
+Alternatively, you can call EverSdk.builder() that provides builder methods for all config values of EVER-SDK.
+Thus you can easily configure only needed parts of library.
+```java
+int contextId3 = EverSdk.builder()
+ .networkEndpoints("http://localhost/graphql")
+ .networkQueryTimeout(300_000L)
+ .build();
+```
### Calling EVER-SDK methods
@@ -85,7 +123,10 @@ It's very simple, just type ModuleName.methodName (list of modules and methods i
Note that method names are converted from snake_case to camelCase. Then pass EverSdkContext object as 1st parameter. That's all.
```java
-Client.version(ctx);
+int contextId = TestEnv.newContextEmpty();
+var asyncResult = Client.version(contextId);
+var syncResult = EverSdk.await(asyncResult);
+System.out.println("EVER-SDK Version: " + syncResult.version());
```
diff --git a/build.gradle b/build.gradle
index 99a81c9..29eb9bc 100644
--- a/build.gradle
+++ b/build.gradle
@@ -8,6 +8,7 @@ group v_groupId
version v_version
repositories {
+ mavenLocal()
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/deplant/maven-artifactory")
@@ -122,6 +123,14 @@ java {
withSourcesJar()
}
+jar {
+ manifest {
+ attributes(
+ 'Enable-Native-Access': 'java4ever.binding',
+ )
+ }
+}
+
// Task for JavaPoet generation of EVER-SDK API
task generateEverSdkApi(type: JavaExec) {
group = "other"
@@ -148,8 +157,8 @@ tasks.register('generateFfmApiBridge') {
exec {
workingDir "${projectDir}"
executable jextractPath
- standardOutput = stdout;
- args "--source", "${projectDir}/jextract/ton_client.h", "--output", "${projectDir}/src/gen/java", "--target-package", "tech.deplant.java4ever.binding.ffi", "--header-class-name", "ton_client"
+ standardOutput = stdout
+ args "--output", "${projectDir}/src/gen/java", "--target-package", "tech.deplant.java4ever.binding.ffi", "--header-class-name", "ton_client", "${projectDir}/jextract/ton_client.h"
}
stdout.toString().trim()
println "FFM API generation ended."
@@ -157,40 +166,32 @@ tasks.register('generateFfmApiBridge') {
tasks.withType(Javadoc).configureEach {
javadocTool = javaToolchains.javadocToolFor {
- languageVersion = JavaLanguageVersion.of(21)
+ languageVersion = JavaLanguageVersion.of(jdkVersion)
}
- failOnError false
options.addBooleanOption('html5', true)
options.addStringOption('encoding', 'UTF-8')
options.addStringOption('charSet', 'UTF-8')
- options.addBooleanOption('-enable-preview', true)
- options.addStringOption('-release', '21')
- options.addBooleanOption('-ignore-source-errors', true)
+ options.addStringOption('-release', "$jdkVersion")
options.addStringOption('Xdoclint:none', '-quiet')
}
tasks.withType(JavaCompile).configureEach {
- sourceCompatibility = JavaVersion.VERSION_21
- targetCompatibility = JavaVersion.VERSION_21
+ sourceCompatibility = JavaLanguageVersion.of(jdkVersion)
+ targetCompatibility = JavaLanguageVersion.of(jdkVersion)
javaCompiler = javaToolchains.compilerFor {
- languageVersion = JavaLanguageVersion.of(21)
+ languageVersion = JavaLanguageVersion.of(jdkVersion)
}
- options.compilerArgs += "--enable-preview"
}
tasks.withType(JavaExec).configureEach {
javaLauncher = javaToolchains.launcherFor {
- languageVersion = JavaLanguageVersion.of(21)
+ languageVersion = JavaLanguageVersion.of(jdkVersion)
}
- jvmArgs += "--enable-preview"
- jvmArgs += "--enable-native-access=java4ever.binding"
}
tasks.withType(Test) {
javaLauncher = javaToolchains.launcherFor {
- languageVersion = JavaLanguageVersion.of(21)
+ languageVersion = JavaLanguageVersion.of(jdkVersion)
}
useJUnitPlatform()
- jvmArgs += "--enable-preview"
- jvmArgs += "--enable-native-access=ALL-UNNAMED"
}
\ No newline at end of file
diff --git a/gradle.properties b/gradle.properties
index 9e27282..4ef49e6 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -2,12 +2,13 @@ org.gradle.java.installations.fromEnv=JAVA_HOME
org.gradle.java.installations.auto-detect=true
org.gradle.java.installations.auto-download=false
# product version
-v_version=3.0.4-SNAPSHOT
+v_version=3.1.2
# dependencies
+jdkVersion=22
junitVersion=5.10.1
jpingVersion=0.0.3
jacksonVersion=2.16.1
-commonsVersion=0.7.0-SNAPSHOT
+commonsVersion=0.7.0
javapoetVersion=2.0.0
slf4jVersion=2.0.9
# publishing
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index a80b22c..a441313 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
diff --git a/src/gen/java/tech/deplant/java4ever/binding/Abi.java b/src/gen/java/tech/deplant/java4ever/binding/Abi.java
index f55d5e9..4f857de 100644
--- a/src/gen/java/tech/deplant/java4ever/binding/Abi.java
+++ b/src/gen/java/tech/deplant/java4ever/binding/Abi.java
@@ -9,11 +9,12 @@
import java.lang.Long;
import java.lang.String;
import java.math.BigInteger;
+import java.util.concurrent.CompletableFuture;
/**
* Abi
* Contains methods of "abi" module of EVER-SDK API
- *
+ *
* Provides message encoding and decoding according to the ABI specification.
* @version 1.45.0
*/
@@ -40,10 +41,10 @@ public final class Abi {
* created. Otherwise can be omitted. Destination address of the message
* @param signatureId Signature ID to be used in data to sign preparing when CapSignatureWithId capability is enabled
*/
- public static Abi.ResultOfEncodeMessageBody encodeMessageBody(int ctxId, Abi.ABI abi,
- Abi.CallSet callSet, Boolean isInternal, Abi.Signer signer, Integer processingTryIndex,
- String address, Long signatureId) throws EverSdkException {
- return EverSdk.call(ctxId, "abi.encode_message_body", new Abi.ParamsOfEncodeMessageBody(abi, callSet, isInternal, signer, processingTryIndex, address, signatureId), Abi.ResultOfEncodeMessageBody.class);
+ public static CompletableFuture encodeMessageBody(int ctxId,
+ Abi.ABI abi, Abi.CallSet callSet, Boolean isInternal, Abi.Signer signer,
+ Integer processingTryIndex, String address, Long signatureId) throws EverSdkException {
+ return EverSdk.async(ctxId, "abi.encode_message_body", new Abi.ParamsOfEncodeMessageBody(abi, callSet, isInternal, signer, processingTryIndex, address, signatureId), Abi.ResultOfEncodeMessageBody.class);
}
/**
@@ -52,9 +53,10 @@ public static Abi.ResultOfEncodeMessageBody encodeMessageBody(int ctxId, Abi.ABI
* @param message Must be encoded with `base64`. Unsigned message body BOC.
* @param signature Must be encoded with `hex`. Signature.
*/
- public static Abi.ResultOfAttachSignatureToMessageBody attachSignatureToMessageBody(int ctxId,
- Abi.ABI abi, String publicKey, String message, String signature) throws EverSdkException {
- return EverSdk.call(ctxId, "abi.attach_signature_to_message_body", new Abi.ParamsOfAttachSignatureToMessageBody(abi, publicKey, message, signature), Abi.ResultOfAttachSignatureToMessageBody.class);
+ public static CompletableFuture attachSignatureToMessageBody(
+ int ctxId, Abi.ABI abi, String publicKey, String message, String signature) throws
+ EverSdkException {
+ return EverSdk.async(ctxId, "abi.attach_signature_to_message_body", new Abi.ParamsOfAttachSignatureToMessageBody(abi, publicKey, message, signature), Abi.ResultOfAttachSignatureToMessageBody.class);
}
/**
@@ -105,15 +107,15 @@ public static Abi.ResultOfAttachSignatureToMessageBody attachSignatureToMessageB
*
* Expiration timeouts will grow with every retry.
* Retry grow factor is set in Client config:
- * <.....add config parameter with default value here>
+ * <.....add config parameter with default value here>
*
* Default value is 0. Processing try index.
* @param signatureId Signature ID to be used in data to sign preparing when CapSignatureWithId capability is enabled
*/
- public static Abi.ResultOfEncodeMessage encodeMessage(int ctxId, Abi.ABI abi, String address,
- Abi.DeploySet deploySet, Abi.CallSet callSet, Abi.Signer signer, Integer processingTryIndex,
- Long signatureId) throws EverSdkException {
- return EverSdk.call(ctxId, "abi.encode_message", new Abi.ParamsOfEncodeMessage(abi, address, deploySet, callSet, signer, processingTryIndex, signatureId), Abi.ResultOfEncodeMessage.class);
+ public static CompletableFuture encodeMessage(int ctxId, Abi.ABI abi,
+ String address, Abi.DeploySet deploySet, Abi.CallSet callSet, Abi.Signer signer,
+ Integer processingTryIndex, Long signatureId) throws EverSdkException {
+ return EverSdk.async(ctxId, "abi.encode_message", new Abi.ParamsOfEncodeMessage(abi, address, deploySet, callSet, signer, processingTryIndex, signatureId), Abi.ResultOfEncodeMessage.class);
}
/**
@@ -144,10 +146,11 @@ public static Abi.ResultOfEncodeMessage encodeMessage(int ctxId, Abi.ABI abi, St
* @param bounce Default is true. Flag of bounceable message.
* @param enableIhr Default is false. Enable Instant Hypercube Routing for the message.
*/
- public static Abi.ResultOfEncodeInternalMessage encodeInternalMessage(int ctxId, Abi.ABI abi,
- String address, String srcAddress, Abi.DeploySet deploySet, Abi.CallSet callSet, String value,
- Boolean bounce, Boolean enableIhr) throws EverSdkException {
- return EverSdk.call(ctxId, "abi.encode_internal_message", new Abi.ParamsOfEncodeInternalMessage(abi, address, srcAddress, deploySet, callSet, value, bounce, enableIhr), Abi.ResultOfEncodeInternalMessage.class);
+ public static CompletableFuture encodeInternalMessage(
+ int ctxId, Abi.ABI abi, String address, String srcAddress, Abi.DeploySet deploySet,
+ Abi.CallSet callSet, String value, Boolean bounce, Boolean enableIhr) throws
+ EverSdkException {
+ return EverSdk.async(ctxId, "abi.encode_internal_message", new Abi.ParamsOfEncodeInternalMessage(abi, address, srcAddress, deploySet, callSet, value, bounce, enableIhr), Abi.ResultOfEncodeInternalMessage.class);
}
/**
@@ -158,9 +161,9 @@ public static Abi.ResultOfEncodeInternalMessage encodeInternalMessage(int ctxId,
* @param message Unsigned message BOC encoded in `base64`.
* @param signature Signature encoded in `hex`.
*/
- public static Abi.ResultOfAttachSignature attachSignature(int ctxId, Abi.ABI abi,
- String publicKey, String message, String signature) throws EverSdkException {
- return EverSdk.call(ctxId, "abi.attach_signature", new Abi.ParamsOfAttachSignature(abi, publicKey, message, signature), Abi.ResultOfAttachSignature.class);
+ public static CompletableFuture attachSignature(int ctxId,
+ Abi.ABI abi, String publicKey, String message, String signature) throws EverSdkException {
+ return EverSdk.async(ctxId, "abi.attach_signature", new Abi.ParamsOfAttachSignature(abi, publicKey, message, signature), Abi.ResultOfAttachSignature.class);
}
/**
@@ -171,10 +174,10 @@ public static Abi.ResultOfAttachSignature attachSignature(int ctxId, Abi.ABI abi
* @param allowPartial Flag allowing partial BOC decoding when ABI doesn't describe the full body BOC. Controls decoder behaviour when after decoding all described in ABI params there are some data left in BOC: `true` - return decoded values `false` - return error of incomplete BOC deserialization (default)
* @param functionName Function name or function id if is known in advance
*/
- public static Abi.DecodedMessageBody decodeMessage(int ctxId, Abi.ABI abi, String message,
- Boolean allowPartial, String functionName, Abi.DataLayout dataLayout) throws
+ public static CompletableFuture decodeMessage(int ctxId, Abi.ABI abi,
+ String message, Boolean allowPartial, String functionName, Abi.DataLayout dataLayout) throws
EverSdkException {
- return EverSdk.call(ctxId, "abi.decode_message", new Abi.ParamsOfDecodeMessage(abi, message, allowPartial, functionName, dataLayout), Abi.DecodedMessageBody.class);
+ return EverSdk.async(ctxId, "abi.decode_message", new Abi.ParamsOfDecodeMessage(abi, message, allowPartial, functionName, dataLayout), Abi.DecodedMessageBody.class);
}
/**
@@ -186,10 +189,10 @@ public static Abi.DecodedMessageBody decodeMessage(int ctxId, Abi.ABI abi, Strin
* @param allowPartial Flag allowing partial BOC decoding when ABI doesn't describe the full body BOC. Controls decoder behaviour when after decoding all described in ABI params there are some data left in BOC: `true` - return decoded values `false` - return error of incomplete BOC deserialization (default)
* @param functionName Function name or function id if is known in advance
*/
- public static Abi.DecodedMessageBody decodeMessageBody(int ctxId, Abi.ABI abi, String body,
- Boolean isInternal, Boolean allowPartial, String functionName, Abi.DataLayout dataLayout)
- throws EverSdkException {
- return EverSdk.call(ctxId, "abi.decode_message_body", new Abi.ParamsOfDecodeMessageBody(abi, body, isInternal, allowPartial, functionName, dataLayout), Abi.DecodedMessageBody.class);
+ public static CompletableFuture decodeMessageBody(int ctxId, Abi.ABI abi,
+ String body, Boolean isInternal, Boolean allowPartial, String functionName,
+ Abi.DataLayout dataLayout) throws EverSdkException {
+ return EverSdk.async(ctxId, "abi.decode_message_body", new Abi.ParamsOfDecodeMessageBody(abi, body, isInternal, allowPartial, functionName, dataLayout), Abi.DecodedMessageBody.class);
}
/**
@@ -201,10 +204,10 @@ public static Abi.DecodedMessageBody decodeMessageBody(int ctxId, Abi.ABI abi, S
* @param lastPaid Initial value for the `last_paid`.
* @param bocCache The BOC itself returned if no cache type provided Cache type to put the result.
*/
- public static Abi.ResultOfEncodeAccount encodeAccount(int ctxId, String stateInit,
- BigInteger balance, BigInteger lastTransLt, Long lastPaid, Boc.BocCacheType bocCache) throws
- EverSdkException {
- return EverSdk.call(ctxId, "abi.encode_account", new Abi.ParamsOfEncodeAccount(stateInit, balance, lastTransLt, lastPaid, bocCache), Abi.ResultOfEncodeAccount.class);
+ public static CompletableFuture encodeAccount(int ctxId,
+ String stateInit, BigInteger balance, BigInteger lastTransLt, Long lastPaid,
+ Boc.BocCacheType bocCache) throws EverSdkException {
+ return EverSdk.async(ctxId, "abi.encode_account", new Abi.ParamsOfEncodeAccount(stateInit, balance, lastTransLt, lastPaid, bocCache), Abi.ResultOfEncodeAccount.class);
}
/**
@@ -214,13 +217,13 @@ public static Abi.ResultOfEncodeAccount encodeAccount(int ctxId, String stateIni
* @param data Data BOC or BOC handle
* @param allowPartial Flag allowing partial BOC decoding when ABI doesn't describe the full body BOC. Controls decoder behaviour when after decoding all described in ABI params there are some data left in BOC: `true` - return decoded values `false` - return error of incomplete BOC deserialization (default)
*/
- public static Abi.ResultOfDecodeAccountData decodeAccountData(int ctxId, Abi.ABI abi, String data,
- Boolean allowPartial) throws EverSdkException {
- return EverSdk.call(ctxId, "abi.decode_account_data", new Abi.ParamsOfDecodeAccountData(abi, data, allowPartial), Abi.ResultOfDecodeAccountData.class);
+ public static CompletableFuture decodeAccountData(int ctxId,
+ Abi.ABI abi, String data, Boolean allowPartial) throws EverSdkException {
+ return EverSdk.async(ctxId, "abi.decode_account_data", new Abi.ParamsOfDecodeAccountData(abi, data, allowPartial), Abi.ResultOfDecodeAccountData.class);
}
/**
- * Doesn't support ABI version >= 2.4. Use `encode_initial_data` instead Updates initial account data with initial values for the contract's static variables and owner's public key. 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.
+ * Doesn't support ABI version >= 2.4. Use `encode_initial_data` instead Updates initial account data with initial values for the contract's static variables and owner's public key. 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.
*
* @param abi Contract ABI
* @param data Data BOC or BOC handle
@@ -228,10 +231,10 @@ public static Abi.ResultOfDecodeAccountData decodeAccountData(int ctxId, Abi.ABI
* @param initialPubkey Initial account owner's public key to set into account data
* @param bocCache Cache type to put the result. The BOC itself returned if no cache type provided.
*/
- public static Abi.ResultOfUpdateInitialData updateInitialData(int ctxId, Abi.ABI abi, String data,
- JsonNode initialData, String initialPubkey, Boc.BocCacheType bocCache) throws
- EverSdkException {
- return EverSdk.call(ctxId, "abi.update_initial_data", new Abi.ParamsOfUpdateInitialData(abi, data, initialData, initialPubkey, bocCache), Abi.ResultOfUpdateInitialData.class);
+ public static CompletableFuture updateInitialData(int ctxId,
+ Abi.ABI abi, String data, JsonNode initialData, String initialPubkey,
+ Boc.BocCacheType bocCache) throws EverSdkException {
+ return EverSdk.async(ctxId, "abi.update_initial_data", new Abi.ParamsOfUpdateInitialData(abi, data, initialData, initialPubkey, bocCache), Abi.ResultOfUpdateInitialData.class);
}
/**
@@ -242,22 +245,22 @@ public static Abi.ResultOfUpdateInitialData updateInitialData(int ctxId, Abi.ABI
* @param initialPubkey Initial account owner's public key to set into account data
* @param bocCache Cache type to put the result. The BOC itself returned if no cache type provided.
*/
- public static Abi.ResultOfEncodeInitialData encodeInitialData(int ctxId, Abi.ABI abi,
- JsonNode initialData, String initialPubkey, Boc.BocCacheType bocCache) throws
+ public static CompletableFuture encodeInitialData(int ctxId,
+ Abi.ABI abi, JsonNode initialData, String initialPubkey, Boc.BocCacheType bocCache) throws
EverSdkException {
- return EverSdk.call(ctxId, "abi.encode_initial_data", new Abi.ParamsOfEncodeInitialData(abi, initialData, initialPubkey, bocCache), Abi.ResultOfEncodeInitialData.class);
+ return EverSdk.async(ctxId, "abi.encode_initial_data", new Abi.ParamsOfEncodeInitialData(abi, initialData, initialPubkey, bocCache), Abi.ResultOfEncodeInitialData.class);
}
/**
- * Doesn't support ABI version >= 2.4. Use `decode_account_data` instead 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.
+ * Doesn't support ABI version >= 2.4. Use `decode_account_data` instead 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.
*
* @param abi Initial data is decoded if this parameter is provided Contract ABI.
* @param data Data BOC or BOC handle
* @param allowPartial Flag allowing partial BOC decoding when ABI doesn't describe the full body BOC. Controls decoder behaviour when after decoding all described in ABI params there are some data left in BOC: `true` - return decoded values `false` - return error of incomplete BOC deserialization (default)
*/
- public static Abi.ResultOfDecodeInitialData decodeInitialData(int ctxId, Abi.ABI abi, String data,
- Boolean allowPartial) throws EverSdkException {
- return EverSdk.call(ctxId, "abi.decode_initial_data", new Abi.ParamsOfDecodeInitialData(abi, data, allowPartial), Abi.ResultOfDecodeInitialData.class);
+ public static CompletableFuture decodeInitialData(int ctxId,
+ Abi.ABI abi, String data, Boolean allowPartial) throws EverSdkException {
+ return EverSdk.async(ctxId, "abi.decode_initial_data", new Abi.ParamsOfDecodeInitialData(abi, data, allowPartial), Abi.ResultOfDecodeInitialData.class);
}
/**
@@ -266,7 +269,7 @@ public static Abi.ResultOfDecodeInitialData decodeInitialData(int ctxId, Abi.ABI
* ABI has it own rules for fields layout in cells so manually encoded
* BOC can not be described in terms of ABI rules.
*
- * To solve this problem we introduce a new ABI type `Ref()`
+ * To solve this problem we introduce a new ABI type `Ref(<ParamType>)`
* which allows to store `ParamType` ABI parameter in cell reference and, thus,
* decode manually encoded BOCs. This type is available only in `decode_boc` function
* and will not be available in ABI messages encoding until it is included into some ABI revision.
@@ -280,9 +283,9 @@ public static Abi.ResultOfDecodeInitialData decodeInitialData(int ctxId, Abi.ABI
* @param params Parameters to decode from BOC
* @param boc Data BOC or BOC handle
*/
- public static Abi.ResultOfDecodeBoc decodeBoc(int ctxId, Abi.AbiParam[] params, String boc,
- Boolean allowPartial) throws EverSdkException {
- return EverSdk.call(ctxId, "abi.decode_boc", new Abi.ParamsOfDecodeBoc(params, boc, allowPartial), Abi.ResultOfDecodeBoc.class);
+ public static CompletableFuture decodeBoc(int ctxId, Abi.AbiParam[] params,
+ String boc, Boolean allowPartial) throws EverSdkException {
+ return EverSdk.async(ctxId, "abi.decode_boc", new Abi.ParamsOfDecodeBoc(params, boc, allowPartial), Abi.ResultOfDecodeBoc.class);
}
/**
@@ -292,9 +295,9 @@ public static Abi.ResultOfDecodeBoc decodeBoc(int ctxId, Abi.AbiParam[] params,
* @param data Parameters and values as a JSON structure
* @param bocCache The BOC itself returned if no cache type provided Cache type to put the result.
*/
- public static Abi.ResultOfAbiEncodeBoc encodeBoc(int ctxId, Abi.AbiParam[] params, JsonNode data,
- Boc.BocCacheType bocCache) throws EverSdkException {
- return EverSdk.call(ctxId, "abi.encode_boc", new Abi.ParamsOfAbiEncodeBoc(params, data, bocCache), Abi.ResultOfAbiEncodeBoc.class);
+ public static CompletableFuture encodeBoc(int ctxId,
+ Abi.AbiParam[] params, JsonNode data, Boc.BocCacheType bocCache) throws EverSdkException {
+ return EverSdk.async(ctxId, "abi.encode_boc", new Abi.ParamsOfAbiEncodeBoc(params, data, bocCache), Abi.ResultOfAbiEncodeBoc.class);
}
/**
@@ -304,9 +307,9 @@ public static Abi.ResultOfAbiEncodeBoc encodeBoc(int ctxId, Abi.AbiParam[] param
* @param functionName Contract function name
* @param output If set to `true` output function ID will be returned which is used in contract response. Default is `false`
*/
- public static Abi.ResultOfCalcFunctionId calcFunctionId(int ctxId, Abi.ABI abi,
+ public static CompletableFuture calcFunctionId(int ctxId, Abi.ABI abi,
String functionName, Boolean output) throws EverSdkException {
- return EverSdk.call(ctxId, "abi.calc_function_id", new Abi.ParamsOfCalcFunctionId(abi, functionName, output), Abi.ResultOfCalcFunctionId.class);
+ return EverSdk.async(ctxId, "abi.calc_function_id", new Abi.ParamsOfCalcFunctionId(abi, functionName, output), Abi.ResultOfCalcFunctionId.class);
}
/**
@@ -316,9 +319,9 @@ public static Abi.ResultOfCalcFunctionId calcFunctionId(int ctxId, Abi.ABI abi,
* @param message Message BOC encoded in `base64`.
* @param signatureId Signature ID to be used in unsigned data preparing when CapSignatureWithId capability is enabled
*/
- public static Abi.ResultOfGetSignatureData getSignatureData(int ctxId, Abi.ABI abi,
- String message, Long signatureId) throws EverSdkException {
- return EverSdk.call(ctxId, "abi.get_signature_data", new Abi.ParamsOfGetSignatureData(abi, message, signatureId), Abi.ResultOfGetSignatureData.class);
+ public static CompletableFuture getSignatureData(int ctxId,
+ Abi.ABI abi, String message, Long signatureId) throws EverSdkException {
+ return EverSdk.async(ctxId, "abi.get_signature_data", new Abi.ParamsOfGetSignatureData(abi, message, signatureId), Abi.ResultOfGetSignatureData.class);
}
/**
@@ -577,7 +580,7 @@ public record ParamsOfAttachSignatureToMessageBody(Abi.ABI abi, String publicKey
*
* Expiration timeouts will grow with every retry.
* Retry grow factor is set in Client config:
- * <.....add config parameter with default value here>
+ * <.....add config parameter with default value here>
*
* Default value is 0. Processing try index.
* @param signatureId Signature ID to be used in data to sign preparing when CapSignatureWithId capability is enabled
@@ -796,7 +799,7 @@ public record ResultOfDecodeAccountData(JsonNode data) {
* 2. Public key, specified in TVM file.
* 3. Public key, provided by Signer.
*
- * Applicable only for contracts with ABI version < 2.4. Contract initial public key should be
+ * Applicable only for contracts with ABI version < 2.4. Contract initial public key should be
* explicitly provided inside `initial_data` since ABI 2.4 Optional public key that can be provided in deploy set in order to substitute one in TVM file or provided by Signer.
*/
public record DeploySet(String tvc, String code, String stateInit, Long workchainId,
diff --git a/src/gen/java/tech/deplant/java4ever/binding/AppSigningBox.java b/src/gen/java/tech/deplant/java4ever/binding/AppSigningBox.java
deleted file mode 100644
index c7c12a9..0000000
--- a/src/gen/java/tech/deplant/java4ever/binding/AppSigningBox.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package tech.deplant.java4ever.binding;
-
-import java.util.Map;
-
-public interface AppSigningBox {
- String getPublicKey();
- String sign(String unsigned);
-}
diff --git a/src/gen/java/tech/deplant/java4ever/binding/Boc.java b/src/gen/java/tech/deplant/java4ever/binding/Boc.java
index 201f32d..11f45a0 100644
--- a/src/gen/java/tech/deplant/java4ever/binding/Boc.java
+++ b/src/gen/java/tech/deplant/java4ever/binding/Boc.java
@@ -6,11 +6,12 @@
import java.lang.Boolean;
import java.lang.Long;
import java.lang.String;
+import java.util.concurrent.CompletableFuture;
/**
* Boc
* Contains methods of "boc" module of EVER-SDK API
- *
+ *
* BOC manipulation module.
* @version 1.45.0
*/
@@ -20,8 +21,9 @@ public final class Boc {
*
* @param tvc Contract TVC BOC encoded as base64 or BOC handle
*/
- public static Boc.ResultOfDecodeTvc decodeTvc(int ctxId, String tvc) throws EverSdkException {
- return EverSdk.call(ctxId, "boc.decode_tvc", new Boc.ParamsOfDecodeTvc(tvc), Boc.ResultOfDecodeTvc.class);
+ public static CompletableFuture decodeTvc(int ctxId, String tvc) throws
+ EverSdkException {
+ return EverSdk.async(ctxId, "boc.decode_tvc", new Boc.ParamsOfDecodeTvc(tvc), Boc.ResultOfDecodeTvc.class);
}
/**
@@ -29,8 +31,9 @@ public static Boc.ResultOfDecodeTvc decodeTvc(int ctxId, String tvc) throws Ever
*
* @param boc BOC encoded as base64
*/
- public static Boc.ResultOfParse parseMessage(int ctxId, String boc) throws EverSdkException {
- return EverSdk.call(ctxId, "boc.parse_message", new Boc.ParamsOfParse(boc), Boc.ResultOfParse.class);
+ public static CompletableFuture parseMessage(int ctxId, String boc) throws
+ EverSdkException {
+ return EverSdk.async(ctxId, "boc.parse_message", new Boc.ParamsOfParse(boc), Boc.ResultOfParse.class);
}
/**
@@ -38,8 +41,9 @@ public static Boc.ResultOfParse parseMessage(int ctxId, String boc) throws EverS
*
* @param boc BOC encoded as base64
*/
- public static Boc.ResultOfParse parseTransaction(int ctxId, String boc) throws EverSdkException {
- return EverSdk.call(ctxId, "boc.parse_transaction", new Boc.ParamsOfParse(boc), Boc.ResultOfParse.class);
+ public static CompletableFuture parseTransaction(int ctxId, String boc) throws
+ EverSdkException {
+ return EverSdk.async(ctxId, "boc.parse_transaction", new Boc.ParamsOfParse(boc), Boc.ResultOfParse.class);
}
/**
@@ -47,8 +51,9 @@ public static Boc.ResultOfParse parseTransaction(int ctxId, String boc) throws E
*
* @param boc BOC encoded as base64
*/
- public static Boc.ResultOfParse parseAccount(int ctxId, String boc) throws EverSdkException {
- return EverSdk.call(ctxId, "boc.parse_account", new Boc.ParamsOfParse(boc), Boc.ResultOfParse.class);
+ public static CompletableFuture parseAccount(int ctxId, String boc) throws
+ EverSdkException {
+ return EverSdk.async(ctxId, "boc.parse_account", new Boc.ParamsOfParse(boc), Boc.ResultOfParse.class);
}
/**
@@ -56,8 +61,9 @@ public static Boc.ResultOfParse parseAccount(int ctxId, String boc) throws EverS
*
* @param boc BOC encoded as base64
*/
- public static Boc.ResultOfParse parseBlock(int ctxId, String boc) throws EverSdkException {
- return EverSdk.call(ctxId, "boc.parse_block", new Boc.ParamsOfParse(boc), Boc.ResultOfParse.class);
+ public static CompletableFuture parseBlock(int ctxId, String boc) throws
+ EverSdkException {
+ return EverSdk.async(ctxId, "boc.parse_block", new Boc.ParamsOfParse(boc), Boc.ResultOfParse.class);
}
/**
@@ -67,9 +73,9 @@ public static Boc.ResultOfParse parseBlock(int ctxId, String boc) throws EverSdk
* @param id Shardstate identifier
* @param workchainId Workchain shardstate belongs to
*/
- public static Boc.ResultOfParse parseShardstate(int ctxId, String boc, String id,
- Long workchainId) throws EverSdkException {
- return EverSdk.call(ctxId, "boc.parse_shardstate", new Boc.ParamsOfParseShardstate(boc, id, workchainId), Boc.ResultOfParse.class);
+ public static CompletableFuture parseShardstate(int ctxId, String boc,
+ String id, Long workchainId) throws EverSdkException {
+ return EverSdk.async(ctxId, "boc.parse_shardstate", new Boc.ParamsOfParseShardstate(boc, id, workchainId), Boc.ResultOfParse.class);
}
/**
@@ -77,9 +83,9 @@ public static Boc.ResultOfParse parseShardstate(int ctxId, String boc, String id
*
* @param blockBoc Key block BOC or zerostate BOC encoded as base64
*/
- public static Boc.ResultOfGetBlockchainConfig getBlockchainConfig(int ctxId, String blockBoc)
- throws EverSdkException {
- return EverSdk.call(ctxId, "boc.get_blockchain_config", new Boc.ParamsOfGetBlockchainConfig(blockBoc), Boc.ResultOfGetBlockchainConfig.class);
+ public static CompletableFuture getBlockchainConfig(int ctxId,
+ String blockBoc) throws EverSdkException {
+ return EverSdk.async(ctxId, "boc.get_blockchain_config", new Boc.ParamsOfGetBlockchainConfig(blockBoc), Boc.ResultOfGetBlockchainConfig.class);
}
/**
@@ -87,8 +93,9 @@ public static Boc.ResultOfGetBlockchainConfig getBlockchainConfig(int ctxId, Str
*
* @param boc BOC encoded as base64 or BOC handle
*/
- public static Boc.ResultOfGetBocHash getBocHash(int ctxId, String boc) throws EverSdkException {
- return EverSdk.call(ctxId, "boc.get_boc_hash", new Boc.ParamsOfGetBocHash(boc), Boc.ResultOfGetBocHash.class);
+ public static CompletableFuture getBocHash(int ctxId, String boc) throws
+ EverSdkException {
+ return EverSdk.async(ctxId, "boc.get_boc_hash", new Boc.ParamsOfGetBocHash(boc), Boc.ResultOfGetBocHash.class);
}
/**
@@ -96,8 +103,9 @@ public static Boc.ResultOfGetBocHash getBocHash(int ctxId, String boc) throws Ev
*
* @param boc BOC encoded as base64 or BOC handle
*/
- public static Boc.ResultOfGetBocDepth getBocDepth(int ctxId, String boc) throws EverSdkException {
- return EverSdk.call(ctxId, "boc.get_boc_depth", new Boc.ParamsOfGetBocDepth(boc), Boc.ResultOfGetBocDepth.class);
+ public static CompletableFuture getBocDepth(int ctxId, String boc) throws
+ EverSdkException {
+ return EverSdk.async(ctxId, "boc.get_boc_depth", new Boc.ParamsOfGetBocDepth(boc), Boc.ResultOfGetBocDepth.class);
}
/**
@@ -105,9 +113,9 @@ public static Boc.ResultOfGetBocDepth getBocDepth(int ctxId, String boc) throws
*
* @param tvc Contract TVC image or image BOC handle
*/
- public static Boc.ResultOfGetCodeFromTvc getCodeFromTvc(int ctxId, String tvc) throws
- EverSdkException {
- return EverSdk.call(ctxId, "boc.get_code_from_tvc", new Boc.ParamsOfGetCodeFromTvc(tvc), Boc.ResultOfGetCodeFromTvc.class);
+ public static CompletableFuture getCodeFromTvc(int ctxId, String tvc)
+ throws EverSdkException {
+ return EverSdk.async(ctxId, "boc.get_code_from_tvc", new Boc.ParamsOfGetCodeFromTvc(tvc), Boc.ResultOfGetCodeFromTvc.class);
}
/**
@@ -115,8 +123,9 @@ public static Boc.ResultOfGetCodeFromTvc getCodeFromTvc(int ctxId, String tvc) t
*
* @param bocRef Reference to the cached BOC
*/
- public static Boc.ResultOfBocCacheGet cacheGet(int ctxId, String bocRef) throws EverSdkException {
- return EverSdk.call(ctxId, "boc.cache_get", new Boc.ParamsOfBocCacheGet(bocRef), Boc.ResultOfBocCacheGet.class);
+ public static CompletableFuture cacheGet(int ctxId, String bocRef) throws
+ EverSdkException {
+ return EverSdk.async(ctxId, "boc.cache_get", new Boc.ParamsOfBocCacheGet(bocRef), Boc.ResultOfBocCacheGet.class);
}
/**
@@ -125,9 +134,9 @@ public static Boc.ResultOfBocCacheGet cacheGet(int ctxId, String bocRef) throws
* @param boc BOC encoded as base64 or BOC reference
* @param cacheType Cache type
*/
- public static Boc.ResultOfBocCacheSet cacheSet(int ctxId, String boc, Boc.BocCacheType cacheType)
- throws EverSdkException {
- return EverSdk.call(ctxId, "boc.cache_set", new Boc.ParamsOfBocCacheSet(boc, cacheType), Boc.ResultOfBocCacheSet.class);
+ public static CompletableFuture cacheSet(int ctxId, String boc,
+ Boc.BocCacheType cacheType) throws EverSdkException {
+ return EverSdk.async(ctxId, "boc.cache_set", new Boc.ParamsOfBocCacheSet(boc, cacheType), Boc.ResultOfBocCacheSet.class);
}
/**
@@ -137,7 +146,7 @@ public static Boc.ResultOfBocCacheSet cacheSet(int ctxId, String boc, Boc.BocCac
* @param bocRef If it is provided then only referenced BOC is unpinned Reference to the cached BOC.
*/
public static void cacheUnpin(int ctxId, String pin, String bocRef) throws EverSdkException {
- EverSdk.callVoid(ctxId, "boc.cache_unpin", new Boc.ParamsOfBocCacheUnpin(pin, bocRef));
+ EverSdk.asyncVoid(ctxId, "boc.cache_unpin", new Boc.ParamsOfBocCacheUnpin(pin, bocRef));
}
/**
@@ -146,9 +155,9 @@ public static void cacheUnpin(int ctxId, String pin, String bocRef) throws EverS
* @param builder Cell builder operations.
* @param bocCache Cache type to put the result. The BOC itself returned if no cache type provided.
*/
- public static Boc.ResultOfEncodeBoc encodeBoc(int ctxId, Boc.BuilderOp[] builder,
- Boc.BocCacheType bocCache) throws EverSdkException {
- return EverSdk.call(ctxId, "boc.encode_boc", new Boc.ParamsOfEncodeBoc(builder, bocCache), Boc.ResultOfEncodeBoc.class);
+ public static CompletableFuture encodeBoc(int ctxId,
+ Boc.BuilderOp[] builder, Boc.BocCacheType bocCache) throws EverSdkException {
+ return EverSdk.async(ctxId, "boc.encode_boc", new Boc.ParamsOfEncodeBoc(builder, bocCache), Boc.ResultOfEncodeBoc.class);
}
/**
@@ -157,9 +166,9 @@ public static Boc.ResultOfEncodeBoc encodeBoc(int ctxId, Boc.BuilderOp[] builder
* @param code Contract code BOC encoded as base64 or code BOC handle
* @param bocCache Cache type to put the result. The BOC itself returned if no cache type provided.
*/
- public static Boc.ResultOfGetCodeSalt getCodeSalt(int ctxId, String code,
+ public static CompletableFuture getCodeSalt(int ctxId, String code,
Boc.BocCacheType bocCache) throws EverSdkException {
- return EverSdk.call(ctxId, "boc.get_code_salt", new Boc.ParamsOfGetCodeSalt(code, bocCache), Boc.ResultOfGetCodeSalt.class);
+ return EverSdk.async(ctxId, "boc.get_code_salt", new Boc.ParamsOfGetCodeSalt(code, bocCache), Boc.ResultOfGetCodeSalt.class);
}
/**
@@ -169,9 +178,9 @@ public static Boc.ResultOfGetCodeSalt getCodeSalt(int ctxId, String code,
* @param salt BOC encoded as base64 or BOC handle Code salt to set.
* @param bocCache Cache type to put the result. The BOC itself returned if no cache type provided.
*/
- public static Boc.ResultOfSetCodeSalt setCodeSalt(int ctxId, String code, String salt,
- Boc.BocCacheType bocCache) throws EverSdkException {
- return EverSdk.call(ctxId, "boc.set_code_salt", new Boc.ParamsOfSetCodeSalt(code, salt, bocCache), Boc.ResultOfSetCodeSalt.class);
+ public static CompletableFuture setCodeSalt(int ctxId, String code,
+ String salt, Boc.BocCacheType bocCache) throws EverSdkException {
+ return EverSdk.async(ctxId, "boc.set_code_salt", new Boc.ParamsOfSetCodeSalt(code, salt, bocCache), Boc.ResultOfSetCodeSalt.class);
}
/**
@@ -180,9 +189,9 @@ public static Boc.ResultOfSetCodeSalt setCodeSalt(int ctxId, String code, String
* @param stateInit Contract StateInit image BOC encoded as base64 or BOC handle
* @param bocCache Cache type to put the result. The BOC itself returned if no cache type provided.
*/
- public static Boc.ResultOfDecodeStateInit decodeStateInit(int ctxId, String stateInit,
- Boc.BocCacheType bocCache) throws EverSdkException {
- return EverSdk.call(ctxId, "boc.decode_state_init", new Boc.ParamsOfDecodeStateInit(stateInit, bocCache), Boc.ResultOfDecodeStateInit.class);
+ public static CompletableFuture decodeStateInit(int ctxId,
+ String stateInit, Boc.BocCacheType bocCache) throws EverSdkException {
+ return EverSdk.async(ctxId, "boc.decode_state_init", new Boc.ParamsOfDecodeStateInit(stateInit, bocCache), Boc.ResultOfDecodeStateInit.class);
}
/**
@@ -196,10 +205,10 @@ public static Boc.ResultOfDecodeStateInit decodeStateInit(int ctxId, String stat
* @param splitDepth Is present and non-zero only in instances of large smart contracts
* @param bocCache Cache type to put the result. The BOC itself returned if no cache type provided.
*/
- public static Boc.ResultOfEncodeStateInit encodeStateInit(int ctxId, String code, String data,
- String library, Boolean tick, Boolean tock, Long splitDepth, Boc.BocCacheType bocCache) throws
- EverSdkException {
- return EverSdk.call(ctxId, "boc.encode_state_init", new Boc.ParamsOfEncodeStateInit(code, data, library, tick, tock, splitDepth, bocCache), Boc.ResultOfEncodeStateInit.class);
+ public static CompletableFuture encodeStateInit(int ctxId,
+ String code, String data, String library, Boolean tick, Boolean tock, Long splitDepth,
+ Boc.BocCacheType bocCache) throws EverSdkException {
+ return EverSdk.async(ctxId, "boc.encode_state_init", new Boc.ParamsOfEncodeStateInit(code, data, library, tick, tock, splitDepth, bocCache), Boc.ResultOfEncodeStateInit.class);
}
/**
@@ -211,9 +220,10 @@ public static Boc.ResultOfEncodeStateInit encodeStateInit(int ctxId, String code
* @param body Bag of cells with the message body encoded as base64.
* @param bocCache The BOC itself returned if no cache type provided Cache type to put the result.
*/
- public static Boc.ResultOfEncodeExternalInMessage encodeExternalInMessage(int ctxId, String src,
- String dst, String init, String body, Boc.BocCacheType bocCache) throws EverSdkException {
- return EverSdk.call(ctxId, "boc.encode_external_in_message", new Boc.ParamsOfEncodeExternalInMessage(src, dst, init, body, bocCache), Boc.ResultOfEncodeExternalInMessage.class);
+ public static CompletableFuture encodeExternalInMessage(
+ int ctxId, String src, String dst, String init, String body, Boc.BocCacheType bocCache) throws
+ EverSdkException {
+ return EverSdk.async(ctxId, "boc.encode_external_in_message", new Boc.ParamsOfEncodeExternalInMessage(src, dst, init, body, bocCache), Boc.ResultOfEncodeExternalInMessage.class);
}
/**
@@ -221,9 +231,9 @@ public static Boc.ResultOfEncodeExternalInMessage encodeExternalInMessage(int ct
*
* @param code Contract code BOC encoded as base64 or code BOC handle
*/
- public static Boc.ResultOfGetCompilerVersion getCompilerVersion(int ctxId, String code) throws
- EverSdkException {
- return EverSdk.call(ctxId, "boc.get_compiler_version", new Boc.ParamsOfGetCompilerVersion(code), Boc.ResultOfGetCompilerVersion.class);
+ public static CompletableFuture getCompilerVersion(int ctxId,
+ String code) throws EverSdkException {
+ return EverSdk.async(ctxId, "boc.get_compiler_version", new Boc.ParamsOfGetCompilerVersion(code), Boc.ResultOfGetCompilerVersion.class);
}
/**
diff --git a/src/gen/java/tech/deplant/java4ever/binding/Client.java b/src/gen/java/tech/deplant/java4ever/binding/Client.java
index b622328..bc2b882 100644
--- a/src/gen/java/tech/deplant/java4ever/binding/Client.java
+++ b/src/gen/java/tech/deplant/java4ever/binding/Client.java
@@ -7,11 +7,12 @@
import java.lang.Integer;
import java.lang.Long;
import java.lang.String;
+import java.util.concurrent.CompletableFuture;
/**
* Client
* Contains methods of "client" module of EVER-SDK API
- *
+ *
* Provides information about library.
* @version 1.45.0
*/
@@ -19,29 +20,32 @@ public final class Client {
/**
* Returns Core Library API reference
*/
- public static Client.ResultOfGetApiReference getApiReference(int ctxId) throws EverSdkException {
- return EverSdk.call(ctxId, "client.get_api_reference", null, Client.ResultOfGetApiReference.class);
+ public static CompletableFuture getApiReference(int ctxId) throws
+ EverSdkException {
+ return EverSdk.async(ctxId, "client.get_api_reference", null, Client.ResultOfGetApiReference.class);
}
/**
* Returns Core Library version
*/
- public static Client.ResultOfVersion version(int ctxId) throws EverSdkException {
- return EverSdk.call(ctxId, "client.version", null, Client.ResultOfVersion.class);
+ public static CompletableFuture version(int ctxId) throws
+ EverSdkException {
+ return EverSdk.async(ctxId, "client.version", null, Client.ResultOfVersion.class);
}
/**
* Returns Core Library API reference
*/
- public static Client.ClientConfig config(int ctxId) throws EverSdkException {
- return EverSdk.call(ctxId, "client.config", null, Client.ClientConfig.class);
+ public static CompletableFuture config(int ctxId) throws EverSdkException {
+ return EverSdk.async(ctxId, "client.config", null, Client.ClientConfig.class);
}
/**
* Returns detailed information about this build.
*/
- public static Client.ResultOfBuildInfo buildInfo(int ctxId) throws EverSdkException {
- return EverSdk.call(ctxId, "client.build_info", null, Client.ResultOfBuildInfo.class);
+ public static CompletableFuture buildInfo(int ctxId) throws
+ EverSdkException {
+ return EverSdk.async(ctxId, "client.build_info", null, Client.ResultOfBuildInfo.class);
}
/**
@@ -52,7 +56,7 @@ public static Client.ResultOfBuildInfo buildInfo(int ctxId) throws EverSdkExcept
*/
public static void resolveAppRequest(int ctxId, Long appRequestId, Client.AppRequestResult result)
throws EverSdkException {
- EverSdk.callVoid(ctxId, "client.resolve_app_request", new Client.ParamsOfResolveAppRequest(appRequestId, result));
+ EverSdk.asyncVoid(ctxId, "client.resolve_app_request", new Client.ParamsOfResolveAppRequest(appRequestId, result));
}
public enum ClientErrorCode {
diff --git a/src/gen/java/tech/deplant/java4ever/binding/Crypto.java b/src/gen/java/tech/deplant/java4ever/binding/Crypto.java
index e2e45de..3251c35 100644
--- a/src/gen/java/tech/deplant/java4ever/binding/Crypto.java
+++ b/src/gen/java/tech/deplant/java4ever/binding/Crypto.java
@@ -7,11 +7,12 @@
import java.lang.Integer;
import java.lang.Long;
import java.lang.String;
+import java.util.concurrent.CompletableFuture;
/**
* Crypto
* Contains methods of "crypto" module of EVER-SDK API
- *
+ *
* Crypto functions.
* @version 1.45.0
*/
@@ -23,9 +24,9 @@ public final class Crypto {
*
* @param composite Hexadecimal representation of u64 composite number.
*/
- public static Crypto.ResultOfFactorize factorize(int ctxId, String composite) throws
- EverSdkException {
- return EverSdk.call(ctxId, "crypto.factorize", new Crypto.ParamsOfFactorize(composite), Crypto.ResultOfFactorize.class);
+ public static CompletableFuture factorize(int ctxId, String composite)
+ throws EverSdkException {
+ return EverSdk.async(ctxId, "crypto.factorize", new Crypto.ParamsOfFactorize(composite), Crypto.ResultOfFactorize.class);
}
/**
@@ -36,9 +37,9 @@ public static Crypto.ResultOfFactorize factorize(int ctxId, String composite) th
* @param exponent `exponent` argument of calculation.
* @param modulus `modulus` argument of calculation.
*/
- public static Crypto.ResultOfModularPower modularPower(int ctxId, String base, String exponent,
- String modulus) throws EverSdkException {
- return EverSdk.call(ctxId, "crypto.modular_power", new Crypto.ParamsOfModularPower(base, exponent, modulus), Crypto.ResultOfModularPower.class);
+ public static CompletableFuture modularPower(int ctxId, String base,
+ String exponent, String modulus) throws EverSdkException {
+ return EverSdk.async(ctxId, "crypto.modular_power", new Crypto.ParamsOfModularPower(base, exponent, modulus), Crypto.ResultOfModularPower.class);
}
/**
@@ -46,8 +47,9 @@ public static Crypto.ResultOfModularPower modularPower(int ctxId, String base, S
*
* @param data Encoded with `base64`. Input data for CRC calculation.
*/
- public static Crypto.ResultOfTonCrc16 tonCrc16(int ctxId, String data) throws EverSdkException {
- return EverSdk.call(ctxId, "crypto.ton_crc16", new Crypto.ParamsOfTonCrc16(data), Crypto.ResultOfTonCrc16.class);
+ public static CompletableFuture tonCrc16(int ctxId, String data) throws
+ EverSdkException {
+ return EverSdk.async(ctxId, "crypto.ton_crc16", new Crypto.ParamsOfTonCrc16(data), Crypto.ResultOfTonCrc16.class);
}
/**
@@ -55,9 +57,9 @@ public static Crypto.ResultOfTonCrc16 tonCrc16(int ctxId, String data) throws Ev
*
* @param length Size of random byte array.
*/
- public static Crypto.ResultOfGenerateRandomBytes generateRandomBytes(int ctxId, Long length)
- throws EverSdkException {
- return EverSdk.call(ctxId, "crypto.generate_random_bytes", new Crypto.ParamsOfGenerateRandomBytes(length), Crypto.ResultOfGenerateRandomBytes.class);
+ public static CompletableFuture generateRandomBytes(int ctxId,
+ Long length) throws EverSdkException {
+ return EverSdk.async(ctxId, "crypto.generate_random_bytes", new Crypto.ParamsOfGenerateRandomBytes(length), Crypto.ResultOfGenerateRandomBytes.class);
}
/**
@@ -65,16 +67,17 @@ public static Crypto.ResultOfGenerateRandomBytes generateRandomBytes(int ctxId,
*
* @param publicKey Public key - 64 symbols hex string
*/
- public static Crypto.ResultOfConvertPublicKeyToTonSafeFormat convertPublicKeyToTonSafeFormat(
+ public static CompletableFuture convertPublicKeyToTonSafeFormat(
int ctxId, String publicKey) throws EverSdkException {
- return EverSdk.call(ctxId, "crypto.convert_public_key_to_ton_safe_format", new Crypto.ParamsOfConvertPublicKeyToTonSafeFormat(publicKey), Crypto.ResultOfConvertPublicKeyToTonSafeFormat.class);
+ return EverSdk.async(ctxId, "crypto.convert_public_key_to_ton_safe_format", new Crypto.ParamsOfConvertPublicKeyToTonSafeFormat(publicKey), Crypto.ResultOfConvertPublicKeyToTonSafeFormat.class);
}
/**
* Generates random ed25519 key pair.
*/
- public static Crypto.KeyPair generateRandomSignKeys(int ctxId) throws EverSdkException {
- return EverSdk.call(ctxId, "crypto.generate_random_sign_keys", null, Crypto.KeyPair.class);
+ public static CompletableFuture generateRandomSignKeys(int ctxId) throws
+ EverSdkException {
+ return EverSdk.async(ctxId, "crypto.generate_random_sign_keys", null, Crypto.KeyPair.class);
}
/**
@@ -83,9 +86,9 @@ public static Crypto.KeyPair generateRandomSignKeys(int ctxId) throws EverSdkExc
* @param unsigned Data that must be signed encoded in `base64`.
* @param keys Sign keys.
*/
- public static Crypto.ResultOfSign sign(int ctxId, String unsigned, Crypto.KeyPair keys) throws
- EverSdkException {
- return EverSdk.call(ctxId, "crypto.sign", new Crypto.ParamsOfSign(unsigned, keys), Crypto.ResultOfSign.class);
+ public static CompletableFuture sign(int ctxId, String unsigned,
+ Crypto.KeyPair keys) throws EverSdkException {
+ return EverSdk.async(ctxId, "crypto.sign", new Crypto.ParamsOfSign(unsigned, keys), Crypto.ResultOfSign.class);
}
/**
@@ -94,9 +97,9 @@ public static Crypto.ResultOfSign sign(int ctxId, String unsigned, Crypto.KeyPai
* @param signed Signed data that must be verified encoded in `base64`.
* @param publicKey Signer's public key - 64 symbols hex string
*/
- public static Crypto.ResultOfVerifySignature verifySignature(int ctxId, String signed,
- @JsonProperty("public") String publicKey) throws EverSdkException {
- return EverSdk.call(ctxId, "crypto.verify_signature", new Crypto.ParamsOfVerifySignature(signed, publicKey), Crypto.ResultOfVerifySignature.class);
+ public static CompletableFuture verifySignature(int ctxId,
+ String signed, @JsonProperty("public") String publicKey) throws EverSdkException {
+ return EverSdk.async(ctxId, "crypto.verify_signature", new Crypto.ParamsOfVerifySignature(signed, publicKey), Crypto.ResultOfVerifySignature.class);
}
/**
@@ -104,8 +107,9 @@ public static Crypto.ResultOfVerifySignature verifySignature(int ctxId, String s
*
* @param data Encoded with `base64`. Input data for hash calculation.
*/
- public static Crypto.ResultOfHash sha256(int ctxId, String data) throws EverSdkException {
- return EverSdk.call(ctxId, "crypto.sha256", new Crypto.ParamsOfHash(data), Crypto.ResultOfHash.class);
+ public static CompletableFuture sha256(int ctxId, String data) throws
+ EverSdkException {
+ return EverSdk.async(ctxId, "crypto.sha256", new Crypto.ParamsOfHash(data), Crypto.ResultOfHash.class);
}
/**
@@ -113,8 +117,9 @@ public static Crypto.ResultOfHash sha256(int ctxId, String data) throws EverSdkE
*
* @param data Encoded with `base64`. Input data for hash calculation.
*/
- public static Crypto.ResultOfHash sha512(int ctxId, String data) throws EverSdkException {
- return EverSdk.call(ctxId, "crypto.sha512", new Crypto.ParamsOfHash(data), Crypto.ResultOfHash.class);
+ public static CompletableFuture sha512(int ctxId, String data) throws
+ EverSdkException {
+ return EverSdk.async(ctxId, "crypto.sha512", new Crypto.ParamsOfHash(data), Crypto.ResultOfHash.class);
}
/**
@@ -141,9 +146,9 @@ public static Crypto.ResultOfHash sha512(int ctxId, String data) throws EverSdkE
* @param p Parallelization parameter.
* @param dkLen Intended output length in octets of the derived key.
*/
- public static Crypto.ResultOfScrypt scrypt(int ctxId, String password, String salt, Integer logN,
- Long r, Long p, Long dkLen) throws EverSdkException {
- return EverSdk.call(ctxId, "crypto.scrypt", new Crypto.ParamsOfScrypt(password, salt, logN, r, p, dkLen), Crypto.ResultOfScrypt.class);
+ public static CompletableFuture scrypt(int ctxId, String password,
+ String salt, Integer logN, Long r, Long p, Long dkLen) throws EverSdkException {
+ return EverSdk.async(ctxId, "crypto.scrypt", new Crypto.ParamsOfScrypt(password, salt, logN, r, p, dkLen), Crypto.ResultOfScrypt.class);
}
/**
@@ -153,9 +158,9 @@ public static Crypto.ResultOfScrypt scrypt(int ctxId, String password, String sa
*
* @param secretKey Secret key - unprefixed 0-padded to 64 symbols hex string
*/
- public static Crypto.KeyPair naclSignKeypairFromSecretKey(int ctxId,
+ public static CompletableFuture naclSignKeypairFromSecretKey(int ctxId,
@JsonProperty("secret") String secretKey) throws EverSdkException {
- return EverSdk.call(ctxId, "crypto.nacl_sign_keypair_from_secret_key", new Crypto.ParamsOfNaclSignKeyPairFromSecret(secretKey), Crypto.KeyPair.class);
+ return EverSdk.async(ctxId, "crypto.nacl_sign_keypair_from_secret_key", new Crypto.ParamsOfNaclSignKeyPairFromSecret(secretKey), Crypto.KeyPair.class);
}
/**
@@ -164,9 +169,9 @@ public static Crypto.KeyPair naclSignKeypairFromSecretKey(int ctxId,
* @param unsigned Data that must be signed encoded in `base64`.
* @param secretKey Signer's secret key - unprefixed 0-padded to 128 symbols hex string (concatenation of 64 symbols secret and 64 symbols public keys). See `nacl_sign_keypair_from_secret_key`.
*/
- public static Crypto.ResultOfNaclSign naclSign(int ctxId, String unsigned,
+ public static CompletableFuture naclSign(int ctxId, String unsigned,
@JsonProperty("secret") String secretKey) throws EverSdkException {
- return EverSdk.call(ctxId, "crypto.nacl_sign", new Crypto.ParamsOfNaclSign(unsigned, secretKey), Crypto.ResultOfNaclSign.class);
+ return EverSdk.async(ctxId, "crypto.nacl_sign", new Crypto.ParamsOfNaclSign(unsigned, secretKey), Crypto.ResultOfNaclSign.class);
}
/**
@@ -178,9 +183,9 @@ public static Crypto.ResultOfNaclSign naclSign(int ctxId, String unsigned,
* @param signed Encoded with `base64`. Signed data that must be unsigned.
* @param publicKey Signer's public key - unprefixed 0-padded to 64 symbols hex string
*/
- public static Crypto.ResultOfNaclSignOpen naclSignOpen(int ctxId, String signed,
- @JsonProperty("public") String publicKey) throws EverSdkException {
- return EverSdk.call(ctxId, "crypto.nacl_sign_open", new Crypto.ParamsOfNaclSignOpen(signed, publicKey), Crypto.ResultOfNaclSignOpen.class);
+ public static CompletableFuture naclSignOpen(int ctxId,
+ String signed, @JsonProperty("public") String publicKey) throws EverSdkException {
+ return EverSdk.async(ctxId, "crypto.nacl_sign_open", new Crypto.ParamsOfNaclSignOpen(signed, publicKey), Crypto.ResultOfNaclSignOpen.class);
}
/**
@@ -190,9 +195,9 @@ public static Crypto.ResultOfNaclSignOpen naclSignOpen(int ctxId, String signed,
* @param unsigned Data that must be signed encoded in `base64`.
* @param secretKey Signer's secret key - unprefixed 0-padded to 128 symbols hex string (concatenation of 64 symbols secret and 64 symbols public keys). See `nacl_sign_keypair_from_secret_key`.
*/
- public static Crypto.ResultOfNaclSignDetached naclSignDetached(int ctxId, String unsigned,
- @JsonProperty("secret") String secretKey) throws EverSdkException {
- return EverSdk.call(ctxId, "crypto.nacl_sign_detached", new Crypto.ParamsOfNaclSign(unsigned, secretKey), Crypto.ResultOfNaclSignDetached.class);
+ public static CompletableFuture naclSignDetached(int ctxId,
+ String unsigned, @JsonProperty("secret") String secretKey) throws EverSdkException {
+ return EverSdk.async(ctxId, "crypto.nacl_sign_detached", new Crypto.ParamsOfNaclSign(unsigned, secretKey), Crypto.ResultOfNaclSignDetached.class);
}
/**
@@ -202,17 +207,18 @@ public static Crypto.ResultOfNaclSignDetached naclSignDetached(int ctxId, String
* @param signature Encoded with `hex`. Signature that must be verified.
* @param publicKey Signer's public key - unprefixed 0-padded to 64 symbols hex string.
*/
- public static Crypto.ResultOfNaclSignDetachedVerify naclSignDetachedVerify(int ctxId,
- String unsigned, String signature, @JsonProperty("public") String publicKey) throws
+ public static CompletableFuture naclSignDetachedVerify(
+ int ctxId, String unsigned, String signature, @JsonProperty("public") String publicKey) throws
EverSdkException {
- return EverSdk.call(ctxId, "crypto.nacl_sign_detached_verify", new Crypto.ParamsOfNaclSignDetachedVerify(unsigned, signature, publicKey), Crypto.ResultOfNaclSignDetachedVerify.class);
+ return EverSdk.async(ctxId, "crypto.nacl_sign_detached_verify", new Crypto.ParamsOfNaclSignDetachedVerify(unsigned, signature, publicKey), Crypto.ResultOfNaclSignDetachedVerify.class);
}
/**
* Generates a random NaCl key pair
*/
- public static Crypto.KeyPair naclBoxKeypair(int ctxId) throws EverSdkException {
- return EverSdk.call(ctxId, "crypto.nacl_box_keypair", null, Crypto.KeyPair.class);
+ public static CompletableFuture naclBoxKeypair(int ctxId) throws
+ EverSdkException {
+ return EverSdk.async(ctxId, "crypto.nacl_box_keypair", null, Crypto.KeyPair.class);
}
/**
@@ -220,9 +226,9 @@ public static Crypto.KeyPair naclBoxKeypair(int ctxId) throws EverSdkException {
*
* @param secretKey Secret key - unprefixed 0-padded to 64 symbols hex string
*/
- public static Crypto.KeyPair naclBoxKeypairFromSecretKey(int ctxId,
+ public static CompletableFuture naclBoxKeypairFromSecretKey(int ctxId,
@JsonProperty("secret") String secretKey) throws EverSdkException {
- return EverSdk.call(ctxId, "crypto.nacl_box_keypair_from_secret_key", new Crypto.ParamsOfNaclBoxKeyPairFromSecret(secretKey), Crypto.KeyPair.class);
+ return EverSdk.async(ctxId, "crypto.nacl_box_keypair_from_secret_key", new Crypto.ParamsOfNaclBoxKeyPairFromSecret(secretKey), Crypto.KeyPair.class);
}
/**
@@ -234,9 +240,10 @@ public static Crypto.KeyPair naclBoxKeypairFromSecretKey(int ctxId,
* @param theirPublic Receiver's public key - unprefixed 0-padded to 64 symbols hex string
* @param secretKey Sender's private key - unprefixed 0-padded to 64 symbols hex string
*/
- public static Crypto.ResultOfNaclBox naclBox(int ctxId, String decrypted, String nonce,
- String theirPublic, @JsonProperty("secret") String secretKey) throws EverSdkException {
- return EverSdk.call(ctxId, "crypto.nacl_box", new Crypto.ParamsOfNaclBox(decrypted, nonce, theirPublic, secretKey), Crypto.ResultOfNaclBox.class);
+ public static CompletableFuture naclBox(int ctxId, String decrypted,
+ String nonce, String theirPublic, @JsonProperty("secret") String secretKey) throws
+ EverSdkException {
+ return EverSdk.async(ctxId, "crypto.nacl_box", new Crypto.ParamsOfNaclBox(decrypted, nonce, theirPublic, secretKey), Crypto.ResultOfNaclBox.class);
}
/**
@@ -247,9 +254,10 @@ public static Crypto.ResultOfNaclBox naclBox(int ctxId, String decrypted, String
* @param theirPublic Sender's public key - unprefixed 0-padded to 64 symbols hex string
* @param secretKey Receiver's private key - unprefixed 0-padded to 64 symbols hex string
*/
- public static Crypto.ResultOfNaclBoxOpen naclBoxOpen(int ctxId, String encrypted, String nonce,
- String theirPublic, @JsonProperty("secret") String secretKey) throws EverSdkException {
- return EverSdk.call(ctxId, "crypto.nacl_box_open", new Crypto.ParamsOfNaclBoxOpen(encrypted, nonce, theirPublic, secretKey), Crypto.ResultOfNaclBoxOpen.class);
+ public static CompletableFuture naclBoxOpen(int ctxId,
+ String encrypted, String nonce, String theirPublic, @JsonProperty("secret") String secretKey)
+ throws EverSdkException {
+ return EverSdk.async(ctxId, "crypto.nacl_box_open", new Crypto.ParamsOfNaclBoxOpen(encrypted, nonce, theirPublic, secretKey), Crypto.ResultOfNaclBoxOpen.class);
}
/**
@@ -259,9 +267,9 @@ public static Crypto.ResultOfNaclBoxOpen naclBoxOpen(int ctxId, String encrypted
* @param nonce Nonce in `hex`
* @param key Secret key - unprefixed 0-padded to 64 symbols hex string
*/
- public static Crypto.ResultOfNaclBox naclSecretBox(int ctxId, String decrypted, String nonce,
- String key) throws EverSdkException {
- return EverSdk.call(ctxId, "crypto.nacl_secret_box", new Crypto.ParamsOfNaclSecretBox(decrypted, nonce, key), Crypto.ResultOfNaclBox.class);
+ public static CompletableFuture naclSecretBox(int ctxId, String decrypted,
+ String nonce, String key) throws EverSdkException {
+ return EverSdk.async(ctxId, "crypto.nacl_secret_box", new Crypto.ParamsOfNaclSecretBox(decrypted, nonce, key), Crypto.ResultOfNaclBox.class);
}
/**
@@ -271,9 +279,9 @@ public static Crypto.ResultOfNaclBox naclSecretBox(int ctxId, String decrypted,
* @param nonce Nonce in `hex`
* @param key Secret key - unprefixed 0-padded to 64 symbols hex string
*/
- public static Crypto.ResultOfNaclBoxOpen naclSecretBoxOpen(int ctxId, String encrypted,
- String nonce, String key) throws EverSdkException {
- return EverSdk.call(ctxId, "crypto.nacl_secret_box_open", new Crypto.ParamsOfNaclSecretBoxOpen(encrypted, nonce, key), Crypto.ResultOfNaclBoxOpen.class);
+ public static CompletableFuture naclSecretBoxOpen(int ctxId,
+ String encrypted, String nonce, String key) throws EverSdkException {
+ return EverSdk.async(ctxId, "crypto.nacl_secret_box_open", new Crypto.ParamsOfNaclSecretBoxOpen(encrypted, nonce, key), Crypto.ResultOfNaclBoxOpen.class);
}
/**
@@ -281,9 +289,9 @@ public static Crypto.ResultOfNaclBoxOpen naclSecretBoxOpen(int ctxId, String enc
*
* @param dictionary Dictionary identifier
*/
- public static Crypto.ResultOfMnemonicWords mnemonicWords(int ctxId,
+ public static CompletableFuture mnemonicWords(int ctxId,
Crypto.MnemonicDictionary dictionary) throws EverSdkException {
- return EverSdk.call(ctxId, "crypto.mnemonic_words", new Crypto.ParamsOfMnemonicWords(dictionary), Crypto.ResultOfMnemonicWords.class);
+ return EverSdk.async(ctxId, "crypto.mnemonic_words", new Crypto.ParamsOfMnemonicWords(dictionary), Crypto.ResultOfMnemonicWords.class);
}
/**
@@ -292,9 +300,9 @@ public static Crypto.ResultOfMnemonicWords mnemonicWords(int ctxId,
* @param dictionary Dictionary identifier
* @param wordCount Mnemonic word count
*/
- public static Crypto.ResultOfMnemonicFromRandom mnemonicFromRandom(int ctxId,
+ public static CompletableFuture mnemonicFromRandom(int ctxId,
Crypto.MnemonicDictionary dictionary, Integer wordCount) throws EverSdkException {
- return EverSdk.call(ctxId, "crypto.mnemonic_from_random", new Crypto.ParamsOfMnemonicFromRandom(dictionary, wordCount), Crypto.ResultOfMnemonicFromRandom.class);
+ return EverSdk.async(ctxId, "crypto.mnemonic_from_random", new Crypto.ParamsOfMnemonicFromRandom(dictionary, wordCount), Crypto.ResultOfMnemonicFromRandom.class);
}
/**
@@ -304,9 +312,10 @@ public static Crypto.ResultOfMnemonicFromRandom mnemonicFromRandom(int ctxId,
* @param dictionary Dictionary identifier
* @param wordCount Mnemonic word count
*/
- public static Crypto.ResultOfMnemonicFromEntropy mnemonicFromEntropy(int ctxId, String entropy,
- Crypto.MnemonicDictionary dictionary, Integer wordCount) throws EverSdkException {
- return EverSdk.call(ctxId, "crypto.mnemonic_from_entropy", new Crypto.ParamsOfMnemonicFromEntropy(entropy, dictionary, wordCount), Crypto.ResultOfMnemonicFromEntropy.class);
+ public static CompletableFuture mnemonicFromEntropy(int ctxId,
+ String entropy, Crypto.MnemonicDictionary dictionary, Integer wordCount) throws
+ EverSdkException {
+ return EverSdk.async(ctxId, "crypto.mnemonic_from_entropy", new Crypto.ParamsOfMnemonicFromEntropy(entropy, dictionary, wordCount), Crypto.ResultOfMnemonicFromEntropy.class);
}
/**
@@ -317,9 +326,10 @@ public static Crypto.ResultOfMnemonicFromEntropy mnemonicFromEntropy(int ctxId,
* @param dictionary Dictionary identifier
* @param wordCount Word count
*/
- public static Crypto.ResultOfMnemonicVerify mnemonicVerify(int ctxId, String phrase,
- Crypto.MnemonicDictionary dictionary, Integer wordCount) throws EverSdkException {
- return EverSdk.call(ctxId, "crypto.mnemonic_verify", new Crypto.ParamsOfMnemonicVerify(phrase, dictionary, wordCount), Crypto.ResultOfMnemonicVerify.class);
+ public static CompletableFuture mnemonicVerify(int ctxId,
+ String phrase, Crypto.MnemonicDictionary dictionary, Integer wordCount) throws
+ EverSdkException {
+ return EverSdk.async(ctxId, "crypto.mnemonic_verify", new Crypto.ParamsOfMnemonicVerify(phrase, dictionary, wordCount), Crypto.ResultOfMnemonicVerify.class);
}
/**
@@ -331,9 +341,10 @@ public static Crypto.ResultOfMnemonicVerify mnemonicVerify(int ctxId, String phr
* @param dictionary Dictionary identifier
* @param wordCount Word count
*/
- public static Crypto.KeyPair mnemonicDeriveSignKeys(int ctxId, String phrase, String path,
- Crypto.MnemonicDictionary dictionary, Integer wordCount) throws EverSdkException {
- return EverSdk.call(ctxId, "crypto.mnemonic_derive_sign_keys", new Crypto.ParamsOfMnemonicDeriveSignKeys(phrase, path, dictionary, wordCount), Crypto.KeyPair.class);
+ public static CompletableFuture mnemonicDeriveSignKeys(int ctxId, String phrase,
+ String path, Crypto.MnemonicDictionary dictionary, Integer wordCount) throws
+ EverSdkException {
+ return EverSdk.async(ctxId, "crypto.mnemonic_derive_sign_keys", new Crypto.ParamsOfMnemonicDeriveSignKeys(phrase, path, dictionary, wordCount), Crypto.KeyPair.class);
}
/**
@@ -343,9 +354,10 @@ public static Crypto.KeyPair mnemonicDeriveSignKeys(int ctxId, String phrase, St
* @param dictionary Dictionary identifier
* @param wordCount Mnemonic word count
*/
- public static Crypto.ResultOfHDKeyXPrvFromMnemonic hdkeyXprvFromMnemonic(int ctxId, String phrase,
- Crypto.MnemonicDictionary dictionary, Integer wordCount) throws EverSdkException {
- return EverSdk.call(ctxId, "crypto.hdkey_xprv_from_mnemonic", new Crypto.ParamsOfHDKeyXPrvFromMnemonic(phrase, dictionary, wordCount), Crypto.ResultOfHDKeyXPrvFromMnemonic.class);
+ public static CompletableFuture hdkeyXprvFromMnemonic(
+ int ctxId, String phrase, Crypto.MnemonicDictionary dictionary, Integer wordCount) throws
+ EverSdkException {
+ return EverSdk.async(ctxId, "crypto.hdkey_xprv_from_mnemonic", new Crypto.ParamsOfHDKeyXPrvFromMnemonic(phrase, dictionary, wordCount), Crypto.ResultOfHDKeyXPrvFromMnemonic.class);
}
/**
@@ -355,9 +367,9 @@ public static Crypto.ResultOfHDKeyXPrvFromMnemonic hdkeyXprvFromMnemonic(int ctx
* @param childIndex Child index (see BIP-0032)
* @param hardened Indicates the derivation of hardened/not-hardened key (see BIP-0032)
*/
- public static Crypto.ResultOfHDKeyDeriveFromXPrv hdkeyDeriveFromXprv(int ctxId, String xprv,
- Long childIndex, Boolean hardened) throws EverSdkException {
- return EverSdk.call(ctxId, "crypto.hdkey_derive_from_xprv", new Crypto.ParamsOfHDKeyDeriveFromXPrv(xprv, childIndex, hardened), Crypto.ResultOfHDKeyDeriveFromXPrv.class);
+ public static CompletableFuture hdkeyDeriveFromXprv(int ctxId,
+ String xprv, Long childIndex, Boolean hardened) throws EverSdkException {
+ return EverSdk.async(ctxId, "crypto.hdkey_derive_from_xprv", new Crypto.ParamsOfHDKeyDeriveFromXPrv(xprv, childIndex, hardened), Crypto.ResultOfHDKeyDeriveFromXPrv.class);
}
/**
@@ -366,9 +378,9 @@ public static Crypto.ResultOfHDKeyDeriveFromXPrv hdkeyDeriveFromXprv(int ctxId,
* @param xprv Serialized extended private key
* @param path Derivation path, for instance "m/44'/396'/0'/0/0"
*/
- public static Crypto.ResultOfHDKeyDeriveFromXPrvPath hdkeyDeriveFromXprvPath(int ctxId,
- String xprv, String path) throws EverSdkException {
- return EverSdk.call(ctxId, "crypto.hdkey_derive_from_xprv_path", new Crypto.ParamsOfHDKeyDeriveFromXPrvPath(xprv, path), Crypto.ResultOfHDKeyDeriveFromXPrvPath.class);
+ public static CompletableFuture hdkeyDeriveFromXprvPath(
+ int ctxId, String xprv, String path) throws EverSdkException {
+ return EverSdk.async(ctxId, "crypto.hdkey_derive_from_xprv_path", new Crypto.ParamsOfHDKeyDeriveFromXPrvPath(xprv, path), Crypto.ResultOfHDKeyDeriveFromXPrvPath.class);
}
/**
@@ -376,9 +388,9 @@ public static Crypto.ResultOfHDKeyDeriveFromXPrvPath hdkeyDeriveFromXprvPath(int
*
* @param xprv Serialized extended private key
*/
- public static Crypto.ResultOfHDKeySecretFromXPrv hdkeySecretFromXprv(int ctxId, String xprv)
- throws EverSdkException {
- return EverSdk.call(ctxId, "crypto.hdkey_secret_from_xprv", new Crypto.ParamsOfHDKeySecretFromXPrv(xprv), Crypto.ResultOfHDKeySecretFromXPrv.class);
+ public static CompletableFuture hdkeySecretFromXprv(int ctxId,
+ String xprv) throws EverSdkException {
+ return EverSdk.async(ctxId, "crypto.hdkey_secret_from_xprv", new Crypto.ParamsOfHDKeySecretFromXPrv(xprv), Crypto.ResultOfHDKeySecretFromXPrv.class);
}
/**
@@ -386,9 +398,9 @@ public static Crypto.ResultOfHDKeySecretFromXPrv hdkeySecretFromXprv(int ctxId,
*
* @param xprv Serialized extended private key
*/
- public static Crypto.ResultOfHDKeyPublicFromXPrv hdkeyPublicFromXprv(int ctxId, String xprv)
- throws EverSdkException {
- return EverSdk.call(ctxId, "crypto.hdkey_public_from_xprv", new Crypto.ParamsOfHDKeyPublicFromXPrv(xprv), Crypto.ResultOfHDKeyPublicFromXPrv.class);
+ public static CompletableFuture hdkeyPublicFromXprv(int ctxId,
+ String xprv) throws EverSdkException {
+ return EverSdk.async(ctxId, "crypto.hdkey_public_from_xprv", new Crypto.ParamsOfHDKeyPublicFromXPrv(xprv), Crypto.ResultOfHDKeyPublicFromXPrv.class);
}
/**
@@ -398,9 +410,9 @@ public static Crypto.ResultOfHDKeyPublicFromXPrv hdkeyPublicFromXprv(int ctxId,
* @param key Must be encoded with `hex`. 256-bit key.
* @param nonce Must be encoded with `hex`. 96-bit nonce.
*/
- public static Crypto.ResultOfChaCha20 chacha20(int ctxId, String data, String key, String nonce)
- throws EverSdkException {
- return EverSdk.call(ctxId, "crypto.chacha20", new Crypto.ParamsOfChaCha20(data, key, nonce), Crypto.ResultOfChaCha20.class);
+ public static CompletableFuture chacha20(int ctxId, String data,
+ String key, String nonce) throws EverSdkException {
+ return EverSdk.async(ctxId, "crypto.chacha20", new Crypto.ParamsOfChaCha20(data, key, nonce), Crypto.ResultOfChaCha20.class);
}
/**
@@ -417,10 +429,10 @@ public static Crypto.ResultOfChaCha20 chacha20(int ctxId, String data, String ke
* @param secretEncryptionSalt Salt used for secret encryption. For example, a mobile device can use device ID as salt.
* @param secretKey Cryptobox secret
*/
- public static Crypto.RegisteredCryptoBox createCryptoBox(int ctxId, String secretEncryptionSalt,
- @JsonProperty("secret") Crypto.CryptoBoxSecret secretKey, AppSigningBox appObject) throws
- EverSdkException {
- return EverSdk.callAppObject(ctxId, "crypto.create_crypto_box", new Crypto.ParamsOfCreateCryptoBox(secretEncryptionSalt, secretKey), appObject, Crypto.RegisteredCryptoBox.class);
+ public static CompletableFuture createCryptoBox(int ctxId,
+ String secretEncryptionSalt, @JsonProperty("secret") Crypto.CryptoBoxSecret secretKey,
+ AppPasswordProvider appObject) throws EverSdkException {
+ return EverSdk.asyncAppObject(ctxId, "crypto.create_crypto_box", new Crypto.ParamsOfCreateCryptoBox(secretEncryptionSalt, secretKey), Crypto.RegisteredCryptoBox.class, appObject);
}
/**
@@ -428,23 +440,23 @@ public static Crypto.RegisteredCryptoBox createCryptoBox(int ctxId, String secre
*/
public static void removeCryptoBox(int ctxId, Crypto.RegisteredCryptoBox params) throws
EverSdkException {
- EverSdk.callVoid(ctxId, "crypto.remove_crypto_box", params);
+ EverSdk.asyncVoid(ctxId, "crypto.remove_crypto_box", params);
}
/**
* Get Crypto Box Info. Used to get `encrypted_secret` that should be used for all the cryptobox initializations except the first one.
*/
- public static Crypto.ResultOfGetCryptoBoxInfo getCryptoBoxInfo(int ctxId,
+ public static CompletableFuture getCryptoBoxInfo(int ctxId,
Crypto.RegisteredCryptoBox params) throws EverSdkException {
- return EverSdk.call(ctxId, "crypto.get_crypto_box_info", params, Crypto.ResultOfGetCryptoBoxInfo.class);
+ return EverSdk.async(ctxId, "crypto.get_crypto_box_info", params, Crypto.ResultOfGetCryptoBoxInfo.class);
}
/**
* Attention! Store this data in your application for a very short period of time and overwrite it with zeroes ASAP. Get Crypto Box Seed Phrase.
*/
- public static Crypto.ResultOfGetCryptoBoxSeedPhrase getCryptoBoxSeedPhrase(int ctxId,
- Crypto.RegisteredCryptoBox params) throws EverSdkException {
- return EverSdk.call(ctxId, "crypto.get_crypto_box_seed_phrase", params, Crypto.ResultOfGetCryptoBoxSeedPhrase.class);
+ public static CompletableFuture getCryptoBoxSeedPhrase(
+ int ctxId, Crypto.RegisteredCryptoBox params) throws EverSdkException {
+ return EverSdk.async(ctxId, "crypto.get_crypto_box_seed_phrase", params, Crypto.ResultOfGetCryptoBoxSeedPhrase.class);
}
/**
@@ -454,9 +466,9 @@ public static Crypto.ResultOfGetCryptoBoxSeedPhrase getCryptoBoxSeedPhrase(int c
* @param hdpath By default, Everscale HD path is used. HD key derivation path.
* @param secretLifetime Store derived secret for this lifetime (in ms). The timer starts after each signing box operation. Secrets will be deleted immediately after each signing box operation, if this value is not set.
*/
- public static Crypto.RegisteredSigningBox getSigningBoxFromCryptoBox(int ctxId, Long handle,
- String hdpath, Long secretLifetime) throws EverSdkException {
- return EverSdk.call(ctxId, "crypto.get_signing_box_from_crypto_box", new Crypto.ParamsOfGetSigningBoxFromCryptoBox(handle, hdpath, secretLifetime), Crypto.RegisteredSigningBox.class);
+ public static CompletableFuture getSigningBoxFromCryptoBox(int ctxId,
+ Long handle, String hdpath, Long secretLifetime) throws EverSdkException {
+ return EverSdk.async(ctxId, "crypto.get_signing_box_from_crypto_box", new Crypto.ParamsOfGetSigningBoxFromCryptoBox(handle, hdpath, secretLifetime), Crypto.RegisteredSigningBox.class);
}
/**
@@ -471,10 +483,10 @@ public static Crypto.RegisteredSigningBox getSigningBoxFromCryptoBox(int ctxId,
* @param algorithm Encryption algorithm.
* @param secretLifetime Store derived secret for encryption algorithm for this lifetime (in ms). The timer starts after each encryption box operation. Secrets will be deleted (overwritten with zeroes) after each encryption operation, if this value is not set.
*/
- public static Crypto.RegisteredEncryptionBox getEncryptionBoxFromCryptoBox(int ctxId, Long handle,
- String hdpath, Crypto.BoxEncryptionAlgorithm algorithm, Long secretLifetime) throws
- EverSdkException {
- return EverSdk.call(ctxId, "crypto.get_encryption_box_from_crypto_box", new Crypto.ParamsOfGetEncryptionBoxFromCryptoBox(handle, hdpath, algorithm, secretLifetime), Crypto.RegisteredEncryptionBox.class);
+ public static CompletableFuture getEncryptionBoxFromCryptoBox(
+ int ctxId, Long handle, String hdpath, Crypto.BoxEncryptionAlgorithm algorithm,
+ Long secretLifetime) throws EverSdkException {
+ return EverSdk.async(ctxId, "crypto.get_encryption_box_from_crypto_box", new Crypto.ParamsOfGetEncryptionBoxFromCryptoBox(handle, hdpath, algorithm, secretLifetime), Crypto.RegisteredEncryptionBox.class);
}
/**
@@ -482,31 +494,31 @@ public static Crypto.RegisteredEncryptionBox getEncryptionBoxFromCryptoBox(int c
*/
public static void clearCryptoBoxSecretCache(int ctxId, Crypto.RegisteredCryptoBox params) throws
EverSdkException {
- EverSdk.callVoid(ctxId, "crypto.clear_crypto_box_secret_cache", params);
+ EverSdk.asyncVoid(ctxId, "crypto.clear_crypto_box_secret_cache", params);
}
/**
* Register an application implemented signing box.
*/
- public static Crypto.RegisteredSigningBox registerSigningBox(int ctxId, AppSigningBox appObject)
- throws EverSdkException {
- return EverSdk.callAppObject(ctxId, "crypto.register_signing_box", null, appObject, Crypto.RegisteredSigningBox.class);
+ public static CompletableFuture registerSigningBox(int ctxId,
+ AppSigningBox appObject) throws EverSdkException {
+ return EverSdk.asyncAppObject(ctxId, "crypto.register_signing_box", null, Crypto.RegisteredSigningBox.class, appObject);
}
/**
* Creates a default signing box implementation.
*/
- public static Crypto.RegisteredSigningBox getSigningBox(int ctxId, Crypto.KeyPair params) throws
- EverSdkException {
- return EverSdk.call(ctxId, "crypto.get_signing_box", params, Crypto.RegisteredSigningBox.class);
+ public static CompletableFuture getSigningBox(int ctxId,
+ Crypto.KeyPair params) throws EverSdkException {
+ return EverSdk.async(ctxId, "crypto.get_signing_box", params, Crypto.RegisteredSigningBox.class);
}
/**
* Returns public key of signing key pair.
*/
- public static Crypto.ResultOfSigningBoxGetPublicKey signingBoxGetPublicKey(int ctxId,
- Crypto.RegisteredSigningBox params) throws EverSdkException {
- return EverSdk.call(ctxId, "crypto.signing_box_get_public_key", params, Crypto.ResultOfSigningBoxGetPublicKey.class);
+ public static CompletableFuture signingBoxGetPublicKey(
+ int ctxId, Crypto.RegisteredSigningBox params) throws EverSdkException {
+ return EverSdk.async(ctxId, "crypto.signing_box_get_public_key", params, Crypto.ResultOfSigningBoxGetPublicKey.class);
}
/**
@@ -515,9 +527,9 @@ public static Crypto.ResultOfSigningBoxGetPublicKey signingBoxGetPublicKey(int c
* @param signingBox Signing Box handle.
* @param unsigned Must be encoded with `base64`. Unsigned user data.
*/
- public static Crypto.ResultOfSigningBoxSign signingBoxSign(int ctxId, Long signingBox,
- String unsigned) throws EverSdkException {
- return EverSdk.call(ctxId, "crypto.signing_box_sign", new Crypto.ParamsOfSigningBoxSign(signingBox, unsigned), Crypto.ResultOfSigningBoxSign.class);
+ public static CompletableFuture signingBoxSign(int ctxId,
+ Long signingBox, String unsigned) throws EverSdkException {
+ return EverSdk.async(ctxId, "crypto.signing_box_sign", new Crypto.ParamsOfSigningBoxSign(signingBox, unsigned), Crypto.ResultOfSigningBoxSign.class);
}
/**
@@ -525,15 +537,15 @@ public static Crypto.ResultOfSigningBoxSign signingBoxSign(int ctxId, Long signi
*/
public static void removeSigningBox(int ctxId, Crypto.RegisteredSigningBox params) throws
EverSdkException {
- EverSdk.callVoid(ctxId, "crypto.remove_signing_box", params);
+ EverSdk.asyncVoid(ctxId, "crypto.remove_signing_box", params);
}
/**
* Register an application implemented encryption box.
*/
- public static Crypto.RegisteredEncryptionBox registerEncryptionBox(int ctxId,
- AppSigningBox appObject) throws EverSdkException {
- return EverSdk.callAppObject(ctxId, "crypto.register_encryption_box", null, appObject, Crypto.RegisteredEncryptionBox.class);
+ public static CompletableFuture registerEncryptionBox(int ctxId,
+ AppEncryptionBox appObject) throws EverSdkException {
+ return EverSdk.asyncAppObject(ctxId, "crypto.register_encryption_box", null, Crypto.RegisteredEncryptionBox.class, appObject);
}
/**
@@ -541,7 +553,7 @@ public static Crypto.RegisteredEncryptionBox registerEncryptionBox(int ctxId,
*/
public static void removeEncryptionBox(int ctxId, Crypto.RegisteredEncryptionBox params) throws
EverSdkException {
- EverSdk.callVoid(ctxId, "crypto.remove_encryption_box", params);
+ EverSdk.asyncVoid(ctxId, "crypto.remove_encryption_box", params);
}
/**
@@ -549,9 +561,9 @@ public static void removeEncryptionBox(int ctxId, Crypto.RegisteredEncryptionBox
*
* @param encryptionBox Encryption box handle
*/
- public static Crypto.ResultOfEncryptionBoxGetInfo encryptionBoxGetInfo(int ctxId,
- Long encryptionBox) throws EverSdkException {
- return EverSdk.call(ctxId, "crypto.encryption_box_get_info", new Crypto.ParamsOfEncryptionBoxGetInfo(encryptionBox), Crypto.ResultOfEncryptionBoxGetInfo.class);
+ public static CompletableFuture encryptionBoxGetInfo(
+ int ctxId, Long encryptionBox) throws EverSdkException {
+ return EverSdk.async(ctxId, "crypto.encryption_box_get_info", new Crypto.ParamsOfEncryptionBoxGetInfo(encryptionBox), Crypto.ResultOfEncryptionBoxGetInfo.class);
}
/**
@@ -561,9 +573,9 @@ public static Crypto.ResultOfEncryptionBoxGetInfo encryptionBoxGetInfo(int ctxId
* @param encryptionBox Encryption box handle
* @param data Data to be encrypted, encoded in Base64
*/
- public static Crypto.ResultOfEncryptionBoxEncrypt encryptionBoxEncrypt(int ctxId,
- Long encryptionBox, String data) throws EverSdkException {
- return EverSdk.call(ctxId, "crypto.encryption_box_encrypt", new Crypto.ParamsOfEncryptionBoxEncrypt(encryptionBox, data), Crypto.ResultOfEncryptionBoxEncrypt.class);
+ public static CompletableFuture encryptionBoxEncrypt(
+ int ctxId, Long encryptionBox, String data) throws EverSdkException {
+ return EverSdk.async(ctxId, "crypto.encryption_box_encrypt", new Crypto.ParamsOfEncryptionBoxEncrypt(encryptionBox, data), Crypto.ResultOfEncryptionBoxEncrypt.class);
}
/**
@@ -573,9 +585,9 @@ public static Crypto.ResultOfEncryptionBoxEncrypt encryptionBoxEncrypt(int ctxId
* @param encryptionBox Encryption box handle
* @param data Data to be decrypted, encoded in Base64
*/
- public static Crypto.ResultOfEncryptionBoxDecrypt encryptionBoxDecrypt(int ctxId,
- Long encryptionBox, String data) throws EverSdkException {
- return EverSdk.call(ctxId, "crypto.encryption_box_decrypt", new Crypto.ParamsOfEncryptionBoxDecrypt(encryptionBox, data), Crypto.ResultOfEncryptionBoxDecrypt.class);
+ public static CompletableFuture encryptionBoxDecrypt(
+ int ctxId, Long encryptionBox, String data) throws EverSdkException {
+ return EverSdk.async(ctxId, "crypto.encryption_box_decrypt", new Crypto.ParamsOfEncryptionBoxDecrypt(encryptionBox, data), Crypto.ResultOfEncryptionBoxDecrypt.class);
}
/**
@@ -583,9 +595,9 @@ public static Crypto.ResultOfEncryptionBoxDecrypt encryptionBoxDecrypt(int ctxId
*
* @param algorithm Encryption algorithm specifier including cipher parameters (key, IV, etc)
*/
- public static Crypto.RegisteredEncryptionBox createEncryptionBox(int ctxId,
+ public static CompletableFuture createEncryptionBox(int ctxId,
Crypto.EncryptionAlgorithm algorithm) throws EverSdkException {
- return EverSdk.call(ctxId, "crypto.create_encryption_box", new Crypto.ParamsOfCreateEncryptionBox(algorithm), Crypto.RegisteredEncryptionBox.class);
+ return EverSdk.async(ctxId, "crypto.create_encryption_box", new Crypto.ParamsOfCreateEncryptionBox(algorithm), Crypto.RegisteredEncryptionBox.class);
}
/**
diff --git a/src/gen/java/tech/deplant/java4ever/binding/Debot.java b/src/gen/java/tech/deplant/java4ever/binding/Debot.java
deleted file mode 100644
index 545c0ce..0000000
--- a/src/gen/java/tech/deplant/java4ever/binding/Debot.java
+++ /dev/null
@@ -1,443 +0,0 @@
-package tech.deplant.java4ever.binding;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonValue;
-import java.lang.Boolean;
-import java.lang.Deprecated;
-import java.lang.Integer;
-import java.lang.Long;
-import java.lang.String;
-import java.math.BigInteger;
-
-/**
- * Debot
- * Contains methods of "debot" module of EVER-SDK API
- *
- * [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Module for working with debot.
- * @version 1.45.0
- */
-public final class Debot {
- /**
- * Downloads debot smart contract (code and data) from blockchain and creates
- * an instance of Debot Engine for it.
- *
- * # Remarks
- * It does not switch debot to context 0. Browser Callbacks are not called. [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Creates and instance of DeBot.
- *
- * @param address Debot smart contract address
- */
- @Unstable
- @Deprecated
- public static Debot.RegisteredDebot init(int ctxId, String address, AppSigningBox appObject)
- throws EverSdkException {
- return EverSdk.callAppObject(ctxId, "debot.init", new Debot.ParamsOfInit(address), appObject, Debot.RegisteredDebot.class);
- }
-
- /**
- * Downloads debot smart contract from blockchain and switches it to
- * context zero.
- *
- * This function must be used by Debot Browser to start a dialog with debot.
- * While the function is executing, several Browser Callbacks can be called,
- * since the debot tries to display all actions from the context 0 to the user.
- *
- * When the debot starts SDK registers `BrowserCallbacks` AppObject.
- * Therefore when `debote.remove` is called the debot is being deleted and the callback is called
- * with `finish`=`true` which indicates that it will never be used again. [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Starts the DeBot.
- *
- * @param debotHandle Debot handle which references an instance of debot engine.
- */
- @Unstable
- @Deprecated
- public static void start(int ctxId, Long debotHandle) throws EverSdkException {
- EverSdk.callVoid(ctxId, "debot.start", new Debot.ParamsOfStart(debotHandle));
- }
-
- /**
- * Downloads DeBot from blockchain and creates and fetches its metadata. [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Fetches DeBot metadata from blockchain.
- *
- * @param address Debot smart contract address.
- */
- @Unstable
- @Deprecated
- public static Debot.ResultOfFetch fetch(int ctxId, String address) throws EverSdkException {
- return EverSdk.call(ctxId, "debot.fetch", new Debot.ParamsOfFetch(address), Debot.ResultOfFetch.class);
- }
-
- /**
- * Calls debot engine referenced by debot handle to execute input action.
- * Calls Debot Browser Callbacks if needed.
- *
- * # Remarks
- * Chain of actions can be executed if input action generates a list of subactions. [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Executes debot action.
- *
- * @param debotHandle Debot handle which references an instance of debot engine.
- * @param action Debot Action that must be executed.
- */
- @Unstable
- @Deprecated
- public static void execute(int ctxId, Long debotHandle, Debot.DebotAction action) throws
- EverSdkException {
- EverSdk.callVoid(ctxId, "debot.execute", new Debot.ParamsOfExecute(debotHandle, action));
- }
-
- /**
- * Used by Debot Browser to send response on Dinterface call or from other Debots. [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Sends message to Debot.
- *
- * @param debotHandle Debot handle which references an instance of debot engine.
- * @param message BOC of internal message to debot encoded in base64 format.
- */
- @Unstable
- @Deprecated
- public static void send(int ctxId, Long debotHandle, String message) throws EverSdkException {
- EverSdk.callVoid(ctxId, "debot.send", new Debot.ParamsOfSend(debotHandle, message));
- }
-
- /**
- * Removes handle from Client Context and drops debot engine referenced by that handle. [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Destroys debot handle.
- *
- * @param debotHandle Debot handle which references an instance of debot engine.
- */
- @Unstable
- @Deprecated
- public static void remove(int ctxId, Long debotHandle) throws EverSdkException {
- EverSdk.callVoid(ctxId, "debot.remove", new Debot.ParamsOfRemove(debotHandle));
- }
-
- /**
- * [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Describes how much funds will be debited from the target contract balance as a result of the transaction.
- *
- * @param amount Amount of nanotokens that will be sent to `dst` address.
- * @param dst Destination address of recipient of funds.
- */
- public record Spending(BigInteger amount, String dst) {
- }
-
- /**
- * [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Parameters for executing debot action.
- *
- * @param debotHandle Debot handle which references an instance of debot engine.
- * @param action Debot Action that must be executed.
- */
- public record ParamsOfExecute(Long debotHandle, Debot.DebotAction action) {
- }
-
- /**
- * [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Returning values from Debot Browser callbacks.
- */
- public sealed interface ResultOfAppDebotBrowser {
- /**
- * Result of user input.
- *
- * @param value String entered by user.
- */
- record Input(String value) implements ResultOfAppDebotBrowser {
- @JsonProperty("type")
- public String type() {
- return "Input";
- }
- }
-
- /**
- * Result of getting signing box.
- *
- * @param signingBox Signing box is owned and disposed by debot engine Signing box for signing data requested by debot engine.
- */
- record GetSigningBox(Long signingBox) implements ResultOfAppDebotBrowser {
- @JsonProperty("type")
- public String type() {
- return "GetSigningBox";
- }
- }
-
- /**
- * Result of debot invoking.
- */
- record InvokeDebot() implements ResultOfAppDebotBrowser {
- @JsonProperty("type")
- public String type() {
- return "InvokeDebot";
- }
- }
-
- /**
- * Result of `approve` callback.
- *
- * @param approved Indicates whether the DeBot is allowed to perform the specified operation.
- */
- record Approve(Boolean approved) implements ResultOfAppDebotBrowser {
- @JsonProperty("type")
- public String type() {
- return "Approve";
- }
- }
- }
-
- /**
- * Called by debot engine to communicate with debot browser. [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Debot Browser callbacks
- */
- public sealed interface ParamsOfAppDebotBrowser {
- /**
- * Print message to user.
- *
- * @param msg A string that must be printed to user.
- */
- record Log(String msg) implements ParamsOfAppDebotBrowser {
- @JsonProperty("type")
- public String type() {
- return "Log";
- }
- }
-
- /**
- * Switch debot to another context (menu).
- *
- * @param contextId Debot context ID to which debot is switched.
- */
- record Switch(Integer contextId) implements ParamsOfAppDebotBrowser {
- @JsonProperty("type")
- public String type() {
- return "Switch";
- }
- }
-
- /**
- * Notify browser that all context actions are shown.
- */
- record SwitchCompleted() implements ParamsOfAppDebotBrowser {
- @JsonProperty("type")
- public String type() {
- return "SwitchCompleted";
- }
- }
-
- /**
- * Show action to the user. Called after `switch` for each action in context.
- *
- * @param action Debot action that must be shown to user as menu item. At least `description` property must be shown from [DebotAction] structure.
- */
- record ShowAction(Debot.DebotAction action) implements ParamsOfAppDebotBrowser {
- @JsonProperty("type")
- public String type() {
- return "ShowAction";
- }
- }
-
- /**
- * Request user input.
- *
- * @param prompt A prompt string that must be printed to user before input request.
- */
- record Input(String prompt) implements ParamsOfAppDebotBrowser {
- @JsonProperty("type")
- public String type() {
- return "Input";
- }
- }
-
- /**
- * Signing box returned is owned and disposed by debot engine Get signing box to sign data.
- */
- record GetSigningBox() implements ParamsOfAppDebotBrowser {
- @JsonProperty("type")
- public String type() {
- return "GetSigningBox";
- }
- }
-
- /**
- * Execute action of another debot.
- *
- * @param debotAddr Address of debot in blockchain.
- * @param action Debot action to execute.
- */
- record InvokeDebot(String debotAddr,
- Debot.DebotAction action) implements ParamsOfAppDebotBrowser {
- @JsonProperty("type")
- public String type() {
- return "InvokeDebot";
- }
- }
-
- /**
- * Used by Debot to call DInterface implemented by Debot Browser.
- *
- * @param message Message body contains interface function and parameters. Internal message to DInterface address.
- */
- record Send(String message) implements ParamsOfAppDebotBrowser {
- @JsonProperty("type")
- public String type() {
- return "Send";
- }
- }
-
- /**
- * Requests permission from DeBot Browser to execute DeBot operation.
- *
- * @param activity DeBot activity details.
- */
- record Approve(Debot.DebotActivity activity) implements ParamsOfAppDebotBrowser {
- @JsonProperty("type")
- public String type() {
- return "Approve";
- }
- }
- }
-
- /**
- * [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md)
- *
- * @param info Debot metadata.
- */
- public record ResultOfFetch(Debot.DebotInfo info) {
- }
-
- /**
- * [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md)
- *
- * @param debotHandle Debot handle which references an instance of debot engine.
- */
- public record ParamsOfRemove(Long debotHandle) {
- }
-
- /**
- * [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Structure for storing debot handle returned from `init` function.
- *
- * @param debotHandle Debot handle which references an instance of debot engine.
- * @param debotAbi Debot abi as json string.
- * @param info Debot metadata.
- */
- public record RegisteredDebot(Long debotHandle, String debotAbi, Debot.DebotInfo info) {
- }
-
- /**
- * [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Parameters to start DeBot. DeBot must be already initialized with init() function.
- *
- * @param debotHandle Debot handle which references an instance of debot engine.
- */
- public record ParamsOfStart(Long debotHandle) {
- }
-
- /**
- * [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Describes the operation that the DeBot wants to perform.
- */
- public sealed interface DebotActivity {
- /**
- * DeBot wants to create new transaction in blockchain.
- *
- * @param msg External inbound message BOC.
- * @param dst Target smart contract address.
- * @param out List of spendings as a result of transaction.
- * @param fee Transaction total fee.
- * @param setcode Indicates if target smart contract updates its code.
- * @param signkey Public key from keypair that was used to sign external message.
- * @param signingBoxHandle Signing box handle used to sign external message.
- */
- record Transaction(String msg, String dst, Debot.Spending[] out, BigInteger fee,
- Boolean setcode, String signkey, Long signingBoxHandle) implements DebotActivity {
- @JsonProperty("type")
- public String type() {
- return "Transaction";
- }
- }
- }
-
- /**
- * [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Parameters to fetch DeBot metadata.
- *
- * @param address Debot smart contract address.
- */
- public record ParamsOfFetch(String address) {
- }
-
- /**
- * [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Parameters of `send` function.
- *
- * @param debotHandle Debot handle which references an instance of debot engine.
- * @param message BOC of internal message to debot encoded in base64 format.
- */
- public record ParamsOfSend(Long debotHandle, String message) {
- }
-
- /**
- * [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Describes DeBot metadata.
- *
- * @param name DeBot short name.
- * @param version DeBot semantic version.
- * @param publisher The name of DeBot deployer.
- * @param caption Short info about DeBot.
- * @param author The name of DeBot developer.
- * @param support TON address of author for questions and donations.
- * @param hello String with the first messsage from DeBot.
- * @param language String with DeBot interface language (ISO-639).
- * @param dabi String with DeBot ABI.
- * @param icon DeBot icon.
- * @param interfaces Vector with IDs of DInterfaces used by DeBot.
- * @param dabiversion ABI version ("x.y") supported by DeBot
- */
- public record DebotInfo(String name, String version, String publisher, String caption,
- String author, String support, String hello, String language, String dabi, String icon,
- String[] interfaces, String dabiversion) {
- }
-
- /**
- * [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Parameters to init DeBot.
- *
- * @param address Debot smart contract address
- */
- public record ParamsOfInit(String address) {
- }
-
- public enum DebotErrorCode {
- DebotStartFailed(801),
-
- DebotFetchFailed(802),
-
- DebotExecutionFailed(803),
-
- DebotInvalidHandle(804),
-
- DebotInvalidJsonParams(805),
-
- DebotInvalidFunctionId(806),
-
- DebotInvalidAbi(807),
-
- DebotGetMethodFailed(808),
-
- DebotInvalidMsg(809),
-
- DebotExternalCallFailed(810),
-
- DebotBrowserCallbackFailed(811),
-
- DebotOperationRejected(812),
-
- DebotNoCode(813);
-
- private final Integer value;
-
- DebotErrorCode(Integer value) {
- this.value = value;
- }
-
- @JsonValue
- public Integer value() {
- return this.value;
- }
- }
-
- /**
- * [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Describes a debot action in a Debot Context.
- *
- * @param description Should be used by Debot Browser as name of menu item. A short action description.
- * @param name Can be a debot function name or a print string (for Print Action). Depends on action type.
- * @param actionType Action type.
- * @param to ID of debot context to switch after action execution.
- * @param attributes In the form of "param=value,flag". attribute example: instant, args, fargs, sign. Action attributes.
- * @param misc Used by debot only. Some internal action data.
- */
- public record DebotAction(String description, String name, Integer actionType, Integer to,
- String attributes, String misc) {
- }
-}
diff --git a/src/gen/java/tech/deplant/java4ever/binding/Net.java b/src/gen/java/tech/deplant/java4ever/binding/Net.java
index bf6f3d0..7ce4e70 100644
--- a/src/gen/java/tech/deplant/java4ever/binding/Net.java
+++ b/src/gen/java/tech/deplant/java4ever/binding/Net.java
@@ -6,12 +6,13 @@
import java.lang.Boolean;
import java.lang.Long;
import java.lang.String;
-import tech.deplant.java4ever.binding.ffi.EverSdkSubscription;
+import java.util.concurrent.CompletableFuture;
+import java.util.function.Consumer;
/**
* Net
* Contains methods of "net" module of EVER-SDK API
- *
+ *
* Network access.
* @version 1.45.0
*/
@@ -22,9 +23,9 @@ public final class Net {
* @param query GraphQL query text.
* @param variables Must be a map with named values that can be used in query. Variables used in query.
*/
- public static Net.ResultOfQuery query(int ctxId, String query, JsonNode variables) throws
- EverSdkException {
- return EverSdk.call(ctxId, "net.query", new Net.ParamsOfQuery(query, variables), Net.ResultOfQuery.class);
+ public static CompletableFuture query(int ctxId, String query,
+ JsonNode variables) throws EverSdkException {
+ return EverSdk.async(ctxId, "net.query", new Net.ParamsOfQuery(query, variables), Net.ResultOfQuery.class);
}
/**
@@ -32,9 +33,9 @@ public static Net.ResultOfQuery query(int ctxId, String query, JsonNode variable
*
* @param operations List of query operations that must be performed per single fetch.
*/
- public static Net.ResultOfBatchQuery batchQuery(int ctxId,
+ public static CompletableFuture batchQuery(int ctxId,
Net.ParamsOfQueryOperation[] operations) throws EverSdkException {
- return EverSdk.call(ctxId, "net.batch_query", new Net.ParamsOfBatchQuery(operations), Net.ResultOfBatchQuery.class);
+ return EverSdk.async(ctxId, "net.batch_query", new Net.ParamsOfBatchQuery(operations), Net.ResultOfBatchQuery.class);
}
/**
@@ -48,9 +49,10 @@ public static Net.ResultOfBatchQuery batchQuery(int ctxId,
* @param order Sorting order
* @param limit Number of documents to return
*/
- public static Net.ResultOfQueryCollection queryCollection(int ctxId, String collection,
- JsonNode filter, String result, Net.OrderBy[] order, Long limit) throws EverSdkException {
- return EverSdk.call(ctxId, "net.query_collection", new Net.ParamsOfQueryCollection(collection, filter, result, order, limit), Net.ResultOfQueryCollection.class);
+ public static CompletableFuture queryCollection(int ctxId,
+ String collection, JsonNode filter, String result, Net.OrderBy[] order, Long limit) throws
+ EverSdkException {
+ return EverSdk.async(ctxId, "net.query_collection", new Net.ParamsOfQueryCollection(collection, filter, result, order, limit), Net.ResultOfQueryCollection.class);
}
/**
@@ -61,9 +63,9 @@ public static Net.ResultOfQueryCollection queryCollection(int ctxId, String coll
* @param filter Collection filter
* @param fields Projection (result) string
*/
- public static Net.ResultOfAggregateCollection aggregateCollection(int ctxId, String collection,
- JsonNode filter, Net.FieldAggregation[] fields) throws EverSdkException {
- return EverSdk.call(ctxId, "net.aggregate_collection", new Net.ParamsOfAggregateCollection(collection, filter, fields), Net.ResultOfAggregateCollection.class);
+ public static CompletableFuture aggregateCollection(int ctxId,
+ String collection, JsonNode filter, Net.FieldAggregation[] fields) throws EverSdkException {
+ return EverSdk.async(ctxId, "net.aggregate_collection", new Net.ParamsOfAggregateCollection(collection, filter, fields), Net.ResultOfAggregateCollection.class);
}
/**
@@ -79,9 +81,9 @@ public static Net.ResultOfAggregateCollection aggregateCollection(int ctxId, Str
* @param result Projection (result) string
* @param timeout Query timeout
*/
- public static Net.ResultOfWaitForCollection waitForCollection(int ctxId, String collection,
- JsonNode filter, String result, Long timeout) throws EverSdkException {
- return EverSdk.call(ctxId, "net.wait_for_collection", new Net.ParamsOfWaitForCollection(collection, filter, result, timeout), Net.ResultOfWaitForCollection.class);
+ public static CompletableFuture waitForCollection(int ctxId,
+ String collection, JsonNode filter, String result, Long timeout) throws EverSdkException {
+ return EverSdk.async(ctxId, "net.wait_for_collection", new Net.ParamsOfWaitForCollection(collection, filter, result, timeout), Net.ResultOfWaitForCollection.class);
}
/**
@@ -89,7 +91,7 @@ public static Net.ResultOfWaitForCollection waitForCollection(int ctxId, String
*/
public static void unsubscribe(int ctxId, Net.ResultOfSubscribeCollection params) throws
EverSdkException {
- EverSdk.callVoid(ctxId, "net.unsubscribe", params);
+ EverSdk.asyncVoid(ctxId, "net.unsubscribe", params);
}
/**
@@ -138,9 +140,10 @@ public static void unsubscribe(int ctxId, Net.ResultOfSubscribeCollection params
* @param filter Collection filter
* @param result Projection (result) string
*/
- public static Net.ResultOfSubscribeCollection subscribeCollection(int ctxId, String collection,
- JsonNode filter, String result, EverSdkSubscription eventHandler) throws EverSdkException {
- return EverSdk.callEvent(ctxId, "net.subscribe_collection", new Net.ParamsOfSubscribeCollection(collection, filter, result), eventHandler, Net.ResultOfSubscribeCollection.class);
+ public static CompletableFuture subscribeCollection(int ctxId,
+ String collection, JsonNode filter, String result, Consumer callback) throws
+ EverSdkException {
+ return EverSdk.asyncCallback(ctxId, "net.subscribe_collection", new Net.ParamsOfSubscribeCollection(collection, filter, result), Net.ResultOfSubscribeCollection.class, callback);
}
/**
@@ -182,23 +185,24 @@ public static Net.ResultOfSubscribeCollection subscribeCollection(int ctxId, Str
* @param subscription GraphQL subscription text.
* @param variables Must be a map with named values that can be used in query. Variables used in subscription.
*/
- public static Net.ResultOfSubscribeCollection subscribe(int ctxId, String subscription,
- JsonNode variables, EverSdkSubscription eventHandler) throws EverSdkException {
- return EverSdk.callEvent(ctxId, "net.subscribe", new Net.ParamsOfSubscribe(subscription, variables), eventHandler, Net.ResultOfSubscribeCollection.class);
+ public static CompletableFuture subscribe(int ctxId,
+ String subscription, JsonNode variables, Consumer callback) throws
+ EverSdkException {
+ return EverSdk.asyncCallback(ctxId, "net.subscribe", new Net.ParamsOfSubscribe(subscription, variables), Net.ResultOfSubscribeCollection.class, callback);
}
/**
* Suspends network module to stop any network activity
*/
public static void suspend(int ctxId) throws EverSdkException {
- EverSdk.callVoid(ctxId, "net.suspend", null);
+ EverSdk.asyncVoid(ctxId, "net.suspend", null);
}
/**
* Resumes network module to enable network activity
*/
public static void resume(int ctxId) throws EverSdkException {
- EverSdk.callVoid(ctxId, "net.resume", null);
+ EverSdk.asyncVoid(ctxId, "net.resume", null);
}
/**
@@ -206,30 +210,32 @@ public static void resume(int ctxId) throws EverSdkException {
*
* @param address Account address
*/
- public static Net.ResultOfFindLastShardBlock findLastShardBlock(int ctxId, String address) throws
- EverSdkException {
- return EverSdk.call(ctxId, "net.find_last_shard_block", new Net.ParamsOfFindLastShardBlock(address), Net.ResultOfFindLastShardBlock.class);
+ public static CompletableFuture findLastShardBlock(int ctxId,
+ String address) throws EverSdkException {
+ return EverSdk.async(ctxId, "net.find_last_shard_block", new Net.ParamsOfFindLastShardBlock(address), Net.ResultOfFindLastShardBlock.class);
}
/**
* Requests the list of alternative endpoints from server
*/
- public static Net.EndpointsSet fetchEndpoints(int ctxId) throws EverSdkException {
- return EverSdk.call(ctxId, "net.fetch_endpoints", null, Net.EndpointsSet.class);
+ public static CompletableFuture fetchEndpoints(int ctxId) throws
+ EverSdkException {
+ return EverSdk.async(ctxId, "net.fetch_endpoints", null, Net.EndpointsSet.class);
}
/**
* Sets the list of endpoints to use on reinit
*/
public static void setEndpoints(int ctxId, Net.EndpointsSet params) throws EverSdkException {
- EverSdk.callVoid(ctxId, "net.set_endpoints", params);
+ EverSdk.asyncVoid(ctxId, "net.set_endpoints", params);
}
/**
* Requests the list of alternative endpoints from server
*/
- public static Net.ResultOfGetEndpoints getEndpoints(int ctxId) throws EverSdkException {
- return EverSdk.call(ctxId, "net.get_endpoints", null, Net.ResultOfGetEndpoints.class);
+ public static CompletableFuture getEndpoints(int ctxId) throws
+ EverSdkException {
+ return EverSdk.async(ctxId, "net.get_endpoints", null, Net.ResultOfGetEndpoints.class);
}
/**
@@ -242,14 +248,14 @@ public static Net.ResultOfGetEndpoints getEndpoints(int ctxId) throws EverSdkExc
* @param first Number of counterparties to return
* @param after `cursor` field of the last received result
*/
- public static Net.ResultOfQueryCollection queryCounterparties(int ctxId, String account,
- String result, Long first, String after) throws EverSdkException {
- return EverSdk.call(ctxId, "net.query_counterparties", new Net.ParamsOfQueryCounterparties(account, result, first, after), Net.ResultOfQueryCollection.class);
+ public static CompletableFuture queryCounterparties(int ctxId,
+ String account, String result, Long first, String after) throws EverSdkException {
+ return EverSdk.async(ctxId, "net.query_counterparties", new Net.ParamsOfQueryCounterparties(account, result, first, after), Net.ResultOfQueryCollection.class);
}
/**
* Performs recursive retrieval of a transactions tree produced by a specific message:
- * in_msg -> dst_transaction -> out_messages -> dst_transaction -> ...
+ * in_msg -> dst_transaction -> out_messages -> dst_transaction -> ...
* If the chain of transactions execution is in progress while the function is running,
* it will wait for the next transactions to appear until the full tree or more than 50 transactions
* are received.
@@ -271,7 +277,7 @@ public static Net.ResultOfQueryCollection queryCounterparties(int ctxId, String
* + 25 message ids of the 4th layer + 75 message ids of the 5th layer.
* 5. Retrieve 20 more messages and 20 more transactions of the 4th layer + 100 more message ids of the 5th layer.
* 6. Now we have 1+5+20+20+20 = 66 transactions, which is more than 50. Function exits with the tree of
- * 1m->1t->5m->5t->25m->25t->35m->35t. If we see any message ids in the last transactions out_msgs, which don't have
+ * 1m->1t->5m->5t->25m->25t->35m->35t. If we see any message ids in the last transactions out_msgs, which don't have
* corresponding messages in the function result, it means that the full tree was not received and we need to continue iteration.
*
* To summarize, it is guaranteed that each message in `result.messages` has the corresponding transaction
@@ -292,9 +298,10 @@ public static Net.ResultOfQueryCollection queryCounterparties(int ctxId, String
* Default value is 50. If `transaction_max_count` is set to 0 then no limitation on
* transaction count is used and all transaction are returned. Maximum transaction count to wait.
*/
- public static Net.ResultOfQueryTransactionTree queryTransactionTree(int ctxId, String inMsg,
- Abi.ABI[] abiRegistry, Long timeout, Long transactionMaxCount) throws EverSdkException {
- return EverSdk.call(ctxId, "net.query_transaction_tree", new Net.ParamsOfQueryTransactionTree(inMsg, abiRegistry, timeout, transactionMaxCount), Net.ResultOfQueryTransactionTree.class);
+ public static CompletableFuture queryTransactionTree(int ctxId,
+ String inMsg, Abi.ABI[] abiRegistry, Long timeout, Long transactionMaxCount) throws
+ EverSdkException {
+ return EverSdk.async(ctxId, "net.query_transaction_tree", new Net.ParamsOfQueryTransactionTree(inMsg, abiRegistry, timeout, transactionMaxCount), Net.ResultOfQueryTransactionTree.class);
}
/**
@@ -334,12 +341,12 @@ public static Net.ResultOfQueryTransactionTree queryTransactionTree(int ctxId, S
* Application should call the `remove_iterator` when iterator is no longer required. Creates block iterator.
*
* @param startTime If the application specifies this parameter then the iteration
- * includes blocks with `gen_utime` >= `start_time`.
+ * includes blocks with `gen_utime` >= `start_time`.
* Otherwise the iteration starts from zero state.
*
* Must be specified in seconds. Starting time to iterate from.
* @param endTime If the application specifies this parameter then the iteration
- * includes blocks with `gen_utime` < `end_time`.
+ * includes blocks with `gen_utime` < `end_time`.
* Otherwise the iteration never stops.
*
* Must be specified in seconds. Optional end time to iterate for.
@@ -356,9 +363,9 @@ public static Net.ResultOfQueryTransactionTree queryTransactionTree(int ctxId, S
* Note that iterated items can contains additional fields that are
* not requested in the `result`. Projection (result) string.
*/
- public static Net.RegisteredIterator createBlockIterator(int ctxId, Long startTime, Long endTime,
- String[] shardFilter, String result) throws EverSdkException {
- return EverSdk.call(ctxId, "net.create_block_iterator", new Net.ParamsOfCreateBlockIterator(startTime, endTime, shardFilter, result), Net.RegisteredIterator.class);
+ public static CompletableFuture createBlockIterator(int ctxId,
+ Long startTime, Long endTime, String[] shardFilter, String result) throws EverSdkException {
+ return EverSdk.async(ctxId, "net.create_block_iterator", new Net.ParamsOfCreateBlockIterator(startTime, endTime, shardFilter, result), Net.RegisteredIterator.class);
}
/**
@@ -368,9 +375,9 @@ public static Net.RegisteredIterator createBlockIterator(int ctxId, Long startTi
*
* @param resumeState Same as value returned from `iterator_next`. Iterator state from which to resume.
*/
- public static Net.RegisteredIterator resumeBlockIterator(int ctxId, JsonNode resumeState) throws
- EverSdkException {
- return EverSdk.call(ctxId, "net.resume_block_iterator", new Net.ParamsOfResumeBlockIterator(resumeState), Net.RegisteredIterator.class);
+ public static CompletableFuture resumeBlockIterator(int ctxId,
+ JsonNode resumeState) throws EverSdkException {
+ return EverSdk.async(ctxId, "net.resume_block_iterator", new Net.ParamsOfResumeBlockIterator(resumeState), Net.RegisteredIterator.class);
}
/**
@@ -431,12 +438,12 @@ public static Net.RegisteredIterator resumeBlockIterator(int ctxId, JsonNode res
* Application should call the `remove_iterator` when iterator is no longer required. Creates transaction iterator.
*
* @param startTime If the application specifies this parameter then the iteration
- * includes blocks with `gen_utime` >= `start_time`.
+ * includes blocks with `gen_utime` >= `start_time`.
* Otherwise the iteration starts from zero state.
*
* Must be specified in seconds. Starting time to iterate from.
* @param endTime If the application specifies this parameter then the iteration
- * includes blocks with `gen_utime` < `end_time`.
+ * includes blocks with `gen_utime` < `end_time`.
* Otherwise the iteration never stops.
*
* Must be specified in seconds. Optional end time to iterate for.
@@ -467,10 +474,10 @@ public static Net.RegisteredIterator resumeBlockIterator(int ctxId, JsonNode res
* @param includeTransfers If this parameter is `true` then each transaction contains field
* `transfers` with list of transfer. See more about this structure in function description. Include `transfers` field in iterated transactions.
*/
- public static Net.RegisteredIterator createTransactionIterator(int ctxId, Long startTime,
- Long endTime, String[] shardFilter, String[] accountsFilter, String result,
+ public static CompletableFuture createTransactionIterator(int ctxId,
+ Long startTime, Long endTime, String[] shardFilter, String[] accountsFilter, String result,
Boolean includeTransfers) throws EverSdkException {
- return EverSdk.call(ctxId, "net.create_transaction_iterator", new Net.ParamsOfCreateTransactionIterator(startTime, endTime, shardFilter, accountsFilter, result, includeTransfers), Net.RegisteredIterator.class);
+ return EverSdk.async(ctxId, "net.create_transaction_iterator", new Net.ParamsOfCreateTransactionIterator(startTime, endTime, shardFilter, accountsFilter, result, includeTransfers), Net.RegisteredIterator.class);
}
/**
@@ -492,9 +499,9 @@ public static Net.RegisteredIterator createTransactionIterator(int ctxId, Long s
* if both are specified.
* So it is the application's responsibility to specify the correct filter combination. Account address filter.
*/
- public static Net.RegisteredIterator resumeTransactionIterator(int ctxId, JsonNode resumeState,
- String[] accountsFilter) throws EverSdkException {
- return EverSdk.call(ctxId, "net.resume_transaction_iterator", new Net.ParamsOfResumeTransactionIterator(resumeState, accountsFilter), Net.RegisteredIterator.class);
+ public static CompletableFuture resumeTransactionIterator(int ctxId,
+ JsonNode resumeState, String[] accountsFilter) throws EverSdkException {
+ return EverSdk.async(ctxId, "net.resume_transaction_iterator", new Net.ParamsOfResumeTransactionIterator(resumeState, accountsFilter), Net.RegisteredIterator.class);
}
/**
@@ -517,9 +524,9 @@ public static Net.RegisteredIterator resumeTransactionIterator(int ctxId, JsonNo
* @param limit If value is missing or is less than 1 the library uses 1. Maximum count of the returned items.
* @param returnResumeState Indicates that function must return the iterator state that can be used for resuming iteration.
*/
- public static Net.ResultOfIteratorNext iteratorNext(int ctxId, Long iterator, Long limit,
- Boolean returnResumeState) throws EverSdkException {
- return EverSdk.call(ctxId, "net.iterator_next", new Net.ParamsOfIteratorNext(iterator, limit, returnResumeState), Net.ResultOfIteratorNext.class);
+ public static CompletableFuture iteratorNext(int ctxId, Long iterator,
+ Long limit, Boolean returnResumeState) throws EverSdkException {
+ return EverSdk.async(ctxId, "net.iterator_next", new Net.ParamsOfIteratorNext(iterator, limit, returnResumeState), Net.ResultOfIteratorNext.class);
}
/**
@@ -530,14 +537,15 @@ public static Net.ResultOfIteratorNext iteratorNext(int ctxId, Long iterator, Lo
*/
public static void removeIterator(int ctxId, Net.RegisteredIterator params) throws
EverSdkException {
- EverSdk.callVoid(ctxId, "net.remove_iterator", params);
+ EverSdk.asyncVoid(ctxId, "net.remove_iterator", params);
}
/**
* Returns signature ID for configured network if it should be used in messages signature
*/
- public static Net.ResultOfGetSignatureId getSignatureId(int ctxId) throws EverSdkException {
- return EverSdk.call(ctxId, "net.get_signature_id", null, Net.ResultOfGetSignatureId.class);
+ public static CompletableFuture getSignatureId(int ctxId) throws
+ EverSdkException {
+ return EverSdk.async(ctxId, "net.get_signature_id", null, Net.ResultOfGetSignatureId.class);
}
/**
@@ -555,12 +563,12 @@ public record FieldAggregation(String field, Net.AggregationFn fn) {
/**
* @param startTime If the application specifies this parameter then the iteration
- * includes blocks with `gen_utime` >= `start_time`.
+ * includes blocks with `gen_utime` >= `start_time`.
* Otherwise the iteration starts from zero state.
*
* Must be specified in seconds. Starting time to iterate from.
* @param endTime If the application specifies this parameter then the iteration
- * includes blocks with `gen_utime` < `end_time`.
+ * includes blocks with `gen_utime` < `end_time`.
* Otherwise the iteration never stops.
*
* Must be specified in seconds. Optional end time to iterate for.
@@ -788,12 +796,12 @@ public record ResultOfFindLastShardBlock(String blockId) {
/**
* @param startTime If the application specifies this parameter then the iteration
- * includes blocks with `gen_utime` >= `start_time`.
+ * includes blocks with `gen_utime` >= `start_time`.
* Otherwise the iteration starts from zero state.
*
* Must be specified in seconds. Starting time to iterate from.
* @param endTime If the application specifies this parameter then the iteration
- * includes blocks with `gen_utime` < `end_time`.
+ * includes blocks with `gen_utime` < `end_time`.
* Otherwise the iteration never stops.
*
* Must be specified in seconds. Optional end time to iterate for.
diff --git a/src/gen/java/tech/deplant/java4ever/binding/Processing.java b/src/gen/java/tech/deplant/java4ever/binding/Processing.java
index 307f4cb..e796c84 100644
--- a/src/gen/java/tech/deplant/java4ever/binding/Processing.java
+++ b/src/gen/java/tech/deplant/java4ever/binding/Processing.java
@@ -8,12 +8,13 @@
import java.lang.Long;
import java.lang.String;
import java.math.BigInteger;
-import tech.deplant.java4ever.binding.ffi.EverSdkSubscription;
+import java.util.concurrent.CompletableFuture;
+import java.util.function.Consumer;
/**
* Processing
* Contains methods of "processing" module of EVER-SDK API
- *
+ *
* Message processing module. This module incorporates functions related to complex message
* processing scenarios.
* @version 1.45.0
@@ -54,7 +55,7 @@ public final class Processing {
*/
public static void monitorMessages(int ctxId, String queue,
Processing.MessageMonitoringParams[] messages) throws EverSdkException {
- EverSdk.callVoid(ctxId, "processing.monitor_messages", new Processing.ParamsOfMonitorMessages(queue, messages));
+ EverSdk.asyncVoid(ctxId, "processing.monitor_messages", new Processing.ParamsOfMonitorMessages(queue, messages));
}
/**
@@ -62,9 +63,9 @@ public static void monitorMessages(int ctxId, String queue,
*
* @param queue Name of the monitoring queue.
*/
- public static Processing.MonitoringQueueInfo getMonitorInfo(int ctxId, String queue) throws
- EverSdkException {
- return EverSdk.call(ctxId, "processing.get_monitor_info", new Processing.ParamsOfGetMonitorInfo(queue), Processing.MonitoringQueueInfo.class);
+ public static CompletableFuture getMonitorInfo(int ctxId,
+ String queue) throws EverSdkException {
+ return EverSdk.async(ctxId, "processing.get_monitor_info", new Processing.ParamsOfGetMonitorInfo(queue), Processing.MonitoringQueueInfo.class);
}
/**
@@ -74,9 +75,9 @@ public static Processing.MonitoringQueueInfo getMonitorInfo(int ctxId, String qu
* @param queue Name of the monitoring queue.
* @param waitMode Default is `NO_WAIT`. Wait mode.
*/
- public static Processing.ResultOfFetchNextMonitorResults fetchNextMonitorResults(int ctxId,
- String queue, Processing.MonitorFetchWaitMode waitMode) throws EverSdkException {
- return EverSdk.call(ctxId, "processing.fetch_next_monitor_results", new Processing.ParamsOfFetchNextMonitorResults(queue, waitMode), Processing.ResultOfFetchNextMonitorResults.class);
+ public static CompletableFuture fetchNextMonitorResults(
+ int ctxId, String queue, Processing.MonitorFetchWaitMode waitMode) throws EverSdkException {
+ return EverSdk.async(ctxId, "processing.fetch_next_monitor_results", new Processing.ParamsOfFetchNextMonitorResults(queue, waitMode), Processing.ResultOfFetchNextMonitorResults.class);
}
/**
@@ -85,7 +86,7 @@ public static Processing.ResultOfFetchNextMonitorResults fetchNextMonitorResults
* @param queue Name of the monitoring queue.
*/
public static void cancelMonitor(int ctxId, String queue) throws EverSdkException {
- EverSdk.callVoid(ctxId, "processing.cancel_monitor", new Processing.ParamsOfCancelMonitor(queue));
+ EverSdk.asyncVoid(ctxId, "processing.cancel_monitor", new Processing.ParamsOfCancelMonitor(queue));
}
/**
@@ -94,9 +95,9 @@ public static void cancelMonitor(int ctxId, String queue) throws EverSdkExceptio
* @param messages Messages that must be sent to the blockchain.
* @param monitorQueue Optional message monitor queue that starts monitoring for the processing results for sent messages.
*/
- public static Processing.ResultOfSendMessages sendMessages(int ctxId,
+ public static CompletableFuture sendMessages(int ctxId,
Processing.MessageSendingParams[] messages, String monitorQueue) throws EverSdkException {
- return EverSdk.call(ctxId, "processing.send_messages", new Processing.ParamsOfSendMessages(messages, monitorQueue), Processing.ResultOfSendMessages.class);
+ return EverSdk.async(ctxId, "processing.send_messages", new Processing.ParamsOfSendMessages(messages, monitorQueue), Processing.ResultOfSendMessages.class);
}
/**
@@ -116,9 +117,10 @@ public static Processing.ResultOfSendMessages sendMessages(int ctxId,
* chosen. Optional message ABI.
* @param sendEvents Flag for requesting events sending. Default is `false`.
*/
- public static Processing.ResultOfSendMessage sendMessage(int ctxId, String message, Abi.ABI abi,
- Boolean sendEvents, EverSdkSubscription eventHandler) throws EverSdkException {
- return EverSdk.callEvent(ctxId, "processing.send_message", new Processing.ParamsOfSendMessage(message, abi, sendEvents), eventHandler, Processing.ResultOfSendMessage.class);
+ public static CompletableFuture sendMessage(int ctxId,
+ String message, Abi.ABI abi, Boolean sendEvents, Consumer callback) throws
+ EverSdkException {
+ return EverSdk.asyncCallback(ctxId, "processing.send_message", new Processing.ParamsOfSendMessage(message, abi, sendEvents), Processing.ResultOfSendMessage.class, callback);
}
/**
@@ -158,10 +160,10 @@ public static Processing.ResultOfSendMessage sendMessage(int ctxId, String messa
* Provide the same value as the `send_message` has returned.
* If the message was not delivered (expired), SDK will log the endpoint URLs, used for its sending. The list of endpoints to which the message was sent.
*/
- public static Processing.ResultOfProcessMessage waitForTransaction(int ctxId, Abi.ABI abi,
- String message, String shardBlockId, Boolean sendEvents, String[] sendingEndpoints,
- EverSdkSubscription eventHandler) throws EverSdkException {
- return EverSdk.callEvent(ctxId, "processing.wait_for_transaction", new Processing.ParamsOfWaitForTransaction(abi, message, shardBlockId, sendEvents, sendingEndpoints), eventHandler, Processing.ResultOfProcessMessage.class);
+ public static CompletableFuture waitForTransaction(int ctxId,
+ Abi.ABI abi, String message, String shardBlockId, Boolean sendEvents,
+ String[] sendingEndpoints, Consumer callback) throws EverSdkException {
+ return EverSdk.asyncCallback(ctxId, "processing.wait_for_transaction", new Processing.ParamsOfWaitForTransaction(abi, message, shardBlockId, sendEvents, sendingEndpoints), Processing.ResultOfProcessMessage.class, callback);
}
/**
@@ -198,16 +200,16 @@ public static Processing.ResultOfProcessMessage waitForTransaction(int ctxId, Ab
*
* Expiration timeouts will grow with every retry.
* Retry grow factor is set in Client config:
- * <.....add config parameter with default value here>
+ * <.....add config parameter with default value here>
*
* Default value is 0. Processing try index.
* @param signatureId Signature ID to be used in data to sign preparing when CapSignatureWithId capability is enabled
* @param sendEvents Flag for requesting events sending. Default is `false`.
*/
- public static Processing.ResultOfProcessMessage processMessage(int ctxId, Abi.ABI abi,
- String address, Abi.DeploySet deploySet, Abi.CallSet callSet, Abi.Signer signer,
+ public static CompletableFuture processMessage(int ctxId,
+ Abi.ABI abi, String address, Abi.DeploySet deploySet, Abi.CallSet callSet, Abi.Signer signer,
Integer processingTryIndex, Long signatureId, Boolean sendEvents) throws EverSdkException {
- return EverSdk.call(ctxId, "processing.process_message", new Processing.ParamsOfProcessMessage(new Abi.ParamsOfEncodeMessage(abi, address, deploySet, callSet, signer, processingTryIndex, signatureId), sendEvents), Processing.ResultOfProcessMessage.class);
+ return EverSdk.async(ctxId, "processing.process_message", new Processing.ParamsOfProcessMessage(new Abi.ParamsOfEncodeMessage(abi, address, deploySet, callSet, signer, processingTryIndex, signatureId), sendEvents), Processing.ResultOfProcessMessage.class);
}
/**
@@ -447,7 +449,7 @@ public String type() {
/**
* This event occurs only for the contracts which ABI includes "expire" header.
*
- * If Application specifies `NetworkConfig.message_retries_count` > 0, then `process_message`
+ * If Application specifies `NetworkConfig.message_retries_count` > 0, then `process_message`
* will perform retries: will create a new message and send it again and repeat it until it reaches
* the maximum retries count or receives a successful result. All the processing
* events will be repeated. Notifies the app that the message was not executed within expire timeout on-chain and will never be because it is already expired. The expiration timeout can be configured with `AbiConfig` parameters.
diff --git a/src/gen/java/tech/deplant/java4ever/binding/Proofs.java b/src/gen/java/tech/deplant/java4ever/binding/Proofs.java
index 8e0daee..aaec270 100644
--- a/src/gen/java/tech/deplant/java4ever/binding/Proofs.java
+++ b/src/gen/java/tech/deplant/java4ever/binding/Proofs.java
@@ -6,7 +6,7 @@
/**
* Proofs
* Contains methods of "proofs" module of EVER-SDK API
- *
+ *
* [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Module for proving data, retrieved from TONOS API.
* @version 1.45.0
*/
@@ -74,7 +74,7 @@ public final class Proofs {
* @param block Single block's data, retrieved from TONOS API, that needs proof. Required fields are `id` and/or top-level `boc` (for block identification), others are optional.
*/
public static void proofBlockData(int ctxId, JsonNode block) throws EverSdkException {
- EverSdk.callVoid(ctxId, "proofs.proof_block_data", new Proofs.ParamsOfProofBlockData(block));
+ EverSdk.asyncVoid(ctxId, "proofs.proof_block_data", new Proofs.ParamsOfProofBlockData(block));
}
/**
@@ -97,7 +97,7 @@ public static void proofBlockData(int ctxId, JsonNode block) throws EverSdkExcep
* @param transaction Single transaction's data as queried from DApp server, without modifications. The required fields are `id` and/or top-level `boc`, others are optional. In order to reduce network requests count, it is recommended to provide `block_id` and `boc` of transaction.
*/
public static void proofTransactionData(int ctxId, JsonNode transaction) throws EverSdkException {
- EverSdk.callVoid(ctxId, "proofs.proof_transaction_data", new Proofs.ParamsOfProofTransactionData(transaction));
+ EverSdk.asyncVoid(ctxId, "proofs.proof_transaction_data", new Proofs.ParamsOfProofTransactionData(transaction));
}
/**
@@ -120,7 +120,7 @@ public static void proofTransactionData(int ctxId, JsonNode transaction) throws
* @param message Single message's data as queried from DApp server, without modifications. The required fields are `id` and/or top-level `boc`, others are optional. In order to reduce network requests count, it is recommended to provide at least `boc` of message and non-null `src_transaction.id` or `dst_transaction.id`.
*/
public static void proofMessageData(int ctxId, JsonNode message) throws EverSdkException {
- EverSdk.callVoid(ctxId, "proofs.proof_message_data", new Proofs.ParamsOfProofMessageData(message));
+ EverSdk.asyncVoid(ctxId, "proofs.proof_message_data", new Proofs.ParamsOfProofMessageData(message));
}
/**
diff --git a/src/gen/java/tech/deplant/java4ever/binding/Tvm.java b/src/gen/java/tech/deplant/java4ever/binding/Tvm.java
index fa031bf..743449e 100644
--- a/src/gen/java/tech/deplant/java4ever/binding/Tvm.java
+++ b/src/gen/java/tech/deplant/java4ever/binding/Tvm.java
@@ -7,11 +7,12 @@
import java.lang.Long;
import java.lang.String;
import java.math.BigInteger;
+import java.util.concurrent.CompletableFuture;
/**
* Tvm
* Contains methods of "tvm" module of EVER-SDK API
- *
+ *
*
* @version 1.45.0
*/
@@ -57,11 +58,11 @@ public final class Tvm {
* @param bocCache The BOC itself returned if no cache type provided Cache type to put the result.
* @param returnUpdatedAccount Empty string is returned if the flag is `false` Return updated account flag.
*/
- public static Tvm.ResultOfRunExecutor runExecutor(int ctxId, String message,
+ public static CompletableFuture runExecutor(int ctxId, String message,
Tvm.AccountForExecutor account, Tvm.ExecutionOptions executionOptions, Abi.ABI abi,
Boolean skipTransactionCheck, Boc.BocCacheType bocCache, Boolean returnUpdatedAccount) throws
EverSdkException {
- return EverSdk.call(ctxId, "tvm.run_executor", new Tvm.ParamsOfRunExecutor(message, account, executionOptions, abi, skipTransactionCheck, bocCache, returnUpdatedAccount), Tvm.ResultOfRunExecutor.class);
+ return EverSdk.async(ctxId, "tvm.run_executor", new Tvm.ParamsOfRunExecutor(message, account, executionOptions, abi, skipTransactionCheck, bocCache, returnUpdatedAccount), Tvm.ResultOfRunExecutor.class);
}
/**
@@ -85,10 +86,10 @@ public static Tvm.ResultOfRunExecutor runExecutor(int ctxId, String message,
* @param bocCache The BOC itself returned if no cache type provided Cache type to put the result.
* @param returnUpdatedAccount Empty string is returned if the flag is `false` Return updated account flag.
*/
- public static Tvm.ResultOfRunTvm runTvm(int ctxId, String message, String account,
- Tvm.ExecutionOptions executionOptions, Abi.ABI abi, Boc.BocCacheType bocCache,
+ public static CompletableFuture runTvm(int ctxId, String message,
+ String account, Tvm.ExecutionOptions executionOptions, Abi.ABI abi, Boc.BocCacheType bocCache,
Boolean returnUpdatedAccount) throws EverSdkException {
- return EverSdk.call(ctxId, "tvm.run_tvm", new Tvm.ParamsOfRunTvm(message, account, executionOptions, abi, bocCache, returnUpdatedAccount), Tvm.ResultOfRunTvm.class);
+ return EverSdk.async(ctxId, "tvm.run_tvm", new Tvm.ParamsOfRunTvm(message, account, executionOptions, abi, bocCache, returnUpdatedAccount), Tvm.ResultOfRunTvm.class);
}
/**
@@ -104,10 +105,10 @@ public static Tvm.ResultOfRunTvm runTvm(int ctxId, String message, String accoun
* set this flag to true.
* This may happen, for example, when elector contract contains too many participants Convert lists based on nested tuples in the **result** into plain arrays.
*/
- public static Tvm.ResultOfRunGet runGet(int ctxId, String account, String functionName,
- JsonNode input, Tvm.ExecutionOptions executionOptions, Boolean tupleListAsArray) throws
- EverSdkException {
- return EverSdk.call(ctxId, "tvm.run_get", new Tvm.ParamsOfRunGet(account, functionName, input, executionOptions, tupleListAsArray), Tvm.ResultOfRunGet.class);
+ public static CompletableFuture runGet(int ctxId, String account,
+ String functionName, JsonNode input, Tvm.ExecutionOptions executionOptions,
+ Boolean tupleListAsArray) throws EverSdkException {
+ return EverSdk.async(ctxId, "tvm.run_get", new Tvm.ParamsOfRunGet(account, functionName, input, executionOptions, tupleListAsArray), Tvm.ResultOfRunGet.class);
}
/**
diff --git a/src/gen/java/tech/deplant/java4ever/binding/Utils.java b/src/gen/java/tech/deplant/java4ever/binding/Utils.java
index 142541e..05cb7fe 100644
--- a/src/gen/java/tech/deplant/java4ever/binding/Utils.java
+++ b/src/gen/java/tech/deplant/java4ever/binding/Utils.java
@@ -4,11 +4,12 @@
import java.lang.Boolean;
import java.lang.Long;
import java.lang.String;
+import java.util.concurrent.CompletableFuture;
/**
* Utils
* Contains methods of "utils" module of EVER-SDK API
- *
+ *
* Misc utility Functions.
* @version 1.45.0
*/
@@ -19,9 +20,9 @@ public final class Utils {
* @param address Account address in any TON format.
* @param outputFormat Specify the format to convert to.
*/
- public static Utils.ResultOfConvertAddress convertAddress(int ctxId, String address,
- Utils.AddressStringFormat outputFormat) throws EverSdkException {
- return EverSdk.call(ctxId, "utils.convert_address", new Utils.ParamsOfConvertAddress(address, outputFormat), Utils.ResultOfConvertAddress.class);
+ public static CompletableFuture convertAddress(int ctxId,
+ String address, Utils.AddressStringFormat outputFormat) throws EverSdkException {
+ return EverSdk.async(ctxId, "utils.convert_address", new Utils.ParamsOfConvertAddress(address, outputFormat), Utils.ResultOfConvertAddress.class);
}
/**
@@ -36,17 +37,17 @@ public static Utils.ResultOfConvertAddress convertAddress(int ctxId, String addr
*
* @param address Account address in any TON format.
*/
- public static Utils.ResultOfGetAddressType getAddressType(int ctxId, String address) throws
- EverSdkException {
- return EverSdk.call(ctxId, "utils.get_address_type", new Utils.ParamsOfGetAddressType(address), Utils.ResultOfGetAddressType.class);
+ public static CompletableFuture getAddressType(int ctxId,
+ String address) throws EverSdkException {
+ return EverSdk.async(ctxId, "utils.get_address_type", new Utils.ParamsOfGetAddressType(address), Utils.ResultOfGetAddressType.class);
}
/**
* Calculates storage fee for an account over a specified time period
*/
- public static Utils.ResultOfCalcStorageFee calcStorageFee(int ctxId, String account, Long period)
- throws EverSdkException {
- return EverSdk.call(ctxId, "utils.calc_storage_fee", new Utils.ParamsOfCalcStorageFee(account, period), Utils.ResultOfCalcStorageFee.class);
+ public static CompletableFuture calcStorageFee(int ctxId,
+ String account, Long period) throws EverSdkException {
+ return EverSdk.async(ctxId, "utils.calc_storage_fee", new Utils.ParamsOfCalcStorageFee(account, period), Utils.ResultOfCalcStorageFee.class);
}
/**
@@ -55,9 +56,9 @@ public static Utils.ResultOfCalcStorageFee calcStorageFee(int ctxId, String acco
* @param uncompressed Must be encoded as base64. Uncompressed data.
* @param level Compression level, from 1 to 21. Where: 1 - lowest compression level (fastest compression); 21 - highest compression level (slowest compression). If level is omitted, the default compression level is used (currently `3`).
*/
- public static Utils.ResultOfCompressZstd compressZstd(int ctxId, String uncompressed, Long level)
- throws EverSdkException {
- return EverSdk.call(ctxId, "utils.compress_zstd", new Utils.ParamsOfCompressZstd(uncompressed, level), Utils.ResultOfCompressZstd.class);
+ public static CompletableFuture compressZstd(int ctxId,
+ String uncompressed, Long level) throws EverSdkException {
+ return EverSdk.async(ctxId, "utils.compress_zstd", new Utils.ParamsOfCompressZstd(uncompressed, level), Utils.ResultOfCompressZstd.class);
}
/**
@@ -65,9 +66,9 @@ public static Utils.ResultOfCompressZstd compressZstd(int ctxId, String uncompre
*
* @param compressed Must be encoded as base64. Compressed data.
*/
- public static Utils.ResultOfDecompressZstd decompressZstd(int ctxId, String compressed) throws
- EverSdkException {
- return EverSdk.call(ctxId, "utils.decompress_zstd", new Utils.ParamsOfDecompressZstd(compressed), Utils.ResultOfDecompressZstd.class);
+ public static CompletableFuture decompressZstd(int ctxId,
+ String compressed) throws EverSdkException {
+ return EverSdk.async(ctxId, "utils.decompress_zstd", new Utils.ParamsOfDecompressZstd(compressed), Utils.ResultOfDecompressZstd.class);
}
public record ParamsOfCalcStorageFee(String account, Long period) {
diff --git a/src/gen/java/tech/deplant/java4ever/binding/ffi/RuntimeHelper.java b/src/gen/java/tech/deplant/java4ever/binding/ffi/RuntimeHelper.java
deleted file mode 100644
index ed82971..0000000
--- a/src/gen/java/tech/deplant/java4ever/binding/ffi/RuntimeHelper.java
+++ /dev/null
@@ -1,245 +0,0 @@
-package tech.deplant.java4ever.binding.ffi;
-// Generated by jextract
-
-import java.lang.foreign.Linker;
-import java.lang.foreign.FunctionDescriptor;
-import java.lang.foreign.GroupLayout;
-import java.lang.foreign.SymbolLookup;
-import java.lang.foreign.MemoryLayout;
-import java.lang.foreign.MemorySegment;
-import java.lang.foreign.Arena;
-import java.lang.foreign.SegmentAllocator;
-import java.lang.foreign.ValueLayout;
-import java.lang.invoke.MethodHandle;
-import java.lang.invoke.MethodHandles;
-import java.lang.invoke.MethodType;
-import java.io.File;
-import java.nio.file.Path;
-import java.nio.charset.StandardCharsets;
-import java.util.Arrays;
-import java.util.Optional;
-import java.util.stream.Stream;
-
-import java.lang.foreign.AddressLayout;
-import java.lang.foreign.MemoryLayout;
-
-import static java.lang.foreign.Linker.*;
-import static java.lang.foreign.ValueLayout.*;
-
-final class RuntimeHelper {
-
- private static final Linker LINKER = Linker.nativeLinker();
- private static final ClassLoader LOADER = RuntimeHelper.class.getClassLoader();
- private static final MethodHandles.Lookup MH_LOOKUP = MethodHandles.lookup();
- private static final SymbolLookup SYMBOL_LOOKUP;
- private static final SegmentAllocator THROWING_ALLOCATOR = (x, y) -> { throw new AssertionError("should not reach here"); };
- static final AddressLayout POINTER = ValueLayout.ADDRESS.withTargetLayout(MemoryLayout.sequenceLayout(JAVA_BYTE));
-
- final static SegmentAllocator CONSTANT_ALLOCATOR =
- (size, align) -> Arena.ofAuto().allocate(size, align);
-
- static {
-
- SymbolLookup loaderLookup = SymbolLookup.loaderLookup();
- SYMBOL_LOOKUP = name -> loaderLookup.find(name).or(() -> LINKER.defaultLookup().find(name));
- }
-
- // Suppresses default constructor, ensuring non-instantiability.
- private RuntimeHelper() {}
-
- static T requireNonNull(T obj, String symbolName) {
- if (obj == null) {
- throw new UnsatisfiedLinkError("unresolved symbol: " + symbolName);
- }
- return obj;
- }
-
- static MemorySegment lookupGlobalVariable(String name, MemoryLayout layout) {
- return SYMBOL_LOOKUP.find(name)
- .map(s -> s.reinterpret(layout.byteSize()))
- .orElse(null);
- }
-
- static MethodHandle downcallHandle(String name, FunctionDescriptor fdesc) {
- return SYMBOL_LOOKUP.find(name).
- map(addr -> LINKER.downcallHandle(addr, fdesc)).
- orElse(null);
- }
-
- static MethodHandle downcallHandle(FunctionDescriptor fdesc) {
- return LINKER.downcallHandle(fdesc);
- }
-
- static MethodHandle downcallHandleVariadic(String name, FunctionDescriptor fdesc) {
- return SYMBOL_LOOKUP.find(name).
- map(addr -> VarargsInvoker.make(addr, fdesc)).
- orElse(null);
- }
-
- static MethodHandle upcallHandle(Class> fi, String name, FunctionDescriptor fdesc) {
- try {
- return MH_LOOKUP.findVirtual(fi, name, fdesc.toMethodType());
- } catch (Throwable ex) {
- throw new AssertionError(ex);
- }
- }
-
- static MemorySegment upcallStub(MethodHandle fiHandle, Z z, FunctionDescriptor fdesc, Arena scope) {
- try {
- fiHandle = fiHandle.bindTo(z);
- return LINKER.upcallStub(fiHandle, fdesc, scope);
- } catch (Throwable ex) {
- throw new AssertionError(ex);
- }
- }
-
- static MemorySegment asArray(MemorySegment addr, MemoryLayout layout, int numElements, Arena arena) {
- return addr.reinterpret(numElements * layout.byteSize(), arena, null);
- }
-
- // Internals only below this point
-
- private static final class VarargsInvoker {
- private static final MethodHandle INVOKE_MH;
- private final MemorySegment symbol;
- private final FunctionDescriptor function;
-
- private VarargsInvoker(MemorySegment symbol, FunctionDescriptor function) {
- this.symbol = symbol;
- this.function = function;
- }
-
- static {
- try {
- INVOKE_MH = MethodHandles.lookup().findVirtual(VarargsInvoker.class, "invoke", MethodType.methodType(Object.class, SegmentAllocator.class, Object[].class));
- } catch (ReflectiveOperationException e) {
- throw new RuntimeException(e);
- }
- }
-
- static MethodHandle make(MemorySegment symbol, FunctionDescriptor function) {
- VarargsInvoker invoker = new VarargsInvoker(symbol, function);
- MethodHandle handle = INVOKE_MH.bindTo(invoker).asCollector(Object[].class, function.argumentLayouts().size() + 1);
- MethodType mtype = MethodType.methodType(function.returnLayout().isPresent() ? carrier(function.returnLayout().get(), true) : void.class);
- for (MemoryLayout layout : function.argumentLayouts()) {
- mtype = mtype.appendParameterTypes(carrier(layout, false));
- }
- mtype = mtype.appendParameterTypes(Object[].class);
- boolean needsAllocator = function.returnLayout().isPresent() &&
- function.returnLayout().get() instanceof GroupLayout;
- if (needsAllocator) {
- mtype = mtype.insertParameterTypes(0, SegmentAllocator.class);
- } else {
- handle = MethodHandles.insertArguments(handle, 0, THROWING_ALLOCATOR);
- }
- return handle.asType(mtype);
- }
-
- static Class> carrier(MemoryLayout layout, boolean ret) {
- if (layout instanceof ValueLayout valueLayout) {
- return valueLayout.carrier();
- } else if (layout instanceof GroupLayout) {
- return MemorySegment.class;
- } else {
- throw new AssertionError("Cannot get here!");
- }
- }
-
- private Object invoke(SegmentAllocator allocator, Object[] args) throws Throwable {
- // one trailing Object[]
- int nNamedArgs = function.argumentLayouts().size();
- assert(args.length == nNamedArgs + 1);
- // The last argument is the array of vararg collector
- Object[] unnamedArgs = (Object[]) args[args.length - 1];
-
- int argsCount = nNamedArgs + unnamedArgs.length;
- Class>[] argTypes = new Class>[argsCount];
- MemoryLayout[] argLayouts = new MemoryLayout[nNamedArgs + unnamedArgs.length];
-
- int pos = 0;
- for (pos = 0; pos < nNamedArgs; pos++) {
- argLayouts[pos] = function.argumentLayouts().get(pos);
- }
-
- assert pos == nNamedArgs;
- for (Object o: unnamedArgs) {
- argLayouts[pos] = variadicLayout(normalize(o.getClass()));
- pos++;
- }
- assert pos == argsCount;
-
- FunctionDescriptor f = (function.returnLayout().isEmpty()) ?
- FunctionDescriptor.ofVoid(argLayouts) :
- FunctionDescriptor.of(function.returnLayout().get(), argLayouts);
- MethodHandle mh = LINKER.downcallHandle(symbol, f);
- boolean needsAllocator = function.returnLayout().isPresent() &&
- function.returnLayout().get() instanceof GroupLayout;
- if (needsAllocator) {
- mh = mh.bindTo(allocator);
- }
- // flatten argument list so that it can be passed to an asSpreader MH
- Object[] allArgs = new Object[nNamedArgs + unnamedArgs.length];
- System.arraycopy(args, 0, allArgs, 0, nNamedArgs);
- System.arraycopy(unnamedArgs, 0, allArgs, nNamedArgs, unnamedArgs.length);
-
- return mh.asSpreader(Object[].class, argsCount).invoke(allArgs);
- }
-
- private static Class> unboxIfNeeded(Class> clazz) {
- if (clazz == Boolean.class) {
- return boolean.class;
- } else if (clazz == Void.class) {
- return void.class;
- } else if (clazz == Byte.class) {
- return byte.class;
- } else if (clazz == Character.class) {
- return char.class;
- } else if (clazz == Short.class) {
- return short.class;
- } else if (clazz == Integer.class) {
- return int.class;
- } else if (clazz == Long.class) {
- return long.class;
- } else if (clazz == Float.class) {
- return float.class;
- } else if (clazz == Double.class) {
- return double.class;
- } else {
- return clazz;
- }
- }
-
- private Class> promote(Class> c) {
- if (c == byte.class || c == char.class || c == short.class || c == int.class) {
- return long.class;
- } else if (c == float.class) {
- return double.class;
- } else {
- return c;
- }
- }
-
- private Class> normalize(Class> c) {
- c = unboxIfNeeded(c);
- if (c.isPrimitive()) {
- return promote(c);
- }
- if (c == MemorySegment.class) {
- return MemorySegment.class;
- }
- throw new IllegalArgumentException("Invalid type for ABI: " + c.getTypeName());
- }
-
- private MemoryLayout variadicLayout(Class> c) {
- if (c == long.class) {
- return JAVA_LONG;
- } else if (c == double.class) {
- return JAVA_DOUBLE;
- } else if (c == MemorySegment.class) {
- return ADDRESS;
- } else {
- throw new IllegalArgumentException("Unhandled variadic argument class: " + c);
- }
- }
- }
-}
diff --git a/src/gen/java/tech/deplant/java4ever/binding/ffi/constants$0.java b/src/gen/java/tech/deplant/java4ever/binding/ffi/constants$0.java
deleted file mode 100644
index 8b8abb2..0000000
--- a/src/gen/java/tech/deplant/java4ever/binding/ffi/constants$0.java
+++ /dev/null
@@ -1,37 +0,0 @@
-// Generated by jextract
-
-package tech.deplant.java4ever.binding.ffi;
-
-import java.lang.invoke.MethodHandle;
-import java.lang.invoke.VarHandle;
-import java.nio.ByteOrder;
-import java.lang.foreign.*;
-import static java.lang.foreign.ValueLayout.*;
-final class constants$0 {
-
- // Suppresses default constructor, ensuring non-instantiability.
- private constants$0() {}
- static final StructLayout const$0 = MemoryLayout.structLayout(
- RuntimeHelper.POINTER.withName("content"),
- JAVA_INT.withName("len"),
- MemoryLayout.paddingLayout(4)
- ).withName("");
- static final VarHandle const$1 = constants$0.const$0.varHandle(MemoryLayout.PathElement.groupElement("content"));
- static final VarHandle const$2 = constants$0.const$0.varHandle(MemoryLayout.PathElement.groupElement("len"));
- static final FunctionDescriptor const$3 = FunctionDescriptor.ofVoid(
- JAVA_INT,
- MemoryLayout.structLayout(
- RuntimeHelper.POINTER.withName("content"),
- JAVA_INT.withName("len"),
- MemoryLayout.paddingLayout(4)
- ).withName(""),
- JAVA_INT,
- JAVA_BOOLEAN
- );
- static final MethodHandle const$4 = RuntimeHelper.upcallHandle(tc_response_handler_t.class, "apply", constants$0.const$3);
- static final MethodHandle const$5 = RuntimeHelper.downcallHandle(
- constants$0.const$3
- );
-}
-
-
diff --git a/src/gen/java/tech/deplant/java4ever/binding/ffi/constants$1.java b/src/gen/java/tech/deplant/java4ever/binding/ffi/constants$1.java
deleted file mode 100644
index 2030e91..0000000
--- a/src/gen/java/tech/deplant/java4ever/binding/ffi/constants$1.java
+++ /dev/null
@@ -1,48 +0,0 @@
-// Generated by jextract
-
-package tech.deplant.java4ever.binding.ffi;
-
-import java.lang.invoke.MethodHandle;
-import java.lang.invoke.VarHandle;
-import java.nio.ByteOrder;
-import java.lang.foreign.*;
-import static java.lang.foreign.ValueLayout.*;
-final class constants$1 {
-
- // Suppresses default constructor, ensuring non-instantiability.
- private constants$1() {}
- static final FunctionDescriptor const$0 = FunctionDescriptor.ofVoid(
- RuntimeHelper.POINTER,
- MemoryLayout.structLayout(
- RuntimeHelper.POINTER.withName("content"),
- JAVA_INT.withName("len"),
- MemoryLayout.paddingLayout(4)
- ).withName(""),
- JAVA_INT,
- JAVA_BOOLEAN
- );
- static final MethodHandle const$1 = RuntimeHelper.upcallHandle(tc_response_handler_ptr_t.class, "apply", constants$1.const$0);
- static final MethodHandle const$2 = RuntimeHelper.downcallHandle(
- constants$1.const$0
- );
- static final FunctionDescriptor const$3 = FunctionDescriptor.of(RuntimeHelper.POINTER,
- MemoryLayout.structLayout(
- RuntimeHelper.POINTER.withName("content"),
- JAVA_INT.withName("len"),
- MemoryLayout.paddingLayout(4)
- ).withName("")
- );
- static final MethodHandle const$4 = RuntimeHelper.downcallHandle(
- "tc_create_context",
- constants$1.const$3
- );
- static final FunctionDescriptor const$5 = FunctionDescriptor.ofVoid(
- JAVA_INT
- );
- static final MethodHandle const$6 = RuntimeHelper.downcallHandle(
- "tc_destroy_context",
- constants$1.const$5
- );
-}
-
-
diff --git a/src/gen/java/tech/deplant/java4ever/binding/ffi/constants$2.java b/src/gen/java/tech/deplant/java4ever/binding/ffi/constants$2.java
deleted file mode 100644
index 21bc8ca..0000000
--- a/src/gen/java/tech/deplant/java4ever/binding/ffi/constants$2.java
+++ /dev/null
@@ -1,71 +0,0 @@
-// Generated by jextract
-
-package tech.deplant.java4ever.binding.ffi;
-
-import java.lang.invoke.MethodHandle;
-import java.lang.invoke.VarHandle;
-import java.nio.ByteOrder;
-import java.lang.foreign.*;
-import static java.lang.foreign.ValueLayout.*;
-final class constants$2 {
-
- // Suppresses default constructor, ensuring non-instantiability.
- private constants$2() {}
- static final FunctionDescriptor const$0 = FunctionDescriptor.ofVoid(
- JAVA_INT,
- MemoryLayout.structLayout(
- RuntimeHelper.POINTER.withName("content"),
- JAVA_INT.withName("len"),
- MemoryLayout.paddingLayout(4)
- ).withName(""),
- MemoryLayout.structLayout(
- RuntimeHelper.POINTER.withName("content"),
- JAVA_INT.withName("len"),
- MemoryLayout.paddingLayout(4)
- ).withName(""),
- JAVA_INT,
- RuntimeHelper.POINTER
- );
- static final MethodHandle const$1 = RuntimeHelper.downcallHandle(
- "tc_request",
- constants$2.const$0
- );
- static final FunctionDescriptor const$2 = FunctionDescriptor.ofVoid(
- JAVA_INT,
- MemoryLayout.structLayout(
- RuntimeHelper.POINTER.withName("content"),
- JAVA_INT.withName("len"),
- MemoryLayout.paddingLayout(4)
- ).withName(""),
- MemoryLayout.structLayout(
- RuntimeHelper.POINTER.withName("content"),
- JAVA_INT.withName("len"),
- MemoryLayout.paddingLayout(4)
- ).withName(""),
- RuntimeHelper.POINTER,
- RuntimeHelper.POINTER
- );
- static final MethodHandle const$3 = RuntimeHelper.downcallHandle(
- "tc_request_ptr",
- constants$2.const$2
- );
- static final FunctionDescriptor const$4 = FunctionDescriptor.of(RuntimeHelper.POINTER,
- JAVA_INT,
- MemoryLayout.structLayout(
- RuntimeHelper.POINTER.withName("content"),
- JAVA_INT.withName("len"),
- MemoryLayout.paddingLayout(4)
- ).withName(""),
- MemoryLayout.structLayout(
- RuntimeHelper.POINTER.withName("content"),
- JAVA_INT.withName("len"),
- MemoryLayout.paddingLayout(4)
- ).withName("")
- );
- static final MethodHandle const$5 = RuntimeHelper.downcallHandle(
- "tc_request_sync",
- constants$2.const$4
- );
-}
-
-
diff --git a/src/gen/java/tech/deplant/java4ever/binding/ffi/constants$3.java b/src/gen/java/tech/deplant/java4ever/binding/ffi/constants$3.java
deleted file mode 100644
index 3e9e75f..0000000
--- a/src/gen/java/tech/deplant/java4ever/binding/ffi/constants$3.java
+++ /dev/null
@@ -1,34 +0,0 @@
-// Generated by jextract
-
-package tech.deplant.java4ever.binding.ffi;
-
-import java.lang.invoke.MethodHandle;
-import java.lang.invoke.VarHandle;
-import java.nio.ByteOrder;
-import java.lang.foreign.*;
-import static java.lang.foreign.ValueLayout.*;
-final class constants$3 {
-
- // Suppresses default constructor, ensuring non-instantiability.
- private constants$3() {}
- static final FunctionDescriptor const$0 = FunctionDescriptor.of(MemoryLayout.structLayout(
- RuntimeHelper.POINTER.withName("content"),
- JAVA_INT.withName("len"),
- MemoryLayout.paddingLayout(4)
- ).withName(""),
- RuntimeHelper.POINTER
- );
- static final MethodHandle const$1 = RuntimeHelper.downcallHandle(
- "tc_read_string",
- constants$3.const$0
- );
- static final FunctionDescriptor const$2 = FunctionDescriptor.ofVoid(
- RuntimeHelper.POINTER
- );
- static final MethodHandle const$3 = RuntimeHelper.downcallHandle(
- "tc_destroy_string",
- constants$3.const$2
- );
-}
-
-
diff --git a/src/gen/java/tech/deplant/java4ever/binding/ffi/tc_response_handler_ptr_t.java b/src/gen/java/tech/deplant/java4ever/binding/ffi/tc_response_handler_ptr_t.java
index 8490141..7e6c87e 100644
--- a/src/gen/java/tech/deplant/java4ever/binding/ffi/tc_response_handler_ptr_t.java
+++ b/src/gen/java/tech/deplant/java4ever/binding/ffi/tc_response_handler_ptr_t.java
@@ -2,32 +2,69 @@
package tech.deplant.java4ever.binding.ffi;
-import java.lang.invoke.MethodHandle;
-import java.lang.invoke.VarHandle;
-import java.nio.ByteOrder;
+import java.lang.invoke.*;
import java.lang.foreign.*;
+import java.nio.ByteOrder;
+import java.util.*;
+import java.util.function.*;
+import java.util.stream.*;
+
import static java.lang.foreign.ValueLayout.*;
+import static java.lang.foreign.MemoryLayout.PathElement.*;
+
/**
- * {@snippet :
- * void (*tc_response_handler_ptr_t)(void* request_ptr,struct params_json,unsigned int response_type,_Bool finished);
+ * {@snippet lang=c :
+ * typedef void (*tc_response_handler_ptr_t)(void *, tc_string_data_t, uint32_t, _Bool)
* }
*/
-public interface tc_response_handler_ptr_t {
+public class tc_response_handler_ptr_t {
- void apply(java.lang.foreign.MemorySegment request_ptr, java.lang.foreign.MemorySegment params_json, int response_type, boolean finished);
- static MemorySegment allocate(tc_response_handler_ptr_t fi, Arena scope) {
- return RuntimeHelper.upcallStub(constants$1.const$1, fi, constants$1.const$0, scope);
+ tc_response_handler_ptr_t() {
+ // Should not be called directly
}
- static tc_response_handler_ptr_t ofAddress(MemorySegment addr, Arena arena) {
- MemorySegment symbol = addr.reinterpret(arena, null);
- return (java.lang.foreign.MemorySegment _request_ptr, java.lang.foreign.MemorySegment _params_json, int _response_type, boolean _finished) -> {
- try {
- constants$1.const$2.invokeExact(symbol, _request_ptr, _params_json, _response_type, _finished);
- } catch (Throwable ex$) {
- throw new AssertionError("should not reach here", ex$);
- }
- };
+
+ /**
+ * The function pointer signature, expressed as a functional interface
+ */
+ public interface Function {
+ void apply(MemorySegment request_ptr, MemorySegment params_json, int response_type, boolean finished);
}
-}
+ private static final FunctionDescriptor $DESC = FunctionDescriptor.ofVoid(
+ ton_client.C_POINTER,
+ tc_string_data_t.layout(),
+ ton_client.C_INT,
+ ton_client.C_BOOL
+ );
+
+ /**
+ * The descriptor of this function pointer
+ */
+ public static FunctionDescriptor descriptor() {
+ return $DESC;
+ }
+
+ private static final MethodHandle UP$MH = ton_client.upcallHandle(tc_response_handler_ptr_t.Function.class, "apply", $DESC);
+
+ /**
+ * Allocates a new upcall stub, whose implementation is defined by {@code fi}.
+ * The lifetime of the returned segment is managed by {@code arena}
+ */
+ public static MemorySegment allocate(tc_response_handler_ptr_t.Function fi, Arena arena) {
+ return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena);
+ }
+
+ private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC);
+
+ /**
+ * Invoke the upcall stub {@code funcPtr}, with given parameters
+ */
+ public static void invoke(MemorySegment funcPtr,MemorySegment request_ptr, MemorySegment params_json, int response_type, boolean finished) {
+ try {
+ DOWN$MH.invokeExact(funcPtr, request_ptr, params_json, response_type, finished);
+ } catch (Throwable ex$) {
+ throw new AssertionError("should not reach here", ex$);
+ }
+ }
+}
diff --git a/src/gen/java/tech/deplant/java4ever/binding/ffi/tc_response_handler_t.java b/src/gen/java/tech/deplant/java4ever/binding/ffi/tc_response_handler_t.java
index 23c5525..ea3910c 100644
--- a/src/gen/java/tech/deplant/java4ever/binding/ffi/tc_response_handler_t.java
+++ b/src/gen/java/tech/deplant/java4ever/binding/ffi/tc_response_handler_t.java
@@ -2,32 +2,69 @@
package tech.deplant.java4ever.binding.ffi;
-import java.lang.invoke.MethodHandle;
-import java.lang.invoke.VarHandle;
-import java.nio.ByteOrder;
+import java.lang.invoke.*;
import java.lang.foreign.*;
+import java.nio.ByteOrder;
+import java.util.*;
+import java.util.function.*;
+import java.util.stream.*;
+
import static java.lang.foreign.ValueLayout.*;
+import static java.lang.foreign.MemoryLayout.PathElement.*;
+
/**
- * {@snippet :
- * void (*tc_response_handler_t)(unsigned int request_id,struct params_json,unsigned int response_type,_Bool finished);
+ * {@snippet lang=c :
+ * typedef void (*tc_response_handler_t)(uint32_t, tc_string_data_t, uint32_t, _Bool)
* }
*/
-public interface tc_response_handler_t {
+public class tc_response_handler_t {
- void apply(int request_id, java.lang.foreign.MemorySegment params_json, int response_type, boolean finished);
- static MemorySegment allocate(tc_response_handler_t fi, Arena scope) {
- return RuntimeHelper.upcallStub(constants$0.const$4, fi, constants$0.const$3, scope);
+ tc_response_handler_t() {
+ // Should not be called directly
}
- static tc_response_handler_t ofAddress(MemorySegment addr, Arena arena) {
- MemorySegment symbol = addr.reinterpret(arena, null);
- return (int _request_id, java.lang.foreign.MemorySegment _params_json, int _response_type, boolean _finished) -> {
- try {
- constants$0.const$5.invokeExact(symbol, _request_id, _params_json, _response_type, _finished);
- } catch (Throwable ex$) {
- throw new AssertionError("should not reach here", ex$);
- }
- };
+
+ /**
+ * The function pointer signature, expressed as a functional interface
+ */
+ public interface Function {
+ void apply(int request_id, MemorySegment params_json, int response_type, boolean finished);
}
-}
+ private static final FunctionDescriptor $DESC = FunctionDescriptor.ofVoid(
+ ton_client.C_INT,
+ tc_string_data_t.layout(),
+ ton_client.C_INT,
+ ton_client.C_BOOL
+ );
+
+ /**
+ * The descriptor of this function pointer
+ */
+ public static FunctionDescriptor descriptor() {
+ return $DESC;
+ }
+
+ private static final MethodHandle UP$MH = ton_client.upcallHandle(tc_response_handler_t.Function.class, "apply", $DESC);
+
+ /**
+ * Allocates a new upcall stub, whose implementation is defined by {@code fi}.
+ * The lifetime of the returned segment is managed by {@code arena}
+ */
+ public static MemorySegment allocate(tc_response_handler_t.Function fi, Arena arena) {
+ return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena);
+ }
+
+ private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC);
+
+ /**
+ * Invoke the upcall stub {@code funcPtr}, with given parameters
+ */
+ public static void invoke(MemorySegment funcPtr,int request_id, MemorySegment params_json, int response_type, boolean finished) {
+ try {
+ DOWN$MH.invokeExact(funcPtr, request_id, params_json, response_type, finished);
+ } catch (Throwable ex$) {
+ throw new AssertionError("should not reach here", ex$);
+ }
+ }
+}
diff --git a/src/gen/java/tech/deplant/java4ever/binding/ffi/tc_string_data_t.java b/src/gen/java/tech/deplant/java4ever/binding/ffi/tc_string_data_t.java
index a8ee2e8..bf56d5c 100644
--- a/src/gen/java/tech/deplant/java4ever/binding/ffi/tc_string_data_t.java
+++ b/src/gen/java/tech/deplant/java4ever/binding/ffi/tc_string_data_t.java
@@ -2,84 +2,173 @@
package tech.deplant.java4ever.binding.ffi;
-import java.lang.invoke.MethodHandle;
-import java.lang.invoke.VarHandle;
-import java.nio.ByteOrder;
+import java.lang.invoke.*;
import java.lang.foreign.*;
+import java.nio.ByteOrder;
+import java.util.*;
+import java.util.function.*;
+import java.util.stream.*;
+
import static java.lang.foreign.ValueLayout.*;
+import static java.lang.foreign.MemoryLayout.PathElement.*;
+
/**
- * {@snippet :
+ * {@snippet lang=c :
* struct {
- * char* content;
+ * const char *content;
* uint32_t len;
- * };
+ * }
* }
*/
public class tc_string_data_t {
- public static MemoryLayout $LAYOUT() {
- return constants$0.const$0;
+ tc_string_data_t() {
+ // Should not be called directly
}
- public static VarHandle content$VH() {
- return constants$0.const$1;
+
+ private static final GroupLayout $LAYOUT = MemoryLayout.structLayout(
+ ton_client.C_POINTER.withName("content"),
+ ton_client.C_INT.withName("len"),
+ MemoryLayout.paddingLayout(4)
+ ).withName("$anon$6:9");
+
+ /**
+ * The layout of this struct
+ */
+ public static final GroupLayout layout() {
+ return $LAYOUT;
}
+
+ private static final AddressLayout content$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("content"));
+
+ /**
+ * Layout for field:
+ * {@snippet lang=c :
+ * const char *content
+ * }
+ */
+ public static final AddressLayout content$layout() {
+ return content$LAYOUT;
+ }
+
+ private static final long content$OFFSET = 0;
+
+ /**
+ * Offset for field:
+ * {@snippet lang=c :
+ * const char *content
+ * }
+ */
+ public static final long content$offset() {
+ return content$OFFSET;
+ }
+
/**
* Getter for field:
- * {@snippet :
- * char* content;
+ * {@snippet lang=c :
+ * const char *content
* }
*/
- public static MemorySegment content$get(MemorySegment seg) {
- return (java.lang.foreign.MemorySegment)constants$0.const$1.get(seg);
+ public static MemorySegment content(MemorySegment struct) {
+ return struct.get(content$LAYOUT, content$OFFSET);
}
+
/**
* Setter for field:
- * {@snippet :
- * char* content;
+ * {@snippet lang=c :
+ * const char *content
* }
*/
- public static void content$set(MemorySegment seg, MemorySegment x) {
- constants$0.const$1.set(seg, x);
- }
- public static MemorySegment content$get(MemorySegment seg, long index) {
- return (java.lang.foreign.MemorySegment)constants$0.const$1.get(seg.asSlice(index*sizeof()));
+ public static void content(MemorySegment struct, MemorySegment fieldValue) {
+ struct.set(content$LAYOUT, content$OFFSET, fieldValue);
}
- public static void content$set(MemorySegment seg, long index, MemorySegment x) {
- constants$0.const$1.set(seg.asSlice(index*sizeof()), x);
+
+ private static final OfInt len$LAYOUT = (OfInt)$LAYOUT.select(groupElement("len"));
+
+ /**
+ * Layout for field:
+ * {@snippet lang=c :
+ * uint32_t len
+ * }
+ */
+ public static final OfInt len$layout() {
+ return len$LAYOUT;
}
- public static VarHandle len$VH() {
- return constants$0.const$2;
+
+ private static final long len$OFFSET = 8;
+
+ /**
+ * Offset for field:
+ * {@snippet lang=c :
+ * uint32_t len
+ * }
+ */
+ public static final long len$offset() {
+ return len$OFFSET;
}
+
/**
* Getter for field:
- * {@snippet :
- * uint32_t len;
+ * {@snippet lang=c :
+ * uint32_t len
* }
*/
- public static int len$get(MemorySegment seg) {
- return (int)constants$0.const$2.get(seg);
+ public static int len(MemorySegment struct) {
+ return struct.get(len$LAYOUT, len$OFFSET);
}
+
/**
* Setter for field:
- * {@snippet :
- * uint32_t len;
+ * {@snippet lang=c :
+ * uint32_t len
* }
*/
- public static void len$set(MemorySegment seg, int x) {
- constants$0.const$2.set(seg, x);
+ public static void len(MemorySegment struct, int fieldValue) {
+ struct.set(len$LAYOUT, len$OFFSET, fieldValue);
+ }
+
+ /**
+ * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}.
+ * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()}
+ */
+ public static MemorySegment asSlice(MemorySegment array, long index) {
+ return array.asSlice(layout().byteSize() * index);
+ }
+
+ /**
+ * The size (in bytes) of this struct
+ */
+ public static long sizeof() { return layout().byteSize(); }
+
+ /**
+ * Allocate a segment of size {@code layout().byteSize()} using {@code allocator}
+ */
+ public static MemorySegment allocate(SegmentAllocator allocator) {
+ return allocator.allocate(layout());
}
- public static int len$get(MemorySegment seg, long index) {
- return (int)constants$0.const$2.get(seg.asSlice(index*sizeof()));
+
+ /**
+ * Allocate an array of size {@code elementCount} using {@code allocator}.
+ * The returned segment has size {@code elementCount * layout().byteSize()}.
+ */
+ public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) {
+ return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout()));
}
- public static void len$set(MemorySegment seg, long index, int x) {
- constants$0.const$2.set(seg.asSlice(index*sizeof()), x);
+
+ /**
+ * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any).
+ * The returned segment has size {@code layout().byteSize()}
+ */
+ public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) {
+ return reinterpret(addr, 1, arena, cleanup);
}
- public static long sizeof() { return $LAYOUT().byteSize(); }
- public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
- public static MemorySegment allocateArray(long len, SegmentAllocator allocator) {
- return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
+
+ /**
+ * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any).
+ * The returned segment has size {@code elementCount * layout().byteSize()}
+ */
+ public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) {
+ return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup);
}
- public static MemorySegment ofAddress(MemorySegment addr, Arena arena) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, arena); }
}
-
diff --git a/src/gen/java/tech/deplant/java4ever/binding/ffi/ton_client.java b/src/gen/java/tech/deplant/java4ever/binding/ffi/ton_client.java
index 26f3c74..47c8ee1 100644
--- a/src/gen/java/tech/deplant/java4ever/binding/ffi/ton_client.java
+++ b/src/gen/java/tech/deplant/java4ever/binding/ffi/ton_client.java
@@ -2,877 +2,1300 @@
package tech.deplant.java4ever.binding.ffi;
-import java.lang.invoke.MethodHandle;
-import java.lang.invoke.VarHandle;
-import java.nio.ByteOrder;
+import java.lang.invoke.*;
import java.lang.foreign.*;
+import java.nio.ByteOrder;
+import java.util.*;
+import java.util.function.*;
+import java.util.stream.*;
+
import static java.lang.foreign.ValueLayout.*;
-public class ton_client {
-
- public static final OfByte C_CHAR = JAVA_BYTE;
- public static final OfShort C_SHORT = JAVA_SHORT;
- public static final OfInt C_INT = JAVA_INT;
- public static final OfInt C_LONG = JAVA_INT;
- public static final OfLong C_LONG_LONG = JAVA_LONG;
- public static final OfFloat C_FLOAT = JAVA_FLOAT;
- public static final OfDouble C_DOUBLE = JAVA_DOUBLE;
- public static final AddressLayout C_POINTER = RuntimeHelper.POINTER;
- /**
- * {@snippet :
+import static java.lang.foreign.MemoryLayout.PathElement.*;
+
+public class ton_client {
+
+ ton_client() {
+ // Should not be called directly
+ }
+
+ static final Arena LIBRARY_ARENA = Arena.ofAuto();
+ static final boolean TRACE_DOWNCALLS = Boolean.getBoolean("jextract.trace.downcalls");
+
+ static void traceDowncall(String name, Object... args) {
+ String traceArgs = Arrays.stream(args)
+ .map(Object::toString)
+ .collect(Collectors.joining(", "));
+ System.out.printf("%s(%s)\n", name, traceArgs);
+ }
+
+ static MemorySegment findOrThrow(String symbol) {
+ return SYMBOL_LOOKUP.find(symbol)
+ .orElseThrow(() -> new UnsatisfiedLinkError("unresolved symbol: " + symbol));
+ }
+
+ static MethodHandle upcallHandle(Class> fi, String name, FunctionDescriptor fdesc) {
+ try {
+ return MethodHandles.lookup().findVirtual(fi, name, fdesc.toMethodType());
+ } catch (ReflectiveOperationException ex) {
+ throw new AssertionError(ex);
+ }
+ }
+
+ static MemoryLayout align(MemoryLayout layout, long align) {
+ return switch (layout) {
+ case PaddingLayout p -> p;
+ case ValueLayout v -> v.withByteAlignment(align);
+ case GroupLayout g -> {
+ MemoryLayout[] alignedMembers = g.memberLayouts().stream()
+ .map(m -> align(m, align)).toArray(MemoryLayout[]::new);
+ yield g instanceof StructLayout ?
+ MemoryLayout.structLayout(alignedMembers) : MemoryLayout.unionLayout(alignedMembers);
+ }
+ case SequenceLayout s -> MemoryLayout.sequenceLayout(s.elementCount(), align(s.elementLayout(), align));
+ };
+ }
+
+ static final SymbolLookup SYMBOL_LOOKUP = SymbolLookup.loaderLookup()
+ .or(Linker.nativeLinker().defaultLookup());
+
+ public static final ValueLayout.OfBoolean C_BOOL = ValueLayout.JAVA_BOOLEAN;
+ public static final ValueLayout.OfByte C_CHAR = ValueLayout.JAVA_BYTE;
+ public static final ValueLayout.OfShort C_SHORT = ValueLayout.JAVA_SHORT;
+ public static final ValueLayout.OfInt C_INT = ValueLayout.JAVA_INT;
+ public static final ValueLayout.OfLong C_LONG_LONG = ValueLayout.JAVA_LONG;
+ public static final ValueLayout.OfFloat C_FLOAT = ValueLayout.JAVA_FLOAT;
+ public static final ValueLayout.OfDouble C_DOUBLE = ValueLayout.JAVA_DOUBLE;
+ public static final AddressLayout C_POINTER = ValueLayout.ADDRESS
+ .withTargetLayout(MemoryLayout.sequenceLayout(java.lang.Long.MAX_VALUE, JAVA_BYTE));
+ public static final ValueLayout.OfInt C_LONG = ValueLayout.JAVA_INT;
+ public static final ValueLayout.OfDouble C_LONG_DOUBLE = ValueLayout.JAVA_DOUBLE;
+ private static final int true_ = (int)1L;
+ /**
+ * {@snippet lang=c :
* #define true 1
* }
*/
public static int true_() {
- return (int)1L;
+ return true_;
}
+ private static final int false_ = (int)0L;
/**
- * {@snippet :
+ * {@snippet lang=c :
* #define false 0
* }
*/
public static int false_() {
- return (int)0L;
+ return false_;
}
+ private static final int __bool_true_false_are_defined = (int)1L;
/**
- * {@snippet :
+ * {@snippet lang=c :
* #define __bool_true_false_are_defined 1
* }
*/
public static int __bool_true_false_are_defined() {
- return (int)1L;
+ return __bool_true_false_are_defined;
}
/**
- * {@snippet :
- * typedef long long int64_t;
+ * {@snippet lang=c :
+ * typedef long long int64_t
* }
*/
- public static final OfLong int64_t = JAVA_LONG;
+ public static final OfLong int64_t = ton_client.C_LONG_LONG;
/**
- * {@snippet :
- * typedef unsigned long long uint64_t;
+ * {@snippet lang=c :
+ * typedef unsigned long long uint64_t
* }
*/
- public static final OfLong uint64_t = JAVA_LONG;
+ public static final OfLong uint64_t = ton_client.C_LONG_LONG;
/**
- * {@snippet :
- * typedef long long int_least64_t;
+ * {@snippet lang=c :
+ * typedef int64_t int_least64_t
* }
*/
- public static final OfLong int_least64_t = JAVA_LONG;
+ public static final OfLong int_least64_t = ton_client.C_LONG_LONG;
/**
- * {@snippet :
- * typedef unsigned long long uint_least64_t;
+ * {@snippet lang=c :
+ * typedef uint64_t uint_least64_t
* }
*/
- public static final OfLong uint_least64_t = JAVA_LONG;
+ public static final OfLong uint_least64_t = ton_client.C_LONG_LONG;
/**
- * {@snippet :
- * typedef long long int_fast64_t;
+ * {@snippet lang=c :
+ * typedef int64_t int_fast64_t
* }
*/
- public static final OfLong int_fast64_t = JAVA_LONG;
+ public static final OfLong int_fast64_t = ton_client.C_LONG_LONG;
/**
- * {@snippet :
- * typedef unsigned long long uint_fast64_t;
+ * {@snippet lang=c :
+ * typedef uint64_t uint_fast64_t
* }
*/
- public static final OfLong uint_fast64_t = JAVA_LONG;
+ public static final OfLong uint_fast64_t = ton_client.C_LONG_LONG;
/**
- * {@snippet :
- * typedef int int32_t;
+ * {@snippet lang=c :
+ * typedef int int32_t
* }
*/
- public static final OfInt int32_t = JAVA_INT;
+ public static final OfInt int32_t = ton_client.C_INT;
/**
- * {@snippet :
- * typedef unsigned int uint32_t;
+ * {@snippet lang=c :
+ * typedef unsigned int uint32_t
* }
*/
- public static final OfInt uint32_t = JAVA_INT;
+ public static final OfInt uint32_t = ton_client.C_INT;
/**
- * {@snippet :
- * typedef int int_least32_t;
+ * {@snippet lang=c :
+ * typedef int32_t int_least32_t
* }
*/
- public static final OfInt int_least32_t = JAVA_INT;
+ public static final OfInt int_least32_t = ton_client.C_INT;
/**
- * {@snippet :
- * typedef unsigned int uint_least32_t;
+ * {@snippet lang=c :
+ * typedef uint32_t uint_least32_t
* }
*/
- public static final OfInt uint_least32_t = JAVA_INT;
+ public static final OfInt uint_least32_t = ton_client.C_INT;
/**
- * {@snippet :
- * typedef int int_fast32_t;
+ * {@snippet lang=c :
+ * typedef int32_t int_fast32_t
* }
*/
- public static final OfInt int_fast32_t = JAVA_INT;
+ public static final OfInt int_fast32_t = ton_client.C_INT;
/**
- * {@snippet :
- * typedef unsigned int uint_fast32_t;
+ * {@snippet lang=c :
+ * typedef uint32_t uint_fast32_t
* }
*/
- public static final OfInt uint_fast32_t = JAVA_INT;
+ public static final OfInt uint_fast32_t = ton_client.C_INT;
/**
- * {@snippet :
- * typedef short int16_t;
+ * {@snippet lang=c :
+ * typedef short int16_t
* }
*/
- public static final OfShort int16_t = JAVA_SHORT;
+ public static final OfShort int16_t = ton_client.C_SHORT;
/**
- * {@snippet :
- * typedef unsigned short uint16_t;
+ * {@snippet lang=c :
+ * typedef unsigned short uint16_t
* }
*/
- public static final OfShort uint16_t = JAVA_SHORT;
+ public static final OfShort uint16_t = ton_client.C_SHORT;
/**
- * {@snippet :
- * typedef short int_least16_t;
+ * {@snippet lang=c :
+ * typedef int16_t int_least16_t
* }
*/
- public static final OfShort int_least16_t = JAVA_SHORT;
+ public static final OfShort int_least16_t = ton_client.C_SHORT;
/**
- * {@snippet :
- * typedef unsigned short uint_least16_t;
+ * {@snippet lang=c :
+ * typedef uint16_t uint_least16_t
* }
*/
- public static final OfShort uint_least16_t = JAVA_SHORT;
+ public static final OfShort uint_least16_t = ton_client.C_SHORT;
/**
- * {@snippet :
- * typedef short int_fast16_t;
+ * {@snippet lang=c :
+ * typedef int16_t int_fast16_t
* }
*/
- public static final OfShort int_fast16_t = JAVA_SHORT;
+ public static final OfShort int_fast16_t = ton_client.C_SHORT;
/**
- * {@snippet :
- * typedef unsigned short uint_fast16_t;
+ * {@snippet lang=c :
+ * typedef uint16_t uint_fast16_t
* }
*/
- public static final OfShort uint_fast16_t = JAVA_SHORT;
+ public static final OfShort uint_fast16_t = ton_client.C_SHORT;
/**
- * {@snippet :
- * typedef signed char int8_t;
+ * {@snippet lang=c :
+ * typedef signed char int8_t
* }
*/
- public static final OfByte int8_t = JAVA_BYTE;
+ public static final OfByte int8_t = ton_client.C_CHAR;
/**
- * {@snippet :
- * typedef unsigned char uint8_t;
+ * {@snippet lang=c :
+ * typedef unsigned char uint8_t
* }
*/
- public static final OfByte uint8_t = JAVA_BYTE;
+ public static final OfByte uint8_t = ton_client.C_CHAR;
/**
- * {@snippet :
- * typedef signed char int_least8_t;
+ * {@snippet lang=c :
+ * typedef int8_t int_least8_t
* }
*/
- public static final OfByte int_least8_t = JAVA_BYTE;
+ public static final OfByte int_least8_t = ton_client.C_CHAR;
/**
- * {@snippet :
- * typedef unsigned char uint_least8_t;
+ * {@snippet lang=c :
+ * typedef uint8_t uint_least8_t
* }
*/
- public static final OfByte uint_least8_t = JAVA_BYTE;
+ public static final OfByte uint_least8_t = ton_client.C_CHAR;
/**
- * {@snippet :
- * typedef signed char int_fast8_t;
+ * {@snippet lang=c :
+ * typedef int8_t int_fast8_t
* }
*/
- public static final OfByte int_fast8_t = JAVA_BYTE;
+ public static final OfByte int_fast8_t = ton_client.C_CHAR;
/**
- * {@snippet :
- * typedef unsigned char uint_fast8_t;
+ * {@snippet lang=c :
+ * typedef uint8_t uint_fast8_t
* }
*/
- public static final OfByte uint_fast8_t = JAVA_BYTE;
+ public static final OfByte uint_fast8_t = ton_client.C_CHAR;
/**
- * {@snippet :
- * typedef long long intptr_t;
+ * {@snippet lang=c :
+ * typedef long long intptr_t
* }
*/
- public static final OfLong intptr_t = JAVA_LONG;
+ public static final OfLong intptr_t = ton_client.C_LONG_LONG;
/**
- * {@snippet :
- * typedef unsigned long long uintptr_t;
+ * {@snippet lang=c :
+ * typedef unsigned long long uintptr_t
* }
*/
- public static final OfLong uintptr_t = JAVA_LONG;
+ public static final OfLong uintptr_t = ton_client.C_LONG_LONG;
/**
- * {@snippet :
- * typedef long long intmax_t;
+ * {@snippet lang=c :
+ * typedef long long intmax_t
* }
*/
- public static final OfLong intmax_t = JAVA_LONG;
+ public static final OfLong intmax_t = ton_client.C_LONG_LONG;
/**
- * {@snippet :
- * typedef unsigned long long uintmax_t;
+ * {@snippet lang=c :
+ * typedef unsigned long long uintmax_t
* }
*/
- public static final OfLong uintmax_t = JAVA_LONG;
+ public static final OfLong uintmax_t = ton_client.C_LONG_LONG;
+ private static final int tc_response_success = (int)0L;
/**
- * {@snippet :
- * enum tc_response_types.tc_response_success = 0;
+ * {@snippet lang=c :
+ * enum tc_response_types.tc_response_success = 0
* }
*/
public static int tc_response_success() {
- return (int)0L;
+ return tc_response_success;
}
+ private static final int tc_response_error = (int)1L;
/**
- * {@snippet :
- * enum tc_response_types.tc_response_error = 1;
+ * {@snippet lang=c :
+ * enum tc_response_types.tc_response_error = 1
* }
*/
public static int tc_response_error() {
- return (int)1L;
+ return tc_response_error;
}
+ private static final int tc_response_nop = (int)2L;
/**
- * {@snippet :
- * enum tc_response_types.tc_response_nop = 2;
+ * {@snippet lang=c :
+ * enum tc_response_types.tc_response_nop = 2
* }
*/
public static int tc_response_nop() {
- return (int)2L;
+ return tc_response_nop;
}
+ private static final int tc_response_app_request = (int)3L;
/**
- * {@snippet :
- * enum tc_response_types.tc_response_app_request = 3;
+ * {@snippet lang=c :
+ * enum tc_response_types.tc_response_app_request = 3
* }
*/
public static int tc_response_app_request() {
- return (int)3L;
+ return tc_response_app_request;
}
+ private static final int tc_response_app_notify = (int)4L;
/**
- * {@snippet :
- * enum tc_response_types.tc_response_app_notify = 4;
+ * {@snippet lang=c :
+ * enum tc_response_types.tc_response_app_notify = 4
* }
*/
public static int tc_response_app_notify() {
- return (int)4L;
+ return tc_response_app_notify;
}
+ private static final int tc_response_custom = (int)100L;
/**
- * {@snippet :
- * enum tc_response_types.tc_response_custom = 100;
+ * {@snippet lang=c :
+ * enum tc_response_types.tc_response_custom = 100
* }
*/
public static int tc_response_custom() {
- return (int)100L;
+ return tc_response_custom;
}
- public static MethodHandle tc_create_context$MH() {
- return RuntimeHelper.requireNonNull(constants$1.const$4,"tc_create_context");
+
+ private static class tc_create_context {
+ public static final FunctionDescriptor DESC = FunctionDescriptor.of(
+ ton_client.C_POINTER,
+ tc_string_data_t.layout()
+ );
+
+ public static final MemorySegment ADDR = ton_client.findOrThrow("tc_create_context");
+
+ public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC);
+ }
+
+ /**
+ * Function descriptor for:
+ * {@snippet lang=c :
+ * tc_string_handle_t *tc_create_context(tc_string_data_t config)
+ * }
+ */
+ public static FunctionDescriptor tc_create_context$descriptor() {
+ return tc_create_context.DESC;
}
+
/**
- * {@snippet :
- * tc_string_handle_t* tc_create_context(tc_string_data_t config);
+ * Downcall method handle for:
+ * {@snippet lang=c :
+ * tc_string_handle_t *tc_create_context(tc_string_data_t config)
+ * }
+ */
+ public static MethodHandle tc_create_context$handle() {
+ return tc_create_context.HANDLE;
+ }
+
+ /**
+ * Address for:
+ * {@snippet lang=c :
+ * tc_string_handle_t *tc_create_context(tc_string_data_t config)
+ * }
+ */
+ public static MemorySegment tc_create_context$address() {
+ return tc_create_context.ADDR;
+ }
+
+ /**
+ * {@snippet lang=c :
+ * tc_string_handle_t *tc_create_context(tc_string_data_t config)
* }
*/
public static MemorySegment tc_create_context(MemorySegment config) {
- var mh$ = tc_create_context$MH();
+ var mh$ = tc_create_context.HANDLE;
try {
- return (java.lang.foreign.MemorySegment)mh$.invokeExact(config);
+ if (TRACE_DOWNCALLS) {
+ traceDowncall("tc_create_context", config);
+ }
+ return (MemorySegment)mh$.invokeExact(config);
} catch (Throwable ex$) {
- throw new AssertionError("should not reach here", ex$);
+ throw new AssertionError("should not reach here", ex$);
}
}
- public static MethodHandle tc_destroy_context$MH() {
- return RuntimeHelper.requireNonNull(constants$1.const$6,"tc_destroy_context");
+
+ private static class tc_destroy_context {
+ public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid(
+ ton_client.C_INT
+ );
+
+ public static final MemorySegment ADDR = ton_client.findOrThrow("tc_destroy_context");
+
+ public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC);
+ }
+
+ /**
+ * Function descriptor for:
+ * {@snippet lang=c :
+ * void tc_destroy_context(uint32_t context)
+ * }
+ */
+ public static FunctionDescriptor tc_destroy_context$descriptor() {
+ return tc_destroy_context.DESC;
}
+
/**
- * {@snippet :
- * void tc_destroy_context(uint32_t context);
+ * Downcall method handle for:
+ * {@snippet lang=c :
+ * void tc_destroy_context(uint32_t context)
+ * }
+ */
+ public static MethodHandle tc_destroy_context$handle() {
+ return tc_destroy_context.HANDLE;
+ }
+
+ /**
+ * Address for:
+ * {@snippet lang=c :
+ * void tc_destroy_context(uint32_t context)
+ * }
+ */
+ public static MemorySegment tc_destroy_context$address() {
+ return tc_destroy_context.ADDR;
+ }
+
+ /**
+ * {@snippet lang=c :
+ * void tc_destroy_context(uint32_t context)
* }
*/
public static void tc_destroy_context(int context) {
- var mh$ = tc_destroy_context$MH();
+ var mh$ = tc_destroy_context.HANDLE;
try {
+ if (TRACE_DOWNCALLS) {
+ traceDowncall("tc_destroy_context", context);
+ }
mh$.invokeExact(context);
} catch (Throwable ex$) {
- throw new AssertionError("should not reach here", ex$);
+ throw new AssertionError("should not reach here", ex$);
}
}
- public static MethodHandle tc_request$MH() {
- return RuntimeHelper.requireNonNull(constants$2.const$1,"tc_request");
+
+ private static class tc_request {
+ public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid(
+ ton_client.C_INT,
+ tc_string_data_t.layout(),
+ tc_string_data_t.layout(),
+ ton_client.C_INT,
+ ton_client.C_POINTER
+ );
+
+ public static final MemorySegment ADDR = ton_client.findOrThrow("tc_request");
+
+ public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC);
+ }
+
+ /**
+ * Function descriptor for:
+ * {@snippet lang=c :
+ * void tc_request(uint32_t context, tc_string_data_t function_name, tc_string_data_t function_params_json, uint32_t request_id, tc_response_handler_t response_handler)
+ * }
+ */
+ public static FunctionDescriptor tc_request$descriptor() {
+ return tc_request.DESC;
}
+
/**
- * {@snippet :
- * void tc_request(uint32_t context, tc_string_data_t function_name, tc_string_data_t function_params_json, uint32_t request_id, tc_response_handler_t response_handler);
+ * Downcall method handle for:
+ * {@snippet lang=c :
+ * void tc_request(uint32_t context, tc_string_data_t function_name, tc_string_data_t function_params_json, uint32_t request_id, tc_response_handler_t response_handler)
+ * }
+ */
+ public static MethodHandle tc_request$handle() {
+ return tc_request.HANDLE;
+ }
+
+ /**
+ * Address for:
+ * {@snippet lang=c :
+ * void tc_request(uint32_t context, tc_string_data_t function_name, tc_string_data_t function_params_json, uint32_t request_id, tc_response_handler_t response_handler)
+ * }
+ */
+ public static MemorySegment tc_request$address() {
+ return tc_request.ADDR;
+ }
+
+ /**
+ * {@snippet lang=c :
+ * void tc_request(uint32_t context, tc_string_data_t function_name, tc_string_data_t function_params_json, uint32_t request_id, tc_response_handler_t response_handler)
* }
*/
public static void tc_request(int context, MemorySegment function_name, MemorySegment function_params_json, int request_id, MemorySegment response_handler) {
- var mh$ = tc_request$MH();
+ var mh$ = tc_request.HANDLE;
try {
+ if (TRACE_DOWNCALLS) {
+ traceDowncall("tc_request", context, function_name, function_params_json, request_id, response_handler);
+ }
mh$.invokeExact(context, function_name, function_params_json, request_id, response_handler);
} catch (Throwable ex$) {
- throw new AssertionError("should not reach here", ex$);
+ throw new AssertionError("should not reach here", ex$);
}
}
- public static MethodHandle tc_request_ptr$MH() {
- return RuntimeHelper.requireNonNull(constants$2.const$3,"tc_request_ptr");
+
+ private static class tc_request_ptr {
+ public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid(
+ ton_client.C_INT,
+ tc_string_data_t.layout(),
+ tc_string_data_t.layout(),
+ ton_client.C_POINTER,
+ ton_client.C_POINTER
+ );
+
+ public static final MemorySegment ADDR = ton_client.findOrThrow("tc_request_ptr");
+
+ public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC);
+ }
+
+ /**
+ * Function descriptor for:
+ * {@snippet lang=c :
+ * void tc_request_ptr(uint32_t context, tc_string_data_t function_name, tc_string_data_t function_params_json, void *request_ptr, tc_response_handler_ptr_t response_handler)
+ * }
+ */
+ public static FunctionDescriptor tc_request_ptr$descriptor() {
+ return tc_request_ptr.DESC;
}
+
/**
- * {@snippet :
- * void tc_request_ptr(uint32_t context, tc_string_data_t function_name, tc_string_data_t function_params_json, void* request_ptr, tc_response_handler_ptr_t response_handler);
+ * Downcall method handle for:
+ * {@snippet lang=c :
+ * void tc_request_ptr(uint32_t context, tc_string_data_t function_name, tc_string_data_t function_params_json, void *request_ptr, tc_response_handler_ptr_t response_handler)
+ * }
+ */
+ public static MethodHandle tc_request_ptr$handle() {
+ return tc_request_ptr.HANDLE;
+ }
+
+ /**
+ * Address for:
+ * {@snippet lang=c :
+ * void tc_request_ptr(uint32_t context, tc_string_data_t function_name, tc_string_data_t function_params_json, void *request_ptr, tc_response_handler_ptr_t response_handler)
+ * }
+ */
+ public static MemorySegment tc_request_ptr$address() {
+ return tc_request_ptr.ADDR;
+ }
+
+ /**
+ * {@snippet lang=c :
+ * void tc_request_ptr(uint32_t context, tc_string_data_t function_name, tc_string_data_t function_params_json, void *request_ptr, tc_response_handler_ptr_t response_handler)
* }
*/
public static void tc_request_ptr(int context, MemorySegment function_name, MemorySegment function_params_json, MemorySegment request_ptr, MemorySegment response_handler) {
- var mh$ = tc_request_ptr$MH();
+ var mh$ = tc_request_ptr.HANDLE;
try {
+ if (TRACE_DOWNCALLS) {
+ traceDowncall("tc_request_ptr", context, function_name, function_params_json, request_ptr, response_handler);
+ }
mh$.invokeExact(context, function_name, function_params_json, request_ptr, response_handler);
} catch (Throwable ex$) {
- throw new AssertionError("should not reach here", ex$);
+ throw new AssertionError("should not reach here", ex$);
}
}
- public static MethodHandle tc_request_sync$MH() {
- return RuntimeHelper.requireNonNull(constants$2.const$5,"tc_request_sync");
+
+ private static class tc_request_sync {
+ public static final FunctionDescriptor DESC = FunctionDescriptor.of(
+ ton_client.C_POINTER,
+ ton_client.C_INT,
+ tc_string_data_t.layout(),
+ tc_string_data_t.layout()
+ );
+
+ public static final MemorySegment ADDR = ton_client.findOrThrow("tc_request_sync");
+
+ public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC);
+ }
+
+ /**
+ * Function descriptor for:
+ * {@snippet lang=c :
+ * tc_string_handle_t *tc_request_sync(uint32_t context, tc_string_data_t function_name, tc_string_data_t function_params_json)
+ * }
+ */
+ public static FunctionDescriptor tc_request_sync$descriptor() {
+ return tc_request_sync.DESC;
}
+
/**
- * {@snippet :
- * tc_string_handle_t* tc_request_sync(uint32_t context, tc_string_data_t function_name, tc_string_data_t function_params_json);
+ * Downcall method handle for:
+ * {@snippet lang=c :
+ * tc_string_handle_t *tc_request_sync(uint32_t context, tc_string_data_t function_name, tc_string_data_t function_params_json)
+ * }
+ */
+ public static MethodHandle tc_request_sync$handle() {
+ return tc_request_sync.HANDLE;
+ }
+
+ /**
+ * Address for:
+ * {@snippet lang=c :
+ * tc_string_handle_t *tc_request_sync(uint32_t context, tc_string_data_t function_name, tc_string_data_t function_params_json)
+ * }
+ */
+ public static MemorySegment tc_request_sync$address() {
+ return tc_request_sync.ADDR;
+ }
+
+ /**
+ * {@snippet lang=c :
+ * tc_string_handle_t *tc_request_sync(uint32_t context, tc_string_data_t function_name, tc_string_data_t function_params_json)
* }
*/
public static MemorySegment tc_request_sync(int context, MemorySegment function_name, MemorySegment function_params_json) {
- var mh$ = tc_request_sync$MH();
+ var mh$ = tc_request_sync.HANDLE;
try {
- return (java.lang.foreign.MemorySegment)mh$.invokeExact(context, function_name, function_params_json);
+ if (TRACE_DOWNCALLS) {
+ traceDowncall("tc_request_sync", context, function_name, function_params_json);
+ }
+ return (MemorySegment)mh$.invokeExact(context, function_name, function_params_json);
} catch (Throwable ex$) {
- throw new AssertionError("should not reach here", ex$);
+ throw new AssertionError("should not reach here", ex$);
}
}
- public static MethodHandle tc_read_string$MH() {
- return RuntimeHelper.requireNonNull(constants$3.const$1,"tc_read_string");
+
+ private static class tc_read_string {
+ public static final FunctionDescriptor DESC = FunctionDescriptor.of(
+ tc_string_data_t.layout(),
+ ton_client.C_POINTER
+ );
+
+ public static final MemorySegment ADDR = ton_client.findOrThrow("tc_read_string");
+
+ public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC);
+ }
+
+ /**
+ * Function descriptor for:
+ * {@snippet lang=c :
+ * tc_string_data_t tc_read_string(const tc_string_handle_t *handle)
+ * }
+ */
+ public static FunctionDescriptor tc_read_string$descriptor() {
+ return tc_read_string.DESC;
}
+
/**
- * {@snippet :
- * tc_string_data_t tc_read_string(const tc_string_handle_t* handle);
+ * Downcall method handle for:
+ * {@snippet lang=c :
+ * tc_string_data_t tc_read_string(const tc_string_handle_t *handle)
+ * }
+ */
+ public static MethodHandle tc_read_string$handle() {
+ return tc_read_string.HANDLE;
+ }
+
+ /**
+ * Address for:
+ * {@snippet lang=c :
+ * tc_string_data_t tc_read_string(const tc_string_handle_t *handle)
+ * }
+ */
+ public static MemorySegment tc_read_string$address() {
+ return tc_read_string.ADDR;
+ }
+
+ /**
+ * {@snippet lang=c :
+ * tc_string_data_t tc_read_string(const tc_string_handle_t *handle)
* }
*/
public static MemorySegment tc_read_string(SegmentAllocator allocator, MemorySegment handle) {
- var mh$ = tc_read_string$MH();
+ var mh$ = tc_read_string.HANDLE;
try {
- return (java.lang.foreign.MemorySegment)mh$.invokeExact(allocator, handle);
+ if (TRACE_DOWNCALLS) {
+ traceDowncall("tc_read_string", allocator, handle);
+ }
+ return (MemorySegment)mh$.invokeExact(allocator, handle);
} catch (Throwable ex$) {
- throw new AssertionError("should not reach here", ex$);
+ throw new AssertionError("should not reach here", ex$);
}
}
- public static MethodHandle tc_destroy_string$MH() {
- return RuntimeHelper.requireNonNull(constants$3.const$3,"tc_destroy_string");
+
+ private static class tc_destroy_string {
+ public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid(
+ ton_client.C_POINTER
+ );
+
+ public static final MemorySegment ADDR = ton_client.findOrThrow("tc_destroy_string");
+
+ public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC);
+ }
+
+ /**
+ * Function descriptor for:
+ * {@snippet lang=c :
+ * void tc_destroy_string(const tc_string_handle_t *handle)
+ * }
+ */
+ public static FunctionDescriptor tc_destroy_string$descriptor() {
+ return tc_destroy_string.DESC;
}
+
/**
- * {@snippet :
- * void tc_destroy_string(const tc_string_handle_t* handle);
+ * Downcall method handle for:
+ * {@snippet lang=c :
+ * void tc_destroy_string(const tc_string_handle_t *handle)
+ * }
+ */
+ public static MethodHandle tc_destroy_string$handle() {
+ return tc_destroy_string.HANDLE;
+ }
+
+ /**
+ * Address for:
+ * {@snippet lang=c :
+ * void tc_destroy_string(const tc_string_handle_t *handle)
+ * }
+ */
+ public static MemorySegment tc_destroy_string$address() {
+ return tc_destroy_string.ADDR;
+ }
+
+ /**
+ * {@snippet lang=c :
+ * void tc_destroy_string(const tc_string_handle_t *handle)
* }
*/
public static void tc_destroy_string(MemorySegment handle) {
- var mh$ = tc_destroy_string$MH();
+ var mh$ = tc_destroy_string.HANDLE;
try {
+ if (TRACE_DOWNCALLS) {
+ traceDowncall("tc_destroy_string", handle);
+ }
mh$.invokeExact(handle);
} catch (Throwable ex$) {
- throw new AssertionError("should not reach here", ex$);
+ throw new AssertionError("should not reach here", ex$);
}
}
+ private static final long INT64_MAX = 9223372036854775807L;
/**
- * {@snippet :
+ * {@snippet lang=c :
* #define INT64_MAX 9223372036854775807
* }
*/
public static long INT64_MAX() {
- return 9223372036854775807L;
+ return INT64_MAX;
}
+ private static final long INT64_MIN = -9223372036854775808L;
/**
- * {@snippet :
+ * {@snippet lang=c :
* #define INT64_MIN -9223372036854775808
* }
*/
public static long INT64_MIN() {
- return -9223372036854775808L;
+ return INT64_MIN;
}
+ private static final long UINT64_MAX = -1L;
/**
- * {@snippet :
+ * {@snippet lang=c :
* #define UINT64_MAX -1
* }
*/
public static long UINT64_MAX() {
- return -1L;
+ return UINT64_MAX;
}
+ private static final long __INT_LEAST64_MIN = -9223372036854775808L;
/**
- * {@snippet :
+ * {@snippet lang=c :
* #define __INT_LEAST64_MIN -9223372036854775808
* }
*/
public static long __INT_LEAST64_MIN() {
- return -9223372036854775808L;
+ return __INT_LEAST64_MIN;
}
+ private static final long __INT_LEAST64_MAX = 9223372036854775807L;
/**
- * {@snippet :
+ * {@snippet lang=c :
* #define __INT_LEAST64_MAX 9223372036854775807
* }
*/
public static long __INT_LEAST64_MAX() {
- return 9223372036854775807L;
+ return __INT_LEAST64_MAX;
}
+ private static final long __UINT_LEAST64_MAX = -1L;
/**
- * {@snippet :
+ * {@snippet lang=c :
* #define __UINT_LEAST64_MAX -1
* }
*/
public static long __UINT_LEAST64_MAX() {
- return -1L;
+ return __UINT_LEAST64_MAX;
}
+ private static final int __INT_LEAST32_MIN = (int)-2147483648L;
/**
- * {@snippet :
+ * {@snippet lang=c :
* #define __INT_LEAST32_MIN -2147483648
* }
*/
public static int __INT_LEAST32_MIN() {
- return (int)-2147483648L;
+ return __INT_LEAST32_MIN;
}
+ private static final int __INT_LEAST32_MAX = (int)2147483647L;
/**
- * {@snippet :
+ * {@snippet lang=c :
* #define __INT_LEAST32_MAX 2147483647
* }
*/
public static int __INT_LEAST32_MAX() {
- return (int)2147483647L;
+ return __INT_LEAST32_MAX;
}
+ private static final int __UINT_LEAST32_MAX = (int)4294967295L;
/**
- * {@snippet :
+ * {@snippet lang=c :
* #define __UINT_LEAST32_MAX 4294967295
* }
*/
public static int __UINT_LEAST32_MAX() {
- return (int)4294967295L;
+ return __UINT_LEAST32_MAX;
}
+ private static final int __INT_LEAST16_MIN = (int)-32768L;
/**
- * {@snippet :
+ * {@snippet lang=c :
* #define __INT_LEAST16_MIN -32768
* }
*/
public static int __INT_LEAST16_MIN() {
- return (int)-32768L;
+ return __INT_LEAST16_MIN;
}
+ private static final int __INT_LEAST16_MAX = (int)32767L;
/**
- * {@snippet :
+ * {@snippet lang=c :
* #define __INT_LEAST16_MAX 32767
* }
*/
public static int __INT_LEAST16_MAX() {
- return (int)32767L;
+ return __INT_LEAST16_MAX;
}
+ private static final int __UINT_LEAST16_MAX = (int)65535L;
/**
- * {@snippet :
+ * {@snippet lang=c :
* #define __UINT_LEAST16_MAX 65535
* }
*/
public static int __UINT_LEAST16_MAX() {
- return (int)65535L;
+ return __UINT_LEAST16_MAX;
}
+ private static final int __INT_LEAST8_MIN = (int)-128L;
/**
- * {@snippet :
+ * {@snippet lang=c :
* #define __INT_LEAST8_MIN -128
* }
*/
public static int __INT_LEAST8_MIN() {
- return (int)-128L;
+ return __INT_LEAST8_MIN;
}
+ private static final int __INT_LEAST8_MAX = (int)127L;
/**
- * {@snippet :
+ * {@snippet lang=c :
* #define __INT_LEAST8_MAX 127
* }
*/
public static int __INT_LEAST8_MAX() {
- return (int)127L;
+ return __INT_LEAST8_MAX;
}
+ private static final int __UINT_LEAST8_MAX = (int)255L;
/**
- * {@snippet :
+ * {@snippet lang=c :
* #define __UINT_LEAST8_MAX 255
* }
*/
public static int __UINT_LEAST8_MAX() {
- return (int)255L;
+ return __UINT_LEAST8_MAX;
}
+ private static final long INT_LEAST64_MIN = -9223372036854775808L;
/**
- * {@snippet :
+ * {@snippet lang=c :
* #define INT_LEAST64_MIN -9223372036854775808
* }
*/
public static long INT_LEAST64_MIN() {
- return -9223372036854775808L;
+ return INT_LEAST64_MIN;
}
+ private static final long INT_LEAST64_MAX = 9223372036854775807L;
/**
- * {@snippet :
+ * {@snippet lang=c :
* #define INT_LEAST64_MAX 9223372036854775807
* }
*/
public static long INT_LEAST64_MAX() {
- return 9223372036854775807L;
+ return INT_LEAST64_MAX;
}
+ private static final long UINT_LEAST64_MAX = -1L;
/**
- * {@snippet :
+ * {@snippet lang=c :
* #define UINT_LEAST64_MAX -1
* }
*/
public static long UINT_LEAST64_MAX() {
- return -1L;
+ return UINT_LEAST64_MAX;
}
+ private static final long INT_FAST64_MIN = -9223372036854775808L;
/**
- * {@snippet :
+ * {@snippet lang=c :
* #define INT_FAST64_MIN -9223372036854775808
* }
*/
public static long INT_FAST64_MIN() {
- return -9223372036854775808L;
+ return INT_FAST64_MIN;
}
+ private static final long INT_FAST64_MAX = 9223372036854775807L;
/**
- * {@snippet :
+ * {@snippet lang=c :
* #define INT_FAST64_MAX 9223372036854775807
* }
*/
public static long INT_FAST64_MAX() {
- return 9223372036854775807L;
+ return INT_FAST64_MAX;
}
+ private static final long UINT_FAST64_MAX = -1L;
/**
- * {@snippet :
+ * {@snippet lang=c :
* #define UINT_FAST64_MAX -1
* }
*/
public static long UINT_FAST64_MAX() {
- return -1L;
+ return UINT_FAST64_MAX;
}
+ private static final int INT32_MAX = (int)2147483647L;
/**
- * {@snippet :
+ * {@snippet lang=c :
* #define INT32_MAX 2147483647
* }
*/
public static int INT32_MAX() {
- return (int)2147483647L;
+ return INT32_MAX;
}
+ private static final int INT32_MIN = (int)-2147483648L;
/**
- * {@snippet :
+ * {@snippet lang=c :
* #define INT32_MIN -2147483648
* }
*/
public static int INT32_MIN() {
- return (int)-2147483648L;
+ return INT32_MIN;
}
+ private static final int UINT32_MAX = (int)4294967295L;
/**
- * {@snippet :
+ * {@snippet lang=c :
* #define UINT32_MAX 4294967295
* }
*/
public static int UINT32_MAX() {
- return (int)4294967295L;
+ return UINT32_MAX;
}
+ private static final int INT_LEAST32_MIN = (int)-2147483648L;
/**
- * {@snippet :
+ * {@snippet lang=c :
* #define INT_LEAST32_MIN -2147483648
* }
*/
public static int INT_LEAST32_MIN() {
- return (int)-2147483648L;
+ return INT_LEAST32_MIN;
}
+ private static final int INT_LEAST32_MAX = (int)2147483647L;
/**
- * {@snippet :
+ * {@snippet lang=c :
* #define INT_LEAST32_MAX 2147483647
* }
*/
public static int INT_LEAST32_MAX() {
- return (int)2147483647L;
+ return INT_LEAST32_MAX;
}
+ private static final int UINT_LEAST32_MAX = (int)4294967295L;
/**
- * {@snippet :
+ * {@snippet lang=c :
* #define UINT_LEAST32_MAX 4294967295
* }
*/
public static int UINT_LEAST32_MAX() {
- return (int)4294967295L;
+ return UINT_LEAST32_MAX;
}
+ private static final int INT_FAST32_MIN = (int)-2147483648L;
/**
- * {@snippet :
+ * {@snippet lang=c :
* #define INT_FAST32_MIN -2147483648
* }
*/
public static int INT_FAST32_MIN() {
- return (int)-2147483648L;
+ return INT_FAST32_MIN;
}
+ private static final int INT_FAST32_MAX = (int)2147483647L;
/**
- * {@snippet :
+ * {@snippet lang=c :
* #define INT_FAST32_MAX 2147483647
* }
*/
public static int INT_FAST32_MAX() {
- return (int)2147483647L;
+ return INT_FAST32_MAX;
}
+ private static final int UINT_FAST32_MAX = (int)4294967295L;
/**
- * {@snippet :
+ * {@snippet lang=c :
* #define UINT_FAST32_MAX 4294967295
* }
*/
public static int UINT_FAST32_MAX() {
- return (int)4294967295L;
+ return UINT_FAST32_MAX;
}
+ private static final int INT16_MAX = (int)32767L;
/**
- * {@snippet :
+ * {@snippet lang=c :
* #define INT16_MAX 32767
* }
*/
public static int INT16_MAX() {
- return (int)32767L;
+ return INT16_MAX;
}
+ private static final int INT16_MIN = (int)-32768L;
/**
- * {@snippet :
+ * {@snippet lang=c :
* #define INT16_MIN -32768
* }
*/
public static int INT16_MIN() {
- return (int)-32768L;
+ return INT16_MIN;
}
+ private static final int UINT16_MAX = (int)65535L;
/**
- * {@snippet :
+ * {@snippet lang=c :
* #define UINT16_MAX 65535
* }
*/
public static int UINT16_MAX() {
- return (int)65535L;
+ return UINT16_MAX;
}
+ private static final int INT_LEAST16_MIN = (int)-32768L;
/**
- * {@snippet :
+ * {@snippet lang=c :
* #define INT_LEAST16_MIN -32768
* }
*/
public static int INT_LEAST16_MIN() {
- return (int)-32768L;
+ return INT_LEAST16_MIN;
}
+ private static final int INT_LEAST16_MAX = (int)32767L;
/**
- * {@snippet :
+ * {@snippet lang=c :
* #define INT_LEAST16_MAX 32767
* }
*/
public static int INT_LEAST16_MAX() {
- return (int)32767L;
+ return INT_LEAST16_MAX;
}
+ private static final int UINT_LEAST16_MAX = (int)65535L;
/**
- * {@snippet :
+ * {@snippet lang=c :
* #define UINT_LEAST16_MAX 65535
* }
*/
public static int UINT_LEAST16_MAX() {
- return (int)65535L;
+ return UINT_LEAST16_MAX;
}
+ private static final int INT_FAST16_MIN = (int)-32768L;
/**
- * {@snippet :
+ * {@snippet lang=c :
* #define INT_FAST16_MIN -32768
* }
*/
public static int INT_FAST16_MIN() {
- return (int)-32768L;
+ return INT_FAST16_MIN;
}
+ private static final int INT_FAST16_MAX = (int)32767L;
/**
- * {@snippet :
+ * {@snippet lang=c :
* #define INT_FAST16_MAX 32767
* }
*/
public static int INT_FAST16_MAX() {
- return (int)32767L;
+ return INT_FAST16_MAX;
}
+ private static final int UINT_FAST16_MAX = (int)65535L;
/**
- * {@snippet :
+ * {@snippet lang=c :
* #define UINT_FAST16_MAX 65535
* }
*/
public static int UINT_FAST16_MAX() {
- return (int)65535L;
+ return UINT_FAST16_MAX;
}
+ private static final int INT8_MAX = (int)127L;
/**
- * {@snippet :
+ * {@snippet lang=c :
* #define INT8_MAX 127
* }
*/
public static int INT8_MAX() {
- return (int)127L;
+ return INT8_MAX;
}
+ private static final int INT8_MIN = (int)-128L;
/**
- * {@snippet :
+ * {@snippet lang=c :
* #define INT8_MIN -128
* }
*/
public static int INT8_MIN() {
- return (int)-128L;
+ return INT8_MIN;
}
+ private static final int UINT8_MAX = (int)255L;
/**
- * {@snippet :
+ * {@snippet lang=c :
* #define UINT8_MAX 255
* }
*/
public static int UINT8_MAX() {
- return (int)255L;
+ return UINT8_MAX;
}
+ private static final int INT_LEAST8_MIN = (int)-128L;
/**
- * {@snippet :
+ * {@snippet lang=c :
* #define INT_LEAST8_MIN -128
* }
*/
public static int INT_LEAST8_MIN() {
- return (int)-128L;
+ return INT_LEAST8_MIN;
}
+ private static final int INT_LEAST8_MAX = (int)127L;
/**
- * {@snippet :
+ * {@snippet lang=c :
* #define INT_LEAST8_MAX 127
* }
*/
public static int INT_LEAST8_MAX() {
- return (int)127L;
+ return INT_LEAST8_MAX;
}
+ private static final int UINT_LEAST8_MAX = (int)255L;
/**
- * {@snippet :
+ * {@snippet lang=c :
* #define UINT_LEAST8_MAX 255
* }
*/
public static int UINT_LEAST8_MAX() {
- return (int)255L;
+ return UINT_LEAST8_MAX;
}
+ private static final int INT_FAST8_MIN = (int)-128L;
/**
- * {@snippet :
+ * {@snippet lang=c :
* #define INT_FAST8_MIN -128
* }
*/
public static int INT_FAST8_MIN() {
- return (int)-128L;
+ return INT_FAST8_MIN;
}
+ private static final int INT_FAST8_MAX = (int)127L;
/**
- * {@snippet :
+ * {@snippet lang=c :
* #define INT_FAST8_MAX 127
* }
*/
public static int INT_FAST8_MAX() {
- return (int)127L;
+ return INT_FAST8_MAX;
}
+ private static final int UINT_FAST8_MAX = (int)255L;
/**
- * {@snippet :
+ * {@snippet lang=c :
* #define UINT_FAST8_MAX 255
* }
*/
public static int UINT_FAST8_MAX() {
- return (int)255L;
+ return UINT_FAST8_MAX;
}
+ private static final long INTPTR_MIN = -9223372036854775808L;
/**
- * {@snippet :
+ * {@snippet lang=c :
* #define INTPTR_MIN -9223372036854775808
* }
*/
public static long INTPTR_MIN() {
- return -9223372036854775808L;
+ return INTPTR_MIN;
}
+ private static final long INTPTR_MAX = 9223372036854775807L;
/**
- * {@snippet :
+ * {@snippet lang=c :
* #define INTPTR_MAX 9223372036854775807
* }
*/
public static long INTPTR_MAX() {
- return 9223372036854775807L;
+ return INTPTR_MAX;
}
+ private static final long UINTPTR_MAX = -1L;
/**
- * {@snippet :
+ * {@snippet lang=c :
* #define UINTPTR_MAX -1
* }
*/
public static long UINTPTR_MAX() {
- return -1L;
+ return UINTPTR_MAX;
}
+ private static final long PTRDIFF_MIN = -9223372036854775808L;
/**
- * {@snippet :
+ * {@snippet lang=c :
* #define PTRDIFF_MIN -9223372036854775808
* }
*/
public static long PTRDIFF_MIN() {
- return -9223372036854775808L;
+ return PTRDIFF_MIN;
}
+ private static final long PTRDIFF_MAX = 9223372036854775807L;
/**
- * {@snippet :
+ * {@snippet lang=c :
* #define PTRDIFF_MAX 9223372036854775807
* }
*/
public static long PTRDIFF_MAX() {
- return 9223372036854775807L;
+ return PTRDIFF_MAX;
}
+ private static final long SIZE_MAX = -1L;
/**
- * {@snippet :
+ * {@snippet lang=c :
* #define SIZE_MAX -1
* }
*/
public static long SIZE_MAX() {
- return -1L;
+ return SIZE_MAX;
}
+ private static final long INTMAX_MIN = -9223372036854775808L;
/**
- * {@snippet :
+ * {@snippet lang=c :
* #define INTMAX_MIN -9223372036854775808
* }
*/
public static long INTMAX_MIN() {
- return -9223372036854775808L;
+ return INTMAX_MIN;
}
+ private static final long INTMAX_MAX = 9223372036854775807L;
/**
- * {@snippet :
+ * {@snippet lang=c :
* #define INTMAX_MAX 9223372036854775807
* }
*/
public static long INTMAX_MAX() {
- return 9223372036854775807L;
+ return INTMAX_MAX;
}
+ private static final long UINTMAX_MAX = -1L;
/**
- * {@snippet :
+ * {@snippet lang=c :
* #define UINTMAX_MAX -1
* }
*/
public static long UINTMAX_MAX() {
- return -1L;
+ return UINTMAX_MAX;
}
+ private static final int SIG_ATOMIC_MIN = (int)-2147483648L;
/**
- * {@snippet :
+ * {@snippet lang=c :
* #define SIG_ATOMIC_MIN -2147483648
* }
*/
public static int SIG_ATOMIC_MIN() {
- return (int)-2147483648L;
+ return SIG_ATOMIC_MIN;
}
+ private static final int SIG_ATOMIC_MAX = (int)2147483647L;
/**
- * {@snippet :
+ * {@snippet lang=c :
* #define SIG_ATOMIC_MAX 2147483647
* }
*/
public static int SIG_ATOMIC_MAX() {
- return (int)2147483647L;
+ return SIG_ATOMIC_MAX;
}
+ private static final int WINT_MIN = (int)0L;
/**
- * {@snippet :
+ * {@snippet lang=c :
* #define WINT_MIN 0
* }
*/
public static int WINT_MIN() {
- return (int)0L;
+ return WINT_MIN;
}
+ private static final int WINT_MAX = (int)65535L;
/**
- * {@snippet :
+ * {@snippet lang=c :
* #define WINT_MAX 65535
* }
*/
public static int WINT_MAX() {
- return (int)65535L;
+ return WINT_MAX;
}
+ private static final int WCHAR_MAX = (int)65535L;
/**
- * {@snippet :
+ * {@snippet lang=c :
* #define WCHAR_MAX 65535
* }
*/
public static int WCHAR_MAX() {
- return (int)65535L;
+ return WCHAR_MAX;
}
+ private static final int WCHAR_MIN = (int)0L;
/**
- * {@snippet :
+ * {@snippet lang=c :
* #define WCHAR_MIN 0
* }
*/
public static int WCHAR_MIN() {
- return (int)0L;
+ return WCHAR_MIN;
}
}
-
diff --git a/src/main/java/module-info.java b/src/main/java/module-info.java
index 8b5df33..91cecf6 100644
--- a/src/main/java/module-info.java
+++ b/src/main/java/module-info.java
@@ -1,4 +1,4 @@
-open module java4ever.binding {
+module java4ever.binding {
requires java.compiler;
requires transitive com.fasterxml.jackson.databind;
requires transitive deplant.commons;
@@ -8,6 +8,11 @@
requires com.fasterxml.jackson.module.paramnames;
requires java.net.http;
+ opens sdk.linux_x86_64;
+ opens sdk.macos_aarch64;
+ opens sdk.macos_x86_64;
+ opens sdk.win_x86_64;
+
exports tech.deplant.java4ever.binding;
exports tech.deplant.java4ever.binding.gql;
exports tech.deplant.java4ever.binding.loader;
@@ -15,5 +20,4 @@
exports tech.deplant.java4ever.binding.generator;
exports tech.deplant.java4ever.binding.generator.reference;
exports tech.deplant.java4ever.binding.generator.jtype;
- exports tech.deplant.java4ever.binding.ffi;
}
\ No newline at end of file
diff --git a/src/main/java/tech/deplant/java4ever/binding/AppEncryptionBox.java b/src/main/java/tech/deplant/java4ever/binding/AppEncryptionBox.java
new file mode 100644
index 0000000..030241c
--- /dev/null
+++ b/src/main/java/tech/deplant/java4ever/binding/AppEncryptionBox.java
@@ -0,0 +1,57 @@
+package tech.deplant.java4ever.binding;
+
+import com.fasterxml.jackson.databind.JsonNode;
+
+import java.util.concurrent.Executors;
+import java.util.concurrent.TimeUnit;
+
+public abstract class AppEncryptionBox implements AppObject {
+
+ @Override
+ public final void consumeParams(int contextId, long appRequestId, JsonNode jsonNode) throws EverSdkException {
+ try (var exec = Executors.newVirtualThreadPerTaskExecutor()) {
+ exec.submit(() -> {
+ try {
+ String requestMethod = jsonNode.get("type").asText();
+ if ("GetInfo".equals(requestMethod)) {
+ Crypto.EncryptionBoxInfo encryptionBox = getInfo();
+ var resultNode = JsonContext.SDK_JSON_MAPPER().valueToTree(new Crypto.ResultOfAppEncryptionBox.GetInfo(encryptionBox));
+ Client.resolveAppRequest(contextId, appRequestId, new Client.AppRequestResult.Ok(resultNode));
+ } else if ("Encrypt".equals(requestMethod)) {
+ String encrypted = encrypt(jsonNode.get("data").asText());
+ var resultNode = JsonContext.SDK_JSON_MAPPER().valueToTree(new Crypto.ResultOfAppEncryptionBox.Encrypt(encrypted));
+ Client.resolveAppRequest(contextId, appRequestId, new Client.AppRequestResult.Ok(resultNode));
+ } else if ("Decrypt".equals(requestMethod)) {
+ String decrypted = decrypt(jsonNode.get("data").asText());
+ var resultNode = JsonContext.SDK_JSON_MAPPER().valueToTree(new Crypto.ResultOfAppEncryptionBox.Decrypt(decrypted));
+ Client.resolveAppRequest(contextId, appRequestId, new Client.AppRequestResult.Ok(resultNode));
+ } else {
+ throw new IllegalStateException("Unexpected value: " + jsonNode.get("type").asText());
+ }
+ } catch (Exception e) {
+ try {
+ Client.resolveAppRequest(contextId,
+ appRequestId,
+ new Client.AppRequestResult.Error(e.getMessage()));
+ } catch (EverSdkException ex) {
+ throw new RuntimeException(ex);
+ }
+ }
+ });
+ exec.shutdown();
+ if (!exec.awaitTermination(60, TimeUnit.SECONDS)) {
+ Client.resolveAppRequest(contextId,
+ appRequestId,
+ new Client.AppRequestResult.Error("Unsuccessful completion"));
+ }
+ } catch (Exception e) {
+ Client.resolveAppRequest(contextId, appRequestId, new Client.AppRequestResult.Error(e.getMessage()));
+ }
+ }
+
+ public abstract Crypto.EncryptionBoxInfo getInfo();
+
+ public abstract String encrypt(String data);
+
+ public abstract String decrypt(String data);
+}
diff --git a/src/main/java/tech/deplant/java4ever/binding/AppObject.java b/src/main/java/tech/deplant/java4ever/binding/AppObject.java
index 36d00d5..209db98 100644
--- a/src/main/java/tech/deplant/java4ever/binding/AppObject.java
+++ b/src/main/java/tech/deplant/java4ever/binding/AppObject.java
@@ -1,4 +1,7 @@
package tech.deplant.java4ever.binding;
+import com.fasterxml.jackson.databind.JsonNode;
+
public interface AppObject {
+ void consumeParams(int contextId, long appRequestId, JsonNode jsonNode) throws EverSdkException;
}
diff --git a/src/main/java/tech/deplant/java4ever/binding/AppPasswordProvider.java b/src/main/java/tech/deplant/java4ever/binding/AppPasswordProvider.java
new file mode 100644
index 0000000..0cff54b
--- /dev/null
+++ b/src/main/java/tech/deplant/java4ever/binding/AppPasswordProvider.java
@@ -0,0 +1,47 @@
+package tech.deplant.java4ever.binding;
+
+import com.fasterxml.jackson.databind.JsonNode;
+
+import java.util.concurrent.Executors;
+import java.util.concurrent.TimeUnit;
+
+public abstract class AppPasswordProvider implements AppObject {
+
+ public abstract Crypto.ResultOfAppPasswordProvider.GetPassword getPassword(String encryptionPublicKey);
+
+ @Override
+ public final void consumeParams(int contextId, long appRequestId, JsonNode jsonNode) throws EverSdkException {
+ try (var exec = Executors.newVirtualThreadPerTaskExecutor()) {
+ exec.submit(() -> {
+ try {
+ String requestMethod = jsonNode.get("type").asText();
+ if ("GetPassword".equals(requestMethod)) {
+ Crypto.ResultOfAppPasswordProvider.GetPassword password = getPassword(jsonNode.get(
+ "encryptionPublicKey").asText());
+ var resultNode = JsonContext.SDK_JSON_MAPPER()
+ .valueToTree(password);
+ Client.resolveAppRequest(contextId, appRequestId, new Client.AppRequestResult.Ok(resultNode));
+ } else {
+ throw new IllegalStateException("Unexpected value: " + jsonNode.get("type").asText());
+ }
+ } catch (Exception e) {
+ try {
+ Client.resolveAppRequest(contextId,
+ appRequestId,
+ new Client.AppRequestResult.Error(e.getMessage()));
+ } catch (EverSdkException ex) {
+ throw new RuntimeException(ex);
+ }
+ }
+ });
+ exec.shutdown();
+ if (!exec.awaitTermination(60, TimeUnit.SECONDS)) {
+ Client.resolveAppRequest(contextId,
+ appRequestId,
+ new Client.AppRequestResult.Error("Unsuccessful completion"));
+ }
+ } catch (Exception e) {
+ Client.resolveAppRequest(contextId, appRequestId, new Client.AppRequestResult.Error(e.getMessage()));
+ }
+ }
+}
diff --git a/src/main/java/tech/deplant/java4ever/binding/AppSigningBox.java b/src/main/java/tech/deplant/java4ever/binding/AppSigningBox.java
new file mode 100644
index 0000000..653eb6e
--- /dev/null
+++ b/src/main/java/tech/deplant/java4ever/binding/AppSigningBox.java
@@ -0,0 +1,53 @@
+package tech.deplant.java4ever.binding;
+
+import com.fasterxml.jackson.databind.JsonNode;
+
+import java.util.Map;
+import java.util.concurrent.Executors;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicReference;
+
+import static tech.deplant.java4ever.binding.JsonContext.SDK_JSON_MAPPER;
+
+public abstract class AppSigningBox implements AppObject {
+
+ @Override
+ public final void consumeParams(int contextId, long appRequestId, JsonNode jsonNode) throws EverSdkException {
+ try (var exec = Executors.newVirtualThreadPerTaskExecutor()) {
+ exec.submit(() -> {
+ try {
+ String requestMethod = jsonNode.get("type").asText();
+ if ("Sign".equals(requestMethod)) {
+ String signature = sign(jsonNode.get("unsigned").asText());
+ var resultNode = JsonContext.SDK_JSON_MAPPER()
+ .valueToTree(new Crypto.ResultOfAppSigningBox.Sign(signature));
+ Client.resolveAppRequest(contextId, appRequestId, new Client.AppRequestResult.Ok(resultNode));
+ } else if ("GetPublicKey".equals(requestMethod)) {
+ String pk = getPublicKey();
+ var resultNode = JsonContext.SDK_JSON_MAPPER()
+ .valueToTree(new Crypto.ResultOfAppSigningBox.GetPublicKey(pk));
+ Client.resolveAppRequest(contextId, appRequestId, new Client.AppRequestResult.Ok(resultNode));
+ } else {
+ throw new IllegalStateException("Unexpected value: " + jsonNode.get("type").asText());
+ }
+ } catch(Exception e) {
+ try {
+ Client.resolveAppRequest(contextId, appRequestId, new Client.AppRequestResult.Error(e.getMessage()));
+ } catch (EverSdkException ex) {
+ throw new RuntimeException(ex);
+ }
+ }
+ });
+ exec.shutdown();
+ if (!exec.awaitTermination(60, TimeUnit.SECONDS)) {
+ Client.resolveAppRequest(contextId, appRequestId, new Client.AppRequestResult.Error("Unsuccessful completion"));
+ }
+ } catch (Exception e) {
+ Client.resolveAppRequest(contextId, appRequestId, new Client.AppRequestResult.Error(e.getMessage()));
+ }
+ }
+
+ public abstract String getPublicKey();
+
+ public abstract String sign(String unsigned);
+}
diff --git a/src/main/java/tech/deplant/java4ever/binding/EverSdk.java b/src/main/java/tech/deplant/java4ever/binding/EverSdk.java
index 8ea5b7b..76504ca 100644
--- a/src/main/java/tech/deplant/java4ever/binding/EverSdk.java
+++ b/src/main/java/tech/deplant/java4ever/binding/EverSdk.java
@@ -3,83 +3,198 @@
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonNode;
import tech.deplant.java4ever.binding.ffi.EverSdkContext;
-import tech.deplant.java4ever.binding.ffi.EverSdkSubscription;
import tech.deplant.java4ever.binding.ffi.NativeMethods;
import tech.deplant.java4ever.binding.loader.DefaultLoader;
import tech.deplant.java4ever.binding.loader.DefaultLoaderContext;
import tech.deplant.java4ever.binding.loader.LibraryLoader;
-import java.io.IOException;
-import java.util.HashMap;
import java.util.Map;
+import java.util.Objects;
import java.util.Optional;
+import java.util.concurrent.*;
import java.util.function.Consumer;
+/**
+ * The type Ever sdk.
+ */
public class EverSdk {
-
- public final static ScopedValue CONTEXT = ScopedValue.newInstance();
+ /**
+ * The constant LOG_FORMAT.
+ */
public final static String LOG_FORMAT = "CTX:%d REQ:%d FUNC:%s %s:%s";
private final static System.Logger logger = System.getLogger(EverSdk.class.getName());
- private final static Map contexts = new HashMap<>();
-
- public static EverSdkContext getContext(int contextId) {
- return contexts.get(contextId);
+ private final static Map contexts = new ConcurrentHashMap<>();
+ /**
+ * Timeout for the waiting of async operations.
+ */
+ public static long timeout = 600_000L;
+
+ /**
+ * Context config client . client config.
+ *
+ * @param contextId the context id
+ * @return the client . client config
+ */
+ public static Client.ClientConfig contextConfig(int contextId) {
+ return contexts.get(contextId).config();
}
+ /**
+ * Gets default workchain id.
+ *
+ * @param contextId the context id
+ * @return the default workchain id
+ */
public static long getDefaultWorkchainId(int contextId) {
- return switch (getContext(contextId).config().abi()) {
+ return switch (contextConfig(contextId).abi()) {
+ case Client.AbiConfig abiConfig -> Objects.requireNonNullElse(abiConfig.workchain(), 0L);
case null -> 0L;
- case Client.AbiConfig abiConfig -> Optional.ofNullable(abiConfig.workchain()).orElse(0L);
};
}
+ /**
+ * Load.
+ */
public static void load() {
load(DefaultLoaderContext.SINGLETON(ClassLoader.getSystemClassLoader()));
}
+ /**
+ * Load.
+ *
+ * @param loader the loader
+ */
public static void load(LibraryLoader loader) {
loader.load();
}
- public static T call(int ctxId,
- String functionName,
- P functionInputs,
- Class outputClass) throws EverSdkException {
- return EverSdk.getContext(ctxId).call(functionName, functionInputs, outputClass);
+ /**
+ * Async method to call EVER-SDK that do not return responses. It will response as soon as call is sent.
+ *
+ * @param function params type parameter
+ * @param contextId config context id
+ * @param functionName EVER-SDK function name
+ * @param functionInputs EVER-SDK function inputs
+ * @return the completable future with generic result type
+ * @throws EverSdkException the ever sdk exception
+ */
+ public static
CompletableFuture asyncVoid(final int contextId,
+ final String functionName,
+ final P functionInputs) throws EverSdkException {
+ return contexts.get(contextId).callAsync(functionName, functionInputs, Void.class, null, null);
+ }
+
+
+ /**
+ * Async method to get future result from EVER-SDK
+ *
+ * @param result type parameter
+ * @param function params type parameter
+ * @param contextId config context id
+ * @param functionName EVER-SDK function name
+ * @param functionInputs EVER-SDK function inputs
+ * @param outputClass EVER-SDK output class
+ * @return the completable future with generic result type
+ * @throws EverSdkException the ever sdk exception
+ */
+ public static CompletableFuture async(final int contextId,
+ final String functionName,
+ final P functionInputs,
+ final Class outputClass) throws EverSdkException {
+ return contexts.get(contextId).callAsync(functionName, functionInputs, outputClass, null, null);
}
- public static T callEvent(int ctxId, String functionName,
- P params,
- EverSdkSubscription subscription,
- Class resultClass) throws EverSdkException {
- return EverSdk.getContext(ctxId).callEvent(functionName, params, subscription, resultClass);
+ /**
+ * Async method to get future result from EVER-SDK with additional parameter to receive recurring events from EVER-SDK
+ *
+ * @param result type parameter
+ * @param function params type parameter
+ * @param contextId config context id
+ * @param functionName EVER-SDK function name
+ * @param functionInputs EVER-SDK function inputs
+ * @param outputClass EVER-SDK output class
+ * @param eventConsumer Java Consumer (lambda-function) that accepts JsonNode object returned by EVER-SDK
+ * @return the completable future with generic result type
+ * @throws EverSdkException the ever sdk exception
+ */
+ public static CompletableFuture asyncCallback(final int contextId,
+ final String functionName,
+ final P functionInputs,
+ final Class outputClass,
+ Consumer eventConsumer) throws EverSdkException {
+ return contexts.get(contextId).callAsync(functionName, functionInputs, outputClass, eventConsumer, null);
}
- public static void callVoid(int ctxId, String functionName, P params) throws EverSdkException {
- EverSdk.getContext(ctxId).callVoid(functionName, params);
+ /**
+ * Async method to get future result from EVER-SDK with additional parameter to receive AppObject callbacks.
+ *
+ * @param result type parameter
+ * @param function params type parameter
+ * @param contextId config context id
+ * @param functionName EVER-SDK function name
+ * @param functionInputs EVER-SDK function inputs
+ * @param outputClass EVER-SDK output class
+ * @param appObject Pointer to AppObject implementation
+ * @return the completable future with generic result type
+ * @throws EverSdkException the ever sdk exception
+ */
+ public static CompletableFuture asyncAppObject(final int contextId,
+ final String functionName,
+ final P functionInputs,
+ final Class outputClass,
+ AppObject appObject) throws EverSdkException {
+ return contexts.get(contextId).callAsync(functionName, functionInputs, outputClass, null, appObject);
}
- public static T callAppObject(int ctxId,
- String functionName,
- P params,
- A appObject,
- Class clazz) throws EverSdkException {
- return EverSdk.getContext(ctxId).callAppObject(functionName, params, appObject, clazz);
+ /**
+ * Destroy.
+ *
+ * @param contextId the context id
+ */
+ public static void destroy(int contextId) {
+ NativeMethods.tcDestroyContext(contextId);
}
- public static Optional createDefault() throws JsonProcessingException {
+ /**
+ * Create default int.
+ *
+ * @return the int
+ * @throws EverSdkException the ever sdk exception
+ */
+ public static int createDefault() throws EverSdkException {
return createWithJson("{}");
}
- public static Builder builder() throws JsonProcessingException {
+ /**
+ * Creates a builder object that is used to precisely configure EVER-SDK before creating new context.
+ * After specifying all needed configs in builder style, call build() to finish and create context_id
+ * with EVER-SDK.
+ *
+ * @return the builder
+ */
+ public static Builder builder() {
return new Builder();
}
- public static Optional createWithEndpoint(String endpoint) throws JsonProcessingException {
+ /**
+ * Helper method to create new context with only one setting - endpoint of the blockchain.
+ *
+ * @param endpoint the endpoint of the blockchain.
+ * @return context_id for future usage
+ * @throws EverSdkException the ever sdk exception
+ */
+ public static int createWithEndpoint(String endpoint) throws EverSdkException {
return createWithJson("{ \"network\":{ \"endpoints\": [\"%s\"] } }".formatted(endpoint));
}
- public static Optional createWithConfig(Client.ClientConfig config) throws JsonProcessingException {
+ /**
+ * Helper method to create new context from existing config object
+ *
+ * @param config config object
+ * @return context_id for future usage
+ * @throws EverSdkException the ever sdk exception
+ */
+ public static int createWithConfig(Client.ClientConfig config) throws EverSdkException {
var mergedConfig = new Client.ClientConfig(new Client.BindingConfig(DefaultLoader.BINDING_LIBRARY_NAME,
DefaultLoader.BINDING_LIBRARY_VERSION),
config.network(),
@@ -88,31 +203,135 @@ public static Optional createWithConfig(Client.ClientConfig config) thr
config.boc(),
config.proofs(),
config.localStoragePath());
- var mergedJson = JsonContext.SDK_JSON_MAPPER().writeValueAsString(mergedConfig);
- //logger.log(System.Logger.Level.TRACE,
- // () -> "FUNC:tc_create_context JSON:%s".formatted(configJson));
- final var createContextResponse = JsonContext.SDK_JSON_MAPPER()
- .readValue(NativeMethods.tcCreateContext(mergedJson),
- ResultOfCreateContext.class);
- Optional contextId = Optional.ofNullable(createContextResponse.result());
- if (contextId.isEmpty() || contextId.get() < 1) {
- logger.log(System.Logger.Level.ERROR, "sdk.create_context failed!");
- } else {
- int ctxId = contextId.get();
- contexts.put(ctxId, new EverSdkContext(ctxId, mergedConfig));
- logger.log(System.Logger.Level.TRACE,
- () -> "FUNC:tc_create_context CTX:%d JSON:%s".formatted(ctxId, mergedJson));
- }
- return contextId;
+ String resultString = "";
+ ResultOfCreateContext createContextResponse;
+ try {
+ String mergedJson = JsonContext.SDK_JSON_MAPPER().writeValueAsString(mergedConfig);
+ try {
+ resultString = NativeMethods.tcCreateContext(mergedJson);
+ createContextResponse = JsonContext.SDK_JSON_MAPPER()
+ .readValue(resultString, ResultOfCreateContext.class);
+ Optional contextId = Optional.ofNullable(createContextResponse.result());
+ if (contextId.isEmpty() || contextId.get() < 1) {
+ logger.log(System.Logger.Level.ERROR, () -> "FUNC:sdk.tc_create_context result is empty!");
+ throw new EverSdkException(new EverSdkException.ErrorResult(-502,
+ "FUNC:sdk.tc_create_context result is empty!"));
+ }
+ int ctxId = contextId.get();
+ contexts.put(ctxId, new EverSdkContext(ctxId, mergedConfig));
+ logger.log(System.Logger.Level.TRACE,
+ () -> "FUNC:sdk.tc_create_context CTX:%d JSON:%s".formatted(ctxId, mergedJson));
+ return ctxId;
+ } catch (JsonProcessingException e) {
+ final String finalResultString = resultString;
+ logger.log(System.Logger.Level.ERROR,
+ () -> "FUNC:sdk.tc_create_context request deserialization failed! Exception: %s Result: %s".formatted(
+ e,
+ finalResultString));
+ throw new EverSdkException(new EverSdkException.ErrorResult(-501,
+ "FUNC:sdk.tc_create_context request deserialization failed!"),
+ e.getCause());
+ }
+ } catch (JsonProcessingException e) {
+ logger.log(System.Logger.Level.ERROR,
+ () -> "EVER-SDK tc_create_context request serialization failed! Exception: %s Config: %s".formatted(
+ e,
+ mergedConfig));
+ throw new EverSdkException(new EverSdkException.ErrorResult(-502,
+ "EVER-SDK tc_create_context request serialization failed!"),
+ e.getCause());
+ }
+ }
+
+ /**
+ * Helper method to create new context from existing JSON config
+ *
+ * @param configJson json text that contains config parameters
+ * @return context_id for future usage
+ * @throws EverSdkException the ever sdk exception
+ */
+ public static int createWithJson(String configJson) throws EverSdkException {
+ try {
+ return createWithConfig(JsonContext.SDK_JSON_MAPPER().readValue(configJson, Client.ClientConfig.class));
+ } catch (JsonProcessingException e) {
+ logger.log(System.Logger.Level.ERROR,
+ () -> "EVER-SDK tc_create_context request serialization failed! Exception: %s Config: %s".formatted(
+ e,
+ configJson));
+ throw new EverSdkException(new EverSdkException.ErrorResult(-502,
+ "EVER-SDK tc_create_context request serialization failed!"),
+ e.getCause());
+ }
}
- public static Optional createWithJson(String configJson) throws JsonProcessingException {
- return createWithConfig(JsonContext.SDK_JSON_MAPPER().readValue(configJson, Client.ClientConfig.class));
+ public static Processing.ResultOfProcessMessage sendExternalMessage(int contextId,
+ String dstAddress,
+ Abi.ABI abi,
+ String stateInit,
+ String messageBody,
+ String optionalSrcAddress) throws EverSdkException {
+ var message = EverSdk.await(Boc.encodeExternalInMessage(contextId,
+ optionalSrcAddress,
+ dstAddress,
+ stateInit,
+ messageBody,
+ null)).message();
+
+ var request = EverSdk.await(Processing.sendMessage(contextId, message, abi, false, null));
+
+ return EverSdk.await(Processing.waitForTransaction(contextId,
+ abi,
+ message,
+ request.shardBlockId(),
+ false,
+ request.sendingEndpoints(),
+ null));
}
+ /**
+ * Helper method that awaits for completable future for timeout that
+ * you can specify by issuing EverSdk.timeout = 60_000L.
+ * All Java Futures possible errors are wrapped in EverSdkException. If you want to catch these errors,
+ * catch errors -400, -408, -500
+ *
+ * @param result type parameter
+ * @param functionOutputs future result to wait for
+ * @return returns result of the given type
+ * @throws EverSdkException the ever sdk exception
+ */
+ public static T await(CompletableFuture functionOutputs) throws EverSdkException {
+ try {
+ return functionOutputs.get(timeout, TimeUnit.MILLISECONDS);
+ } catch (InterruptedException ex3) {
+ logger.log(System.Logger.Level.ERROR, () -> "EVER-SDK Call interrupted! %s".formatted(ex3.toString()));
+ throw new EverSdkException(new EverSdkException.ErrorResult(-400, "EVER-SDK call interrupted!"),
+ ex3.getCause());
+ } catch (TimeoutException ex4) {
+ logger.log(System.Logger.Level.ERROR,
+ () -> "EVER-SDK Call expired on Timeout! %s".formatted(ex4.toString()));
+ throw new EverSdkException(new EverSdkException.ErrorResult(-408, "EVER-SDK call expired on Timeout!"),
+ ex4.getCause());
+ } catch (ExecutionException e) {
+ if (e.getCause() instanceof EverSdkException everEx) {
+ throw everEx;
+ } else {
+ logger.log(System.Logger.Level.ERROR,
+ () -> "EVER-SDK Call unknown execution exception! %s".formatted(e.toString()));
+ throw new EverSdkException(new EverSdkException.ErrorResult(-500, "EVER-SDK call expired on Timeout!"),
+ e.getCause());
+ }
+ }
+ }
+
+ /**
+ * The type Result of create context.
+ */
public record ResultOfCreateContext(Integer result, String error) {
}
+ /**
+ * The type Builder.
+ */
public static class Builder {
private Boolean cacheInLocalStorage = null; // true
@@ -147,160 +366,319 @@ public static class Builder {
private Long nextRempStatusTimeout = null; // 5000L;
private Long signatureId = null;
+ /**
+ * Instantiates a new Builder.
+ */
public Builder() {
}
+ /**
+ * Local storage path builder.
+ *
+ * @param localStoragePath the local storage path
+ * @return the builder
+ */
+ public Builder localStoragePath(String localStoragePath) {
+ this.localStoragePath = localStoragePath;
+ return this;
+ }
+
+ /**
+ * Proofs cache in local storage builder.
+ *
+ * @param cacheInLocalStorage the cache in local storage
+ * @return the builder
+ */
public Builder proofsCacheInLocalStorage(boolean cacheInLocalStorage) {
this.cacheInLocalStorage = cacheInLocalStorage;
return this;
}
+ /**
+ * Network max reconnect timeout builder.
+ *
+ * @param maxReconnectTimeout the max reconnect timeout
+ * @return the builder
+ */
public Builder networkMaxReconnectTimeout(Long maxReconnectTimeout) {
this.maxReconnectTimeout = maxReconnectTimeout;
return this;
}
+ /**
+ * Network sending endpoint count builder.
+ *
+ * @param sendingEndpointCount the sending endpoint count
+ * @return the builder
+ */
public Builder networkSendingEndpointCount(Integer sendingEndpointCount) {
this.sendingEndpointCount = sendingEndpointCount;
return this;
}
+ /**
+ * Network latency detection interval builder.
+ *
+ * @param latencyDetectionInterval the latency detection interval
+ * @return the builder
+ */
public Builder networkLatencyDetectionInterval(Long latencyDetectionInterval) {
this.latencyDetectionInterval = latencyDetectionInterval;
return this;
}
+ /**
+ * Network max latency builder.
+ *
+ * @param maxLatency the max latency
+ * @return the builder
+ */
public Builder networkMaxLatency(Long maxLatency) {
this.maxLatency = maxLatency;
return this;
}
+ /**
+ * Network query timeout builder.
+ *
+ * @param queryTimeout the query timeout
+ * @return the builder
+ */
public Builder networkQueryTimeout(Long queryTimeout) {
this.queryTimeout = queryTimeout;
return this;
}
+ /**
+ * Network queries protocol builder.
+ *
+ * @param queriesProtocol the queries protocol
+ * @return the builder
+ */
public Builder networkQueriesProtocol(Client.NetworkQueriesProtocol queriesProtocol) {
this.queriesProtocol = queriesProtocol;
return this;
}
+ /**
+ * Network first remp status timeout builder.
+ *
+ * @param firstRempStatusTimeout the first remp status timeout
+ * @return the builder
+ */
public Builder networkFirstRempStatusTimeout(Long firstRempStatusTimeout) {
this.firstRempStatusTimeout = firstRempStatusTimeout;
return this;
}
+ /**
+ * Network next remp status timeout builder.
+ *
+ * @param nextRempStatusTimeout the next remp status timeout
+ * @return the builder
+ */
public Builder networkNextRempStatusTimeout(Long nextRempStatusTimeout) {
this.nextRempStatusTimeout = nextRempStatusTimeout;
return this;
}
+ /**
+ * Network endpoints builder.
+ *
+ * @param endpoints the endpoints
+ * @return the builder
+ */
public Builder networkEndpoints(String... endpoints) {
this.endpoints = endpoints;
return this;
}
+ /**
+ * Network server address builder.
+ *
+ * @param server_address the server address
+ * @return the builder
+ */
public Builder networkServerAddress(String server_address) {
this.serverAddress = server_address;
return this;
}
+ /**
+ * Network retries count builder.
+ *
+ * @param network_retries_count the network retries count
+ * @return the builder
+ */
public Builder networkRetriesCount(Integer network_retries_count) {
this.networkRetriesCount = network_retries_count;
return this;
}
+ /**
+ * Network message retries count builder.
+ *
+ * @param message_retries_count the message retries count
+ * @return the builder
+ */
public Builder networkMessageRetriesCount(Integer message_retries_count) {
this.messageRetriesCount = message_retries_count;
return this;
}
+ /**
+ * Network message processing timeout builder.
+ *
+ * @param message_processing_timeout the message processing timeout
+ * @return the builder
+ */
public Builder networkMessageProcessingTimeout(Long message_processing_timeout) {
this.messageProcessingTimeout = message_processing_timeout;
return this;
}
+ /**
+ * Network wait for timeout builder.
+ *
+ * @param wait_for_timeout the wait for timeout
+ * @return the builder
+ */
public Builder networkWaitForTimeout(Long wait_for_timeout) {
this.waitForTimeout = wait_for_timeout;
return this;
}
+ /**
+ * Network out of sync threshold builder.
+ *
+ * @param out_of_sync_threshold the out of sync threshold
+ * @return the builder
+ */
public Builder networkOutOfSyncThreshold(Long out_of_sync_threshold) {
this.outOfSyncThreshold = out_of_sync_threshold;
return this;
}
+ /**
+ * Network reconnect timeout builder.
+ *
+ * @param reconnect_timeout the reconnect timeout
+ * @return the builder
+ */
public Builder networkReconnectTimeout(Long reconnect_timeout) {
this.reconnectTimeout = reconnect_timeout;
return this;
}
+ /**
+ * Network signature id builder.
+ *
+ * @param signatureId the signature id
+ * @return the builder
+ */
public Builder networkSignatureId(Long signatureId) {
this.signatureId = signatureId;
return this;
}
+ /**
+ * Network access key builder.
+ *
+ * @param access_key the access key
+ * @return the builder
+ */
public Builder networkAccessKey(String access_key) {
this.accessKey = access_key;
return this;
}
- //cripto
+ /**
+ * Crypto mnemonic dictionary builder.
+ *
+ * @param mnemonic_dictionary the mnemonic dictionary
+ * @return the builder
+ */
+//cripto
public Builder cryptoMnemonicDictionary(Crypto.MnemonicDictionary mnemonic_dictionary) {
this.mnemonicDictionary = mnemonic_dictionary;
return this;
}
+ /**
+ * Crypto mnemonic word count builder.
+ *
+ * @param mnemonic_word_count the mnemonic word count
+ * @return the builder
+ */
public Builder cryptoMnemonicWordCount(Integer mnemonic_word_count) {
this.mnemonicWordCount = mnemonic_word_count;
return this;
}
+ /**
+ * Crypto hdkey derivation path builder.
+ *
+ * @param hdkey_derivation_path the hdkey derivation path
+ * @return the builder
+ */
public Builder cryptoHdkeyDerivationPath(String hdkey_derivation_path) {
this.hdkeyDerivationPath = hdkey_derivation_path;
return this;
}
- //abi
+ /**
+ * Abi workchain builder.
+ *
+ * @param workchain the workchain
+ * @return the builder
+ */
+//abi
public Builder abiWorkchain(Long workchain) {
this.workchain = workchain;
return this;
}
+ /**
+ * Abi message expiration timeout builder.
+ *
+ * @param message_expiration_timeout the message expiration timeout
+ * @return the builder
+ */
public Builder abiMessageExpirationTimeout(Long message_expiration_timeout) {
this.messageExpirationTimeout = message_expiration_timeout;
return this;
}
+ /**
+ * Abi message expiration timeout grow factor builder.
+ *
+ * @param message_expiration_timeout_grow_factor the message expiration timeout grow factor
+ * @return the builder
+ */
public Builder abiMessageExpirationTimeoutGrowFactor(Long message_expiration_timeout_grow_factor) {
this.messageExpirationTimeoutGrowFactor = message_expiration_timeout_grow_factor;
return this;
}
+ /**
+ * Boc cache max size builder.
+ *
+ * @param cacheMaxSize the cache max size
+ * @return the builder
+ */
public Builder bocCacheMaxSize(Long cacheMaxSize) {
this.cacheMaxSize = cacheMaxSize;
return this;
}
private Client.NetworkConfig buildNetworkConfig() {
- if (this.serverAddress == null &&
- this.endpoints == null &&
- this.networkRetriesCount == null &&
- this.maxReconnectTimeout == null &&
- this.reconnectTimeout == null &&
- this.messageRetriesCount == null &&
- this.messageProcessingTimeout == null &&
- this.waitForTimeout == null &&
- this.outOfSyncThreshold == null &&
- this.sendingEndpointCount == null &&
- this.latencyDetectionInterval == null &&
- this.maxLatency == null &&
- this.queryTimeout == null &&
- this.queriesProtocol == null &&
- this.firstRempStatusTimeout == null &&
- this.nextRempStatusTimeout == null &&
- this.signatureId == null &&
- this.accessKey == null) {
+ if (this.serverAddress == null && this.endpoints == null && this.networkRetriesCount == null &&
+ this.maxReconnectTimeout == null && this.reconnectTimeout == null && this.messageRetriesCount == null &&
+ this.messageProcessingTimeout == null && this.waitForTimeout == null &&
+ this.outOfSyncThreshold == null && this.sendingEndpointCount == null &&
+ this.latencyDetectionInterval == null && this.maxLatency == null && this.queryTimeout == null &&
+ this.queriesProtocol == null && this.firstRempStatusTimeout == null &&
+ this.nextRempStatusTimeout == null && this.signatureId == null && this.accessKey == null) {
return null;
} else {
return new Client.NetworkConfig(this.serverAddress,
@@ -325,9 +703,7 @@ private Client.NetworkConfig buildNetworkConfig() {
}
private Client.CryptoConfig buildCryptoConfig() {
- if (this.mnemonicDictionary == null &&
- this.mnemonicWordCount == null &&
- this.hdkeyDerivationPath == null) {
+ if (this.mnemonicDictionary == null && this.mnemonicWordCount == null && this.hdkeyDerivationPath == null) {
return null;
} else {
return new Client.CryptoConfig(this.mnemonicDictionary,
@@ -337,9 +713,8 @@ private Client.CryptoConfig buildCryptoConfig() {
}
private Client.AbiConfig buildAbiConfig() {
- if (this.workchain == null &&
- this.messageExpirationTimeout == null &&
- this.messageExpirationTimeoutGrowFactor == null) {
+ if (this.workchain == null && this.messageExpirationTimeout == null &&
+ this.messageExpirationTimeoutGrowFactor == null) {
return null;
} else {
return new Client.AbiConfig(this.workchain,
@@ -364,7 +739,13 @@ private Client.ProofsConfig buildProofsConfig() {
}
}
- public Optional build() throws IOException {
+ /**
+ * Build int.
+ *
+ * @return the int
+ * @throws EverSdkException the ever sdk exception
+ */
+ public int build() throws EverSdkException {
var config = new Client.ClientConfig(new Client.BindingConfig("java4ever", "3.0.0"),
buildNetworkConfig(),
buildCryptoConfig(),
diff --git a/src/main/java/tech/deplant/java4ever/binding/JsonContext.java b/src/main/java/tech/deplant/java4ever/binding/JsonContext.java
index de42782..985caef 100644
--- a/src/main/java/tech/deplant/java4ever/binding/JsonContext.java
+++ b/src/main/java/tech/deplant/java4ever/binding/JsonContext.java
@@ -22,7 +22,8 @@ public class JsonContext {
private static ObjectMapper lazySdkMapper;
private static ObjectMapper lazyAbiMapper;
- private static final TypeReference