mixin_bot 0.7.10 → 0.7.13

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: 222522068617e93a42e0b59a81d8afc8908ed3569217c643d781ba4b721f639a
4
- data.tar.gz: 8d15656e77f7176c91b3daf7d6fc4901c257db8005d1adf27d526913c1646286
3
+ metadata.gz: 5cdd410480755e106ac96a3e492d2d4c30936dab79592442fc8ac939c3c4f184
4
+ data.tar.gz: fe3e012d4fe40573d4843b552d8f6e8dcb4322cb28f7b5aad5ec73bc115ebe1f
5
5
  SHA512:
6
- metadata.gz: 5fb562d8867fb8b06723367e9d1a38d4d7bd6c9d6d7c1af7444283855b316d2f18b5aae365f27eb14be85a1630541c81e790cc7aae94bbf2ac21591e029e7f76
7
- data.tar.gz: b722aa66007d94077ef6b963b260066cfd02074469f58f70f2959f4cf6e1c4c8aaae9c6d18e2bf45af2903a0443f76a3989b172250e4a8c958cea2fcffdc42b8
6
+ metadata.gz: 738d63fe68c680d5aef9a38ecc2d1235f8b7adb9e0acf4fec3996ac161af779bfaf0b8a4042850e3da5bd74099b99c9197fd84a3ca558df176aa8a63e001a3c9
7
+ data.tar.gz: 51be6edd791ca609c3e40a7758ec132f29f86903cbfaf639a382cd95c9ebccee641d2d4497c113a12a8021f37d79055a58358ea225a16c7557c2b5c0dd16e062
@@ -20,11 +20,12 @@ module MixinBot
20
20
 
21
21
  def snapshots(**options)
22
22
  path = format(
23
- '/snapshots?limit=%<limit>s&offset=%<offset>s&asset=%<asset>s&opponent=%<opponent>s',
23
+ '/snapshots?limit=%<limit>s&offset=%<offset>s&asset=%<asset>s&opponent=%<opponent>s&order=%<order>s',
24
24
  limit: options[:limit],
25
25
  offset: options[:offset],
26
26
  asset: options[:asset],
27
- opponent: options[:opponent]
27
+ opponent: options[:opponent],
28
+ order: options[:order],
28
29
  )
29
30
 
30
31
  access_token = options[:access_token] || access_token('GET', path)
@@ -11,13 +11,7 @@ module MixinBot
11
11
 
12
12
  desc 'unique UUIDS', 'generate unique UUID for two or more UUIDs'
13
13
  def unique(*uuids)
14
- uuids.sort
15
- r = uuids.first
16
- uuids.each_with_index do |uuid, i|
17
- r = MixinBot::Utils.unique_uuid(r, uuid) if i.positive?
18
- end
19
-
20
- log r
14
+ log MixinBot::Utils.unique_uuid *uuids
21
15
  end
22
16
 
23
17
  desc 'generatetrace HASH', 'generate trace ID from Tx hash'
@@ -76,7 +76,9 @@ module MixinBot
76
76
  raise UnauthorizedError, errmsg
77
77
  when 403, 20116, 10002, 429
78
78
  raise ForbiddenError, errmsg
79
- when 400, 404, 10006, 20133, 500, 7000, 7001
79
+ when 404
80
+ raise NotFoundError, errmsg
81
+ when 400, 10006, 20133, 500, 7000, 7001
80
82
  raise ResponseError, errmsg
81
83
  when 20117
82
84
  raise InsufficientBalanceError, errmsg
@@ -17,7 +17,7 @@ module MixinBot
17
17
  NFT_MASK = 0x00
18
18
  NULL_UUID = '00000000-0000-0000-0000-000000000000'
19
19
 
20
- def unique_uuid(uuid_1, uuid_2)
20
+ def generate_unique_uuid(uuid_1, uuid_2)
21
21
  md5 = Digest::MD5.new
22
22
  md5 << [uuid_1, uuid_2].min
23
23
  md5 << [uuid_1, uuid_2].max
@@ -37,6 +37,16 @@ module MixinBot
37
37
  )
38
38
  end
39
39
 
40
+ def unique_uuid(*uuids)
41
+ uuids.sort
42
+ r = uuids.first
43
+ uuids.each_with_index do |uuid, i|
44
+ r = MixinBot::Utils.generate_unique_uuid(r, uuid) if i.positive?
45
+ end
46
+
47
+ r
48
+ end
49
+
40
50
  def generate_trace_from_hash(hash, output_index = 0)
41
51
  md5 = Digest::MD5.new
42
52
  md5 << hash
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MixinBot
4
- VERSION = '0.7.10'
4
+ VERSION = '0.7.13'
5
5
  end
data/lib/mixin_bot.rb CHANGED
@@ -35,6 +35,7 @@ module MixinBot
35
35
  class HttpError < Error; end
36
36
  class RequestError < Error; end
37
37
  class ResponseError < Error; end
38
+ class NotFoundError < Error; end
38
39
  class UnauthorizedError < Error; end
39
40
  class ForbiddenError < Error; end
40
41
  class InsufficientBalanceError < Error; 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.7.10
4
+ version: 0.7.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - an-lee
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-03-02 00:00:00.000000000 Z
11
+ date: 2022-03-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport