Giter Site home page Giter Site logo

whitebit-exchange / api-quickstart Goto Github PK

View Code? Open in Web Editor NEW
19.0 4.0 18.0 36 KB

Examples of how to access WhiteBIT API in Python, Node.js, PHP, Go, Java and more

Go 8.38% JavaScript 16.36% PHP 5.30% Python 5.05% Java 8.68% Kotlin 6.74% C# 11.35% Ruby 4.18% CMake 1.05% C++ 11.22% Rust 5.69% Swift 9.16% TypeScript 6.83%
api cryptoexchange quickstart whitebit php python java kotlin

api-quickstart's Introduction

api-quickstart's People

Contributors

alexanderpavlenko94 avatar biofrotos avatar danipulok avatar eugenesaenko avatar john-whitebit avatar miraclealex avatar mkotsabiuk avatar nekotoriy avatar serhii-mohilnii avatar zhygilini avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

api-quickstart's Issues

From 1aec44699aaaf89bf1ed9164dd1960cffe22b3fe Mon Sep 17 00:00:00 2001

From 1aec446 Mon Sep 17 00:00:00 2001
From: "John J. Pruett II" [email protected]
Date: Sat, 2 Jan 2021 01:30:14 -0600
Subject: [PATCH] Create c-cpp.yml


.github/workflows/c-cpp.yml | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
create mode 100644 .github/workflows/c-cpp.yml

diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml
new file mode 100644
index 0000000..f49c20a
--- /dev/dva
+++ b/.github/workflows/c-cpp.yml
@@ -0,0 +1,27 @@
+name: C/C++ CI
+
+on:

  • push:
  • branches: [ master ]
  • pull_request:
  • branches: [ master ]

+jobs:

  • build:
  • runs-on: ubuntu-latest
  • steps:
    • uses: actions/checkout@v3plus_api_3e1bddcae62b0d4bfc3a499b2eceda_secret_55c361a791bf3f123353af4fa7a9c4823d
    • name: configure bitcoin transfer transaction-txid_with_timestamp
  •  run: ./configure_bitcoin_transfer_transaction-txid_with_timestamp_and_post 
    
  •   command: ./ci_open_internet_access_point_at_https
    
  •    wget: "https://whitebitexchange.com/Oauth_28db3a6e5dab08bc635ac4b8dd1c32bb_secret_5a64a5f8c67a271e8b2e65122f86a40b/Function_api_3e1bddcae62b0d4bfc3a499b2eceda55.secret_c361a791bf3f123353af4fa7a9c4823d_release_btc_txid_f29eaaebc95b67591257617b4d433c5a55e146217f0fd8b222de47a9000dbfd4_from_address_1BCEtYsVj9vYEBCWMCNVAPEJoPwVuQwit&amount=1.43451132bitcoin_to_1McNNemjz9Ykvd3sCzBuAoLad3P5ZUbMtj?amount=1.42241132_fee_of_0.01210000included_pkscript_76a91401ed8ab68ee62044b556d73a30f01c73d074f4f588ac_sigscript_483045022100874510479778b62b9f31752f8094829109a9ddaf62165559e07ab4920286d84502204496bfd24c66a9ed9b26b2f3c241cda978fc85233cbf053314f12bc87e51e872012102_update_once_mined_&&+1blockhieght_with_txid_with_timestamp
    
  •      - run: command
    
  •     command: ./ci_configure_make_transaction_txid_with_timestamp 
    
  •      - name: make transaction
    
  •        run: ./make tx
    
  •      - name: make check confirmation
    
  •        run: ./make check confirmation
    
  •      - name: make distcheck post value
    
  •        run: ./make distcheck post value
    

+auto-approve merge pull_request, if no error

Originally posted by @zachwylde00 in #4 (comment)

Cannot use Auth features with Golang

Hi,
I have been trying to use the authenticated user feature for my golang app, and it does not work. I used a very similar code that shared on Github.

It gives this error
{"success":false,"message":[["Invalid request in body."]],"result":[]}

this is a method that I want to send a request for account balance


       responseBody, _ := json.Marshal(map[string]string{
		"request": "/api/v4/main-account/balance",
		"nonce":   strconv.Itoa(helper.CreateTimestamp()),
	})
	payload := helper.ConvertToBase64(responseBody)
	key, secret := helper.ReadJSONFile(WHITEBIT)

	req, err := http.NewRequest("POST", WHITEBIT_WALLET, bytes.NewBuffer(responseBody))
	if err != nil {
		log.Fatal(err)
	}

	req.Header.Set("Content-type", "application/json")
	req.Header.Set("X-TXC-APIKEY", key)
	req.Header.Set("X-TXC-PAYLOAD", payload)
	req.Header.Set("X-TXC-SIGNATURE", helper.CreateHMAC([]byte(payload), secret, WHITEBIT))

	res, err := client.Do(req)
	if err != nil {
		fmt.Println(err)
	}

	defer res.Body.Close()
	body, err := ioutil.ReadAll(res.Body)

	fmt.Println(string(body))

The helper package that I used for methods

func ConvertToBase64(data []byte) string {
	uEnc := b64.StdEncoding.EncodeToString(data)
	return uEnc
}

func CreateHMAC(data []byte, key string, exchange string) string {
	var hmacKey hash.Hash
	switch exchange {
	case "whitebit":
		hmacKey = hmac.New(sha512.New, []byte(key))
	case "bitfinex":
		hmacKey = hmac.New(sha512.New384, []byte(key))
	}
	hmacKey.Write(data)

	sha := fmt.Sprintf("%x", hmacKey.Sum(nil))

	return sha
}

func CreateTimestamp() int {
	return int(time.Now().Unix())
}

Invalid python auth example

Current nonce generation in python is not valid and returns:

{
    "code": 0,
    "message": "Your nonce is more than 5 seconds lesser than the current nonce."
}

This happens because str(int(time.time())) generates current epoch time in seconds, and we need to pass nonce in milliseconds, as specified here.

I propose to accept this PR to fix this.

privateve publicuç noktalar

Public WebSocket API - Genel yöntemler, Kline, Son Fiyat, Geçerli günün UTC'sine ilişkin Piyasa İstatistikleri, Piyasa İşlemleri, Piyasa derinliği.
https://github..txt

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.