Skip to content

Commit db0af53

Browse files
committed
1.39 up
1 parent 85807e2 commit db0af53

File tree

7 files changed

+36
-14
lines changed

7 files changed

+36
-14
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Swift Client for Everscale SDK
22

33
[![SPM](https://img.shields.io/badge/swift-package%20manager-green)](https://swift.org/package-manager/)
4-
[![SPM](https://img.shields.io/badge/SDK%20VERSION-1.38.0-orange)](https://github.com/tonlabs/ever-sdk)
4+
[![SPM](https://img.shields.io/badge/SDK%20VERSION-1.39.0-orange)](https://github.com/tonlabs/ever-sdk)
55

66
Swift is a strongly typed language that has long been used not only for iOS development. Apple is actively promoting it to new platforms and today it can be used for almost any task. Thanks to this, this implementation provides the work of Everscale SDK on many platforms at once, including the native one for mobile phones. Let me remind you that swift can also be built for android.
77

Sources/EverscaleClientSwift/Abi/AbiTypes.swift

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ public enum TSDKMessageSourceEnumTypes: String, Codable {
5454
case EncodingParams = "EncodingParams"
5555
}
5656

57+
public enum TSDKDataLayout: String, Codable {
58+
case Input = "Input"
59+
case Output = "Output"
60+
}
61+
5762
public struct TSDKAbi: Codable {
5863
public var type: TSDKAbiEnumTypes
5964
public var value: AnyValue?
@@ -471,11 +476,16 @@ public struct TSDKParamsOfDecodeMessage: Codable {
471476
public var message: String
472477
/// Flag allowing partial BOC decoding when ABI doesn't describe the full body BOC. Controls decoder behaviour when after decoding all described in ABI params there are some data left in BOC: `true` - return decoded values `false` - return error of incomplete BOC deserialization (default)
473478
public var allow_partial: Bool?
479+
/// Function name or function id if is known in advance
480+
public var function_name: String?
481+
public var data_layout: TSDKDataLayout?
474482

475-
public init(abi: TSDKAbi, message: String, allow_partial: Bool? = nil) {
483+
public init(abi: TSDKAbi, message: String, allow_partial: Bool? = nil, function_name: String? = nil, data_layout: TSDKDataLayout? = nil) {
476484
self.abi = abi
477485
self.message = message
478486
self.allow_partial = allow_partial
487+
self.function_name = function_name
488+
self.data_layout = data_layout
479489
}
480490
}
481491

@@ -506,12 +516,17 @@ public struct TSDKParamsOfDecodeMessageBody: Codable {
506516
public var is_internal: Bool
507517
/// Flag allowing partial BOC decoding when ABI doesn't describe the full body BOC. Controls decoder behaviour when after decoding all described in ABI params there are some data left in BOC: `true` - return decoded values `false` - return error of incomplete BOC deserialization (default)
508518
public var allow_partial: Bool?
519+
/// Function name or function id if is known in advance
520+
public var function_name: String?
521+
public var data_layout: TSDKDataLayout?
509522

510-
public init(abi: TSDKAbi, body: String, is_internal: Bool, allow_partial: Bool? = nil) {
523+
public init(abi: TSDKAbi, body: String, is_internal: Bool, allow_partial: Bool? = nil, function_name: String? = nil, data_layout: TSDKDataLayout? = nil) {
511524
self.abi = abi
512525
self.body = body
513526
self.is_internal = is_internal
514527
self.allow_partial = allow_partial
528+
self.function_name = function_name
529+
self.data_layout = data_layout
515530
}
516531
}
517532

Sources/EverscaleClientSwift/Boc/BocTypes.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public struct TSDKResultOfParse: Codable {
5656
public struct TSDKParamsOfParseShardstate: Codable {
5757
/// BOC encoded as base64
5858
public var boc: String
59-
/// Shardstate identificator
59+
/// Shardstate identifier
6060
public var id: String
6161
/// Workchain shardstate belongs to
6262
public var workchain_id: Int32

Sources/EverscaleClientSwift/Client/ClientTypes.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,11 @@ public struct TSDKNetworkConfig: Codable {
131131
/// Default is 1.
132132
public var sending_endpoint_count: UInt8?
133133
/// Frequency of sync latency detection.
134-
/// Library periodically checks the current endpoint for blockchain data syncronization latency.
134+
/// Library periodically checks the current endpoint for blockchain data synchronization latency.
135135
/// If the latency (time-lag) is less then `NetworkConfig.max_latency`then library selects another endpoint.
136136
/// Must be specified in milliseconds. Default is 60000 (1 min).
137137
public var latency_detection_interval: UInt32?
138-
/// Maximum value for the endpoint's blockchain data syncronization latency (time-lag). Library periodically checks the current endpoint for blockchain data synchronization latency. If the latency (time-lag) is less then `NetworkConfig.max_latency` then library selects another endpoint.
138+
/// Maximum value for the endpoint's blockchain data synchronization latency (time-lag). Library periodically checks the current endpoint for blockchain data synchronization latency. If the latency (time-lag) is less then `NetworkConfig.max_latency` then library selects another endpoint.
139139
/// Must be specified in milliseconds. Default is 60000 (1 min).
140140
public var max_latency: UInt32?
141141
/// Default timeout for http requests.
@@ -147,11 +147,11 @@ public struct TSDKNetworkConfig: Codable {
147147
/// /// Default is `HTTP`.
148148
public var queries_protocol: TSDKNetworkQueriesProtocol?
149149
/// UNSTABLE.
150-
/// First REMP status awaiting timeout. If no status recieved during the timeout than fallback transaction scenario is activated.
150+
/// First REMP status awaiting timeout. If no status received during the timeout than fallback transaction scenario is activated.
151151
/// Must be specified in milliseconds. Default is 1000 (1 sec).
152152
public var first_remp_status_timeout: UInt32?
153153
/// UNSTABLE.
154-
/// Subsequent REMP status awaiting timeout. If no status recieved during the timeout than fallback transaction scenario is activated.
154+
/// Subsequent REMP status awaiting timeout. If no status received during the timeout than fallback transaction scenario is activated.
155155
/// Must be specified in milliseconds. Default is 5000 (5 sec).
156156
public var next_remp_status_timeout: UInt32?
157157
/// Access key to GraphQL API (Project secret)

Sources/EverscaleClientSwift/Net/Net.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public final class TSDKNetModule {
111111

112112
/// Creates a subscription
113113
/// The subscription is a persistent communication channel betweenclient and Everscale Network.
114-
/// ### Important Notes on SubscriptionsUnfortunately sometimes the connection with the network breakes down.
114+
/// ### Important Notes on SubscriptionsUnfortunately sometimes the connection with the network breaks down.
115115
/// In this situation the library attempts to reconnect to the network.
116116
/// This reconnection sequence can take significant time.
117117
/// All of this time the client is disconnected from the network.
@@ -217,7 +217,7 @@ public final class TSDKNetModule {
217217
/// If the chain of transactions execution is in progress while the function is running,it will wait for the next transactions to appear until the full tree or more than 50 transactionsare received.
218218
/// All the retrieved messages and transactions are includedinto `result.messages` and `result.transactions` respectively.
219219
/// Function reads transactions layer by layer, by pages of 20 transactions.
220-
/// The retrieval prosess goes like this:
220+
/// The retrieval process goes like this:
221221
/// Let's assume we have an infinite chain of transactions and each transaction generates 5 messages.
222222
/// 1. Retrieve 1st message (input parameter) and corresponding transaction - put it into result.
223223
/// It is the first level of the tree of transactions - its root.
@@ -261,7 +261,7 @@ public final class TSDKNetModule {
261261
}
262262

263263
/// Resumes block iterator.
264-
/// The iterator stays exactly at the same position where the `resume_state` was catched.
264+
/// The iterator stays exactly at the same position where the `resume_state` was caught.
265265
/// Application should call the `remove_iterator` when iterator is no longer required.
266266
public func resume_block_iterator(_ payload: TSDKParamsOfResumeBlockIterator, _ handler: @escaping (TSDKBindingResponse<TSDKRegisteredIterator, TSDKClientError>) throws -> Void
267267
) throws {

Sources/EverscaleClientSwift/Net/NetTypes.swift

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ public enum TSDKNetErrorCode: Int, Codable {
1818
case GraphqlWebsocketInitError = 613
1919
case NetworkModuleResumed = 614
2020
case Unauthorized = 615
21+
case QueryTransactionTreeTimeout = 616
22+
case GraphqlConnectionError = 617
2123
}
2224

2325
public enum TSDKSortDirection: String, Codable {
@@ -357,13 +359,18 @@ public struct TSDKParamsOfQueryTransactionTree: Codable {
357359
public var abi_registry: [TSDKAbi]?
358360
/// Timeout used to limit waiting time for the missing messages and transaction.
359361
/// If some of the following messages and transactions are missing yetThe maximum waiting time is regulated by this option.
360-
/// Default value is 60000 (1 min).
362+
/// Default value is 60000 (1 min). If `timeout` is set to 0 then function will wait infinitelyuntil the whole transaction tree is executed
361363
public var timeout: UInt32?
364+
/// Maximum transaction count to wait.
365+
/// If transaction tree contains more transaction then this parameter then only first `transaction_max_count` transaction are awaited and returned.
366+
/// Default value is 50. If `transaction_max_count` is set to 0 then no limitation ontransaction count is used and all transaction are returned.
367+
public var transaction_max_count: UInt32?
362368

363-
public init(in_msg: String, abi_registry: [TSDKAbi]? = nil, timeout: UInt32? = nil) {
369+
public init(in_msg: String, abi_registry: [TSDKAbi]? = nil, timeout: UInt32? = nil, transaction_max_count: UInt32? = nil) {
364370
self.in_msg = in_msg
365371
self.abi_registry = abi_registry
366372
self.timeout = timeout
373+
self.transaction_max_count = transaction_max_count
367374
}
368375
}
369376

Sources/EverscaleClientSwift/Tvm/Tvm.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public final class TSDKTvmModule {
1010
/// Emulates all the phases of contract execution locally
1111
/// Performs all the phases of contract execution on Transaction Executor -the same component that is used on Validator Nodes.
1212
/// Can be used for contract debugging, to find out the reason why a message was not delivered successfully.
13-
/// Validators throw away the failed external inbound messages (if they failed bedore `ACCEPT`) in the real network.
13+
/// Validators throw away the failed external inbound messages (if they failed before `ACCEPT`) in the real network.
1414
/// This is why these messages are impossible to debug in the real network.
1515
/// With the help of run_executor you can do that. In fact, `process_message` functionperforms local check with `run_executor` if there was no transaction as a result of processingand returns the error, if there is one.
1616
/// Another use case to use `run_executor` is to estimate fees for message execution.

0 commit comments

Comments
 (0)