File tree 2 files changed +5
-4
lines changed
2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -56,11 +56,12 @@ const ops = ref<FeedUserOp[]>([]);
56
56
async function fetch(): Promise <void > {
57
57
const LIMIT = 20 ;
58
58
const indexerService = new IndexerService (indexerEndpoint );
59
- const startBlock = ops .value [0 ]?.blockTimestamp ;
59
+ const startTimestamp =
60
+ ops .value [0 ]?.blockTimestamp || Math .floor (Date .now () / 1000 ) - 60 * 60 ;
60
61
const newOps = await indexerService .getLatestUserOps (
61
62
LIMIT ,
63
+ startTimestamp ,
62
64
chain .value || undefined ,
63
- startBlock ,
64
65
);
65
66
const opList = [... newOps , ... ops .value ];
66
67
opList .sort ((a , b ) => b .blockTimestamp - a .blockTimestamp );
Original file line number Diff line number Diff line change @@ -269,15 +269,15 @@ class Service {
269
269
270
270
public async getLatestUserOps (
271
271
limit : number ,
272
+ startTimestamp : number ,
272
273
chain ?: Chain ,
273
- startBlock ?: number ,
274
274
) : Promise < FeedUserOp [ ] > {
275
275
const query = `{
276
276
UserOp(
277
277
limit: ${ limit } ,
278
278
where: {
279
279
${ chain ? `chainId: { _eq: ${ chain } },` : '' }
280
- ${ startBlock ? `blockTimestamp: { _gt: ${ startBlock } },` : '' }
280
+ ${ startTimestamp ? `blockTimestamp: { _gt: ${ startTimestamp } },` : '' }
281
281
},
282
282
order_by: {
283
283
blockTimestamp: desc
You can’t perform that action at this time.
0 commit comments