askmike / bitstamp Goto Github PK
View Code? Open in Web Editor NEWBitstamp REST API wrapper
Bitstamp REST API wrapper
Bitstamp has changed their API. The current implementation will stop working by the end of October. I've also created a copy of this issue for Gekko.
Hey,
I was trying your example but not getting how to display the console.log output of ticker etc in html.
Can you help me?
client_id needs to be a string, so client_id = 0 is quite misleading.
It'll help if it's '0' or '12345'
hi,
i just discovered your bitstamp node
and im looking in documentation for withdrawing BTC and XRP
now for XRP in dont get this from documentation:
privateBitstamp.ripple_withdrawal(amount, address, currency);
now my questions:
When too many calls are made to the private API, Bitstamp will temporarily block the requests and inform us of it.
In Bitstamp.prototype._request:
the res.StatusCode is 200, however the buffer cannot be parsed as JSON. This results in messages like "SyntaxError: Unexpected token . in JSON at position 6" being passed as the error to the API callback.
Instead can we either return a BitstampError with the raw buffer text or include the raw buffer text in some other way.
The wrapper appears to be missing order_status
Hi Mike,
I noticed parameters offset
and sort
are not supported by user_transactions
method.
Do you plan to implement these sometimes soon?
Thanks
With introduction of API v2 incompatible (non-backward compatible) changes has been introduced.
As per Semantic Versioning, MAJOR version need to be stepped up
The transfer-to-main and transfer-from-main are v2 api, while it is using the legacy_endpoint in the code.
I'd like to propose a queue so we don't accidentally get banned from Bitstamp for flooding the API as implemented in:
I could not find a method for getting the orderBook
list in your module?
Update: my mistake...
Hi, can you make a new release? It would be great for me ๐
on: buy/sell function calls i get bitstamp error 404 ?
ist this node absolete?
Hello, I see in the following code:
Bitstamp.prototype.buy = function(market, amount, price, limit_price, callback) {
this._post(market, 'buy', callback, {
amount: amount,
price: price,
limit_price: limit_price
});
}
that the buy (and sell) API calls have a limit_price field, which is optional. I'm a little noob on js, but how can I do a buy order without putting the "limit_price" arg?
Can I just do "privateBitstamp.buy('btcusd', amount, price, console.log);"? Will the limit_price not be used in that case?
@askmike
It is the same issue with both buy and sell
In some situations "daily_order" is a better option if an order in the opposite direction is not desireable, IMO
Bitstamp.prototype.sell = function(market, amount, price, limit_price, callback) {
this._post(market, 'sell', callback, {
amount: amount,
price: price,
limit_price: limit_price
});
}
Hi,
would it be possible to make all the request async, possibly with promises?
Hi,
Perhaps this is something I don't know about javascript. If you initialize nonce in the constructor as Date.now(), then generateNonce function returns nonce++. Wouldn't that always be unique as long as you use the same object?
Preferably the module should be consistent and return all error as Error object.
The error "'Must provide key, secret and client ID to make this API request' is returned as String
hi,
when i call
privateBitstamp.buy
i get error invalid nonce?
any idea?
BUT
if i call
privateBitstamp.balanc
i get the balance
my bad... generated new keys... now works perfectly!
Parameter time
is not implemented for order_book
.
Also parameter group
doesn't appear in official API documentation anymore.
When doing a call to a nonexisting endpoint, this one caoncats the error code and buffer. which means I am getting the entire html page in return.
if (res.statusCode !== 200) {
return callback(new Error('Bitstamp error ' + res.statusCode + ': ' + buffer));
}
Is it possible get the return as two different entities, preferably as an object with statusCode and a short descriptive text like this for the most common error codes?
{ statusCode: 404, statusText: 'Not found' }
At least separate the statusCode from the buffer.
When an http error is received from Bitstamp, the methods do not return the http error code and error message
https://github.com/askmike/bitstamp/blob/master/bitstamp.js#L48
Hi, sorry for all the questions using the "issues" on github, but there is no contact mail.
Is the library supporting straightforward the new markets with XRP? Is also the bitstamp-ws supporting these new markets and the EUR-USD market?
PS: sent you a tip in BTC for the nice work ;)
Sometimes an API call will return without an err obj but the result will contain:
{error: "Invalid nonce"}
My code
`var Bitstamp = require('bitstamp');
var bitstamp = new Bitstamp();
bitstamp.transactions('btcusd', function(err, trades) {
console.error(err);
console.log(trades);
});`
node -v
v12.6.0
node --http-parser=legacy index.js
it's a work around for run
but if i call
node index.js
i got this error:
Error: Parse Error
at TLSSocket.socketOnData (_http_client.js:452:22)
at TLSSocket.emit (events.js:203:13)
at addChunk (_stream_readable.js:294:12)
at readableAddChunk (_stream_readable.js:275:11)
at TLSSocket.Readable.push (_stream_readable.js:210:10)
at TLSWrap.onStreamRead (internal/stream_base_commons.js:166:17) {
bytesParsed: 368,
code: 'HPE_INVALID_HEADER_TOKEN',
reason: 'Invalid header value char'
}
see here.
Hi Mike,
I would like to prepare a pull request to add withdrawal requests (like eth) but I don't know how to locally update my package. I use your package as a base then
And the issue I have is that the new functions (like eth_withdrawal) are not recognized ("eth_withdrawal is not a function")
Do you have an idea?
Sorry for tagging this as an issue I don't know how to open a simple question on your repo :(
Please change:
'Content-Length': data.length -> Buffer.byteLength(post_data),
While it should be passed to the callback. Todo: replicate & handle correctly.
events.js:72
throw er; // Unhandled 'error' event
^
Error: socket hang up
at SecurePair.error (tls.js:999:23)
at EncryptedStream.CryptoStream._done (tls.js:695:22)
at CleartextStream.read [as _read] (tls.js:496:24)
at CleartextStream.Readable.read (_stream_readable.js:320:10)
at EncryptedStream.onCryptoStreamFinish (tls.js:301:47)
at EncryptedStream.g (events.js:175:14)
at EncryptedStream.EventEmitter.emit (events.js:117:20)
at finishMaybe (_stream_writable.js:354:12)
at endWritable (_stream_writable.js:361:3)
at EncryptedStream.Writable.end (_stream_writable.js:339:5)
at EncryptedStream.CryptoStream.end (tls.js:633:31)
at Socket.onend (_stream_readable.js:483:10)
EDIT: error was on windows, might be platform specific.
cannot call method balance
without parameter market
According to Bitstamp API specification this should be possible
There seems to be an uncaught exception that get's thrown when a request times out.
connect ETIMEDOUT
when args
is empty GET path should not contain ?
https://github.com/askmike/bitstamp/blob/master/bitstamp.js#L98
This is not a functionality issue, however it is not in line with official API documentation.
Example for ticker it should be
https://www.bitstamp.net/api/ticker/
rather then https://www.bitstamp.net/api/ticker/?
The issue leads to confusion for example when module is included in mock API tests
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.