java.lang.Object
tech.deplant.java4ever.binding.Boc
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static class
static class
static class
static class
static class
static class
static class
static class
static class
static class
static class
static class
static class
static class
static class
static class
static class
static class
static class
static class
static class
static class
static class
static class
static class
static class
static class
static class
static class
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet BOC from cachecacheSet
(@NonNull Context context, @NonNull String boc, @NonNull Boc.BocCacheType cacheType) Save BOC into cachestatic CompletableFuture<Void>
cacheUnpin
(@NonNull Context context, @NonNull String pin, String bocRef) Unpin BOCs with specified pin.decodeTvc
(@NonNull Context context, @NonNull String tvc, Boc.BocCacheType bocCache) Decodes tvc into code, data, libraries and special options.encodeBoc
(@NonNull Context context, @NonNull Boc.BuilderOp[] builder, Boc.BocCacheType bocCache) Encodes bag of cells (BOC) with builder operations.encodeTvc
(@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)getBlockchainConfig
(@NonNull Context context, @NonNull String blockBoc) Extract blockchain configuration from key block and also from zerostate.getBocDepth
(@NonNull Context context, @NonNull String boc) Calculates BOC depthgetBocHash
(@NonNull Context context, @NonNull String boc) Calculates BOC root hashgetCodeFromTvc
(@NonNull Context context, @NonNull String tvc) Extracts code from TVC contract imagegetCodeSalt
(@NonNull Context context, @NonNull String code, Boc.BocCacheType bocCache) Returns the contract code's salt if it is present.getCompilerVersion
(@NonNull Context context, @NonNull String code) Returns the compiler version used to compile the code.static CompletableFuture<Boc.ResultOfParse>
parseAccount
(@NonNull Context context, @NonNull String boc) Parses account boc into a JSONstatic CompletableFuture<Boc.ResultOfParse>
parseBlock
(@NonNull Context context, @NonNull String boc) Parses block boc into a JSONstatic CompletableFuture<Boc.ResultOfParse>
parseMessage
(@NonNull Context context, @NonNull String boc) Parses message boc into a JSONstatic CompletableFuture<Boc.ResultOfParse>
parseShardstate
(@NonNull Context context, @NonNull String boc, @NonNull String id, @NonNull Number workchainId) Parses shardstate boc into a JSONstatic CompletableFuture<Boc.ResultOfParse>
parseTransaction
(@NonNull Context context, @NonNull String boc) Parses transaction boc into a JSONsetCodeSalt
(@NonNull Context context, @NonNull String code, @NonNull String salt, Boc.BocCacheType bocCache) Sets new salt to contract code.
-
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 base64id
- Shardstate identificatorworkchainId
- 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 referencecacheType
- 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 namebocRef
- 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 handlebocCache
- 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 handlesalt
- Code salt to set. BOC encoded as base64 or BOC handlebocCache
- 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 handlebocCache
- 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 handledata
- Contract data BOC encoded as base64 or BOC handlelibrary
- Contract library BOC encoded as base64 or BOC handletick
- `special.tick` field. Specifies the contract ability to handle tick transactionstock
- `special.tock` field. Specifies the contract ability to handle tock transactionssplitDepth
- Is present and non-zero only in instances of large smart contractsbocCache
- 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
-