coinapult / public

Coinapult API clients, plugins, etc.
Other
18 stars 16 forks source link

Create example using streaming #5

Open thanksmister opened 9 years ago

thanksmister commented 9 years ago

Create more examples in JavaScript for using the SockJS and websocket for ticker and transactions. Also include the links for using those examples with the Coinapult playground, there is no documentation for using the Coinapult testnet environment.

g-p-g commented 9 years ago

True, it really is lacking websocket examples in general. About the testnet environment, is there something specific you're looking for? The usage should be exactly the same (except for an ecc key which maybe you are not using).

thanksmister commented 9 years ago

Yea I am looking for the API endpoints. They can't be the same for the playground correct? If I have transactions in the playground and I want to check the status using the stream API then using the documented endpoints in the API. I was also unable to establish any connection or open status with either of the stream API endpoints listed. As you mentioned in another post there was a missing port on the websocket url.

Can the ports listed for the API production endpoints be verified/updated so they are correct? Can you provide the endpoints for the Playground so during development I might be able to get transaction and ticker data using the stream API's as well?

thanksmister commented 9 years ago

No, I am not using the ECC key but what I ran into was that neither of the endpoints listed works and neither are for the playground environment.

g-p-g commented 9 years ago

The endpoints are the same, just the hostname is different (playground.coinapult.com instead of api.coinapult.com).

thanksmister commented 9 years ago

Wait, you have https://stream.coinapult.com/ for SockJS and wss://stream.coinapult.com/websocket for websocket. So how are these to be used against the playground? Correct that the hostname for the API is different (playground.coinapult.com instead of api.coinapult.com) but how is this related to the stream API endpoints?

g-p-g commented 9 years ago

The hostname and port for the streaming API for playground is playground.coinapult.com:8123. I feel that this question is mixed with that other ticket. Let's try to separate the two so both can be solved. For this one I'm going to assume the issue is the lack of more websocket examples.

g-p-g commented 9 years ago

To help you with this, can you tell more about the examples you're looking for? Here's one involving the ticker: https://gist.github.com/g-p-g/7ad02b8df52414679ee0. Another involving transactions would be based on the code at bottom in https://coinapult.com/developer/api/streaming and then a new case to handle the 'transaction' message would be added.

thanksmister commented 9 years ago

I think I wanted more examples because I couldn't get your examples to work because of the missing port number. But if did have one example request it would be something working with Socket.io if possible. Right now I am working on the SockJS example provided in the code and your gist is a big help... thanks!

moracarlos commented 8 years ago

So, can't I create accounts with the ECC API using the playground?