Skip to content

Commit caa5de3

Browse files
committed
Feat: Use block timestamp as streaming payment createdAt date
1 parent 79e9d91 commit caa5de3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/handlers/expenditures/streamingPaymentCreated.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,13 @@ import {
1515
verbose,
1616
writeActionFromEvent,
1717
} from '~utils';
18+
import { getBlockChainTimestampISODate } from '~utils/dates';
1819

1920
export const handleStreamingPaymentCreated: EventHandler = async (
2021
event,
2122
listener,
2223
) => {
23-
const { blockNumber } = event;
24+
const { blockNumber, timestamp } = event;
2425
const { streamingPaymentId, agent: initiatorAddress } = event.args;
2526
const convertedNativeId = toNumber(streamingPaymentId);
2627
const { colonyAddress } = listener as ExtensionEventListener;
@@ -70,6 +71,7 @@ export const handleStreamingPaymentCreated: EventHandler = async (
7071
amount: amount.toString(),
7172
colonyId: colonyAddress,
7273
creatorAddress: initiatorAddress,
74+
createdAt: getBlockChainTimestampISODate(timestamp),
7375
},
7476
});
7577

0 commit comments

Comments
 (0)