Home

Awesome

Ruby Client for TVM SDK Toncoin, Everscale, Venom, Gosh

<p align="center"> <a href="https://github.com/venom-blockchain/developer-program"> <img src="https://raw.githubusercontent.com/venom-blockchain/developer-program/main/vf-dev-program.png" alt="Logo" width="366.8" height="146.4"> </a> </p>

GEM SPM

Get api keys and TVM endpoints:

You need to get an API-KEY here https://dashboard.evercloud.dev

Install

Install gem

gem install everscale-client-ruby

Install TON-SDK

result - path to dylib file for everscale-client-ruby configuration
everscale-client-ruby setup

Manual build TVM SDK

  1. Install Rust to your OS
  2. git clone https://github.com/tonlabs/ever-sdk
  3. cd ./ever-sdk
  4. cargo update
  5. cargo build --release

Usage

# For MAcOS
TonClient.configure { |config| config.ffi_lib(./ever-sdk/target/release/libton_client.dylib) }
# For Linux
# TonClient.configure { |config| config.ffi_lib(./ever-sdk/target/release/libton_client.so) }

client = TonClient.create(config: {network: {endpoints: ["https://eri01.net.everos.dev/YOUR-X-API-KEY", "https://rbx01.net.everos.dev/YOUR-X-API-KEY"]}})

# All methods are asynchronous

## example 1: call method for Crypto module
payload = {composite: '17ED48941A08F981'}

# Sync
response = client.crypto.factorize_sync(payload)
p response['result']['factors']

# Async
client.crypto.factorize(payload) do |response|
  p response.result['factors']
end


## example 2: parse message from boc base64 encoded
payload = {boc: "te6ccgEBAQEAWAAAq2n+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE/zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzSsG8DgAAAAAjuOu9NAL7BxYpA"}

# Sync
response = client.boc.parse_message_sync(payload)
p response['result']['parsed']['id']
p response['result']['parsed']['src']
p response['result']['parsed']['dst']

# Async
client.boc.parse_message(payload) do |response|
  p response.result['parsed']['id']
  p response.result['parsed']['src']
  p response.result['parsed']['dst']
end

# e.g. ...

All Modules, methods and types

<details> <summary>Types</summary>

Network protocol used to perform GraphQL queries.

Crypto Box Secret.

Interface that provides a callback that returns an encrypted password, used for cryptobox secret encryption# To secure the password while passing it from application to the library,the library generates a temporary key pair, passes the pubkeyto the passwordProvider, decrypts the received password with private key,and deletes the key pair right away.

Application should generate a temporary nacl_box_keypairand encrypt the password with naclbox function using nacl_box_keypair.secretand encryption_public_key keys + nonce = 24-byte prefix of encryption_public_key.

Signing box callbacks.

Returning values from signing box callbacks.

Interface for data encryption/decryption

Returning values from signing box callbacks.

Cell builder operation.

UNSTABLE Describes the operation that the DeBot wants to perform.

UNSTABLE Debot Browser callbacks# Called by debot engine to communicate with debot browser.

UNSTABLE Returning values from Debot Browser callbacks.

</details> <details> <summary>CLIENT</summary>
    # Returns Core Library API reference
    def get_api_reference(&block)

    # RESPONSE: ResultOfGetApiReference
    # api: Value - 
    # Returns Core Library version
    def version(&block)

    # RESPONSE: ResultOfVersion
    # version: String - Core Library version
    # Returns Core Library API reference
    def config(&block)

    # RESPONSE: ClientConfig
    # binding: BindingConfig<Optional> - 
    # network: NetworkConfig<Optional> - 
    # crypto: CryptoConfig<Optional> - 
    # abi: Value - 
    # boc: BocConfig<Optional> - 
    # proofs: ProofsConfig<Optional> - 
    # local_storage_path: String<Optional> - 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.
    def build_info(&block)

    # RESPONSE: ResultOfBuildInfo
    # build_number: Number - Build number assigned to this build by the CI.
    # dependencies: Array - Fingerprint of the most important dependencies.
    # Resolves application request processing result
    def resolve_app_request(payload, &block)
    # INPUT: ParamsOfResolveAppRequest
    # app_request_id: Number - Request ID received from SDK
    # result: AppRequestResult - Result of request processing
</details> <details> <summary>CRYPTO</summary>
    # Integer factorization    # Performs prime factorization – decomposition of a composite numberinto a product of smaller prime integers (factors).
    # See [https://en.wikipedia.org/wiki/Integer_factorization]
    def factorize(payload, &block)
    # INPUT: ParamsOfFactorize
    # composite: String - Hexadecimal representation of u64 composite number.

    # RESPONSE: ResultOfFactorize
    # factors: Array - Two factors of composite or empty if composite can't be factorized.
    # Modular exponentiation    # Performs modular exponentiation for big integers (`base`^`exponent` mod `modulus`).
    # See [https://en.wikipedia.org/wiki/Modular_exponentiation]
    def modular_power(payload, &block)
    # INPUT: ParamsOfModularPower
    # base: String - `base` argument of calculation.
    # exponent: String - `exponent` argument of calculation.
    # modulus: String - `modulus` argument of calculation.

    # RESPONSE: ResultOfModularPower
    # modular_power: String - Result of modular exponentiation
    # Calculates CRC16 using TON algorithm.
    def ton_crc16(payload, &block)
    # INPUT: ParamsOfTonCrc16
    # data: String - Input data for CRC calculation. Encoded with `base64`.

    # RESPONSE: ResultOfTonCrc16
    # crc: Number - Calculated CRC for input data.
    # Generates random byte array of the specified length and returns it in `base64` format
    def generate_random_bytes(payload, &block)
    # INPUT: ParamsOfGenerateRandomBytes
    # length: Number - Size of random byte array.

    # RESPONSE: ResultOfGenerateRandomBytes
    # bytes: String - Generated bytes encoded in `base64`.
    # Converts public key to ton safe_format
    def convert_public_key_to_ton_safe_format(payload, &block)
    # INPUT: ParamsOfConvertPublicKeyToTonSafeFormat
    # public_key: String - Public key - 64 symbols hex string

    # RESPONSE: ResultOfConvertPublicKeyToTonSafeFormat
    # ton_public_key: String - Public key represented in TON safe format.
    # Generates random ed25519 key pair.
    def generate_random_sign_keys(&block)

    # RESPONSE: KeyPair
    # public: String - Public key - 64 symbols hex string
    # secret: String - Private key - u64 symbols hex string
    # Signs a data using the provided keys.
    def sign(payload, &block)
    # INPUT: ParamsOfSign
    # unsigned: String - Data that must be signed encoded in `base64`.
    # keys: KeyPair - Sign keys.

    # RESPONSE: ResultOfSign
    # signed: String - Signed data combined with signature encoded in `base64`.
    # signature: String - Signature encoded in `hex`.
    # Verifies signed data using the provided public key. Raises error if verification is failed.
    def verify_signature(payload, &block)
    # INPUT: ParamsOfVerifySignature
    # signed: String - Signed data that must be verified encoded in `base64`.
    # public: String - Signer's public key - 64 symbols hex string

    # RESPONSE: ResultOfVerifySignature
    # unsigned: String - Unsigned data encoded in `base64`.
    # Calculates SHA256 hash of the specified data.
    def sha256(payload, &block)
    # INPUT: ParamsOfHash
    # data: String - Input data for hash calculation. Encoded with `base64`.

    # RESPONSE: ResultOfHash
    # hash: String - Hash of input `data`. Encoded with 'hex'.
    # Calculates SHA512 hash of the specified data.
    def sha512(payload, &block)
    # INPUT: ParamsOfHash
    # data: String - Input data for hash calculation. Encoded with `base64`.

    # RESPONSE: ResultOfHash
    # hash: String - Hash of input `data`. Encoded with 'hex'.
    # Perform `scrypt` encryption    # Derives key from `password` and `key` using `scrypt` algorithm.
    # See [https://en.wikipedia.org/wiki/Scrypt].
 Arguments- `log_n` - The log2 of the Scrypt parameter `N`- `r` - The Scrypt parameter `r`- `p` - The Scrypt parameter `p`# Conditions- `log_n` must be less than `64`- `r` must be greater than `0` and less than or equal to `4294967295`- `p` must be greater than `0` and less than `4294967295`# Recommended values sufficient for most use-cases- `log_n = 15` (`n = 32768`)- `r = 8`- `p = 1`
    def scrypt(payload, &block)
    # INPUT: ParamsOfScrypt
    # password: String - The password bytes to be hashed. Must be encoded with `base64`.
    # salt: String - Salt bytes that modify the hash to protect against Rainbow table attacks. Must be encoded with `base64`.
    # log_n: Number - CPU/memory cost parameter
    # r: Number - The block size parameter, which fine-tunes sequential memory read size and performance.
    # p: Number - Parallelization parameter.
    # dk_len: Number - Intended output length in octets of the derived key.

    # RESPONSE: ResultOfScrypt
    # key: String - Derived key. Encoded with `hex`.
    # Generates a key pair for signing from the secret key    # **NOTE:** In the result the secret key is actually the concatenationof secret and public keys (128 symbols hex string) by design of [NaCL](http://nacl.cr.yp.to/sign.html).
    # See also [the stackexchange question](https://crypto.stackexchange.com/questions/54353/).
    def nacl_sign_keypair_from_secret_key(payload, &block)
    # INPUT: ParamsOfNaclSignKeyPairFromSecret
    # secret: String - Secret key - unprefixed 0-padded to 64 symbols hex string

    # RESPONSE: KeyPair
    # public: String - Public key - 64 symbols hex string
    # secret: String - Private key - u64 symbols hex string
    # Signs data using the signer's secret key.
    def nacl_sign(payload, &block)
    # INPUT: ParamsOfNaclSign
    # unsigned: String - Data that must be signed encoded in `base64`.
    # secret: String - Signer's secret key - unprefixed 0-padded to 128 symbols hex string (concatenation of 64 symbols secret and 64 symbols public keys). See `nacl_sign_keypair_from_secret_key`.

    # RESPONSE: ResultOfNaclSign
    # signed: String - Signed data, encoded in `base64`.
    # Verifies the signature and returns the unsigned message    # Verifies the signature in `signed` using the signer's public key `public`and returns the message `unsigned`.
    # If the signature fails verification, crypto_sign_open raises an exception.
    def nacl_sign_open(payload, &block)
    # INPUT: ParamsOfNaclSignOpen
    # 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

    # RESPONSE: ResultOfNaclSignOpen
    # unsigned: String - Unsigned data, encoded in `base64`.
    # Signs the message using the secret key and returns a signature.    # Signs the message `unsigned` using the secret key `secret`and returns a signature `signature`.
    def nacl_sign_detached(payload, &block)
    # INPUT: ParamsOfNaclSign
    # unsigned: String - Data that must be signed encoded in `base64`.
    # secret: String - Signer's secret key - unprefixed 0-padded to 128 symbols hex string (concatenation of 64 symbols secret and 64 symbols public keys). See `nacl_sign_keypair_from_secret_key`.

    # RESPONSE: ResultOfNaclSignDetached
    # signature: String - Signature encoded in `hex`.
    # Verifies the signature with public key and `unsigned` data.
    def nacl_sign_detached_verify(payload, &block)
    # INPUT: ParamsOfNaclSignDetachedVerify
    # unsigned: String - Unsigned data that must be verified. Encoded with `base64`.
    # signature: String - Signature that must be verified. Encoded with `hex`.
    # public: String - Signer's public key - unprefixed 0-padded to 64 symbols hex string.

    # RESPONSE: ResultOfNaclSignDetachedVerify
    # succeeded: Boolean - `true` if verification succeeded or `false` if it failed
    # Generates a random NaCl key pair
    def nacl_box_keypair(&block)

    # RESPONSE: KeyPair
    # public: String - Public key - 64 symbols hex string
    # secret: String - Private key - u64 symbols hex string
    # Generates key pair from a secret key
    def nacl_box_keypair_from_secret_key(payload, &block)
    # INPUT: ParamsOfNaclBoxKeyPairFromSecret
    # secret: String - Secret key - unprefixed 0-padded to 64 symbols hex string

    # RESPONSE: KeyPair
    # public: String - Public key - 64 symbols hex string
    # secret: String - Private key - u64 symbols hex string
    # Public key authenticated encryption    # Encrypt and authenticate a message using the senders secret key, the receivers publickey, and a nonce.
    def nacl_box(payload, &block)
    # INPUT: ParamsOfNaclBox
    # decrypted: String - Data that must be encrypted encoded in `base64`.
    # nonce: String - Nonce, encoded in `hex`
    # their_public: String - Receiver's public key - unprefixed 0-padded to 64 symbols hex string
    # secret: String - Sender's private key - unprefixed 0-padded to 64 symbols hex string

    # RESPONSE: ResultOfNaclBox
    # encrypted: String - Encrypted data encoded in `base64`.
    # Decrypt and verify the cipher text using the receivers secret key, the senders public key, and the nonce.
    def nacl_box_open(payload, &block)
    # INPUT: ParamsOfNaclBoxOpen
    # encrypted: String - Data that must be decrypted. Encoded with `base64`.
    # nonce: String - Nonce
    # 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

    # RESPONSE: ResultOfNaclBoxOpen
    # decrypted: String - Decrypted data encoded in `base64`.
    # Encrypt and authenticate message using nonce and secret key.
    def nacl_secret_box(payload, &block)
    # INPUT: ParamsOfNaclSecretBox
    # 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

    # RESPONSE: ResultOfNaclBox
    # encrypted: String - Encrypted data encoded in `base64`.
    # Decrypts and verifies cipher text using `nonce` and secret `key`.
    def nacl_secret_box_open(payload, &block)
    # INPUT: ParamsOfNaclSecretBoxOpen
    # encrypted: String - Data that must be decrypted. Encoded with `base64`.
    # nonce: String - Nonce in `hex`
    # key: String - Secret key - unprefixed 0-padded to 64 symbols hex string

    # RESPONSE: ResultOfNaclBoxOpen
    # decrypted: String - Decrypted data encoded in `base64`.
    # Prints the list of words from the specified dictionary
    def mnemonic_words(payload, &block)
    # INPUT: ParamsOfMnemonicWords
    # dictionary: MnemonicDictionary - Dictionary identifier

    # RESPONSE: ResultOfMnemonicWords
    # words: String - The list of mnemonic words
    # Generates a random mnemonic    # Generates a random mnemonic from the specified dictionary and word count
    def mnemonic_from_random(payload, &block)
    # INPUT: ParamsOfMnemonicFromRandom
    # dictionary: MnemonicDictionary - Dictionary identifier
    # word_count: Number<Optional> - Mnemonic word count

    # RESPONSE: ResultOfMnemonicFromRandom
    # phrase: String - String of mnemonic words
    # Generates mnemonic from pre-generated entropy
    def mnemonic_from_entropy(payload, &block)
    # INPUT: ParamsOfMnemonicFromEntropy
    # entropy: String - Entropy bytes. Hex encoded.
    # dictionary: MnemonicDictionary - Dictionary identifier
    # word_count: Number<Optional> - Mnemonic word count

    # RESPONSE: ResultOfMnemonicFromEntropy
    # phrase: String - Phrase
    # Validates a mnemonic phrase    # The phrase supplied will be checked for word length and validated according to the checksumspecified in BIP0039.
    def mnemonic_verify(payload, &block)
    # INPUT: ParamsOfMnemonicVerify
    # phrase: String - Phrase
    # dictionary: MnemonicDictionary - Dictionary identifier
    # word_count: Number<Optional> - Word count

    # RESPONSE: ResultOfMnemonicVerify
    # valid: Boolean - Flag indicating if the mnemonic is valid or not
    # Derives a key pair for signing from the seed phrase    # Validates the seed phrase, generates master key and then derivesthe key pair from the master key and the specified path
    def mnemonic_derive_sign_keys(payload, &block)
    # INPUT: ParamsOfMnemonicDeriveSignKeys
    # phrase: String - Phrase
    # path: String<Optional> - Derivation path, for instance "m/44'/396'/0'/0/0"
    # dictionary: MnemonicDictionary - Dictionary identifier
    # word_count: Number<Optional> - Word count

    # RESPONSE: KeyPair
    # public: String - Public key - 64 symbols hex string
    # secret: String - Private key - u64 symbols hex string
    # Generates an extended master private key that will be the root for all the derived keys
    def hdkey_xprv_from_mnemonic(payload, &block)
    # INPUT: ParamsOfHDKeyXPrvFromMnemonic
    # phrase: String - String with seed phrase
    # dictionary: MnemonicDictionary - Dictionary identifier
    # word_count: Number<Optional> - Mnemonic word count

    # RESPONSE: ResultOfHDKeyXPrvFromMnemonic
    # xprv: String - Serialized extended master private key
    # Returns extended private key derived from the specified extended private key and child index
    def hdkey_derive_from_xprv(payload, &block)
    # INPUT: ParamsOfHDKeyDeriveFromXPrv
    # xprv: String - Serialized extended private key
    # child_index: Number - Child index (see BIP-0032)
    # hardened: Boolean - Indicates the derivation of hardened/not-hardened key (see BIP-0032)

    # RESPONSE: ResultOfHDKeyDeriveFromXPrv
    # xprv: String - Serialized extended private key
    # Derives the extended private key from the specified key and path
    def hdkey_derive_from_xprv_path(payload, &block)
    # INPUT: ParamsOfHDKeyDeriveFromXPrvPath
    # xprv: String - Serialized extended private key
    # path: String - Derivation path, for instance "m/44'/396'/0'/0/0"

    # RESPONSE: ResultOfHDKeyDeriveFromXPrvPath
    # xprv: String - Derived serialized extended private key
    # Extracts the private key from the serialized extended private key
    def hdkey_secret_from_xprv(payload, &block)
    # INPUT: ParamsOfHDKeySecretFromXPrv
    # xprv: String - Serialized extended private key

    # RESPONSE: ResultOfHDKeySecretFromXPrv
    # secret: String - Private key - 64 symbols hex string
    # Extracts the public key from the serialized extended private key
    def hdkey_public_from_xprv(payload, &block)
    # INPUT: ParamsOfHDKeyPublicFromXPrv
    # xprv: String - Serialized extended private key

    # RESPONSE: ResultOfHDKeyPublicFromXPrv
    # public: String - Public key - 64 symbols hex string
    # Performs symmetric `chacha20` encryption.
    def chacha20(payload, &block)
    # INPUT: ParamsOfChaCha20
    # 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`.

    # RESPONSE: ResultOfChaCha20
    # data: String - Encrypted/decrypted data. Encoded with `base64`.
    # Creates a Crypto Box instance.    # Crypto Box is a root crypto object, that encapsulates some secret (seed phrase usually)in encrypted form and acts as a factory for all crypto primitives used in SDK:
    # keys for signing and encryption, derived from this secret.
    # Crypto Box encrypts original Seed Phrase with salt and password that is retrievedfrom `password_provider` callback, implemented on Application side.
    # When used, decrypted secret shows up in core library's memory for a very short periodof time and then is immediately overwritten with zeroes.
    def create_crypto_box(payload, &block)
    # INPUT: ParamsOfCreateCryptoBox
    # secret_encryption_salt: String - Salt used for secret encryption. For example, a mobile device can use device ID as salt.
    # secret: CryptoBoxSecret - Cryptobox secret

    # RESPONSE: RegisteredCryptoBox
    # handle: CryptoBoxHandle - 
    # Removes Crypto Box. Clears all secret data.
    def remove_crypto_box(payload, &block)
    # INPUT: RegisteredCryptoBox
    # handle: CryptoBoxHandle - 
    # Get Crypto Box Info. Used to get `encrypted_secret` that should be used for all the cryptobox initializations except the first one.
    def get_crypto_box_info(payload, &block)
    # INPUT: RegisteredCryptoBox
    # handle: CryptoBoxHandle - 

    # RESPONSE: ResultOfGetCryptoBoxInfo
    # encrypted_secret: String - Secret (seed phrase) encrypted with salt and password.
    # Get Crypto Box Seed Phrase.    # Attention! Store this data in your application for a very short period of time and overwrite it with zeroes ASAP.
    def get_crypto_box_seed_phrase(payload, &block)
    # INPUT: RegisteredCryptoBox
    # handle: CryptoBoxHandle - 

    # RESPONSE: ResultOfGetCryptoBoxSeedPhrase
    # phrase: String - 
    # dictionary: MnemonicDictionary - 
    # wordcount: Number - 
    # Get handle of Signing Box derived from Crypto Box.
    def get_signing_box_from_crypto_box(payload, &block)
    # INPUT: ParamsOfGetSigningBoxFromCryptoBox
    # handle: Number - Crypto Box Handle.
    # hdpath: String<Optional> - HD key derivation path. By default, Everscale HD path is used.
    # secret_lifetime: Number<Optional> - Store derived secret for this lifetime (in ms). The timer starts after each signing box operation. Secrets will be deleted immediately after each signing box operation, if this value is not set.

    # RESPONSE: RegisteredSigningBox
    # handle: SigningBoxHandle - Handle of the signing box.
    # Gets Encryption Box from Crypto Box.    # Derives encryption keypair from cryptobox secret and hdpath andstores it in cache for `secret_lifetime`or until explicitly cleared by `clear_crypto_box_secret_cache` method.
    # If `secret_lifetime` is not specified - overwrites encryption secret with zeroes immediately afterencryption operation.
    def get_encryption_box_from_crypto_box(payload, &block)
    # INPUT: ParamsOfGetEncryptionBoxFromCryptoBox
    # handle: Number - Crypto Box Handle.
    # hdpath: String<Optional> - HD key derivation path. By default, Everscale HD path is used.
    # algorithm: BoxEncryptionAlgorithm - Encryption algorithm.
    # secret_lifetime: Number<Optional> - Store derived secret for encryption algorithm for this lifetime (in ms). The timer starts after each encryption box operation. Secrets will be deleted (overwritten with zeroes) after each encryption operation, if this value is not set.

    # RESPONSE: RegisteredEncryptionBox
    # handle: EncryptionBoxHandle - Handle of the encryption box.
    # Removes cached secrets (overwrites with zeroes) from all signing and encryption boxes, derived from crypto box.
    def clear_crypto_box_secret_cache(payload, &block)
    # INPUT: RegisteredCryptoBox
    # handle: CryptoBoxHandle - 
    # Register an application implemented signing box.
    def register_signing_box(&block)

    # RESPONSE: RegisteredSigningBox
    # handle: SigningBoxHandle - Handle of the signing box.
    # Creates a default signing box implementation.
    def get_signing_box(payload, &block)
    # INPUT: KeyPair
    # public: String - Public key - 64 symbols hex string
    # secret: String - Private key - u64 symbols hex string

    # RESPONSE: RegisteredSigningBox
    # handle: SigningBoxHandle - Handle of the signing box.
    # Returns public key of signing key pair.
    def signing_box_get_public_key(payload, &block)
    # INPUT: RegisteredSigningBox
    # handle: SigningBoxHandle - Handle of the signing box.

    # RESPONSE: ResultOfSigningBoxGetPublicKey
    # pubkey: String - Public key of signing box. Encoded with hex
    # Returns signed user data.
    def signing_box_sign(payload, &block)
    # INPUT: ParamsOfSigningBoxSign
    # signing_box: SigningBoxHandle - Signing Box handle.
    # unsigned: String - Unsigned user data. Must be encoded with `base64`.

    # RESPONSE: ResultOfSigningBoxSign
    # signature: String - Data signature. Encoded with `hex`.
    # Removes signing box from SDK.
    def remove_signing_box(payload, &block)
    # INPUT: RegisteredSigningBox
    # handle: SigningBoxHandle - Handle of the signing box.
    # Register an application implemented encryption box.
    def register_encryption_box(&block)

    # RESPONSE: RegisteredEncryptionBox
    # handle: EncryptionBoxHandle - Handle of the encryption box.
    # Removes encryption box from SDK
    def remove_encryption_box(payload, &block)
    # INPUT: RegisteredEncryptionBox
    # handle: EncryptionBoxHandle - Handle of the encryption box.
    # Queries info from the given encryption box
    def encryption_box_get_info(payload, &block)
    # INPUT: ParamsOfEncryptionBoxGetInfo
    # encryption_box: EncryptionBoxHandle - Encryption box handle

    # RESPONSE: ResultOfEncryptionBoxGetInfo
    # info: EncryptionBoxInfo - Encryption box information
    # Encrypts data using given encryption box Note.    # Block cipher algorithms pad data to cipher block size so encrypted data can be longer then original data. Client should store the original data size after encryption and use it afterdecryption to retrieve the original data from decrypted data.
    def encryption_box_encrypt(payload, &block)
    # INPUT: ParamsOfEncryptionBoxEncrypt
    # encryption_box: EncryptionBoxHandle - Encryption box handle
    # data: String - Data to be encrypted, encoded in Base64

    # RESPONSE: ResultOfEncryptionBoxEncrypt
    # data: String - Encrypted data, encoded in Base64. Padded to cipher block size
    # Decrypts data using given encryption box Note.    # Block cipher algorithms pad data to cipher block size so encrypted data can be longer then original data. Client should store the original data size after encryption and use it afterdecryption to retrieve the original data from decrypted data.
    def encryption_box_decrypt(payload, &block)
    # INPUT: ParamsOfEncryptionBoxDecrypt
    # encryption_box: EncryptionBoxHandle - Encryption box handle
    # data: String - Data to be decrypted, encoded in Base64

    # RESPONSE: ResultOfEncryptionBoxDecrypt
    # data: String - Decrypted data, encoded in Base64.
    # Creates encryption box with specified algorithm
    def create_encryption_box(payload, &block)
    # INPUT: ParamsOfCreateEncryptionBox
    # algorithm: EncryptionAlgorithm - Encryption algorithm specifier including cipher parameters (key, IV, etc)

    # RESPONSE: RegisteredEncryptionBox
    # handle: EncryptionBoxHandle - Handle of the encryption box.
</details> <details> <summary>ABI</summary>
    # Encodes message body according to ABI function call.
    def encode_message_body(payload, &block)
    # INPUT: ParamsOfEncodeMessageBody
    # abi: Value - Contract ABI.
    # call_set: CallSet - Function call parameters. Must be specified in non deploy message.
 # In case of deploy message contains parameters of constructor.
    # is_internal: Boolean - True if internal message body must be encoded.
    # signer: Signer - Signing parameters.
    # processing_try_index: Number<Optional> - Processing try index. Used in message processing with retries.
 # Encoder uses the provided try index to calculate messageexpiration time.
 # Expiration timeouts will grow with every retry.
 # Default value is 0.
    # address: String<Optional> - Destination address of the message Since ABI version 2.3 destination address of external inbound message is used in messagebody signature calculation. Should be provided when signed external inbound message body iscreated. Otherwise can be omitted.
    # signature_id: Number<Optional> - Signature ID to be used in data to sign preparing when CapSignatureWithId capability is enabled

    # RESPONSE: ResultOfEncodeMessageBody
    # body: String - Message body BOC encoded with `base64`.
    # data_to_sign: String<Optional> - Optional data to sign. Encoded with `base64`.
 # # Presents when `message` is unsigned. Can be used for externalmessage signing. Is this case you need to sing this data andproduce signed message using `abi.attach_signature`.

    def attach_signature_to_message_body(payload, &block)
    # INPUT: ParamsOfAttachSignatureToMessageBody
    # abi: Value - 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`.

    # RESPONSE: ResultOfAttachSignatureToMessageBody
    # body: String - 
    # Encodes an ABI-compatible message    # Allows to encode deploy and function call messages,both signed and unsigned.
    # Use cases include messages of any possible type:
    # - deploy with initial function call (i.e. `constructor` or any other function that is used for some kindof initialization);
    # - deploy without initial function call;
    # - signed/unsigned + data for signing.
    # `Signer` defines how the message should or shouldn't be signed:
    # `Signer::None` creates an unsigned message. This may be needed in case of some public methods,that do not require authorization by pubkey.
    # `Signer::External` takes public key and returns `data_to_sign` for later signing.
    # Use `attach_signature` method with the result signature to get the signed message.
    # `Signer::Keys` creates a signed message with provided key pair.
    # [SOON] `Signer::SigningBox` Allows using a special interface to implement signingwithout private key disclosure to SDK. For instance, in case of using a cold wallet or HSM,when application calls some API to sign data.
    # There is an optional public key can be provided in deploy set in order to substitute onein TVM file.
    # Public key resolving priority:
    # 1. Public key from deploy set.
    # 2. Public key, specified in TVM file.
    # 3. Public key, provided by signer.
    def encode_message(payload, &block)
    # INPUT: ParamsOfEncodeMessage
    # abi: Value - Contract ABI.
    # address: String<Optional> - Target address the message will be sent to. Must be specified in case of non-deploy message.
    # deploy_set: DeploySet<Optional> - Deploy parameters. Must be specified in case of deploy message.
    # call_set: CallSet<Optional> - Function call parameters. Must be specified in case of non-deploy message.
 # In case of deploy message it is optional and contains parametersof the functions that will to be called upon deploy transaction.
    # signer: Signer - Signing parameters.
    # processing_try_index: Number<Optional> - Processing try index. Used in message processing with retries (if contract's ABI includes "expire" header).
 # Encoder uses the provided try index to calculate messageexpiration time. The 1st message expiration time is specified inClient config.
 # Expiration timeouts will grow with every retry.
 # Retry grow factor is set in Client config:
 # <.....add config parameter with default value here>Default value is 0.
    # signature_id: Number<Optional> - Signature ID to be used in data to sign preparing when CapSignatureWithId capability is enabled

    # RESPONSE: ResultOfEncodeMessage
    # message: String - Message BOC encoded with `base64`.
    # data_to_sign: String<Optional> - Optional data to be signed encoded in `base64`. Returned in case of `Signer::External`. Can be used for externalmessage signing. Is this case you need to use this data to create signature andthen produce signed message using `abi.attach_signature`.
    # address: String - Destination address.
    # message_id: String - Message id.
    # Encodes an internal ABI-compatible message    # Allows to encode deploy and function call messages.
    # Use cases include messages of any possible type:
    # - deploy with initial function call (i.e. `constructor` or any other function that is used for some kindof initialization);
    # - deploy without initial function call;
    # - simple function callThere is an optional public key can be provided in deploy set in order to substitute onein TVM file.
    # Public key resolving priority:
    # 1. Public key from deploy set.
    # 2. Public key, specified in TVM file.
    def encode_internal_message(payload, &block)
    # INPUT: ParamsOfEncodeInternalMessage
    # abi: Value<Optional> - Contract ABI. Can be None if both deploy_set and call_set are None.
    # address: String<Optional> - Target address the message will be sent to. Must be specified in case of non-deploy message.
    # src_address: String<Optional> - Source address of the message.
    # deploy_set: DeploySet<Optional> - Deploy parameters. Must be specified in case of deploy message.
    # call_set: CallSet<Optional> - Function call parameters. Must be specified in case of non-deploy message.
 # In case of deploy message it is optional and contains parametersof the functions that will to be called upon deploy transaction.
    # value: String - Value in nanotokens to be sent with message.
    # bounce: Boolean<Optional> - Flag of bounceable message. Default is true.
    # enable_ihr: Boolean<Optional> - Enable Instant Hypercube Routing for the message. Default is false.

    # RESPONSE: ResultOfEncodeInternalMessage
    # message: String - Message BOC encoded with `base64`.
    # address: String - Destination address.
    # message_id: String - Message id.
    # Combines `hex`-encoded `signature` with `base64`-encoded `unsigned_message`. Returns signed message encoded in `base64`.
    def attach_signature(payload, &block)
    # INPUT: ParamsOfAttachSignature
    # abi: Value - Contract ABI
    # public_key: String - Public key encoded in `hex`.
    # message: String - Unsigned message BOC encoded in `base64`.
    # signature: String - Signature encoded in `hex`.

    # RESPONSE: ResultOfAttachSignature
    # message: String - Signed message BOC
    # message_id: String - Message ID
    # Decodes message body using provided message BOC and ABI.
    def decode_message(payload, &block)
    # INPUT: ParamsOfDecodeMessage
    # abi: Value - contract ABI
    # message: String - Message BOC
    # allow_partial: Boolean<Optional> - Flag allowing partial BOC decoding when ABI doesn't describe the full body BOC. Controls decoder behaviour when after decoding all described in ABI params there are some data left in BOC: `true` - return decoded values `false` - return error of incomplete BOC deserialization (default)
    # function_name: String<Optional> - Function name or function id if is known in advance
    # data_layout: DataLayout<Optional> - 

    # RESPONSE: DecodedMessageBody
    # body_type: MessageBodyType - Type of the message body content.
    # name: String - Function or event name.
    # value: Value<Optional> - Parameters or result value.
    # header: FunctionHeader<Optional> - Function header.
    # Decodes message body using provided body BOC and ABI.
    def decode_message_body(payload, &block)
    # INPUT: ParamsOfDecodeMessageBody
    # abi: Value - Contract ABI used to decode.
    # body: String - Message body BOC encoded in `base64`.
    # is_internal: Boolean - True if the body belongs to the internal message.
    # allow_partial: Boolean<Optional> - Flag allowing partial BOC decoding when ABI doesn't describe the full body BOC. Controls decoder behaviour when after decoding all described in ABI params there are some data left in BOC: `true` - return decoded values `false` - return error of incomplete BOC deserialization (default)
    # function_name: String<Optional> - Function name or function id if is known in advance
    # data_layout: DataLayout<Optional> - 

    # RESPONSE: DecodedMessageBody
    # body_type: MessageBodyType - Type of the message body content.
    # name: String - Function or event name.
    # value: Value<Optional> - Parameters or result value.
    # header: FunctionHeader<Optional> - Function header.
    # Creates account state BOC    # Creates account state provided with one of these sets of data :
    # 1. BOC of code, BOC of data, BOC of library2. TVC (string in `base64`), keys, init params
    def encode_account(payload, &block)
    # INPUT: ParamsOfEncodeAccount
    # state_init: StateInitSource - Source of the account state init.
    # balance: BigInt<Optional> - Initial balance.
    # last_trans_lt: BigInt<Optional> - Initial value for the `last_trans_lt`.
    # last_paid: Number<Optional> - Initial value for the `last_paid`.
    # boc_cache: BocCacheType<Optional> - Cache type to put the result. The BOC itself returned if no cache type provided

    # RESPONSE: ResultOfEncodeAccount
    # account: String - Account BOC encoded in `base64`.
    # id: String - Account ID  encoded in `hex`.
    # Decodes account data using provided data BOC and ABI.    # Note: this feature requires ABI 2.1 or higher.
    def decode_account_data(payload, &block)
    # INPUT: ParamsOfDecodeAccountData
    # abi: Value - Contract ABI
    # data: String - Data BOC or BOC handle
    # allow_partial: Boolean<Optional> - Flag allowing partial BOC decoding when ABI doesn't describe the full body BOC. Controls decoder behaviour when after decoding all described in ABI params there are some data left in BOC: `true` - return decoded values `false` - return error of incomplete BOC deserialization (default)

    # RESPONSE: ResultOfDecodeAccountData
    # data: Value - Decoded data as a JSON structure.
    # Updates initial account data with initial values for the contract's static variables and owner's public key. This operation is applicable only for initial account data (before deploy). If the contract is already deployed, its data doesn't contain this data section any more.
    def update_initial_data(payload, &block)
    # INPUT: ParamsOfUpdateInitialData
    # abi: Value<Optional> - Contract ABI
    # data: String - Data BOC or BOC handle
    # initial_data: Value - List of initial values for contract's static variables. `abi` parameter should be provided to set initial data
    # initial_pubkey: String<Optional> - Initial account owner's public key to set into account data
    # boc_cache: BocCacheType<Optional> - Cache type to put the result. The BOC itself returned if no cache type provided.

    # RESPONSE: ResultOfUpdateInitialData
    # data: String - Updated data BOC or BOC handle
    # Encodes initial account data with initial values for the contract's static variables and owner's public key into a data BOC that can be passed to `encode_tvc` function afterwards.    # This function is analogue of `tvm.buildDataInit` function in Solidity.
    def encode_initial_data(payload, &block)
    # INPUT: ParamsOfEncodeInitialData
    # abi: Value<Optional> - Contract ABI
    # initial_data: Value - List of initial values for contract's static variables. `abi` parameter should be provided to set initial data
    # initial_pubkey: String<Optional> - Initial account owner's public key to set into account data
    # boc_cache: BocCacheType<Optional> - Cache type to put the result. The BOC itself returned if no cache type provided.

    # RESPONSE: ResultOfEncodeInitialData
    # data: String - Updated data BOC or BOC handle
    # Decodes initial values of a contract's static variables and owner's public key from account initial data This operation is applicable only for initial account data (before deploy). If the contract is already deployed, its data doesn't contain this data section any more.
    def decode_initial_data(payload, &block)
    # INPUT: ParamsOfDecodeInitialData
    # abi: Value<Optional> - Contract ABI. Initial data is decoded if this parameter is provided
    # data: String - Data BOC or BOC handle
    # allow_partial: Boolean<Optional> - Flag allowing partial BOC decoding when ABI doesn't describe the full body BOC. Controls decoder behaviour when after decoding all described in ABI params there are some data left in BOC: `true` - return decoded values `false` - return error of incomplete BOC deserialization (default)

    # RESPONSE: ResultOfDecodeInitialData
    # initial_data: Value<Optional> - List of initial values of contract's public variables. Initial data is decoded if `abi` input parameter is provided
    # initial_pubkey: String - Initial account owner's public key
    # Decodes BOC into JSON as a set of provided parameters.    # Solidity functions use ABI types for [builder encoding](https://github.com/tonlabs/TON-Solidity-Compiler/blob/master/API.md#tvmbuilderstore).
    # The simplest way to decode such a BOC is to use ABI decoding.
    # ABI has it own rules for fields layout in cells so manually encodedBOC can not be described in terms of ABI rules.
    # To solve this problem we introduce a new ABI type `Ref(<ParamType>)`which allows to store `ParamType` ABI parameter in cell reference and, thus,decode manually encoded BOCs. This type is available only in `decode_boc` functionand will not be available in ABI messages encoding until it is included into some ABI revision.
    # Such BOC descriptions covers most users needs. If someone wants to decode some BOC whichcan not be described by these rules (i.e. BOC with TLB containing constructors of flagsdefining some parsing conditions) then they can decode the fields up to fork condition,check the parsed data manually, expand the parsing schema and then decode the whole BOCwith the full schema.
    def decode_boc(payload, &block)
    # INPUT: ParamsOfDecodeBoc
    # params: Array - Parameters to decode from BOC
    # boc: String - Data BOC or BOC handle
    # allow_partial: Boolean - 

    # RESPONSE: ResultOfDecodeBoc
    # data: Value - Decoded data as a JSON structure.
    # Encodes given parameters in JSON into a BOC using param types from ABI.
    def encode_boc(payload, &block)
    # INPUT: ParamsOfAbiEncodeBoc
    # params: Array - Parameters to encode into BOC
    # data: Value - Parameters and values as a JSON structure
    # boc_cache: BocCacheType<Optional> - Cache type to put the result. The BOC itself returned if no cache type provided

    # RESPONSE: ResultOfAbiEncodeBoc
    # boc: String - BOC encoded as base64
    # Calculates contract function ID by contract ABI
    def calc_function_id(payload, &block)
    # INPUT: ParamsOfCalcFunctionId
    # abi: Value - Contract ABI.
    # function_name: String - Contract function name
    # output: Boolean<Optional> - If set to `true` output function ID will be returned which is used in contract response. Default is `false`

    # RESPONSE: ResultOfCalcFunctionId
    # function_id: Number - Contract function ID
    # Extracts signature from message body and calculates hash to verify the signature
    def get_signature_data(payload, &block)
    # INPUT: ParamsOfGetSignatureData
    # abi: Value - Contract ABI used to decode.
    # message: String - Message BOC encoded in `base64`.
    # signature_id: Number<Optional> - Signature ID to be used in unsigned data preparing when CapSignatureWithId capability is enabled

    # RESPONSE: ResultOfGetSignatureData
    # signature: String - Signature from the message in `hex`.
    # unsigned: String - Data to verify the signature in `base64`.
</details> <details> <summary>BOC</summary>
    # Decodes tvc according to the tvc spec. Read more about tvc structure here https://github.com/tonlabs/ever-struct/blob/main/src/scheme/mod.rs#L30
    def decode_tvc(payload, &block)
    # INPUT: ParamsOfDecodeTvc
    # tvc: String - Contract TVC BOC encoded as base64 or BOC handle

    # RESPONSE: ResultOfDecodeTvc
    # tvc: Tvc - Decoded TVC
    # Parses message boc into a JSON    # JSON structure is compatible with GraphQL API message object
    def parse_message(payload, &block)
    # INPUT: ParamsOfParse
    # boc: String - BOC encoded as base64

    # RESPONSE: ResultOfParse
    # parsed: Value - JSON containing parsed BOC
    # Parses transaction boc into a JSON    # JSON structure is compatible with GraphQL API transaction object
    def parse_transaction(payload, &block)
    # INPUT: ParamsOfParse
    # boc: String - BOC encoded as base64

    # RESPONSE: ResultOfParse
    # parsed: Value - JSON containing parsed BOC
    # Parses account boc into a JSON    # JSON structure is compatible with GraphQL API account object
    def parse_account(payload, &block)
    # INPUT: ParamsOfParse
    # boc: String - BOC encoded as base64

    # RESPONSE: ResultOfParse
    # parsed: Value - JSON containing parsed BOC
    # Parses block boc into a JSON    # JSON structure is compatible with GraphQL API block object
    def parse_block(payload, &block)
    # INPUT: ParamsOfParse
    # boc: String - BOC encoded as base64

    # RESPONSE: ResultOfParse
    # parsed: Value - JSON containing parsed BOC
    # Parses shardstate boc into a JSON    # JSON structure is compatible with GraphQL API shardstate object
    def parse_shardstate(payload, &block)
    # INPUT: ParamsOfParseShardstate
    # boc: String - BOC encoded as base64
    # id: String - Shardstate identifier
    # workchain_id: Number - Workchain shardstate belongs to

    # RESPONSE: ResultOfParse
    # parsed: Value - JSON containing parsed BOC
    # Extract blockchain configuration from key block and also from zerostate.
    def get_blockchain_config(payload, &block)
    # INPUT: ParamsOfGetBlockchainConfig
    # block_boc: String - Key block BOC or zerostate BOC encoded as base64

    # RESPONSE: ResultOfGetBlockchainConfig
    # config_boc: String - Blockchain config BOC encoded as base64
    # Calculates BOC root hash
    def get_boc_hash(payload, &block)
    # INPUT: ParamsOfGetBocHash
    # boc: String - BOC encoded as base64 or BOC handle

    # RESPONSE: ResultOfGetBocHash
    # hash: String - BOC root hash encoded with hex
    # Calculates BOC depth
    def get_boc_depth(payload, &block)
    # INPUT: ParamsOfGetBocDepth
    # boc: String - BOC encoded as base64 or BOC handle

    # RESPONSE: ResultOfGetBocDepth
    # depth: Number - BOC root cell depth
    # Extracts code from TVC contract image
    def get_code_from_tvc(payload, &block)
    # INPUT: ParamsOfGetCodeFromTvc
    # tvc: String - Contract TVC image or image BOC handle

    # RESPONSE: ResultOfGetCodeFromTvc
    # code: String - Contract code encoded as base64
    # Get BOC from cache
    def cache_get(payload, &block)
    # INPUT: ParamsOfBocCacheGet
    # boc_ref: String - Reference to the cached BOC

    # RESPONSE: ResultOfBocCacheGet
    # boc: String<Optional> - BOC encoded as base64.
    # Save BOC into cache or increase pin counter for existing pinned BOC
    def cache_set(payload, &block)
    # INPUT: ParamsOfBocCacheSet
    # boc: String - BOC encoded as base64 or BOC reference
    # cache_type: BocCacheType - Cache type

    # RESPONSE: ResultOfBocCacheSet
    # boc_ref: String - Reference to the cached BOC
    # Unpin BOCs with specified pin defined in the `cache_set`. Decrease pin reference counter for BOCs with specified pin defined in the `cache_set`. BOCs which have only 1 pin and its reference counter become 0 will be removed from cache
    def cache_unpin(payload, &block)
    # INPUT: ParamsOfBocCacheUnpin
    # pin: String - Pinned name
    # boc_ref: String<Optional> - Reference to the cached BOC. If it is provided then only referenced BOC is unpinned
    # Encodes bag of cells (BOC) with builder operations. This method provides the same functionality as Solidity TvmBuilder. Resulting BOC of this method can be passed into Solidity and C++ contracts as TvmCell type.
    def encode_boc(payload, &block)
    # INPUT: ParamsOfEncodeBoc
    # builder: Array - Cell builder operations.
    # boc_cache: BocCacheType<Optional> - Cache type to put the result. The BOC itself returned if no cache type provided.

    # RESPONSE: ResultOfEncodeBoc
    # boc: String - Encoded cell BOC or BOC cache key.
    # Returns the contract code's salt if it is present.
    def get_code_salt(payload, &block)
    # INPUT: ParamsOfGetCodeSalt
    # code: String - Contract code BOC encoded as base64 or code BOC handle
    # boc_cache: BocCacheType<Optional> - Cache type to put the result. The BOC itself returned if no cache type provided.

    # RESPONSE: ResultOfGetCodeSalt
    # salt: String<Optional> - Contract code salt if present. BOC encoded as base64 or BOC handle
    # Sets new salt to contract code.    # Returns the new contract code with salt.
    def set_code_salt(payload, &block)
    # INPUT: ParamsOfSetCodeSalt
    # code: String - Contract code BOC encoded as base64 or code BOC handle
    # salt: String - Code salt to set. BOC encoded as base64 or BOC handle
    # boc_cache: BocCacheType<Optional> - Cache type to put the result. The BOC itself returned if no cache type provided.

    # RESPONSE: ResultOfSetCodeSalt
    # code: String - Contract code with salt set. BOC encoded as base64 or BOC handle
    # Decodes contract's initial state into code, data, libraries and special options.
    def decode_state_init(payload, &block)
    # INPUT: ParamsOfDecodeStateInit
    # state_init: String - Contract StateInit image BOC encoded as base64 or BOC handle
    # boc_cache: BocCacheType<Optional> - Cache type to put the result. The BOC itself returned if no cache type provided.

    # RESPONSE: ResultOfDecodeStateInit
    # code: String<Optional> - Contract code BOC encoded as base64 or BOC handle
    # code_hash: String<Optional> - Contract code hash
    # code_depth: Number<Optional> - Contract code depth
    # data: String<Optional> - Contract data BOC encoded as base64 or BOC handle
    # data_hash: String<Optional> - Contract data hash
    # data_depth: Number<Optional> - Contract data depth
    # library: String<Optional> - Contract library BOC encoded as base64 or BOC handle
    # tick: Boolean<Optional> - `special.tick` field. Specifies the contract ability to handle tick transactions
    # tock: Boolean<Optional> - `special.tock` field. Specifies the contract ability to handle tock transactions
    # split_depth: Number<Optional> - Is present and non-zero only in instances of large smart contracts
    # compiler_version: String<Optional> - Compiler version, for example 'sol 0.49.0'
    # Encodes initial contract state from code, data, libraries ans special options (see input params)
    def encode_state_init(payload, &block)
    # INPUT: ParamsOfEncodeStateInit
    # code: String<Optional> - Contract code BOC encoded as base64 or BOC handle
    # data: String<Optional> - Contract data BOC encoded as base64 or BOC handle
    # library: String<Optional> - Contract library BOC encoded as base64 or BOC handle
    # tick: Boolean<Optional> - `special.tick` field. Specifies the contract ability to handle tick transactions
    # tock: Boolean<Optional> - `special.tock` field. Specifies the contract ability to handle tock transactions
    # split_depth: Number<Optional> - Is present and non-zero only in instances of large smart contracts
    # boc_cache: BocCacheType<Optional> - Cache type to put the result. The BOC itself returned if no cache type provided.

    # RESPONSE: ResultOfEncodeStateInit
    # state_init: String - Contract StateInit image BOC encoded as base64 or BOC handle of boc_cache parameter was specified
    # Encodes a message    # Allows to encode any external inbound message.
    def encode_external_in_message(payload, &block)
    # INPUT: ParamsOfEncodeExternalInMessage
    # src: String<Optional> - Source address.
    # dst: String - Destination address.
    # init: String<Optional> - Bag of cells with state init (used in deploy messages).
    # body: String<Optional> - Bag of cells with the message body encoded as base64.
    # boc_cache: BocCacheType<Optional> - Cache type to put the result. The BOC itself returned if no cache type provided

    # RESPONSE: ResultOfEncodeExternalInMessage
    # message: String - Message BOC encoded with `base64`.
    # message_id: String - Message id.
    # Returns the compiler version used to compile the code.
    def get_compiler_version(payload, &block)
    # INPUT: ParamsOfGetCompilerVersion
    # code: String - Contract code BOC encoded as base64 or code BOC handle

    # RESPONSE: ResultOfGetCompilerVersion
    # version: String<Optional> - Compiler version, for example 'sol 0.49.0'
</details> <details> <summary>PROCESSING</summary>
    # Starts monitoring for the processing results of the specified messages.    # Message monitor performs background monitoring for a message processing resultsfor the specified set of messages.
    # Message monitor can serve several isolated monitoring queues.
    # Each monitor queue has a unique application defined identifier (or name) usedto separate several queue's.
    # There are two important lists inside of the monitoring queue:
    # - unresolved messages: contains messages requested by the application for monitoring  and not yet resolved;
    # - resolved results: contains resolved processing results for monitored messages.
    # Each monitoring queue tracks own unresolved and resolved lists.
    # Application can add more messages to the monitoring queue at any time.
    # Message monitor accumulates resolved results.
    # Application should fetch this results with `fetchNextMonitorResults` function.
    # When both unresolved and resolved lists becomes empty, monitor stops any background activityand frees all allocated internal memory.
    # If monitoring queue with specified name already exists then messages will be addedto the unresolved list.
    # If monitoring queue with specified name does not exist then monitoring queue will be createdwith specified unresolved messages.
    def monitor_messages(payload, &block)
    # INPUT: ParamsOfMonitorMessages
    # queue: String - Name of the monitoring queue.
    # messages: Array - Messages to start monitoring for.
    # Returns summary information about current state of the specified monitoring queue.
    def get_monitor_info(payload, &block)
    # INPUT: ParamsOfGetMonitorInfo
    # queue: String - Name of the monitoring queue.

    # RESPONSE: MonitoringQueueInfo
    # unresolved: Number - Count of the unresolved messages.
    # resolved: Number - Count of resolved results.
    # Fetches next resolved results from the specified monitoring queue.    # Results and waiting options are depends on the `wait` parameter.
    # All returned results will be removed from the queue's resolved list.
    def fetch_next_monitor_results(payload, &block)
    # INPUT: ParamsOfFetchNextMonitorResults
    # queue: String - Name of the monitoring queue.
    # wait_mode: MonitorFetchWaitMode<Optional> - Wait mode. Default is `NO_WAIT`.

    # RESPONSE: ResultOfFetchNextMonitorResults
    # results: Array - List of the resolved results.
    # Cancels all background activity and releases all allocated system resources for the specified monitoring queue.
    def cancel_monitor(payload, &block)
    # INPUT: ParamsOfCancelMonitor
    # queue: String - Name of the monitoring queue.
    # Sends specified messages to the blockchain.
    def send_messages(payload, &block)
    # INPUT: ParamsOfSendMessages
    # messages: Array - Messages that must be sent to the blockchain.
    # monitor_queue: String<Optional> - Optional message monitor queue that starts monitoring for the processing results for sent messages.

    # RESPONSE: ResultOfSendMessages
    # messages: Array - Messages that was sent to the blockchain for execution.
    # Sends message to the network    # Sends message to the network and returns the last generated shard block of the destination accountbefore the message was sent. It will be required later for message processing.
    def send_message(payload, &block)
    # INPUT: ParamsOfSendMessage
    # message: String - Message BOC.
    # abi: Value<Optional> - Optional message ABI. If this parameter is specified and the message has the`expire` header then expiration time will be checked againstthe current time to prevent unnecessary sending of already expired message.
 # The `message already expired` error will be returned in thiscase.
 # Note, that specifying `abi` for ABI compliant contracts isstrongly recommended, so that proper processing strategy can bechosen.
    # send_events: Boolean - Flag for requesting events sending

    # RESPONSE: ResultOfSendMessage
    # shard_block_id: String - The last generated shard block of the message destination account before the message was sent. This block id must be used as a parameter of the`wait_for_transaction`.
    # sending_endpoints: Array - The list of endpoints to which the message was sent. This list id must be used as a parameter of the`wait_for_transaction`.
    # Performs monitoring of the network for the result transaction of the external inbound message processing.    # `send_events` enables intermediate events, such as `WillFetchNextBlock`,`FetchNextBlockFailed` that may be useful for logging of new shard blocks creationduring message processing.
    # Note, that presence of the `abi` parameter is critical for ABIcompliant contracts. Message processing uses drasticallydifferent strategy for processing message for contracts whichABI includes "expire" header.
    # When the ABI header `expire` is present, the processing uses`message expiration` strategy:
    # - The maximum block gen time is set to  `message_expiration_timeout + transaction_wait_timeout`.
    # - When maximum block gen time is reached, the processing will  be finished with `MessageExpired` error.
    # When the ABI header `expire` isn't present or `abi` parameterisn't specified, the processing uses `transaction waiting`strategy:
    # - The maximum block gen time is set to  `now() + transaction_wait_timeout`.
    # - If maximum block gen time is reached and no result transaction is found,the processing will exit with an error.
    def wait_for_transaction(payload, &block)
    # INPUT: ParamsOfWaitForTransaction
    # abi: Value<Optional> - Optional ABI for decoding the transaction result. If it is specified, then the output messages' bodies will bedecoded according to this ABI.
 # The `abi_decoded` result field will be filled out.
    # 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
    # sending_endpoints: Array<Optional> - The list of endpoints to which the message was sent. Use this field to get more informative errors.
 # Provide the same value as the `send_message` has returned.
 # If the message was not delivered (expired), SDK will log the endpoint URLs, used for its sending.

    # RESPONSE: ResultOfProcessMessage
    # transaction: Value - Parsed transaction. In addition to the regular transaction fields there is a`boc` field encoded with `base64` which contains sourcetransaction BOC.
    # out_messages: Array - List of output messages' BOCs. Encoded as `base64`
    # decoded: DecodedOutput<Optional> - Optional decoded message bodies according to the optional `abi` parameter.
    # fees: TransactionFees - Transaction fees
    # Creates message, sends it to the network and monitors its processing.    # Creates ABI-compatible message,sends it to the network and monitors for the result transaction.
    # Decodes the output messages' bodies.
    # If contract's ABI includes "expire" header, thenSDK implements retries in case of unsuccessful message delivery within the expirationtimeout: SDK recreates the message, sends it and processes it again.
    # The intermediate events, such as `WillFetchFirstBlock`, `WillSend`, `DidSend`,`WillFetchNextBlock`, etc - are switched on/off by `send_events` flagand logged into the supplied callback function.
    # The retry configuration parameters are defined in the client's `NetworkConfig` and `AbiConfig`.
    # If contract's ABI does not include "expire" headerthen, if no transaction is found within the network timeout (see config parameter ), exits with error.
    def process_message(payload, &block)
    # INPUT: ParamsOfProcessMessage
    # message_encode_params: ParamsOfEncodeMessage - Message encode parameters.
    # send_events: Boolean - Flag for requesting events sending

    # RESPONSE: ResultOfProcessMessage
    # transaction: Value - Parsed transaction. In addition to the regular transaction fields there is a`boc` field encoded with `base64` which contains sourcetransaction BOC.
    # out_messages: Array - List of output messages' BOCs. Encoded as `base64`
    # decoded: DecodedOutput<Optional> - Optional decoded message bodies according to the optional `abi` parameter.
    # fees: TransactionFees - Transaction fees
</details> <details> <summary>UTILS</summary>
    # Converts address from any TON format to any TON format
    def convert_address(payload, &block)
    # INPUT: ParamsOfConvertAddress
    # address: String - Account address in any TON format.
    # output_format: AddressStringFormat - Specify the format to convert to.

    # RESPONSE: ResultOfConvertAddress
    # address: String - Address in the specified format
    # Validates and returns the type of any TON address.    # Address types are the following`0:919db8e740d50bf349df2eea03fa30c385d846b991ff5542e67098ee833fc7f7` - standard TON address mostcommonly used in all cases. Also called as hex address`919db8e740d50bf349df2eea03fa30c385d846b991ff5542e67098ee833fc7f7` - account ID. A part of fulladdress. Identifies account inside particular workchain`EQCRnbjnQNUL80nfLuoD+jDDhdhGuZH/VULmcJjugz/H9wam` - base64 address. Also called "user-friendly".
    # Was used at the beginning of TON. Now it is supported for compatibility
    def get_address_type(payload, &block)
    # INPUT: ParamsOfGetAddressType
    # address: String - Account address in any TON format.

    # RESPONSE: ResultOfGetAddressType
    # address_type: AccountAddressType - Account address type.
    # Calculates storage fee for an account over a specified time period
    def calc_storage_fee(payload, &block)
    # INPUT: ParamsOfCalcStorageFee
    # account: String - 
    # period: Number - 

    # RESPONSE: ResultOfCalcStorageFee
    # fee: String - 
    # Compresses data using Zstandard algorithm
    def compress_zstd(payload, &block)
    # INPUT: ParamsOfCompressZstd
    # uncompressed: String - Uncompressed data. Must be encoded as base64.
    # level: Number<Optional> - Compression level, from 1 to 21. Where: 1 - lowest compression level (fastest compression); 21 - highest compression level (slowest compression). If level is omitted, the default compression level is used (currently `3`).

    # RESPONSE: ResultOfCompressZstd
    # compressed: String - Compressed data. Must be encoded as base64.
    # Decompresses data using Zstandard algorithm
    def decompress_zstd(payload, &block)
    # INPUT: ParamsOfDecompressZstd
    # compressed: String - Compressed data. Must be encoded as base64.

    # RESPONSE: ResultOfDecompressZstd
    # decompressed: String - Decompressed data. Must be encoded as base64.
</details> <details> <summary>TVM</summary>
    # Emulates all the phases of contract execution locally    # Performs all the phases of contract execution on Transaction Executor -the same component that is used on Validator Nodes.
    # Can be used for contract debugging, to find out the reason why a message was not delivered successfully.
    # Validators throw away the failed external inbound messages (if they failed before `ACCEPT`) in the real network.
    # This is why these messages are impossible to debug in the real network.
    # With the help of run_executor you can do that. In fact, `process_message` functionperforms local check with `run_executor` if there was no transaction as a result of processingand returns the error, if there is one.
    # Another use case to use `run_executor` is to estimate fees for message execution.
    # Set  `AccountForExecutor::Account.unlimited_balance`to `true` so that emulation will not depend on the actual balance.
    # This may be needed to calculate deploy fees for an account that does not exist yet.
    # JSON with fees is in `fees` field of the result.
    # One more use case - you can produce the sequence of operations,thus emulating the sequential contract calls locally.
    # And so on.
    # Transaction executor requires account BOC (bag of cells) as a parameter.
    # To get the account BOC - use `net.query` method to download it from GraphQL API(field `boc` of `account`) or generate it with `abi.encode_account` method.
    # Also it requires message BOC. To get the message BOC - use `abi.encode_message` or `abi.encode_internal_message`.
    # If you need this emulation to be as precise as possible (for instance - emulate transactionwith particular lt in particular block or use particular blockchain config,downloaded from a particular key block - then specify `execution_options` parameter.
    # If you need to see the aborted transaction as a result, not as an error, set `skip_transaction_check` to `true`.
    def run_executor(payload, &block)
    # INPUT: ParamsOfRunExecutor
    # message: String - Input message BOC. Must be encoded as base64.
    # account: AccountForExecutor - Account to run on executor
    # execution_options: ExecutionOptions<Optional> - Execution options.
    # abi: Value<Optional> - Contract ABI for decoding output messages
    # skip_transaction_check: Boolean<Optional> - Skip transaction check flag
    # boc_cache: BocCacheType<Optional> - Cache type to put the result. The BOC itself returned if no cache type provided
    # return_updated_account: Boolean<Optional> - Return updated account flag. Empty string is returned if the flag is `false`

    # RESPONSE: ResultOfRunExecutor
    # transaction: Value - Parsed transaction. In addition to the regular transaction fields there is a`boc` field encoded with `base64` which contains sourcetransaction BOC.
    # out_messages: Array - List of output messages' BOCs. Encoded as `base64`
    # decoded: DecodedOutput<Optional> - Optional decoded message bodies according to the optional `abi` parameter.
    # account: String - Updated account state BOC. Encoded as `base64`
    # fees: TransactionFees - Transaction fees
    # Executes get-methods of ABI-compatible contracts    # Performs only a part of compute phase of transaction executionthat is used to run get-methods of ABI-compatible contracts.
    # If you try to run get-methods with `run_executor` you will get an error, because it checks ACCEPT and exitsif there is none, which is actually true for get-methods.
    #  To get the account BOC (bag of cells) - use `net.query` method to download it from GraphQL API(field `boc` of `account`) or generate it with `abi.encode_account method`.
    # To get the message BOC - use `abi.encode_message` or prepare it any other way, for instance, with FIFT script.
    # Attention! Updated account state is produces as well, but only`account_state.storage.state.data`  part of the BOC is updated.
    def run_tvm(payload, &block)
    # INPUT: ParamsOfRunTvm
    # message: String - Input message BOC. Must be encoded as base64.
    # account: String - Account BOC. Must be encoded as base64.
    # execution_options: ExecutionOptions<Optional> - Execution options.
    # abi: Value<Optional> - Contract ABI for decoding output messages
    # boc_cache: BocCacheType<Optional> - Cache type to put the result. The BOC itself returned if no cache type provided
    # return_updated_account: Boolean<Optional> - Return updated account flag. Empty string is returned if the flag is `false`

    # RESPONSE: ResultOfRunTvm
    # out_messages: Array - List of output messages' BOCs. Encoded as `base64`
    # decoded: DecodedOutput<Optional> - Optional decoded message bodies according to the optional `abi` parameter.
    # account: String - Updated account state BOC. Encoded as `base64`. Attention! Only `account_state.storage.state.data` part of the BOC is updated.
    # Executes a get-method of FIFT contract    # Executes a get-method of FIFT contract that fulfills the smc-guidelines https://test.ton.org/smc-guidelines.txtand returns the result data from TVM's stack
    def run_get(payload, &block)
    # INPUT: ParamsOfRunGet
    # account: String - Account BOC in `base64`
    # function_name: String - Function name
    # input: Value - Input parameters
    # execution_options: ExecutionOptions<Optional> - Execution options
    # tuple_list_as_array: Boolean<Optional> - Convert lists based on nested tuples in the **result** into plain arrays. Default is `false`. Input parameters may use any of lists representationsIf you receive this error on Web: "Runtime error. Unreachable code should not be executed...",set this flag to true.
 # This may happen, for example, when elector contract contains too many participants

    # RESPONSE: ResultOfRunGet
    # output: Value - Values returned by get-method on stack
</details> <details> <summary>NET</summary>
    # Performs DAppServer GraphQL query.
    def query(payload, &block)
    # INPUT: ParamsOfQuery
    # query: String - GraphQL query text.
    # variables: Value - Variables used in query. Must be a map with named values that can be used in query.

    # RESPONSE: ResultOfQuery
    # result: Value - Result provided by DAppServer.
    # Performs multiple queries per single fetch.
    def batch_query(payload, &block)
    # INPUT: ParamsOfBatchQuery
    # operations: Array - List of query operations that must be performed per single fetch.

    # RESPONSE: ResultOfBatchQuery
    # results: Array - Result values for batched queries. Returns an array of values. Each value corresponds to `queries` item.
    # Queries collection data    # Queries data that satisfies the `filter` conditions,limits the number of returned records and orders them.
    # The projection fields are limited to `result` fields
    def query_collection(payload, &block)
    # INPUT: ParamsOfQueryCollection
    # collection: String - Collection name (accounts, blocks, transactions, messages, block_signatures)
    # filter: Value - Collection filter
    # result: String - Projection (result) string
    # order: Array<Optional> - Sorting order
    # limit: Number<Optional> - Number of documents to return

    # RESPONSE: ResultOfQueryCollection
    # result: Array - Objects that match the provided criteria
    # Aggregates collection data.    # Aggregates values from the specified `fields` for recordsthat satisfies the `filter` conditions,
    def aggregate_collection(payload, &block)
    # INPUT: ParamsOfAggregateCollection
    # collection: String - Collection name (accounts, blocks, transactions, messages, block_signatures)
    # filter: Value - Collection filter
    # fields: Array<Optional> - Projection (result) string

    # RESPONSE: ResultOfAggregateCollection
    # values: Value - Values for requested fields. Returns an array of strings. Each string refers to the corresponding `fields` item.
 # Numeric value is returned as a decimal string representations.
    # Returns an object that fulfills the conditions or waits for its appearance    # Triggers only once.
    # If object that satisfies the `filter` conditionsalready exists - returns it immediately.
    # If not - waits for insert/update of data within the specified `timeout`,and returns it.
    # The projection fields are limited to `result` fields
    def wait_for_collection(payload, &block)
    # INPUT: ParamsOfWaitForCollection
    # collection: String - Collection name (accounts, blocks, transactions, messages, block_signatures)
    # filter: Value - Collection filter
    # result: String - Projection (result) string
    # timeout: Number<Optional> - Query timeout

    # RESPONSE: ResultOfWaitForCollection
    # result: Value - First found object that matches the provided criteria
    # Cancels a subscription    # Cancels a subscription specified by its handle.
    def unsubscribe(payload, &block)
    # INPUT: ResultOfSubscribeCollection
    # handle: Number - Subscription handle. Must be closed with `unsubscribe`
    # Creates a collection subscription    # Triggers for each insert/update of data that satisfiesthe `filter` conditions.
    # The projection fields are limited to `result` fields.
    # The subscription is a persistent communication channel betweenclient and Free TON Network.
    # All changes in the blockchain will be reflected in realtime.
    # Changes means inserts and updates of the blockchain entities.
    # ### Important Notes on SubscriptionsUnfortunately sometimes the connection with the network brakes down.
    # In this situation the library attempts to reconnect to the network.
    # This reconnection sequence can take significant time.
    # All of this time the client is disconnected from the network.
    # Bad news is that all blockchain changes that happened whilethe client was disconnected are lost.
    # Good news is that the client report errors to the callback whenit loses and resumes connection.
    # So, if the lost changes are important to the application thenthe application must handle these error reports.
    # Library reports errors with `responseType` == 101and the error object passed via `params`.
    # When the library has successfully reconnectedthe application receives callback with`responseType` == 101 and `params.code` == 614 (NetworkModuleResumed).
    # Application can use several ways to handle this situation:
    # - If application monitors changes for the single blockchainobject (for example specific account):  applicationcan perform a query for this object and handle actual data as aregular data from the subscription.
    # - If application monitors sequence of some blockchain objects(for example transactions of the specific account): application mustrefresh all cached (or visible to user) lists where this sequences presents.
    def subscribe_collection(payload, &block)
    # INPUT: ParamsOfSubscribeCollection
    # collection: String - Collection name (accounts, blocks, transactions, messages, block_signatures)
    # filter: Value - Collection filter
    # result: String - Projection (result) string

    # RESPONSE: ResultOfSubscribeCollection
    # handle: Number - Subscription handle. Must be closed with `unsubscribe`
    # Creates a subscription    # The subscription is a persistent communication channel betweenclient and Everscale Network.
    # ### Important Notes on SubscriptionsUnfortunately sometimes the connection with the network breaks down.
    # In this situation the library attempts to reconnect to the network.
    # This reconnection sequence can take significant time.
    # All of this time the client is disconnected from the network.
    # Bad news is that all changes that happened whilethe client was disconnected are lost.
    # Good news is that the client report errors to the callback whenit loses and resumes connection.
    # So, if the lost changes are important to the application thenthe application must handle these error reports.
    # Library reports errors with `responseType` == 101and the error object passed via `params`.
    # When the library has successfully reconnectedthe application receives callback with`responseType` == 101 and `params.code` == 614 (NetworkModuleResumed).
    # Application can use several ways to handle this situation:
    # - If application monitors changes for the singleobject (for example specific account):  applicationcan perform a query for this object and handle actual data as aregular data from the subscription.
    # - If application monitors sequence of some objects(for example transactions of the specific account): application mustrefresh all cached (or visible to user) lists where this sequences presents.
    def subscribe(payload, &block)
    # INPUT: ParamsOfSubscribe
    # subscription: String - GraphQL subscription text.
    # variables: Value - Variables used in subscription. Must be a map with named values that can be used in query.

    # RESPONSE: ResultOfSubscribeCollection
    # handle: Number - Subscription handle. Must be closed with `unsubscribe`
    # Suspends network module to stop any network activity
    def suspend(&block)
    # Resumes network module to enable network activity
    def resume(&block)
    # Returns ID of the last block in a specified account shard
    def find_last_shard_block(payload, &block)
    # INPUT: ParamsOfFindLastShardBlock
    # address: String - Account address

    # RESPONSE: ResultOfFindLastShardBlock
    # block_id: String - Account shard last block ID
    # Requests the list of alternative endpoints from server
    def fetch_endpoints(&block)

    # RESPONSE: EndpointsSet
    # endpoints: Array - List of endpoints provided by server
    # Sets the list of endpoints to use on reinit
    def set_endpoints(payload, &block)
    # INPUT: EndpointsSet
    # endpoints: Array - List of endpoints provided by server
    # Requests the list of alternative endpoints from server
    def get_endpoints(&block)

    # RESPONSE: ResultOfGetEndpoints
    # query: String - Current query endpoint
    # endpoints: Array - List of all endpoints used by client
    # Allows to query and paginate through the list of accounts that the specified account has interacted with, sorted by the time of the last internal message between accounts    # *Attention* this query retrieves data from 'Counterparties' service which is not supported inthe opensource version of DApp Server (and will not be supported) as well as in Evernode SE (will be supported in SE in future),but is always accessible via [EVER OS Clouds](../ton-os-api/networks.md)
    def query_counterparties(payload, &block)
    # INPUT: ParamsOfQueryCounterparties
    # account: String - Account address
    # result: String - Projection (result) string
    # first: Number<Optional> - Number of counterparties to return
    # after: String<Optional> - `cursor` field of the last received result

    # RESPONSE: ResultOfQueryCollection
    # result: Array - Objects that match the provided criteria
    # Returns a tree of transactions triggered by a specific message.    # Performs recursive retrieval of a transactions tree produced by a specific message:
    # in_msg -> dst_transaction -> out_messages -> dst_transaction -> ...
    # If the chain of transactions execution is in progress while the function is running,it will wait for the next transactions to appear until the full tree or more than 50 transactionsare received.
    # All the retrieved messages and transactions are includedinto `result.messages` and `result.transactions` respectively.
    # Function reads transactions layer by layer, by pages of 20 transactions.
    # The retrieval process goes like this:
    # Let's assume we have an infinite chain of transactions and each transaction generates 5 messages.
    # 1. Retrieve 1st message (input parameter) and corresponding transaction - put it into result.
    # It is the first level of the tree of transactions - its root.
    # Retrieve 5 out message ids from the transaction for next steps.
    # 2. Retrieve 5 messages and corresponding transactions on the 2nd layer. Put them into result.
    # Retrieve 5*5 out message ids from these transactions for next steps3. Retrieve 20 (size of the page) messages and transactions (3rd layer) and 20*5=100 message ids (4th layer).
    # 4. Retrieve the last 5 messages and 5 transactions on the 3rd layer + 15 messages and transactions (of 100) from the 4th layer+ 25 message ids of the 4th layer + 75 message ids of the 5th layer.
    # 5. Retrieve 20 more messages and 20 more transactions of the 4th layer + 100 more message ids of the 5th layer.
    # 6. Now we have 1+5+20+20+20 = 66 transactions, which is more than 50. Function exits with the tree of1m->1t->5m->5t->25m->25t->35m->35t. If we see any message ids in the last transactions out_msgs, which don't havecorresponding messages in the function result, it means that the full tree was not received and we need to continue iteration.
    # To summarize, it is guaranteed that each message in `result.messages` has the corresponding transactionin the `result.transactions`.
    # But there is no guarantee that all messages from transactions `out_msgs` arepresented in `result.messages`.
    # So the application has to continue retrieval for missing messages if it requires.
    def query_transaction_tree(payload, &block)
    # INPUT: ParamsOfQueryTransactionTree
    # in_msg: String - Input message id.
    # abi_registry: Array<Optional> - List of contract ABIs that will be used to decode message bodies. Library will try to decode each returned message body using any ABI from the registry.
    # timeout: Number<Optional> - Timeout used to limit waiting time for the missing messages and transaction. If some of the following messages and transactions are missing yetThe maximum waiting time is regulated by this option.
 # Default value is 60000 (1 min). If `timeout` is set to 0 then function will wait infinitelyuntil the whole transaction tree is executed
    # transaction_max_count: Number<Optional> - Maximum transaction count to wait. If transaction tree contains more transaction then this parameter then only first `transaction_max_count` transaction are awaited and returned.
 # Default value is 50. If `transaction_max_count` is set to 0 then no limitation ontransaction count is used and all transaction are returned.

    # RESPONSE: ResultOfQueryTransactionTree
    # messages: Array - Messages.
    # transactions: Array - Transactions.
    # Creates block iterator.    # Block iterator uses robust iteration methods that guaranties that everyblock in the specified range isn't missed or iterated twice.
    # Iterated range can be reduced with some filters:
    # - `start_time` – the bottom time range. Only blocks with `gen_utime`more or equal to this value is iterated. If this parameter is omitted then there isno bottom time edge, so all blocks since zero state is iterated.
    # - `end_time` – the upper time range. Only blocks with `gen_utime`less then this value is iterated. If this parameter is omitted then there isno upper time edge, so iterator never finishes.
    # - `shard_filter` – workchains and shard prefixes that reduce the set of interestingblocks. Block conforms to the shard filter if it belongs to the filter workchainand the first bits of block's `shard` fields matches to the shard prefix.
    # Only blocks with suitable shard are iterated.
    # Items iterated is a JSON objects with block data. The minimal set of returnedfields is:
    # ```textidgen_utimeworkchain_idshardafter_splitafter_mergeprev_ref {    root_hash}prev_alt_ref {    root_hash}```Application can request additional fields in the `result` parameter.
    # Application should call the `remove_iterator` when iterator is no longer required.
    def create_block_iterator(payload, &block)
    # INPUT: ParamsOfCreateBlockIterator
    # start_time: Number<Optional> - Starting time to iterate from. If the application specifies this parameter then the iterationincludes blocks with `gen_utime` >= `start_time`.
 # Otherwise the iteration starts from zero state.
 # Must be specified in seconds.
    # end_time: Number<Optional> - Optional end time to iterate for. If the application specifies this parameter then the iterationincludes blocks with `gen_utime` < `end_time`.
 # Otherwise the iteration never stops.
 # Must be specified in seconds.
    # shard_filter: Array<Optional> - Shard prefix filter. If the application specifies this parameter and it is not the empty arraythen the iteration will include items related to accounts that belongs tothe specified shard prefixes.
 # Shard prefix must be represented as a string "workchain:prefix".
 # Where `workchain` is a signed integer and the `prefix` if a hexadecimalrepresentation if the 64-bit unsigned integer with tagged shard prefix.
 # For example: "0:3800000000000000".
    # result: String<Optional> - Projection (result) string. List of the fields that must be returned for iterated items.
 # This field is the same as the `result` parameter ofthe `query_collection` function.
 # Note that iterated items can contains additional fields that arenot requested in the `result`.

    # RESPONSE: RegisteredIterator
    # handle: Number - Iterator handle. Must be removed using `remove_iterator`when it is no more needed for the application.
    # Resumes block iterator.    # The iterator stays exactly at the same position where the `resume_state` was caught.
    # Application should call the `remove_iterator` when iterator is no longer required.
    def resume_block_iterator(payload, &block)
    # INPUT: ParamsOfResumeBlockIterator
    # resume_state: Value - Iterator state from which to resume. Same as value returned from `iterator_next`.

    # RESPONSE: RegisteredIterator
    # handle: Number - Iterator handle. Must be removed using `remove_iterator`when it is no more needed for the application.
    # Creates transaction iterator.    # Transaction iterator uses robust iteration methods that guaranty that everytransaction in the specified range isn't missed or iterated twice.
    # Iterated range can be reduced with some filters:
    # - `start_time` – the bottom time range. Only transactions with `now`more or equal to this value are iterated. If this parameter is omitted then there isno bottom time edge, so all the transactions since zero state are iterated.
    # - `end_time` – the upper time range. Only transactions with `now`less then this value are iterated. If this parameter is omitted then there isno upper time edge, so iterator never finishes.
    # - `shard_filter` – workchains and shard prefixes that reduce the set of interestingaccounts. Account address conforms to the shard filter ifit belongs to the filter workchain and the first bits of address match tothe shard prefix. Only transactions with suitable account addresses are iterated.
    # - `accounts_filter` – set of account addresses whose transactions must be iterated.
    # Note that accounts filter can conflict with shard filter so application must combinethese filters carefully.
    # Iterated item is a JSON objects with transaction data. The minimal set of returnedfields is:
    # ```textidaccount_addrnowbalance_delta(format:DEC)bounce { bounce_type }in_message {    id    value(format:DEC)    msg_type    src}out_messages {    id    value(format:DEC)    msg_type    dst}```Application can request an additional fields in the `result` parameter.
    # Another parameter that affects on the returned fields is the `include_transfers`.
    # When this parameter is `true` the iterator computes and adds `transfer` field containinglist of the useful `TransactionTransfer` objects.
    # Each transfer is calculated from the particular message related to the transactionand has the following structure:
    # - message – source message identifier.
    # - isBounced – indicates that the transaction is bounced, which means the value will be returned back to the sender.
    # - isDeposit – indicates that this transfer is the deposit (true) or withdraw (false).
    # - counterparty – account address of the transfer source or destination depending on `isDeposit`.
    # - value – amount of nano tokens transferred. The value is represented as a decimal stringbecause the actual value can be more precise than the JSON number can represent. Applicationmust use this string carefully – conversion to number can follow to loose of precision.
    # Application should call the `remove_iterator` when iterator is no longer required.
    def create_transaction_iterator(payload, &block)
    # INPUT: ParamsOfCreateTransactionIterator
    # start_time: Number<Optional> - Starting time to iterate from. If the application specifies this parameter then the iterationincludes blocks with `gen_utime` >= `start_time`.
 # Otherwise the iteration starts from zero state.
 # Must be specified in seconds.
    # end_time: Number<Optional> - Optional end time to iterate for. If the application specifies this parameter then the iterationincludes blocks with `gen_utime` < `end_time`.
 # Otherwise the iteration never stops.
 # Must be specified in seconds.
    # shard_filter: Array<Optional> - Shard prefix filters. If the application specifies this parameter and it is not an empty arraythen the iteration will include items related to accounts that belongs tothe specified shard prefixes.
 # Shard prefix must be represented as a string "workchain:prefix".
 # Where `workchain` is a signed integer and the `prefix` if a hexadecimalrepresentation if the 64-bit unsigned integer with tagged shard prefix.
 # For example: "0:3800000000000000".
 # Account address conforms to the shard filter ifit belongs to the filter workchain and the first bits of address match tothe shard prefix. Only transactions with suitable account addresses are iterated.
    # accounts_filter: Array<Optional> - Account address filter. Application can specify the list of accounts for whichit wants to iterate transactions.
 # If this parameter is missing or an empty list then the library iteratestransactions for all accounts that pass the shard filter.
 # Note that the library doesn't detect conflicts between the account filter and the shard filterif both are specified.
 # So it is an application responsibility to specify the correct filter combination.
    # result: String<Optional> - Projection (result) string. List of the fields that must be returned for iterated items.
 # This field is the same as the `result` parameter ofthe `query_collection` function.
 # Note that iterated items can contain additional fields that arenot requested in the `result`.
    # include_transfers: Boolean<Optional> - Include `transfers` field in iterated transactions. If this parameter is `true` then each transaction contains field`transfers` with list of transfer. See more about this structure in function description.

    # RESPONSE: RegisteredIterator
    # handle: Number - Iterator handle. Must be removed using `remove_iterator`when it is no more needed for the application.
    # Resumes transaction iterator.    # The iterator stays exactly at the same position where the `resume_state` was caught.
    # Note that `resume_state` doesn't store the account filter. If the application requiresto use the same account filter as it was when the iterator was created then the applicationmust pass the account filter again in `accounts_filter` parameter.
    # Application should call the `remove_iterator` when iterator is no longer required.
    def resume_transaction_iterator(payload, &block)
    # INPUT: ParamsOfResumeTransactionIterator
    # resume_state: Value - Iterator state from which to resume. Same as value returned from `iterator_next`.
    # accounts_filter: Array<Optional> - Account address filter. Application can specify the list of accounts for whichit wants to iterate transactions.
 # If this parameter is missing or an empty list then the library iteratestransactions for all accounts that passes the shard filter.
 # Note that the library doesn't detect conflicts between the account filter and the shard filterif both are specified.
 # So it is the application's responsibility to specify the correct filter combination.

    # RESPONSE: RegisteredIterator
    # handle: Number - Iterator handle. Must be removed using `remove_iterator`when it is no more needed for the application.
    # Returns next available items.    # In addition to available items this function returns the `has_more` flagindicating that the iterator isn't reach the end of the iterated range yet.
    # This function can return the empty list of available items butindicates that there are more items is available.
    # This situation appears when the iterator doesn't reach iterated rangebut database doesn't contains available items yet.
    # If application requests resume state in `return_resume_state` parameterthen this function returns `resume_state` that can be used later toresume the iteration from the position after returned items.
    # The structure of the items returned depends on the iterator used.
    # See the description to the appropriated iterator creation function.
    def iterator_next(payload, &block)
    # INPUT: ParamsOfIteratorNext
    # iterator: Number - Iterator handle
    # limit: Number<Optional> - Maximum count of the returned items. If value is missing or is less than 1 the library uses 1.
    # return_resume_state: Boolean<Optional> - Indicates that function must return the iterator state that can be used for resuming iteration.

    # RESPONSE: ResultOfIteratorNext
    # items: Array - Next available items. Note that `iterator_next` can return an empty items and `has_more` equals to `true`.
 # In this case the application have to continue iteration.
 # Such situation can take place when there is no data yet butthe requested `end_time` is not reached.
    # has_more: Boolean - Indicates that there are more available items in iterated range.
    # resume_state: Value<Optional> - Optional iterator state that can be used for resuming iteration. This field is returned only if the `return_resume_state` parameteris specified.
 # Note that `resume_state` corresponds to the iteration positionafter the returned items.
    # Removes an iterator    # Frees all resources allocated in library to serve iterator.
    # Application always should call the `remove_iterator` when iteratoris no longer required.
    def remove_iterator(payload, &block)
    # INPUT: RegisteredIterator
    # handle: Number - Iterator handle. Must be removed using `remove_iterator`when it is no more needed for the application.
    # Returns signature ID for configured network if it should be used in messages signature
    def get_signature_id(&block)

    # RESPONSE: ResultOfGetSignatureId
    # signature_id: Number<Optional> - Signature ID for configured network if it should be used in messages signature
</details> <details> <summary>DEBOT</summary>
    # [UNSTABLE](UNSTABLE.md) Creates and instance of DeBot.    # Downloads debot smart contract (code and data) from blockchain and createsan instance of Debot Engine for it.
 RemarksIt does not switch debot to context 0. Browser Callbacks are not called.
    def init(payload, &block)
    # INPUT: ParamsOfInit
    # address: String - Debot smart contract address

    # RESPONSE: RegisteredDebot
    # debot_handle: DebotHandle - Debot handle which references an instance of debot engine.
    # debot_abi: String - Debot abi as json string.
    # info: DebotInfo - Debot metadata.
    # [UNSTABLE](UNSTABLE.md) Starts the DeBot.    # Downloads debot smart contract from blockchain and switches it tocontext zero.
    # This function must be used by Debot Browser to start a dialog with debot.
    # While the function is executing, several Browser Callbacks can be called,since the debot tries to display all actions from the context 0 to the user.
    # When the debot starts SDK registers `BrowserCallbacks` AppObject.
    # Therefore when `debote.remove` is called the debot is being deleted and the callback is calledwith `finish`=`true` which indicates that it will never be used again.
    def start(payload, &block)
    # INPUT: ParamsOfStart
    # debot_handle: DebotHandle - Debot handle which references an instance of debot engine.
    # [UNSTABLE](UNSTABLE.md) Fetches DeBot metadata from blockchain.    # Downloads DeBot from blockchain and creates and fetches its metadata.
    def fetch(payload, &block)
    # INPUT: ParamsOfFetch
    # address: String - Debot smart contract address.

    # RESPONSE: ResultOfFetch
    # info: DebotInfo - Debot metadata.
    # [UNSTABLE](UNSTABLE.md) Executes debot action.    # Calls debot engine referenced by debot handle to execute input action.
    # Calls Debot Browser Callbacks if needed.
 RemarksChain of actions can be executed if input action generates a list of subactions.
    def execute(payload, &block)
    # INPUT: ParamsOfExecute
    # debot_handle: DebotHandle - Debot handle which references an instance of debot engine.
    # action: DebotAction - Debot Action that must be executed.
    # [UNSTABLE](UNSTABLE.md) Sends message to Debot.    # Used by Debot Browser to send response on Dinterface call or from other Debots.
    def send(payload, &block)
    # INPUT: ParamsOfSend
    # debot_handle: DebotHandle - Debot handle which references an instance of debot engine.
    # message: String - BOC of internal message to debot encoded in base64 format.
    # [UNSTABLE](UNSTABLE.md) Destroys debot handle.    # Removes handle from Client Context and drops debot engine referenced by that handle.
    def remove(payload, &block)
    # INPUT: ParamsOfRemove
    # debot_handle: DebotHandle - Debot handle which references an instance of debot engine.
</details> <details> <summary>PROOFS</summary>
    # Proves that a given block's data, which is queried from TONOS API, can be trusted.    # This function checks block proofs and compares given data with the proven.
    # If the given data differs from the proven, the exception will be thrown.
    # The input param is a single block's JSON object, which was queried from DApp server usingfunctions such as `net.query`, `net.query_collection` or `net.wait_for_collection`.
    # If block's BOC is not provided in the JSON, it will be queried from DApp server(in this case it is required to provide at least `id` of block).
    # Please note, that joins (like `signatures` in `Block`) are separated entities and not supported,so function will throw an exception in a case if JSON being checked has such entities in it.
    # If `cache_in_local_storage` in config is set to `true` (default), downloaded proofs andmaster-chain BOCs are saved into the persistent local storage (e.g. file system for nativeenvironments or browser's IndexedDB for the web); otherwise all the data is cached only inmemory in current client's context and will be lost after destruction of the client.
    # **Why Proofs are needed**Proofs are needed to ensure that the data downloaded from a DApp server is real blockchaindata. Checking proofs can protect from the malicious DApp server which can potentially providefake data, or also from "Man in the Middle" attacks class.
    # **What Proofs are**Simply, proof is a list of signatures of validators', which have signed this particular master-block.
    # The very first validator set's public keys are included in the zero-state. Whe know a root hashof the zero-state, because it is stored in the network configuration file, it is our authorityroot. For proving zero-state it is enough to calculate and compare its root hash.
    # In each new validator cycle the validator set is changed. The new one is stored in a key-block,which is signed by the validator set, which we already trust, the next validator set will bestored to the new key-block and signed by the current validator set, and so on.
    # In order to prove any block in the master-chain we need to check, that it has been signed bya trusted validator set. So we need to check all key-blocks' proofs, started from the zero-stateand until the block, which we want to prove. But it can take a lot of time and traffic todownload and prove all key-blocks on a client. For solving this, special trusted blocks are usedin Ever-SDK.
    # The trusted block is the authority root, as well, as the zero-state. Each trusted block is the`id` (e.g. `root_hash`) of the already proven key-block. There can be plenty of trustedblocks, so there can be a lot of authority roots. The hashes of trusted blocks for MainNetand DevNet are hardcoded in SDK in a separated binary file (trusted_key_blocks.bin) and isbeing updated for each release by using `update_trusted_blocks` utility.
    # See [update_trusted_blocks](../../../tools/update_trusted_blocks) directory for more info.
    # In future SDK releases, one will also be able to provide their hashes of trusted blocks forother networks, besides for MainNet and DevNet.
    # By using trusted key-blocks, in order to prove any block, we can prove chain of key-blocks tothe closest previous trusted key-block, not only to the zero-state.
    # But shard-blocks don't have proofs on DApp server. In this case, in order to prove any shard-block data, we search for a corresponding master-block, which contains the root hash of thisshard-block, or some shard block which is linked to that block in shard-chain. After provingthis master-block, we traverse through each link and calculate and compare hashes with links,one-by-one. After that we can ensure that this shard-block has also been proven.
    def proof_block_data(payload, &block)
    # INPUT: ParamsOfProofBlockData
    # block: Value - Single block's data, retrieved from TONOS API, that needs proof. Required fields are `id` and/or top-level `boc` (for block identification), others are optional.
    # Proves that a given transaction's data, which is queried from TONOS API, can be trusted.    # This function requests the corresponding block, checks block proofs, ensures that giventransaction exists in the proven block and compares given data with the proven.
    # If the given data differs from the proven, the exception will be thrown.
    # The input parameter is a single transaction's JSON object (see params description),which was queried from TONOS API using functions such as `net.query`, `net.query_collection`or `net.wait_for_collection`.
    # If transaction's BOC and/or `block_id` are not provided in the JSON, they will be queried fromTONOS API.
    # Please note, that joins (like `account`, `in_message`, `out_messages`, etc. in `Transaction`entity) are separated entities and not supported, so function will throw an exception in a caseif JSON being checked has such entities in it.
    # For more information about proofs checking, see description of `proof_block_data` function.
    def proof_transaction_data(payload, &block)
    # INPUT: ParamsOfProofTransactionData
    # transaction: Value - Single transaction's data as queried from DApp server, without modifications. The required fields are `id` and/or top-level `boc`, others are optional. In order to reduce network requests count, it is recommended to provide `block_id` and `boc` of transaction.
    # Proves that a given message's data, which is queried from TONOS API, can be trusted.    # This function first proves the corresponding transaction, ensures that the proven transactionrefers to the given message and compares given data with the proven.
    # If the given data differs from the proven, the exception will be thrown.
    # The input parameter is a single message's JSON object (see params description),which was queried from TONOS API using functions such as `net.query`, `net.query_collection`or `net.wait_for_collection`.
    # If message's BOC and/or non-null `src_transaction.id` or `dst_transaction.id` are not providedin the JSON, they will be queried from TONOS API.
    # Please note, that joins (like `block`, `dst_account`, `dst_transaction`, `src_account`,`src_transaction`, etc. in `Message` entity) are separated entities and not supported,so function will throw an exception in a case if JSON being checked has such entities in it.
    # For more information about proofs checking, see description of `proof_block_data` function.
    def proof_message_data(payload, &block)
    # INPUT: ParamsOfProofMessageData
    # message: Value - Single message's data as queried from DApp server, without modifications. The required fields are `id` and/or top-level `boc`, others are optional. In order to reduce network requests count, it is recommended to provide at least `boc` of message and non-null `src_transaction.id` or `dst_transaction.id`.
</details>

Tests

  1. create .env.test file inside root directory of this library with variables

example for NodeSE

spec_ffi=./ever-sdk/target/release/libton_client.dylib
server_address=http://localhost:80
giver_abi_name=GiverNodeSE
giver_amount=10000000000
  1. Run tests: inside folder of this library execute this commands
    rspec spec/binding.rb
    rspec spec/client.rb
    rspec spec/context.rb
    rspec spec/abi.rb
    rspec spec/boc.rb
    rspec spec/crypto.rb
    rspec spec/net.rb
    rspec spec/processing.rb
    rspec spec/tvm.rb
    rspec spec/utils.rb

Update


everscale-client-ruby update
 

or


curl https://raw.githubusercontent.com/tonlabs/ever-sdk/master/tools/api.json > api.json



everscale-client-ruby update ./api.json

or


cd everscale-client-ruby


./bin/everscale-client-ruby update