Here’s a file you can use to connect to the Cryptopia API.
This snippet allows you to programmatically access the Cryptopia API using Promises, which is much, much easier than dealing with callbacks, in my opinion. I generally do not release any crypto-related code, but in this case, I think I can help a few people out.