Skip to content

Commit ea0c4fb

Browse files
authored
feat: add nonce field to CSV export (#2697)
Signed-off-by: dsh <[email protected]>
1 parent f0b292d commit ea0c4fb

File tree

4 files changed

+6
-1
lines changed

4 files changed

+6
-1
lines changed

src/modules/csv-export/v1/entities/__tests__/transaction-export.builder.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ export function transactionExportBuilder(): IBuilder<TransactionExport> {
2727
.with('executedAt', faker.date.recent())
2828
.with('note', faker.lorem.sentence())
2929
.with('transactionHash', faker.string.hexadecimal({ length: 64 }) as Hex)
30-
.with('contractAddress', getAddress(faker.finance.ethereumAddress()));
30+
.with('contractAddress', getAddress(faker.finance.ethereumAddress()))
31+
.with('nonce', faker.number.int().toString());
3132
}
3233

3334
/**

src/modules/csv-export/v1/entities/csv-export.options.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import type { CsvOptions } from '@/modules/csv-export/csv-utils/csv.service';
33
export const CSV_OPTIONS: CsvOptions = {
44
header: true,
55
columns: [
6+
{ key: 'nonce', header: 'Nonce' },
67
{ key: 'safe', header: 'Safe Address' },
78
{ key: 'from', header: 'From Address' },
89
{ key: 'to', header: 'To Address' },

src/modules/csv-export/v1/entities/transaction-export.entity.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ describe('TransactionExportSchema', () => {
9292
.with('executedAt', null)
9393
.with('note', null)
9494
.with('contractAddress', null)
95+
.with('nonce', null)
9596
.build();
9697

9798
const result = TransactionExportSchema.safeParse(transactionExport);
@@ -107,6 +108,7 @@ describe('TransactionExportSchema', () => {
107108
expect(result.data.executedAt).toBeNull();
108109
expect(result.data.note).toBeNull();
109110
expect(result.data.contractAddress).toBeNull();
111+
expect(result.data.nonce).toBeNull();
110112
}
111113
});
112114

src/modules/csv-export/v1/entities/transaction-export.entity.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export const TransactionExportSchema = z
2222
note: z.string().nullable(),
2323
transactionHash: HexSchema,
2424
contractAddress: AddressSchema.nullable(),
25+
nonce: z.string().nullable(),
2526
})
2627
.transform(({ amount, assetDecimals, ...rest }) => ({
2728
...rest,

0 commit comments

Comments
 (0)