Skip to content

Commit

Permalink
Change return type of function decodeEvents (#205)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan-SL authored Nov 29, 2022
1 parent a61439e commit 4b0814f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ it("should return transaction data and transaction receipt", async function () {
const txHash = await account.invoke(contract, "increase_balance", { amount: 10 });

const receipt = await starknet.getTransactionReceipt(txHash);
const decodedEvents = await contract.decodeEvents(receipt.events);
const decodedEvents = contract.decodeEvents(receipt.events);
// decodedEvents contains hex data array converted to a structured object
// { name: "increase_balance_called", data: { current_balance: 0n, amount: 10n } }
});
Expand Down
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,7 @@ export class StarknetContract {
* @param events as received from the server.
* @returns structured object with parameter names.
*/
async decodeEvents(events: starknet.Event[]): Promise<DecodedEvent[]> {
decodeEvents(events: starknet.Event[]): DecodedEvent[] {
const decodedEvents: DecodedEvent[] = [];
for (const event of events) {
const rawEventData = event.data.map(BigInt).join(" ");
Expand Down

0 comments on commit 4b0814f

Please sign in to comment.