@gearbox-protocol/sdk 14.5.9 → 14.6.0-next.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 (100) hide show
  1. package/dist/cjs/abi/kyc/iDSToken.js +1907 -20
  2. package/dist/cjs/common-utils/utils/apy/bonus-apy-from-points.js +28 -0
  3. package/dist/cjs/common-utils/utils/apy/calculate-effective-borrow-rate.js +35 -0
  4. package/dist/cjs/common-utils/utils/apy/get-complex-apy-list.js +45 -0
  5. package/dist/cjs/common-utils/utils/apy/get-rate-with-fee.js +31 -0
  6. package/dist/cjs/common-utils/utils/apy/get-single-quota-borrow-rate.js +33 -0
  7. package/dist/cjs/common-utils/utils/apy/index.js +32 -0
  8. package/dist/cjs/common-utils/utils/apy/max-apy-formula.js +40 -0
  9. package/dist/cjs/common-utils/utils/index.js +5 -1
  10. package/dist/cjs/common-utils/utils/strategies/__test-utils.js +95 -0
  11. package/dist/cjs/common-utils/utils/strategies/availability/check-boolean.js +33 -0
  12. package/dist/cjs/common-utils/utils/strategies/availability/check-degen-nft.js +35 -0
  13. package/dist/cjs/common-utils/utils/strategies/availability/index.js +28 -0
  14. package/dist/cjs/common-utils/utils/strategies/availability/validate-open-account-pool-quota-status.js +40 -0
  15. package/dist/cjs/common-utils/utils/strategies/availability/validate-open-account-pool-status.js +76 -0
  16. package/dist/cjs/common-utils/utils/strategies/index.js +28 -0
  17. package/dist/cjs/common-utils/utils/strategies/leverage/calculate-loss-coefficient.js +31 -0
  18. package/dist/cjs/common-utils/utils/strategies/leverage/calculate-max-leverage-factor.js +45 -0
  19. package/dist/cjs/common-utils/utils/strategies/leverage/get-factor-from-leverage.js +31 -0
  20. package/dist/cjs/common-utils/utils/strategies/leverage/get-leverage-from-factor.js +31 -0
  21. package/dist/cjs/common-utils/utils/strategies/leverage/index.js +32 -0
  22. package/dist/cjs/common-utils/utils/strategies/leverage/max-leverage-threshold.js +42 -0
  23. package/dist/cjs/common-utils/utils/strategies/leverage/max-leverage.js +35 -0
  24. package/dist/cjs/common-utils/utils/strategies/sort-strategy-cms-by-availability/index.js +22 -0
  25. package/dist/cjs/common-utils/utils/strategies/sort-strategy-cms-by-availability/sort-strategy-cms-by-availability.js +64 -0
  26. package/dist/cjs/common-utils/utils/strategies/strategy-info/cm-availability-condition.js +63 -0
  27. package/dist/cjs/common-utils/utils/strategies/strategy-info/get-strategy-info.js +98 -0
  28. package/dist/cjs/common-utils/utils/strategies/strategy-info/get-strategy-max-apy.js +102 -0
  29. package/dist/cjs/common-utils/utils/strategies/strategy-info/index.js +30 -0
  30. package/dist/cjs/common-utils/utils/strategies/strategy-info/is-strategy-cm-disabled.js +33 -0
  31. package/dist/cjs/common-utils/utils/strategies/strategy-info/types.js +16 -0
  32. package/dist/cjs/plugins/adapters/abi/securitize/iBaseOnRamp.js +351 -0
  33. package/dist/cjs/plugins/adapters/contracts/SecuritizeOnRampAdapterContract.js +2 -1
  34. package/dist/esm/abi/kyc/iDSToken.js +1907 -20
  35. package/dist/esm/common-utils/utils/apy/bonus-apy-from-points.js +4 -0
  36. package/dist/esm/common-utils/utils/apy/calculate-effective-borrow-rate.js +11 -0
  37. package/dist/esm/common-utils/utils/apy/get-complex-apy-list.js +21 -0
  38. package/dist/esm/common-utils/utils/apy/get-rate-with-fee.js +7 -0
  39. package/dist/esm/common-utils/utils/apy/get-single-quota-borrow-rate.js +9 -0
  40. package/dist/esm/common-utils/utils/apy/index.js +6 -0
  41. package/dist/esm/common-utils/utils/apy/max-apy-formula.js +16 -0
  42. package/dist/esm/common-utils/utils/index.js +2 -0
  43. package/dist/esm/common-utils/utils/strategies/__test-utils.js +65 -0
  44. package/dist/esm/common-utils/utils/strategies/availability/check-boolean.js +9 -0
  45. package/dist/esm/common-utils/utils/strategies/availability/check-degen-nft.js +11 -0
  46. package/dist/esm/common-utils/utils/strategies/availability/index.js +4 -0
  47. package/dist/esm/common-utils/utils/strategies/availability/validate-open-account-pool-quota-status.js +16 -0
  48. package/dist/esm/common-utils/utils/strategies/availability/validate-open-account-pool-status.js +52 -0
  49. package/dist/esm/common-utils/utils/strategies/index.js +4 -0
  50. package/dist/esm/common-utils/utils/strategies/leverage/calculate-loss-coefficient.js +7 -0
  51. package/dist/esm/common-utils/utils/strategies/leverage/calculate-max-leverage-factor.js +21 -0
  52. package/dist/esm/common-utils/utils/strategies/leverage/get-factor-from-leverage.js +7 -0
  53. package/dist/esm/common-utils/utils/strategies/leverage/get-leverage-from-factor.js +7 -0
  54. package/dist/esm/common-utils/utils/strategies/leverage/index.js +6 -0
  55. package/dist/esm/common-utils/utils/strategies/leverage/max-leverage-threshold.js +18 -0
  56. package/dist/esm/common-utils/utils/strategies/leverage/max-leverage.js +11 -0
  57. package/dist/esm/common-utils/utils/strategies/sort-strategy-cms-by-availability/index.js +1 -0
  58. package/dist/esm/common-utils/utils/strategies/sort-strategy-cms-by-availability/sort-strategy-cms-by-availability.js +43 -0
  59. package/dist/esm/common-utils/utils/strategies/strategy-info/cm-availability-condition.js +43 -0
  60. package/dist/esm/common-utils/utils/strategies/strategy-info/get-strategy-info.js +74 -0
  61. package/dist/esm/common-utils/utils/strategies/strategy-info/get-strategy-max-apy.js +85 -0
  62. package/dist/esm/common-utils/utils/strategies/strategy-info/index.js +5 -0
  63. package/dist/esm/common-utils/utils/strategies/strategy-info/is-strategy-cm-disabled.js +9 -0
  64. package/dist/esm/common-utils/utils/strategies/strategy-info/types.js +0 -0
  65. package/dist/esm/plugins/adapters/abi/securitize/iBaseOnRamp.js +327 -0
  66. package/dist/esm/plugins/adapters/contracts/SecuritizeOnRampAdapterContract.js +2 -1
  67. package/dist/types/abi/kyc/iDSToken.d.ts +1446 -13
  68. package/dist/types/common-utils/utils/apy/bonus-apy-from-points.d.ts +4 -0
  69. package/dist/types/common-utils/utils/apy/calculate-effective-borrow-rate.d.ts +6 -0
  70. package/dist/types/common-utils/utils/apy/get-complex-apy-list.d.ts +5 -0
  71. package/dist/types/common-utils/utils/apy/get-rate-with-fee.d.ts +7 -0
  72. package/dist/types/common-utils/utils/apy/get-single-quota-borrow-rate.d.ts +9 -0
  73. package/dist/types/common-utils/utils/apy/index.d.ts +6 -0
  74. package/dist/types/common-utils/utils/apy/max-apy-formula.d.ts +6 -0
  75. package/dist/types/common-utils/utils/index.d.ts +2 -0
  76. package/dist/types/common-utils/utils/strategies/__test-utils.d.ts +11 -0
  77. package/dist/types/common-utils/utils/strategies/availability/check-boolean.d.ts +1 -0
  78. package/dist/types/common-utils/utils/strategies/availability/check-degen-nft.d.ts +5 -0
  79. package/dist/types/common-utils/utils/strategies/availability/index.d.ts +4 -0
  80. package/dist/types/common-utils/utils/strategies/availability/validate-open-account-pool-quota-status.d.ts +6 -0
  81. package/dist/types/common-utils/utils/strategies/availability/validate-open-account-pool-status.d.ts +24 -0
  82. package/dist/types/common-utils/utils/strategies/index.d.ts +4 -0
  83. package/dist/types/common-utils/utils/strategies/leverage/calculate-loss-coefficient.d.ts +1 -0
  84. package/dist/types/common-utils/utils/strategies/leverage/calculate-max-leverage-factor.d.ts +12 -0
  85. package/dist/types/common-utils/utils/strategies/leverage/get-factor-from-leverage.d.ts +4 -0
  86. package/dist/types/common-utils/utils/strategies/leverage/get-leverage-from-factor.d.ts +2 -0
  87. package/dist/types/common-utils/utils/strategies/leverage/index.d.ts +6 -0
  88. package/dist/types/common-utils/utils/strategies/leverage/max-leverage-threshold.d.ts +5 -0
  89. package/dist/types/common-utils/utils/strategies/leverage/max-leverage.d.ts +9 -0
  90. package/dist/types/common-utils/utils/strategies/sort-strategy-cms-by-availability/index.d.ts +1 -0
  91. package/dist/types/common-utils/utils/strategies/sort-strategy-cms-by-availability/sort-strategy-cms-by-availability.d.ts +13 -0
  92. package/dist/types/common-utils/utils/strategies/strategy-info/cm-availability-condition.d.ts +3 -0
  93. package/dist/types/common-utils/utils/strategies/strategy-info/get-strategy-info.d.ts +2 -0
  94. package/dist/types/common-utils/utils/strategies/strategy-info/get-strategy-max-apy.d.ts +13 -0
  95. package/dist/types/common-utils/utils/strategies/strategy-info/index.d.ts +5 -0
  96. package/dist/types/common-utils/utils/strategies/strategy-info/is-strategy-cm-disabled.d.ts +2 -0
  97. package/dist/types/common-utils/utils/strategies/strategy-info/types.d.ts +80 -0
  98. package/dist/types/plugins/adapters/abi/securitize/iBaseOnRamp.d.ts +255 -0
  99. package/dist/types/plugins/adapters/contracts/SecuritizeOnRampAdapterContract.d.ts +254 -0
  100. package/package.json +1 -1
@@ -0,0 +1,327 @@
1
+ const iBaseOnRampAbi = [
2
+ {
3
+ inputs: [],
4
+ name: "InsufficientERC20BalanceError",
5
+ type: "error"
6
+ },
7
+ {
8
+ inputs: [],
9
+ name: "InvalidEIP712SignatureError",
10
+ type: "error"
11
+ },
12
+ {
13
+ inputs: [],
14
+ name: "InvestorNotRegisteredError",
15
+ type: "error"
16
+ },
17
+ {
18
+ inputs: [],
19
+ name: "InvestorSubscriptionDisabledError",
20
+ type: "error"
21
+ },
22
+ {
23
+ inputs: [],
24
+ name: "MinSubscriptionAmountError",
25
+ type: "error"
26
+ },
27
+ {
28
+ inputs: [],
29
+ name: "NonPositiveAmountError",
30
+ type: "error"
31
+ },
32
+ {
33
+ inputs: [],
34
+ name: "NonZeroAddressError",
35
+ type: "error"
36
+ },
37
+ {
38
+ inputs: [],
39
+ name: "NonZeroNavRateError",
40
+ type: "error"
41
+ },
42
+ {
43
+ inputs: [],
44
+ name: "SameValueError",
45
+ type: "error"
46
+ },
47
+ {
48
+ inputs: [],
49
+ name: "SignatureDeadlineExpiredError",
50
+ type: "error"
51
+ },
52
+ {
53
+ inputs: [],
54
+ name: "SlippageControlError",
55
+ type: "error"
56
+ },
57
+ {
58
+ anonymous: false,
59
+ inputs: [
60
+ {
61
+ indexed: true,
62
+ internalType: "address",
63
+ name: "oldProvider",
64
+ type: "address"
65
+ },
66
+ {
67
+ indexed: true,
68
+ internalType: "address",
69
+ name: "newProvider",
70
+ type: "address"
71
+ }
72
+ ],
73
+ name: "AssetProviderUpdated",
74
+ type: "event"
75
+ },
76
+ {
77
+ anonymous: false,
78
+ inputs: [
79
+ {
80
+ indexed: false,
81
+ internalType: "uint16",
82
+ name: "chainId",
83
+ type: "uint16"
84
+ },
85
+ {
86
+ indexed: false,
87
+ internalType: "address",
88
+ name: "bridge",
89
+ type: "address"
90
+ }
91
+ ],
92
+ name: "BridgeParamsUpdated",
93
+ type: "event"
94
+ },
95
+ {
96
+ anonymous: false,
97
+ inputs: [
98
+ {
99
+ indexed: false,
100
+ internalType: "bool",
101
+ name: "newValue",
102
+ type: "bool"
103
+ }
104
+ ],
105
+ name: "InvestorSubscriptionUpdated",
106
+ type: "event"
107
+ },
108
+ {
109
+ anonymous: false,
110
+ inputs: [
111
+ {
112
+ indexed: false,
113
+ internalType: "uint256",
114
+ name: "oldValue",
115
+ type: "uint256"
116
+ },
117
+ {
118
+ indexed: false,
119
+ internalType: "uint256",
120
+ name: "newValue",
121
+ type: "uint256"
122
+ }
123
+ ],
124
+ name: "MinSubscriptionAmountUpdated",
125
+ type: "event"
126
+ },
127
+ {
128
+ anonymous: false,
129
+ inputs: [
130
+ {
131
+ indexed: true,
132
+ internalType: "address",
133
+ name: "oldProvider",
134
+ type: "address"
135
+ },
136
+ {
137
+ indexed: true,
138
+ internalType: "address",
139
+ name: "newProvider",
140
+ type: "address"
141
+ }
142
+ ],
143
+ name: "NavProviderUpdated",
144
+ type: "event"
145
+ },
146
+ {
147
+ anonymous: false,
148
+ inputs: [
149
+ {
150
+ indexed: true,
151
+ internalType: "address",
152
+ name: "from",
153
+ type: "address"
154
+ },
155
+ {
156
+ indexed: false,
157
+ internalType: "uint256",
158
+ name: "dsTokenValue",
159
+ type: "uint256"
160
+ },
161
+ {
162
+ indexed: false,
163
+ internalType: "uint256",
164
+ name: "liquidityValue",
165
+ type: "uint256"
166
+ },
167
+ {
168
+ indexed: true,
169
+ internalType: "address",
170
+ name: "newWalletTo",
171
+ type: "address"
172
+ },
173
+ {
174
+ indexed: false,
175
+ internalType: "uint256",
176
+ name: "rate",
177
+ type: "uint256"
178
+ },
179
+ {
180
+ indexed: false,
181
+ internalType: "uint256",
182
+ name: "fee",
183
+ type: "uint256"
184
+ },
185
+ {
186
+ indexed: true,
187
+ internalType: "address",
188
+ name: "liquidityToken",
189
+ type: "address"
190
+ }
191
+ ],
192
+ name: "Swap",
193
+ type: "event"
194
+ },
195
+ {
196
+ anonymous: false,
197
+ inputs: [
198
+ {
199
+ indexed: false,
200
+ internalType: "bool",
201
+ name: "newValue",
202
+ type: "bool"
203
+ }
204
+ ],
205
+ name: "TwoStepTransferUpdated",
206
+ type: "event"
207
+ },
208
+ {
209
+ inputs: [
210
+ {
211
+ internalType: "address",
212
+ name: "_dsToken",
213
+ type: "address"
214
+ },
215
+ {
216
+ internalType: "address",
217
+ name: "_liquidity",
218
+ type: "address"
219
+ },
220
+ {
221
+ internalType: "address",
222
+ name: "_navProvider",
223
+ type: "address"
224
+ },
225
+ {
226
+ internalType: "address",
227
+ name: "_feeManager",
228
+ type: "address"
229
+ },
230
+ {
231
+ internalType: "address",
232
+ name: "_custodianWallet",
233
+ type: "address"
234
+ }
235
+ ],
236
+ name: "initialize",
237
+ outputs: [],
238
+ stateMutability: "nonpayable",
239
+ type: "function"
240
+ },
241
+ {
242
+ inputs: [
243
+ {
244
+ internalType: "bool",
245
+ name: "_investorSubscription",
246
+ type: "bool"
247
+ }
248
+ ],
249
+ name: "toggleInvestorSubscription",
250
+ outputs: [],
251
+ stateMutability: "nonpayable",
252
+ type: "function"
253
+ },
254
+ {
255
+ inputs: [
256
+ {
257
+ internalType: "bool",
258
+ name: "_twoStepTransfer",
259
+ type: "bool"
260
+ }
261
+ ],
262
+ name: "toggleTwoStepTransfer",
263
+ outputs: [],
264
+ stateMutability: "nonpayable",
265
+ type: "function"
266
+ },
267
+ {
268
+ inputs: [
269
+ {
270
+ internalType: "address",
271
+ name: "_assetProvider",
272
+ type: "address"
273
+ }
274
+ ],
275
+ name: "updateAssetProvider",
276
+ outputs: [],
277
+ stateMutability: "nonpayable",
278
+ type: "function"
279
+ },
280
+ {
281
+ inputs: [
282
+ {
283
+ internalType: "uint16",
284
+ name: "_chainId",
285
+ type: "uint16"
286
+ },
287
+ {
288
+ internalType: "address",
289
+ name: "_bridge",
290
+ type: "address"
291
+ }
292
+ ],
293
+ name: "updateBridgeParams",
294
+ outputs: [],
295
+ stateMutability: "nonpayable",
296
+ type: "function"
297
+ },
298
+ {
299
+ inputs: [
300
+ {
301
+ internalType: "uint256",
302
+ name: "_minSubscriptionAmount",
303
+ type: "uint256"
304
+ }
305
+ ],
306
+ name: "updateMinSubscriptionAmount",
307
+ outputs: [],
308
+ stateMutability: "nonpayable",
309
+ type: "function"
310
+ },
311
+ {
312
+ inputs: [
313
+ {
314
+ internalType: "address",
315
+ name: "_navProvider",
316
+ type: "address"
317
+ }
318
+ ],
319
+ name: "updateNavProvider",
320
+ outputs: [],
321
+ stateMutability: "nonpayable",
322
+ type: "function"
323
+ }
324
+ ];
325
+ export {
326
+ iBaseOnRampAbi
327
+ };
@@ -2,11 +2,12 @@ import { decodeAbiParameters } from "viem";
2
2
  import {
3
3
  MissingSerializedParamsError
4
4
  } from "../../../sdk/index.js";
5
+ import { iBaseOnRampAbi } from "../abi/securitize/iBaseOnRamp.js";
5
6
  import { iSecuritizeOnRampAbi } from "../abi/securitize/iSecuritizeOnRamp.js";
6
7
  import { iSecuritizeOnRampAdapterAbi } from "../abi/securitize/iSecuritizeOnRampAdapter.js";
7
8
  import { AbstractAdapterContract } from "./AbstractAdapter.js";
8
9
  const abi = iSecuritizeOnRampAdapterAbi;
9
- const protocolAbi = iSecuritizeOnRampAbi;
10
+ const protocolAbi = [...iSecuritizeOnRampAbi, ...iBaseOnRampAbi];
10
11
  class SecuritizeOnRampAdapterContract extends AbstractAdapterContract {
11
12
  #dsToken;
12
13
  #liquidityToken;