Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated getTransactions and added getPendingTransactions #17

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

JustinNothling
Copy link

The new Luno API requires an account_id to retrieve transactions. If you are currently using getTransactions you will need to update your code to use min_row and max_row to specify transaction range. You will also need to pass in your account_id instead of using the asset code.

@bausmeier
Copy link
Owner

@JustinNothling Thanks for the PR. It looks like the tests are failing because of your change - it would be awesome if you can update those to match your change. I'll take a closer look when I can find some time.

@JustinNothling
Copy link
Author

JustinNothling commented Aug 25, 2017

@bausmeier i updated your tests, let me know if that fixes things?

@JustinNothling
Copy link
Author

Ok, all tests are passing (except for "SyntaxError: Use of const in strict mode.")

@bausmeier
Copy link
Owner

@JustinNothling Thanks, that test was failing before your change anyway. I haven't had a chance to look at your change but will try and find time this evening.

Copy link
Owner

@bausmeier bausmeier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JustinNothling The code mostly looks good. I just left a few minor comments. You also haven't added any tests for the new getPendingTransactions function that you added - please do that if you can.

lib/BitX.js Outdated
@@ -218,17 +218,20 @@ BitX.prototype.createFundingAddress = function (asset, callback) {
this._request('POST', 'funding_address', {asset: asset}, callback)
}

BitX.prototype.getTransactions = function (asset, options, callback) {
BitX.prototype.getTransactions = function (account_id, options, callback) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please could you name the account id parameter using camel case so that it's consistent with the rest of the code like:

function BitX (keyId, keySecret, options) {

And please update the docs to match.

lib/BitX.js Outdated
this._request('GET', 'accounts/' + account_id + '/transactions', extend(defaults, options), callback)
}

BitX.prototype.getPendingTransactions = function (account_id, callback) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as above applies here.

offset: 5,
limit: 5
min_row: 5,
max_row: 5
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use different values for the min and max so that this test will fail if the logic gets accidentaly inverted at some point.

README.md Outdated
### getTransactions(asset, [options, ]callback)
GET https://api.mybitx.com/api/1/transactions
### getTransactions(account_id, [options, ]callback)
GET https://api.mybitx.com/api/1/accounts/:id/transactions
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use the same style of placeholder for variables as the rest of the docs i.e. {accountId}.

@codecov-io
Copy link

codecov-io commented Aug 30, 2017

Codecov Report

❗ No coverage uploaded for pull request base (master@00e9f05). Click here to learn what that means.
The diff coverage is 75%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master      #17   +/-   ##
=========================================
  Coverage          ?   99.22%           
=========================================
  Files             ?        1           
  Lines             ?      129           
  Branches          ?        0           
=========================================
  Hits              ?      128           
  Misses            ?        1           
  Partials          ?        0
Impacted Files Coverage Δ
lib/BitX.js 99.22% <75%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 00e9f05...f683022. Read the comment docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants