@gearbox-protocol/sdk 14.8.7 → 14.10.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 (45) hide show
  1. package/dist/cjs/abi/IWithdrawalCompressorV311.js +315 -0
  2. package/dist/cjs/{plugins/apy/apy-cache.js → common-utils/axios-cache/AxiosCache.js} +31 -20
  3. package/dist/cjs/common-utils/axios-cache/index.js +22 -0
  4. package/dist/cjs/common-utils/index.js +2 -0
  5. package/dist/cjs/plugins/apy/ApyPlugin.js +4 -4
  6. package/dist/cjs/plugins/apy/index.js +0 -2
  7. package/dist/cjs/plugins/delayed-withdrawal/DelayedWithdrawalPlugin.js +3 -2
  8. package/dist/cjs/plugins/remote-configs/CustomConfigSource.js +41 -0
  9. package/dist/cjs/plugins/remote-configs/RemoteConfigSource.js +56 -0
  10. package/dist/cjs/plugins/remote-configs/RemoteConfigsPlugin.js +186 -0
  11. package/dist/cjs/plugins/remote-configs/index.js +28 -0
  12. package/dist/cjs/plugins/remote-configs/package.json +1 -0
  13. package/dist/cjs/plugins/remote-configs/types.js +16 -0
  14. package/dist/cjs/sdk/OnchainSDK.js +2 -2
  15. package/dist/cjs/sdk/accounts/CreditAccountsServiceV310.js +13 -6
  16. package/dist/cjs/sdk/utils/viem/simulateWithPriceUpdates.js +1 -1
  17. package/dist/esm/abi/IWithdrawalCompressorV311.js +291 -0
  18. package/dist/esm/{plugins/apy/apy-cache.js → common-utils/axios-cache/AxiosCache.js} +27 -16
  19. package/dist/esm/common-utils/axios-cache/index.js +1 -0
  20. package/dist/esm/common-utils/index.js +1 -0
  21. package/dist/esm/plugins/apy/ApyPlugin.js +4 -4
  22. package/dist/esm/plugins/apy/index.js +0 -1
  23. package/dist/esm/plugins/delayed-withdrawal/DelayedWithdrawalPlugin.js +3 -2
  24. package/dist/esm/plugins/remote-configs/CustomConfigSource.js +17 -0
  25. package/dist/esm/plugins/remote-configs/RemoteConfigSource.js +32 -0
  26. package/dist/esm/plugins/remote-configs/RemoteConfigsPlugin.js +165 -0
  27. package/dist/esm/plugins/remote-configs/index.js +4 -0
  28. package/dist/esm/plugins/remote-configs/package.json +1 -0
  29. package/dist/esm/plugins/remote-configs/types.js +0 -0
  30. package/dist/esm/sdk/OnchainSDK.js +2 -2
  31. package/dist/esm/sdk/accounts/CreditAccountsServiceV310.js +13 -6
  32. package/dist/esm/sdk/utils/viem/simulateWithPriceUpdates.js +1 -1
  33. package/dist/types/abi/IWithdrawalCompressorV311.d.ts +327 -0
  34. package/dist/types/{plugins/apy/apy-cache.d.ts → common-utils/axios-cache/AxiosCache.d.ts} +6 -7
  35. package/dist/types/common-utils/axios-cache/index.d.ts +1 -0
  36. package/dist/types/common-utils/index.d.ts +1 -0
  37. package/dist/types/plugins/apy/index.d.ts +0 -1
  38. package/dist/types/plugins/delayed-withdrawal/types.d.ts +10 -2
  39. package/dist/types/plugins/remote-configs/CustomConfigSource.d.ts +13 -0
  40. package/dist/types/plugins/remote-configs/RemoteConfigSource.d.ts +31 -0
  41. package/dist/types/plugins/remote-configs/RemoteConfigsPlugin.d.ts +24 -0
  42. package/dist/types/plugins/remote-configs/index.d.ts +4 -0
  43. package/dist/types/plugins/remote-configs/types.d.ts +24 -0
  44. package/dist/types/sdk/accounts/CreditAccountsServiceV310.d.ts +4 -1
  45. package/package.json +1 -1
@@ -0,0 +1,186 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var RemoteConfigsPlugin_exports = {};
20
+ __export(RemoteConfigsPlugin_exports, {
21
+ RemoteConfigsPlugin: () => RemoteConfigsPlugin
22
+ });
23
+ module.exports = __toCommonJS(RemoteConfigsPlugin_exports);
24
+ var import_viem = require("viem");
25
+ var import_sdk = require("../../sdk/index.js");
26
+ var import_RemoteConfigSource = require("./RemoteConfigSource.js");
27
+ class RemoteConfigsPlugin extends import_sdk.BasePlugin {
28
+ #sources;
29
+ #pools;
30
+ #strategies;
31
+ constructor(loadOnAttach = false, options) {
32
+ super(loadOnAttach);
33
+ this.#sources = options?.sources ?? [new import_RemoteConfigSource.RemoteConfigSource()];
34
+ }
35
+ get loaded() {
36
+ return !!this.#pools && !!this.#strategies;
37
+ }
38
+ async load(force) {
39
+ if (!force && this.loaded) {
40
+ return this.state;
41
+ }
42
+ const [pools, strategies] = await Promise.all([
43
+ this.#loadPools(),
44
+ this.#loadStrategies()
45
+ ]);
46
+ this.#pools = pools;
47
+ this.#strategies = strategies;
48
+ return this.state;
49
+ }
50
+ async syncState() {
51
+ await this.load(false);
52
+ }
53
+ get state() {
54
+ return {
55
+ pools: this.pools,
56
+ strategies: this.strategies
57
+ };
58
+ }
59
+ hydrate(state) {
60
+ this.#pools = state.pools;
61
+ this.#strategies = state.strategies;
62
+ }
63
+ stateHuman(_) {
64
+ return this.state;
65
+ }
66
+ // ---------------------------------------------------------------------------
67
+ // Accessors
68
+ // ---------------------------------------------------------------------------
69
+ /**
70
+ * Pool configs for the current SDK network.
71
+ * @throws if plugin is not loaded
72
+ */
73
+ get pools() {
74
+ if (!this.#pools) {
75
+ throw new Error("remote-configs plugin not loaded");
76
+ }
77
+ return this.#pools;
78
+ }
79
+ /**
80
+ * Strategy configs for the current SDK network.
81
+ * @throws if plugin is not loaded
82
+ */
83
+ get strategies() {
84
+ if (!this.#strategies) {
85
+ throw new Error("remote-configs plugin not loaded");
86
+ }
87
+ return this.#strategies;
88
+ }
89
+ // ---------------------------------------------------------------------------
90
+ // Internal
91
+ // ---------------------------------------------------------------------------
92
+ async #loadPools() {
93
+ for (const source of this.#sources) {
94
+ try {
95
+ const data = await source.getPools();
96
+ const mapped = this.#mapPoolPayload(
97
+ data.filter(
98
+ (p) => p.chainId === this.sdk.chainId && p.network.toLowerCase() === this.sdk.networkType.toLowerCase()
99
+ )
100
+ );
101
+ return mapped;
102
+ } catch (e) {
103
+ this.logger?.warn(e, `${source.constructor.name} failed to load pools`);
104
+ }
105
+ }
106
+ throw new Error("all config sources failed to load pools");
107
+ }
108
+ async #loadStrategies() {
109
+ for (const source of this.#sources) {
110
+ try {
111
+ const data = await source.getStrategies();
112
+ const mapped = this.#mapStrategyPayload(
113
+ data.filter(
114
+ (s) => s.chainId === this.sdk.chainId && s.network.toLowerCase() === this.sdk.networkType.toLowerCase()
115
+ )
116
+ );
117
+ return mapped;
118
+ } catch (e) {
119
+ this.logger?.warn(
120
+ e,
121
+ `${source.constructor.name} failed to load strategies`
122
+ );
123
+ }
124
+ }
125
+ throw new Error("all config sources failed to load strategies");
126
+ }
127
+ #mapPoolPayload(payload) {
128
+ return payload.reduce((acc, p) => {
129
+ const addressLc = p.address.toLowerCase();
130
+ if ((0, import_viem.isAddress)(addressLc)) {
131
+ acc.push({
132
+ ...p,
133
+ address: addressLc
134
+ });
135
+ }
136
+ return acc;
137
+ }, []);
138
+ }
139
+ #mapStrategyPayload(payload) {
140
+ return payload.reduce((acc, p) => {
141
+ const tokenOutAddressLc = p.tokenOutAddress.toLowerCase();
142
+ const creditManagers = p.creditManagers.filter((cm) => (0, import_viem.isAddress)(cm)).map((cm) => cm.toLowerCase());
143
+ const zeroSlippage = p.zeroSlippage ? import_sdk.TypedObjectUtils.entries(p.zeroSlippage).reduce((zsAcc, [address, value]) => {
144
+ const addressLc = address.toLowerCase();
145
+ if ((0, import_viem.isAddress)(addressLc)) zsAcc[addressLc] = value;
146
+ return zsAcc;
147
+ }, {}) : void 0;
148
+ const additionalRewardQuotas = p.additionalRewardQuotas ? import_sdk.TypedObjectUtils.entries(p.additionalRewardQuotas).reduce((rqAcc, [address, value]) => {
149
+ const addressLc = address.toLowerCase();
150
+ if ((0, import_viem.isAddress)(addressLc)) {
151
+ const rewards = value?.filter((r) => (0, import_viem.isAddress)(r)).map((r) => r.toLowerCase());
152
+ rqAcc[addressLc] = rewards;
153
+ }
154
+ return rqAcc;
155
+ }, {}) : void 0;
156
+ const additionalCollaterals = p.additionalCollaterals?.reduce((colAcc, cfg) => {
157
+ const token = typeof cfg === "string" ? cfg : cfg.token;
158
+ const tokenLc = token.toLowerCase();
159
+ const valid = (0, import_viem.isAddress)(tokenLc);
160
+ if (valid && !colAcc[tokenLc]) colAcc[tokenLc] = [];
161
+ const nextCfg = typeof cfg === "string" ? tokenLc : {
162
+ token: tokenLc,
163
+ cm: cfg.cm.toLowerCase()
164
+ };
165
+ if (valid) colAcc[tokenLc].push(nextCfg);
166
+ return colAcc;
167
+ }, {});
168
+ if ((0, import_viem.isAddress)(tokenOutAddressLc)) {
169
+ const { additionalCollaterals: _, ...rest } = p;
170
+ acc.push({
171
+ ...rest,
172
+ tokenOutAddress: tokenOutAddressLc,
173
+ creditManagers,
174
+ ...zeroSlippage ? { zeroSlippage } : {},
175
+ ...additionalRewardQuotas ? { additionalRewardQuotas } : {},
176
+ ...additionalCollaterals ? { additionalCollaterals } : {}
177
+ });
178
+ }
179
+ return acc;
180
+ }, []);
181
+ }
182
+ }
183
+ // Annotate the CommonJS export names for ESM import in node:
184
+ 0 && (module.exports = {
185
+ RemoteConfigsPlugin
186
+ });
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
15
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
16
+ var remote_configs_exports = {};
17
+ module.exports = __toCommonJS(remote_configs_exports);
18
+ __reExport(remote_configs_exports, require("./CustomConfigSource.js"), module.exports);
19
+ __reExport(remote_configs_exports, require("./RemoteConfigSource.js"), module.exports);
20
+ __reExport(remote_configs_exports, require("./RemoteConfigsPlugin.js"), module.exports);
21
+ __reExport(remote_configs_exports, require("./types.js"), module.exports);
22
+ // Annotate the CommonJS export names for ESM import in node:
23
+ 0 && (module.exports = {
24
+ ...require("./CustomConfigSource.js"),
25
+ ...require("./RemoteConfigSource.js"),
26
+ ...require("./RemoteConfigsPlugin.js"),
27
+ ...require("./types.js")
28
+ });
@@ -0,0 +1 @@
1
+ {"type": "commonjs"}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+ var types_exports = {};
16
+ module.exports = __toCommonJS(types_exports);
@@ -150,12 +150,12 @@ class OnchainSDK extends import_base.ChainContractsRegister {
150
150
  );
151
151
  this.#currentBlock = block.number;
152
152
  this.#timestamp = block.timestamp;
153
- if (!!blockNumber && !redstone?.historicTimestamp && time - Number(block.timestamp) * 1e3 > 60 * 1e3) {
153
+ if (blockNumber && !redstone?.historicTimestamp && time - Number(block.timestamp) * 1e3 > 60 * 1e3) {
154
154
  this.logger?.warn(
155
155
  "attaching to fixed block number, but redstone historicTimestamp is not set. price updates might fail"
156
156
  );
157
157
  }
158
- if (!!blockNumber && !pyth?.historicTimestamp && time - Number(block.timestamp) * 1e3 > 60 * 1e3) {
158
+ if (blockNumber && !pyth?.historicTimestamp && time - Number(block.timestamp) * 1e3 > 60 * 1e3) {
159
159
  this.logger?.warn(
160
160
  "attaching to fixed block number, but pyth historicTimestamp is not set. price updates might fail"
161
161
  );
@@ -29,6 +29,7 @@ var import_creditAccountCompressor = require("../../abi/compressors/creditAccoun
29
29
  var import_peripheryCompressor = require("../../abi/compressors/peripheryCompressor.js");
30
30
  var import_rewardsCompressor = require("../../abi/compressors/rewardsCompressor.js");
31
31
  var import_IWithdrawalCompressorV310 = require("../../abi/IWithdrawalCompressorV310.js");
32
+ var import_IWithdrawalCompressorV311 = require("../../abi/IWithdrawalCompressorV311.js");
32
33
  var import_iBaseRewardPool = require("../../abi/iBaseRewardPool.js");
33
34
  var import_iRWAFactory = require("../../abi/rwa/iRWAFactory.js");
34
35
  var import_base = require("../base/index.js");
@@ -40,8 +41,14 @@ var import_utils = require("../utils/index.js");
40
41
  var import_viem2 = require("../utils/viem/index.js");
41
42
  var import_multicall_utils = require("./multicall-utils.js");
42
43
  const COMPRESSORS = {
43
- [import_chains.chains.Mainnet.id]: "0x36F3d0Bb73CBC2E94fE24dF0f26a689409cF9023",
44
- [import_chains.chains.Monad.id]: "0x36F3d0Bb73CBC2E94fE24dF0f26a689409cF9023"
44
+ [import_chains.chains.Mainnet.id]: {
45
+ address: "0x36F3d0Bb73CBC2E94fE24dF0f26a689409cF9023",
46
+ version: 310
47
+ },
48
+ [import_chains.chains.Monad.id]: {
49
+ address: "0x36F3d0Bb73CBC2E94fE24dF0f26a689409cF9023",
50
+ version: 310
51
+ }
45
52
  };
46
53
  function getWithdrawalCompressorAddress(chainId) {
47
54
  return COMPRESSORS[chainId];
@@ -778,8 +785,8 @@ class CreditAccountsServiceV310 extends import_base.SDKConstruct {
778
785
  `No compressor for current chain ${this.sdk.networkType}`
779
786
  );
780
787
  const contract = (0, import_viem.getContract)({
781
- address: compressor,
782
- abi: import_IWithdrawalCompressorV310.iWithdrawalCompressorV310Abi,
788
+ address: compressor.address,
789
+ abi: compressor.version === 310 ? import_IWithdrawalCompressorV310.iWithdrawalCompressorV310Abi : import_IWithdrawalCompressorV311.iWithdrawalCompressorV311Abi,
783
790
  client: this.client
784
791
  });
785
792
  const resp = await contract.read.getWithdrawalRequestResult([
@@ -801,8 +808,8 @@ class CreditAccountsServiceV310 extends import_base.SDKConstruct {
801
808
  `No compressor for current chain ${this.sdk.networkType}`
802
809
  );
803
810
  const contract = (0, import_viem.getContract)({
804
- address: compressor,
805
- abi: import_IWithdrawalCompressorV310.iWithdrawalCompressorV310Abi,
811
+ address: compressor.address,
812
+ abi: compressor.version === 310 ? import_IWithdrawalCompressorV310.iWithdrawalCompressorV310Abi : import_IWithdrawalCompressorV311.iWithdrawalCompressorV311Abi,
806
813
  client: this.client
807
814
  });
808
815
  const resp = await contract.read.getCurrentWithdrawals([creditAccount]);
@@ -131,7 +131,7 @@ async function simulateWithPriceUpdates(client, parameters) {
131
131
  const r = multicallResults[1];
132
132
  if (r.status === "success") {
133
133
  const fromMc = BigInt(r.result);
134
- if (!!r.result && fromMc !== parameters.blockNumber) {
134
+ if (r.result && fromMc !== parameters.blockNumber) {
135
135
  throw getSimulateWithPriceUpdatesError(
136
136
  new import_viem.BaseError(
137
137
  `block number returned from multicall (${fromMc}) is different from the one provided (${parameters.blockNumber})`
@@ -0,0 +1,291 @@
1
+ const iWithdrawalCompressorV311Abi = [
2
+ {
3
+ inputs: [
4
+ { internalType: "address", name: "_owner", type: "address" },
5
+ { internalType: "address", name: "addressProvider_", type: "address" }
6
+ ],
7
+ stateMutability: "nonpayable",
8
+ type: "constructor"
9
+ },
10
+ {
11
+ anonymous: false,
12
+ inputs: [
13
+ {
14
+ indexed: true,
15
+ internalType: "address",
16
+ name: "previousOwner",
17
+ type: "address"
18
+ },
19
+ {
20
+ indexed: true,
21
+ internalType: "address",
22
+ name: "newOwner",
23
+ type: "address"
24
+ }
25
+ ],
26
+ name: "OwnershipTransferred",
27
+ type: "event"
28
+ },
29
+ {
30
+ inputs: [],
31
+ name: "addressProvider",
32
+ outputs: [{ internalType: "address", name: "", type: "address" }],
33
+ stateMutability: "view",
34
+ type: "function"
35
+ },
36
+ {
37
+ inputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
38
+ name: "compressorTypeToCompressor",
39
+ outputs: [{ internalType: "address", name: "", type: "address" }],
40
+ stateMutability: "view",
41
+ type: "function"
42
+ },
43
+ {
44
+ inputs: [],
45
+ name: "contractType",
46
+ outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
47
+ stateMutability: "view",
48
+ type: "function"
49
+ },
50
+ {
51
+ inputs: [
52
+ { internalType: "address", name: "creditAccount", type: "address" }
53
+ ],
54
+ name: "getCurrentWithdrawals",
55
+ outputs: [
56
+ {
57
+ components: [
58
+ { internalType: "address", name: "token", type: "address" },
59
+ {
60
+ internalType: "address",
61
+ name: "withdrawalPhantomToken",
62
+ type: "address"
63
+ },
64
+ {
65
+ internalType: "uint256",
66
+ name: "withdrawalTokenSpent",
67
+ type: "uint256"
68
+ },
69
+ {
70
+ components: [
71
+ { internalType: "address", name: "token", type: "address" },
72
+ { internalType: "bool", name: "isDelayed", type: "bool" },
73
+ { internalType: "uint256", name: "amount", type: "uint256" }
74
+ ],
75
+ internalType: "struct WithdrawalOutput[]",
76
+ name: "outputs",
77
+ type: "tuple[]"
78
+ },
79
+ {
80
+ components: [
81
+ { internalType: "address", name: "target", type: "address" },
82
+ { internalType: "bytes", name: "callData", type: "bytes" }
83
+ ],
84
+ internalType: "struct MultiCall[]",
85
+ name: "claimCalls",
86
+ type: "tuple[]"
87
+ }
88
+ ],
89
+ internalType: "struct ClaimableWithdrawal[]",
90
+ name: "",
91
+ type: "tuple[]"
92
+ },
93
+ {
94
+ components: [
95
+ { internalType: "address", name: "token", type: "address" },
96
+ {
97
+ internalType: "address",
98
+ name: "withdrawalPhantomToken",
99
+ type: "address"
100
+ },
101
+ {
102
+ components: [
103
+ { internalType: "address", name: "token", type: "address" },
104
+ { internalType: "bool", name: "isDelayed", type: "bool" },
105
+ { internalType: "uint256", name: "amount", type: "uint256" }
106
+ ],
107
+ internalType: "struct WithdrawalOutput[]",
108
+ name: "expectedOutputs",
109
+ type: "tuple[]"
110
+ },
111
+ { internalType: "uint256", name: "claimableAt", type: "uint256" }
112
+ ],
113
+ internalType: "struct PendingWithdrawal[]",
114
+ name: "",
115
+ type: "tuple[]"
116
+ }
117
+ ],
118
+ stateMutability: "view",
119
+ type: "function"
120
+ },
121
+ {
122
+ inputs: [
123
+ { internalType: "address", name: "creditManager", type: "address" }
124
+ ],
125
+ name: "getWithdrawableAssets",
126
+ outputs: [
127
+ {
128
+ components: [
129
+ { internalType: "address", name: "token", type: "address" },
130
+ {
131
+ internalType: "address",
132
+ name: "withdrawalPhantomToken",
133
+ type: "address"
134
+ },
135
+ { internalType: "address", name: "underlying", type: "address" },
136
+ {
137
+ internalType: "uint256",
138
+ name: "withdrawalLength",
139
+ type: "uint256"
140
+ },
141
+ { internalType: "uint256", name: "maxWithdrawals", type: "uint256" }
142
+ ],
143
+ internalType: "struct WithdrawableAsset[]",
144
+ name: "",
145
+ type: "tuple[]"
146
+ }
147
+ ],
148
+ stateMutability: "view",
149
+ type: "function"
150
+ },
151
+ {
152
+ inputs: [
153
+ { internalType: "address", name: "creditAccount", type: "address" },
154
+ { internalType: "address", name: "token", type: "address" },
155
+ { internalType: "uint256", name: "amount", type: "uint256" }
156
+ ],
157
+ name: "getWithdrawalRequestResult",
158
+ outputs: [
159
+ {
160
+ components: [
161
+ { internalType: "address", name: "token", type: "address" },
162
+ { internalType: "uint256", name: "amountIn", type: "uint256" },
163
+ {
164
+ components: [
165
+ { internalType: "address", name: "token", type: "address" },
166
+ { internalType: "bool", name: "isDelayed", type: "bool" },
167
+ { internalType: "uint256", name: "amount", type: "uint256" }
168
+ ],
169
+ internalType: "struct WithdrawalOutput[]",
170
+ name: "outputs",
171
+ type: "tuple[]"
172
+ },
173
+ {
174
+ components: [
175
+ { internalType: "address", name: "target", type: "address" },
176
+ { internalType: "bytes", name: "callData", type: "bytes" }
177
+ ],
178
+ internalType: "struct MultiCall[]",
179
+ name: "requestCalls",
180
+ type: "tuple[]"
181
+ },
182
+ { internalType: "uint256", name: "claimableAt", type: "uint256" }
183
+ ],
184
+ internalType: "struct RequestableWithdrawal",
185
+ name: "withdrawal",
186
+ type: "tuple"
187
+ }
188
+ ],
189
+ stateMutability: "view",
190
+ type: "function"
191
+ },
192
+ // {
193
+ // inputs: [
194
+ // { internalType: "address", name: "creditAccount", type: "address" },
195
+ // { internalType: "address", name: "token", type: "address" },
196
+ // { internalType: "address", name: "withdrawalToken", type: "address" },
197
+ // { internalType: "uint256", name: "amount", type: "uint256" },
198
+ // ],
199
+ // name: "getWithdrawalRequestResult",
200
+ // outputs: [
201
+ // {
202
+ // components: [
203
+ // { internalType: "address", name: "token", type: "address" },
204
+ // { internalType: "uint256", name: "amountIn", type: "uint256" },
205
+ // {
206
+ // components: [
207
+ // { internalType: "address", name: "token", type: "address" },
208
+ // { internalType: "bool", name: "isDelayed", type: "bool" },
209
+ // { internalType: "uint256", name: "amount", type: "uint256" },
210
+ // ],
211
+ // internalType: "struct WithdrawalOutput[]",
212
+ // name: "outputs",
213
+ // type: "tuple[]",
214
+ // },
215
+ // {
216
+ // components: [
217
+ // { internalType: "address", name: "target", type: "address" },
218
+ // { internalType: "bytes", name: "callData", type: "bytes" },
219
+ // ],
220
+ // internalType: "struct MultiCall[]",
221
+ // name: "requestCalls",
222
+ // type: "tuple[]",
223
+ // },
224
+ // { internalType: "uint256", name: "claimableAt", type: "uint256" },
225
+ // ],
226
+ // internalType: "struct RequestableWithdrawal",
227
+ // name: "withdrawal",
228
+ // type: "tuple",
229
+ // },
230
+ // ],
231
+ // stateMutability: "view",
232
+ // type: "function",
233
+ // },
234
+ {
235
+ inputs: [],
236
+ name: "owner",
237
+ outputs: [{ internalType: "address", name: "", type: "address" }],
238
+ stateMutability: "view",
239
+ type: "function"
240
+ },
241
+ {
242
+ inputs: [],
243
+ name: "renounceOwnership",
244
+ outputs: [],
245
+ stateMutability: "nonpayable",
246
+ type: "function"
247
+ },
248
+ {
249
+ inputs: [
250
+ { internalType: "address", name: "subcompressor", type: "address" }
251
+ ],
252
+ name: "setSubcompressor",
253
+ outputs: [],
254
+ stateMutability: "nonpayable",
255
+ type: "function"
256
+ },
257
+ {
258
+ inputs: [
259
+ { internalType: "bytes32", name: "withdrawableType", type: "bytes32" },
260
+ { internalType: "bytes32", name: "compressorType", type: "bytes32" }
261
+ ],
262
+ name: "setWithdrawableTypeToCompressorType",
263
+ outputs: [],
264
+ stateMutability: "nonpayable",
265
+ type: "function"
266
+ },
267
+ {
268
+ inputs: [{ internalType: "address", name: "newOwner", type: "address" }],
269
+ name: "transferOwnership",
270
+ outputs: [],
271
+ stateMutability: "nonpayable",
272
+ type: "function"
273
+ },
274
+ {
275
+ inputs: [],
276
+ name: "version",
277
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
278
+ stateMutability: "view",
279
+ type: "function"
280
+ },
281
+ {
282
+ inputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
283
+ name: "withdrawableTypeToCompressorType",
284
+ outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
285
+ stateMutability: "view",
286
+ type: "function"
287
+ }
288
+ ];
289
+ export {
290
+ iWithdrawalCompressorV311Abi
291
+ };