mixin_bot 0.3.0 → 0.3.5

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: 490beec97c1c3ba36f339f4a947f7717ee7eafa0aad01ba7d36c0ad8962af0e2
4
- data.tar.gz: e00974b0b39f0002d60ced9f3ad416ce4b0addc63ba2d6e14584fc5b3f64a4c3
3
+ metadata.gz: 8282148099d4fa3128ae77f40fbefbd5712edeacebbd10fc286055b463427f40
4
+ data.tar.gz: d8e8b3511fb866dd76004534d2629f6edb362d82177d8a717a5f7a797c532b8e
5
5
  SHA512:
6
- metadata.gz: ccf975f89a77c9421151ec6235939a9b1e78359253597daa81e70e7e4badd1362e9c617425e547681ac25be72bdad25c0d56334dc9cc9a56b97abe0b08913dd7
7
- data.tar.gz: c6d2dabfd14fa960f32549e2ba082d275a618f058b25ab54217e900197d42d10659c48a36e484aff55ed58c92e3355c35a121e599e6b110286bbd9ac3fc06b22
6
+ metadata.gz: ac472ad54cc28559dec43283aa12691984fb5dd4f1d4dc5c2356b72716cfedd754d209b4b37f7ca4986408e7155523a2a41caeeec140c9ab6dcd00704e7b0d2e
7
+ data.tar.gz: 414a6e52690819775032c7abd45d2cc4e885bc0d12a195ba87e4d5bd945ebac1eb8ffad7b458d3f3faf7cbfba5cccc157b5c5f6cab1517685dc28e15041389fe
@@ -6,10 +6,10 @@ require 'digest'
6
6
  require 'faye/websocket'
7
7
  require 'http'
8
8
  require 'jose'
9
- require 'jwt'
10
9
  require 'msgpack'
11
10
  require 'open3'
12
11
  require 'openssl'
12
+ require 'rbnacl'
13
13
  require_relative './mixin_bot/api'
14
14
  require_relative './mixin_bot/cli'
15
15
  require_relative './mixin_bot/version'
@@ -25,9 +25,14 @@ module MixinBot
25
25
  @client_id = options[:client_id] || MixinBot.client_id
26
26
  @client_secret = options[:client_secret] || MixinBot.client_secret
27
27
  @session_id = options[:session_id] || MixinBot.session_id
28
- @pin_token = Base64.urlsafe_decode64 options[:pin_token] || MixinBot.pin_token
29
28
  @client = Client.new(MixinBot.api_host || 'api.mixin.one')
30
29
  @blaze_host = MixinBot.blaze_host || 'blaze.mixin.one'
30
+ @pin_token =
31
+ begin
32
+ Base64.urlsafe_decode64 options[:pin_token] || MixinBot.pin_token
33
+ rescue StandardError
34
+ ''
35
+ end
31
36
  _private_key = options[:private_key] || MixinBot.private_key
32
37
  @private_key =
33
38
  if /^-----BEGIN RSA PRIVATE KEY-----/.match? _private_key
@@ -54,7 +54,7 @@ module MixinBot
54
54
  end
55
55
 
56
56
  ws = nil
57
- start_blaze_connect(&block) if reconnect
57
+ start_blaze_connect(&_block) if reconnect
58
58
  end
59
59
  end
60
60
  end
@@ -261,15 +261,21 @@ module MixinBot
261
261
 
262
262
  outputs = []
263
263
  output0 = create_output(receivers: receivers, index: 0)['data']
264
- output0['amount'] = format('%<amount>.8f', amount: amount)
265
- output0['script'] = build_threshold_script(receivers.length)
266
- outputs << output0
264
+ outputs << {
265
+ 'amount': format('%<amount>.8f', amount: amount),
266
+ 'script': build_threshold_script(receivers.length),
267
+ 'mask': output0['mask'],
268
+ 'keys': output0['keys']
269
+ }
267
270
 
268
271
  if input_amount > amount
269
272
  output1 = create_output(receivers: senders, index: 1)['data']
270
- output1['amount'] = format('%<amount>.8f', amount: input_amount - amount)
271
- output1['script'] = build_threshold_script(utxos[0]['threshold'].to_i)
272
- outputs << output1
273
+ outputs << {
274
+ 'amount': format('%<amount>.8f', amount: input_amount - amount),
275
+ 'script': build_threshold_script(threshold.to_i),
276
+ 'mask': output1['mask'],
277
+ 'keys': output1['keys']
278
+ }
273
279
  end
274
280
 
275
281
  extra = Digest.hexencode memo.to_s.slice(0, 140)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MixinBot
4
- VERSION = '0.3.0'
4
+ VERSION = '0.3.5'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mixin_bot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - an-lee
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-10 00:00:00.000000000 Z
11
+ date: 2021-01-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: awesome_print
@@ -108,6 +108,20 @@ dependencies:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
110
  version: '1.3'
111
+ - !ruby/object:Gem::Dependency
112
+ name: rbnacl
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '7.1'
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '7.1'
111
125
  - !ruby/object:Gem::Dependency
112
126
  name: thor
113
127
  requirement: !ruby/object:Gem::Requirement