java.lang.Object
tech.deplant.java4ever.binding.Boc

public class Boc extends Object
  • Constructor Details

    • Boc

      public Boc()
  • Method Details

    • parseMessage

      public static CompletableFuture<Boc.ResultOfParse> parseMessage(@NonNull @NonNull Context context, @NonNull @NonNull String boc)
      Parses message boc into a JSON
      Parameters:
      boc - BOC encoded as base64
    • parseTransaction

      public static CompletableFuture<Boc.ResultOfParse> parseTransaction(@NonNull @NonNull Context context, @NonNull @NonNull String boc)
      Parses transaction boc into a JSON
      Parameters:
      boc - BOC encoded as base64
    • parseAccount

      public static CompletableFuture<Boc.ResultOfParse> parseAccount(@NonNull @NonNull Context context, @NonNull @NonNull String boc)
      Parses account boc into a JSON
      Parameters:
      boc - BOC encoded as base64
    • parseBlock

      public static CompletableFuture<Boc.ResultOfParse> parseBlock(@NonNull @NonNull Context context, @NonNull @NonNull String boc)
      Parses block boc into a JSON
      Parameters:
      boc - BOC encoded as base64
    • parseShardstate

      public static CompletableFuture<Boc.ResultOfParse> parseShardstate(@NonNull @NonNull Context context, @NonNull @NonNull String boc, @NonNull @NonNull String id, @NonNull @NonNull Number workchainId)
      Parses shardstate boc into a JSON
      Parameters:
      boc - BOC encoded as base64
      id - Shardstate identificator
      workchainId - Workchain shardstate belongs to
    • getBlockchainConfig

      public static CompletableFuture<Boc.ResultOfGetBlockchainConfig> getBlockchainConfig(@NonNull @NonNull Context context, @NonNull @NonNull String blockBoc)
      Extract blockchain configuration from key block and also from zerostate.
      Parameters:
      blockBoc - Key block BOC or zerostate BOC encoded as base64
    • getBocHash

      public static CompletableFuture<Boc.ResultOfGetBocHash> getBocHash(@NonNull @NonNull Context context, @NonNull @NonNull String boc)
      Calculates BOC root hash
      Parameters:
      boc - BOC encoded as base64 or BOC handle
    • getBocDepth

      public static CompletableFuture<Boc.ResultOfGetBocDepth> getBocDepth(@NonNull @NonNull Context context, @NonNull @NonNull String boc)
      Calculates BOC depth
      Parameters:
      boc - BOC encoded as base64 or BOC handle
    • getCodeFromTvc

      public static CompletableFuture<Boc.ResultOfGetCodeFromTvc> getCodeFromTvc(@NonNull @NonNull Context context, @NonNull @NonNull String tvc)
      Extracts code from TVC contract image
      Parameters:
      tvc - Contract TVC image or image BOC handle
    • cacheGet

      public static CompletableFuture<Boc.ResultOfBocCacheGet> cacheGet(@NonNull @NonNull Context context, @NonNull @NonNull String bocRef)
      Get BOC from cache
      Parameters:
      bocRef - Reference to the cached BOC
    • cacheSet

      public static CompletableFuture<Boc.ResultOfBocCacheSet> cacheSet(@NonNull @NonNull Context context, @NonNull @NonNull String boc, @NonNull @NonNull Boc.BocCacheType cacheType)
      Save BOC into cache
      Parameters:
      boc - BOC encoded as base64 or BOC reference
      cacheType - Cache type
    • cacheUnpin

      public static CompletableFuture<Void> cacheUnpin(@NonNull @NonNull Context context, @NonNull @NonNull String pin, String bocRef)
      Unpin BOCs with specified pin.
      Parameters:
      pin - Pinned name
      bocRef - Reference to the cached BOC. If it is provided then only referenced BOC is unpinned
    • encodeBoc

      public static CompletableFuture<Boc.ResultOfEncodeBoc> encodeBoc(@NonNull @NonNull Context context, @NonNull @NonNull Boc.BuilderOp[] builder, Boc.BocCacheType bocCache)
      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
      Parameters:
      builder - Cell builder operations.
      bocCache - Cache type to put the result. The BOC itself returned if no cache type provided.
    • getCodeSalt

      public static CompletableFuture<Boc.ResultOfGetCodeSalt> getCodeSalt(@NonNull @NonNull Context context, @NonNull @NonNull String code, Boc.BocCacheType bocCache)
      Returns the contract code's salt if it is present.
      Parameters:
      code - Contract code BOC encoded as base64 or code BOC handle
      bocCache - Cache type to put the result. The BOC itself returned if no cache type provided.
    • setCodeSalt

      public static CompletableFuture<Boc.ResultOfSetCodeSalt> setCodeSalt(@NonNull @NonNull Context context, @NonNull @NonNull String code, @NonNull @NonNull String salt, Boc.BocCacheType bocCache)
      Sets new salt to contract code.
      Parameters:
      code - Contract code BOC encoded as base64 or code BOC handle
      salt - Code salt to set. BOC encoded as base64 or BOC handle
      bocCache - Cache type to put the result. The BOC itself returned if no cache type provided.
    • decodeTvc

      public static CompletableFuture<Boc.ResultOfDecodeTvc> decodeTvc(@NonNull @NonNull Context context, @NonNull @NonNull String tvc, Boc.BocCacheType bocCache)
      Decodes tvc into code, data, libraries and special options.
      Parameters:
      tvc - Contract TVC image BOC encoded as base64 or BOC handle
      bocCache - Cache type to put the result. The BOC itself returned if no cache type provided.
    • encodeTvc

      public static CompletableFuture<Boc.ResultOfEncodeTvc> encodeTvc(@NonNull @NonNull Context context, String code, String data, String library, Boolean tick, Boolean tock, Number splitDepth, Boc.BocCacheType bocCache)
      Encodes tvc from code, data, libraries ans special options (see input params)
      Parameters:
      code - Contract code BOC encoded as base64 or BOC handle
      data - Contract data BOC encoded as base64 or BOC handle
      library - Contract library BOC encoded as base64 or BOC handle
      tick - `special.tick` field. Specifies the contract ability to handle tick transactions
      tock - `special.tock` field. Specifies the contract ability to handle tock transactions
      splitDepth - Is present and non-zero only in instances of large smart contracts
      bocCache - Cache type to put the result. The BOC itself returned if no cache type provided.
    • getCompilerVersion

      public static CompletableFuture<Boc.ResultOfGetCompilerVersion> getCompilerVersion(@NonNull @NonNull Context context, @NonNull @NonNull String code)
      Returns the compiler version used to compile the code.
      Parameters:
      code - Contract code BOC encoded as base64 or code BOC handle