Skip to content

Commit

Permalink
feat: add new method to retrieve list of current user wallet records
Browse files Browse the repository at this point in the history
  • Loading branch information
nekofar committed Jul 15, 2021
1 parent aea5534 commit d90cd60
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/nobitex.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,13 @@ class Nobitex {

return jsonDecode(response.body) as Map<String, dynamic>?;
}

Future<Map<String, dynamic>?> getWalletRecords() async {
var url = Uri.https(basePath, '/users/wallets/deposits/list');

var response =
await http.post(url, headers: {'Authorization': 'Token ' + token});

return jsonDecode(response.body) as Map<String, dynamic>?;
}
}
6 changes: 6 additions & 0 deletions test/nobitex_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,11 @@ void main() {

expect(data!.containsKey('wallets'), true);
});

test('test getWalletRecords', () async {
var data = await nobitex.getWalletRecords();

expect(data!.containsKey('deposits'), true);
});
});
}

0 comments on commit d90cd60

Please sign in to comment.