@sonarwatch/portfolio-plugins 0.11.193 → 0.11.194
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +1513 -1509
- package/README.md +3 -3
- package/package.json +2 -2
- package/src/AirdropFetcher.d.ts +11 -0
- package/src/AirdropFetcher.js +92 -0
- package/src/AirdropFetcher.js.map +1 -0
- package/src/index.d.ts +3 -0
- package/src/index.js +6 -1
- package/src/index.js.map +1 -1
- package/src/plugins/balancer/helpers/pools.js +21 -21
- package/src/plugins/drift/airdropFetcher.js +7 -21
- package/src/plugins/drift/airdropFetcher.js.map +1 -1
- package/src/plugins/drift/constants.d.ts +4 -0
- package/src/plugins/drift/constants.js +8 -4
- package/src/plugins/drift/constants.js.map +1 -1
- package/src/plugins/drift/helpersAirdrop.d.ts +3 -0
- package/src/plugins/drift/helpersAirdrop.js +59 -0
- package/src/plugins/drift/helpersAirdrop.js.map +1 -0
- package/src/plugins/drift/index.d.ts +1 -0
- package/src/plugins/drift/index.js +3 -1
- package/src/plugins/drift/index.js.map +1 -1
- package/src/plugins/parcl/airdropFetcher.js +7 -45
- package/src/plugins/parcl/airdropFetcher.js.map +1 -1
- package/src/plugins/parcl/constants.d.ts +3 -0
- package/src/plugins/parcl/constants.js +7 -4
- package/src/plugins/parcl/constants.js.map +1 -1
- package/src/plugins/parcl/helpersAirdrop.d.ts +19 -0
- package/src/plugins/parcl/helpersAirdrop.js +99 -0
- package/src/plugins/parcl/helpersAirdrop.js.map +1 -0
- package/src/plugins/parcl/index.d.ts +1 -0
- package/src/plugins/parcl/index.js +3 -1
- package/src/plugins/parcl/index.js.map +1 -1
- package/src/plugins/parcl/types.d.ts +6 -1
- package/src/plugins/sandglass/marketsJob.js +3 -2
- package/src/plugins/sandglass/marketsJob.js.map +1 -1
- package/src/plugins/sushiswap/helpers.js +24 -24
- package/src/plugins/uniswap-v2/helpers.js +22 -22
- package/src/utils/sei/constants.js +8 -8
- package/src/utils/sei/getQueryBalanceByOwner.js +4 -4
@@ -0,0 +1,99 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
+
});
|
10
|
+
};
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
13
|
+
};
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
15
|
+
exports.airdropFetcher = exports.fetchAirdrop = exports.airdropStatics = exports.fetchAllocation = void 0;
|
16
|
+
const axios_1 = __importDefault(require("axios"));
|
17
|
+
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
18
|
+
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
19
|
+
const constants_1 = require("./constants");
|
20
|
+
const helpers_1 = require("../jupiter/helpers");
|
21
|
+
const getParsedAccountInfo_1 = require("../../utils/solana/getParsedAccountInfo");
|
22
|
+
const structs_1 = require("../jupiter/launchpad/structs");
|
23
|
+
const clients_1 = require("../../utils/clients");
|
24
|
+
function fetchAllocation(owner, cache) {
|
25
|
+
return __awaiter(this, void 0, void 0, function* () {
|
26
|
+
const cachedAllocation = yield cache.getItem(owner, {
|
27
|
+
prefix: constants_1.allocationPrefix,
|
28
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
29
|
+
});
|
30
|
+
if (cachedAllocation)
|
31
|
+
return cachedAllocation;
|
32
|
+
let allocation;
|
33
|
+
const apiResponse = yield axios_1.default.get(constants_1.airdropApi + owner, {
|
34
|
+
headers: {
|
35
|
+
origin: 'https://app.parcl.co',
|
36
|
+
referer: 'https://app.parcl.co',
|
37
|
+
},
|
38
|
+
validateStatus(status) {
|
39
|
+
return status === 200 || status === 404;
|
40
|
+
},
|
41
|
+
});
|
42
|
+
if (apiResponse.data.error ||
|
43
|
+
!apiResponse.data.amount ||
|
44
|
+
!apiResponse.data.merkle_tree) {
|
45
|
+
allocation = {
|
46
|
+
amount: 0,
|
47
|
+
};
|
48
|
+
}
|
49
|
+
else {
|
50
|
+
const amount = new bignumber_js_1.default(apiResponse.data.amount)
|
51
|
+
.dividedBy(Math.pow(10, constants_1.prclDecimals))
|
52
|
+
.toNumber();
|
53
|
+
allocation = {
|
54
|
+
amount,
|
55
|
+
merkleTree: apiResponse.data.merkle_tree,
|
56
|
+
};
|
57
|
+
}
|
58
|
+
yield cache.setItem(owner, allocation, {
|
59
|
+
prefix: constants_1.allocationPrefix,
|
60
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
61
|
+
ttl: 86400000, // 24h
|
62
|
+
});
|
63
|
+
return allocation;
|
64
|
+
});
|
65
|
+
}
|
66
|
+
exports.fetchAllocation = fetchAllocation;
|
67
|
+
exports.airdropStatics = {
|
68
|
+
id: 'parcl-airdrop-1',
|
69
|
+
claimLink: 'https://claims.parcllimited.com/',
|
70
|
+
image: constants_1.platformImage,
|
71
|
+
label: 'PRCL',
|
72
|
+
organizerLink: constants_1.platformWebsite,
|
73
|
+
organizerName: constants_1.platformName,
|
74
|
+
claimStart: 0,
|
75
|
+
claimEnd: 1735603200000,
|
76
|
+
name: undefined,
|
77
|
+
};
|
78
|
+
function fetchAirdrop(owner, client, cache) {
|
79
|
+
return __awaiter(this, void 0, void 0, function* () {
|
80
|
+
const prclTokenPrice = yield cache.getTokenPrice(constants_1.prclMint, portfolio_core_1.NetworkId.solana);
|
81
|
+
const allocation = yield fetchAllocation(owner, cache);
|
82
|
+
if (allocation.amount === 0 || !allocation.merkleTree)
|
83
|
+
return Object.assign(Object.assign(Object.assign({}, exports.airdropStatics), (0, portfolio_core_1.getAirdropStatus)(exports.airdropStatics.claimStart, exports.airdropStatics.claimEnd)), { price: (prclTokenPrice === null || prclTokenPrice === void 0 ? void 0 : prclTokenPrice.price) || null });
|
84
|
+
const claimStatusPubkey = (0, helpers_1.deriveClaimStatus)(owner, allocation.merkleTree, constants_1.distributorProgram);
|
85
|
+
const claimStatusAccounts = yield (0, getParsedAccountInfo_1.getParsedAccountInfo)(client, structs_1.claimStatusStruct, claimStatusPubkey);
|
86
|
+
const isClaimed = claimStatusAccounts !== null;
|
87
|
+
return Object.assign(Object.assign(Object.assign({}, exports.airdropStatics), (0, portfolio_core_1.getAirdropStatus)(exports.airdropStatics.claimStart, exports.airdropStatics.claimEnd, allocation.amount, isClaimed)), { amount: allocation.amount, price: (prclTokenPrice === null || prclTokenPrice === void 0 ? void 0 : prclTokenPrice.price) || null });
|
88
|
+
});
|
89
|
+
}
|
90
|
+
exports.fetchAirdrop = fetchAirdrop;
|
91
|
+
exports.airdropFetcher = {
|
92
|
+
id: exports.airdropStatics.id,
|
93
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
94
|
+
executor: (owner, cache) => {
|
95
|
+
const client = (0, clients_1.getClientSolana)();
|
96
|
+
return fetchAirdrop(owner, client, cache);
|
97
|
+
},
|
98
|
+
};
|
99
|
+
//# sourceMappingURL=helpersAirdrop.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"helpersAirdrop.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/parcl/helpersAirdrop.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,kDAA6C;AAC7C,gEAAqC;AACrC,+DAIoC;AACpC,2CASqB;AAGrB,gDAAuD;AACvD,kFAA+E;AAE/E,0DAAiE;AAEjE,iDAAsD;AAEtD,SAAsB,eAAe,CACnC,KAAa,EACb,KAAY;;QAEZ,MAAM,gBAAgB,GAAG,MAAM,KAAK,CAAC,OAAO,CAAa,KAAK,EAAE;YAC9D,MAAM,EAAE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AAC,EAAE;IACrB,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;QACzB,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;QACjC,OAAO,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;IAC5C,CAAC;CACF,CAAC"}
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import { Platform } from '@sonarwatch/portfolio-core';
|
2
2
|
import { Fetcher } from '../../Fetcher';
|
3
3
|
import { Job } from '../../Job';
|
4
|
+
export { airdropFetcher } from './helpersAirdrop';
|
4
5
|
export declare const platforms: Platform[];
|
5
6
|
export declare const jobs: Job[];
|
6
7
|
export declare const fetchers: Fetcher[];
|
@@ -3,11 +3,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
4
|
};
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
exports.fetchers = exports.jobs = exports.platforms = void 0;
|
6
|
+
exports.fetchers = exports.jobs = exports.platforms = exports.airdropFetcher = void 0;
|
7
7
|
const constants_1 = require("./constants");
|
8
8
|
const depositsFetcher_1 = __importDefault(require("./depositsFetcher"));
|
9
9
|
const marginFetcher_1 = __importDefault(require("./marginFetcher"));
|
10
10
|
const airdropFetcher_1 = __importDefault(require("./airdropFetcher"));
|
11
|
+
var helpersAirdrop_1 = require("./helpersAirdrop");
|
12
|
+
Object.defineProperty(exports, "airdropFetcher", { enumerable: true, get: function () { return helpersAirdrop_1.airdropFetcher; } });
|
11
13
|
exports.platforms = [constants_1.platform];
|
12
14
|
exports.jobs = [];
|
13
15
|
exports.fetchers = [
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/parcl/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAAuC;AACvC,wEAAgD;AAChD,oEAA4C;AAC5C,sEAA8C;
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/parcl/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAAuC;AACvC,wEAAgD;AAChD,oEAA4C;AAC5C,sEAA8C;AAE9C,mDAAkD;AAAzC,gHAAA,cAAc,OAAA;AACV,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC;AACnC,QAAA,IAAI,GAAU,EAAE,CAAC;AACjB,QAAA,QAAQ,GAAc;IACjC,yBAAe;IACf,uBAAa;IACb,wBAAc;CACf,CAAC"}
|
@@ -19,6 +19,7 @@ const solana_1 = require("../../utils/solana");
|
|
19
19
|
const constants_1 = require("./constants");
|
20
20
|
const structs_1 = require("./structs");
|
21
21
|
const filters_1 = require("./filters");
|
22
|
+
const constants_2 = require("../tokens/constants");
|
22
23
|
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
23
24
|
var _a, _b;
|
24
25
|
const client = (0, clients_1.getClientSolana)();
|
@@ -57,7 +58,7 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
57
58
|
decimals: ptDecimals,
|
58
59
|
id: market.pubkey.toString(),
|
59
60
|
networkId: portfolio_core_1.NetworkId.solana,
|
60
|
-
platformId:
|
61
|
+
platformId: constants_2.walletTokensPlatform.id,
|
61
62
|
price: ptPrice.times(baseTokenPrice.price).toNumber(),
|
62
63
|
timestamp: Date.now(),
|
63
64
|
weight: 1,
|
@@ -68,7 +69,7 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
68
69
|
decimals: ytDecimals,
|
69
70
|
id: market.pubkey.toString(),
|
70
71
|
networkId: portfolio_core_1.NetworkId.solana,
|
71
|
-
platformId:
|
72
|
+
platformId: constants_2.walletTokensPlatform.id,
|
72
73
|
price: ytPrice.times(baseTokenPrice.price).toNumber(),
|
73
74
|
timestamp: Date.now(),
|
74
75
|
weight: 1,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"marketsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/sandglass/marketsJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,gEAAqC;AACrC,+DAAyE;AAGzE,iDAAsD;AACtD,+CAK4B;AAC5B,2CAAoE;AACpE,uCAAyC;AACzC,uCAAiD;
|
1
|
+
{"version":3,"file":"marketsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/sandglass/marketsJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,gEAAqC;AACrC,+DAAyE;AAGzE,iDAAsD;AACtD,+CAK4B;AAC5B,2CAAoE;AACpE,uCAAyC;AACzC,uCAAiD;AAEjD,mDAA2D;AAE3D,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;;IACnD,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IACjC,MAAM,OAAO,GAAG,MAAM,IAAA,iCAAwB,EAC5C,MAAM,EACN,sBAAY,EACZ,qBAAS,EACT,8BAAoB,CACrB,CAAC;IAEF,MAAM,KAAK,GAAG,OAAO;SAClB,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC;QACf,MAAM,CAAC,kBAAkB;QACzB,MAAM,CAAC,kBAAkB;QACzB,MAAM,CAAC,kBAAkB;QACzB,MAAM,CAAC,kBAAkB;KAC1B,CAAC;SACD,IAAI,EAAE,CAAC;IAEV,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CACvC,MAAM,CAAC,kBAAkB,CAAC,QAAQ,EAAE,CACrC,CAAC;IACF,MAAM,kBAAkB,GAAG,MAAM,KAAK,CAAC,mBAAmB,CACxD,SAAS,EACT,0BAAS,CAAC,MAAM,CACjB,CAAC;IAEF,MAAM,aAAa,GAAG,MAAM,IAAA,sCAA6B,EACvD,MAAM,EACN,0BAAiB,EACjB,KAAK,CACN,CAAC;IACF,MAAM,aAA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F,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,UAAU;IAC3B,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
|
@@ -54,30 +54,30 @@ function sushiV3PairToUniV2(pair) {
|
|
54
54
|
}
|
55
55
|
function getV3PairsAddresses(url, length = 300) {
|
56
56
|
return __awaiter(this, void 0, void 0, function* () {
|
57
|
-
const query = (0, graphql_request_1.gql) `
|
58
|
-
{
|
59
|
-
pools(
|
60
|
-
orderBy: totalValueLockedUSD
|
61
|
-
first: ${length}
|
62
|
-
orderDirection: desc
|
63
|
-
where: { volumeUSD_not: "0", liquidity_not: "0" }
|
64
|
-
) {
|
65
|
-
id
|
66
|
-
token0Price
|
67
|
-
token1Price
|
68
|
-
liquidity
|
69
|
-
token0 {
|
70
|
-
id
|
71
|
-
totalSupply
|
72
|
-
decimals
|
73
|
-
}
|
74
|
-
token1 {
|
75
|
-
id
|
76
|
-
totalSupply
|
77
|
-
decimals
|
78
|
-
}
|
79
|
-
}
|
80
|
-
}
|
57
|
+
const query = (0, graphql_request_1.gql) `
|
58
|
+
{
|
59
|
+
pools(
|
60
|
+
orderBy: totalValueLockedUSD
|
61
|
+
first: ${length}
|
62
|
+
orderDirection: desc
|
63
|
+
where: { volumeUSD_not: "0", liquidity_not: "0" }
|
64
|
+
) {
|
65
|
+
id
|
66
|
+
token0Price
|
67
|
+
token1Price
|
68
|
+
liquidity
|
69
|
+
token0 {
|
70
|
+
id
|
71
|
+
totalSupply
|
72
|
+
decimals
|
73
|
+
}
|
74
|
+
token1 {
|
75
|
+
id
|
76
|
+
totalSupply
|
77
|
+
decimals
|
78
|
+
}
|
79
|
+
}
|
80
|
+
}
|
81
81
|
`;
|
82
82
|
const res = yield (0, graphql_request_1.default)(url, query);
|
83
83
|
const pools = res.pools;
|
@@ -40,28 +40,28 @@ function getPairKey(version) {
|
|
40
40
|
exports.getPairKey = getPairKey;
|
41
41
|
function getPairsV2FromTheGraph(url, length = 300) {
|
42
42
|
return __awaiter(this, void 0, void 0, function* () {
|
43
|
-
const query = (0, graphql_request_1.gql) `
|
44
|
-
{
|
45
|
-
pairs(
|
46
|
-
orderBy: reserveUSD
|
47
|
-
first: ${length}
|
48
|
-
orderDirection: desc
|
49
|
-
where: { trackedReserveETH_not: "0" }
|
50
|
-
) {
|
51
|
-
id
|
52
|
-
reserve0
|
53
|
-
reserve1
|
54
|
-
totalSupply
|
55
|
-
token0 {
|
56
|
-
id
|
57
|
-
decimals
|
58
|
-
}
|
59
|
-
token1 {
|
60
|
-
id
|
61
|
-
decimals
|
62
|
-
}
|
63
|
-
}
|
64
|
-
}
|
43
|
+
const query = (0, graphql_request_1.gql) `
|
44
|
+
{
|
45
|
+
pairs(
|
46
|
+
orderBy: reserveUSD
|
47
|
+
first: ${length}
|
48
|
+
orderDirection: desc
|
49
|
+
where: { trackedReserveETH_not: "0" }
|
50
|
+
) {
|
51
|
+
id
|
52
|
+
reserve0
|
53
|
+
reserve1
|
54
|
+
totalSupply
|
55
|
+
token0 {
|
56
|
+
id
|
57
|
+
decimals
|
58
|
+
}
|
59
|
+
token1 {
|
60
|
+
id
|
61
|
+
decimals
|
62
|
+
}
|
63
|
+
}
|
64
|
+
}
|
65
65
|
`;
|
66
66
|
const res = yield (0, graphql_request_1.default)(url, query);
|
67
67
|
const pairs = res.pairs;
|
@@ -1,16 +1,16 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.poolQueryMsg = exports.minterQueryMsg = exports.tokenInfoQueryMsg = exports.infoQueryMsg = void 0;
|
4
|
-
exports.infoQueryMsg = JSON.parse(`{
|
5
|
-
"info": {}
|
4
|
+
exports.infoQueryMsg = JSON.parse(`{
|
5
|
+
"info": {}
|
6
6
|
}`);
|
7
|
-
exports.tokenInfoQueryMsg = JSON.parse(`{
|
8
|
-
"token_info": {}
|
7
|
+
exports.tokenInfoQueryMsg = JSON.parse(`{
|
8
|
+
"token_info": {}
|
9
9
|
}`);
|
10
|
-
exports.minterQueryMsg = JSON.parse(`{
|
11
|
-
"minter": {}
|
10
|
+
exports.minterQueryMsg = JSON.parse(`{
|
11
|
+
"minter": {}
|
12
12
|
}`);
|
13
|
-
exports.poolQueryMsg = JSON.parse(`{
|
14
|
-
"pool": {}
|
13
|
+
exports.poolQueryMsg = JSON.parse(`{
|
14
|
+
"pool": {}
|
15
15
|
}`);
|
16
16
|
//# sourceMappingURL=constants.js.map
|
@@ -1,10 +1,10 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
function getQueryBalanceByOwner(owner) {
|
4
|
-
return JSON.parse(`{
|
5
|
-
"balance": {
|
6
|
-
"address": "${owner}"
|
7
|
-
}
|
4
|
+
return JSON.parse(`{
|
5
|
+
"balance": {
|
6
|
+
"address": "${owner}"
|
7
|
+
}
|
8
8
|
}`);
|
9
9
|
}
|
10
10
|
exports.default = getQueryBalanceByOwner;
|