Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions app/backend/src/transactions/dto/transaction.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,18 @@ export class TransactionItemDto {
@ApiProperty({ example: "2026-02-21T08:00:00Z" })
timestamp: string;

@ApiProperty({ example: "GABCD...1234", description: "Source account" })
source: string;

@ApiProperty({ example: "GDCBA...4321", description: "Destination account" })
destination: string;

@ApiProperty({
example: "Success",
description: "Transaction status (Success or Pending)",
})
status: "Success" | "Pending";

@ApiProperty({ example: "6852...a341" })
txHash: string;

Expand Down
10 changes: 9 additions & 1 deletion app/backend/src/transactions/horizon.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,19 @@ export class HorizonService {
assetString = `${payment.asset_code}:${payment.asset_issuer}`;
}

const isSuccessful =
'transaction_successful' in payment
? Boolean(payment.transaction_successful)
: true;

return {
amount: payment.amount,
asset: assetString,
memo,
timestamp: payment.created_at,
source: payment.from,
destination: payment.to,
status: isSuccessful ? 'Success' : 'Pending',
txHash: payment.transaction_hash,
pagingToken: payment.paging_token,
};
Expand Down Expand Up @@ -272,4 +280,4 @@ export class HorizonService {
this.backoffCache.clear();
this.logger.debug('Cache cleared');
}
}
}
21 changes: 21 additions & 0 deletions app/mobile/__tests__/Transactions.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,27 @@ jest.mock('expo-router', () => ({
useRouter: () => ({ back: jest.fn() }),
}));

jest.mock('@shopify/flash-list', () => {
const React = require('react');
const { FlatList } = require('react-native');
return {
FlashList: React.forwardRef((props: unknown, ref: unknown) => (
<FlatList ref={ref} {...(props as object)} />
)),
};
});

jest.mock('expo-file-system', () => ({
cacheDirectory: 'file://cache/',
writeAsStringAsync: jest.fn(),
EncodingType: { UTF8: 'utf8' },
}));

jest.mock('expo-sharing', () => ({
isAvailableAsync: jest.fn(() => Promise.resolve(false)),
shareAsync: jest.fn(),
}));

// ── Hook mock ─────────────────────────────────────────────────────────────

const mockUseTransactions = jest.fn();
Expand Down
Loading
Loading