@gearbox-protocol/sdk 14.12.0-test.1 → 14.12.0-test.3

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 (48) hide show
  1. package/dist/cjs/abi/compressors/subcompressors/withdrawal/mellowWithdrawalSubcompressor.js +85 -1
  2. package/dist/cjs/abi/compressors/subcompressors/withdrawal/midasWithdrawalSubcompressor.js +85 -1
  3. package/dist/cjs/abi/compressors/subcompressors/withdrawal/securitizeRedemptionSubcompressor.js +85 -1
  4. package/dist/cjs/abi/compressors/withdrawalCompressor.js +197 -1
  5. package/dist/cjs/abi/helpers/redemptionLogger.js +160 -0
  6. package/dist/cjs/abi/router/midasWorker.js +4 -4
  7. package/dist/cjs/dev/AccountOpener.js +2 -2
  8. package/dist/cjs/plugins/adapters/abi/actionAbi.js +13 -5
  9. package/dist/cjs/plugins/adapters/abi/adapters/iSecuritizeRedemptionGatewayAdapterV311.js +23 -8
  10. package/dist/cjs/plugins/adapters/abi/conctructorAbi.js +2 -1
  11. package/dist/cjs/preview/preview/buildDelayedPreview.js +38 -16
  12. package/dist/cjs/sdk/accounts/liquidations/LiquidationsService.js +21 -0
  13. package/dist/cjs/sdk/accounts/liquidations/MultichainLiquidationsService.js +26 -0
  14. package/dist/cjs/sdk/accounts/liquidations/helpers.js +29 -2
  15. package/dist/cjs/sdk/accounts/withdrawal-compressor/intent-codec.js +4 -6
  16. package/dist/esm/abi/compressors/subcompressors/withdrawal/mellowWithdrawalSubcompressor.js +85 -1
  17. package/dist/esm/abi/compressors/subcompressors/withdrawal/midasWithdrawalSubcompressor.js +85 -1
  18. package/dist/esm/abi/compressors/subcompressors/withdrawal/securitizeRedemptionSubcompressor.js +85 -1
  19. package/dist/esm/abi/compressors/withdrawalCompressor.js +197 -1
  20. package/dist/esm/abi/helpers/redemptionLogger.js +136 -0
  21. package/dist/esm/abi/router/midasWorker.js +4 -4
  22. package/dist/esm/dev/AccountOpener.js +2 -2
  23. package/dist/esm/plugins/adapters/abi/actionAbi.js +13 -5
  24. package/dist/esm/plugins/adapters/abi/adapters/iSecuritizeRedemptionGatewayAdapterV311.js +23 -8
  25. package/dist/esm/plugins/adapters/abi/conctructorAbi.js +2 -1
  26. package/dist/esm/preview/preview/buildDelayedPreview.js +41 -17
  27. package/dist/esm/sdk/accounts/liquidations/LiquidationsService.js +23 -1
  28. package/dist/esm/sdk/accounts/liquidations/MultichainLiquidationsService.js +26 -0
  29. package/dist/esm/sdk/accounts/liquidations/helpers.js +27 -1
  30. package/dist/esm/sdk/accounts/withdrawal-compressor/intent-codec.js +4 -6
  31. package/dist/types/abi/compressors/subcompressors/withdrawal/mellowWithdrawalSubcompressor.d.ts +121 -0
  32. package/dist/types/abi/compressors/subcompressors/withdrawal/midasWithdrawalSubcompressor.d.ts +121 -0
  33. package/dist/types/abi/compressors/subcompressors/withdrawal/securitizeRedemptionSubcompressor.d.ts +121 -0
  34. package/dist/types/abi/compressors/withdrawalCompressor.d.ts +274 -0
  35. package/dist/types/abi/helpers/redemptionLogger.d.ts +167 -0
  36. package/dist/types/abi/router/midasWorker.d.ts +4 -4
  37. package/dist/types/permissionless/bindings/compressors/withdrawal-compressor.d.ts +274 -0
  38. package/dist/types/plugins/adapters/abi/actionAbi.d.ts +1 -1
  39. package/dist/types/plugins/adapters/abi/adapters/iSecuritizeRedemptionGatewayAdapterV311.d.ts +37 -7
  40. package/dist/types/plugins/adapters/contracts/SecuritizeRedemptionGatewayAdapterContract.d.ts +37 -7
  41. package/dist/types/preview/preview/buildDelayedPreview.d.ts +8 -26
  42. package/dist/types/sdk/accounts/liquidations/LiquidationsService.d.ts +5 -1
  43. package/dist/types/sdk/accounts/liquidations/MultichainLiquidationsService.d.ts +5 -1
  44. package/dist/types/sdk/accounts/liquidations/helpers.d.ts +12 -0
  45. package/dist/types/sdk/accounts/liquidations/types.d.ts +55 -0
  46. package/dist/types/sdk/accounts/withdrawal-compressor/intent-codec.d.ts +1 -1
  47. package/dist/types/sdk/accounts/withdrawal-compressor/types.d.ts +4 -9
  48. package/package.json +1 -1
@@ -423,7 +423,7 @@ const midasWorkerAbi = [
423
423
  name: "trimSpecialVertex",
424
424
  inputs: [
425
425
  {
426
- name: "edge",
426
+ name: "",
427
427
  type: "tuple",
428
428
  internalType: "struct Edge",
429
429
  components: [
@@ -444,7 +444,7 @@ const midasWorkerAbi = [
444
444
  ]
445
445
  },
446
446
  {
447
- name: "graph",
447
+ name: "",
448
448
  type: "tuple",
449
449
  internalType: "struct Graph",
450
450
  components: [
@@ -503,10 +503,10 @@ const midasWorkerAbi = [
503
503
  }
504
504
  ]
505
505
  },
506
- { name: "targetToken", type: "address", internalType: "address" }
506
+ { name: "", type: "address", internalType: "address" }
507
507
  ],
508
508
  outputs: [{ name: "", type: "bool", internalType: "bool" }],
509
- stateMutability: "view"
509
+ stateMutability: "pure"
510
510
  },
511
511
  {
512
512
  type: "function",
@@ -496,10 +496,10 @@ class AccountOpener extends import_sdk.SDKConstruct {
496
496
  );
497
497
  txHash = await this.#anvil.writeContract({
498
498
  account: depositor,
499
- address: metadata.approveTarget,
499
+ address: underlying,
500
500
  abi: import_iERC20.ierc20Abi,
501
501
  functionName: "approve",
502
- args: [address, allowance],
502
+ args: [metadata.approveTarget, allowance],
503
503
  chain: this.#anvil.chain
504
504
  });
505
505
  let receipt = await this.#anvil.waitForTransactionReceipt({
@@ -87,7 +87,7 @@ const adapterActionAbi = Object.fromEntries(
87
87
  Object.fromEntries(
88
88
  Object.entries(versionedSignature).map(([version, signature]) => [
89
89
  version,
90
- (0, import_viem.parseAbi)([signature])
90
+ (0, import_viem.parseAbi)(Array.isArray(signature) ? signature : [signature])
91
91
  ])
92
92
  )
93
93
  ]
@@ -95,10 +95,18 @@ const adapterActionAbi = Object.fromEntries(
95
95
  );
96
96
  const adapterActionSelectors = Object.fromEntries(
97
97
  Object.entries(adapterActionSignatures).flatMap(
98
- ([adapterType, versionedSignature]) => Object.entries(versionedSignature).map(([version, signature]) => [
99
- (0, import_viem.toFunctionSelector)(signature),
100
- { version: +version, signature, adapterType }
101
- ])
98
+ ([adapterType, versionedSignature]) => Object.entries(versionedSignature).map(([version, signature]) => {
99
+ if (Array.isArray(signature)) {
100
+ return signature.map((s) => [
101
+ (0, import_viem.toFunctionSelector)(s),
102
+ { version: +version, signature: s, adapterType }
103
+ ]);
104
+ }
105
+ return [
106
+ (0, import_viem.toFunctionSelector)(signature),
107
+ { version: +version, signature, adapterType }
108
+ ];
109
+ })
102
110
  )
103
111
  );
104
112
  // Annotate the CommonJS export names for ESM import in node:
@@ -22,6 +22,13 @@ __export(iSecuritizeRedemptionGatewayAdapterV311_exports, {
22
22
  });
23
23
  module.exports = __toCommonJS(iSecuritizeRedemptionGatewayAdapterV311_exports);
24
24
  const iSecuritizeRedemptionGatewayAdapterV311Abi = [
25
+ {
26
+ type: "function",
27
+ name: "acl",
28
+ inputs: [],
29
+ outputs: [{ name: "", type: "address", internalType: "address" }],
30
+ stateMutability: "view"
31
+ },
25
32
  {
26
33
  type: "function",
27
34
  name: "claim",
@@ -49,11 +56,11 @@ const iSecuritizeRedemptionGatewayAdapterV311Abi = [
49
56
  type: "function",
50
57
  name: "depositPhantomToken",
51
58
  inputs: [
52
- { name: "token", type: "address", internalType: "address" },
53
- { name: "amount", type: "uint256", internalType: "uint256" }
59
+ { name: "", type: "address", internalType: "address" },
60
+ { name: "", type: "uint256", internalType: "uint256" }
54
61
  ],
55
62
  outputs: [{ name: "", type: "bool", internalType: "bool" }],
56
- stateMutability: "nonpayable"
63
+ stateMutability: "view"
57
64
  },
58
65
  {
59
66
  type: "function",
@@ -149,14 +156,22 @@ const iSecuritizeRedemptionGatewayAdapterV311Abi = [
149
156
  type: "function",
150
157
  name: "withdrawPhantomToken",
151
158
  inputs: [
152
- { name: "token", type: "address", internalType: "address" },
153
- { name: "amount", type: "uint256", internalType: "uint256" }
159
+ { name: "", type: "address", internalType: "address" },
160
+ { name: "", type: "uint256", internalType: "uint256" }
154
161
  ],
155
- outputs: [{ name: "useSafePrices", type: "bool", internalType: "bool" }],
156
- stateMutability: "nonpayable"
162
+ outputs: [{ name: "", type: "bool", internalType: "bool" }],
163
+ stateMutability: "view"
164
+ },
165
+ {
166
+ type: "error",
167
+ name: "AddressIsNotContractException",
168
+ inputs: [{ name: "", type: "address", internalType: "address" }]
157
169
  },
170
+ { type: "error", name: "CallerNotCreditFacadeException", inputs: [] },
158
171
  { type: "error", name: "IncorrectStakedPhantomTokenException", inputs: [] },
159
- { type: "error", name: "InvalidRedemptionGatewayException", inputs: [] }
172
+ { type: "error", name: "InvalidRedemptionGatewayException", inputs: [] },
173
+ { type: "error", name: "NotImplementedException", inputs: [] },
174
+ { type: "error", name: "ZeroAddressException", inputs: [] }
160
175
  ];
161
176
  // Annotate the CommonJS export names for ESM import in node:
162
177
  0 && (module.exports = {
@@ -144,7 +144,8 @@ const adapterConstructorAbi = {
144
144
  310: import_conctructorAbiPatterns.PHANTOM_TOKEN_ADAPTER_ABI
145
145
  },
146
146
  [import_types.AdapterType.SECURITIZE_REDEMPTION]: {
147
- 310: import_conctructorAbiPatterns.PHANTOM_TOKEN_ADAPTER_ABI
147
+ 310: import_conctructorAbiPatterns.PHANTOM_TOKEN_ADAPTER_ABI,
148
+ 311: import_conctructorAbiPatterns.PHANTOM_TOKEN_ADAPTER_ABI
148
149
  },
149
150
  // other patterns
150
151
  [import_types.AdapterType.STAKING_REWARDS]: {
@@ -38,23 +38,12 @@ function buildDelayedPreview(afterInstant, before, detected, convert, receivedTo
38
38
  repayFromClaim(post, request.claimToken, converter.convert, claimed);
39
39
  break;
40
40
  case "WITHDRAW_COLLATERAL": {
41
- const withdrawn = import_common_utils.BigIntMath.min(
42
- intent.withdrawAmount,
43
- post.balances.getOrZero(intent.withdrawToken)
44
- );
45
- if (withdrawn > 0n) {
46
- post.balances.dec(intent.withdrawToken, withdrawn);
47
- collateralWithdrawn.upsert(intent.withdrawToken, withdrawn);
48
- }
49
- const claimSpentOnWithdrawal = (0, import_viem.isAddressEqual)(
50
- intent.withdrawToken,
51
- request.claimToken
52
- ) ? withdrawn : 0n;
53
- repayFromClaim(
41
+ applyWithdrawCollateral(
54
42
  post,
55
- request.claimToken,
56
- converter.convert,
57
- import_common_utils.BigIntMath.max(claimed - claimSpentOnWithdrawal, 0n)
43
+ request,
44
+ intent,
45
+ converter,
46
+ collateralWithdrawn
58
47
  );
59
48
  break;
60
49
  }
@@ -89,6 +78,39 @@ function applyClaim(post, request) {
89
78
  post.balances.inc(request.claimToken, claimed);
90
79
  return claimed;
91
80
  }
81
+ function applyWithdrawCollateral(post, request, intent, converter, collateralWithdrawn) {
82
+ const { withdrawToken, withdrawAmount, debtRepaid } = intent;
83
+ const { claimToken } = request;
84
+ const sameToken = (0, import_viem.isAddressEqual)(withdrawToken, claimToken);
85
+ const fromBalance = import_common_utils.BigIntMath.min(
86
+ withdrawAmount,
87
+ post.balances.getOrZero(withdrawToken)
88
+ );
89
+ post.balances.dec(withdrawToken, fromBalance);
90
+ let withdrawn = fromBalance;
91
+ const missing = withdrawAmount - fromBalance;
92
+ if (missing > 0n && !sameToken) {
93
+ const available = post.balances.getOrZero(claimToken);
94
+ const cost = converter.convert(withdrawToken, claimToken, missing);
95
+ if (cost > 0n && cost <= available) {
96
+ post.balances.dec(claimToken, cost);
97
+ withdrawn += missing;
98
+ } else if (available > 0n) {
99
+ post.balances.dec(claimToken, available);
100
+ withdrawn += converter.convert(claimToken, withdrawToken, available);
101
+ }
102
+ }
103
+ if (withdrawn > 0n) {
104
+ collateralWithdrawn.upsert(withdrawToken, withdrawn);
105
+ }
106
+ const remaining = post.balances.getOrZero(claimToken);
107
+ if (remaining > 0n) {
108
+ const proceeds = converter.convert(claimToken, post.underlying, remaining);
109
+ post.balances.dec(claimToken, remaining);
110
+ post.balances.inc(post.underlying, proceeds);
111
+ post.repay(import_common_utils.BigIntMath.min(proceeds, debtRepaid));
112
+ }
113
+ }
92
114
  function repayFromClaim(post, claimToken, convert, amount) {
93
115
  const spent = import_common_utils.BigIntMath.min(amount, post.balances.getOrZero(claimToken));
94
116
  if (spent <= 0n) {
@@ -121,6 +121,27 @@ class LiquidationsService extends import_base.SDKConstruct {
121
121
  }
122
122
  return { ...account, receivedAssets };
123
123
  }
124
+ /**
125
+ * {@inheritDoc ILiquidationsService.getLiquidatorWithdrawals}
126
+ **/
127
+ async getLiquidatorWithdrawals(props) {
128
+ if (props.networks && !props.networks.includes(this.sdk.networkType)) {
129
+ return [];
130
+ }
131
+ const compressor = this.sdk.withdrawalCompressor;
132
+ if (!compressor) {
133
+ return [];
134
+ }
135
+ await compressor.loadWithdrawableAssets();
136
+ const phantomTokens = new import_utils.AddressSet(
137
+ compressor.getWithdrawableAssets().map((a) => a.withdrawalPhantomToken)
138
+ );
139
+ const current = await compressor.getExternalAccountCurrentWithdrawals(
140
+ props.liquidator,
141
+ ...phantomTokens.asArray()
142
+ );
143
+ return (0, import_helpers.toLiquidatorWithdrawals)(current, this.sdk.networkType);
144
+ }
124
145
  /**
125
146
  * Accounts of expired credit managers with outstanding debt are liquidatable
126
147
  * regardless of their health factor.
@@ -58,6 +58,32 @@ class MultichainLiquidationsService {
58
58
  async getLiquidationDetails(props) {
59
59
  return this.#sdk.chain(props.network).liquidations.getLiquidationDetails(props);
60
60
  }
61
+ /**
62
+ * {@inheritDoc ILiquidationsService.getLiquidatorWithdrawals}
63
+ **/
64
+ async getLiquidatorWithdrawals(props) {
65
+ const chains = [...this.#sdk.chains.entries()].filter(
66
+ ([network]) => !props.networks || props.networks.includes(network)
67
+ );
68
+ const results = await Promise.allSettled(
69
+ chains.map(
70
+ ([, chainSdk]) => chainSdk.liquidations.getLiquidatorWithdrawals(props)
71
+ )
72
+ );
73
+ const withdrawals = [];
74
+ results.forEach((result, i) => {
75
+ const [network, chainSdk] = chains[i];
76
+ if (result.status === "fulfilled") {
77
+ withdrawals.push(...result.value);
78
+ } else {
79
+ chainSdk.logger?.warn(
80
+ result.reason,
81
+ `failed to get liquidator withdrawals on ${network}`
82
+ );
83
+ }
84
+ });
85
+ return withdrawals;
86
+ }
61
87
  }
62
88
  // Annotate the CommonJS export names for ESM import in node:
63
89
  0 && (module.exports = {
@@ -21,7 +21,8 @@ __export(helpers_exports, {
21
21
  DUST_THRESHOLD: () => DUST_THRESHOLD,
22
22
  calcEstimatedProfit: () => calcEstimatedProfit,
23
23
  calcRepaymentAmount: () => calcRepaymentAmount,
24
- pickMainAsset: () => pickMainAsset
24
+ pickMainAsset: () => pickMainAsset,
25
+ toLiquidatorWithdrawals: () => toLiquidatorWithdrawals
25
26
  });
26
27
  module.exports = __toCommonJS(helpers_exports);
27
28
  var import_constants = require("../../constants/index.js");
@@ -54,10 +55,36 @@ function pickMainAsset(ca, convert) {
54
55
  }
55
56
  return bestToken;
56
57
  }
58
+ function toLiquidatorWithdrawals(current, network) {
59
+ const rows = [];
60
+ for (const w of current.claimable) {
61
+ for (const o of w.outputs) {
62
+ rows.push({
63
+ network,
64
+ sourceToken: w.token,
65
+ token: o.token,
66
+ amount: o.amount
67
+ });
68
+ }
69
+ }
70
+ for (const w of current.pending) {
71
+ for (const o of w.expectedOutputs) {
72
+ rows.push({
73
+ network,
74
+ sourceToken: w.token,
75
+ token: o.token,
76
+ amount: o.amount,
77
+ claimableAt: w.claimableAt
78
+ });
79
+ }
80
+ }
81
+ return rows;
82
+ }
57
83
  // Annotate the CommonJS export names for ESM import in node:
58
84
  0 && (module.exports = {
59
85
  DUST_THRESHOLD,
60
86
  calcEstimatedProfit,
61
87
  calcRepaymentAmount,
62
- pickMainAsset
88
+ pickMainAsset,
89
+ toLiquidatorWithdrawals
63
90
  });
@@ -25,7 +25,7 @@ __export(intent_codec_exports, {
25
25
  });
26
26
  module.exports = __toCommonJS(intent_codec_exports);
27
27
  var import_viem = require("viem");
28
- const DELAYED_INTENT_VERSION = 2;
28
+ const DELAYED_INTENT_VERSION = 1;
29
29
  const DELAYED_INTENT_TYPES = {
30
30
  INCREASE_LEVERAGE: 1,
31
31
  DEPOSIT: 2,
@@ -51,7 +51,6 @@ function encodeDelayedIntent(intent) {
51
51
  const version = DELAYED_INTENT_VERSION;
52
52
  const intentType = DELAYED_INTENT_TYPES[intent.type];
53
53
  switch (intent.type) {
54
- case "INCREASE_LEVERAGE":
55
54
  case "CLOSE_ACCOUNT":
56
55
  return (0, import_viem.encodeAbiParameters)(TO_PARAMS, [version, intentType, intent.to]);
57
56
  case "WITHDRAW_COLLATERAL":
@@ -64,6 +63,7 @@ function encodeDelayedIntent(intent) {
64
63
  intent.sourceToken,
65
64
  intent.debtRepaid
66
65
  ]);
66
+ case "INCREASE_LEVERAGE":
67
67
  case "DEPOSIT":
68
68
  case "DEPOSIT_AND_INCREASE_LEVERAGE":
69
69
  case "ADD_COLLATERAL":
@@ -81,10 +81,8 @@ function decodeDelayedIntent(data) {
81
81
  throw new Error(`unsupported delayed intent version: ${version}`);
82
82
  }
83
83
  switch (intentType) {
84
- case DELAYED_INTENT_TYPES.INCREASE_LEVERAGE: {
85
- const [, , to] = (0, import_viem.decodeAbiParameters)(TO_PARAMS, data);
86
- return { type: "INCREASE_LEVERAGE", to };
87
- }
84
+ case DELAYED_INTENT_TYPES.INCREASE_LEVERAGE:
85
+ return { type: "INCREASE_LEVERAGE" };
88
86
  case DELAYED_INTENT_TYPES.DEPOSIT:
89
87
  return { type: "DEPOSIT" };
90
88
  case DELAYED_INTENT_TYPES.DEPOSIT_AND_INCREASE_LEVERAGE:
@@ -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",