Skip to content

Commit

Permalink
Move 'cursor' field to the right place
Browse files Browse the repository at this point in the history
  • Loading branch information
Shaptic committed Dec 17, 2024
1 parent 3988271 commit 106618e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/rpc/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ export namespace Api {
export interface GetEventsResponse {
latestLedger: number;
events: EventResponse[];
cursor: string;
}

export interface EventResponse extends BaseEventResponse {
Expand All @@ -203,14 +204,14 @@ export namespace Api {
export interface RawGetEventsResponse {
latestLedger: number;
events: RawEventResponse[];
cursor: string;
}

interface BaseEventResponse {
id: string;
type: EventType;
ledger: number;
ledgerClosedAt: string;
cursor: string;
pagingToken: string;
inSuccessfulContractCall: boolean;
txHash: string;
Expand Down
1 change: 1 addition & 0 deletions src/rpc/parsers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ export function parseRawEvents(
): Api.GetEventsResponse {
return {
latestLedger: raw.latestLedger,
cursor: raw.cursor,
events: (raw.events ?? []).map((evt) => {
const clone: Omit<Api.RawEventResponse, 'contractId'> = { ...evt };
delete (clone as any).contractId; // `as any` hack because contractId field isn't optional
Expand Down

0 comments on commit 106618e

Please sign in to comment.