Skip to content

Instantly share code, notes, and snippets.

coinscious-io

Block or report user

Report or block coinscious-io

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@coinscious-io
coinscious-io / new_jwt_token.py
Created Aug 2, 2019
How to get your JWT token
View new_jwt_token.py
import requests
url = "https://auth-api.coinscious.org/auth/access-token"
payload = "{\n \"handle\": \"<username>\",\n \"password\": \"<password>\"\n}"
headers = {
'Content-Type': "application/json"
}
response = requests.request("POST", url, data=payload, headers=headers)
@coinscious-io
coinscious-io / new_jwt_token.java
Created Aug 2, 2019
How to get your JWT token
View new_jwt_token.java
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"handle\": \"<username>\",\n \"password\": \"<password>\"\n}");
Request request = new Request.Builder()
.url("https://auth-api.coinscious.org/auth/access-token")
.post(body)
.addHeader("Content-Type", "application/json")
.build();
@coinscious-io
coinscious-io / new_jwt_token.sh
Last active Aug 2, 2019
How to get your JWT token
View new_jwt_token.sh
curl -X POST \
https://auth-api.coinscious.org/auth/access-token \
-H 'Content-Type: application/json' \
-d '{
"handle": "<username>",
"password": "<password>"
}'
@coinscious-io
coinscious-io / live_stream_order_book_data.java
Last active Aug 2, 2019
Subscribing to live stream order book data
View live_stream_order_book_data.java
import okhttp3.Dispatcher;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import okhttp3.WebSocket;
import okhttp3.WebSocketListener;
import java.util.concurrent.TimeUnit;
public class Example {
@coinscious-io
coinscious-io / live_stream_order_book_data.py
Last active Aug 2, 2019
Subscribing to live stream order book data
View live_stream_order_book_data.py
import websocket
try:
import
thread
except ImportError:
import _thread as thread
import time
def on_message(ws, message):
print(message)
@coinscious-io
coinscious-io / live_stream_trade_history.py
Last active Aug 2, 2019
Subscribing to live stream trade history data
View live_stream_trade_history.py
import websocket
try:
import thread
except ImportError:
import _thread as thread
import time
def on_message(ws, message):
print(message)
@coinscious-io
coinscious-io / live_stream_trade_history.java
Last active Aug 2, 2019
Subscribing to live stream trade history data
View live_stream_trade_history.java
import okhttp3.Dispatcher;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import okhttp3.WebSocket;
import okhttp3.WebSocketListener;
import java.util.concurrent.TimeUnit;
public class Example {
@coinscious-io
coinscious-io / get_vwap.sh
Created Aug 2, 2019
Get the VWAP of a cryptocurrency denominated in a fiat currency
View get_vwap.sh
curl -X GET \
'https://api.coinscious.org/vwap/btc?fiat=CAD' \
-H 'Authorization: Bearer <token>'
@coinscious-io
coinscious-io / get_vwap.py
Last active Aug 2, 2019
Get the VWAP of a cryptocurrency denominated in a fiat currency
View get_vwap.py
import requests
url = "https://api.coinscious.org/vwap/btc"
querystring = {"fiat":"CAD”}
payload = ""
headers = {
'Authorization': "Bearer <token>"
}
@coinscious-io
coinscious-io / get_vwap.java
Created Aug 2, 2019
Get the VWAP of a cryptocurrency denominated in a fiat currency
View get_vwap.java
import okhttp3.Dispatcher;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import java.io.IOException;
public class Example {
public static void main(String[] args) throws IOException {
You can’t perform that action at this time.