@sonarwatch/portfolio-plugins 0.11.197 → 0.11.198
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +4 -0
- package/package.json +2 -2
- package/src/plugins/drift/helpersAirdrop.js +7 -2
- 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 +1 -0
- package/src/plugins/parcl/helpersAirdrop.js +5 -2
- package/src/plugins/parcl/helpersAirdrop.js.map +1 -1
package/CHANGELOG.md
CHANGED
@@ -2,6 +2,10 @@
|
|
2
2
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
4
4
|
|
5
|
+
## [0.11.198](https://github.com/sonarwatch/portfolio/compare/plugins-0.11.197...plugins-0.11.198) (2024-05-06)
|
6
|
+
|
7
|
+
|
8
|
+
|
5
9
|
## [0.11.197](https://github.com/sonarwatch/portfolio/compare/plugins-0.11.196...plugins-0.11.197) (2024-05-04)
|
6
10
|
|
7
11
|
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@sonarwatch/portfolio-plugins",
|
3
|
-
"version": "0.11.
|
3
|
+
"version": "0.11.198",
|
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.198"
|
45
45
|
},
|
46
46
|
"main": "./src/index.js",
|
47
47
|
"types": "./src/index.d.ts"
|
@@ -42,14 +42,19 @@ const airdropStatics = {
|
|
42
42
|
image: constants_1.platformImage,
|
43
43
|
label: 'DRIFT',
|
44
44
|
name: undefined,
|
45
|
+
shortName: 'Drift S1',
|
45
46
|
organizerName: constants_1.platformName,
|
46
47
|
organizerLink: 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,EAAE,EAAI,yBAAa,CAAA,CAAC,CAAC;AACvD,SAAsB,kBAAkB,CAAC,KAAa;;QACpD,MAAM,GAAG,GAAmC,MAAM,eAAK,CAAC,GAAG,CACzD,sBAAU,GAAG,KAAK,EAClB;YACE,OAAO,EAAE;gBACP,MAAM,EAAE,0BAA0B;gBAClC,OAAO,EAAE,2BAA2B;aACrC;YACD,OAAO,EAAE,IAAI;YACb,cAAc,CAAC,MAAM;gBACnB,OAAO,MAAM,KAAK,GAAG,IAAI,MAAM,KAAK,GAAG,CAAC;YAC1C,CAAC;SACF,CACF,CAAC;QACF,OAAO,IAAI,sBAAS,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,IAAI,CAAC,CAAC;aAC7C,SAAS,CAAC,WAAW,CAAC;aACtB,QAAQ,EAAE,CAAC;IAChB,CAAC;CAAA;AAjBD,gDAiBC;AAED,MAAM,cAAc,GAAG;IACrB,SAAS,EAAE,sCAAsC;IACjD,EAAE,EAAE,iBAAiB;IACrB,KAAK,EAAE,yBAAa;IACpB,KAAK,EAAE,OAAO;IACd,IAAI,EAAE,SAAS;IACf,SAAS,EAAE,UAAU;IACrB,aAAa,EAAE,wBAAY;IAC3B,aAAa,EAAE,2BAAe;IAC9B,UAAU,EAAE,SAAS;IACrB,QAAQ,EAAE,SAAS;CACpB,CAAC;AACF,MAAM,oBAAoB,GAA2B,CAAO,KAAa,EAAE,EAAE;IAC3E,IAAI,MAAM,GAAG,MAAM,kBAAkB,CAAC,KAAK,CAAC,CAAC;IAC7C,IAAI,MAAM,KAAK,CAAC;QAAE,MAAM,GAAG,CAAC,CAAC,CAAC;IAE9B,MAAM,WAAW,GAAG,IAAA,sCAAqB,EACvC,cAAc,CAAC,UAAU,EACzB,cAAc,CAAC,QAAQ,CACxB,CAAC;IACF,uCACK,cAAc,KACjB,MAAM;QACN,WAAW,EACX,SAAS,EAAE,KAAK,EAChB,KAAK,EAAE,IAAI,IACX;AACJ,CAAC,CAAA,CAAC;AAEW,QAAA,cAAc,GAAmB;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"}
|
@@ -14,6 +14,7 @@ export declare const airdropStatics: {
|
|
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;
|
@@ -74,17 +74,20 @@ exports.airdropStatics = {
|
|
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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,EAAE,aAAa;IACvB,IAAI,EAAE,SAAS;
|
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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