Skip to content

Commit

Permalink
feat: refactor types
Browse files Browse the repository at this point in the history
  • Loading branch information
FedericoAmura committed Dec 6, 2024
1 parent 3e37a56 commit 751b1dd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/automation/src/lib/state-machine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ export class StateMachine {
chain.rpcUrls[0],
{
address: evmContractEvent.contractAddress,
abi: evmContractEvent.abi,
abi: evmContractEvent.contractABI,
},
{
name: evmContractEvent.eventName,
Expand Down
10 changes: 5 additions & 5 deletions packages/automation/src/lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ export interface LitActionStateDefinition extends UsesPkp {
}

export interface TransactionStateDefinition extends UsesPkp, OnEvmChain {
contractAddress: Address;
contractABI: ethers.ContractInterface;
contractAddress: Address;
method: string;
value?: string;
params?: any[];
value?: string;
}

export interface StateDefinition {
Expand All @@ -52,8 +52,8 @@ export interface BaseBalanceTransitionDefinition
extends IntervalTransitionDefinition,
OnEvmChain {
address: Address;
comparator: '>' | '>=' | '=' | '!=' | '<=' | '<';
amount: string;
comparator: '>' | '>=' | '=' | '!=' | '<=' | '<';
}

export interface NativeBalanceTransitionDefinition
Expand All @@ -63,9 +63,9 @@ export interface NativeBalanceTransitionDefinition

export interface ERC20BalanceTransitionDefinition
extends BaseBalanceTransitionDefinition {
type: 'ERC20';
tokenAddress: Address;
tokenDecimals: number;
type: 'ERC20';
}

// TODO add ERC721 and ERC1155
Expand All @@ -81,8 +81,8 @@ export interface TimerTransitionDefinition
}

export interface EvmContractEventTransitionDefinition extends OnEvmChain {
contractABI: ethers.ContractInterface;
contractAddress: Address;
abi: ethers.ContractInterface; // TODO rename a contractABI
eventName: string;
eventParams?: any;
}
Expand Down

0 comments on commit 751b1dd

Please sign in to comment.