Skip to content

Commit

Permalink
add get_network_fee_estimate endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
patricklodder committed Dec 20, 2014
1 parent 2bf23de commit cf6769f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/block_io.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ BlockIo.PASSTHROUGH_METHODS = [
'get_user_balance', 'get_user_address', 'get_user_received', 'get_current_price',
'is_green_address', 'is_green_transaction', 'get_transactions', 'sign_and_finalize_withdrawal',
'get_new_dtrust_address', 'get_my_dtrust_addresses', 'get_dtrust_address_by_label', 'get_dtrust_transactions',
'get_dtrust_address_balance'
'get_dtrust_address_balance', 'get_network_fee_estimate'
];

BlockIo.WITHDRAWAL_METHODS = [
Expand Down
19 changes: 19 additions & 0 deletions test/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,25 @@ spec.addBatch({
})
});

if (VERSION > 1) spec.addBatch({
'get_network_fee_estimate': genericHelpers.makeMethodCase(
client,
'get_network_fee_estimate',
{
from_address: cache.lazy('fromAddress'),
amounts: genericHelpers.calcWithdrawalAmount,
to_addresses: cache.lazy('newAddress')
},
{
"must return fee estimation data": function (err, res) {
assert.isObject(res);
assert.isObject(res.data);
assert.isString(res.data.estimated_network_fee);
}
}
)
});

// depreciated after v1:
if (VERSION == 1) spec.addBatch({
"get_address_received (by address)": genericHelpers.makeMethodCase(
Expand Down

0 comments on commit cf6769f

Please sign in to comment.