mirror of
https://github.com/skydiver/ewelink-api.git
synced 2025-12-24 14:31:53 +01:00
20 lines
391 B
JavaScript
20 lines
391 B
JavaScript
const { timestamp, nonce } = require('../helpers/utilities');
|
|
|
|
const wssLoginPayload = ({ at, apiKey, appid }) => {
|
|
const payload = {
|
|
action: 'userOnline',
|
|
version: 8,
|
|
ts: timestamp,
|
|
at,
|
|
userAgent: 'app',
|
|
apikey: apiKey,
|
|
appid,
|
|
nonce,
|
|
sequence: Math.floor(timestamp * 1000),
|
|
};
|
|
|
|
return JSON.stringify(payload);
|
|
};
|
|
|
|
module.exports = wssLoginPayload;
|