ton_sdk_client 1.12.0 → 1.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -1
- data/README.md +1 -1
- data/lib/ton_sdk_client/boc.rb +18 -148
- data/lib/ton_sdk_client/config.rb +34 -22
- data/lib/ton_sdk_client/crypto.rb +24 -151
- data/lib/ton_sdk_client/debot.rb +1 -1
- data/lib/ton_sdk_client/net.rb +45 -78
- data/lib/ton_sdk_client/processing.rb +2 -15
- data/lib/ton_sdk_client/version.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3d1c48c5f27ebe774498f9a6a471e384aa658c48d51a834bf09a9d62407b5b9a
|
4
|
+
data.tar.gz: cb6369381b1aaf376a19dddea4b3d2e3a6b32b681dde8e0ce7a9fa3358bbb630
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2e2c8829e03117c75787b63f414a4e04dbf0466d27b4f25c7767b429942a2732db56e6ced5b91a2c7ee50e863a36843b356631a2164494dfb8c1f855f2ec2069
|
7
|
+
data.tar.gz: 495f0ac60ff7a8ea641afdf1169bc6accc5748fb7c01240f9246f5e47633bf24f222100ca5eff2a4c31df683b4b411076d3d095fc843c5cc2c7bbdccf03e796a
|
data/CHANGELOG.md
CHANGED
@@ -1,12 +1,17 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
1.13.x
|
4
|
+
-----
|
5
|
+
* TON SDK version: 1.13.0
|
6
|
+
* internal refactoring
|
7
|
+
* the changes are according the ones of TON SDK
|
8
|
+
|
3
9
|
1.12.x
|
4
10
|
-----
|
5
11
|
* TON SDK version: 1.12.0
|
6
12
|
* internal refactoring
|
7
13
|
* the changes are according the ones of TON SDK
|
8
14
|
|
9
|
-
|
10
15
|
1.11.x
|
11
16
|
-----
|
12
17
|
* TON SDK version: 1.11.0
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# TON SDK client in Ruby and for Ruby
|
2
2
|
|
3
3
|
[](https://badge.fury.io/rb/ton_sdk_client)
|
4
|
-
[](https://github.com/tonlabs/TON-SDK/tree/1.13.0)
|
5
5
|
|
6
6
|
Ruby gem-client bindings for [TON SDK](https://github.com/tonlabs/TON-SDK) which allows one to communicate with [FreeTON](https://freeton.org) blockchain in Ruby.
|
7
7
|
|
data/lib/ton_sdk_client/boc.rb
CHANGED
@@ -5,33 +5,13 @@ module TonSdk
|
|
5
5
|
# types
|
6
6
|
#
|
7
7
|
|
8
|
-
|
9
|
-
attr_reader :boc
|
10
|
-
|
11
|
-
def initialize(a)
|
12
|
-
@boc = a
|
13
|
-
end
|
14
|
-
|
8
|
+
ParamsOfParse = Struct.new(:boc) do
|
15
9
|
def to_h = { boc: @boc }
|
16
10
|
end
|
17
11
|
|
18
|
-
|
19
|
-
attr_reader :parsed
|
20
|
-
|
21
|
-
def initialize(a)
|
22
|
-
@parsed = a
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
class ParamsOfParseShardstate
|
27
|
-
attr_reader :boc, :id, :workchain_id
|
28
|
-
|
29
|
-
def initialize(boc:, id_:, workchain_id:)
|
30
|
-
@boc = boc
|
31
|
-
@id_ = id_
|
32
|
-
@workchain_id = workchain_id
|
33
|
-
end
|
12
|
+
ResultOfParse = Struct.new(:parsed)
|
34
13
|
|
14
|
+
ParamsOfParseShardstate = Struct.new(:boc, :id, :workchain_id) do
|
35
15
|
def to_h
|
36
16
|
{
|
37
17
|
boc: @boc,
|
@@ -41,35 +21,13 @@ module TonSdk
|
|
41
21
|
end
|
42
22
|
end
|
43
23
|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
def initialize(a)
|
48
|
-
@block_boc = a
|
49
|
-
end
|
50
|
-
|
51
|
-
def to_h
|
52
|
-
{
|
53
|
-
block_boc: @block_boc
|
54
|
-
}
|
55
|
-
end
|
56
|
-
end
|
57
|
-
|
58
|
-
class ResultOfGetBlockchainConfig
|
59
|
-
attr_reader :config_boc
|
60
|
-
|
61
|
-
def initialize(a)
|
62
|
-
@config_boc = a
|
63
|
-
end
|
24
|
+
ParamsOfGetBlockchainConfig = Struct.new(:block_boc) do
|
25
|
+
def to_h = { block_boc: @block_boc }
|
64
26
|
end
|
65
27
|
|
66
|
-
|
67
|
-
attr_reader :boc
|
68
|
-
|
69
|
-
def initialize(a)
|
70
|
-
@boc = a
|
71
|
-
end
|
28
|
+
ResultOfGetBlockchainConfig = Struct.new(:config_boc)
|
72
29
|
|
30
|
+
ParamsOfGetBocHash = Struct.new(:boc) do
|
73
31
|
def to_h
|
74
32
|
{
|
75
33
|
boc: @boc
|
@@ -77,53 +35,19 @@ module TonSdk
|
|
77
35
|
end
|
78
36
|
end
|
79
37
|
|
80
|
-
|
81
|
-
attr_reader :hash
|
82
|
-
|
83
|
-
def initialize(a)
|
84
|
-
@hash = a
|
85
|
-
end
|
86
|
-
end
|
87
|
-
|
88
|
-
class ParamsOfGetCodeFromTvc
|
89
|
-
attr_reader :tvc
|
90
|
-
|
91
|
-
def initialize(a)
|
92
|
-
@tvc = a
|
93
|
-
end
|
94
|
-
|
95
|
-
def to_h
|
96
|
-
{
|
97
|
-
tvc: @tvc
|
98
|
-
}
|
99
|
-
end
|
100
|
-
end
|
101
|
-
|
102
|
-
class ResultOfGetCodeFromTvc
|
103
|
-
attr_reader :code
|
38
|
+
ResultOfGetBocHash = Struct.new(:hash)
|
104
39
|
|
105
|
-
|
106
|
-
|
107
|
-
end
|
40
|
+
ParamsOfGetCodeFromTvc = Struct.new(:hash) do
|
41
|
+
def to_h = { tvc: @tvc }
|
108
42
|
end
|
109
43
|
|
110
|
-
|
111
|
-
attr_reader :boc_ref
|
112
|
-
|
113
|
-
def initialize(a)
|
114
|
-
@boc_ref = a
|
115
|
-
end
|
44
|
+
ResultOfGetCodeFromTvc = Struct.new(:code)
|
116
45
|
|
46
|
+
ParamsOfBocCacheGet = Struct.new(:boc_ref) do
|
117
47
|
def to_h = { boc_ref: @boc_ref }
|
118
48
|
end
|
119
49
|
|
120
|
-
|
121
|
-
attr_reader :boc
|
122
|
-
|
123
|
-
def initialize(boc: nil)
|
124
|
-
@boc = boc
|
125
|
-
end
|
126
|
-
end
|
50
|
+
ResultOfBocCacheGet = Struct.new(:boc)
|
127
51
|
|
128
52
|
class BocCacheType
|
129
53
|
TYPES = [
|
@@ -159,14 +83,7 @@ module TonSdk
|
|
159
83
|
end
|
160
84
|
end
|
161
85
|
|
162
|
-
|
163
|
-
attr_reader :boc, :cache_type
|
164
|
-
|
165
|
-
def initialize(boc:, cache_type:)
|
166
|
-
@boc = boc
|
167
|
-
@cache_type = cache_type
|
168
|
-
end
|
169
|
-
|
86
|
+
ParamsOfBocCacheSet = Struct.new(:boc, :cache_type) do
|
170
87
|
def to_h
|
171
88
|
{
|
172
89
|
boc: @boc,
|
@@ -175,22 +92,9 @@ module TonSdk
|
|
175
92
|
end
|
176
93
|
end
|
177
94
|
|
178
|
-
|
179
|
-
attr_reader :boc_ref
|
180
|
-
|
181
|
-
def initialize(a)
|
182
|
-
@boc_ref = a
|
183
|
-
end
|
184
|
-
end
|
185
|
-
|
186
|
-
class ParamsOfBocCacheUnpin
|
187
|
-
attr_reader :boc, :boc_ref
|
188
|
-
|
189
|
-
def initialize(boc:, boc_ref: nil)
|
190
|
-
@boc = boc
|
191
|
-
@boc_ref = boc_ref
|
192
|
-
end
|
95
|
+
ResultOfBocCacheSet = Struct.new(:boc_ref)
|
193
96
|
|
97
|
+
ParamsOfBocCacheUnpin = Struct.new(:boc, :boc_ref) do
|
194
98
|
def to_h
|
195
99
|
{
|
196
100
|
boc: @boc,
|
@@ -199,14 +103,7 @@ module TonSdk
|
|
199
103
|
end
|
200
104
|
end
|
201
105
|
|
202
|
-
|
203
|
-
attr_reader :builder, :boc_cache
|
204
|
-
|
205
|
-
def initialize(builder:, boc_cache: nil)
|
206
|
-
@builder = builder
|
207
|
-
@boc_cache = boc_cache
|
208
|
-
end
|
209
|
-
|
106
|
+
ParamsOfEncodeBoc = Struct.new(:builder, :boc_cache) do
|
210
107
|
def to_h
|
211
108
|
{
|
212
109
|
boc: @boc,
|
@@ -215,35 +112,8 @@ module TonSdk
|
|
215
112
|
end
|
216
113
|
end
|
217
114
|
|
218
|
-
|
219
|
-
attr_reader :boc
|
220
|
-
|
221
|
-
def initialize(a)
|
222
|
-
@boc = a
|
223
|
-
end
|
224
|
-
end
|
115
|
+
ResultOfEncodeBoc = Struct.new(:boc)
|
225
116
|
|
226
|
-
class ParamsOfGetBlockchainConfig
|
227
|
-
attr_reader :block_boc
|
228
|
-
|
229
|
-
def initialize(a)
|
230
|
-
@block_boc = a
|
231
|
-
end
|
232
|
-
|
233
|
-
def to_h
|
234
|
-
{
|
235
|
-
block_boc: @block_boc
|
236
|
-
}
|
237
|
-
end
|
238
|
-
end
|
239
|
-
|
240
|
-
class ResultOfGetBlockchainConfig
|
241
|
-
attr_reader :config_boc
|
242
|
-
|
243
|
-
def initialize(a)
|
244
|
-
@config_boc = a
|
245
|
-
end
|
246
|
-
end
|
247
117
|
|
248
118
|
|
249
119
|
#
|
@@ -22,65 +22,77 @@ module TonSdk
|
|
22
22
|
end
|
23
23
|
|
24
24
|
class NetworkConfig
|
25
|
-
|
26
|
-
|
25
|
+
DEFAULT_NETWORK_RETRIES_COUNT = 5
|
26
|
+
DEFAULT_MAX_RECONNECT_TIMEOUT = 120000
|
27
|
+
DEFAULT_RECONNECT_TIMEOUT = 1000
|
28
|
+
DEFAULT_MESSAGE_RETRIES_COUNT = 5
|
29
|
+
|
30
|
+
DEFAULT_MESSAGE_PROCESSING_TIMEOUT = 40000
|
27
31
|
DEFAULT_WAIT_TIMEOUT = 40000
|
28
32
|
DEFAULT_OUT_OF_SYNC_THRESHOLD = 15000
|
29
|
-
|
30
|
-
DEFAULT_MAX_RECONNECT_TIMEOUT = 2
|
33
|
+
DEFAULT_SENDING_ENDPOINT_COUNT = 2
|
31
34
|
|
32
35
|
attr_reader :server_address, :endpoints, :network_retries_count,
|
33
36
|
:message_retries_count, :message_processing_timeout,
|
34
37
|
:wait_for_timeout, :out_of_sync_threshold, :reconnect_timeout,
|
35
|
-
:
|
38
|
+
:max_reconnect_timeout,
|
39
|
+
:sending_endpoint_count,
|
40
|
+
:access_key
|
36
41
|
|
37
42
|
def initialize(
|
38
43
|
server_address: "",
|
39
44
|
endpoints: [],
|
45
|
+
|
40
46
|
network_retries_count: DEFAULT_NETWORK_RETRIES_COUNT,
|
41
|
-
|
42
|
-
|
47
|
+
max_reconnect_timeout: DEFAULT_MAX_RECONNECT_TIMEOUT,
|
48
|
+
reconnect_timeout: DEFAULT_RECONNECT_TIMEOUT,
|
49
|
+
message_retries_count: DEFAULT_MESSAGE_RETRIES_COUNT,
|
50
|
+
|
51
|
+
message_processing_timeout: DEFAULT_MESSAGE_PROCESSING_TIMEOUT,
|
43
52
|
wait_for_timeout: DEFAULT_WAIT_TIMEOUT,
|
44
53
|
out_of_sync_threshold: DEFAULT_OUT_OF_SYNC_THRESHOLD,
|
45
|
-
|
46
|
-
|
47
|
-
|
54
|
+
sending_endpoint_count: DEFAULT_SENDING_ENDPOINT_COUNT,
|
55
|
+
|
56
|
+
access_key: nil
|
48
57
|
)
|
58
|
+
|
49
59
|
@server_address = server_address
|
50
60
|
@endpoints = endpoints
|
61
|
+
|
51
62
|
@network_retries_count = network_retries_count
|
63
|
+
@max_reconnect_timeout = max_reconnect_timeout
|
64
|
+
@reconnect_timeout = reconnect_timeout
|
52
65
|
@message_retries_count = message_retries_count
|
66
|
+
|
53
67
|
@message_processing_timeout = message_processing_timeout
|
54
68
|
@wait_for_timeout = wait_for_timeout
|
55
69
|
@out_of_sync_threshold = out_of_sync_threshold
|
56
|
-
@
|
70
|
+
@sending_endpoint_count = sending_endpoint_count
|
71
|
+
|
57
72
|
@access_key = access_key
|
58
|
-
@max_reconnect_timeout = max_reconnect_timeout
|
59
73
|
end
|
60
74
|
|
61
75
|
def to_h
|
62
76
|
{
|
63
77
|
server_address: @server_address,
|
64
78
|
endpoints: @endpoints,
|
79
|
+
|
65
80
|
network_retries_count: @network_retries_count,
|
81
|
+
max_reconnect_timeout: @max_reconnect_timeout,
|
82
|
+
reconnect_timeout: @reconnect_timeout,
|
66
83
|
message_retries_count: @message_retries_count,
|
84
|
+
|
67
85
|
message_processing_timeout: @message_processing_timeout,
|
68
86
|
wait_for_timeout: @wait_for_timeout,
|
69
87
|
out_of_sync_threshold: @out_of_sync_threshold,
|
70
|
-
|
71
|
-
|
72
|
-
|
88
|
+
sending_endpoint_count: @sending_endpoint_count,
|
89
|
+
|
90
|
+
access_key: @access_key
|
73
91
|
}
|
74
92
|
end
|
75
93
|
end
|
76
94
|
|
77
|
-
|
78
|
-
attr_reader :fish_param
|
79
|
-
|
80
|
-
def initialize(a)
|
81
|
-
@fish_param = a
|
82
|
-
end
|
83
|
-
|
95
|
+
CryptoConfig = Struct.new(:fish_param) do
|
84
96
|
def to_h = { fish_param: @fish_param }
|
85
97
|
end
|
86
98
|
|
@@ -10,11 +10,11 @@ module TonSdk
|
|
10
10
|
INVALID_KEY = 102
|
11
11
|
INVALID_FACTORIZE_CHALLENGE = 106
|
12
12
|
INVALID_BIGINT = 107
|
13
|
-
SCRYPT_FAILED = 108
|
13
|
+
SCRYPT_FAILED = 108
|
14
14
|
INVALID_KEYSIZE = 109
|
15
|
-
NACL_SECRET_BOX_FAILED = 110
|
16
|
-
NACL_BOX_FAILED = 111
|
17
|
-
NACL_SIGN_FAILED = 112
|
15
|
+
NACL_SECRET_BOX_FAILED = 110
|
16
|
+
NACL_BOX_FAILED = 111
|
17
|
+
NACL_SIGN_FAILED = 112
|
18
18
|
BIP39_INVALID_ENTROPY = 113
|
19
19
|
BIP39_INVALID_PHRASE = 114
|
20
20
|
BIP32_INVALID_KEY = 115
|
@@ -27,27 +27,13 @@ module TonSdk
|
|
27
27
|
INVALID_SIGNATURE = 122
|
28
28
|
end
|
29
29
|
|
30
|
-
|
31
|
-
attr_reader :composite
|
32
|
-
|
33
|
-
def initialize(a)
|
34
|
-
@composite = a
|
35
|
-
end
|
36
|
-
|
30
|
+
ParamsOfFactorize = Struct.new(:composite) do
|
37
31
|
def to_h = { composite: @composite }
|
38
32
|
end
|
39
33
|
|
40
34
|
ResultOfFactorize = Struct.new(:factors)
|
41
35
|
|
42
|
-
|
43
|
-
attr_reader :base, :exponent, :modulus
|
44
|
-
|
45
|
-
def initialize(base:, exponent:, modulus:)
|
46
|
-
@base = base
|
47
|
-
@exponent = exponent
|
48
|
-
@modulus = modulus
|
49
|
-
end
|
50
|
-
|
36
|
+
ParamsOfModularPower = Struct.new(:base, :exponent, :modulus) do
|
51
37
|
def to_h
|
52
38
|
{
|
53
39
|
base: @base,
|
@@ -97,14 +83,7 @@ module TonSdk
|
|
97
83
|
|
98
84
|
ResultOfSign = Struct.new(:signed, :signature)
|
99
85
|
|
100
|
-
|
101
|
-
attr_reader :signed, :public_
|
102
|
-
|
103
|
-
def initialize(signed:, public_:)
|
104
|
-
@signed = signed
|
105
|
-
@public_ = public_
|
106
|
-
end
|
107
|
-
|
86
|
+
ParamsOfVerifySignature = Struct.new(:signed, :public_) do
|
108
87
|
def to_h
|
109
88
|
{
|
110
89
|
signed: @signed,
|
@@ -113,48 +92,15 @@ module TonSdk
|
|
113
92
|
end
|
114
93
|
end
|
115
94
|
|
116
|
-
|
117
|
-
attr_reader :unsigned
|
118
|
-
|
119
|
-
def initialize(a)
|
120
|
-
@unsigned = a
|
121
|
-
end
|
122
|
-
end
|
95
|
+
ResultOfVerifySignature = Struct.new(:unsigned)
|
123
96
|
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
def initialize(a)
|
128
|
-
@data = a
|
129
|
-
end
|
130
|
-
|
131
|
-
def to_h
|
132
|
-
{
|
133
|
-
data: @data
|
134
|
-
}
|
135
|
-
end
|
136
|
-
end
|
137
|
-
|
138
|
-
class ResultOfHash
|
139
|
-
attr_reader :hash
|
140
|
-
|
141
|
-
def initialize(a)
|
142
|
-
@hash = a
|
143
|
-
end
|
97
|
+
ParamsOfHash = Struct.new(:data) do
|
98
|
+
def to_h = { data: @data }
|
144
99
|
end
|
145
100
|
|
146
|
-
|
147
|
-
attr_reader :password, :salt, :log_n, :r, :p_, :dk_len
|
148
|
-
|
149
|
-
def initialize(password:, salt:, log_n:, r:, p_:, dk_len:)
|
150
|
-
@password = password
|
151
|
-
@salt = salt
|
152
|
-
@log_n = log_n
|
153
|
-
@r = r
|
154
|
-
@p_ = p_
|
155
|
-
@dk_len = dk_len
|
156
|
-
end
|
101
|
+
ResultOfHash = Struct.new(:hash)
|
157
102
|
|
103
|
+
ParamsOfScrypt = Struct.new(:password, :salt, :log_n, :r, :p_, :dk_len) do
|
158
104
|
def to_h
|
159
105
|
{
|
160
106
|
password: @password,
|
@@ -167,32 +113,13 @@ module TonSdk
|
|
167
113
|
end
|
168
114
|
end
|
169
115
|
|
170
|
-
|
171
|
-
attr_reader :key
|
172
|
-
|
173
|
-
def initialize(a)
|
174
|
-
@key = a
|
175
|
-
end
|
176
|
-
end
|
177
|
-
|
178
|
-
class ParamsOfNaclSignKeyPairFromSecret
|
179
|
-
attr_reader :secret
|
180
|
-
|
181
|
-
def initialize(a)
|
182
|
-
@secret = a
|
183
|
-
end
|
116
|
+
ResultOfScrypt = Struct.new(:key)
|
184
117
|
|
118
|
+
ParamsOfNaclSignKeyPairFromSecret = Struct.new(:secret) do
|
185
119
|
def to_h = { secret: @secret }
|
186
120
|
end
|
187
121
|
|
188
|
-
|
189
|
-
attr_reader :unsigned, :secret
|
190
|
-
|
191
|
-
def initialize(unsigned:, secret:)
|
192
|
-
@unsigned = unsigned
|
193
|
-
@secret = secret
|
194
|
-
end
|
195
|
-
|
122
|
+
ParamsOfNaclSign = Struct.new(:unsigned, :secret) do
|
196
123
|
def to_h
|
197
124
|
{
|
198
125
|
unsigned: @unsigned,
|
@@ -201,13 +128,7 @@ module TonSdk
|
|
201
128
|
end
|
202
129
|
end
|
203
130
|
|
204
|
-
|
205
|
-
attr_reader :signed
|
206
|
-
|
207
|
-
def initialize(a)
|
208
|
-
@signed = a
|
209
|
-
end
|
210
|
-
end
|
131
|
+
ResultOfNaclSign = Struct.new(:signed)
|
211
132
|
|
212
133
|
class ParamsOfNaclSignOpen
|
213
134
|
attr_reader :signed, :public_
|
@@ -225,21 +146,9 @@ module TonSdk
|
|
225
146
|
end
|
226
147
|
end
|
227
148
|
|
228
|
-
|
229
|
-
attr_reader :unsigned
|
230
|
-
|
231
|
-
def initialize(a)
|
232
|
-
@unsigned = a
|
233
|
-
end
|
234
|
-
end
|
235
|
-
|
236
|
-
class ResultOfNaclSignDetached
|
237
|
-
attr_reader :signature
|
149
|
+
ResultOfNaclSignOpen = Struct.new(:unsigned)
|
238
150
|
|
239
|
-
|
240
|
-
@signature = a
|
241
|
-
end
|
242
|
-
end
|
151
|
+
ResultOfNaclSignDetached = Struct.new(:signature)
|
243
152
|
|
244
153
|
class ParamsOfNaclBoxKeyPairFromSecret
|
245
154
|
attr_reader :secret
|
@@ -275,13 +184,7 @@ module TonSdk
|
|
275
184
|
end
|
276
185
|
end
|
277
186
|
|
278
|
-
|
279
|
-
attr_reader :encrypted
|
280
|
-
|
281
|
-
def initialize(a)
|
282
|
-
@encrypted = a
|
283
|
-
end
|
284
|
-
end
|
187
|
+
ResultOfNaclBox = Struct.new(:encrypted)
|
285
188
|
|
286
189
|
class ParamsOfNaclBoxOpen
|
287
190
|
attr_reader :encrypted, :nonce, :their_public, :secret
|
@@ -303,13 +206,7 @@ module TonSdk
|
|
303
206
|
end
|
304
207
|
end
|
305
208
|
|
306
|
-
|
307
|
-
attr_reader :decrypted
|
308
|
-
|
309
|
-
def initialize(a)
|
310
|
-
@decrypted = a
|
311
|
-
end
|
312
|
-
end
|
209
|
+
ResultOfNaclBoxOpen = Struct.new(:decrypted)
|
313
210
|
|
314
211
|
class ParamsOfNaclSecretBox
|
315
212
|
attr_reader :decrypted, :nonce, :key
|
@@ -361,13 +258,7 @@ module TonSdk
|
|
361
258
|
end
|
362
259
|
end
|
363
260
|
|
364
|
-
|
365
|
-
attr_reader :words
|
366
|
-
|
367
|
-
def initialize(a)
|
368
|
-
@words = a
|
369
|
-
end
|
370
|
-
end
|
261
|
+
ResultOfMnemonicWords = Struct.new(:words)
|
371
262
|
|
372
263
|
class ParamsOfMnemonicFromRandom
|
373
264
|
attr_reader :dictionary, :word_count
|
@@ -385,13 +276,7 @@ module TonSdk
|
|
385
276
|
end
|
386
277
|
end
|
387
278
|
|
388
|
-
|
389
|
-
attr_reader :phrase
|
390
|
-
|
391
|
-
def initialize(a)
|
392
|
-
@phrase = a
|
393
|
-
end
|
394
|
-
end
|
279
|
+
ResultOfMnemonicFromRandom = Struct.new(:phrase)
|
395
280
|
|
396
281
|
class ParamsOfMnemonicFromEntropy
|
397
282
|
attr_reader :entropy, :dictionary, :word_count
|
@@ -411,13 +296,7 @@ module TonSdk
|
|
411
296
|
end
|
412
297
|
end
|
413
298
|
|
414
|
-
|
415
|
-
attr_reader :phrase
|
416
|
-
|
417
|
-
def initialize(a)
|
418
|
-
@phrase = a
|
419
|
-
end
|
420
|
-
end
|
299
|
+
ResultOfMnemonicFromEntropy = Struct.new(:phrase)
|
421
300
|
|
422
301
|
class ParamsOfMnemonicVerify
|
423
302
|
attr_reader :phrase, :dictionary, :word_count
|
@@ -437,13 +316,7 @@ module TonSdk
|
|
437
316
|
end
|
438
317
|
end
|
439
318
|
|
440
|
-
|
441
|
-
attr_reader :valid
|
442
|
-
|
443
|
-
def initialize(a)
|
444
|
-
@valid = a
|
445
|
-
end
|
446
|
-
end
|
319
|
+
ResultOfMnemonicVerify = Struct.new(:valid)
|
447
320
|
|
448
321
|
class ParamsOfMnemonicDeriveSignKeys
|
449
322
|
attr_reader :phrase, :path, :dictionary, :word_count
|
data/lib/ton_sdk_client/debot.rb
CHANGED
@@ -23,7 +23,7 @@ module TonSdk
|
|
23
23
|
OPERATION_REJECTED = 812
|
24
24
|
end
|
25
25
|
|
26
|
-
DebotAction = Struct.new(:description, :name, :action_type, :to, :attributes, :misc) do
|
26
|
+
DebotAction = Struct.new(:description, :name, :action_type, :to, :attributes, :misc, keyword_init: true) do
|
27
27
|
def to_h
|
28
28
|
{
|
29
29
|
description: @description,
|
data/lib/ton_sdk_client/net.rb
CHANGED
@@ -18,7 +18,7 @@ module TonSdk
|
|
18
18
|
WEBSOCKET_DISCONNECTED = 610
|
19
19
|
NOT_SUPPORTED = 611
|
20
20
|
NO_ENDPOINTS_PROVIDED = 612
|
21
|
-
GRAPHQL_WEBSOCKET_INIT_ERROR = 613
|
21
|
+
GRAPHQL_WEBSOCKET_INIT_ERROR = 613
|
22
22
|
NETWORK_MODULE_RESUMED = 614
|
23
23
|
end
|
24
24
|
|
@@ -68,12 +68,14 @@ module TonSdk
|
|
68
68
|
end
|
69
69
|
end
|
70
70
|
|
71
|
-
|
72
|
-
attr_reader :result
|
71
|
+
ResultOfQueryCollection = Struct.new(:result)
|
73
72
|
|
74
|
-
|
75
|
-
|
76
|
-
|
73
|
+
ResultOfWaitForCollection = Struct.new(:result)
|
74
|
+
|
75
|
+
ResultOfQuery = Struct.new(:result)
|
76
|
+
|
77
|
+
ResultOfBatchQuery = Struct.new(:results) do
|
78
|
+
def to_h = { results: @results }
|
77
79
|
end
|
78
80
|
|
79
81
|
class ParamsOfWaitForCollection
|
@@ -96,14 +98,6 @@ module TonSdk
|
|
96
98
|
end
|
97
99
|
end
|
98
100
|
|
99
|
-
class ResultOfWaitForCollection
|
100
|
-
attr_reader :result
|
101
|
-
|
102
|
-
def initialize(a)
|
103
|
-
@result = a
|
104
|
-
end
|
105
|
-
end
|
106
|
-
|
107
101
|
class ParamsOfSubscribeCollection
|
108
102
|
attr_reader :collection, :filter, :result
|
109
103
|
|
@@ -122,22 +116,13 @@ module TonSdk
|
|
122
116
|
end
|
123
117
|
end
|
124
118
|
|
125
|
-
|
126
|
-
attr_reader :handle
|
127
|
-
|
128
|
-
def initialize(a)
|
129
|
-
@handle = a
|
130
|
-
end
|
131
|
-
|
119
|
+
ResultOfSubscribeCollection = Struct.new(:handle) do
|
132
120
|
def to_h = { handle: @handle }
|
133
121
|
end
|
134
122
|
|
135
|
-
|
136
|
-
attr_reader :query, :variables
|
137
|
-
|
123
|
+
ParamsOfQuery = Struct.new(:query, :variables) do
|
138
124
|
def initialize(query:, variables: nil)
|
139
|
-
|
140
|
-
@variables = variables
|
125
|
+
super
|
141
126
|
end
|
142
127
|
|
143
128
|
def to_h
|
@@ -148,39 +133,13 @@ module TonSdk
|
|
148
133
|
end
|
149
134
|
end
|
150
135
|
|
151
|
-
|
152
|
-
attr_reader :result
|
153
|
-
|
154
|
-
def initialize(a)
|
155
|
-
@result = a
|
156
|
-
end
|
157
|
-
end
|
158
|
-
|
159
|
-
class ParamsOfFindLastShardBlock
|
160
|
-
attr_reader :address
|
161
|
-
|
162
|
-
def initialize(a)
|
163
|
-
@address = a
|
164
|
-
end
|
165
|
-
|
136
|
+
ParamsOfFindLastShardBlock = Struct.new(:address) do
|
166
137
|
def to_h = { address: @address }
|
167
138
|
end
|
168
139
|
|
169
|
-
|
170
|
-
attr_reader :block_id
|
171
|
-
|
172
|
-
def initialize(a)
|
173
|
-
@block_id = a
|
174
|
-
end
|
175
|
-
end
|
176
|
-
|
177
|
-
class EndpointsSet
|
178
|
-
attr_reader :endpoints
|
179
|
-
|
180
|
-
def initialize(a)
|
181
|
-
@endpoints = a
|
182
|
-
end
|
140
|
+
ResultOfFindLastShardBlock = Struct.new(:block_id)
|
183
141
|
|
142
|
+
EndpointsSet = Struct.new(:endpoints) do
|
184
143
|
def to_h = { endpoints: @endpoints }
|
185
144
|
end
|
186
145
|
|
@@ -212,24 +171,12 @@ module TonSdk
|
|
212
171
|
end
|
213
172
|
end
|
214
173
|
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
end
|
221
|
-
|
222
|
-
def to_h = { operations: @operations.compact.map(&:to_h) }
|
223
|
-
end
|
224
|
-
|
225
|
-
class ResultOfBatchQuery
|
226
|
-
attr_reader :results
|
227
|
-
|
228
|
-
def initialize(a)
|
229
|
-
@results = a
|
174
|
+
ParamsOfBatchQuery = Struct.new(:operations) do
|
175
|
+
def to_h
|
176
|
+
{
|
177
|
+
operations: @operations.compact.map(&:to_h)
|
178
|
+
}
|
230
179
|
end
|
231
|
-
|
232
|
-
def to_h = { results: @results }
|
233
180
|
end
|
234
181
|
|
235
182
|
class ParamsOfAggregateCollection
|
@@ -277,18 +224,26 @@ module TonSdk
|
|
277
224
|
end
|
278
225
|
end
|
279
226
|
|
280
|
-
|
281
|
-
|
227
|
+
ResultOfAggregateCollection = Struct.new(:values) do
|
228
|
+
def to_h = { values: @values }
|
229
|
+
end
|
282
230
|
|
283
|
-
|
284
|
-
|
231
|
+
ParamsOfQueryCounterparties = Struct.new(:account, :result, :first, :after, keyword_init: true) do
|
232
|
+
def initialize(account:, result:, first: nil, after: nil)
|
233
|
+
super
|
285
234
|
end
|
286
235
|
|
287
|
-
def to_h
|
236
|
+
def to_h
|
237
|
+
{
|
238
|
+
account: @account,
|
239
|
+
result: @result,
|
240
|
+
first: @first,
|
241
|
+
after: @after
|
242
|
+
}
|
243
|
+
end
|
288
244
|
end
|
289
245
|
|
290
246
|
|
291
|
-
|
292
247
|
#
|
293
248
|
# functions
|
294
249
|
#
|
@@ -449,4 +404,16 @@ module TonSdk
|
|
449
404
|
end
|
450
405
|
end
|
451
406
|
end
|
407
|
+
|
408
|
+
def self.query_counterparties(ctx, params)
|
409
|
+
Interop::request_to_native_lib(ctx, "net.query_counterparties", params.to_h.to_json) do |resp|
|
410
|
+
if resp.success?
|
411
|
+
yield NativeLibResponsetResult.new(
|
412
|
+
result: ResultOfQueryCollection.new(resp.result["result"])
|
413
|
+
)
|
414
|
+
else
|
415
|
+
yield resp
|
416
|
+
end
|
417
|
+
end
|
418
|
+
end
|
452
419
|
end
|
@@ -23,13 +23,7 @@ module TonSdk
|
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
|
-
|
27
|
-
attr_reader :shard_block_id
|
28
|
-
|
29
|
-
def initialize(a)
|
30
|
-
@shard_block_id = a
|
31
|
-
end
|
32
|
-
|
26
|
+
ResultOfSendMessage = Struct.new(:shard_block_id) do
|
33
27
|
def to_h
|
34
28
|
{
|
35
29
|
shard_block_id: @shard_block_id
|
@@ -157,14 +151,7 @@ module TonSdk
|
|
157
151
|
end
|
158
152
|
end
|
159
153
|
|
160
|
-
|
161
|
-
attr_reader :message_encode_params, :send_events
|
162
|
-
|
163
|
-
def initialize(message_encode_params:, send_events:)
|
164
|
-
@message_encode_params = message_encode_params
|
165
|
-
@send_events = send_events
|
166
|
-
end
|
167
|
-
|
154
|
+
ParamsOfProcessMessage = Struct.new(:message_encode_params, :send_events) do
|
168
155
|
def to_h
|
169
156
|
{
|
170
157
|
message_encode_params: @message_encode_params.to_h,
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ton_sdk_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.13.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Maslakov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-05-
|
11
|
+
date: 2021-05-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ffi
|