@sonarwatch/portfolio-plugins 0.12.55 → 0.12.57
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 +1 -1
- package/src/AirdropFetcher.d.ts +15 -1
- package/src/AirdropFetcher.js +73 -1
- package/src/AirdropFetcher.js.map +1 -1
- package/src/plugins/drift/airdropFetcher.js +3 -66
- package/src/plugins/drift/airdropFetcher.js.map +1 -1
- package/src/plugins/drift/constants.d.ts +2 -1
- package/src/plugins/drift/constants.js +11 -2
- package/src/plugins/drift/constants.js.map +1 -1
- package/src/plugins/drift/helpersAirdrop.d.ts +6 -2
- package/src/plugins/drift/helpersAirdrop.js +23 -21
- package/src/plugins/drift/helpersAirdrop.js.map +1 -1
- package/src/plugins/drift/types.d.ts +0 -16
- package/src/plugins/jupiter/governance/asrFetcher.js +3 -3
- package/src/plugins/jupiter/governance/asrFetcher.js.map +1 -1
- package/src/plugins/jupiter/helpers.d.ts +0 -1
- package/src/plugins/jupiter/helpers.js +1 -9
- package/src/plugins/jupiter/helpers.js.map +1 -1
- package/src/plugins/jupiter/launchpad/allocationsFetcher.js +2 -2
- package/src/plugins/jupiter/launchpad/allocationsFetcher.js.map +1 -1
- package/src/plugins/kamino/airdropFetcher.js +2 -2
- package/src/plugins/kamino/airdropFetcher.js.map +1 -1
- package/src/plugins/parcl/airdropFetcher.js +2 -41
- package/src/plugins/parcl/airdropFetcher.js.map +1 -1
- package/src/plugins/parcl/constants.d.ts +2 -0
- package/src/plugins/parcl/constants.js +11 -1
- package/src/plugins/parcl/constants.js.map +1 -1
- package/src/plugins/parcl/helpersAirdrop.d.ts +0 -17
- package/src/plugins/parcl/helpersAirdrop.js +23 -24
- package/src/plugins/parcl/helpersAirdrop.js.map +1 -1
- package/src/plugins/zeta/airdropFetcher.js +2 -2
- package/src/plugins/zeta/airdropFetcher.js.map +1 -1
- package/src/utils/solana/jupiter/deriveClaimStatus.d.ts +2 -0
- package/src/utils/solana/jupiter/deriveClaimStatus.js +13 -0
- package/src/utils/solana/jupiter/deriveClaimStatus.js.map +1 -0
- package/src/utils/solana/jupiter/deriveClaimStatuses.d.ts +2 -0
- package/src/utils/solana/jupiter/deriveClaimStatuses.js +9 -0
- package/src/utils/solana/jupiter/deriveClaimStatuses.js.map +1 -0
- package/src/plugins/jito/helper.d.ts +0 -3
- package/src/plugins/jito/helper.js +0 -21
- package/src/plugins/jito/helper.js.map +0 -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.12.57](https://github.com/sonarwatch/portfolio/compare/plugins-0.12.56...plugins-0.12.57) (2024-07-12)
|
6
|
+
|
7
|
+
|
8
|
+
|
9
|
+
## [0.12.56](https://github.com/sonarwatch/portfolio/compare/plugins-0.12.55...plugins-0.12.56) (2024-07-12)
|
10
|
+
|
11
|
+
|
12
|
+
|
5
13
|
## [0.12.55](https://github.com/sonarwatch/portfolio/compare/plugins-0.12.54...plugins-0.12.55) (2024-07-11)
|
6
14
|
|
7
15
|
|
package/package.json
CHANGED
package/src/AirdropFetcher.d.ts
CHANGED
@@ -1,5 +1,6 @@
|
|
1
|
-
import { AddressSystemType, Airdrop, AirdropFetcherResult, AirdropFetchersResult, NetworkIdType } from '@sonarwatch/portfolio-core';
|
1
|
+
import { AddressSystemType, Airdrop, AirdropFetcherResult, AirdropFetchersResult, IsClaimed, NetworkIdType, UsdValue } from '@sonarwatch/portfolio-core';
|
2
2
|
import { Cache } from './Cache';
|
3
|
+
import { Fetcher } from './Fetcher';
|
3
4
|
export type AirdropFetcherExecutor = (owner: string, cache: Cache) => Promise<Airdrop>;
|
4
5
|
export type AirdropFetcher = {
|
5
6
|
id: string;
|
@@ -7,5 +8,18 @@ export type AirdropFetcher = {
|
|
7
8
|
executor: AirdropFetcherExecutor;
|
8
9
|
};
|
9
10
|
export declare function runAirdropFetchersByNetworkId(owner: string, networkId: NetworkIdType, fetchers: AirdropFetcher[], cache: Cache): Promise<AirdropFetchersResult>;
|
11
|
+
export type AirdropStatics = Omit<Airdrop, 'status' | 'items'>;
|
12
|
+
export declare function getAirdrop(params: {
|
13
|
+
statics: AirdropStatics;
|
14
|
+
items: {
|
15
|
+
amount: number;
|
16
|
+
label: string;
|
17
|
+
price: UsdValue;
|
18
|
+
imageUri?: string;
|
19
|
+
address?: string;
|
20
|
+
isClaimed: IsClaimed;
|
21
|
+
}[];
|
22
|
+
}): Airdrop;
|
10
23
|
export declare function runAirdropFetchers(owner: string, addressSystem: AddressSystemType, fetchers: AirdropFetcher[], cache: Cache): Promise<AirdropFetchersResult>;
|
11
24
|
export declare function runAirdropFetcher(owner: string, fetcher: AirdropFetcher, cache: Cache): Promise<AirdropFetcherResult>;
|
25
|
+
export declare function airdropFetcherToFetcher(airdropFetcher: AirdropFetcher, platformId: string, id: string, claimEnd?: number): Fetcher;
|
package/src/AirdropFetcher.js
CHANGED
@@ -12,9 +12,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
13
13
|
};
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
15
|
-
exports.runAirdropFetcher = exports.runAirdropFetchers = exports.runAirdropFetchersByNetworkId = void 0;
|
15
|
+
exports.airdropFetcherToFetcher = exports.runAirdropFetcher = exports.runAirdropFetchers = exports.getAirdrop = exports.runAirdropFetchersByNetworkId = void 0;
|
16
16
|
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
17
17
|
const promiseTimeout_1 = __importDefault(require("./utils/misc/promiseTimeout"));
|
18
|
+
const tokenPriceToAssetToken_1 = __importDefault(require("./utils/misc/tokenPriceToAssetToken"));
|
18
19
|
const runAirdropFetcherTimeout = 10000;
|
19
20
|
function runAirdropFetchersByNetworkId(owner, networkId, fetchers, cache) {
|
20
21
|
return __awaiter(this, void 0, void 0, function* () {
|
@@ -26,6 +27,26 @@ function runAirdropFetchersByNetworkId(owner, networkId, fetchers, cache) {
|
|
26
27
|
});
|
27
28
|
}
|
28
29
|
exports.runAirdropFetchersByNetworkId = runAirdropFetchersByNetworkId;
|
30
|
+
function getAirdrop(params) {
|
31
|
+
const status = (0, portfolio_core_1.getAirdropStatus)(params.statics.claimStart, params.statics.claimEnd);
|
32
|
+
return Object.assign(Object.assign({}, params.statics), { status, items: getAirdropItems(status, params.items) });
|
33
|
+
}
|
34
|
+
exports.getAirdrop = getAirdrop;
|
35
|
+
function getAirdropItems(airdropStatus, items) {
|
36
|
+
return items.map((item) => {
|
37
|
+
const isEligible = (0, portfolio_core_1.getIsEligible)(item.amount);
|
38
|
+
return {
|
39
|
+
amount: item.amount,
|
40
|
+
isClaimed: isEligible === false ? false : item.isClaimed,
|
41
|
+
isEligible,
|
42
|
+
label: item.label,
|
43
|
+
price: item.price,
|
44
|
+
status: (0, portfolio_core_1.getAirdropItemStatus)(airdropStatus, item.amount, item.isClaimed),
|
45
|
+
address: item.address,
|
46
|
+
imageUri: item.imageUri,
|
47
|
+
};
|
48
|
+
});
|
49
|
+
}
|
29
50
|
function runAirdropFetchers(owner, addressSystem, fetchers, cache) {
|
30
51
|
return __awaiter(this, void 0, void 0, function* () {
|
31
52
|
const fOwner = (0, portfolio_core_1.formatAddress)(owner, addressSystem);
|
@@ -89,4 +110,55 @@ function runAirdropFetcher(owner, fetcher, cache) {
|
|
89
110
|
});
|
90
111
|
}
|
91
112
|
exports.runAirdropFetcher = runAirdropFetcher;
|
113
|
+
function airdropFetcherToFetcher(airdropFetcher, platformId, id, claimEnd) {
|
114
|
+
return {
|
115
|
+
id,
|
116
|
+
networkId: airdropFetcher.networkId,
|
117
|
+
executor: (owner, cache) => __awaiter(this, void 0, void 0, function* () {
|
118
|
+
if (claimEnd && Date.now() > claimEnd)
|
119
|
+
return [];
|
120
|
+
const airdrop = yield airdropFetcher.executor(owner, cache);
|
121
|
+
const assets = [];
|
122
|
+
airdrop.items.forEach((item) => {
|
123
|
+
if (item.status !== portfolio_core_1.AirdropItemStatus.claimable &&
|
124
|
+
item.status !== portfolio_core_1.AirdropItemStatus.claimableLater)
|
125
|
+
return;
|
126
|
+
const asset = item.address
|
127
|
+
? (0, tokenPriceToAssetToken_1.default)(item.address, item.amount, airdropFetcher.networkId, undefined, item.price || undefined, { isClaimable: true, lockedUntil: airdrop.claimStart })
|
128
|
+
: {
|
129
|
+
type: portfolio_core_1.PortfolioAssetType.generic,
|
130
|
+
data: {
|
131
|
+
amount: item.amount,
|
132
|
+
price: item.price,
|
133
|
+
},
|
134
|
+
name: item.label,
|
135
|
+
networkId: airdropFetcher.networkId,
|
136
|
+
attributes: {
|
137
|
+
isClaimable: true,
|
138
|
+
lockedUntil: airdrop.claimStart,
|
139
|
+
},
|
140
|
+
value: item.price ? item.price * item.amount : null,
|
141
|
+
imageUri: item.imageUri,
|
142
|
+
};
|
143
|
+
assets.push(asset);
|
144
|
+
});
|
145
|
+
if (assets.length === 0)
|
146
|
+
return [];
|
147
|
+
return [
|
148
|
+
{
|
149
|
+
networkId: airdropFetcher.networkId,
|
150
|
+
label: 'Airdrop',
|
151
|
+
data: {
|
152
|
+
assets,
|
153
|
+
},
|
154
|
+
platformId,
|
155
|
+
type: portfolio_core_1.PortfolioElementType.multiple,
|
156
|
+
value: (0, portfolio_core_1.getUsdValueSum)(assets.map((a) => a.value)),
|
157
|
+
name: airdrop.name,
|
158
|
+
},
|
159
|
+
];
|
160
|
+
}),
|
161
|
+
};
|
162
|
+
}
|
163
|
+
exports.airdropFetcherToFetcher = airdropFetcherToFetcher;
|
92
164
|
//# sourceMappingURL=AirdropFetcher.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"AirdropFetcher.js","sourceRoot":"","sources":["../../../../packages/plugins/src/AirdropFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+
|
1
|
+
{"version":3,"file":"AirdropFetcher.js","sourceRoot":"","sources":["../../../../packages/plugins/src/AirdropFetcher.ts"],"names":[],"mappings":";;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AU,EAAE;4BACV,WAAW,EAAE,IAAI;4BACjB,WAAW,EAAE,OAAO,CAAC,UAAU;yBAChC;wBACD,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI;wBACnD,QAAQ,EAAE,IAAI,CAAC,QAAQ;qBACxB,CAAC;gBACN,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACrB,CAAC,CAAC,CAAC;YAEH,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;gBAAE,OAAO,EAAE,CAAC;YACnC,OAAO;gBACL;oBACE,SAAS,EAAE,cAAc,CAAC,SAAS;oBACnC,KAAK,EAAE,SAAS;oBAChB,IAAI,EAAE;wBACJ,MAAM;qBACP;oBACD,UAAU;oBACV,IAAI,EAAE,qCAAoB,CAAC,QAAQ;oBACnC,KAAK,EAAE,IAAA,+BAAc,EAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;oBACjD,IAAI,EAAE,OAAO,CAAC,IAAI;iBACnB;aACF,CAAC;QACJ,CAAC,CAAA;KACF,CAAC;AACJ,CAAC;AApED,0DAoEC"}
|
@@ -1,71 +1,8 @@
|
|
1
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
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
15
|
-
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
16
|
-
const constants_1 = require("./constants");
|
17
|
-
const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
|
18
3
|
const helpersAirdrop_1 = require("./helpersAirdrop");
|
19
|
-
const
|
20
|
-
const
|
21
|
-
const
|
22
|
-
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
23
|
-
if (Date.now() > claimEnds)
|
24
|
-
return [];
|
25
|
-
const { amount, merkle } = yield (0, helpersAirdrop_1.fetchAirdropInfo)(owner);
|
26
|
-
if (amount === 0)
|
27
|
-
return [];
|
28
|
-
const client = (0, clients_1.getClientSolana)();
|
29
|
-
const claimStatus = (0, helpers_1.deriveClaimStatus)(owner, merkle, constants_1.distributorPid);
|
30
|
-
const account = yield client.getAccountInfo(claimStatus);
|
31
|
-
if (account)
|
32
|
-
return [];
|
33
|
-
const tokenPrice = constants_1.driftMint
|
34
|
-
? yield cache.getTokenPrice(constants_1.driftMint, portfolio_core_1.NetworkId.solana)
|
35
|
-
: undefined;
|
36
|
-
const asset = tokenPrice
|
37
|
-
? (0, tokenPriceToAssetToken_1.default)(tokenPrice.address, amount, portfolio_core_1.NetworkId.solana, tokenPrice)
|
38
|
-
: {
|
39
|
-
type: 'generic',
|
40
|
-
data: {
|
41
|
-
amount,
|
42
|
-
name: 'DRIFT',
|
43
|
-
price: null,
|
44
|
-
imageUri: constants_1.platform.image,
|
45
|
-
},
|
46
|
-
attributes: {
|
47
|
-
lockedUntil: helpersAirdrop_1.claimStart,
|
48
|
-
},
|
49
|
-
networkId: portfolio_core_1.NetworkId.solana,
|
50
|
-
value: null,
|
51
|
-
};
|
52
|
-
return [
|
53
|
-
{
|
54
|
-
networkId: portfolio_core_1.NetworkId.solana,
|
55
|
-
platformId: constants_1.platformId,
|
56
|
-
type: portfolio_core_1.PortfolioElementType.multiple,
|
57
|
-
data: {
|
58
|
-
assets: [asset],
|
59
|
-
},
|
60
|
-
value: null,
|
61
|
-
label: 'Airdrop',
|
62
|
-
},
|
63
|
-
];
|
64
|
-
});
|
65
|
-
const fetcher = {
|
66
|
-
id: `${constants_1.platformId}-airdrop`,
|
67
|
-
networkId: portfolio_core_1.NetworkId.solana,
|
68
|
-
executor,
|
69
|
-
};
|
4
|
+
const AirdropFetcher_1 = require("../../AirdropFetcher");
|
5
|
+
const constants_1 = require("./constants");
|
6
|
+
const fetcher = (0, AirdropFetcher_1.airdropFetcherToFetcher)(helpersAirdrop_1.airdropFetcher, constants_1.platformId, `${constants_1.platformId}-airdrop`, constants_1.airdropStatics.claimEnd);
|
70
7
|
exports.default = fetcher;
|
71
8
|
//# sourceMappingURL=airdropFetcher.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"airdropFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/drift/airdropFetcher.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"airdropFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/drift/airdropFetcher.ts"],"names":[],"mappings":";;AACA,qDAAkD;AAClD,yDAA+D;AAC/D,2CAAyD;AAEzD,MAAM,OAAO,GAAY,IAAA,wCAAuB,EAC9C,+BAAc,EACd,sBAAU,EACV,GAAG,sBAAU,UAAU,EACvB,0BAAc,CAAC,QAAQ,CACxB,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { PublicKey } from '@solana/web3.js';
|
2
2
|
import { Platform } from '@sonarwatch/portfolio-core';
|
3
|
+
import { AirdropStatics } from '../../AirdropFetcher';
|
3
4
|
export declare const platformId = "drift";
|
4
5
|
export declare const platformName = "Drift";
|
5
6
|
export declare const platformImage = "https://sonar.watch/img/platforms/drift.webp";
|
@@ -11,6 +12,6 @@ export declare const preMarketPriceKey = "premarketPrice";
|
|
11
12
|
export declare const perpMarketsIndexesKey = "perp-markets-indexes";
|
12
13
|
export declare const oracleToMintKey = "oracle-to-mint";
|
13
14
|
export declare const airdropUrl = "https://airdrop.drift.trade/eligibility/";
|
14
|
-
export declare const distributorPid = "E7HtfkEMhmn9uwL7EFNydcXBWy5WCYN1vFmKKjipEH1x";
|
15
15
|
export declare const driftDecimals = 6;
|
16
16
|
export declare const driftMint = "DriFtupJYLTosbwoN8koMbEYSx54aFAVLddWsbksjwg7";
|
17
|
+
export declare const airdropStatics: AirdropStatics;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
3
|
+
exports.airdropStatics = exports.driftMint = exports.driftDecimals = exports.airdropUrl = exports.oracleToMintKey = exports.perpMarketsIndexesKey = exports.preMarketPriceKey = exports.driftProgram = exports.prefixSpotMarkets = exports.platform = exports.platformWebsite = exports.platformImage = exports.platformName = exports.platformId = void 0;
|
4
4
|
const web3_js_1 = require("@solana/web3.js");
|
5
5
|
exports.platformId = 'drift';
|
6
6
|
exports.platformName = 'Drift';
|
@@ -19,7 +19,16 @@ exports.preMarketPriceKey = 'premarketPrice';
|
|
19
19
|
exports.perpMarketsIndexesKey = 'perp-markets-indexes';
|
20
20
|
exports.oracleToMintKey = 'oracle-to-mint';
|
21
21
|
exports.airdropUrl = 'https://airdrop.drift.trade/eligibility/';
|
22
|
-
exports.distributorPid = 'E7HtfkEMhmn9uwL7EFNydcXBWy5WCYN1vFmKKjipEH1x';
|
23
22
|
exports.driftDecimals = 6;
|
24
23
|
exports.driftMint = 'DriFtupJYLTosbwoN8koMbEYSx54aFAVLddWsbksjwg7';
|
24
|
+
exports.airdropStatics = {
|
25
|
+
id: 'drift-airdrop-1',
|
26
|
+
claimLink: 'https://drift.foundation',
|
27
|
+
image: exports.platformImage,
|
28
|
+
name: undefined,
|
29
|
+
emitterName: exports.platformName,
|
30
|
+
emitterLink: exports.platformWebsite,
|
31
|
+
claimStart: 1715860800000,
|
32
|
+
claimEnd: 1723831200000,
|
33
|
+
};
|
25
34
|
//# sourceMappingURL=constants.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/drift/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/drift/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAI/B,QAAA,UAAU,GAAG,OAAO,CAAC;AACrB,QAAA,YAAY,GAAG,OAAO,CAAC;AACvB,QAAA,aAAa,GAAG,8CAA8C,CAAC;AAC/D,QAAA,eAAe,GAAG,0BAA0B,CAAC;AAC7C,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,oBAAY;IAClB,KAAK,EAAE,qBAAa;IACpB,WAAW,EAAE,OAAO;IACpB,OAAO,EAAE,uBAAe;CACzB,CAAC;AACW,QAAA,iBAAiB,GAAG,GAAG,kBAAU,cAAc,CAAC;AAEhD,QAAA,YAAY,GAAG,IAAI,mBAAS,CACvC,6CAA6C,CAC9C,CAAC;AAEW,QAAA,iBAAiB,GAAG,gBAAgB,CAAC;AACrC,QAAA,qBAAqB,GAAG,sBAAsB,CAAC;AAC/C,QAAA,eAAe,GAAG,gBAAgB,CAAC;AAEnC,QAAA,UAAU,GAAG,0CAA0C,CAAC;AACxD,QAAA,aAAa,GAAG,CAAC,CAAC;AAClB,QAAA,SAAS,GAAG,8CAA8C,CAAC;AAE3D,QAAA,cAAc,GAAmB;IAC5C,EAAE,EAAE,iBAAiB;IACrB,SAAS,EAAE,0BAA0B;IACrC,KAAK,EAAE,qBAAa;IACpB,IAAI,EAAE,SAAS;IACf,WAAW,EAAE,oBAAY;IACzB,WAAW,EAAE,uBAAe;IAC5B,UAAU,EAAE,aAAa;IACzB,QAAQ,EAAE,aAAa;CACxB,CAAC"}
|
@@ -1,5 +1,9 @@
|
|
1
|
-
import { AirdropInfo } from './types';
|
2
1
|
import { AirdropFetcher } from '../../AirdropFetcher';
|
3
|
-
|
2
|
+
type AirdropInfo = {
|
3
|
+
merkle?: string;
|
4
|
+
amount: number;
|
5
|
+
isClaimed: boolean;
|
6
|
+
};
|
4
7
|
export declare function fetchAirdropInfo(owner: string): Promise<AirdropInfo>;
|
5
8
|
export declare const airdropFetcher: AirdropFetcher;
|
9
|
+
export {};
|
@@ -12,13 +12,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
13
13
|
};
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
15
|
-
exports.airdropFetcher = exports.fetchAirdropInfo =
|
15
|
+
exports.airdropFetcher = exports.fetchAirdropInfo = void 0;
|
16
16
|
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
17
17
|
const axios_1 = __importDefault(require("axios"));
|
18
18
|
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
19
19
|
const constants_1 = require("./constants");
|
20
|
+
const AirdropFetcher_1 = require("../../AirdropFetcher");
|
20
21
|
const driftFactor = new bignumber_js_1.default(Math.pow(10, constants_1.driftDecimals));
|
21
|
-
exports.claimStart = 1715860800000;
|
22
22
|
function fetchAirdropInfo(owner) {
|
23
23
|
return __awaiter(this, void 0, void 0, function* () {
|
24
24
|
const res = yield axios_1.default.get(constants_1.airdropUrl + owner, {
|
@@ -31,6 +31,9 @@ function fetchAirdropInfo(owner) {
|
|
31
31
|
return status === 404 || status === 200;
|
32
32
|
},
|
33
33
|
});
|
34
|
+
if (res.data.error) {
|
35
|
+
return { amount: 0, merkle: undefined, isClaimed: false };
|
36
|
+
}
|
34
37
|
const availableAmount = Date.now() > res.data.end_ts * 1000
|
35
38
|
? res.data.end_amount
|
36
39
|
: res.data.start_amount;
|
@@ -39,31 +42,30 @@ function fetchAirdropInfo(owner) {
|
|
39
42
|
.dividedBy(driftFactor)
|
40
43
|
.toNumber(),
|
41
44
|
merkle: res.data.merkle_tree,
|
45
|
+
isClaimed: res.data.unvested_amount === 0,
|
42
46
|
};
|
43
47
|
});
|
44
48
|
}
|
45
49
|
exports.fetchAirdropInfo = fetchAirdropInfo;
|
46
|
-
const
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
return Object.assign(Object.assign({}, airdropStatics), { amount,
|
63
|
-
claimStatus, isClaimed: false, price: null });
|
50
|
+
const fetchAirdropExecutor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
51
|
+
const airdropInfo = yield fetchAirdropInfo(owner);
|
52
|
+
const { isClaimed, amount } = airdropInfo;
|
53
|
+
const driftPrice = yield cache.getTokenPrice(constants_1.driftMint, portfolio_core_1.NetworkId.solana);
|
54
|
+
return (0, AirdropFetcher_1.getAirdrop)({
|
55
|
+
statics: constants_1.airdropStatics,
|
56
|
+
items: [
|
57
|
+
{
|
58
|
+
amount,
|
59
|
+
label: 'DRIFT',
|
60
|
+
address: constants_1.driftMint,
|
61
|
+
price: (driftPrice === null || driftPrice === void 0 ? void 0 : driftPrice.price) || null,
|
62
|
+
isClaimed,
|
63
|
+
},
|
64
|
+
],
|
65
|
+
});
|
64
66
|
});
|
65
67
|
exports.airdropFetcher = {
|
66
|
-
id: airdropStatics.id,
|
68
|
+
id: constants_1.airdropStatics.id,
|
67
69
|
networkId: portfolio_core_1.NetworkId.solana,
|
68
70
|
executor: fetchAirdropExecutor,
|
69
71
|
};
|
@@ -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,+DAAuD;AACvD,2CAKqB;AACrB,yDAI8B;AAG9B,MAAM,WAAW,GAAG,IAAI,sBAAS,CAAC,SAAA,EAAE,EAAI,yBAAa,CAAA,CAAC,CAAC;AAmBvD,SAAsB,gBAAgB,CAAC,KAAa;;QAClD,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;QAEF,IAAI,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;YACnB,OAAO,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;QAC5D,CAAC;QAED,MAAM,eAAe,GACnB,IAAI,CAAC,GAAG,EAAE,GAAG,GAAG,CAAC,IAAI,CAAC,MAAM,GAAG,IAAI;YACjC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU;YACrB,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC;QAE5B,OAAO;YACL,MAAM,EAAE,IAAI,sBAAS,CAAC,eAAe,IAAI,CAAC,CAAC;iBACxC,SAAS,CAAC,WAAW,CAAC;iBACtB,QAAQ,EAAE;YACb,MAAM,EAAE,GAAG,CAAC,IAAI,CAAC,WAAW;YAC5B,SAAS,EAAE,GAAG,CAAC,IAAI,CAAC,eAAe,KAAK,CAAC;SAC1C,CAAC;IACJ,CAAC;CAAA;AA/BD,4CA+BC;AAED,MAAM,oBAAoB,GAA2B,CACnD,KAAa,EACb,KAAY,EACZ,EAAE;IACF,MAAM,WAAW,GAAG,MAAM,gBAAgB,CAAC,KAAK,CAAC,CAAC;IAClD,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,WAAW,CAAC;IAE1C,MAAM,UAAU,GAAG,MAAM,KAAK,CAAC,aAAa,CAAC,qBAAS,EAAE,0BAAS,CAAC,MAAM,CAAC,CAAC;IAE1E,OAAO,IAAA,2BAAU,EAAC;QAChB,OAAO,EAAE,0BAAc;QACvB,KAAK,EAAE;YACL;gBACE,MAAM;gBACN,KAAK,EAAE,OAAO;gBACd,OAAO,EAAE,qBAAS;gBAClB,KAAK,EAAE,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,KAAK,KAAI,IAAI;gBAChC,SAAS;aACV;SACF;KACF,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AAEW,QAAA,cAAc,GAAmB;IAC5C,EAAE,EAAE,0BAAc,CAAC,EAAE;IACrB,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ,EAAE,oBAAoB;CAC/B,CAAC"}
|
@@ -7,20 +7,4 @@ export type PreMarketPrice = {
|
|
7
7
|
id: string;
|
8
8
|
price: number;
|
9
9
|
};
|
10
|
-
export type AirdropResponse = {
|
11
|
-
claimant: string;
|
12
|
-
merkle_tree: string;
|
13
|
-
mint: string;
|
14
|
-
start_ts: number;
|
15
|
-
end_ts: number;
|
16
|
-
start_amount: number;
|
17
|
-
end_amount: number;
|
18
|
-
unvested_amount: number;
|
19
|
-
claimed_amount: number;
|
20
|
-
error: string;
|
21
|
-
};
|
22
|
-
export type AirdropInfo = {
|
23
|
-
merkle: string;
|
24
|
-
amount: number;
|
25
|
-
};
|
26
10
|
export type PerpMarketIndexes = Array<[number, string]>;
|
@@ -16,7 +16,7 @@ const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
|
16
16
|
const axios_1 = __importDefault(require("axios"));
|
17
17
|
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
18
18
|
const clients_1 = require("../../../utils/clients");
|
19
|
-
const
|
19
|
+
const deriveClaimStatus_1 = require("../../../utils/solana/jupiter/deriveClaimStatus");
|
20
20
|
const tokenPriceToAssetToken_1 = __importDefault(require("../../../utils/misc/tokenPriceToAssetToken"));
|
21
21
|
const structs_1 = require("../launchpad/structs");
|
22
22
|
const constants_1 = require("../launchpad/constants");
|
@@ -34,10 +34,10 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
34
34
|
for (let i = 0; i < claims.length; i++) {
|
35
35
|
const proof = claims[i];
|
36
36
|
if (proof.mint === constants_1.jupMint) {
|
37
|
-
claimsStatusPubkeys.push((0,
|
37
|
+
claimsStatusPubkeys.push((0, deriveClaimStatus_1.deriveClaimStatus)(owner, proof.merkle_tree, constants_1.jupDisProgram));
|
38
38
|
}
|
39
39
|
else {
|
40
|
-
claimsStatusPubkeys.push((0,
|
40
|
+
claimsStatusPubkeys.push((0, deriveClaimStatus_1.deriveClaimStatus)(owner, proof.merkle_tree, constants_1.mainDisProgram));
|
41
41
|
}
|
42
42
|
}
|
43
43
|
const [claimStatusAccounts, tokenPriceById] = yield Promise.all([
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"asrFetcher.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/jupiter/governance/asrFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAKoC;AACpC,kDAA6C;AAE7C,gEAAqC;AAGrC,oDAAyD;AAEzD,
|
1
|
+
{"version":3,"file":"asrFetcher.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/jupiter/governance/asrFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAKoC;AACpC,kDAA6C;AAE7C,gEAAqC;AAGrC,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M;YAC3B,UAAU,EAAV,sBAAU;YACV,IAAI,EAAE,wBAAwB;YAC9B,IAAI,EAAE;gBACJ,MAAM;aACP;YACD,KAAK,EAAE,IAAA,+BAAc,EAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;SAC1D;KACF,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,MAAM;IACvB,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -1,6 +1,5 @@
|
|
1
1
|
import { PublicKey } from '@solana/web3.js';
|
2
2
|
import { PortfolioAssetToken } from '@sonarwatch/portfolio-core';
|
3
|
-
export declare function deriveClaimStatus(claimant: string, merkleTree: string, merkleDistributor: string): PublicKey;
|
4
3
|
export declare function getVotePda(owner: string): PublicKey;
|
5
4
|
export declare function getJupiterPrices(mints: PublicKey[], vsMint: PublicKey): Promise<Map<string, number>>;
|
6
5
|
export declare function getMergedAssets(assets: PortfolioAssetToken[]): PortfolioAssetToken[];
|
@@ -12,19 +12,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
13
13
|
};
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
15
|
-
exports.getMergedAssets = exports.getJupiterPrices = exports.getVotePda =
|
15
|
+
exports.getMergedAssets = exports.getJupiterPrices = exports.getVotePda = void 0;
|
16
16
|
const web3_js_1 = require("@solana/web3.js");
|
17
17
|
const axios_1 = __importDefault(require("axios"));
|
18
18
|
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
19
19
|
const constants_1 = require("./launchpad/constants");
|
20
|
-
function deriveClaimStatus(claimant, merkleTree, merkleDistributor) {
|
21
|
-
return web3_js_1.PublicKey.findProgramAddressSync([
|
22
|
-
Buffer.from('ClaimStatus'),
|
23
|
-
new web3_js_1.PublicKey(claimant).toBytes(),
|
24
|
-
new web3_js_1.PublicKey(merkleTree).toBytes(),
|
25
|
-
], new web3_js_1.PublicKey(merkleDistributor))[0];
|
26
|
-
}
|
27
|
-
exports.deriveClaimStatus = deriveClaimStatus;
|
28
20
|
function getVotePda(owner) {
|
29
21
|
return web3_js_1.PublicKey.findProgramAddressSync([
|
30
22
|
Buffer.from('Escrow'),
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/jupiter/helpers.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6CAA4C;AAC5C,kDAA6C;AAC7C,+DAGoC;AAEpC,qDAAoE;AAEpE,SAAgB,
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/jupiter/helpers.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6CAA4C;AAC5C,kDAA6C;AAC7C,+DAGoC;AAEpC,qDAAoE;AAEpE,SAAgB,UAAU,CAAC,KAAa;IACtC,OAAO,mBAAS,CAAC,sBAAsB,CACrC;QACE,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC;QACrB,wBAAY,CAAC,OAAO,EAAE;QACtB,IAAI,mBAAS,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE;KAC/B,EACD,yBAAa,CACd,CAAC,CAAC,CAAC,CAAC;AACP,CAAC;AATD,gCASC;AAED,SAAsB,gBAAgB,CAAC,KAAkB,EAAE,MAAiB;;QAC1E,MAAM,GAAG,GAAG,MAAM,eAAK,CAAC,GAAG,CACzB,+BAA+B,EAC/B;YACE,MAAM,EAAE;gBACN,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;gBAC7C,OAAO,EAAE,MAAM,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AnBD,0CAmBC"}
|
@@ -16,7 +16,7 @@ const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
|
16
16
|
const axios_1 = __importDefault(require("axios"));
|
17
17
|
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
18
18
|
const clients_1 = require("../../../utils/clients");
|
19
|
-
const
|
19
|
+
const deriveClaimStatus_1 = require("../../../utils/solana/jupiter/deriveClaimStatus");
|
20
20
|
const tokenPriceToAssetToken_1 = __importDefault(require("../../../utils/misc/tokenPriceToAssetToken"));
|
21
21
|
const structs_1 = require("./structs");
|
22
22
|
const constants_1 = require("./constants");
|
@@ -40,7 +40,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
40
40
|
continue;
|
41
41
|
eligibleAirdrops.push(constants_1.airdropsInfo[i]);
|
42
42
|
proofs.push(proof.data);
|
43
|
-
claimsPubkeys.push((0,
|
43
|
+
claimsPubkeys.push((0, deriveClaimStatus_1.deriveClaimStatus)(owner, proof.data.merkle_tree, constants_1.airdropsInfo[i].distributorProgram));
|
44
44
|
}
|
45
45
|
if (proofs.length === 0)
|
46
46
|
return [];
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"allocationsFetcher.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/jupiter/launchpad/allocationsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAKoC;AACpC,kDAA6C;AAE7C,gEAAqC;AAGrC,oDAAyD;AAEzD,
|
1
|
+
{"version":3,"file":"allocationsFetcher.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/jupiter/launchpad/allocationsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAKoC;AACpC,kDAA6C;AAE7C,gEAAqC;AAGrC,oDAAyD;AAEzD,uFAAoF;AACpF,wGAAgF;AAChF,uCAA8C;AAC9C,2CAA+E;AAC/E,kDAAsE;AAEtE,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE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;YAChB,SAAS,EAAE,0BAAS,CAAC,MAAM;YAC3B,UAAU,EAAV,sBAAU;YACV,IAAI,EAAE,YAAY;YAClB,IAAI,EAAE;gBACJ,MAAM;aACP;YACD,KAAK,EAAE,IAAA,+BAAc,EAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;SAC1D;KACF,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,aAAa;IAC9B,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -16,7 +16,7 @@ const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
|
16
16
|
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
17
17
|
const axios_1 = __importDefault(require("axios"));
|
18
18
|
const constants_1 = require("./constants");
|
19
|
-
const
|
19
|
+
const deriveClaimStatus_1 = require("../../utils/solana/jupiter/deriveClaimStatus");
|
20
20
|
const clients_1 = require("../../utils/clients");
|
21
21
|
const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
|
22
22
|
const kmnoFactor = new bignumber_js_1.default(Math.pow(10, constants_1.kmnoDecimals));
|
@@ -26,7 +26,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
26
26
|
.catch(() => null);
|
27
27
|
if (!allocation)
|
28
28
|
return [];
|
29
|
-
const pda = (0,
|
29
|
+
const pda = (0, deriveClaimStatus_1.deriveClaimStatus)(owner, allocation.data.merkle_tree, constants_1.distributorProgram);
|
30
30
|
const client = (0, clients_1.getClientSolana)();
|
31
31
|
const claimStatus = yield client.getAccountInfo(pda);
|
32
32
|
if (claimStatus)
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"airdropFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/kamino/airdropFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAIoC;AACpC,gEAAqC;AACrC,kDAA6C;AAG7C,2CAMqB;AACrB,
|
1
|
+
{"version":3,"file":"airdropFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/kamino/airdropFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAIoC;AACpC,gEAAqC;AACrC,kDAA6C;AAG7C,2CAMqB;AACrB,oFAAiF;AAEjF,iDAAsD;AACtD,qGAA6E;AAE7E,MAAM,UAAU,GAAG,IAAI,sBAAS,CAAC,SAAA,EAAE,EAAI,wBAAY,CAAA,CAAC,CAAC;AACrD,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,UAAU,GAA6C,MAAM,eAAK;SACrE,GAAG,CAAC,0BAAc,GAAG,KAAK,CAAC;SAC3B,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;IACrB,IAAI,CAAC,UAAU;QAAE,OAAO,EAAE,CAAC;IAE3B,MAAM,GAAG,GAAG,IAAA,qCAAiB,EAC3B,KAAK,EACL,UAAU,CAAC,IAAI,CAAC,WAAW,EAC3B,8BAAkB,CACnB,CAAC;IAEF,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IACjC,MAAM,WAAW,GAAG,MAAM,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;IACrD,IAAI,WAAW;QAAE,OAAO,EAAE,CAAC;IAE3B,MAAM,cAAc,GAAG,MAAM,KAAK,CAAC,aAAa,CAAC,oBAAQ,EAAE,0BAAS,CAAC,MAAM,CAAC,CAAC;IAE7E,MAAM,MAAM,GAAG,IAAA,sBAAS,EAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC;SAC7C,SAAS,CAAC,UAAU,CAAC;SACrB,QAAQ,EAAE,CAAC;IACd,MAAM,KAAK,GAAmB,IAAA,gCAAsB,EAClD,oBAAQ,EACR,MAAM,EACN,0BAAS,CAAC,MAAM,EAChB,cAAc,EACd,SAAS,EACT,EAAE,WAAW,EAAE,IAAI,EAAE,CACtB,CAAC;IAEF,OAAO;QACL;YACE,IAAI,EAAE,qCAAoB,CAAC,QAAQ;YACnC,UAAU,EAAV,sBAAU;YACV,IAAI,EAAE,UAAU;YAChB,SAAS,EAAE,0BAAS,CAAC,MAAM;YAC3B,KAAK,EAAE,SAAS;YAChB,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,KAAK,CAAC,EAAE;YACzB,KAAK,EAAE,KAAK,CAAC,KAAK;SACnB;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"}
|
@@ -1,47 +1,8 @@
|
|
1
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
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
15
|
-
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
16
3
|
const constants_1 = require("./constants");
|
17
|
-
const clients_1 = require("../../utils/clients");
|
18
|
-
const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
|
19
4
|
const helpersAirdrop_1 = require("./helpersAirdrop");
|
20
|
-
const
|
21
|
-
|
22
|
-
return [];
|
23
|
-
const client = (0, clients_1.getClientSolana)();
|
24
|
-
const airdrop = yield (0, helpersAirdrop_1.fetchAirdrop)(owner, client, cache);
|
25
|
-
if (!(0, portfolio_core_1.isAirdropEligible)(airdrop) || airdrop.isClaimed)
|
26
|
-
return [];
|
27
|
-
if (!airdrop.amount)
|
28
|
-
return [];
|
29
|
-
const asset = (0, tokenPriceToAssetToken_1.default)(constants_1.prclMint, airdrop.amount, portfolio_core_1.NetworkId.solana, undefined, airdrop.price || undefined, { isClaimable: true });
|
30
|
-
return [
|
31
|
-
{
|
32
|
-
value: asset.value,
|
33
|
-
type: portfolio_core_1.PortfolioElementType.multiple,
|
34
|
-
platformId: constants_1.platformId,
|
35
|
-
networkId: portfolio_core_1.NetworkId.solana,
|
36
|
-
label: 'Airdrop',
|
37
|
-
data: { assets: [asset] },
|
38
|
-
},
|
39
|
-
];
|
40
|
-
});
|
41
|
-
const fetcher = {
|
42
|
-
id: `${constants_1.platformId}-airdrop`,
|
43
|
-
networkId: portfolio_core_1.NetworkId.solana,
|
44
|
-
executor,
|
45
|
-
};
|
5
|
+
const AirdropFetcher_1 = require("../../AirdropFetcher");
|
6
|
+
const fetcher = (0, AirdropFetcher_1.airdropFetcherToFetcher)(helpersAirdrop_1.airdropFetcher, constants_1.platformId, `${constants_1.platformId}-airdrop`, constants_1.airdropStatics.claimEnd);
|
46
7
|
exports.default = fetcher;
|
47
8
|
//# sourceMappingURL=airdropFetcher.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"airdropFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/parcl/airdropFetcher.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"airdropFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/parcl/airdropFetcher.ts"],"names":[],"mappings":";;AACA,2CAAyD;AACzD,qDAAkD;AAClD,yDAA+D;AAE/D,MAAM,OAAO,GAAY,IAAA,wCAAuB,EAC9C,+BAAc,EACd,sBAAU,EACV,GAAG,sBAAU,UAAU,EACvB,0BAAc,CAAC,QAAQ,CACxB,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { PublicKey } from '@solana/web3.js';
|
2
2
|
import { Platform } from '@sonarwatch/portfolio-core';
|
3
|
+
import { AirdropStatics } from '../../AirdropFetcher';
|
3
4
|
export declare const platformId = "parcl";
|
4
5
|
export declare const platformImage = "https://sonar.watch/img/platforms/parcl.webp";
|
5
6
|
export declare const platformWebsite = "https://app.parcl.co/";
|
@@ -13,3 +14,4 @@ export declare const prclDecimals = 6;
|
|
13
14
|
export declare const merkleApi = "https://worker.jup.ag/jup-claim-proof";
|
14
15
|
export declare const merkleTree = "5nRBuSmpA98JgrznGYEAFTvQAA7hCdFkVKS9e41N8mBQ";
|
15
16
|
export declare const distributorProgram = "5tu3xkmLfud5BAwSuQke4WSjoHcQ52SbrPwX9es8j6Ve";
|
17
|
+
export declare const airdropStatics: AirdropStatics;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.distributorProgram = exports.merkleTree = exports.merkleApi = exports.prclDecimals = exports.prclMint = exports.allocationPrefix = exports.airdropApi = exports.programId = exports.platform = exports.platformName = exports.platformWebsite = exports.platformImage = exports.platformId = void 0;
|
3
|
+
exports.airdropStatics = exports.distributorProgram = exports.merkleTree = exports.merkleApi = exports.prclDecimals = exports.prclMint = exports.allocationPrefix = exports.airdropApi = exports.programId = exports.platform = exports.platformName = exports.platformWebsite = exports.platformImage = exports.platformId = void 0;
|
4
4
|
const web3_js_1 = require("@solana/web3.js");
|
5
5
|
exports.platformId = 'parcl';
|
6
6
|
exports.platformImage = 'https://sonar.watch/img/platforms/parcl.webp';
|
@@ -22,4 +22,14 @@ exports.prclDecimals = 6;
|
|
22
22
|
exports.merkleApi = 'https://worker.jup.ag/jup-claim-proof';
|
23
23
|
exports.merkleTree = '5nRBuSmpA98JgrznGYEAFTvQAA7hCdFkVKS9e41N8mBQ';
|
24
24
|
exports.distributorProgram = '5tu3xkmLfud5BAwSuQke4WSjoHcQ52SbrPwX9es8j6Ve';
|
25
|
+
exports.airdropStatics = {
|
26
|
+
id: 'parcl-airdrop-1',
|
27
|
+
claimLink: 'https://claims.parcllimited.com/',
|
28
|
+
image: exports.platformImage,
|
29
|
+
emitterLink: exports.platformWebsite,
|
30
|
+
emitterName: exports.platformName,
|
31
|
+
claimStart: 1704067200000,
|
32
|
+
claimEnd: 1735603200000,
|
33
|
+
name: undefined,
|
34
|
+
};
|
25
35
|
//# sourceMappingURL=constants.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/parcl/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/parcl/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAI/B,QAAA,UAAU,GAAG,OAAO,CAAC;AACrB,QAAA,aAAa,GAAG,8CAA8C,CAAC;AAC/D,QAAA,eAAe,GAAG,uBAAuB,CAAC;AAC1C,QAAA,YAAY,GAAG,OAAO,CAAC;AACvB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,oBAAY;IAClB,KAAK,EAAE,qBAAa;IACpB,WAAW,EAAE,cAAc,EAAE,sCAAsC;IACnE,OAAO,EAAE,uBAAe;IACxB,OAAO,EAAE,2BAA2B;CACrC,CAAC;AAEW,QAAA,SAAS,GAAG,IAAI,mBAAS,CACpC,8CAA8C,CAC/C,CAAC;AAEW,QAAA,UAAU,GAAG,yCAAyC,CAAC;AACvD,QAAA,gBAAgB,GAAG,GAAG,kBAAU,aAAa,CAAC;AAC9C,QAAA,QAAQ,GAAG,8CAA8C,CAAC;AAC1D,QAAA,YAAY,GAAG,CAAC,CAAC;AACjB,QAAA,SAAS,GAAG,uCAAuC,CAAC;AACpD,QAAA,UAAU,GAAG,8CAA8C,CAAC;AAC5D,QAAA,kBAAkB,GAC7B,8CAA8C,CAAC;AAEpC,QAAA,cAAc,GAAmB;IAC5C,EAAE,EAAE,iBAAiB;IACrB,SAAS,EAAE,kCAAkC;IAC7C,KAAK,EAAE,qBAAa;IACpB,WAAW,EAAE,uBAAe;IAC5B,WAAW,EAAE,oBAAY;IACzB,UAAU,EAAE,aAAa;IACzB,QAAQ,EAAE,aAAa;IACvB,IAAI,EAAE,SAAS;CAChB,CAAC"}
|
@@ -1,19 +1,2 @@
|
|
1
|
-
import { Airdrop } from '@sonarwatch/portfolio-core';
|
2
|
-
import { Allocation } from './types';
|
3
|
-
import { Cache } from '../../Cache';
|
4
|
-
import { SolanaClient } from '../../utils/clients/types';
|
5
1
|
import { AirdropFetcher } from '../../AirdropFetcher';
|
6
|
-
export declare function fetchAllocation(owner: string, cache: Cache): Promise<Allocation>;
|
7
|
-
export declare const airdropStatics: {
|
8
|
-
id: string;
|
9
|
-
claimLink: string;
|
10
|
-
image: string;
|
11
|
-
label: string;
|
12
|
-
emitterLink: string;
|
13
|
-
emitterName: string;
|
14
|
-
claimStart: number;
|
15
|
-
claimEnd: number;
|
16
|
-
name: undefined;
|
17
|
-
};
|
18
|
-
export declare function fetchAirdrop(owner: string, client: SolanaClient, cache: Cache): Promise<Airdrop>;
|
19
2
|
export declare const airdropFetcher: AirdropFetcher;
|
@@ -12,14 +12,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
13
13
|
};
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
15
|
-
exports.airdropFetcher =
|
15
|
+
exports.airdropFetcher = void 0;
|
16
16
|
const axios_1 = __importDefault(require("axios"));
|
17
17
|
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
18
18
|
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
19
19
|
const constants_1 = require("./constants");
|
20
|
-
const
|
20
|
+
const deriveClaimStatus_1 = require("../../utils/solana/jupiter/deriveClaimStatus");
|
21
21
|
const getParsedAccountInfo_1 = require("../../utils/solana/getParsedAccountInfo");
|
22
22
|
const structs_1 = require("../jupiter/launchpad/structs");
|
23
|
+
const AirdropFetcher_1 = require("../../AirdropFetcher");
|
23
24
|
const clients_1 = require("../../utils/clients");
|
24
25
|
function fetchAllocation(owner, cache) {
|
25
26
|
return __awaiter(this, void 0, void 0, function* () {
|
@@ -63,35 +64,33 @@ function fetchAllocation(owner, cache) {
|
|
63
64
|
return allocation;
|
64
65
|
});
|
65
66
|
}
|
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
|
-
emitterLink: constants_1.platformWebsite,
|
73
|
-
emitterName: constants_1.platformName,
|
74
|
-
claimStart: 1,
|
75
|
-
claimEnd: 1735603200000,
|
76
|
-
name: undefined,
|
77
|
-
};
|
78
67
|
function fetchAirdrop(owner, client, cache) {
|
79
68
|
return __awaiter(this, void 0, void 0, function* () {
|
80
69
|
const prclTokenPrice = yield cache.getTokenPrice(constants_1.prclMint, portfolio_core_1.NetworkId.solana);
|
81
70
|
const allocation = yield fetchAllocation(owner, cache);
|
82
|
-
const
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
71
|
+
const amount = !allocation.merkleTree ? 0 : allocation.amount;
|
72
|
+
let isClaimed = false;
|
73
|
+
if (amount > 0 && allocation.merkleTree) {
|
74
|
+
const claimStatusPubkey = (0, deriveClaimStatus_1.deriveClaimStatus)(owner, allocation.merkleTree, constants_1.distributorProgram);
|
75
|
+
const claimStatusAccount = yield (0, getParsedAccountInfo_1.getParsedAccountInfo)(client, structs_1.claimStatusStruct, claimStatusPubkey);
|
76
|
+
isClaimed = claimStatusAccount !== null;
|
77
|
+
}
|
78
|
+
return (0, AirdropFetcher_1.getAirdrop)({
|
79
|
+
statics: constants_1.airdropStatics,
|
80
|
+
items: [
|
81
|
+
{
|
82
|
+
amount,
|
83
|
+
isClaimed,
|
84
|
+
label: 'PRCL',
|
85
|
+
address: constants_1.prclMint,
|
86
|
+
price: (prclTokenPrice === null || prclTokenPrice === void 0 ? void 0 : prclTokenPrice.price) || null,
|
87
|
+
},
|
88
|
+
],
|
89
|
+
});
|
90
90
|
});
|
91
91
|
}
|
92
|
-
exports.fetchAirdrop = fetchAirdrop;
|
93
92
|
exports.airdropFetcher = {
|
94
|
-
id:
|
93
|
+
id: constants_1.airdropStatics.id,
|
95
94
|
networkId: portfolio_core_1.NetworkId.solana,
|
96
95
|
executor: (owner, cache) => {
|
97
96
|
const client = (0, clients_1.getClientSolana)();
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"helpersAirdrop.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/parcl/helpersAirdrop.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,kDAA6C;AAC7C,gEAAqC;AACrC,+
|
1
|
+
{"version":3,"file":"helpersAirdrop.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/parcl/helpersAirdrop.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,kDAA6C;AAC7C,gEAAqC;AACrC,+DAA2E;AAC3E,2CAOqB;AAGrB,oFAAiF;AACjF,kFAA+E;AAE/E,0DAAiE;AACjE,yDAAkE;AAClE,iDAAsD;AAEtD,SAAe,eAAe,CAC5B,KAAa,EACb,KAAY;;QAEZ,MAAM,gBAAgB,GA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-39,9 +39,9 @@ const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
|
39
39
|
const graphql_request_1 = __importStar(require("graphql-request"));
|
40
40
|
const constants_1 = require("./constants");
|
41
41
|
const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
|
42
|
-
const helper_1 = require("../jito/helper");
|
43
42
|
const clients_1 = require("../../utils/clients");
|
44
43
|
const getMultipleAccountsInfoSafe_1 = require("../../utils/solana/getMultipleAccountsInfoSafe");
|
44
|
+
const deriveClaimStatuses_1 = require("../../utils/solana/jupiter/deriveClaimStatuses");
|
45
45
|
const query = (0, graphql_request_1.gql) `
|
46
46
|
query GetAirdropFinalFrontend($authority: String!) {
|
47
47
|
getAirdropFinalFrontend(authority: $authority) {
|
@@ -71,7 +71,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
71
71
|
const amount = res.getAirdropFinalFrontend.total_allocation;
|
72
72
|
if (amount === 0)
|
73
73
|
return [];
|
74
|
-
const claimStatuses = (0,
|
74
|
+
const claimStatuses = (0, deriveClaimStatuses_1.deriveClaimStatuses)(owner, constants_1.distributors, constants_1.distributorPid);
|
75
75
|
const client = (0, clients_1.getClientSolana)();
|
76
76
|
const claimStatusesAccount = yield (0, getMultipleAccountsInfoSafe_1.getMultipleAccountsInfoSafe)(client, claimStatuses);
|
77
77
|
if (claimStatusesAccount.some((account) => account))
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"airdropFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/zeta/airdropFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+DAAuE;AACvE,mEAA+C;AAG/C,2CAMqB;AAErB,qGAA6E;AAC7E,
|
1
|
+
{"version":3,"file":"airdropFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/zeta/airdropFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;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AAO,EAClB,MAAM,EACN,SAAS,EACT,UAAU,EACV,SAAS,EACT,EAAE,WAAW,EAAE,aAAa,EAAE,CAC/B;QACH,CAAC,CAAC;YACE,IAAI,EAAE,SAAS;YACf,IAAI,EAAE;gBACJ,OAAO,EAAE,mBAAO;gBAChB,QAAQ,EACN,kMAAkM;gBACpM,MAAM;gBACN,KAAK,EAAE,IAAI;gBACX,IAAI,EAAE,KAAK;aACZ;YACD,KAAK,EAAE,IAAI;YACX,SAAS;YACT,UAAU,EAAE,EAAE,WAAW,EAAE,aAAa,EAAE;SAC3C,CAAC;IAEN,OAAO;QACL;YACE,IAAI,EAAE,UAAU;YAChB,KAAK,EAAE,SAAS;YAChB,SAAS;YACT,UAAU,EAAV,sBAAU;YACV,IAAI,EAAE;gBACJ,MAAM,EAAE,CAAC,KAAK,CAAC;aAChB;YACD,KAAK,EAAE,KAAK,CAAC,KAAK;SACnB;KACF,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,UAAU;IAC3B,SAAS;IACT,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.deriveClaimStatus = void 0;
|
4
|
+
const web3_js_1 = require("@solana/web3.js");
|
5
|
+
function deriveClaimStatus(claimant, merkleTree, merkleDistributor) {
|
6
|
+
return web3_js_1.PublicKey.findProgramAddressSync([
|
7
|
+
Buffer.from('ClaimStatus'),
|
8
|
+
new web3_js_1.PublicKey(claimant).toBytes(),
|
9
|
+
new web3_js_1.PublicKey(merkleTree).toBytes(),
|
10
|
+
], new web3_js_1.PublicKey(merkleDistributor))[0];
|
11
|
+
}
|
12
|
+
exports.deriveClaimStatus = deriveClaimStatus;
|
13
|
+
//# sourceMappingURL=deriveClaimStatus.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"deriveClaimStatus.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/utils/solana/jupiter/deriveClaimStatus.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAE5C,SAAgB,iBAAiB,CAC/B,QAAgB,EAChB,UAAkB,EAClB,iBAAyB;IAEzB,OAAO,mBAAS,CAAC,sBAAsB,CACrC;QACE,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC;QAC1B,IAAI,mBAAS,CAAC,QAAQ,CAAC,CAAC,OAAO,EAAE;QACjC,IAAI,mBAAS,CAAC,UAAU,CAAC,CAAC,OAAO,EAAE;KACpC,EACD,IAAI,mBAAS,CAAC,iBAAiB,CAAC,CACjC,CAAC,CAAC,CAAC,CAAC;AACP,CAAC;AAbD,8CAaC"}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.deriveClaimStatuses = void 0;
|
4
|
+
const deriveClaimStatus_1 = require("./deriveClaimStatus");
|
5
|
+
function deriveClaimStatuses(claimant, distributors, programId) {
|
6
|
+
return distributors.map((d) => (0, deriveClaimStatus_1.deriveClaimStatus)(claimant, d, programId));
|
7
|
+
}
|
8
|
+
exports.deriveClaimStatuses = deriveClaimStatuses;
|
9
|
+
//# sourceMappingURL=deriveClaimStatuses.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"deriveClaimStatuses.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/utils/solana/jupiter/deriveClaimStatuses.ts"],"names":[],"mappings":";;;AACA,2DAAwD;AAExD,SAAgB,mBAAmB,CACjC,QAAgB,EAChB,YAAsB,EACtB,SAAiB;IAEjB,OAAO,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAA,qCAAiB,EAAC,QAAQ,EAAE,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC;AAC5E,CAAC;AAND,kDAMC"}
|
@@ -1,3 +0,0 @@
|
|
1
|
-
import { PublicKey } from '@solana/web3.js';
|
2
|
-
export declare function findClaimStatusKey(claimant: string, distributor: string, programId: string): PublicKey;
|
3
|
-
export declare function findClaimStatusesKeys(claimant: string, distributors: string[], programId: string): PublicKey[];
|
@@ -1,21 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.findClaimStatusesKeys = exports.findClaimStatusKey = void 0;
|
4
|
-
const web3_js_1 = require("@solana/web3.js");
|
5
|
-
function findClaimStatusKey(claimant, distributor, programId) {
|
6
|
-
return web3_js_1.PublicKey.findProgramAddressSync([
|
7
|
-
Buffer.from('ClaimStatus'),
|
8
|
-
new web3_js_1.PublicKey(distributor).toBytes(),
|
9
|
-
new web3_js_1.PublicKey(claimant).toBytes(),
|
10
|
-
], new web3_js_1.PublicKey(programId))[0];
|
11
|
-
}
|
12
|
-
exports.findClaimStatusKey = findClaimStatusKey;
|
13
|
-
function findClaimStatusesKeys(claimant, distributors, programId) {
|
14
|
-
return distributors.map((distributor) => web3_js_1.PublicKey.findProgramAddressSync([
|
15
|
-
Buffer.from('ClaimStatus'),
|
16
|
-
new web3_js_1.PublicKey(distributor).toBytes(),
|
17
|
-
new web3_js_1.PublicKey(claimant).toBytes(),
|
18
|
-
], new web3_js_1.PublicKey(programId))[0]);
|
19
|
-
}
|
20
|
-
exports.findClaimStatusesKeys = findClaimStatusesKeys;
|
21
|
-
//# sourceMappingURL=helper.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"helper.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/jito/helper.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAE5C,SAAgB,kBAAkB,CAChC,QAAgB,EAChB,WAAmB,EACnB,SAAiB;IAEjB,OAAO,mBAAS,CAAC,sBAAsB,CACrC;QACE,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC;QAC1B,IAAI,mBAAS,CAAC,WAAW,CAAC,CAAC,OAAO,EAAE;QACpC,IAAI,mBAAS,CAAC,QAAQ,CAAC,CAAC,OAAO,EAAE;KAClC,EACD,IAAI,mBAAS,CAAC,SAAS,CAAC,CACzB,CAAC,CAAC,CAAC,CAAC;AACP,CAAC;AAbD,gDAaC;AAED,SAAgB,qBAAqB,CACnC,QAAgB,EAChB,YAAsB,EACtB,SAAiB;IAEjB,OAAO,YAAY,CAAC,GAAG,CACrB,CAAC,WAAW,EAAE,EAAE,CACd,mBAAS,CAAC,sBAAsB,CAC9B;QACE,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC;QAC1B,IAAI,mBAAS,CAAC,WAAW,CAAC,CAAC,OAAO,EAAE;QACpC,IAAI,mBAAS,CAAC,QAAQ,CAAC,CAAC,OAAO,EAAE;KAClC,EACD,IAAI,mBAAS,CAAC,SAAS,CAAC,CACzB,CAAC,CAAC,CAAC,CACP,CAAC;AACJ,CAAC;AAhBD,sDAgBC"}
|