Skip to content

Commit 751b1dd

Browse files
committed
feat: refactor types
1 parent 3e37a56 commit 751b1dd

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

packages/automation/src/lib/state-machine.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ export class StateMachine {
245245
chain.rpcUrls[0],
246246
{
247247
address: evmContractEvent.contractAddress,
248-
abi: evmContractEvent.abi,
248+
abi: evmContractEvent.contractABI,
249249
},
250250
{
251251
name: evmContractEvent.eventName,

packages/automation/src/lib/types.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ export interface LitActionStateDefinition extends UsesPkp {
3030
}
3131

3232
export interface TransactionStateDefinition extends UsesPkp, OnEvmChain {
33-
contractAddress: Address;
3433
contractABI: ethers.ContractInterface;
34+
contractAddress: Address;
3535
method: string;
36-
value?: string;
3736
params?: any[];
37+
value?: string;
3838
}
3939

4040
export interface StateDefinition {
@@ -52,8 +52,8 @@ export interface BaseBalanceTransitionDefinition
5252
extends IntervalTransitionDefinition,
5353
OnEvmChain {
5454
address: Address;
55-
comparator: '>' | '>=' | '=' | '!=' | '<=' | '<';
5655
amount: string;
56+
comparator: '>' | '>=' | '=' | '!=' | '<=' | '<';
5757
}
5858

5959
export interface NativeBalanceTransitionDefinition
@@ -63,9 +63,9 @@ export interface NativeBalanceTransitionDefinition
6363

6464
export interface ERC20BalanceTransitionDefinition
6565
extends BaseBalanceTransitionDefinition {
66-
type: 'ERC20';
6766
tokenAddress: Address;
6867
tokenDecimals: number;
68+
type: 'ERC20';
6969
}
7070

7171
// TODO add ERC721 and ERC1155
@@ -81,8 +81,8 @@ export interface TimerTransitionDefinition
8181
}
8282

8383
export interface EvmContractEventTransitionDefinition extends OnEvmChain {
84+
contractABI: ethers.ContractInterface;
8485
contractAddress: Address;
85-
abi: ethers.ContractInterface; // TODO rename a contractABI
8686
eventName: string;
8787
eventParams?: any;
8888
}

0 commit comments

Comments
 (0)