otomato-sdk 2.0.13 → 2.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/dist/src/constants/Blocks.js +1102 -36
  2. package/dist/src/constants/tokens.js +1 -1
  3. package/dist/src/constants/version.js +1 -1
  4. package/dist/src/models/Node.js +0 -2
  5. package/dist/types/examples/UseCases/lending-aggregator-v2.d.ts +4 -0
  6. package/dist/types/examples/UseCases/stop-lending-aggregator.d.ts +7 -0
  7. package/dist/types/src/constants/Blocks.d.ts +480 -8
  8. package/dist/types/src/constants/version.d.ts +1 -1
  9. package/package.json +1 -1
  10. package/dist/src/constants/ActionBlocks.js +0 -321
  11. package/dist/src/models/Automation.js +0 -44
  12. package/dist/src/utils/balances/addressBalance.js +0 -177
  13. package/dist/src/utils/balances/getBalanceInUnderlying.js +0 -95
  14. package/dist/types/examples/ex.d.ts +0 -1
  15. package/dist/types/examples/lending-aggregator.d.ts +0 -1
  16. package/dist/types/examples/load-workflows.d.ts +0 -1
  17. package/dist/types/examples/protocols/aave_trigger_borrow_action_borrow.d.ts +0 -1
  18. package/dist/types/examples/protocols/aave_trigger_borrow_action_withdraw.d.ts +0 -1
  19. package/dist/types/examples/protocols/aave_trigger_supply_action_supply.d.ts +0 -1
  20. package/dist/types/examples/protocols/ionic_base_supply.d.ts +0 -1
  21. package/dist/types/examples/protocols/ionic_base_withdraw.d.ts +0 -1
  22. package/dist/types/examples/sandbox.d.ts +0 -1
  23. package/dist/types/examples/update-edge.d.ts +0 -1
  24. package/dist/types/examples/yield-comparator.d.ts +0 -1
  25. package/dist/types/src/constants/ActionBlocks.d.ts +0 -91
  26. package/dist/types/src/models/Automation.d.ts +0 -23
  27. package/dist/types/src/models/Condition.d.ts +0 -6
  28. package/dist/types/src/services/AutomationService.d.ts +0 -6
  29. package/dist/types/src/utils/balances/addressBalance.d.ts +0 -20
  30. package/dist/types/src/utils/balances/getBalanceInUnderlying.d.ts +0 -44
  31. package/dist/types/test/automation.spec.d.ts +0 -1
  32. package/dist/types/test/sessionKeyPermission.spec.d.ts +0 -1
  33. /package/dist/types/examples/{authorizations.d.ts → Core/authorizations.d.ts} +0 -0
  34. /package/dist/types/examples/{create-action.d.ts → Core/create-action.d.ts} +0 -0
  35. /package/dist/types/examples/{create-condition.d.ts → Core/create-condition.d.ts} +0 -0
  36. /package/dist/types/examples/{create-trigger-list.d.ts → Core/create-trigger-list.d.ts} +0 -0
  37. /package/dist/types/examples/{create-trigger.d.ts → Core/create-trigger.d.ts} +0 -0
  38. /package/dist/types/examples/{delete-edge.d.ts → Core/delete-edge.d.ts} +0 -0
  39. /package/dist/types/examples/{login.d.ts → Core/login.d.ts} +0 -0
  40. /package/dist/types/examples/{rpcServices.d.ts → Core/rpcServices.d.ts} +0 -0
  41. /package/dist/types/examples/{sessionKeyPermissions.d.ts → Core/sessionKeyPermissions.d.ts} +0 -0
  42. /package/dist/types/examples/{update-action.d.ts → Core/update-action.d.ts} +0 -0
  43. /package/dist/types/examples/{version.d.ts → Core/version.d.ts} +0 -0
  44. /package/dist/types/examples/{aave-trigger-borrow-action-borrow.d.ts → DeFi/AAVE/aave-trigger-borrow-action-borrow.d.ts} +0 -0
  45. /package/dist/types/examples/{aave-trigger-supply-action-supply.d.ts → DeFi/AAVE/aave-trigger-supply-action-supply.d.ts} +0 -0
  46. /package/dist/types/examples/{compound-supply-trigger-and-supply-action.d.ts → DeFi/Compound/compound-supply-trigger-and-supply-action.d.ts} +0 -0
  47. /package/dist/types/examples/{compound-withdraw-trigger-and-withdraw-action.d.ts → DeFi/Compound/compound-withdraw-trigger-and-withdraw-action.d.ts} +0 -0
  48. /package/dist/types/examples/{ionic-base-supply.d.ts → DeFi/Ionic/ionic-base-supply.d.ts} +0 -0
  49. /package/dist/types/examples/{ionic-base-withdraw.d.ts → DeFi/Ionic/ionic-base-withdraw.d.ts} +0 -0
  50. /package/dist/types/examples/{ionic-trigger-lending.d.ts → DeFi/Ionic/ionic-trigger-lending.d.ts} +0 -0
  51. /package/dist/types/examples/{ionic-trigger-withdraw.d.ts → DeFi/Ionic/ionic-trigger-withdraw.d.ts} +0 -0
  52. /package/dist/{src/models/Condition.js → types/examples/DeFi/Ironclad/ironclad-trigger-borrow-action-withdraw.d.ts} +0 -0
  53. /package/dist/{src/services/AutomationService.js → types/examples/DeFi/Ironclad/ironclad-trigger-supply-action-supply.d.ts} +0 -0
  54. /package/dist/types/examples/{moonwell-borrow-trigger-deposit-action.d.ts → DeFi/Moonwell/moonwell-borrow-trigger-deposit-action.d.ts} +0 -0
  55. /package/dist/types/examples/{moonwell-borrow.d.ts → DeFi/Moonwell/moonwell-borrow.d.ts} +0 -0
  56. /package/dist/types/examples/{moonwell-repay.d.ts → DeFi/Moonwell/moonwell-repay.d.ts} +0 -0
  57. /package/dist/types/examples/{moonwell-supply-trigger-withdraw-action.d.ts → DeFi/Moonwell/moonwell-supply-trigger-withdraw-action.d.ts} +0 -0
  58. /package/dist/types/examples/{create-odos-swap.d.ts → DeFi/Odos/create-odos-swap.d.ts} +0 -0
  59. /package/dist/types/examples/{create-automation.d.ts → UseCases/lending-aggregator-base.d.ts} +0 -0
  60. /package/dist/types/examples/{create-workflow-with-condition-and-split.d.ts → UseCases/lending-aggregator-mode.d.ts} +0 -0
  61. /package/dist/types/examples/{create-workflow-with-condition.d.ts → Workflow/create-workflow-with-condition-and-split.d.ts} +0 -0
  62. /package/dist/types/examples/{create-workflow-with-external-variable-condition.d.ts → Workflow/create-workflow-with-condition.d.ts} +0 -0
  63. /package/dist/types/examples/{create-workflow-with-notes.d.ts → Workflow/create-workflow-with-external-variable-condition.d.ts} +0 -0
  64. /package/dist/types/examples/{create-workflow-with-split.d.ts → Workflow/create-workflow-with-notes.d.ts} +0 -0
  65. /package/dist/types/examples/{create-workflow-with-variables.d.ts → Workflow/create-workflow-with-split.d.ts} +0 -0
  66. /package/dist/types/examples/{create-workflow.d.ts → Workflow/create-workflow-with-variables.d.ts} +0 -0
  67. /package/dist/types/examples/{delete-workflow.d.ts → Workflow/create-workflow.d.ts} +0 -0
  68. /package/dist/types/examples/{everyhour-ifusdc-ionic.d.ts → Workflow/delete-workflow.d.ts} +0 -0
  69. /package/dist/types/examples/{get-all-workflows-from-user.d.ts → Workflow/get-all-workflows-from-user.d.ts} +0 -0
  70. /package/dist/types/examples/{load-workflow.d.ts → Workflow/load-workflow.d.ts} +0 -0
  71. /package/dist/types/examples/{workflow-templates.d.ts → Workflow/workflow-templates.d.ts} +0 -0
@@ -1,91 +0,0 @@
1
- import { Parameter } from '../models/Parameter.js';
2
- export declare const TRIGGERS: {
3
- TOKENS: {
4
- ERC20: {
5
- CHAINS: number[];
6
- TRANSFER: {
7
- id: number;
8
- name: string;
9
- description: string;
10
- type: number;
11
- parameters: Parameter[];
12
- };
13
- BALANCE: {
14
- id: number;
15
- name: string;
16
- description: string;
17
- type: number;
18
- parameters: Parameter[];
19
- };
20
- };
21
- };
22
- YIELD: {
23
- SPLICE_FI: {
24
- CHAINS: number[];
25
- SWAP: {
26
- id: number;
27
- name: string;
28
- description: string;
29
- type: number;
30
- parameters: Parameter[];
31
- };
32
- LIQUIDITY_REMOVED: {
33
- id: number;
34
- name: string;
35
- description: string;
36
- type: number;
37
- parameters: Parameter[];
38
- };
39
- MARKET_CREATION: {
40
- id: number;
41
- name: string;
42
- description: string;
43
- type: number;
44
- parameters: Parameter[];
45
- };
46
- INTEREST_RATE_UPDATE: {
47
- id: number;
48
- name: string;
49
- description: string;
50
- type: number;
51
- parameters: Parameter[];
52
- };
53
- };
54
- };
55
- LENDING: {
56
- ASTARIA: {
57
- CHAINS: number[];
58
- LEND_RECALLED: {
59
- id: number;
60
- name: string;
61
- description: string;
62
- type: number;
63
- parameters: Parameter[];
64
- };
65
- };
66
- };
67
- DEXES: {
68
- ODOS: {
69
- CHAINS: number[];
70
- SWAP: {
71
- id: number;
72
- name: string;
73
- description: string;
74
- type: number;
75
- parameters: Parameter[];
76
- };
77
- };
78
- };
79
- SOCIALS: {
80
- MODE_NAME_SERVICE: {
81
- CHAINS: number[];
82
- NAME_REGISTERED: {
83
- id: number;
84
- name: string;
85
- description: string;
86
- type: number;
87
- parameters: Parameter[];
88
- };
89
- };
90
- };
91
- };
@@ -1,23 +0,0 @@
1
- import { Node } from './Node.js';
2
- import { Edge } from './Edge.js';
3
- export declare class Automation {
4
- name: string;
5
- nodes: Node[];
6
- edges: Edge[];
7
- constructor(name: string, nodes?: Node[], edges?: Edge[]);
8
- setName(name: string): void;
9
- addNode(node: Node): void;
10
- addNodes(nodes: Node[]): void;
11
- addEdge(edge: Edge): void;
12
- addEdges(edges: Edge[]): void;
13
- toJSON(): {
14
- name: string;
15
- nodes: {
16
- [key: string]: any;
17
- }[];
18
- edges: {
19
- [key: string]: any;
20
- }[];
21
- };
22
- save(): Promise<any>;
23
- }
@@ -1,6 +0,0 @@
1
- export interface COndition {
2
- key: string;
3
- type: string;
4
- description: string;
5
- value: any;
6
- }
@@ -1,6 +0,0 @@
1
- export interface AUTOSERVICES {
2
- key: string;
3
- type: string;
4
- description: string;
5
- value: any;
6
- }
@@ -1,20 +0,0 @@
1
- export declare const PROTOCOLS: {
2
- readonly AAVE: "AAVE";
3
- readonly COMPOUND: "COMPOUND";
4
- readonly IONIC: "IONIC";
5
- readonly MOONWELL: "MOONWELL";
6
- readonly WALLET: "WALLET";
7
- };
8
- export type Protocol = typeof PROTOCOLS[keyof typeof PROTOCOLS];
9
- export interface GetUserProtocolBalancesParams {
10
- chainId: number;
11
- address: string;
12
- contractAddress: string;
13
- }
14
- export interface ProtocolBalanceResult {
15
- protocol: Protocol;
16
- wrapperTokenAddress: string;
17
- wrapperBalance: string;
18
- underlyingBalance: string;
19
- }
20
- export declare function getUserProtocolBalances(params: GetUserProtocolBalancesParams): Promise<ProtocolBalanceResult[]>;
@@ -1,44 +0,0 @@
1
- import { ethers } from 'ethers';
2
- export declare const PROTOCOLS: {
3
- readonly AAVE: "AAVE";
4
- readonly COMPOUND: "COMPOUND";
5
- readonly IONIC: "IONIC";
6
- readonly MOONWELL: "MOONWELL";
7
- readonly WALLET: "WALLET";
8
- };
9
- export declare const COMPOUNDV2_EXCHANGERATE_ABI: string[];
10
- /**
11
- * A minimal "executeReadContract" helper, exactly like in your code snippet.
12
- * You can import this from wherever you defined it.
13
- */
14
- export declare function executeReadContract(address: string, abi: string[], method: string, params: any[] | undefined, provider: ethers.JsonRpcProvider): Promise<any>;
15
- /**
16
- * The shape of the "balanceObj" from your code:
17
- * {
18
- * value: bigint,
19
- * decimals: number,
20
- * symbol: string,
21
- * displayValue: string,
22
- * }
23
- */
24
- export interface BalanceObject {
25
- value: bigint;
26
- decimals: number;
27
- symbol: string;
28
- displayValue: string;
29
- }
30
- /**
31
- * getBalanceInUnderlying:
32
- * Keeps the exact logic you provided for each protocol.
33
- *
34
- * @param protocol - which protocol (WALLET, AAVE, COMPOUND, IONIC, MOONWELL)
35
- * @param chainId - the chain you’re on (not actively used in this snippet, but kept for consistency)
36
- * @param smartAccountAddress - the user’s address (passed, but your snippet only uses it for logs or COMPOUND custom calls if you expand logic)
37
- * @param contractAddress - the “wrapper token” contract to read from
38
- * @param balanceObj - the result from getBalanceObject (raw BigInt, decimals, displayValue, etc.)
39
- * @param decimals - typically the “underlying decimals” you want to interpret. (In your code, you used the WALLET entry’s decimals for USDC.)
40
- * @param provider - a JsonRpcProvider for read calls (required if you do exchangeRateCurrent).
41
- *
42
- * @returns a string representing the final “underlying” balance
43
- */
44
- export declare function getBalanceInUnderlying(protocol: string, chainId: number, smartAccountAddress: string, contractAddress: string, balanceObj: BalanceObject, decimals: number, provider: ethers.JsonRpcProvider): Promise<string>;
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};