@gearbox-protocol/sdk 16.3.0-next.1 → 16.3.0-next.2
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/abi/rwa/iMidasAccessControl.js +23 -0
- package/dist/cjs/abi/rwa/iMidasDegenNFT.js +92 -0
- package/dist/cjs/model/index.js +6 -1
- package/dist/cjs/model/opportunities.schema.js +3 -1
- package/dist/cjs/model/rwa.js +13 -0
- package/dist/cjs/model/rwa.schema.js +20 -0
- package/dist/cjs/offchain/opportunities/OffchainOpportunities.js +1 -1
- package/dist/cjs/onchain/accounts/liquidations/LiquidationsService.js +2 -2
- package/dist/cjs/onchain/index.js +8 -2
- package/dist/cjs/onchain/market/MarketSuite.js +3 -3
- package/dist/cjs/onchain/market/credit/CreditSuite.js +30 -0
- package/dist/cjs/onchain/market/index.js +8 -2
- package/dist/cjs/onchain/market/rwa/createDegenNFT.js +53 -0
- package/dist/cjs/onchain/market/rwa/index.js +7 -1
- package/dist/cjs/onchain/market/rwa/midas/MidasDegenNFT.js +56 -0
- package/dist/cjs/onchain/market/rwa/midas/constants.js +2 -0
- package/dist/cjs/onchain/market/rwa/midas/index.js +3 -0
- package/dist/cjs/onchain/market/rwa/securitize/SecuritizeDegenNFT.js +22 -3
- package/dist/cjs/onchain/market/rwa/securitize/SecuritizeRWAFactory.js +2 -2
- package/dist/cjs/onchain/market/rwa/securitize/constants.js +2 -0
- package/dist/cjs/onchain/market/rwa/securitize/index.js +3 -0
- package/dist/cjs/onchain/opportunities/MultichainOpportunitiesService.js +2 -2
- package/dist/cjs/onchain/opportunities/OpportunitiesService.js +11 -3
- package/dist/cjs/sdk/opportunities/OpportunitiesNamespace.js +19 -4
- package/dist/esm/abi/rwa/iMidasAccessControl.js +22 -0
- package/dist/esm/abi/rwa/iMidasDegenNFT.js +91 -0
- package/dist/esm/model/index.js +3 -2
- package/dist/esm/model/opportunities.schema.js +3 -1
- package/dist/esm/model/rwa.js +12 -1
- package/dist/esm/model/rwa.schema.js +18 -0
- package/dist/esm/offchain/opportunities/OffchainOpportunities.js +1 -1
- package/dist/esm/onchain/accounts/liquidations/LiquidationsService.js +2 -2
- package/dist/esm/onchain/index.js +5 -3
- package/dist/esm/onchain/market/MarketSuite.js +3 -3
- package/dist/esm/onchain/market/credit/CreditSuite.js +30 -0
- package/dist/esm/onchain/market/index.js +5 -3
- package/dist/esm/onchain/market/rwa/createDegenNFT.js +52 -0
- package/dist/esm/onchain/market/rwa/index.js +5 -3
- package/dist/esm/onchain/market/rwa/midas/MidasDegenNFT.js +55 -0
- package/dist/esm/onchain/market/rwa/midas/constants.js +2 -1
- package/dist/esm/onchain/market/rwa/midas/index.js +3 -2
- package/dist/esm/onchain/market/rwa/securitize/SecuritizeDegenNFT.js +20 -2
- package/dist/esm/onchain/market/rwa/securitize/SecuritizeRWAFactory.js +2 -2
- package/dist/esm/onchain/market/rwa/securitize/constants.js +2 -1
- package/dist/esm/onchain/market/rwa/securitize/index.js +3 -2
- package/dist/esm/onchain/opportunities/MultichainOpportunitiesService.js +2 -2
- package/dist/esm/onchain/opportunities/OpportunitiesService.js +11 -3
- package/dist/esm/sdk/opportunities/OpportunitiesNamespace.js +19 -4
- package/dist/types/abi/rwa/iMidasAccessControl.d.ts +22 -0
- package/dist/types/abi/rwa/iMidasDegenNFT.d.ts +82 -0
- package/dist/types/model/index.d.ts +3 -2
- package/dist/types/model/opportunities.d.ts +9 -0
- package/dist/types/model/opportunities.schema.d.ts +30 -0
- package/dist/types/model/rwa.d.ts +25 -1
- package/dist/types/model/rwa.schema.d.ts +29 -0
- package/dist/types/offchain/opportunities/OffchainOpportunities.d.ts +2 -1
- package/dist/types/offchain/opportunities/types.d.ts +4 -1
- package/dist/types/onchain/index.d.ts +8 -6
- package/dist/types/onchain/market/credit/CreditSuite.d.ts +12 -2
- package/dist/types/onchain/market/index.d.ts +8 -6
- package/dist/types/onchain/market/rwa/RWARegistry.d.ts +1 -1
- package/dist/types/onchain/market/rwa/createDegenNFT.d.ts +12 -0
- package/dist/types/onchain/market/rwa/index.d.ts +9 -7
- package/dist/types/onchain/market/rwa/midas/MidasDegenNFT.d.ts +98 -0
- package/dist/types/onchain/market/rwa/midas/constants.d.ts +2 -1
- package/dist/types/onchain/market/rwa/midas/index.d.ts +3 -2
- package/dist/types/onchain/market/rwa/securitize/SecuritizeDegenNFT.d.ts +8 -2
- package/dist/types/onchain/market/rwa/securitize/SecuritizeRWAFactory.d.ts +2 -2
- package/dist/types/onchain/market/rwa/securitize/constants.d.ts +2 -1
- package/dist/types/onchain/market/rwa/securitize/index.d.ts +4 -3
- package/dist/types/onchain/market/rwa/types.d.ts +20 -2
- package/dist/types/onchain/opportunities/MultichainOpportunitiesService.d.ts +2 -1
- package/dist/types/onchain/opportunities/OpportunitiesService.d.ts +5 -1
- package/dist/types/onchain/opportunities/types.d.ts +3 -2
- package/dist/types/sdk/opportunities/OpportunitiesNamespace.d.ts +2 -1
- package/dist/types/sdk/opportunities/types.d.ts +8 -2
- package/package.json +1 -1
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { BaseContract } from "../../../base/BaseContract.js";
|
|
2
|
+
import "../../../base/index.js";
|
|
3
|
+
import { iMidasGatewayV311Abi } from "../../adapters/abi/midas/iMidasGatewayV311.js";
|
|
4
|
+
import "../../adapters/abi/index.js";
|
|
5
|
+
import { iMidasDegenNFTAbi } from "../../../../abi/rwa/iMidasDegenNFT.js";
|
|
6
|
+
import "./constants.js";
|
|
7
|
+
import { iMidasAccessControlAbi } from "../../../../abi/rwa/iMidasAccessControl.js";
|
|
8
|
+
import { decodeAbiParameters } from "viem";
|
|
9
|
+
//#region src/onchain/market/rwa/midas/MidasDegenNFT.ts
|
|
10
|
+
const abi = iMidasDegenNFTAbi;
|
|
11
|
+
var MidasDegenNFT = class extends BaseContract {
|
|
12
|
+
protocol = "midas";
|
|
13
|
+
gateway;
|
|
14
|
+
accessControl;
|
|
15
|
+
greenlistedRole;
|
|
16
|
+
constructor(sdk, baseParams) {
|
|
17
|
+
super(sdk, {
|
|
18
|
+
...baseParams,
|
|
19
|
+
contractType: baseParams.contractType || "DEGEN_NFT::MIDAS",
|
|
20
|
+
name: "MidasDegenNFT",
|
|
21
|
+
abi
|
|
22
|
+
});
|
|
23
|
+
if (!baseParams.serializedParams) throw new Error(`MidasDegenNFT at ${baseParams.addr} is missing serializedParams`);
|
|
24
|
+
const [gateway, accessControl, greenlistedRole] = decodeAbiParameters([
|
|
25
|
+
{ type: "address" },
|
|
26
|
+
{ type: "address" },
|
|
27
|
+
{ type: "bytes32" }
|
|
28
|
+
], baseParams.serializedParams);
|
|
29
|
+
this.gateway = gateway;
|
|
30
|
+
this.accessControl = accessControl;
|
|
31
|
+
this.greenlistedRole = greenlistedRole;
|
|
32
|
+
}
|
|
33
|
+
/** Same predicate `MidasDegenNFT.burn` reverts on; the mToken rides along in the batch. */
|
|
34
|
+
async checkKyc(wallet, _targetCollateral) {
|
|
35
|
+
const [eligible, token] = await this.client.multicall({
|
|
36
|
+
allowFailure: false,
|
|
37
|
+
contracts: [{
|
|
38
|
+
abi: iMidasAccessControlAbi,
|
|
39
|
+
address: this.accessControl,
|
|
40
|
+
functionName: "hasRole",
|
|
41
|
+
args: [this.greenlistedRole, wallet]
|
|
42
|
+
}, {
|
|
43
|
+
abi: iMidasGatewayV311Abi,
|
|
44
|
+
address: this.gateway,
|
|
45
|
+
functionName: "mToken"
|
|
46
|
+
}]
|
|
47
|
+
});
|
|
48
|
+
return {
|
|
49
|
+
eligible,
|
|
50
|
+
token
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
//#endregion
|
|
55
|
+
export { MidasDegenNFT };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
//#region src/onchain/market/rwa/midas/constants.ts
|
|
2
2
|
const RWA_LIQUIDATOR_MIDAS = "RWA_LIQUIDATOR::MIDAS";
|
|
3
3
|
const PHANTOM_TOKEN_MIDAS_REDEMPTION = "PHANTOM_TOKEN::MIDAS_REDEMPTION";
|
|
4
|
+
const DEGEN_NFT_MIDAS = "DEGEN_NFT::MIDAS";
|
|
4
5
|
//#endregion
|
|
5
|
-
export { PHANTOM_TOKEN_MIDAS_REDEMPTION, RWA_LIQUIDATOR_MIDAS };
|
|
6
|
+
export { DEGEN_NFT_MIDAS, PHANTOM_TOKEN_MIDAS_REDEMPTION, RWA_LIQUIDATOR_MIDAS };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import { PHANTOM_TOKEN_MIDAS_REDEMPTION, RWA_LIQUIDATOR_MIDAS } from "./constants.js";
|
|
1
|
+
import { DEGEN_NFT_MIDAS, PHANTOM_TOKEN_MIDAS_REDEMPTION, RWA_LIQUIDATOR_MIDAS } from "./constants.js";
|
|
2
|
+
import { MidasDegenNFT } from "./MidasDegenNFT.js";
|
|
2
3
|
import { MidasLiquidatorContract } from "./MidasLiquidatorContract.js";
|
|
3
|
-
export { MidasLiquidatorContract, PHANTOM_TOKEN_MIDAS_REDEMPTION, RWA_LIQUIDATOR_MIDAS };
|
|
4
|
+
export { DEGEN_NFT_MIDAS, MidasDegenNFT, MidasLiquidatorContract, PHANTOM_TOKEN_MIDAS_REDEMPTION, RWA_LIQUIDATOR_MIDAS };
|
|
@@ -1,17 +1,35 @@
|
|
|
1
1
|
import { BaseContract } from "../../../base/BaseContract.js";
|
|
2
2
|
import "../../../base/index.js";
|
|
3
|
+
import { DEGEN_NFT_SECURITIZE } from "./constants.js";
|
|
3
4
|
import { iSecuritizeDegenNFTAbi } from "../../../../abi/rwa/iSecuritizeDegenNFT.js";
|
|
5
|
+
import { isAddressEqual } from "viem";
|
|
4
6
|
//#region src/onchain/market/rwa/securitize/SecuritizeDegenNFT.ts
|
|
5
7
|
const abi = iSecuritizeDegenNFTAbi;
|
|
6
8
|
var SecuritizeDegenNFT = class extends BaseContract {
|
|
7
|
-
|
|
9
|
+
protocol = "securitize";
|
|
10
|
+
factory;
|
|
11
|
+
constructor(sdk, address, factory) {
|
|
8
12
|
super(sdk, {
|
|
9
13
|
addr: address,
|
|
10
|
-
contractType:
|
|
14
|
+
contractType: DEGEN_NFT_SECURITIZE,
|
|
11
15
|
version: 310,
|
|
12
16
|
name: "SecuritizeDegenNFT",
|
|
13
17
|
abi
|
|
14
18
|
});
|
|
19
|
+
this.factory = factory;
|
|
20
|
+
}
|
|
21
|
+
/** Registration on Securitize is the only KYC step; pending EIP-712 signatures are not. */
|
|
22
|
+
async checkKyc(wallet, targetCollateral) {
|
|
23
|
+
const { factory } = this;
|
|
24
|
+
if (!factory.getTokens().some((t) => isAddressEqual(t, targetCollateral))) return {
|
|
25
|
+
eligible: true,
|
|
26
|
+
token: targetCollateral
|
|
27
|
+
};
|
|
28
|
+
const req = await factory.getOpenAccountRequirements(wallet, { tokenOutAddress: targetCollateral });
|
|
29
|
+
return {
|
|
30
|
+
eligible: !req || req.securitizeTokensToRegister.length === 0,
|
|
31
|
+
token: req?.securitizeTokensToRegister[0] ?? targetCollateral
|
|
32
|
+
};
|
|
15
33
|
}
|
|
16
34
|
};
|
|
17
35
|
//#endregion
|
|
@@ -5,8 +5,8 @@ import { BaseContract } from "../../../base/BaseContract.js";
|
|
|
5
5
|
import "../../../base/index.js";
|
|
6
6
|
import { RWA_FACTORY_SECURITIZE, SECURITIZE_REGISTER_VAULT_TYPES } from "../../../../model/rwa.js";
|
|
7
7
|
import "../../../../model/index.js";
|
|
8
|
-
import { iSecuritizeRWAFactoryAbi } from "../../../../abi/rwa/iSecuritizeRWAFactory.js";
|
|
9
8
|
import { SecuritizeDegenNFT } from "./SecuritizeDegenNFT.js";
|
|
9
|
+
import { iSecuritizeRWAFactoryAbi } from "../../../../abi/rwa/iSecuritizeRWAFactory.js";
|
|
10
10
|
import { decodeAbiParameters } from "viem";
|
|
11
11
|
//#region src/onchain/market/rwa/securitize/SecuritizeRWAFactory.ts
|
|
12
12
|
const abi = iSecuritizeRWAFactoryAbi;
|
|
@@ -53,7 +53,7 @@ var SecuritizeRWAFactory = class extends BaseContract {
|
|
|
53
53
|
}
|
|
54
54
|
], data.baseParams.serializedParams);
|
|
55
55
|
this.owner = decoded[0];
|
|
56
|
-
this.degenNFT = new SecuritizeDegenNFT(sdk, decoded[1]);
|
|
56
|
+
this.degenNFT = new SecuritizeDegenNFT(sdk, decoded[1], this);
|
|
57
57
|
for (const t of data.tokens) this.tokensMeta.upsert(t.addr, t);
|
|
58
58
|
this.dsTokens = decoded[2].map((t) => ({
|
|
59
59
|
address: t.token,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
//#region src/onchain/market/rwa/securitize/constants.ts
|
|
2
2
|
const RWA_LIQUIDATOR_SECURITIZE = "RWA_LIQUIDATOR::SECURITIZE";
|
|
3
3
|
const PHANTOM_TOKEN_SECURITIZE_REDEMPTION = "PHANTOM_TOKEN::SECURITIZE_RD";
|
|
4
|
+
const DEGEN_NFT_SECURITIZE = "DEGEN_NFT::SECURITIZE";
|
|
4
5
|
//#endregion
|
|
5
|
-
export { PHANTOM_TOKEN_SECURITIZE_REDEMPTION, RWA_LIQUIDATOR_SECURITIZE };
|
|
6
|
+
export { DEGEN_NFT_SECURITIZE, PHANTOM_TOKEN_SECURITIZE_REDEMPTION, RWA_LIQUIDATOR_SECURITIZE };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { PHANTOM_TOKEN_SECURITIZE_REDEMPTION, RWA_LIQUIDATOR_SECURITIZE } from "./constants.js";
|
|
1
|
+
import { DEGEN_NFT_SECURITIZE, PHANTOM_TOKEN_SECURITIZE_REDEMPTION, RWA_LIQUIDATOR_SECURITIZE } from "./constants.js";
|
|
2
|
+
import { SecuritizeDegenNFT } from "./SecuritizeDegenNFT.js";
|
|
2
3
|
import { SecuritizeLiquidatorContract } from "./SecuritizeLiquidatorContract.js";
|
|
3
4
|
import { SecuritizeRWAFactory } from "./SecuritizeRWAFactory.js";
|
|
4
5
|
import "./types.js";
|
|
5
|
-
export { PHANTOM_TOKEN_SECURITIZE_REDEMPTION, RWA_LIQUIDATOR_SECURITIZE, SecuritizeLiquidatorContract, SecuritizeRWAFactory };
|
|
6
|
+
export { DEGEN_NFT_SECURITIZE, PHANTOM_TOKEN_SECURITIZE_REDEMPTION, RWA_LIQUIDATOR_SECURITIZE, SecuritizeDegenNFT, SecuritizeLiquidatorContract, SecuritizeRWAFactory };
|
|
@@ -37,10 +37,10 @@ var MultichainOpportunitiesService = class extends MultichainConstruct {
|
|
|
37
37
|
*
|
|
38
38
|
* See {@link MultichainOpportunitiesService.getPool}.
|
|
39
39
|
**/
|
|
40
|
-
async getStrategy(key) {
|
|
40
|
+
async getStrategy(key, wallet) {
|
|
41
41
|
return this.queryChain({
|
|
42
42
|
network: key.chainId,
|
|
43
|
-
run: (sdk) => sdk.opportunities.getStrategy(key)
|
|
43
|
+
run: (sdk) => sdk.opportunities.getStrategy(key, wallet)
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
46
|
};
|
|
@@ -36,13 +36,21 @@ var OpportunitiesService = class extends SDKConstruct {
|
|
|
36
36
|
* A single strategy opportunity plus the rate curve of the pool it borrows
|
|
37
37
|
* from and the price feeds its liquidation price depends on.
|
|
38
38
|
*
|
|
39
|
+
* @param wallet - When given, `kyc` says whether this wallet must register
|
|
40
|
+
* with the strategy's KYC provider first; `null` otherwise.
|
|
41
|
+
*
|
|
39
42
|
* @throws If the credit manager is unknown, or does not currently offer a
|
|
40
43
|
* strategy.
|
|
41
44
|
**/
|
|
42
|
-
async getStrategy(key) {
|
|
43
|
-
const
|
|
45
|
+
async getStrategy(key, wallet) {
|
|
46
|
+
const suite = this.sdk.marketRegister.findCreditManager(key.creditManager);
|
|
47
|
+
const detail = suite.strategyOpportunityDetail();
|
|
44
48
|
if (!detail) throw new Error(`credit manager ${key.creditManager} does not currently offer a strategy`);
|
|
45
|
-
|
|
49
|
+
const kyc = wallet ? await suite.kycRequirement(wallet, detail.targetCollateral.address) : null;
|
|
50
|
+
return {
|
|
51
|
+
...detail,
|
|
52
|
+
kyc
|
|
53
|
+
};
|
|
46
54
|
}
|
|
47
55
|
};
|
|
48
56
|
//#endregion
|
|
@@ -22,7 +22,7 @@ var OpportunitiesNamespace = class extends AbstractNamespace {
|
|
|
22
22
|
merge = {
|
|
23
23
|
list: (onchain, offchain) => mergeChainList(onchain, offchain, this.maxOffchainLagSeconds),
|
|
24
24
|
pool: (onchain, offchain) => mergeChainOne(onchain, offchain, this.maxOffchainLagSeconds),
|
|
25
|
-
strategy: (onchain, offchain) => mergeChainOne(onchain, offchain, this.maxOffchainLagSeconds)
|
|
25
|
+
strategy: (onchain, offchain) => overlayOnchainKyc(mergeChainOne(onchain, offchain, this.maxOffchainLagSeconds), onchain)
|
|
26
26
|
};
|
|
27
27
|
#prepare;
|
|
28
28
|
#execute;
|
|
@@ -70,11 +70,11 @@ var OpportunitiesNamespace = class extends AbstractNamespace {
|
|
|
70
70
|
/**
|
|
71
71
|
* {@inheritDoc IOpportunitiesBase.getStrategy}
|
|
72
72
|
**/
|
|
73
|
-
async getStrategy(key) {
|
|
73
|
+
async getStrategy(key, wallet) {
|
|
74
74
|
return this.merged("get strategy opportunity", {
|
|
75
75
|
chainIds: [key.chainId],
|
|
76
|
-
fromChain: (source) => source.getStrategy(key),
|
|
77
|
-
fromBackend: (source) => source.getStrategy(key),
|
|
76
|
+
fromChain: (source) => source.getStrategy(key, wallet),
|
|
77
|
+
fromBackend: (source) => source.getStrategy(key, wallet),
|
|
78
78
|
merge: this.merge.strategy
|
|
79
79
|
});
|
|
80
80
|
}
|
|
@@ -94,5 +94,20 @@ var OpportunitiesNamespace = class extends AbstractNamespace {
|
|
|
94
94
|
return this.offchain.getCharts(key, metrics, range);
|
|
95
95
|
}
|
|
96
96
|
};
|
|
97
|
+
/**
|
|
98
|
+
* Freshness still picks the body; `kyc` is taken from a successful chain
|
|
99
|
+
* response because the backend does not evaluate it.
|
|
100
|
+
**/
|
|
101
|
+
function overlayOnchainKyc(merged, onchain) {
|
|
102
|
+
if (!merged || !onchain || onchain.meta.chains[0]?.status !== "success") return merged;
|
|
103
|
+
if (merged === onchain) return merged;
|
|
104
|
+
return {
|
|
105
|
+
...merged,
|
|
106
|
+
data: {
|
|
107
|
+
...merged.data,
|
|
108
|
+
kyc: onchain.data.kyc
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
}
|
|
97
112
|
//#endregion
|
|
98
113
|
export { OpportunitiesNamespace };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//#region src/abi/rwa/iMidasAccessControl.d.ts
|
|
2
|
+
declare const iMidasAccessControlAbi: readonly [{
|
|
3
|
+
readonly type: "function";
|
|
4
|
+
readonly name: "hasRole";
|
|
5
|
+
readonly inputs: readonly [{
|
|
6
|
+
readonly name: "role";
|
|
7
|
+
readonly type: "bytes32";
|
|
8
|
+
readonly internalType: "bytes32";
|
|
9
|
+
}, {
|
|
10
|
+
readonly name: "account";
|
|
11
|
+
readonly type: "address";
|
|
12
|
+
readonly internalType: "address";
|
|
13
|
+
}];
|
|
14
|
+
readonly outputs: readonly [{
|
|
15
|
+
readonly name: "";
|
|
16
|
+
readonly type: "bool";
|
|
17
|
+
readonly internalType: "bool";
|
|
18
|
+
}];
|
|
19
|
+
readonly stateMutability: "view";
|
|
20
|
+
}];
|
|
21
|
+
//#endregion
|
|
22
|
+
export { iMidasAccessControlAbi };
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
//#region src/abi/rwa/iMidasDegenNFT.d.ts
|
|
2
|
+
declare const iMidasDegenNFTAbi: readonly [{
|
|
3
|
+
readonly type: "function";
|
|
4
|
+
readonly name: "accessControl";
|
|
5
|
+
readonly inputs: readonly [];
|
|
6
|
+
readonly outputs: readonly [{
|
|
7
|
+
readonly name: "";
|
|
8
|
+
readonly type: "address";
|
|
9
|
+
readonly internalType: "address";
|
|
10
|
+
}];
|
|
11
|
+
readonly stateMutability: "view";
|
|
12
|
+
}, {
|
|
13
|
+
readonly type: "function";
|
|
14
|
+
readonly name: "burn";
|
|
15
|
+
readonly inputs: readonly [{
|
|
16
|
+
readonly name: "from";
|
|
17
|
+
readonly type: "address";
|
|
18
|
+
readonly internalType: "address";
|
|
19
|
+
}, {
|
|
20
|
+
readonly name: "";
|
|
21
|
+
readonly type: "uint256";
|
|
22
|
+
readonly internalType: "uint256";
|
|
23
|
+
}];
|
|
24
|
+
readonly outputs: readonly [];
|
|
25
|
+
readonly stateMutability: "view";
|
|
26
|
+
}, {
|
|
27
|
+
readonly type: "function";
|
|
28
|
+
readonly name: "contractType";
|
|
29
|
+
readonly inputs: readonly [];
|
|
30
|
+
readonly outputs: readonly [{
|
|
31
|
+
readonly name: "";
|
|
32
|
+
readonly type: "bytes32";
|
|
33
|
+
readonly internalType: "bytes32";
|
|
34
|
+
}];
|
|
35
|
+
readonly stateMutability: "view";
|
|
36
|
+
}, {
|
|
37
|
+
readonly type: "function";
|
|
38
|
+
readonly name: "gateway";
|
|
39
|
+
readonly inputs: readonly [];
|
|
40
|
+
readonly outputs: readonly [{
|
|
41
|
+
readonly name: "";
|
|
42
|
+
readonly type: "address";
|
|
43
|
+
readonly internalType: "address";
|
|
44
|
+
}];
|
|
45
|
+
readonly stateMutability: "view";
|
|
46
|
+
}, {
|
|
47
|
+
readonly type: "function";
|
|
48
|
+
readonly name: "greenlistedRole";
|
|
49
|
+
readonly inputs: readonly [];
|
|
50
|
+
readonly outputs: readonly [{
|
|
51
|
+
readonly name: "";
|
|
52
|
+
readonly type: "bytes32";
|
|
53
|
+
readonly internalType: "bytes32";
|
|
54
|
+
}];
|
|
55
|
+
readonly stateMutability: "view";
|
|
56
|
+
}, {
|
|
57
|
+
readonly type: "function";
|
|
58
|
+
readonly name: "serialize";
|
|
59
|
+
readonly inputs: readonly [];
|
|
60
|
+
readonly outputs: readonly [{
|
|
61
|
+
readonly name: "";
|
|
62
|
+
readonly type: "bytes";
|
|
63
|
+
readonly internalType: "bytes";
|
|
64
|
+
}];
|
|
65
|
+
readonly stateMutability: "view";
|
|
66
|
+
}, {
|
|
67
|
+
readonly type: "function";
|
|
68
|
+
readonly name: "version";
|
|
69
|
+
readonly inputs: readonly [];
|
|
70
|
+
readonly outputs: readonly [{
|
|
71
|
+
readonly name: "";
|
|
72
|
+
readonly type: "uint256";
|
|
73
|
+
readonly internalType: "uint256";
|
|
74
|
+
}];
|
|
75
|
+
readonly stateMutability: "view";
|
|
76
|
+
}, {
|
|
77
|
+
readonly type: "error";
|
|
78
|
+
readonly name: "NotGreenlistedException";
|
|
79
|
+
readonly inputs: readonly [];
|
|
80
|
+
}];
|
|
81
|
+
//#endregion
|
|
82
|
+
export { iMidasDegenNFTAbi };
|
|
@@ -5,7 +5,7 @@ import { Curator, CuratorName } from "./curators.js";
|
|
|
5
5
|
import { DelayedAddCollateralIntent, DelayedCloseAccountIntent, DelayedDecreaseLeverageIntent, DelayedDepositAndIncreaseLeverageIntent, DelayedDepositIntent, DelayedIncreaseLeverageIntent, DelayedIntent, DelayedWithdrawCollateralIntent } from "./delayed-intents.js";
|
|
6
6
|
import { IGearboxError } from "./errors/base.js";
|
|
7
7
|
import { CreditAccountFrozenError, LiquidatorNotEligibleError, NotEmergencyLiquidatorError, creditAccountFrozen, liquidatorNotEligible, notEmergencyLiquidator } from "./errors/liquidation-errors.js";
|
|
8
|
-
import { RWAFactoryType, RWAMissingOpenAccountRequirements, RWAOpenAccountRequirements, RWAOperationArgs, RWA_FACTORY_SECURITIZE, RWA_FACTORY_TYPES, SECURITIZE_REGISTER_VAULT_TYPES, SecuritizeMissingOpenAccountRequirements, SecuritizeOpenAccountRequirements, SecuritizeOperationArgs, SecuritizeRegisterMessage, SecuritizeRegisterVaultMessage, SecuritizeSignature } from "./rwa.js";
|
|
8
|
+
import { KYC_PROTOCOLS, KYC_REGISTRATION_LINKS, KycProtocol, KycRequirement, RWAFactoryType, RWAMissingOpenAccountRequirements, RWAOpenAccountRequirements, RWAOperationArgs, RWA_FACTORY_SECURITIZE, RWA_FACTORY_TYPES, SECURITIZE_REGISTER_VAULT_TYPES, SecuritizeMissingOpenAccountRequirements, SecuritizeOpenAccountRequirements, SecuritizeOperationArgs, SecuritizeRegisterMessage, SecuritizeRegisterVaultMessage, SecuritizeSignature } from "./rwa.js";
|
|
9
9
|
import { BorrowLimitCause, CreditManagerPausedError, DebtOutOfRangeError, ForbiddenTokenError, InsufficientAllowanceError, InsufficientBalanceError, InsufficientCollateralError, InsufficientPoolLiquidityError, LeverageOutOfRangeError, MarketExpiredError, PoolPausedError, PoolSunsetError, QuotaCountExceededError, QuotaLimitReachedError, RWAOpenRequirementsError, creditManagerPaused, debtOutOfRange, forbiddenToken, insufficientAllowance, insufficientBalance, insufficientCollateral, insufficientPoolLiquidity, leverageOutOfRange, marketExpired, poolPaused, poolSunset, quotaCountExceeded, quotaLimitReached, rwaOpenRequirementsNotMet } from "./errors/operation-errors.js";
|
|
10
10
|
import { UnpriceableTokenError, unpriceableTokenError } from "./errors/oracle-errors.js";
|
|
11
11
|
import { CreditAccountNotEmptyError, CreditAccountNotFoundError, EmptyOpenTakesNothingError, MultipleDelayedWithdrawalsError, NoDelayedRouteError, NoRecordedIntentError, NoStrategyTargetCollateralError, UnexpectedFailureError, UnsupportedCollateralTokenError, UnsupportedTokenPairError, WithdrawalInProgressError, creditAccountNotEmpty, creditAccountNotFound, emptyOpenTakesNothing, multipleDelayedWithdrawals, noDelayedRoute, noRecordedIntent, noStrategyTargetCollateral, unexpectedFailure, unsupportedCollateralToken, unsupportedTokenPair, withdrawalInProgress } from "./errors/prepare-errors.js";
|
|
@@ -30,6 +30,7 @@ import { amountSchema, assetTypeSchema, bpsSchema, chainIdSchema, leverageSchema
|
|
|
30
30
|
import { ChainFailed, ChainMetadata, ChainScoped, ChainSucceeded, DataResponse, DataSource, ResponseMetadata } from "./response.js";
|
|
31
31
|
import { chainFailedSchema, chainMetadataSchema, chainSucceededSchema, dataSourceSchema, responseMetadataSchema, responseSchema } from "./response.schema.js";
|
|
32
32
|
import { SDKError, SDKResult, SDKReturn, SafeValue, safeValue, sdkErr, sdkOk } from "./result.js";
|
|
33
|
+
import { kycProtocolSchema, kycRequirementSchema } from "./rwa.schema.js";
|
|
33
34
|
import { PositionClaimableWithdrawal, PositionPendingWithdrawal, PositionWithdrawals, WithdrawalOutputAmount } from "./withdrawals.js";
|
|
34
35
|
import { positionClaimableWithdrawalSchema, positionPendingWithdrawalSchema, positionWithdrawalsSchema, withdrawalOutputAmountSchema } from "./withdrawals.schema.js";
|
|
35
|
-
export { ANALYTICS_POSITIONS_DEFAULT_LIMIT, ANALYTICS_POSITIONS_MAX_LIMIT, AccountHoldings, AccountMetrics, AccountProjection, AccountStateChange, AdjustStrategyPositionPreview, Amount, AnalyticsChartQuery, AnalyticsLiquidationPosition, AnalyticsPoolPosition, AnalyticsPosition, AnalyticsPositionListOptions, AnalyticsPositionOwner, AnalyticsPositionPage, AnalyticsPositionSortField, AnalyticsSortDirection, AnalyticsStrategyPosition, ApyBreakdown, Asset, AssetType, BorrowLimitCause, BorrowRateBreakdown, Bps, CHART_METRIC_UNITS, CHART_RANGES, CHART_UNAVAILABLE_CODES, ChainFailed, ChainId, ChainMetadata, ChainScoped, ChainScopedFilter, ChainSucceeded, ChartBundle, ChartDenomination, ChartMetric, ChartQuery, ChartRange, ChartSeries, ChartSeriesOk, ChartSeriesUnavailable, ChartUnavailableCode, ChartUnit, ChartValue, ChartWindow, CompareTag, CompareTolerance, CreditAccountFrozenError, CreditAccountNotEmptyError, CreditAccountNotFoundError, CreditManagerPausedError, CreditOperationMarket, Curator, CuratorName, DataResponse, DataSource, DebtOutOfRangeError, DelayedAddCollateralIntent, DelayedCloseAccountIntent, DelayedDecreaseLeverageIntent, DelayedDepositAndIncreaseLeverageIntent, DelayedDepositIntent, DelayedIncreaseLeverageIntent, DelayedIntent, DelayedReceivedAsset, DelayedStrategyPositionOperationPreview, DelayedWithdrawCollateralIntent, EmptyOpenTakesNothingError, Estimated, EstimatedProjection, ExitStrategyPositionPreview, FILTER_ALL, FilterAll, Filterable, ForbiddenTokenError, GridSampling, IGearboxError, InstantReceivedAsset, InstantStrategyPositionOperationPreview, InsufficientAllowanceError, InsufficientBalanceError, InsufficientCollateralError, InsufficientPoolLiquidityError, InvalidDelayedIntentError, Leverage, LeverageOutOfRangeError, LiquidatableAccount, LiquidatableAccountFilter, LiquidationApproval, LiquidationDetails, LiquidationPosition, LiquidatorNotEligibleError, MalformedTransactionError, MarketExpiredError, MultipleDelayedWithdrawalsError, NoDelayedRouteError, NoRecordedIntentError, NoStrategyTargetCollateralError, NotEmergencyLiquidatorError, Notice, NoticeKind, NoticeSubject, OpenNonRWAStrategyPositionPreview, OpenRWAStrategyPositionPreview, OpenStrategyPositionPreview, OperationPreview, Opportunity, OpportunityBase, OpportunityChartMetric, OpportunityDetail, OpportunityFilter, OpportunityId, OpportunityKey, OpportunityKind, OpportunityTotals, POOL_OPPORTUNITY_CHART_METRICS, POOL_POSITION_CHART_METRICS, PROTOCOL_CHART_METRICS, PnlBreakdown, PointRewards, PointsProgram, PointsProgramPnL, PointsRewardsPnL, PoolOperationPreviewError, PoolOperationType, PoolOpportunity, PoolOpportunityChartMetric, PoolOpportunityDetail, PoolOpportunityKey, PoolOpportunityRef, PoolPausedError, PoolPosition, PoolPositionChartMetric, PoolPositionKey, PoolPositionOperationPreview, PoolPositionRef, PoolSunsetError, Position, PositionChartMetric, PositionClaimableWithdrawal, PositionCollateral, PositionFilter, PositionId, PositionKey, PositionKind, PositionPendingWithdrawal, PositionTransaction, PositionTransactionKind, PositionWithdrawals, PositionsTotals, PreviewOperationInput, PreviewOperationOptions, PriceFeedData, PriceFeedSummary, ProtocolChartMetric, QuotaAsset, QuotaCountExceededError, QuotaLimitReachedError, RWAFactoryType, RWAMissingOpenAccountRequirements, RWAOpenAccountRequirements, RWAOpenRequirementsError, RWAOperationArgs, RWA_FACTORY_SECURITIZE, RWA_FACTORY_TYPES, RateCurve, RateCurvePoint, ReceivedAsset, RepayStrategyPositionPreview, ResponseMetadata, Rewards, RewardsPnL, RoutedField, SDKError, SDKResult, SDKReturn, SECURITIZE_REGISTER_VAULT_TYPES, STRATEGY_OPPORTUNITY_CHART_METRICS, STRATEGY_POSITION_CHART_METRICS, STRATEGY_POSITION_COLLATERAL_ERROR, SafeValue, SecuritizeMissingOpenAccountRequirements, SecuritizeOpenAccountRequirements, SecuritizeOperationArgs, SecuritizeRegisterMessage, SecuritizeRegisterVaultMessage, SecuritizeSignature, StrategyOpportunity, StrategyOpportunityChartMetric, StrategyOpportunityDetail, StrategyOpportunityKey, StrategyOpportunityRef, StrategyPosition, StrategyPositionChartMetric, StrategyPositionKey, StrategyPositionRef, Timestamp, Token, TokenAmount, TokenQuotaRate, TokenRewards, TokenRewardsPnL, ToleranceCompareTag, TxCall, UnderlyingToken, UnexpectedFailureError, UnpriceableTokenError, UnsupportedCollateralTokenError, UnsupportedOperationError, UnsupportedPoolFunctionError, UnsupportedTargetError, UnsupportedTokenPairError, UnsupportedZapperFunctionError, WithdrawalInProgressError, WithdrawalOutputAmount, amountSchema, analyticsChartQueryOptionsSchema, analyticsChartQueryParamsSchema, analyticsChartQuerySchema, analyticsPositionListOptionsSchema, analyticsPositionListQueryParamsSchema, analyticsPositionListQuerySchema, analyticsPositionPageSchema, analyticsPositionSchema, analyticsPositionSortFieldSchema, analyticsSortDirectionSchema, apyBreakdownSchema, asEstimated, assetTypeSchema, backendPreferred, booleanParamSchema, borrowRateBreakdownSchema, bpsSchema, chainFailedSchema, chainIdSchema, chainMetadataSchema, chainSucceededSchema, chartBundleSchemaFor, chartDenominationSchema, chartMetricSchema, chartQueryCodec, chartQueryParamsSchema, chartQuerySchema, chartRangeSchema, chartSeriesSchema, chartValueSchema, chartWindowSchema, compareTagOf, creditAccountFrozen, creditAccountNotEmpty, creditAccountNotFound, creditManagerPaused, curatorNameSchema, curatorSchema, dataSourceSchema, debtOutOfRange, delayedReceivedAssetSchema, emptyOpenTakesNothing, encodeFlag, filterAllSchema, filterable, forbiddenToken, instantReceivedAssetSchema, insufficientAllowance, insufficientBalance, insufficientCollateral, insufficientPoolLiquidity, isFilterSet, leverageOutOfRange, leverageSchema, liquidatableAccountFilterSchema, liquidatableAccountSchema, liquidationApprovalSchema, liquidationDetailsSchema, liquidationPositionId, liquidationPositionSchema, liquidatorNotEligible, malformedTransaction, marketExpired, matchesLiquidatableAccountFilter, matchesOpportunityFilter, matchesPositionFilter, multipleDelayedWithdrawals, noDelayedRoute, noRecordedIntent, noStrategyTargetCollateral, notEmergencyLiquidator, noticeKindSchema, noticeSchema, offchainOnly, onchainOnly, opportunityBaseSchema, opportunityDetailSchema, opportunityFilterQueryParamsSchema, opportunityFilterQuerySchema, opportunityFilterSchema, opportunityId, opportunityKeySchema, opportunityKindSchema, opportunitySchema, opportunityTotalsSchema, pnlBreakdownSchema, pointRewardsSchema, pointsProgramPnLSchema, pointsProgramSchema, pointsRewardsPnLSchema, poolOpportunityChartMetricSchema, poolOpportunityDetailSchema, poolOpportunityId, poolOpportunityKeySchema, poolOpportunitySchema, poolPaused, poolPositionChartMetricSchema, poolPositionId, poolPositionKeySchema, poolPositionSchema, poolSunset, positionClaimableWithdrawalSchema, positionCollateralSchema, positionFilterQueryParamsSchema, positionFilterQuerySchema, positionFilterSchema, positionId, positionKeySchema, positionKindSchema, positionPendingWithdrawalSchema, positionSchema, positionTransactionKindSchema, positionTransactionSchema, positionWithdrawalsSchema, positionsTotalsSchema, priceFeedDataSchema, priceFeedSummarySchema, protocolChartMetricSchema, quotaAssetSchema, quotaCountExceeded, quotaLimitReached, rateCurvePointSchema, rateCurveSchema, receivedAssetSchema, responseMetadataSchema, responseSchema, rewardsPnLSchema, rewardsSchema, rwaOpenRequirementsNotMet, safeValue, sdkErr, sdkOk, strategyOpportunityChartMetricSchema, strategyOpportunityDetailSchema, strategyOpportunityId, strategyOpportunityKeySchema, strategyOpportunitySchema, strategyPositionChartMetricSchema, strategyPositionId, strategyPositionKeySchema, strategyPositionSchema, timestampSchema, tokenAmountSchema, tokenQuotaRateSchema, tokenRewardsPnLSchema, tokenRewardsSchema, tokenSchema, tolerance, txCallSchema, underlyingTokenSchema, unexpectedFailure, unpriceableTokenError, unsupportedCollateralToken, unsupportedTokenPair, withdrawalInProgress, withdrawalOutputAmountSchema };
|
|
36
|
+
export { ANALYTICS_POSITIONS_DEFAULT_LIMIT, ANALYTICS_POSITIONS_MAX_LIMIT, AccountHoldings, AccountMetrics, AccountProjection, AccountStateChange, AdjustStrategyPositionPreview, Amount, AnalyticsChartQuery, AnalyticsLiquidationPosition, AnalyticsPoolPosition, AnalyticsPosition, AnalyticsPositionListOptions, AnalyticsPositionOwner, AnalyticsPositionPage, AnalyticsPositionSortField, AnalyticsSortDirection, AnalyticsStrategyPosition, ApyBreakdown, Asset, AssetType, BorrowLimitCause, BorrowRateBreakdown, Bps, CHART_METRIC_UNITS, CHART_RANGES, CHART_UNAVAILABLE_CODES, ChainFailed, ChainId, ChainMetadata, ChainScoped, ChainScopedFilter, ChainSucceeded, ChartBundle, ChartDenomination, ChartMetric, ChartQuery, ChartRange, ChartSeries, ChartSeriesOk, ChartSeriesUnavailable, ChartUnavailableCode, ChartUnit, ChartValue, ChartWindow, CompareTag, CompareTolerance, CreditAccountFrozenError, CreditAccountNotEmptyError, CreditAccountNotFoundError, CreditManagerPausedError, CreditOperationMarket, Curator, CuratorName, DataResponse, DataSource, DebtOutOfRangeError, DelayedAddCollateralIntent, DelayedCloseAccountIntent, DelayedDecreaseLeverageIntent, DelayedDepositAndIncreaseLeverageIntent, DelayedDepositIntent, DelayedIncreaseLeverageIntent, DelayedIntent, DelayedReceivedAsset, DelayedStrategyPositionOperationPreview, DelayedWithdrawCollateralIntent, EmptyOpenTakesNothingError, Estimated, EstimatedProjection, ExitStrategyPositionPreview, FILTER_ALL, FilterAll, Filterable, ForbiddenTokenError, GridSampling, IGearboxError, InstantReceivedAsset, InstantStrategyPositionOperationPreview, InsufficientAllowanceError, InsufficientBalanceError, InsufficientCollateralError, InsufficientPoolLiquidityError, InvalidDelayedIntentError, KYC_PROTOCOLS, KYC_REGISTRATION_LINKS, KycProtocol, KycRequirement, Leverage, LeverageOutOfRangeError, LiquidatableAccount, LiquidatableAccountFilter, LiquidationApproval, LiquidationDetails, LiquidationPosition, LiquidatorNotEligibleError, MalformedTransactionError, MarketExpiredError, MultipleDelayedWithdrawalsError, NoDelayedRouteError, NoRecordedIntentError, NoStrategyTargetCollateralError, NotEmergencyLiquidatorError, Notice, NoticeKind, NoticeSubject, OpenNonRWAStrategyPositionPreview, OpenRWAStrategyPositionPreview, OpenStrategyPositionPreview, OperationPreview, Opportunity, OpportunityBase, OpportunityChartMetric, OpportunityDetail, OpportunityFilter, OpportunityId, OpportunityKey, OpportunityKind, OpportunityTotals, POOL_OPPORTUNITY_CHART_METRICS, POOL_POSITION_CHART_METRICS, PROTOCOL_CHART_METRICS, PnlBreakdown, PointRewards, PointsProgram, PointsProgramPnL, PointsRewardsPnL, PoolOperationPreviewError, PoolOperationType, PoolOpportunity, PoolOpportunityChartMetric, PoolOpportunityDetail, PoolOpportunityKey, PoolOpportunityRef, PoolPausedError, PoolPosition, PoolPositionChartMetric, PoolPositionKey, PoolPositionOperationPreview, PoolPositionRef, PoolSunsetError, Position, PositionChartMetric, PositionClaimableWithdrawal, PositionCollateral, PositionFilter, PositionId, PositionKey, PositionKind, PositionPendingWithdrawal, PositionTransaction, PositionTransactionKind, PositionWithdrawals, PositionsTotals, PreviewOperationInput, PreviewOperationOptions, PriceFeedData, PriceFeedSummary, ProtocolChartMetric, QuotaAsset, QuotaCountExceededError, QuotaLimitReachedError, RWAFactoryType, RWAMissingOpenAccountRequirements, RWAOpenAccountRequirements, RWAOpenRequirementsError, RWAOperationArgs, RWA_FACTORY_SECURITIZE, RWA_FACTORY_TYPES, RateCurve, RateCurvePoint, ReceivedAsset, RepayStrategyPositionPreview, ResponseMetadata, Rewards, RewardsPnL, RoutedField, SDKError, SDKResult, SDKReturn, SECURITIZE_REGISTER_VAULT_TYPES, STRATEGY_OPPORTUNITY_CHART_METRICS, STRATEGY_POSITION_CHART_METRICS, STRATEGY_POSITION_COLLATERAL_ERROR, SafeValue, SecuritizeMissingOpenAccountRequirements, SecuritizeOpenAccountRequirements, SecuritizeOperationArgs, SecuritizeRegisterMessage, SecuritizeRegisterVaultMessage, SecuritizeSignature, StrategyOpportunity, StrategyOpportunityChartMetric, StrategyOpportunityDetail, StrategyOpportunityKey, StrategyOpportunityRef, StrategyPosition, StrategyPositionChartMetric, StrategyPositionKey, StrategyPositionRef, Timestamp, Token, TokenAmount, TokenQuotaRate, TokenRewards, TokenRewardsPnL, ToleranceCompareTag, TxCall, UnderlyingToken, UnexpectedFailureError, UnpriceableTokenError, UnsupportedCollateralTokenError, UnsupportedOperationError, UnsupportedPoolFunctionError, UnsupportedTargetError, UnsupportedTokenPairError, UnsupportedZapperFunctionError, WithdrawalInProgressError, WithdrawalOutputAmount, amountSchema, analyticsChartQueryOptionsSchema, analyticsChartQueryParamsSchema, analyticsChartQuerySchema, analyticsPositionListOptionsSchema, analyticsPositionListQueryParamsSchema, analyticsPositionListQuerySchema, analyticsPositionPageSchema, analyticsPositionSchema, analyticsPositionSortFieldSchema, analyticsSortDirectionSchema, apyBreakdownSchema, asEstimated, assetTypeSchema, backendPreferred, booleanParamSchema, borrowRateBreakdownSchema, bpsSchema, chainFailedSchema, chainIdSchema, chainMetadataSchema, chainSucceededSchema, chartBundleSchemaFor, chartDenominationSchema, chartMetricSchema, chartQueryCodec, chartQueryParamsSchema, chartQuerySchema, chartRangeSchema, chartSeriesSchema, chartValueSchema, chartWindowSchema, compareTagOf, creditAccountFrozen, creditAccountNotEmpty, creditAccountNotFound, creditManagerPaused, curatorNameSchema, curatorSchema, dataSourceSchema, debtOutOfRange, delayedReceivedAssetSchema, emptyOpenTakesNothing, encodeFlag, filterAllSchema, filterable, forbiddenToken, instantReceivedAssetSchema, insufficientAllowance, insufficientBalance, insufficientCollateral, insufficientPoolLiquidity, isFilterSet, kycProtocolSchema, kycRequirementSchema, leverageOutOfRange, leverageSchema, liquidatableAccountFilterSchema, liquidatableAccountSchema, liquidationApprovalSchema, liquidationDetailsSchema, liquidationPositionId, liquidationPositionSchema, liquidatorNotEligible, malformedTransaction, marketExpired, matchesLiquidatableAccountFilter, matchesOpportunityFilter, matchesPositionFilter, multipleDelayedWithdrawals, noDelayedRoute, noRecordedIntent, noStrategyTargetCollateral, notEmergencyLiquidator, noticeKindSchema, noticeSchema, offchainOnly, onchainOnly, opportunityBaseSchema, opportunityDetailSchema, opportunityFilterQueryParamsSchema, opportunityFilterQuerySchema, opportunityFilterSchema, opportunityId, opportunityKeySchema, opportunityKindSchema, opportunitySchema, opportunityTotalsSchema, pnlBreakdownSchema, pointRewardsSchema, pointsProgramPnLSchema, pointsProgramSchema, pointsRewardsPnLSchema, poolOpportunityChartMetricSchema, poolOpportunityDetailSchema, poolOpportunityId, poolOpportunityKeySchema, poolOpportunitySchema, poolPaused, poolPositionChartMetricSchema, poolPositionId, poolPositionKeySchema, poolPositionSchema, poolSunset, positionClaimableWithdrawalSchema, positionCollateralSchema, positionFilterQueryParamsSchema, positionFilterQuerySchema, positionFilterSchema, positionId, positionKeySchema, positionKindSchema, positionPendingWithdrawalSchema, positionSchema, positionTransactionKindSchema, positionTransactionSchema, positionWithdrawalsSchema, positionsTotalsSchema, priceFeedDataSchema, priceFeedSummarySchema, protocolChartMetricSchema, quotaAssetSchema, quotaCountExceeded, quotaLimitReached, rateCurvePointSchema, rateCurveSchema, receivedAssetSchema, responseMetadataSchema, responseSchema, rewardsPnLSchema, rewardsSchema, rwaOpenRequirementsNotMet, safeValue, sdkErr, sdkOk, strategyOpportunityChartMetricSchema, strategyOpportunityDetailSchema, strategyOpportunityId, strategyOpportunityKeySchema, strategyOpportunitySchema, strategyPositionChartMetricSchema, strategyPositionId, strategyPositionKeySchema, strategyPositionSchema, timestampSchema, tokenAmountSchema, tokenQuotaRateSchema, tokenRewardsPnLSchema, tokenRewardsSchema, tokenSchema, tolerance, txCallSchema, underlyingTokenSchema, unexpectedFailure, unpriceableTokenError, unsupportedCollateralToken, unsupportedTokenPair, withdrawalInProgress, withdrawalOutputAmountSchema };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Amount, AssetType, Bps, ChainId, Leverage, Timestamp, Token, UnderlyingToken } from "./primitives.js";
|
|
2
2
|
import { ChainScopedFilter, Filterable } from "./filters.js";
|
|
3
3
|
import { Curator } from "./curators.js";
|
|
4
|
+
import { KycRequirement } from "./rwa.js";
|
|
4
5
|
import { Address } from "viem";
|
|
5
6
|
//#region src/model/opportunities.d.ts
|
|
6
7
|
/**
|
|
@@ -589,6 +590,14 @@ interface StrategyOpportunityDetail extends StrategyOpportunity {
|
|
|
589
590
|
* Prices and feeds of the underlying and the target collateral.
|
|
590
591
|
**/
|
|
591
592
|
priceFeeds: PriceFeedSummary;
|
|
593
|
+
/**
|
|
594
|
+
* Registration the wallet passed to `getStrategy` still needs before it may
|
|
595
|
+
* open this strategy. `null` when the strategy is not KYC-gated, when no
|
|
596
|
+
* wallet was given, or when the wallet is already eligible. `undefined`
|
|
597
|
+
* only in `offchain` mode, where the backend does not evaluate it. In
|
|
598
|
+
* `both` mode `kyc` is taken from the chain whenever that leg succeeded.
|
|
599
|
+
**/
|
|
600
|
+
kyc?: KycRequirement | null;
|
|
592
601
|
}
|
|
593
602
|
/**
|
|
594
603
|
* Detailed view of any opportunity.
|
|
@@ -1118,6 +1118,21 @@ declare const strategyOpportunityDetailSchema: z.ZodObject<{
|
|
|
1118
1118
|
dependencies: z.ZodArray<z.ZodObject<any, z.core.$strip>>;
|
|
1119
1119
|
}, z.core.$strip>;
|
|
1120
1120
|
}, z.core.$strip>;
|
|
1121
|
+
kyc: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
1122
|
+
protocol: z.ZodEnum<{
|
|
1123
|
+
midas: "midas";
|
|
1124
|
+
securitize: "securitize";
|
|
1125
|
+
}>;
|
|
1126
|
+
token: z.ZodOptional<z.ZodObject<{
|
|
1127
|
+
chainId: z.ZodNumber;
|
|
1128
|
+
address: z.ZodCodec<z.ZodString, z.ZodCustom<`0x${string}`, `0x${string}`>>;
|
|
1129
|
+
symbol: z.ZodString;
|
|
1130
|
+
name: z.ZodString;
|
|
1131
|
+
decimals: z.ZodNumber;
|
|
1132
|
+
assetType: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"Stable">, z.ZodLiteral<"ETH">, z.ZodLiteral<"BTC">]>>;
|
|
1133
|
+
}, z.core.$strip>>;
|
|
1134
|
+
registrationLink: z.ZodString;
|
|
1135
|
+
}, z.core.$strip>>>;
|
|
1121
1136
|
}, z.core.$strip>;
|
|
1122
1137
|
/**
|
|
1123
1138
|
* {@link OpportunityDetail}
|
|
@@ -1419,6 +1434,21 @@ declare const opportunityDetailSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1419
1434
|
dependencies: z.ZodArray<z.ZodObject<any, z.core.$strip>>;
|
|
1420
1435
|
}, z.core.$strip>;
|
|
1421
1436
|
}, z.core.$strip>;
|
|
1437
|
+
kyc: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
1438
|
+
protocol: z.ZodEnum<{
|
|
1439
|
+
midas: "midas";
|
|
1440
|
+
securitize: "securitize";
|
|
1441
|
+
}>;
|
|
1442
|
+
token: z.ZodOptional<z.ZodObject<{
|
|
1443
|
+
chainId: z.ZodNumber;
|
|
1444
|
+
address: z.ZodCodec<z.ZodString, z.ZodCustom<`0x${string}`, `0x${string}`>>;
|
|
1445
|
+
symbol: z.ZodString;
|
|
1446
|
+
name: z.ZodString;
|
|
1447
|
+
decimals: z.ZodNumber;
|
|
1448
|
+
assetType: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"Stable">, z.ZodLiteral<"ETH">, z.ZodLiteral<"BTC">]>>;
|
|
1449
|
+
}, z.core.$strip>>;
|
|
1450
|
+
registrationLink: z.ZodString;
|
|
1451
|
+
}, z.core.$strip>>>;
|
|
1422
1452
|
}, z.core.$strip>], "kind">;
|
|
1423
1453
|
/**
|
|
1424
1454
|
* {@link PoolOpportunityKey}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Token } from "./primitives.js";
|
|
1
2
|
import { Address, Hex, TypedDataDefinition } from "viem";
|
|
2
3
|
//#region src/model/rwa.d.ts
|
|
3
4
|
/**
|
|
@@ -139,5 +140,28 @@ type RWAMissingOpenAccountRequirements<T extends RWAFactoryType = RWAFactoryType
|
|
|
139
140
|
type RWAOperationArgs<T extends RWAFactoryType = RWAFactoryType> = Extract<SecuritizeOperationArgs, {
|
|
140
141
|
type: T;
|
|
141
142
|
}>;
|
|
143
|
+
/**
|
|
144
|
+
* KYC providers a strategy may be gated by
|
|
145
|
+
**/
|
|
146
|
+
declare const KYC_PROTOCOLS: readonly ["securitize", "midas"];
|
|
147
|
+
/** String literal union of {@link KYC_PROTOCOLS}. */
|
|
148
|
+
type KycProtocol = (typeof KYC_PROTOCOLS)[number];
|
|
149
|
+
/**
|
|
150
|
+
* What a wallet still has to do before it may open a KYC-gated strategy.
|
|
151
|
+
**/
|
|
152
|
+
interface KycRequirement {
|
|
153
|
+
protocol: KycProtocol;
|
|
154
|
+
/**
|
|
155
|
+
* Token the wallet must be registered for; `undefined` when unknown to the
|
|
156
|
+
* token registry.
|
|
157
|
+
**/
|
|
158
|
+
token?: Token;
|
|
159
|
+
/** Where the wallet completes registration with {@link protocol}. */
|
|
160
|
+
registrationLink: string;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Hardcoded registration URLs for each {@link KycProtocol}.
|
|
164
|
+
**/
|
|
165
|
+
declare const KYC_REGISTRATION_LINKS: Record<KycProtocol, string>;
|
|
142
166
|
//#endregion
|
|
143
|
-
export { RWAFactoryType, RWAMissingOpenAccountRequirements, RWAOpenAccountRequirements, RWAOperationArgs, RWA_FACTORY_SECURITIZE, RWA_FACTORY_TYPES, SECURITIZE_REGISTER_VAULT_TYPES, SecuritizeMissingOpenAccountRequirements, SecuritizeOpenAccountRequirements, SecuritizeOperationArgs, SecuritizeRegisterMessage, SecuritizeRegisterVaultMessage, SecuritizeSignature };
|
|
167
|
+
export { KYC_PROTOCOLS, KYC_REGISTRATION_LINKS, KycProtocol, KycRequirement, RWAFactoryType, RWAMissingOpenAccountRequirements, RWAOpenAccountRequirements, RWAOperationArgs, RWA_FACTORY_SECURITIZE, RWA_FACTORY_TYPES, SECURITIZE_REGISTER_VAULT_TYPES, SecuritizeMissingOpenAccountRequirements, SecuritizeOpenAccountRequirements, SecuritizeOperationArgs, SecuritizeRegisterMessage, SecuritizeRegisterVaultMessage, SecuritizeSignature };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { z } from "zod/v4";
|
|
2
|
+
//#region src/model/rwa.schema.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* {@link ./rwa.js#KycProtocol}
|
|
5
|
+
**/
|
|
6
|
+
declare const kycProtocolSchema: z.ZodEnum<{
|
|
7
|
+
midas: "midas";
|
|
8
|
+
securitize: "securitize";
|
|
9
|
+
}>;
|
|
10
|
+
/**
|
|
11
|
+
* {@link ./rwa.js#KycRequirement}
|
|
12
|
+
**/
|
|
13
|
+
declare const kycRequirementSchema: z.ZodObject<{
|
|
14
|
+
protocol: z.ZodEnum<{
|
|
15
|
+
midas: "midas";
|
|
16
|
+
securitize: "securitize";
|
|
17
|
+
}>;
|
|
18
|
+
token: z.ZodOptional<z.ZodObject<{
|
|
19
|
+
chainId: z.ZodNumber;
|
|
20
|
+
address: z.ZodCodec<z.ZodString, z.ZodCustom<`0x${string}`, `0x${string}`>>;
|
|
21
|
+
symbol: z.ZodString;
|
|
22
|
+
name: z.ZodString;
|
|
23
|
+
decimals: z.ZodNumber;
|
|
24
|
+
assetType: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"Stable">, z.ZodLiteral<"ETH">, z.ZodLiteral<"BTC">]>>;
|
|
25
|
+
}, z.core.$strip>>;
|
|
26
|
+
registrationLink: z.ZodString;
|
|
27
|
+
}, z.core.$strip>;
|
|
28
|
+
//#endregion
|
|
29
|
+
export { kycProtocolSchema, kycRequirementSchema };
|
|
@@ -4,6 +4,7 @@ import { DataResponse } from "../../model/response.js";
|
|
|
4
4
|
import { GearboxAPIOptions } from "../types.js";
|
|
5
5
|
import { AbstractOffchainNamespace } from "../AbstractOffchainNamespace.js";
|
|
6
6
|
import { IOffchainOpportunities, OpportunityChartMetricFor } from "./types.js";
|
|
7
|
+
import { Address } from "viem";
|
|
7
8
|
//#region src/offchain/opportunities/OffchainOpportunities.d.ts
|
|
8
9
|
/**
|
|
9
10
|
* Backend counterpart of the `opportunities` namespace.
|
|
@@ -22,7 +23,7 @@ declare class OffchainOpportunities extends AbstractOffchainNamespace implements
|
|
|
22
23
|
/**
|
|
23
24
|
* {@inheritDoc IOffchainOpportunities.getStrategy}
|
|
24
25
|
**/
|
|
25
|
-
getStrategy(key: StrategyOpportunityKey): Promise<DataResponse<StrategyOpportunityDetail>>;
|
|
26
|
+
getStrategy(key: StrategyOpportunityKey, _wallet?: Address): Promise<DataResponse<StrategyOpportunityDetail>>;
|
|
26
27
|
/**
|
|
27
28
|
* {@inheritDoc IOffchainOpportunities.getTotals}
|
|
28
29
|
**/
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ChartBundle, ChartRange, PoolOpportunityChartMetric, StrategyOpportunityChartMetric } from "../../model/charts.js";
|
|
2
2
|
import { Opportunity, OpportunityFilter, OpportunityKey, OpportunityTotals, PoolOpportunityDetail, PoolOpportunityKey, StrategyOpportunityDetail, StrategyOpportunityKey } from "../../model/opportunities.js";
|
|
3
3
|
import { DataResponse } from "../../model/response.js";
|
|
4
|
+
import { Address } from "viem";
|
|
4
5
|
//#region src/offchain/opportunities/types.d.ts
|
|
5
6
|
type OpportunityChartMetricFor<K extends OpportunityKey> = {
|
|
6
7
|
pool: PoolOpportunityChartMetric;
|
|
@@ -21,8 +22,10 @@ interface IOffchainOpportunities {
|
|
|
21
22
|
getPool(key: PoolOpportunityKey): Promise<DataResponse<PoolOpportunityDetail>>;
|
|
22
23
|
/**
|
|
23
24
|
* Detailed view of one strategy opportunity.
|
|
25
|
+
*
|
|
26
|
+
* @param wallet - Optional wallet address to check KYC status for.
|
|
24
27
|
**/
|
|
25
|
-
getStrategy(key: StrategyOpportunityKey): Promise<DataResponse<StrategyOpportunityDetail>>;
|
|
28
|
+
getStrategy(key: StrategyOpportunityKey, wallet?: Address): Promise<DataResponse<StrategyOpportunityDetail>>;
|
|
26
29
|
/**
|
|
27
30
|
* Protocol-wide totals across every opportunity the backend serves.
|
|
28
31
|
**/
|