ton-sdk-ruby 0.0.8 → 0.0.10

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a40582e4537e796bc89484a96c1d9fb4e94cb9bc8591ca286fe4f0d6e13424da
4
- data.tar.gz: d71f7b8c1ecbd69013a248bc78ecc85c97cf5b8617bdf702e549c20d0ba366b8
3
+ metadata.gz: 68504e10900a26ccd5a6c524e2eac0cb454bd1f34c108f759697fcd84b357799
4
+ data.tar.gz: 6e77df109856cf14a81f2495dceb003ee6db0a95b3b5bce0159be8e6fb2a9fd9
5
5
  SHA512:
6
- metadata.gz: 6cb37cbc35445ae570f61c450320676fd4b1da0f945bb0981df8f53e6b9b969fbf634bcfe64b8c1f0c6aa7e45544ba3777f07a2b565680e6042961e876da6121
7
- data.tar.gz: '01729e7324dbaded99146bad11e75e09305d5c9cbec451f9ebbcc6ed57d6990b5359bbb840f2b37dbb369c89c2c3030acbda5199159a4d6e99c9524d032ca5c8'
6
+ metadata.gz: 6765370f7db2173007951e2e95f7095bfe42060a559ca20c586a74c278e734cce35373b49de7888a847496f6bdf0ecfdd40110dc0e7a9f13e8b123f37d312eae
7
+ data.tar.gz: 477c4277c23f4f4540f792e619ae59335c6f5e022ffcc02016b32c3ad9b629bf262fd443feb154a347f35da517436f1e2f882b5b06be12208852f8d9ae4c68a5
@@ -24,7 +24,6 @@ module TonSdkRuby
24
24
  end
25
25
 
26
26
  def initialize(address, options = {})
27
- options = {workchain: 0, bounceable: false, test_only: false}.merge(options)
28
27
  is_address = Address.is_address?(address)
29
28
  is_encoded = Address.is_encoded?(address)
30
29
  is_raw = Address.is_raw?(address)
@@ -99,7 +98,7 @@ module TonSdkRuby
99
98
  "#{workchain}:#{bytes_to_hex(hash)}"
100
99
  else
101
100
  tag = Address.encode_tag(bounceable: bounceable, test_only: test_only)
102
- address = [tag, workchain] + hash
101
+ address = [tag, [workchain].pack("c*").unpack("C*").last] + hash
103
102
  checksum = crc16_bytes_be(address)
104
103
  base64 = bytes_to_base64(address + checksum)
105
104
 
@@ -139,9 +138,8 @@ module TonSdkRuby
139
138
 
140
139
  buffer = address.shift(2).pack('C2')
141
140
 
142
- tag_and_wc = buffer.unpack('CS>')
143
- tag = tag_and_wc.first
144
- workchain = tag_and_wc.last.to_i
141
+ tag = buffer.unpack('C*').first
142
+ workchain = buffer.unpack('c*').last
145
143
 
146
144
  hash = address.shift(32)
147
145
 
@@ -30,6 +30,8 @@ module TonSdkRuby
30
30
  end
31
31
 
32
32
  def bytes_to_uint(bytes)
33
+ bytes = bytes.is_a?(Array) ? bytes : bytes.unpack("C*")
34
+
33
35
  uint = bytes.each_with_index.inject(0) do |acc, (byte, i)|
34
36
  acc *= 256
35
37
  acc += byte
@@ -1,4 +1,4 @@
1
1
  module TonSdkRuby
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.10"
3
3
  end
4
4
 
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.8
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - nerzh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-10-14 00:00:00.000000000 Z
11
+ date: 2024-01-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ed25519