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 +4 -4
- data/lib/mixin_bot/api/snapshot.rb +3 -2
- data/lib/mixin_bot/cli/utils.rb +1 -7
- data/lib/mixin_bot/client.rb +3 -1
- data/lib/mixin_bot/utils.rb +11 -1
- data/lib/mixin_bot/version.rb +1 -1
- data/lib/mixin_bot.rb +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5cdd410480755e106ac96a3e492d2d4c30936dab79592442fc8ac939c3c4f184
|
4
|
+
data.tar.gz: fe3e012d4fe40573d4843b552d8f6e8dcb4322cb28f7b5aad5ec73bc115ebe1f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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)
|
data/lib/mixin_bot/cli/utils.rb
CHANGED
@@ -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
|
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'
|
data/lib/mixin_bot/client.rb
CHANGED
@@ -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
|
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
|
data/lib/mixin_bot/utils.rb
CHANGED
@@ -17,7 +17,7 @@ module MixinBot
|
|
17
17
|
NFT_MASK = 0x00
|
18
18
|
NULL_UUID = '00000000-0000-0000-0000-000000000000'
|
19
19
|
|
20
|
-
def
|
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
|
data/lib/mixin_bot/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2022-03-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|