@gearbox-protocol/sdk 18.0.0 → 18.1.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.
@@ -8,6 +8,10 @@ const WITHDRAWAL_COMPRESSORS = {
8
8
  Monad: {
9
9
  address: "0x36F3d0Bb73CBC2E94fE24dF0f26a689409cF9023",
10
10
  version: 310
11
+ },
12
+ Etherlink: {
13
+ address: "0x6FA0c5404C31D0161bb39Cc1311aac998A38ecD5",
14
+ version: 313
11
15
  }
12
16
  };
13
17
  /**
@@ -6075,44 +6075,57 @@ const iMellowWrapperAbi = [{
6075
6075
  }],
6076
6076
  stateMutability: "nonpayable"
6077
6077
  }];
6078
- const iMidasIssuanceVaultV310Abi = [{
6079
- type: "function",
6080
- name: "depositInstant",
6081
- inputs: [
6082
- {
6083
- name: "tokenIn",
6078
+ const iMidasIssuanceVaultV310Abi = [
6079
+ {
6080
+ type: "function",
6081
+ name: "paused",
6082
+ inputs: [],
6083
+ outputs: [{
6084
+ name: "",
6085
+ type: "bool"
6086
+ }],
6087
+ stateMutability: "view"
6088
+ },
6089
+ {
6090
+ type: "function",
6091
+ name: "depositInstant",
6092
+ inputs: [
6093
+ {
6094
+ name: "tokenIn",
6095
+ type: "address",
6096
+ internalType: "address"
6097
+ },
6098
+ {
6099
+ name: "amountToken",
6100
+ type: "uint256",
6101
+ internalType: "uint256"
6102
+ },
6103
+ {
6104
+ name: "minReceiveAmount",
6105
+ type: "uint256",
6106
+ internalType: "uint256"
6107
+ },
6108
+ {
6109
+ name: "referrerId",
6110
+ type: "bytes32",
6111
+ internalType: "bytes32"
6112
+ }
6113
+ ],
6114
+ outputs: [],
6115
+ stateMutability: "nonpayable"
6116
+ },
6117
+ {
6118
+ type: "function",
6119
+ name: "mToken",
6120
+ inputs: [],
6121
+ outputs: [{
6122
+ name: "",
6084
6123
  type: "address",
6085
6124
  internalType: "address"
6086
- },
6087
- {
6088
- name: "amountToken",
6089
- type: "uint256",
6090
- internalType: "uint256"
6091
- },
6092
- {
6093
- name: "minReceiveAmount",
6094
- type: "uint256",
6095
- internalType: "uint256"
6096
- },
6097
- {
6098
- name: "referrerId",
6099
- type: "bytes32",
6100
- internalType: "bytes32"
6101
- }
6102
- ],
6103
- outputs: [],
6104
- stateMutability: "nonpayable"
6105
- }, {
6106
- type: "function",
6107
- name: "mToken",
6108
- inputs: [],
6109
- outputs: [{
6110
- name: "",
6111
- type: "address",
6112
- internalType: "address"
6113
- }],
6114
- stateMutability: "view"
6115
- }];
6125
+ }],
6126
+ stateMutability: "view"
6127
+ }
6128
+ ];
6116
6129
  const iPendleRouterAbi = [
6117
6130
  {
6118
6131
  type: "function",
@@ -1,14 +1,23 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_onchain_base_MultichainConstruct = require("../base/MultichainConstruct.js");
3
3
  require("../base/index.js");
4
+ const require_onchain_market_adapters_abi_targetContractAbi = require("../market/adapters/abi/targetContractAbi.js");
4
5
  //#region src/onchain/opportunities/MultichainOpportunitiesService.ts
5
6
  /**
6
- * Cross-chain counterpart of {@link OpportunitiesService}. Every read walks
7
- * loaded market state, so the block it reports is the SDK's snapshot.
7
+ * Cross-chain counterpart of {@link OpportunitiesService}. List and detail
8
+ * reads walk loaded market state; the mGLOBAL window reads live vault state.
8
9
  *
9
10
  * @typeParam Plugins - Map of attached plugin types.
10
11
  **/
11
12
  var MultichainOpportunitiesService = class extends require_onchain_base_MultichainConstruct.MultichainConstruct {
13
+ /** {@inheritDoc IMultichainOpportunitiesService.isMGLOBALInvestmentWindowOpen} */
14
+ async isMGLOBALInvestmentWindowOpen() {
15
+ return !await this.sdk.chain("Mainnet").client.readContract({
16
+ address: "0xCe29c36c6D4556f2d01d79414C1354B968dDDEf1",
17
+ abi: require_onchain_market_adapters_abi_targetContractAbi.iMidasIssuanceVaultV310Abi,
18
+ functionName: "paused"
19
+ });
20
+ }
12
21
  /**
13
22
  * Opportunities of all queried chains, see {@link OpportunitiesService.list}.
14
23
  * A filter that names chains narrows the fan-out itself, so a chain whose
@@ -79,6 +79,10 @@ var OpportunitiesNamespace = class extends require_sdk_AbstractNamespace.Abstrac
79
79
  merge: this.merge.strategy
80
80
  });
81
81
  }
82
+ /** {@inheritDoc IOpportunitiesOnchainOnly.isMGLOBALInvestmentWindowOpen} */
83
+ async isMGLOBALInvestmentWindowOpen() {
84
+ return this.onchain.isMGLOBALInvestmentWindowOpen();
85
+ }
82
86
  /**
83
87
  * {@inheritDoc IOpportunitiesOnchainOnly.isEligibleForStrategy}
84
88
  **/
@@ -7,6 +7,10 @@ const WITHDRAWAL_COMPRESSORS = {
7
7
  Monad: {
8
8
  address: "0x36F3d0Bb73CBC2E94fE24dF0f26a689409cF9023",
9
9
  version: 310
10
+ },
11
+ Etherlink: {
12
+ address: "0x6FA0c5404C31D0161bb39Cc1311aac998A38ecD5",
13
+ version: 313
10
14
  }
11
15
  };
12
16
  /**
@@ -6074,44 +6074,57 @@ const iMellowWrapperAbi = [{
6074
6074
  }],
6075
6075
  stateMutability: "nonpayable"
6076
6076
  }];
6077
- const iMidasIssuanceVaultV310Abi = [{
6078
- type: "function",
6079
- name: "depositInstant",
6080
- inputs: [
6081
- {
6082
- name: "tokenIn",
6077
+ const iMidasIssuanceVaultV310Abi = [
6078
+ {
6079
+ type: "function",
6080
+ name: "paused",
6081
+ inputs: [],
6082
+ outputs: [{
6083
+ name: "",
6084
+ type: "bool"
6085
+ }],
6086
+ stateMutability: "view"
6087
+ },
6088
+ {
6089
+ type: "function",
6090
+ name: "depositInstant",
6091
+ inputs: [
6092
+ {
6093
+ name: "tokenIn",
6094
+ type: "address",
6095
+ internalType: "address"
6096
+ },
6097
+ {
6098
+ name: "amountToken",
6099
+ type: "uint256",
6100
+ internalType: "uint256"
6101
+ },
6102
+ {
6103
+ name: "minReceiveAmount",
6104
+ type: "uint256",
6105
+ internalType: "uint256"
6106
+ },
6107
+ {
6108
+ name: "referrerId",
6109
+ type: "bytes32",
6110
+ internalType: "bytes32"
6111
+ }
6112
+ ],
6113
+ outputs: [],
6114
+ stateMutability: "nonpayable"
6115
+ },
6116
+ {
6117
+ type: "function",
6118
+ name: "mToken",
6119
+ inputs: [],
6120
+ outputs: [{
6121
+ name: "",
6083
6122
  type: "address",
6084
6123
  internalType: "address"
6085
- },
6086
- {
6087
- name: "amountToken",
6088
- type: "uint256",
6089
- internalType: "uint256"
6090
- },
6091
- {
6092
- name: "minReceiveAmount",
6093
- type: "uint256",
6094
- internalType: "uint256"
6095
- },
6096
- {
6097
- name: "referrerId",
6098
- type: "bytes32",
6099
- internalType: "bytes32"
6100
- }
6101
- ],
6102
- outputs: [],
6103
- stateMutability: "nonpayable"
6104
- }, {
6105
- type: "function",
6106
- name: "mToken",
6107
- inputs: [],
6108
- outputs: [{
6109
- name: "",
6110
- type: "address",
6111
- internalType: "address"
6112
- }],
6113
- stateMutability: "view"
6114
- }];
6124
+ }],
6125
+ stateMutability: "view"
6126
+ }
6127
+ ];
6115
6128
  const iPendleRouterAbi = [
6116
6129
  {
6117
6130
  type: "function",
@@ -1,13 +1,22 @@
1
1
  import { MultichainConstruct } from "../base/MultichainConstruct.js";
2
2
  import "../base/index.js";
3
+ import { iMidasIssuanceVaultV310Abi } from "../market/adapters/abi/targetContractAbi.js";
3
4
  //#region src/onchain/opportunities/MultichainOpportunitiesService.ts
4
5
  /**
5
- * Cross-chain counterpart of {@link OpportunitiesService}. Every read walks
6
- * loaded market state, so the block it reports is the SDK's snapshot.
6
+ * Cross-chain counterpart of {@link OpportunitiesService}. List and detail
7
+ * reads walk loaded market state; the mGLOBAL window reads live vault state.
7
8
  *
8
9
  * @typeParam Plugins - Map of attached plugin types.
9
10
  **/
10
11
  var MultichainOpportunitiesService = class extends MultichainConstruct {
12
+ /** {@inheritDoc IMultichainOpportunitiesService.isMGLOBALInvestmentWindowOpen} */
13
+ async isMGLOBALInvestmentWindowOpen() {
14
+ return !await this.sdk.chain("Mainnet").client.readContract({
15
+ address: "0xCe29c36c6D4556f2d01d79414C1354B968dDDEf1",
16
+ abi: iMidasIssuanceVaultV310Abi,
17
+ functionName: "paused"
18
+ });
19
+ }
11
20
  /**
12
21
  * Opportunities of all queried chains, see {@link OpportunitiesService.list}.
13
22
  * A filter that names chains narrows the fan-out itself, so a chain whose
@@ -78,6 +78,10 @@ var OpportunitiesNamespace = class extends AbstractNamespace {
78
78
  merge: this.merge.strategy
79
79
  });
80
80
  }
81
+ /** {@inheritDoc IOpportunitiesOnchainOnly.isMGLOBALInvestmentWindowOpen} */
82
+ async isMGLOBALInvestmentWindowOpen() {
83
+ return this.onchain.isMGLOBALInvestmentWindowOpen();
84
+ }
81
85
  /**
82
86
  * {@inheritDoc IOpportunitiesOnchainOnly.isEligibleForStrategy}
83
87
  **/
@@ -5310,6 +5310,15 @@ export declare const iMellowWrapperAbi: readonly [{
5310
5310
  readonly stateMutability: "nonpayable";
5311
5311
  }];
5312
5312
  export declare const iMidasIssuanceVaultV310Abi: readonly [{
5313
+ readonly type: "function";
5314
+ readonly name: "paused";
5315
+ readonly inputs: readonly [];
5316
+ readonly outputs: readonly [{
5317
+ readonly name: "";
5318
+ readonly type: "bool";
5319
+ }];
5320
+ readonly stateMutability: "view";
5321
+ }, {
5313
5322
  readonly type: "function";
5314
5323
  readonly name: "depositInstant";
5315
5324
  readonly inputs: readonly [{
@@ -186,6 +186,15 @@ declare const abi: readonly [{
186
186
  }];
187
187
  type abi = typeof abi;
188
188
  declare const protocolAbi: readonly [{
189
+ readonly type: "function";
190
+ readonly name: "paused";
191
+ readonly inputs: readonly [];
192
+ readonly outputs: readonly [{
193
+ readonly name: "";
194
+ readonly type: "bool";
195
+ }];
196
+ readonly stateMutability: "view";
197
+ }, {
189
198
  readonly type: "function";
190
199
  readonly name: "depositInstant";
191
200
  readonly inputs: readonly [{
@@ -9,12 +9,14 @@ import "../base/index.js";
9
9
  import { Address } from "viem";
10
10
  //#region src/onchain/opportunities/MultichainOpportunitiesService.d.ts
11
11
  /**
12
- * Cross-chain counterpart of {@link OpportunitiesService}. Every read walks
13
- * loaded market state, so the block it reports is the SDK's snapshot.
12
+ * Cross-chain counterpart of {@link OpportunitiesService}. List and detail
13
+ * reads walk loaded market state; the mGLOBAL window reads live vault state.
14
14
  *
15
15
  * @typeParam Plugins - Map of attached plugin types.
16
16
  **/
17
17
  export declare class MultichainOpportunitiesService<const Plugins extends PluginsMap = {}> extends MultichainConstruct<Plugins> implements IMultichainOpportunitiesService {
18
+ /** {@inheritDoc IMultichainOpportunitiesService.isMGLOBALInvestmentWindowOpen} */
19
+ isMGLOBALInvestmentWindowOpen(): Promise<boolean>;
18
20
  /**
19
21
  * Opportunities of all queried chains, see {@link OpportunitiesService.list}.
20
22
  * A filter that names chains narrows the fan-out itself, so a chain whose
@@ -8,6 +8,11 @@ import { Address } from "viem";
8
8
  * the loaded markets expose.
9
9
  **/
10
10
  export interface IMultichainOpportunitiesService {
11
+ /**
12
+ * Whether the Mainnet mGLOBAL investment window is open: returns the
13
+ * issuance vault's `!paused()`. Chain-only; RPC and chain-resolution errors propagate.
14
+ */
15
+ isMGLOBALInvestmentWindowOpen(): Promise<boolean>;
11
16
  /**
12
17
  * Opportunities of all queried chains. A filter that names chains narrows
13
18
  * the fan-out itself, so a chain whose rows would be discarded is never
@@ -48,6 +48,8 @@ export declare class OpportunitiesNamespace extends AbstractNamespace<Multichain
48
48
  * {@inheritDoc IOpportunitiesBase.getStrategy}
49
49
  **/
50
50
  getStrategy(key: StrategyOpportunityKey): Promise<DataResponse<StrategyOpportunityDetail>>;
51
+ /** {@inheritDoc IOpportunitiesOnchainOnly.isMGLOBALInvestmentWindowOpen} */
52
+ isMGLOBALInvestmentWindowOpen(): Promise<boolean>;
51
53
  /**
52
54
  * {@inheritDoc IOpportunitiesOnchainOnly.isEligibleForStrategy}
53
55
  **/
@@ -74,6 +74,11 @@ export interface IOpportunitiesOffchainOnly {
74
74
  * Reads only the chain can answer.
75
75
  **/
76
76
  export interface IOpportunitiesOnchainOnly {
77
+ /**
78
+ * Whether the Mainnet mGLOBAL investment window is open: returns the
79
+ * issuance vault's `!paused()`. Chain-only; RPC and chain-resolution errors propagate.
80
+ */
81
+ isMGLOBALInvestmentWindowOpen(): Promise<boolean>;
77
82
  /**
78
83
  * What a deposit, withdrawal or leverage change would do, and the calldata
79
84
  * that does it.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/sdk",
3
- "version": "18.0.0",
3
+ "version": "18.1.0-next.1",
4
4
  "description": "Gearbox SDK",
5
5
  "license": "MIT",
6
6
  "repository": {