Skip to content

Commit

Permalink
Get transaction from pagination data of a request
Browse files Browse the repository at this point in the history
  • Loading branch information
hsharghi committed Jul 20, 2023
1 parent eea6a58 commit 37e94e0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Sources/VaporWallet/WalletRepository.swift
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,13 @@ extension WalletsRepository {
/// Accessing transactions of a wallet and confirming transactions
///
extension WalletsRepository {
public func transactions(type name: WalletType = .default,
paginationRequest: Request,
sortOrder: DatabaseQuery.Sort.Direction = .descending) async throws -> Page<WalletTransaction> {
let page = try paginationRequest.query.decode(PageRequest.self)
return try await transactions(type: name, paginate: page, sortOrder: sortOrder)
}

public func transactions(type name: WalletType = .default,
paginate: PageRequest = .init(page: 1, per: 10),
sortOrder: DatabaseQuery.Sort.Direction = .descending) async throws -> Page<WalletTransaction> {
Expand Down

0 comments on commit 37e94e0

Please sign in to comment.