@defisaver/positions-sdk 2.1.111-merkl-auth-api-dev → 2.1.111-merkl-auth-api-2-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/aaveV3/merkl.js +2 -2
- package/cjs/aaveV4/merkl.js +2 -2
- package/cjs/claiming/aaveV3.d.ts +1 -1
- package/cjs/claiming/aaveV3.js +2 -2
- package/cjs/index.d.ts +0 -1
- package/cjs/index.js +1 -4
- package/esm/aaveV3/merkl.js +2 -2
- package/esm/aaveV4/merkl.js +2 -2
- package/esm/claiming/aaveV3.d.ts +1 -1
- package/esm/claiming/aaveV3.js +2 -2
- package/esm/index.d.ts +0 -1
- package/esm/index.js +0 -1
- package/package.json +1 -1
- package/src/aaveV3/merkl.ts +2 -2
- package/src/aaveV4/merkl.ts +2 -2
- package/src/claiming/aaveV3.ts +3 -3
- package/src/index.ts +0 -2
- package/cjs/services/merkl.d.ts +0 -2
- package/cjs/services/merkl.js +0 -17
- package/esm/services/merkl.d.ts +0 -2
- package/esm/services/merkl.js +0 -12
- package/src/services/merkl.ts +0 -14
package/cjs/aaveV3/merkl.js
CHANGED
|
@@ -12,7 +12,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.getMerkleCampaigns = exports.formatAaveAsset = exports.getAaveUnderlyingSymbol = void 0;
|
|
13
13
|
const moneymarket_1 = require("../moneymarket");
|
|
14
14
|
const utils_1 = require("../services/utils");
|
|
15
|
-
const merkl_1 = require("../services/merkl");
|
|
16
15
|
const types_1 = require("../types");
|
|
17
16
|
const getAaveUnderlyingSymbol = (_symbol = '') => {
|
|
18
17
|
let symbol = _symbol
|
|
@@ -41,7 +40,8 @@ const formatAaveAsset = (_symbol) => {
|
|
|
41
40
|
exports.formatAaveAsset = formatAaveAsset;
|
|
42
41
|
const getMerkleCampaigns = (chainId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
43
42
|
try {
|
|
44
|
-
|
|
43
|
+
// TEMP staging QA (DEV-12653): revert to https://fe.defisaver.com/api/merkl before merge
|
|
44
|
+
const res = yield fetch('https://stage.defisaver.com/dev-12653-merkl-auth-api/api/merkl/opportunities?mainProtocolId=aave', {
|
|
45
45
|
signal: AbortSignal.timeout(utils_1.LONGER_TIMEOUT),
|
|
46
46
|
});
|
|
47
47
|
if (!res.ok)
|
package/cjs/aaveV4/merkl.js
CHANGED
|
@@ -12,7 +12,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.attachAaveV4MerklIncentives = exports.getAaveV4MerkleCampaigns = void 0;
|
|
13
13
|
const moneymarket_1 = require("../moneymarket");
|
|
14
14
|
const utils_1 = require("../services/utils");
|
|
15
|
-
const merkl_1 = require("../services/merkl");
|
|
16
15
|
const types_1 = require("../types");
|
|
17
16
|
/**
|
|
18
17
|
* Merkl tags Aave V4 reward campaigns by scope via the `type` field:
|
|
@@ -35,7 +34,8 @@ const buildIncentive = (opportunity) => {
|
|
|
35
34
|
const getAaveV4MerkleCampaigns = (chainId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
36
35
|
const result = { hub: {}, spoke: {} };
|
|
37
36
|
try {
|
|
38
|
-
|
|
37
|
+
// TEMP staging QA (DEV-12653): revert to https://fe.defisaver.com/api/merkl before merge
|
|
38
|
+
const res = yield fetch('https://stage.defisaver.com/dev-12653-merkl-auth-api/api/merkl/opportunities?mainProtocolId=aave', {
|
|
39
39
|
signal: AbortSignal.timeout(utils_1.LONGER_TIMEOUT),
|
|
40
40
|
});
|
|
41
41
|
if (!res.ok)
|
package/cjs/claiming/aaveV3.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Client } from 'viem';
|
|
2
|
-
import { EthAddress, NetworkNumber } from '../types
|
|
2
|
+
import { EthAddress, NetworkNumber } from '../types';
|
|
3
3
|
import { ClaimableToken } from '../types/claiming';
|
|
4
4
|
export declare function getUnclaimedRewardsForAllMarkets(provider: Client, network: NetworkNumber, walletAddress: EthAddress, marketAddress: EthAddress): Promise<ClaimableToken[]>;
|
|
5
5
|
export declare function getMeritUnclaimedRewards(account: EthAddress, network: NetworkNumber): Promise<ClaimableToken[]>;
|
package/cjs/claiming/aaveV3.js
CHANGED
|
@@ -19,7 +19,6 @@ const claiming_1 = require("../types/claiming");
|
|
|
19
19
|
const contracts_1 = require("../contracts");
|
|
20
20
|
const utils_1 = require("../services/utils");
|
|
21
21
|
const aaveHelpers_1 = require("../helpers/aaveHelpers");
|
|
22
|
-
const merkl_1 = require("../services/merkl");
|
|
23
22
|
const mapAaveRewardsToClaimableTokens = (aaveRewards, marketAddress, walletAddress) => aaveRewards.map(reward => ({
|
|
24
23
|
symbol: reward.symbol,
|
|
25
24
|
amount: reward.amount,
|
|
@@ -100,7 +99,8 @@ function getMeritUnclaimedRewards(account, network) {
|
|
|
100
99
|
return __awaiter(this, void 0, void 0, function* () {
|
|
101
100
|
let data;
|
|
102
101
|
try {
|
|
103
|
-
|
|
102
|
+
// TEMP staging QA (DEV-12653): revert to https://fe.defisaver.com/api/merkl before merge
|
|
103
|
+
const res = yield fetch(`https://stage.defisaver.com/dev-12653-merkl-auth-api/api/merkl/get-user-rewards/${account}?chainId=${network}`, { signal: AbortSignal.timeout(utils_1.LONGER_TIMEOUT) });
|
|
104
104
|
data = yield res.json();
|
|
105
105
|
}
|
|
106
106
|
catch (error) {
|
package/cjs/index.d.ts
CHANGED
|
@@ -22,5 +22,4 @@ import * as portfolio from './portfolio';
|
|
|
22
22
|
import * as claiming from './claiming';
|
|
23
23
|
import * as savings from './savings';
|
|
24
24
|
export * from './types';
|
|
25
|
-
export { getMerklApiUrl, setMerklApiUrl } from './services/merkl';
|
|
26
25
|
export { aaveV2, aaveV3, aaveV4, compoundV2, compoundV3, spark, curveUsd, liquity, liquityV2, maker, exchange, staking, moneymarket, markets, helpers, morphoBlue, llamaLend, eulerV2, fluid, portfolio, claiming, savings, };
|
package/cjs/index.js
CHANGED
|
@@ -36,7 +36,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
36
36
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.savings = exports.claiming = exports.portfolio = exports.fluid = exports.eulerV2 = exports.llamaLend = exports.morphoBlue = exports.helpers = exports.markets = exports.moneymarket = exports.staking = exports.exchange = exports.maker = exports.liquityV2 = exports.liquity = exports.curveUsd = exports.spark = exports.compoundV3 = exports.compoundV2 = exports.aaveV4 = exports.aaveV3 = exports.aaveV2 =
|
|
39
|
+
exports.savings = exports.claiming = exports.portfolio = exports.fluid = exports.eulerV2 = exports.llamaLend = exports.morphoBlue = exports.helpers = exports.markets = exports.moneymarket = exports.staking = exports.exchange = exports.maker = exports.liquityV2 = exports.liquity = exports.curveUsd = exports.spark = exports.compoundV3 = exports.compoundV2 = exports.aaveV4 = exports.aaveV3 = exports.aaveV2 = void 0;
|
|
40
40
|
require("./setup");
|
|
41
41
|
const fluid = __importStar(require("./fluid"));
|
|
42
42
|
exports.fluid = fluid;
|
|
@@ -83,6 +83,3 @@ exports.claiming = claiming;
|
|
|
83
83
|
const savings = __importStar(require("./savings"));
|
|
84
84
|
exports.savings = savings;
|
|
85
85
|
__exportStar(require("./types"), exports);
|
|
86
|
-
var merkl_1 = require("./services/merkl");
|
|
87
|
-
Object.defineProperty(exports, "getMerklApiUrl", { enumerable: true, get: function () { return merkl_1.getMerklApiUrl; } });
|
|
88
|
-
Object.defineProperty(exports, "setMerklApiUrl", { enumerable: true, get: function () { return merkl_1.setMerklApiUrl; } });
|
package/esm/aaveV3/merkl.js
CHANGED
|
@@ -9,7 +9,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
};
|
|
10
10
|
import { aprToApy } from '../moneymarket';
|
|
11
11
|
import { LONGER_TIMEOUT, wethToEth } from '../services/utils';
|
|
12
|
-
import { getMerklApiUrl } from '../services/merkl';
|
|
13
12
|
import { OpportunityAction, OpportunityStatus, } from '../types';
|
|
14
13
|
export const getAaveUnderlyingSymbol = (_symbol = '') => {
|
|
15
14
|
let symbol = _symbol
|
|
@@ -36,7 +35,8 @@ export const formatAaveAsset = (_symbol) => {
|
|
|
36
35
|
};
|
|
37
36
|
export const getMerkleCampaigns = (chainId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
38
37
|
try {
|
|
39
|
-
|
|
38
|
+
// TEMP staging QA (DEV-12653): revert to https://fe.defisaver.com/api/merkl before merge
|
|
39
|
+
const res = yield fetch('https://stage.defisaver.com/dev-12653-merkl-auth-api/api/merkl/opportunities?mainProtocolId=aave', {
|
|
40
40
|
signal: AbortSignal.timeout(LONGER_TIMEOUT),
|
|
41
41
|
});
|
|
42
42
|
if (!res.ok)
|
package/esm/aaveV4/merkl.js
CHANGED
|
@@ -9,7 +9,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
};
|
|
10
10
|
import { aprToApy } from '../moneymarket';
|
|
11
11
|
import { LONGER_TIMEOUT } from '../services/utils';
|
|
12
|
-
import { getMerklApiUrl } from '../services/merkl';
|
|
13
12
|
import { IncentiveKind, OpportunityAction, OpportunityStatus, } from '../types';
|
|
14
13
|
/**
|
|
15
14
|
* Merkl tags Aave V4 reward campaigns by scope via the `type` field:
|
|
@@ -32,7 +31,8 @@ const buildIncentive = (opportunity) => {
|
|
|
32
31
|
export const getAaveV4MerkleCampaigns = (chainId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
33
32
|
const result = { hub: {}, spoke: {} };
|
|
34
33
|
try {
|
|
35
|
-
|
|
34
|
+
// TEMP staging QA (DEV-12653): revert to https://fe.defisaver.com/api/merkl before merge
|
|
35
|
+
const res = yield fetch('https://stage.defisaver.com/dev-12653-merkl-auth-api/api/merkl/opportunities?mainProtocolId=aave', {
|
|
36
36
|
signal: AbortSignal.timeout(LONGER_TIMEOUT),
|
|
37
37
|
});
|
|
38
38
|
if (!res.ok)
|
package/esm/claiming/aaveV3.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Client } from 'viem';
|
|
2
|
-
import { EthAddress, NetworkNumber } from '../types
|
|
2
|
+
import { EthAddress, NetworkNumber } from '../types';
|
|
3
3
|
import { ClaimableToken } from '../types/claiming';
|
|
4
4
|
export declare function getUnclaimedRewardsForAllMarkets(provider: Client, network: NetworkNumber, walletAddress: EthAddress, marketAddress: EthAddress): Promise<ClaimableToken[]>;
|
|
5
5
|
export declare function getMeritUnclaimedRewards(account: EthAddress, network: NetworkNumber): Promise<ClaimableToken[]>;
|
package/esm/claiming/aaveV3.js
CHANGED
|
@@ -12,7 +12,6 @@ import { ClaimType } from '../types/claiming';
|
|
|
12
12
|
import { AaveIncentiveDataProviderV3ContractViem, AaveRewardsControllerViem, } from '../contracts';
|
|
13
13
|
import { compareAddresses, getEthAmountForDecimals, LONGER_TIMEOUT } from '../services/utils';
|
|
14
14
|
import { getAaveUnderlyingSymbol } from '../helpers/aaveHelpers';
|
|
15
|
-
import { getMerklApiUrl } from '../services/merkl';
|
|
16
15
|
const mapAaveRewardsToClaimableTokens = (aaveRewards, marketAddress, walletAddress) => aaveRewards.map(reward => ({
|
|
17
16
|
symbol: reward.symbol,
|
|
18
17
|
amount: reward.amount,
|
|
@@ -93,7 +92,8 @@ export function getMeritUnclaimedRewards(account, network) {
|
|
|
93
92
|
return __awaiter(this, void 0, void 0, function* () {
|
|
94
93
|
let data;
|
|
95
94
|
try {
|
|
96
|
-
|
|
95
|
+
// TEMP staging QA (DEV-12653): revert to https://fe.defisaver.com/api/merkl before merge
|
|
96
|
+
const res = yield fetch(`https://stage.defisaver.com/dev-12653-merkl-auth-api/api/merkl/get-user-rewards/${account}?chainId=${network}`, { signal: AbortSignal.timeout(LONGER_TIMEOUT) });
|
|
97
97
|
data = yield res.json();
|
|
98
98
|
}
|
|
99
99
|
catch (error) {
|
package/esm/index.d.ts
CHANGED
|
@@ -22,5 +22,4 @@ import * as portfolio from './portfolio';
|
|
|
22
22
|
import * as claiming from './claiming';
|
|
23
23
|
import * as savings from './savings';
|
|
24
24
|
export * from './types';
|
|
25
|
-
export { getMerklApiUrl, setMerklApiUrl } from './services/merkl';
|
|
26
25
|
export { aaveV2, aaveV3, aaveV4, compoundV2, compoundV3, spark, curveUsd, liquity, liquityV2, maker, exchange, staking, moneymarket, markets, helpers, morphoBlue, llamaLend, eulerV2, fluid, portfolio, claiming, savings, };
|
package/esm/index.js
CHANGED
|
@@ -22,5 +22,4 @@ import * as portfolio from './portfolio';
|
|
|
22
22
|
import * as claiming from './claiming';
|
|
23
23
|
import * as savings from './savings';
|
|
24
24
|
export * from './types';
|
|
25
|
-
export { getMerklApiUrl, setMerklApiUrl } from './services/merkl';
|
|
26
25
|
export { aaveV2, aaveV3, aaveV4, compoundV2, compoundV3, spark, curveUsd, liquity, liquityV2, maker, exchange, staking, moneymarket, markets, helpers, morphoBlue, llamaLend, eulerV2, fluid, portfolio, claiming, savings, };
|
package/package.json
CHANGED
package/src/aaveV3/merkl.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { aprToApy } from '../moneymarket';
|
|
2
2
|
import { LONGER_TIMEOUT, wethToEth } from '../services/utils';
|
|
3
|
-
import { getMerklApiUrl } from '../services/merkl';
|
|
4
3
|
import {
|
|
5
4
|
MerkleRewardMap, MerklOpportunity, OpportunityAction, OpportunityStatus,
|
|
6
5
|
} from '../types';
|
|
@@ -32,7 +31,8 @@ export const formatAaveAsset = (_symbol: string) => {
|
|
|
32
31
|
|
|
33
32
|
export const getMerkleCampaigns = async (chainId: NetworkNumber): Promise<MerkleRewardMap> => {
|
|
34
33
|
try {
|
|
35
|
-
|
|
34
|
+
// TEMP staging QA (DEV-12653): revert to https://fe.defisaver.com/api/merkl before merge
|
|
35
|
+
const res = await fetch('https://stage.defisaver.com/dev-12653-merkl-auth-api/api/merkl/opportunities?mainProtocolId=aave', {
|
|
36
36
|
signal: AbortSignal.timeout(LONGER_TIMEOUT),
|
|
37
37
|
});
|
|
38
38
|
if (!res.ok) throw new Error('Failed to fetch Merkle campaigns');
|
package/src/aaveV4/merkl.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { aprToApy } from '../moneymarket';
|
|
2
2
|
import { LONGER_TIMEOUT } from '../services/utils';
|
|
3
|
-
import { getMerklApiUrl } from '../services/merkl';
|
|
4
3
|
import {
|
|
5
4
|
AaveV4MerklRewardMap,
|
|
6
5
|
AaveV4ReserveAssetData,
|
|
@@ -35,7 +34,8 @@ const buildIncentive = (opportunity: MerklOpportunity): IncentiveData => {
|
|
|
35
34
|
export const getAaveV4MerkleCampaigns = async (chainId: NetworkNumber): Promise<AaveV4MerklRewardMap> => {
|
|
36
35
|
const result: AaveV4MerklRewardMap = { hub: {}, spoke: {} };
|
|
37
36
|
try {
|
|
38
|
-
|
|
37
|
+
// TEMP staging QA (DEV-12653): revert to https://fe.defisaver.com/api/merkl before merge
|
|
38
|
+
const res = await fetch('https://stage.defisaver.com/dev-12653-merkl-auth-api/api/merkl/opportunities?mainProtocolId=aave', {
|
|
39
39
|
signal: AbortSignal.timeout(LONGER_TIMEOUT),
|
|
40
40
|
});
|
|
41
41
|
if (!res.ok) throw new Error('Failed to fetch Aave V4 Merkle campaigns');
|
package/src/claiming/aaveV3.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Client } from 'viem';
|
|
2
2
|
import Dec from 'decimal.js';
|
|
3
|
-
import { EthAddress, NetworkNumber } from '../types
|
|
3
|
+
import { EthAddress, NetworkNumber } from '../types';
|
|
4
4
|
import { ClaimableToken, ClaimType } from '../types/claiming';
|
|
5
5
|
import {
|
|
6
6
|
AaveIncentiveDataProviderV3ContractViem,
|
|
@@ -8,7 +8,6 @@ import {
|
|
|
8
8
|
} from '../contracts';
|
|
9
9
|
import { compareAddresses, getEthAmountForDecimals, LONGER_TIMEOUT } from '../services/utils';
|
|
10
10
|
import { getAaveUnderlyingSymbol } from '../helpers/aaveHelpers';
|
|
11
|
-
import { getMerklApiUrl } from '../services/merkl';
|
|
12
11
|
|
|
13
12
|
type AaveReward = {
|
|
14
13
|
amount: string;
|
|
@@ -107,7 +106,8 @@ export async function getUnclaimedRewardsForAllMarkets(
|
|
|
107
106
|
export async function getMeritUnclaimedRewards(account: EthAddress, network: NetworkNumber): Promise<ClaimableToken[]> {
|
|
108
107
|
let data;
|
|
109
108
|
try {
|
|
110
|
-
|
|
109
|
+
// TEMP staging QA (DEV-12653): revert to https://fe.defisaver.com/api/merkl before merge
|
|
110
|
+
const res = await fetch(`https://stage.defisaver.com/dev-12653-merkl-auth-api/api/merkl/get-user-rewards/${account}?chainId=${network}`,
|
|
111
111
|
{ signal: AbortSignal.timeout(LONGER_TIMEOUT) });
|
|
112
112
|
data = await res.json();
|
|
113
113
|
} catch (error) {
|
package/src/index.ts
CHANGED
package/cjs/services/merkl.d.ts
DELETED
package/cjs/services/merkl.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setMerklApiUrl = exports.getMerklApiUrl = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Configurable base URL for the Merkl API (https://developers.merkl.xyz).
|
|
6
|
-
*
|
|
7
|
-
* Defaults to Merkl's public host. Consumers can override it via `setMerklApiUrl` — e.g. to route
|
|
8
|
-
* requests through their own backend proxy that attaches a Merkl API key (the key must stay
|
|
9
|
-
* server-side, and a proxy also avoids browser CORS limits on the public host).
|
|
10
|
-
*/
|
|
11
|
-
let merklApiUrl = 'https://api.merkl.xyz';
|
|
12
|
-
const getMerklApiUrl = () => merklApiUrl;
|
|
13
|
-
exports.getMerklApiUrl = getMerklApiUrl;
|
|
14
|
-
const setMerklApiUrl = (url) => {
|
|
15
|
-
merklApiUrl = url.replace(/\/+$/, '');
|
|
16
|
-
};
|
|
17
|
-
exports.setMerklApiUrl = setMerklApiUrl;
|
package/esm/services/merkl.d.ts
DELETED
package/esm/services/merkl.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Configurable base URL for the Merkl API (https://developers.merkl.xyz).
|
|
3
|
-
*
|
|
4
|
-
* Defaults to Merkl's public host. Consumers can override it via `setMerklApiUrl` — e.g. to route
|
|
5
|
-
* requests through their own backend proxy that attaches a Merkl API key (the key must stay
|
|
6
|
-
* server-side, and a proxy also avoids browser CORS limits on the public host).
|
|
7
|
-
*/
|
|
8
|
-
let merklApiUrl = 'https://api.merkl.xyz';
|
|
9
|
-
export const getMerklApiUrl = () => merklApiUrl;
|
|
10
|
-
export const setMerklApiUrl = (url) => {
|
|
11
|
-
merklApiUrl = url.replace(/\/+$/, '');
|
|
12
|
-
};
|
package/src/services/merkl.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Configurable base URL for the Merkl API (https://developers.merkl.xyz).
|
|
3
|
-
*
|
|
4
|
-
* Defaults to Merkl's public host. Consumers can override it via `setMerklApiUrl` — e.g. to route
|
|
5
|
-
* requests through their own backend proxy that attaches a Merkl API key (the key must stay
|
|
6
|
-
* server-side, and a proxy also avoids browser CORS limits on the public host).
|
|
7
|
-
*/
|
|
8
|
-
let merklApiUrl = 'https://api.merkl.xyz';
|
|
9
|
-
|
|
10
|
-
export const getMerklApiUrl = (): string => merklApiUrl;
|
|
11
|
-
|
|
12
|
-
export const setMerklApiUrl = (url: string): void => {
|
|
13
|
-
merklApiUrl = url.replace(/\/+$/, '');
|
|
14
|
-
};
|