diff --git a/lib/core/src/Cardano/Wallet/Api.hs b/lib/core/src/Cardano/Wallet/Api.hs index f0cd098979d..28fd5efd603 100644 --- a/lib/core/src/Cardano/Wallet/Api.hs +++ b/lib/core/src/Cardano/Wallet/Api.hs @@ -124,6 +124,7 @@ type CompatibilityApi t = :<|> GetByronWallet :<|> GetByronWalletMigrationInfo :<|> ListByronWallets + :<|> ListByronTransactions t :<|> MigrateByronWallet t :<|> PostByronWallet @@ -307,6 +308,15 @@ type GetByronWalletMigrationInfo = "byron-wallets" type ListByronWallets = "byron-wallets" :> Get '[JSON] [ApiByronWallet] +-- | https://input-output-hk.github.io/cardano-wallet/api/#operation/listByronTransactions +type ListByronTransactions t = "byron-wallets" + :> Capture "walletId" (ApiT WalletId) + :> "transactions" + :> QueryParam "start" Iso8601Time + :> QueryParam "end" Iso8601Time + :> QueryParam "order" (ApiT SortOrder) + :> Get '[JSON] [ApiTransaction t] + -- | https://input-output-hk.github.io/cardano-wallet/api/#operation/migrateByronWallet type MigrateByronWallet t = "byron-wallets" :> Capture "sourceWalletId" (ApiT WalletId) diff --git a/lib/core/src/Cardano/Wallet/Api/Server.hs b/lib/core/src/Cardano/Wallet/Api/Server.hs index 9bd725e6653..05e83d37a9c 100644 --- a/lib/core/src/Cardano/Wallet/Api/Server.hs +++ b/lib/core/src/Cardano/Wallet/Api/Server.hs @@ -633,7 +633,6 @@ deleteTransaction ctx (ApiT wid) (ApiTxId (ApiT (tid))) = do listTransactions :: forall ctx s t k. ( DefineTx t - , s ~ SeqState t , ctx ~ ApiLayer s t k ) => ctx @@ -752,6 +751,7 @@ compatibilityApiServer rndCtx seqCtx = :<|> getByronWallet rndCtx :<|> getByronWalletMigrationInfo rndCtx :<|> listByronWallets rndCtx + :<|> listByronTransactions rndCtx :<|> migrateByronWallet rndCtx seqCtx :<|> postByronWallet rndCtx @@ -828,6 +828,20 @@ postByronWallet ctx body = do rootXPrv = Rnd.generateKeyFromSeed mnemonicSentence passphrase wid = WalletId $ digest $ publicKey rootXPrv +listByronTransactions + :: forall ctx s t k. + ( DefineTx t + , ctx ~ ApiLayer s t k + ) + => ctx + -> ApiT WalletId + -> Maybe Iso8601Time + -> Maybe Iso8601Time + -> Maybe (ApiT SortOrder) + -> Handler [ApiTransaction t] +listByronTransactions = + listTransactions + {------------------------------------------------------------------------------- Helpers -------------------------------------------------------------------------------} diff --git a/specifications/api/swagger.yaml b/specifications/api/swagger.yaml index 0ec21effd15..69a4639f55b 100644 --- a/specifications/api/swagger.yaml +++ b/specifications/api/swagger.yaml @@ -992,6 +992,7 @@ x-tagGroups: - name: Byron (Random) tags: - Byron Wallets + - Byron Transactions - Byron Migrations - name: Miscellaneous @@ -1293,6 +1294,17 @@ paths: - *parametersWalletId responses: *responsesDeleteWallet + /byron-wallets/{walletId}/transactions: + get: + operationId: listByronTransactions + tags: ["Byron Transactions"] + summary: List + description: | +

status: under testing

+ + List all incoming and outgoing wallet's transactions. + responses: *responsesListTransactions + /byron-wallets/{walletId}/migrations: get: operationId: getByronWalletMigrationInfo