@defisaver/positions-sdk 2.1.127-midnight-dev → 2.1.127-uniswap-dev
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/claiming/index.d.ts +2 -1
- package/cjs/claiming/index.js +3 -1
- package/cjs/claiming/uniswap.d.ts +4 -0
- package/cjs/claiming/uniswap.js +70 -0
- package/cjs/config/contracts.d.ts +22 -249
- package/cjs/config/contracts.js +10 -11
- package/cjs/contracts.d.ts +35 -1510
- package/cjs/contracts.js +3 -3
- package/cjs/helpers/index.d.ts +0 -1
- package/cjs/helpers/index.js +1 -2
- package/cjs/helpers/morphoBlueHelpers/index.js +1 -0
- package/cjs/index.d.ts +1 -2
- package/cjs/index.js +1 -3
- package/cjs/markets/index.d.ts +0 -1
- package/cjs/markets/index.js +1 -4
- package/cjs/morphoBlue/index.d.ts +8 -6
- package/cjs/morphoBlue/index.js +69 -40
- package/cjs/portfolio/discovery.js +0 -4
- package/cjs/portfolio/index.js +30 -45
- package/cjs/services/viem.d.ts +11 -11
- package/cjs/types/claiming.d.ts +2 -0
- package/cjs/types/claiming.js +2 -0
- package/cjs/types/index.d.ts +0 -1
- package/cjs/types/index.js +0 -1
- package/cjs/types/morphoBlue.d.ts +9 -0
- package/cjs/types/portfolio.d.ts +0 -4
- package/esm/claiming/index.d.ts +2 -1
- package/esm/claiming/index.js +2 -1
- package/esm/claiming/uniswap.d.ts +4 -0
- package/esm/claiming/uniswap.js +62 -0
- package/esm/config/contracts.d.ts +22 -249
- package/esm/config/contracts.js +8 -9
- package/esm/contracts.d.ts +35 -1510
- package/esm/contracts.js +1 -1
- package/esm/helpers/index.d.ts +0 -1
- package/esm/helpers/index.js +0 -1
- package/esm/helpers/morphoBlueHelpers/index.js +1 -0
- package/esm/index.d.ts +1 -2
- package/esm/index.js +1 -2
- package/esm/markets/index.d.ts +0 -1
- package/esm/markets/index.js +0 -1
- package/esm/morphoBlue/index.d.ts +8 -6
- package/esm/morphoBlue/index.js +62 -39
- package/esm/portfolio/discovery.js +1 -5
- package/esm/portfolio/index.js +32 -47
- package/esm/services/viem.d.ts +11 -11
- package/esm/types/claiming.d.ts +2 -0
- package/esm/types/claiming.js +2 -0
- package/esm/types/index.d.ts +0 -1
- package/esm/types/index.js +0 -1
- package/esm/types/morphoBlue.d.ts +9 -0
- package/esm/types/portfolio.d.ts +0 -4
- package/package.json +1 -1
- package/src/claiming/index.ts +2 -0
- package/src/claiming/uniswap.ts +65 -0
- package/src/config/contracts.ts +9 -9
- package/src/contracts.ts +2 -1
- package/src/helpers/index.ts +0 -1
- package/src/helpers/morphoBlueHelpers/index.ts +1 -0
- package/src/index.ts +0 -2
- package/src/markets/index.ts +0 -1
- package/src/morphoBlue/index.ts +101 -44
- package/src/portfolio/discovery.ts +0 -6
- package/src/portfolio/index.ts +30 -46
- package/src/types/claiming.ts +2 -0
- package/src/types/index.ts +0 -1
- package/src/types/morphoBlue.ts +11 -0
- package/src/types/portfolio.ts +0 -4
- package/cjs/helpers/morphoMidnightHelpers/index.d.ts +0 -16
- package/cjs/helpers/morphoMidnightHelpers/index.js +0 -68
- package/cjs/markets/morphoMidnight/index.d.ts +0 -16
- package/cjs/markets/morphoMidnight/index.js +0 -159
- package/cjs/morphoMidnight/index.d.ts +0 -14
- package/cjs/morphoMidnight/index.js +0 -220
- package/cjs/types/morphoMidnight.d.ts +0 -91
- package/cjs/types/morphoMidnight.js +0 -15
- package/esm/helpers/morphoMidnightHelpers/index.d.ts +0 -16
- package/esm/helpers/morphoMidnightHelpers/index.js +0 -61
- package/esm/markets/morphoMidnight/index.d.ts +0 -16
- package/esm/markets/morphoMidnight/index.js +0 -148
- package/esm/morphoMidnight/index.d.ts +0 -14
- package/esm/morphoMidnight/index.js +0 -207
- package/esm/types/morphoMidnight.d.ts +0 -91
- package/esm/types/morphoMidnight.js +0 -12
- package/src/helpers/morphoMidnightHelpers/index.ts +0 -86
- package/src/markets/morphoMidnight/index.ts +0 -161
- package/src/morphoMidnight/index.ts +0 -234
- package/src/types/morphoMidnight.ts +0 -104
package/cjs/services/viem.d.ts
CHANGED
|
@@ -833,7 +833,6 @@ export declare const getViemProvider: (provider: EthereumProvider, network: Netw
|
|
|
833
833
|
s: import("viem").Hex;
|
|
834
834
|
value: bigint;
|
|
835
835
|
v: bigint;
|
|
836
|
-
chainId?: number | undefined;
|
|
837
836
|
type: "legacy";
|
|
838
837
|
gas: bigint;
|
|
839
838
|
nonce: number;
|
|
@@ -848,6 +847,7 @@ export declare const getViemProvider: (provider: EthereumProvider, network: Netw
|
|
|
848
847
|
yParity?: undefined | undefined;
|
|
849
848
|
input: import("viem").Hex;
|
|
850
849
|
typeHex: import("viem").Hex | null;
|
|
850
|
+
chainId?: number | undefined;
|
|
851
851
|
blockNumber: (blockTag extends "pending" ? true : false) extends infer T ? T extends (blockTag extends "pending" ? true : false) ? T extends true ? null : bigint : never : never;
|
|
852
852
|
blockHash: (blockTag extends "pending" ? true : false) extends infer T_1 ? T_1 extends (blockTag extends "pending" ? true : false) ? T_1 extends true ? null : `0x${string}` : never : never;
|
|
853
853
|
transactionIndex: (blockTag extends "pending" ? true : false) extends infer T_2 ? T_2 extends (blockTag extends "pending" ? true : false) ? T_2 extends true ? null : number : never : never;
|
|
@@ -858,7 +858,6 @@ export declare const getViemProvider: (provider: EthereumProvider, network: Netw
|
|
|
858
858
|
s: import("viem").Hex;
|
|
859
859
|
value: bigint;
|
|
860
860
|
v: bigint;
|
|
861
|
-
chainId: number;
|
|
862
861
|
type: "eip2930";
|
|
863
862
|
gas: bigint;
|
|
864
863
|
nonce: number;
|
|
@@ -873,6 +872,7 @@ export declare const getViemProvider: (provider: EthereumProvider, network: Netw
|
|
|
873
872
|
yParity: number;
|
|
874
873
|
input: import("viem").Hex;
|
|
875
874
|
typeHex: import("viem").Hex | null;
|
|
875
|
+
chainId: number;
|
|
876
876
|
blockNumber: (blockTag extends "pending" ? true : false) extends infer T_3 ? T_3 extends (blockTag extends "pending" ? true : false) ? T_3 extends true ? null : bigint : never : never;
|
|
877
877
|
blockHash: (blockTag extends "pending" ? true : false) extends infer T_4 ? T_4 extends (blockTag extends "pending" ? true : false) ? T_4 extends true ? null : `0x${string}` : never : never;
|
|
878
878
|
transactionIndex: (blockTag extends "pending" ? true : false) extends infer T_5 ? T_5 extends (blockTag extends "pending" ? true : false) ? T_5 extends true ? null : number : never : never;
|
|
@@ -883,7 +883,6 @@ export declare const getViemProvider: (provider: EthereumProvider, network: Netw
|
|
|
883
883
|
s: import("viem").Hex;
|
|
884
884
|
value: bigint;
|
|
885
885
|
v: bigint;
|
|
886
|
-
chainId: number;
|
|
887
886
|
type: "eip1559";
|
|
888
887
|
gas: bigint;
|
|
889
888
|
nonce: number;
|
|
@@ -898,6 +897,7 @@ export declare const getViemProvider: (provider: EthereumProvider, network: Netw
|
|
|
898
897
|
yParity: number;
|
|
899
898
|
input: import("viem").Hex;
|
|
900
899
|
typeHex: import("viem").Hex | null;
|
|
900
|
+
chainId: number;
|
|
901
901
|
blockNumber: (blockTag extends "pending" ? true : false) extends infer T_6 ? T_6 extends (blockTag extends "pending" ? true : false) ? T_6 extends true ? null : bigint : never : never;
|
|
902
902
|
blockHash: (blockTag extends "pending" ? true : false) extends infer T_7 ? T_7 extends (blockTag extends "pending" ? true : false) ? T_7 extends true ? null : `0x${string}` : never : never;
|
|
903
903
|
transactionIndex: (blockTag extends "pending" ? true : false) extends infer T_8 ? T_8 extends (blockTag extends "pending" ? true : false) ? T_8 extends true ? null : number : never : never;
|
|
@@ -908,7 +908,6 @@ export declare const getViemProvider: (provider: EthereumProvider, network: Netw
|
|
|
908
908
|
s: import("viem").Hex;
|
|
909
909
|
value: bigint;
|
|
910
910
|
v: bigint;
|
|
911
|
-
chainId: number;
|
|
912
911
|
type: "eip4844";
|
|
913
912
|
gas: bigint;
|
|
914
913
|
nonce: number;
|
|
@@ -923,6 +922,7 @@ export declare const getViemProvider: (provider: EthereumProvider, network: Netw
|
|
|
923
922
|
yParity: number;
|
|
924
923
|
input: import("viem").Hex;
|
|
925
924
|
typeHex: import("viem").Hex | null;
|
|
925
|
+
chainId: number;
|
|
926
926
|
blockNumber: (blockTag extends "pending" ? true : false) extends infer T_9 ? T_9 extends (blockTag extends "pending" ? true : false) ? T_9 extends true ? null : bigint : never : never;
|
|
927
927
|
blockHash: (blockTag extends "pending" ? true : false) extends infer T_10 ? T_10 extends (blockTag extends "pending" ? true : false) ? T_10 extends true ? null : `0x${string}` : never : never;
|
|
928
928
|
transactionIndex: (blockTag extends "pending" ? true : false) extends infer T_11 ? T_11 extends (blockTag extends "pending" ? true : false) ? T_11 extends true ? null : number : never : never;
|
|
@@ -933,7 +933,6 @@ export declare const getViemProvider: (provider: EthereumProvider, network: Netw
|
|
|
933
933
|
s: import("viem").Hex;
|
|
934
934
|
value: bigint;
|
|
935
935
|
v: bigint;
|
|
936
|
-
chainId: number;
|
|
937
936
|
type: "eip7702";
|
|
938
937
|
gas: bigint;
|
|
939
938
|
nonce: number;
|
|
@@ -948,6 +947,7 @@ export declare const getViemProvider: (provider: EthereumProvider, network: Netw
|
|
|
948
947
|
yParity: number;
|
|
949
948
|
input: import("viem").Hex;
|
|
950
949
|
typeHex: import("viem").Hex | null;
|
|
950
|
+
chainId: number;
|
|
951
951
|
blockNumber: (blockTag extends "pending" ? true : false) extends infer T_12 ? T_12 extends (blockTag extends "pending" ? true : false) ? T_12 extends true ? null : bigint : never : never;
|
|
952
952
|
blockHash: (blockTag extends "pending" ? true : false) extends infer T_13 ? T_13 extends (blockTag extends "pending" ? true : false) ? T_13 extends true ? null : `0x${string}` : never : never;
|
|
953
953
|
transactionIndex: (blockTag extends "pending" ? true : false) extends infer T_14 ? T_14 extends (blockTag extends "pending" ? true : false) ? T_14 extends true ? null : number : never : never;
|
|
@@ -983,7 +983,6 @@ export declare const getViemProvider: (provider: EthereumProvider, network: Netw
|
|
|
983
983
|
s: import("viem").Hex;
|
|
984
984
|
value: bigint;
|
|
985
985
|
v: bigint;
|
|
986
|
-
chainId?: number | undefined;
|
|
987
986
|
type: "legacy";
|
|
988
987
|
gas: bigint;
|
|
989
988
|
nonce: number;
|
|
@@ -998,6 +997,7 @@ export declare const getViemProvider: (provider: EthereumProvider, network: Netw
|
|
|
998
997
|
yParity?: undefined | undefined;
|
|
999
998
|
input: import("viem").Hex;
|
|
1000
999
|
typeHex: import("viem").Hex | null;
|
|
1000
|
+
chainId?: number | undefined;
|
|
1001
1001
|
blockNumber: (blockTag extends "pending" ? true : false) extends infer T ? T extends (blockTag extends "pending" ? true : false) ? T extends true ? null : bigint : never : never;
|
|
1002
1002
|
blockHash: (blockTag extends "pending" ? true : false) extends infer T_1 ? T_1 extends (blockTag extends "pending" ? true : false) ? T_1 extends true ? null : `0x${string}` : never : never;
|
|
1003
1003
|
transactionIndex: (blockTag extends "pending" ? true : false) extends infer T_2 ? T_2 extends (blockTag extends "pending" ? true : false) ? T_2 extends true ? null : number : never : never;
|
|
@@ -1008,7 +1008,6 @@ export declare const getViemProvider: (provider: EthereumProvider, network: Netw
|
|
|
1008
1008
|
s: import("viem").Hex;
|
|
1009
1009
|
value: bigint;
|
|
1010
1010
|
v: bigint;
|
|
1011
|
-
chainId: number;
|
|
1012
1011
|
type: "eip2930";
|
|
1013
1012
|
gas: bigint;
|
|
1014
1013
|
nonce: number;
|
|
@@ -1023,6 +1022,7 @@ export declare const getViemProvider: (provider: EthereumProvider, network: Netw
|
|
|
1023
1022
|
yParity: number;
|
|
1024
1023
|
input: import("viem").Hex;
|
|
1025
1024
|
typeHex: import("viem").Hex | null;
|
|
1025
|
+
chainId: number;
|
|
1026
1026
|
blockNumber: (blockTag extends "pending" ? true : false) extends infer T_3 ? T_3 extends (blockTag extends "pending" ? true : false) ? T_3 extends true ? null : bigint : never : never;
|
|
1027
1027
|
blockHash: (blockTag extends "pending" ? true : false) extends infer T_4 ? T_4 extends (blockTag extends "pending" ? true : false) ? T_4 extends true ? null : `0x${string}` : never : never;
|
|
1028
1028
|
transactionIndex: (blockTag extends "pending" ? true : false) extends infer T_5 ? T_5 extends (blockTag extends "pending" ? true : false) ? T_5 extends true ? null : number : never : never;
|
|
@@ -1033,7 +1033,6 @@ export declare const getViemProvider: (provider: EthereumProvider, network: Netw
|
|
|
1033
1033
|
s: import("viem").Hex;
|
|
1034
1034
|
value: bigint;
|
|
1035
1035
|
v: bigint;
|
|
1036
|
-
chainId: number;
|
|
1037
1036
|
type: "eip1559";
|
|
1038
1037
|
gas: bigint;
|
|
1039
1038
|
nonce: number;
|
|
@@ -1048,6 +1047,7 @@ export declare const getViemProvider: (provider: EthereumProvider, network: Netw
|
|
|
1048
1047
|
yParity: number;
|
|
1049
1048
|
input: import("viem").Hex;
|
|
1050
1049
|
typeHex: import("viem").Hex | null;
|
|
1050
|
+
chainId: number;
|
|
1051
1051
|
blockNumber: (blockTag extends "pending" ? true : false) extends infer T_6 ? T_6 extends (blockTag extends "pending" ? true : false) ? T_6 extends true ? null : bigint : never : never;
|
|
1052
1052
|
blockHash: (blockTag extends "pending" ? true : false) extends infer T_7 ? T_7 extends (blockTag extends "pending" ? true : false) ? T_7 extends true ? null : `0x${string}` : never : never;
|
|
1053
1053
|
transactionIndex: (blockTag extends "pending" ? true : false) extends infer T_8 ? T_8 extends (blockTag extends "pending" ? true : false) ? T_8 extends true ? null : number : never : never;
|
|
@@ -1058,7 +1058,6 @@ export declare const getViemProvider: (provider: EthereumProvider, network: Netw
|
|
|
1058
1058
|
s: import("viem").Hex;
|
|
1059
1059
|
value: bigint;
|
|
1060
1060
|
v: bigint;
|
|
1061
|
-
chainId: number;
|
|
1062
1061
|
type: "eip4844";
|
|
1063
1062
|
gas: bigint;
|
|
1064
1063
|
nonce: number;
|
|
@@ -1073,6 +1072,7 @@ export declare const getViemProvider: (provider: EthereumProvider, network: Netw
|
|
|
1073
1072
|
yParity: number;
|
|
1074
1073
|
input: import("viem").Hex;
|
|
1075
1074
|
typeHex: import("viem").Hex | null;
|
|
1075
|
+
chainId: number;
|
|
1076
1076
|
blockNumber: (blockTag extends "pending" ? true : false) extends infer T_9 ? T_9 extends (blockTag extends "pending" ? true : false) ? T_9 extends true ? null : bigint : never : never;
|
|
1077
1077
|
blockHash: (blockTag extends "pending" ? true : false) extends infer T_10 ? T_10 extends (blockTag extends "pending" ? true : false) ? T_10 extends true ? null : `0x${string}` : never : never;
|
|
1078
1078
|
transactionIndex: (blockTag extends "pending" ? true : false) extends infer T_11 ? T_11 extends (blockTag extends "pending" ? true : false) ? T_11 extends true ? null : number : never : never;
|
|
@@ -1083,7 +1083,6 @@ export declare const getViemProvider: (provider: EthereumProvider, network: Netw
|
|
|
1083
1083
|
s: import("viem").Hex;
|
|
1084
1084
|
value: bigint;
|
|
1085
1085
|
v: bigint;
|
|
1086
|
-
chainId: number;
|
|
1087
1086
|
type: "eip7702";
|
|
1088
1087
|
gas: bigint;
|
|
1089
1088
|
nonce: number;
|
|
@@ -1098,6 +1097,7 @@ export declare const getViemProvider: (provider: EthereumProvider, network: Netw
|
|
|
1098
1097
|
yParity: number;
|
|
1099
1098
|
input: import("viem").Hex;
|
|
1100
1099
|
typeHex: import("viem").Hex | null;
|
|
1100
|
+
chainId: number;
|
|
1101
1101
|
blockNumber: (blockTag extends "pending" ? true : false) extends infer T_12 ? T_12 extends (blockTag extends "pending" ? true : false) ? T_12 extends true ? null : bigint : never : never;
|
|
1102
1102
|
blockHash: (blockTag extends "pending" ? true : false) extends infer T_13 ? T_13 extends (blockTag extends "pending" ? true : false) ? T_13 extends true ? null : `0x${string}` : never : never;
|
|
1103
1103
|
transactionIndex: (blockTag extends "pending" ? true : false) extends infer T_14 ? T_14 extends (blockTag extends "pending" ? true : false) ? T_14 extends true ? null : number : never : never;
|
|
@@ -4358,7 +4358,7 @@ export declare const getViemProvider: (provider: EthereumProvider, network: Netw
|
|
|
4358
4358
|
authorizationList: import("viem").TransactionSerializableEIP7702["authorizationList"];
|
|
4359
4359
|
} ? "eip7702" : never) | (request["type"] extends string | undefined ? Extract<request["type"], string> : never)>) ? T_12 extends "eip7702" ? import("viem").TransactionRequestEIP7702 : never : never : never)>> & {
|
|
4360
4360
|
chainId?: number | undefined;
|
|
4361
|
-
}, (request["parameters"] extends readonly import("viem").PrepareTransactionRequestParameterType[] ? request["parameters"][number] : "
|
|
4361
|
+
}, (request["parameters"] extends readonly import("viem").PrepareTransactionRequestParameterType[] ? request["parameters"][number] : "type" | "gas" | "nonce" | "blobVersionedHashes" | "fees" | "chainId") extends infer T_13 ? T_13 extends (request["parameters"] extends readonly import("viem").PrepareTransactionRequestParameterType[] ? request["parameters"][number] : "type" | "gas" | "nonce" | "blobVersionedHashes" | "fees" | "chainId") ? T_13 extends "fees" ? "gasPrice" | "maxFeePerGas" | "maxPriorityFeePerGas" : T_13 : never : never> & (unknown extends request["kzg"] ? {} : Pick<request, "kzg">) extends infer T ? { [K in keyof T]: T[K]; } : never>;
|
|
4362
4362
|
readContract: <const abi extends Abi | readonly unknown[], functionName extends import("viem").ContractFunctionName<abi, "pure" | "view">, const args extends import("viem").ContractFunctionArgs<abi, "pure" | "view", functionName>>(args: import("viem").ReadContractParameters<abi, functionName, args>) => Promise<import("viem").ReadContractReturnType<abi, functionName, args>>;
|
|
4363
4363
|
sendRawTransaction: (args: import("viem").SendRawTransactionParameters) => Promise<import("viem").SendRawTransactionReturnType>;
|
|
4364
4364
|
simulate: <const calls extends readonly unknown[]>(args: import("viem").SimulateBlocksParameters<calls>) => Promise<import("viem").SimulateBlocksReturnType<calls>>;
|
package/cjs/types/claiming.d.ts
CHANGED
|
@@ -14,6 +14,8 @@ export declare enum ClaimType {
|
|
|
14
14
|
SPARK_AIRDROP = "SPARK_AIRDROP",
|
|
15
15
|
/** Spark Airdrop */
|
|
16
16
|
SPARK_WST_ETH_REWARDS = "SPARK_WST_ETH_REWARDS",// TODO: This will be removed once we fully refactor spark rewards
|
|
17
|
+
/** UNI Airdrop */
|
|
18
|
+
UNI_REWARDS = "UNI_REWARDS",
|
|
17
19
|
ETHENA_AIRDROP = "ETHENA_AIRDROP"
|
|
18
20
|
}
|
|
19
21
|
type _ClaimableTokenPartial = {
|
package/cjs/types/claiming.js
CHANGED
|
@@ -17,6 +17,8 @@ var ClaimType;
|
|
|
17
17
|
ClaimType["SPARK_AIRDROP"] = "SPARK_AIRDROP";
|
|
18
18
|
/** Spark Airdrop */
|
|
19
19
|
ClaimType["SPARK_WST_ETH_REWARDS"] = "SPARK_WST_ETH_REWARDS";
|
|
20
|
+
/** UNI Airdrop */
|
|
21
|
+
ClaimType["UNI_REWARDS"] = "UNI_REWARDS";
|
|
20
22
|
ClaimType["ETHENA_AIRDROP"] = "ETHENA_AIRDROP";
|
|
21
23
|
})(ClaimType || (exports.ClaimType = ClaimType = {}));
|
|
22
24
|
var SparkAirdropType;
|
package/cjs/types/index.d.ts
CHANGED
package/cjs/types/index.js
CHANGED
|
@@ -22,7 +22,6 @@ __exportStar(require("./liquity"), exports);
|
|
|
22
22
|
__exportStar(require("./liquityV2"), exports);
|
|
23
23
|
__exportStar(require("./maker"), exports);
|
|
24
24
|
__exportStar(require("./morphoBlue"), exports);
|
|
25
|
-
__exportStar(require("./morphoMidnight"), exports);
|
|
26
25
|
__exportStar(require("./llamaLend"), exports);
|
|
27
26
|
__exportStar(require("./euler"), exports);
|
|
28
27
|
__exportStar(require("./fluid"), exports);
|
|
@@ -212,6 +212,15 @@ export interface MorphoBluePositionData {
|
|
|
212
212
|
borrowShares: string;
|
|
213
213
|
exposure: string;
|
|
214
214
|
}
|
|
215
|
+
export interface MorphoBlueEarnData {
|
|
216
|
+
apy: string;
|
|
217
|
+
amount: string;
|
|
218
|
+
amountUsd: string;
|
|
219
|
+
}
|
|
220
|
+
export interface MorphoBlueMarketRewards {
|
|
221
|
+
supplyApy: string;
|
|
222
|
+
borrowApy: string;
|
|
223
|
+
}
|
|
215
224
|
export interface MorphoBlueVault {
|
|
216
225
|
address: string;
|
|
217
226
|
}
|
package/cjs/types/portfolio.d.ts
CHANGED
|
@@ -9,7 +9,6 @@ import { LiquityTroveInfo } from './liquity';
|
|
|
9
9
|
import { LlamaLendUserData, LlamaLendVersionsType } from './llamaLend';
|
|
10
10
|
import { CdpData } from './maker';
|
|
11
11
|
import { MorphoBluePositionData, MorphoBlueVersions } from './morphoBlue';
|
|
12
|
-
import { MorphoMidnightPositionData, MorphoMidnightVersions } from './morphoMidnight';
|
|
13
12
|
import { SparkPositionData, SparkVersions } from './spark';
|
|
14
13
|
export interface PortfolioProtocolData<T> {
|
|
15
14
|
error: string;
|
|
@@ -22,9 +21,6 @@ export interface PortfolioPositionsDataForAddress {
|
|
|
22
21
|
morphoBlue: {
|
|
23
22
|
[key in MorphoBlueVersions]?: PortfolioProtocolData<MorphoBluePositionData>;
|
|
24
23
|
};
|
|
25
|
-
morphoMidnight: {
|
|
26
|
-
[key in MorphoMidnightVersions]?: PortfolioProtocolData<MorphoMidnightPositionData>;
|
|
27
|
-
};
|
|
28
24
|
compoundV3: {
|
|
29
25
|
[key in CompoundVersions]?: PortfolioProtocolData<CompoundV3PositionData>;
|
|
30
26
|
};
|
package/esm/claiming/index.d.ts
CHANGED
|
@@ -2,4 +2,5 @@ import * as aaveV3Claim from './aaveV3';
|
|
|
2
2
|
import * as compV3Claim from './compV3';
|
|
3
3
|
import * as kingV3Claim from './king';
|
|
4
4
|
import * as sparkClaim from './spark';
|
|
5
|
-
|
|
5
|
+
import * as uniswapClaim from './uniswap';
|
|
6
|
+
export { aaveV3Claim, compV3Claim, kingV3Claim, sparkClaim, uniswapClaim, };
|
package/esm/claiming/index.js
CHANGED
|
@@ -2,4 +2,5 @@ import * as aaveV3Claim from './aaveV3';
|
|
|
2
2
|
import * as compV3Claim from './compV3';
|
|
3
3
|
import * as kingV3Claim from './king';
|
|
4
4
|
import * as sparkClaim from './spark';
|
|
5
|
-
|
|
5
|
+
import * as uniswapClaim from './uniswap';
|
|
6
|
+
export { aaveV3Claim, compV3Claim, kingV3Claim, sparkClaim, uniswapClaim, };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Client } from 'viem';
|
|
2
|
+
import { EthAddress, NetworkNumber } from '../types';
|
|
3
|
+
export declare const fetchUniswapRewardsData: (walletAddress: EthAddress) => Promise<any>;
|
|
4
|
+
export declare const getUniswapRewards: (provider: Client, network: NetworkNumber, walletAddresses: EthAddress[]) => Promise<Record<string, any[]>>;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import Dec from 'decimal.js';
|
|
11
|
+
import { assetAmountInEth } from '@defisaver/tokens';
|
|
12
|
+
import { UniswapTokenDistributorViem } from '../contracts';
|
|
13
|
+
import { ClaimType } from '../types/claiming';
|
|
14
|
+
const EMPTY_DATA = (walletAddress) => ({
|
|
15
|
+
address: walletAddress, index: 0, amount: '0x0', proof: [],
|
|
16
|
+
});
|
|
17
|
+
export const fetchUniswapRewardsData = (walletAddress) => __awaiter(void 0, void 0, void 0, function* () {
|
|
18
|
+
try {
|
|
19
|
+
const res = yield fetch(`https://uniswap-merkl-drop.defisaver.com/claims/${walletAddress}`, { signal: AbortSignal.timeout(5000) });
|
|
20
|
+
if (!res.ok)
|
|
21
|
+
throw new Error(yield res.text());
|
|
22
|
+
const data = yield res.json();
|
|
23
|
+
if (data.error)
|
|
24
|
+
return EMPTY_DATA(walletAddress);
|
|
25
|
+
return data;
|
|
26
|
+
}
|
|
27
|
+
catch (err) {
|
|
28
|
+
console.error('External API Error: Error fetching Uniswap rewards:', err);
|
|
29
|
+
return EMPTY_DATA(walletAddress);
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
export const getUniswapRewards = (provider, network, walletAddresses) => __awaiter(void 0, void 0, void 0, function* () {
|
|
33
|
+
// Fetch all API data in parallel (these are external API calls, can't be batched with multicall)
|
|
34
|
+
const apiDataPromises = walletAddresses.map(address => fetchUniswapRewardsData(address));
|
|
35
|
+
const apiDataArray = yield Promise.all(apiDataPromises);
|
|
36
|
+
// Batch all contract calls using multicall
|
|
37
|
+
const contract = UniswapTokenDistributorViem(provider, network);
|
|
38
|
+
const cumulativePromises = apiDataArray.map(data => (data.index ? contract.read.isClaimed([data.index]) : Promise.resolve(false)));
|
|
39
|
+
const cumulativeResults = yield Promise.all(cumulativePromises);
|
|
40
|
+
// Process results
|
|
41
|
+
const results = {};
|
|
42
|
+
for (let i = 0; i < walletAddresses.length; i++) {
|
|
43
|
+
const walletAddress = walletAddresses[i];
|
|
44
|
+
const data = apiDataArray[i];
|
|
45
|
+
const cumulative = cumulativeResults[i];
|
|
46
|
+
const amountToClaim = new Dec(data.amount);
|
|
47
|
+
if (amountToClaim.lessThanOrEqualTo('0')) {
|
|
48
|
+
results[walletAddress.toLowerCase()] = [];
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
results[walletAddress.toLowerCase()] = [{
|
|
52
|
+
amount: assetAmountInEth(amountToClaim.toString(), 'UNI'),
|
|
53
|
+
walletAddress,
|
|
54
|
+
claimType: ClaimType.UNI_REWARDS,
|
|
55
|
+
index: data.index,
|
|
56
|
+
proof: data.proof,
|
|
57
|
+
isClaimed: cumulative,
|
|
58
|
+
}];
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return results;
|
|
62
|
+
});
|
|
@@ -87015,255 +87015,6 @@ export declare const MorphoBlueView: {
|
|
|
87015
87015
|
};
|
|
87016
87016
|
};
|
|
87017
87017
|
};
|
|
87018
|
-
export declare const MidnightView: {
|
|
87019
|
-
readonly abi: readonly [{
|
|
87020
|
-
readonly inputs: readonly [{
|
|
87021
|
-
readonly internalType: "bytes32";
|
|
87022
|
-
readonly name: "_id";
|
|
87023
|
-
readonly type: "bytes32";
|
|
87024
|
-
}];
|
|
87025
|
-
readonly name: "getMarketInfo";
|
|
87026
|
-
readonly outputs: readonly [{
|
|
87027
|
-
readonly components: readonly [{
|
|
87028
|
-
readonly internalType: "bytes32";
|
|
87029
|
-
readonly name: "id";
|
|
87030
|
-
readonly type: "bytes32";
|
|
87031
|
-
}, {
|
|
87032
|
-
readonly internalType: "uint128";
|
|
87033
|
-
readonly name: "totalUnits";
|
|
87034
|
-
readonly type: "uint128";
|
|
87035
|
-
}, {
|
|
87036
|
-
readonly internalType: "uint128";
|
|
87037
|
-
readonly name: "lossFactor";
|
|
87038
|
-
readonly type: "uint128";
|
|
87039
|
-
}, {
|
|
87040
|
-
readonly internalType: "uint128";
|
|
87041
|
-
readonly name: "withdrawable";
|
|
87042
|
-
readonly type: "uint128";
|
|
87043
|
-
}, {
|
|
87044
|
-
readonly internalType: "uint128";
|
|
87045
|
-
readonly name: "continuousFeeCredit";
|
|
87046
|
-
readonly type: "uint128";
|
|
87047
|
-
}, {
|
|
87048
|
-
readonly internalType: "uint16[7]";
|
|
87049
|
-
readonly name: "settlementFees";
|
|
87050
|
-
readonly type: "uint16[7]";
|
|
87051
|
-
}, {
|
|
87052
|
-
readonly internalType: "uint32";
|
|
87053
|
-
readonly name: "continuousFee";
|
|
87054
|
-
readonly type: "uint32";
|
|
87055
|
-
}, {
|
|
87056
|
-
readonly internalType: "uint8";
|
|
87057
|
-
readonly name: "tickSpacing";
|
|
87058
|
-
readonly type: "uint8";
|
|
87059
|
-
}, {
|
|
87060
|
-
readonly internalType: "uint256[]";
|
|
87061
|
-
readonly name: "prices";
|
|
87062
|
-
readonly type: "uint256[]";
|
|
87063
|
-
}];
|
|
87064
|
-
readonly internalType: "struct MidnightView.MarketInfo";
|
|
87065
|
-
readonly name: "info";
|
|
87066
|
-
readonly type: "tuple";
|
|
87067
|
-
}];
|
|
87068
|
-
readonly stateMutability: "view";
|
|
87069
|
-
readonly type: "function";
|
|
87070
|
-
}, {
|
|
87071
|
-
readonly inputs: readonly [{
|
|
87072
|
-
readonly internalType: "bytes32";
|
|
87073
|
-
readonly name: "_id";
|
|
87074
|
-
readonly type: "bytes32";
|
|
87075
|
-
}, {
|
|
87076
|
-
readonly internalType: "address";
|
|
87077
|
-
readonly name: "_user";
|
|
87078
|
-
readonly type: "address";
|
|
87079
|
-
}];
|
|
87080
|
-
readonly name: "getPositionInfo";
|
|
87081
|
-
readonly outputs: readonly [{
|
|
87082
|
-
readonly components: readonly [{
|
|
87083
|
-
readonly internalType: "uint128";
|
|
87084
|
-
readonly name: "credit";
|
|
87085
|
-
readonly type: "uint128";
|
|
87086
|
-
}, {
|
|
87087
|
-
readonly internalType: "uint128";
|
|
87088
|
-
readonly name: "pendingFee";
|
|
87089
|
-
readonly type: "uint128";
|
|
87090
|
-
}, {
|
|
87091
|
-
readonly internalType: "uint128";
|
|
87092
|
-
readonly name: "debt";
|
|
87093
|
-
readonly type: "uint128";
|
|
87094
|
-
}, {
|
|
87095
|
-
readonly internalType: "uint128";
|
|
87096
|
-
readonly name: "collateralBitmap";
|
|
87097
|
-
readonly type: "uint128";
|
|
87098
|
-
}, {
|
|
87099
|
-
readonly internalType: "uint128[]";
|
|
87100
|
-
readonly name: "collateral";
|
|
87101
|
-
readonly type: "uint128[]";
|
|
87102
|
-
}, {
|
|
87103
|
-
readonly internalType: "uint256";
|
|
87104
|
-
readonly name: "ratio";
|
|
87105
|
-
readonly type: "uint256";
|
|
87106
|
-
}];
|
|
87107
|
-
readonly internalType: "struct MidnightView.PositionInfo";
|
|
87108
|
-
readonly name: "pos";
|
|
87109
|
-
readonly type: "tuple";
|
|
87110
|
-
}];
|
|
87111
|
-
readonly stateMutability: "view";
|
|
87112
|
-
readonly type: "function";
|
|
87113
|
-
}, {
|
|
87114
|
-
readonly inputs: readonly [{
|
|
87115
|
-
readonly internalType: "bytes32";
|
|
87116
|
-
readonly name: "_id";
|
|
87117
|
-
readonly type: "bytes32";
|
|
87118
|
-
}, {
|
|
87119
|
-
readonly internalType: "address";
|
|
87120
|
-
readonly name: "_user";
|
|
87121
|
-
readonly type: "address";
|
|
87122
|
-
}];
|
|
87123
|
-
readonly name: "getRatio";
|
|
87124
|
-
readonly outputs: readonly [{
|
|
87125
|
-
readonly internalType: "uint256";
|
|
87126
|
-
readonly name: "ratio";
|
|
87127
|
-
readonly type: "uint256";
|
|
87128
|
-
}];
|
|
87129
|
-
readonly stateMutability: "view";
|
|
87130
|
-
readonly type: "function";
|
|
87131
|
-
}, {
|
|
87132
|
-
readonly inputs: readonly [{
|
|
87133
|
-
readonly components: readonly [{
|
|
87134
|
-
readonly internalType: "uint256";
|
|
87135
|
-
readonly name: "chainId";
|
|
87136
|
-
readonly type: "uint256";
|
|
87137
|
-
}, {
|
|
87138
|
-
readonly internalType: "address";
|
|
87139
|
-
readonly name: "midnight";
|
|
87140
|
-
readonly type: "address";
|
|
87141
|
-
}, {
|
|
87142
|
-
readonly internalType: "address";
|
|
87143
|
-
readonly name: "loanToken";
|
|
87144
|
-
readonly type: "address";
|
|
87145
|
-
}, {
|
|
87146
|
-
readonly components: readonly [{
|
|
87147
|
-
readonly internalType: "address";
|
|
87148
|
-
readonly name: "token";
|
|
87149
|
-
readonly type: "address";
|
|
87150
|
-
}, {
|
|
87151
|
-
readonly internalType: "uint256";
|
|
87152
|
-
readonly name: "lltv";
|
|
87153
|
-
readonly type: "uint256";
|
|
87154
|
-
}, {
|
|
87155
|
-
readonly internalType: "uint256";
|
|
87156
|
-
readonly name: "liquidationCursor";
|
|
87157
|
-
readonly type: "uint256";
|
|
87158
|
-
}, {
|
|
87159
|
-
readonly internalType: "address";
|
|
87160
|
-
readonly name: "oracle";
|
|
87161
|
-
readonly type: "address";
|
|
87162
|
-
}];
|
|
87163
|
-
readonly internalType: "struct CollateralParams[]";
|
|
87164
|
-
readonly name: "collateralParams";
|
|
87165
|
-
readonly type: "tuple[]";
|
|
87166
|
-
}, {
|
|
87167
|
-
readonly internalType: "uint256";
|
|
87168
|
-
readonly name: "maturity";
|
|
87169
|
-
readonly type: "uint256";
|
|
87170
|
-
}, {
|
|
87171
|
-
readonly internalType: "uint256";
|
|
87172
|
-
readonly name: "rcfThreshold";
|
|
87173
|
-
readonly type: "uint256";
|
|
87174
|
-
}, {
|
|
87175
|
-
readonly internalType: "address";
|
|
87176
|
-
readonly name: "enterGate";
|
|
87177
|
-
readonly type: "address";
|
|
87178
|
-
}, {
|
|
87179
|
-
readonly internalType: "address";
|
|
87180
|
-
readonly name: "liquidatorGate";
|
|
87181
|
-
readonly type: "address";
|
|
87182
|
-
}];
|
|
87183
|
-
readonly internalType: "struct Market";
|
|
87184
|
-
readonly name: "_market";
|
|
87185
|
-
readonly type: "tuple";
|
|
87186
|
-
}];
|
|
87187
|
-
readonly name: "toId";
|
|
87188
|
-
readonly outputs: readonly [{
|
|
87189
|
-
readonly internalType: "bytes32";
|
|
87190
|
-
readonly name: "id";
|
|
87191
|
-
readonly type: "bytes32";
|
|
87192
|
-
}];
|
|
87193
|
-
readonly stateMutability: "pure";
|
|
87194
|
-
readonly type: "function";
|
|
87195
|
-
}, {
|
|
87196
|
-
readonly inputs: readonly [{
|
|
87197
|
-
readonly internalType: "bytes32";
|
|
87198
|
-
readonly name: "_id";
|
|
87199
|
-
readonly type: "bytes32";
|
|
87200
|
-
}];
|
|
87201
|
-
readonly name: "toMarket";
|
|
87202
|
-
readonly outputs: readonly [{
|
|
87203
|
-
readonly components: readonly [{
|
|
87204
|
-
readonly internalType: "uint256";
|
|
87205
|
-
readonly name: "chainId";
|
|
87206
|
-
readonly type: "uint256";
|
|
87207
|
-
}, {
|
|
87208
|
-
readonly internalType: "address";
|
|
87209
|
-
readonly name: "midnight";
|
|
87210
|
-
readonly type: "address";
|
|
87211
|
-
}, {
|
|
87212
|
-
readonly internalType: "address";
|
|
87213
|
-
readonly name: "loanToken";
|
|
87214
|
-
readonly type: "address";
|
|
87215
|
-
}, {
|
|
87216
|
-
readonly components: readonly [{
|
|
87217
|
-
readonly internalType: "address";
|
|
87218
|
-
readonly name: "token";
|
|
87219
|
-
readonly type: "address";
|
|
87220
|
-
}, {
|
|
87221
|
-
readonly internalType: "uint256";
|
|
87222
|
-
readonly name: "lltv";
|
|
87223
|
-
readonly type: "uint256";
|
|
87224
|
-
}, {
|
|
87225
|
-
readonly internalType: "uint256";
|
|
87226
|
-
readonly name: "liquidationCursor";
|
|
87227
|
-
readonly type: "uint256";
|
|
87228
|
-
}, {
|
|
87229
|
-
readonly internalType: "address";
|
|
87230
|
-
readonly name: "oracle";
|
|
87231
|
-
readonly type: "address";
|
|
87232
|
-
}];
|
|
87233
|
-
readonly internalType: "struct CollateralParams[]";
|
|
87234
|
-
readonly name: "collateralParams";
|
|
87235
|
-
readonly type: "tuple[]";
|
|
87236
|
-
}, {
|
|
87237
|
-
readonly internalType: "uint256";
|
|
87238
|
-
readonly name: "maturity";
|
|
87239
|
-
readonly type: "uint256";
|
|
87240
|
-
}, {
|
|
87241
|
-
readonly internalType: "uint256";
|
|
87242
|
-
readonly name: "rcfThreshold";
|
|
87243
|
-
readonly type: "uint256";
|
|
87244
|
-
}, {
|
|
87245
|
-
readonly internalType: "address";
|
|
87246
|
-
readonly name: "enterGate";
|
|
87247
|
-
readonly type: "address";
|
|
87248
|
-
}, {
|
|
87249
|
-
readonly internalType: "address";
|
|
87250
|
-
readonly name: "liquidatorGate";
|
|
87251
|
-
readonly type: "address";
|
|
87252
|
-
}];
|
|
87253
|
-
readonly internalType: "struct Market";
|
|
87254
|
-
readonly name: "market";
|
|
87255
|
-
readonly type: "tuple";
|
|
87256
|
-
}];
|
|
87257
|
-
readonly stateMutability: "view";
|
|
87258
|
-
readonly type: "function";
|
|
87259
|
-
}];
|
|
87260
|
-
readonly networks: {
|
|
87261
|
-
readonly "8453": {
|
|
87262
|
-
readonly address: "0x3aa272f329E8B562A3bA56Bb6979a44D23A28839";
|
|
87263
|
-
readonly createdBlock: 48932293;
|
|
87264
|
-
};
|
|
87265
|
-
};
|
|
87266
|
-
};
|
|
87267
87018
|
export declare const FeedRegistry: {
|
|
87268
87019
|
readonly abi: readonly [{
|
|
87269
87020
|
readonly anonymous: false;
|
|
@@ -99340,3 +99091,25 @@ export declare const AaveV4View: {
|
|
|
99340
99091
|
};
|
|
99341
99092
|
};
|
|
99342
99093
|
};
|
|
99094
|
+
export declare const UniswapTokenDistributor: {
|
|
99095
|
+
readonly abi: readonly [{
|
|
99096
|
+
readonly inputs: readonly [{
|
|
99097
|
+
readonly internalType: "uint256";
|
|
99098
|
+
readonly name: "index";
|
|
99099
|
+
readonly type: "uint256";
|
|
99100
|
+
}];
|
|
99101
|
+
readonly name: "isClaimed";
|
|
99102
|
+
readonly outputs: readonly [{
|
|
99103
|
+
readonly internalType: "bool";
|
|
99104
|
+
readonly name: "";
|
|
99105
|
+
readonly type: "bool";
|
|
99106
|
+
}];
|
|
99107
|
+
readonly stateMutability: "view";
|
|
99108
|
+
readonly type: "function";
|
|
99109
|
+
}];
|
|
99110
|
+
readonly networks: {
|
|
99111
|
+
readonly "1": {
|
|
99112
|
+
readonly address: "0x090D4613473dEE047c3f2706764f49E0821D256e";
|
|
99113
|
+
};
|
|
99114
|
+
};
|
|
99115
|
+
};
|