sorare-rewards 1.3.0 → 1.4.0
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/CHANGELOG.md +12 -0
- data/Gemfile.lock +2 -2
- data/README.md +2 -5
- data/lib/sorare/rewards/league.rb +10 -2
- data/lib/sorare/rewards/version.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 385b50a4b23229464d9807665633f7bc5475f2572a1981fb2be18dd5501f3620
|
4
|
+
data.tar.gz: 01f7f7d0bed52e96f3caec5743004bb10b16f4a223ce83f804ec4e94d96b4bd3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 188333489495c2a7ab8e4da7a1f0cd7874131cdb01acde247997f925edf473639db04ee8a7ddb02c8458c77f89888c0bb6a6eaccd724523d86c305cd50c86835
|
7
|
+
data.tar.gz: 00c0276d280c1c3b0e5980837709d69d24dbd5263975f33546099589ddca46aeebb8cad4bee0572561bd85febfdea98e986f5cb622ab92bd0bca9d1357500ee0
|
data/CHANGELOG.md
CHANGED
@@ -1,11 +1,23 @@
|
|
1
|
+
## [1.4.0] - 2021-12-14
|
2
|
+
|
3
|
+
### Added
|
4
|
+
|
5
|
+
- Added support for rarity based `rewards_ratio_per_cards_in_circulation`
|
6
|
+
|
1
7
|
## [1.3.0] - 2021-11-02
|
8
|
+
|
2
9
|
### Breaking
|
10
|
+
|
3
11
|
- Removed rewards method from `GameWeek` (`card_rewards`, `cards_picked`, `reward_allocations`, `prize_pools`, `card_allocations`)
|
4
12
|
- `Picker` has been renamed to `CardPicker`
|
13
|
+
|
5
14
|
### Added
|
15
|
+
|
6
16
|
- Added a `GameWeekRewards` class that provides all rewards related methods
|
7
17
|
- Added a way to pick cards with a custom `card_allocations`
|
8
18
|
|
9
19
|
## [1.2.0] - 2021-11-02
|
20
|
+
|
10
21
|
### Added
|
22
|
+
|
11
23
|
- Enable cross leagues cooldown using `per_league` configuration flag
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -10,15 +10,14 @@ gem 'sorare-rewards'
|
|
10
10
|
|
11
11
|
And then execute:
|
12
12
|
|
13
|
-
|
13
|
+
$ bundle install
|
14
14
|
|
15
15
|
Or install it yourself as:
|
16
16
|
|
17
|
-
|
17
|
+
$ gem install sorare-rewards
|
18
18
|
|
19
19
|
## Usage
|
20
20
|
|
21
|
-
|
22
21
|
First you need to load a game week
|
23
22
|
|
24
23
|
```ruby
|
@@ -27,7 +26,6 @@ game_week = Sorare::Rewards::GameWeek.new(hash: 'QmbwCo1fuhRN1T2DyEQtETefsBH6yCj
|
|
27
26
|
|
28
27
|
Game Week's `hash` and `salt` can be retrieved using the GQL API, the salt is made public after the rewards have been distributed.
|
29
28
|
|
30
|
-
|
31
29
|
To compute rewards for a game week :
|
32
30
|
|
33
31
|
```ruby
|
@@ -67,7 +65,6 @@ After checking out the repo, run `bin/setup` to install dependencies. Then, run
|
|
67
65
|
|
68
66
|
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
69
67
|
|
70
|
-
|
71
68
|
## License
|
72
69
|
|
73
70
|
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
@@ -24,9 +24,17 @@ module Sorare
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def cards_in_circulation_limit(rarity)
|
27
|
-
return unless cards_in_circulation&.dig(rarity) &&
|
27
|
+
return unless cards_in_circulation&.dig(rarity) && rewards_ratio_per_cards_in_circulation_for_rarity(rarity)
|
28
28
|
|
29
|
-
(cards_in_circulation[rarity] *
|
29
|
+
(cards_in_circulation[rarity] * rewards_ratio_per_cards_in_circulation_for_rarity(rarity)).floor
|
30
|
+
end
|
31
|
+
|
32
|
+
def rewards_ratio_per_cards_in_circulation_for_rarity(rarity)
|
33
|
+
if game_week.config.rewards_ratio_per_cards_in_circulation.is_a?(Hash)
|
34
|
+
return game_week.config.rewards_ratio_per_cards_in_circulation&.dig(rarity)
|
35
|
+
end
|
36
|
+
|
37
|
+
game_week.config.rewards_ratio_per_cards_in_circulation
|
30
38
|
end
|
31
39
|
|
32
40
|
def each_division_prize_pools
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sorare-rewards
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- pierre
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-12-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -150,7 +150,7 @@ dependencies:
|
|
150
150
|
- - "~>"
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: 2.5.0
|
153
|
-
description:
|
153
|
+
description:
|
154
154
|
email:
|
155
155
|
- pierre@sorare.com
|
156
156
|
executables: []
|
@@ -211,7 +211,7 @@ licenses:
|
|
211
211
|
metadata:
|
212
212
|
homepage_uri: https://gitlab.com/sorare/sorare-rewards
|
213
213
|
source_code_uri: https://gitlab.com/sorare/sorare-rewards
|
214
|
-
post_install_message:
|
214
|
+
post_install_message:
|
215
215
|
rdoc_options: []
|
216
216
|
require_paths:
|
217
217
|
- lib
|
@@ -226,8 +226,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
226
226
|
- !ruby/object:Gem::Version
|
227
227
|
version: '0'
|
228
228
|
requirements: []
|
229
|
-
rubygems_version: 3.
|
230
|
-
signing_key:
|
229
|
+
rubygems_version: 3.1.6
|
230
|
+
signing_key:
|
231
231
|
specification_version: 4
|
232
232
|
summary: '["Sorare", "reward", "allocation", "algorithm"]'
|
233
233
|
test_files: []
|