Skip to content

Commit

Permalink
refactor(provider): removed event as non response type from response …
Browse files Browse the repository at this point in the history
…types
  • Loading branch information
tabaktoni committed Dec 13, 2023
1 parent 7ecb069 commit 6b77f54
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
4 changes: 4 additions & 0 deletions src/types/api/rpcspec_0_6/nonspec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import {
CONTRACT_CLASS,
CONTRACT_STORAGE_DIFF_ITEM,
DEPRECATED_CONTRACT_CLASS,
EMITTED_EVENT,
EVENT,
EVENTS_CHUNK,
EVENT_FILTER,
FEE_ESTIMATE,
Expand Down Expand Up @@ -65,6 +67,8 @@ export type BlockTransactionsTraces = { transaction_hash: FELT; trace_root: TRAN
export type Syncing = false | SYNC_STATUS;
// response starknet_getEvents
export type Events = EVENTS_CHUNK;
export type EmittedEvent = EMITTED_EVENT;
export type Event = EVENT;
// response starknet_addInvokeTransaction
export type InvokedTransaction = { transaction_hash: TXN_HASH };
// response starknet_addDeclareTransaction
Expand Down
7 changes: 0 additions & 7 deletions src/types/provider/response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,6 @@ export type Block = {

export type GetTransactionResponse = RPC.TransactionWithHash;

// TODO: solve this one
export interface Event {
from_address: string;
keys: Array<string>;
data: Array<string>;
}

// TODO Check if can be pending discriminated
export type GetTransactionReceiptResponse = RPC.Receipt | RPC.PendingReceipt;
// Spread individual types for usage convenience
Expand Down
4 changes: 2 additions & 2 deletions src/utils/events/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import {
LegacyEvent,
ParsedEvent,
ParsedEvents,
RPC,
} from '../../types';
import { Event as ProviderEvent } from '../../types/provider/response';
import responseParser from '../calldata/responseParser';
import { starkCurve } from '../ec';
import { addHexPrefix, utf8ToArray } from '../encode';
Expand All @@ -36,7 +36,7 @@ export function getAbiEvents(abi: Abi): AbiEvents {
* @return ParsedEvents - parsed events corresponding to the abi
*/
export function parseEvents(
providerReceivedEvents: Array<ProviderEvent>,
providerReceivedEvents: RPC.Event[],
abiEvents: AbiEvents,
abiStructs: AbiStructs,
abiEnums: AbiEnums
Expand Down

0 comments on commit 6b77f54

Please sign in to comment.