Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'crypto'
- https = require 'ssl.https'
- local key, secret = "89QK21JO-8O72SN4U-ZUR4CGE5-TSGNT63S",
- "50c94254737f8a47364eb6825055fd93c5cf9b2e927d366e7acdf22e58e89e3fa2c32955d1feddc2f395a2d44507c36167be348dbd44b3eae6d1019d938994cd"
- local poloniex_url = "https://poloniex.com/tradingApi"
- local post_data = [[nonce=1399116375497&command=returnBalances]] --os.time()
- local signature = crypto.hmac.digest("sha512", post_data, secret)
- print(poloniex_url)
- print("sha512:", signature)
- https.request
- {
- method = "POST",
- url = poloniex_url,
- headers =
- {
- Sign = signature,
- Key = key,
- ["Content-Type"] = "application/x-www-form-urlencoded",
- ["Content-Length"] = #post_data
- },
- source = ltn12.source.string(post_data),
- sink = ltn12.sink.file(io.stdout)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement