Bitfinex API for Google Apps Script
This sample script is converted this sample script (javascript) to Google Apps Script. The point for converting is signature as shown in the following sample script.
- At Bitfinex API, after
"/api/" + apiPath + nonce + rawBodyis encrypted using HMAC SHA-384, the data of byte array is converted to HEX.- In Google Apps Script, there is no the method for this.
- The data which was encrypted by
Utilities.computeHmacSignature()is the bytes array of the signed hexadecimal. - On the other hand, at this sample script for javascript, the data which was encrypted by
crypto.createHmac('sha384', apiSecret).update(signature).digest('hex')is the string of the unsigned hexadecimal.
In order to achieve above, I made the method of bytesToHex().