From 200c7153466b5c5c58828ac34d0113b58e51c962 Mon Sep 17 00:00:00 2001 From: Michael Vlasov Date: Wed, 2 Dec 2020 12:07:56 +0500 Subject: [PATCH 01/15] 1.3.0 start --- CHANGELOG.md | 5 +++++ api/derive/Cargo.toml | 2 +- api/info/Cargo.toml | 2 +- api/test/Cargo.toml | 2 +- ton_client/Cargo.toml | 2 +- ton_sdk/Cargo.toml | 2 +- toncli/Cargo.toml | 2 +- 7 files changed, 11 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f97369e2..c233ba39f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ # Release Notes All notable changes to this project will be documented in this file. +## 1.3.0 Dec 8, 2020 + +### New +- `query` method in the `net` module. Performs custom graphql query. + ## 1.2.0 Nov 26, 2020 ### Featured diff --git a/api/derive/Cargo.toml b/api/derive/Cargo.toml index 4f1dfdb07..6ae3174f3 100644 --- a/api/derive/Cargo.toml +++ b/api/derive/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "api_derive" -version = "1.2.0" +version = "1.3.0" authors = ["Michael Vlasov "] edition = "2018" diff --git a/api/info/Cargo.toml b/api/info/Cargo.toml index 7b4d7efcd..26588ee80 100644 --- a/api/info/Cargo.toml +++ b/api/info/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "api_info" -version = "1.2.0" +version = "1.3.0" authors = ["Michael Vlasov "] edition = "2018" diff --git a/api/test/Cargo.toml b/api/test/Cargo.toml index d26ec0ecd..bac591b76 100644 --- a/api/test/Cargo.toml +++ b/api/test/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "api_test" -version = "1.2.0" +version = "1.3.0" authors = ["Michael Vlasov "] edition = "2018" diff --git a/ton_client/Cargo.toml b/ton_client/Cargo.toml index b86377dcf..132ef80eb 100644 --- a/ton_client/Cargo.toml +++ b/ton_client/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ton_client" -version = "1.2.0" +version = "1.3.0" authors = ["Michael Vlasov"] edition = "2018" license = "Apache-2.0" diff --git a/ton_sdk/Cargo.toml b/ton_sdk/Cargo.toml index 32fd3c64b..3442c011e 100644 --- a/ton_sdk/Cargo.toml +++ b/ton_sdk/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ton_sdk" -version = "1.2.0" +version = "1.3.0" edition = "2018" license = "Apache-2.0" diff --git a/toncli/Cargo.toml b/toncli/Cargo.toml index 26f6bb2ae..3ea27fa97 100644 --- a/toncli/Cargo.toml +++ b/toncli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "toncli" -version = "1.2.0" +version = "1.3.0" description = "TON CLient Command Line Tool" authors = ["TON DEV SOLUTIONS LTD "] repository = "https://github.com/tonlabs/TON-SDK" From 9d113c9a3d6046fad96e90dfc2796cc9842211d3 Mon Sep 17 00:00:00 2001 From: Michael Vlasov Date: Wed, 2 Dec 2020 13:29:26 +0500 Subject: [PATCH 02/15] NEW: `query` method of `net` module --- docs/mod_net.md | 56 +++++++++++++ docs/modules.md | 2 + ton_client/src/json_interface/modules.rs | 4 + ton_client/src/net/mod.rs | 45 ++++++++++- ton_client/src/net/node_client.rs | 33 ++++++-- ton_client/src/net/tests.rs | 21 +++++ ton_client/src/processing/blocks_walking.rs | 6 +- tools/api.json | 90 ++++++++++++++++++++- 8 files changed, 244 insertions(+), 13 deletions(-) diff --git a/docs/mod_net.md b/docs/mod_net.md index 83cb44193..e6232f30a 100644 --- a/docs/mod_net.md +++ b/docs/mod_net.md @@ -2,6 +2,8 @@ Network access. ## Functions +[query](#query) – Performs DAppServer GraphQL query. + [query_collection](#query_collection) – Queries collection data [wait_for_collection](#wait_for_collection) – Returns an object that fulfills the conditions or waits for its appearance @@ -15,6 +17,10 @@ [SortDirection](#SortDirection) +[ParamsOfQuery](#ParamsOfQuery) + +[ResultOfQuery](#ResultOfQuery) + [ParamsOfQueryCollection](#ParamsOfQueryCollection) [ResultOfQueryCollection](#ResultOfQueryCollection) @@ -29,6 +35,34 @@ # Functions +## query + +Performs DAppServer GraphQL query. + +```ts +type ParamsOfQuery = { + query: string, + variables?: any, + timeout?: number +}; + +type ResultOfQuery = { + result: any +}; + +function query( + params: ParamsOfQuery, +): Promise; +``` +### Parameters +- `query`: _string_ – GraphQL query text. +- `variables`?: _any_ – Variables used in query. +- `timeout`?: _number_ – Query timeout in ms. +### Result + +- `result`: _any_ – Result provided by DAppServer. + + ## query_collection Queries collection data @@ -178,6 +212,28 @@ One of the following value: - `DESC` +## ParamsOfQuery +```ts +type ParamsOfQuery = { + query: string, + variables?: any, + timeout?: number +}; +``` +- `query`: _string_ – GraphQL query text. +- `variables`?: _any_ – Variables used in query. +- `timeout`?: _number_ – Query timeout in ms. + + +## ResultOfQuery +```ts +type ResultOfQuery = { + result: any +}; +``` +- `result`: _any_ – Result provided by DAppServer. + + ## ParamsOfQueryCollection ```ts type ParamsOfQueryCollection = { diff --git a/docs/modules.md b/docs/modules.md index 0e98b1470..ee6a27a22 100644 --- a/docs/modules.md +++ b/docs/modules.md @@ -139,6 +139,8 @@ ## [net](mod_net.md) – Network access. +[query](mod_net.md#query) – Performs DAppServer GraphQL query. + [query_collection](mod_net.md#query_collection) – Queries collection data [wait_for_collection](mod_net.md#wait_for_collection) – Returns an object that fulfills the conditions or waits for its appearance diff --git a/ton_client/src/json_interface/modules.rs b/ton_client/src/json_interface/modules.rs index 04e13d362..966f435fb 100644 --- a/ton_client/src/json_interface/modules.rs +++ b/ton_client/src/json_interface/modules.rs @@ -310,6 +310,10 @@ fn register_net(handlers: &mut RuntimeHandlers) { module.register_type::(); module.register_type::(); + module.register_async_fn( + crate::net::query, + crate::net::query_api, + ); module.register_async_fn( crate::net::query_collection, crate::net::query_collection_api, diff --git a/ton_client/src/net/mod.rs b/ton_client/src/net/mod.rs index 47b4b082e..621376eba 100644 --- a/ton_client/src/net/mod.rs +++ b/ton_client/src/net/mod.rs @@ -28,6 +28,7 @@ mod node_client; pub(crate) use node_client::{NodeClient, MAX_TIMEOUT}; pub use node_client::{OrderBy, SortDirection}; use serde::{Deserialize, Deserializer}; +use serde_json::Value; #[cfg(test)] mod tests; @@ -132,6 +133,22 @@ impl Default for NetworkConfig { } } +#[derive(Serialize, Deserialize, ApiType, Clone)] +pub struct ParamsOfQuery { + /// GraphQL query text. + pub query: String, + /// Variables used in query. + pub variables: Option, + /// Query timeout in ms. + pub timeout: Option, +} + +#[derive(Serialize, Deserialize, ApiType, Clone)] +pub struct ResultOfQuery { + /// Result provided by DAppServer. + pub result: Value, +} + #[derive(Serialize, Deserialize, ApiType, Clone)] pub struct ParamsOfQueryCollection { /// Collection name (accounts, blocks, transactions, messages, block_signatures) @@ -210,6 +227,30 @@ async fn extract_subscription_handle(handle: &u32) -> Option> { SUBSCRIPTIONS.lock().await.remove(handle) } +/// Performs DAppServer GraphQL query. +#[api_function] +pub async fn query( + context: std::sync::Arc, + params: ParamsOfQuery, +) -> ClientResult { + let client = context.get_client()?; + let result = client + .query( + ¶ms.query, + params.variables, + params.timeout, + ) + .await + .map_err(|err| Error::queries_query_failed(err).add_network_url(client))?; + + let result = serde_json::from_value(result).map_err(|err| { + Error::queries_query_failed(format!("Can not parse result: {}", err)) + .add_network_url(client) + })?; + + Ok(ResultOfQuery { result }) +} + /// Queries collection data /// /// Queries data that satisfies the `filter` conditions, @@ -222,7 +263,7 @@ pub async fn query_collection( ) -> ClientResult { let client = context.get_client()?; let result = client - .query( + .query_collection( ¶ms.collection, ¶ms.filter.unwrap_or(json!({})), ¶ms.result, @@ -324,3 +365,5 @@ pub async fn unsubscribe( Ok(()) } + + diff --git a/ton_client/src/net/node_client.rs b/ton_client/src/net/node_client.rs index 1363a4dd7..7497469b7 100644 --- a/ton_client/src/net/node_client.rs +++ b/ton_client/src/net/node_client.rs @@ -74,8 +74,8 @@ struct ServerInfo { } pub(crate) struct Subscription { - pub unsubscribe: Pin + Send>>, - pub data_stream: Pin> + Send>>, + pub unsubscribe: Pin + Send>>, + pub data_stream: Pin> + Send>>, } pub(crate) struct NodeClient { @@ -262,7 +262,7 @@ impl NodeClient { return Some(Err(Error::invalid_server_response(format!( "Subscription answer is not a valid JSON: {}\n{}", err, value - )))) + )))); } Ok(value) => value, }; @@ -307,7 +307,7 @@ impl NodeClient { "variables": request.variables, } }) - .to_string(); + .to_string(); websocket.sender.send(request).await?; let mut sender = websocket.sender; @@ -319,7 +319,7 @@ impl NodeClient { "type": "stop", "payload": {} }) - .to_string(), + .to_string(), ) .await; }; @@ -364,7 +364,7 @@ impl NodeClient { "query": request.query, "variables": request.variables, }) - .to_string(); + .to_string(); let mut headers = HashMap::new(); headers.insert("content-type".to_owned(), "application/json".to_owned()); @@ -390,7 +390,7 @@ impl NodeClient { } // Returns Stream with GraphQL query answer - pub async fn query( + pub async fn query_collection( &self, table: &str, filter: &Value, @@ -419,6 +419,23 @@ impl NodeClient { } } + // Returns GraphQL query answer + pub async fn query( + &self, + query: &str, + variables: Option, + timeout: Option, + ) -> ClientResult { + let query = VariableRequest { + query: query.into(), + variables: variables.unwrap_or(json!({})), + }; + self.ensure_client().await?; + let client_lock = self.server_info.read().await; + let address = &client_lock.as_ref().unwrap().query_url; + Ok(self.query_vars(address, query, timeout).await?) + } + // Executes GraphQL query, waits for result and returns recieved value pub async fn wait_for( &self, @@ -428,7 +445,7 @@ impl NodeClient { timeout: Option, ) -> ClientResult { let value = self - .query( + .query_collection( table, filter, fields, diff --git a/ton_client/src/net/tests.rs b/ton_client/src/net/tests.rs index f64bf1c40..024eac30f 100644 --- a/ton_client/src/net/tests.rs +++ b/ton_client/src/net/tests.rs @@ -8,6 +8,27 @@ use crate::net::{ }; use crate::tests::{TestClient, HELLO}; +#[tokio::test(core_threads = 2)] +async fn query() { + let client = TestClient::new(); + + let info: ResultOfQuery = client + .request_async( + "net.query", + ParamsOfQuery { + query: "query{info{version}}".to_owned(), + variables: None, + timeout: None, + }, + ) + .await + .unwrap(); + + let version = info.result["data"]["info"]["version"].as_str().unwrap(); + assert_eq!(version.split(".").count(), 3); +} + + #[tokio::test(core_threads = 2)] async fn block_signatures() { let client = TestClient::new(); diff --git a/ton_client/src/processing/blocks_walking.rs b/ton_client/src/processing/blocks_walking.rs index db41ba17a..7264ccd83 100644 --- a/ton_client/src/processing/blocks_walking.rs +++ b/ton_client/src/processing/blocks_walking.rs @@ -41,7 +41,7 @@ pub async fn find_last_shard_block( // if account resides in masterchain, then starting point is last masterchain block // generated before message was sent let blocks = client - .query( + .query_collection( BLOCKS_TABLE_NAME, &json!({ "workchain_id": { "eq": MASTERCHAIN_ID } @@ -71,7 +71,7 @@ pub async fn find_last_shard_block( if blocks[0].is_null() { // Node SE case - no masterchain, no sharding. Check that only one shard let blocks = client - .query( + .query_collection( BLOCKS_TABLE_NAME, &json!({ "workchain_id": { "eq": workchain }, @@ -101,7 +101,7 @@ pub async fn find_last_shard_block( // Take last block by seq_no let blocks = client - .query( + .query_collection( BLOCKS_TABLE_NAME, &json!({ "workchain_id": { "eq": workchain }, diff --git a/tools/api.json b/tools/api.json index 7da859fda..2e295771e 100644 --- a/tools/api.json +++ b/tools/api.json @@ -1,5 +1,5 @@ { - "version": "1.2.0", + "version": "1.3.0", "modules": [ { "name": "client", @@ -6070,6 +6070,56 @@ "summary": null, "description": null }, + { + "name": "ParamsOfQuery", + "type": "Struct", + "struct_fields": [ + { + "name": "query", + "type": "String", + "summary": " GraphQL query text.", + "description": " GraphQL query text." + }, + { + "name": "variables", + "type": "Optional", + "optional_inner": { + "type": "Ref", + "ref_name": "Value" + }, + "summary": " Variables used in query.", + "description": " Variables used in query." + }, + { + "name": "timeout", + "type": "Optional", + "optional_inner": { + "type": "Number", + "number_type": "UInt", + "number_size": 32 + }, + "summary": " Query timeout in ms.", + "description": " Query timeout in ms." + } + ], + "summary": null, + "description": null + }, + { + "name": "ResultOfQuery", + "type": "Struct", + "struct_fields": [ + { + "name": "result", + "type": "Ref", + "ref_name": "Value", + "summary": " Result provided by DAppServer.", + "description": " Result provided by DAppServer." + } + ], + "summary": null, + "description": null + }, { "name": "ParamsOfQueryCollection", "type": "Struct", @@ -6246,6 +6296,44 @@ } ], "functions": [ + { + "name": "query", + "summary": " Performs DAppServer GraphQL query.", + "description": " Performs DAppServer GraphQL query.", + "params": [ + { + "name": "context", + "type": "Generic", + "generic_name": "Arc", + "generic_args": [ + { + "type": "Ref", + "ref_name": "ClientContext" + } + ], + "summary": null, + "description": null + }, + { + "name": "params", + "type": "Ref", + "ref_name": "net.ParamsOfQuery", + "summary": null, + "description": null + } + ], + "result": { + "type": "Generic", + "generic_name": "ClientResult", + "generic_args": [ + { + "type": "Ref", + "ref_name": "net.ResultOfQuery" + } + ] + }, + "errors": null + }, { "name": "query_collection", "summary": " Queries collection data", From 42448cdb3dec96c17763091d1eee930abc43d29d Mon Sep 17 00:00:00 2001 From: Michael Vlasov Date: Wed, 2 Dec 2020 14:02:15 +0500 Subject: [PATCH 03/15] remove `timeout` parameter from `query` method --- docs/mod_net.md | 12 ++++-------- ton_client/src/net/mod.rs | 7 +++---- ton_client/src/net/tests.rs | 1 - tools/api.json | 15 ++------------- 4 files changed, 9 insertions(+), 26 deletions(-) diff --git a/docs/mod_net.md b/docs/mod_net.md index e6232f30a..acd10d44b 100644 --- a/docs/mod_net.md +++ b/docs/mod_net.md @@ -42,8 +42,7 @@ Performs DAppServer GraphQL query. ```ts type ParamsOfQuery = { query: string, - variables?: any, - timeout?: number + variables?: any }; type ResultOfQuery = { @@ -56,8 +55,7 @@ function query( ``` ### Parameters - `query`: _string_ – GraphQL query text. -- `variables`?: _any_ – Variables used in query. -- `timeout`?: _number_ – Query timeout in ms. +- `variables`?: _any_ – Variables used in query. Must be a map with named values that can be used in query. ### Result - `result`: _any_ – Result provided by DAppServer. @@ -216,13 +214,11 @@ One of the following value: ```ts type ParamsOfQuery = { query: string, - variables?: any, - timeout?: number + variables?: any }; ``` - `query`: _string_ – GraphQL query text. -- `variables`?: _any_ – Variables used in query. -- `timeout`?: _number_ – Query timeout in ms. +- `variables`?: _any_ – Variables used in query. Must be a map with named values that can be used in query. ## ResultOfQuery diff --git a/ton_client/src/net/mod.rs b/ton_client/src/net/mod.rs index 621376eba..5319b6fe1 100644 --- a/ton_client/src/net/mod.rs +++ b/ton_client/src/net/mod.rs @@ -137,10 +137,9 @@ impl Default for NetworkConfig { pub struct ParamsOfQuery { /// GraphQL query text. pub query: String, - /// Variables used in query. + /// Variables used in query. Must be a map with named values that + /// can be used in query. pub variables: Option, - /// Query timeout in ms. - pub timeout: Option, } #[derive(Serialize, Deserialize, ApiType, Clone)] @@ -238,7 +237,7 @@ pub async fn query( .query( ¶ms.query, params.variables, - params.timeout, + None, ) .await .map_err(|err| Error::queries_query_failed(err).add_network_url(client))?; diff --git a/ton_client/src/net/tests.rs b/ton_client/src/net/tests.rs index 024eac30f..a40795c9b 100644 --- a/ton_client/src/net/tests.rs +++ b/ton_client/src/net/tests.rs @@ -18,7 +18,6 @@ async fn query() { ParamsOfQuery { query: "query{info{version}}".to_owned(), variables: None, - timeout: None, }, ) .await diff --git a/tools/api.json b/tools/api.json index 2e295771e..3bda06b47 100644 --- a/tools/api.json +++ b/tools/api.json @@ -6087,19 +6087,8 @@ "type": "Ref", "ref_name": "Value" }, - "summary": " Variables used in query.", - "description": " Variables used in query." - }, - { - "name": "timeout", - "type": "Optional", - "optional_inner": { - "type": "Number", - "number_type": "UInt", - "number_size": 32 - }, - "summary": " Query timeout in ms.", - "description": " Query timeout in ms." + "summary": " Variables used in query. Must be a map with named values that", + "description": " Variables used in query. Must be a map with named values that\n can be used in query." } ], "summary": null, From 88c6f2d4784b7281e310c0c4a0a3d7845785e975 Mon Sep 17 00:00:00 2001 From: Alexey Vavilin Date: Wed, 2 Dec 2020 14:58:35 +0300 Subject: [PATCH 04/15] Test error codes on Node SE --- ton_client/src/processing/internal.rs | 11 ++++-- ton_client/src/processing/tests.rs | 39 ++++++++++++------- .../src/processing/wait_for_transaction.rs | 8 +++- 3 files changed, 41 insertions(+), 17 deletions(-) diff --git a/ton_client/src/processing/internal.rs b/ton_client/src/processing/internal.rs index e4bc29256..2d593c9df 100644 --- a/ton_client/src/processing/internal.rs +++ b/ton_client/src/processing/internal.rs @@ -3,7 +3,7 @@ use crate::abi::{Abi, ParamsOfDecodeMessage}; use crate::client::ClientContext; use crate::error::{ClientError, ClientResult}; use crate::processing::Error; -use crate::tvm::{AccountForExecutor, ParamsOfRunExecutor}; +use crate::tvm::{AccountForExecutor, ParamsOfRunExecutor, ExecutionOptions}; use std::sync::Arc; use ton_block::{MsgAddressInt, Serializable}; use ton_sdk::{Block, MessageId}; @@ -82,6 +82,7 @@ async fn get_local_error( context: Arc, address: &MsgAddressInt, message: String, + time: u32, ) -> ClientResult<()> { let account = fetch_account(context.clone(), address, "boc").await?; @@ -98,7 +99,10 @@ async fn get_local_error( boc, unlimited_balance: None, }, - execution_options: None, + execution_options: Some(ExecutionOptions { + block_time: Some(time), + ..Default::default() + }), message, skip_transaction_check: None, }, @@ -112,8 +116,9 @@ pub(crate) async fn resolve_error( address: &MsgAddressInt, message: String, mut original_error: ClientError, + time: u32, ) -> ClientResult<()> { - let result = get_local_error(context, address, message).await; + let result = get_local_error(context, address, message, time).await; match result { Err(err) => { diff --git a/ton_client/src/processing/tests.rs b/ton_client/src/processing/tests.rs index f991f7032..3e70b9213 100644 --- a/ton_client/src/processing/tests.rs +++ b/ton_client/src/processing/tests.rs @@ -286,11 +286,6 @@ async fn test_process_message() { #[tokio::test(core_threads = 2)] async fn test_error_resolving() { - // skip on Node SE since it behaves different to real node - if TestClient::node_se() { - return; - } - let default_client = TestClient::new(); let client = TestClient::new_with_config(json!({ "network": { @@ -356,8 +351,12 @@ async fn test_error_resolving() { .unwrap_err(); log::debug!("{:#}", json!(result)); - assert_eq!(result.code, original_code); - assert_eq!(result.data["local_error"]["code"], TvmErrorCode::AccountMissing as u32); + if TestClient::node_se() { + assert_eq!(result.code, TvmErrorCode::AccountCodeMissing as u32); + } else { + assert_eq!(result.code, original_code); + assert_eq!(result.data["local_error"]["code"], TvmErrorCode::AccountMissing as u32); + } // deploy with low balance default_client @@ -376,8 +375,12 @@ async fn test_error_resolving() { .unwrap_err(); log::debug!("{:#}", json!(result)); - assert_eq!(result.code, original_code); - assert_eq!(result.data["local_error"]["code"], TvmErrorCode::LowBalance as u32); + if TestClient::node_se() { + assert_eq!(result.code, TvmErrorCode::LowBalance as u32); + } else { + assert_eq!(result.code, original_code); + assert_eq!(result.data["local_error"]["code"], TvmErrorCode::LowBalance as u32); + } // ABI version 1 messages don't expire so previous deploy message can be processed after // increasing balance. Need to wait until message will be rejected by all validators @@ -402,8 +405,12 @@ async fn test_error_resolving() { .unwrap_err(); log::debug!("{:#}", json!(result)); - assert_eq!(result.code, original_code); - assert_eq!(result.data["local_error"]["code"], TvmErrorCode::AccountCodeMissing as u32); + if TestClient::node_se() { + assert_eq!(result.code, TvmErrorCode::AccountCodeMissing as u32); + } else { + assert_eq!(result.code, original_code); + assert_eq!(result.data["local_error"]["code"], TvmErrorCode::AccountCodeMissing as u32); + } // normal deploy client @@ -431,6 +438,12 @@ async fn test_error_resolving() { .unwrap_err(); log::debug!("{:#}", json!(result)); - assert_eq!(result.code, original_code); - assert_eq!(result.data["local_error"]["code"], TvmErrorCode::ContractExecutionError as u32); + if TestClient::node_se() { + assert_eq!(result.code, TvmErrorCode::ContractExecutionError as u32); + assert_eq!(result.data["exit_code"], 100); + } else { + assert_eq!(result.code, original_code); + assert_eq!(result.data["local_error"]["code"], TvmErrorCode::ContractExecutionError as u32); + assert_eq!(result.data["local_error"]["data"]["exit_code"], 100) + } } diff --git a/ton_client/src/processing/wait_for_transaction.rs b/ton_client/src/processing/wait_for_transaction.rs index 35a5c06f1..951b1b709 100644 --- a/ton_client/src/processing/wait_for_transaction.rs +++ b/ton_client/src/processing/wait_for_transaction.rs @@ -110,7 +110,13 @@ pub async fn wait_for_transaction + Send>( ) }; - resolve_error(context.clone(), &address, params.message.clone(), error).await?; + resolve_error( + context.clone(), + &address, + params.message.clone(), + error, + waiting_expiration_time - 1, + ).await?; } // We have successfully walked through the block. From 0f5f0f0ac00654573083926ae9e4f5a4c583cf7a Mon Sep 17 00:00:00 2001 From: Alexey Vavilin Date: Wed, 2 Dec 2020 17:50:57 +0300 Subject: [PATCH 05/15] Add some text in error --- ton_client/src/processing/internal.rs | 2 +- ton_client/src/processing/process_message.rs | 1 - ton_client/src/processing/tests.rs | 7 ++++++- ton_client/src/tvm/errors.rs | 8 ++++++-- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/ton_client/src/processing/internal.rs b/ton_client/src/processing/internal.rs index 2d593c9df..36ef3f328 100644 --- a/ton_client/src/processing/internal.rs +++ b/ton_client/src/processing/internal.rs @@ -19,7 +19,7 @@ pub(crate) fn get_message_id(message: &ton_block::Message) -> ClientResult bool { - limit < 0 || retries <= limit as u8 + limit < 0 || retries < limit as u8 } pub fn can_retry_network_error(context: &Arc, retries: u8) -> bool { diff --git a/ton_client/src/processing/process_message.rs b/ton_client/src/processing/process_message.rs index 91a7425f0..551968d49 100644 --- a/ton_client/src/processing/process_message.rs +++ b/ton_client/src/processing/process_message.rs @@ -72,7 +72,6 @@ pub async fn process_message + Send>( return Err(err); } // Waiting is failed but we can retry - try_index } }; try_index = try_index.checked_add(1).unwrap_or(try_index); diff --git a/ton_client/src/processing/tests.rs b/ton_client/src/processing/tests.rs index 3e70b9213..fa57ffdde 100644 --- a/ton_client/src/processing/tests.rs +++ b/ton_client/src/processing/tests.rs @@ -286,6 +286,11 @@ async fn test_process_message() { #[tokio::test(core_threads = 2)] async fn test_error_resolving() { + // skip on Node SE since it behaves different to real node + if TestClient::node_se() { + return; + } + let default_client = TestClient::new(); let client = TestClient::new_with_config(json!({ "network": { @@ -352,7 +357,7 @@ async fn test_error_resolving() { log::debug!("{:#}", json!(result)); if TestClient::node_se() { - assert_eq!(result.code, TvmErrorCode::AccountCodeMissing as u32); + assert_eq!(result.code, TvmErrorCode::AccountMissing as u32); } else { assert_eq!(result.code, original_code); assert_eq!(result.data["local_error"]["code"], TvmErrorCode::AccountMissing as u32); diff --git a/ton_client/src/tvm/errors.rs b/ton_client/src/tvm/errors.rs index 33a90c8ff..5cc69c6fe 100644 --- a/ton_client/src/tvm/errors.rs +++ b/ton_client/src/tvm/errors.rs @@ -117,18 +117,22 @@ impl Error { if let Some(error_code) = ExceptionCode::from_usize(exit_code as usize) .or(ExceptionCode::from_usize(!exit_code as usize)) { + error.message.push_str(&format!(" ({})", error_code)); + error.data["description"] = error_code.to_string().into(); if error_code == ExceptionCode::OutOfGas { error.message.push_str(". Check account balance"); } - error.data["description"] = error_code.to_string().into(); } else if let Some(code) = StdContractError::from_usize(exit_code as usize) { + error.message.push_str(&format!(" ({})", code)); + error.data["description"] = code.to_string().into(); if let Some(tip) = code.tip() { error.message.push_str(". "); error.message.push_str(tip); } - error.data["description"] = code.to_string().into(); } + error.message.push_str(". For more information about exit code check the contract source code or ask the contract developer"); + error } From a6959076d3c98c037a37f19b9368361bc3334ea4 Mon Sep 17 00:00:00 2001 From: Alexey Vavilin Date: Wed, 2 Dec 2020 18:34:35 +0300 Subject: [PATCH 06/15] Remove debot after test --- ton_client/src/debot/tests.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ton_client/src/debot/tests.rs b/ton_client/src/debot/tests.rs index ed2a165fe..bcdb9c458 100644 --- a/ton_client/src/debot/tests.rs +++ b/ton_client/src/debot/tests.rs @@ -126,6 +126,10 @@ impl TestBrowser { } assert_eq!(state.next.lock().await.len(), 0); + + let _: () = client.request_async( + "debot.remove", + handle).await.unwrap(); } pub async fn execute(client: Arc, address: String, keys: KeyPair, steps: Vec) { From 4653bfbbed549124785f0733367bf2c42139d190 Mon Sep 17 00:00:00 2001 From: Alexey Vavilin Date: Fri, 4 Dec 2020 11:35:13 +0300 Subject: [PATCH 07/15] Suspend and resume net module --- ton_client/src/client/client.rs | 18 ++- ton_client/src/json_interface/modules.rs | 2 + ton_client/src/json_interface/registrar.rs | 24 ++++ ton_client/src/net/errors.rs | 8 ++ ton_client/src/net/mod.rs | 148 +++++++++++++++------ ton_client/src/net/node_client.rs | 15 +++ ton_client/src/net/tests.rs | 54 +++++++- 7 files changed, 222 insertions(+), 47 deletions(-) diff --git a/ton_client/src/client/client.rs b/ton_client/src/client/client.rs index 7982964d7..33db53d65 100644 --- a/ton_client/src/client/client.rs +++ b/ton_client/src/client/client.rs @@ -16,7 +16,7 @@ use serde::{Deserialize, Deserializer, Serialize, de::DeserializeOwned}; use std::sync::Arc; use std::sync::atomic::{AtomicU32, Ordering}; use std::collections::HashMap; -use tokio::sync::{oneshot, Mutex}; +use tokio::sync::{oneshot, mpsc, Mutex}; use super::{ParamsOfAppRequest, Error, AppRequestResult}; use crate::error::ClientResult; @@ -26,7 +26,7 @@ use crate::crypto::boxes::SigningBox; use crate::debot::DEngine; use crate::json_interface::request::Request; use crate::json_interface::interop::ResponseType; -use crate::net::{NetworkConfig, NodeClient}; +use crate::net::{NetworkConfig, NodeClient, SubscriptionAction}; #[cfg(not(feature = "wasm"))] use super::std_client_env::ClientEnv; @@ -38,8 +38,13 @@ pub struct Boxes { pub(crate) signing_boxes: LockfreeMap>, } -pub struct ClientContext { +pub struct NetworkContext { pub(crate) client: Option, + pub(crate) subscriptions: Mutex>>, +} + +pub struct ClientContext { + pub(crate) net: NetworkContext, pub(crate) config: ClientConfig, pub(crate) env: Arc, pub(crate) debots: LockfreeMap>, @@ -51,7 +56,7 @@ pub struct ClientContext { impl ClientContext { pub(crate) fn get_client(&self) -> ClientResult<&NodeClient> { - self.client.as_ref().ok_or(Error::net_module_not_init()) + self.net.client.as_ref().ok_or(Error::net_module_not_init()) } pub async fn set_timer(&self, ms: u64) -> ClientResult<()> { @@ -76,7 +81,10 @@ Note that default values are used if parameters are omitted in config"#, }; Ok(Self { - client, + net: NetworkContext { + client, + subscriptions: Default::default(), + }, config, env, debots: LockfreeMap::new(), diff --git a/ton_client/src/json_interface/modules.rs b/ton_client/src/json_interface/modules.rs index 966f435fb..1e41af5f0 100644 --- a/ton_client/src/json_interface/modules.rs +++ b/ton_client/src/json_interface/modules.rs @@ -327,6 +327,8 @@ fn register_net(handlers: &mut RuntimeHandlers) { super::net::subscribe_collection, super::net::subscribe_collection_api, ); + module.register_async_fn_no_args(crate::net::suspend, crate::net::suspend_api); + module.register_async_fn_no_args(crate::net::resume, crate::net::resume_api); module.register(); } diff --git a/ton_client/src/json_interface/registrar.rs b/ton_client/src/json_interface/registrar.rs index fc7824034..57c66385a 100644 --- a/ton_client/src/json_interface/registrar.rs +++ b/ton_client/src/json_interface/registrar.rs @@ -87,6 +87,30 @@ impl<'h> ModuleReg<'h> { ); } + pub fn register_async_fn_no_args( + &mut self, + handler: fn(context: std::sync::Arc) -> F, + api: fn() -> api_info::Function, + ) where + R: ApiType + Send + Serialize + 'static, + F: Send + Future> + 'static, + { + self.register_type::(); + let function = api(); + let name = format!("{}.{}", self.module.name, function.name); + self.module.functions.push(function); + + self.handlers + .register_async(name.clone(), Box::new(SpawnNoArgsHandler::new(handler))); + #[cfg(not(feature = "wasm"))] + self.handlers.register_sync( + name, + Box::new(CallNoArgsHandler::new(move |context| { + context.clone().env.block_on(handler(context)) + })), + ); + } + pub fn register_async_fn_with_callback( &mut self, handler: fn(context: std::sync::Arc, params: P, callback: Arc) -> F, diff --git a/ton_client/src/net/errors.rs b/ton_client/src/net/errors.rs index 1e6d86c76..d40bc0e50 100644 --- a/ton_client/src/net/errors.rs +++ b/ton_client/src/net/errors.rs @@ -11,6 +11,7 @@ pub enum ErrorCode { ClockOutOfSync = NET + 6, WaitForTimeout = NET + 7, GraphqlError = NET + 8, + NetworkModuleSuspended = NET + 9, } pub struct Error; @@ -74,4 +75,11 @@ impl Error { format!("Graphql server returned error: {}", err), ) } + + pub fn network_module_suspended() -> ClientError { + error( + ErrorCode::NetworkModuleSuspended, + "Can not use network module since it is suspended".to_owned(), + ) + } } diff --git a/ton_client/src/net/mod.rs b/ton_client/src/net/mod.rs index 5319b6fe1..2b8a24a6d 100644 --- a/ton_client/src/net/mod.rs +++ b/ton_client/src/net/mod.rs @@ -15,11 +15,7 @@ use crate::client::ClientContext; use crate::error::ClientResult; use futures::{Future, FutureExt, StreamExt}; use rand::RngCore; -use std::collections::HashMap; -use tokio::sync::{ - mpsc::{channel, Sender}, - Mutex, -}; +use tokio::sync::mpsc::{channel, Sender}; mod errors; pub use errors::{Error, ErrorCode}; @@ -214,16 +210,19 @@ pub struct ResultOfSubscription { pub result: serde_json::Value, } -lazy_static! { - static ref SUBSCRIPTIONS: Mutex>> = Mutex::new(HashMap::new()); +#[derive(PartialEq)] +pub(crate) enum SubscriptionAction { + Suspend, + Resume, + Finish, } -async fn add_subscription_handle(handle: u32, aborter: Sender) { - SUBSCRIPTIONS.lock().await.insert(handle, aborter); +async fn add_subscription_handle(context: &ClientContext, handle: u32, sender: Sender) { + context.net.subscriptions.lock().await.insert(handle, sender); } -async fn extract_subscription_handle(handle: &u32) -> Option> { - SUBSCRIPTIONS.lock().await.remove(handle) +async fn extract_subscription_handle(context: &ClientContext, handle: &u32) -> Option> { + context.net.subscriptions.lock().await.remove(handle) } /// Performs DAppServer GraphQL query. @@ -308,6 +307,20 @@ pub async fn wait_for_collection( Ok(ResultOfWaitForCollection { result }) } +async fn create_subscription( + context: std::sync::Arc, params: &ParamsOfSubscribeCollection +) -> ClientResult { + let client = context.get_client()?; + client + .subscribe( + ¶ms.collection, + params.filter.as_ref().unwrap_or(&json!({})), + ¶ms.result, + ) + .await + .map_err(|err| Error::queries_subscribe_failed(err).add_network_url(client)) +} + pub async fn subscribe_collection + Send>( context: std::sync::Arc, params: ParamsOfSubscribeCollection, @@ -315,36 +328,65 @@ pub async fn subscribe_collection + Send>( ) -> ClientResult { let handle = rand::thread_rng().next_u32(); - let client = context.get_client()?; - let subscription = client - .subscribe( - ¶ms.collection, - ¶ms.filter.unwrap_or(json!({})), - ¶ms.result, - ) - .await - .map_err(|err| Error::queries_subscribe_failed(err).add_network_url(client))?; + let mut subscription = Some(create_subscription(context.clone(), ¶ms).await?); let (sender, mut receiver) = channel(1); - add_subscription_handle(handle, sender).await; + add_subscription_handle(&context, handle, sender).await; // spawn thread which reads subscription stream and calls callback with data - context.env.spawn(Box::pin(async move { - let wait_abortion = receiver.recv().fuse(); - futures::pin_mut!(wait_abortion); - let mut data_stream = subscription.data_stream.fuse(); - loop { - futures::select!( - // waiting next subscription data - data = data_stream.select_next_some() => { - callback(data.map(|data| ResultOfSubscription { result: data })).await - }, - // waiting for unsubscribe - _ = wait_abortion => break - ); + context.clone().env.spawn(Box::pin(async move { + let mut last_action = None; + while last_action != Some(SubscriptionAction::Finish) { + if last_action != Some(SubscriptionAction::Suspend) { + let subscription = subscription.take().unwrap(); + let mut data_stream = subscription.data_stream.fuse(); + let wait_action = receiver.recv().fuse(); + futures::pin_mut!(wait_action); + loop { + futures::select!( + // waiting next subscription data + data = data_stream.select_next_some() => { + callback(data.map(|data| ResultOfSubscription { result: data })).await + }, + // waiting for some action with subscription + action = wait_action => match action { + None => { + last_action = Some(SubscriptionAction::Finish); + break; + }, + Some(SubscriptionAction::Resume) => {}, + _ => { + last_action = action; + break; + } + } + ); + } + subscription.unsubscribe.await; + } + loop { + match last_action { + Some(SubscriptionAction::Suspend) => last_action = receiver.recv().await, + Some(SubscriptionAction::Finish) | None => { + last_action = Some(SubscriptionAction::Finish); + break; + } + Some(SubscriptionAction::Resume) => { + let result = create_subscription(context.clone(), ¶ms).await; + match result { + Ok(resumed) => subscription = Some(resumed), + Err(err) => { + callback(Err(err)).await; + last_action = Some(SubscriptionAction::Suspend); + } + } + break; + }, + } + } } - subscription.unsubscribe.await; + })); Ok(ResultOfSubscribeCollection { handle }) @@ -355,14 +397,44 @@ pub async fn subscribe_collection + Send>( /// Cancels a subscription specified by its handle. #[api_function] pub async fn unsubscribe( - _context: std::sync::Arc, + context: std::sync::Arc, params: ResultOfSubscribeCollection, ) -> ClientResult<()> { - if let Some(mut sender) = extract_subscription_handle(¶ms.handle).await { - let _ = sender.send(true); + if let Some(mut sender) = extract_subscription_handle(&context, ¶ms.handle).await { + let _ = sender.send(SubscriptionAction::Finish); + } + + Ok(()) +} + +/// Suspends network module to stop any network activity +#[api_function] +pub async fn suspend( + context: std::sync::Arc, +) -> ClientResult<()> { + context.get_client()?.suspend(); + + let mut subscriptions = context.net.subscriptions.lock().await; + + for sender in subscriptions.values_mut() { + let _ = sender.send(SubscriptionAction::Suspend).await; } Ok(()) } +/// Resumes network module to enable network activity +#[api_function] +pub async fn resume( + context: std::sync::Arc, +) -> ClientResult<()> { + context.get_client()?.resume(); + + let mut subscriptions = context.net.subscriptions.lock().await; + for sender in subscriptions.values_mut() { + let _ = sender.send(SubscriptionAction::Resume).await; + } + + Ok(()) +} diff --git a/ton_client/src/net/node_client.rs b/ton_client/src/net/node_client.rs index 7497469b7..9c2b7ddc3 100644 --- a/ton_client/src/net/node_client.rs +++ b/ton_client/src/net/node_client.rs @@ -21,6 +21,7 @@ use std::collections::HashMap; use std::iter::FromIterator; use std::pin::Pin; use std::sync::Arc; +use std::sync::atomic::{AtomicBool, Ordering}; pub const MAX_TIMEOUT: u32 = std::i32::MAX as u32; @@ -81,6 +82,7 @@ pub(crate) struct Subscription { pub(crate) struct NodeClient { config: NetworkConfig, client_env: Arc, + suspended: AtomicBool, server_info: tokio::sync::RwLock>, // TODO: use tokio::sync:RwLock when SDK core is fully async query_url: std::sync::RwLock>, @@ -91,6 +93,7 @@ impl NodeClient { NodeClient { config, client_env, + suspended: AtomicBool::new(false), query_url: std::sync::RwLock::new(None), server_info: tokio::sync::RwLock::new(None), } @@ -196,6 +199,10 @@ impl NodeClient { } async fn ensure_client(&self) -> ClientResult<()> { + if self.suspended.load(Ordering::Relaxed) { + return Err(Error::network_module_suspended()); + } + if self.server_info.read().await.is_some() { return Ok(()); } @@ -552,4 +559,12 @@ impl NodeClient { Ok(()) } + + pub fn suspend(&self) { + self.suspended.store(true, Ordering::Relaxed); + } + + pub fn resume(&self) { + self.suspended.store(false, Ordering::Relaxed); + } } diff --git a/ton_client/src/net/tests.rs b/ton_client/src/net/tests.rs index a40795c9b..82be708ea 100644 --- a/ton_client/src/net/tests.rs +++ b/ton_client/src/net/tests.rs @@ -6,7 +6,9 @@ use crate::net::{ ResultOfQueryCollection, ResultOfSubscribeCollection, ResultOfSubscription, ResultOfWaitForCollection, }; +use crate::processing::ParamsOfProcessMessage; use crate::tests::{TestClient, HELLO}; +use tokio::sync::Mutex; #[tokio::test(core_threads = 2)] async fn query() { @@ -125,6 +127,7 @@ async fn wait_for() { #[tokio::test(core_threads = 2)] async fn subscribe_for_transactions_with_addresses() { let client = TestClient::new(); + let subscription_client = TestClient::new(); let keys = client.generate_sign_keys(); let deploy_params = ParamsOfEncodeMessage { abi: TestClient::abi(HELLO, None), @@ -133,7 +136,7 @@ async fn subscribe_for_transactions_with_addresses() { tvc: TestClient::tvc(HELLO, None), workchain_id: None, }), - signer: Signer::Keys { keys }, + signer: Signer::Keys { keys: keys.clone() }, processing_try_index: None, address: None, call_set: CallSet::some_with_function("constructor"), @@ -160,7 +163,7 @@ async fn subscribe_for_transactions_with_addresses() { } }; - let handle: ResultOfSubscribeCollection = client.request_async_callback( + let handle: ResultOfSubscribeCollection = subscription_client.request_async_callback( "net.subscribe_collection", ParamsOfSubscribeCollection { collection: "transactions".to_owned(), @@ -172,16 +175,59 @@ async fn subscribe_for_transactions_with_addresses() { }, callback ).await.unwrap(); - client.deploy_with_giver_async(deploy_params, None).await; + + // send grams to create first transaction + client.get_grams_from_giver_async(&msg.address, None).await; // give some time for subscription to receive all data std::thread::sleep(std::time::Duration::from_millis(1000)); + // suspend subscription + let _: () = subscription_client.request_async("net.suspend", ()).await.unwrap(); + + // deploy to create second transaction + client.net_process_message( + ParamsOfProcessMessage { + message_encode_params: deploy_params, + send_events: false, + }, + TestClient::default_callback + ).await.unwrap(); + + // check that second transaction is not received when subscription suspended + { + let transactions = transactions.lock().await; + assert_eq!(transactions.len(), 1); + } + + // resume subscription + let _: () = subscription_client.request_async("net.resume", ()).await.unwrap(); + + // run contract function to create third transaction + client.net_process_message( + ParamsOfProcessMessage { + message_encode_params: ParamsOfEncodeMessage { + abi: TestClient::abi(HELLO, None), + deploy_set: None, + signer: Signer::Keys { keys }, + processing_try_index: None, + address: Some(msg.address), + call_set: CallSet::some_with_function("touch"), + }, + send_events: false, + }, + TestClient::default_callback + ).await.unwrap(); + + // give some time for subscription to receive all data + std::thread::sleep(std::time::Duration::from_millis(1000)); + + // check that third transaction is now received after resume let transactions = transactions.lock().await; assert_eq!(transactions.len(), 2); assert_ne!(transactions[0]["id"], transactions[1]["id"]); - let _: () = client + let _: () = subscription_client .request_async("net.unsubscribe", handle) .await .unwrap(); From d5532a1641ad36c947aae851cf08d0f25ca4eaa4 Mon Sep 17 00:00:00 2001 From: Alexey Vavilin Date: Fri, 4 Dec 2020 11:36:58 +0300 Subject: [PATCH 08/15] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c233ba39f..d9464ea0a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ All notable changes to this project will be documented in this file. ### New - `query` method in the `net` module. Performs custom graphql query. +- `suspend` and `resume` methods in the `net` module for disabling and enabling network activity ## 1.2.0 Nov 26, 2020 From 99925795e83440405d4be850294118fadf560283 Mon Sep 17 00:00:00 2001 From: Alexey Vavilin Date: Fri, 4 Dec 2020 11:42:33 +0300 Subject: [PATCH 09/15] Update docs --- docs/mod_net.md | 26 +++++++++++++++++++++ docs/modules.md | 4 ++++ tools/api.json | 62 ++++++++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 91 insertions(+), 1 deletion(-) diff --git a/docs/mod_net.md b/docs/mod_net.md index acd10d44b..9007f7388 100644 --- a/docs/mod_net.md +++ b/docs/mod_net.md @@ -12,6 +12,10 @@ [subscribe_collection](#subscribe_collection) – Creates a subscription +[suspend](#suspend) – Suspends network module to stop any network activity + +[resume](#resume) – Resumes network module to enable network activity + ## Types [OrderBy](#OrderBy) @@ -188,6 +192,28 @@ function subscribe_collection( - `handle`: _number_ – Subscription handle. Must be closed with `unsubscribe` +## suspend + +Suspends network module to stop any network activity + +```ts +function suspend(): Promise; +``` +### Result + + + +## resume + +Resumes network module to enable network activity + +```ts +function resume(): Promise; +``` +### Result + + + # Types ## OrderBy ```ts diff --git a/docs/modules.md b/docs/modules.md index ee6a27a22..73f404b46 100644 --- a/docs/modules.md +++ b/docs/modules.md @@ -149,6 +149,10 @@ [subscribe_collection](mod_net.md#subscribe_collection) – Creates a subscription +[suspend](mod_net.md#suspend) – Suspends network module to stop any network activity + +[resume](mod_net.md#resume) – Resumes network module to enable network activity + ## [debot](mod_debot.md) – [UNSTABLE](UNSTABLE.md) Module for working with debot. [start](mod_debot.md#start) – [UNSTABLE](UNSTABLE.md) Starts an instance of debot. diff --git a/tools/api.json b/tools/api.json index 3bda06b47..04ada91d3 100644 --- a/tools/api.json +++ b/tools/api.json @@ -6405,7 +6405,7 @@ "description": " Cancels a subscription\n\n Cancels a subscription specified by its handle.", "params": [ { - "name": "_context", + "name": "context", "type": "Generic", "generic_name": "Arc", "generic_args": [ @@ -6486,6 +6486,66 @@ ] }, "errors": null + }, + { + "name": "suspend", + "summary": " Suspends network module to stop any network activity", + "description": " Suspends network module to stop any network activity", + "params": [ + { + "name": "context", + "type": "Generic", + "generic_name": "Arc", + "generic_args": [ + { + "type": "Ref", + "ref_name": "ClientContext" + } + ], + "summary": null, + "description": null + } + ], + "result": { + "type": "Generic", + "generic_name": "ClientResult", + "generic_args": [ + { + "type": "None" + } + ] + }, + "errors": null + }, + { + "name": "resume", + "summary": " Resumes network module to enable network activity", + "description": " Resumes network module to enable network activity", + "params": [ + { + "name": "context", + "type": "Generic", + "generic_name": "Arc", + "generic_args": [ + { + "type": "Ref", + "ref_name": "ClientContext" + } + ], + "summary": null, + "description": null + } + ], + "result": { + "type": "Generic", + "generic_name": "ClientResult", + "generic_args": [ + { + "type": "None" + } + ] + }, + "errors": null } ] }, From 0a85a2fb35839c153d4abff763e3b394e8708270 Mon Sep 17 00:00:00 2001 From: Ekaterina Pantaz <52739957+elasticLove1@users.noreply.github.com> Date: Mon, 7 Dec 2020 01:25:40 +0300 Subject: [PATCH 10/15] Update README.md --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 23044f3b0..122990343 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,8 @@ **Documentation** -[GraphQL API and SDK documentation](https://docs.ton.dev/86757ecb2/p/92b041-overview) +[API Reference](https://github.com/tonlabs/TON-SDK/blob/master/docs/modules.md) +[GraphQL API documentation](https://docs.ton.dev/86757ecb2/p/70a850-introduction) # What is TONOS Client Library @@ -21,7 +22,7 @@ We ended up with very slow work of pure JavaScript and decided to move all this library and link it to Javascript as a compiled binary including a wasm module for browser applications. -Also this approach provides an opportunity to easily create bindings for any programming +Also this approach provided an opportunity to easily create bindings for any programming language and platform, thus, to make it possible to develop distributed applications (DApps) for any possible use-cases, such as: mobile DApps, web DApps, server-side DApps, enterprise DApp etc. From 37b8e76dbb543e8579be32009ff45322bcbe5524 Mon Sep 17 00:00:00 2001 From: Ekaterina Pantaz <52739957+elasticLove1@users.noreply.github.com> Date: Mon, 7 Dec 2020 01:28:20 +0300 Subject: [PATCH 11/15] Update README.md --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 122990343..3736c2de6 100644 --- a/README.md +++ b/README.md @@ -30,11 +30,10 @@ DApp etc. Client Library exposes all the functionality through a few of exported functions. All interaction with library is performed using JSON-RPC like protocol. -Library works over GraphQL API of [TON OS DApp Server](https://github.com/tonlabs/TON-OS-DApp-Server). +Library works over [GraphQL API](https://docs.ton.dev/86757ecb2/p/70a850-introduction) of [TON OS DApp Server](https://github.com/tonlabs/TON-OS-DApp-Server). So, it can be used to interact directly with TON OS Clouds: - [Freeton](https://main.ton.dev/graphql) - [Devnet](https://net.ton.dev/graphql) -- [Testnet](https://testnet.ton.dev/graphql) # How to use library From add2668dd4687b25a5c8210f7769553683d1ccf7 Mon Sep 17 00:00:00 2001 From: Ekaterina Pantaz <52739957+elasticLove1@users.noreply.github.com> Date: Mon, 7 Dec 2020 01:42:55 +0300 Subject: [PATCH 12/15] Update CHANGELOG.md --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d9464ea0a..f0209a764 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,8 +4,8 @@ All notable changes to this project will be documented in this file. ## 1.3.0 Dec 8, 2020 ### New -- `query` method in the `net` module. Performs custom graphql query. -- `suspend` and `resume` methods in the `net` module for disabling and enabling network activity +- `net.query` method . Performs custom graphql query that can be copied directly from the playground. +- `net.suspend` and `net.resume` methods for disabling and enabling network activity. One of the possible use-cases is to manage subscriptions when a mobile application is brought to the background and into the foreground again. ## 1.2.0 Nov 26, 2020 From ee3e1ef808346fc1229d43092785304fec2823af Mon Sep 17 00:00:00 2001 From: Ekaterina Pantaz <52739957+elasticLove1@users.noreply.github.com> Date: Mon, 7 Dec 2020 01:43:47 +0300 Subject: [PATCH 13/15] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f0209a764..a945802ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ All notable changes to this project will be documented in this file. ## 1.3.0 Dec 8, 2020 -### New +### Featured - `net.query` method . Performs custom graphql query that can be copied directly from the playground. - `net.suspend` and `net.resume` methods for disabling and enabling network activity. One of the possible use-cases is to manage subscriptions when a mobile application is brought to the background and into the foreground again. From e7dac9e4aa353a37e08333660dd8ae4a77aaae86 Mon Sep 17 00:00:00 2001 From: Michael Vlasov Date: Mon, 7 Dec 2020 10:58:03 +0500 Subject: [PATCH 14/15] NEW: Smart summary and description doc separation. NEW: ts-generator includes doc comments in JSDoc format. --- api/derive/src/utils.rs | 75 ++ docs/mod_abi.md | 55 +- docs/mod_boc.md | 2 +- docs/mod_client.md | 8 +- docs/mod_crypto.md | 104 ++- docs/mod_debot.md | 21 +- docs/mod_net.md | 17 +- docs/mod_processing.md | 21 +- docs/mod_tvm.md | 48 +- docs/mod_utils.md | 2 +- tools/api.json | 1500 +++++++++++++++++++-------------------- tools/api.ts | 15 +- tools/docs.ts | 184 ++--- tools/ts-code.ts | 254 ++++--- 14 files changed, 1215 insertions(+), 1091 deletions(-) diff --git a/api/derive/src/utils.rs b/api/derive/src/utils.rs index c2981c1b3..9c05c365c 100644 --- a/api/derive/src/utils.rs +++ b/api/derive/src/utils.rs @@ -295,6 +295,80 @@ fn generic_type_from( } } +fn replace_tabs(s: &str) -> String { + s.split("\t").collect::>().join(" ").trim_end().into() +} + +fn get_leading_spaces(s: &str) -> usize { + let mut count = 0; + while count < s.len() && &s[count..=count] == " " { + count += 1; + } + count +} + +fn reduce_lines(lines: Vec) -> Vec { + if lines.is_empty() { + return lines; + } + let mut min_leading_spaces = None; + let mut reduced = Vec::new(); + for line in &lines { + let line = replace_tabs(&line); + if !line.is_empty() { + let leading_spaces = get_leading_spaces(&line); + if min_leading_spaces.is_none() || leading_spaces < min_leading_spaces.unwrap() { + min_leading_spaces = Some(leading_spaces); + } + } + reduced.push(line); + } + if min_leading_spaces.is_some() && min_leading_spaces.unwrap() > 0 { + for line in &mut reduced { + if !line.is_empty() { + *line = line[min_leading_spaces.unwrap()..].into(); + } + } + } + reduced +} + + +fn get_doc(element_summary: String, element_description: String) -> (String, String) { + if element_description.trim().is_empty() { + return (element_summary, String::new()); + } + let lines = reduce_lines(element_description.split("\n").map(|s| s.into()).collect()); + let mut summary = String::new(); + let mut summary_complete = false; + let mut description = String::new(); + for line in &lines { + if summary_complete { + if !line.is_empty() || !description.is_empty() { + description.push_str(line); + description.push_str("\n"); + } + } else if !line.is_empty() { + if !summary.is_empty() { + summary.push_str(" "); + } + if let Some(dot_pos) = line.find(". ").or(line.find(".\n")) { + summary.push_str(&line[0..(dot_pos + 1)]); + summary_complete = true; + description.push_str(&line[(dot_pos + 1)..].trim_start()); + } else { + summary.push_str(line); + } + } else { + if !summary.is_empty() { + summary_complete = true; + } + } + } + (summary, description.trim().into()) +} + + pub(crate) fn doc_from(attrs: &Vec) -> (Option, Option) { let mut summary = String::new(); let mut description = String::new(); @@ -326,6 +400,7 @@ pub(crate) fn doc_from(attrs: &Vec) -> (Option, OptionPresents when `message` is unsigned. Can be used for external
message signing. Is this case you need to sing this data and
produce signed message using `abi.attach_signature`. +- `data_to_sign`?: _string_ – Optional data to sign. +
Encoded with `base64`.
Presents when `message` is unsigned. Can be used for external
message signing. Is this case you need to sing this data and
produce signed message using `abi.attach_signature`. ## attach_signature_to_message_body @@ -133,9 +132,12 @@ function attach_signature_to_message_body( ``` ### Parameters - `abi`: _[Abi](mod_abi.md#Abi)_ – Contract ABI -- `public_key`: _string_ – Public key. Must be encoded with `hex`. -- `message`: _string_ – Unsigned message body BOC. Must be encoded with `base64`. -- `signature`: _string_ – Signature. Must be encoded with `hex`. +- `public_key`: _string_ – Public key. +
Must be encoded with `hex`. +- `message`: _string_ – Unsigned message body BOC. +
Must be encoded with `base64`. +- `signature`: _string_ – Signature. +
Must be encoded with `hex`. ### Result - `body`: _string_ @@ -406,8 +408,10 @@ type FunctionHeader = { }; ``` - `expire`?: _number_ – Message expiration time in seconds. If not specified - calculated automatically from message_expiration_timeout(), try_index and message_expiration_timeout_grow_factor() (if ABI includes `expire` header). -- `time`?: _bigint_ – Message creation time in milliseconds. If not specified, `now` is used (if ABI includes `time` header). -- `pubkey`?: _string_ – Public key is used by the contract to check the signature. Encoded in `hex`. If not specified, method fails with exception (if ABI includes `pubkey` header).. +- `time`?: _bigint_ – Message creation time in milliseconds. +
If not specified, `now` is used(if ABI includes `time` header). +- `pubkey`?: _string_ – Public key is used by the contract to check the signature. +
Encoded in `hex`.If not specified, method fails with exception (if ABI includes `pubkey` header).. ## CallSet @@ -433,7 +437,8 @@ type DeploySet = { }; ``` - `tvc`: _string_ – Content of TVC file encoded in `base64`. -- `workchain_id`?: _number_ – Target workchain for destination address. Default is `0`. +- `workchain_id`?: _number_ – Target workchain for destination address. +
Default is `0`. - `initial_data`?: _any_ – List of initial values for contract's public variables. @@ -456,7 +461,9 @@ Depends on value of the `type` field. When _type_ is _'None'_ -No keys are provided. Creates an unsigned message. +No keys are provided. + +Creates an unsigned message. When _type_ is _'External'_ @@ -525,13 +532,18 @@ When _type_ is _'StateInit'_ State init data. -- `code`: _string_ – Code BOC. Encoded in `base64`. -- `data`: _string_ – Data BOC. Encoded in `base64`. -- `library`?: _string_ – Library BOC. Encoded in `base64`. +- `code`: _string_ – Code BOC. +
Encoded in `base64`. +- `data`: _string_ – Data BOC. +
Encoded in `base64`. +- `library`?: _string_ – Library BOC. +
Encoded in `base64`. When _type_ is _'Tvc'_ -Content of the TVC file. Encoded in `base64`. +Content of the TVC file. + +Encoded in `base64`. - `tvc`: _string_ @@ -684,8 +696,8 @@ type ResultOfEncodeMessageBody = { }; ``` - `body`: _string_ – Message body BOC encoded with `base64`. -- `data_to_sign`?: _string_ – Optional data to sign. Encoded with `base64`. -
Presents when `message` is unsigned. Can be used for external
message signing. Is this case you need to sing this data and
produce signed message using `abi.attach_signature`. +- `data_to_sign`?: _string_ – Optional data to sign. +
Encoded with `base64`.
Presents when `message` is unsigned. Can be used for external
message signing. Is this case you need to sing this data and
produce signed message using `abi.attach_signature`. ## ParamsOfAttachSignatureToMessageBody @@ -698,9 +710,12 @@ type ParamsOfAttachSignatureToMessageBody = { }; ``` - `abi`: _[Abi](mod_abi.md#Abi)_ – Contract ABI -- `public_key`: _string_ – Public key. Must be encoded with `hex`. -- `message`: _string_ – Unsigned message body BOC. Must be encoded with `base64`. -- `signature`: _string_ – Signature. Must be encoded with `hex`. +- `public_key`: _string_ – Public key. +
Must be encoded with `hex`. +- `message`: _string_ – Unsigned message body BOC. +
Must be encoded with `base64`. +- `signature`: _string_ – Signature. +
Must be encoded with `hex`. ## ResultOfAttachSignatureToMessageBody diff --git a/docs/mod_boc.md b/docs/mod_boc.md index c317a3c56..f3c063e7e 100644 --- a/docs/mod_boc.md +++ b/docs/mod_boc.md @@ -1,6 +1,6 @@ # Module boc - BOC manipulation module. +null ## Functions [parse_message](#parse_message) – Parses message boc into a JSON diff --git a/docs/mod_client.md b/docs/mod_client.md index 76c24a74e..9d63b475a 100644 --- a/docs/mod_client.md +++ b/docs/mod_client.md @@ -1,6 +1,6 @@ # Module client - Provides information about library. +null ## Functions [get_api_reference](#get_api_reference) – Returns Core Library API reference @@ -189,7 +189,8 @@ type BuildInfoDependency = { git_commit: string }; ``` -- `name`: _string_ – Dependency name. Usually it is a crate name. +- `name`: _string_ – Dependency name. +
Usually it is a crate name. - `git_commit`: _string_ – Git commit hash of the related repository. @@ -200,7 +201,8 @@ type ParamsOfAppRequest = { request_data: any }; ``` -- `app_request_id`: _number_ – Request ID. Should be used in `resolve_app_request` call +- `app_request_id`: _number_ – Request ID. +
Should be used in `resolve_app_request` call - `request_data`: _any_ – Request describing data diff --git a/docs/mod_crypto.md b/docs/mod_crypto.md index 4dcdb3cb5..90b0242e7 100644 --- a/docs/mod_crypto.md +++ b/docs/mod_crypto.md @@ -1,6 +1,6 @@ # Module crypto - Crypto functions. +null ## Functions [factorize](#factorize) – Performs prime factorization – decomposition of a composite number into a product of smaller prime integers (factors). See [https://en.wikipedia.org/wiki/Integer_factorization] @@ -269,7 +269,8 @@ function ton_crc16( ): Promise; ``` ### Parameters -- `data`: _string_ – Input data for CRC calculation. Encoded with `base64`. +- `data`: _string_ – Input data for CRC calculation. +
Encoded with `base64`. ### Result - `crc`: _number_ – Calculated CRC for input data. @@ -413,10 +414,12 @@ function sha256( ): Promise; ``` ### Parameters -- `data`: _string_ – Input data for hash calculation. Encoded with `base64`. +- `data`: _string_ – Input data for hash calculation. +
Encoded with `base64`. ### Result -- `hash`: _string_ – Hash of input `data`. Encoded with 'hex'. +- `hash`: _string_ – Hash of input `data`. +
Encoded with 'hex'. ## sha512 @@ -437,10 +440,12 @@ function sha512( ): Promise; ``` ### Parameters -- `data`: _string_ – Input data for hash calculation. Encoded with `base64`. +- `data`: _string_ – Input data for hash calculation. +
Encoded with `base64`. ### Result -- `hash`: _string_ – Hash of input `data`. Encoded with 'hex'. +- `hash`: _string_ – Hash of input `data`. +
Encoded with 'hex'. ## scrypt @@ -487,7 +492,8 @@ function scrypt( - `dk_len`: _number_ – Intended output length in octets of the derived key. ### Result -- `key`: _string_ – Derived key. Encoded with `hex`. +- `key`: _string_ – Derived key. +
Encoded with `hex`. ## nacl_sign_keypair_from_secret_key @@ -559,7 +565,8 @@ function nacl_sign_open( ): Promise; ``` ### Parameters -- `signed`: _string_ – Signed data that must be unsigned. Encoded with `base64`. +- `signed`: _string_ – Signed data that must be unsigned. +
Encoded with `base64`. - `public`: _string_ – Signer's public key - unprefixed 0-padded to 64 symbols hex string ### Result @@ -686,7 +693,8 @@ function nacl_box_open( ): Promise; ``` ### Parameters -- `encrypted`: _string_ – Data that must be decrypted. Encoded with `base64`. +- `encrypted`: _string_ – Data that must be decrypted. +
Encoded with `base64`. - `nonce`: _string_ - `their_public`: _string_ – Sender's public key - unprefixed 0-padded to 64 symbols hex string - `secret`: _string_ – Receiver's private key - unprefixed 0-padded to 64 symbols hex string @@ -715,7 +723,8 @@ function nacl_secret_box( ): Promise; ``` ### Parameters -- `decrypted`: _string_ – Data that must be encrypted. Encoded with `base64`. +- `decrypted`: _string_ – Data that must be encrypted. +
Encoded with `base64`. - `nonce`: _string_ – Nonce in `hex` - `key`: _string_ – Secret key - unprefixed 0-padded to 64 symbols hex string ### Result @@ -743,7 +752,8 @@ function nacl_secret_box_open( ): Promise; ``` ### Parameters -- `encrypted`: _string_ – Data that must be decrypted. Encoded with `base64`. +- `encrypted`: _string_ – Data that must be decrypted. +
Encoded with `base64`. - `nonce`: _string_ – Nonce in `hex` - `key`: _string_ – Public key - unprefixed 0-padded to 64 symbols hex string ### Result @@ -821,7 +831,8 @@ function mnemonic_from_entropy( ): Promise; ``` ### Parameters -- `entropy`: _string_ – Entropy bytes. Hex encoded. +- `entropy`: _string_ – Entropy bytes. +
Hex encoded. - `dictionary`?: _number_ – Dictionary identifier - `word_count`?: _number_ – Mnemonic word count ### Result @@ -1039,12 +1050,16 @@ function chacha20( ): Promise; ``` ### Parameters -- `data`: _string_ – Source data to be encrypted or decrypted. Must be encoded with `base64`. -- `key`: _string_ – 256-bit key. Must be encoded with `hex`. -- `nonce`: _string_ – 96-bit nonce. Must be encoded with `hex`. +- `data`: _string_ – Source data to be encrypted or decrypted. +
Must be encoded with `base64`. +- `key`: _string_ – 256-bit key. +
Must be encoded with `hex`. +- `nonce`: _string_ – 96-bit nonce. +
Must be encoded with `hex`. ### Result -- `data`: _string_ – Encrypted/decrypted data. Encoded with `base64`. +- `data`: _string_ – Encrypted/decrypted data. +
Encoded with `base64`. ## register_signing_box @@ -1112,7 +1127,8 @@ function signing_box_get_public_key( - `handle`: _[SigningBoxHandle](mod_crypto.md#SigningBoxHandle)_ – Handle of the signing box. ### Result -- `pubkey`: _string_ – Public key of signing box. Encoded with hex +- `pubkey`: _string_ – Public key of signing box. +
Encoded with hex ## signing_box_sign @@ -1135,10 +1151,12 @@ function signing_box_sign( ``` ### Parameters - `signing_box`: _[SigningBoxHandle](mod_crypto.md#SigningBoxHandle)_ – Signing Box handle. -- `unsigned`: _string_ – Unsigned user data. Must be encoded with `base64`. +- `unsigned`: _string_ – Unsigned user data. +
Must be encoded with `base64`. ### Result -- `signature`: _string_ – Data signature. Encoded with `base64`. +- `signature`: _string_ – Data signature. +
Encoded with `base64`. ## remove_signing_box @@ -1213,7 +1231,8 @@ type ParamsOfTonCrc16 = { data: string }; ``` -- `data`: _string_ – Input data for CRC calculation. Encoded with `base64`. +- `data`: _string_ – Input data for CRC calculation. +
Encoded with `base64`. ## ResultOfTonCrc16 @@ -1320,7 +1339,8 @@ type ParamsOfHash = { data: string }; ``` -- `data`: _string_ – Input data for hash calculation. Encoded with `base64`. +- `data`: _string_ – Input data for hash calculation. +
Encoded with `base64`. ## ResultOfHash @@ -1329,7 +1349,8 @@ type ResultOfHash = { hash: string }; ``` -- `hash`: _string_ – Hash of input `data`. Encoded with 'hex'. +- `hash`: _string_ – Hash of input `data`. +
Encoded with 'hex'. ## ParamsOfScrypt @@ -1357,7 +1378,8 @@ type ResultOfScrypt = { key: string }; ``` -- `key`: _string_ – Derived key. Encoded with `hex`. +- `key`: _string_ – Derived key. +
Encoded with `hex`. ## ParamsOfNaclSignKeyPairFromSecret @@ -1396,7 +1418,8 @@ type ParamsOfNaclSignOpen = { public: string }; ``` -- `signed`: _string_ – Signed data that must be unsigned. Encoded with `base64`. +- `signed`: _string_ – Signed data that must be unsigned. +
Encoded with `base64`. - `public`: _string_ – Signer's public key - unprefixed 0-padded to 64 symbols hex string @@ -1460,7 +1483,8 @@ type ParamsOfNaclBoxOpen = { secret: string }; ``` -- `encrypted`: _string_ – Data that must be decrypted. Encoded with `base64`. +- `encrypted`: _string_ – Data that must be decrypted. +
Encoded with `base64`. - `nonce`: _string_ - `their_public`: _string_ – Sender's public key - unprefixed 0-padded to 64 symbols hex string - `secret`: _string_ – Receiver's private key - unprefixed 0-padded to 64 symbols hex string @@ -1483,7 +1507,8 @@ type ParamsOfNaclSecretBox = { key: string }; ``` -- `decrypted`: _string_ – Data that must be encrypted. Encoded with `base64`. +- `decrypted`: _string_ – Data that must be encrypted. +
Encoded with `base64`. - `nonce`: _string_ – Nonce in `hex` - `key`: _string_ – Secret key - unprefixed 0-padded to 64 symbols hex string @@ -1496,7 +1521,8 @@ type ParamsOfNaclSecretBoxOpen = { key: string }; ``` -- `encrypted`: _string_ – Data that must be decrypted. Encoded with `base64`. +- `encrypted`: _string_ – Data that must be decrypted. +
Encoded with `base64`. - `nonce`: _string_ – Nonce in `hex` - `key`: _string_ – Public key - unprefixed 0-padded to 64 symbols hex string @@ -1547,7 +1573,8 @@ type ParamsOfMnemonicFromEntropy = { word_count?: number }; ``` -- `entropy`: _string_ – Entropy bytes. Hex encoded. +- `entropy`: _string_ – Entropy bytes. +
Hex encoded. - `dictionary`?: _number_ – Dictionary identifier - `word_count`?: _number_ – Mnemonic word count @@ -1706,9 +1733,12 @@ type ParamsOfChaCha20 = { nonce: string }; ``` -- `data`: _string_ – Source data to be encrypted or decrypted. Must be encoded with `base64`. -- `key`: _string_ – 256-bit key. Must be encoded with `hex`. -- `nonce`: _string_ – 96-bit nonce. Must be encoded with `hex`. +- `data`: _string_ – Source data to be encrypted or decrypted. +
Must be encoded with `base64`. +- `key`: _string_ – 256-bit key. +
Must be encoded with `hex`. +- `nonce`: _string_ – 96-bit nonce. +
Must be encoded with `hex`. ## ResultOfChaCha20 @@ -1717,7 +1747,8 @@ type ResultOfChaCha20 = { data: string }; ``` -- `data`: _string_ – Encrypted/decrypted data. Encoded with `base64`. +- `data`: _string_ – Encrypted/decrypted data. +
Encoded with `base64`. ## RegisteredSigningBox @@ -1790,7 +1821,8 @@ type ResultOfSigningBoxGetPublicKey = { pubkey: string }; ``` -- `pubkey`: _string_ – Public key of signing box. Encoded with hex +- `pubkey`: _string_ – Public key of signing box. +
Encoded with hex ## ParamsOfSigningBoxSign @@ -1801,7 +1833,8 @@ type ParamsOfSigningBoxSign = { }; ``` - `signing_box`: _[SigningBoxHandle](mod_crypto.md#SigningBoxHandle)_ – Signing Box handle. -- `unsigned`: _string_ – Unsigned user data. Must be encoded with `base64`. +- `unsigned`: _string_ – Unsigned user data. +
Must be encoded with `base64`. ## ResultOfSigningBoxSign @@ -1810,6 +1843,7 @@ type ResultOfSigningBoxSign = { signature: string }; ``` -- `signature`: _string_ – Data signature. Encoded with `base64`. +- `signature`: _string_ – Data signature. +
Encoded with `base64`. diff --git a/docs/mod_debot.md b/docs/mod_debot.md index 048c558e7..30f203fba 100644 --- a/docs/mod_debot.md +++ b/docs/mod_debot.md @@ -1,6 +1,6 @@ # Module debot - [UNSTABLE](UNSTABLE.md) Module for working with debot. +null ## Functions [start](#start) – [UNSTABLE](UNSTABLE.md) Starts an instance of debot. @@ -165,12 +165,16 @@ type DebotAction = { misc: string }; ``` -- `description`: _string_ – A short action description. Should be used by Debot Browser as name of menu item. -- `name`: _string_ – Depends on action type. Can be a debot function name or a print string (for Print Action). +- `description`: _string_ – A short action description. +
Should be used by Debot Browser as name ofmenu item. +- `name`: _string_ – Depends on action type. +
Can be a debot function name or a print string(for Print Action). - `action_type`: _number_ – Action type. - `to`: _number_ – ID of debot context to switch after action execution. -- `attributes`: _string_ – Action attributes. In the form of "param=value,flag". attribute example: instant, args, fargs, sign. -- `misc`: _string_ – Some internal action data. Used by debot only. +- `attributes`: _string_ – Action attributes. +
In the form of "param=value,flag".attribute example: instant, args, fargs, sign. +- `misc`: _string_ – Some internal action data. +
Used by debot only. ## ParamsOfStart @@ -253,7 +257,9 @@ Request user input. When _type_ is _'GetSigningBox'_ -Get signing box to sign data. Signing box returned is owned and disposed by debot engine +Get signing box to sign data. + +Signing box returned is owned and disposed by debot engine When _type_ is _'InvokeDebot'_ @@ -293,7 +299,8 @@ When _type_ is _'GetSigningBox'_ Result of getting signing box. -- `signing_box`: _[SigningBoxHandle](mod_crypto.md#SigningBoxHandle)_ – Signing box for signing data requested by debot engine. Signing box is owned and disposed by debot engine +- `signing_box`: _[SigningBoxHandle](mod_crypto.md#SigningBoxHandle)_ – Signing box for signing data requested by debot engine. +
Signing box is owned and disposed by debot engine When _type_ is _'InvokeDebot'_ diff --git a/docs/mod_net.md b/docs/mod_net.md index acd10d44b..9476caaa9 100644 --- a/docs/mod_net.md +++ b/docs/mod_net.md @@ -1,6 +1,6 @@ # Module net - Network access. +null ## Functions [query](#query) – Performs DAppServer GraphQL query. @@ -55,7 +55,8 @@ function query( ``` ### Parameters - `query`: _string_ – GraphQL query text. -- `variables`?: _any_ – Variables used in query. Must be a map with named values that can be used in query. +- `variables`?: _any_ – Variables used in query. +
Must be a map with named values thatcan be used in query. ### Result - `result`: _any_ – Result provided by DAppServer. @@ -150,7 +151,8 @@ function unsubscribe( ): Promise; ``` ### Parameters -- `handle`: _number_ – Subscription handle. Must be closed with `unsubscribe` +- `handle`: _number_ – Subscription handle. +
Must be closed with `unsubscribe` ### Result @@ -185,7 +187,8 @@ function subscribe_collection( - `result`: _string_ – Projection (result) string - `responseHandler`?: _ResponseHandler_ – additional responses handler.### Result -- `handle`: _number_ – Subscription handle. Must be closed with `unsubscribe` +- `handle`: _number_ – Subscription handle. +
Must be closed with `unsubscribe` # Types @@ -218,7 +221,8 @@ type ParamsOfQuery = { }; ``` - `query`: _string_ – GraphQL query text. -- `variables`?: _any_ – Variables used in query. Must be a map with named values that can be used in query. +- `variables`?: _any_ – Variables used in query. +
Must be a map with named values thatcan be used in query. ## ResultOfQuery @@ -286,7 +290,8 @@ type ResultOfSubscribeCollection = { handle: number }; ``` -- `handle`: _number_ – Subscription handle. Must be closed with `unsubscribe` +- `handle`: _number_ – Subscription handle. +
Must be closed with `unsubscribe` ## ParamsOfSubscribeCollection diff --git a/docs/mod_processing.md b/docs/mod_processing.md index ea52311d7..db00f64e9 100644 --- a/docs/mod_processing.md +++ b/docs/mod_processing.md @@ -1,9 +1,7 @@ # Module processing - Message processing module. - - This module incorporates functions related to complex message - processing scenarios. +This module incorporates functions related to complex message +processing scenarios. ## Functions [send_message](#send_message) – Sends message to the network @@ -114,7 +112,8 @@ function wait_for_transaction( ### 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. -- `message`: _string_ – Message BOC. Encoded with `base64`. +- `message`: _string_ – Message BOC. +
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 @@ -122,7 +121,8 @@ function wait_for_transaction( - `transaction`: _any_ – Parsed transaction.
In addition to the regular transaction fields there is a
`boc` field encoded with `base64` which contains source
transaction BOC. -- `out_messages`: _string[]_ – List of output messages' BOCs. Encoded as `base64` +- `out_messages`: _string[]_ – List of output messages' BOCs. +
Encoded as `base64` - `decoded`?: _[DecodedOutput](mod_processing.md#DecodedOutput)_ – Optional decoded message bodies according to the optional `abi` parameter. - `fees`: _[TransactionFees](mod_tvm.md#TransactionFees)_ – Transaction fees @@ -176,7 +176,8 @@ function process_message( - `transaction`: _any_ – Parsed transaction.
In addition to the regular transaction fields there is a
`boc` field encoded with `base64` which contains source
transaction BOC. -- `out_messages`: _string[]_ – List of output messages' BOCs. Encoded as `base64` +- `out_messages`: _string[]_ – List of output messages' BOCs. +
Encoded as `base64` - `decoded`?: _[DecodedOutput](mod_processing.md#DecodedOutput)_ – Optional decoded message bodies according to the optional `abi` parameter. - `fees`: _[TransactionFees](mod_tvm.md#TransactionFees)_ – Transaction fees @@ -323,7 +324,8 @@ type ResultOfProcessMessage = { ``` - `transaction`: _any_ – Parsed transaction.
In addition to the regular transaction fields there is a
`boc` field encoded with `base64` which contains source
transaction BOC. -- `out_messages`: _string[]_ – List of output messages' BOCs. Encoded as `base64` +- `out_messages`: _string[]_ – List of output messages' BOCs. +
Encoded as `base64` - `decoded`?: _[DecodedOutput](mod_processing.md#DecodedOutput)_ – Optional decoded message bodies according to the optional `abi` parameter. - `fees`: _[TransactionFees](mod_tvm.md#TransactionFees)_ – Transaction fees @@ -375,7 +377,8 @@ type ParamsOfWaitForTransaction = { ``` - `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. -- `message`: _string_ – Message BOC. Encoded with `base64`. +- `message`: _string_ – Message BOC. +
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 diff --git a/docs/mod_tvm.md b/docs/mod_tvm.md index de7fc37d2..eaafc9aa4 100644 --- a/docs/mod_tvm.md +++ b/docs/mod_tvm.md @@ -53,7 +53,8 @@ function run_executor( ): Promise; ``` ### Parameters -- `message`: _string_ – Input message BOC. Must be encoded as base64. +- `message`: _string_ – Input message BOC. +
Must be encoded as base64. - `account`: _[AccountForExecutor](mod_tvm.md#AccountForExecutor)_ – Account to run on executor - `execution_options`?: _[ExecutionOptions](mod_tvm.md#ExecutionOptions)_ – Execution options. - `abi`?: _[Abi](mod_abi.md#Abi)_ – Contract ABI for decoding output messages @@ -62,9 +63,11 @@ function run_executor( - `transaction`: _any_ – Parsed transaction.
In addition to the regular transaction fields there is a
`boc` field encoded with `base64` which contains source
transaction BOC. -- `out_messages`: _string[]_ – List of output messages' BOCs. Encoded as `base64` +- `out_messages`: _string[]_ – List of output messages' BOCs. +
Encoded as `base64` - `decoded`?: _[DecodedOutput](mod_processing.md#DecodedOutput)_ – Optional decoded message bodies according to the optional `abi` parameter. -- `account`: _string_ – Updated account state BOC. Encoded as `base64` +- `account`: _string_ – Updated account state BOC. +
Encoded as `base64` - `fees`: _[TransactionFees](mod_tvm.md#TransactionFees)_ – Transaction fees @@ -89,15 +92,19 @@ function run_tvm( ): Promise; ``` ### Parameters -- `message`: _string_ – Input message BOC. Must be encoded as base64. -- `account`: _string_ – Account BOC. Must be encoded as base64. +- `message`: _string_ – Input message BOC. +
Must be encoded as base64. +- `account`: _string_ – Account BOC. +
Must be encoded as base64. - `execution_options`?: _[ExecutionOptions](mod_tvm.md#ExecutionOptions)_ – Execution options. - `abi`?: _[Abi](mod_abi.md#Abi)_ – Contract ABI for dedcoding output messages ### Result -- `out_messages`: _string[]_ – List of output messages' BOCs. Encoded as `base64` +- `out_messages`: _string[]_ – List of output messages' BOCs. +
Encoded as `base64` - `decoded`?: _[DecodedOutput](mod_processing.md#DecodedOutput)_ – Optional decoded message bodies according to the optional `abi` parameter. -- `account`: _string_ – Updated account state BOC. Encoded as `base64`. Attention! Only data in account state is updated. +- `account`: _string_ – Updated account state BOC. +
Encoded as `base64`.Attention! Only data in account state is updated. ## run_get @@ -175,8 +182,10 @@ When _type_ is _'Account'_ Account state to run message -- `boc`: _string_ – Account BOC. Encoded as base64. -- `unlimited_balance`?: _boolean_ – Flag for running account with the unlimited balance. Can be used to calculate transaction fees without balance check +- `boc`: _string_ – Account BOC. +
Encoded as base64. +- `unlimited_balance`?: _boolean_ – Flag for running account with the unlimited balance. +
Can be used to calculatetransaction fees without balance check ## TransactionFees @@ -208,7 +217,8 @@ type ParamsOfRunExecutor = { skip_transaction_check?: boolean }; ``` -- `message`: _string_ – Input message BOC. Must be encoded as base64. +- `message`: _string_ – Input message BOC. +
Must be encoded as base64. - `account`: _[AccountForExecutor](mod_tvm.md#AccountForExecutor)_ – Account to run on executor - `execution_options`?: _[ExecutionOptions](mod_tvm.md#ExecutionOptions)_ – Execution options. - `abi`?: _[Abi](mod_abi.md#Abi)_ – Contract ABI for decoding output messages @@ -227,9 +237,11 @@ type ResultOfRunExecutor = { ``` - `transaction`: _any_ – Parsed transaction.
In addition to the regular transaction fields there is a
`boc` field encoded with `base64` which contains source
transaction BOC. -- `out_messages`: _string[]_ – List of output messages' BOCs. Encoded as `base64` +- `out_messages`: _string[]_ – List of output messages' BOCs. +
Encoded as `base64` - `decoded`?: _[DecodedOutput](mod_processing.md#DecodedOutput)_ – Optional decoded message bodies according to the optional `abi` parameter. -- `account`: _string_ – Updated account state BOC. Encoded as `base64` +- `account`: _string_ – Updated account state BOC. +
Encoded as `base64` - `fees`: _[TransactionFees](mod_tvm.md#TransactionFees)_ – Transaction fees @@ -242,8 +254,10 @@ type ParamsOfRunTvm = { abi?: Abi }; ``` -- `message`: _string_ – Input message BOC. Must be encoded as base64. -- `account`: _string_ – Account BOC. Must be encoded as base64. +- `message`: _string_ – Input message BOC. +
Must be encoded as base64. +- `account`: _string_ – Account BOC. +
Must be encoded as base64. - `execution_options`?: _[ExecutionOptions](mod_tvm.md#ExecutionOptions)_ – Execution options. - `abi`?: _[Abi](mod_abi.md#Abi)_ – Contract ABI for dedcoding output messages @@ -256,9 +270,11 @@ type ResultOfRunTvm = { account: string }; ``` -- `out_messages`: _string[]_ – List of output messages' BOCs. Encoded as `base64` +- `out_messages`: _string[]_ – List of output messages' BOCs. +
Encoded as `base64` - `decoded`?: _[DecodedOutput](mod_processing.md#DecodedOutput)_ – Optional decoded message bodies according to the optional `abi` parameter. -- `account`: _string_ – Updated account state BOC. Encoded as `base64`. Attention! Only data in account state is updated. +- `account`: _string_ – Updated account state BOC. +
Encoded as `base64`.Attention! Only data in account state is updated. ## ParamsOfRunGet diff --git a/docs/mod_utils.md b/docs/mod_utils.md index 6cd07a582..bc8410d1d 100644 --- a/docs/mod_utils.md +++ b/docs/mod_utils.md @@ -1,6 +1,6 @@ # Module utils - Misc utility Functions. +null ## Functions [convert_address](#convert_address) – Converts address from any TON format to any TON format diff --git a/tools/api.json b/tools/api.json index 3bda06b47..50994ebc4 100644 --- a/tools/api.json +++ b/tools/api.json @@ -3,8 +3,8 @@ "modules": [ { "name": "client", - "summary": " Provides information about library.", - "description": " Provides information about library.", + "summary": "Provides information about library.", + "description": null, "types": [ { "name": "ClientError", @@ -238,14 +238,14 @@ { "name": "name", "type": "String", - "summary": " Dependency name. Usually it is a crate name.", - "description": " Dependency name. Usually it is a crate name." + "summary": "Dependency name.", + "description": "Usually it is a crate name." }, { "name": "git_commit", "type": "String", - "summary": " Git commit hash of the related repository.", - "description": " Git commit hash of the related repository." + "summary": "Git commit hash of the related repository.", + "description": null } ], "summary": null, @@ -260,15 +260,15 @@ "type": "Number", "number_type": "UInt", "number_size": 32, - "summary": " Request ID. Should be used in `resolve_app_request` call", - "description": " Request ID. Should be used in `resolve_app_request` call" + "summary": "Request ID.", + "description": "Should be used in `resolve_app_request` call" }, { "name": "request_data", "type": "Ref", "ref_name": "Value", - "summary": " Request describing data", - "description": " Request describing data" + "summary": "Request describing data", + "description": null } ], "summary": null, @@ -285,12 +285,12 @@ { "name": "text", "type": "String", - "summary": " Error description", - "description": " Error description" + "summary": "Error description", + "description": null } ], - "summary": " Error occured during request processing", - "description": " Error occured during request processing" + "summary": "Error occured during request processing", + "description": null }, { "name": "Ok", @@ -300,12 +300,12 @@ "name": "result", "type": "Ref", "ref_name": "Value", - "summary": " Request processing result", - "description": " Request processing result" + "summary": "Request processing result", + "description": null } ], - "summary": " Request processed successfully", - "description": " Request processed successfully" + "summary": "Request processed successfully", + "description": null } ], "summary": null, @@ -333,8 +333,8 @@ { "name": "version", "type": "String", - "summary": " Core Library version", - "description": " Core Library version" + "summary": "Core Library version", + "description": null } ], "summary": null, @@ -349,8 +349,8 @@ "type": "Number", "number_type": "UInt", "number_size": 32, - "summary": " Build number assigned to this build by the CI.", - "description": " Build number assigned to this build by the CI." + "summary": "Build number assigned to this build by the CI.", + "description": null }, { "name": "dependencies", @@ -359,8 +359,8 @@ "type": "Ref", "ref_name": "client.BuildInfoDependency" }, - "summary": " Fingerprint of the most important dependencies.", - "description": " Fingerprint of the most important dependencies." + "summary": "Fingerprint of the most important dependencies.", + "description": null } ], "summary": null, @@ -375,15 +375,15 @@ "type": "Number", "number_type": "UInt", "number_size": 32, - "summary": " Request ID received from SDK", - "description": " Request ID received from SDK" + "summary": "Request ID received from SDK", + "description": null }, { "name": "result", "type": "Ref", "ref_name": "client.AppRequestResult", - "summary": " Result of request processing", - "description": " Result of request processing" + "summary": "Result of request processing", + "description": null } ], "summary": null, @@ -393,8 +393,8 @@ "functions": [ { "name": "get_api_reference", - "summary": " Returns Core Library API reference", - "description": " Returns Core Library API reference", + "summary": "Returns Core Library API reference", + "description": null, "params": [ { "name": "_context", @@ -424,8 +424,8 @@ }, { "name": "version", - "summary": " Returns Core Library version", - "description": " Returns Core Library version", + "summary": "Returns Core Library version", + "description": null, "params": [ { "name": "_context", @@ -455,8 +455,8 @@ }, { "name": "build_info", - "summary": " Returns detailed information about this build.", - "description": " Returns detailed information about this build.", + "summary": "Returns detailed information about this build.", + "description": null, "params": [ { "name": "_context", @@ -486,8 +486,8 @@ }, { "name": "resolve_app_request", - "summary": " Resolves application request processing result", - "description": " Resolves application request processing result", + "summary": "Resolves application request processing result", + "description": null, "params": [ { "name": "context", @@ -525,8 +525,8 @@ }, { "name": "crypto", - "summary": " Crypto functions.", - "description": " Crypto functions.", + "summary": "Crypto functions.", + "description": null, "types": [ { "name": "SigningBoxHandle", @@ -543,8 +543,8 @@ { "name": "composite", "type": "String", - "summary": " Hexadecimal representation of u64 composite number.", - "description": " Hexadecimal representation of u64 composite number." + "summary": "Hexadecimal representation of u64 composite number.", + "description": null } ], "summary": null, @@ -560,8 +560,8 @@ "array_item": { "type": "String" }, - "summary": " Two factors of composite or empty if composite can't be factorized.", - "description": " Two factors of composite or empty if composite can't be factorized." + "summary": "Two factors of composite or empty if composite can't be factorized.", + "description": null } ], "summary": null, @@ -574,20 +574,20 @@ { "name": "base", "type": "String", - "summary": " `base` argument of calculation.", - "description": " `base` argument of calculation." + "summary": "`base` argument of calculation.", + "description": null }, { "name": "exponent", "type": "String", - "summary": " `exponent` argument of calculation.", - "description": " `exponent` argument of calculation." + "summary": "`exponent` argument of calculation.", + "description": null }, { "name": "modulus", "type": "String", - "summary": " `modulus` argument of calculation.", - "description": " `modulus` argument of calculation." + "summary": "`modulus` argument of calculation.", + "description": null } ], "summary": null, @@ -600,8 +600,8 @@ { "name": "modular_power", "type": "String", - "summary": " Result of modular exponentiation", - "description": " Result of modular exponentiation" + "summary": "Result of modular exponentiation", + "description": null } ], "summary": null, @@ -614,8 +614,8 @@ { "name": "data", "type": "String", - "summary": " Input data for CRC calculation. Encoded with `base64`.", - "description": " Input data for CRC calculation. Encoded with `base64`." + "summary": "Input data for CRC calculation.", + "description": "Encoded with `base64`." } ], "summary": null, @@ -630,8 +630,8 @@ "type": "Number", "number_type": "UInt", "number_size": 16, - "summary": " Calculated CRC for input data.", - "description": " Calculated CRC for input data." + "summary": "Calculated CRC for input data.", + "description": null } ], "summary": null, @@ -646,8 +646,8 @@ "type": "Number", "number_type": "UInt", "number_size": 32, - "summary": " Size of random byte array.", - "description": " Size of random byte array." + "summary": "Size of random byte array.", + "description": null } ], "summary": null, @@ -660,8 +660,8 @@ { "name": "bytes", "type": "String", - "summary": " Generated bytes encoded in `base64`.", - "description": " Generated bytes encoded in `base64`." + "summary": "Generated bytes encoded in `base64`.", + "description": null } ], "summary": null, @@ -674,8 +674,8 @@ { "name": "public_key", "type": "String", - "summary": " Public key - 64 symbols hex string", - "description": " Public key - 64 symbols hex string" + "summary": "Public key - 64 symbols hex string", + "description": null } ], "summary": null, @@ -688,8 +688,8 @@ { "name": "ton_public_key", "type": "String", - "summary": " Public key represented in TON safe format.", - "description": " Public key represented in TON safe format." + "summary": "Public key represented in TON safe format.", + "description": null } ], "summary": null, @@ -702,14 +702,14 @@ { "name": "public", "type": "String", - "summary": " Public key - 64 symbols hex string", - "description": " Public key - 64 symbols hex string" + "summary": "Public key - 64 symbols hex string", + "description": null }, { "name": "secret", "type": "String", - "summary": " Private key - u64 symbols hex string", - "description": " Private key - u64 symbols hex string" + "summary": "Private key - u64 symbols hex string", + "description": null } ], "summary": null, @@ -722,15 +722,15 @@ { "name": "unsigned", "type": "String", - "summary": " Data that must be signed encoded in `base64`.", - "description": " Data that must be signed encoded in `base64`." + "summary": "Data that must be signed encoded in `base64`.", + "description": null }, { "name": "keys", "type": "Ref", "ref_name": "crypto.KeyPair", - "summary": " Sign keys.", - "description": " Sign keys." + "summary": "Sign keys.", + "description": null } ], "summary": null, @@ -743,14 +743,14 @@ { "name": "signed", "type": "String", - "summary": " Signed data combined with signature encoded in `base64`.", - "description": " Signed data combined with signature encoded in `base64`." + "summary": "Signed data combined with signature encoded in `base64`.", + "description": null }, { "name": "signature", "type": "String", - "summary": " Signature encoded in `hex`.", - "description": " Signature encoded in `hex`." + "summary": "Signature encoded in `hex`.", + "description": null } ], "summary": null, @@ -763,14 +763,14 @@ { "name": "signed", "type": "String", - "summary": " Signed data that must be verified encoded in `base64`.", - "description": " Signed data that must be verified encoded in `base64`." + "summary": "Signed data that must be verified encoded in `base64`.", + "description": null }, { "name": "public", "type": "String", - "summary": " Signer's public key - 64 symbols hex string", - "description": " Signer's public key - 64 symbols hex string" + "summary": "Signer's public key - 64 symbols hex string", + "description": null } ], "summary": null, @@ -783,8 +783,8 @@ { "name": "unsigned", "type": "String", - "summary": " Unsigned data encoded in `base64`.", - "description": " Unsigned data encoded in `base64`." + "summary": "Unsigned data encoded in `base64`.", + "description": null } ], "summary": null, @@ -797,8 +797,8 @@ { "name": "data", "type": "String", - "summary": " Input data for hash calculation. Encoded with `base64`.", - "description": " Input data for hash calculation. Encoded with `base64`." + "summary": "Input data for hash calculation.", + "description": "Encoded with `base64`." } ], "summary": null, @@ -811,8 +811,8 @@ { "name": "hash", "type": "String", - "summary": " Hash of input `data`. Encoded with 'hex'.", - "description": " Hash of input `data`. Encoded with 'hex'." + "summary": "Hash of input `data`.", + "description": "Encoded with 'hex'." } ], "summary": null, @@ -825,46 +825,46 @@ { "name": "password", "type": "String", - "summary": " The password bytes to be hashed.", - "description": " The password bytes to be hashed.\n Must be encoded with `base64`." + "summary": "The password bytes to be hashed. Must be encoded with `base64`.", + "description": null }, { "name": "salt", "type": "String", - "summary": " Salt bytes that modify the hash to protect against Rainbow table attacks.", - "description": " Salt bytes that modify the hash to protect against Rainbow table attacks.\n Must be encoded with `base64`." + "summary": "Salt bytes that modify the hash to protect against Rainbow table attacks. Must be encoded with `base64`.", + "description": null }, { "name": "log_n", "type": "Number", "number_type": "UInt", "number_size": 8, - "summary": " CPU/memory cost parameter", - "description": " CPU/memory cost parameter" + "summary": "CPU/memory cost parameter", + "description": null }, { "name": "r", "type": "Number", "number_type": "UInt", "number_size": 32, - "summary": " The block size parameter, which fine-tunes sequential memory read size and performance.", - "description": " The block size parameter, which fine-tunes sequential memory read size and performance." + "summary": "The block size parameter, which fine-tunes sequential memory read size and performance.", + "description": null }, { "name": "p", "type": "Number", "number_type": "UInt", "number_size": 32, - "summary": " Parallelization parameter.", - "description": " Parallelization parameter." + "summary": "Parallelization parameter.", + "description": null }, { "name": "dk_len", "type": "Number", "number_type": "UInt", "number_size": 32, - "summary": " Intended output length in octets of the derived key.", - "description": " Intended output length in octets of the derived key." + "summary": "Intended output length in octets of the derived key.", + "description": null } ], "summary": null, @@ -877,8 +877,8 @@ { "name": "key", "type": "String", - "summary": " Derived key. Encoded with `hex`.", - "description": " Derived key. Encoded with `hex`." + "summary": "Derived key.", + "description": "Encoded with `hex`." } ], "summary": null, @@ -891,8 +891,8 @@ { "name": "secret", "type": "String", - "summary": " Secret key - unprefixed 0-padded to 64 symbols hex string", - "description": " Secret key - unprefixed 0-padded to 64 symbols hex string" + "summary": "Secret key - unprefixed 0-padded to 64 symbols hex string", + "description": null } ], "summary": null, @@ -905,14 +905,14 @@ { "name": "unsigned", "type": "String", - "summary": " Data that must be signed encoded in `base64`.", - "description": " Data that must be signed encoded in `base64`." + "summary": "Data that must be signed encoded in `base64`.", + "description": null }, { "name": "secret", "type": "String", - "summary": " Signer's secret key - unprefixed 0-padded to 64 symbols hex string", - "description": " Signer's secret key - unprefixed 0-padded to 64 symbols hex string" + "summary": "Signer's secret key - unprefixed 0-padded to 64 symbols hex string", + "description": null } ], "summary": null, @@ -925,8 +925,8 @@ { "name": "signed", "type": "String", - "summary": " Signed data, encoded in `base64`.", - "description": " Signed data, encoded in `base64`." + "summary": "Signed data, encoded in `base64`.", + "description": null } ], "summary": null, @@ -939,14 +939,14 @@ { "name": "signed", "type": "String", - "summary": " Signed data that must be unsigned. Encoded with `base64`.", - "description": " Signed data that must be unsigned. Encoded with `base64`." + "summary": "Signed data that must be unsigned.", + "description": "Encoded with `base64`." }, { "name": "public", "type": "String", - "summary": " Signer's public key - unprefixed 0-padded to 64 symbols hex string", - "description": " Signer's public key - unprefixed 0-padded to 64 symbols hex string" + "summary": "Signer's public key - unprefixed 0-padded to 64 symbols hex string", + "description": null } ], "summary": null, @@ -959,8 +959,8 @@ { "name": "unsigned", "type": "String", - "summary": " Unsigned data, encoded in `base64`.", - "description": " Unsigned data, encoded in `base64`." + "summary": "Unsigned data, encoded in `base64`.", + "description": null } ], "summary": null, @@ -973,8 +973,8 @@ { "name": "signature", "type": "String", - "summary": " Signature encoded in `hex`.", - "description": " Signature encoded in `hex`." + "summary": "Signature encoded in `hex`.", + "description": null } ], "summary": null, @@ -987,8 +987,8 @@ { "name": "secret", "type": "String", - "summary": " Secret key - unprefixed 0-padded to 64 symbols hex string", - "description": " Secret key - unprefixed 0-padded to 64 symbols hex string" + "summary": "Secret key - unprefixed 0-padded to 64 symbols hex string", + "description": null } ], "summary": null, @@ -1001,26 +1001,26 @@ { "name": "decrypted", "type": "String", - "summary": " Data that must be encrypted encoded in `base64`.", - "description": " Data that must be encrypted encoded in `base64`." + "summary": "Data that must be encrypted encoded in `base64`.", + "description": null }, { "name": "nonce", "type": "String", - "summary": " Nonce, encoded in `hex`", - "description": " Nonce, encoded in `hex`" + "summary": "Nonce, encoded in `hex`", + "description": null }, { "name": "their_public", "type": "String", - "summary": " Receiver's public key - unprefixed 0-padded to 64 symbols hex string", - "description": " Receiver's public key - unprefixed 0-padded to 64 symbols hex string" + "summary": "Receiver's public key - unprefixed 0-padded to 64 symbols hex string", + "description": null }, { "name": "secret", "type": "String", - "summary": " Sender's private key - unprefixed 0-padded to 64 symbols hex string", - "description": " Sender's private key - unprefixed 0-padded to 64 symbols hex string" + "summary": "Sender's private key - unprefixed 0-padded to 64 symbols hex string", + "description": null } ], "summary": null, @@ -1033,8 +1033,8 @@ { "name": "encrypted", "type": "String", - "summary": " Encrypted data encoded in `base64`.", - "description": " Encrypted data encoded in `base64`." + "summary": "Encrypted data encoded in `base64`.", + "description": null } ], "summary": null, @@ -1047,8 +1047,8 @@ { "name": "encrypted", "type": "String", - "summary": " Data that must be decrypted. Encoded with `base64`.", - "description": " Data that must be decrypted. Encoded with `base64`." + "summary": "Data that must be decrypted.", + "description": "Encoded with `base64`." }, { "name": "nonce", @@ -1059,14 +1059,14 @@ { "name": "their_public", "type": "String", - "summary": " Sender's public key - unprefixed 0-padded to 64 symbols hex string", - "description": " Sender's public key - unprefixed 0-padded to 64 symbols hex string" + "summary": "Sender's public key - unprefixed 0-padded to 64 symbols hex string", + "description": null }, { "name": "secret", "type": "String", - "summary": " Receiver's private key - unprefixed 0-padded to 64 symbols hex string", - "description": " Receiver's private key - unprefixed 0-padded to 64 symbols hex string" + "summary": "Receiver's private key - unprefixed 0-padded to 64 symbols hex string", + "description": null } ], "summary": null, @@ -1079,8 +1079,8 @@ { "name": "decrypted", "type": "String", - "summary": " Decrypted data encoded in `base64`.", - "description": " Decrypted data encoded in `base64`." + "summary": "Decrypted data encoded in `base64`.", + "description": null } ], "summary": null, @@ -1093,20 +1093,20 @@ { "name": "decrypted", "type": "String", - "summary": " Data that must be encrypted. Encoded with `base64`.", - "description": " Data that must be encrypted. Encoded with `base64`." + "summary": "Data that must be encrypted.", + "description": "Encoded with `base64`." }, { "name": "nonce", "type": "String", - "summary": " Nonce in `hex`", - "description": " Nonce in `hex`" + "summary": "Nonce in `hex`", + "description": null }, { "name": "key", "type": "String", - "summary": " Secret key - unprefixed 0-padded to 64 symbols hex string", - "description": " Secret key - unprefixed 0-padded to 64 symbols hex string" + "summary": "Secret key - unprefixed 0-padded to 64 symbols hex string", + "description": null } ], "summary": null, @@ -1119,20 +1119,20 @@ { "name": "encrypted", "type": "String", - "summary": " Data that must be decrypted. Encoded with `base64`.", - "description": " Data that must be decrypted. Encoded with `base64`." + "summary": "Data that must be decrypted.", + "description": "Encoded with `base64`." }, { "name": "nonce", "type": "String", - "summary": " Nonce in `hex`", - "description": " Nonce in `hex`" + "summary": "Nonce in `hex`", + "description": null }, { "name": "key", "type": "String", - "summary": " Public key - unprefixed 0-padded to 64 symbols hex string", - "description": " Public key - unprefixed 0-padded to 64 symbols hex string" + "summary": "Public key - unprefixed 0-padded to 64 symbols hex string", + "description": null } ], "summary": null, @@ -1150,8 +1150,8 @@ "number_type": "UInt", "number_size": 8 }, - "summary": " Dictionary identifier", - "description": " Dictionary identifier" + "summary": "Dictionary identifier", + "description": null } ], "summary": null, @@ -1164,8 +1164,8 @@ { "name": "words", "type": "String", - "summary": " The list of mnemonic words", - "description": " The list of mnemonic words" + "summary": "The list of mnemonic words", + "description": null } ], "summary": null, @@ -1183,8 +1183,8 @@ "number_type": "UInt", "number_size": 8 }, - "summary": " Dictionary identifier", - "description": " Dictionary identifier" + "summary": "Dictionary identifier", + "description": null }, { "name": "word_count", @@ -1194,8 +1194,8 @@ "number_type": "UInt", "number_size": 8 }, - "summary": " Mnemonic word count", - "description": " Mnemonic word count" + "summary": "Mnemonic word count", + "description": null } ], "summary": null, @@ -1208,8 +1208,8 @@ { "name": "phrase", "type": "String", - "summary": " String of mnemonic words", - "description": " String of mnemonic words" + "summary": "String of mnemonic words", + "description": null } ], "summary": null, @@ -1222,8 +1222,8 @@ { "name": "entropy", "type": "String", - "summary": " Entropy bytes. Hex encoded.", - "description": " Entropy bytes. Hex encoded." + "summary": "Entropy bytes.", + "description": "Hex encoded." }, { "name": "dictionary", @@ -1233,8 +1233,8 @@ "number_type": "UInt", "number_size": 8 }, - "summary": " Dictionary identifier", - "description": " Dictionary identifier" + "summary": "Dictionary identifier", + "description": null }, { "name": "word_count", @@ -1244,8 +1244,8 @@ "number_type": "UInt", "number_size": 8 }, - "summary": " Mnemonic word count", - "description": " Mnemonic word count" + "summary": "Mnemonic word count", + "description": null } ], "summary": null, @@ -1258,8 +1258,8 @@ { "name": "phrase", "type": "String", - "summary": " Phrase", - "description": " Phrase" + "summary": "Phrase", + "description": null } ], "summary": null, @@ -1272,8 +1272,8 @@ { "name": "phrase", "type": "String", - "summary": " Phrase", - "description": " Phrase" + "summary": "Phrase", + "description": null }, { "name": "dictionary", @@ -1283,8 +1283,8 @@ "number_type": "UInt", "number_size": 8 }, - "summary": " Dictionary identifier", - "description": " Dictionary identifier" + "summary": "Dictionary identifier", + "description": null }, { "name": "word_count", @@ -1294,8 +1294,8 @@ "number_type": "UInt", "number_size": 8 }, - "summary": " Word count", - "description": " Word count" + "summary": "Word count", + "description": null } ], "summary": null, @@ -1308,8 +1308,8 @@ { "name": "valid", "type": "Boolean", - "summary": " Flag indicating if the mnemonic is valid or not", - "description": " Flag indicating if the mnemonic is valid or not" + "summary": "Flag indicating if the mnemonic is valid or not", + "description": null } ], "summary": null, @@ -1322,8 +1322,8 @@ { "name": "phrase", "type": "String", - "summary": " Phrase", - "description": " Phrase" + "summary": "Phrase", + "description": null }, { "name": "path", @@ -1331,8 +1331,8 @@ "optional_inner": { "type": "String" }, - "summary": " Derivation path, for instance \"m/44'/396'/0'/0/0\"", - "description": " Derivation path, for instance \"m/44'/396'/0'/0/0\"" + "summary": "Derivation path, for instance \"m/44'/396'/0'/0/0\"", + "description": null }, { "name": "dictionary", @@ -1342,8 +1342,8 @@ "number_type": "UInt", "number_size": 8 }, - "summary": " Dictionary identifier", - "description": " Dictionary identifier" + "summary": "Dictionary identifier", + "description": null }, { "name": "word_count", @@ -1353,8 +1353,8 @@ "number_type": "UInt", "number_size": 8 }, - "summary": " Word count", - "description": " Word count" + "summary": "Word count", + "description": null } ], "summary": null, @@ -1367,8 +1367,8 @@ { "name": "phrase", "type": "String", - "summary": " String with seed phrase", - "description": " String with seed phrase" + "summary": "String with seed phrase", + "description": null }, { "name": "dictionary", @@ -1378,8 +1378,8 @@ "number_type": "UInt", "number_size": 8 }, - "summary": " Dictionary identifier", - "description": " Dictionary identifier" + "summary": "Dictionary identifier", + "description": null }, { "name": "word_count", @@ -1389,8 +1389,8 @@ "number_type": "UInt", "number_size": 8 }, - "summary": " Mnemonic word count", - "description": " Mnemonic word count" + "summary": "Mnemonic word count", + "description": null } ], "summary": null, @@ -1403,8 +1403,8 @@ { "name": "xprv", "type": "String", - "summary": " Serialized extended master private key", - "description": " Serialized extended master private key" + "summary": "Serialized extended master private key", + "description": null } ], "summary": null, @@ -1417,22 +1417,22 @@ { "name": "xprv", "type": "String", - "summary": " Serialized extended private key", - "description": " Serialized extended private key" + "summary": "Serialized extended private key", + "description": null }, { "name": "child_index", "type": "Number", "number_type": "UInt", "number_size": 32, - "summary": " Child index (see BIP-0032)", - "description": " Child index (see BIP-0032)" + "summary": "Child index (see BIP-0032)", + "description": null }, { "name": "hardened", "type": "Boolean", - "summary": " Indicates the derivation of hardened/not-hardened key (see BIP-0032)", - "description": " Indicates the derivation of hardened/not-hardened key (see BIP-0032)" + "summary": "Indicates the derivation of hardened/not-hardened key (see BIP-0032)", + "description": null } ], "summary": null, @@ -1445,8 +1445,8 @@ { "name": "xprv", "type": "String", - "summary": " Serialized extended private key", - "description": " Serialized extended private key" + "summary": "Serialized extended private key", + "description": null } ], "summary": null, @@ -1459,14 +1459,14 @@ { "name": "xprv", "type": "String", - "summary": " Serialized extended private key", - "description": " Serialized extended private key" + "summary": "Serialized extended private key", + "description": null }, { "name": "path", "type": "String", - "summary": " Derivation path, for instance \"m/44'/396'/0'/0/0\"", - "description": " Derivation path, for instance \"m/44'/396'/0'/0/0\"" + "summary": "Derivation path, for instance \"m/44'/396'/0'/0/0\"", + "description": null } ], "summary": null, @@ -1479,8 +1479,8 @@ { "name": "xprv", "type": "String", - "summary": " Derived serialized extended private key", - "description": " Derived serialized extended private key" + "summary": "Derived serialized extended private key", + "description": null } ], "summary": null, @@ -1493,8 +1493,8 @@ { "name": "xprv", "type": "String", - "summary": " Serialized extended private key", - "description": " Serialized extended private key" + "summary": "Serialized extended private key", + "description": null } ], "summary": null, @@ -1507,8 +1507,8 @@ { "name": "secret", "type": "String", - "summary": " Private key - 64 symbols hex string", - "description": " Private key - 64 symbols hex string" + "summary": "Private key - 64 symbols hex string", + "description": null } ], "summary": null, @@ -1521,8 +1521,8 @@ { "name": "xprv", "type": "String", - "summary": " Serialized extended private key", - "description": " Serialized extended private key" + "summary": "Serialized extended private key", + "description": null } ], "summary": null, @@ -1535,8 +1535,8 @@ { "name": "public", "type": "String", - "summary": " Public key - 64 symbols hex string", - "description": " Public key - 64 symbols hex string" + "summary": "Public key - 64 symbols hex string", + "description": null } ], "summary": null, @@ -1549,20 +1549,20 @@ { "name": "data", "type": "String", - "summary": " Source data to be encrypted or decrypted. Must be encoded with `base64`.", - "description": " Source data to be encrypted or decrypted. Must be encoded with `base64`." + "summary": "Source data to be encrypted or decrypted.", + "description": "Must be encoded with `base64`." }, { "name": "key", "type": "String", - "summary": " 256-bit key. Must be encoded with `hex`.", - "description": " 256-bit key. Must be encoded with `hex`." + "summary": "256-bit key.", + "description": "Must be encoded with `hex`." }, { "name": "nonce", "type": "String", - "summary": " 96-bit nonce. Must be encoded with `hex`.", - "description": " 96-bit nonce. Must be encoded with `hex`." + "summary": "96-bit nonce.", + "description": "Must be encoded with `hex`." } ], "summary": null, @@ -1575,8 +1575,8 @@ { "name": "data", "type": "String", - "summary": " Encrypted/decrypted data. Encoded with `base64`.", - "description": " Encrypted/decrypted data. Encoded with `base64`." + "summary": "Encrypted/decrypted data.", + "description": "Encoded with `base64`." } ], "summary": null, @@ -1590,8 +1590,8 @@ "name": "handle", "type": "Ref", "ref_name": "crypto.SigningBoxHandle", - "summary": " Handle of the signing box.", - "description": " Handle of the signing box." + "summary": "Handle of the signing box.", + "description": null } ], "summary": null, @@ -1605,8 +1605,8 @@ "name": "GetPublicKey", "type": "Struct", "struct_fields": [], - "summary": " Get signing box public key", - "description": " Get signing box public key" + "summary": "Get signing box public key", + "description": null }, { "name": "Sign", @@ -1615,16 +1615,16 @@ { "name": "unsigned", "type": "String", - "summary": " Data to sign encoded as base64", - "description": " Data to sign encoded as base64" + "summary": "Data to sign encoded as base64", + "description": null } ], - "summary": " Sign data", - "description": " Sign data" + "summary": "Sign data", + "description": null } ], - "summary": " Signing box callbacks.", - "description": " Signing box callbacks." + "summary": "Signing box callbacks.", + "description": null }, { "name": "ResultOfAppSigningBox", @@ -1637,12 +1637,12 @@ { "name": "public_key", "type": "String", - "summary": " Signing box public key", - "description": " Signing box public key" + "summary": "Signing box public key", + "description": null } ], - "summary": " Result of getting public key", - "description": " Result of getting public key" + "summary": "Result of getting public key", + "description": null }, { "name": "Sign", @@ -1651,16 +1651,16 @@ { "name": "signature", "type": "String", - "summary": " Data signature encoded as hex", - "description": " Data signature encoded as hex" + "summary": "Data signature encoded as hex", + "description": null } ], - "summary": " Result of signing data", - "description": " Result of signing data" + "summary": "Result of signing data", + "description": null } ], - "summary": " Returning values from signing box callbacks.", - "description": " Returning values from signing box callbacks." + "summary": "Returning values from signing box callbacks.", + "description": null }, { "name": "ResultOfSigningBoxGetPublicKey", @@ -1669,8 +1669,8 @@ { "name": "pubkey", "type": "String", - "summary": " Public key of signing box. Encoded with hex", - "description": " Public key of signing box. Encoded with hex" + "summary": "Public key of signing box.", + "description": "Encoded with hex" } ], "summary": null, @@ -1684,14 +1684,14 @@ "name": "signing_box", "type": "Ref", "ref_name": "crypto.SigningBoxHandle", - "summary": " Signing Box handle.", - "description": " Signing Box handle." + "summary": "Signing Box handle.", + "description": null }, { "name": "unsigned", "type": "String", - "summary": " Unsigned user data. Must be encoded with `base64`.", - "description": " Unsigned user data. Must be encoded with `base64`." + "summary": "Unsigned user data.", + "description": "Must be encoded with `base64`." } ], "summary": null, @@ -1704,8 +1704,8 @@ { "name": "signature", "type": "String", - "summary": " Data signature. Encoded with `base64`.", - "description": " Data signature. Encoded with `base64`." + "summary": "Data signature.", + "description": "Encoded with `base64`." } ], "summary": null, @@ -1715,8 +1715,8 @@ "functions": [ { "name": "factorize", - "summary": "Integer factorization", - "description": " Performs prime factorization – decomposition of a composite number\n into a product of smaller prime integers (factors).\n See [https://en.wikipedia.org/wiki/Integer_factorization]", + "summary": "Performs prime factorization – decomposition of a composite number into a product of smaller prime integers (factors). See [https://en.wikipedia.org/wiki/Integer_factorization]", + "description": null, "params": [ { "name": "_context", @@ -1753,8 +1753,8 @@ }, { "name": "modular_power", - "summary": "Modular exponentiation", - "description": " Performs modular exponentiation for big integers (`base`^`exponent` mod `modulus`).\n See [https://en.wikipedia.org/wiki/Modular_exponentiation]", + "summary": "Performs modular exponentiation for big integers (`base`^`exponent` mod `modulus`). See [https://en.wikipedia.org/wiki/Modular_exponentiation]", + "description": null, "params": [ { "name": "_context", @@ -1791,8 +1791,8 @@ }, { "name": "ton_crc16", - "summary": " Calculates CRC16 using TON algorithm.", - "description": " Calculates CRC16 using TON algorithm.", + "summary": "Calculates CRC16 using TON algorithm.", + "description": null, "params": [ { "name": "_context", @@ -1829,8 +1829,8 @@ }, { "name": "generate_random_bytes", - "summary": " Generates random byte array of the specified length and returns it in `base64` format", - "description": " Generates random byte array of the specified length and returns it in `base64` format", + "summary": "Generates random byte array of the specified length and returns it in `base64` format", + "description": null, "params": [ { "name": "_context", @@ -1867,8 +1867,8 @@ }, { "name": "convert_public_key_to_ton_safe_format", - "summary": " Converts public key to ton safe_format", - "description": " Converts public key to ton safe_format", + "summary": "Converts public key to ton safe_format", + "description": null, "params": [ { "name": "_context", @@ -1905,8 +1905,8 @@ }, { "name": "generate_random_sign_keys", - "summary": " Generates random ed25519 key pair.", - "description": " Generates random ed25519 key pair.", + "summary": "Generates random ed25519 key pair.", + "description": null, "params": [ { "name": "_context", @@ -1936,8 +1936,8 @@ }, { "name": "sign", - "summary": " Signs a data using the provided keys.", - "description": " Signs a data using the provided keys.", + "summary": "Signs a data using the provided keys.", + "description": null, "params": [ { "name": "_context", @@ -1974,8 +1974,8 @@ }, { "name": "verify_signature", - "summary": " Verifies signed data using the provided public key.", - "description": " Verifies signed data using the provided public key.\n Raises error if verification is failed.", + "summary": "Verifies signed data using the provided public key. Raises error if verification is failed.", + "description": null, "params": [ { "name": "_context", @@ -2012,8 +2012,8 @@ }, { "name": "sha256", - "summary": " Calculates SHA256 hash of the specified data.", - "description": " Calculates SHA256 hash of the specified data.", + "summary": "Calculates SHA256 hash of the specified data.", + "description": null, "params": [ { "name": "_context", @@ -2050,8 +2050,8 @@ }, { "name": "sha512", - "summary": " Calculates SHA512 hash of the specified data.", - "description": " Calculates SHA512 hash of the specified data.", + "summary": "Calculates SHA512 hash of the specified data.", + "description": null, "params": [ { "name": "_context", @@ -2088,8 +2088,8 @@ }, { "name": "scrypt", - "summary": "Perform `scrypt` encryption", - "description": " Derives key from `password` and `key` using `scrypt` algorithm.\n See [https://en.wikipedia.org/wiki/Scrypt].\n\n # Arguments\n - `log_n` - The log2 of the Scrypt parameter `N`\n - `r` - The Scrypt parameter `r`\n - `p` - The Scrypt parameter `p`\n # Conditions\n - `log_n` must be less than `64`\n - `r` must be greater than `0` and less than or equal to `4294967295`\n - `p` must be greater than `0` and less than `4294967295`\n # Recommended values sufficient for most use-cases\n - `log_n = 15` (`n = 32768`)\n - `r = 8`\n - `p = 1`", + "summary": "Derives key from `password` and `key` using `scrypt` algorithm. See [https://en.wikipedia.org/wiki/Scrypt].", + "description": "# Arguments\n- `log_n` - The log2 of the Scrypt parameter `N`\n- `r` - The Scrypt parameter `r`\n- `p` - The Scrypt parameter `p`\n# Conditions\n- `log_n` must be less than `64`\n- `r` must be greater than `0` and less than or equal to `4294967295`\n- `p` must be greater than `0` and less than `4294967295`\n# Recommended values sufficient for most use-cases\n- `log_n = 15` (`n = 32768`)\n- `r = 8`\n- `p = 1`", "params": [ { "name": "_context", @@ -2126,8 +2126,8 @@ }, { "name": "nacl_sign_keypair_from_secret_key", - "summary": " Generates a key pair for signing from the secret key", - "description": " Generates a key pair for signing from the secret key", + "summary": "Generates a key pair for signing from the secret key", + "description": null, "params": [ { "name": "_context", @@ -2164,8 +2164,8 @@ }, { "name": "nacl_sign", - "summary": " Signs data using the signer's secret key.", - "description": " Signs data using the signer's secret key.", + "summary": "Signs data using the signer's secret key.", + "description": null, "params": [ { "name": "_context", @@ -2309,8 +2309,8 @@ }, { "name": "nacl_box_keypair_from_secret_key", - "summary": " Generates key pair from a secret key", - "description": " Generates key pair from a secret key", + "summary": "Generates key pair from a secret key", + "description": null, "params": [ { "name": "_context", @@ -2347,8 +2347,8 @@ }, { "name": "nacl_box", - "summary": " Public key authenticated encryption", - "description": " Public key authenticated encryption\n\n Encrypt and authenticate a message using the senders secret key, the recievers public\n key, and a nonce.", + "summary": "Public key authenticated encryption", + "description": "Encrypt and authenticate a message using the senders secret key, the recievers public\nkey, and a nonce.", "params": [ { "name": "_context", @@ -2385,8 +2385,8 @@ }, { "name": "nacl_box_open", - "summary": " Decrypt and verify the cipher text using the recievers secret key, the senders public", - "description": " Decrypt and verify the cipher text using the recievers secret key, the senders public\n key, and the nonce.", + "summary": "Decrypt and verify the cipher text using the recievers secret key, the senders public key, and the nonce.", + "description": null, "params": [ { "name": "_context", @@ -2423,8 +2423,8 @@ }, { "name": "nacl_secret_box", - "summary": " Encrypt and authenticate message using nonce and secret key.", - "description": " Encrypt and authenticate message using nonce and secret key.", + "summary": "Encrypt and authenticate message using nonce and secret key.", + "description": null, "params": [ { "name": "_context", @@ -2461,8 +2461,8 @@ }, { "name": "nacl_secret_box_open", - "summary": " Decrypts and verifies cipher text using `nonce` and secret `key`.", - "description": " Decrypts and verifies cipher text using `nonce` and secret `key`.", + "summary": "Decrypts and verifies cipher text using `nonce` and secret `key`.", + "description": null, "params": [ { "name": "_context", @@ -2499,8 +2499,8 @@ }, { "name": "mnemonic_words", - "summary": " Prints the list of words from the specified dictionary", - "description": " Prints the list of words from the specified dictionary", + "summary": "Prints the list of words from the specified dictionary", + "description": null, "params": [ { "name": "context", @@ -2537,8 +2537,8 @@ }, { "name": "mnemonic_from_random", - "summary": "Generates a random mnemonic", - "description": " Generates a random mnemonic from the specified dictionary and word count", + "summary": "Generates a random mnemonic from the specified dictionary and word count", + "description": null, "params": [ { "name": "context", @@ -2575,8 +2575,8 @@ }, { "name": "mnemonic_from_entropy", - "summary": "Generates mnemonic from the specified entropy", - "description": " Generates mnemonic from pre-generated entropy", + "summary": "Generates mnemonic from pre-generated entropy", + "description": null, "params": [ { "name": "context", @@ -2613,8 +2613,8 @@ }, { "name": "mnemonic_verify", - "summary": "Validates a mnemonic phrase", - "description": " The phrase supplied will be checked for word length and validated according to the checksum\n specified in BIP0039.", + "summary": "The phrase supplied will be checked for word length and validated according to the checksum specified in BIP0039.", + "description": null, "params": [ { "name": "context", @@ -2651,8 +2651,8 @@ }, { "name": "mnemonic_derive_sign_keys", - "summary": "Derives a key pair for signing from the seed phrase", - "description": " Validates the seed phrase, generates master key and then derives\n the key pair from the master key and the specified path", + "summary": "Validates the seed phrase, generates master key and then derives the key pair from the master key and the specified path", + "description": null, "params": [ { "name": "context", @@ -2689,8 +2689,8 @@ }, { "name": "hdkey_xprv_from_mnemonic", - "summary": " Generates an extended master private key that will be the root for all the derived keys", - "description": " Generates an extended master private key that will be the root for all the derived keys", + "summary": "Generates an extended master private key that will be the root for all the derived keys", + "description": null, "params": [ { "name": "context", @@ -2727,8 +2727,8 @@ }, { "name": "hdkey_derive_from_xprv", - "summary": " Returns extended private key derived from the specified extended private key and child index", - "description": " Returns extended private key derived from the specified extended private key and child index", + "summary": "Returns extended private key derived from the specified extended private key and child index", + "description": null, "params": [ { "name": "_context", @@ -2765,8 +2765,8 @@ }, { "name": "hdkey_derive_from_xprv_path", - "summary": " Derives the extended private key from the specified key and path", - "description": " Derives the extended private key from the specified key and path", + "summary": "Derives the extended private key from the specified key and path", + "description": null, "params": [ { "name": "_context", @@ -2803,8 +2803,8 @@ }, { "name": "hdkey_secret_from_xprv", - "summary": " Extracts the private key from the serialized extended private key", - "description": " Extracts the private key from the serialized extended private key", + "summary": "Extracts the private key from the serialized extended private key", + "description": null, "params": [ { "name": "_context", @@ -2841,8 +2841,8 @@ }, { "name": "hdkey_public_from_xprv", - "summary": " Extracts the public key from the serialized extended private key", - "description": " Extracts the public key from the serialized extended private key", + "summary": "Extracts the public key from the serialized extended private key", + "description": null, "params": [ { "name": "_context", @@ -2879,8 +2879,8 @@ }, { "name": "chacha20", - "summary": " Performs symmetric `chacha20` encryption.", - "description": " Performs symmetric `chacha20` encryption.", + "summary": "Performs symmetric `chacha20` encryption.", + "description": null, "params": [ { "name": "_context", @@ -2917,8 +2917,8 @@ }, { "name": "register_signing_box", - "summary": " Register an application implemented signing box.", - "description": " Register an application implemented signing box.", + "summary": "Register an application implemented signing box.", + "description": null, "params": [ { "name": "context", @@ -2965,8 +2965,8 @@ }, { "name": "get_signing_box", - "summary": " Creates a default signing box implementation.", - "description": " Creates a default signing box implementation.", + "summary": "Creates a default signing box implementation.", + "description": null, "params": [ { "name": "context", @@ -3003,8 +3003,8 @@ }, { "name": "signing_box_get_public_key", - "summary": " Returns public key of signing key pair.", - "description": " Returns public key of signing key pair.", + "summary": "Returns public key of signing key pair.", + "description": null, "params": [ { "name": "context", @@ -3041,8 +3041,8 @@ }, { "name": "signing_box_sign", - "summary": " Returns signed user data.", - "description": " Returns signed user data.", + "summary": "Returns signed user data.", + "description": null, "params": [ { "name": "context", @@ -3079,8 +3079,8 @@ }, { "name": "remove_signing_box", - "summary": " Removes signing box from SDK.", - "description": " Removes signing box from SDK.", + "summary": "Removes signing box from SDK.", + "description": null, "params": [ { "name": "context", @@ -3118,8 +3118,8 @@ }, { "name": "abi", - "summary": " Provides message encoding and decoding according to the ABI", - "description": " Provides message encoding and decoding according to the ABI\n specification.", + "summary": "Provides message encoding and decoding according to the ABI specification.", + "description": null, "types": [ { "name": "Abi", @@ -3208,8 +3208,8 @@ "number_type": "UInt", "number_size": 32 }, - "summary": " Message expiration time in seconds.", - "description": " Message expiration time in seconds.\n If not specified - calculated automatically from message_expiration_timeout(),\n try_index and message_expiration_timeout_grow_factor() (if ABI includes `expire` header)." + "summary": "Message expiration time in seconds. If not specified - calculated automatically from message_expiration_timeout(), try_index and message_expiration_timeout_grow_factor() (if ABI includes `expire` header).", + "description": null }, { "name": "time", @@ -3219,8 +3219,8 @@ "number_type": "UInt", "number_size": 64 }, - "summary": " Message creation time in milliseconds. If not specified, `now` is used", - "description": " Message creation time in milliseconds. If not specified, `now` is used\n (if ABI includes `time` header)." + "summary": "Message creation time in milliseconds.", + "description": "If not specified, `now` is used(if ABI includes `time` header)." }, { "name": "pubkey", @@ -3228,12 +3228,12 @@ "optional_inner": { "type": "String" }, - "summary": " Public key is used by the contract to check the signature. Encoded in `hex`.", - "description": " Public key is used by the contract to check the signature. Encoded in `hex`.\n If not specified, method fails with exception (if ABI includes `pubkey` header).." + "summary": "Public key is used by the contract to check the signature.", + "description": "Encoded in `hex`.If not specified, method fails with exception (if ABI includes `pubkey` header).." } ], - "summary": " The ABI function header.", - "description": " The ABI function header.\n\n Includes several hidden function parameters that contract\n uses for security, message delivery monitoring and replay protection reasons.\n\n The actual set of header fields depends on the contract's ABI.\n If a contract's ABI does not include some headers, then they are not filled." + "summary": "The ABI function header.", + "description": "Includes several hidden function parameters that contract\nuses for security, message delivery monitoring and replay protection reasons.\n\nThe actual set of header fields depends on the contract's ABI.\nIf a contract's ABI does not include some headers, then they are not filled." }, { "name": "CallSet", @@ -3242,8 +3242,8 @@ { "name": "function_name", "type": "String", - "summary": " Function name that is being called.", - "description": " Function name that is being called." + "summary": "Function name that is being called.", + "description": null }, { "name": "header", @@ -3252,8 +3252,8 @@ "type": "Ref", "ref_name": "abi.FunctionHeader" }, - "summary": " Function header.", - "description": " Function header.\n\n If an application omits some header parameters required by the\n contract's ABI, the library will set the default values for\n them." + "summary": "Function header.", + "description": "If an application omits some header parameters required by the\ncontract's ABI, the library will set the default values for\nthem." }, { "name": "input", @@ -3262,8 +3262,8 @@ "type": "Ref", "ref_name": "Value" }, - "summary": " Function input parameters according to ABI.", - "description": " Function input parameters according to ABI." + "summary": "Function input parameters according to ABI.", + "description": null } ], "summary": null, @@ -3276,8 +3276,8 @@ { "name": "tvc", "type": "String", - "summary": " Content of TVC file encoded in `base64`.", - "description": " Content of TVC file encoded in `base64`." + "summary": "Content of TVC file encoded in `base64`.", + "description": null }, { "name": "workchain_id", @@ -3287,8 +3287,8 @@ "number_type": "Int", "number_size": 32 }, - "summary": " Target workchain for destination address. Default is `0`.", - "description": " Target workchain for destination address. Default is `0`." + "summary": "Target workchain for destination address.", + "description": "Default is `0`." }, { "name": "initial_data", @@ -3297,8 +3297,8 @@ "type": "Ref", "ref_name": "Value" }, - "summary": " List of initial values for contract's public variables.", - "description": " List of initial values for contract's public variables." + "summary": "List of initial values for contract's public variables.", + "description": null } ], "summary": null, @@ -3312,8 +3312,8 @@ "name": "None", "type": "Struct", "struct_fields": [], - "summary": " No keys are provided. Creates an unsigned message.", - "description": " No keys are provided. Creates an unsigned message." + "summary": "No keys are provided.", + "description": "Creates an unsigned message." }, { "name": "External", @@ -3326,8 +3326,8 @@ "description": null } ], - "summary": " Only public key is provided in unprefixed hex string format to generate unsigned message", - "description": " Only public key is provided in unprefixed hex string format to generate unsigned message\n and `data_to_sign` which can be signed later. " + "summary": "Only public key is provided in unprefixed hex string format to generate unsigned message and `data_to_sign` which can be signed later.", + "description": null }, { "name": "Keys", @@ -3341,8 +3341,8 @@ "description": null } ], - "summary": " Key pair is provided for signing", - "description": " Key pair is provided for signing" + "summary": "Key pair is provided for signing", + "description": null }, { "name": "SigningBox", @@ -3356,8 +3356,8 @@ "description": null } ], - "summary": " Signing Box interface is provided for signing, allows Dapps to sign messages using external APIs,", - "description": " Signing Box interface is provided for signing, allows Dapps to sign messages using external APIs,\n such as HSM, cold wallet, etc." + "summary": "Signing Box interface is provided for signing, allows Dapps to sign messages using external APIs, such as HSM, cold wallet, etc.", + "description": null } ], "summary": null, @@ -3370,26 +3370,26 @@ { "name": "Input", "type": "None", - "summary": " Message contains the input of the ABI function.", - "description": " Message contains the input of the ABI function." + "summary": "Message contains the input of the ABI function.", + "description": null }, { "name": "Output", "type": "None", - "summary": " Message contains the output of the ABI function.", - "description": " Message contains the output of the ABI function." + "summary": "Message contains the output of the ABI function.", + "description": null }, { "name": "InternalOutput", "type": "None", - "summary": " Message contains the input of the imported ABI function.", - "description": " Message contains the input of the imported ABI function.\n\n Occurs when contract sends an internal message to other\n contract." + "summary": "Message contains the input of the imported ABI function.", + "description": "Occurs when contract sends an internal message to other\ncontract." }, { "name": "Event", "type": "None", - "summary": " Message contains the input of the ABI event.", - "description": " Message contains the input of the ABI event." + "summary": "Message contains the input of the ABI event.", + "description": null } ], "summary": null, @@ -3411,8 +3411,8 @@ "description": null } ], - "summary": " Deploy message.", - "description": " Deploy message." + "summary": "Deploy message.", + "description": null }, { "name": "StateInit", @@ -3421,14 +3421,14 @@ { "name": "code", "type": "String", - "summary": " Code BOC. Encoded in `base64`.", - "description": " Code BOC. Encoded in `base64`." + "summary": "Code BOC.", + "description": "Encoded in `base64`." }, { "name": "data", "type": "String", - "summary": " Data BOC. Encoded in `base64`.", - "description": " Data BOC. Encoded in `base64`." + "summary": "Data BOC.", + "description": "Encoded in `base64`." }, { "name": "library", @@ -3436,12 +3436,12 @@ "optional_inner": { "type": "String" }, - "summary": " Library BOC. Encoded in `base64`.", - "description": " Library BOC. Encoded in `base64`." + "summary": "Library BOC.", + "description": "Encoded in `base64`." } ], - "summary": " State init data.", - "description": " State init data." + "summary": "State init data.", + "description": null }, { "name": "Tvc", @@ -3473,8 +3473,8 @@ "description": null } ], - "summary": " Content of the TVC file. Encoded in `base64`.", - "description": " Content of the TVC file. Encoded in `base64`." + "summary": "Content of the TVC file.", + "description": "Encoded in `base64`." } ], "summary": null, @@ -3786,28 +3786,28 @@ "name": "abi", "type": "Ref", "ref_name": "abi.Abi", - "summary": " Contract ABI.", - "description": " Contract ABI." + "summary": "Contract ABI.", + "description": null }, { "name": "call_set", "type": "Ref", "ref_name": "abi.CallSet", - "summary": " Function call parameters.", - "description": " Function call parameters.\n\n Must be specified in non deploy message.\n\n In case of deploy message contains parameters of constructor." + "summary": "Function call parameters.", + "description": "Must be specified in non deploy message.\n\nIn case of deploy message contains parameters of constructor." }, { "name": "is_internal", "type": "Boolean", - "summary": " True if internal message body must be encoded.", - "description": " True if internal message body must be encoded." + "summary": "True if internal message body must be encoded.", + "description": null }, { "name": "signer", "type": "Ref", "ref_name": "abi.Signer", - "summary": " Signing parameters.", - "description": " Signing parameters." + "summary": "Signing parameters.", + "description": null }, { "name": "processing_try_index", @@ -3817,8 +3817,8 @@ "number_type": "UInt", "number_size": 8 }, - "summary": " Processing try index.", - "description": " Processing try index.\n\n Used in message processing with retries.\n\n Encoder uses the provided try index to calculate message\n expiration time.\n\n Expiration timeouts will grow with every retry.\n\n Default value is 0." + "summary": "Processing try index.", + "description": "Used in message processing with retries.\n\nEncoder uses the provided try index to calculate message\nexpiration time.\n\nExpiration timeouts will grow with every retry.\n\nDefault value is 0." } ], "summary": null, @@ -3831,8 +3831,8 @@ { "name": "body", "type": "String", - "summary": " Message body BOC encoded with `base64`.", - "description": " Message body BOC encoded with `base64`." + "summary": "Message body BOC encoded with `base64`.", + "description": null }, { "name": "data_to_sign", @@ -3840,8 +3840,8 @@ "optional_inner": { "type": "String" }, - "summary": " Optional data to sign. Encoded with `base64`.", - "description": " Optional data to sign. Encoded with `base64`.\n\n Presents when `message` is unsigned. Can be used for external\n message signing. Is this case you need to sing this data and\n produce signed message using `abi.attach_signature`." + "summary": "Optional data to sign.", + "description": "Encoded with `base64`.\nPresents when `message` is unsigned. Can be used for external\nmessage signing. Is this case you need to sing this data and\nproduce signed message using `abi.attach_signature`." } ], "summary": null, @@ -3855,26 +3855,26 @@ "name": "abi", "type": "Ref", "ref_name": "abi.Abi", - "summary": " Contract ABI", - "description": " Contract ABI" + "summary": "Contract ABI", + "description": null }, { "name": "public_key", "type": "String", - "summary": " Public key. Must be encoded with `hex`.", - "description": " Public key. Must be encoded with `hex`." + "summary": "Public key.", + "description": "Must be encoded with `hex`." }, { "name": "message", "type": "String", - "summary": " Unsigned message body BOC. Must be encoded with `base64`.", - "description": " Unsigned message body BOC. Must be encoded with `base64`." + "summary": "Unsigned message body BOC.", + "description": "Must be encoded with `base64`." }, { "name": "signature", "type": "String", - "summary": " Signature. Must be encoded with `hex`.", - "description": " Signature. Must be encoded with `hex`." + "summary": "Signature.", + "description": "Must be encoded with `hex`." } ], "summary": null, @@ -3902,8 +3902,8 @@ "name": "abi", "type": "Ref", "ref_name": "abi.Abi", - "summary": " Contract ABI.", - "description": " Contract ABI." + "summary": "Contract ABI.", + "description": null }, { "name": "address", @@ -3911,8 +3911,8 @@ "optional_inner": { "type": "String" }, - "summary": " Target address the message will be sent to.", - "description": " Target address the message will be sent to.\n\n Must be specified in case of non-deploy message." + "summary": "Target address the message will be sent to.", + "description": "Must be specified in case of non-deploy message." }, { "name": "deploy_set", @@ -3921,8 +3921,8 @@ "type": "Ref", "ref_name": "abi.DeploySet" }, - "summary": " Deploy parameters.", - "description": " Deploy parameters.\n\n Must be specified in case of deploy message." + "summary": "Deploy parameters.", + "description": "Must be specified in case of deploy message." }, { "name": "call_set", @@ -3931,15 +3931,15 @@ "type": "Ref", "ref_name": "abi.CallSet" }, - "summary": " Function call parameters.", - "description": " Function call parameters.\n\n Must be specified in case of non-deploy message.\n\n In case of deploy message it is optional and contains parameters\n of the functions that will to be called upon deploy transaction." + "summary": "Function call parameters.", + "description": "Must be specified in case of non-deploy message.\n\nIn case of deploy message it is optional and contains parameters\nof the functions that will to be called upon deploy transaction." }, { "name": "signer", "type": "Ref", "ref_name": "abi.Signer", - "summary": " Signing parameters.", - "description": " Signing parameters." + "summary": "Signing parameters.", + "description": null }, { "name": "processing_try_index", @@ -3949,8 +3949,8 @@ "number_type": "UInt", "number_size": 8 }, - "summary": " Processing try index.", - "description": " Processing try index.\n\n Used in message processing with retries (if contract's ABI includes \"expire\" header).\n\n Encoder uses the provided try index to calculate message\n expiration time. The 1st message expiration time is specified in\n Client config.\n\n Expiration timeouts will grow with every retry.\n Retry grow factor is set in Client config:\n <.....add config parameter with default value here>\n\n Default value is 0." + "summary": "Processing try index.", + "description": "Used in message processing with retries (if contract's ABI includes \"expire\" header).\n\nEncoder uses the provided try index to calculate message\nexpiration time. The 1st message expiration time is specified in\nClient config.\n\nExpiration timeouts will grow with every retry.\nRetry grow factor is set in Client config:\n<.....add config parameter with default value here>\n\nDefault value is 0." } ], "summary": null, @@ -3963,8 +3963,8 @@ { "name": "message", "type": "String", - "summary": " Message BOC encoded with `base64`.", - "description": " Message BOC encoded with `base64`." + "summary": "Message BOC encoded with `base64`.", + "description": null }, { "name": "data_to_sign", @@ -3972,20 +3972,20 @@ "optional_inner": { "type": "String" }, - "summary": " Optional data to be signed encoded in `base64`.", - "description": " Optional data to be signed encoded in `base64`.\n\n Returned in case of `Signer::External`. Can be used for external\n message signing. Is this case you need to use this data to create signature and\n then produce signed message using `abi.attach_signature`." + "summary": "Optional data to be signed encoded in `base64`.", + "description": "Returned in case of `Signer::External`. Can be used for external\nmessage signing. Is this case you need to use this data to create signature and\nthen produce signed message using `abi.attach_signature`." }, { "name": "address", "type": "String", - "summary": " Destination address.", - "description": " Destination address." + "summary": "Destination address.", + "description": null }, { "name": "message_id", "type": "String", - "summary": " Message id.", - "description": " Message id." + "summary": "Message id.", + "description": null } ], "summary": null, @@ -3999,26 +3999,26 @@ "name": "abi", "type": "Ref", "ref_name": "abi.Abi", - "summary": " Contract ABI", - "description": " Contract ABI" + "summary": "Contract ABI", + "description": null }, { "name": "public_key", "type": "String", - "summary": " Public key encoded in `hex`.", - "description": " Public key encoded in `hex`." + "summary": "Public key encoded in `hex`.", + "description": null }, { "name": "message", "type": "String", - "summary": " Unsigned message BOC encoded in `base64`.", - "description": " Unsigned message BOC encoded in `base64`." + "summary": "Unsigned message BOC encoded in `base64`.", + "description": null }, { "name": "signature", "type": "String", - "summary": " Signature encoded in `hex`.", - "description": " Signature encoded in `hex`." + "summary": "Signature encoded in `hex`.", + "description": null } ], "summary": null, @@ -4031,14 +4031,14 @@ { "name": "message", "type": "String", - "summary": " Signed message BOC", - "description": " Signed message BOC" + "summary": "Signed message BOC", + "description": null }, { "name": "message_id", "type": "String", - "summary": " Message ID", - "description": " Message ID" + "summary": "Message ID", + "description": null } ], "summary": null, @@ -4052,14 +4052,14 @@ "name": "abi", "type": "Ref", "ref_name": "abi.Abi", - "summary": " contract ABI", - "description": " contract ABI" + "summary": "contract ABI", + "description": null }, { "name": "message", "type": "String", - "summary": " Message BOC", - "description": " Message BOC" + "summary": "Message BOC", + "description": null } ], "summary": null, @@ -4073,14 +4073,14 @@ "name": "body_type", "type": "Ref", "ref_name": "abi.MessageBodyType", - "summary": " Type of the message body content.", - "description": " Type of the message body content." + "summary": "Type of the message body content.", + "description": null }, { "name": "name", "type": "String", - "summary": " Function or event name.", - "description": " Function or event name." + "summary": "Function or event name.", + "description": null }, { "name": "value", @@ -4089,8 +4089,8 @@ "type": "Ref", "ref_name": "Value" }, - "summary": " Parameters or result value.", - "description": " Parameters or result value." + "summary": "Parameters or result value.", + "description": null }, { "name": "header", @@ -4099,8 +4099,8 @@ "type": "Ref", "ref_name": "abi.FunctionHeader" }, - "summary": " Function header.", - "description": " Function header." + "summary": "Function header.", + "description": null } ], "summary": null, @@ -4114,20 +4114,20 @@ "name": "abi", "type": "Ref", "ref_name": "abi.Abi", - "summary": " Contract ABI used to decode.", - "description": " Contract ABI used to decode." + "summary": "Contract ABI used to decode.", + "description": null }, { "name": "body", "type": "String", - "summary": " Message body BOC encoded in `base64`.", - "description": " Message body BOC encoded in `base64`." + "summary": "Message body BOC encoded in `base64`.", + "description": null }, { "name": "is_internal", "type": "Boolean", - "summary": " True if the body belongs to the internal message.", - "description": " True if the body belongs to the internal message." + "summary": "True if the body belongs to the internal message.", + "description": null } ], "summary": null, @@ -4141,8 +4141,8 @@ "name": "state_init", "type": "Ref", "ref_name": "abi.StateInitSource", - "summary": " Source of the account state init.", - "description": " Source of the account state init." + "summary": "Source of the account state init.", + "description": null }, { "name": "balance", @@ -4152,8 +4152,8 @@ "number_type": "UInt", "number_size": 64 }, - "summary": " Initial balance.", - "description": " Initial balance." + "summary": "Initial balance.", + "description": null }, { "name": "last_trans_lt", @@ -4163,8 +4163,8 @@ "number_type": "UInt", "number_size": 64 }, - "summary": " Initial value for the `last_trans_lt`.", - "description": " Initial value for the `last_trans_lt`." + "summary": "Initial value for the `last_trans_lt`.", + "description": null }, { "name": "last_paid", @@ -4174,8 +4174,8 @@ "number_type": "UInt", "number_size": 32 }, - "summary": " Initial value for the `last_paid`.", - "description": " Initial value for the `last_paid`." + "summary": "Initial value for the `last_paid`.", + "description": null } ], "summary": null, @@ -4188,14 +4188,14 @@ { "name": "account", "type": "String", - "summary": " Account BOC encoded in `base64`.", - "description": " Account BOC encoded in `base64`." + "summary": "Account BOC encoded in `base64`.", + "description": null }, { "name": "id", "type": "String", - "summary": " Account ID encoded in `hex`.", - "description": " Account ID encoded in `hex`." + "summary": "Account ID encoded in `hex`.", + "description": null } ], "summary": null, @@ -4205,8 +4205,8 @@ "functions": [ { "name": "encode_message_body", - "summary": " Encodes message body according to ABI function call.", - "description": " Encodes message body according to ABI function call.", + "summary": "Encodes message body according to ABI function call.", + "description": null, "params": [ { "name": "context", @@ -4281,8 +4281,8 @@ }, { "name": "encode_message", - "summary": " Encodes an ABI-compatible message", - "description": " Encodes an ABI-compatible message\n\n Allows to encode deploy and function call messages,\n both signed and unsigned.\n\n Use cases include messages of any possible type:\n - deploy with initial function call (i.e. `constructor` or any other function that is used for some kind\n of initialization);\n - deploy without initial function call;\n - signed/unsigned + data for signing.\n\n `Signer` defines how the message should or shouldn't be signed:\n\n `Signer::None` creates an unsigned message. This may be needed in case of some public methods,\n that do not require authorization by pubkey.\n\n `Signer::External` takes public key and returns `data_to_sign` for later signing.\n Use `attach_signature` method with the result signature to get the signed message.\n\n `Signer::Keys` creates a signed message with provided key pair.\n\n [SOON] `Signer::SigningBox` Allows using a special interface to imlepement signing\n without private key disclosure to SDK. For instance, in case of using a cold wallet or HSM,\n when application calls some API to sign data.", + "summary": "Encodes an ABI-compatible message", + "description": "Allows to encode deploy and function call messages,\nboth signed and unsigned.\n\nUse cases include messages of any possible type:\n- deploy with initial function call (i.e. `constructor` or any other function that is used for some kind\nof initialization);\n- deploy without initial function call;\n- signed/unsigned + data for signing.\n\n`Signer` defines how the message should or shouldn't be signed:\n\n`Signer::None` creates an unsigned message. This may be needed in case of some public methods,\nthat do not require authorization by pubkey.\n\n`Signer::External` takes public key and returns `data_to_sign` for later signing.\nUse `attach_signature` method with the result signature to get the signed message.\n\n`Signer::Keys` creates a signed message with provided key pair.\n\n[SOON] `Signer::SigningBox` Allows using a special interface to imlepement signing\nwithout private key disclosure to SDK. For instance, in case of using a cold wallet or HSM,\nwhen application calls some API to sign data.", "params": [ { "name": "context", @@ -4319,8 +4319,8 @@ }, { "name": "attach_signature", - "summary": " Combines `hex`-encoded `signature` with `base64`-encoded `unsigned_message`.", - "description": " Combines `hex`-encoded `signature` with `base64`-encoded `unsigned_message`.\n Returns signed message encoded in `base64`.", + "summary": "Combines `hex`-encoded `signature` with `base64`-encoded `unsigned_message`. Returns signed message encoded in `base64`.", + "description": null, "params": [ { "name": "_context", @@ -4357,8 +4357,8 @@ }, { "name": "decode_message", - "summary": " Decodes message body using provided message BOC and ABI.", - "description": " Decodes message body using provided message BOC and ABI.", + "summary": "Decodes message body using provided message BOC and ABI.", + "description": null, "params": [ { "name": "_context", @@ -4395,8 +4395,8 @@ }, { "name": "decode_message_body", - "summary": " Decodes message body using provided body BOC and ABI.", - "description": " Decodes message body using provided body BOC and ABI.", + "summary": "Decodes message body using provided body BOC and ABI.", + "description": null, "params": [ { "name": "_context", @@ -4433,8 +4433,8 @@ }, { "name": "encode_account", - "summary": " Creates account state BOC", - "description": " Creates account state BOC\n\n Creates account state provided with one of these sets of data :\n 1. BOC of code, BOC of data, BOC of library\n 2. TVC (string in `base64`), keys, init params", + "summary": "Creates account state BOC", + "description": "Creates account state provided with one of these sets of data :\n1. BOC of code, BOC of data, BOC of library\n2. TVC (string in `base64`), keys, init params", "params": [ { "name": "context", @@ -4473,8 +4473,8 @@ }, { "name": "boc", - "summary": " BOC manipulation module.", - "description": " BOC manipulation module.", + "summary": "BOC manipulation module.", + "description": null, "types": [ { "name": "ParamsOfParse", @@ -4483,8 +4483,8 @@ { "name": "boc", "type": "String", - "summary": " BOC encoded as base64", - "description": " BOC encoded as base64" + "summary": "BOC encoded as base64", + "description": null } ], "summary": null, @@ -4498,8 +4498,8 @@ "name": "parsed", "type": "Ref", "ref_name": "Value", - "summary": " JSON containing parsed BOC", - "description": " JSON containing parsed BOC" + "summary": "JSON containing parsed BOC", + "description": null } ], "summary": null, @@ -4512,22 +4512,22 @@ { "name": "boc", "type": "String", - "summary": " BOC encoded as base64", - "description": " BOC encoded as base64" + "summary": "BOC encoded as base64", + "description": null }, { "name": "id", "type": "String", - "summary": " Shardstate identificator", - "description": " Shardstate identificator" + "summary": "Shardstate identificator", + "description": null }, { "name": "workchain_id", "type": "Number", "number_type": "Int", "number_size": 32, - "summary": " Workchain shardstate belongs to", - "description": " Workchain shardstate belongs to" + "summary": "Workchain shardstate belongs to", + "description": null } ], "summary": null, @@ -4540,8 +4540,8 @@ { "name": "block_boc", "type": "String", - "summary": " Key block BOC encoded as base64", - "description": " Key block BOC encoded as base64" + "summary": "Key block BOC encoded as base64", + "description": null } ], "summary": null, @@ -4554,8 +4554,8 @@ { "name": "config_boc", "type": "String", - "summary": " Blockchain config BOC encoded as base64", - "description": " Blockchain config BOC encoded as base64" + "summary": "Blockchain config BOC encoded as base64", + "description": null } ], "summary": null, @@ -4568,8 +4568,8 @@ { "name": "boc", "type": "String", - "summary": " BOC encoded as base64", - "description": " BOC encoded as base64" + "summary": "BOC encoded as base64", + "description": null } ], "summary": null, @@ -4582,8 +4582,8 @@ { "name": "hash", "type": "String", - "summary": " BOC root hash encoded with hex", - "description": " BOC root hash encoded with hex" + "summary": "BOC root hash encoded with hex", + "description": null } ], "summary": null, @@ -4593,8 +4593,8 @@ "functions": [ { "name": "parse_message", - "summary": " Parses message boc into a JSON", - "description": " Parses message boc into a JSON\n\n JSON structure is compatible with GraphQL API message object", + "summary": "Parses message boc into a JSON", + "description": "JSON structure is compatible with GraphQL API message object", "params": [ { "name": "_context", @@ -4631,8 +4631,8 @@ }, { "name": "parse_transaction", - "summary": " Parses transaction boc into a JSON", - "description": " Parses transaction boc into a JSON\n\n JSON structure is compatible with GraphQL API transaction object", + "summary": "Parses transaction boc into a JSON", + "description": "JSON structure is compatible with GraphQL API transaction object", "params": [ { "name": "_context", @@ -4669,8 +4669,8 @@ }, { "name": "parse_account", - "summary": " Parses account boc into a JSON", - "description": " Parses account boc into a JSON\n\n JSON structure is compatible with GraphQL API account object", + "summary": "Parses account boc into a JSON", + "description": "JSON structure is compatible with GraphQL API account object", "params": [ { "name": "_context", @@ -4707,8 +4707,8 @@ }, { "name": "parse_block", - "summary": " Parses block boc into a JSON", - "description": " Parses block boc into a JSON\n\n JSON structure is compatible with GraphQL API block object", + "summary": "Parses block boc into a JSON", + "description": "JSON structure is compatible with GraphQL API block object", "params": [ { "name": "_context", @@ -4745,8 +4745,8 @@ }, { "name": "parse_shardstate", - "summary": " Parses shardstate boc into a JSON", - "description": " Parses shardstate boc into a JSON\n\n JSON structure is compatible with GraphQL API shardstate object", + "summary": "Parses shardstate boc into a JSON", + "description": "JSON structure is compatible with GraphQL API shardstate object", "params": [ { "name": "_context", @@ -4821,8 +4821,8 @@ }, { "name": "get_boc_hash", - "summary": " Calculates BOC root hash", - "description": " Calculates BOC root hash", + "summary": "Calculates BOC root hash", + "description": null, "params": [ { "name": "_context", @@ -4861,8 +4861,8 @@ }, { "name": "processing", - "summary": " Message processing module.", - "description": " Message processing module.\n\n This module incorporates functions related to complex message\n processing scenarios.", + "summary": "Message processing module.", + "description": "This module incorporates functions related to complex message\nprocessing scenarios.", "types": [ { "name": "ProcessingEvent", @@ -4872,8 +4872,8 @@ "name": "WillFetchFirstBlock", "type": "Struct", "struct_fields": [], - "summary": " Notifies the app that the current shard block will be fetched", - "description": " Notifies the app that the current shard block will be fetched\n from the network.\n\n Fetched block will be used later in waiting phase." + "summary": "Notifies the app that the current shard block will be fetched from the network.", + "description": "Fetched block will be used later in waiting phase." }, { "name": "FetchFirstBlockFailed", @@ -4887,8 +4887,8 @@ "description": null } ], - "summary": " Notifies the app that the client has failed to fetch current", - "description": " Notifies the app that the client has failed to fetch current\n shard block.\n\n Message processing has finished." + "summary": "Notifies the app that the client has failed to fetch current shard block.", + "description": "Message processing has finished." }, { "name": "WillSend", @@ -4913,8 +4913,8 @@ "description": null } ], - "summary": " Notifies the app that the message will be sent to the", - "description": " Notifies the app that the message will be sent to the\n network." + "summary": "Notifies the app that the message will be sent to the network.", + "description": null }, { "name": "DidSend", @@ -4939,8 +4939,8 @@ "description": null } ], - "summary": " Notifies the app that the message was sent to the network.", - "description": " Notifies the app that the message was sent to the network." + "summary": "Notifies the app that the message was sent to the network.", + "description": null }, { "name": "SendFailed", @@ -4972,8 +4972,8 @@ "description": null } ], - "summary": " Notifies the app that the sending operation was failed with", - "description": " Notifies the app that the sending operation was failed with\n network error.\n\n Nevertheless the processing will be continued at the waiting\n phase because the message possibly has been delivered to the\n node." + "summary": "Notifies the app that the sending operation was failed with network error.", + "description": "Nevertheless the processing will be continued at the waiting\nphase because the message possibly has been delivered to the\nnode." }, { "name": "WillFetchNextBlock", @@ -4998,8 +4998,8 @@ "description": null } ], - "summary": " Notifies the app that the next shard block will be fetched", - "description": " Notifies the app that the next shard block will be fetched\n from the network.\n\n Event can occurs more than one time due to block walking\n procedure." + "summary": "Notifies the app that the next shard block will be fetched from the network.", + "description": "Event can occurs more than one time due to block walking\nprocedure." }, { "name": "FetchNextBlockFailed", @@ -5031,8 +5031,8 @@ "description": null } ], - "summary": " Notifies the app that the next block can't be fetched due to", - "description": " Notifies the app that the next block can't be fetched due to\n error.\n\n Processing will be continued after `network_resume_timeout`." + "summary": "Notifies the app that the next block can't be fetched due to error.", + "description": "Processing will be continued after `network_resume_timeout`." }, { "name": "MessageExpired", @@ -5058,8 +5058,8 @@ "description": null } ], - "summary": " Notifies the app that the message was expired.", - "description": " Notifies the app that the message was expired.\n\n Event occurs for contracts which ABI includes header \"expire\"\n\n Processing will be continued from encoding phase after\n `expiration_retries_timeout`." + "summary": "Notifies the app that the message was expired.", + "description": "Event occurs for contracts which ABI includes header \"expire\"\n\nProcessing will be continued from encoding phase after\n`expiration_retries_timeout`." } ], "summary": null, @@ -5073,8 +5073,8 @@ "name": "transaction", "type": "Ref", "ref_name": "Value", - "summary": " Parsed transaction.", - "description": " Parsed transaction.\n\n In addition to the regular transaction fields there is a\n `boc` field encoded with `base64` which contains source\n transaction BOC." + "summary": "Parsed transaction.", + "description": "In addition to the regular transaction fields there is a\n`boc` field encoded with `base64` which contains source\ntransaction BOC." }, { "name": "out_messages", @@ -5082,8 +5082,8 @@ "array_item": { "type": "String" }, - "summary": " List of output messages' BOCs. Encoded as `base64`", - "description": " List of output messages' BOCs. Encoded as `base64`" + "summary": "List of output messages' BOCs.", + "description": "Encoded as `base64`" }, { "name": "decoded", @@ -5092,15 +5092,15 @@ "type": "Ref", "ref_name": "processing.DecodedOutput" }, - "summary": " Optional decoded message bodies according to the optional", - "description": " Optional decoded message bodies according to the optional\n `abi` parameter." + "summary": "Optional decoded message bodies according to the optional `abi` parameter.", + "description": null }, { "name": "fees", "type": "Ref", "ref_name": "tvm.TransactionFees", - "summary": " Transaction fees", - "description": " Transaction fees" + "summary": "Transaction fees", + "description": null } ], "summary": null, @@ -5120,8 +5120,8 @@ "ref_name": "abi.DecodedMessageBody" } }, - "summary": " Decoded bodies of the out messages.", - "description": " Decoded bodies of the out messages.\n\n If the message can't be decoded, then `None` will be stored in\n the appropriate position." + "summary": "Decoded bodies of the out messages.", + "description": "If the message can't be decoded, then `None` will be stored in\nthe appropriate position." }, { "name": "output", @@ -5130,8 +5130,8 @@ "type": "Ref", "ref_name": "Value" }, - "summary": " Decoded body of the function output message.", - "description": " Decoded body of the function output message." + "summary": "Decoded body of the function output message.", + "description": null } ], "summary": null, @@ -5144,8 +5144,8 @@ { "name": "message", "type": "String", - "summary": " Message BOC.", - "description": " Message BOC." + "summary": "Message BOC.", + "description": null }, { "name": "abi", @@ -5154,14 +5154,14 @@ "type": "Ref", "ref_name": "abi.Abi" }, - "summary": " Optional message ABI.", - "description": " Optional message ABI.\n\n If this parameter is specified and the message has the\n `expire` header then expiration time will be checked against\n the current time to prevent unnecessary sending of already expired message.\n\n The `message already expired` error will be returned in this\n case.\n\n Note, that specifying `abi` for ABI compliant contracts is\n strongly recommended, so that proper processing strategy can be\n chosen." + "summary": "Optional message ABI.", + "description": "If this parameter is specified and the message has the\n`expire` header then expiration time will be checked against\nthe current time to prevent unnecessary sending of already expired message.\n\nThe `message already expired` error will be returned in this\ncase.\n\nNote, that specifying `abi` for ABI compliant contracts is\nstrongly recommended, so that proper processing strategy can be\nchosen." }, { "name": "send_events", "type": "Boolean", - "summary": " Flag for requesting events sending", - "description": " Flag for requesting events sending" + "summary": "Flag for requesting events sending", + "description": null } ], "summary": null, @@ -5174,8 +5174,8 @@ { "name": "shard_block_id", "type": "String", - "summary": " The last generated shard block of the message destination account before the", - "description": " The last generated shard block of the message destination account before the\n message was sent.\n\n This block id must be used as a parameter of the\n `wait_for_transaction`." + "summary": "The last generated shard block of the message destination account before the message was sent.", + "description": "This block id must be used as a parameter of the\n`wait_for_transaction`." } ], "summary": null, @@ -5192,26 +5192,26 @@ "type": "Ref", "ref_name": "abi.Abi" }, - "summary": " Optional ABI for decoding the transaction result.", - "description": " Optional ABI for decoding the transaction result.\n\n If it is specified, then the output messages' bodies will be\n decoded according to this ABI.\n\n The `abi_decoded` result field will be filled out." + "summary": "Optional ABI for decoding the transaction result.", + "description": "If it is specified, then the output messages' bodies will be\ndecoded according to this ABI.\n\nThe `abi_decoded` result field will be filled out." }, { "name": "message", "type": "String", - "summary": " Message BOC. Encoded with `base64`.", - "description": " Message BOC. Encoded with `base64`." + "summary": "Message BOC.", + "description": "Encoded with `base64`." }, { "name": "shard_block_id", "type": "String", - "summary": " The last generated block id of the destination account shard before the message was sent.", - "description": " The last generated block id of the destination account shard before the message was sent.\n\n You must provide the same value as the `send_message` has returned." + "summary": "The last generated block id of the destination account shard before the message was sent.", + "description": "You must provide the same value as the `send_message` has returned." }, { "name": "send_events", "type": "Boolean", - "summary": " Flag that enables/disables intermediate events", - "description": " Flag that enables/disables intermediate events" + "summary": "Flag that enables/disables intermediate events", + "description": null } ], "summary": null, @@ -5225,14 +5225,14 @@ "name": "message_encode_params", "type": "Ref", "ref_name": "abi.ParamsOfEncodeMessage", - "summary": " Message encode parameters.", - "description": " Message encode parameters." + "summary": "Message encode parameters.", + "description": null }, { "name": "send_events", "type": "Boolean", - "summary": " Flag for requesting events sending", - "description": " Flag for requesting events sending" + "summary": "Flag for requesting events sending", + "description": null } ], "summary": null, @@ -5242,8 +5242,8 @@ "functions": [ { "name": "send_message", - "summary": " Sends message to the network", - "description": " Sends message to the network\n\n Sends message to the network and returns the last generated shard block of the destination account\n before the message was sent. It will be required later for message processing.", + "summary": "Sends message to the network", + "description": "Sends message to the network and returns the last generated shard block of the destination account\nbefore the message was sent. It will be required later for message processing.", "params": [ { "name": "context", @@ -5293,8 +5293,8 @@ }, { "name": "wait_for_transaction", - "summary": " Performs monitoring of the network for the result transaction", - "description": " Performs monitoring of the network for the result transaction\n of the external inbound message processing.\n\n `send_events` enables intermediate events, such as `WillFetchNextBlock`,\n `FetchNextBlockFailed` that may be useful for logging of new shard blocks creation\n during message processing.\n\n Note, that presence of the `abi` parameter is critical for ABI\n compliant contracts. Message processing uses drastically\n different strategy for processing message for contracts which\n ABI includes \"expire\" header.\n\n When the ABI header `expire` is present, the processing uses\n `message expiration` strategy:\n - The maximum block gen time is set to\n `message_expiration_timeout + transaction_wait_timeout`.\n - When maximum block gen time is reached, the processing will\n be finished with `MessageExpired` error.\n\n When the ABI header `expire` isn't present or `abi` parameter\n isn't specified, the processing uses `transaction waiting`\n strategy:\n - The maximum block gen time is set to\n `now() + transaction_wait_timeout`.\n\n - If maximum block gen time is reached and no result transaction is found,\n the processing will exit with an error.", + "summary": "Performs monitoring of the network for the result transaction of the external inbound message processing.", + "description": "`send_events` enables intermediate events, such as `WillFetchNextBlock`,\n`FetchNextBlockFailed` that may be useful for logging of new shard blocks creation\nduring message processing.\n\nNote, that presence of the `abi` parameter is critical for ABI\ncompliant contracts. Message processing uses drastically\ndifferent strategy for processing message for contracts which\nABI includes \"expire\" header.\n\nWhen the ABI header `expire` is present, the processing uses\n`message expiration` strategy:\n- The maximum block gen time is set to\n `message_expiration_timeout + transaction_wait_timeout`.\n- When maximum block gen time is reached, the processing will\n be finished with `MessageExpired` error.\n\nWhen the ABI header `expire` isn't present or `abi` parameter\nisn't specified, the processing uses `transaction waiting`\nstrategy:\n- The maximum block gen time is set to\n `now() + transaction_wait_timeout`.\n\n- If maximum block gen time is reached and no result transaction is found,\nthe processing will exit with an error.", "params": [ { "name": "context", @@ -5344,8 +5344,8 @@ }, { "name": "process_message", - "summary": " Creates message, sends it to the network and monitors its processing.", - "description": " Creates message, sends it to the network and monitors its processing.\n\n Creates ABI-compatible message,\n sends it to the network and monitors for the result transaction.\n Decodes the output messages' bodies.\n\n If contract's ABI includes \"expire\" header, then\n SDK implements retries in case of unsuccessful message delivery within the expiration\n timeout: SDK recreates the message, sends it and processes it again.\n\n The intermediate events, such as `WillFetchFirstBlock`, `WillSend`, `DidSend`,\n `WillFetchNextBlock`, etc - are switched on/off by `send_events` flag\n and logged into the supplied callback function.\n The retry configuration parameters are defined in config:\n \n pub const DEFAULT_EXPIRATION_RETRIES_LIMIT: i8 = 3; - max number of retries\n pub const DEFAULT_EXPIRATION_TIMEOUT: u32 = 40000; - message expiration timeout in ms.\n pub const DEFAULT_....expiration_timeout_grow_factor... = 1.5 - factor that increases the expiration timeout for each retry\n\n If contract's ABI does not include \"expire\" header\n then, if no transaction is found within the network timeout (see config parameter ), exits with error.", + "summary": "Creates message, sends it to the network and monitors its processing.", + "description": "Creates ABI-compatible message,\nsends it to the network and monitors for the result transaction.\nDecodes the output messages' bodies.\n\nIf contract's ABI includes \"expire\" header, then\nSDK implements retries in case of unsuccessful message delivery within the expiration\ntimeout: SDK recreates the message, sends it and processes it again.\n\nThe intermediate events, such as `WillFetchFirstBlock`, `WillSend`, `DidSend`,\n`WillFetchNextBlock`, etc - are switched on/off by `send_events` flag\nand logged into the supplied callback function.\nThe retry configuration parameters are defined in config:\n\npub const DEFAULT_EXPIRATION_RETRIES_LIMIT: i8 = 3; - max number of retries\npub const DEFAULT_EXPIRATION_TIMEOUT: u32 = 40000; - message expiration timeout in ms.\npub const DEFAULT_....expiration_timeout_grow_factor... = 1.5 - factor that increases the expiration timeout for each retry\n\nIf contract's ABI does not include \"expire\" header\nthen, if no transaction is found within the network timeout (see config parameter ), exits with error.", "params": [ { "name": "context", @@ -5397,8 +5397,8 @@ }, { "name": "utils", - "summary": " Misc utility Functions.", - "description": " Misc utility Functions.", + "summary": "Misc utility Functions.", + "description": null, "types": [ { "name": "AddressStringFormat", @@ -5455,15 +5455,15 @@ { "name": "address", "type": "String", - "summary": " Account address in any TON format.", - "description": " Account address in any TON format." + "summary": "Account address in any TON format.", + "description": null }, { "name": "output_format", "type": "Ref", "ref_name": "utils.AddressStringFormat", - "summary": " Specify the format to convert to.", - "description": " Specify the format to convert to." + "summary": "Specify the format to convert to.", + "description": null } ], "summary": null, @@ -5476,8 +5476,8 @@ { "name": "address", "type": "String", - "summary": " Address in the specified format", - "description": " Address in the specified format" + "summary": "Address in the specified format", + "description": null } ], "summary": null, @@ -5487,8 +5487,8 @@ "functions": [ { "name": "convert_address", - "summary": " Converts address from any TON format to any TON format", - "description": " Converts address from any TON format to any TON format", + "summary": "Converts address from any TON format to any TON format", + "description": null, "params": [ { "name": "_context", @@ -5540,8 +5540,8 @@ "optional_inner": { "type": "String" }, - "summary": " boc with config", - "description": " boc with config" + "summary": "boc with config", + "description": null }, { "name": "block_time", @@ -5551,8 +5551,8 @@ "number_type": "UInt", "number_size": 32 }, - "summary": " time that is used as transaction time", - "description": " time that is used as transaction time" + "summary": "time that is used as transaction time", + "description": null }, { "name": "block_lt", @@ -5562,8 +5562,8 @@ "number_type": "UInt", "number_size": 64 }, - "summary": " block logical time", - "description": " block logical time" + "summary": "block logical time", + "description": null }, { "name": "transaction_lt", @@ -5573,8 +5573,8 @@ "number_type": "UInt", "number_size": 64 }, - "summary": " transaction logical time", - "description": " transaction logical time" + "summary": "transaction logical time", + "description": null } ], "summary": null, @@ -5588,15 +5588,15 @@ "name": "None", "type": "Struct", "struct_fields": [], - "summary": " Non-existing account to run a creation internal message.", - "description": " Non-existing account to run a creation internal message.\n Should be used with `skip_transaction_check = true` if the message has no deploy data\n since transactions on the uninitialized account are always aborted" + "summary": "Non-existing account to run a creation internal message. Should be used with `skip_transaction_check = true` if the message has no deploy data since transactions on the uninitialized account are always aborted", + "description": null }, { "name": "Uninit", "type": "Struct", "struct_fields": [], - "summary": " Emulate uninitialized account to run deploy message", - "description": " Emulate uninitialized account to run deploy message" + "summary": "Emulate uninitialized account to run deploy message", + "description": null }, { "name": "Account", @@ -5605,8 +5605,8 @@ { "name": "boc", "type": "String", - "summary": " Account BOC. Encoded as base64.", - "description": " Account BOC. Encoded as base64." + "summary": "Account BOC.", + "description": "Encoded as base64." }, { "name": "unlimited_balance", @@ -5614,12 +5614,12 @@ "optional_inner": { "type": "Boolean" }, - "summary": " Flag for running account with the unlimited balance. Can be used to calculate", - "description": " Flag for running account with the unlimited balance. Can be used to calculate\n transaction fees without balance check" + "summary": "Flag for running account with the unlimited balance.", + "description": "Can be used to calculatetransaction fees without balance check" } ], - "summary": " Account state to run message", - "description": " Account state to run message" + "summary": "Account state to run message", + "description": null } ], "summary": null, @@ -5688,15 +5688,15 @@ { "name": "message", "type": "String", - "summary": " Input message BOC. Must be encoded as base64.", - "description": " Input message BOC. Must be encoded as base64." + "summary": "Input message BOC.", + "description": "Must be encoded as base64." }, { "name": "account", "type": "Ref", "ref_name": "tvm.AccountForExecutor", - "summary": " Account to run on executor", - "description": " Account to run on executor" + "summary": "Account to run on executor", + "description": null }, { "name": "execution_options", @@ -5705,8 +5705,8 @@ "type": "Ref", "ref_name": "tvm.ExecutionOptions" }, - "summary": " Execution options.", - "description": " Execution options." + "summary": "Execution options.", + "description": null }, { "name": "abi", @@ -5715,8 +5715,8 @@ "type": "Ref", "ref_name": "abi.Abi" }, - "summary": " Contract ABI for decoding output messages", - "description": " Contract ABI for decoding output messages" + "summary": "Contract ABI for decoding output messages", + "description": null }, { "name": "skip_transaction_check", @@ -5724,8 +5724,8 @@ "optional_inner": { "type": "Boolean" }, - "summary": " Skip transaction check flag", - "description": " Skip transaction check flag" + "summary": "Skip transaction check flag", + "description": null } ], "summary": null, @@ -5739,8 +5739,8 @@ "name": "transaction", "type": "Ref", "ref_name": "Value", - "summary": " Parsed transaction.", - "description": " Parsed transaction.\n\n In addition to the regular transaction fields there is a\n `boc` field encoded with `base64` which contains source\n transaction BOC." + "summary": "Parsed transaction.", + "description": "In addition to the regular transaction fields there is a\n`boc` field encoded with `base64` which contains source\ntransaction BOC." }, { "name": "out_messages", @@ -5748,8 +5748,8 @@ "array_item": { "type": "String" }, - "summary": " List of output messages' BOCs. Encoded as `base64`", - "description": " List of output messages' BOCs. Encoded as `base64`" + "summary": "List of output messages' BOCs.", + "description": "Encoded as `base64`" }, { "name": "decoded", @@ -5758,21 +5758,21 @@ "type": "Ref", "ref_name": "processing.DecodedOutput" }, - "summary": " Optional decoded message bodies according to the optional", - "description": " Optional decoded message bodies according to the optional\n `abi` parameter." + "summary": "Optional decoded message bodies according to the optional `abi` parameter.", + "description": null }, { "name": "account", "type": "String", - "summary": " Updated account state BOC. Encoded as `base64`", - "description": " Updated account state BOC. Encoded as `base64`" + "summary": "Updated account state BOC.", + "description": "Encoded as `base64`" }, { "name": "fees", "type": "Ref", "ref_name": "tvm.TransactionFees", - "summary": " Transaction fees", - "description": " Transaction fees" + "summary": "Transaction fees", + "description": null } ], "summary": null, @@ -5785,14 +5785,14 @@ { "name": "message", "type": "String", - "summary": " Input message BOC. Must be encoded as base64.", - "description": " Input message BOC. Must be encoded as base64." + "summary": "Input message BOC.", + "description": "Must be encoded as base64." }, { "name": "account", "type": "String", - "summary": " Account BOC. Must be encoded as base64.", - "description": " Account BOC. Must be encoded as base64." + "summary": "Account BOC.", + "description": "Must be encoded as base64." }, { "name": "execution_options", @@ -5801,8 +5801,8 @@ "type": "Ref", "ref_name": "tvm.ExecutionOptions" }, - "summary": " Execution options.", - "description": " Execution options." + "summary": "Execution options.", + "description": null }, { "name": "abi", @@ -5811,8 +5811,8 @@ "type": "Ref", "ref_name": "abi.Abi" }, - "summary": " Contract ABI for dedcoding output messages", - "description": " Contract ABI for dedcoding output messages" + "summary": "Contract ABI for dedcoding output messages", + "description": null } ], "summary": null, @@ -5828,8 +5828,8 @@ "array_item": { "type": "String" }, - "summary": " List of output messages' BOCs. Encoded as `base64`", - "description": " List of output messages' BOCs. Encoded as `base64`" + "summary": "List of output messages' BOCs.", + "description": "Encoded as `base64`" }, { "name": "decoded", @@ -5838,14 +5838,14 @@ "type": "Ref", "ref_name": "processing.DecodedOutput" }, - "summary": " Optional decoded message bodies according to the optional", - "description": " Optional decoded message bodies according to the optional\n `abi` parameter." + "summary": "Optional decoded message bodies according to the optional `abi` parameter.", + "description": null }, { "name": "account", "type": "String", - "summary": " Updated account state BOC. Encoded as `base64`.", - "description": " Updated account state BOC. Encoded as `base64`.\n Attention! Only data in account state is updated." + "summary": "Updated account state BOC.", + "description": "Encoded as `base64`.Attention! Only data in account state is updated." } ], "summary": null, @@ -5858,14 +5858,14 @@ { "name": "account", "type": "String", - "summary": " Account BOC in `base64`", - "description": " Account BOC in `base64`" + "summary": "Account BOC in `base64`", + "description": null }, { "name": "function_name", "type": "String", - "summary": " Function name", - "description": " Function name" + "summary": "Function name", + "description": null }, { "name": "input", @@ -5874,8 +5874,8 @@ "type": "Ref", "ref_name": "Value" }, - "summary": " Input parameters", - "description": " Input parameters" + "summary": "Input parameters", + "description": null }, { "name": "execution_options", @@ -5899,8 +5899,8 @@ "name": "output", "type": "Ref", "ref_name": "Value", - "summary": " Values returned by getmethod on stack", - "description": " Values returned by getmethod on stack" + "summary": "Values returned by getmethod on stack", + "description": null } ], "summary": null, @@ -5986,8 +5986,8 @@ }, { "name": "run_get", - "summary": " Executes getmethod and returns data from TVM stack", - "description": " Executes getmethod and returns data from TVM stack", + "summary": "Executes getmethod and returns data from TVM stack", + "description": null, "params": [ { "name": "context", @@ -6026,8 +6026,8 @@ }, { "name": "net", - "summary": " Network access.", - "description": " Network access.", + "summary": "Network access.", + "description": null, "types": [ { "name": "OrderBy", @@ -6077,8 +6077,8 @@ { "name": "query", "type": "String", - "summary": " GraphQL query text.", - "description": " GraphQL query text." + "summary": "GraphQL query text.", + "description": null }, { "name": "variables", @@ -6087,8 +6087,8 @@ "type": "Ref", "ref_name": "Value" }, - "summary": " Variables used in query. Must be a map with named values that", - "description": " Variables used in query. Must be a map with named values that\n can be used in query." + "summary": "Variables used in query.", + "description": "Must be a map with named values thatcan be used in query." } ], "summary": null, @@ -6102,8 +6102,8 @@ "name": "result", "type": "Ref", "ref_name": "Value", - "summary": " Result provided by DAppServer.", - "description": " Result provided by DAppServer." + "summary": "Result provided by DAppServer.", + "description": null } ], "summary": null, @@ -6116,8 +6116,8 @@ { "name": "collection", "type": "String", - "summary": " Collection name (accounts, blocks, transactions, messages, block_signatures)", - "description": " Collection name (accounts, blocks, transactions, messages, block_signatures)" + "summary": "Collection name (accounts, blocks, transactions, messages, block_signatures)", + "description": null }, { "name": "filter", @@ -6126,14 +6126,14 @@ "type": "Ref", "ref_name": "Value" }, - "summary": " Collection filter", - "description": " Collection filter" + "summary": "Collection filter", + "description": null }, { "name": "result", "type": "String", - "summary": " Projection (result) string", - "description": " Projection (result) string" + "summary": "Projection (result) string", + "description": null }, { "name": "order", @@ -6145,8 +6145,8 @@ "ref_name": "net.OrderBy" } }, - "summary": " Sorting order", - "description": " Sorting order" + "summary": "Sorting order", + "description": null }, { "name": "limit", @@ -6156,8 +6156,8 @@ "number_type": "UInt", "number_size": 32 }, - "summary": " Number of documents to return", - "description": " Number of documents to return" + "summary": "Number of documents to return", + "description": null } ], "summary": null, @@ -6174,8 +6174,8 @@ "type": "Ref", "ref_name": "Value" }, - "summary": " Objects that match the provided criteria", - "description": " Objects that match the provided criteria" + "summary": "Objects that match the provided criteria", + "description": null } ], "summary": null, @@ -6188,8 +6188,8 @@ { "name": "collection", "type": "String", - "summary": " Collection name (accounts, blocks, transactions, messages, block_signatures)", - "description": " Collection name (accounts, blocks, transactions, messages, block_signatures)" + "summary": "Collection name (accounts, blocks, transactions, messages, block_signatures)", + "description": null }, { "name": "filter", @@ -6198,14 +6198,14 @@ "type": "Ref", "ref_name": "Value" }, - "summary": " Collection filter", - "description": " Collection filter" + "summary": "Collection filter", + "description": null }, { "name": "result", "type": "String", - "summary": " Projection (result) string", - "description": " Projection (result) string" + "summary": "Projection (result) string", + "description": null }, { "name": "timeout", @@ -6215,8 +6215,8 @@ "number_type": "UInt", "number_size": 32 }, - "summary": " Query timeout", - "description": " Query timeout" + "summary": "Query timeout", + "description": null } ], "summary": null, @@ -6230,8 +6230,8 @@ "name": "result", "type": "Ref", "ref_name": "Value", - "summary": " First found object that matches the provided criteria", - "description": " First found object that matches the provided criteria" + "summary": "First found object that matches the provided criteria", + "description": null } ], "summary": null, @@ -6246,8 +6246,8 @@ "type": "Number", "number_type": "UInt", "number_size": 32, - "summary": " Subscription handle. Must be closed with `unsubscribe`", - "description": " Subscription handle. Must be closed with `unsubscribe`" + "summary": "Subscription handle.", + "description": "Must be closed with `unsubscribe`" } ], "summary": null, @@ -6260,8 +6260,8 @@ { "name": "collection", "type": "String", - "summary": " Collection name (accounts, blocks, transactions, messages, block_signatures)", - "description": " Collection name (accounts, blocks, transactions, messages, block_signatures)" + "summary": "Collection name (accounts, blocks, transactions, messages, block_signatures)", + "description": null }, { "name": "filter", @@ -6270,14 +6270,14 @@ "type": "Ref", "ref_name": "Value" }, - "summary": " Collection filter", - "description": " Collection filter" + "summary": "Collection filter", + "description": null }, { "name": "result", "type": "String", - "summary": " Projection (result) string", - "description": " Projection (result) string" + "summary": "Projection (result) string", + "description": null } ], "summary": null, @@ -6287,8 +6287,8 @@ "functions": [ { "name": "query", - "summary": " Performs DAppServer GraphQL query.", - "description": " Performs DAppServer GraphQL query.", + "summary": "Performs DAppServer GraphQL query.", + "description": null, "params": [ { "name": "context", @@ -6325,8 +6325,8 @@ }, { "name": "query_collection", - "summary": " Queries collection data", - "description": " Queries collection data\n\n Queries data that satisfies the `filter` conditions,\n limits the number of returned records and orders them.\n The projection fields are limited to `result` fields", + "summary": "Queries collection data", + "description": "Queries data that satisfies the `filter` conditions,\nlimits the number of returned records and orders them.\nThe projection fields are limited to `result` fields", "params": [ { "name": "context", @@ -6363,8 +6363,8 @@ }, { "name": "wait_for_collection", - "summary": " Returns an object that fulfills the conditions or waits for its appearance", - "description": " Returns an object that fulfills the conditions or waits for its appearance\n\n Triggers only once.\n If object that satisfies the `filter` conditions\n already exists - returns it immediately.\n If not - waits for insert/update of data within the specified `timeout`,\n and returns it.\n The projection fields are limited to `result` fields", + "summary": "Returns an object that fulfills the conditions or waits for its appearance", + "description": "Triggers only once.\nIf object that satisfies the `filter` conditions\nalready exists - returns it immediately.\nIf not - waits for insert/update of data within the specified `timeout`,\nand returns it.\nThe projection fields are limited to `result` fields", "params": [ { "name": "context", @@ -6401,8 +6401,8 @@ }, { "name": "unsubscribe", - "summary": " Cancels a subscription", - "description": " Cancels a subscription\n\n Cancels a subscription specified by its handle.", + "summary": "Cancels a subscription", + "description": "Cancels a subscription specified by its handle.", "params": [ { "name": "_context", @@ -6438,8 +6438,8 @@ }, { "name": "subscribe_collection", - "summary": " Creates a subscription", - "description": " Creates a subscription\n\n Triggers for each insert/update of data\n that satisfies the `filter` conditions.\n The projection fields are limited to `result` fields.", + "summary": "Creates a subscription", + "description": "Triggers for each insert/update of data\nthat satisfies the `filter` conditions.\nThe projection fields are limited to `result` fields.", "params": [ { "name": "context", @@ -6491,16 +6491,16 @@ }, { "name": "debot", - "summary": " [UNSTABLE](UNSTABLE.md) Module for working with debot.", - "description": " [UNSTABLE](UNSTABLE.md) Module for working with debot.", + "summary": "[UNSTABLE](UNSTABLE.md) Module for working with debot.", + "description": null, "types": [ { "name": "DebotHandle", "type": "Number", "number_type": "UInt", "number_size": 32, - "summary": " [UNSTABLE](UNSTABLE.md) Handle of registered in SDK debot", - "description": " [UNSTABLE](UNSTABLE.md) Handle of registered in SDK debot" + "summary": "[UNSTABLE](UNSTABLE.md) Handle of registered in SDK debot", + "description": null }, { "name": "DebotAction", @@ -6509,46 +6509,46 @@ { "name": "description", "type": "String", - "summary": " A short action description. Should be used by Debot Browser as name of", - "description": " A short action description. Should be used by Debot Browser as name of\n menu item." + "summary": "A short action description.", + "description": "Should be used by Debot Browser as name ofmenu item." }, { "name": "name", "type": "String", - "summary": " Depends on action type. Can be a debot function name or a print string ", - "description": " Depends on action type. Can be a debot function name or a print string \n (for Print Action)." + "summary": "Depends on action type.", + "description": "Can be a debot function name or a print string(for Print Action)." }, { "name": "action_type", "type": "Number", "number_type": "UInt", "number_size": 8, - "summary": " Action type.", - "description": " Action type." + "summary": "Action type.", + "description": null }, { "name": "to", "type": "Number", "number_type": "UInt", "number_size": 8, - "summary": " ID of debot context to switch after action execution. ", - "description": " ID of debot context to switch after action execution. " + "summary": "ID of debot context to switch after action execution.", + "description": null }, { "name": "attributes", "type": "String", - "summary": " Action attributes. In the form of \"param=value,flag\".", - "description": " Action attributes. In the form of \"param=value,flag\".\n attribute example: instant, args, fargs, sign." + "summary": "Action attributes.", + "description": "In the form of \"param=value,flag\".attribute example: instant, args, fargs, sign." }, { "name": "misc", "type": "String", - "summary": " Some internal action data. Used by debot only.", - "description": " Some internal action data. Used by debot only." + "summary": "Some internal action data.", + "description": "Used by debot only." } ], - "summary": " [UNSTABLE](UNSTABLE.md) Describes a debot action in a Debot Context.", - "description": " [UNSTABLE](UNSTABLE.md) Describes a debot action in a Debot Context." + "summary": "[UNSTABLE](UNSTABLE.md) Describes a debot action in a Debot Context.", + "description": null }, { "name": "ParamsOfStart", @@ -6557,12 +6557,12 @@ { "name": "address", "type": "String", - "summary": " Debot smart contract address ", - "description": " Debot smart contract address " + "summary": "Debot smart contract address", + "description": null } ], - "summary": " [UNSTABLE](UNSTABLE.md) Parameters to start debot.", - "description": " [UNSTABLE](UNSTABLE.md) Parameters to start debot." + "summary": "[UNSTABLE](UNSTABLE.md) Parameters to start debot.", + "description": null }, { "name": "RegisteredDebot", @@ -6572,12 +6572,12 @@ "name": "debot_handle", "type": "Ref", "ref_name": "debot.DebotHandle", - "summary": " Debot handle which references an instance of debot engine.", - "description": " Debot handle which references an instance of debot engine." + "summary": "Debot handle which references an instance of debot engine.", + "description": null } ], - "summary": " [UNSTABLE](UNSTABLE.md) Structure for storing debot handle returned from `start` and `fetch` functions.", - "description": " [UNSTABLE](UNSTABLE.md) Structure for storing debot handle returned from `start` and `fetch` functions." + "summary": "[UNSTABLE](UNSTABLE.md) Structure for storing debot handle returned from `start` and `fetch` functions.", + "description": null }, { "name": "ParamsOfAppDebotBrowser", @@ -6590,12 +6590,12 @@ { "name": "msg", "type": "String", - "summary": " A string that must be printed to user.", - "description": " A string that must be printed to user." + "summary": "A string that must be printed to user.", + "description": null } ], - "summary": " Print message to user. ", - "description": " Print message to user. " + "summary": "Print message to user.", + "description": null }, { "name": "Switch", @@ -6606,12 +6606,12 @@ "type": "Number", "number_type": "UInt", "number_size": 8, - "summary": " Debot context ID to which debot is switched.", - "description": " Debot context ID to which debot is switched." + "summary": "Debot context ID to which debot is switched.", + "description": null } ], - "summary": " Switch debot to another context (menu).", - "description": " Switch debot to another context (menu)." + "summary": "Switch debot to another context (menu).", + "description": null }, { "name": "ShowAction", @@ -6621,12 +6621,12 @@ "name": "action", "type": "Ref", "ref_name": "debot.DebotAction", - "summary": " Debot action that must be shown to user as menu item.", - "description": " Debot action that must be shown to user as menu item.\n At least `description` property must be shown from [DebotAction] structure." + "summary": "Debot action that must be shown to user as menu item. At least `description` property must be shown from [DebotAction] structure.", + "description": null } ], - "summary": " Show action to the user.", - "description": " Show action to the user.\n Called after `switch` for each action in context." + "summary": "Show action to the user. Called after `switch` for each action in context.", + "description": null }, { "name": "Input", @@ -6635,19 +6635,19 @@ { "name": "prompt", "type": "String", - "summary": " A prompt string that must be printed to user before input request.", - "description": " A prompt string that must be printed to user before input request." + "summary": "A prompt string that must be printed to user before input request.", + "description": null } ], - "summary": " Request user input. ", - "description": " Request user input. " + "summary": "Request user input.", + "description": null }, { "name": "GetSigningBox", "type": "Struct", "struct_fields": [], - "summary": " Get signing box to sign data. Signing box returned is owned and disposed by debot engine", - "description": " Get signing box to sign data. Signing box returned is owned and disposed by debot engine" + "summary": "Get signing box to sign data.", + "description": "Signing box returned is owned and disposed by debot engine" }, { "name": "InvokeDebot", @@ -6656,23 +6656,23 @@ { "name": "debot_addr", "type": "String", - "summary": " Address of debot in blockchain.", - "description": " Address of debot in blockchain." + "summary": "Address of debot in blockchain.", + "description": null }, { "name": "action", "type": "Ref", "ref_name": "debot.DebotAction", - "summary": " Debot action to execute.", - "description": " Debot action to execute." + "summary": "Debot action to execute.", + "description": null } ], - "summary": " Execute action of another debot.", - "description": " Execute action of another debot." + "summary": "Execute action of another debot.", + "description": null } ], - "summary": " [UNSTABLE](UNSTABLE.md) Debot Browser callbacks", - "description": " [UNSTABLE](UNSTABLE.md) Debot Browser callbacks\n \n Called by debot engine to communicate with debot browser." + "summary": "[UNSTABLE](UNSTABLE.md) Debot Browser callbacks", + "description": "Called by debot engine to communicate with debot browser." }, { "name": "ResultOfAppDebotBrowser", @@ -6685,12 +6685,12 @@ { "name": "value", "type": "String", - "summary": " String entered by user.", - "description": " String entered by user." + "summary": "String entered by user.", + "description": null } ], - "summary": " Result of user input.", - "description": " Result of user input." + "summary": "Result of user input.", + "description": null }, { "name": "GetSigningBox", @@ -6700,23 +6700,23 @@ "name": "signing_box", "type": "Ref", "ref_name": "crypto.SigningBoxHandle", - "summary": " Signing box for signing data requested by debot engine. Signing box is owned and disposed by debot engine", - "description": " Signing box for signing data requested by debot engine. Signing box is owned and disposed by debot engine" + "summary": "Signing box for signing data requested by debot engine.", + "description": "Signing box is owned and disposed by debot engine" } ], - "summary": " Result of getting signing box.", - "description": " Result of getting signing box." + "summary": "Result of getting signing box.", + "description": null }, { "name": "InvokeDebot", "type": "Struct", "struct_fields": [], - "summary": " Result of debot invoking.", - "description": " Result of debot invoking." + "summary": "Result of debot invoking.", + "description": null } ], - "summary": " [UNSTABLE](UNSTABLE.md) Returning values from Debot Browser callbacks.", - "description": " [UNSTABLE](UNSTABLE.md) Returning values from Debot Browser callbacks." + "summary": "[UNSTABLE](UNSTABLE.md) Returning values from Debot Browser callbacks.", + "description": null }, { "name": "ParamsOfFetch", @@ -6725,12 +6725,12 @@ { "name": "address", "type": "String", - "summary": " Debot smart contract address", - "description": " Debot smart contract address" + "summary": "Debot smart contract address", + "description": null } ], - "summary": " [UNSTABLE](UNSTABLE.md) Parameters to fetch debot.", - "description": " [UNSTABLE](UNSTABLE.md) Parameters to fetch debot." + "summary": "[UNSTABLE](UNSTABLE.md) Parameters to fetch debot.", + "description": null }, { "name": "ParamsOfExecute", @@ -6740,26 +6740,26 @@ "name": "debot_handle", "type": "Ref", "ref_name": "debot.DebotHandle", - "summary": " Debot handle which references an instance of debot engine.", - "description": " Debot handle which references an instance of debot engine." + "summary": "Debot handle which references an instance of debot engine.", + "description": null }, { "name": "action", "type": "Ref", "ref_name": "debot.DebotAction", - "summary": " Debot Action that must be executed.", - "description": " Debot Action that must be executed." + "summary": "Debot Action that must be executed.", + "description": null } ], - "summary": " [UNSTABLE](UNSTABLE.md) Parameters for executing debot action.", - "description": " [UNSTABLE](UNSTABLE.md) Parameters for executing debot action." + "summary": "[UNSTABLE](UNSTABLE.md) Parameters for executing debot action.", + "description": null } ], "functions": [ { "name": "start", - "summary": " [UNSTABLE](UNSTABLE.md) Starts an instance of debot.", - "description": " [UNSTABLE](UNSTABLE.md) Starts an instance of debot.\n \n Downloads debot smart contract from blockchain and switches it to\n context zero.\n Returns a debot handle which can be used later in `execute` function.\n This function must be used by Debot Browser to start a dialog with debot.\n While the function is executing, several Browser Callbacks can be called,\n since the debot tries to display all actions from the context 0 to the user.\n \n # Remarks\n `start` is equivalent to `fetch` + switch to context 0.", + "summary": "[UNSTABLE](UNSTABLE.md) Starts an instance of debot.", + "description": "Downloads debot smart contract from blockchain and switches it to\ncontext zero.\nReturns a debot handle which can be used later in `execute` function.\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\n# Remarks\n`start` is equivalent to `fetch` + switch to context 0.", "params": [ { "name": "context", @@ -6813,8 +6813,8 @@ }, { "name": "fetch", - "summary": " [UNSTABLE](UNSTABLE.md) Fetches debot from blockchain.", - "description": " [UNSTABLE](UNSTABLE.md) Fetches debot from blockchain.\n \n Downloads debot smart contract (code and data) from blockchain and creates \n an instance of Debot Engine for it.\n \n # Remarks\n It does not switch debot to context 0. Browser Callbacks are not called.", + "summary": "[UNSTABLE](UNSTABLE.md) Fetches debot from blockchain.", + "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": [ { "name": "context", @@ -6868,8 +6868,8 @@ }, { "name": "execute", - "summary": " [UNSTABLE](UNSTABLE.md) Executes debot action.", - "description": " [UNSTABLE](UNSTABLE.md) Executes debot action.\n \n Calls debot engine referenced by debot handle to execute input action.\n Calls Debot Browser Callbacks if needed.\n \n # Remarks\n Chain of actions can be executed if input action generates a list of subactions.", + "summary": "[UNSTABLE](UNSTABLE.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": [ { "name": "context", @@ -6905,8 +6905,8 @@ }, { "name": "remove", - "summary": " [UNSTABLE](UNSTABLE.md) Destroys debot handle.", - "description": " [UNSTABLE](UNSTABLE.md) Destroys debot handle.\n \n Removes handle from Client Context and drops debot engine referenced by that handle.", + "summary": "[UNSTABLE](UNSTABLE.md) Destroys debot handle.", + "description": "Removes handle from Client Context and drops debot engine referenced by that handle.", "params": [ { "name": "context", diff --git a/tools/api.ts b/tools/api.ts index f64eeefaf..5c950f556 100644 --- a/tools/api.ts +++ b/tools/api.ts @@ -143,6 +143,11 @@ export type ApiError = { data?: any, } +export type Documented = { + summary?: string, + description?: string, +} + export function parseApi(json: any): Api { const api: Api = json; const types = new Map(); @@ -305,15 +310,15 @@ export abstract class Code { abstract module(module: ApiModule): string; - abstract field(field: ApiField, indent: string): string; + abstract field(field: ApiField, indent: string, includeDoc?: boolean): string; - abstract typeVariant(variant: ApiField, indent: string): string; + abstract typeVariant(variant: ApiField, indent: string, includeDoc?: boolean): string; - abstract constVariant(variant: ApiConst): string; + abstract constVariant(variant: ApiConst, includeDoc?: boolean): string; - abstract type(type: ApiType, indent: string): string; + abstract type(type: ApiType, indent: string, includeDoc?: boolean): string; - abstract typeDef(type: ApiField): string; + abstract typeDef(type: ApiField, includeDoc?: boolean): string; abstract functionImpl(func: ApiFunction): string; diff --git a/tools/docs.ts b/tools/docs.ts index 06d023d37..34411e936 100644 --- a/tools/docs.ts +++ b/tools/docs.ts @@ -10,108 +10,24 @@ import { ApiType, ApiTypeIs, Code, -} from './api'; - -type Doc = { - summary: string, - description: string, -} - -type Documented = { - summary?: string, - description?: string, -} - -function replaceTabs(s: string): string { - return s.split('\t').join(' ').trimRight(); -} - -function getLeadingSpaces(s: string): number { - let count = 0; - while (count < s.length && s[count] === ' ') { - count += 1; - } - return count; -} - -function reduceLines(lines: string[]) { - if (lines.length === 0) { - return; - } - let minLeadingSpaces: number | null = null; - for (let i = 0; i < lines.length; i += 1) { - const line = replaceTabs(lines[i]); - lines[i] = line; - if (line) { - const leadingSpaces = getLeadingSpaces(line); - if (minLeadingSpaces === null || leadingSpaces < minLeadingSpaces) { - minLeadingSpaces = leadingSpaces; - } - } - } - if (minLeadingSpaces !== null && minLeadingSpaces > 0) { - for (let i = 0; i < lines.length; i += 1) { - if (lines[i]) { - lines[i] = lines[i].substr(minLeadingSpaces); - } - } - } -} - -function getDoc(element: Documented): Doc { - if (!element.description || element.description.trim() === '') { - return { - summary: element.summary ?? '', - description: '', - }; - } - const lines = element.description.split('\n'); - reduceLines(lines); - let summary = ''; - let summaryComplete = false; - let description = ''; - for (let i = 0; i < lines.length; i += 1) { - const line = lines[i]; - if (summaryComplete) { - if (line || description) { - description += `${line}\n`; - } - } else if (line) { - if (summary) { - summary += ' '; - } - summary += line; - } else { - if (summary) { - summaryComplete = true; - } - } - - } - return { - summary, - description: description.trim(), - }; -} + Documented, +} from "./api"; function summaryOf(element: Documented): string { - const doc = getDoc(element); - return doc.summary ? ` – ${doc.summary}` : ''; + return element.summary ? ` – ${element.summary}` : ""; } function descriptionOf(element: Documented): string { - const doc = getDoc(element); - return doc.description ? `
${doc.description.split('\n').join('
')}\n` : ''; + return element.description ? `
${element.description.split("\n").join("
")}\n` : ""; } function docOf(element: Documented): string { - const doc = getDoc(element); - let md = ''; - if (doc.summary) { - md += `${doc.summary}\n\n`; + let md = ""; + if (element.summary) { + md += `${element.summary}\n\n`; } - if (doc.description) { - md += `${doc.description}\n\n`; + if (element.description) { + md += `${element.description}\n\n`; } return md; } @@ -121,11 +37,11 @@ function moduleFile(module: ApiModule): string { } function funcRef(func: ApiFunction, module?: ApiModule): string { - return `[${func.name}](${module ? moduleFile(module) : ''}#${func.name})`; + return `[${func.name}](${module ? moduleFile(module) : ""}#${func.name})`; } function typeRef(t: ApiField, module?: ApiModule): string { - return `[${t.name}](${module ? moduleFile(module) : ''}#${t.name})`; + return `[${t.name}](${module ? moduleFile(module) : ""}#${t.name})`; } @@ -138,15 +54,15 @@ export class Docs extends Code { } language(): string { - return 'md'; + return "md"; } typeDef(type: ApiField) { - let md = ''; + let md = ""; md += `## ${type.name}\n`; md += docOf(type); md += `\`\`\`${this.code.language()}\n${this.code.typeDef(type)}\`\`\`\n`; - md += this.type(type, ''); + md += this.type(type, ""); return md; } @@ -167,7 +83,7 @@ export class Docs extends Code { case ApiTypeIs.EnumOfConsts: return this.enumOfConsts(type); } - return ''; + return ""; } tupleFields(variant: ApiStruct, indent: string): ApiField[] { @@ -184,7 +100,7 @@ export class Docs extends Code { return [ { ...innerType, - name: 'value', + name: "value", }, ]; } @@ -204,7 +120,7 @@ export class Docs extends Code { const fields = this.structFields(variant, indent); let fieldsDecl: string; if (fields.length === 0) { - fieldsDecl = ''; + fieldsDecl = ""; } else { fieldsDecl = `\n${this.typeFields(fields)}`; } @@ -218,7 +134,7 @@ export class Docs extends Code { } constVariant(variant: ApiConst): string { - let md = '- \`'; + let md = "- \`"; switch (variant.type) { case ApiConstValueIs.None: md += variant.name; @@ -235,44 +151,44 @@ export class Docs extends Code { fieldType(type: ApiType): string { switch (type.type) { case ApiTypeIs.Ref: - if (type.ref_name === 'Value') { - return 'any'; + if (type.ref_name === "Value") { + return "any"; } - const parts = type.ref_name.split('.'); + const parts = type.ref_name.split("."); return parts.length === 2 ? `[${parts[1]}](mod_${parts[0]}.md#${parts[1]})` : type.ref_name; case ApiTypeIs.Optional: return `${this.fieldType(type.optional_inner)}?`; case ApiTypeIs.Struct: - return 'struct'; + return "struct"; case ApiTypeIs.EnumOfTypes: - return 'enum'; + return "enum"; case ApiTypeIs.EnumOfConsts: - return 'const'; + return "const"; case ApiTypeIs.Array: return `${this.fieldType(type.array_item)}[]`; case ApiTypeIs.String: - return 'string'; + return "string"; case ApiTypeIs.Any: - return 'any'; + return "any"; case ApiTypeIs.Boolean: - return 'boolean'; + return "boolean"; case ApiTypeIs.Number: - return 'number'; + return "number"; case ApiTypeIs.Generic: return `${type.generic_name}<${this.fieldType(type.generic_args[0])}>`; case ApiTypeIs.BigInt: - return 'bigint'; + return "bigint"; case ApiTypeIs.None: - return 'void'; + return "void"; default: - return ''; + return ""; } } field(field: ApiField): string { - const opt = field.type === ApiTypeIs.Optional ? '?' : ''; + const opt = field.type === ApiTypeIs.Optional ? "?" : ""; const type = field.type === ApiTypeIs.Optional ? field.optional_inner : field; const name = `\`${field.name}\`${opt}: `; let md = `- ${name}_${this.fieldType(type)}_${summaryOf(field)}\n`; @@ -285,11 +201,11 @@ export class Docs extends Code { } functionInterface(func: ApiFunction) { - let md = ''; + let md = ""; md += `## ${func.name}\n\n`; md += docOf(func); const funcInfo = this.getFunctionInfo(func); - let code = ''; + let code = ""; if (funcInfo.params) { const params = this.resolveRef(funcInfo.params); if (params) { @@ -304,50 +220,50 @@ export class Docs extends Code { md += `\`\`\`${this.code.language()}\n${code}\n\`\`\`\n`; if (funcInfo.params || funcInfo.hasResponseHandler) { - md += '### Parameters\n'; + md += "### Parameters\n"; if (funcInfo.params) { - md += this.type(funcInfo.params, ''); + md += this.type(funcInfo.params, ""); } if (funcInfo.hasResponseHandler) { md += `- \`responseHandler\`?: _ResponseHandler_ – additional responses handler.`; } } - md += '### Result\n\n'; - md += this.type(func.result, ''); + md += "### Result\n\n"; + md += this.type(func.result, ""); return md; } module(module: ApiModule) { - let md = ''; + let md = ""; md += `# Module ${module.name}\n\n`; md += module.description; - md += '\n## Functions\n'; + md += "\n## Functions\n"; for (const func of module.functions) { md += `${funcRef(func)}${summaryOf(func)}\n\n`; } - md += '## Types\n'; + md += "## Types\n"; for (const type of module.types) { md += `${typeRef(type)}${summaryOf(type)}\n\n`; } - md += '\n# Functions\n'; + md += "\n# Functions\n"; for (const func of module.functions) { md += this.functionInterface(func); - md += '\n\n'; + md += "\n\n"; } - md += '# Types\n'; + md += "# Types\n"; for (const func of module.types) { md += this.typeDef(func); - md += '\n\n'; + md += "\n\n"; } return md; } modules(): string { - let md = ''; - md += '# Modules\n'; + let md = ""; + md += "# Modules\n"; for (const module of this.api.modules) { md += `## [${module.name}](${moduleFile(module)})${summaryOf(module)}\n\n`; for (const func of module.functions) { @@ -363,7 +279,7 @@ export class Docs extends Code { } private typeFields(fields: ApiField[]): string { - let md = ''; + let md = ""; for (const field of fields) { md += this.field(field); } @@ -372,13 +288,13 @@ export class Docs extends Code { private enumOfTypes(type: ApiEnumOfTypes, indent: string) { let md = `Depends on value of the \`type\` field.\n\n`; - md += type.enum_types.map(v => this.typeVariant(v, indent)).join('\n'); + md += type.enum_types.map(v => this.typeVariant(v, indent)).join("\n"); return md; } private enumOfConsts(type: ApiEnumOfConsts) { let md = `One of the following value:\n\n`; - md += type.enum_consts.map(c => this.constVariant(c)).join(''); + md += type.enum_consts.map(c => this.constVariant(c)).join(""); return md; } } diff --git a/tools/ts-code.ts b/tools/ts-code.ts index 5adec1b3b..e8205da9e 100644 --- a/tools/ts-code.ts +++ b/tools/ts-code.ts @@ -24,8 +24,10 @@ import { ApiType, ApiTypeIs, Code, -} from './api'; + Documented, +} from "./api"; +const INDENT = " "; const MODULES_HEADER = ` import {ResponseHandler} from "./bin"; @@ -41,15 +43,15 @@ interface IClient { `; function isValidIdentFirstChar(c: string): boolean { - return c >= 'A' && c <= 'Z' || c >= 'a' && c <= 'z' || c === '_'; + return c >= "A" && c <= "Z" || c >= "a" && c <= "z" || c === "_"; } function isValidIdentChar(c: string): boolean { - return isValidIdentFirstChar(c) || (c >= '0' && c <= '9'); + return isValidIdentFirstChar(c) || (c >= "0" && c <= "9"); } function fixFieldName(name: string): string { - let isValidIdent = name !== '' && isValidIdentFirstChar(name[0]); + let isValidIdent = name !== "" && isValidIdentFirstChar(name[0]); if (isValidIdent) { for (let i = 1; i < name.length; i += 1) { if (!isValidIdentChar(name[i])) { @@ -58,24 +60,53 @@ function fixFieldName(name: string): string { } } } - return isValidIdent ? name : `'${name.split('\'').join('\\\'')}'`; + return isValidIdent ? name : `'${name.split("'").join("\\'")}'`; } function typeName(fullName: string) { - const parts = fullName.split('.'); + const parts = fullName.split("."); return parts[parts.length - 1]; } +function jsDocStart(element: Documented, indent: string = ""): string { + let ts = `\n${indent}/**`; + if (element.summary) { + ts += jsDoc(element.summary, indent); + } + if (element.description) { + ts += jsDoc("", indent); + ts += jsDoc("@remarks", indent); + ts += jsDoc(element.description, indent); + } + return ts; +} + +function jsDoc(text: string, indent: string = ""): string { + return `\n${text.split("\n").map(x => `${indent} * ${x}`).join("\n")}`; +} + +function jsDocEnd(indent: string = ""): string { + return `\n${indent} */`; +} + +function elementJsDoc(element: Documented, indent: string = ""): string { + return `${jsDocStart(element, indent)}${jsDocEnd(indent)}`; +} + +function getRefName(type: ApiType): string { + return type.type === ApiTypeIs.Ref ? type.ref_name.split(".")[1] : ""; +} + export class TSCode extends Code { language(): string { - return 'ts'; + return "ts"; } module(module: ApiModule): string { let ts = `// ${module.name} module\n\n`; for (const type of module.types) { - ts += `\nexport ${this.typeDef(type)}`; + ts += `\nexport ${this.typeDef(type, true)}`; if (type.type === ApiTypeIs.EnumOfTypes) { ts += this.typeVariantConstructors(type.name, type); } @@ -87,13 +118,14 @@ export class TSCode extends Code { if (functionInfo.appObject && !generatedAppObjects.has(functionInfo.appObject.name)) { generatedAppObjects.add(functionInfo.appObject.name); ts += this.appObjectInterface(functionInfo.appObject); - ts += '\n'; + ts += "\n"; ts += this.appObjectDispatchImpl(functionInfo.appObject); } } + ts += elementJsDoc(module); ts += ` -\nexport class ${Code.upperFirst(module.name)}Module { +export class ${Code.upperFirst(module.name)}Module { client: IClient; constructor(client: IClient) { @@ -102,22 +134,36 @@ export class TSCode extends Code { `; for (const func of module.functions) { + ts += jsDocStart(func, INDENT); + const info = this.getFunctionInfo(func); + if (info.params) { + ts += jsDoc("", INDENT); + ts += jsDoc(`@param {${getRefName(info.params)}} ${info.params.name}`, INDENT); + } + ts += jsDoc(`@returns ${getRefName(func.result)}`, INDENT); + ts += jsDocEnd(INDENT); ts += this.functionImpl(func); } - ts += '}\n\n'; + ts += "}\n\n"; return ts; } - field(field: ApiField, indent: string): string { - const name = `${fixFieldName(field.name)}${field.type === ApiTypeIs.Optional ? '?' : ''}`; + field(field: ApiField, indent: string, includeDoc?: boolean): string { + const name = `${fixFieldName(field.name)}${field.type === ApiTypeIs.Optional ? "?" : ""}`; const type = field.type === ApiTypeIs.Optional ? field.optional_inner : field; - return `${indent}${name}: ${this.type(type, indent)}`; + let ts = ""; + if (includeDoc) { + ts += elementJsDoc(field, indent); + ts += "\n"; + } + ts += `${indent}${name}: ${this.type(type, indent)}`; + return ts; } - fields(fields: ApiField[], indent: string): string { - return fields.map(f => this.field(f, indent)).join(',\n'); + fields(fields: ApiField[], indent: string, includeDoc?: boolean): string { + return fields.map(f => this.field(f, indent, includeDoc)).join(",\n"); } typeVariantStructFields(variant: ApiStruct, _indent: string): ApiField[] { @@ -128,16 +174,16 @@ export class TSCode extends Code { return fields; } - typeVariant(variant: ApiField, indent: string): string { + typeVariant(variant: ApiField, indent: string, includeDoc?: boolean): string { if (variant.type === ApiTypeIs.Ref) { return `({\n${indent} type: '${variant.name}'\n${indent}} & ${typeName(variant.ref_name)})`; } else if (variant.type === ApiTypeIs.Struct) { const fields = this.typeVariantStructFields(variant, indent); let fieldsDecl: string; if (fields.length === 0) { - fieldsDecl = ''; + fieldsDecl = ""; } else { - fieldsDecl = `\n${this.fields(fields, `${indent} `)}`; + fieldsDecl = `\n${this.fields(fields, `${indent} `, includeDoc)}`; } return `{\n${indent} type: '${variant.name}'${fieldsDecl}\n${indent}}`; } else if (variant.type === ApiTypeIs.None) { @@ -147,69 +193,69 @@ export class TSCode extends Code { } } - constVariant(variant: ApiConst): string { + constVariant(variant: ApiConst, _includeDoc?: boolean): string { switch (variant.type) { - case ApiConstValueIs.String: - return `'${variant.value}'`; - case ApiConstValueIs.None: - return `'${variant.name}'`; - case ApiConstValueIs.Bool: - return variant.value; - case ApiConstValueIs.Number: - return variant.value; - default: - return ''; + case ApiConstValueIs.String: + return `'${variant.value}'`; + case ApiConstValueIs.None: + return `'${variant.name}'`; + case ApiConstValueIs.Bool: + return variant.value; + case ApiConstValueIs.Number: + return variant.value; + default: + return ""; } } - type(type: ApiType, indent: string): string { + type(type: ApiType, indent: string, includeDoc?: boolean): string { switch (type.type) { - case ApiTypeIs.None: - return 'void'; - case ApiTypeIs.Ref: - if (type.ref_name === 'Value' || type.ref_name === 'API') { - return 'any'; - } - return typeName(type.ref_name); - case ApiTypeIs.Optional: - return `${this.type(type.optional_inner, indent)} | null`; - case ApiTypeIs.Struct: - const fields = type.struct_fields; - return `{\n${this.fields(fields, `${indent} `)}\n${indent}}`; - case ApiTypeIs.EnumOfTypes: - return type.enum_types.map(x => this.typeVariant(x, indent)).join(' | '); - case ApiTypeIs.Array: - return `${this.type(type.array_item, indent)}[]`; - case ApiTypeIs.EnumOfConsts: - return type.enum_consts.map(c => this.constVariant(c)).join(' | '); - case ApiTypeIs.BigInt: - return 'bigint'; - case ApiTypeIs.Any: - return 'any'; - case ApiTypeIs.String: - return 'string'; - case ApiTypeIs.Number: - return 'number'; - case ApiTypeIs.Boolean: - return 'boolean'; - default: - return type.type; + case ApiTypeIs.None: + return "void"; + case ApiTypeIs.Ref: + if (type.ref_name === "Value" || type.ref_name === "API") { + return "any"; + } + return typeName(type.ref_name); + case ApiTypeIs.Optional: + return `${this.type(type.optional_inner, indent, includeDoc)} | null`; + case ApiTypeIs.Struct: + const fields = type.struct_fields; + return `{\n${this.fields(fields, `${indent} `, includeDoc)}\n${indent}}`; + case ApiTypeIs.EnumOfTypes: + return type.enum_types.map(x => this.typeVariant(x, indent, includeDoc)).join(" | "); + case ApiTypeIs.Array: + return `${this.type(type.array_item, indent)}[]`; + case ApiTypeIs.EnumOfConsts: + return type.enum_consts.map(c => this.constVariant(c, includeDoc)).join(" | "); + case ApiTypeIs.BigInt: + return "bigint"; + case ApiTypeIs.Any: + return "any"; + case ApiTypeIs.String: + return "string"; + case ApiTypeIs.Number: + return "number"; + case ApiTypeIs.Boolean: + return "boolean"; + default: + return type.type; } } - typeDef(type: ApiField): string { - return `type ${type.name} = ${this.type(type, '')};\n`; + typeDef(type: ApiField, includeDoc?: boolean): string { + return `type ${type.name} = ${this.type(type, "", includeDoc)};\n`; } paramsDecls(paramsInfo: ApiFunctionInfo): string[] { const decls: string[] = []; if (paramsInfo.params) { - decls.push(`${paramsInfo.params.name}: ${this.type(paramsInfo.params, '')}`); + decls.push(`${paramsInfo.params.name}: ${this.type(paramsInfo.params, "")}`); } if (paramsInfo.appObject) { decls.push(`obj: ${paramsInfo.appObject.name}`); } else if (paramsInfo.hasResponseHandler) { - decls.push('responseHandler?: ResponseHandler'); + decls.push("responseHandler?: ResponseHandler"); } return decls; } @@ -218,27 +264,27 @@ export class TSCode extends Code { const paramsInfo = this.getFunctionInfo(func); const paramsDecls = this.paramsDecls(paramsInfo); const paramsDecl = paramsDecls.length > 0 ? `\n${paramsDecls.map(p => ` ${p},`) - .join('\n')}\n` : ''; - const resultDecl = this.type(func.result, ''); + .join("\n")}\n` : ""; + const resultDecl = this.type(func.result, ""); return `function ${func.name}(${paramsDecl}): Promise<${resultDecl}>;`; } appObjectInterface(obj: ApiModule): string { - let ts = ''; + let ts = ""; for (const type of obj.types) { - ts += '\n'; + ts += "\n"; ts += this.typeDef(type); } ts += `\nexport interface ${obj.name} {`; for (const f of obj.functions) { - const isNotify = (f.result.type === ApiTypeIs.Ref) && f.result.ref_name === ''; + const isNotify = (f.result.type === ApiTypeIs.Ref) && f.result.ref_name === ""; const paramsInfo = this.getFunctionInfo(f); const paramsDecls = this.paramsDecls(paramsInfo); - const paramsDecl = paramsDecls.length > 0 ? `${paramsDecls.join(', ')}` : ''; - const resultDecl = !isNotify ? `: Promise<${this.type(f.result, '')}>` : ': void'; + const paramsDecl = paramsDecls.length > 0 ? `${paramsDecls.join(", ")}` : ""; + const resultDecl = !isNotify ? `: Promise<${this.type(f.result, "")}>` : ": void"; ts += `\n ${f.name}(${paramsDecl})${resultDecl},`; } - ts += '\n}'; + ts += "\n}"; return ts; } @@ -249,19 +295,19 @@ async function dispatch${obj.name}(obj: ${obj.name}, params: ParamsOf${obj.name} let result = {}; switch (params.type) {`; for (const f of obj.functions) { - const isNotify = (f.result.type === ApiTypeIs.Ref) && f.result.ref_name === ''; - let assignment = ''; + const isNotify = (f.result.type === ApiTypeIs.Ref) && f.result.ref_name === ""; + let assignment = ""; if (!isNotify) { if (f.result.type !== ApiTypeIs.None) { - assignment = 'result = await '; + assignment = "result = await "; } else { - assignment = 'await '; + assignment = "await "; } } ts += ` - case '${TSCode.pascal(f.name.split('_'))}': - ${assignment}obj.${f.name}(${f.params.length > 0 ? 'params' : ''}); - break;` + case '${TSCode.pascal(f.name.split("_"))}': + ${assignment}obj.${f.name}(${f.params.length > 0 ? "params" : ""}); + break;`; } ts += ` } @@ -276,14 +322,14 @@ async function dispatch${obj.name}(obj: ${obj.name}, params: ParamsOf${obj.name} functionImpl(func: ApiFunction): string { const paramsInfo = this.getFunctionInfo(func); - const paramsDecl = this.paramsDecls(paramsInfo).map(p => `${p}`).join(', '); + const paramsDecl = this.paramsDecls(paramsInfo).map(p => `${p}`).join(", "); const calls = [`'${func.module.name}.${func.name}'`]; if (paramsInfo.params) { calls.push(`${paramsInfo.params.name}`); } if (paramsInfo.appObject) { if (!paramsInfo.params) { - calls.push('undefined'); + calls.push("undefined"); } calls.push(`(params: any, responseType: number) => { if (responseType === 3) { @@ -294,44 +340,44 @@ async function dispatch${obj.name}(obj: ${obj.name}, params: ParamsOf${obj.name} }`); } else if (paramsInfo.hasResponseHandler) { if (!paramsInfo.params) { - calls.push('undefined'); + calls.push("undefined"); } - calls.push('responseHandler'); + calls.push("responseHandler"); } return ` - ${func.name}(${paramsDecl}): Promise<${this.type(func.result, '')}> { - return this.client.request(${calls.join(', ')}); + ${func.name}(${paramsDecl}): Promise<${this.type(func.result, "")}> { + return this.client.request(${calls.join(", ")}); }\n`; } modules(): string { return ` ${MODULES_HEADER} -${this.api.modules.map(m => this.module(m)).join('')} +${this.api.modules.map(m => this.module(m)).join("")} `; } private typeVariantConstructors(enumName: string, type: ApiEnumOfTypes): string { - let ts = ''; + let ts = ""; for (const variant of type.enum_types) { - let params = ''; - let properties = ''; + let params = ""; + let properties = ""; switch (variant.type) { - case ApiTypeIs.Ref: - params = `params: ${typeName(variant.ref_name)}`; - properties = ` ...params,\n`; - break; - case ApiTypeIs.Struct: - const fields = variant.struct_fields; - for (const field of fields) { - if (params !== '') { - params += ', '; - } - params += `${this.field(field, '')}`; - properties += ` ${fixFieldName(field.name)},\n`; - + case ApiTypeIs.Ref: + params = `params: ${typeName(variant.ref_name)}`; + properties = ` ...params,\n`; + break; + case ApiTypeIs.Struct: + const fields = variant.struct_fields; + for (const field of fields) { + if (params !== "") { + params += ", "; } - break; + params += `${this.field(field, "")}`; + properties += ` ${fixFieldName(field.name)},\n`; + + } + break; } ts += `\nexport function ${TSCode.lowerFirst(enumName)}${variant.name}(${params}): ${enumName} {\n`; From 745de8cfbce22b38f769ee85e8f64bd7cfc00758 Mon Sep 17 00:00:00 2001 From: Michael Vlasov Date: Tue, 8 Dec 2020 15:13:15 +0500 Subject: [PATCH 15/15] CHANGELOG.md --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a945802ec..e6ac5ed61 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ All notable changes to this project will be documented in this file. ### Featured - `net.query` method . Performs custom graphql query that can be copied directly from the playground. - `net.suspend` and `net.resume` methods for disabling and enabling network activity. One of the possible use-cases is to manage subscriptions when a mobile application is brought to the background and into the foreground again. +- Smart summary and description doc separation. +- ts-generator includes doc comments in JSDoc format. ## 1.2.0 Nov 26, 2020