@sonarwatch/portfolio-plugins 0.11.197 → 0.11.199
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +8 -0
- package/package.json +2 -2
- package/src/plugins/drift/helpersAirdrop.js +10 -5
- package/src/plugins/drift/helpersAirdrop.js.map +1 -1
- package/src/plugins/parcl/airdropFetcher.js +1 -2
- package/src/plugins/parcl/airdropFetcher.js.map +1 -1
- package/src/plugins/parcl/helpersAirdrop.d.ts +3 -2
- package/src/plugins/parcl/helpersAirdrop.js +7 -4
- package/src/plugins/parcl/helpersAirdrop.js.map +1 -1
package/CHANGELOG.md
CHANGED
@@ -2,6 +2,14 @@
|
|
2
2
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
4
4
|
|
5
|
+
## [0.11.199](https://github.com/sonarwatch/portfolio/compare/plugins-0.11.198...plugins-0.11.199) (2024-05-06)
|
6
|
+
|
7
|
+
|
8
|
+
|
9
|
+
## [0.11.198](https://github.com/sonarwatch/portfolio/compare/plugins-0.11.197...plugins-0.11.198) (2024-05-06)
|
10
|
+
|
11
|
+
|
12
|
+
|
5
13
|
## [0.11.197](https://github.com/sonarwatch/portfolio/compare/plugins-0.11.196...plugins-0.11.197) (2024-05-04)
|
6
14
|
|
7
15
|
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@sonarwatch/portfolio-plugins",
|
3
|
-
"version": "0.11.
|
3
|
+
"version": "0.11.199",
|
4
4
|
"type": "commonjs",
|
5
5
|
"generators": "./generators.json",
|
6
6
|
"dependencies": {
|
@@ -41,7 +41,7 @@
|
|
41
41
|
"web3-v1": "npm:web3@^1.5.0"
|
42
42
|
},
|
43
43
|
"peerDependencies": {
|
44
|
-
"@sonarwatch/portfolio-core": "0.11.
|
44
|
+
"@sonarwatch/portfolio-core": "0.11.199"
|
45
45
|
},
|
46
46
|
"main": "./src/index.js",
|
47
47
|
"types": "./src/index.d.ts"
|
@@ -25,7 +25,7 @@ function fetchAirdropAmount(owner) {
|
|
25
25
|
Origin: 'https://drift.foundation',
|
26
26
|
Referer: 'https://drift.foundation/',
|
27
27
|
},
|
28
|
-
timeout:
|
28
|
+
timeout: 4000,
|
29
29
|
validateStatus(status) {
|
30
30
|
return status === 404 || status === 200;
|
31
31
|
},
|
@@ -42,14 +42,19 @@ const airdropStatics = {
|
|
42
42
|
image: constants_1.platformImage,
|
43
43
|
label: 'DRIFT',
|
44
44
|
name: undefined,
|
45
|
-
|
46
|
-
|
45
|
+
shortName: 'Drift S1',
|
46
|
+
emitterName: constants_1.platformName,
|
47
|
+
emitterLink: constants_1.platformWebsite,
|
47
48
|
claimStart: undefined,
|
48
49
|
claimEnd: undefined,
|
49
50
|
};
|
50
51
|
const fetchAirdropExecutor = (owner) => __awaiter(void 0, void 0, void 0, function* () {
|
51
|
-
|
52
|
-
|
52
|
+
let amount = yield fetchAirdropAmount(owner);
|
53
|
+
if (amount === 0)
|
54
|
+
amount = -1;
|
55
|
+
const claimStatus = (0, portfolio_core_1.getAirdropClaimStatus)(airdropStatics.claimStart, airdropStatics.claimEnd);
|
56
|
+
return Object.assign(Object.assign({}, airdropStatics), { amount,
|
57
|
+
claimStatus, isClaimed: false, price: null });
|
53
58
|
});
|
54
59
|
exports.airdropFetcher = {
|
55
60
|
id: airdropStatics.id,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"helpersAirdrop.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/drift/helpersAirdrop.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gEAAqC;AACrC,kDAA6C;AAC7C,+
|
1
|
+
{"version":3,"file":"helpersAirdrop.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/drift/helpersAirdrop.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gEAAqC;AACrC,kDAA6C;AAC7C,+DAA8E;AAC9E,2CAMqB;AAIrB,MAAM,WAAW,GAAG,IAAI,sBAAS,CAAC,SAAA,EAA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AAmB;IAC5C,EAAE,EAAE,cAAc,CAAC,EAAE;IACrB,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ,EAAE,oBAAoB;CAC/B,CAAC"}
|
@@ -22,8 +22,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
22
22
|
return [];
|
23
23
|
const client = (0, clients_1.getClientSolana)();
|
24
24
|
const airdrop = yield (0, helpersAirdrop_1.fetchAirdrop)(owner, client, cache);
|
25
|
-
if (airdrop
|
26
|
-
airdrop.userStatus !== portfolio_core_1.AirdropUserStatus.claimableLater)
|
25
|
+
if (!(0, portfolio_core_1.isAirdropEligible)(airdrop) || airdrop.isClaimed)
|
27
26
|
return [];
|
28
27
|
if (!airdrop.amount)
|
29
28
|
return [];
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"airdropFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/parcl/airdropFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAIoC;AAGpC,2CAAmD;AACnD,iDAAsD;AACtD,qGAA6E;AAC7E,qDAAgE;AAEhE,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,IAAI,IAAI,CAAC,GAAG,EAAE,GAAG,+BAAc,CAAC,QAAQ;QAAE,OAAO,EAAE,CAAC;IAEpD,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IACjC,MAAM,OAAO,GAAG,MAAM,IAAA,6BAAY,EAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;IACzD,
|
1
|
+
{"version":3,"file":"airdropFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/parcl/airdropFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAIoC;AAGpC,2CAAmD;AACnD,iDAAsD;AACtD,qGAA6E;AAC7E,qDAAgE;AAEhE,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,IAAI,IAAI,CAAC,GAAG,EAAE,GAAG,+BAAc,CAAC,QAAQ;QAAE,OAAO,EAAE,CAAC;IAEpD,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IACjC,MAAM,OAAO,GAAG,MAAM,IAAA,6BAAY,EAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;IACzD,IAAI,CAAC,IAAA,kCAAiB,EAAC,OAAO,CAAC,IAAI,OAAO,CAAC,SAAS;QAAE,OAAO,EAAE,CAAC;IAChE,IAAI,CAAC,OAAO,CAAC,MAAM;QAAE,OAAO,EAAE,CAAC;IAE/B,MAAM,KAAK,GAAG,IAAA,gCAAsB,EAClC,oBAAQ,EACR,OAAO,CAAC,MAAM,EACd,0BAAS,CAAC,MAAM,EAChB,SAAS,EACT,OAAO,CAAC,KAAK,IAAI,SAAS,EAC1B,EAAE,WAAW,EAAE,IAAI,EAAE,CACtB,CAAC;IAEF,OAAO;QACL;YACE,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,IAAI,EAAE,qCAAoB,CAAC,QAAQ;YACnC,UAAU,EAAV,sBAAU;YACV,SAAS,EAAE,0BAAS,CAAC,MAAM;YAC3B,KAAK,EAAE,SAAS;YAChB,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,KAAK,CAAC,EAAE;SAC1B;KACF,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,UAAU;IAC3B,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -9,11 +9,12 @@ export declare const airdropStatics: {
|
|
9
9
|
claimLink: string;
|
10
10
|
image: string;
|
11
11
|
label: string;
|
12
|
-
|
13
|
-
|
12
|
+
emitterLink: string;
|
13
|
+
emitterName: string;
|
14
14
|
claimStart: number;
|
15
15
|
claimEnd: number;
|
16
16
|
name: undefined;
|
17
|
+
shortName: string;
|
17
18
|
};
|
18
19
|
export declare function fetchAirdrop(owner: string, client: SolanaClient, cache: Cache): Promise<Airdrop>;
|
19
20
|
export declare const airdropFetcher: AirdropFetcher;
|
@@ -69,22 +69,25 @@ exports.airdropStatics = {
|
|
69
69
|
claimLink: 'https://claims.parcllimited.com/',
|
70
70
|
image: constants_1.platformImage,
|
71
71
|
label: 'PRCL',
|
72
|
-
|
73
|
-
|
72
|
+
emitterLink: constants_1.platformWebsite,
|
73
|
+
emitterName: constants_1.platformName,
|
74
74
|
claimStart: 0,
|
75
75
|
claimEnd: 1735603200000,
|
76
76
|
name: undefined,
|
77
|
+
shortName: 'Parcl S1',
|
77
78
|
};
|
78
79
|
function fetchAirdrop(owner, client, cache) {
|
79
80
|
return __awaiter(this, void 0, void 0, function* () {
|
80
81
|
const prclTokenPrice = yield cache.getTokenPrice(constants_1.prclMint, portfolio_core_1.NetworkId.solana);
|
81
82
|
const allocation = yield fetchAllocation(owner, cache);
|
83
|
+
const claimStatus = (0, portfolio_core_1.getAirdropClaimStatus)(exports.airdropStatics.claimStart, exports.airdropStatics.claimEnd);
|
82
84
|
if (allocation.amount === 0 || !allocation.merkleTree)
|
83
|
-
return Object.assign(Object.assign(
|
85
|
+
return Object.assign(Object.assign({}, exports.airdropStatics), { claimStatus, isClaimed: false, amount: -1, price: (prclTokenPrice === null || prclTokenPrice === void 0 ? void 0 : prclTokenPrice.price) || null });
|
84
86
|
const claimStatusPubkey = (0, helpers_1.deriveClaimStatus)(owner, allocation.merkleTree, constants_1.distributorProgram);
|
85
87
|
const claimStatusAccounts = yield (0, getParsedAccountInfo_1.getParsedAccountInfo)(client, structs_1.claimStatusStruct, claimStatusPubkey);
|
86
88
|
const isClaimed = claimStatusAccounts !== null;
|
87
|
-
return Object.assign(Object.assign(
|
89
|
+
return Object.assign(Object.assign({}, exports.airdropStatics), { claimStatus,
|
90
|
+
isClaimed, amount: allocation.amount, price: (prclTokenPrice === null || prclTokenPrice === void 0 ? void 0 : prclTokenPrice.price) || null });
|
88
91
|
});
|
89
92
|
}
|
90
93
|
exports.fetchAirdrop = fetchAirdrop;
|
@@ -1 +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,4BAAgB;YACxB,SAAS,EAAE,0BAAS,CAAC,MAAM;SAC5B,CAAC,CAAC;QACH,IAAI,gBAAgB;YAAE,OAAO,gBAAgB,CAAC;QAE9C,IAAI,UAAsB,CAAC;QAC3B,MAAM,WAAW,GAAG,MAAM,eAAK,CAAC,GAAG,CAGjC,sBAAU,GAAG,KAAK,EAAE;YACpB,OAAO,EAAE;gBACP,MAAM,EAAE,sBAAsB;gBAC9B,OAAO,EAAE,sBAAsB;aAChC;YACD,cAAc,CAAC,MAAM;gBACnB,OAAO,MAAM,KAAK,GAAG,IAAI,MAAM,KAAK,GAAG,CAAC;YAC1C,CAAC;SACF,CAAC,CAAC;QAEH,IACE,WAAW,CAAC,IAAI,CAAC,KAAK;YACtB,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM;YACxB,CAAC,WAAW,CAAC,IAAI,CAAC,WAAW,EAC7B,CAAC;YACD,UAAU,GAAG;gBACX,MAAM,EAAE,CAAC;aACV,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,MAAM,MAAM,GAAG,IAAI,sBAAS,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC;iBAClD,SAAS,CAAC,SAAA,EAAE,EAAI,wBAAY,CAAA,CAAC;iBAC7B,QAAQ,EAAE,CAAC;YACd,UAAU,GAAG;gBACX,MAAM;gBACN,UAAU,EAAE,WAAW,CAAC,IAAI,CAAC,WAAW;aACzC,CAAC;QACJ,CAAC;QACD,MAAM,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,UAAU,EAAE;YACrC,MAAM,EAAE,4BAAgB;YACxB,SAAS,EAAE,0BAAS,CAAC,MAAM;YAC3B,GAAG,EAAE,QAAQ,EAAE,MAAM;SACtB,CAAC,CAAC;QACH,OAAO,UAAU,CAAC;IACpB,CAAC;CAAA;AA/CD,0CA+CC;AAEY,QAAA,cAAc,GAAG;IAC5B,EAAE,EAAE,iBAAiB;IACrB,SAAS,EAAE,kCAAkC;IAC7C,KAAK,EAAE,yBAAa;IACpB,KAAK,EAAE,MAAM;IACb,
|
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,4BAAgB;YACxB,SAAS,EAAE,0BAAS,CAAC,MAAM;SAC5B,CAAC,CAAC;QACH,IAAI,gBAAgB;YAAE,OAAO,gBAAgB,CAAC;QAE9C,IAAI,UAAsB,CAAC;QAC3B,MAAM,WAAW,GAAG,MAAM,eAAK,CAAC,GAAG,CAGjC,sBAAU,GAAG,KAAK,EAAE;YACpB,OAAO,EAAE;gBACP,MAAM,EAAE,sBAAsB;gBAC9B,OAAO,EAAE,sBAAsB;aAChC;YACD,cAAc,CAAC,MAAM;gBACnB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