Module: MaxExchangeApi::Helper
- Defined in:
- lib/max_exchange_api/helper.rb
Class Method Summary collapse
Class Method Details
.gen_headers(payload, access_key, secret_key, sub_account_sn: nil) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/max_exchange_api/helper.rb', line 9 def gen_headers(payload, access_key, secret_key, sub_account_sn: nil) encoded_payload = encode(payload) headers = { 'X-MAX-ACCESSKEY' => access_key, 'X-MAX-PAYLOAD' => encoded_payload, 'X-MAX-SIGNATURE' => encrypt(encoded_payload, secret_key), } headers['X-Sub-Account'] = sub_account_sn if sub_account_sn return headers end |