@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.
- package/dist/cjs/onchain/accounts/withdrawal-compressor/addresses.js +4 -0
- package/dist/cjs/onchain/market/adapters/abi/targetContractAbi.js +49 -36
- package/dist/cjs/onchain/opportunities/MultichainOpportunitiesService.js +11 -2
- package/dist/cjs/sdk/opportunities/OpportunitiesNamespace.js +4 -0
- package/dist/esm/onchain/accounts/withdrawal-compressor/addresses.js +4 -0
- package/dist/esm/onchain/market/adapters/abi/targetContractAbi.js +49 -36
- package/dist/esm/onchain/opportunities/MultichainOpportunitiesService.js +11 -2
- package/dist/esm/sdk/opportunities/OpportunitiesNamespace.js +4 -0
- package/dist/types/onchain/market/adapters/abi/targetContractAbi.d.ts +9 -0
- package/dist/types/onchain/market/adapters/contracts/MidasIssuanceVaultAdapterContract.d.ts +9 -0
- package/dist/types/onchain/opportunities/MultichainOpportunitiesService.d.ts +4 -2
- package/dist/types/onchain/opportunities/types.d.ts +5 -0
- package/dist/types/sdk/opportunities/OpportunitiesNamespace.d.ts +2 -0
- package/dist/types/sdk/opportunities/types.d.ts +5 -0
- package/package.json +1 -1
|
@@ -6075,44 +6075,57 @@ const iMellowWrapperAbi = [{
|
|
|
6075
6075
|
}],
|
|
6076
6076
|
stateMutability: "nonpayable"
|
|
6077
6077
|
}];
|
|
6078
|
-
const iMidasIssuanceVaultV310Abi = [
|
|
6079
|
-
|
|
6080
|
-
|
|
6081
|
-
|
|
6082
|
-
|
|
6083
|
-
|
|
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
|
-
|
|
6089
|
-
|
|
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}.
|
|
7
|
-
* loaded market state
|
|
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
|
**/
|
|
@@ -6074,44 +6074,57 @@ const iMellowWrapperAbi = [{
|
|
|
6074
6074
|
}],
|
|
6075
6075
|
stateMutability: "nonpayable"
|
|
6076
6076
|
}];
|
|
6077
|
-
const iMidasIssuanceVaultV310Abi = [
|
|
6078
|
-
|
|
6079
|
-
|
|
6080
|
-
|
|
6081
|
-
|
|
6082
|
-
|
|
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
|
-
|
|
6088
|
-
|
|
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}.
|
|
6
|
-
* loaded market state
|
|
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}.
|
|
13
|
-
* loaded market state
|
|
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.
|