mixin_bot 0.4.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 769e68c946637d91db6a89c5583ab7c49763193ca8c7088fbd95038cb2bf5f20
4
- data.tar.gz: 31405213d094fb3a3d39c4f2e1b2f4e51ce7555c591148c539eb669c7b9d7ccb
3
+ metadata.gz: c746194faff682c2e72eac0cd3673986c9ecf02fd4bbbc7a07afc114f9594646
4
+ data.tar.gz: e33d157e155c857cfe2eff5c78150ac2e1c10f1b48f9925474d0cd09f5664581
5
5
  SHA512:
6
- metadata.gz: 1105ff54db0cb2eef406ebeaed844227fbb009006ddc71c4ca96bd45967b87fadd8e4a596c2f383e6c4f37558c22fec33111aa051546abf046a2944f0a3d100e
7
- data.tar.gz: 5bfce8c2db0ddfc6f204babffd5314988055a59529634d16657943c69373130640e706bb25c339c2dbb8e5f6045b796e636b76cea870746db04d3548086a52d4
6
+ metadata.gz: 6b73cf7f7a56f9b982de773c5b4158ff00a72e09938d6b06398b0595eea9a58095874eddfe26f9407e4c2e887e8b9f05ee3a33b7222fe71efe6b592c21be41c8
7
+ data.tar.gz: 372982bdcd9d1bb1ba5be676d0f195e2eaa9a4a7205b50736b589da0890d41f78db6ce153f9bd11a2b84cc545c456388ed584c19762f8e8a1a13e362e86e04a0
data/lib/mixin_bot/api.rb CHANGED
@@ -44,7 +44,7 @@ module MixinBot
44
44
  end
45
45
 
46
46
  # Use a mixin software to implement transaction build
47
- def build_transaction(json)
47
+ def sign_raw_transaction(json)
48
48
  ensure_mixin_command_exist
49
49
  command = format("mixin signrawtransaction --raw '%<arg>s'", arg: json)
50
50
 
@@ -197,7 +197,7 @@ module MixinBot
197
197
  threshold: threshold,
198
198
  state: 'unspent',
199
199
  access_token: access_token
200
- ).filter(
200
+ )['data'].filter(
201
201
  &lambda { |utxo|
202
202
  utxo['asset_id'] == kwargs[:asset_id]
203
203
  }
@@ -255,7 +255,7 @@ module MixinBot
255
255
  extra: extra
256
256
  }
257
257
 
258
- build_transaction tx.to_json
258
+ tx.to_json
259
259
  end
260
260
 
261
261
  def str_to_bin(str)
@@ -23,7 +23,7 @@ module MixinBot
23
23
  threshold: threshold
24
24
  },
25
25
  pin: encrypted_pin,
26
- amount: amount.to_s,
26
+ amount: format('%.8f', amount),
27
27
  trace_id: trace_id,
28
28
  memo: memo
29
29
  }
@@ -50,7 +50,7 @@ module MixinBot
50
50
  asset_id: asset_id,
51
51
  opponent_key: opponent_key,
52
52
  pin: encrypted_pin,
53
- amount: amount.to_s,
53
+ amount: format('%.8f', amount),
54
54
  trace_id: trace_id,
55
55
  memo: memo
56
56
  }
@@ -9,7 +9,7 @@ module MixinBot
9
9
 
10
10
  asset_id = options[:asset_id]
11
11
  opponent_id = options[:opponent_id]
12
- amount = options[:amount]
12
+ amount = options[:amount].to_f
13
13
  memo = options[:memo]
14
14
  trace_id = options[:trace_id] || SecureRandom.uuid
15
15
  encrypted_pin = options[:encrypted_pin] || encrypt_pin(pin)
@@ -19,7 +19,7 @@ module MixinBot
19
19
  asset_id: asset_id,
20
20
  opponent_id: opponent_id,
21
21
  pin: encrypted_pin,
22
- amount: amount.to_s,
22
+ amount: format('%.8f', amount),
23
23
  trace_id: trace_id,
24
24
  memo: memo
25
25
  }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MixinBot
4
- VERSION = '0.4.0'
4
+ VERSION = '0.5.1'
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.4.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - an-lee
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-08 00:00:00.000000000 Z
11
+ date: 2021-06-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: awesome_print