@gearbox-protocol/sdk 14.12.0-next.37 → 14.12.0-next.39

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 (47) hide show
  1. package/dist/cjs/abi/IWithdrawalCompressorV313.js +78 -0
  2. package/dist/cjs/abi/compressors/subcompressors/withdrawal/mellowWithdrawalSubcompressor.js +85 -1
  3. package/dist/cjs/abi/compressors/subcompressors/withdrawal/midasWithdrawalSubcompressor.js +85 -1
  4. package/dist/cjs/abi/compressors/subcompressors/withdrawal/securitizeRedemptionSubcompressor.js +85 -1
  5. package/dist/cjs/abi/compressors/withdrawalCompressor.js +197 -1
  6. package/dist/cjs/abi/helpers/redemptionLogger.js +160 -0
  7. package/dist/cjs/abi/router/midasWorker.js +4 -4
  8. package/dist/cjs/dev/AccountOpener.js +2 -2
  9. package/dist/cjs/plugins/adapters/abi/actionAbi.js +13 -5
  10. package/dist/cjs/plugins/adapters/abi/adapters/iSecuritizeRedemptionGatewayAdapterV311.js +23 -8
  11. package/dist/cjs/plugins/adapters/abi/conctructorAbi.js +2 -1
  12. package/dist/cjs/plugins/adapters/abi/securitize/iMidasGatewayAdapter.js +354 -0
  13. package/dist/cjs/plugins/adapters/abi/securitize/index.js +2 -0
  14. package/dist/cjs/sdk/accounts/withdrawal-compressor/AbstractWithdrawalCompressorContract.js +1 -1
  15. package/dist/cjs/sdk/accounts/withdrawal-compressor/WithdrawalCompressorV313Contract.js +90 -5
  16. package/dist/esm/abi/IWithdrawalCompressorV313.js +78 -0
  17. package/dist/esm/abi/compressors/subcompressors/withdrawal/mellowWithdrawalSubcompressor.js +85 -1
  18. package/dist/esm/abi/compressors/subcompressors/withdrawal/midasWithdrawalSubcompressor.js +85 -1
  19. package/dist/esm/abi/compressors/subcompressors/withdrawal/securitizeRedemptionSubcompressor.js +85 -1
  20. package/dist/esm/abi/compressors/withdrawalCompressor.js +197 -1
  21. package/dist/esm/abi/helpers/redemptionLogger.js +136 -0
  22. package/dist/esm/abi/router/midasWorker.js +4 -4
  23. package/dist/esm/dev/AccountOpener.js +2 -2
  24. package/dist/esm/plugins/adapters/abi/actionAbi.js +13 -5
  25. package/dist/esm/plugins/adapters/abi/adapters/iSecuritizeRedemptionGatewayAdapterV311.js +23 -8
  26. package/dist/esm/plugins/adapters/abi/conctructorAbi.js +2 -1
  27. package/dist/esm/plugins/adapters/abi/securitize/iMidasGatewayAdapter.js +330 -0
  28. package/dist/esm/plugins/adapters/abi/securitize/index.js +1 -0
  29. package/dist/esm/sdk/accounts/withdrawal-compressor/AbstractWithdrawalCompressorContract.js +1 -1
  30. package/dist/esm/sdk/accounts/withdrawal-compressor/WithdrawalCompressorV313Contract.js +90 -5
  31. package/dist/types/abi/IWithdrawalCompressorV313.d.ts +103 -0
  32. package/dist/types/abi/compressors/subcompressors/withdrawal/mellowWithdrawalSubcompressor.d.ts +121 -0
  33. package/dist/types/abi/compressors/subcompressors/withdrawal/midasWithdrawalSubcompressor.d.ts +121 -0
  34. package/dist/types/abi/compressors/subcompressors/withdrawal/securitizeRedemptionSubcompressor.d.ts +121 -0
  35. package/dist/types/abi/compressors/withdrawalCompressor.d.ts +274 -0
  36. package/dist/types/abi/helpers/redemptionLogger.d.ts +167 -0
  37. package/dist/types/abi/router/midasWorker.d.ts +4 -4
  38. package/dist/types/permissionless/bindings/compressors/withdrawal-compressor.d.ts +274 -0
  39. package/dist/types/plugins/adapters/abi/actionAbi.d.ts +1 -1
  40. package/dist/types/plugins/adapters/abi/adapters/iSecuritizeRedemptionGatewayAdapterV311.d.ts +37 -7
  41. package/dist/types/plugins/adapters/abi/securitize/iMidasGatewayAdapter.d.ts +555 -0
  42. package/dist/types/plugins/adapters/abi/securitize/index.d.ts +1 -0
  43. package/dist/types/plugins/adapters/contracts/SecuritizeRedemptionGatewayAdapterContract.d.ts +37 -7
  44. package/dist/types/sdk/accounts/withdrawal-compressor/AbstractWithdrawalCompressorContract.d.ts +1 -1
  45. package/dist/types/sdk/accounts/withdrawal-compressor/WithdrawalCompressorV313Contract.d.ts +104 -1
  46. package/dist/types/sdk/accounts/withdrawal-compressor/types.d.ts +3 -2
  47. package/package.json +1 -1
@@ -26,6 +26,86 @@ var import_AbstractWithdrawalCompressorContract = require("./AbstractWithdrawalC
26
26
  var import_intent_codec = require("./intent-codec.js");
27
27
  var import_types = require("./types.js");
28
28
  const abi = import_IWithdrawalCompressorV313.iWithdrawalCompressorV313Abi;
29
+ const iExternalWithdrawalsBatchAbi = [
30
+ {
31
+ type: "function",
32
+ name: "getExternalAccountCurrentWithdrawals",
33
+ inputs: [
34
+ {
35
+ name: "withdrawalTokens",
36
+ type: "address[]",
37
+ internalType: "address[]"
38
+ },
39
+ { name: "account", type: "address", internalType: "address" }
40
+ ],
41
+ outputs: [
42
+ {
43
+ name: "",
44
+ type: "tuple[]",
45
+ internalType: "struct ClaimableWithdrawal[]",
46
+ components: [
47
+ { name: "token", type: "address", internalType: "address" },
48
+ {
49
+ name: "withdrawalPhantomToken",
50
+ type: "address",
51
+ internalType: "address"
52
+ },
53
+ {
54
+ name: "withdrawalTokenSpent",
55
+ type: "uint256",
56
+ internalType: "uint256"
57
+ },
58
+ {
59
+ name: "outputs",
60
+ type: "tuple[]",
61
+ internalType: "struct WithdrawalOutput[]",
62
+ components: [
63
+ { name: "token", type: "address", internalType: "address" },
64
+ { name: "isDelayed", type: "bool", internalType: "bool" },
65
+ { name: "amount", type: "uint256", internalType: "uint256" }
66
+ ]
67
+ },
68
+ {
69
+ name: "claimCalls",
70
+ type: "tuple[]",
71
+ internalType: "struct MultiCall[]",
72
+ components: [
73
+ { name: "target", type: "address", internalType: "address" },
74
+ { name: "callData", type: "bytes", internalType: "bytes" }
75
+ ]
76
+ },
77
+ { name: "extraData", type: "bytes", internalType: "bytes" }
78
+ ]
79
+ },
80
+ {
81
+ name: "",
82
+ type: "tuple[]",
83
+ internalType: "struct PendingWithdrawal[]",
84
+ components: [
85
+ { name: "token", type: "address", internalType: "address" },
86
+ {
87
+ name: "withdrawalPhantomToken",
88
+ type: "address",
89
+ internalType: "address"
90
+ },
91
+ {
92
+ name: "expectedOutputs",
93
+ type: "tuple[]",
94
+ internalType: "struct WithdrawalOutput[]",
95
+ components: [
96
+ { name: "token", type: "address", internalType: "address" },
97
+ { name: "isDelayed", type: "bool", internalType: "bool" },
98
+ { name: "amount", type: "uint256", internalType: "uint256" }
99
+ ]
100
+ },
101
+ { name: "claimableAt", type: "uint256", internalType: "uint256" },
102
+ { name: "extraData", type: "bytes", internalType: "bytes" }
103
+ ]
104
+ }
105
+ ],
106
+ stateMutability: "view"
107
+ }
108
+ ];
29
109
  const iWithdrawalStatusBatchAbi = [
30
110
  {
31
111
  type: "function",
@@ -51,11 +131,16 @@ class WithdrawalCompressorV313Contract extends import_AbstractWithdrawalCompress
51
131
  /**
52
132
  * {@inheritDoc IWithdrawalCompressorContract.getExternalAccountCurrentWithdrawals}
53
133
  **/
54
- async getExternalAccountCurrentWithdrawals(withdrawalToken, account) {
55
- const [claimable, pending] = await this.contract.read.getExternalAccountCurrentWithdrawals([
56
- withdrawalToken,
57
- account
58
- ]);
134
+ async getExternalAccountCurrentWithdrawals(account, ...withdrawalTokens) {
135
+ if (withdrawalTokens.length === 0) {
136
+ return { claimable: [], pending: [] };
137
+ }
138
+ const [claimable, pending] = await this.client.readContract({
139
+ address: this.address,
140
+ abi: iExternalWithdrawalsBatchAbi,
141
+ functionName: "getExternalAccountCurrentWithdrawals",
142
+ args: [withdrawalTokens, account]
143
+ });
59
144
  return {
60
145
  claimable: claimable.map((w) => (0, import_AbstractWithdrawalCompressorContract.toClaimableWithdrawal)(w, void 0)),
61
146
  pending: pending.map((w) => (0, import_AbstractWithdrawalCompressorContract.toPendingWithdrawal)(w, void 0)).sort((a, b) => a.claimableAt < b.claimableAt ? -1 : 1)
@@ -153,6 +153,84 @@ const iWithdrawalCompressorV313Abi = [
153
153
  ],
154
154
  stateMutability: "view"
155
155
  },
156
+ {
157
+ type: "function",
158
+ name: "getExternalAccountCurrentWithdrawals",
159
+ inputs: [
160
+ {
161
+ name: "withdrawalTokens",
162
+ type: "address[]",
163
+ internalType: "address[]"
164
+ },
165
+ { name: "account", type: "address", internalType: "address" }
166
+ ],
167
+ outputs: [
168
+ {
169
+ name: "",
170
+ type: "tuple[]",
171
+ internalType: "struct ClaimableWithdrawal[]",
172
+ components: [
173
+ { name: "token", type: "address", internalType: "address" },
174
+ {
175
+ name: "withdrawalPhantomToken",
176
+ type: "address",
177
+ internalType: "address"
178
+ },
179
+ {
180
+ name: "withdrawalTokenSpent",
181
+ type: "uint256",
182
+ internalType: "uint256"
183
+ },
184
+ {
185
+ name: "outputs",
186
+ type: "tuple[]",
187
+ internalType: "struct WithdrawalOutput[]",
188
+ components: [
189
+ { name: "token", type: "address", internalType: "address" },
190
+ { name: "isDelayed", type: "bool", internalType: "bool" },
191
+ { name: "amount", type: "uint256", internalType: "uint256" }
192
+ ]
193
+ },
194
+ {
195
+ name: "claimCalls",
196
+ type: "tuple[]",
197
+ internalType: "struct MultiCall[]",
198
+ components: [
199
+ { name: "target", type: "address", internalType: "address" },
200
+ { name: "callData", type: "bytes", internalType: "bytes" }
201
+ ]
202
+ },
203
+ { name: "extraData", type: "bytes", internalType: "bytes" }
204
+ ]
205
+ },
206
+ {
207
+ name: "",
208
+ type: "tuple[]",
209
+ internalType: "struct PendingWithdrawal[]",
210
+ components: [
211
+ { name: "token", type: "address", internalType: "address" },
212
+ {
213
+ name: "withdrawalPhantomToken",
214
+ type: "address",
215
+ internalType: "address"
216
+ },
217
+ {
218
+ name: "expectedOutputs",
219
+ type: "tuple[]",
220
+ internalType: "struct WithdrawalOutput[]",
221
+ components: [
222
+ { name: "token", type: "address", internalType: "address" },
223
+ { name: "isDelayed", type: "bool", internalType: "bool" },
224
+ { name: "amount", type: "uint256", internalType: "uint256" }
225
+ ]
226
+ },
227
+ { name: "claimableAt", type: "uint256", internalType: "uint256" },
228
+ { name: "extraData", type: "bytes", internalType: "bytes" }
229
+ ]
230
+ }
231
+ ],
232
+ stateMutability: "view"
233
+ },
156
234
  {
157
235
  type: "function",
158
236
  name: "getWithdrawalStatus",
@@ -73,12 +73,87 @@ const mellowWithdrawalSubcompressorAbi = [
73
73
  { name: "amount", type: "uint256", internalType: "uint256" }
74
74
  ]
75
75
  },
76
- { name: "claimableAt", type: "uint256", internalType: "uint256" }
76
+ { name: "claimableAt", type: "uint256", internalType: "uint256" },
77
+ { name: "extraData", type: "bytes", internalType: "bytes" }
77
78
  ]
78
79
  }
79
80
  ],
80
81
  stateMutability: "view"
81
82
  },
83
+ {
84
+ type: "function",
85
+ name: "getExternalAccountCurrentWithdrawals",
86
+ inputs: [
87
+ { name: "", type: "address", internalType: "address" },
88
+ { name: "", type: "address", internalType: "address" }
89
+ ],
90
+ outputs: [
91
+ {
92
+ name: "claimableWithdrawals",
93
+ type: "tuple[]",
94
+ internalType: "struct ClaimableWithdrawal[]",
95
+ components: [
96
+ { name: "token", type: "address", internalType: "address" },
97
+ {
98
+ name: "withdrawalPhantomToken",
99
+ type: "address",
100
+ internalType: "address"
101
+ },
102
+ {
103
+ name: "withdrawalTokenSpent",
104
+ type: "uint256",
105
+ internalType: "uint256"
106
+ },
107
+ {
108
+ name: "outputs",
109
+ type: "tuple[]",
110
+ internalType: "struct WithdrawalOutput[]",
111
+ components: [
112
+ { name: "token", type: "address", internalType: "address" },
113
+ { name: "isDelayed", type: "bool", internalType: "bool" },
114
+ { name: "amount", type: "uint256", internalType: "uint256" }
115
+ ]
116
+ },
117
+ {
118
+ name: "claimCalls",
119
+ type: "tuple[]",
120
+ internalType: "struct MultiCall[]",
121
+ components: [
122
+ { name: "target", type: "address", internalType: "address" },
123
+ { name: "callData", type: "bytes", internalType: "bytes" }
124
+ ]
125
+ },
126
+ { name: "extraData", type: "bytes", internalType: "bytes" }
127
+ ]
128
+ },
129
+ {
130
+ name: "pendingWithdrawals",
131
+ type: "tuple[]",
132
+ internalType: "struct PendingWithdrawal[]",
133
+ components: [
134
+ { name: "token", type: "address", internalType: "address" },
135
+ {
136
+ name: "withdrawalPhantomToken",
137
+ type: "address",
138
+ internalType: "address"
139
+ },
140
+ {
141
+ name: "expectedOutputs",
142
+ type: "tuple[]",
143
+ internalType: "struct WithdrawalOutput[]",
144
+ components: [
145
+ { name: "token", type: "address", internalType: "address" },
146
+ { name: "isDelayed", type: "bool", internalType: "bool" },
147
+ { name: "amount", type: "uint256", internalType: "uint256" }
148
+ ]
149
+ },
150
+ { name: "claimableAt", type: "uint256", internalType: "uint256" },
151
+ { name: "extraData", type: "bytes", internalType: "bytes" }
152
+ ]
153
+ }
154
+ ],
155
+ stateMutability: "pure"
156
+ },
82
157
  {
83
158
  type: "function",
84
159
  name: "getWithdrawableAssets",
@@ -195,6 +270,15 @@ const mellowWithdrawalSubcompressorAbi = [
195
270
  ],
196
271
  stateMutability: "view"
197
272
  },
273
+ {
274
+ type: "function",
275
+ name: "getWithdrawalStatus",
276
+ inputs: [{ name: "", type: "address", internalType: "address" }],
277
+ outputs: [
278
+ { name: "", type: "uint8", internalType: "enum WithdrawalStatus" }
279
+ ],
280
+ stateMutability: "pure"
281
+ },
198
282
  {
199
283
  type: "function",
200
284
  name: "version",
@@ -73,7 +73,82 @@ const midasWithdrawalSubcompressorAbi = [
73
73
  { name: "amount", type: "uint256", internalType: "uint256" }
74
74
  ]
75
75
  },
76
- { name: "claimableAt", type: "uint256", internalType: "uint256" }
76
+ { name: "claimableAt", type: "uint256", internalType: "uint256" },
77
+ { name: "extraData", type: "bytes", internalType: "bytes" }
78
+ ]
79
+ }
80
+ ],
81
+ stateMutability: "view"
82
+ },
83
+ {
84
+ type: "function",
85
+ name: "getExternalAccountCurrentWithdrawals",
86
+ inputs: [
87
+ { name: "account", type: "address", internalType: "address" },
88
+ { name: "token", type: "address", internalType: "address" }
89
+ ],
90
+ outputs: [
91
+ {
92
+ name: "",
93
+ type: "tuple[]",
94
+ internalType: "struct ClaimableWithdrawal[]",
95
+ components: [
96
+ { name: "token", type: "address", internalType: "address" },
97
+ {
98
+ name: "withdrawalPhantomToken",
99
+ type: "address",
100
+ internalType: "address"
101
+ },
102
+ {
103
+ name: "withdrawalTokenSpent",
104
+ type: "uint256",
105
+ internalType: "uint256"
106
+ },
107
+ {
108
+ name: "outputs",
109
+ type: "tuple[]",
110
+ internalType: "struct WithdrawalOutput[]",
111
+ components: [
112
+ { name: "token", type: "address", internalType: "address" },
113
+ { name: "isDelayed", type: "bool", internalType: "bool" },
114
+ { name: "amount", type: "uint256", internalType: "uint256" }
115
+ ]
116
+ },
117
+ {
118
+ name: "claimCalls",
119
+ type: "tuple[]",
120
+ internalType: "struct MultiCall[]",
121
+ components: [
122
+ { name: "target", type: "address", internalType: "address" },
123
+ { name: "callData", type: "bytes", internalType: "bytes" }
124
+ ]
125
+ },
126
+ { name: "extraData", type: "bytes", internalType: "bytes" }
127
+ ]
128
+ },
129
+ {
130
+ name: "",
131
+ type: "tuple[]",
132
+ internalType: "struct PendingWithdrawal[]",
133
+ components: [
134
+ { name: "token", type: "address", internalType: "address" },
135
+ {
136
+ name: "withdrawalPhantomToken",
137
+ type: "address",
138
+ internalType: "address"
139
+ },
140
+ {
141
+ name: "expectedOutputs",
142
+ type: "tuple[]",
143
+ internalType: "struct WithdrawalOutput[]",
144
+ components: [
145
+ { name: "token", type: "address", internalType: "address" },
146
+ { name: "isDelayed", type: "bool", internalType: "bool" },
147
+ { name: "amount", type: "uint256", internalType: "uint256" }
148
+ ]
149
+ },
150
+ { name: "claimableAt", type: "uint256", internalType: "uint256" },
151
+ { name: "extraData", type: "bytes", internalType: "bytes" }
77
152
  ]
78
153
  }
79
154
  ],
@@ -195,6 +270,15 @@ const midasWithdrawalSubcompressorAbi = [
195
270
  ],
196
271
  stateMutability: "view"
197
272
  },
273
+ {
274
+ type: "function",
275
+ name: "getWithdrawalStatus",
276
+ inputs: [{ name: "redeemer", type: "address", internalType: "address" }],
277
+ outputs: [
278
+ { name: "", type: "uint8", internalType: "enum WithdrawalStatus" }
279
+ ],
280
+ stateMutability: "view"
281
+ },
198
282
  {
199
283
  type: "function",
200
284
  name: "version",
@@ -73,7 +73,82 @@ const securitizeRedemptionSubcompressorAbi = [
73
73
  { name: "amount", type: "uint256", internalType: "uint256" }
74
74
  ]
75
75
  },
76
- { name: "claimableAt", type: "uint256", internalType: "uint256" }
76
+ { name: "claimableAt", type: "uint256", internalType: "uint256" },
77
+ { name: "extraData", type: "bytes", internalType: "bytes" }
78
+ ]
79
+ }
80
+ ],
81
+ stateMutability: "view"
82
+ },
83
+ {
84
+ type: "function",
85
+ name: "getExternalAccountCurrentWithdrawals",
86
+ inputs: [
87
+ { name: "account", type: "address", internalType: "address" },
88
+ { name: "token", type: "address", internalType: "address" }
89
+ ],
90
+ outputs: [
91
+ {
92
+ name: "",
93
+ type: "tuple[]",
94
+ internalType: "struct ClaimableWithdrawal[]",
95
+ components: [
96
+ { name: "token", type: "address", internalType: "address" },
97
+ {
98
+ name: "withdrawalPhantomToken",
99
+ type: "address",
100
+ internalType: "address"
101
+ },
102
+ {
103
+ name: "withdrawalTokenSpent",
104
+ type: "uint256",
105
+ internalType: "uint256"
106
+ },
107
+ {
108
+ name: "outputs",
109
+ type: "tuple[]",
110
+ internalType: "struct WithdrawalOutput[]",
111
+ components: [
112
+ { name: "token", type: "address", internalType: "address" },
113
+ { name: "isDelayed", type: "bool", internalType: "bool" },
114
+ { name: "amount", type: "uint256", internalType: "uint256" }
115
+ ]
116
+ },
117
+ {
118
+ name: "claimCalls",
119
+ type: "tuple[]",
120
+ internalType: "struct MultiCall[]",
121
+ components: [
122
+ { name: "target", type: "address", internalType: "address" },
123
+ { name: "callData", type: "bytes", internalType: "bytes" }
124
+ ]
125
+ },
126
+ { name: "extraData", type: "bytes", internalType: "bytes" }
127
+ ]
128
+ },
129
+ {
130
+ name: "",
131
+ type: "tuple[]",
132
+ internalType: "struct PendingWithdrawal[]",
133
+ components: [
134
+ { name: "token", type: "address", internalType: "address" },
135
+ {
136
+ name: "withdrawalPhantomToken",
137
+ type: "address",
138
+ internalType: "address"
139
+ },
140
+ {
141
+ name: "expectedOutputs",
142
+ type: "tuple[]",
143
+ internalType: "struct WithdrawalOutput[]",
144
+ components: [
145
+ { name: "token", type: "address", internalType: "address" },
146
+ { name: "isDelayed", type: "bool", internalType: "bool" },
147
+ { name: "amount", type: "uint256", internalType: "uint256" }
148
+ ]
149
+ },
150
+ { name: "claimableAt", type: "uint256", internalType: "uint256" },
151
+ { name: "extraData", type: "bytes", internalType: "bytes" }
77
152
  ]
78
153
  }
79
154
  ],
@@ -195,6 +270,15 @@ const securitizeRedemptionSubcompressorAbi = [
195
270
  ],
196
271
  stateMutability: "view"
197
272
  },
273
+ {
274
+ type: "function",
275
+ name: "getWithdrawalStatus",
276
+ inputs: [{ name: "redeemer", type: "address", internalType: "address" }],
277
+ outputs: [
278
+ { name: "", type: "uint8", internalType: "enum WithdrawalStatus" }
279
+ ],
280
+ stateMutability: "view"
281
+ },
198
282
  {
199
283
  type: "function",
200
284
  name: "version",