diff --git a/CHANGELOG.md b/CHANGELOG.md index d9f39be7..a01288fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,16 @@ All notable changes to this project will be documented in this file. +## [1.44.1] – 2023-07-25 + +### New + +- functions with callbacks (e.g. `processing.process_messages`) can be called as sync. +- `send_event` parameter is now optional with default value `false`. + +### Deprecated +- Debot module is [DEPRECATED](./docs/reference/types-and-methods/DEPRECATED.md) + ## [1.44.0] – 2023-07-12 ### New diff --git a/Cargo.lock b/Cargo.lock index 026cc472..b8e395ce 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -113,7 +113,7 @@ checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" [[package]] name = "api_derive" -version = "1.44.0" +version = "1.44.1" dependencies = [ "api_info", "proc-macro2", @@ -124,7 +124,7 @@ dependencies = [ [[package]] name = "api_info" -version = "1.44.0" +version = "1.44.1" dependencies = [ "serde", "serde_derive", @@ -133,7 +133,7 @@ dependencies = [ [[package]] name = "api_test" -version = "1.44.0" +version = "1.44.1" dependencies = [ "api_derive", "api_info", @@ -2601,7 +2601,7 @@ dependencies = [ [[package]] name = "ton_client" -version = "1.44.0" +version = "1.44.1" dependencies = [ "aes", "api_derive", @@ -2668,7 +2668,7 @@ dependencies = [ [[package]] name = "ton_client_processing" -version = "1.44.0" +version = "1.44.1" dependencies = [ "api_derive", "api_info", @@ -2700,7 +2700,7 @@ dependencies = [ [[package]] name = "ton_sdk" -version = "1.44.0" +version = "1.44.1" dependencies = [ "api_derive", "api_info", @@ -2807,7 +2807,7 @@ dependencies = [ [[package]] name = "toncli" -version = "1.44.0" +version = "1.44.1" dependencies = [ "api_info", "assert_cmd", diff --git a/api/derive/Cargo.toml b/api/derive/Cargo.toml index 88bac0ea..a5bf91dd 100644 --- a/api/derive/Cargo.toml +++ b/api/derive/Cargo.toml @@ -2,7 +2,7 @@ authors = [ 'TON Labs LTD ' ] edition = '2018' name = 'api_derive' -version = '1.44.0' +version = '1.44.1' [dependencies] quote = '1.0.26' diff --git a/api/info/Cargo.toml b/api/info/Cargo.toml index c0caeae8..daa81cb0 100644 --- a/api/info/Cargo.toml +++ b/api/info/Cargo.toml @@ -2,7 +2,7 @@ authors = [ 'TON Labs LTD ' ] edition = '2018' name = 'api_info' -version = '1.44.0' +version = '1.44.1' [dependencies] serde = '1.0.115' diff --git a/api/test/Cargo.toml b/api/test/Cargo.toml index f0f9f086..9efef3e4 100644 --- a/api/test/Cargo.toml +++ b/api/test/Cargo.toml @@ -2,7 +2,7 @@ authors = [ 'TON Labs LTD ' ] edition = '2018' name = 'api_test' -version = '1.44.0' +version = '1.44.1' [dependencies] serde = '1.0.115' diff --git a/docs/reference/types-and-methods/DEPRECATED.md b/docs/reference/types-and-methods/DEPRECATED.md new file mode 100644 index 00000000..b33c89cf --- /dev/null +++ b/docs/reference/types-and-methods/DEPRECATED.md @@ -0,0 +1,5 @@ +# DEPRECATED API + +API elements marked as **DEPRECATED** will be REMOVED in the next +MINOR releases. + diff --git a/docs/reference/types-and-methods/mod_abi.md b/docs/reference/types-and-methods/mod_abi.md index bef7c515..09dce74b 100644 --- a/docs/reference/types-and-methods/mod_abi.md +++ b/docs/reference/types-and-methods/mod_abi.md @@ -182,7 +182,12 @@ type ResultOfEncodeMessageBody = { function encode_message_body( params: ParamsOfEncodeMessageBody, ): Promise; + +function encode_message_body_sync( + params: ParamsOfEncodeMessageBody, +): ResultOfEncodeMessageBody; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `abi`: _[Abi](mod\_abi.md#abi)_ – Contract ABI. - `call_set`: _[CallSet](mod\_abi.md#callset)_ – Function call parameters. @@ -220,7 +225,12 @@ type ResultOfAttachSignatureToMessageBody = { function attach_signature_to_message_body( params: ParamsOfAttachSignatureToMessageBody, ): Promise; + +function attach_signature_to_message_body_sync( + params: ParamsOfAttachSignatureToMessageBody, +): ResultOfAttachSignatureToMessageBody; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `abi`: _[Abi](mod\_abi.md#abi)_ – Contract ABI - `public_key`: _string_ – Public key. @@ -292,7 +302,12 @@ type ResultOfEncodeMessage = { function encode_message( params: ParamsOfEncodeMessage, ): Promise; + +function encode_message_sync( + params: ParamsOfEncodeMessage, +): ResultOfEncodeMessage; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `abi`: _[Abi](mod\_abi.md#abi)_ – Contract ABI. - `address`?: _string_ – Target address the message will be sent to. @@ -356,7 +371,12 @@ type ResultOfEncodeInternalMessage = { function encode_internal_message( params: ParamsOfEncodeInternalMessage, ): Promise; + +function encode_internal_message_sync( + params: ParamsOfEncodeInternalMessage, +): ResultOfEncodeInternalMessage; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `abi`?: _[Abi](mod\_abi.md#abi)_ – Contract ABI.
Can be None if both deploy_set and call_set are None. @@ -401,7 +421,12 @@ type ResultOfAttachSignature = { function attach_signature( params: ParamsOfAttachSignature, ): Promise; + +function attach_signature_sync( + params: ParamsOfAttachSignature, +): ResultOfAttachSignature; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `abi`: _[Abi](mod\_abi.md#abi)_ – Contract ABI - `public_key`: _string_ – Public key encoded in `hex`. @@ -438,7 +463,12 @@ type DecodedMessageBody = { function decode_message( params: ParamsOfDecodeMessage, ): Promise; + +function decode_message_sync( + params: ParamsOfDecodeMessage, +): DecodedMessageBody; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `abi`: _[Abi](mod\_abi.md#abi)_ – contract ABI - `message`: _string_ – Message BOC @@ -479,7 +509,12 @@ type DecodedMessageBody = { function decode_message_body( params: ParamsOfDecodeMessageBody, ): Promise; + +function decode_message_body_sync( + params: ParamsOfDecodeMessageBody, +): DecodedMessageBody; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `abi`: _[Abi](mod\_abi.md#abi)_ – Contract ABI used to decode. - `body`: _string_ – Message body BOC encoded in `base64`. @@ -522,7 +557,12 @@ type ResultOfEncodeAccount = { function encode_account( params: ParamsOfEncodeAccount, ): Promise; + +function encode_account_sync( + params: ParamsOfEncodeAccount, +): ResultOfEncodeAccount; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `state_init`: _[StateInitSource](mod\_abi.md#stateinitsource)_ – Source of the account state init. - `balance`?: _bigint_ – Initial balance. @@ -558,7 +598,12 @@ type ResultOfDecodeAccountData = { function decode_account_data( params: ParamsOfDecodeAccountData, ): Promise; + +function decode_account_data_sync( + params: ParamsOfDecodeAccountData, +): ResultOfDecodeAccountData; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `abi`: _[Abi](mod\_abi.md#abi)_ – Contract ABI - `data`: _string_ – Data BOC or BOC handle @@ -590,7 +635,12 @@ type ResultOfUpdateInitialData = { function update_initial_data( params: ParamsOfUpdateInitialData, ): Promise; + +function update_initial_data_sync( + params: ParamsOfUpdateInitialData, +): ResultOfUpdateInitialData; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `abi`?: _[Abi](mod\_abi.md#abi)_ – Contract ABI - `data`: _string_ – Data BOC or BOC handle @@ -626,7 +676,12 @@ type ResultOfEncodeInitialData = { function encode_initial_data( params: ParamsOfEncodeInitialData, ): Promise; + +function encode_initial_data_sync( + params: ParamsOfEncodeInitialData, +): ResultOfEncodeInitialData; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `abi`?: _[Abi](mod\_abi.md#abi)_ – Contract ABI - `initial_data`?: _any_ – List of initial values for contract's static variables. @@ -659,7 +714,12 @@ type ResultOfDecodeInitialData = { function decode_initial_data( params: ParamsOfDecodeInitialData, ): Promise; + +function decode_initial_data_sync( + params: ParamsOfDecodeInitialData, +): ResultOfDecodeInitialData; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `abi`?: _[Abi](mod\_abi.md#abi)_ – Contract ABI.
Initial data is decoded if this parameter is provided @@ -708,7 +768,12 @@ type ResultOfDecodeBoc = { function decode_boc( params: ParamsOfDecodeBoc, ): Promise; + +function decode_boc_sync( + params: ParamsOfDecodeBoc, +): ResultOfDecodeBoc; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `params`: _[AbiParam](mod\_abi.md#abiparam)[]_ – Parameters to decode from BOC - `boc`: _string_ – Data BOC or BOC handle @@ -738,7 +803,12 @@ type ResultOfAbiEncodeBoc = { function encode_boc( params: ParamsOfAbiEncodeBoc, ): Promise; + +function encode_boc_sync( + params: ParamsOfAbiEncodeBoc, +): ResultOfAbiEncodeBoc; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `params`: _[AbiParam](mod\_abi.md#abiparam)[]_ – Parameters to encode into BOC - `data`: _any_ – Parameters and values as a JSON structure @@ -769,7 +839,12 @@ type ResultOfCalcFunctionId = { function calc_function_id( params: ParamsOfCalcFunctionId, ): Promise; + +function calc_function_id_sync( + params: ParamsOfCalcFunctionId, +): ResultOfCalcFunctionId; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `abi`: _[Abi](mod\_abi.md#abi)_ – Contract ABI. - `function_name`: _string_ – Contract function name @@ -800,7 +875,12 @@ type ResultOfGetSignatureData = { function get_signature_data( params: ParamsOfGetSignatureData, ): Promise; + +function get_signature_data_sync( + params: ParamsOfGetSignatureData, +): ResultOfGetSignatureData; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `abi`: _[Abi](mod\_abi.md#abi)_ – Contract ABI used to decode. - `message`: _string_ – Message BOC encoded in `base64`. diff --git a/docs/reference/types-and-methods/mod_boc.md b/docs/reference/types-and-methods/mod_boc.md index b7b0bd2c..6b24c60c 100644 --- a/docs/reference/types-and-methods/mod_boc.md +++ b/docs/reference/types-and-methods/mod_boc.md @@ -153,7 +153,12 @@ type ResultOfDecodeTvc = { function decode_tvc( params: ParamsOfDecodeTvc, ): Promise; + +function decode_tvc_sync( + params: ParamsOfDecodeTvc, +): ResultOfDecodeTvc; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `tvc`: _string_ – Contract TVC BOC encoded as base64 or BOC handle @@ -181,7 +186,12 @@ type ResultOfParse = { function parse_message( params: ParamsOfParse, ): Promise; + +function parse_message_sync( + params: ParamsOfParse, +): ResultOfParse; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `boc`: _string_ – BOC encoded as base64 @@ -209,7 +219,12 @@ type ResultOfParse = { function parse_transaction( params: ParamsOfParse, ): Promise; + +function parse_transaction_sync( + params: ParamsOfParse, +): ResultOfParse; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `boc`: _string_ – BOC encoded as base64 @@ -237,7 +252,12 @@ type ResultOfParse = { function parse_account( params: ParamsOfParse, ): Promise; + +function parse_account_sync( + params: ParamsOfParse, +): ResultOfParse; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `boc`: _string_ – BOC encoded as base64 @@ -265,7 +285,12 @@ type ResultOfParse = { function parse_block( params: ParamsOfParse, ): Promise; + +function parse_block_sync( + params: ParamsOfParse, +): ResultOfParse; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `boc`: _string_ – BOC encoded as base64 @@ -295,7 +320,12 @@ type ResultOfParse = { function parse_shardstate( params: ParamsOfParseShardstate, ): Promise; + +function parse_shardstate_sync( + params: ParamsOfParseShardstate, +): ResultOfParse; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `boc`: _string_ – BOC encoded as base64 - `id`: _string_ – Shardstate identifier @@ -323,7 +353,12 @@ type ResultOfGetBlockchainConfig = { function get_blockchain_config( params: ParamsOfGetBlockchainConfig, ): Promise; + +function get_blockchain_config_sync( + params: ParamsOfGetBlockchainConfig, +): ResultOfGetBlockchainConfig; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `block_boc`: _string_ – Key block BOC or zerostate BOC encoded as base64 @@ -349,7 +384,12 @@ type ResultOfGetBocHash = { function get_boc_hash( params: ParamsOfGetBocHash, ): Promise; + +function get_boc_hash_sync( + params: ParamsOfGetBocHash, +): ResultOfGetBocHash; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `boc`: _string_ – BOC encoded as base64 or BOC handle @@ -375,7 +415,12 @@ type ResultOfGetBocDepth = { function get_boc_depth( params: ParamsOfGetBocDepth, ): Promise; + +function get_boc_depth_sync( + params: ParamsOfGetBocDepth, +): ResultOfGetBocDepth; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `boc`: _string_ – BOC encoded as base64 or BOC handle @@ -401,7 +446,12 @@ type ResultOfGetCodeFromTvc = { function get_code_from_tvc( params: ParamsOfGetCodeFromTvc, ): Promise; + +function get_code_from_tvc_sync( + params: ParamsOfGetCodeFromTvc, +): ResultOfGetCodeFromTvc; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `tvc`: _string_ – Contract TVC image or image BOC handle @@ -427,7 +477,12 @@ type ResultOfBocCacheGet = { function cache_get( params: ParamsOfBocCacheGet, ): Promise; + +function cache_get_sync( + params: ParamsOfBocCacheGet, +): ResultOfBocCacheGet; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `boc_ref`: _string_ – Reference to the cached BOC @@ -454,7 +509,12 @@ type ResultOfBocCacheSet = { function cache_set( params: ParamsOfBocCacheSet, ): Promise; + +function cache_set_sync( + params: ParamsOfBocCacheSet, +): ResultOfBocCacheSet; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `boc`: _string_ – BOC encoded as base64 or BOC reference - `cache_type`: _[BocCacheType](mod\_boc.md#boccachetype)_ – Cache type @@ -478,7 +538,12 @@ type ParamsOfBocCacheUnpin = { function cache_unpin( params: ParamsOfBocCacheUnpin, ): Promise; + +function cache_unpin_sync( + params: ParamsOfBocCacheUnpin, +): void; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `pin`: _string_ – Pinned name - `boc_ref`?: _string_ – Reference to the cached BOC. @@ -502,7 +567,12 @@ type ResultOfEncodeBoc = { function encode_boc( params: ParamsOfEncodeBoc, ): Promise; + +function encode_boc_sync( + params: ParamsOfEncodeBoc, +): ResultOfEncodeBoc; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `builder`: _[BuilderOp](mod\_boc.md#builderop)[]_ – Cell builder operations. - `boc_cache`?: _[BocCacheType](mod\_boc.md#boccachetype)_ – Cache type to put the result. The BOC itself returned if no cache type provided. @@ -530,7 +600,12 @@ type ResultOfGetCodeSalt = { function get_code_salt( params: ParamsOfGetCodeSalt, ): Promise; + +function get_code_salt_sync( + params: ParamsOfGetCodeSalt, +): ResultOfGetCodeSalt; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `code`: _string_ – Contract code BOC encoded as base64 or code BOC handle - `boc_cache`?: _[BocCacheType](mod\_boc.md#boccachetype)_ – Cache type to put the result. The BOC itself returned if no cache type provided. @@ -562,7 +637,12 @@ type ResultOfSetCodeSalt = { function set_code_salt( params: ParamsOfSetCodeSalt, ): Promise; + +function set_code_salt_sync( + params: ParamsOfSetCodeSalt, +): ResultOfSetCodeSalt; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `code`: _string_ – Contract code BOC encoded as base64 or code BOC handle - `salt`: _string_ – Code salt to set. @@ -603,7 +683,12 @@ type ResultOfDecodeStateInit = { function decode_state_init( params: ParamsOfDecodeStateInit, ): Promise; + +function decode_state_init_sync( + params: ParamsOfDecodeStateInit, +): ResultOfDecodeStateInit; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `state_init`: _string_ – Contract StateInit image BOC encoded as base64 or BOC handle - `boc_cache`?: _[BocCacheType](mod\_boc.md#boccachetype)_ – Cache type to put the result. The BOC itself returned if no cache type provided. @@ -648,7 +733,12 @@ type ResultOfEncodeStateInit = { function encode_state_init( params: ParamsOfEncodeStateInit, ): Promise; + +function encode_state_init_sync( + params: ParamsOfEncodeStateInit, +): ResultOfEncodeStateInit; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `code`?: _string_ – Contract code BOC encoded as base64 or BOC handle - `data`?: _string_ – Contract data BOC encoded as base64 or BOC handle @@ -689,7 +779,12 @@ type ResultOfEncodeExternalInMessage = { function encode_external_in_message( params: ParamsOfEncodeExternalInMessage, ): Promise; + +function encode_external_in_message_sync( + params: ParamsOfEncodeExternalInMessage, +): ResultOfEncodeExternalInMessage; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `src`?: _string_ – Source address. - `dst`: _string_ – Destination address. @@ -721,7 +816,12 @@ type ResultOfGetCompilerVersion = { function get_compiler_version( params: ParamsOfGetCompilerVersion, ): Promise; + +function get_compiler_version_sync( + params: ParamsOfGetCompilerVersion, +): ResultOfGetCompilerVersion; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `code`: _string_ – Contract code BOC encoded as base64 or code BOC handle diff --git a/docs/reference/types-and-methods/mod_client.md b/docs/reference/types-and-methods/mod_client.md index 55ec65d6..a9a4c806 100644 --- a/docs/reference/types-and-methods/mod_client.md +++ b/docs/reference/types-and-methods/mod_client.md @@ -65,7 +65,10 @@ type ResultOfGetApiReference = { } function get_api_reference(): Promise; + +function get_api_reference_sync(): ResultOfGetApiReference; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Result @@ -83,7 +86,10 @@ type ResultOfVersion = { } function version(): Promise; + +function version_sync(): ResultOfVersion; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Result @@ -107,7 +113,10 @@ type ClientConfig = { } function config(): Promise; + +function config_sync(): ClientConfig; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Result @@ -132,7 +141,10 @@ type ResultOfBuildInfo = { } function build_info(): Promise; + +function build_info_sync(): ResultOfBuildInfo; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Result @@ -154,7 +166,12 @@ type ParamsOfResolveAppRequest = { function resolve_app_request( params: ParamsOfResolveAppRequest, ): Promise; + +function resolve_app_request_sync( + params: ParamsOfResolveAppRequest, +): void; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `app_request_id`: _number_ – Request ID received from SDK - `result`: _[AppRequestResult](mod\_client.md#apprequestresult)_ – Result of request processing diff --git a/docs/reference/types-and-methods/mod_crypto.md b/docs/reference/types-and-methods/mod_crypto.md index 4cdf1c4c..4300229e 100644 --- a/docs/reference/types-and-methods/mod_crypto.md +++ b/docs/reference/types-and-methods/mod_crypto.md @@ -373,7 +373,12 @@ type ResultOfFactorize = { function factorize( params: ParamsOfFactorize, ): Promise; + +function factorize_sync( + params: ParamsOfFactorize, +): ResultOfFactorize; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `composite`: _string_ – Hexadecimal representation of u64 composite number. @@ -404,7 +409,12 @@ type ResultOfModularPower = { function modular_power( params: ParamsOfModularPower, ): Promise; + +function modular_power_sync( + params: ParamsOfModularPower, +): ResultOfModularPower; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `base`: _string_ – `base` argument of calculation. - `exponent`: _string_ – `exponent` argument of calculation. @@ -432,7 +442,12 @@ type ResultOfTonCrc16 = { function ton_crc16( params: ParamsOfTonCrc16, ): Promise; + +function ton_crc16_sync( + params: ParamsOfTonCrc16, +): ResultOfTonCrc16; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `data`: _string_ – Input data for CRC calculation.
Encoded with `base64`. @@ -459,7 +474,12 @@ type ResultOfGenerateRandomBytes = { function generate_random_bytes( params: ParamsOfGenerateRandomBytes, ): Promise; + +function generate_random_bytes_sync( + params: ParamsOfGenerateRandomBytes, +): ResultOfGenerateRandomBytes; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `length`: _number_ – Size of random byte array. @@ -485,7 +505,12 @@ type ResultOfConvertPublicKeyToTonSafeFormat = { function convert_public_key_to_ton_safe_format( params: ParamsOfConvertPublicKeyToTonSafeFormat, ): Promise; + +function convert_public_key_to_ton_safe_format_sync( + params: ParamsOfConvertPublicKeyToTonSafeFormat, +): ResultOfConvertPublicKeyToTonSafeFormat; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `public_key`: _string_ – Public key - 64 symbols hex string @@ -506,7 +531,10 @@ type KeyPair = { } function generate_random_sign_keys(): Promise; + +function generate_random_sign_keys_sync(): KeyPair; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Result @@ -533,7 +561,12 @@ type ResultOfSign = { function sign( params: ParamsOfSign, ): Promise; + +function sign_sync( + params: ParamsOfSign, +): ResultOfSign; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `unsigned`: _string_ – Data that must be signed encoded in `base64`. - `keys`: _[KeyPair](mod\_crypto.md#keypair)_ – Sign keys. @@ -562,7 +595,12 @@ type ResultOfVerifySignature = { function verify_signature( params: ParamsOfVerifySignature, ): Promise; + +function verify_signature_sync( + params: ParamsOfVerifySignature, +): ResultOfVerifySignature; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `signed`: _string_ – Signed data that must be verified encoded in `base64`. - `public`: _string_ – Signer's public key - 64 symbols hex string @@ -589,7 +627,12 @@ type ResultOfHash = { function sha256( params: ParamsOfHash, ): Promise; + +function sha256_sync( + params: ParamsOfHash, +): ResultOfHash; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `data`: _string_ – Input data for hash calculation.
Encoded with `base64`. @@ -617,7 +660,12 @@ type ResultOfHash = { function sha512( params: ParamsOfHash, ): Promise; + +function sha512_sync( + params: ParamsOfHash, +): ResultOfHash; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `data`: _string_ – Input data for hash calculation.
Encoded with `base64`. @@ -666,7 +714,12 @@ type ResultOfScrypt = { function scrypt( params: ParamsOfScrypt, ): Promise; + +function scrypt_sync( + params: ParamsOfScrypt, +): ResultOfScrypt; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `password`: _string_ – The password bytes to be hashed. Must be encoded with `base64`. - `salt`: _string_ – Salt bytes that modify the hash to protect against Rainbow table attacks. Must be encoded with `base64`. @@ -703,7 +756,12 @@ type KeyPair = { function nacl_sign_keypair_from_secret_key( params: ParamsOfNaclSignKeyPairFromSecret, ): Promise; + +function nacl_sign_keypair_from_secret_key_sync( + params: ParamsOfNaclSignKeyPairFromSecret, +): KeyPair; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `secret`: _string_ – Secret key - unprefixed 0-padded to 64 symbols hex string @@ -731,7 +789,12 @@ type ResultOfNaclSign = { function nacl_sign( params: ParamsOfNaclSign, ): Promise; + +function nacl_sign_sync( + params: ParamsOfNaclSign, +): ResultOfNaclSign; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `unsigned`: _string_ – Data that must be signed encoded in `base64`. - `secret`: _string_ – 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`. @@ -764,7 +827,12 @@ type ResultOfNaclSignOpen = { function nacl_sign_open( params: ParamsOfNaclSignOpen, ): Promise; + +function nacl_sign_open_sync( + params: ParamsOfNaclSignOpen, +): ResultOfNaclSignOpen; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `signed`: _string_ – Signed data that must be unsigned.
Encoded with `base64`. @@ -796,7 +864,12 @@ type ResultOfNaclSignDetached = { function nacl_sign_detached( params: ParamsOfNaclSign, ): Promise; + +function nacl_sign_detached_sync( + params: ParamsOfNaclSign, +): ResultOfNaclSignDetached; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `unsigned`: _string_ – Data that must be signed encoded in `base64`. - `secret`: _string_ – 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`. @@ -825,7 +898,12 @@ type ResultOfNaclSignDetachedVerify = { function nacl_sign_detached_verify( params: ParamsOfNaclSignDetachedVerify, ): Promise; + +function nacl_sign_detached_verify_sync( + params: ParamsOfNaclSignDetachedVerify, +): ResultOfNaclSignDetachedVerify; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `unsigned`: _string_ – Unsigned data that must be verified.
Encoded with `base64`. @@ -850,7 +928,10 @@ type KeyPair = { } function nacl_box_keypair(): Promise; + +function nacl_box_keypair_sync(): KeyPair; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Result @@ -876,7 +957,12 @@ type KeyPair = { function nacl_box_keypair_from_secret_key( params: ParamsOfNaclBoxKeyPairFromSecret, ): Promise; + +function nacl_box_keypair_from_secret_key_sync( + params: ParamsOfNaclBoxKeyPairFromSecret, +): KeyPair; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `secret`: _string_ – Secret key - unprefixed 0-padded to 64 symbols hex string @@ -909,7 +995,12 @@ type ResultOfNaclBox = { function nacl_box( params: ParamsOfNaclBox, ): Promise; + +function nacl_box_sync( + params: ParamsOfNaclBox, +): ResultOfNaclBox; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `decrypted`: _string_ – Data that must be encrypted encoded in `base64`. - `nonce`: _string_ – Nonce, encoded in `hex` @@ -941,7 +1032,12 @@ type ResultOfNaclBoxOpen = { function nacl_box_open( params: ParamsOfNaclBoxOpen, ): Promise; + +function nacl_box_open_sync( + params: ParamsOfNaclBoxOpen, +): ResultOfNaclBoxOpen; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `encrypted`: _string_ – Data that must be decrypted.
Encoded with `base64`. @@ -973,7 +1069,12 @@ type ResultOfNaclBox = { function nacl_secret_box( params: ParamsOfNaclSecretBox, ): Promise; + +function nacl_secret_box_sync( + params: ParamsOfNaclSecretBox, +): ResultOfNaclBox; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `decrypted`: _string_ – Data that must be encrypted.
Encoded with `base64`. @@ -1004,7 +1105,12 @@ type ResultOfNaclBoxOpen = { function nacl_secret_box_open( params: ParamsOfNaclSecretBoxOpen, ): Promise; + +function nacl_secret_box_open_sync( + params: ParamsOfNaclSecretBoxOpen, +): ResultOfNaclBoxOpen; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `encrypted`: _string_ – Data that must be decrypted.
Encoded with `base64`. @@ -1033,7 +1139,12 @@ type ResultOfMnemonicWords = { function mnemonic_words( params: ParamsOfMnemonicWords, ): Promise; + +function mnemonic_words_sync( + params: ParamsOfMnemonicWords, +): ResultOfMnemonicWords; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `dictionary`?: _[MnemonicDictionary](mod\_crypto.md#mnemonicdictionary)_ – Dictionary identifier @@ -1062,7 +1173,12 @@ type ResultOfMnemonicFromRandom = { function mnemonic_from_random( params: ParamsOfMnemonicFromRandom, ): Promise; + +function mnemonic_from_random_sync( + params: ParamsOfMnemonicFromRandom, +): ResultOfMnemonicFromRandom; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `dictionary`?: _[MnemonicDictionary](mod\_crypto.md#mnemonicdictionary)_ – Dictionary identifier - `word_count`?: _number_ – Mnemonic word count @@ -1091,7 +1207,12 @@ type ResultOfMnemonicFromEntropy = { function mnemonic_from_entropy( params: ParamsOfMnemonicFromEntropy, ): Promise; + +function mnemonic_from_entropy_sync( + params: ParamsOfMnemonicFromEntropy, +): ResultOfMnemonicFromEntropy; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `entropy`: _string_ – Entropy bytes.
Hex encoded. @@ -1125,7 +1246,12 @@ type ResultOfMnemonicVerify = { function mnemonic_verify( params: ParamsOfMnemonicVerify, ): Promise; + +function mnemonic_verify_sync( + params: ParamsOfMnemonicVerify, +): ResultOfMnemonicVerify; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `phrase`: _string_ – Phrase - `dictionary`?: _[MnemonicDictionary](mod\_crypto.md#mnemonicdictionary)_ – Dictionary identifier @@ -1160,7 +1286,12 @@ type KeyPair = { function mnemonic_derive_sign_keys( params: ParamsOfMnemonicDeriveSignKeys, ): Promise; + +function mnemonic_derive_sign_keys_sync( + params: ParamsOfMnemonicDeriveSignKeys, +): KeyPair; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `phrase`: _string_ – Phrase - `path`?: _string_ – Derivation path, for instance "m/44'/396'/0'/0/0" @@ -1192,7 +1323,12 @@ type ResultOfHDKeyXPrvFromMnemonic = { function hdkey_xprv_from_mnemonic( params: ParamsOfHDKeyXPrvFromMnemonic, ): Promise; + +function hdkey_xprv_from_mnemonic_sync( + params: ParamsOfHDKeyXPrvFromMnemonic, +): ResultOfHDKeyXPrvFromMnemonic; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `phrase`: _string_ – String with seed phrase - `dictionary`?: _[MnemonicDictionary](mod\_crypto.md#mnemonicdictionary)_ – Dictionary identifier @@ -1222,7 +1358,12 @@ type ResultOfHDKeyDeriveFromXPrv = { function hdkey_derive_from_xprv( params: ParamsOfHDKeyDeriveFromXPrv, ): Promise; + +function hdkey_derive_from_xprv_sync( + params: ParamsOfHDKeyDeriveFromXPrv, +): ResultOfHDKeyDeriveFromXPrv; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `xprv`: _string_ – Serialized extended private key - `child_index`: _number_ – Child index (see BIP-0032) @@ -1251,7 +1392,12 @@ type ResultOfHDKeyDeriveFromXPrvPath = { function hdkey_derive_from_xprv_path( params: ParamsOfHDKeyDeriveFromXPrvPath, ): Promise; + +function hdkey_derive_from_xprv_path_sync( + params: ParamsOfHDKeyDeriveFromXPrvPath, +): ResultOfHDKeyDeriveFromXPrvPath; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `xprv`: _string_ – Serialized extended private key - `path`: _string_ – Derivation path, for instance "m/44'/396'/0'/0/0" @@ -1278,7 +1424,12 @@ type ResultOfHDKeySecretFromXPrv = { function hdkey_secret_from_xprv( params: ParamsOfHDKeySecretFromXPrv, ): Promise; + +function hdkey_secret_from_xprv_sync( + params: ParamsOfHDKeySecretFromXPrv, +): ResultOfHDKeySecretFromXPrv; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `xprv`: _string_ – Serialized extended private key @@ -1304,7 +1455,12 @@ type ResultOfHDKeyPublicFromXPrv = { function hdkey_public_from_xprv( params: ParamsOfHDKeyPublicFromXPrv, ): Promise; + +function hdkey_public_from_xprv_sync( + params: ParamsOfHDKeyPublicFromXPrv, +): ResultOfHDKeyPublicFromXPrv; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `xprv`: _string_ – Serialized extended private key @@ -1332,7 +1488,12 @@ type ResultOfChaCha20 = { function chacha20( params: ParamsOfChaCha20, ): Promise; + +function chacha20_sync( + params: ParamsOfChaCha20, +): ResultOfChaCha20; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `data`: _string_ – Source data to be encrypted or decrypted.
Must be encoded with `base64`. @@ -1376,7 +1537,12 @@ function create_crypto_box( params: ParamsOfCreateCryptoBox, obj: AppPasswordProvider, ): Promise; + +function create_crypto_box_sync( + params: ParamsOfCreateCryptoBox, +): RegisteredCryptoBox; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `secret_encryption_salt`: _string_ – Salt used for secret encryption. For example, a mobile device can use device ID as salt. - `secret`: _[CryptoBoxSecret](mod\_crypto.md#cryptoboxsecret)_ – Cryptobox secret @@ -1401,7 +1567,12 @@ type RegisteredCryptoBox = { function remove_crypto_box( params: RegisteredCryptoBox, ): Promise; + +function remove_crypto_box_sync( + params: RegisteredCryptoBox, +): void; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `handle`: _[CryptoBoxHandle](mod\_crypto.md#cryptoboxhandle)_ @@ -1422,7 +1593,12 @@ type ResultOfGetCryptoBoxInfo = { function get_crypto_box_info( params: RegisteredCryptoBox, ): Promise; + +function get_crypto_box_info_sync( + params: RegisteredCryptoBox, +): ResultOfGetCryptoBoxInfo; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `handle`: _[CryptoBoxHandle](mod\_crypto.md#cryptoboxhandle)_ @@ -1452,7 +1628,12 @@ type ResultOfGetCryptoBoxSeedPhrase = { function get_crypto_box_seed_phrase( params: RegisteredCryptoBox, ): Promise; + +function get_crypto_box_seed_phrase_sync( + params: RegisteredCryptoBox, +): ResultOfGetCryptoBoxSeedPhrase; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `handle`: _[CryptoBoxHandle](mod\_crypto.md#cryptoboxhandle)_ @@ -1482,7 +1663,12 @@ type RegisteredSigningBox = { function get_signing_box_from_crypto_box( params: ParamsOfGetSigningBoxFromCryptoBox, ): Promise; + +function get_signing_box_from_crypto_box_sync( + params: ParamsOfGetSigningBoxFromCryptoBox, +): RegisteredSigningBox; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `handle`: _number_ – Crypto Box Handle. - `hdpath`?: _string_ – HD key derivation path. @@ -1520,7 +1706,12 @@ type RegisteredEncryptionBox = { function get_encryption_box_from_crypto_box( params: ParamsOfGetEncryptionBoxFromCryptoBox, ): Promise; + +function get_encryption_box_from_crypto_box_sync( + params: ParamsOfGetEncryptionBoxFromCryptoBox, +): RegisteredEncryptionBox; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `handle`: _number_ – Crypto Box Handle. - `hdpath`?: _string_ – HD key derivation path. @@ -1546,7 +1737,12 @@ type RegisteredCryptoBox = { function clear_crypto_box_secret_cache( params: RegisteredCryptoBox, ): Promise; + +function clear_crypto_box_secret_cache_sync( + params: RegisteredCryptoBox, +): void; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `handle`: _[CryptoBoxHandle](mod\_crypto.md#cryptoboxhandle)_ @@ -1563,7 +1759,10 @@ type RegisteredSigningBox = { function register_signing_box( obj: AppSigningBox, ): Promise; + +function register_signing_box_sync(): RegisteredSigningBox; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `obj`: [AppSigningBox](mod\_AppSigningBox.md#appsigningbox) – Signing box callbacks. @@ -1591,7 +1790,12 @@ type RegisteredSigningBox = { function get_signing_box( params: KeyPair, ): Promise; + +function get_signing_box_sync( + params: KeyPair, +): RegisteredSigningBox; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `public`: _string_ – Public key - 64 symbols hex string - `secret`: _string_ – Private key - u64 symbols hex string @@ -1618,7 +1822,12 @@ type ResultOfSigningBoxGetPublicKey = { function signing_box_get_public_key( params: RegisteredSigningBox, ): Promise; + +function signing_box_get_public_key_sync( + params: RegisteredSigningBox, +): ResultOfSigningBoxGetPublicKey; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `handle`: _[SigningBoxHandle](mod\_crypto.md#signingboxhandle)_ – Handle of the signing box. @@ -1646,7 +1855,12 @@ type ResultOfSigningBoxSign = { function signing_box_sign( params: ParamsOfSigningBoxSign, ): Promise; + +function signing_box_sign_sync( + params: ParamsOfSigningBoxSign, +): ResultOfSigningBoxSign; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `signing_box`: _[SigningBoxHandle](mod\_crypto.md#signingboxhandle)_ – Signing Box handle. - `unsigned`: _string_ – Unsigned user data. @@ -1671,7 +1885,12 @@ type RegisteredSigningBox = { function remove_signing_box( params: RegisteredSigningBox, ): Promise; + +function remove_signing_box_sync( + params: RegisteredSigningBox, +): void; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `handle`: _[SigningBoxHandle](mod\_crypto.md#signingboxhandle)_ – Handle of the signing box. @@ -1688,7 +1907,10 @@ type RegisteredEncryptionBox = { function register_encryption_box( obj: AppEncryptionBox, ): Promise; + +function register_encryption_box_sync(): RegisteredEncryptionBox; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `obj`: [AppEncryptionBox](mod\_AppEncryptionBox.md#appencryptionbox) – Interface for data encryption/decryption @@ -1711,7 +1933,12 @@ type RegisteredEncryptionBox = { function remove_encryption_box( params: RegisteredEncryptionBox, ): Promise; + +function remove_encryption_box_sync( + params: RegisteredEncryptionBox, +): void; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `handle`: _[EncryptionBoxHandle](mod\_crypto.md#encryptionboxhandle)_ – Handle of the encryption box. @@ -1732,7 +1959,12 @@ type ResultOfEncryptionBoxGetInfo = { function encryption_box_get_info( params: ParamsOfEncryptionBoxGetInfo, ): Promise; + +function encryption_box_get_info_sync( + params: ParamsOfEncryptionBoxGetInfo, +): ResultOfEncryptionBoxGetInfo; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `encryption_box`: _[EncryptionBoxHandle](mod\_crypto.md#encryptionboxhandle)_ – Encryption box handle @@ -1762,7 +1994,12 @@ type ResultOfEncryptionBoxEncrypt = { function encryption_box_encrypt( params: ParamsOfEncryptionBoxEncrypt, ): Promise; + +function encryption_box_encrypt_sync( + params: ParamsOfEncryptionBoxEncrypt, +): ResultOfEncryptionBoxEncrypt; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `encryption_box`: _[EncryptionBoxHandle](mod\_crypto.md#encryptionboxhandle)_ – Encryption box handle - `data`: _string_ – Data to be encrypted, encoded in Base64 @@ -1794,7 +2031,12 @@ type ResultOfEncryptionBoxDecrypt = { function encryption_box_decrypt( params: ParamsOfEncryptionBoxDecrypt, ): Promise; + +function encryption_box_decrypt_sync( + params: ParamsOfEncryptionBoxDecrypt, +): ResultOfEncryptionBoxDecrypt; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `encryption_box`: _[EncryptionBoxHandle](mod\_crypto.md#encryptionboxhandle)_ – Encryption box handle - `data`: _string_ – Data to be decrypted, encoded in Base64 @@ -1821,7 +2063,12 @@ type RegisteredEncryptionBox = { function create_encryption_box( params: ParamsOfCreateEncryptionBox, ): Promise; + +function create_encryption_box_sync( + params: ParamsOfCreateEncryptionBox, +): RegisteredEncryptionBox; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `algorithm`: _[EncryptionAlgorithm](mod\_crypto.md#encryptionalgorithm)_ – Encryption algorithm specifier including cipher parameters (key, IV, etc) @@ -3469,7 +3716,12 @@ type ResultOfAppPasswordProviderGetPasswordVariant = ResultOfAppPasswordProvider function get_password( params: ParamsOfAppPasswordProviderGetPasswordVariant, ): Promise; + +function get_password_sync( + params: ParamsOfAppPasswordProviderGetPasswordVariant, +): ResultOfAppPasswordProviderGetPasswordVariant; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `encryption_public_key`: _string_ – Temporary library pubkey, that is used on application side for password encryption, along with application temporary private key and nonce. Used for password decryption on library side. @@ -3501,7 +3753,10 @@ Get signing box public key type ResultOfAppSigningBoxGetPublicKeyVariant = ResultOfAppSigningBoxGetPublicKeyVariant function get_public_key(): Promise; + +function get_public_key_sync(): ResultOfAppSigningBoxGetPublicKeyVariant; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Result @@ -3521,7 +3776,12 @@ type ResultOfAppSigningBoxSignVariant = ResultOfAppSigningBoxSignVariant function sign( params: ParamsOfAppSigningBoxSignVariant, ): Promise; + +function sign_sync( + params: ParamsOfAppSigningBoxSignVariant, +): ResultOfAppSigningBoxSignVariant; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `unsigned`: _string_ – Data to sign encoded as base64 @@ -3552,7 +3812,10 @@ Get encryption box info type ResultOfAppEncryptionBoxGetInfoVariant = ResultOfAppEncryptionBoxGetInfoVariant function get_info(): Promise; + +function get_info_sync(): ResultOfAppEncryptionBoxGetInfoVariant; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Result @@ -3572,7 +3835,12 @@ type ResultOfAppEncryptionBoxEncryptVariant = ResultOfAppEncryptionBoxEncryptVar function encrypt( params: ParamsOfAppEncryptionBoxEncryptVariant, ): Promise; + +function encrypt_sync( + params: ParamsOfAppEncryptionBoxEncryptVariant, +): ResultOfAppEncryptionBoxEncryptVariant; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `data`: _string_ – Data, encoded in Base64 @@ -3594,7 +3862,12 @@ type ResultOfAppEncryptionBoxDecryptVariant = ResultOfAppEncryptionBoxDecryptVar function decrypt( params: ParamsOfAppEncryptionBoxDecryptVariant, ): Promise; + +function decrypt_sync( + params: ParamsOfAppEncryptionBoxDecryptVariant, +): ResultOfAppEncryptionBoxDecryptVariant; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `data`: _string_ – Data, encoded in Base64 diff --git a/docs/reference/types-and-methods/mod_debot.md b/docs/reference/types-and-methods/mod_debot.md index 9fa7cc4c..37391c6b 100644 --- a/docs/reference/types-and-methods/mod_debot.md +++ b/docs/reference/types-and-methods/mod_debot.md @@ -1,39 +1,39 @@ # Module debot -[UNSTABLE](UNSTABLE.md) Module for working with debot. +[UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Module for working with debot. ## Functions -[init](mod\_debot.md#init) – [UNSTABLE](UNSTABLE.md) Creates and instance of DeBot. +[init](mod\_debot.md#init) – [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Creates and instance of DeBot. -[start](mod\_debot.md#start) – [UNSTABLE](UNSTABLE.md) Starts the DeBot. +[start](mod\_debot.md#start) – [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Starts the DeBot. -[fetch](mod\_debot.md#fetch) – [UNSTABLE](UNSTABLE.md) Fetches DeBot metadata from blockchain. +[fetch](mod\_debot.md#fetch) – [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Fetches DeBot metadata from blockchain. -[execute](mod\_debot.md#execute) – [UNSTABLE](UNSTABLE.md) Executes debot action. +[execute](mod\_debot.md#execute) – [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Executes debot action. -[send](mod\_debot.md#send) – [UNSTABLE](UNSTABLE.md) Sends message to Debot. +[send](mod\_debot.md#send) – [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Sends message to Debot. -[remove](mod\_debot.md#remove) – [UNSTABLE](UNSTABLE.md) Destroys debot handle. +[remove](mod\_debot.md#remove) – [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Destroys debot handle. ## Types [DebotErrorCode](mod\_debot.md#deboterrorcode) -[DebotHandle](mod\_debot.md#debothandle) – [UNSTABLE](UNSTABLE.md) Handle of registered in SDK debot +[DebotHandle](mod\_debot.md#debothandle) – [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Handle of registered in SDK debot -[DebotAction](mod\_debot.md#debotaction) – [UNSTABLE](UNSTABLE.md) Describes a debot action in a Debot Context. +[DebotAction](mod\_debot.md#debotaction) – [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Describes a debot action in a Debot Context. -[DebotInfo](mod\_debot.md#debotinfo) – [UNSTABLE](UNSTABLE.md) Describes DeBot metadata. +[DebotInfo](mod\_debot.md#debotinfo) – [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Describes DeBot metadata. [DebotActivityTransactionVariant](mod\_debot.md#debotactivitytransactionvariant) – DeBot wants to create new transaction in blockchain. -[DebotActivity](mod\_debot.md#debotactivity) – [UNSTABLE](UNSTABLE.md) Describes the operation that the DeBot wants to perform. +[DebotActivity](mod\_debot.md#debotactivity) – [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Describes the operation that the DeBot wants to perform. -[Spending](mod\_debot.md#spending) – [UNSTABLE](UNSTABLE.md) Describes how much funds will be debited from the target contract balance as a result of the transaction. +[Spending](mod\_debot.md#spending) – [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Describes how much funds will be debited from the target contract balance as a result of the transaction. -[ParamsOfInit](mod\_debot.md#paramsofinit) – [UNSTABLE](UNSTABLE.md) Parameters to init DeBot. +[ParamsOfInit](mod\_debot.md#paramsofinit) – [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Parameters to init DeBot. -[RegisteredDebot](mod\_debot.md#registereddebot) – [UNSTABLE](UNSTABLE.md) Structure for storing debot handle returned from `init` function. +[RegisteredDebot](mod\_debot.md#registereddebot) – [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Structure for storing debot handle returned from `init` function. [ParamsOfAppDebotBrowserLogVariant](mod\_debot.md#paramsofappdebotbrowserlogvariant) – Print message to user. @@ -53,7 +53,7 @@ [ParamsOfAppDebotBrowserApproveVariant](mod\_debot.md#paramsofappdebotbrowserapprovevariant) – Requests permission from DeBot Browser to execute DeBot operation. -[ParamsOfAppDebotBrowser](mod\_debot.md#paramsofappdebotbrowser) – [UNSTABLE](UNSTABLE.md) Debot Browser callbacks +[ParamsOfAppDebotBrowser](mod\_debot.md#paramsofappdebotbrowser) – [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Debot Browser callbacks [ResultOfAppDebotBrowserInputVariant](mod\_debot.md#resultofappdebotbrowserinputvariant) – Result of user input. @@ -63,27 +63,27 @@ [ResultOfAppDebotBrowserApproveVariant](mod\_debot.md#resultofappdebotbrowserapprovevariant) – Result of `approve` callback. -[ResultOfAppDebotBrowser](mod\_debot.md#resultofappdebotbrowser) – [UNSTABLE](UNSTABLE.md) Returning values from Debot Browser callbacks. +[ResultOfAppDebotBrowser](mod\_debot.md#resultofappdebotbrowser) – [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Returning values from Debot Browser callbacks. -[ParamsOfStart](mod\_debot.md#paramsofstart) – [UNSTABLE](UNSTABLE.md) Parameters to start DeBot. DeBot must be already initialized with init() function. +[ParamsOfStart](mod\_debot.md#paramsofstart) – [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Parameters to start DeBot. DeBot must be already initialized with init() function. -[ParamsOfFetch](mod\_debot.md#paramsoffetch) – [UNSTABLE](UNSTABLE.md) Parameters to fetch DeBot metadata. +[ParamsOfFetch](mod\_debot.md#paramsoffetch) – [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Parameters to fetch DeBot metadata. -[ResultOfFetch](mod\_debot.md#resultoffetch) – [UNSTABLE](UNSTABLE.md) +[ResultOfFetch](mod\_debot.md#resultoffetch) – [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) -[ParamsOfExecute](mod\_debot.md#paramsofexecute) – [UNSTABLE](UNSTABLE.md) Parameters for executing debot action. +[ParamsOfExecute](mod\_debot.md#paramsofexecute) – [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Parameters for executing debot action. -[ParamsOfSend](mod\_debot.md#paramsofsend) – [UNSTABLE](UNSTABLE.md) Parameters of `send` function. +[ParamsOfSend](mod\_debot.md#paramsofsend) – [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Parameters of `send` function. -[ParamsOfRemove](mod\_debot.md#paramsofremove) – [UNSTABLE](UNSTABLE.md) +[ParamsOfRemove](mod\_debot.md#paramsofremove) – [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) -[AppDebotBrowser](mod\_debot.md#appdebotbrowser) – [UNSTABLE](UNSTABLE.md) Debot Browser callbacks +[AppDebotBrowser](mod\_debot.md#appdebotbrowser) – [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Debot Browser callbacks # Functions ## init -[UNSTABLE](UNSTABLE.md) Creates and instance of DeBot. +[UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Creates and instance of DeBot. Downloads debot smart contract (code and data) from blockchain and creates an instance of Debot Engine for it. @@ -106,10 +106,15 @@ function init( params: ParamsOfInit, obj: AppDebotBrowser, ): Promise; + +function init_sync( + params: ParamsOfInit, +): RegisteredDebot; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `address`: _string_ – Debot smart contract address -- `obj`: [AppDebotBrowser](mod\_AppDebotBrowser.md#appdebotbrowser) – [UNSTABLE](UNSTABLE.md) Debot Browser callbacks +- `obj`: [AppDebotBrowser](mod\_AppDebotBrowser.md#appdebotbrowser) – [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Debot Browser callbacks @@ -122,7 +127,7 @@ function init( ## start -[UNSTABLE](UNSTABLE.md) Starts the DeBot. +[UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Starts the DeBot. Downloads debot smart contract from blockchain and switches it to context zero. @@ -143,14 +148,19 @@ type ParamsOfStart = { function start( params: ParamsOfStart, ): Promise; + +function start_sync( + params: ParamsOfStart, +): void; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `debot_handle`: _[DebotHandle](mod\_debot.md#debothandle)_ – Debot handle which references an instance of debot engine. ## fetch -[UNSTABLE](UNSTABLE.md) Fetches DeBot metadata from blockchain. +[UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Fetches DeBot metadata from blockchain. Downloads DeBot from blockchain and creates and fetches its metadata. @@ -166,7 +176,12 @@ type ResultOfFetch = { function fetch( params: ParamsOfFetch, ): Promise; + +function fetch_sync( + params: ParamsOfFetch, +): ResultOfFetch; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `address`: _string_ – Debot smart contract address. @@ -178,7 +193,7 @@ function fetch( ## execute -[UNSTABLE](UNSTABLE.md) Executes debot action. +[UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Executes debot action. Calls debot engine referenced by debot handle to execute input action. Calls Debot Browser Callbacks if needed. @@ -195,7 +210,12 @@ type ParamsOfExecute = { function execute( params: ParamsOfExecute, ): Promise; + +function execute_sync( + params: ParamsOfExecute, +): void; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `debot_handle`: _[DebotHandle](mod\_debot.md#debothandle)_ – Debot handle which references an instance of debot engine. - `action`: _[DebotAction](mod\_debot.md#debotaction)_ – Debot Action that must be executed. @@ -203,7 +223,7 @@ function execute( ## send -[UNSTABLE](UNSTABLE.md) Sends message to Debot. +[UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Sends message to Debot. Used by Debot Browser to send response on Dinterface call or from other Debots. @@ -216,7 +236,12 @@ type ParamsOfSend = { function send( params: ParamsOfSend, ): Promise; + +function send_sync( + params: ParamsOfSend, +): void; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `debot_handle`: _[DebotHandle](mod\_debot.md#debothandle)_ – Debot handle which references an instance of debot engine. - `message`: _string_ – BOC of internal message to debot encoded in base64 format. @@ -224,7 +249,7 @@ function send( ## remove -[UNSTABLE](UNSTABLE.md) Destroys debot handle. +[UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Destroys debot handle. Removes handle from Client Context and drops debot engine referenced by that handle. @@ -236,7 +261,12 @@ type ParamsOfRemove = { function remove( params: ParamsOfRemove, ): Promise; + +function remove_sync( + params: ParamsOfRemove, +): void; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `debot_handle`: _[DebotHandle](mod\_debot.md#debothandle)_ – Debot handle which references an instance of debot engine. @@ -278,7 +308,7 @@ One of the following value: ## DebotHandle -[UNSTABLE](UNSTABLE.md) Handle of registered in SDK debot +[UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Handle of registered in SDK debot ```ts type DebotHandle = number @@ -286,7 +316,7 @@ type DebotHandle = number ## DebotAction -[UNSTABLE](UNSTABLE.md) Describes a debot action in a Debot Context. +[UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Describes a debot action in a Debot Context. ```ts type DebotAction = { @@ -311,7 +341,7 @@ type DebotAction = { ## DebotInfo -[UNSTABLE](UNSTABLE.md) Describes DeBot metadata. +[UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Describes DeBot metadata. ```ts type DebotInfo = { @@ -367,7 +397,7 @@ type DebotActivityTransactionVariant = { ## DebotActivity -[UNSTABLE](UNSTABLE.md) Describes the operation that the DeBot wants to perform. +[UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Describes the operation that the DeBot wants to perform. ```ts type DebotActivity = ({ @@ -396,7 +426,7 @@ function debotActivityTransaction(msg: string, dst: string, out: Spending[], fee ``` ## Spending -[UNSTABLE](UNSTABLE.md) Describes how much funds will be debited from the target contract balance as a result of the transaction. +[UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Describes how much funds will be debited from the target contract balance as a result of the transaction. ```ts type Spending = { @@ -409,7 +439,7 @@ type Spending = { ## ParamsOfInit -[UNSTABLE](UNSTABLE.md) Parameters to init DeBot. +[UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Parameters to init DeBot. ```ts type ParamsOfInit = { @@ -420,7 +450,7 @@ type ParamsOfInit = { ## RegisteredDebot -[UNSTABLE](UNSTABLE.md) Structure for storing debot handle returned from `init` function. +[UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Structure for storing debot handle returned from `init` function. ```ts type RegisteredDebot = { @@ -537,7 +567,7 @@ type ParamsOfAppDebotBrowserApproveVariant = { ## ParamsOfAppDebotBrowser -[UNSTABLE](UNSTABLE.md) Debot Browser callbacks +[UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Debot Browser callbacks Called by debot engine to communicate with debot browser. @@ -680,7 +710,7 @@ type ResultOfAppDebotBrowserApproveVariant = { ## ResultOfAppDebotBrowser -[UNSTABLE](UNSTABLE.md) Returning values from Debot Browser callbacks. +[UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Returning values from Debot Browser callbacks. ```ts type ResultOfAppDebotBrowser = ({ @@ -730,7 +760,7 @@ function resultOfAppDebotBrowserApprove(approved: boolean): ResultOfAppDebotBrow ``` ## ParamsOfStart -[UNSTABLE](UNSTABLE.md) Parameters to start DeBot. DeBot must be already initialized with init() function. +[UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Parameters to start DeBot. DeBot must be already initialized with init() function. ```ts type ParamsOfStart = { @@ -741,7 +771,7 @@ type ParamsOfStart = { ## ParamsOfFetch -[UNSTABLE](UNSTABLE.md) Parameters to fetch DeBot metadata. +[UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Parameters to fetch DeBot metadata. ```ts type ParamsOfFetch = { @@ -752,7 +782,7 @@ type ParamsOfFetch = { ## ResultOfFetch -[UNSTABLE](UNSTABLE.md) +[UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) ```ts type ResultOfFetch = { @@ -763,7 +793,7 @@ type ResultOfFetch = { ## ParamsOfExecute -[UNSTABLE](UNSTABLE.md) Parameters for executing debot action. +[UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Parameters for executing debot action. ```ts type ParamsOfExecute = { @@ -776,7 +806,7 @@ type ParamsOfExecute = { ## ParamsOfSend -[UNSTABLE](UNSTABLE.md) Parameters of `send` function. +[UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Parameters of `send` function. ```ts type ParamsOfSend = { @@ -789,7 +819,7 @@ type ParamsOfSend = { ## ParamsOfRemove -[UNSTABLE](UNSTABLE.md) +[UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) ```ts type ParamsOfRemove = { @@ -800,7 +830,7 @@ type ParamsOfRemove = { ## AppDebotBrowser -[UNSTABLE](UNSTABLE.md) Debot Browser callbacks +[UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Debot Browser callbacks Called by debot engine to communicate with debot browser. @@ -830,7 +860,12 @@ type ParamsOfAppDebotBrowserLogVariant = ParamsOfAppDebotBrowserLogVariant function log( params: ParamsOfAppDebotBrowserLogVariant, ): Promise<>; + +function log_sync( + params: ParamsOfAppDebotBrowserLogVariant, +): ; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `msg`: _string_ – A string that must be printed to user. @@ -845,7 +880,12 @@ type ParamsOfAppDebotBrowserSwitchVariant = ParamsOfAppDebotBrowserSwitchVariant function switch( params: ParamsOfAppDebotBrowserSwitchVariant, ): Promise<>; + +function switch_sync( + params: ParamsOfAppDebotBrowserSwitchVariant, +): ; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `context_id`: _number_ – Debot context ID to which debot is switched. @@ -856,7 +896,10 @@ Notify browser that all context actions are shown. ```ts function switch_completed(): Promise<>; + +function switch_completed_sync(): ; ``` +NOTE: Sync version is available only for `lib-node` binding. ## show_action @@ -869,7 +912,12 @@ type ParamsOfAppDebotBrowserShowActionVariant = ParamsOfAppDebotBrowserShowActio function show_action( params: ParamsOfAppDebotBrowserShowActionVariant, ): Promise<>; + +function show_action_sync( + params: ParamsOfAppDebotBrowserShowActionVariant, +): ; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `action`: _[DebotAction](mod\_debot.md#debotaction)_ – Debot action that must be shown to user as menu item. At least `description` property must be shown from [DebotAction] structure. @@ -886,7 +934,12 @@ type ResultOfAppDebotBrowserInputVariant = ResultOfAppDebotBrowserInputVariant function input( params: ParamsOfAppDebotBrowserInputVariant, ): Promise; + +function input_sync( + params: ParamsOfAppDebotBrowserInputVariant, +): ResultOfAppDebotBrowserInputVariant; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `prompt`: _string_ – A prompt string that must be printed to user before input request. @@ -906,7 +959,10 @@ Signing box returned is owned and disposed by debot engine type ResultOfAppDebotBrowserGetSigningBoxVariant = ResultOfAppDebotBrowserGetSigningBoxVariant function get_signing_box(): Promise; + +function get_signing_box_sync(): ResultOfAppDebotBrowserGetSigningBoxVariant; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Result @@ -925,7 +981,12 @@ type ParamsOfAppDebotBrowserInvokeDebotVariant = ParamsOfAppDebotBrowserInvokeDe function invoke_debot( params: ParamsOfAppDebotBrowserInvokeDebotVariant, ): Promise; + +function invoke_debot_sync( + params: ParamsOfAppDebotBrowserInvokeDebotVariant, +): void; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `debot_addr`: _string_ – Address of debot in blockchain. - `action`: _[DebotAction](mod\_debot.md#debotaction)_ – Debot action to execute. @@ -941,7 +1002,12 @@ type ParamsOfAppDebotBrowserSendVariant = ParamsOfAppDebotBrowserSendVariant function send( params: ParamsOfAppDebotBrowserSendVariant, ): Promise<>; + +function send_sync( + params: ParamsOfAppDebotBrowserSendVariant, +): ; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `message`: _string_ – Internal message to DInterface address.
Message body contains interface function and parameters. @@ -959,7 +1025,12 @@ type ResultOfAppDebotBrowserApproveVariant = ResultOfAppDebotBrowserApproveVaria function approve( params: ParamsOfAppDebotBrowserApproveVariant, ): Promise; + +function approve_sync( + params: ParamsOfAppDebotBrowserApproveVariant, +): ResultOfAppDebotBrowserApproveVariant; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `activity`: _[DebotActivity](mod\_debot.md#debotactivity)_ – DeBot activity details. diff --git a/docs/reference/types-and-methods/mod_net.md b/docs/reference/types-and-methods/mod_net.md index af72d1cf..52a3a8de 100644 --- a/docs/reference/types-and-methods/mod_net.md +++ b/docs/reference/types-and-methods/mod_net.md @@ -142,7 +142,12 @@ type ResultOfQuery = { function query( params: ParamsOfQuery, ): Promise; + +function query_sync( + params: ParamsOfQuery, +): ResultOfQuery; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `query`: _string_ – GraphQL query text. - `variables`?: _any_ – Variables used in query. @@ -170,7 +175,12 @@ type ResultOfBatchQuery = { function batch_query( params: ParamsOfBatchQuery, ): Promise; + +function batch_query_sync( + params: ParamsOfBatchQuery, +): ResultOfBatchQuery; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `operations`: _[ParamsOfQueryOperation](mod\_net.md#paramsofqueryoperation)[]_ – List of query operations that must be performed per single fetch. @@ -205,7 +215,12 @@ type ResultOfQueryCollection = { function query_collection( params: ParamsOfQueryCollection, ): Promise; + +function query_collection_sync( + params: ParamsOfQueryCollection, +): ResultOfQueryCollection; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `collection`: _string_ – Collection name (accounts, blocks, transactions, messages, block_signatures) - `filter`?: _any_ – Collection filter @@ -240,7 +255,12 @@ type ResultOfAggregateCollection = { function aggregate_collection( params: ParamsOfAggregateCollection, ): Promise; + +function aggregate_collection_sync( + params: ParamsOfAggregateCollection, +): ResultOfAggregateCollection; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `collection`: _string_ – Collection name (accounts, blocks, transactions, messages, block_signatures) - `filter`?: _any_ – Collection filter @@ -279,7 +299,12 @@ type ResultOfWaitForCollection = { function wait_for_collection( params: ParamsOfWaitForCollection, ): Promise; + +function wait_for_collection_sync( + params: ParamsOfWaitForCollection, +): ResultOfWaitForCollection; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `collection`: _string_ – Collection name (accounts, blocks, transactions, messages, block_signatures) - `filter`?: _any_ – Collection filter @@ -306,7 +331,12 @@ type ResultOfSubscribeCollection = { function unsubscribe( params: ResultOfSubscribeCollection, ): Promise; + +function unsubscribe_sync( + params: ResultOfSubscribeCollection, +): void; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `handle`: _number_ – Subscription handle.
Must be closed with `unsubscribe` @@ -372,7 +402,12 @@ function subscribe_collection( params: ParamsOfSubscribeCollection, responseHandler?: ResponseHandler, ): Promise; + +function subscribe_collection_sync( + params: ParamsOfSubscribeCollection, +): ResultOfSubscribeCollection; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `collection`: _string_ – Collection name (accounts, blocks, transactions, messages, block_signatures) - `filter`?: _any_ – Collection filter @@ -438,7 +473,12 @@ function subscribe( params: ParamsOfSubscribe, responseHandler?: ResponseHandler, ): Promise; + +function subscribe_sync( + params: ParamsOfSubscribe, +): ResultOfSubscribeCollection; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `subscription`: _string_ – GraphQL subscription text. - `variables`?: _any_ – Variables used in subscription. @@ -457,7 +497,10 @@ Suspends network module to stop any network activity ```ts function suspend(): Promise; + +function suspend_sync(): void; ``` +NOTE: Sync version is available only for `lib-node` binding. ## resume @@ -466,7 +509,10 @@ Resumes network module to enable network activity ```ts function resume(): Promise; + +function resume_sync(): void; ``` +NOTE: Sync version is available only for `lib-node` binding. ## find_last_shard_block @@ -485,7 +531,12 @@ type ResultOfFindLastShardBlock = { function find_last_shard_block( params: ParamsOfFindLastShardBlock, ): Promise; + +function find_last_shard_block_sync( + params: ParamsOfFindLastShardBlock, +): ResultOfFindLastShardBlock; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `address`: _string_ – Account address @@ -505,7 +556,10 @@ type EndpointsSet = { } function fetch_endpoints(): Promise; + +function fetch_endpoints_sync(): EndpointsSet; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Result @@ -525,7 +579,12 @@ type EndpointsSet = { function set_endpoints( params: EndpointsSet, ): Promise; + +function set_endpoints_sync( + params: EndpointsSet, +): void; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `endpoints`: _string[]_ – List of endpoints provided by server @@ -541,7 +600,10 @@ type ResultOfGetEndpoints = { } function get_endpoints(): Promise; + +function get_endpoints_sync(): ResultOfGetEndpoints; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Result @@ -573,7 +635,12 @@ type ResultOfQueryCollection = { function query_counterparties( params: ParamsOfQueryCounterparties, ): Promise; + +function query_counterparties_sync( + params: ParamsOfQueryCounterparties, +): ResultOfQueryCollection; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `account`: _string_ – Account address - `result`: _string_ – Projection (result) string @@ -638,7 +705,12 @@ type ResultOfQueryTransactionTree = { function query_transaction_tree( params: ParamsOfQueryTransactionTree, ): Promise; + +function query_transaction_tree_sync( + params: ParamsOfQueryTransactionTree, +): ResultOfQueryTransactionTree; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `in_msg`: _string_ – Input message id. - `abi_registry`?: _[Abi](mod\_abi.md#abi)[]_ – List of contract ABIs that will be used to decode message bodies. Library will try to decode each returned message body using any ABI from the registry. @@ -708,7 +780,12 @@ type RegisteredIterator = { function create_block_iterator( params: ParamsOfCreateBlockIterator, ): Promise; + +function create_block_iterator_sync( + params: ParamsOfCreateBlockIterator, +): RegisteredIterator; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `start_time`?: _number_ – Starting time to iterate from.
If the application specifies this parameter then the iteration
includes blocks with `gen_utime` >= `start_time`.
Otherwise the iteration starts from zero state.

Must be specified in seconds. @@ -746,7 +823,12 @@ type RegisteredIterator = { function resume_block_iterator( params: ParamsOfResumeBlockIterator, ): Promise; + +function resume_block_iterator_sync( + params: ParamsOfResumeBlockIterator, +): RegisteredIterator; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `resume_state`: _any_ – Iterator state from which to resume.
Same as value returned from `iterator_next`. @@ -835,7 +917,12 @@ type RegisteredIterator = { function create_transaction_iterator( params: ParamsOfCreateTransactionIterator, ): Promise; + +function create_transaction_iterator_sync( + params: ParamsOfCreateTransactionIterator, +): RegisteredIterator; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `start_time`?: _number_ – Starting time to iterate from.
If the application specifies this parameter then the iteration
includes blocks with `gen_utime` >= `start_time`.
Otherwise the iteration starts from zero state.

Must be specified in seconds. @@ -881,7 +968,12 @@ type RegisteredIterator = { function resume_transaction_iterator( params: ParamsOfResumeTransactionIterator, ): Promise; + +function resume_transaction_iterator_sync( + params: ParamsOfResumeTransactionIterator, +): RegisteredIterator; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `resume_state`: _any_ – Iterator state from which to resume.
Same as value returned from `iterator_next`. @@ -930,7 +1022,12 @@ type ResultOfIteratorNext = { function iterator_next( params: ParamsOfIteratorNext, ): Promise; + +function iterator_next_sync( + params: ParamsOfIteratorNext, +): ResultOfIteratorNext; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `iterator`: _number_ – Iterator handle - `limit`?: _number_ – Maximum count of the returned items. @@ -964,7 +1061,12 @@ type RegisteredIterator = { function remove_iterator( params: RegisteredIterator, ): Promise; + +function remove_iterator_sync( + params: RegisteredIterator, +): void; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `handle`: _number_ – Iterator handle.
Must be removed using `remove_iterator`
when it is no more needed for the application. @@ -980,7 +1082,10 @@ type ResultOfGetSignatureId = { } function get_signature_id(): Promise; + +function get_signature_id_sync(): ResultOfGetSignatureId; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Result diff --git a/docs/reference/types-and-methods/mod_processing.md b/docs/reference/types-and-methods/mod_processing.md index 173c48f5..c460d9e6 100644 --- a/docs/reference/types-and-methods/mod_processing.md +++ b/docs/reference/types-and-methods/mod_processing.md @@ -146,7 +146,12 @@ type ParamsOfMonitorMessages = { function monitor_messages( params: ParamsOfMonitorMessages, ): Promise; + +function monitor_messages_sync( + params: ParamsOfMonitorMessages, +): void; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `queue`: _string_ – Name of the monitoring queue. - `messages`: _[MessageMonitoringParams](mod\_processing.md#messagemonitoringparams)[]_ – Messages to start monitoring for. @@ -169,7 +174,12 @@ type MonitoringQueueInfo = { function get_monitor_info( params: ParamsOfGetMonitorInfo, ): Promise; + +function get_monitor_info_sync( + params: ParamsOfGetMonitorInfo, +): MonitoringQueueInfo; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `queue`: _string_ – Name of the monitoring queue. @@ -200,7 +210,12 @@ type ResultOfFetchNextMonitorResults = { function fetch_next_monitor_results( params: ParamsOfFetchNextMonitorResults, ): Promise; + +function fetch_next_monitor_results_sync( + params: ParamsOfFetchNextMonitorResults, +): ResultOfFetchNextMonitorResults; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `queue`: _string_ – Name of the monitoring queue. - `wait_mode`?: _[MonitorFetchWaitMode](mod\_processing.md#monitorfetchwaitmode)_ – Wait mode. @@ -224,7 +239,12 @@ type ParamsOfCancelMonitor = { function cancel_monitor( params: ParamsOfCancelMonitor, ): Promise; + +function cancel_monitor_sync( + params: ParamsOfCancelMonitor, +): void; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `queue`: _string_ – Name of the monitoring queue. @@ -246,7 +266,12 @@ type ResultOfSendMessages = { function send_messages( params: ParamsOfSendMessages, ): Promise; + +function send_messages_sync( + params: ParamsOfSendMessages, +): ResultOfSendMessages; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `messages`: _[MessageSendingParams](mod\_processing.md#messagesendingparams)[]_ – Messages that must be sent to the blockchain. - `monitor_queue`?: _string_ – Optional message monitor queue that starts monitoring for the processing results for sent messages. @@ -268,7 +293,7 @@ before the message was sent. It will be required later for message processing. type ParamsOfSendMessage = { message: string, abi?: Abi, - send_events: boolean + send_events?: boolean } type ResultOfSendMessage = { @@ -280,12 +305,17 @@ function send_message( params: ParamsOfSendMessage, responseHandler?: ResponseHandler, ): Promise; + +function send_message_sync( + params: ParamsOfSendMessage, +): ResultOfSendMessage; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `message`: _string_ – Message BOC. - `abi`?: _[Abi](mod\_abi.md#abi)_ – Optional message ABI.
If this parameter is specified and the message has the
`expire` header then expiration time will be checked against
the current time to prevent unnecessary sending of already expired message.

The `message already expired` error will be returned in this
case.

Note, that specifying `abi` for ABI compliant contracts is
strongly recommended, so that proper processing strategy can be
chosen. -- `send_events`: _boolean_ – Flag for requesting events sending +- `send_events`?: _boolean_ – Flag for requesting events sending. Default is `false`. - `responseHandler`?: _[ResponseHandler](modules.md#responsehandler)_ – additional responses handler. ### Result @@ -330,7 +360,7 @@ type ParamsOfWaitForTransaction = { abi?: Abi, message: string, shard_block_id: string, - send_events: boolean, + send_events?: boolean, sending_endpoints?: string[] } @@ -345,7 +375,12 @@ function wait_for_transaction( params: ParamsOfWaitForTransaction, responseHandler?: ResponseHandler, ): Promise; + +function wait_for_transaction_sync( + params: ParamsOfWaitForTransaction, +): ResultOfProcessMessage; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `abi`?: _[Abi](mod\_abi.md#abi)_ – Optional ABI for decoding the transaction result.
If it is specified, then the output messages' bodies will be
decoded according to this ABI.

The `abi_decoded` result field will be filled out. @@ -353,7 +388,7 @@ function wait_for_transaction(
Encoded with `base64`. - `shard_block_id`: _string_ – The last generated block id of the destination account shard before the message was sent.
You must provide the same value as the `send_message` has returned. -- `send_events`: _boolean_ – Flag that enables/disables intermediate events +- `send_events`?: _boolean_ – Flag that enables/disables intermediate events. Default is `false`. - `sending_endpoints`?: _string[]_ – The list of endpoints to which the message was sent.
Use this field to get more informative errors.
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. - `responseHandler`?: _[ResponseHandler](modules.md#responsehandler)_ – additional responses handler. @@ -392,7 +427,7 @@ then, if no transaction is found within the network timeout (see config paramete ```ts type ParamsOfProcessMessage = { message_encode_params: ParamsOfEncodeMessage, - send_events: boolean + send_events?: boolean } type ResultOfProcessMessage = { @@ -406,10 +441,15 @@ function process_message( params: ParamsOfProcessMessage, responseHandler?: ResponseHandler, ): Promise; + +function process_message_sync( + params: ParamsOfProcessMessage, +): ResultOfProcessMessage; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `message_encode_params`: _[ParamsOfEncodeMessage](mod\_abi.md#paramsofencodemessage)_ – Message encode parameters. -- `send_events`: _boolean_ – Flag for requesting events sending +- `send_events`?: _boolean_ – Flag for requesting events sending. Default is `false`. - `responseHandler`?: _[ResponseHandler](modules.md#responsehandler)_ – additional responses handler. ### Result @@ -1187,13 +1227,13 @@ type ResultOfSendMessages = { type ParamsOfSendMessage = { message: string, abi?: Abi, - send_events: boolean + send_events?: boolean } ``` - `message`: _string_ – Message BOC. - `abi`?: _[Abi](mod\_abi.md#abi)_ – Optional message ABI.
If this parameter is specified and the message has the
`expire` header then expiration time will be checked against
the current time to prevent unnecessary sending of already expired message.

The `message already expired` error will be returned in this
case.

Note, that specifying `abi` for ABI compliant contracts is
strongly recommended, so that proper processing strategy can be
chosen. -- `send_events`: _boolean_ – Flag for requesting events sending +- `send_events`?: _boolean_ – Flag for requesting events sending. Default is `false`. ## ResultOfSendMessage @@ -1215,7 +1255,7 @@ type ParamsOfWaitForTransaction = { abi?: Abi, message: string, shard_block_id: string, - send_events: boolean, + send_events?: boolean, sending_endpoints?: string[] } ``` @@ -1225,7 +1265,7 @@ type ParamsOfWaitForTransaction = {
Encoded with `base64`. - `shard_block_id`: _string_ – The last generated block id of the destination account shard before the message was sent.
You must provide the same value as the `send_message` has returned. -- `send_events`: _boolean_ – Flag that enables/disables intermediate events +- `send_events`?: _boolean_ – Flag that enables/disables intermediate events. Default is `false`. - `sending_endpoints`?: _string[]_ – The list of endpoints to which the message was sent.
Use this field to get more informative errors.
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. @@ -1234,10 +1274,10 @@ type ParamsOfWaitForTransaction = { ```ts type ParamsOfProcessMessage = { message_encode_params: ParamsOfEncodeMessage, - send_events: boolean + send_events?: boolean } ``` - `message_encode_params`: _[ParamsOfEncodeMessage](mod\_abi.md#paramsofencodemessage)_ – Message encode parameters. -- `send_events`: _boolean_ – Flag for requesting events sending +- `send_events`?: _boolean_ – Flag for requesting events sending. Default is `false`. diff --git a/docs/reference/types-and-methods/mod_proofs.md b/docs/reference/types-and-methods/mod_proofs.md index 77275fc7..32302b16 100644 --- a/docs/reference/types-and-methods/mod_proofs.md +++ b/docs/reference/types-and-methods/mod_proofs.md @@ -1,6 +1,6 @@ # Module proofs -[UNSTABLE](UNSTABLE.md) Module for proving data, retrieved from TONOS API. +[UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Module for proving data, retrieved from TONOS API. ## Functions @@ -92,7 +92,12 @@ type ParamsOfProofBlockData = { function proof_block_data( params: ParamsOfProofBlockData, ): Promise; + +function proof_block_data_sync( + params: ParamsOfProofBlockData, +): void; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `block`: _any_ – 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. @@ -125,7 +130,12 @@ type ParamsOfProofTransactionData = { function proof_transaction_data( params: ParamsOfProofTransactionData, ): Promise; + +function proof_transaction_data_sync( + params: ParamsOfProofTransactionData, +): void; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `transaction`: _any_ – 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. @@ -158,7 +168,12 @@ type ParamsOfProofMessageData = { function proof_message_data( params: ParamsOfProofMessageData, ): Promise; + +function proof_message_data_sync( + params: ParamsOfProofMessageData, +): void; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `message`: _any_ – 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`. diff --git a/docs/reference/types-and-methods/mod_tvm.md b/docs/reference/types-and-methods/mod_tvm.md index 6af31900..174559ad 100644 --- a/docs/reference/types-and-methods/mod_tvm.md +++ b/docs/reference/types-and-methods/mod_tvm.md @@ -95,7 +95,12 @@ type ResultOfRunExecutor = { function run_executor( params: ParamsOfRunExecutor, ): Promise; + +function run_executor_sync( + params: ParamsOfRunExecutor, +): ResultOfRunExecutor; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `message`: _string_ – Input message BOC.
Must be encoded as base64. @@ -157,7 +162,12 @@ type ResultOfRunTvm = { function run_tvm( params: ParamsOfRunTvm, ): Promise; + +function run_tvm_sync( + params: ParamsOfRunTvm, +): ResultOfRunTvm; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `message`: _string_ – Input message BOC.
Must be encoded as base64. @@ -203,7 +213,12 @@ type ResultOfRunGet = { function run_get( params: ParamsOfRunGet, ): Promise; + +function run_get_sync( + params: ParamsOfRunGet, +): ResultOfRunGet; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `account`: _string_ – Account BOC in `base64` - `function_name`: _string_ – Function name diff --git a/docs/reference/types-and-methods/mod_utils.md b/docs/reference/types-and-methods/mod_utils.md index a2c0ff55..db24f202 100644 --- a/docs/reference/types-and-methods/mod_utils.md +++ b/docs/reference/types-and-methods/mod_utils.md @@ -64,7 +64,12 @@ type ResultOfConvertAddress = { function convert_address( params: ParamsOfConvertAddress, ): Promise; + +function convert_address_sync( + params: ParamsOfConvertAddress, +): ResultOfConvertAddress; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `address`: _string_ – Account address in any TON format. - `output_format`: _[AddressStringFormat](mod\_utils.md#addressstringformat)_ – Specify the format to convert to. @@ -100,7 +105,12 @@ type ResultOfGetAddressType = { function get_address_type( params: ParamsOfGetAddressType, ): Promise; + +function get_address_type_sync( + params: ParamsOfGetAddressType, +): ResultOfGetAddressType; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `address`: _string_ – Account address in any TON format. @@ -127,7 +137,12 @@ type ResultOfCalcStorageFee = { function calc_storage_fee( params: ParamsOfCalcStorageFee, ): Promise; + +function calc_storage_fee_sync( + params: ParamsOfCalcStorageFee, +): ResultOfCalcStorageFee; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `account`: _string_ - `period`: _number_ @@ -155,7 +170,12 @@ type ResultOfCompressZstd = { function compress_zstd( params: ParamsOfCompressZstd, ): Promise; + +function compress_zstd_sync( + params: ParamsOfCompressZstd, +): ResultOfCompressZstd; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `uncompressed`: _string_ – Uncompressed data.
Must be encoded as base64. @@ -184,7 +204,12 @@ type ResultOfDecompressZstd = { function decompress_zstd( params: ParamsOfDecompressZstd, ): Promise; + +function decompress_zstd_sync( + params: ParamsOfDecompressZstd, +): ResultOfDecompressZstd; ``` +NOTE: Sync version is available only for `lib-node` binding. ### Parameters - `compressed`: _string_ – Compressed data.
Must be encoded as base64. diff --git a/docs/reference/types-and-methods/modules.md b/docs/reference/types-and-methods/modules.md index b0b8f343..939c0548 100644 --- a/docs/reference/types-and-methods/modules.md +++ b/docs/reference/types-and-methods/modules.md @@ -289,21 +289,21 @@ Where: [get_signature_id](mod\_net.md#get_signature_id) – Returns signature ID for configured network if it should be used in messages signature -## [debot](mod\_debot.md) – [UNSTABLE](UNSTABLE.md) Module for working with debot. +## [debot](mod\_debot.md) – [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Module for working with debot. -[init](mod\_debot.md#init) – [UNSTABLE](UNSTABLE.md) Creates and instance of DeBot. +[init](mod\_debot.md#init) – [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Creates and instance of DeBot. -[start](mod\_debot.md#start) – [UNSTABLE](UNSTABLE.md) Starts the DeBot. +[start](mod\_debot.md#start) – [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Starts the DeBot. -[fetch](mod\_debot.md#fetch) – [UNSTABLE](UNSTABLE.md) Fetches DeBot metadata from blockchain. +[fetch](mod\_debot.md#fetch) – [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Fetches DeBot metadata from blockchain. -[execute](mod\_debot.md#execute) – [UNSTABLE](UNSTABLE.md) Executes debot action. +[execute](mod\_debot.md#execute) – [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Executes debot action. -[send](mod\_debot.md#send) – [UNSTABLE](UNSTABLE.md) Sends message to Debot. +[send](mod\_debot.md#send) – [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Sends message to Debot. -[remove](mod\_debot.md#remove) – [UNSTABLE](UNSTABLE.md) Destroys debot handle. +[remove](mod\_debot.md#remove) – [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Destroys debot handle. -## [proofs](mod\_proofs.md) – [UNSTABLE](UNSTABLE.md) Module for proving data, retrieved from TONOS API. +## [proofs](mod\_proofs.md) – [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Module for proving data, retrieved from TONOS API. [proof_block_data](mod\_proofs.md#proof_block_data) – Proves that a given block's data, which is queried from TONOS API, can be trusted. diff --git a/ton_client/Cargo.toml b/ton_client/Cargo.toml index 4cd46ba3..ff2a31f1 100644 --- a/ton_client/Cargo.toml +++ b/ton_client/Cargo.toml @@ -1,6 +1,6 @@ [package] name = 'ton_client' -version = '1.44.0' +version = '1.44.1' authors = [ 'TON Labs LTD ' ] edition = '2018' license = 'Apache-2.0' diff --git a/ton_client/src/debot/activity.rs b/ton_client/src/debot/activity.rs index 2ae1e1d0..75daba18 100644 --- a/ton_client/src/debot/activity.rs +++ b/ton_client/src/debot/activity.rs @@ -1,5 +1,5 @@ -/// [UNSTABLE](UNSTABLE.md) Describes how much funds will be debited from the target +/// [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Describes how much funds will be debited from the target /// contract balance as a result of the transaction. #[derive(Serialize, Deserialize, Clone, Debug, ApiType, PartialEq)] pub struct Spending { @@ -9,7 +9,7 @@ pub struct Spending { pub dst: String, } -/// [UNSTABLE](UNSTABLE.md) Describes the operation that the DeBot wants to perform. +/// [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Describes the operation that the DeBot wants to perform. #[derive(Serialize, Deserialize, Clone, Debug, ApiType)] #[serde(tag="type")] pub enum DebotActivity { diff --git a/ton_client/src/debot/mod.rs b/ton_client/src/debot/mod.rs index ae028acc..0845b178 100644 --- a/ton_client/src/debot/mod.rs +++ b/ton_client/src/debot/mod.rs @@ -58,11 +58,11 @@ pub const DEBOT_WC: i8 = -31; // 0xDB type TonClient = Arc; type JsonValue = serde_json::Value; -/// [UNSTABLE](UNSTABLE.md) Handle of registered in SDK debot +/// [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Handle of registered in SDK debot #[derive(Serialize, Deserialize, Default, ApiType, Clone)] pub struct DebotHandle(u32); -/// [UNSTABLE](UNSTABLE.md) Describes a debot action in a Debot Context. +/// [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Describes a debot action in a Debot Context. #[derive(Serialize, Deserialize, Clone, Debug, ApiType, Default, PartialEq)] pub struct DebotAction { /// A short action description. Should be used by Debot Browser as name of @@ -108,7 +108,7 @@ impl Into for DebotAction { } } -/// [UNSTABLE](UNSTABLE.md) Describes DeBot metadata. +/// [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Describes DeBot metadata. #[derive(Serialize, Deserialize, Clone, Debug, ApiType, Default, PartialEq)] pub struct DebotInfo { /// DeBot short name. @@ -157,7 +157,7 @@ impl From for DebotInfo { } } -/// [UNSTABLE](UNSTABLE.md) Parameters to start DeBot. +/// [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Parameters to start DeBot. /// DeBot must be already initialized with init() function. #[derive(Serialize, Deserialize, Default, ApiType)] pub struct ParamsOfStart { @@ -165,7 +165,7 @@ pub struct ParamsOfStart { debot_handle: DebotHandle, } -/// [UNSTABLE](UNSTABLE.md) Starts the DeBot. +/// [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Starts the DeBot. /// /// Downloads debot smart contract from blockchain and switches it to /// context zero. @@ -190,21 +190,21 @@ pub async fn start( dengine.start().await.map_err(Error::start_failed) } -/// [UNSTABLE](UNSTABLE.md) Parameters to fetch DeBot metadata. +/// [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Parameters to fetch DeBot metadata. #[derive(Serialize, Deserialize, Default, ApiType)] pub struct ParamsOfFetch { /// Debot smart contract address. pub address: String, } -/// [UNSTABLE](UNSTABLE.md) +/// [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) #[derive(Serialize, Deserialize, Default, ApiType)] pub struct ResultOfFetch { /// Debot metadata. pub info: DebotInfo, } -/// [UNSTABLE](UNSTABLE.md) Fetches DeBot metadata from blockchain. +/// [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Fetches DeBot metadata from blockchain. /// /// Downloads DeBot from blockchain and creates and fetches its metadata. #[api_function] @@ -217,14 +217,14 @@ pub async fn fetch( }) } -/// [UNSTABLE](UNSTABLE.md) Parameters to init DeBot. +/// [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Parameters to init DeBot. #[derive(Serialize, Deserialize, Default, ApiType)] pub struct ParamsOfInit { /// Debot smart contract address pub address: String, } -/// [UNSTABLE](UNSTABLE.md) Structure for storing debot handle returned from `init` function. +/// [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Structure for storing debot handle returned from `init` function. #[derive(Serialize, Deserialize, ApiType, Default)] pub struct RegisteredDebot { /// Debot handle which references an instance of debot engine. @@ -235,7 +235,7 @@ pub struct RegisteredDebot { pub info: DebotInfo, } -/// [UNSTABLE](UNSTABLE.md) Creates an instance of DeBot. +/// [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Creates an instance of DeBot. /// /// Downloads DeBot smart contract (code and data) from blockchain and creates /// an instance of Debot Engine for it. @@ -258,7 +258,7 @@ pub async fn init( Ok(RegisteredDebot { debot_handle: DebotHandle(handle), info, debot_abi }) } -/// [UNSTABLE](UNSTABLE.md) Parameters for executing debot action. +/// [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Parameters for executing debot action. #[derive(Serialize, Deserialize, ApiType, Default)] pub struct ParamsOfExecute { /// Debot handle which references an instance of debot engine. @@ -267,7 +267,7 @@ pub struct ParamsOfExecute { pub action: DebotAction, } -/// [UNSTABLE](UNSTABLE.md) Executes debot action. +/// [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Executes debot action. /// /// Calls debot engine referenced by debot handle to execute input action. /// Calls Debot Browser Callbacks if needed. @@ -287,14 +287,14 @@ pub async fn execute(context: Arc, params: ParamsOfExecute) -> Cl .map_err(Error::execute_failed) } -/// [UNSTABLE](UNSTABLE.md) +/// [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) #[derive(Serialize, Deserialize, ApiType, Default)] pub struct ParamsOfRemove { /// Debot handle which references an instance of debot engine. pub debot_handle: DebotHandle, } -/// [UNSTABLE](UNSTABLE.md) Destroys debot handle. +/// [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Destroys debot handle. /// /// Removes handle from Client Context and drops debot engine referenced by that handle. #[api_function] @@ -303,7 +303,7 @@ pub fn remove(context: Arc, params: ParamsOfRemove) -> ClientResu Ok(()) } -/// [UNSTABLE](UNSTABLE.md) Parameters of `send` function. +/// [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Parameters of `send` function. #[derive(Serialize, Deserialize, ApiType, Default)] pub struct ParamsOfSend { /// Debot handle which references an instance of debot engine. @@ -312,7 +312,7 @@ pub struct ParamsOfSend { pub message: String, } -/// [UNSTABLE](UNSTABLE.md) Sends message to Debot. +/// [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Sends message to Debot. /// /// Used by Debot Browser to send response on Dinterface call or from other Debots. #[api_function] diff --git a/ton_client/src/json_interface/debot.rs b/ton_client/src/json_interface/debot.rs index ec3ac788..98bee828 100644 --- a/ton_client/src/json_interface/debot.rs +++ b/ton_client/src/json_interface/debot.rs @@ -18,7 +18,7 @@ use crate::debot::Error; use crate::debot::{DAction, DebotAction, BrowserCallbacks, ParamsOfInit, RegisteredDebot, DebotActivity}; use crate::crypto::SigningBoxHandle; -/// [UNSTABLE](UNSTABLE.md) Returning values from Debot Browser callbacks. +/// [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Returning values from Debot Browser callbacks. #[derive(Serialize, Deserialize, Clone, Debug, ApiType)] #[serde(tag="type")] pub enum ResultOfAppDebotBrowser { @@ -41,7 +41,7 @@ pub enum ResultOfAppDebotBrowser { } } -/// [UNSTABLE](UNSTABLE.md) Debot Browser callbacks +/// [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Debot Browser callbacks /// /// Called by debot engine to communicate with debot browser. #[derive(Serialize, Deserialize, Clone, Debug, ApiType)] @@ -184,7 +184,7 @@ impl DebotBrowserAdapter { } } -/// [UNSTABLE](UNSTABLE.md) Creates and instance of DeBot. +/// [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Creates and instance of DeBot. /// /// Downloads debot smart contract (code and data) from blockchain and creates /// an instance of Debot Engine for it. diff --git a/ton_client/src/json_interface/modules.rs b/ton_client/src/json_interface/modules.rs index 9e5d11a2..23900aed 100644 --- a/ton_client/src/json_interface/modules.rs +++ b/ton_client/src/json_interface/modules.rs @@ -671,7 +671,7 @@ fn register_utils(handlers: &mut RuntimeHandlers) { module.register(); } -/// [UNSTABLE](UNSTABLE.md) Module for working with debot. +/// [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Module for working with debot. #[derive(ApiModule)] #[api_module(name = "debot")] pub struct DebotModule; @@ -698,7 +698,7 @@ fn register_debot(handlers: &mut RuntimeHandlers) { module.register(); } -/// [UNSTABLE](UNSTABLE.md) Module for proving data, retrieved from TONOS API. +/// [UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Module for proving data, retrieved from TONOS API. #[derive(ApiModule)] #[api_module(name = "proofs")] pub struct ProofsModule; diff --git a/ton_client/src/json_interface/registrar.rs b/ton_client/src/json_interface/registrar.rs index 70d7d5cd..f4d51dd2 100644 --- a/ton_client/src/json_interface/registrar.rs +++ b/ton_client/src/json_interface/registrar.rs @@ -138,16 +138,23 @@ impl<'h> ModuleReg<'h> { self.module.functions.push(function); self.handlers .register_async(name.clone(), Box::new(SpawnHandlerCallback::new(handler))); + #[cfg(not(feature = "wasm-base"))] + self.handlers.register_sync( + name, + Box::new(CallHandler::new(move |context, params| { + context.clone().env.block_on(handler( + context, + params, + Arc::new(Request::new(1, |_, _, _, _| {})), + )) + })), + ); } #[allow(dead_code)] pub fn register_async_fn_with_app_object( &mut self, - handler: fn( - context: Arc, - params: P, - app_object: AppObject, - ) -> F, + handler: fn(context: Arc, params: P, app_object: AppObject) -> F, api: fn() -> api_info::Function, ) where P: ApiType + Send + DeserializeOwned + Default + 'static, diff --git a/ton_client/src/processing/process_message.rs b/ton_client/src/processing/process_message.rs index 7db5f50c..4c4a3151 100644 --- a/ton_client/src/processing/process_message.rs +++ b/ton_client/src/processing/process_message.rs @@ -14,7 +14,9 @@ pub struct ParamsOfProcessMessage { /// Message encode parameters. pub message_encode_params: ParamsOfEncodeMessage, - /// Flag for requesting events sending + /// Flag for requesting events sending. + /// Default is `false`. + #[serde(default)] pub send_events: bool, } @@ -82,7 +84,7 @@ pub async fn process_message + Send>( return Err(err); } if params.send_events { - callback(ProcessingEvent::MessageExpired { + callback(ProcessingEvent::MessageExpired { message_id: message.message_id, message_dst: message.address, message: message.message, diff --git a/ton_client/src/processing/send_message.rs b/ton_client/src/processing/send_message.rs index 0351f127..a8c1e5e3 100644 --- a/ton_client/src/processing/send_message.rs +++ b/ton_client/src/processing/send_message.rs @@ -44,7 +44,9 @@ pub struct ParamsOfSendMessage { /// chosen. pub abi: Option, - /// Flag for requesting events sending + /// Flag for requesting events sending. + /// Default is `false`. + #[serde(default)] pub send_events: bool, } diff --git a/ton_client/src/processing/tests.rs b/ton_client/src/processing/tests.rs index de7338de..d88e974d 100644 --- a/ton_client/src/processing/tests.rs +++ b/ton_client/src/processing/tests.rs @@ -762,3 +762,94 @@ async fn test_deploy_from_tvc_v1() { }) ); } + +#[test] +fn test_process_message_sync() { + TestClient::init_log(); + let client = TestClient::new(); + let (events_abi, events_tvc) = TestClient::package(EVENTS_OLD, Some(2)); + let keys = client.generate_sign_keys(); + let abi = events_abi.clone(); + + let encode_params = ParamsOfEncodeMessage { + abi: abi.clone(), + deploy_set: DeploySet::some_with_tvc(events_tvc.clone()), + call_set: Some(CallSet { + function_name: "constructor".into(), + header: Some(FunctionHeader { + expire: None, + time: None, + pubkey: Some(keys.public.clone()), + }), + input: None, + }), + signer: Signer::Keys { keys: keys.clone() }, + ..Default::default() + }; + + let encoded = client.encode_message_sync(encode_params.clone()).unwrap(); + + client.get_tokens_from_giver_sync(&encoded.address, None); + + let output = client + .process_message_sync( + ParamsOfProcessMessage { + message_encode_params: encode_params, + send_events: true, + }, + ) + .unwrap(); + + assert!(output.fees.total_account_fees > 0); + assert_eq!(output.out_messages.len(), 0); + assert_eq!( + output.decoded, + Some(DecodedOutput { + out_messages: vec![], + output: None, + }) + ); + + let output = client + .process_message_sync( + ParamsOfProcessMessage { + message_encode_params: ParamsOfEncodeMessage { + abi: abi.clone(), + address: Some(encoded.address.clone()), + call_set: CallSet::some_with_function_and_input( + "returnValue", + json!({ + "id": "0x1" + }), + ), + signer: Signer::Keys { keys: keys.clone() }, + ..Default::default() + }, + send_events: true, + }, + ) + .unwrap(); + assert_eq!(output.out_messages.len(), 2); + assert_eq!( + output.decoded, + Some(DecodedOutput { + out_messages: vec![ + Some(DecodedMessageBody { + body_type: MessageBodyType::Event, + name: "EventThrown".into(), + value: Some(json!({"id": abi_uint(1, 256)})), + header: None, + }), + Some(DecodedMessageBody { + body_type: MessageBodyType::Output, + name: "returnValue".into(), + value: Some(json!({"value0": abi_uint(1, 256)})), + header: None, + }) + ], + output: Some(json!({ + "value0": abi_uint(1, 256) + })), + }) + ); +} diff --git a/ton_client/src/processing/wait_for_transaction.rs b/ton_client/src/processing/wait_for_transaction.rs index 613dec62..b6d829de 100644 --- a/ton_client/src/processing/wait_for_transaction.rs +++ b/ton_client/src/processing/wait_for_transaction.rs @@ -33,7 +33,9 @@ pub struct ParamsOfWaitForTransaction { /// You must provide the same value as the `send_message` has returned. pub shard_block_id: String, - /// Flag that enables/disables intermediate events + /// Flag that enables/disables intermediate events. + /// Default is `false`. + #[serde(default)] pub send_events: bool, /// The list of endpoints to which the message was sent. diff --git a/ton_client/src/proofs/trusted_key_blocks.bin b/ton_client/src/proofs/trusted_key_blocks.bin index df67b196..f1d13c9c 100644 Binary files a/ton_client/src/proofs/trusted_key_blocks.bin and b/ton_client/src/proofs/trusted_key_blocks.bin differ diff --git a/ton_client/src/tests/mod.rs b/ton_client/src/tests/mod.rs index 230c92f3..81260107 100644 --- a/ton_client/src/tests/mod.rs +++ b/ton_client/src/tests/mod.rs @@ -16,13 +16,13 @@ use crate::abi::{ encode_message, Abi, CallSet, DeploySet, ParamsOfEncodeMessage, ResultOfEncodeMessage, Signer, }; use crate::client::*; -use crate::net::{ParamsOfQuery, ResultOfQuery}; use crate::crypto::{ ParamsOfNaclSignDetached, ParamsOfNaclSignKeyPairFromSecret, ResultOfNaclSignDetached, }; use crate::json_interface::interop::{ResponseType, StringData}; use crate::json_interface::modules::{AbiModule, NetModule, ProcessingModule}; use crate::json_interface::runtime::Runtime; +use crate::net::{ParamsOfQuery, ResultOfQuery}; use crate::processing::{ParamsOfProcessMessage, ResultOfProcessMessage}; use crate::{ crypto::KeyPair, @@ -291,7 +291,7 @@ impl TestClient { "v3" => Self::abi(GIVER_V3, Some(2)), "v2" => Self::abi(GIVER_V2, Some(2)), "v1" => Self::abi("Giver", Some(1)), - _ => panic!("Unknown giver type") + _ => panic!("Unknown giver type"), } } @@ -300,13 +300,13 @@ impl TestClient { "v3" => Self::tvc(GIVER_V3, Some(2)), "v2" => Self::tvc(GIVER_V2, Some(2)), "v1" => Self::tvc("Giver", Some(1)), - _ => panic!("Unknown giver type") + _ => panic!("Unknown giver type"), } } async fn calc_giver_address(&self, keys: KeyPair) -> String { self.encode_message(ParamsOfEncodeMessage { - abi: Self::giver_abi(), + abi: Self::giver_abi(), deploy_set: DeploySet::some_with_tvc(Self::giver_tvc()), signer: Signer::Keys { keys }, ..Default::default() @@ -420,7 +420,8 @@ impl TestClient { } pub fn init_simple_logger() { - let _ = log::set_boxed_logger(Box::new(SimpleLogger)).map(|()| log::set_max_level(MAX_LEVEL)); + let _ = + log::set_boxed_logger(Box::new(SimpleLogger)).map(|()| log::set_max_level(MAX_LEVEL)); } pub(crate) fn init_log() { @@ -634,6 +635,13 @@ impl TestClient { encode.call(params).await } + pub(crate) fn encode_message_sync( + &self, + params: ParamsOfEncodeMessage, + ) -> ClientResult { + self.request("abi.encode_message", params) + } + pub(crate) async fn net_process_message( &self, params: ParamsOfProcessMessage, @@ -652,6 +660,13 @@ impl TestClient { process.call_with_callback(params, callback).await } + pub(crate) fn process_message_sync( + &self, + params: ParamsOfProcessMessage, + ) -> ClientResult { + self.request("processing.process_message", params) + } + pub(crate) async fn fetch_account(&self, address: &str) -> Value { let wait_for = self.wrap_async( crate::net::wait_for_collection, @@ -700,7 +715,11 @@ impl TestClient { .await } - pub(crate) async fn get_tokens_from_giver_async(&self, account: &str, value: Option) -> ResultOfProcessMessage { + pub(crate) async fn get_tokens_from_giver_async( + &self, + account: &str, + value: Option, + ) -> ResultOfProcessMessage { let giver_exists: ResultOfQuery = self .request_async( "net.query", @@ -713,38 +732,39 @@ impl TestClient { } } } - }"#.to_string(), + }"# + .to_string(), variables: Some(json!({"addr": self.giver_address().await})), }, ) .await .unwrap_or_default(); - if giver_exists.result["data"]["blockchain"]["account"]["info"]["acc_type"].as_i64().unwrap_or_default() != 1 { + if giver_exists.result["data"]["blockchain"]["account"]["info"]["acc_type"] + .as_i64() + .unwrap_or_default() + != 1 + { panic!("The giver contract should be deployed and active"); } let (function, input) = match env::giver_type().as_str() { - "v1" => { - ( - "sendGrams", - json!({ - "dest": account.to_string(), - "amount": value.unwrap_or(500_000_000u64), - }) - ) - }, - "v2" | "v3" => { - ( - "sendTransaction", - json!({ - "dest": account.to_string(), - "value": value.unwrap_or(500_000_000u64), - "bounce": false, - }) - ) - }, - _ => panic!("Unknown giver version") + "v1" => ( + "sendGrams", + json!({ + "dest": account.to_string(), + "amount": value.unwrap_or(500_000_000u64), + }), + ), + "v2" | "v3" => ( + "sendTransaction", + json!({ + "dest": account.to_string(), + "value": value.unwrap_or(500_000_000u64), + "bounce": false, + }), + ), + _ => panic!("Unknown giver version"), }; let run_result = self .net_process_function( @@ -781,6 +801,17 @@ impl TestClient { run_result } + pub(crate) fn get_tokens_from_giver_sync( + &self, + account: &str, + value: Option, + ) -> ResultOfProcessMessage { + self.context() + .clone() + .env + .block_on(self.get_tokens_from_giver_async(account, value)) + } + pub(crate) async fn deploy_with_giver_async( &self, params: ParamsOfEncodeMessage, diff --git a/ton_client_processing/Cargo.toml b/ton_client_processing/Cargo.toml index b75e0a96..9367066d 100644 --- a/ton_client_processing/Cargo.toml +++ b/ton_client_processing/Cargo.toml @@ -1,6 +1,6 @@ [package] name = 'ton_client_processing' -version = '1.44.0' +version = '1.44.1' authors = [ 'TON Labs LTD ' ] edition = '2018' license = 'Apache-2.0' diff --git a/ton_sdk/Cargo.toml b/ton_sdk/Cargo.toml index 4c40e8a7..1574b564 100644 --- a/ton_sdk/Cargo.toml +++ b/ton_sdk/Cargo.toml @@ -1,6 +1,6 @@ [package] name = 'ton_sdk' -version = '1.44.0' +version = '1.44.1' edition = '2018' license = 'Apache-2.0' authors = [ 'TON Labs LTD ' ] diff --git a/toncli/Cargo.toml b/toncli/Cargo.toml index d18f275b..6984842b 100644 --- a/toncli/Cargo.toml +++ b/toncli/Cargo.toml @@ -9,7 +9,7 @@ license = 'Apache-2.0' name = 'toncli' readme = 'README.md' repository = 'https://github.com/tonlabs/ever-sdk' -version = '1.44.0' +version = '1.44.1' [dependencies] base64 = '0.13.0' diff --git a/tools/api.json b/tools/api.json index 5506a9ba..e8d0b2f4 100644 --- a/tools/api.json +++ b/tools/api.json @@ -1,5 +1,5 @@ { - "version": "1.44.0", + "version": "1.44.1", "modules": [ { "name": "client", @@ -10755,8 +10755,11 @@ }, { "name": "send_events", - "type": "Boolean", - "summary": "Flag for requesting events sending", + "type": "Optional", + "optional_inner": { + "type": "Boolean" + }, + "summary": "Flag for requesting events sending. Default is `false`.", "description": null } ], @@ -10814,8 +10817,11 @@ }, { "name": "send_events", - "type": "Boolean", - "summary": "Flag that enables/disables intermediate events", + "type": "Optional", + "optional_inner": { + "type": "Boolean" + }, + "summary": "Flag that enables/disables intermediate events. Default is `false`.", "description": null }, { @@ -10847,8 +10853,11 @@ }, { "name": "send_events", - "type": "Boolean", - "summary": "Flag for requesting events sending", + "type": "Optional", + "optional_inner": { + "type": "Boolean" + }, + "summary": "Flag for requesting events sending. Default is `false`.", "description": null } ], @@ -14397,7 +14406,7 @@ }, { "name": "debot", - "summary": "[UNSTABLE](UNSTABLE.md) Module for working with debot.", + "summary": "[UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Module for working with debot.", "description": null, "types": [ { @@ -14504,7 +14513,7 @@ "type": "Number", "number_type": "UInt", "number_size": 32, - "summary": "[UNSTABLE](UNSTABLE.md) Handle of registered in SDK debot", + "summary": "[UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Handle of registered in SDK debot", "description": null }, { @@ -14552,7 +14561,7 @@ "description": "Used by debot only." } ], - "summary": "[UNSTABLE](UNSTABLE.md) Describes a debot action in a Debot Context.", + "summary": "[UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Describes a debot action in a Debot Context.", "description": null }, { @@ -14665,7 +14674,7 @@ "description": null } ], - "summary": "[UNSTABLE](UNSTABLE.md) Describes DeBot metadata.", + "summary": "[UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Describes DeBot metadata.", "description": null }, { @@ -14731,7 +14740,7 @@ "description": null } ], - "summary": "[UNSTABLE](UNSTABLE.md) Describes the operation that the DeBot wants to perform.", + "summary": "[UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Describes the operation that the DeBot wants to perform.", "description": null }, { @@ -14753,7 +14762,7 @@ "description": null } ], - "summary": "[UNSTABLE](UNSTABLE.md) Describes how much funds will be debited from the target contract balance as a result of the transaction.", + "summary": "[UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Describes how much funds will be debited from the target contract balance as a result of the transaction.", "description": null }, { @@ -14767,7 +14776,7 @@ "description": null } ], - "summary": "[UNSTABLE](UNSTABLE.md) Parameters to init DeBot.", + "summary": "[UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Parameters to init DeBot.", "description": null }, { @@ -14795,7 +14804,7 @@ "description": null } ], - "summary": "[UNSTABLE](UNSTABLE.md) Structure for storing debot handle returned from `init` function.", + "summary": "[UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Structure for storing debot handle returned from `init` function.", "description": null }, { @@ -14926,7 +14935,7 @@ "description": null } ], - "summary": "[UNSTABLE](UNSTABLE.md) Debot Browser callbacks", + "summary": "[UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Debot Browser callbacks", "description": "Called by debot engine to communicate with debot browser." }, { @@ -14984,7 +14993,7 @@ "description": null } ], - "summary": "[UNSTABLE](UNSTABLE.md) Returning values from Debot Browser callbacks.", + "summary": "[UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Returning values from Debot Browser callbacks.", "description": null }, { @@ -14999,7 +15008,7 @@ "description": null } ], - "summary": "[UNSTABLE](UNSTABLE.md) Parameters to start DeBot. DeBot must be already initialized with init() function.", + "summary": "[UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Parameters to start DeBot. DeBot must be already initialized with init() function.", "description": null }, { @@ -15013,7 +15022,7 @@ "description": null } ], - "summary": "[UNSTABLE](UNSTABLE.md) Parameters to fetch DeBot metadata.", + "summary": "[UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Parameters to fetch DeBot metadata.", "description": null }, { @@ -15028,7 +15037,7 @@ "description": null } ], - "summary": "[UNSTABLE](UNSTABLE.md)", + "summary": "[UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md)", "description": null }, { @@ -15050,7 +15059,7 @@ "description": null } ], - "summary": "[UNSTABLE](UNSTABLE.md) Parameters for executing debot action.", + "summary": "[UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Parameters for executing debot action.", "description": null }, { @@ -15071,7 +15080,7 @@ "description": null } ], - "summary": "[UNSTABLE](UNSTABLE.md) Parameters of `send` function.", + "summary": "[UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Parameters of `send` function.", "description": null }, { @@ -15086,14 +15095,14 @@ "description": null } ], - "summary": "[UNSTABLE](UNSTABLE.md)", + "summary": "[UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md)", "description": null } ], "functions": [ { "name": "init", - "summary": "[UNSTABLE](UNSTABLE.md) Creates and instance of DeBot.", + "summary": "[UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Creates and instance of DeBot.", "description": "Downloads debot smart contract (code and data) from blockchain and creates\nan instance of Debot Engine for it.\n\n# Remarks\nIt does not switch debot to context 0. Browser Callbacks are not called.", "params": [ { @@ -15148,7 +15157,7 @@ }, { "name": "start", - "summary": "[UNSTABLE](UNSTABLE.md) Starts the DeBot.", + "summary": "[UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Starts the DeBot.", "description": "Downloads debot smart contract from blockchain and switches it to\ncontext zero.\n\nThis function must be used by Debot Browser to start a dialog with debot.\nWhile the function is executing, several Browser Callbacks can be called,\nsince the debot tries to display all actions from the context 0 to the user.\n\nWhen the debot starts SDK registers `BrowserCallbacks` AppObject.\nTherefore when `debote.remove` is called the debot is being deleted and the callback is called\nwith `finish`=`true` which indicates that it will never be used again.", "params": [ { @@ -15185,7 +15194,7 @@ }, { "name": "fetch", - "summary": "[UNSTABLE](UNSTABLE.md) Fetches DeBot metadata from blockchain.", + "summary": "[UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Fetches DeBot metadata from blockchain.", "description": "Downloads DeBot from blockchain and creates and fetches its metadata.", "params": [ { @@ -15223,7 +15232,7 @@ }, { "name": "execute", - "summary": "[UNSTABLE](UNSTABLE.md) Executes debot action.", + "summary": "[UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Executes debot action.", "description": "Calls debot engine referenced by debot handle to execute input action.\nCalls Debot Browser Callbacks if needed.\n\n# Remarks\nChain of actions can be executed if input action generates a list of subactions.", "params": [ { @@ -15260,7 +15269,7 @@ }, { "name": "send", - "summary": "[UNSTABLE](UNSTABLE.md) Sends message to Debot.", + "summary": "[UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Sends message to Debot.", "description": "Used by Debot Browser to send response on Dinterface call or from other Debots.", "params": [ { @@ -15297,7 +15306,7 @@ }, { "name": "remove", - "summary": "[UNSTABLE](UNSTABLE.md) Destroys debot handle.", + "summary": "[UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Destroys debot handle.", "description": "Removes handle from Client Context and drops debot engine referenced by that handle.", "params": [ { @@ -15336,7 +15345,7 @@ }, { "name": "proofs", - "summary": "[UNSTABLE](UNSTABLE.md) Module for proving data, retrieved from TONOS API.", + "summary": "[UNSTABLE](UNSTABLE.md) [DEPRECATED](DEPRECATED.md) Module for proving data, retrieved from TONOS API.", "description": null, "types": [ { diff --git a/tools/api.ts b/tools/api.ts index 3f97c822..5bcd4252 100644 --- a/tools/api.ts +++ b/tools/api.ts @@ -393,6 +393,10 @@ export abstract class Code { abstract functionInterface(func: ApiFunction): string; + syncFunctionInterface(func: ApiFunction): string { + return this.functionInterface(func) + } + abstract appObjectInterface(obj: ApiModule): string; abstract modules(): string; diff --git a/tools/docs.ts b/tools/docs.ts index 5f7d6b55..9840bcc2 100644 --- a/tools/docs.ts +++ b/tools/docs.ts @@ -217,7 +217,10 @@ export class Docs extends Code { code += `${this.code.typeDef(result)}\n`; } code += this.code.functionInterface(func); + code += "\n\n" + code += this.code.syncFunctionInterface(func); md += `\`\`\`${this.code.language()}\n${code}\n\`\`\`\n`; + md += `NOTE: Sync version is available only for \`lib-node\` binding.\n`; if (appObject || params || funcInfo.hasResponseHandler) { md += "### Parameters\n"; diff --git a/tools/package.json b/tools/package.json index 6436882d..913d5021 100644 --- a/tools/package.json +++ b/tools/package.json @@ -1,10 +1,11 @@ { "name": "tools", - "version": "1.44.0", + "version": "1.44.1", "description": "", "main": "index.js", "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" + "test": "echo \"Error: no test specified\" && exit 1", + "docs": "node index docs -o ../docs/reference/types-and-methods" }, "keywords": [], "author": "", diff --git a/tools/ts-code.ts b/tools/ts-code.ts index 07dfc608..c9ff6339 100644 --- a/tools/ts-code.ts +++ b/tools/ts-code.ts @@ -163,8 +163,13 @@ export class ${Code.upperFirst(module.name)}Module { for (const func of module.functions) { const info = this.getFunctionInfo(func); - const funcDoc = () => { + const funcDoc = (isSync: boolean) => { ts += jsDocStart(func, INDENT); + if (isSync) { + ts += jsDoc("", INDENT); + ts += jsDoc(`NOTE: Available only for \`lib-node\` binding.\n`, INDENT); + ts += jsDoc("", INDENT); + } if (info.params) { ts += jsDoc("", INDENT); ts += jsDoc(`@param {${getRefName(info.params)}} ${info.params.name}`, INDENT); @@ -172,9 +177,9 @@ export class ${Code.upperFirst(module.name)}Module { ts += jsDoc(`@returns ${getRefName(func.result)}`, INDENT); ts += jsDocEnd(INDENT); } - funcDoc() + funcDoc(false) ts += this.functionImpl(func); - funcDoc() + funcDoc(true) ts += this.syncFunctionImpl(func); } @@ -315,6 +320,15 @@ export class ${Code.upperFirst(module.name)}Module { return `function ${func.name}(${paramsDecl}): Promise<${resultDecl}>;`; } + syncFunctionInterface(func: ApiFunction): string { + const paramsInfo = this.getFunctionInfo(func); + const paramsDecls = this.syncParamsDecls(paramsInfo); + const paramsDecl = paramsDecls.length > 0 ? `\n${paramsDecls.map(p => ` ${p},`) + .join("\n")}\n` : ""; + const resultDecl = this.type(func.result, ""); + return `function ${func.name}_sync(${paramsDecl}): ${resultDecl};`; + } + appObjectInterface(obj: ApiModule): string { let ts = ""; // for (const type of obj.types) {