@defisaver/automation-sdk 1.0.1

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 (123) hide show
  1. package/.babelrc +3 -0
  2. package/.editorconfig +9 -0
  3. package/.eslintignore +7 -0
  4. package/.eslintrc.js +104 -0
  5. package/esm/abis/Erc20.json +223 -0
  6. package/esm/abis/SubStorage.json +17 -0
  7. package/esm/abis/UniMulticall.json +14 -0
  8. package/esm/abis/index.d.ts +9 -0
  9. package/esm/abis/index.js +18 -0
  10. package/esm/abis/legacy_AaveV2Subscriptions.json +8 -0
  11. package/esm/abis/legacy_AuthCheck.json +8 -0
  12. package/esm/abis/legacy_CompoundV2Subscriptions.json +9 -0
  13. package/esm/abis/legacy_MakerSubscriptions.json +9 -0
  14. package/esm/automation/private/Automation.d.ts +12 -0
  15. package/esm/automation/private/Automation.js +39 -0
  16. package/esm/automation/private/LegacyAutomation.d.ts +25 -0
  17. package/esm/automation/private/LegacyAutomation.js +102 -0
  18. package/esm/automation/private/LegacyProtocol.d.ts +20 -0
  19. package/esm/automation/private/LegacyProtocol.js +34 -0
  20. package/esm/automation/private/Protocol.d.ts +20 -0
  21. package/esm/automation/private/Protocol.js +34 -0
  22. package/esm/automation/private/StrategiesAutomation.d.ts +24 -0
  23. package/esm/automation/private/StrategiesAutomation.js +111 -0
  24. package/esm/automation/public/ArbitrumStrategies.d.ts +5 -0
  25. package/esm/automation/public/ArbitrumStrategies.js +7 -0
  26. package/esm/automation/public/EthereumStrategies.d.ts +5 -0
  27. package/esm/automation/public/EthereumStrategies.js +7 -0
  28. package/esm/automation/public/OptimismStrategies.d.ts +5 -0
  29. package/esm/automation/public/OptimismStrategies.js +7 -0
  30. package/esm/automation/public/legacy/LegacyAaveAutomation.d.ts +6 -0
  31. package/esm/automation/public/legacy/LegacyAaveAutomation.js +14 -0
  32. package/esm/automation/public/legacy/LegacyCompoundAutomation.d.ts +6 -0
  33. package/esm/automation/public/legacy/LegacyCompoundAutomation.js +14 -0
  34. package/esm/automation/public/legacy/LegacyMakerAutomation.d.ts +6 -0
  35. package/esm/automation/public/legacy/LegacyMakerAutomation.js +14 -0
  36. package/esm/configuration.d.ts +1 -0
  37. package/esm/configuration.js +9 -0
  38. package/esm/constants/index.d.ts +23 -0
  39. package/esm/constants/index.js +153 -0
  40. package/esm/index.d.ts +20 -0
  41. package/esm/index.js +22 -0
  42. package/esm/services/contractService.d.ts +11 -0
  43. package/esm/services/contractService.js +40 -0
  44. package/esm/services/ethereumService.d.ts +7 -0
  45. package/esm/services/ethereumService.js +34 -0
  46. package/esm/services/strategiesService.d.ts +2 -0
  47. package/esm/services/strategiesService.js +244 -0
  48. package/esm/services/strategySubService.d.ts +32 -0
  49. package/esm/services/strategySubService.js +91 -0
  50. package/esm/services/subDataService.d.ts +62 -0
  51. package/esm/services/subDataService.js +148 -0
  52. package/esm/services/triggerService.d.ts +89 -0
  53. package/esm/services/triggerService.js +141 -0
  54. package/esm/services/utils.d.ts +24 -0
  55. package/esm/services/utils.js +78 -0
  56. package/esm/types/contracts/generated/Erc20.d.ts +53 -0
  57. package/esm/types/contracts/generated/Erc20.js +4 -0
  58. package/esm/types/contracts/generated/Legacy_AaveV2Subscriptions.d.ts +129 -0
  59. package/esm/types/contracts/generated/Legacy_AaveV2Subscriptions.js +4 -0
  60. package/esm/types/contracts/generated/Legacy_AuthCheck.d.ts +20 -0
  61. package/esm/types/contracts/generated/Legacy_AuthCheck.js +4 -0
  62. package/esm/types/contracts/generated/Legacy_CompoundV2Subscriptions.d.ts +128 -0
  63. package/esm/types/contracts/generated/Legacy_CompoundV2Subscriptions.js +4 -0
  64. package/esm/types/contracts/generated/Legacy_MakerSubscriptions.d.ts +246 -0
  65. package/esm/types/contracts/generated/Legacy_MakerSubscriptions.js +4 -0
  66. package/esm/types/contracts/generated/SubStorage.d.ts +114 -0
  67. package/esm/types/contracts/generated/SubStorage.js +4 -0
  68. package/esm/types/contracts/generated/UniMulticall.d.ts +55 -0
  69. package/esm/types/contracts/generated/UniMulticall.js +4 -0
  70. package/esm/types/contracts/generated/index.d.ts +7 -0
  71. package/esm/types/contracts/generated/index.js +1 -0
  72. package/esm/types/contracts/generated/types.d.ts +54 -0
  73. package/esm/types/contracts/generated/types.js +1 -0
  74. package/esm/types/enums.d.ts +97 -0
  75. package/esm/types/enums.js +113 -0
  76. package/esm/types/index.d.ts +180 -0
  77. package/esm/types/index.js +1 -0
  78. package/package.json +66 -0
  79. package/scripts/generateContractTypes.js +39 -0
  80. package/src/abis/Erc20.json +223 -0
  81. package/src/abis/SubStorage.json +17 -0
  82. package/src/abis/UniMulticall.json +14 -0
  83. package/src/abis/index.ts +28 -0
  84. package/src/abis/legacy_AaveV2Subscriptions.json +8 -0
  85. package/src/abis/legacy_AuthCheck.json +8 -0
  86. package/src/abis/legacy_CompoundV2Subscriptions.json +9 -0
  87. package/src/abis/legacy_MakerSubscriptions.json +9 -0
  88. package/src/automation/private/Automation.ts +44 -0
  89. package/src/automation/private/LegacyAutomation.ts +124 -0
  90. package/src/automation/private/LegacyProtocol.ts +45 -0
  91. package/src/automation/private/Protocol.ts +45 -0
  92. package/src/automation/private/StrategiesAutomation.ts +157 -0
  93. package/src/automation/public/ArbitrumStrategies.ts +10 -0
  94. package/src/automation/public/EthereumStrategies.ts +10 -0
  95. package/src/automation/public/OptimismStrategies.ts +10 -0
  96. package/src/automation/public/legacy/LegacyAaveAutomation.ts +20 -0
  97. package/src/automation/public/legacy/LegacyCompoundAutomation.ts +20 -0
  98. package/src/automation/public/legacy/LegacyMakerAutomation.ts +20 -0
  99. package/src/configuration.ts +11 -0
  100. package/src/constants/index.ts +173 -0
  101. package/src/index.ts +38 -0
  102. package/src/services/contractService.ts +65 -0
  103. package/src/services/ethereumService.ts +55 -0
  104. package/src/services/strategiesService.ts +336 -0
  105. package/src/services/strategySubService.ts +202 -0
  106. package/src/services/subDataService.ts +212 -0
  107. package/src/services/triggerService.ts +173 -0
  108. package/src/services/utils.ts +101 -0
  109. package/src/types/contracts/generated/Erc20.ts +95 -0
  110. package/src/types/contracts/generated/Legacy_AaveV2Subscriptions.ts +207 -0
  111. package/src/types/contracts/generated/Legacy_AuthCheck.ts +41 -0
  112. package/src/types/contracts/generated/Legacy_CompoundV2Subscriptions.ts +205 -0
  113. package/src/types/contracts/generated/Legacy_MakerSubscriptions.ts +338 -0
  114. package/src/types/contracts/generated/SubStorage.ts +196 -0
  115. package/src/types/contracts/generated/UniMulticall.ts +83 -0
  116. package/src/types/contracts/generated/index.ts +10 -0
  117. package/src/types/contracts/generated/types.ts +73 -0
  118. package/src/types/enums.ts +108 -0
  119. package/src/types/index.ts +217 -0
  120. package/src/types/typings/process.d.ts +9 -0
  121. package/tsconfig.json +79 -0
  122. package/umd/web3.d.ts +28961 -0
  123. package/webpack.umd.js +52 -0
package/.babelrc ADDED
@@ -0,0 +1,3 @@
1
+ {
2
+ "presets": []
3
+ }
package/.editorconfig ADDED
@@ -0,0 +1,9 @@
1
+ root = true
2
+
3
+ [*]
4
+ charset = utf-8
5
+ indent_style = space
6
+ indent_size = 2
7
+ end_of_line = lf
8
+ insert_final_newline = true
9
+ trim_trailing_whitespace = true
package/.eslintignore ADDED
@@ -0,0 +1,7 @@
1
+ node_modules
2
+ esm
3
+ test
4
+ docs
5
+ webpack.umd.js
6
+ umd
7
+ src/types/contracts/generated/*
package/.eslintrc.js ADDED
@@ -0,0 +1,104 @@
1
+
2
+ module.exports = {
3
+ extends: ['airbnb'],
4
+ plugins: ['import'],
5
+ parser: '@babel/eslint-parser',
6
+ env: {
7
+ es6: true,
8
+ browser: true,
9
+ },
10
+ overrides: [{
11
+ // these are overrides for .ts files, meaning these are only applied to .ts files
12
+ files: ['*.ts'],
13
+ extends: ['airbnb-typescript'],
14
+ plugins: ['@typescript-eslint'],
15
+ parser: '@typescript-eslint/parser',
16
+ parserOptions: {
17
+ project: ['./tsconfig.json'],
18
+ tsconfigRootDir: './',
19
+ },
20
+ // typescript rules must be added here to work
21
+ rules: {
22
+ '@typescript-eslint/no-unused-vars': 0,
23
+ '@typescript-eslint/naming-convention': 0,
24
+ '@typescript-eslint/default-param-last': 0,
25
+ '@typescript-eslint/consistent-type-imports': 2,
26
+ },
27
+ }],
28
+ parserOptions: {
29
+ ecmaVersion: 2018,
30
+ sourceType: 'module',
31
+ },
32
+ rules: {
33
+ 'no-restricted-syntax': 0,
34
+ 'no-continue': 0,
35
+ 'jsx-a11y/control-has-associated-label': 0,
36
+ 'arrow-parens': 0,
37
+ 'no-async-promise-executor': 0,
38
+ 'no-multiple-empty-lines': [2, { max: 2 }],
39
+ camelcase: [2, { allow: ['^UNSAFE_'] }],
40
+ 'no-mixed-operators': [2, { allowSamePrecedence: true }],
41
+ 'no-plusplus': 0,
42
+ 'no-minusminus': 0,
43
+ 'prefer-destructuring': 0,
44
+ 'max-len': 0,
45
+ 'class-methods-use-this': 0,
46
+ 'jsx-a11y/href-no-hash': 'off',
47
+ 'jsx-a11y/no-autofocus': 0,
48
+ 'no-unused-vars': 0,
49
+ 'no-underscore-dangle': 0,
50
+ 'global-require': 0,
51
+ 'no-console': 0,
52
+ 'new-cap': 0,
53
+ 'eol-last': 0,
54
+ 'jsx-a11y/label-has-for': 0,
55
+ 'linebreak-style': 0,
56
+ 'consistent-return': 0,
57
+ 'import/prefer-default-export': 0,
58
+ 'no-unescaped-entities': 0,
59
+ 'jsx-a11y/no-static-element-interactions': 0,
60
+ 'jsx-a11y/click-events-have-key-events': 0,
61
+ 'jsx-a11y/anchor-is-valid': 0,
62
+ 'no-shadow': 0,
63
+ 'prefer-promise-reject-errors': 0,
64
+ 'function-paren-newline': 0,
65
+ 'operator-linebreak': 0,
66
+ 'jsx-a11y/no-noninteractive-element-interactions': 0,
67
+ 'jsx-a11y/label-has-associated-control': 0,
68
+ 'no-nested-ternary': 0,
69
+ 'import/no-cycle': 0,
70
+ 'import/no-unresolved': 0,
71
+ 'function-call-argument-newline': 0,
72
+ 'import/extensions': [
73
+ 'error',
74
+ 'always',
75
+ {
76
+ pattern: {
77
+ js: 'never',
78
+ ts: 'never',
79
+ },
80
+ },
81
+ ],
82
+ },
83
+ globals: {
84
+ web3: true,
85
+ ethereum: true,
86
+ $: true,
87
+ window: true,
88
+ document: true,
89
+ fetch: true,
90
+ location: true,
91
+ localStorage: true,
92
+ },
93
+ settings: {
94
+ 'import/resolver': {
95
+ typescript: {
96
+ alwaysTryTypes: true,
97
+ project: ['./tsconfig.json'],
98
+ },
99
+ node: {
100
+ extensions: ['.js', '.ts'],
101
+ },
102
+ },
103
+ },
104
+ };
@@ -0,0 +1,223 @@
1
+ { "abi": [
2
+ {
3
+ "constant": true,
4
+ "inputs": [],
5
+ "name": "name",
6
+ "outputs": [
7
+ {
8
+ "name": "",
9
+ "type": "string"
10
+ }
11
+ ],
12
+ "payable": false,
13
+ "stateMutability": "view",
14
+ "type": "function"
15
+ },
16
+ {
17
+ "constant": false,
18
+ "inputs": [
19
+ {
20
+ "name": "_spender",
21
+ "type": "address"
22
+ },
23
+ {
24
+ "name": "_value",
25
+ "type": "uint256"
26
+ }
27
+ ],
28
+ "name": "approve",
29
+ "outputs": [
30
+ {
31
+ "name": "",
32
+ "type": "bool"
33
+ }
34
+ ],
35
+ "payable": false,
36
+ "stateMutability": "nonpayable",
37
+ "type": "function"
38
+ },
39
+ {
40
+ "constant": true,
41
+ "inputs": [],
42
+ "name": "totalSupply",
43
+ "outputs": [
44
+ {
45
+ "name": "",
46
+ "type": "uint256"
47
+ }
48
+ ],
49
+ "payable": false,
50
+ "stateMutability": "view",
51
+ "type": "function"
52
+ },
53
+ {
54
+ "constant": false,
55
+ "inputs": [
56
+ {
57
+ "name": "_from",
58
+ "type": "address"
59
+ },
60
+ {
61
+ "name": "_to",
62
+ "type": "address"
63
+ },
64
+ {
65
+ "name": "_value",
66
+ "type": "uint256"
67
+ }
68
+ ],
69
+ "name": "transferFrom",
70
+ "outputs": [
71
+ {
72
+ "name": "",
73
+ "type": "bool"
74
+ }
75
+ ],
76
+ "payable": false,
77
+ "stateMutability": "nonpayable",
78
+ "type": "function"
79
+ },
80
+ {
81
+ "constant": true,
82
+ "inputs": [],
83
+ "name": "decimals",
84
+ "outputs": [
85
+ {
86
+ "name": "",
87
+ "type": "uint8"
88
+ }
89
+ ],
90
+ "payable": false,
91
+ "stateMutability": "view",
92
+ "type": "function"
93
+ },
94
+ {
95
+ "constant": true,
96
+ "inputs": [
97
+ {
98
+ "name": "_owner",
99
+ "type": "address"
100
+ }
101
+ ],
102
+ "name": "balanceOf",
103
+ "outputs": [
104
+ {
105
+ "name": "balance",
106
+ "type": "uint256"
107
+ }
108
+ ],
109
+ "payable": false,
110
+ "stateMutability": "view",
111
+ "type": "function"
112
+ },
113
+ {
114
+ "constant": true,
115
+ "inputs": [],
116
+ "name": "symbol",
117
+ "outputs": [
118
+ {
119
+ "name": "",
120
+ "type": "string"
121
+ }
122
+ ],
123
+ "payable": false,
124
+ "stateMutability": "view",
125
+ "type": "function"
126
+ },
127
+ {
128
+ "constant": false,
129
+ "inputs": [
130
+ {
131
+ "name": "_to",
132
+ "type": "address"
133
+ },
134
+ {
135
+ "name": "_value",
136
+ "type": "uint256"
137
+ }
138
+ ],
139
+ "name": "transfer",
140
+ "outputs": [
141
+ {
142
+ "name": "",
143
+ "type": "bool"
144
+ }
145
+ ],
146
+ "payable": false,
147
+ "stateMutability": "nonpayable",
148
+ "type": "function"
149
+ },
150
+ {
151
+ "constant": true,
152
+ "inputs": [
153
+ {
154
+ "name": "_owner",
155
+ "type": "address"
156
+ },
157
+ {
158
+ "name": "_spender",
159
+ "type": "address"
160
+ }
161
+ ],
162
+ "name": "allowance",
163
+ "outputs": [
164
+ {
165
+ "name": "",
166
+ "type": "uint256"
167
+ }
168
+ ],
169
+ "payable": false,
170
+ "stateMutability": "view",
171
+ "type": "function"
172
+ },
173
+ {
174
+ "payable": true,
175
+ "stateMutability": "payable",
176
+ "type": "fallback"
177
+ },
178
+ {
179
+ "anonymous": false,
180
+ "inputs": [
181
+ {
182
+ "indexed": true,
183
+ "name": "owner",
184
+ "type": "address"
185
+ },
186
+ {
187
+ "indexed": true,
188
+ "name": "spender",
189
+ "type": "address"
190
+ },
191
+ {
192
+ "indexed": false,
193
+ "name": "value",
194
+ "type": "uint256"
195
+ }
196
+ ],
197
+ "name": "Approval",
198
+ "type": "event"
199
+ },
200
+ {
201
+ "anonymous": false,
202
+ "inputs": [
203
+ {
204
+ "indexed": true,
205
+ "name": "from",
206
+ "type": "address"
207
+ },
208
+ {
209
+ "indexed": true,
210
+ "name": "to",
211
+ "type": "address"
212
+ },
213
+ {
214
+ "indexed": false,
215
+ "name": "value",
216
+ "type": "uint256"
217
+ }
218
+ ],
219
+ "name": "Transfer",
220
+ "type": "event"
221
+ }
222
+ ]
223
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "abi": [{ "inputs": [], "name": "NonContractCall", "type": "error" }, { "inputs": [], "name": "SenderNotAdmin", "type": "error" }, { "inputs": [], "name": "SenderNotOwner", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "", "type": "address" }, { "internalType": "uint256", "name": "", "type": "uint256" }], "name": "SenderNotSubOwnerError", "type": "error" }, { "inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }, { "internalType": "bool", "name": "", "type": "bool" }], "name": "SubIdOutOfRange", "type": "error" }, { "inputs": [], "name": "UserPositionsEmpty", "type": "error" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "uint256", "name": "subId", "type": "uint256" }], "name": "ActivateSub", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "uint256", "name": "subId", "type": "uint256" }], "name": "DeactivateSub", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "uint256", "name": "subId", "type": "uint256" }, { "indexed": true, "internalType": "address", "name": "proxy", "type": "address" }, { "indexed": true, "internalType": "bytes32", "name": "subHash", "type": "bytes32" }, { "components": [{ "internalType": "uint64", "name": "strategyOrBundleId", "type": "uint64" }, { "internalType": "bool", "name": "isBundle", "type": "bool" }, { "internalType": "bytes[]", "name": "triggerData", "type": "bytes[]" }, { "internalType": "bytes32[]", "name": "subData", "type": "bytes32[]" }], "indexed": false, "internalType": "struct StrategyModel.StrategySub", "name": "subStruct", "type": "tuple" }], "name": "Subscribe", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "uint256", "name": "subId", "type": "uint256" }, { "indexed": true, "internalType": "bytes32", "name": "subHash", "type": "bytes32" }, { "components": [{ "internalType": "uint64", "name": "strategyOrBundleId", "type": "uint64" }, { "internalType": "bool", "name": "isBundle", "type": "bool" }, { "internalType": "bytes[]", "name": "triggerData", "type": "bytes[]" }, { "internalType": "bytes32[]", "name": "subData", "type": "bytes32[]" }], "indexed": false, "internalType": "struct StrategyModel.StrategySub", "name": "subStruct", "type": "tuple" }], "name": "UpdateData", "type": "event" }, { "inputs": [{ "internalType": "uint256", "name": "_subId", "type": "uint256" }], "name": "activateSub", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "adminVault", "outputs": [{ "internalType": "contract AdminVault", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "_subId", "type": "uint256" }], "name": "deactivateSub", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "_subId", "type": "uint256" }], "name": "getSub", "outputs": [{ "components": [{ "internalType": "bytes20", "name": "userProxy", "type": "bytes20" }, { "internalType": "bool", "name": "isEnabled", "type": "bool" }, { "internalType": "bytes32", "name": "strategySubHash", "type": "bytes32" }], "internalType": "struct StrategyModel.StoredSubData", "name": "", "type": "tuple" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getSubsCount", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "kill", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "registry", "outputs": [{ "internalType": "contract DFSRegistry", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "name": "strategiesSubs", "outputs": [{ "internalType": "bytes20", "name": "userProxy", "type": "bytes20" }, { "internalType": "bool", "name": "isEnabled", "type": "bool" }, { "internalType": "bytes32", "name": "strategySubHash", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "components": [{ "internalType": "uint64", "name": "strategyOrBundleId", "type": "uint64" }, { "internalType": "bool", "name": "isBundle", "type": "bool" }, { "internalType": "bytes[]", "name": "triggerData", "type": "bytes[]" }, { "internalType": "bytes32[]", "name": "subData", "type": "bytes32[]" }], "internalType": "struct StrategyModel.StrategySub", "name": "_sub", "type": "tuple" }], "name": "subscribeToStrategy", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "_subId", "type": "uint256" }, { "components": [{ "internalType": "uint64", "name": "strategyOrBundleId", "type": "uint64" }, { "internalType": "bool", "name": "isBundle", "type": "bool" }, { "internalType": "bytes[]", "name": "triggerData", "type": "bytes[]" }, { "internalType": "bytes32[]", "name": "subData", "type": "bytes32[]" }], "internalType": "struct StrategyModel.StrategySub", "name": "_sub", "type": "tuple" }], "name": "updateSubData", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_token", "type": "address" }, { "internalType": "address", "name": "_receiver", "type": "address" }, { "internalType": "uint256", "name": "_amount", "type": "uint256" }], "name": "withdrawStuckFunds", "outputs": [], "stateMutability": "nonpayable", "type": "function" }],
3
+ "networks": {
4
+ "1": {
5
+ "createdBlock": 14242966,
6
+ "address": "0x1612fc28Ee0AB882eC99842Cde0Fc77ff0691e90"
7
+ },
8
+ "10": {
9
+ "createdBlock": 13688707,
10
+ "address": "0xb944291Ed31886b20030d0d4C47c7838d1d9eb97"
11
+ },
12
+ "42161": {
13
+ "createdBlock": 19126047,
14
+ "address": "0x24ab68395660b910BfBF1cc88BaA316BA06354eE"
15
+ }
16
+ }
17
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "abi": [{ "inputs": [], "name": "getCurrentBlockTimestamp", "outputs": [{ "internalType": "uint256", "name": "timestamp", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "addr", "type": "address" }], "name": "getEthBalance", "outputs": [{ "internalType": "uint256", "name": "balance", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "components": [{ "internalType": "address", "name": "target", "type": "address" }, { "internalType": "uint256", "name": "gasLimit", "type": "uint256" }, { "internalType": "bytes", "name": "callData", "type": "bytes" }], "internalType": "struct UniswapInterfaceMulticall.Call[]", "name": "calls", "type": "tuple[]" }], "name": "multicall", "outputs": [{ "internalType": "uint256", "name": "blockNumber", "type": "uint256" }, { "components": [{ "internalType": "bool", "name": "success", "type": "bool" }, { "internalType": "uint256", "name": "gasUsed", "type": "uint256" }, { "internalType": "bytes", "name": "returnData", "type": "bytes" }], "internalType": "struct UniswapInterfaceMulticall.Result[]", "name": "returnData", "type": "tuple[]" }], "stateMutability": "nonpayable", "type": "function" }],
3
+ "networks": {
4
+ "1": {
5
+ "address": "0x1F98415757620B543A52E61c46B32eB19261F984"
6
+ },
7
+ "10": {
8
+ "address": "0x1F98415757620B543A52E61c46B32eB19261F984"
9
+ },
10
+ "42161": {
11
+ "address": "0x1F98415757620B543A52E61c46B32eB19261F984"
12
+ }
13
+ }
14
+ }
@@ -0,0 +1,9 @@
1
+ import type { Contract } from '../types';
2
+ declare const MakerSubscriptionsJson: Contract.Json;
3
+ declare const AaveV2SubscriptionsJson: Contract.Json;
4
+ declare const CompoundV2SubscriptionsJson: Contract.Json;
5
+ declare const Erc20Json: Contract.Json;
6
+ declare const UniMulticallJson: Contract.Json;
7
+ declare const SubStorageJson: Contract.Json;
8
+ declare const AuthCheckJson: Contract.Json;
9
+ export { MakerSubscriptionsJson, AaveV2SubscriptionsJson, CompoundV2SubscriptionsJson, Erc20Json, UniMulticallJson, SubStorageJson, AuthCheckJson, };
@@ -0,0 +1,18 @@
1
+ import MakerSubscriptions from './legacy_MakerSubscriptions.json';
2
+ import AaveV2Subscriptions from './legacy_AaveV2Subscriptions.json';
3
+ import CompoundV2Subscriptions from './legacy_CompoundV2Subscriptions.json';
4
+ import Erc20 from './Erc20.json';
5
+ import UniMulticall from './UniMulticall.json';
6
+ import SubStorage from './SubStorage.json';
7
+ import AuthCheck from './legacy_AuthCheck.json';
8
+ function castToContractJsonType(json) {
9
+ return json;
10
+ }
11
+ const MakerSubscriptionsJson = castToContractJsonType(MakerSubscriptions);
12
+ const AaveV2SubscriptionsJson = castToContractJsonType(AaveV2Subscriptions);
13
+ const CompoundV2SubscriptionsJson = castToContractJsonType(CompoundV2Subscriptions);
14
+ const Erc20Json = castToContractJsonType(Erc20);
15
+ const UniMulticallJson = castToContractJsonType(UniMulticall);
16
+ const SubStorageJson = castToContractJsonType(SubStorage);
17
+ const AuthCheckJson = castToContractJsonType(AuthCheck);
18
+ export { MakerSubscriptionsJson, AaveV2SubscriptionsJson, CompoundV2SubscriptionsJson, Erc20Json, UniMulticallJson, SubStorageJson, AuthCheckJson, };
@@ -0,0 +1,8 @@
1
+ {
2
+ "abi": [{ "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "user", "type": "address" }, { "indexed": false, "internalType": "uint128", "name": "", "type": "uint128" }, { "indexed": false, "internalType": "uint128", "name": "", "type": "uint128" }, { "indexed": false, "internalType": "uint128", "name": "", "type": "uint128" }, { "indexed": false, "internalType": "uint128", "name": "", "type": "uint128" }, { "indexed": false, "internalType": "bool", "name": "", "type": "bool" }], "name": "ParamUpdates", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "user", "type": "address" }], "name": "Subscribed", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "user", "type": "address" }], "name": "Unsubscribed", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "user", "type": "address" }], "name": "Updated", "type": "event" }, { "inputs": [], "name": "NAME", "outputs": [{ "internalType": "string", "name": "", "type": "string" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "admin", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "changeIndex", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_user", "type": "address" }], "name": "getHolder", "outputs": [{ "components": [{ "internalType": "address", "name": "user", "type": "address" }, { "internalType": "uint128", "name": "minRatio", "type": "uint128" }, { "internalType": "uint128", "name": "maxRatio", "type": "uint128" }, { "internalType": "uint128", "name": "optimalRatioBoost", "type": "uint128" }, { "internalType": "uint128", "name": "optimalRatioRepay", "type": "uint128" }, { "internalType": "bool", "name": "boostEnabled", "type": "bool" }], "internalType": "struct AaveSubscriptionsV2.AaveHolder", "name": "", "type": "tuple" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getSubscribers", "outputs": [{ "components": [{ "internalType": "address", "name": "user", "type": "address" }, { "internalType": "uint128", "name": "minRatio", "type": "uint128" }, { "internalType": "uint128", "name": "maxRatio", "type": "uint128" }, { "internalType": "uint128", "name": "optimalRatioBoost", "type": "uint128" }, { "internalType": "uint128", "name": "optimalRatioRepay", "type": "uint128" }, { "internalType": "bool", "name": "boostEnabled", "type": "bool" }], "internalType": "struct AaveSubscriptionsV2.AaveHolder[]", "name": "", "type": "tuple[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "_page", "type": "uint256" }, { "internalType": "uint256", "name": "_perPage", "type": "uint256" }], "name": "getSubscribersByPage", "outputs": [{ "components": [{ "internalType": "address", "name": "user", "type": "address" }, { "internalType": "uint128", "name": "minRatio", "type": "uint128" }, { "internalType": "uint128", "name": "maxRatio", "type": "uint128" }, { "internalType": "uint128", "name": "optimalRatioBoost", "type": "uint128" }, { "internalType": "uint128", "name": "optimalRatioRepay", "type": "uint128" }, { "internalType": "bool", "name": "boostEnabled", "type": "bool" }], "internalType": "struct AaveSubscriptionsV2.AaveHolder[]", "name": "", "type": "tuple[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_user", "type": "address" }], "name": "isSubscribed", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "kill", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "owner", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_admin", "type": "address" }], "name": "setAdminByAdmin", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_admin", "type": "address" }], "name": "setAdminByOwner", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_owner", "type": "address" }], "name": "setOwnerByAdmin", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "uint128", "name": "_minRatio", "type": "uint128" }, { "internalType": "uint128", "name": "_maxRatio", "type": "uint128" }, { "internalType": "uint128", "name": "_optimalBoost", "type": "uint128" }, { "internalType": "uint128", "name": "_optimalRepay", "type": "uint128" }, { "internalType": "bool", "name": "_boostEnabled", "type": "bool" }], "name": "subscribe", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "name": "subscribers", "outputs": [{ "internalType": "address", "name": "user", "type": "address" }, { "internalType": "uint128", "name": "minRatio", "type": "uint128" }, { "internalType": "uint128", "name": "maxRatio", "type": "uint128" }, { "internalType": "uint128", "name": "optimalRatioBoost", "type": "uint128" }, { "internalType": "uint128", "name": "optimalRatioRepay", "type": "uint128" }, { "internalType": "bool", "name": "boostEnabled", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "", "type": "address" }], "name": "subscribersPos", "outputs": [{ "internalType": "uint256", "name": "arrPos", "type": "uint256" }, { "internalType": "bool", "name": "subscribed", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "unsubscribe", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_user", "type": "address" }], "name": "unsubscribeByAdmin", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_token", "type": "address" }, { "internalType": "uint256", "name": "_amount", "type": "uint256" }], "name": "withdrawStuckFunds", "outputs": [], "stateMutability": "nonpayable", "type": "function" }],
3
+ "networks": {
4
+ "1": {
5
+ "address": "0x6B25043BF08182d8e86056C6548847aF607cd7CD"
6
+ }
7
+ }
8
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "abi": [{ "inputs": [{ "internalType": "address", "name": "src", "type": "address" }, { "internalType": "address", "name": "dst", "type": "address" }, { "internalType": "bytes4", "name": "sig", "type": "bytes4" }], "name": "canCall", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }],
3
+ "networks": {
4
+ "1": {
5
+ "address": "0x47b485673Cc06590CA44667b495C6bA294fd7cDB"
6
+ }
7
+ }
8
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "abi": [{ "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "user", "type": "address" }, { "indexed": false, "internalType": "uint128", "name": "", "type": "uint128" }, { "indexed": false, "internalType": "uint128", "name": "", "type": "uint128" }, { "indexed": false, "internalType": "uint128", "name": "", "type": "uint128" }, { "indexed": false, "internalType": "uint128", "name": "", "type": "uint128" }, { "indexed": false, "internalType": "bool", "name": "", "type": "bool" }], "name": "ParamUpdates", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "user", "type": "address" }], "name": "Subscribed", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "user", "type": "address" }], "name": "Unsubscribed", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "user", "type": "address" }], "name": "Updated", "type": "event" }, { "inputs": [], "name": "admin", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "changeIndex", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_user", "type": "address" }], "name": "getHolder", "outputs": [{ "components": [{ "internalType": "address", "name": "user", "type": "address" }, { "internalType": "uint128", "name": "minRatio", "type": "uint128" }, { "internalType": "uint128", "name": "maxRatio", "type": "uint128" }, { "internalType": "uint128", "name": "optimalRatioBoost", "type": "uint128" }, { "internalType": "uint128", "name": "optimalRatioRepay", "type": "uint128" }, { "internalType": "bool", "name": "boostEnabled", "type": "bool" }], "internalType": "struct CompoundSubscriptions.CompoundHolder", "name": "", "type": "tuple" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getSubscribers", "outputs": [{ "components": [{ "internalType": "address", "name": "user", "type": "address" }, { "internalType": "uint128", "name": "minRatio", "type": "uint128" }, { "internalType": "uint128", "name": "maxRatio", "type": "uint128" }, { "internalType": "uint128", "name": "optimalRatioBoost", "type": "uint128" }, { "internalType": "uint128", "name": "optimalRatioRepay", "type": "uint128" }, { "internalType": "bool", "name": "boostEnabled", "type": "bool" }], "internalType": "struct CompoundSubscriptions.CompoundHolder[]", "name": "", "type": "tuple[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "_page", "type": "uint256" }, { "internalType": "uint256", "name": "_perPage", "type": "uint256" }], "name": "getSubscribersByPage", "outputs": [{ "components": [{ "internalType": "address", "name": "user", "type": "address" }, { "internalType": "uint128", "name": "minRatio", "type": "uint128" }, { "internalType": "uint128", "name": "maxRatio", "type": "uint128" }, { "internalType": "uint128", "name": "optimalRatioBoost", "type": "uint128" }, { "internalType": "uint128", "name": "optimalRatioRepay", "type": "uint128" }, { "internalType": "bool", "name": "boostEnabled", "type": "bool" }], "internalType": "struct CompoundSubscriptions.CompoundHolder[]", "name": "", "type": "tuple[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_user", "type": "address" }], "name": "isSubscribed", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "kill", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "owner", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_admin", "type": "address" }], "name": "setAdminByAdmin", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_admin", "type": "address" }], "name": "setAdminByOwner", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_owner", "type": "address" }], "name": "setOwnerByAdmin", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "uint128", "name": "_minRatio", "type": "uint128" }, { "internalType": "uint128", "name": "_maxRatio", "type": "uint128" }, { "internalType": "uint128", "name": "_optimalBoost", "type": "uint128" }, { "internalType": "uint128", "name": "_optimalRepay", "type": "uint128" }, { "internalType": "bool", "name": "_boostEnabled", "type": "bool" }], "name": "subscribe", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "name": "subscribers", "outputs": [{ "internalType": "address", "name": "user", "type": "address" }, { "internalType": "uint128", "name": "minRatio", "type": "uint128" }, { "internalType": "uint128", "name": "maxRatio", "type": "uint128" }, { "internalType": "uint128", "name": "optimalRatioBoost", "type": "uint128" }, { "internalType": "uint128", "name": "optimalRatioRepay", "type": "uint128" }, { "internalType": "bool", "name": "boostEnabled", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "", "type": "address" }], "name": "subscribersPos", "outputs": [{ "internalType": "uint256", "name": "arrPos", "type": "uint256" }, { "internalType": "bool", "name": "subscribed", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "unsubscribe", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_user", "type": "address" }], "name": "unsubscribeByAdmin", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_token", "type": "address" }, { "internalType": "uint256", "name": "_amount", "type": "uint256" }], "name": "withdrawStuckFunds", "outputs": [], "stateMutability": "nonpayable", "type": "function" }],
3
+ "networks": {
4
+ "1": {
5
+ "address": "0x52015EFFD577E08f498a0CCc11905925D58D6207",
6
+ "createdBlock": 10386357
7
+ }
8
+ }
9
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "abi": [{ "constant": true, "inputs": [], "name": "WETH_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "CDAI_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "getSubscribers", "outputs": [{ "components": [{ "name": "minRatio", "type": "uint128" }, { "name": "maxRatio", "type": "uint128" }, { "name": "optimalRatioBoost", "type": "uint128" }, { "name": "optimalRatioRepay", "type": "uint128" }, { "name": "owner", "type": "address" }, { "name": "cdpId", "type": "uint256" }, { "name": "boostEnabled", "type": "bool" }, { "name": "nextPriceEnabled", "type": "bool" }], "name": "", "type": "tuple[]" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "SAVINGS_LOGGER_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "SAI_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "changeIndex", "outputs": [{ "name": "", "type": "uint256" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [{ "name": "_cdpId", "type": "uint256" }], "name": "getCdpHolder", "outputs": [{ "name": "subscribed", "type": "bool" }, { "components": [{ "name": "minRatio", "type": "uint128" }, { "name": "maxRatio", "type": "uint128" }, { "name": "optimalRatioBoost", "type": "uint128" }, { "name": "optimalRatioRepay", "type": "uint128" }, { "name": "owner", "type": "address" }, { "name": "cdpId", "type": "uint256" }, { "name": "boostEnabled", "type": "bool" }, { "name": "nextPriceEnabled", "type": "bool" }], "name": "", "type": "tuple" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "PIP_INTERFACE_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [{ "name": "_owner", "type": "address" }], "name": "setOwnerByAdmin", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [], "name": "KYBER_ETH_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "OTC_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "DAI_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "IDAI_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [{ "name": "_ilk", "type": "bytes32" }, { "name": "_cdpId", "type": "uint256" }], "name": "getIlkInfo", "outputs": [{ "name": "ilk", "type": "bytes32" }, { "name": "art", "type": "uint256" }, { "name": "rate", "type": "uint256" }, { "name": "spot", "type": "uint256" }, { "name": "line", "type": "uint256" }, { "name": "dust", "type": "uint256" }, { "name": "mat", "type": "uint256" }, { "name": "par", "type": "uint256" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "spotter", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "GAS_TOKEN_INTERFACE_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "vat", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "VOX_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "MANAGER_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "MONITOR_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "ETH2DAI_WRAPPER", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "manager", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "STUPID_EXCHANGE", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [{ "name": "", "type": "uint256" }], "name": "subscribers", "outputs": [{ "name": "minRatio", "type": "uint128" }, { "name": "maxRatio", "type": "uint128" }, { "name": "optimalRatioBoost", "type": "uint128" }, { "name": "optimalRatioRepay", "type": "uint128" }, { "name": "owner", "type": "address" }, { "name": "cdpId", "type": "uint256" }, { "name": "boostEnabled", "type": "bool" }, { "name": "nextPriceEnabled", "type": "bool" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [{ "name": "_cdpId", "type": "uint256" }, { "name": "_minRatio", "type": "uint128" }, { "name": "_maxRatio", "type": "uint128" }, { "name": "_optimalBoost", "type": "uint128" }, { "name": "_optimalRepay", "type": "uint128" }, { "name": "_boostEnabled", "type": "bool" }, { "name": "_nextPriceEnabled", "type": "bool" }], "name": "subscribe", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [], "name": "MIGRATION_ACTIONS_PROXY", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [{ "name": "", "type": "bytes32" }], "name": "minLimits", "outputs": [{ "name": "", "type": "uint256" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "SPOTTER_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [{ "name": "", "type": "uint256" }], "name": "subscribersPos", "outputs": [{ "name": "arrPos", "type": "uint256" }, { "name": "subscribed", "type": "bool" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "PROXY_REGISTRY_INTERFACE_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "PROXY_ACTIONS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "MKR_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "FACTORY_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [{ "name": "_page", "type": "uint256" }, { "name": "_perPage", "type": "uint256" }], "name": "getSubscribersByPage", "outputs": [{ "components": [{ "name": "minRatio", "type": "uint128" }, { "name": "maxRatio", "type": "uint128" }, { "name": "optimalRatioBoost", "type": "uint128" }, { "name": "optimalRatioRepay", "type": "uint128" }, { "name": "owner", "type": "address" }, { "name": "cdpId", "type": "uint256" }, { "name": "boostEnabled", "type": "bool" }, { "name": "nextPriceEnabled", "type": "bool" }], "name": "", "type": "tuple[]" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "owner", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [{ "name": "_cdpId", "type": "uint256" }], "name": "unsubscribeByAdmin", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [], "name": "LOGGER_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "SAVER_EXCHANGE_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "MAKER_DAI_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "DISCOUNT_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [{ "name": "_admin", "type": "address" }], "name": "setAdminByAdmin", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [], "name": "JUG_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [{ "name": "_cdpId", "type": "uint256" }], "name": "unsubscribe", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [], "name": "NEW_CDAI_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "KYBER_WRAPPER", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "SUBSCRIPTION_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "NEW_IDAI_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "COMPOUND_DAI_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [{ "name": "_cdpId", "type": "uint256" }], "name": "getOwner", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "UNISWAP_FACTORY", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "OASIS_WRAPPER", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "PETH_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [{ "name": "_cdpId", "type": "uint256" }], "name": "getSubscribedInfo", "outputs": [{ "name": "", "type": "bool" }, { "name": "", "type": "uint128" }, { "name": "", "type": "uint128" }, { "name": "", "type": "uint128" }, { "name": "", "type": "uint128" }, { "name": "", "type": "address" }, { "name": "coll", "type": "uint256" }, { "name": "debt", "type": "uint256" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "KYBER_INTERFACE", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "VAT_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "DAI_JOIN_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "ERC20_PROXY_0X", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "WALLET_ID", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "SOLO_MARGIN_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "UNISWAP_WRAPPER", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [{ "name": "_admin", "type": "address" }], "name": "setAdminByOwner", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [], "name": "saverProxy", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [{ "name": "_ilk", "type": "bytes32" }, { "name": "_newRatio", "type": "uint256" }], "name": "changeMinRatios", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [], "name": "TUB_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "ETH_JOIN_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "SCD_MCD_MIGRATION", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "admin", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "inputs": [{ "name": "_saverProxy", "type": "address" }], "payable": false, "stateMutability": "nonpayable", "type": "constructor" }, { "anonymous": false, "inputs": [{ "indexed": true, "name": "owner", "type": "address" }, { "indexed": false, "name": "cdpId", "type": "uint256" }], "name": "Subscribed", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "name": "owner", "type": "address" }, { "indexed": false, "name": "cdpId", "type": "uint256" }], "name": "Unsubscribed", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "name": "owner", "type": "address" }, { "indexed": false, "name": "cdpId", "type": "uint256" }], "name": "Updated", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "name": "owner", "type": "address" }, { "indexed": false, "name": "cdpId", "type": "uint256" }, { "indexed": false, "name": "", "type": "uint128" }, { "indexed": false, "name": "", "type": "uint128" }, { "indexed": false, "name": "", "type": "uint128" }, { "indexed": false, "name": "", "type": "uint128" }, { "indexed": false, "name": "boostEnabled", "type": "bool" }], "name": "ParamUpdates", "type": "event" }],
3
+ "networks": {
4
+ "1": {
5
+ "createdBlock": 8335635,
6
+ "address": "0xC45d4f6B6bf41b6EdAA58B01c4298B8d9078269a"
7
+ }
8
+ }
9
+ }
@@ -0,0 +1,12 @@
1
+ import type Web3 from 'web3';
2
+ import type { EthereumAddress, Position, SubscriptionOptions } from '../../types';
3
+ import { ChainId } from '../../types/enums';
4
+ export default class Automation {
5
+ protected chainId?: ChainId;
6
+ protected web3?: Web3;
7
+ protected assertProvider(): void;
8
+ protected assertChainId(): void;
9
+ protected assert(): void;
10
+ getSubscriptions(options?: SubscriptionOptions): Promise<(Position.Automated | null)[] | Position.LegacyAutomated[]>;
11
+ getSubscriptionsFor(addresses: EthereumAddress[], options?: SubscriptionOptions): Promise<(Position.Automated | null)[] | Position.LegacyAutomated[]>;
12
+ }
@@ -0,0 +1,39 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { isUndefined } from '../../services/utils';
11
+ import { ChainId } from '../../types/enums';
12
+ // TODO - Improve provider assertion
13
+ export default class Automation {
14
+ assertProvider() {
15
+ if (isUndefined(this.web3)) {
16
+ throw new Error(`Assertion for property 'web3' failed. \nExpected web3.js instance. Got: '${this.web3}.`);
17
+ }
18
+ }
19
+ assertChainId() {
20
+ const allowedChainIds = Object.values(ChainId);
21
+ if (isUndefined(this.chainId) || !allowedChainIds.includes(this.chainId || '')) {
22
+ throw new Error(`Assertion for property 'chainId' failed. \nExpected one of: '${allowedChainIds.join(', ')}. Got: '${this.chainId}.`);
23
+ }
24
+ }
25
+ assert() {
26
+ this.assertProvider();
27
+ this.assertChainId();
28
+ }
29
+ getSubscriptions(options) {
30
+ return __awaiter(this, void 0, void 0, function* () {
31
+ throw new Error('Method \'getSubscriptions\' must be implemented.');
32
+ });
33
+ }
34
+ getSubscriptionsFor(addresses, options) {
35
+ return __awaiter(this, void 0, void 0, function* () {
36
+ throw new Error('Method \'getSubscriptionsFor\' must be implemented.');
37
+ });
38
+ }
39
+ }