From 37e94e05b61690b30c65b4ee3e45d92ba9dc5bb2 Mon Sep 17 00:00:00 2001 From: Hadi Sharghi Date: Thu, 20 Jul 2023 20:31:15 +0330 Subject: [PATCH] Get transaction from pagination data of a request --- Sources/VaporWallet/WalletRepository.swift | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Sources/VaporWallet/WalletRepository.swift b/Sources/VaporWallet/WalletRepository.swift index 12404c5..b43211c 100644 --- a/Sources/VaporWallet/WalletRepository.swift +++ b/Sources/VaporWallet/WalletRepository.swift @@ -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 { + 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 {