diff --git a/generator/api.index.txt b/generator/api.index.txt index 464d314..603d693 100644 --- a/generator/api.index.txt +++ b/generator/api.index.txt @@ -1,4 +1,4 @@ -1.37.1 +1.37.2 TYPES client.ClientErrorCode client.ClientError diff --git a/generator/api.json b/generator/api.json index cbcb386..512b525 100644 --- a/generator/api.json +++ b/generator/api.json @@ -1,5 +1,5 @@ { - "version": "1.37.1", + "version": "1.37.2", "modules": [ { "name": "client", @@ -540,7 +540,7 @@ "type": "String" }, "summary": "Access key to GraphQL API.", - "description": "You can specify here Evercloud project secret ot serialized JWT." + "description": "You can specify here Basic Auth secret (Evercloud project secret) in hex string\nor serialized JWT in base64 string.\nWill be passed on as Authorization: Basic ... or Authorization: Bearer ... header." } ], "summary": null, @@ -1310,29 +1310,61 @@ "enum_types": [ { "name": "AES", - "type": "Ref", - "ref_name": "crypto.AesParamsEB", + "type": "Struct", + "struct_fields": [ + { + "name": "value", + "type": "Ref", + "ref_name": "crypto.AesParamsEB", + "summary": null, + "description": null + } + ], "summary": null, "description": null }, { "name": "ChaCha20", - "type": "Ref", - "ref_name": "crypto.ChaCha20ParamsEB", + "type": "Struct", + "struct_fields": [ + { + "name": "value", + "type": "Ref", + "ref_name": "crypto.ChaCha20ParamsEB", + "summary": null, + "description": null + } + ], "summary": null, "description": null }, { "name": "NaclBox", - "type": "Ref", - "ref_name": "crypto.NaclBoxParamsEB", + "type": "Struct", + "struct_fields": [ + { + "name": "value", + "type": "Ref", + "ref_name": "crypto.NaclBoxParamsEB", + "summary": null, + "description": null + } + ], "summary": null, "description": null }, { "name": "NaclSecretBox", - "type": "Ref", - "ref_name": "crypto.NaclSecretBoxParamsEB", + "type": "Struct", + "struct_fields": [ + { + "name": "value", + "type": "Ref", + "ref_name": "crypto.NaclSecretBoxParamsEB", + "summary": null, + "description": null + } + ], "summary": null, "description": null } @@ -1588,22 +1620,46 @@ "enum_types": [ { "name": "ChaCha20", - "type": "Ref", - "ref_name": "crypto.ChaCha20ParamsCB", + "type": "Struct", + "struct_fields": [ + { + "name": "value", + "type": "Ref", + "ref_name": "crypto.ChaCha20ParamsCB", + "summary": null, + "description": null + } + ], "summary": null, "description": null }, { "name": "NaclBox", - "type": "Ref", - "ref_name": "crypto.NaclBoxParamsCB", + "type": "Struct", + "struct_fields": [ + { + "name": "value", + "type": "Ref", + "ref_name": "crypto.NaclBoxParamsCB", + "summary": null, + "description": null + } + ], "summary": null, "description": null }, { "name": "NaclSecretBox", - "type": "Ref", - "ref_name": "crypto.NaclSecretBoxParamsCB", + "type": "Struct", + "struct_fields": [ + { + "name": "value", + "type": "Ref", + "ref_name": "crypto.NaclSecretBoxParamsCB", + "summary": null, + "description": null + } + ], "summary": null, "description": null } diff --git a/runtimes/linux-x64/native/libton_client.so b/runtimes/linux-x64/native/libton_client.so index d9fb2a6..53a577e 100644 Binary files a/runtimes/linux-x64/native/libton_client.so and b/runtimes/linux-x64/native/libton_client.so differ diff --git a/runtimes/osx-x64/native/libton_client.dylib b/runtimes/osx-x64/native/libton_client.dylib index 26981ee..c06b6f4 100644 Binary files a/runtimes/osx-x64/native/libton_client.dylib and b/runtimes/osx-x64/native/libton_client.dylib differ diff --git a/runtimes/win-x64/native/ton_client.dll b/runtimes/win-x64/native/ton_client.dll index e8807d0..1ae2f5f 100644 Binary files a/runtimes/win-x64/native/ton_client.dll and b/runtimes/win-x64/native/ton_client.dll differ diff --git a/runtimes/win-x86/native/ton_client.dll b/runtimes/win-x86/native/ton_client.dll index da2c066..6643d67 100644 Binary files a/runtimes/win-x86/native/ton_client.dll and b/runtimes/win-x86/native/ton_client.dll differ diff --git a/src/TonClient/Modules/AbiModule.cs b/src/TonClient/Modules/AbiModule.cs index 09d4bb4..3c9854a 100644 --- a/src/TonClient/Modules/AbiModule.cs +++ b/src/TonClient/Modules/AbiModule.cs @@ -6,7 +6,7 @@ using TonSdk.Modules; /* -* TON API version 1.37.1, abi module. +* TON API version 1.37.2, abi module. * THIS FILE WAS GENERATED AUTOMATICALLY. */ diff --git a/src/TonClient/Modules/BocModule.cs b/src/TonClient/Modules/BocModule.cs index bd4f6a5..b0e5e5f 100644 --- a/src/TonClient/Modules/BocModule.cs +++ b/src/TonClient/Modules/BocModule.cs @@ -5,7 +5,7 @@ using TonSdk.Modules; /* -* TON API version 1.37.1, boc module. +* TON API version 1.37.2, boc module. * THIS FILE WAS GENERATED AUTOMATICALLY. */ diff --git a/src/TonClient/Modules/ClientModule.cs b/src/TonClient/Modules/ClientModule.cs index cc425f5..528467f 100644 --- a/src/TonClient/Modules/ClientModule.cs +++ b/src/TonClient/Modules/ClientModule.cs @@ -6,7 +6,7 @@ using TonSdk.Modules; /* -* TON API version 1.37.1, client module. +* TON API version 1.37.2, client module. * THIS FILE WAS GENERATED AUTOMATICALLY. */ @@ -211,7 +211,9 @@ public class NetworkConfig public uint? NextRempStatusTimeout { get; set; } /// - /// You can specify here Evercloud project secret ot serialized JWT. + /// You can specify here Basic Auth secret (Evercloud project secret) in hex string + /// or serialized JWT in base64 string. + /// Will be passed on as Authorization: Basic ... or Authorization: Bearer ... header. /// [JsonProperty("access_key", NullValueHandling = NullValueHandling.Ignore)] public string AccessKey { get; set; } diff --git a/src/TonClient/Modules/CryptoModule.cs b/src/TonClient/Modules/CryptoModule.cs index f8e25aa..5763348 100644 --- a/src/TonClient/Modules/CryptoModule.cs +++ b/src/TonClient/Modules/CryptoModule.cs @@ -6,7 +6,7 @@ using TonSdk.Modules; /* -* TON API version 1.37.1, crypto module. +* TON API version 1.37.2, crypto module. * THIS FILE WAS GENERATED AUTOMATICALLY. */ @@ -82,48 +82,26 @@ public abstract class EncryptionAlgorithm { public class AES : EncryptionAlgorithm { - [JsonProperty("mode", NullValueHandling = NullValueHandling.Ignore)] - [JsonConverter(typeof(StringEnumConverter))] - public CipherMode Mode { get; set; } - - [JsonProperty("key", NullValueHandling = NullValueHandling.Ignore)] - public string Key { get; set; } - - [JsonProperty("iv", NullValueHandling = NullValueHandling.Ignore)] - public string Iv { get; set; } + [JsonProperty("value", NullValueHandling = NullValueHandling.Ignore)] + public AesParamsEB Value { get; set; } } public class ChaCha20 : EncryptionAlgorithm { - /// - /// Must be encoded with `hex`. - /// - [JsonProperty("nonce", NullValueHandling = NullValueHandling.Ignore)] - public string Nonce { get; set; } + [JsonProperty("value", NullValueHandling = NullValueHandling.Ignore)] + public ChaCha20ParamsEB Value { get; set; } } public class NaclBox : EncryptionAlgorithm { - /// - /// Must be encoded with `hex`. - /// - [JsonProperty("their_public", NullValueHandling = NullValueHandling.Ignore)] - public string TheirPublic { get; set; } - - /// - /// Must be encoded with `hex`. - /// - [JsonProperty("nonce", NullValueHandling = NullValueHandling.Ignore)] - public string Nonce { get; set; } + [JsonProperty("value", NullValueHandling = NullValueHandling.Ignore)] + public NaclBoxParamsEB Value { get; set; } } public class NaclSecretBox : EncryptionAlgorithm { - /// - /// Nonce in `hex` - /// - [JsonProperty("nonce", NullValueHandling = NullValueHandling.Ignore)] - public string Nonce { get; set; } + [JsonProperty("value", NullValueHandling = NullValueHandling.Ignore)] + public NaclSecretBoxParamsEB Value { get; set; } } } @@ -270,35 +248,20 @@ public abstract class BoxEncryptionAlgorithm { public class ChaCha20 : BoxEncryptionAlgorithm { - /// - /// Must be encoded with `hex`. - /// - [JsonProperty("nonce", NullValueHandling = NullValueHandling.Ignore)] - public string Nonce { get; set; } + [JsonProperty("value", NullValueHandling = NullValueHandling.Ignore)] + public ChaCha20ParamsCB Value { get; set; } } public class NaclBox : BoxEncryptionAlgorithm { - /// - /// Must be encoded with `hex`. - /// - [JsonProperty("their_public", NullValueHandling = NullValueHandling.Ignore)] - public string TheirPublic { get; set; } - - /// - /// Must be encoded with `hex`. - /// - [JsonProperty("nonce", NullValueHandling = NullValueHandling.Ignore)] - public string Nonce { get; set; } + [JsonProperty("value", NullValueHandling = NullValueHandling.Ignore)] + public NaclBoxParamsCB Value { get; set; } } public class NaclSecretBox : BoxEncryptionAlgorithm { - /// - /// Nonce in `hex` - /// - [JsonProperty("nonce", NullValueHandling = NullValueHandling.Ignore)] - public string Nonce { get; set; } + [JsonProperty("value", NullValueHandling = NullValueHandling.Ignore)] + public NaclSecretBoxParamsCB Value { get; set; } } } diff --git a/src/TonClient/Modules/DebotModule.cs b/src/TonClient/Modules/DebotModule.cs index faca16b..14c0389 100644 --- a/src/TonClient/Modules/DebotModule.cs +++ b/src/TonClient/Modules/DebotModule.cs @@ -5,7 +5,7 @@ using TonSdk.Modules; /* -* TON API version 1.37.1, debot module. +* TON API version 1.37.2, debot module. * THIS FILE WAS GENERATED AUTOMATICALLY. */ diff --git a/src/TonClient/Modules/NetModule.cs b/src/TonClient/Modules/NetModule.cs index d78469c..c11f3ad 100644 --- a/src/TonClient/Modules/NetModule.cs +++ b/src/TonClient/Modules/NetModule.cs @@ -6,7 +6,7 @@ using TonSdk.Modules; /* -* TON API version 1.37.1, net module. +* TON API version 1.37.2, net module. * THIS FILE WAS GENERATED AUTOMATICALLY. */ diff --git a/src/TonClient/Modules/ProcessingModule.cs b/src/TonClient/Modules/ProcessingModule.cs index 32b5656..b841928 100644 --- a/src/TonClient/Modules/ProcessingModule.cs +++ b/src/TonClient/Modules/ProcessingModule.cs @@ -5,7 +5,7 @@ using TonSdk.Modules; /* -* TON API version 1.37.1, processing module. +* TON API version 1.37.2, processing module. * THIS FILE WAS GENERATED AUTOMATICALLY. */ diff --git a/src/TonClient/Modules/ProofsModule.cs b/src/TonClient/Modules/ProofsModule.cs index fe5a785..cff6c08 100644 --- a/src/TonClient/Modules/ProofsModule.cs +++ b/src/TonClient/Modules/ProofsModule.cs @@ -5,7 +5,7 @@ using TonSdk.Modules; /* -* TON API version 1.37.1, proofs module. +* TON API version 1.37.2, proofs module. * THIS FILE WAS GENERATED AUTOMATICALLY. */ diff --git a/src/TonClient/Modules/TvmModule.cs b/src/TonClient/Modules/TvmModule.cs index 50fd49f..11339ba 100644 --- a/src/TonClient/Modules/TvmModule.cs +++ b/src/TonClient/Modules/TvmModule.cs @@ -5,7 +5,7 @@ using TonSdk.Modules; /* -* TON API version 1.37.1, tvm module. +* TON API version 1.37.2, tvm module. * THIS FILE WAS GENERATED AUTOMATICALLY. */ diff --git a/src/TonClient/Modules/UtilsModule.cs b/src/TonClient/Modules/UtilsModule.cs index fd9b311..02b2c03 100644 --- a/src/TonClient/Modules/UtilsModule.cs +++ b/src/TonClient/Modules/UtilsModule.cs @@ -6,7 +6,7 @@ using TonSdk.Modules; /* -* TON API version 1.37.1, utils module. +* TON API version 1.37.2, utils module. * THIS FILE WAS GENERATED AUTOMATICALLY. */ diff --git a/tests/Modules/ClientModuleTests.cs b/tests/Modules/ClientModuleTests.cs index f163fd2..1889d72 100644 --- a/tests/Modules/ClientModuleTests.cs +++ b/tests/Modules/ClientModuleTests.cs @@ -25,7 +25,7 @@ public async Task Should_Return_Version() var result = await _client.Client.VersionAsync(); Assert.NotEmpty(result.Version); Assert.Matches(@"\d+\.\d+\.\d+", result.Version); - Assert.Equal("1.37.1", result.Version); + Assert.Equal("1.37.2", result.Version); } [Fact] diff --git a/tests/Resources/contracts/abi_v2/testDebot15.abi.json b/tests/Resources/contracts/abi_v2/testDebot15.abi.json index 60f4e71..e022afb 100644 --- a/tests/Resources/contracts/abi_v2/testDebot15.abi.json +++ b/tests/Resources/contracts/abi_v2/testDebot15.abi.json @@ -1,5 +1,6 @@ { "ABI version": 2, + "version": "2.2", "header": ["pubkey", "time", "expire"], "functions": [ { @@ -33,15 +34,15 @@ "inputs": [ ], "outputs": [ - {"name":"name","type":"bytes"}, - {"name":"version","type":"bytes"}, - {"name":"publisher","type":"bytes"}, - {"name":"caption","type":"bytes"}, - {"name":"author","type":"bytes"}, + {"name":"name","type":"string"}, + {"name":"version","type":"string"}, + {"name":"publisher","type":"string"}, + {"name":"caption","type":"string"}, + {"name":"author","type":"string"}, {"name":"support","type":"address"}, - {"name":"hello","type":"bytes"}, - {"name":"language","type":"bytes"}, - {"name":"dabi","type":"bytes"}, + {"name":"hello","type":"string"}, + {"name":"language","type":"string"}, + {"name":"dabi","type":"string"}, {"name":"icon","type":"bytes"} ] }, @@ -59,15 +60,15 @@ ], "outputs": [ {"name":"options","type":"uint8"}, - {"name":"debotAbi","type":"bytes"}, - {"name":"targetAbi","type":"bytes"}, + {"name":"debotAbi","type":"string"}, + {"name":"targetAbi","type":"string"}, {"name":"targetAddr","type":"address"} ] }, { "name": "setABI", "inputs": [ - {"name":"dabi","type":"bytes"} + {"name":"dabi","type":"string"} ], "outputs": [ ] @@ -83,5 +84,14 @@ "data": [ ], "events": [ + ], + "fields": [ + {"name":"_pubkey","type":"uint256"}, + {"name":"_timestamp","type":"uint64"}, + {"name":"_constructorFlag","type":"bool"}, + {"name":"m_options","type":"uint8"}, + {"name":"m_debotAbi","type":"optional(string)"}, + {"name":"m_targetAbi","type":"optional(string)"}, + {"name":"m_target","type":"optional(address)"} ] } diff --git a/tests/Resources/contracts/abi_v2/testDebot15.sol b/tests/Resources/contracts/abi_v2/testDebot15.sol index d14206e..a9224c7 100644 --- a/tests/Resources/contracts/abi_v2/testDebot15.sol +++ b/tests/Resources/contracts/abi_v2/testDebot15.sol @@ -83,7 +83,7 @@ contract TestDebot15 is Debot { val = jsonObj.get("value2"); string value2 = val.get().as_string().get(); - require(value2 == "11", 212); + require(value2 == "11.0", 212); val = jsonObj.get("value3"); string value3 = val.get().as_string().get(); diff --git a/tests/Resources/contracts/abi_v2/testDebot15.tvc b/tests/Resources/contracts/abi_v2/testDebot15.tvc index 5fbd7b4..e3e488c 100644 Binary files a/tests/Resources/contracts/abi_v2/testDebot15.tvc and b/tests/Resources/contracts/abi_v2/testDebot15.tvc differ diff --git a/tests/Resources/contracts/abi_v2/test_gosh.abi.json b/tests/Resources/contracts/abi_v2/test_gosh.abi.json new file mode 100644 index 0000000..58bad2b --- /dev/null +++ b/tests/Resources/contracts/abi_v2/test_gosh.abi.json @@ -0,0 +1,59 @@ +{ + "ABI version": 2, + "version": "2.3", + "header": ["time"], + "functions": [ + { + "name": "f", + "inputs": [ + ], + "outputs": [ + ] + }, + { + "name": "fZip", + "inputs": [ + ], + "outputs": [ + ] + }, + { + "name": "f2", + "inputs": [ + ], + "outputs": [ + ] + }, + { + "name": "ff", + "inputs": [ + ], + "outputs": [ + {"name":"value0","type":"uint64"} + ] + }, + { + "name": "fff", + "inputs": [ + ], + "outputs": [ + ] + }, + { + "name": "constructor", + "inputs": [ + ], + "outputs": [ + ] + } + ], + "data": [ + ], + "events": [ + ], + "fields": [ + {"name":"_pubkey","type":"uint256"}, + {"name":"_timestamp","type":"uint64"}, + {"name":"_constructorFlag","type":"bool"} + ] +} diff --git a/tests/Resources/contracts/abi_v2/test_gosh.sol b/tests/Resources/contracts/abi_v2/test_gosh.sol new file mode 100644 index 0000000..5cbbc6d --- /dev/null +++ b/tests/Resources/contracts/abi_v2/test_gosh.sol @@ -0,0 +1,60 @@ +pragma ton-solidity >=0.5.0; + +contract TestAddress { + + modifier alwaysAccept { + tvm.accept(); _; + } + + function f() public pure alwaysAccept { + string textA; + string textB; + string diff = gosh.diff(textA, textB); + { + string newTextB = gosh.applyPatch(textA, diff); + require(newTextB == textB); + } + { + optional(string) newTextB = gosh.applyPatchQ(textA, diff); + require(newTextB.get() == textB); + } + } + + function fZip() public pure alwaysAccept { + string textA = "12edsegfr"; + bytes cell = gosh.zip(textA); + string s = gosh.unzip(cell); + require(s == textA); + } + + function f2() public pure alwaysAccept { + bytes textA = gosh.zip("lalalala"); + bytes textB = gosh.zip("lalalala\nlalalala\n"); + bytes diff = gosh.zipDiff(textA, textB); + { + bytes newTextB = gosh.applyZipPatch(textA, diff); + require(newTextB == textB); + } + { + optional(bytes) newTextB = gosh.applyZipPatchQ(textA, diff); + require(newTextB.get() == textB); + } + } + + function ff() public pure alwaysAccept returns (uint64) { + return tx.storageFee; + } + + function fff() public pure alwaysAccept { + bytes textA; + bytes textB; + bytes patch; + optional(bytes) optTextB; + + textB = gosh.applyBinPatch(textA, patch); + optTextB = gosh.applyBinPatchQ(textA, patch); + + textB = gosh.applyZipBinPatch(textA, patch); + optTextB = gosh.applyZipBinPatchQ(textA, patch); + } +} diff --git a/tests/Resources/contracts/abi_v2/test_gosh.tvc b/tests/Resources/contracts/abi_v2/test_gosh.tvc new file mode 100644 index 0000000..06524bb Binary files /dev/null and b/tests/Resources/contracts/abi_v2/test_gosh.tvc differ