Skip to content

Commit

Permalink
Allow setting of mining_fees_satoshis with create_forwarding_address
Browse files Browse the repository at this point in the history
  • Loading branch information
ramontayag committed Oct 25, 2016
1 parent 2e4c35b commit 824832f
Show file tree
Hide file tree
Showing 3 changed files with 112 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/blockcypher/api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -287,11 +287,17 @@ def event_webhook_delete(id)
# Payments and Forwarding API
##################

def create_forwarding_address(destination, callback_url: nil, enable_confirmations: false)
def create_forwarding_address(
destination,
callback_url: nil,
enable_confirmations: false,
mining_fees_satoshis: nil
)
payload = {
destination: destination,
callback_url: callback_url,
enable_confirmations: enable_confirmations
enable_confirmations: enable_confirmations,
mining_fees_satoshis: mining_fees_satoshis,
}
api_http_post('/payments', json_payload: payload)
end
Expand Down
2 changes: 2 additions & 0 deletions spec/blockcypher/api_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,11 @@ module BlockCypher
forward_details = api.create_forwarding_address(address_1, {
callback_url: "http://test.com/foo",
enable_confirmations: true,
mining_fees_satoshis: 20_000,
})
expect(forward_details["callback_url"]).to eql("http://test.com/foo")
expect(forward_details["enable_confirmations"]).to be true
expect(forward_details["mining_fees_satoshis"]).to be 20_000
end

it 'is possible to use the alias create_payments_forwarding' do
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 824832f

Please sign in to comment.