java.lang.Object
tech.deplant.java4ever.binding.Abi
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static class
static class
static class
static class
static class
static enum
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 TypeMethodDescriptionattachSignature
(@NonNull Context context, @NonNull Abi.ABI abi, @NonNull String publicKey, @NonNull String message, @NonNull String signature) Combines `hex`-encoded `signature` with `base64`-encoded `unsigned_message`.attachSignatureToMessageBody
(@NonNull Context context, @NonNull Abi.ABI abi, @NonNull String publicKey, @NonNull String message, @NonNull String signature) decodeAccountData
(@NonNull Context context, @NonNull Abi.ABI abi, @NonNull String data) Decodes account data using provided data BOC and ABI.decodeBoc
(@NonNull Context context, @NonNull Abi.AbiParam[] params, @NonNull String boc, @NonNull Boolean allowPartial) Decodes BOC into JSON as a set of provided parameters.decodeInitialData
(@NonNull Context context, Abi.ABI abi, @NonNull String data) 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).decodeMessage
(@NonNull Context context, @NonNull Abi.ABI abi, @NonNull String message) Decodes message body using provided message BOC and ABI.decodeMessageBody
(@NonNull Context context, @NonNull Abi.ABI abi, @NonNull String body, @NonNull Boolean isInternal) Decodes message body using provided body BOC and ABI.encodeAccount
(@NonNull Context context, @NonNull Abi.StateInitSource stateInit, Long balance, Long lastTransLt, Number lastPaid, Boc.BocCacheType bocCache) Creates account state BOCencodeInitialData
(@NonNull Context context, Abi.ABI abi, Map<String, Object> initialData, String initialPubkey, Boc.BocCacheType bocCache) 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.encodeInternalMessage
(@NonNull Context context, Abi.ABI abi, String address, String srcAddress, Abi.DeploySet deploySet, Abi.CallSet callSet, @NonNull String value, Boolean bounce, Boolean enableIhr) Encodes an internal ABI-compatible messageencodeMessage
(@NonNull Context context, @NonNull Abi.ABI abi, String address, Abi.DeploySet deploySet, Abi.CallSet callSet, @NonNull Abi.Signer signer, Number processingTryIndex) Encodes an ABI-compatible messageencodeMessageBody
(@NonNull Context context, @NonNull Abi.ABI abi, @NonNull Abi.CallSet callSet, @NonNull Boolean isInternal, @NonNull Abi.Signer signer, Number processingTryIndex) Encodes message body according to ABI function call.updateInitialData
(@NonNull Context context, Abi.ABI abi, @NonNull String data, Map<String, Object> initialData, String initialPubkey, Boc.BocCacheType bocCache) Updates initial account data with initial values for the contract's static variables and owner's public key.
-
Constructor Details
-
Abi
public Abi()
-
-
Method Details
-
encodeMessageBody
public static CompletableFuture<Abi.ResultOfEncodeMessageBody> encodeMessageBody(@NonNull @NonNull Context context, @NonNull @NonNull Abi.ABI abi, @NonNull @NonNull Abi.CallSet callSet, @NonNull @NonNull Boolean isInternal, @NonNull @NonNull Abi.Signer signer, Number processingTryIndex) Encodes message body according to ABI function call.- Parameters:
abi
- Contract ABI.callSet
- Function call parameters. Must be specified in non deploy message.In case of deploy message contains parameters of constructor.
isInternal
- True if internal message body must be encoded.signer
- Signing parameters.processingTryIndex
- 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.
-
attachSignatureToMessageBody
public static CompletableFuture<Abi.ResultOfAttachSignatureToMessageBody> attachSignatureToMessageBody(@NonNull @NonNull Context context, @NonNull @NonNull Abi.ABI abi, @NonNull @NonNull String publicKey, @NonNull @NonNull String message, @NonNull @NonNull String signature) - Parameters:
abi
- Contract ABIpublicKey
- Public key. Must be encoded with `hex`.message
- Unsigned message body BOC. Must be encoded with `base64`.signature
- Signature. Must be encoded with `hex`.
-
encodeMessage
public static CompletableFuture<Abi.ResultOfEncodeMessage> encodeMessage(@NonNull @NonNull Context context, @NonNull @NonNull Abi.ABI abi, String address, Abi.DeploySet deploySet, Abi.CallSet callSet, @NonNull @NonNull Abi.Signer signer, Number processingTryIndex) Encodes an ABI-compatible message- Parameters:
abi
- Contract ABI.address
- Target address the message will be sent to. Must be specified in case of non-deploy message.deploySet
- Deploy parameters. Must be specified in case of deploy message.callSet
- 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
- Signing parameters.processingTryIndex
- 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.
-
encodeInternalMessage
public static CompletableFuture<Abi.ResultOfEncodeInternalMessage> encodeInternalMessage(@NonNull @NonNull Context context, Abi.ABI abi, String address, String srcAddress, Abi.DeploySet deploySet, Abi.CallSet callSet, @NonNull @NonNull String value, Boolean bounce, Boolean enableIhr) Encodes an internal ABI-compatible message- Parameters:
abi
- Contract ABI. Can be None if both deploy_set and call_set are None.address
- Target address the message will be sent to. Must be specified in case of non-deploy message.srcAddress
- Source address of the message.deploySet
- Deploy parameters. Must be specified in case of deploy message.callSet
- 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
- Value in nanotokens to be sent with message.bounce
- Flag of bounceable message. Default is true.enableIhr
- Enable Instant Hypercube Routing for the message. Default is false.
-
attachSignature
public static CompletableFuture<Abi.ResultOfAttachSignature> attachSignature(@NonNull @NonNull Context context, @NonNull @NonNull Abi.ABI abi, @NonNull @NonNull String publicKey, @NonNull @NonNull String message, @NonNull @NonNull String signature) Combines `hex`-encoded `signature` with `base64`-encoded `unsigned_message`. Returns signed message encoded in `base64`.- Parameters:
abi
- Contract ABIpublicKey
- Public key encoded in `hex`.message
- Unsigned message BOC encoded in `base64`.signature
- Signature encoded in `hex`.
-
decodeMessage
public static CompletableFuture<Abi.DecodedMessageBody> decodeMessage(@NonNull @NonNull Context context, @NonNull @NonNull Abi.ABI abi, @NonNull @NonNull String message) Decodes message body using provided message BOC and ABI.- Parameters:
abi
- contract ABImessage
- Message BOC
-
decodeMessageBody
public static CompletableFuture<Abi.DecodedMessageBody> decodeMessageBody(@NonNull @NonNull Context context, @NonNull @NonNull Abi.ABI abi, @NonNull @NonNull String body, @NonNull @NonNull Boolean isInternal) Decodes message body using provided body BOC and ABI.- Parameters:
abi
- Contract ABI used to decode.body
- Message body BOC encoded in `base64`.isInternal
- True if the body belongs to the internal message.
-
encodeAccount
public static CompletableFuture<Abi.ResultOfEncodeAccount> encodeAccount(@NonNull @NonNull Context context, @NonNull @NonNull Abi.StateInitSource stateInit, Long balance, Long lastTransLt, Number lastPaid, Boc.BocCacheType bocCache) Creates account state BOC- Parameters:
stateInit
- Source of the account state init.balance
- Initial balance.lastTransLt
- Initial value for the `last_trans_lt`.lastPaid
- Initial value for the `last_paid`.bocCache
- Cache type to put the result. The BOC itself returned if no cache type provided
-
decodeAccountData
public static CompletableFuture<Abi.ResultOfDecodeAccountData> decodeAccountData(@NonNull @NonNull Context context, @NonNull @NonNull Abi.ABI abi, @NonNull @NonNull String data) Decodes account data using provided data BOC and ABI.- Parameters:
abi
- Contract ABIdata
- Data BOC or BOC handle
-
updateInitialData
public static CompletableFuture<Abi.ResultOfUpdateInitialData> updateInitialData(@NonNull @NonNull Context context, Abi.ABI abi, @NonNull @NonNull String data, Map<String, Object> initialData, String initialPubkey, Boc.BocCacheType bocCache) 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.- Parameters:
abi
- Contract ABIdata
- Data BOC or BOC handleinitialData
- List of initial values for contract's static variables. `abi` parameter should be provided to set initial datainitialPubkey
- Initial account owner's public key to set into account databocCache
- Cache type to put the result. The BOC itself returned if no cache type provided.
-
encodeInitialData
public static CompletableFuture<Abi.ResultOfEncodeInitialData> encodeInitialData(@NonNull @NonNull Context context, Abi.ABI abi, Map<String, Object> initialData, String initialPubkey, Boc.BocCacheType bocCache) 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.- Parameters:
abi
- Contract ABIinitialData
- List of initial values for contract's static variables. `abi` parameter should be provided to set initial datainitialPubkey
- Initial account owner's public key to set into account databocCache
- Cache type to put the result. The BOC itself returned if no cache type provided.
-
decodeInitialData
public static CompletableFuture<Abi.ResultOfDecodeInitialData> decodeInitialData(@NonNull @NonNull Context context, Abi.ABI abi, @NonNull @NonNull String data) 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.- Parameters:
abi
- Contract ABI. Initial data is decoded if this parameter is provideddata
- Data BOC or BOC handle
-
decodeBoc
public static CompletableFuture<Abi.ResultOfDecodeBoc> decodeBoc(@NonNull @NonNull Context context, @NonNull @NonNull Abi.AbiParam[] params, @NonNull @NonNull String boc, @NonNull @NonNull Boolean allowPartial) Decodes BOC into JSON as a set of provided parameters.- Parameters:
params
- Parameters to decode from BOCboc
- Data BOC or BOC handleallowPartial
-
-