Skip to content

Instantly share code, notes, and snippets.

@hitbtc-com
hitbtc-com / socket_orderbook.js
Created October 2, 2018 14:40
Socket API example with orderbook
if (typeof WebSocket !== 'function') {
// for node.js install ws package
WebSocket = require('ws');
}
const logger = {
debug: (...arg) => {
// console.log((new Date).toISOString(), 'DEBUG', ...arg)
},
info: (...arg) => {
import datetime
import hashlib
import hmac
import random
import string
import time
import unirest as unirest
key = "da01c7e1f0dc4f166c6aa3d56add3293"
secret = "XXXXXXXXXXXXXXXXXXXXXXXXXX"
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.HttpClient;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.message.BasicNameValuePair;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
@hitbtc-com
hitbtc-com / hitbtc_example.java
Created July 25, 2014 13:37
hitbtc rest trading API example
package com.company;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
using System;
using WebSocketSharp;
// Install WebSocketSharp https://github.com/sta/websocket-sharp (e.g. via NuGet)
namespace Hitbtc
{
public class Program
{
public static void Main(string[] args)
{
@hitbtc-com
hitbtc-com / hitbtc_example.php
Last active September 2, 2023 18:34
hitbtc php example
<?php
namespace Hitbtc;
/**
* show off @method
*
* @method string balance() balance( array $params )
* @method string ordersActive() ordersActive( array $params )
* @method string new_order() new_order( array $params )
* @method string cancel_order() cancel_order( array $params )
* @method string trades() trades( array $params )
using RestSharp;
using System;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
namespace Hitbtc.Api.Demo
{
class Program
{