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 +4 -4
- data/lib/mixin_bot.rb +1 -1
- data/lib/mixin_bot/api.rb +6 -1
- data/lib/mixin_bot/api/blaze.rb +1 -1
- data/lib/mixin_bot/api/multisig.rb +12 -6
- data/lib/mixin_bot/version.rb +1 -1
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8282148099d4fa3128ae77f40fbefbd5712edeacebbd10fc286055b463427f40
|
4
|
+
data.tar.gz: d8e8b3511fb866dd76004534d2629f6edb362d82177d8a717a5f7a797c532b8e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ac472ad54cc28559dec43283aa12691984fb5dd4f1d4dc5c2356b72716cfedd754d209b4b37f7ca4986408e7155523a2a41caeeec140c9ab6dcd00704e7b0d2e
|
7
|
+
data.tar.gz: 414a6e52690819775032c7abd45d2cc4e885bc0d12a195ba87e4d5bd945ebac1eb8ffad7b458d3f3faf7cbfba5cccc157b5c5f6cab1517685dc28e15041389fe
|
data/lib/mixin_bot.rb
CHANGED
@@ -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'
|
data/lib/mixin_bot/api.rb
CHANGED
@@ -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
|
data/lib/mixin_bot/api/blaze.rb
CHANGED
@@ -261,15 +261,21 @@ module MixinBot
|
|
261
261
|
|
262
262
|
outputs = []
|
263
263
|
output0 = create_output(receivers: receivers, index: 0)['data']
|
264
|
-
|
265
|
-
|
266
|
-
|
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
|
-
|
271
|
-
|
272
|
-
|
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)
|
data/lib/mixin_bot/version.rb
CHANGED
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.
|
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:
|
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
|