ton-sdk-ruby 0.0.1 → 0.0.3
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/lib/ton-sdk-ruby/bit_array/bit_array.rb +5 -27
- data/lib/ton-sdk-ruby/boc/builder.rb +4 -1
- data/lib/ton-sdk-ruby/boc/hashmap.rb +4 -1
- data/lib/ton-sdk-ruby/boc/mask.rb +3 -1
- data/lib/ton-sdk-ruby/boc/slice.rb +4 -1
- data/lib/ton-sdk-ruby/johnny_mnemonic/ton_mnemonic.rb +2 -1
- data/lib/ton-sdk-ruby/providers/provider.rb +4 -1
- data/lib/ton-sdk-ruby/providers/toncenter.rb +4 -1
- data/lib/ton-sdk-ruby/types/address.rb +4 -1
- data/lib/ton-sdk-ruby/types/block.rb +48 -1
- data/lib/ton-sdk-ruby/types/coins.rb +4 -1
- data/lib/ton-sdk-ruby/version.rb +1 -1
- 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: f9f4f9ebce30d9947d1ca4f7aa7ed95822328fb3f3557fe15d7c113949d3ed31
|
4
|
+
data.tar.gz: 8092504fda3168aafbe087f5ef5d54488750c66905b82d564e76c4f72352c5aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 837c24715138986fbf478b30d10da67edc718f20a1c3124817b08d53535842826feca8cebe2d44fca6705330f5c0e229c5cc405ac0f7d460a1edf18129591d7d
|
7
|
+
data.tar.gz: 95497b85309c0a4e0924cea11a47c3ae50fc55977fe7d40a4b3764eca9943e171395d1d758ac6e325124cdbe0e20bd9ef90b63f74d2a5b8cc2312ed9d7861958
|
@@ -1,6 +1,9 @@
|
|
1
1
|
module TonSdkRuby
|
2
|
+
|
2
3
|
class BitArray < Array
|
3
|
-
|
4
|
+
extend TonSdkRuby
|
5
|
+
include TonSdkRuby
|
6
|
+
|
4
7
|
attr_accessor :read_cursor
|
5
8
|
|
6
9
|
def initialize(size: 0, value: false)
|
@@ -40,7 +43,7 @@ module TonSdkRuby
|
|
40
43
|
end
|
41
44
|
|
42
45
|
def store_sint!(value: nil, size: nil)
|
43
|
-
# i.e. signed int and one first bit reserved for sign size = (size - 1)
|
46
|
+
# i.e. signed int and one first bit reserved for sign size = (size - 1)
|
44
47
|
# and restrict for max value = value >= (1 << size - 1)
|
45
48
|
max_sint = (1 << size - 1)
|
46
49
|
raise "Wrong value #{value}" if value < -max_sint || value >= max_sint
|
@@ -142,28 +145,3 @@ class TrueClass
|
|
142
145
|
1
|
143
146
|
end
|
144
147
|
end
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
@@ -1,6 +1,9 @@
|
|
1
1
|
module TonSdkRuby
|
2
2
|
|
3
3
|
class Slice
|
4
|
+
extend TonSdkRuby
|
5
|
+
include TonSdkRuby
|
6
|
+
|
4
7
|
def initialize(bits, refs)
|
5
8
|
@bits = bits
|
6
9
|
@refs = refs
|
@@ -332,4 +335,4 @@ module TonSdkRuby
|
|
332
335
|
Slice.new(cell.bits.dup, cell.refs.dup)
|
333
336
|
end
|
334
337
|
end
|
335
|
-
end
|
338
|
+
end
|
@@ -1,5 +1,8 @@
|
|
1
1
|
module TonSdkRuby
|
2
2
|
class Provider
|
3
|
+
extend TonSdkRuby
|
4
|
+
include TonSdkRuby
|
5
|
+
|
3
6
|
attr_accessor :provider
|
4
7
|
|
5
8
|
def initialize(provider)
|
@@ -38,4 +41,4 @@ module TonSdkRuby
|
|
38
41
|
provider.estimate_fee(address, body, init_code, init_data, ignore_chksig)
|
39
42
|
end
|
40
43
|
end
|
41
|
-
end
|
44
|
+
end
|
@@ -1,5 +1,8 @@
|
|
1
1
|
module TonSdkRuby
|
2
2
|
class TickTockOptions
|
3
|
+
extend TonSdkRuby
|
4
|
+
include TonSdkRuby
|
5
|
+
|
3
6
|
attr_accessor :tick, :tock
|
4
7
|
|
5
8
|
def initialize(tick, tock)
|
@@ -9,6 +12,9 @@ module TonSdkRuby
|
|
9
12
|
end
|
10
13
|
|
11
14
|
class SimpleLibOptions
|
15
|
+
extend TonSdkRuby
|
16
|
+
include TonSdkRuby
|
17
|
+
|
12
18
|
attr_accessor :public, :root
|
13
19
|
|
14
20
|
def initialize(public_value, root_value)
|
@@ -18,6 +24,9 @@ module TonSdkRuby
|
|
18
24
|
end
|
19
25
|
|
20
26
|
class TickTock
|
27
|
+
extend TonSdkRuby
|
28
|
+
include TonSdkRuby
|
29
|
+
|
21
30
|
attr_reader :data, :cell
|
22
31
|
|
23
32
|
def initialize(options)
|
@@ -37,6 +46,9 @@ module TonSdkRuby
|
|
37
46
|
end
|
38
47
|
|
39
48
|
class SimpleLib
|
49
|
+
extend TonSdkRuby
|
50
|
+
include TonSdkRuby
|
51
|
+
|
40
52
|
attr_reader :data, :cell
|
41
53
|
|
42
54
|
def initialize(options)
|
@@ -57,6 +69,9 @@ module TonSdkRuby
|
|
57
69
|
end
|
58
70
|
|
59
71
|
class StateInitOptions
|
72
|
+
extend TonSdkRuby
|
73
|
+
include TonSdkRuby
|
74
|
+
|
60
75
|
attr_accessor :split_depth, :special, :code, :data, :library
|
61
76
|
|
62
77
|
def initialize(options = {})
|
@@ -69,6 +84,9 @@ module TonSdkRuby
|
|
69
84
|
end
|
70
85
|
|
71
86
|
class StateInit
|
87
|
+
extend TonSdkRuby
|
88
|
+
include TonSdkRuby
|
89
|
+
|
72
90
|
attr_reader :data, :cell
|
73
91
|
|
74
92
|
def initialize(state_init_options)
|
@@ -113,6 +131,9 @@ module TonSdkRuby
|
|
113
131
|
end
|
114
132
|
|
115
133
|
class IntMsgInfo
|
134
|
+
extend TonSdkRuby
|
135
|
+
include TonSdkRuby
|
136
|
+
|
116
137
|
attr_accessor :tag, :ihr_disabled, :bounce, :bounced, :src, :dest, :value,
|
117
138
|
:ihr_fee, :fwd_fee, :created_lt, :created_at
|
118
139
|
|
@@ -132,6 +153,9 @@ module TonSdkRuby
|
|
132
153
|
end
|
133
154
|
|
134
155
|
class ExtInMsgInfo
|
156
|
+
extend TonSdkRuby
|
157
|
+
include TonSdkRuby
|
158
|
+
|
135
159
|
attr_accessor :tag, :src, :dest, :import_fee
|
136
160
|
|
137
161
|
def initialize(options = {})
|
@@ -143,6 +167,9 @@ module TonSdkRuby
|
|
143
167
|
end
|
144
168
|
|
145
169
|
class CommonMsgInfo
|
170
|
+
extend TonSdkRuby
|
171
|
+
include TonSdkRuby
|
172
|
+
|
146
173
|
attr_reader :data, :cell
|
147
174
|
|
148
175
|
def initialize(data)
|
@@ -232,6 +259,9 @@ module TonSdkRuby
|
|
232
259
|
end
|
233
260
|
|
234
261
|
class MessageOptions
|
262
|
+
extend TonSdkRuby
|
263
|
+
include TonSdkRuby
|
264
|
+
|
235
265
|
attr_accessor :info, :init, :body
|
236
266
|
|
237
267
|
def initialize(options = {})
|
@@ -242,6 +272,9 @@ module TonSdkRuby
|
|
242
272
|
end
|
243
273
|
|
244
274
|
class Message
|
275
|
+
extend TonSdkRuby
|
276
|
+
include TonSdkRuby
|
277
|
+
|
245
278
|
attr_reader :data, :cell
|
246
279
|
|
247
280
|
def initialize(options)
|
@@ -294,6 +327,9 @@ module TonSdkRuby
|
|
294
327
|
end
|
295
328
|
|
296
329
|
class ActionSendMsg
|
330
|
+
extend TonSdkRuby
|
331
|
+
include TonSdkRuby
|
332
|
+
|
297
333
|
attr_reader :tag, :mode, :out_msg
|
298
334
|
|
299
335
|
def initialize(options)
|
@@ -304,6 +340,9 @@ module TonSdkRuby
|
|
304
340
|
end
|
305
341
|
|
306
342
|
class ActionSetCode
|
343
|
+
extend TonSdkRuby
|
344
|
+
include TonSdkRuby
|
345
|
+
|
307
346
|
attr_reader :tag, :new_code
|
308
347
|
|
309
348
|
def initialize(options)
|
@@ -313,6 +352,9 @@ module TonSdkRuby
|
|
313
352
|
end
|
314
353
|
|
315
354
|
class OutAction
|
355
|
+
extend TonSdkRuby
|
356
|
+
include TonSdkRuby
|
357
|
+
|
316
358
|
def initialize(data)
|
317
359
|
case data.tag
|
318
360
|
when 'action_send_msg' then action_send_msg(data)
|
@@ -361,6 +403,9 @@ module TonSdkRuby
|
|
361
403
|
end
|
362
404
|
|
363
405
|
class OutListOptions
|
406
|
+
extend TonSdkRuby
|
407
|
+
include TonSdkRuby
|
408
|
+
|
364
409
|
attr_reader :actions
|
365
410
|
|
366
411
|
def initialize(options)
|
@@ -369,6 +414,8 @@ module TonSdkRuby
|
|
369
414
|
end
|
370
415
|
|
371
416
|
class OutList
|
417
|
+
extend TonSdkRuby
|
418
|
+
include TonSdkRuby
|
372
419
|
|
373
420
|
attr_reader :cell, :data
|
374
421
|
def initialize(action)
|
@@ -385,4 +432,4 @@ module TonSdkRuby
|
|
385
432
|
@cell = cur
|
386
433
|
end
|
387
434
|
end
|
388
|
-
end
|
435
|
+
end
|
@@ -3,6 +3,9 @@ require 'bigdecimal'
|
|
3
3
|
module TonSdkRuby
|
4
4
|
|
5
5
|
class Coins
|
6
|
+
extend TonSdkRuby
|
7
|
+
include TonSdkRuby
|
8
|
+
|
6
9
|
attr_reader :value, :decimals, :multiplier
|
7
10
|
private :value, :decimals, :multiplier
|
8
11
|
|
@@ -185,4 +188,4 @@ class BigDecimal
|
|
185
188
|
return 0 if digits_after_comma == '0'
|
186
189
|
digits_after_comma.size
|
187
190
|
end
|
188
|
-
end
|
191
|
+
end
|
data/lib/ton-sdk-ruby/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ton-sdk-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- nerzh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-10-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ed25519
|