Skip to content

Commit 7eba5a2

Browse files
authored
Add average_daily_balance_btc_sats for btc (#46)
1 parent 19fbf52 commit 7eba5a2

14 files changed

+62
-11
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [1.13.0] - 2021-09-10
9+
10+
### Added
11+
12+
- Adds ability to create Bitcoin and Ethereum estimates using the daily balance held.
13+
814
## [1.12.0] - 2021-09-08
915

1016
### Added

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
patch_ruby (1.12.0)
4+
patch_ruby (1.13.0)
55
typhoeus (~> 1.0, >= 1.0.1)
66

77
GEM

lib/patch_ruby/api/estimates_api.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def create_bitcoin_estimate_with_http_info(create_bitcoin_estimate_request, opts
9696
return data, status_code, headers
9797
end
9898

99-
# Create an ethereum estimate given a timestamp and gas used
99+
# Create an ethereum estimate
100100
# Creates an ethereum estimate for the amount of CO2 to be compensated. An order in the `draft` state may be created based on the parameters, linked to the estimate.
101101
# @param create_ethereum_estimate_request [CreateEthereumEstimateRequest]
102102
# @param [Hash] opts the optional parameters
@@ -107,7 +107,7 @@ def create_ethereum_estimate(create_ethereum_estimate_request = {}, opts = {})
107107
data
108108
end
109109

110-
# Create an ethereum estimate given a timestamp and gas used
110+
# Create an ethereum estimate
111111
# Creates an ethereum estimate for the amount of CO2 to be compensated. An order in the `draft` state may be created based on the parameters, linked to the estimate.
112112
# @param create_ethereum_estimate_request [CreateEthereumEstimateRequest]
113113
# @param [Hash] opts the optional parameters

lib/patch_ruby/api_client.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class ApiClient
3131
# @option config [Configuration] Configuration for initializing the object, default to Configuration.default
3232
def initialize(config = Configuration.default)
3333
@config = config
34-
@user_agent = "patch-ruby/1.12.0"
34+
@user_agent = "patch-ruby/1.13.0"
3535
@default_headers = {
3636
'Content-Type' => 'application/json',
3737
'User-Agent' => @user_agent

lib/patch_ruby/models/create_bitcoin_estimate_request.rb

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ class CreateBitcoinEstimateRequest
1919

2020
attr_accessor :transaction_value_btc_sats
2121

22+
attr_accessor :average_daily_balance_btc_sats
23+
2224
attr_accessor :project_id
2325

2426
attr_accessor :create_order
@@ -28,6 +30,7 @@ def self.attribute_map
2830
{
2931
:'timestamp' => :'timestamp',
3032
:'transaction_value_btc_sats' => :'transaction_value_btc_sats',
33+
:'average_daily_balance_btc_sats' => :'average_daily_balance_btc_sats',
3134
:'project_id' => :'project_id',
3235
:'create_order' => :'create_order'
3336
}
@@ -43,6 +46,7 @@ def self.openapi_types
4346
{
4447
:'timestamp' => :'Time',
4548
:'transaction_value_btc_sats' => :'Integer',
49+
:'average_daily_balance_btc_sats' => :'Integer',
4650
:'project_id' => :'String',
4751
:'create_order' => :'Boolean'
4852
}
@@ -53,6 +57,7 @@ def self.openapi_nullable
5357
Set.new([
5458
:'timestamp',
5559
:'transaction_value_btc_sats',
60+
:'average_daily_balance_btc_sats',
5661
:'project_id',
5762
:'create_order'
5863
])
@@ -93,12 +98,18 @@ def initialize(attributes = {})
9398
self.transaction_value_btc_sats = attributes[:'transaction_value_btc_sats']
9499
end
95100

101+
if attributes.key?(:'average_daily_balance_btc_sats')
102+
self.average_daily_balance_btc_sats = attributes[:'average_daily_balance_btc_sats']
103+
end
104+
96105
if attributes.key?(:'project_id')
97106
self.project_id = attributes[:'project_id']
98107
end
99108

100109
if attributes.key?(:'create_order')
101110
self.create_order = attributes[:'create_order']
111+
else
112+
self.create_order = false
102113
end
103114
end
104115

@@ -122,6 +133,7 @@ def ==(o)
122133
self.class == o.class &&
123134
timestamp == o.timestamp &&
124135
transaction_value_btc_sats == o.transaction_value_btc_sats &&
136+
average_daily_balance_btc_sats == o.average_daily_balance_btc_sats &&
125137
project_id == o.project_id &&
126138
create_order == o.create_order
127139
end
@@ -135,7 +147,7 @@ def eql?(o)
135147
# Calculates hash code according to all attributes.
136148
# @return [Integer] Hash code
137149
def hash
138-
[timestamp, transaction_value_btc_sats, project_id, create_order].hash
150+
[timestamp, transaction_value_btc_sats, average_daily_balance_btc_sats, project_id, create_order].hash
139151
end
140152

141153
# Builds the object from hash

lib/patch_ruby/models/create_ethereum_estimate_request.rb

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ class CreateEthereumEstimateRequest
2121

2222
attr_accessor :transaction_value_eth_gwei
2323

24+
attr_accessor :average_daily_balance_eth_gwei
25+
2426
attr_accessor :project_id
2527

2628
attr_accessor :create_order
@@ -31,6 +33,7 @@ def self.attribute_map
3133
:'timestamp' => :'timestamp',
3234
:'gas_used' => :'gas_used',
3335
:'transaction_value_eth_gwei' => :'transaction_value_eth_gwei',
36+
:'average_daily_balance_eth_gwei' => :'average_daily_balance_eth_gwei',
3437
:'project_id' => :'project_id',
3538
:'create_order' => :'create_order'
3639
}
@@ -47,6 +50,7 @@ def self.openapi_types
4750
:'timestamp' => :'String',
4851
:'gas_used' => :'Integer',
4952
:'transaction_value_eth_gwei' => :'Integer',
53+
:'average_daily_balance_eth_gwei' => :'Integer',
5054
:'project_id' => :'String',
5155
:'create_order' => :'Boolean'
5256
}
@@ -58,6 +62,7 @@ def self.openapi_nullable
5862
:'timestamp',
5963
:'gas_used',
6064
:'transaction_value_eth_gwei',
65+
:'average_daily_balance_eth_gwei',
6166
:'project_id',
6267
:'create_order'
6368
])
@@ -102,12 +107,18 @@ def initialize(attributes = {})
102107
self.transaction_value_eth_gwei = attributes[:'transaction_value_eth_gwei']
103108
end
104109

110+
if attributes.key?(:'average_daily_balance_eth_gwei')
111+
self.average_daily_balance_eth_gwei = attributes[:'average_daily_balance_eth_gwei']
112+
end
113+
105114
if attributes.key?(:'project_id')
106115
self.project_id = attributes[:'project_id']
107116
end
108117

109118
if attributes.key?(:'create_order')
110119
self.create_order = attributes[:'create_order']
120+
else
121+
self.create_order = false
111122
end
112123
end
113124

@@ -132,6 +143,7 @@ def ==(o)
132143
timestamp == o.timestamp &&
133144
gas_used == o.gas_used &&
134145
transaction_value_eth_gwei == o.transaction_value_eth_gwei &&
146+
average_daily_balance_eth_gwei == o.average_daily_balance_eth_gwei &&
135147
project_id == o.project_id &&
136148
create_order == o.create_order
137149
end
@@ -145,7 +157,7 @@ def eql?(o)
145157
# Calculates hash code according to all attributes.
146158
# @return [Integer] Hash code
147159
def hash
148-
[timestamp, gas_used, transaction_value_eth_gwei, project_id, create_order].hash
160+
[timestamp, gas_used, transaction_value_eth_gwei, average_daily_balance_eth_gwei, project_id, create_order].hash
149161
end
150162

151163
# Builds the object from hash

lib/patch_ruby/models/create_flight_estimate_request.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,8 @@ def initialize(attributes = {})
135135

136136
if attributes.key?(:'create_order')
137137
self.create_order = attributes[:'create_order']
138+
else
139+
self.create_order = false
138140
end
139141
end
140142

lib/patch_ruby/models/create_mass_estimate_request.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ def initialize(attributes = {})
8484

8585
if attributes.key?(:'create_order')
8686
self.create_order = attributes[:'create_order']
87+
else
88+
self.create_order = false
8789
end
8890

8991
if attributes.key?(:'project_id')

lib/patch_ruby/models/create_shipping_estimate_request.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ def initialize(attributes = {})
127127

128128
if attributes.key?(:'create_order')
129129
self.create_order = attributes[:'create_order']
130+
else
131+
self.create_order = false
130132
end
131133
end
132134

lib/patch_ruby/models/create_vehicle_estimate_request.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@ def initialize(attributes = {})
116116

117117
if attributes.key?(:'create_order')
118118
self.create_order = attributes[:'create_order']
119+
else
120+
self.create_order = false
119121
end
120122
end
121123

0 commit comments

Comments
 (0)