createListenKey method

Future<Either<String, String>> createListenKey()

Start a new user data stream. The stream will close after 60 minutes unless a keepalive is sent.

If the account has an active listenKey, that listenKey will be returned and its validity will be extended for 60 minutes.

Implementation

Future<Either<String, String>> createListenKey() {
  return sendRequest(
    path: 'fapi/v1/listenKey',
    type: RequestType.POST,
    keyRequired: true,
  ).then((r) => r.isLeft ? Left(r.left) : Right(r.right['listenKey']));
}