Skip to content

Commit

Permalink
update model types optionality
Browse files Browse the repository at this point in the history
  • Loading branch information
o-az committed Sep 25, 2022
1 parent 5d137e1 commit 4981ae1
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 11 deletions.
23 changes: 23 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,27 @@
{
"typescript.disableAutomaticTypeAcquisition": true,
"typescript.tsdk": "node_modules/typescript/lib",
"editor.tokenColorCustomizations": {
"[Tokyo Night]": {
"comments": "#7f7f7f",
"textMateRules": [
{
"scope": [
"comment",
"meta.var.expr storage.type",
"keyword.control.flow",
"keyword.control.return",
"meta.directive.vue punctuation.separator.key-value.html",
"meta.directive.vue entity.other.attribute-name.html",
"tag.decorator.js entity.name.tag.js",
"tag.decorator.js punctuation.definition.tag.js",
"storage.modifier"
],
"settings": {}
}
]
},
"comments": "",
"textMateRules": []
},
}
11 changes: 5 additions & 6 deletions packages/internal-common/src/flow-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ import { ActionBaseModel } from './action-model';
import { ChainId } from './constants/networks';

export interface FlowModel {
accountAddress: string;
chainId: ChainId;
trigger: TriggerModel;
accountAddress?: string;
chainId?: ChainId;
trigger?: TriggerModel;
actions: ActionBaseModel[];
alertActionModel: ActionBaseModel;
moneyActionModel: ActionBaseModel;

// potentially can add more metadata here
// such as name, description, created time, modified time, etc
}
}
11 changes: 6 additions & 5 deletions packages/internal-common/src/trigger-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ export enum TriggerType {

export interface TriggerModel {
triggerType: TriggerType;

// 'RECEIVE_FUNDS' trigger
receiveFrom: string;
receiveTokenAddress: string;
receiveTokenDecimal: number;
receiveTokenSymbol: string;
evaluator: Evaluator;
receiveFrom?: string;
receiveTokenAddress?: string;
receiveTokenDecimal?: number;
receiveTokenSymbol?: string;
evaluator?: Evaluator;
compareThreshold?: number;

// 'AMM_LP_LIQUIDITY_THRESHOLD' trigger
Expand Down

0 comments on commit 4981ae1

Please sign in to comment.