@defisaver/positions-sdk 0.0.30-dev → 0.0.32
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/cjs/compoundV3/index.js +1 -1
- package/cjs/config/contracts.d.ts +285 -1037
- package/cjs/config/contracts.js +58 -171
- package/cjs/constants/index.d.ts +2 -0
- package/cjs/constants/index.js +3 -1
- package/cjs/contracts.d.ts +2 -0
- package/cjs/contracts.js +13 -5
- package/cjs/curveUsd/index.js +1 -1
- package/cjs/helpers/curveUsdHelpers/index.d.ts +1 -2
- package/cjs/helpers/curveUsdHelpers/index.js +17 -25
- package/cjs/helpers/index.d.ts +1 -0
- package/cjs/helpers/index.js +2 -1
- package/cjs/helpers/morphoBlueHelpers/index.d.ts +7 -0
- package/cjs/helpers/morphoBlueHelpers/index.js +41 -0
- package/cjs/index.d.ts +2 -1
- package/cjs/index.js +3 -1
- package/cjs/markets/index.d.ts +1 -0
- package/cjs/markets/index.js +3 -1
- package/cjs/markets/morphoBlue/index.d.ts +6 -0
- package/cjs/markets/morphoBlue/index.js +24 -0
- package/cjs/moneymarket/moneymarketCommonService.js +1 -1
- package/cjs/morphoBlue/index.d.ts +5 -0
- package/cjs/morphoBlue/index.js +153 -0
- package/cjs/services/utils.d.ts +0 -4
- package/cjs/services/utils.js +1 -13
- package/cjs/types/common.d.ts +1 -1
- package/cjs/types/contracts/generated/CrvUSDView.d.ts +4 -30
- package/cjs/types/contracts/generated/FeedRegistry.d.ts +182 -0
- package/cjs/types/contracts/generated/FeedRegistry.js +5 -0
- package/cjs/types/contracts/generated/MorphoBlueView.d.ts +122 -0
- package/cjs/types/contracts/generated/MorphoBlueView.js +5 -0
- package/cjs/types/contracts/generated/index.d.ts +2 -0
- package/cjs/types/curveUsd.d.ts +0 -6
- package/cjs/types/index.d.ts +1 -0
- package/cjs/types/index.js +1 -0
- package/cjs/types/morphoBlue.d.ts +74 -0
- package/cjs/types/morphoBlue.js +7 -0
- package/esm/compoundV3/index.js +1 -1
- package/esm/config/contracts.d.ts +285 -1037
- package/esm/config/contracts.js +58 -171
- package/esm/constants/index.d.ts +2 -0
- package/esm/constants/index.js +2 -0
- package/esm/contracts.d.ts +2 -0
- package/esm/contracts.js +12 -4
- package/esm/curveUsd/index.js +1 -1
- package/esm/helpers/curveUsdHelpers/index.d.ts +1 -2
- package/esm/helpers/curveUsdHelpers/index.js +18 -26
- package/esm/helpers/index.d.ts +1 -0
- package/esm/helpers/index.js +1 -0
- package/esm/helpers/morphoBlueHelpers/index.d.ts +7 -0
- package/esm/helpers/morphoBlueHelpers/index.js +34 -0
- package/esm/index.d.ts +2 -1
- package/esm/index.js +2 -1
- package/esm/markets/index.d.ts +1 -0
- package/esm/markets/index.js +1 -0
- package/esm/markets/morphoBlue/index.d.ts +6 -0
- package/esm/markets/morphoBlue/index.js +19 -0
- package/esm/moneymarket/moneymarketCommonService.js +1 -1
- package/esm/morphoBlue/index.d.ts +5 -0
- package/esm/morphoBlue/index.js +145 -0
- package/esm/services/utils.d.ts +0 -4
- package/esm/services/utils.js +0 -11
- package/esm/types/common.d.ts +1 -1
- package/esm/types/contracts/generated/CrvUSDView.d.ts +4 -30
- package/esm/types/contracts/generated/FeedRegistry.d.ts +182 -0
- package/esm/types/contracts/generated/FeedRegistry.js +4 -0
- package/esm/types/contracts/generated/MorphoBlueView.d.ts +122 -0
- package/esm/types/contracts/generated/MorphoBlueView.js +4 -0
- package/esm/types/contracts/generated/index.d.ts +2 -0
- package/esm/types/curveUsd.d.ts +0 -6
- package/esm/types/index.d.ts +1 -0
- package/esm/types/index.js +1 -0
- package/esm/types/morphoBlue.d.ts +74 -0
- package/esm/types/morphoBlue.js +4 -0
- package/package.json +1 -1
- package/src/compoundV3/index.ts +1 -1
- package/src/config/contracts.js +58 -171
- package/src/constants/index.ts +3 -1
- package/src/contracts.ts +16 -6
- package/src/curveUsd/index.ts +1 -1
- package/src/helpers/curveUsdHelpers/index.ts +20 -28
- package/src/helpers/index.ts +2 -1
- package/src/helpers/morphoBlueHelpers/index.ts +47 -0
- package/src/index.ts +2 -0
- package/src/markets/index.ts +2 -1
- package/src/markets/morphoBlue/index.ts +21 -0
- package/src/moneymarket/moneymarketCommonService.ts +1 -1
- package/src/morphoBlue/index.ts +166 -0
- package/src/services/utils.ts +1 -14
- package/src/types/common.ts +1 -1
- package/src/types/contracts/generated/CrvUSDView.ts +8 -43
- package/src/types/contracts/generated/FeedRegistry.ts +337 -0
- package/src/types/contracts/generated/MorphoBlueView.ts +171 -0
- package/src/types/contracts/generated/index.ts +2 -0
- package/src/types/curveUsd.ts +0 -6
- package/src/types/index.ts +2 -1
- package/src/types/morphoBlue.ts +80 -0
- package/src/morpho/markets.ts +0 -39
- package/yarn-error.log +0 -64
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import type BN from "bn.js";
|
|
3
|
+
import type { ContractOptions } from "web3-eth-contract";
|
|
4
|
+
import type { EventLog } from "web3-core";
|
|
5
|
+
import type { EventEmitter } from "events";
|
|
6
|
+
import type { Callback, NonPayableTransactionObject, BlockType, ContractEventLog, BaseContract } from "./types";
|
|
7
|
+
export interface EventOptions {
|
|
8
|
+
filter?: object;
|
|
9
|
+
fromBlock?: BlockType;
|
|
10
|
+
topics?: string[];
|
|
11
|
+
}
|
|
12
|
+
export declare namespace FeedRegistryInterface {
|
|
13
|
+
type PhaseStruct = [number | string | BN, number | string | BN, number | string | BN] | {
|
|
14
|
+
phaseId: number | string | BN;
|
|
15
|
+
startingAggregatorRoundId: number | string | BN;
|
|
16
|
+
endingAggregatorRoundId: number | string | BN;
|
|
17
|
+
};
|
|
18
|
+
type PhaseStructOutputArray = [string, string, string];
|
|
19
|
+
type PhaseStructOutputStruct = {
|
|
20
|
+
phaseId: string;
|
|
21
|
+
startingAggregatorRoundId: string;
|
|
22
|
+
endingAggregatorRoundId: string;
|
|
23
|
+
};
|
|
24
|
+
type PhaseStructOutput = PhaseStructOutputArray & PhaseStructOutputStruct;
|
|
25
|
+
}
|
|
26
|
+
export type AccessControllerSet = ContractEventLog<{
|
|
27
|
+
accessController: string;
|
|
28
|
+
sender: string;
|
|
29
|
+
0: string;
|
|
30
|
+
1: string;
|
|
31
|
+
}>;
|
|
32
|
+
export type FeedConfirmed = ContractEventLog<{
|
|
33
|
+
asset: string;
|
|
34
|
+
denomination: string;
|
|
35
|
+
latestAggregator: string;
|
|
36
|
+
previousAggregator: string;
|
|
37
|
+
nextPhaseId: string;
|
|
38
|
+
sender: string;
|
|
39
|
+
0: string;
|
|
40
|
+
1: string;
|
|
41
|
+
2: string;
|
|
42
|
+
3: string;
|
|
43
|
+
4: string;
|
|
44
|
+
5: string;
|
|
45
|
+
}>;
|
|
46
|
+
export type FeedProposed = ContractEventLog<{
|
|
47
|
+
asset: string;
|
|
48
|
+
denomination: string;
|
|
49
|
+
proposedAggregator: string;
|
|
50
|
+
currentAggregator: string;
|
|
51
|
+
sender: string;
|
|
52
|
+
0: string;
|
|
53
|
+
1: string;
|
|
54
|
+
2: string;
|
|
55
|
+
3: string;
|
|
56
|
+
4: string;
|
|
57
|
+
}>;
|
|
58
|
+
export type OwnershipTransferRequested = ContractEventLog<{
|
|
59
|
+
from: string;
|
|
60
|
+
to: string;
|
|
61
|
+
0: string;
|
|
62
|
+
1: string;
|
|
63
|
+
}>;
|
|
64
|
+
export type OwnershipTransferred = ContractEventLog<{
|
|
65
|
+
from: string;
|
|
66
|
+
to: string;
|
|
67
|
+
0: string;
|
|
68
|
+
1: string;
|
|
69
|
+
}>;
|
|
70
|
+
export interface FeedRegistry extends BaseContract {
|
|
71
|
+
constructor(jsonInterface: any[], address?: string, options?: ContractOptions): FeedRegistry;
|
|
72
|
+
clone(): FeedRegistry;
|
|
73
|
+
methods: {
|
|
74
|
+
acceptOwnership(): NonPayableTransactionObject<void>;
|
|
75
|
+
confirmFeed(base: string, quote: string, aggregator: string): NonPayableTransactionObject<void>;
|
|
76
|
+
decimals(base: string, quote: string): NonPayableTransactionObject<string>;
|
|
77
|
+
description(base: string, quote: string): NonPayableTransactionObject<string>;
|
|
78
|
+
getAccessController(): NonPayableTransactionObject<string>;
|
|
79
|
+
getAnswer(base: string, quote: string, roundId: number | string | BN): NonPayableTransactionObject<string>;
|
|
80
|
+
getCurrentPhaseId(base: string, quote: string): NonPayableTransactionObject<string>;
|
|
81
|
+
getFeed(base: string, quote: string): NonPayableTransactionObject<string>;
|
|
82
|
+
getNextRoundId(base: string, quote: string, roundId: number | string | BN): NonPayableTransactionObject<string>;
|
|
83
|
+
getPhase(base: string, quote: string, phaseId: number | string | BN): NonPayableTransactionObject<FeedRegistryInterface.PhaseStructOutput>;
|
|
84
|
+
getPhaseFeed(base: string, quote: string, phaseId: number | string | BN): NonPayableTransactionObject<string>;
|
|
85
|
+
getPhaseRange(base: string, quote: string, phaseId: number | string | BN): NonPayableTransactionObject<[
|
|
86
|
+
string,
|
|
87
|
+
string
|
|
88
|
+
] & {
|
|
89
|
+
startingRoundId: string;
|
|
90
|
+
endingRoundId: string;
|
|
91
|
+
}>;
|
|
92
|
+
getPreviousRoundId(base: string, quote: string, roundId: number | string | BN): NonPayableTransactionObject<string>;
|
|
93
|
+
getProposedFeed(base: string, quote: string): NonPayableTransactionObject<string>;
|
|
94
|
+
getRoundData(base: string, quote: string, _roundId: number | string | BN): NonPayableTransactionObject<[
|
|
95
|
+
string,
|
|
96
|
+
string,
|
|
97
|
+
string,
|
|
98
|
+
string,
|
|
99
|
+
string
|
|
100
|
+
] & {
|
|
101
|
+
roundId: string;
|
|
102
|
+
answer: string;
|
|
103
|
+
startedAt: string;
|
|
104
|
+
updatedAt: string;
|
|
105
|
+
answeredInRound: string;
|
|
106
|
+
}>;
|
|
107
|
+
getRoundFeed(base: string, quote: string, roundId: number | string | BN): NonPayableTransactionObject<string>;
|
|
108
|
+
getTimestamp(base: string, quote: string, roundId: number | string | BN): NonPayableTransactionObject<string>;
|
|
109
|
+
isFeedEnabled(aggregator: string): NonPayableTransactionObject<boolean>;
|
|
110
|
+
latestAnswer(base: string, quote: string): NonPayableTransactionObject<string>;
|
|
111
|
+
latestRound(base: string, quote: string): NonPayableTransactionObject<string>;
|
|
112
|
+
latestRoundData(base: string, quote: string): NonPayableTransactionObject<[
|
|
113
|
+
string,
|
|
114
|
+
string,
|
|
115
|
+
string,
|
|
116
|
+
string,
|
|
117
|
+
string
|
|
118
|
+
] & {
|
|
119
|
+
roundId: string;
|
|
120
|
+
answer: string;
|
|
121
|
+
startedAt: string;
|
|
122
|
+
updatedAt: string;
|
|
123
|
+
answeredInRound: string;
|
|
124
|
+
}>;
|
|
125
|
+
latestTimestamp(base: string, quote: string): NonPayableTransactionObject<string>;
|
|
126
|
+
owner(): NonPayableTransactionObject<string>;
|
|
127
|
+
proposeFeed(base: string, quote: string, aggregator: string): NonPayableTransactionObject<void>;
|
|
128
|
+
proposedGetRoundData(base: string, quote: string, roundId: number | string | BN): NonPayableTransactionObject<[
|
|
129
|
+
string,
|
|
130
|
+
string,
|
|
131
|
+
string,
|
|
132
|
+
string,
|
|
133
|
+
string
|
|
134
|
+
] & {
|
|
135
|
+
id: string;
|
|
136
|
+
answer: string;
|
|
137
|
+
startedAt: string;
|
|
138
|
+
updatedAt: string;
|
|
139
|
+
answeredInRound: string;
|
|
140
|
+
}>;
|
|
141
|
+
proposedLatestRoundData(base: string, quote: string): NonPayableTransactionObject<[
|
|
142
|
+
string,
|
|
143
|
+
string,
|
|
144
|
+
string,
|
|
145
|
+
string,
|
|
146
|
+
string
|
|
147
|
+
] & {
|
|
148
|
+
id: string;
|
|
149
|
+
answer: string;
|
|
150
|
+
startedAt: string;
|
|
151
|
+
updatedAt: string;
|
|
152
|
+
answeredInRound: string;
|
|
153
|
+
}>;
|
|
154
|
+
setAccessController(_accessController: string): NonPayableTransactionObject<void>;
|
|
155
|
+
transferOwnership(to: string): NonPayableTransactionObject<void>;
|
|
156
|
+
typeAndVersion(): NonPayableTransactionObject<string>;
|
|
157
|
+
version(base: string, quote: string): NonPayableTransactionObject<string>;
|
|
158
|
+
};
|
|
159
|
+
events: {
|
|
160
|
+
AccessControllerSet(cb?: Callback<AccessControllerSet>): EventEmitter;
|
|
161
|
+
AccessControllerSet(options?: EventOptions, cb?: Callback<AccessControllerSet>): EventEmitter;
|
|
162
|
+
FeedConfirmed(cb?: Callback<FeedConfirmed>): EventEmitter;
|
|
163
|
+
FeedConfirmed(options?: EventOptions, cb?: Callback<FeedConfirmed>): EventEmitter;
|
|
164
|
+
FeedProposed(cb?: Callback<FeedProposed>): EventEmitter;
|
|
165
|
+
FeedProposed(options?: EventOptions, cb?: Callback<FeedProposed>): EventEmitter;
|
|
166
|
+
OwnershipTransferRequested(cb?: Callback<OwnershipTransferRequested>): EventEmitter;
|
|
167
|
+
OwnershipTransferRequested(options?: EventOptions, cb?: Callback<OwnershipTransferRequested>): EventEmitter;
|
|
168
|
+
OwnershipTransferred(cb?: Callback<OwnershipTransferred>): EventEmitter;
|
|
169
|
+
OwnershipTransferred(options?: EventOptions, cb?: Callback<OwnershipTransferred>): EventEmitter;
|
|
170
|
+
allEvents(options?: EventOptions, cb?: Callback<EventLog>): EventEmitter;
|
|
171
|
+
};
|
|
172
|
+
once(event: "AccessControllerSet", cb: Callback<AccessControllerSet>): void;
|
|
173
|
+
once(event: "AccessControllerSet", options: EventOptions, cb: Callback<AccessControllerSet>): void;
|
|
174
|
+
once(event: "FeedConfirmed", cb: Callback<FeedConfirmed>): void;
|
|
175
|
+
once(event: "FeedConfirmed", options: EventOptions, cb: Callback<FeedConfirmed>): void;
|
|
176
|
+
once(event: "FeedProposed", cb: Callback<FeedProposed>): void;
|
|
177
|
+
once(event: "FeedProposed", options: EventOptions, cb: Callback<FeedProposed>): void;
|
|
178
|
+
once(event: "OwnershipTransferRequested", cb: Callback<OwnershipTransferRequested>): void;
|
|
179
|
+
once(event: "OwnershipTransferRequested", options: EventOptions, cb: Callback<OwnershipTransferRequested>): void;
|
|
180
|
+
once(event: "OwnershipTransferred", cb: Callback<OwnershipTransferred>): void;
|
|
181
|
+
once(event: "OwnershipTransferred", options: EventOptions, cb: Callback<OwnershipTransferred>): void;
|
|
182
|
+
}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import type BN from "bn.js";
|
|
3
|
+
import type { ContractOptions } from "web3-eth-contract";
|
|
4
|
+
import type { EventLog } from "web3-core";
|
|
5
|
+
import type { EventEmitter } from "events";
|
|
6
|
+
import type { Callback, NonPayableTransactionObject, BlockType, BaseContract } from "./types";
|
|
7
|
+
export interface EventOptions {
|
|
8
|
+
filter?: object;
|
|
9
|
+
fromBlock?: BlockType;
|
|
10
|
+
topics?: string[];
|
|
11
|
+
}
|
|
12
|
+
export type MarketParamsStruct = [string, string, string, string, number | string | BN] | {
|
|
13
|
+
loanToken: string;
|
|
14
|
+
collateralToken: string;
|
|
15
|
+
oracle: string;
|
|
16
|
+
irm: string;
|
|
17
|
+
lltv: number | string | BN;
|
|
18
|
+
};
|
|
19
|
+
export type MarketParamsStructOutputArray = [
|
|
20
|
+
string,
|
|
21
|
+
string,
|
|
22
|
+
string,
|
|
23
|
+
string,
|
|
24
|
+
string
|
|
25
|
+
];
|
|
26
|
+
export type MarketParamsStructOutputStruct = {
|
|
27
|
+
loanToken: string;
|
|
28
|
+
collateralToken: string;
|
|
29
|
+
oracle: string;
|
|
30
|
+
irm: string;
|
|
31
|
+
lltv: string;
|
|
32
|
+
};
|
|
33
|
+
export type MarketParamsStructOutput = MarketParamsStructOutputArray & MarketParamsStructOutputStruct;
|
|
34
|
+
export declare namespace MorphoBlueView {
|
|
35
|
+
type MarketInfoStruct = [
|
|
36
|
+
string | number[],
|
|
37
|
+
number | string | BN,
|
|
38
|
+
number | string | BN,
|
|
39
|
+
number | string | BN,
|
|
40
|
+
number | string | BN,
|
|
41
|
+
number | string | BN,
|
|
42
|
+
number | string | BN,
|
|
43
|
+
number | string | BN,
|
|
44
|
+
number | string | BN
|
|
45
|
+
] | {
|
|
46
|
+
id: string | number[];
|
|
47
|
+
totalSupplyAssets: number | string | BN;
|
|
48
|
+
totalSupplyShares: number | string | BN;
|
|
49
|
+
totalBorrowAssets: number | string | BN;
|
|
50
|
+
totalBorrowShares: number | string | BN;
|
|
51
|
+
lastUpdate: number | string | BN;
|
|
52
|
+
fee: number | string | BN;
|
|
53
|
+
borrowRate: number | string | BN;
|
|
54
|
+
oracle: number | string | BN;
|
|
55
|
+
};
|
|
56
|
+
type MarketInfoStructOutputArray = [
|
|
57
|
+
string,
|
|
58
|
+
string,
|
|
59
|
+
string,
|
|
60
|
+
string,
|
|
61
|
+
string,
|
|
62
|
+
string,
|
|
63
|
+
string,
|
|
64
|
+
string,
|
|
65
|
+
string
|
|
66
|
+
];
|
|
67
|
+
type MarketInfoStructOutputStruct = {
|
|
68
|
+
id: string;
|
|
69
|
+
totalSupplyAssets: string;
|
|
70
|
+
totalSupplyShares: string;
|
|
71
|
+
totalBorrowAssets: string;
|
|
72
|
+
totalBorrowShares: string;
|
|
73
|
+
lastUpdate: string;
|
|
74
|
+
fee: string;
|
|
75
|
+
borrowRate: string;
|
|
76
|
+
oracle: string;
|
|
77
|
+
};
|
|
78
|
+
type MarketInfoStructOutput = MarketInfoStructOutputArray & MarketInfoStructOutputStruct;
|
|
79
|
+
type PositionInfoStruct = [
|
|
80
|
+
number | string | BN,
|
|
81
|
+
number | string | BN,
|
|
82
|
+
number | string | BN,
|
|
83
|
+
number | string | BN,
|
|
84
|
+
number | string | BN
|
|
85
|
+
] | {
|
|
86
|
+
supplyShares: number | string | BN;
|
|
87
|
+
suppliedInAssets: number | string | BN;
|
|
88
|
+
borrowShares: number | string | BN;
|
|
89
|
+
borrowedInAssets: number | string | BN;
|
|
90
|
+
collateral: number | string | BN;
|
|
91
|
+
};
|
|
92
|
+
type PositionInfoStructOutputArray = [
|
|
93
|
+
string,
|
|
94
|
+
string,
|
|
95
|
+
string,
|
|
96
|
+
string,
|
|
97
|
+
string
|
|
98
|
+
];
|
|
99
|
+
type PositionInfoStructOutputStruct = {
|
|
100
|
+
supplyShares: string;
|
|
101
|
+
suppliedInAssets: string;
|
|
102
|
+
borrowShares: string;
|
|
103
|
+
borrowedInAssets: string;
|
|
104
|
+
collateral: string;
|
|
105
|
+
};
|
|
106
|
+
type PositionInfoStructOutput = PositionInfoStructOutputArray & PositionInfoStructOutputStruct;
|
|
107
|
+
}
|
|
108
|
+
export interface MorphoBlueView extends BaseContract {
|
|
109
|
+
constructor(jsonInterface: any[], address?: string, options?: ContractOptions): MorphoBlueView;
|
|
110
|
+
clone(): MorphoBlueView;
|
|
111
|
+
methods: {
|
|
112
|
+
MORPHO_BLUE_ADDRESS(): NonPayableTransactionObject<string>;
|
|
113
|
+
getMarketId(marketParams: MarketParamsStruct): NonPayableTransactionObject<string>;
|
|
114
|
+
getMarketInfo(marketParams: MarketParamsStruct): NonPayableTransactionObject<MorphoBlueView.MarketInfoStructOutput>;
|
|
115
|
+
getMarketInfoNotTuple(loanToken: string, collToken: string, oracle: string, irm: string, lltv: number | string | BN): NonPayableTransactionObject<MorphoBlueView.MarketInfoStructOutput>;
|
|
116
|
+
getUserInfo(marketParams: MarketParamsStruct, owner: string): NonPayableTransactionObject<MorphoBlueView.PositionInfoStructOutput>;
|
|
117
|
+
morphoBlue(): NonPayableTransactionObject<string>;
|
|
118
|
+
};
|
|
119
|
+
events: {
|
|
120
|
+
allEvents(options?: EventOptions, cb?: Callback<EventLog>): EventEmitter;
|
|
121
|
+
};
|
|
122
|
+
}
|
|
@@ -21,6 +21,7 @@ export type { CompoundLoanInfo } from "./CompoundLoanInfo";
|
|
|
21
21
|
export type { Comptroller } from "./Comptroller";
|
|
22
22
|
export type { ETHPriceFeed } from "./ETHPriceFeed";
|
|
23
23
|
export type { Erc20 } from "./Erc20";
|
|
24
|
+
export type { FeedRegistry } from "./FeedRegistry";
|
|
24
25
|
export type { GHO } from "./GHO";
|
|
25
26
|
export type { GhoDiscountRateStrategy } from "./GhoDiscountRateStrategy";
|
|
26
27
|
export type { IAToken } from "./IAToken";
|
|
@@ -37,6 +38,7 @@ export type { McdView } from "./McdView";
|
|
|
37
38
|
export type { MorphoAaveV2Proxy } from "./MorphoAaveV2Proxy";
|
|
38
39
|
export type { MorphoAaveV2View } from "./MorphoAaveV2View";
|
|
39
40
|
export type { MorphoAaveV3ProxyEthMarket } from "./MorphoAaveV3ProxyEthMarket";
|
|
41
|
+
export type { MorphoBlueView } from "./MorphoBlueView";
|
|
40
42
|
export type { Pot } from "./Pot";
|
|
41
43
|
export type { PriceFeed } from "./PriceFeed";
|
|
42
44
|
export type { REth } from "./REth";
|
package/cjs/types/curveUsd.d.ts
CHANGED
|
@@ -67,12 +67,6 @@ export interface CrvUSDAggregatedPositionData {
|
|
|
67
67
|
borrowedUsd: string;
|
|
68
68
|
borrowed: string;
|
|
69
69
|
safetyRatio: string;
|
|
70
|
-
borrowLimitUsd: string;
|
|
71
|
-
minAllowedRatio: number;
|
|
72
|
-
collFactor: string;
|
|
73
|
-
leveragedType: string;
|
|
74
|
-
leveragedAsset?: string;
|
|
75
|
-
liquidationPrice?: string;
|
|
76
70
|
}
|
|
77
71
|
export interface CrvUSDUsedAsset {
|
|
78
72
|
isSupplied: boolean;
|
package/cjs/types/index.d.ts
CHANGED
package/cjs/types/index.js
CHANGED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { MMUsedAssets, NetworkNumber } from './common';
|
|
2
|
+
export declare enum MorphoBlueVersions {
|
|
3
|
+
MorphoBlueWstEthEth = "morphobluewstetheth"
|
|
4
|
+
}
|
|
5
|
+
export interface MorphoBlueMarketData {
|
|
6
|
+
chainIds: NetworkNumber[];
|
|
7
|
+
label: string;
|
|
8
|
+
shortLabel: string;
|
|
9
|
+
url: string;
|
|
10
|
+
value: MorphoBlueVersions;
|
|
11
|
+
loanToken: string;
|
|
12
|
+
collateralToken: string;
|
|
13
|
+
oracle: string;
|
|
14
|
+
irm: string;
|
|
15
|
+
lltv: number | string;
|
|
16
|
+
protocolName: string;
|
|
17
|
+
}
|
|
18
|
+
export interface MorphoBlueAssetData {
|
|
19
|
+
symbol: string;
|
|
20
|
+
address: string;
|
|
21
|
+
price: string;
|
|
22
|
+
supplyRate: string;
|
|
23
|
+
borrowRate: string;
|
|
24
|
+
incentiveSupplyApy?: string;
|
|
25
|
+
incentiveSupplyToken?: string;
|
|
26
|
+
totalSupply?: string;
|
|
27
|
+
totalBorrow?: string;
|
|
28
|
+
}
|
|
29
|
+
export type MorphoBlueAssetsData = {
|
|
30
|
+
[key: string]: MorphoBlueAssetData;
|
|
31
|
+
};
|
|
32
|
+
export interface MorphoBlueMarketInfo {
|
|
33
|
+
id: string;
|
|
34
|
+
fee: string;
|
|
35
|
+
loanToken: string;
|
|
36
|
+
collateralToken: string;
|
|
37
|
+
utillization: string;
|
|
38
|
+
oracle: string;
|
|
39
|
+
lltv: string;
|
|
40
|
+
assetsData: MorphoBlueAssetsData;
|
|
41
|
+
}
|
|
42
|
+
export interface MorphoBlueAggregatedPositionData {
|
|
43
|
+
suppliedUsd: string;
|
|
44
|
+
suppliedCollateralUsd: string;
|
|
45
|
+
borrowedUsd: string;
|
|
46
|
+
borrowLimitUsd: string;
|
|
47
|
+
liquidationLimitUsd: string;
|
|
48
|
+
leftToBorrowUsd: string;
|
|
49
|
+
netApy: string;
|
|
50
|
+
incentiveUsd: string;
|
|
51
|
+
totalInterestUsd: string;
|
|
52
|
+
ltv: string;
|
|
53
|
+
leveragedType: string;
|
|
54
|
+
leveragedAsset?: string;
|
|
55
|
+
leveragedLsdAssetRatio?: string;
|
|
56
|
+
liquidationPrice?: string;
|
|
57
|
+
}
|
|
58
|
+
export interface MorphoBluePositionData {
|
|
59
|
+
usedAssets: MMUsedAssets;
|
|
60
|
+
suppliedUsd: string;
|
|
61
|
+
suppliedCollateralUsd: string;
|
|
62
|
+
borrowedUsd: string;
|
|
63
|
+
borrowLimitUsd: string;
|
|
64
|
+
liquidationLimitUsd: string;
|
|
65
|
+
leftToBorrowUsd: string;
|
|
66
|
+
netApy: string;
|
|
67
|
+
incentiveUsd: string;
|
|
68
|
+
totalInterestUsd: string;
|
|
69
|
+
ltv: string;
|
|
70
|
+
leveragedType: string;
|
|
71
|
+
leveragedAsset?: string;
|
|
72
|
+
leveragedLsdAssetRatio?: string;
|
|
73
|
+
liquidationPrice?: string;
|
|
74
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MorphoBlueVersions = void 0;
|
|
4
|
+
var MorphoBlueVersions;
|
|
5
|
+
(function (MorphoBlueVersions) {
|
|
6
|
+
MorphoBlueVersions["MorphoBlueWstEthEth"] = "morphobluewstetheth";
|
|
7
|
+
})(MorphoBlueVersions || (exports.MorphoBlueVersions = MorphoBlueVersions = {}));
|
package/esm/compoundV3/index.js
CHANGED
|
@@ -169,7 +169,7 @@ export const getCompoundV3AccountData = (web3, network, address, proxyAddress, e
|
|
|
169
169
|
if (loanData.depositAmount.toString() !== '0') {
|
|
170
170
|
usedAssets[baseAssetSymbol].isSupplied = true;
|
|
171
171
|
usedAssets[baseAssetSymbol].supplied = assetAmountInEth(loanData.depositAmount, baseAssetInfo.symbol);
|
|
172
|
-
usedAssets[baseAssetSymbol].suppliedUsd = assetAmountInEth(loanData.depositValue, baseAssetInfo.symbol);
|
|
172
|
+
usedAssets[baseAssetSymbol].suppliedUsd = new Dec(assetAmountInEth(loanData.depositValue, baseAssetInfo.symbol)).mul(assetsData[baseAssetSymbol].price).toString();
|
|
173
173
|
}
|
|
174
174
|
if (loanData.borrowAmount.toString() !== '0') {
|
|
175
175
|
usedAssets[baseAssetSymbol].isBorrowed = true;
|