java.lang.Object
tech.deplant.java4ever.binding.Utils
utils
Contains methods of "utils" module.
Misc utility Functions.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic interfacestatic final recordstatic final recordstatic final recordstatic final recordstatic final recordstatic final recordstatic final recordstatic final recordstatic final recordstatic final record -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Utils.ResultOfCalcStorageFeecalcStorageFee(Context ctx, String account, Number period) utils.calc_storage_fee Calculates storage fee for an account over a specified time periodstatic Utils.ResultOfCompressZstdcompressZstd(Context ctx, String uncompressed, Number level) utils.compress_zstd Compresses data using Zstandard algorithmstatic Utils.ResultOfConvertAddressconvertAddress(Context ctx, String address, Utils.AddressStringFormat outputFormat) utils.convert_address Converts address from any TON format to any TON formatstatic Utils.ResultOfDecompressZstddecompressZstd(Context ctx, String compressed) utils.decompress_zstd Decompresses data using Zstandard algorithmstatic Utils.ResultOfGetAddressTypegetAddressType(Context ctx, String address) utils.get_address_type Validates and returns the type of any TON address.
-
Constructor Details
-
Utils
public Utils()
-
-
Method Details
-
convertAddress
public static Utils.ResultOfConvertAddress convertAddress(Context ctx, String address, Utils.AddressStringFormat outputFormat) throws EverSdkException utils.convert_address Converts address from any TON format to any TON format- Parameters:
address- Account address in any TON format.outputFormat- Specify the format to convert to.- Returns:
Utils.ResultOfConvertAddress- Throws:
EverSdkException
-
getAddressType
public static Utils.ResultOfGetAddressType getAddressType(Context ctx, String address) throws EverSdkException utils.get_address_type 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
- Parameters:
address- Account address in any TON format.- Returns:
Utils.ResultOfGetAddressType- Throws:
EverSdkException
-
calcStorageFee
public static Utils.ResultOfCalcStorageFee calcStorageFee(Context ctx, String account, Number period) throws EverSdkException utils.calc_storage_fee Calculates storage fee for an account over a specified time period- Parameters:
account-period-- Returns:
Utils.ResultOfCalcStorageFee- Throws:
EverSdkException
-
compressZstd
public static Utils.ResultOfCompressZstd compressZstd(Context ctx, String uncompressed, Number level) throws EverSdkException utils.compress_zstd Compresses data using Zstandard algorithm- Parameters:
uncompressed- Uncompressed data. Must be encoded as base64.level- 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`).- Returns:
Utils.ResultOfCompressZstd- Throws:
EverSdkException
-
decompressZstd
public static Utils.ResultOfDecompressZstd decompressZstd(Context ctx, String compressed) throws EverSdkException utils.decompress_zstd Decompresses data using Zstandard algorithm- Parameters:
compressed- Compressed data. Must be encoded as base64.- Returns:
Utils.ResultOfDecompressZstd- Throws:
EverSdkException
-