Skip to content

Commit

Permalink
ts: add commitment param to addEventListener
Browse files Browse the repository at this point in the history
  • Loading branch information
livthomas committed Jun 26, 2024
1 parent 70d4f48 commit 3555959
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions ts/packages/anchor/src/program/event.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { PublicKey } from "@solana/web3.js";
import { IdlEvent, IdlField } from "../idl.js";
import { Commitment, PublicKey } from "@solana/web3.js";
import { Coder } from "../coder/index.js";
import { DecodeType } from "./namespace/types.js";
import { IdlEvent, IdlField } from "../idl.js";
import Provider from "../provider.js";
import { DecodeType } from "./namespace/types.js";

const PROGRAM_LOG = "Program log: ";
const PROGRAM_DATA = "Program data: ";
Expand Down Expand Up @@ -73,7 +73,8 @@ export class EventManager {

public addEventListener(
eventName: string,
callback: (event: any, slot: number, signature: string) => void
callback: (event: any, slot: number, signature: string) => void,
commitment?: Commitment
): number {
let listener = this._listenerIdCount;
this._listenerIdCount += 1;
Expand Down Expand Up @@ -116,7 +117,8 @@ export class EventManager {
});
}
}
}
},
commitment
);

return listener;
Expand Down

0 comments on commit 3555959

Please sign in to comment.