klionpad.blogg.se

Coincheck api
Coincheck api






coincheck api

If $iMode = 2 Then $vOutOnError = Binary($vOutOnError)

coincheck api

_WinHttpDefault($iNumberOfBytesToRead, 8192) Local $iPercent = Round($iCurrentSize / $iMax * 100, 0)įunc _WinHttpReadData_Ex($hRequest, $iMode = Default, $iNumberOfBytesToRead = Default, $pBuffer = Default, $vFunc = Default) Local $hFile = & "\MY_FILE", $FO_OVERWRITE + $FO_CREATEPATH + $FO_BINARY)įunc Progress($iSizeAll, $iSizeChunk = 0) MsgBox(48, "Error", "Site is experiencing problems (or you).") $sChunk = _WinHttpReadData_Ex($hRequest, Default, Default, Default, Progress) If _WinHttpQueryDataAvailable($hRequest) Then Progress(_WinHttpQueryHeaders($hRequest, $WINHTTP_QUERY_CONTENT_LENGTH)) ProgressOn("Downloading", "In Progress.") Local $hRequest = _WinHttpOpenRequest($hConnect, Default, "MY_FILE") " : _WinHttpSetOption" & Specify the reguest Local $hConnect = _WinHttpConnect($hOpen, " Local $CurrentOption = _WinHttpQueryOption($hConnect, $WINHTTP_OPTION_SECURITY_FLAGS)

#Coincheck api full

get full header Local $sData = _WinHttpReadData ( $hRequest ) Clean _WinHttpCloseHandle ( $hRequest ) _WinHttpCloseHandle ( $hConnect ) _WinHttpCloseHandle ( $hOpen ) Display retrieved data MsgBox ( 0, "Data", $sData ) EndFunc Func sha256 ( $message ) Return _Crypt_HashData ( $message, $CALG_SHA_256 ) EndFunc Func HMAC ( $key, $message, $hash = "sha256" ) Local $blocksize = 64 Local $a_opad, $a_ipad Local Const $oconst = 0x5C, $iconst = 0x36 Local $opad = Binary ( '' ), $ipad = Binary ( '' ) $key = Binary ( $key ) If BinaryLen ( $key ) > $blocksize Then $key = Call ( $hash, $key ) For $i = 1 To BinaryLen ( $key ) $a_ipad = Number ( BinaryMid ( $key, $i, 1 ) ) $a_opad = Number ( BinaryMid ( $key, $i, 1 ) ) Next For $i = 0 To $blocksize - 1 $a_opad = BitXOR ( $a_opad, $oconst ) $a_ipad = BitXOR ( $a_ipad, $iconst ) Next For $i = 0 To $blocksize - 1 $ipad &= Binary ( '0x' & Hex ( $a_ipad, 2 ) ) $opad &= Binary ( '0x' & Hex ( $a_opad, 2 ) ) Next Return Call ( $hash, $opad & Call ( $hash, $ipad & Binary ( $message ) ) ) EndFunc Func _TimeGetStamp ( ) Local $av_Time $av_Time = DllCall ( 'CrtDll.dll', 'long:cdecl', 'time', 'ptr', 0 ) If Then SetError ( 99 ) Return False EndIf Return $av_Time EndFunc Func _Base64Encode ( $input ) $input = Binary ( $input ) Local $struct = DllStructCreate ( "byte" ) DllStructSetData ( $struct, 1, $input ) Local $strc = DllStructCreate ( "int" ) Local $a_Call = DllCall ( "Crypt32.dll", "int", "CryptBinaryToString", _ "ptr", DllStructGetPtr ( $struct ), _ "int", DllStructGetSize ( $struct ), _ "int", 1, _ "ptr", 0, _ "ptr", DllStructGetPtr ( $strc ) ) If Or Not $a_Call Then Return SetError ( 1, 0, "" ) error calculating the length of the buffer needed EndIf Local $a = DllStructCreate ( "char" ) $a_Call = DllCall ( "Crypt32.dll", "int", "CryptBinaryToString", _ "ptr", DllStructGetPtr ( $struct ), _ "int", DllStructGetSize ( $struct ), _ "int", 1, _ "ptr", DllStructGetPtr ( $a ), _ "ptr", DllStructGetPtr ( $strc ) ) If Or Not $a_Call Then Return SetError ( 2, 0, "" ) error encoding EndIf Return DllStructGetData ( $a, 1 ) EndFunc =>_Base64Encode WinHTTP ( $url, $body ) Func WinHTTP ( $sUrl, $sBody ) Local $hOpen = _WinHttpOpen ( ) Local $hConnect = _WinHttpConnect ( $hOpen, "" ) Specify the reguest: Local $hRequest = _WinHttpOpenRequest($hConnect, Default, $sApi) $accessKey = "" Add the key from above $secretKey = "" Add the secret key from above $message = $accessNonCE & $sUrl $BinarySignature = HMAC ( $secretKey, $message ) $signature = _Base64Encode ( $BinarySignature ) Encode signature Local $hRequest = _WinHttpOpenRequest ( $hConnect, "GET" ) _WinHttpAddRequestHeaders ( $hRequest, 'ACCESS-KEY: ' & $accessKey ) _WinHttpAddRequestHeaders ( $hRequest, 'ACCESS-NONCE: ' & $accessNonCE ) _WinHttpAddRequestHeaders ( $hRequest, 'ACCESS-SIGNATURE: ' & $signature ) Send request _WinHttpSendRequest ( $hRequest ) Wait for the response _WinHttpReceiveResponse ( $hRequest ) Local $sHeader = _WinHttpQueryHeaders ( $hRequest ).

  • Returned value of each function of coincheck_api.Client is a json-deserialized API response.Expand collapse popup #include #include Global Const $CALG_SHA_256 = 0x0000800c = $api = "/api/accounts/balance" $accessNonCE = _TimeGetStamp ( ) $url = "" $body = "".
  • client = Client(access_key="foo", secret="bar")








    Coincheck api