Module client
Last updated
Was this helpful?
Last updated
Was this helpful?
Provides information about library.
– Returns Core Library API reference
– Returns Core Library version
– Returns Core Library API reference
– Returns detailed information about this build.
– Resolves application request processing result
– Network protocol used to perform GraphQL queries.
Returns Core Library API reference
NOTE: Sync version is available only for lib-node
binding.
api
: API
Returns Core Library version
NOTE: Sync version is available only for lib-node
binding.
version
: string – Core Library version
Returns Core Library API reference
NOTE: Sync version is available only for lib-node
binding.
local_storage_path
?: string – For file based storage is a folder name where SDK will store its data. For browser based is a browser async storage key prefix. Default (recommended) value is "~/.tonclient" for native environments and ".tonclient" for web-browser.
Returns detailed information about this build.
NOTE: Sync version is available only for lib-node
binding.
build_number
: number – Build number assigned to this build by the CI.
Resolves application request processing result
NOTE: Sync version is available only for lib-node
binding.
app_request_id
: number – Request ID received from SDK
One of the following value:
NotImplemented = 1
InvalidHex = 2
InvalidBase64 = 3
InvalidAddress = 4
CallbackParamsCantBeConvertedToJson = 5
WebsocketConnectError = 6
WebsocketReceiveError = 7
WebsocketSendError = 8
HttpClientCreateError = 9
HttpRequestCreateError = 10
HttpRequestSendError = 11
HttpRequestParseError = 12
CallbackNotRegistered = 13
NetModuleNotInit = 14
InvalidConfig = 15
CannotCreateRuntime = 16
InvalidContextHandle = 17
CannotSerializeResult = 18
CannotSerializeError = 19
CannotConvertJsValueToJson = 20
CannotReceiveSpawnedResult = 21
SetTimerError = 22
InvalidParams = 23
ContractsAddressConversionFailed = 24
UnknownFunction = 25
AppRequestError = 26
NoSuchRequest = 27
CanNotSendRequestResult = 28
CanNotReceiveRequestResult = 29
CanNotParseRequestResult = 30
UnexpectedCallbackResponse = 31
CanNotParseNumber = 32
InternalError = 33
InvalidHandle = 34
LocalStorageError = 35
InvalidData = 36
code
: number
message
: string
data
: any
local_storage_path
?: string – For file based storage is a folder name where SDK will store its data. For browser based is a browser async storage key prefix. Default (recommended) value is "~/.tonclient" for native environments and ".tonclient" for web-browser.
server_address
?: string – This field is deprecated, but left for backward-compatibility. Evernode endpoint.
network_retries_count
?: number – Deprecated.
You must use network.max_reconnect_timeout
that allows to specify maximum network resolving timeout.
max_reconnect_timeout
?: number – Maximum time for sequential reconnections.
Must be specified in milliseconds. Default is 120000 (2 min).
reconnect_timeout
?: number – Deprecated
message_retries_count
?: number – The number of automatic message processing retries that SDK performs in case of Message Expired (507)
error - but only for those messages which local emulation was successful or failed with replay protection error.
Default is 5.
message_processing_timeout
?: number – Timeout that is used to process message delivery for the contracts which ABI does not include "expire" header. If the message is not delivered within the specified timeout the appropriate error occurs.
Must be specified in milliseconds. Default is 40000 (40 sec).
wait_for_timeout
?: number – Maximum timeout that is used for query response.
Must be specified in milliseconds. Default is 40000 (40 sec).
out_of_sync_threshold
?: number – DEPRECATED: This parameter was deprecated.
sending_endpoint_count
?: number – Maximum number of randomly chosen endpoints the library uses to broadcast a message.
Default is 1.
latency_detection_interval
?: number – Frequency of sync latency detection.
Library periodically checks the current endpoint for blockchain data synchronization latency.
If the latency (time-lag) is less then NetworkConfig.max_latency
then library selects another endpoint.
Must be specified in milliseconds. Default is 60000 (1 min).
max_latency
?: number – Maximum value for the endpoint's blockchain data synchronization latency (time-lag). Library periodically checks the current endpoint for blockchain data synchronization latency. If the latency (time-lag) is less then NetworkConfig.max_latency
then library selects another endpoint.
Must be specified in milliseconds. Default is 60000 (1 min).
query_timeout
?: number – Default timeout for http requests.
Is is used when no timeout specified for the request to limit the answer waiting time. If no answer received during the timeout requests ends with
error.
Must be specified in milliseconds. Default is 60000 (1 min).
first_remp_status_timeout
?: number – UNSTABLE.
First REMP status awaiting timeout. If no status received during the timeout than fallback transaction scenario is activated.
Must be specified in milliseconds. Default is 1 (1 ms) in order to start fallback scenario
together with REMP statuses processing while REMP is not properly tuned yet.
next_remp_status_timeout
?: number – UNSTABLE.
Subsequent REMP status awaiting timeout. If no status received during the timeout than fallback transaction scenario is activated.
Must be specified in milliseconds. Default is 5000 (5 sec).
signature_id
?: number – Network signature ID which is used by VM in signature verifying instructions if capability CapSignatureWithId
is enabled in blockchain configuration parameters.
This parameter should be set to global_id
field from any blockchain block if network can
not be reachable at the moment of message encoding and the message is aimed to be sent into
network with CapSignatureWithId
enabled. Otherwise signature ID is detected automatically
inside message encoding functions
access_key
?: string – Access key to GraphQL API (Project secret)
library
?: string
version
?: string
Network protocol used to perform GraphQL queries.
One of the following value:
HTTP = "HTTP"
– Each GraphQL query uses separate HTTP request.
WS = "WS"
– All GraphQL queries will be served using single web socket connection. SDK is tested to reliably handle 5000 parallel network requests (sending and processing messages, quering and awaiting blockchain data)
Crypto config.
mnemonic_word_count
?: number – Mnemonic word count that will be used by default in crypto functions. If not specified the default value will be 12.
hdkey_derivation_path
?: string – Derivation path that will be used by default in crypto functions. If not specified m/44'/396'/0'/0/0
will be used.
workchain
?: number – Workchain id that is used by default in DeploySet
message_expiration_timeout
?: number – Message lifetime for contracts which ABI includes "expire" header.
Must be specified in milliseconds. Default is 40000 (40 sec).
message_expiration_timeout_grow_factor
?: number – Factor that increases the expiration timeout for each retry
Default is 1.5
cache_max_size
?: number – Maximum BOC cache size in kilobytes.
Default is 10 MB
cache_in_local_storage
?: boolean – Cache proofs in the local storage.
Default is true
. If this value is set to true
, downloaded proofs and master-chain BOCs are saved into the
persistent local storage (e.g. file system for native environments or browser's IndexedDB
for the web); otherwise all the data is cached only in memory in current client's context
and will be lost after destruction of the client.
name
: string – Dependency name.
Usually it is a crate name.
git_commit
: string – Git commit hash of the related repository.
app_request_id
: number – Request ID.
Should be used in resolve_app_request
call
request_data
: any – Request describing data
Error occurred during request processing
text
: string – Error description
Request processed successfully
result
: any – Request processing result
Depends on value of the type
field.
When type is 'Error'
Error occurred during request processing
text
: string – Error description
When type is 'Ok'
Request processed successfully
result
: any – Request processing result
Variant constructors:
api
: API
version
: string – Core Library version
build_number
: number – Build number assigned to this build by the CI.
app_request_id
: number – Request ID received from SDK
– Crypto config.
– Error occurred during request processing
– Request processed successfully
binding
?:
network
?:
crypto
?:
abi
?:
boc
?:
proofs
?:
dependencies
: [] – Fingerprint of the most important dependencies.
result
: – Result of request processing
binding
?:
network
?:
crypto
?:
abi
?:
boc
?:
proofs
?:
endpoints
?: string[] – List of Evernode endpoints.
Any correct URL format can be specified, including IP addresses. This parameter is prevailing over server_address
.
Check the full list of .
queries_protocol
?: – Queries protocol.
HTTP
or WS
.
Default is HTTP
.
mnemonic_dictionary
?: – Mnemonic dictionary that will be used by default in crypto functions. If not specified, English
dictionary will be used.
dependencies
: [] – Fingerprint of the most important dependencies.
result
: – Result of request processing