@gearbox-protocol/sdk 0.0.102 → 0.0.103

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 (119) hide show
  1. package/.eslintignore +4 -0
  2. package/.eslintrc.js +52 -0
  3. package/.husky/pre-push +4 -0
  4. package/lib/apy/convexAPY.js +3 -5
  5. package/lib/apy/lidoAPY.js +8 -9
  6. package/lib/contracts/contracts.d.ts +3 -3
  7. package/lib/contracts/contracts.js +2 -2
  8. package/lib/core/constants.d.ts +1 -1
  9. package/lib/core/constants.js +2 -2
  10. package/lib/core/creditAccount.js +7 -5
  11. package/lib/core/creditManager.d.ts +1 -1
  12. package/lib/core/creditManager.js +1 -7
  13. package/lib/core/creditSession.js +14 -3
  14. package/lib/core/eventOrTx.d.ts +1 -1
  15. package/lib/core/events.d.ts +19 -19
  16. package/lib/core/events.js +23 -21
  17. package/lib/core/pool.d.ts +1 -1
  18. package/lib/core/pool.js +1 -7
  19. package/lib/core/price.js +6 -1
  20. package/lib/core/strategy.d.ts +1 -3
  21. package/lib/core/strategy.js +14 -13
  22. package/lib/core/tokenDistributor.js +1 -1
  23. package/lib/core/transactions.d.ts +18 -3
  24. package/lib/core/transactions.js +39 -3
  25. package/lib/index.d.ts +1 -2
  26. package/lib/index.js +1 -1
  27. package/lib/oracles/priceFeeds.js +1 -1
  28. package/lib/pathfinder/convexLP.d.ts +1 -1
  29. package/lib/pathfinder/convexLP.js +26 -29
  30. package/lib/pathfinder/curveLP.d.ts +1 -1
  31. package/lib/pathfinder/curveLP.js +5 -7
  32. package/lib/pathfinder/path.d.ts +1 -1
  33. package/lib/pathfinder/path.js +38 -42
  34. package/lib/pathfinder/trade.d.ts +1 -2
  35. package/lib/pathfinder/tradeTypes.d.ts +5 -5
  36. package/lib/pathfinder/yVault.d.ts +2 -2
  37. package/lib/pathfinder/yVault.js +18 -15
  38. package/lib/strategies/curve.d.ts +6 -60
  39. package/lib/strategies/curve.js +6 -0
  40. package/lib/strategies/uniswapV2.js +3 -19
  41. package/lib/strategies/uniswapV3.js +1 -1
  42. package/lib/strategies/yearn.js +15 -11
  43. package/lib/tokens/convex.d.ts +3 -3
  44. package/lib/tokens/curveLP.d.ts +2 -2
  45. package/lib/tokens/curveLP.js +1 -1
  46. package/lib/tokens/gear.d.ts +2 -2
  47. package/lib/tokens/gear.js +1 -1
  48. package/lib/tokens/normal.d.ts +1 -1
  49. package/lib/tokens/token.js +4 -4
  50. package/lib/tokens/tokenData.d.ts +3 -1
  51. package/lib/tokens/tokenData.js +10 -8
  52. package/lib/tokens/yearn.d.ts +3 -3
  53. package/lib/utils/errors.d.ts +6 -0
  54. package/lib/utils/errors.js +13 -0
  55. package/lib/utils/formatter.d.ts +1 -1
  56. package/lib/utils/formatter.js +17 -14
  57. package/lib/utils/loading.d.ts +2 -1
  58. package/lib/utils/loading.js +9 -13
  59. package/lib/utils/mappers.js +2 -2
  60. package/lib/utils/network.js +2 -2
  61. package/lib/utils/repeater.js +12 -24
  62. package/lib/utils/validate.js +1 -1
  63. package/package.json +26 -8
  64. package/src/apy/convexAPY.ts +6 -6
  65. package/src/apy/lidoAPY.ts +12 -11
  66. package/src/contracts/contracts.ts +8 -7
  67. package/src/core/constants.ts +1 -1
  68. package/src/core/creditAccount.ts +28 -5
  69. package/src/core/creditManager.ts +29 -4
  70. package/src/core/creditOperation.ts +7 -7
  71. package/src/core/creditSession.ts +25 -5
  72. package/src/core/errors.ts +1 -0
  73. package/src/core/eventOrTx.ts +8 -5
  74. package/src/core/events.ts +85 -24
  75. package/src/core/history.ts +46 -46
  76. package/src/core/operations.ts +6 -0
  77. package/src/core/pool.ts +16 -4
  78. package/src/core/price.ts +7 -3
  79. package/src/core/strategy.ts +27 -23
  80. package/src/core/tokenDistributor.ts +2 -2
  81. package/src/core/transactions.ts +427 -350
  82. package/src/index.ts +1 -3
  83. package/src/oracles/priceFeeds.ts +523 -523
  84. package/src/pathfinder/contracts.ts +15 -13
  85. package/src/pathfinder/convexLP.ts +29 -25
  86. package/src/pathfinder/curveLP.ts +57 -53
  87. package/src/pathfinder/path.ts +17 -9
  88. package/src/pathfinder/priority.ts +11 -11
  89. package/src/pathfinder/trade.ts +84 -77
  90. package/src/pathfinder/tradeTypes.ts +98 -94
  91. package/src/pathfinder/yVault.ts +26 -11
  92. package/src/payload/token.ts +3 -3
  93. package/src/strategies/convex.ts +217 -210
  94. package/src/strategies/creditFacade.ts +70 -53
  95. package/src/strategies/curve.ts +263 -194
  96. package/src/strategies/lido.ts +33 -37
  97. package/src/strategies/uniswapV2.ts +90 -112
  98. package/src/strategies/uniswapV3.ts +114 -91
  99. package/src/strategies/yearn.ts +58 -62
  100. package/src/tokens/connectors.ts +6 -6
  101. package/src/tokens/convex.ts +297 -296
  102. package/src/tokens/curveLP.ts +170 -165
  103. package/src/tokens/gear.ts +47 -45
  104. package/src/tokens/normal.ts +801 -802
  105. package/src/tokens/token.ts +9 -5
  106. package/src/tokens/tokenData.ts +19 -9
  107. package/src/tokens/tokenType.ts +11 -11
  108. package/src/tokens/yearn.ts +126 -124
  109. package/src/utils/errors.ts +11 -0
  110. package/src/utils/formatter.ts +22 -18
  111. package/src/utils/loading.ts +14 -6
  112. package/src/utils/mappers.ts +8 -6
  113. package/src/utils/multicall.ts +2 -0
  114. package/src/utils/network.ts +21 -21
  115. package/src/utils/repeater.ts +2 -2
  116. package/src/utils/validate.ts +1 -1
  117. package/lib/utils/events.d.ts +0 -2
  118. package/lib/utils/events.js +0 -13
  119. package/src/utils/events.ts +0 -10
@@ -1,233 +1,240 @@
1
1
  import { BigNumberish } from "ethers";
2
2
 
3
3
  import {
4
- ConvexV1BoosterAdapter__factory,
5
- ConvexV1BaseRewardPoolAdapter__factory,
6
- ConvexV1ClaimZapAdapter__factory
7
- } from "../types"
4
+ ConvexV1BoosterAdapter__factory,
5
+ ConvexV1BaseRewardPoolAdapter__factory,
6
+ ConvexV1ClaimZapAdapter__factory
7
+ } from "../types";
8
8
 
9
9
  import { MultiCallStruct } from "../types/contracts/interfaces/ICreditFacade.sol/ICreditFacade";
10
10
 
11
11
  export class ConvexBoosterCalls {
12
- public static deposit(pid: BigNumberish, amount: BigNumberish, stake: boolean) {
13
- return ConvexV1BoosterAdapter__factory.createInterface().encodeFunctionData(
14
- "deposit",
15
- [pid, amount, stake]
16
- );
17
- }
18
-
19
- public static depositAll(pid: BigNumberish, stake: boolean) {
20
- return ConvexV1BoosterAdapter__factory.createInterface().encodeFunctionData(
21
- "depositAll",
22
- [pid, stake]
23
- );
24
- }
25
-
26
- public static withdraw(pid: BigNumberish, amount: BigNumberish) {
27
- return ConvexV1BoosterAdapter__factory.createInterface().encodeFunctionData(
28
- "withdraw",
29
- [pid, amount]
30
- );
31
- }
32
-
33
- public static withdrawAll(pid: BigNumberish) {
34
- return ConvexV1BoosterAdapter__factory.createInterface().encodeFunctionData(
35
- "withdrawAll",
36
- [pid]
37
- );
38
- }
12
+ public static deposit(
13
+ pid: BigNumberish,
14
+ amount: BigNumberish,
15
+ stake: boolean
16
+ ) {
17
+ return ConvexV1BoosterAdapter__factory.createInterface().encodeFunctionData(
18
+ "deposit",
19
+ [pid, amount, stake]
20
+ );
21
+ }
22
+
23
+ public static depositAll(pid: BigNumberish, stake: boolean) {
24
+ return ConvexV1BoosterAdapter__factory.createInterface().encodeFunctionData(
25
+ "depositAll",
26
+ [pid, stake]
27
+ );
28
+ }
29
+
30
+ public static withdraw(pid: BigNumberish, amount: BigNumberish) {
31
+ return ConvexV1BoosterAdapter__factory.createInterface().encodeFunctionData(
32
+ "withdraw",
33
+ [pid, amount]
34
+ );
35
+ }
36
+
37
+ public static withdrawAll(pid: BigNumberish) {
38
+ return ConvexV1BoosterAdapter__factory.createInterface().encodeFunctionData(
39
+ "withdrawAll",
40
+ [pid]
41
+ );
42
+ }
39
43
  }
40
44
 
41
45
  export class ConvexPoolCalls {
42
- public static stake(amount: BigNumberish) {
43
- return ConvexV1BaseRewardPoolAdapter__factory.createInterface().encodeFunctionData(
44
- "stake",
45
- [amount]
46
- );
47
- }
48
-
49
- public static stakeAll() {
50
- return ConvexV1BaseRewardPoolAdapter__factory.createInterface().encodeFunctionData(
51
- "stakeAll"
52
- );
53
- }
54
-
55
- public static withdraw(amount: BigNumberish, claim: boolean) {
56
- return ConvexV1BaseRewardPoolAdapter__factory.createInterface().encodeFunctionData(
57
- "withdraw",
58
- [amount, claim]
59
- );
60
- }
61
-
62
- public static withdrawAll(claim: boolean) {
63
- return ConvexV1BaseRewardPoolAdapter__factory.createInterface().encodeFunctionData(
64
- "withdrawAll",
65
- [claim]
66
- );
67
- }
68
-
69
- public static withdrawAndUnwrap(amount: BigNumberish, claim: boolean) {
70
- return ConvexV1BaseRewardPoolAdapter__factory.createInterface().encodeFunctionData(
71
- "withdrawAndUnwrap",
72
- [amount, claim]
73
- );
74
- }
75
-
76
- public static withdrawAllAndUnwrap(claim: boolean) {
77
- return ConvexV1BaseRewardPoolAdapter__factory.createInterface().encodeFunctionData(
78
- "withdrawAllAndUnwrap",
79
- [claim]
80
- );
81
- }
46
+ public static stake(amount: BigNumberish) {
47
+ return ConvexV1BaseRewardPoolAdapter__factory.createInterface().encodeFunctionData(
48
+ "stake",
49
+ [amount]
50
+ );
51
+ }
52
+
53
+ public static stakeAll() {
54
+ return ConvexV1BaseRewardPoolAdapter__factory.createInterface().encodeFunctionData(
55
+ "stakeAll"
56
+ );
57
+ }
58
+
59
+ public static withdraw(amount: BigNumberish, claim: boolean) {
60
+ return ConvexV1BaseRewardPoolAdapter__factory.createInterface().encodeFunctionData(
61
+ "withdraw",
62
+ [amount, claim]
63
+ );
64
+ }
65
+
66
+ public static withdrawAll(claim: boolean) {
67
+ return ConvexV1BaseRewardPoolAdapter__factory.createInterface().encodeFunctionData(
68
+ "withdrawAll",
69
+ [claim]
70
+ );
71
+ }
72
+
73
+ public static withdrawAndUnwrap(amount: BigNumberish, claim: boolean) {
74
+ return ConvexV1BaseRewardPoolAdapter__factory.createInterface().encodeFunctionData(
75
+ "withdrawAndUnwrap",
76
+ [amount, claim]
77
+ );
78
+ }
79
+
80
+ public static withdrawAllAndUnwrap(claim: boolean) {
81
+ return ConvexV1BaseRewardPoolAdapter__factory.createInterface().encodeFunctionData(
82
+ "withdrawAllAndUnwrap",
83
+ [claim]
84
+ );
85
+ }
82
86
  }
83
87
 
84
-
85
88
  export class ConvexClaimZapCalls {
86
- public static claimRewards(
87
- rewardContracts: Array<string>,
88
- extraRewardContracts: Array<string>,
89
- tokenRewardContracts: Array<string>,
90
- tokenRewardTokens: Array<string>,
91
- depositCrvMaxAmount: BigNumberish,
92
- minAmountOut: BigNumberish,
93
- depositCvxMaxAmount: BigNumberish,
94
- spendCvxAmount: BigNumberish,
95
- options: BigNumberish
96
- ) {
97
- return ConvexV1ClaimZapAdapter__factory.createInterface().encodeFunctionData(
98
- "claimRewards",
99
- [
100
- rewardContracts,
101
- extraRewardContracts,
102
- tokenRewardContracts,
103
- tokenRewardTokens,
104
- depositCrvMaxAmount,
105
- minAmountOut,
106
- depositCvxMaxAmount,
107
- spendCvxAmount,
108
- options
109
- ]
110
- );
111
- }
89
+ public static claimRewards(
90
+ rewardContracts: Array<string>,
91
+ extraRewardContracts: Array<string>,
92
+ tokenRewardContracts: Array<string>,
93
+ tokenRewardTokens: Array<string>,
94
+ depositCrvMaxAmount: BigNumberish,
95
+ minAmountOut: BigNumberish,
96
+ depositCvxMaxAmount: BigNumberish,
97
+ spendCvxAmount: BigNumberish,
98
+ options: BigNumberish
99
+ ) {
100
+ return ConvexV1ClaimZapAdapter__factory.createInterface().encodeFunctionData(
101
+ "claimRewards",
102
+ [
103
+ rewardContracts,
104
+ extraRewardContracts,
105
+ tokenRewardContracts,
106
+ tokenRewardTokens,
107
+ depositCrvMaxAmount,
108
+ minAmountOut,
109
+ depositCvxMaxAmount,
110
+ spendCvxAmount,
111
+ options
112
+ ]
113
+ );
114
+ }
112
115
  }
113
116
 
114
117
  export class ConvexBoosterMulticaller {
115
- private readonly _address: string;
116
-
117
- constructor(address: string) {
118
- this._address = address;
119
- }
120
-
121
- deposit(pid: BigNumberish, amount: BigNumberish, stake: boolean): MultiCallStruct {
122
- return {
123
- target: this._address,
124
- callData: ConvexBoosterCalls.deposit(pid, amount, stake)
125
- }
126
- }
127
-
128
- depositAll(pid: BigNumberish, stake: boolean): MultiCallStruct {
129
- return {
130
- target: this._address,
131
- callData: ConvexBoosterCalls.depositAll(pid, stake)
132
- }
133
- }
134
-
135
- withdraw(pid: BigNumberish, amount: BigNumberish): MultiCallStruct {
136
- return {
137
- target: this._address,
138
- callData: ConvexBoosterCalls.withdraw(pid, amount)
139
- }
140
- }
141
-
142
- withdrawAll(pid: BigNumberish): MultiCallStruct {
143
- return {
144
- target: this._address,
145
- callData: ConvexBoosterCalls.withdrawAll(pid)
146
- }
147
- }
118
+ private readonly _address: string;
119
+
120
+ constructor(address: string) {
121
+ this._address = address;
122
+ }
123
+
124
+ deposit(
125
+ pid: BigNumberish,
126
+ amount: BigNumberish,
127
+ stake: boolean
128
+ ): MultiCallStruct {
129
+ return {
130
+ target: this._address,
131
+ callData: ConvexBoosterCalls.deposit(pid, amount, stake)
132
+ };
133
+ }
134
+
135
+ depositAll(pid: BigNumberish, stake: boolean): MultiCallStruct {
136
+ return {
137
+ target: this._address,
138
+ callData: ConvexBoosterCalls.depositAll(pid, stake)
139
+ };
140
+ }
141
+
142
+ withdraw(pid: BigNumberish, amount: BigNumberish): MultiCallStruct {
143
+ return {
144
+ target: this._address,
145
+ callData: ConvexBoosterCalls.withdraw(pid, amount)
146
+ };
147
+ }
148
+
149
+ withdrawAll(pid: BigNumberish): MultiCallStruct {
150
+ return {
151
+ target: this._address,
152
+ callData: ConvexBoosterCalls.withdrawAll(pid)
153
+ };
154
+ }
148
155
  }
149
156
 
150
157
  export class ConvexPoolMulticaller {
151
- private readonly _address: string;
152
-
153
- constructor(address: string) {
154
- this._address = address;
155
- }
156
-
157
- stake(amount: BigNumberish): MultiCallStruct {
158
- return {
159
- target: this._address,
160
- callData: ConvexPoolCalls.stake(amount)
161
- }
162
- }
163
-
164
- stakeAll(): MultiCallStruct {
165
- return {
166
- target: this._address,
167
- callData: ConvexPoolCalls.stakeAll()
168
- }
169
- }
170
-
171
- withdraw(amount: BigNumberish, claim: boolean): MultiCallStruct {
172
- return {
173
- target: this._address,
174
- callData: ConvexPoolCalls.withdraw(amount, claim)
175
- }
176
- }
177
-
178
- withdrawAll(claim: boolean): MultiCallStruct {
179
- return {
180
- target: this._address,
181
- callData: ConvexPoolCalls.withdrawAll(claim)
182
- }
183
- }
184
-
185
- withdrawAndUnwrap(amount: BigNumberish, claim: boolean): MultiCallStruct {
186
- return {
187
- target: this._address,
188
- callData: ConvexPoolCalls.withdrawAndUnwrap(amount, claim)
189
- }
190
- }
191
-
192
- withdrawAllAndUnwrap(claim: boolean) {
193
- return {
194
- target: this._address,
195
- callData: ConvexPoolCalls.withdrawAllAndUnwrap(claim)
196
- }
197
- }
158
+ private readonly _address: string;
159
+
160
+ constructor(address: string) {
161
+ this._address = address;
162
+ }
163
+
164
+ stake(amount: BigNumberish): MultiCallStruct {
165
+ return {
166
+ target: this._address,
167
+ callData: ConvexPoolCalls.stake(amount)
168
+ };
169
+ }
170
+
171
+ stakeAll(): MultiCallStruct {
172
+ return {
173
+ target: this._address,
174
+ callData: ConvexPoolCalls.stakeAll()
175
+ };
176
+ }
177
+
178
+ withdraw(amount: BigNumberish, claim: boolean): MultiCallStruct {
179
+ return {
180
+ target: this._address,
181
+ callData: ConvexPoolCalls.withdraw(amount, claim)
182
+ };
183
+ }
184
+
185
+ withdrawAll(claim: boolean): MultiCallStruct {
186
+ return {
187
+ target: this._address,
188
+ callData: ConvexPoolCalls.withdrawAll(claim)
189
+ };
190
+ }
191
+
192
+ withdrawAndUnwrap(amount: BigNumberish, claim: boolean): MultiCallStruct {
193
+ return {
194
+ target: this._address,
195
+ callData: ConvexPoolCalls.withdrawAndUnwrap(amount, claim)
196
+ };
197
+ }
198
+
199
+ withdrawAllAndUnwrap(claim: boolean) {
200
+ return {
201
+ target: this._address,
202
+ callData: ConvexPoolCalls.withdrawAllAndUnwrap(claim)
203
+ };
204
+ }
198
205
  }
199
206
 
200
207
  export class ConvexClaimZapMulticaller {
201
- private readonly _address: string;
202
-
203
- constructor(address: string) {
204
- this._address = address;
205
- }
206
-
207
- claimRewards(
208
- rewardContracts: Array<string>,
209
- extraRewardContracts: Array<string>,
210
- tokenRewardContracts: Array<string>,
211
- tokenRewardTokens: Array<string>,
212
- depositCrvMaxAmount: BigNumberish,
213
- minAmountOut: BigNumberish,
214
- depositCvxMaxAmount: BigNumberish,
215
- spendCvxAmount: BigNumberish,
216
- options: BigNumberish
217
- ): MultiCallStruct {
218
- return {
219
- target: this._address,
220
- callData: ConvexClaimZapCalls.claimRewards(
221
- rewardContracts,
222
- extraRewardContracts,
223
- tokenRewardContracts,
224
- tokenRewardTokens,
225
- depositCrvMaxAmount,
226
- minAmountOut,
227
- depositCvxMaxAmount,
228
- spendCvxAmount,
229
- options
230
- )
231
- }
232
- }
208
+ private readonly _address: string;
209
+
210
+ constructor(address: string) {
211
+ this._address = address;
212
+ }
213
+
214
+ claimRewards(
215
+ rewardContracts: Array<string>,
216
+ extraRewardContracts: Array<string>,
217
+ tokenRewardContracts: Array<string>,
218
+ tokenRewardTokens: Array<string>,
219
+ depositCrvMaxAmount: BigNumberish,
220
+ minAmountOut: BigNumberish,
221
+ depositCvxMaxAmount: BigNumberish,
222
+ spendCvxAmount: BigNumberish,
223
+ options: BigNumberish
224
+ ): MultiCallStruct {
225
+ return {
226
+ target: this._address,
227
+ callData: ConvexClaimZapCalls.claimRewards(
228
+ rewardContracts,
229
+ extraRewardContracts,
230
+ tokenRewardContracts,
231
+ tokenRewardTokens,
232
+ depositCrvMaxAmount,
233
+ minAmountOut,
234
+ depositCvxMaxAmount,
235
+ spendCvxAmount,
236
+ options
237
+ )
238
+ };
239
+ }
233
240
  }
@@ -1,70 +1,87 @@
1
1
  import { BigNumberish } from "ethers";
2
2
 
3
- import { ICreditFacade__factory, ICreditFacadeBalanceChecker__factory } from "../types";
3
+ import {
4
+ ICreditFacade__factory,
5
+ ICreditFacadeBalanceChecker__factory
6
+ } from "../types";
4
7
  import { MultiCallStruct } from "../types/contracts/interfaces/ICreditFacade.sol/ICreditFacade";
5
8
 
6
9
  export class CreditFacadeCalls {
7
- public static addCollateral(onBehalfOf: string, token: string, amount: BigNumberish) {
8
- return ICreditFacade__factory.createInterface().encodeFunctionData(
9
- "addCollateral",
10
- [onBehalfOf, token, amount]
11
- )
12
- }
10
+ public static addCollateral(
11
+ onBehalfOf: string,
12
+ token: string,
13
+ amount: BigNumberish
14
+ ) {
15
+ return ICreditFacade__factory.createInterface().encodeFunctionData(
16
+ "addCollateral",
17
+ [onBehalfOf, token, amount]
18
+ );
19
+ }
13
20
 
14
- public static increaseDebt(amount: BigNumberish) {
15
- return ICreditFacade__factory.createInterface().encodeFunctionData(
16
- "increaseDebt",
17
- [amount]
18
- )
19
- }
21
+ public static increaseDebt(amount: BigNumberish) {
22
+ return ICreditFacade__factory.createInterface().encodeFunctionData(
23
+ "increaseDebt",
24
+ [amount]
25
+ );
26
+ }
20
27
 
21
- public static decreaseDebt(amount: BigNumberish) {
22
- return ICreditFacade__factory.createInterface().encodeFunctionData(
23
- "decreaseDebt",
24
- [amount]
25
- )
26
- }
28
+ public static decreaseDebt(amount: BigNumberish) {
29
+ return ICreditFacade__factory.createInterface().encodeFunctionData(
30
+ "decreaseDebt",
31
+ [amount]
32
+ );
33
+ }
27
34
 
28
- public static revertIfBalanceLessThan(token: string, minBalance: BigNumberish) {
29
- return ICreditFacadeBalanceChecker__factory.createInterface().encodeFunctionData(
30
- "revertIfBalanceLessThan",
31
- [token, minBalance]
32
- )
33
- }
35
+ public static revertIfBalanceLessThan(
36
+ token: string,
37
+ minBalance: BigNumberish
38
+ ) {
39
+ return ICreditFacadeBalanceChecker__factory.createInterface().encodeFunctionData(
40
+ "revertIfBalanceLessThan",
41
+ [token, minBalance]
42
+ );
43
+ }
34
44
  }
35
45
 
36
46
  export class CreditFacadeMulticaller {
37
- private readonly _address: string;
47
+ private readonly _address: string;
38
48
 
39
- constructor(address: string) {
40
- this._address = address;
41
- }
49
+ constructor(address: string) {
50
+ this._address = address;
51
+ }
42
52
 
43
- addCollateral(onBehalfOf: string, token: string, amount: BigNumberish): MultiCallStruct {
44
- return {
45
- target: this._address,
46
- callData: CreditFacadeCalls.addCollateral(onBehalfOf, token, amount)
47
- }
48
- }
53
+ addCollateral(
54
+ onBehalfOf: string,
55
+ token: string,
56
+ amount: BigNumberish
57
+ ): MultiCallStruct {
58
+ return {
59
+ target: this._address,
60
+ callData: CreditFacadeCalls.addCollateral(onBehalfOf, token, amount)
61
+ };
62
+ }
49
63
 
50
- increaseDebt(amount: BigNumberish): MultiCallStruct {
51
- return {
52
- target: this._address,
53
- callData: CreditFacadeCalls.increaseDebt(amount)
54
- }
55
- }
64
+ increaseDebt(amount: BigNumberish): MultiCallStruct {
65
+ return {
66
+ target: this._address,
67
+ callData: CreditFacadeCalls.increaseDebt(amount)
68
+ };
69
+ }
56
70
 
57
- decreaseDebt(amount: BigNumberish): MultiCallStruct {
58
- return {
59
- target: this._address,
60
- callData: CreditFacadeCalls.decreaseDebt(amount)
61
- }
62
- }
71
+ decreaseDebt(amount: BigNumberish): MultiCallStruct {
72
+ return {
73
+ target: this._address,
74
+ callData: CreditFacadeCalls.decreaseDebt(amount)
75
+ };
76
+ }
63
77
 
64
- revertIfBalanceLessThan(token: string, minBalance: BigNumberish): MultiCallStruct {
65
- return {
66
- target: this._address,
67
- callData: CreditFacadeCalls.revertIfBalanceLessThan(token, minBalance)
68
- }
69
- }
78
+ revertIfBalanceLessThan(
79
+ token: string,
80
+ minBalance: BigNumberish
81
+ ): MultiCallStruct {
82
+ return {
83
+ target: this._address,
84
+ callData: CreditFacadeCalls.revertIfBalanceLessThan(token, minBalance)
85
+ };
86
+ }
70
87
  }