withdrawHistory method
Fetch withdraw history.
Implementation
Future<Either<String, List<Withdraw>>> withdrawHistory({
required String coin,
String? withdrawOrderId,
int? status,
int? offset,
int? limit,
int? startTime,
int? endTime,
int? recvWindow,
}) {
Map<String, String> params = {
'coin': coin,
};
if (withdrawOrderId != null) params['withdrawOrderId'] = withdrawOrderId;
if (status != null) params['status'] = status.toString();
if (offset != null) params['offset'] = offset.toString();
if (limit != null) params['limit'] = limit.toString();
if (startTime != null) params['startTime'] = startTime.toString();
if (endTime != null) params['endTime'] = endTime.toString();
if (recvWindow != null) params['recvWindow'] = recvWindow.toString();
return sendRequest(
path: 'sapi/v1/capital/withdraw/history',
type: RequestType.GET,
params: params,
keyRequired: true,
signatureRequired: true,
timestampRequired: true,
).then((r) => r.isLeft
? Left(r.left)
: Right(List<Withdraw>.from(r.right.map((e) => Withdraw.fromMap(e)))));
}