﻿CREATE PROCEDURE [dbo].[TRN_GetLatestAccountTransaction]
	@AcountTransactionTypeId SMALLINT
AS
	
	SELECT TOP (1) [AccountTransactionId]
      ,[AccountId]
      ,[UserId]
      ,[AccountTransactionDate]
      ,[AccountTransactionTypeId]
      ,[Symbol]
      ,[Amount]
      ,[AmountUSD]
      ,[ExternalReferenceId]
      ,[Comment]
      ,[Origin]
      ,[CurrentBalance]
      ,[CurrentBonusBalance]
      ,[OperatorId]
      ,[WalletAddress]
      ,[PendingId]
      ,[KnokId]
  FROM [AccountTransactions]
  WHERE [AccountTransactionTypeId] = @AcountTransactionTypeId
  ORDER BY [AccountTransactionDate] DESC