Skip to content

Commit

Permalink
shovel-config-ts: update types to match documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanhleung authored Dec 6, 2024
1 parent cb9264e commit e3e8f26
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions shovel-config-ts/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,17 @@ export type Table = {
index?: IndexStatment[];
};

export type FilterOp = "contains" | "!contains";
export type FilterRefOp = "contains" | "!contains";

export type FilterArgOp = FilterRefOp | "eq" | "ne" | "gt" | "lt";

export type FilterReference = {
integration: string;
column: string;
};

export type Filter = {
op: FilterOp;
op: FilterRefOp;
arg: Hex[];
};

Expand All @@ -65,6 +67,13 @@ export type BlockDataOptions =
| "tx_type"
| "tx_status"
| "log_idx"
| "tx_gas_used"
| "tx_gas_price"
| "tx_effective_gas_price"
| "tx_contract_address"
| "tx_max_priority_fee_per_gas"
| "tx_max_fee_per_gas"
| "tx_nonce"
| "log_addr"
| "trace_action_call_type"
| "trace_action_idx"
Expand All @@ -81,10 +90,13 @@ export type BlockData = {
name: BlockDataOptions;

column: string;
filter_op?: FilterOp;
} & ({
filter_op?: FilterArgOp;
filter_arg?: Hex[];
} | {
filter_op?: FilterRefOp;
filter_ref?: FilterReference;
};
});

/**
* EventInput is a superset of the ABI JSON defintion for event
Expand All @@ -108,10 +120,13 @@ export type EventInput = {
readonly components?: EventInput[];

column?: string;
filter_op?: FilterOp;
} & ({
filter_op?: FilterArgOp;
filter_arg?: Hex[];
} | {
filter_op?: FilterRefOp;
filter_ref?: FilterReference;
};
});

export type Event = {
readonly name: string;
Expand Down

0 comments on commit e3e8f26

Please sign in to comment.