@gearbox-protocol/sdk 14.4.2 → 14.5.0

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 (27) hide show
  1. package/dist/cjs/abi/compressors/subcompressors/securitizeRedemptionSubcompressor.js +187 -0
  2. package/dist/cjs/abi/router/securitizeOnrampWorker.js +541 -0
  3. package/dist/cjs/plugins/adapters/abi/conctructorAbi.js +9 -0
  4. package/dist/cjs/plugins/adapters/contracts/SecuritizeOnRampAdapterContract.js +68 -0
  5. package/dist/cjs/plugins/adapters/contracts/SecuritizeRedemptionGatewayAdapterContract.js +77 -0
  6. package/dist/cjs/plugins/adapters/contracts/SecuritizeSwapAdapterContract.js +68 -0
  7. package/dist/cjs/plugins/adapters/createAdapter.js +9 -0
  8. package/dist/cjs/plugins/adapters/types.js +3 -0
  9. package/dist/cjs/sdk/accounts/CreditAccountsServiceV310.js +14 -0
  10. package/dist/esm/abi/compressors/subcompressors/securitizeRedemptionSubcompressor.js +163 -0
  11. package/dist/esm/abi/router/securitizeOnrampWorker.js +517 -0
  12. package/dist/esm/plugins/adapters/abi/conctructorAbi.js +9 -0
  13. package/dist/esm/plugins/adapters/contracts/SecuritizeOnRampAdapterContract.js +46 -0
  14. package/dist/esm/plugins/adapters/contracts/SecuritizeRedemptionGatewayAdapterContract.js +55 -0
  15. package/dist/esm/plugins/adapters/contracts/SecuritizeSwapAdapterContract.js +46 -0
  16. package/dist/esm/plugins/adapters/createAdapter.js +9 -0
  17. package/dist/esm/plugins/adapters/types.js +3 -0
  18. package/dist/esm/sdk/accounts/CreditAccountsServiceV310.js +14 -0
  19. package/dist/types/abi/compressors/subcompressors/securitizeRedemptionSubcompressor.d.ts +220 -0
  20. package/dist/types/abi/router/securitizeOnrampWorker.d.ts +726 -0
  21. package/dist/types/plugins/adapters/contracts/SecuritizeOnRampAdapterContract.d.ts +24 -0
  22. package/dist/types/plugins/adapters/contracts/SecuritizeRedemptionGatewayAdapterContract.d.ts +26 -0
  23. package/dist/types/plugins/adapters/contracts/SecuritizeSwapAdapterContract.d.ts +24 -0
  24. package/dist/types/plugins/adapters/types.d.ts +4 -1
  25. package/dist/types/sdk/accounts/CreditAccountsServiceV310.d.ts +5 -1
  26. package/dist/types/sdk/accounts/types.d.ts +28 -3
  27. package/package.json +1 -1
@@ -40,6 +40,9 @@ import {
40
40
  VelodromeV2RouterAdapterContract,
41
41
  WstETHV1AdapterContract
42
42
  } from "./contracts/index.js";
43
+ import { SecuritizeOnRampAdapterContract } from "./contracts/SecuritizeOnRampAdapterContract.js";
44
+ import { SecuritizeRedemptionGatewayAdapterContract } from "./contracts/SecuritizeRedemptionGatewayAdapterContract.js";
45
+ import { SecuritizeSwapAdapterContract } from "./contracts/SecuritizeSwapAdapterContract.js";
43
46
  import { UniswapV4AdapterContract } from "./contracts/UniswapV4AdapterContract.js";
44
47
  function createAdapter(options, data, strict) {
45
48
  const contractType = data.baseParams.contractType;
@@ -107,6 +110,12 @@ function createAdapter(options, data, strict) {
107
110
  return new MidasRedemptionVaultAdapterContract(options, data);
108
111
  case "ADAPTER::PENDLE_ROUTER":
109
112
  return new PendleRouterAdapterContract(options, data);
113
+ case "ADAPTER::SECURITIZE_ONRAMP":
114
+ return new SecuritizeOnRampAdapterContract(options, data);
115
+ case "ADAPTER::SECURITIZE_REDEMPTION":
116
+ return new SecuritizeRedemptionGatewayAdapterContract(options, data);
117
+ case "ADAPTER::SECURITIZE_SWAP":
118
+ return new SecuritizeSwapAdapterContract(options, data);
110
119
  case "ADAPTER::STAKING_REWARDS":
111
120
  return new StakingRewardsAdapterContract(options, data);
112
121
  case "ADAPTER::TRADER_JOE_ROUTER":
@@ -35,6 +35,9 @@ var AdapterType = /* @__PURE__ */ ((AdapterType2) => {
35
35
  AdapterType2["MIDAS_ISSUANCE_VAULT"] = "MIDAS_ISSUANCE_VAULT";
36
36
  AdapterType2["MIDAS_REDEMPTION_VAULT"] = "MIDAS_REDEMPTION_VAULT";
37
37
  AdapterType2["PENDLE_ROUTER"] = "PENDLE_ROUTER";
38
+ AdapterType2["SECURITIZE_ONRAMP"] = "SECURITIZE_ONRAMP";
39
+ AdapterType2["SECURITIZE_REDEMPTION"] = "SECURITIZE_REDEMPTION";
40
+ AdapterType2["SECURITIZE_SWAP"] = "SECURITIZE_SWAP";
38
41
  AdapterType2["STAKING_REWARDS"] = "STAKING_REWARDS";
39
42
  AdapterType2["TRADER_JOE_ROUTER"] = "TRADER_JOE_ROUTER";
40
43
  AdapterType2["UNISWAP_V2_ROUTER"] = "UNISWAP_V2_ROUTER";
@@ -448,6 +448,20 @@ class CreditAccountsServiceV310 extends SDKConstruct {
448
448
  creditFacade: cm.creditFacade
449
449
  };
450
450
  }
451
+ /**
452
+ * {@inheritDoc ICreditAccountsService.defaultPartialLiquidationParams}
453
+ */
454
+ defaultPartialLiquidationParams(ca) {
455
+ const tokenOut = this.#getBestTokenOut(ca);
456
+ const optimalHF = this.getOptimalHFForPartialLiquidation(ca);
457
+ const repaidAmount = this.#calcOptimalRepaidAmount(ca, tokenOut, optimalHF);
458
+ const minSeizedAmount = this.#calcMinSeizedAmount(
459
+ ca,
460
+ tokenOut,
461
+ repaidAmount
462
+ );
463
+ return { tokenOut, optimalHF, repaidAmount, minSeizedAmount };
464
+ }
451
465
  /**
452
466
  * {@inheritDoc ICreditAccountsService.partiallyLiquidate}
453
467
  */
@@ -0,0 +1,220 @@
1
+ export declare const securitizeRedemptionSubcompressorAbi: readonly [{
2
+ readonly type: "function";
3
+ readonly name: "contractType";
4
+ readonly inputs: readonly [];
5
+ readonly outputs: readonly [{
6
+ readonly name: "";
7
+ readonly type: "bytes32";
8
+ readonly internalType: "bytes32";
9
+ }];
10
+ readonly stateMutability: "view";
11
+ }, {
12
+ readonly type: "function";
13
+ readonly name: "getCurrentWithdrawals";
14
+ readonly inputs: readonly [{
15
+ readonly name: "creditAccount";
16
+ readonly type: "address";
17
+ readonly internalType: "address";
18
+ }, {
19
+ readonly name: "token";
20
+ readonly type: "address";
21
+ readonly internalType: "address";
22
+ }];
23
+ readonly outputs: readonly [{
24
+ readonly name: "";
25
+ readonly type: "tuple[]";
26
+ readonly internalType: "struct ClaimableWithdrawal[]";
27
+ readonly components: readonly [{
28
+ readonly name: "token";
29
+ readonly type: "address";
30
+ readonly internalType: "address";
31
+ }, {
32
+ readonly name: "withdrawalPhantomToken";
33
+ readonly type: "address";
34
+ readonly internalType: "address";
35
+ }, {
36
+ readonly name: "withdrawalTokenSpent";
37
+ readonly type: "uint256";
38
+ readonly internalType: "uint256";
39
+ }, {
40
+ readonly name: "outputs";
41
+ readonly type: "tuple[]";
42
+ readonly internalType: "struct WithdrawalOutput[]";
43
+ readonly components: readonly [{
44
+ readonly name: "token";
45
+ readonly type: "address";
46
+ readonly internalType: "address";
47
+ }, {
48
+ readonly name: "isDelayed";
49
+ readonly type: "bool";
50
+ readonly internalType: "bool";
51
+ }, {
52
+ readonly name: "amount";
53
+ readonly type: "uint256";
54
+ readonly internalType: "uint256";
55
+ }];
56
+ }, {
57
+ readonly name: "claimCalls";
58
+ readonly type: "tuple[]";
59
+ readonly internalType: "struct MultiCall[]";
60
+ readonly components: readonly [{
61
+ readonly name: "target";
62
+ readonly type: "address";
63
+ readonly internalType: "address";
64
+ }, {
65
+ readonly name: "callData";
66
+ readonly type: "bytes";
67
+ readonly internalType: "bytes";
68
+ }];
69
+ }];
70
+ }, {
71
+ readonly name: "";
72
+ readonly type: "tuple[]";
73
+ readonly internalType: "struct PendingWithdrawal[]";
74
+ readonly components: readonly [{
75
+ readonly name: "token";
76
+ readonly type: "address";
77
+ readonly internalType: "address";
78
+ }, {
79
+ readonly name: "withdrawalPhantomToken";
80
+ readonly type: "address";
81
+ readonly internalType: "address";
82
+ }, {
83
+ readonly name: "expectedOutputs";
84
+ readonly type: "tuple[]";
85
+ readonly internalType: "struct WithdrawalOutput[]";
86
+ readonly components: readonly [{
87
+ readonly name: "token";
88
+ readonly type: "address";
89
+ readonly internalType: "address";
90
+ }, {
91
+ readonly name: "isDelayed";
92
+ readonly type: "bool";
93
+ readonly internalType: "bool";
94
+ }, {
95
+ readonly name: "amount";
96
+ readonly type: "uint256";
97
+ readonly internalType: "uint256";
98
+ }];
99
+ }, {
100
+ readonly name: "claimableAt";
101
+ readonly type: "uint256";
102
+ readonly internalType: "uint256";
103
+ }];
104
+ }];
105
+ readonly stateMutability: "view";
106
+ }, {
107
+ readonly type: "function";
108
+ readonly name: "getWithdrawableAssets";
109
+ readonly inputs: readonly [{
110
+ readonly name: "";
111
+ readonly type: "address";
112
+ readonly internalType: "address";
113
+ }, {
114
+ readonly name: "token";
115
+ readonly type: "address";
116
+ readonly internalType: "address";
117
+ }];
118
+ readonly outputs: readonly [{
119
+ readonly name: "";
120
+ readonly type: "tuple[]";
121
+ readonly internalType: "struct WithdrawableAsset[]";
122
+ readonly components: readonly [{
123
+ readonly name: "token";
124
+ readonly type: "address";
125
+ readonly internalType: "address";
126
+ }, {
127
+ readonly name: "withdrawalPhantomToken";
128
+ readonly type: "address";
129
+ readonly internalType: "address";
130
+ }, {
131
+ readonly name: "underlying";
132
+ readonly type: "address";
133
+ readonly internalType: "address";
134
+ }, {
135
+ readonly name: "withdrawalLength";
136
+ readonly type: "uint256";
137
+ readonly internalType: "uint256";
138
+ }];
139
+ }];
140
+ readonly stateMutability: "view";
141
+ }, {
142
+ readonly type: "function";
143
+ readonly name: "getWithdrawalRequestResult";
144
+ readonly inputs: readonly [{
145
+ readonly name: "creditAccount";
146
+ readonly type: "address";
147
+ readonly internalType: "address";
148
+ }, {
149
+ readonly name: "token";
150
+ readonly type: "address";
151
+ readonly internalType: "address";
152
+ }, {
153
+ readonly name: "withdrawalToken";
154
+ readonly type: "address";
155
+ readonly internalType: "address";
156
+ }, {
157
+ readonly name: "amount";
158
+ readonly type: "uint256";
159
+ readonly internalType: "uint256";
160
+ }];
161
+ readonly outputs: readonly [{
162
+ readonly name: "requestableWithdrawal";
163
+ readonly type: "tuple";
164
+ readonly internalType: "struct RequestableWithdrawal";
165
+ readonly components: readonly [{
166
+ readonly name: "token";
167
+ readonly type: "address";
168
+ readonly internalType: "address";
169
+ }, {
170
+ readonly name: "amountIn";
171
+ readonly type: "uint256";
172
+ readonly internalType: "uint256";
173
+ }, {
174
+ readonly name: "outputs";
175
+ readonly type: "tuple[]";
176
+ readonly internalType: "struct WithdrawalOutput[]";
177
+ readonly components: readonly [{
178
+ readonly name: "token";
179
+ readonly type: "address";
180
+ readonly internalType: "address";
181
+ }, {
182
+ readonly name: "isDelayed";
183
+ readonly type: "bool";
184
+ readonly internalType: "bool";
185
+ }, {
186
+ readonly name: "amount";
187
+ readonly type: "uint256";
188
+ readonly internalType: "uint256";
189
+ }];
190
+ }, {
191
+ readonly name: "requestCalls";
192
+ readonly type: "tuple[]";
193
+ readonly internalType: "struct MultiCall[]";
194
+ readonly components: readonly [{
195
+ readonly name: "target";
196
+ readonly type: "address";
197
+ readonly internalType: "address";
198
+ }, {
199
+ readonly name: "callData";
200
+ readonly type: "bytes";
201
+ readonly internalType: "bytes";
202
+ }];
203
+ }, {
204
+ readonly name: "claimableAt";
205
+ readonly type: "uint256";
206
+ readonly internalType: "uint256";
207
+ }];
208
+ }];
209
+ readonly stateMutability: "view";
210
+ }, {
211
+ readonly type: "function";
212
+ readonly name: "version";
213
+ readonly inputs: readonly [];
214
+ readonly outputs: readonly [{
215
+ readonly name: "";
216
+ readonly type: "uint256";
217
+ readonly internalType: "uint256";
218
+ }];
219
+ readonly stateMutability: "view";
220
+ }];