From 78a4b42db3641e3f6a1b7eee716d77dd86c0cb62 Mon Sep 17 00:00:00 2001 From: nerzh Date: Sun, 19 Mar 2023 08:54:50 +0100 Subject: [PATCH] downgrade ios version to 12 --- .../Sources/ApiParser/CodeGenerator.swift | 2 + Package.swift | 2 +- Sources/EverscaleClientSwift/Abi/Abi.swift | 32 ++++++ Sources/EverscaleClientSwift/Boc/Boc.swift | 38 +++++++ .../EverscaleClientSwift/Client/Client.swift | 10 ++ .../EverscaleClientSwift/Crypto/Crypto.swift | 102 ++++++++++++++++++ .../EverscaleClientSwift/Debot/Debot.swift | 12 +++ Sources/EverscaleClientSwift/Net/Net.swift | 40 +++++++ .../Processing/Processing.swift | 6 ++ .../EverscaleClientSwift/Proofs/Proofs.swift | 6 ++ Sources/EverscaleClientSwift/Tvm/Tvm.swift | 6 ++ .../EverscaleClientSwift/Utils/Utils.swift | 10 ++ 12 files changed, 265 insertions(+), 1 deletion(-) diff --git a/ApiParser/Sources/ApiParser/CodeGenerator.swift b/ApiParser/Sources/ApiParser/CodeGenerator.swift index 3c36f1b..52fd000 100644 --- a/ApiParser/Sources/ApiParser/CodeGenerator.swift +++ b/ApiParser/Sources/ApiParser/CodeGenerator.swift @@ -180,6 +180,8 @@ class CodeGenerator { var result: String = .init() if let summary = swiftFunction.summary { result.append("\(tab)/// \(checkComment(summary))\n") } if let description = swiftFunction.description { result.append("\(tab)/// \(checkComment(description))\n") } + result.append("\(tab)@available(iOS 13, *)\n") + result.append("\(tab)@available(macOS 12, *)\n") result.append("\(tab)\(swiftFunction.accessType) func \(swiftFunction.name)(") for parameter in swiftFunction.params { result.append("_ \(parameter.name): \(parameter.type)") diff --git a/Package.swift b/Package.swift index eb5f401..a967558 100644 --- a/Package.swift +++ b/Package.swift @@ -7,7 +7,7 @@ let package = Package( name: "EverscaleClientSwift", platforms: [ .macOS(SupportedPlatform.MacOSVersion.v12), - .iOS(SupportedPlatform.IOSVersion.v13) + .iOS(SupportedPlatform.IOSVersion.v12) ], products: [ .library(name: "EverscaleClientSwift", targets: ["EverscaleClientSwift"]), diff --git a/Sources/EverscaleClientSwift/Abi/Abi.swift b/Sources/EverscaleClientSwift/Abi/Abi.swift index 5cf9ea1..d8d3f6c 100644 --- a/Sources/EverscaleClientSwift/Abi/Abi.swift +++ b/Sources/EverscaleClientSwift/Abi/Abi.swift @@ -19,6 +19,8 @@ public final class TSDKAbiModule { } /// Encodes message body according to ABI function call. + @available(iOS 13, *) + @available(macOS 12, *) public func encode_message_body(_ payload: TSDKParamsOfEncodeMessageBody) async throws -> TSDKResultOfEncodeMessageBody { try await withCheckedThrowingContinuation { continuation in do { @@ -50,6 +52,8 @@ public final class TSDKAbiModule { } } + @available(iOS 13, *) + @available(macOS 12, *) public func attach_signature_to_message_body(_ payload: TSDKParamsOfAttachSignatureToMessageBody) async throws -> TSDKResultOfAttachSignatureToMessageBody { try await withCheckedThrowingContinuation { continuation in do { @@ -115,6 +119,8 @@ public final class TSDKAbiModule { /// 1. Public key from deploy set. /// 2. Public key, specified in TVM file. /// 3. Public key, provided by signer. + @available(iOS 13, *) + @available(macOS 12, *) public func encode_message(_ payload: TSDKParamsOfEncodeMessage) async throws -> TSDKResultOfEncodeMessage { try await withCheckedThrowingContinuation { continuation in do { @@ -164,6 +170,8 @@ public final class TSDKAbiModule { /// Public key resolving priority: /// 1. Public key from deploy set. /// 2. Public key, specified in TVM file. + @available(iOS 13, *) + @available(macOS 12, *) public func encode_internal_message(_ payload: TSDKParamsOfEncodeInternalMessage) async throws -> TSDKResultOfEncodeInternalMessage { try await withCheckedThrowingContinuation { continuation in do { @@ -197,6 +205,8 @@ public final class TSDKAbiModule { } /// Combines `hex`-encoded `signature` with `base64`-encoded `unsigned_message`. Returns signed message encoded in `base64`. + @available(iOS 13, *) + @available(macOS 12, *) public func attach_signature(_ payload: TSDKParamsOfAttachSignature) async throws -> TSDKResultOfAttachSignature { try await withCheckedThrowingContinuation { continuation in do { @@ -230,6 +240,8 @@ public final class TSDKAbiModule { } /// Decodes message body using provided message BOC and ABI. + @available(iOS 13, *) + @available(macOS 12, *) public func decode_message(_ payload: TSDKParamsOfDecodeMessage) async throws -> TSDKDecodedMessageBody { try await withCheckedThrowingContinuation { continuation in do { @@ -263,6 +275,8 @@ public final class TSDKAbiModule { } /// Decodes message body using provided body BOC and ABI. + @available(iOS 13, *) + @available(macOS 12, *) public func decode_message_body(_ payload: TSDKParamsOfDecodeMessageBody) async throws -> TSDKDecodedMessageBody { try await withCheckedThrowingContinuation { continuation in do { @@ -300,6 +314,8 @@ public final class TSDKAbiModule { /// 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 + @available(iOS 13, *) + @available(macOS 12, *) public func encode_account(_ payload: TSDKParamsOfEncodeAccount) async throws -> TSDKResultOfEncodeAccount { try await withCheckedThrowingContinuation { continuation in do { @@ -335,6 +351,8 @@ public final class TSDKAbiModule { /// Decodes account data using provided data BOC and ABI. /// Note: this feature requires ABI 2.1 or higher. + @available(iOS 13, *) + @available(macOS 12, *) public func decode_account_data(_ payload: TSDKParamsOfDecodeAccountData) async throws -> TSDKResultOfDecodeAccountData { try await withCheckedThrowingContinuation { continuation in do { @@ -368,6 +386,8 @@ public final class TSDKAbiModule { } /// 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. + @available(iOS 13, *) + @available(macOS 12, *) public func update_initial_data(_ payload: TSDKParamsOfUpdateInitialData) async throws -> TSDKResultOfUpdateInitialData { try await withCheckedThrowingContinuation { continuation in do { @@ -403,6 +423,8 @@ public final class TSDKAbiModule { /// 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. + @available(iOS 13, *) + @available(macOS 12, *) public func encode_initial_data(_ payload: TSDKParamsOfEncodeInitialData) async throws -> TSDKResultOfEncodeInitialData { try await withCheckedThrowingContinuation { continuation in do { @@ -436,6 +458,8 @@ public final class TSDKAbiModule { } /// 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. + @available(iOS 13, *) + @available(macOS 12, *) public func decode_initial_data(_ payload: TSDKParamsOfDecodeInitialData) async throws -> TSDKResultOfDecodeInitialData { try await withCheckedThrowingContinuation { continuation in do { @@ -479,6 +503,8 @@ public final class TSDKAbiModule { /// 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()`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. + @available(iOS 13, *) + @available(macOS 12, *) public func decode_boc(_ payload: TSDKParamsOfDecodeBoc) async throws -> TSDKResultOfDecodeBoc { try await withCheckedThrowingContinuation { continuation in do { @@ -512,6 +538,8 @@ public final class TSDKAbiModule { } /// Encodes given parameters in JSON into a BOC using param types from ABI. + @available(iOS 13, *) + @available(macOS 12, *) public func encode_boc(_ payload: TSDKParamsOfAbiEncodeBoc) async throws -> TSDKResultOfAbiEncodeBoc { try await withCheckedThrowingContinuation { continuation in do { @@ -545,6 +573,8 @@ public final class TSDKAbiModule { } /// Calculates contract function ID by contract ABI + @available(iOS 13, *) + @available(macOS 12, *) public func calc_function_id(_ payload: TSDKParamsOfCalcFunctionId) async throws -> TSDKResultOfCalcFunctionId { try await withCheckedThrowingContinuation { continuation in do { @@ -578,6 +608,8 @@ public final class TSDKAbiModule { } /// Extracts signature from message body and calculates hash to verify the signature + @available(iOS 13, *) + @available(macOS 12, *) public func get_signature_data(_ payload: TSDKParamsOfGetSignatureData) async throws -> TSDKResultOfGetSignatureData { try await withCheckedThrowingContinuation { continuation in do { diff --git a/Sources/EverscaleClientSwift/Boc/Boc.swift b/Sources/EverscaleClientSwift/Boc/Boc.swift index 8ed1498..a34d099 100644 --- a/Sources/EverscaleClientSwift/Boc/Boc.swift +++ b/Sources/EverscaleClientSwift/Boc/Boc.swift @@ -21,6 +21,8 @@ public final class TSDKBocModule { /// Parses message boc into a JSON /// JSON structure is compatible with GraphQL API message object + @available(iOS 13, *) + @available(macOS 12, *) public func parse_message(_ payload: TSDKParamsOfParse) async throws -> TSDKResultOfParse { try await withCheckedThrowingContinuation { continuation in do { @@ -56,6 +58,8 @@ public final class TSDKBocModule { /// Parses transaction boc into a JSON /// JSON structure is compatible with GraphQL API transaction object + @available(iOS 13, *) + @available(macOS 12, *) public func parse_transaction(_ payload: TSDKParamsOfParse) async throws -> TSDKResultOfParse { try await withCheckedThrowingContinuation { continuation in do { @@ -91,6 +95,8 @@ public final class TSDKBocModule { /// Parses account boc into a JSON /// JSON structure is compatible with GraphQL API account object + @available(iOS 13, *) + @available(macOS 12, *) public func parse_account(_ payload: TSDKParamsOfParse) async throws -> TSDKResultOfParse { try await withCheckedThrowingContinuation { continuation in do { @@ -126,6 +132,8 @@ public final class TSDKBocModule { /// Parses block boc into a JSON /// JSON structure is compatible with GraphQL API block object + @available(iOS 13, *) + @available(macOS 12, *) public func parse_block(_ payload: TSDKParamsOfParse) async throws -> TSDKResultOfParse { try await withCheckedThrowingContinuation { continuation in do { @@ -161,6 +169,8 @@ public final class TSDKBocModule { /// Parses shardstate boc into a JSON /// JSON structure is compatible with GraphQL API shardstate object + @available(iOS 13, *) + @available(macOS 12, *) public func parse_shardstate(_ payload: TSDKParamsOfParseShardstate) async throws -> TSDKResultOfParse { try await withCheckedThrowingContinuation { continuation in do { @@ -194,6 +204,8 @@ public final class TSDKBocModule { } /// Extract blockchain configuration from key block and also from zerostate. + @available(iOS 13, *) + @available(macOS 12, *) public func get_blockchain_config(_ payload: TSDKParamsOfGetBlockchainConfig) async throws -> TSDKResultOfGetBlockchainConfig { try await withCheckedThrowingContinuation { continuation in do { @@ -227,6 +239,8 @@ public final class TSDKBocModule { } /// Calculates BOC root hash + @available(iOS 13, *) + @available(macOS 12, *) public func get_boc_hash(_ payload: TSDKParamsOfGetBocHash) async throws -> TSDKResultOfGetBocHash { try await withCheckedThrowingContinuation { continuation in do { @@ -260,6 +274,8 @@ public final class TSDKBocModule { } /// Calculates BOC depth + @available(iOS 13, *) + @available(macOS 12, *) public func get_boc_depth(_ payload: TSDKParamsOfGetBocDepth) async throws -> TSDKResultOfGetBocDepth { try await withCheckedThrowingContinuation { continuation in do { @@ -293,6 +309,8 @@ public final class TSDKBocModule { } /// Extracts code from TVC contract image + @available(iOS 13, *) + @available(macOS 12, *) public func get_code_from_tvc(_ payload: TSDKParamsOfGetCodeFromTvc) async throws -> TSDKResultOfGetCodeFromTvc { try await withCheckedThrowingContinuation { continuation in do { @@ -326,6 +344,8 @@ public final class TSDKBocModule { } /// Get BOC from cache + @available(iOS 13, *) + @available(macOS 12, *) public func cache_get(_ payload: TSDKParamsOfBocCacheGet) async throws -> TSDKResultOfBocCacheGet { try await withCheckedThrowingContinuation { continuation in do { @@ -359,6 +379,8 @@ public final class TSDKBocModule { } /// Save BOC into cache or increase pin counter for existing pinned BOC + @available(iOS 13, *) + @available(macOS 12, *) public func cache_set(_ payload: TSDKParamsOfBocCacheSet) async throws -> TSDKResultOfBocCacheSet { try await withCheckedThrowingContinuation { continuation in do { @@ -392,6 +414,8 @@ public final class TSDKBocModule { } /// 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 + @available(iOS 13, *) + @available(macOS 12, *) public func cache_unpin(_ payload: TSDKParamsOfBocCacheUnpin) async throws -> TSDKNoneResult { try await withCheckedThrowingContinuation { continuation in do { @@ -425,6 +449,8 @@ public final class TSDKBocModule { } /// 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. + @available(iOS 13, *) + @available(macOS 12, *) public func encode_boc(_ payload: TSDKParamsOfEncodeBoc) async throws -> TSDKResultOfEncodeBoc { try await withCheckedThrowingContinuation { continuation in do { @@ -458,6 +484,8 @@ public final class TSDKBocModule { } /// Returns the contract code's salt if it is present. + @available(iOS 13, *) + @available(macOS 12, *) public func get_code_salt(_ payload: TSDKParamsOfGetCodeSalt) async throws -> TSDKResultOfGetCodeSalt { try await withCheckedThrowingContinuation { continuation in do { @@ -493,6 +521,8 @@ public final class TSDKBocModule { /// Sets new salt to contract code. /// Returns the new contract code with salt. + @available(iOS 13, *) + @available(macOS 12, *) public func set_code_salt(_ payload: TSDKParamsOfSetCodeSalt) async throws -> TSDKResultOfSetCodeSalt { try await withCheckedThrowingContinuation { continuation in do { @@ -526,6 +556,8 @@ public final class TSDKBocModule { } /// Decodes tvc into code, data, libraries and special options. + @available(iOS 13, *) + @available(macOS 12, *) public func decode_tvc(_ payload: TSDKParamsOfDecodeTvc) async throws -> TSDKResultOfDecodeTvc { try await withCheckedThrowingContinuation { continuation in do { @@ -559,6 +591,8 @@ public final class TSDKBocModule { } /// Encodes tvc from code, data, libraries ans special options (see input params) + @available(iOS 13, *) + @available(macOS 12, *) public func encode_tvc(_ payload: TSDKParamsOfEncodeTvc) async throws -> TSDKResultOfEncodeTvc { try await withCheckedThrowingContinuation { continuation in do { @@ -594,6 +628,8 @@ public final class TSDKBocModule { /// Encodes a message /// Allows to encode any external inbound message. + @available(iOS 13, *) + @available(macOS 12, *) public func encode_external_in_message(_ payload: TSDKParamsOfEncodeExternalInMessage) async throws -> TSDKResultOfEncodeExternalInMessage { try await withCheckedThrowingContinuation { continuation in do { @@ -627,6 +663,8 @@ public final class TSDKBocModule { } /// Returns the compiler version used to compile the code. + @available(iOS 13, *) + @available(macOS 12, *) public func get_compiler_version(_ payload: TSDKParamsOfGetCompilerVersion) async throws -> TSDKResultOfGetCompilerVersion { try await withCheckedThrowingContinuation { continuation in do { diff --git a/Sources/EverscaleClientSwift/Client/Client.swift b/Sources/EverscaleClientSwift/Client/Client.swift index eda1bcc..2142480 100644 --- a/Sources/EverscaleClientSwift/Client/Client.swift +++ b/Sources/EverscaleClientSwift/Client/Client.swift @@ -39,6 +39,8 @@ public final class TSDKClientModule { } /// Returns Core Library API reference + @available(iOS 13, *) + @available(macOS 12, *) public func get_api_reference() async throws -> TSDKResultOfGetApiReference { try await withCheckedThrowingContinuation { continuation in do { @@ -72,6 +74,8 @@ public final class TSDKClientModule { } /// Returns Core Library version + @available(iOS 13, *) + @available(macOS 12, *) public func version() async throws -> TSDKResultOfVersion { try await withCheckedThrowingContinuation { continuation in do { @@ -105,6 +109,8 @@ public final class TSDKClientModule { } /// Returns Core Library API reference + @available(iOS 13, *) + @available(macOS 12, *) public func config() async throws -> TSDKClientConfig { try await withCheckedThrowingContinuation { continuation in do { @@ -138,6 +144,8 @@ public final class TSDKClientModule { } /// Returns detailed information about this build. + @available(iOS 13, *) + @available(macOS 12, *) public func build_info() async throws -> TSDKResultOfBuildInfo { try await withCheckedThrowingContinuation { continuation in do { @@ -171,6 +179,8 @@ public final class TSDKClientModule { } /// Resolves application request processing result + @available(iOS 13, *) + @available(macOS 12, *) public func resolve_app_request(_ payload: TSDKParamsOfResolveAppRequest) async throws -> TSDKNoneResult { try await withCheckedThrowingContinuation { continuation in do { diff --git a/Sources/EverscaleClientSwift/Crypto/Crypto.swift b/Sources/EverscaleClientSwift/Crypto/Crypto.swift index 079cfff..d02e53c 100644 --- a/Sources/EverscaleClientSwift/Crypto/Crypto.swift +++ b/Sources/EverscaleClientSwift/Crypto/Crypto.swift @@ -23,6 +23,8 @@ public final class TSDKCryptoModule { /// 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] + @available(iOS 13, *) + @available(macOS 12, *) public func factorize(_ payload: TSDKParamsOfFactorize) async throws -> TSDKResultOfFactorize { try await withCheckedThrowingContinuation { continuation in do { @@ -60,6 +62,8 @@ public final class TSDKCryptoModule { /// Modular exponentiation /// Performs modular exponentiation for big integers (`base`^`exponent` mod `modulus`). /// See [https://en.wikipedia.org/wiki/Modular_exponentiation] + @available(iOS 13, *) + @available(macOS 12, *) public func modular_power(_ payload: TSDKParamsOfModularPower) async throws -> TSDKResultOfModularPower { try await withCheckedThrowingContinuation { continuation in do { @@ -93,6 +97,8 @@ public final class TSDKCryptoModule { } /// Calculates CRC16 using TON algorithm. + @available(iOS 13, *) + @available(macOS 12, *) public func ton_crc16(_ payload: TSDKParamsOfTonCrc16) async throws -> TSDKResultOfTonCrc16 { try await withCheckedThrowingContinuation { continuation in do { @@ -126,6 +132,8 @@ public final class TSDKCryptoModule { } /// Generates random byte array of the specified length and returns it in `base64` format + @available(iOS 13, *) + @available(macOS 12, *) public func generate_random_bytes(_ payload: TSDKParamsOfGenerateRandomBytes) async throws -> TSDKResultOfGenerateRandomBytes { try await withCheckedThrowingContinuation { continuation in do { @@ -159,6 +167,8 @@ public final class TSDKCryptoModule { } /// Converts public key to ton safe_format + @available(iOS 13, *) + @available(macOS 12, *) public func convert_public_key_to_ton_safe_format(_ payload: TSDKParamsOfConvertPublicKeyToTonSafeFormat) async throws -> TSDKResultOfConvertPublicKeyToTonSafeFormat { try await withCheckedThrowingContinuation { continuation in do { @@ -192,6 +202,8 @@ public final class TSDKCryptoModule { } /// Generates random ed25519 key pair. + @available(iOS 13, *) + @available(macOS 12, *) public func generate_random_sign_keys() async throws -> TSDKKeyPair { try await withCheckedThrowingContinuation { continuation in do { @@ -225,6 +237,8 @@ public final class TSDKCryptoModule { } /// Signs a data using the provided keys. + @available(iOS 13, *) + @available(macOS 12, *) public func sign(_ payload: TSDKParamsOfSign) async throws -> TSDKResultOfSign { try await withCheckedThrowingContinuation { continuation in do { @@ -258,6 +272,8 @@ public final class TSDKCryptoModule { } /// Verifies signed data using the provided public key. Raises error if verification is failed. + @available(iOS 13, *) + @available(macOS 12, *) public func verify_signature(_ payload: TSDKParamsOfVerifySignature) async throws -> TSDKResultOfVerifySignature { try await withCheckedThrowingContinuation { continuation in do { @@ -291,6 +307,8 @@ public final class TSDKCryptoModule { } /// Calculates SHA256 hash of the specified data. + @available(iOS 13, *) + @available(macOS 12, *) public func sha256(_ payload: TSDKParamsOfHash) async throws -> TSDKResultOfHash { try await withCheckedThrowingContinuation { continuation in do { @@ -324,6 +342,8 @@ public final class TSDKCryptoModule { } /// Calculates SHA512 hash of the specified data. + @available(iOS 13, *) + @available(macOS 12, *) public func sha512(_ payload: TSDKParamsOfHash) async throws -> TSDKResultOfHash { try await withCheckedThrowingContinuation { continuation in do { @@ -363,6 +383,8 @@ public final class TSDKCryptoModule { /// 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` + @available(iOS 13, *) + @available(macOS 12, *) public func scrypt(_ payload: TSDKParamsOfScrypt) async throws -> TSDKResultOfScrypt { try await withCheckedThrowingContinuation { continuation in do { @@ -400,6 +422,8 @@ public final class TSDKCryptoModule { /// 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/). + @available(iOS 13, *) + @available(macOS 12, *) public func nacl_sign_keypair_from_secret_key(_ payload: TSDKParamsOfNaclSignKeyPairFromSecret) async throws -> TSDKKeyPair { try await withCheckedThrowingContinuation { continuation in do { @@ -433,6 +457,8 @@ public final class TSDKCryptoModule { } /// Signs data using the signer's secret key. + @available(iOS 13, *) + @available(macOS 12, *) public func nacl_sign(_ payload: TSDKParamsOfNaclSign) async throws -> TSDKResultOfNaclSign { try await withCheckedThrowingContinuation { continuation in do { @@ -470,6 +496,8 @@ public final class TSDKCryptoModule { /// 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. + @available(iOS 13, *) + @available(macOS 12, *) public func nacl_sign_open(_ payload: TSDKParamsOfNaclSignOpen) async throws -> TSDKResultOfNaclSignOpen { try await withCheckedThrowingContinuation { continuation in do { @@ -505,6 +533,8 @@ public final class TSDKCryptoModule { /// 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`. + @available(iOS 13, *) + @available(macOS 12, *) public func nacl_sign_detached(_ payload: TSDKParamsOfNaclSign) async throws -> TSDKResultOfNaclSignDetached { try await withCheckedThrowingContinuation { continuation in do { @@ -538,6 +568,8 @@ public final class TSDKCryptoModule { } /// Verifies the signature with public key and `unsigned` data. + @available(iOS 13, *) + @available(macOS 12, *) public func nacl_sign_detached_verify(_ payload: TSDKParamsOfNaclSignDetachedVerify) async throws -> TSDKResultOfNaclSignDetachedVerify { try await withCheckedThrowingContinuation { continuation in do { @@ -571,6 +603,8 @@ public final class TSDKCryptoModule { } /// Generates a random NaCl key pair + @available(iOS 13, *) + @available(macOS 12, *) public func nacl_box_keypair() async throws -> TSDKKeyPair { try await withCheckedThrowingContinuation { continuation in do { @@ -604,6 +638,8 @@ public final class TSDKCryptoModule { } /// Generates key pair from a secret key + @available(iOS 13, *) + @available(macOS 12, *) public func nacl_box_keypair_from_secret_key(_ payload: TSDKParamsOfNaclBoxKeyPairFromSecret) async throws -> TSDKKeyPair { try await withCheckedThrowingContinuation { continuation in do { @@ -639,6 +675,8 @@ public final class TSDKCryptoModule { /// Public key authenticated encryption /// Encrypt and authenticate a message using the senders secret key, the receivers publickey, and a nonce. + @available(iOS 13, *) + @available(macOS 12, *) public func nacl_box(_ payload: TSDKParamsOfNaclBox) async throws -> TSDKResultOfNaclBox { try await withCheckedThrowingContinuation { continuation in do { @@ -672,6 +710,8 @@ public final class TSDKCryptoModule { } /// Decrypt and verify the cipher text using the receivers secret key, the senders public key, and the nonce. + @available(iOS 13, *) + @available(macOS 12, *) public func nacl_box_open(_ payload: TSDKParamsOfNaclBoxOpen) async throws -> TSDKResultOfNaclBoxOpen { try await withCheckedThrowingContinuation { continuation in do { @@ -705,6 +745,8 @@ public final class TSDKCryptoModule { } /// Encrypt and authenticate message using nonce and secret key. + @available(iOS 13, *) + @available(macOS 12, *) public func nacl_secret_box(_ payload: TSDKParamsOfNaclSecretBox) async throws -> TSDKResultOfNaclBox { try await withCheckedThrowingContinuation { continuation in do { @@ -738,6 +780,8 @@ public final class TSDKCryptoModule { } /// Decrypts and verifies cipher text using `nonce` and secret `key`. + @available(iOS 13, *) + @available(macOS 12, *) public func nacl_secret_box_open(_ payload: TSDKParamsOfNaclSecretBoxOpen) async throws -> TSDKResultOfNaclBoxOpen { try await withCheckedThrowingContinuation { continuation in do { @@ -771,6 +815,8 @@ public final class TSDKCryptoModule { } /// Prints the list of words from the specified dictionary + @available(iOS 13, *) + @available(macOS 12, *) public func mnemonic_words(_ payload: TSDKParamsOfMnemonicWords) async throws -> TSDKResultOfMnemonicWords { try await withCheckedThrowingContinuation { continuation in do { @@ -806,6 +852,8 @@ public final class TSDKCryptoModule { /// Generates a random mnemonic /// Generates a random mnemonic from the specified dictionary and word count + @available(iOS 13, *) + @available(macOS 12, *) public func mnemonic_from_random(_ payload: TSDKParamsOfMnemonicFromRandom) async throws -> TSDKResultOfMnemonicFromRandom { try await withCheckedThrowingContinuation { continuation in do { @@ -839,6 +887,8 @@ public final class TSDKCryptoModule { } /// Generates mnemonic from pre-generated entropy + @available(iOS 13, *) + @available(macOS 12, *) public func mnemonic_from_entropy(_ payload: TSDKParamsOfMnemonicFromEntropy) async throws -> TSDKResultOfMnemonicFromEntropy { try await withCheckedThrowingContinuation { continuation in do { @@ -874,6 +924,8 @@ public final class TSDKCryptoModule { /// Validates a mnemonic phrase /// The phrase supplied will be checked for word length and validated according to the checksumspecified in BIP0039. + @available(iOS 13, *) + @available(macOS 12, *) public func mnemonic_verify(_ payload: TSDKParamsOfMnemonicVerify) async throws -> TSDKResultOfMnemonicVerify { try await withCheckedThrowingContinuation { continuation in do { @@ -909,6 +961,8 @@ public final class TSDKCryptoModule { /// 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 + @available(iOS 13, *) + @available(macOS 12, *) public func mnemonic_derive_sign_keys(_ payload: TSDKParamsOfMnemonicDeriveSignKeys) async throws -> TSDKKeyPair { try await withCheckedThrowingContinuation { continuation in do { @@ -942,6 +996,8 @@ public final class TSDKCryptoModule { } /// Generates an extended master private key that will be the root for all the derived keys + @available(iOS 13, *) + @available(macOS 12, *) public func hdkey_xprv_from_mnemonic(_ payload: TSDKParamsOfHDKeyXPrvFromMnemonic) async throws -> TSDKResultOfHDKeyXPrvFromMnemonic { try await withCheckedThrowingContinuation { continuation in do { @@ -975,6 +1031,8 @@ public final class TSDKCryptoModule { } /// Returns extended private key derived from the specified extended private key and child index + @available(iOS 13, *) + @available(macOS 12, *) public func hdkey_derive_from_xprv(_ payload: TSDKParamsOfHDKeyDeriveFromXPrv) async throws -> TSDKResultOfHDKeyDeriveFromXPrv { try await withCheckedThrowingContinuation { continuation in do { @@ -1008,6 +1066,8 @@ public final class TSDKCryptoModule { } /// Derives the extended private key from the specified key and path + @available(iOS 13, *) + @available(macOS 12, *) public func hdkey_derive_from_xprv_path(_ payload: TSDKParamsOfHDKeyDeriveFromXPrvPath) async throws -> TSDKResultOfHDKeyDeriveFromXPrvPath { try await withCheckedThrowingContinuation { continuation in do { @@ -1041,6 +1101,8 @@ public final class TSDKCryptoModule { } /// Extracts the private key from the serialized extended private key + @available(iOS 13, *) + @available(macOS 12, *) public func hdkey_secret_from_xprv(_ payload: TSDKParamsOfHDKeySecretFromXPrv) async throws -> TSDKResultOfHDKeySecretFromXPrv { try await withCheckedThrowingContinuation { continuation in do { @@ -1074,6 +1136,8 @@ public final class TSDKCryptoModule { } /// Extracts the public key from the serialized extended private key + @available(iOS 13, *) + @available(macOS 12, *) public func hdkey_public_from_xprv(_ payload: TSDKParamsOfHDKeyPublicFromXPrv) async throws -> TSDKResultOfHDKeyPublicFromXPrv { try await withCheckedThrowingContinuation { continuation in do { @@ -1107,6 +1171,8 @@ public final class TSDKCryptoModule { } /// Performs symmetric `chacha20` encryption. + @available(iOS 13, *) + @available(macOS 12, *) public func chacha20(_ payload: TSDKParamsOfChaCha20) async throws -> TSDKResultOfChaCha20 { try await withCheckedThrowingContinuation { continuation in do { @@ -1148,6 +1214,8 @@ public final class TSDKCryptoModule { /// 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. + @available(iOS 13, *) + @available(macOS 12, *) public func create_crypto_box(_ payload: TSDKParamsOfCreateCryptoBox) async throws -> TSDKRegisteredCryptoBox { try await withCheckedThrowingContinuation { continuation in do { @@ -1181,6 +1249,8 @@ public final class TSDKCryptoModule { } /// Removes Crypto Box. Clears all secret data. + @available(iOS 13, *) + @available(macOS 12, *) public func remove_crypto_box(_ payload: TSDKRegisteredCryptoBox) async throws -> TSDKNoneResult { try await withCheckedThrowingContinuation { continuation in do { @@ -1214,6 +1284,8 @@ public final class TSDKCryptoModule { } /// Get Crypto Box Info. Used to get `encrypted_secret` that should be used for all the cryptobox initializations except the first one. + @available(iOS 13, *) + @available(macOS 12, *) public func get_crypto_box_info(_ payload: TSDKRegisteredCryptoBox) async throws -> TSDKResultOfGetCryptoBoxInfo { try await withCheckedThrowingContinuation { continuation in do { @@ -1249,6 +1321,8 @@ public final class TSDKCryptoModule { /// 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. + @available(iOS 13, *) + @available(macOS 12, *) public func get_crypto_box_seed_phrase(_ payload: TSDKRegisteredCryptoBox) async throws -> TSDKResultOfGetCryptoBoxSeedPhrase { try await withCheckedThrowingContinuation { continuation in do { @@ -1282,6 +1356,8 @@ public final class TSDKCryptoModule { } /// Get handle of Signing Box derived from Crypto Box. + @available(iOS 13, *) + @available(macOS 12, *) public func get_signing_box_from_crypto_box(_ payload: TSDKParamsOfGetSigningBoxFromCryptoBox) async throws -> TSDKRegisteredSigningBox { try await withCheckedThrowingContinuation { continuation in do { @@ -1319,6 +1395,8 @@ public final class TSDKCryptoModule { /// 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. + @available(iOS 13, *) + @available(macOS 12, *) public func get_encryption_box_from_crypto_box(_ payload: TSDKParamsOfGetEncryptionBoxFromCryptoBox) async throws -> TSDKRegisteredEncryptionBox { try await withCheckedThrowingContinuation { continuation in do { @@ -1352,6 +1430,8 @@ public final class TSDKCryptoModule { } /// Removes cached secrets (overwrites with zeroes) from all signing and encryption boxes, derived from crypto box. + @available(iOS 13, *) + @available(macOS 12, *) public func clear_crypto_box_secret_cache(_ payload: TSDKRegisteredCryptoBox) async throws -> TSDKNoneResult { try await withCheckedThrowingContinuation { continuation in do { @@ -1385,6 +1465,8 @@ public final class TSDKCryptoModule { } /// Register an application implemented signing box. + @available(iOS 13, *) + @available(macOS 12, *) public func register_signing_box() async throws -> TSDKRegisteredSigningBox { try await withCheckedThrowingContinuation { continuation in do { @@ -1418,6 +1500,8 @@ public final class TSDKCryptoModule { } /// Creates a default signing box implementation. + @available(iOS 13, *) + @available(macOS 12, *) public func get_signing_box(_ payload: TSDKKeyPair) async throws -> TSDKRegisteredSigningBox { try await withCheckedThrowingContinuation { continuation in do { @@ -1451,6 +1535,8 @@ public final class TSDKCryptoModule { } /// Returns public key of signing key pair. + @available(iOS 13, *) + @available(macOS 12, *) public func signing_box_get_public_key(_ payload: TSDKRegisteredSigningBox) async throws -> TSDKResultOfSigningBoxGetPublicKey { try await withCheckedThrowingContinuation { continuation in do { @@ -1484,6 +1570,8 @@ public final class TSDKCryptoModule { } /// Returns signed user data. + @available(iOS 13, *) + @available(macOS 12, *) public func signing_box_sign(_ payload: TSDKParamsOfSigningBoxSign) async throws -> TSDKResultOfSigningBoxSign { try await withCheckedThrowingContinuation { continuation in do { @@ -1517,6 +1605,8 @@ public final class TSDKCryptoModule { } /// Removes signing box from SDK. + @available(iOS 13, *) + @available(macOS 12, *) public func remove_signing_box(_ payload: TSDKRegisteredSigningBox) async throws -> TSDKNoneResult { try await withCheckedThrowingContinuation { continuation in do { @@ -1550,6 +1640,8 @@ public final class TSDKCryptoModule { } /// Register an application implemented encryption box. + @available(iOS 13, *) + @available(macOS 12, *) public func register_encryption_box() async throws -> TSDKRegisteredEncryptionBox { try await withCheckedThrowingContinuation { continuation in do { @@ -1583,6 +1675,8 @@ public final class TSDKCryptoModule { } /// Removes encryption box from SDK + @available(iOS 13, *) + @available(macOS 12, *) public func remove_encryption_box(_ payload: TSDKRegisteredEncryptionBox) async throws -> TSDKNoneResult { try await withCheckedThrowingContinuation { continuation in do { @@ -1616,6 +1710,8 @@ public final class TSDKCryptoModule { } /// Queries info from the given encryption box + @available(iOS 13, *) + @available(macOS 12, *) public func encryption_box_get_info(_ payload: TSDKParamsOfEncryptionBoxGetInfo) async throws -> TSDKResultOfEncryptionBoxGetInfo { try await withCheckedThrowingContinuation { continuation in do { @@ -1651,6 +1747,8 @@ public final class TSDKCryptoModule { /// 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. + @available(iOS 13, *) + @available(macOS 12, *) public func encryption_box_encrypt(_ payload: TSDKParamsOfEncryptionBoxEncrypt) async throws -> TSDKResultOfEncryptionBoxEncrypt { try await withCheckedThrowingContinuation { continuation in do { @@ -1686,6 +1784,8 @@ public final class TSDKCryptoModule { /// 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. + @available(iOS 13, *) + @available(macOS 12, *) public func encryption_box_decrypt(_ payload: TSDKParamsOfEncryptionBoxDecrypt) async throws -> TSDKResultOfEncryptionBoxDecrypt { try await withCheckedThrowingContinuation { continuation in do { @@ -1719,6 +1819,8 @@ public final class TSDKCryptoModule { } /// Creates encryption box with specified algorithm + @available(iOS 13, *) + @available(macOS 12, *) public func create_encryption_box(_ payload: TSDKParamsOfCreateEncryptionBox) async throws -> TSDKRegisteredEncryptionBox { try await withCheckedThrowingContinuation { continuation in do { diff --git a/Sources/EverscaleClientSwift/Debot/Debot.swift b/Sources/EverscaleClientSwift/Debot/Debot.swift index 8520ca5..de470c4 100644 --- a/Sources/EverscaleClientSwift/Debot/Debot.swift +++ b/Sources/EverscaleClientSwift/Debot/Debot.swift @@ -23,6 +23,8 @@ public final class TSDKDebotModule { /// [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. + @available(iOS 13, *) + @available(macOS 12, *) public func initialize(_ payload: TSDKParamsOfInit) async throws -> TSDKRegisteredDebot { try await withCheckedThrowingContinuation { continuation in do { @@ -66,6 +68,8 @@ public final class TSDKDebotModule { /// 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. + @available(iOS 13, *) + @available(macOS 12, *) public func start(_ payload: TSDKParamsOfStart) async throws -> TSDKNoneResult { try await withCheckedThrowingContinuation { continuation in do { @@ -101,6 +105,8 @@ public final class TSDKDebotModule { /// [UNSTABLE](UNSTABLE.md) Fetches DeBot metadata from blockchain. /// Downloads DeBot from blockchain and creates and fetches its metadata. + @available(iOS 13, *) + @available(macOS 12, *) public func fetch(_ payload: TSDKParamsOfFetch) async throws -> TSDKResultOfFetch { try await withCheckedThrowingContinuation { continuation in do { @@ -140,6 +146,8 @@ public final class TSDKDebotModule { /// 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. + @available(iOS 13, *) + @available(macOS 12, *) public func execute(_ payload: TSDKParamsOfExecute) async throws -> TSDKNoneResult { try await withCheckedThrowingContinuation { continuation in do { @@ -175,6 +183,8 @@ public final class TSDKDebotModule { /// [UNSTABLE](UNSTABLE.md) Sends message to Debot. /// Used by Debot Browser to send response on Dinterface call or from other Debots. + @available(iOS 13, *) + @available(macOS 12, *) public func send(_ payload: TSDKParamsOfSend) async throws -> TSDKNoneResult { try await withCheckedThrowingContinuation { continuation in do { @@ -210,6 +220,8 @@ public final class TSDKDebotModule { /// [UNSTABLE](UNSTABLE.md) Destroys debot handle. /// Removes handle from Client Context and drops debot engine referenced by that handle. + @available(iOS 13, *) + @available(macOS 12, *) public func remove(_ payload: TSDKParamsOfRemove) async throws -> TSDKNoneResult { try await withCheckedThrowingContinuation { continuation in do { diff --git a/Sources/EverscaleClientSwift/Net/Net.swift b/Sources/EverscaleClientSwift/Net/Net.swift index 14c201d..f9ae25a 100644 --- a/Sources/EverscaleClientSwift/Net/Net.swift +++ b/Sources/EverscaleClientSwift/Net/Net.swift @@ -19,6 +19,8 @@ public final class TSDKNetModule { } /// Performs DAppServer GraphQL query. + @available(iOS 13, *) + @available(macOS 12, *) public func query(_ payload: TSDKParamsOfQuery) async throws -> TSDKResultOfQuery { try await withCheckedThrowingContinuation { continuation in do { @@ -52,6 +54,8 @@ public final class TSDKNetModule { } /// Performs multiple queries per single fetch. + @available(iOS 13, *) + @available(macOS 12, *) public func batch_query(_ payload: TSDKParamsOfBatchQuery) async throws -> TSDKResultOfBatchQuery { try await withCheckedThrowingContinuation { continuation in do { @@ -89,6 +93,8 @@ public final class TSDKNetModule { /// 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 + @available(iOS 13, *) + @available(macOS 12, *) public func query_collection(_ payload: TSDKParamsOfQueryCollection) async throws -> TSDKResultOfQueryCollection { try await withCheckedThrowingContinuation { continuation in do { @@ -124,6 +130,8 @@ public final class TSDKNetModule { /// Aggregates collection data. /// Aggregates values from the specified `fields` for recordsthat satisfies the `filter` conditions, + @available(iOS 13, *) + @available(macOS 12, *) public func aggregate_collection(_ payload: TSDKParamsOfAggregateCollection) async throws -> TSDKResultOfAggregateCollection { try await withCheckedThrowingContinuation { continuation in do { @@ -165,6 +173,8 @@ public final class TSDKNetModule { /// 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 + @available(iOS 13, *) + @available(macOS 12, *) public func wait_for_collection(_ payload: TSDKParamsOfWaitForCollection) async throws -> TSDKResultOfWaitForCollection { try await withCheckedThrowingContinuation { continuation in do { @@ -262,6 +272,8 @@ public final class TSDKNetModule { } /// Suspends network module to stop any network activity + @available(iOS 13, *) + @available(macOS 12, *) public func suspend() async throws -> TSDKNoneResult { try await withCheckedThrowingContinuation { continuation in do { @@ -295,6 +307,8 @@ public final class TSDKNetModule { } /// Resumes network module to enable network activity + @available(iOS 13, *) + @available(macOS 12, *) public func resume() async throws -> TSDKNoneResult { try await withCheckedThrowingContinuation { continuation in do { @@ -328,6 +342,8 @@ public final class TSDKNetModule { } /// Returns ID of the last block in a specified account shard + @available(iOS 13, *) + @available(macOS 12, *) public func find_last_shard_block(_ payload: TSDKParamsOfFindLastShardBlock) async throws -> TSDKResultOfFindLastShardBlock { try await withCheckedThrowingContinuation { continuation in do { @@ -361,6 +377,8 @@ public final class TSDKNetModule { } /// Requests the list of alternative endpoints from server + @available(iOS 13, *) + @available(macOS 12, *) public func fetch_endpoints() async throws -> TSDKEndpointsSet { try await withCheckedThrowingContinuation { continuation in do { @@ -394,6 +412,8 @@ public final class TSDKNetModule { } /// Sets the list of endpoints to use on reinit + @available(iOS 13, *) + @available(macOS 12, *) public func set_endpoints(_ payload: TSDKEndpointsSet) async throws -> TSDKNoneResult { try await withCheckedThrowingContinuation { continuation in do { @@ -427,6 +447,8 @@ public final class TSDKNetModule { } /// Requests the list of alternative endpoints from server + @available(iOS 13, *) + @available(macOS 12, *) public func get_endpoints() async throws -> TSDKResultOfGetEndpoints { try await withCheckedThrowingContinuation { continuation in do { @@ -462,6 +484,8 @@ public final class TSDKNetModule { /// 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) + @available(iOS 13, *) + @available(macOS 12, *) public func query_counterparties(_ payload: TSDKParamsOfQueryCounterparties) async throws -> TSDKResultOfQueryCollection { try await withCheckedThrowingContinuation { continuation in do { @@ -531,6 +555,8 @@ public final class TSDKNetModule { /// 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. + @available(iOS 13, *) + @available(macOS 12, *) public func query_transaction_tree(_ payload: TSDKParamsOfQueryTransactionTree) async throws -> TSDKResultOfQueryTransactionTree { try await withCheckedThrowingContinuation { continuation in do { @@ -582,6 +608,8 @@ public final class TSDKNetModule { /// 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. + @available(iOS 13, *) + @available(macOS 12, *) public func create_block_iterator(_ payload: TSDKParamsOfCreateBlockIterator) async throws -> TSDKRegisteredIterator { try await withCheckedThrowingContinuation { continuation in do { @@ -619,6 +647,8 @@ public final class TSDKNetModule { /// 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. + @available(iOS 13, *) + @available(macOS 12, *) public func resume_block_iterator(_ payload: TSDKParamsOfResumeBlockIterator) async throws -> TSDKRegisteredIterator { try await withCheckedThrowingContinuation { continuation in do { @@ -688,6 +718,8 @@ public final class TSDKNetModule { /// - 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. + @available(iOS 13, *) + @available(macOS 12, *) public func create_transaction_iterator(_ payload: TSDKParamsOfCreateTransactionIterator) async throws -> TSDKRegisteredIterator { try await withCheckedThrowingContinuation { continuation in do { @@ -727,6 +759,8 @@ public final class TSDKNetModule { /// 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. + @available(iOS 13, *) + @available(macOS 12, *) public func resume_transaction_iterator(_ payload: TSDKParamsOfResumeTransactionIterator) async throws -> TSDKRegisteredIterator { try await withCheckedThrowingContinuation { continuation in do { @@ -772,6 +806,8 @@ public final class TSDKNetModule { /// 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. + @available(iOS 13, *) + @available(macOS 12, *) public func iterator_next(_ payload: TSDKParamsOfIteratorNext) async throws -> TSDKResultOfIteratorNext { try await withCheckedThrowingContinuation { continuation in do { @@ -809,6 +845,8 @@ public final class TSDKNetModule { /// Removes an iterator /// Frees all resources allocated in library to serve iterator. /// Application always should call the `remove_iterator` when iteratoris no longer required. + @available(iOS 13, *) + @available(macOS 12, *) public func remove_iterator(_ payload: TSDKRegisteredIterator) async throws -> TSDKNoneResult { try await withCheckedThrowingContinuation { continuation in do { @@ -842,6 +880,8 @@ public final class TSDKNetModule { } /// Returns signature ID for configured network if it should be used in messages signature + @available(iOS 13, *) + @available(macOS 12, *) public func get_signature_id() async throws -> TSDKResultOfGetSignatureId { try await withCheckedThrowingContinuation { continuation in do { diff --git a/Sources/EverscaleClientSwift/Processing/Processing.swift b/Sources/EverscaleClientSwift/Processing/Processing.swift index 1eac266..9213405 100644 --- a/Sources/EverscaleClientSwift/Processing/Processing.swift +++ b/Sources/EverscaleClientSwift/Processing/Processing.swift @@ -21,6 +21,8 @@ public final class TSDKProcessingModule { /// 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. + @available(iOS 13, *) + @available(macOS 12, *) public func send_message(_ payload: TSDKParamsOfSendMessage) async throws -> TSDKResultOfSendMessage { try await withCheckedThrowingContinuation { continuation in do { @@ -70,6 +72,8 @@ public final class TSDKProcessingModule { /// 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. + @available(iOS 13, *) + @available(macOS 12, *) public func wait_for_transaction(_ payload: TSDKParamsOfWaitForTransaction) async throws -> TSDKResultOfProcessMessage { try await withCheckedThrowingContinuation { continuation in do { @@ -115,6 +119,8 @@ public final class TSDKProcessingModule { /// 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. + @available(iOS 13, *) + @available(macOS 12, *) public func process_message(_ payload: TSDKParamsOfProcessMessage) async throws -> TSDKResultOfProcessMessage { try await withCheckedThrowingContinuation { continuation in do { diff --git a/Sources/EverscaleClientSwift/Proofs/Proofs.swift b/Sources/EverscaleClientSwift/Proofs/Proofs.swift index 351b5b4..1494311 100644 --- a/Sources/EverscaleClientSwift/Proofs/Proofs.swift +++ b/Sources/EverscaleClientSwift/Proofs/Proofs.swift @@ -51,6 +51,8 @@ public final class TSDKProofsModule { /// 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. + @available(iOS 13, *) + @available(macOS 12, *) public func proof_block_data(_ payload: TSDKParamsOfProofBlockData) async throws -> TSDKNoneResult { try await withCheckedThrowingContinuation { continuation in do { @@ -96,6 +98,8 @@ public final class TSDKProofsModule { /// 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. + @available(iOS 13, *) + @available(macOS 12, *) public func proof_transaction_data(_ payload: TSDKParamsOfProofTransactionData) async throws -> TSDKNoneResult { try await withCheckedThrowingContinuation { continuation in do { @@ -141,6 +145,8 @@ public final class TSDKProofsModule { /// 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. + @available(iOS 13, *) + @available(macOS 12, *) public func proof_message_data(_ payload: TSDKParamsOfProofMessageData) async throws -> TSDKNoneResult { try await withCheckedThrowingContinuation { continuation in do { diff --git a/Sources/EverscaleClientSwift/Tvm/Tvm.swift b/Sources/EverscaleClientSwift/Tvm/Tvm.swift index 27462d5..df1a280 100644 --- a/Sources/EverscaleClientSwift/Tvm/Tvm.swift +++ b/Sources/EverscaleClientSwift/Tvm/Tvm.swift @@ -51,6 +51,8 @@ public final class TSDKTvmModule { /// 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`. + @available(iOS 13, *) + @available(macOS 12, *) public func run_executor(_ payload: TSDKParamsOfRunExecutor) async throws -> TSDKResultOfRunExecutor { try await withCheckedThrowingContinuation { continuation in do { @@ -94,6 +96,8 @@ public final class TSDKTvmModule { /// 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. + @available(iOS 13, *) + @available(macOS 12, *) public func run_tvm(_ payload: TSDKParamsOfRunTvm) async throws -> TSDKResultOfRunTvm { try await withCheckedThrowingContinuation { continuation in do { @@ -129,6 +133,8 @@ public final class TSDKTvmModule { /// 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 + @available(iOS 13, *) + @available(macOS 12, *) public func run_get(_ payload: TSDKParamsOfRunGet) async throws -> TSDKResultOfRunGet { try await withCheckedThrowingContinuation { continuation in do { diff --git a/Sources/EverscaleClientSwift/Utils/Utils.swift b/Sources/EverscaleClientSwift/Utils/Utils.swift index caacf7f..c0fbb0f 100644 --- a/Sources/EverscaleClientSwift/Utils/Utils.swift +++ b/Sources/EverscaleClientSwift/Utils/Utils.swift @@ -19,6 +19,8 @@ public final class TSDKUtilsModule { } /// Converts address from any TON format to any TON format + @available(iOS 13, *) + @available(macOS 12, *) public func convert_address(_ payload: TSDKParamsOfConvertAddress) async throws -> TSDKResultOfConvertAddress { try await withCheckedThrowingContinuation { continuation in do { @@ -56,6 +58,8 @@ public final class TSDKUtilsModule { /// 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 + @available(iOS 13, *) + @available(macOS 12, *) public func get_address_type(_ payload: TSDKParamsOfGetAddressType) async throws -> TSDKResultOfGetAddressType { try await withCheckedThrowingContinuation { continuation in do { @@ -89,6 +93,8 @@ public final class TSDKUtilsModule { } /// Calculates storage fee for an account over a specified time period + @available(iOS 13, *) + @available(macOS 12, *) public func calc_storage_fee(_ payload: TSDKParamsOfCalcStorageFee) async throws -> TSDKResultOfCalcStorageFee { try await withCheckedThrowingContinuation { continuation in do { @@ -122,6 +128,8 @@ public final class TSDKUtilsModule { } /// Compresses data using Zstandard algorithm + @available(iOS 13, *) + @available(macOS 12, *) public func compress_zstd(_ payload: TSDKParamsOfCompressZstd) async throws -> TSDKResultOfCompressZstd { try await withCheckedThrowingContinuation { continuation in do { @@ -155,6 +163,8 @@ public final class TSDKUtilsModule { } /// Decompresses data using Zstandard algorithm + @available(iOS 13, *) + @available(macOS 12, *) public func decompress_zstd(_ payload: TSDKParamsOfDecompressZstd) async throws -> TSDKResultOfDecompressZstd { try await withCheckedThrowingContinuation { continuation in do {