@sonarwatch/portfolio-plugins 0.14.64 → 0.14.66
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/CHANGELOG.md +1856 -1848
- package/README.md +3 -3
- package/package.json +1 -1
- package/src/index.js +2 -0
- package/src/index.js.map +1 -1
- package/src/plugins/balancer/helpers/pools.js +21 -21
- package/src/plugins/magiceden/airdropFetcher.d.ts +3 -0
- package/src/plugins/magiceden/airdropFetcher.js +67 -0
- package/src/plugins/magiceden/airdropFetcher.js.map +1 -0
- package/src/plugins/magiceden/constants.d.ts +3 -0
- package/src/plugins/magiceden/constants.js +11 -1
- package/src/plugins/magiceden/constants.js.map +1 -1
- package/src/plugins/magiceden/index.d.ts +2 -0
- package/src/plugins/magiceden/index.js +3 -1
- package/src/plugins/magiceden/index.js.map +1 -1
- package/src/plugins/magiceden/types.d.ts +15 -0
- package/src/plugins/magiceden/types.js +3 -0
- package/src/plugins/magiceden/types.js.map +1 -0
- package/src/plugins/sandglass/marketsJob.js +0 -1
- package/src/plugins/sandglass/marketsJob.js.map +1 -1
- package/src/plugins/streamflow/airdropFetcher.d.ts +5 -0
- package/src/plugins/streamflow/airdropFetcher.js +46 -0
- package/src/plugins/streamflow/airdropFetcher.js.map +1 -0
- package/src/plugins/streamflow/constants.d.ts +4 -0
- package/src/plugins/streamflow/constants.js +12 -1
- package/src/plugins/streamflow/constants.js.map +1 -1
- package/src/plugins/streamflow/helpers.d.ts +3 -0
- package/src/plugins/streamflow/helpers.js +83 -0
- package/src/plugins/streamflow/helpers.js.map +1 -0
- package/src/plugins/streamflow/index.d.ts +2 -0
- package/src/plugins/streamflow/index.js +8 -1
- package/src/plugins/streamflow/index.js.map +1 -1
- package/src/plugins/streamflow/types.d.ts +13 -0
- package/src/plugins/streamflow/types.js +3 -0
- package/src/plugins/streamflow/types.js.map +1 -0
- package/src/plugins/suilend/airdropFetcher.d.ts +1 -0
- package/src/plugins/suilend/airdropFetcher.js +66 -34
- package/src/plugins/suilend/airdropFetcher.js.map +1 -1
- package/src/plugins/suilend/burnEventsJob.d.ts +3 -0
- package/src/plugins/suilend/burnEventsJob.js +68 -0
- package/src/plugins/suilend/burnEventsJob.js.map +1 -0
- package/src/plugins/suilend/constants.d.ts +2 -1
- package/src/plugins/suilend/constants.js +5 -4
- package/src/plugins/suilend/constants.js.map +1 -1
- package/src/plugins/suilend/index.js +2 -1
- package/src/plugins/suilend/index.js.map +1 -1
- package/src/plugins/suilend/types.d.ts +23 -0
- package/src/plugins/sushiswap/helpers.js +24 -24
- package/src/plugins/uniswap-v2/helpers.js +22 -22
- package/src/plugins/zeta/airdropFetcher.js +14 -14
- package/src/utils/sei/constants.js +8 -8
- package/src/utils/sei/getQueryBalanceByOwner.js +4 -4
@@ -12,7 +12,7 @@ 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 = void 0;
|
15
|
+
exports.fetcher = exports.airdropFetcher = void 0;
|
16
16
|
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
17
17
|
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
18
18
|
const AirdropFetcher_1 = require("../../AirdropFetcher");
|
@@ -25,6 +25,12 @@ const earlyUsers_json_1 = __importDefault(require("./earlyUsers.json"));
|
|
25
25
|
const bluefinLeagues_json_1 = __importDefault(require("./bluefinLeagues.json"));
|
26
26
|
const getKioskObjects_1 = require("../../utils/sui/getKioskObjects");
|
27
27
|
const getOwnedObjectsPreloaded_1 = require("../../utils/sui/getOwnedObjectsPreloaded");
|
28
|
+
const MemoizedCache_1 = require("../../utils/misc/MemoizedCache");
|
29
|
+
const getOwnedObjects_1 = require("../../utils/sui/getOwnedObjects");
|
30
|
+
const memoizedBurnEvents = new MemoizedCache_1.MemoizedCache('burnEvents', {
|
31
|
+
prefix: constants_1.platformId,
|
32
|
+
networkId: portfolio_core_1.NetworkId.sui,
|
33
|
+
});
|
28
34
|
const eligibleCollections = new Map([
|
29
35
|
[
|
30
36
|
'0x8f74a7d632191e29956df3843404f22d27bd84d92cca1b1abde621d033098769::rootlet::Rootlet',
|
@@ -49,46 +55,58 @@ const eligibleCollections = new Map([
|
|
49
55
|
]);
|
50
56
|
const capsuleType = '0x008a7e85138643db888096f2db04766d549ca496583e41c3a683c6e1539a64ac::suilend_capsule::SuilendCapsule';
|
51
57
|
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
58
|
+
const client = (0, clients_1.getClientSui)();
|
59
|
+
const { capsuleRecord, pointsRecord } = yield memoizedBurnEvents.getItem(cache);
|
60
|
+
const capsuleAmountClaimed = capsuleRecord[owner];
|
61
|
+
const pointsAmountClaimed = pointsRecord[owner];
|
52
62
|
const [pointsAllocation, nftsAllocation] = yield Promise.all([
|
53
|
-
|
54
|
-
|
63
|
+
getPointsAllocationItem(owner, client, cache),
|
64
|
+
getNftsAllocationItems(owner, client),
|
55
65
|
]);
|
66
|
+
// This is because we are not able to compute the EXACT number of mSEND for the classic allocation
|
67
|
+
// So we expect that 95% of claimed or higher means it's claimed
|
68
|
+
const isPointsAllocClaimed = (0, bignumber_js_1.default)(pointsAmountClaimed)
|
69
|
+
.dividedBy(pointsAllocation)
|
70
|
+
.isGreaterThan(0.95);
|
56
71
|
return (0, AirdropFetcher_1.getAirdropRaw)({
|
57
72
|
statics: constants_1.airdropStatics,
|
58
73
|
items: [
|
59
74
|
{
|
60
|
-
amount: pointsAllocation,
|
61
|
-
isClaimed:
|
62
|
-
label: '
|
63
|
-
address: constants_1.
|
75
|
+
amount: pointsAmountClaimed !== null && pointsAmountClaimed !== void 0 ? pointsAmountClaimed : pointsAllocation,
|
76
|
+
isClaimed: isPointsAllocClaimed,
|
77
|
+
label: 'mSEND',
|
78
|
+
address: constants_1.mSendMint,
|
64
79
|
imageUri: constants_1.platform.image,
|
65
80
|
},
|
66
81
|
{
|
67
82
|
amount: nftsAllocation.collectionsAllocation,
|
68
|
-
isClaimed:
|
69
|
-
|
70
|
-
|
83
|
+
isClaimed: nftsAllocation.collectionsClaimed ===
|
84
|
+
nftsAllocation.collectionsAllocation,
|
85
|
+
label: 'mSEND',
|
86
|
+
address: constants_1.mSendMint,
|
71
87
|
imageUri: constants_1.platform.image,
|
72
88
|
},
|
73
89
|
{
|
74
|
-
amount: nftsAllocation.capsulesAllocation,
|
75
|
-
isClaimed:
|
76
|
-
label: '
|
77
|
-
address: constants_1.
|
90
|
+
amount: capsuleAmountClaimed !== null && capsuleAmountClaimed !== void 0 ? capsuleAmountClaimed : nftsAllocation.capsulesAllocation,
|
91
|
+
isClaimed: capsuleAmountClaimed === nftsAllocation.capsulesAllocation,
|
92
|
+
label: 'mSEND',
|
93
|
+
address: constants_1.mSendMint,
|
78
94
|
imageUri: constants_1.platform.image,
|
79
95
|
},
|
80
96
|
{
|
81
97
|
amount: getEarlyUserAllocation(owner),
|
82
|
-
|
83
|
-
|
84
|
-
|
98
|
+
// Those were airdropped directly inside the wallet
|
99
|
+
isClaimed: true,
|
100
|
+
label: 'mSEND',
|
101
|
+
address: constants_1.mSendMint,
|
85
102
|
imageUri: constants_1.platform.image,
|
86
103
|
},
|
87
104
|
{
|
88
105
|
amount: getBluefinLeagueAllocation(owner),
|
89
|
-
|
90
|
-
|
91
|
-
|
106
|
+
// Those were airdropped directly inside the wallet
|
107
|
+
isClaimed: true,
|
108
|
+
label: 'mSEND',
|
109
|
+
address: constants_1.mSendMint,
|
92
110
|
imageUri: constants_1.platform.image,
|
93
111
|
},
|
94
112
|
],
|
@@ -99,12 +117,7 @@ exports.airdropFetcher = {
|
|
99
117
|
networkId: portfolio_core_1.NetworkId.sui,
|
100
118
|
executor,
|
101
119
|
};
|
102
|
-
|
103
|
-
// airdropFetcher,
|
104
|
-
// platform.id,
|
105
|
-
// 'suilend-airdrop',
|
106
|
-
// airdropStatics.claimEnd
|
107
|
-
// );
|
120
|
+
exports.fetcher = (0, AirdropFetcher_1.airdropFetcherToFetcher)(exports.airdropFetcher, constants_1.platform.id, 'suilend-airdrop', constants_1.airdropStatics.claimEnd);
|
108
121
|
function getEarlyUserAllocation(owner) {
|
109
122
|
if (earlyUsers_json_1.default.includes(owner))
|
110
123
|
return 512;
|
@@ -113,21 +126,23 @@ function getEarlyUserAllocation(owner) {
|
|
113
126
|
function getBluefinLeagueAllocation(owner) {
|
114
127
|
return bluefinLeagues_json_1.default.includes(owner) ? 6.08 : 0;
|
115
128
|
}
|
116
|
-
function
|
129
|
+
function getNftsAllocationItems(owner, client) {
|
117
130
|
return __awaiter(this, void 0, void 0, function* () {
|
118
|
-
const client = (0, clients_1.getClientSui)();
|
119
131
|
const eligibleCollectionsTypes = Array.from(eligibleCollections.keys());
|
120
132
|
const objects = yield (0, getOwnedObjectsPreloaded_1.getOwnedObjectsPreloaded)(client, owner);
|
121
133
|
const kioskObjects = (yield (0, getKioskObjects_1.getKiosksDynamicFieldsObjects)(objects)).flat();
|
122
|
-
|
134
|
+
const elligibleNfts = [];
|
135
|
+
const collectionsAllocations = [];
|
123
136
|
let capsulesAllocation = 0;
|
124
137
|
[...objects, ...kioskObjects].forEach((obj) => {
|
125
138
|
var _a;
|
126
139
|
if ((_a = obj.data) === null || _a === void 0 ? void 0 : _a.content) {
|
127
140
|
if (eligibleCollectionsTypes.includes(obj.data.content.type)) {
|
128
141
|
const nftAlloc = eligibleCollections.get(obj.data.content.type);
|
129
|
-
if (nftAlloc)
|
130
|
-
|
142
|
+
if (nftAlloc) {
|
143
|
+
elligibleNfts.push(obj.data.objectId);
|
144
|
+
collectionsAllocations.push(nftAlloc);
|
145
|
+
}
|
131
146
|
}
|
132
147
|
else if (obj.data.content.type === capsuleType) {
|
133
148
|
const capsule = obj.data.content.fields;
|
@@ -140,16 +155,33 @@ function getNftsAllocation(owner) {
|
|
140
155
|
}
|
141
156
|
}
|
142
157
|
});
|
158
|
+
let totalAlloc = 0;
|
159
|
+
let totalClaimed = 0;
|
160
|
+
const nftsObjects = yield Promise.all([
|
161
|
+
...elligibleNfts.map((obj) => (0, getOwnedObjects_1.getOwnedObjects)(client, obj, {
|
162
|
+
filter: {
|
163
|
+
StructType: constants_1.mSendCoinType,
|
164
|
+
},
|
165
|
+
})),
|
166
|
+
]);
|
167
|
+
for (let i = 0; i < elligibleNfts.length; i += 1) {
|
168
|
+
const claimed = nftsObjects[i];
|
169
|
+
const alloc = collectionsAllocations[i];
|
170
|
+
if (claimed.length === 0) {
|
171
|
+
totalClaimed += alloc;
|
172
|
+
}
|
173
|
+
totalAlloc += alloc;
|
174
|
+
}
|
143
175
|
return {
|
144
|
-
collectionsAllocation,
|
176
|
+
collectionsAllocation: totalAlloc,
|
145
177
|
capsulesAllocation,
|
178
|
+
collectionsClaimed: totalClaimed,
|
146
179
|
};
|
147
180
|
});
|
148
181
|
}
|
149
|
-
function
|
182
|
+
function getPointsAllocationItem(owner, client, cache) {
|
150
183
|
var _a, _b, _c, _d;
|
151
184
|
return __awaiter(this, void 0, void 0, function* () {
|
152
|
-
const client = (0, clients_1.getClientSui)();
|
153
185
|
const obligationsCapFields = yield (0, getOwnedObjectsPreloaded_1.getOwnedObjectsPreloaded)(client, owner, {
|
154
186
|
filter: { Package: constants_1.packageId },
|
155
187
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"airdropFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/suilend/airdropFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+DAAuD;AACvD,gEAAqC;AACrC,
|
1
|
+
{"version":3,"file":"airdropFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/suilend/airdropFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+DAAuD;AACvD,gEAAqC;AACrC,yDAM8B;AAC9B,2CAUqB;AACrB,qEAAkE;AASlE,iDAAmD;AAEnD,uCAAgD;AAChD,iDAAgD;AAChD,wE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C,UAAU,CAAC,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,SAAS,CAChE,SAAA,EAAE,EAAI,uBAAW,CAAA,CAClB,CACF,CAAC;gBACJ,CAAC;YACH,CAAC;QACH,CAAC;QAED,OAAO,aAAa;aACjB,SAAS,CAAC,SAAA,EAAE,EAAI,CAAC,CAAA,CAAC;aAClB,SAAS,CAAC,IAAI,CAAC;aACf,KAAK,CAAC,IAAI,CAAC,CAAC,cAAc;aAC1B,QAAQ,EAAE,CAAC;;CACf"}
|
@@ -0,0 +1,68 @@
|
|
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
|
+
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
16
|
+
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
17
|
+
const clients_1 = require("../../utils/clients");
|
18
|
+
const constants_1 = require("./constants");
|
19
|
+
const queryEvents_1 = require("../../utils/sui/queryEvents");
|
20
|
+
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
21
|
+
const client = (0, clients_1.getClientSui)();
|
22
|
+
const [pointsBurnEvents, capsuleBurnEvents] = yield Promise.all([
|
23
|
+
(0, queryEvents_1.queryEvents)(client, {
|
24
|
+
MoveEventType: '0xf4e0686b311e9b9d6da7e61fc42dae4254828f5ee3ded8ab5480ecd27e46ff08::points::BurnEvent',
|
25
|
+
}),
|
26
|
+
(0, queryEvents_1.queryEvents)(client, {
|
27
|
+
MoveEventType: '0xf4e0686b311e9b9d6da7e61fc42dae4254828f5ee3ded8ab5480ecd27e46ff08::capsule::BurnEvent',
|
28
|
+
}),
|
29
|
+
]);
|
30
|
+
const pointsBurnByUser = pointsBurnEvents.reduce((obj, event) => {
|
31
|
+
if (event.parsedJson)
|
32
|
+
// eslint-disable-next-line no-param-reassign
|
33
|
+
obj[event.sender] = (0, bignumber_js_1.default)(event.parsedJson.claim_amount)
|
34
|
+
.dividedBy(Math.pow(10, 6))
|
35
|
+
.toNumber();
|
36
|
+
return obj;
|
37
|
+
}, {});
|
38
|
+
const capsuleBurnByUser = capsuleBurnEvents.reduce((obj, event) => {
|
39
|
+
if (event.parsedJson) {
|
40
|
+
const pastAmount = obj[event.sender];
|
41
|
+
if (pastAmount) {
|
42
|
+
// eslint-disable-next-line no-param-reassign
|
43
|
+
obj[event.sender] = (0, bignumber_js_1.default)(event.parsedJson.claim_amount)
|
44
|
+
.dividedBy(Math.pow(10, 6))
|
45
|
+
.plus(pastAmount)
|
46
|
+
.toNumber();
|
47
|
+
}
|
48
|
+
else {
|
49
|
+
// eslint-disable-next-line no-param-reassign
|
50
|
+
obj[event.sender] = (0, bignumber_js_1.default)(event.parsedJson.claim_amount)
|
51
|
+
.dividedBy(Math.pow(10, 6))
|
52
|
+
.toNumber();
|
53
|
+
}
|
54
|
+
}
|
55
|
+
return obj;
|
56
|
+
}, {});
|
57
|
+
yield cache.setItem('burnEvents', {
|
58
|
+
capsuleRecord: capsuleBurnByUser,
|
59
|
+
pointsRecord: pointsBurnByUser,
|
60
|
+
}, { prefix: constants_1.platformId, networkId: portfolio_core_1.NetworkId.sui });
|
61
|
+
});
|
62
|
+
const job = {
|
63
|
+
id: `${constants_1.platformId}-burn-events`,
|
64
|
+
executor,
|
65
|
+
label: 'normal',
|
66
|
+
};
|
67
|
+
exports.default = job;
|
68
|
+
//# sourceMappingURL=burnEventsJob.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"burnEventsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/suilend/burnEventsJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAAuD;AACvD,gEAAqC;AAGrC,iDAAmD;AACnD,2CAAyC;AAEzC,6DAA0D;AAE1D,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,MAAM,GAAG,IAAA,sBAAY,GAAE,CAAC;IAE9B,MAAM,CAAC,gBAAgB,EAAE,iBAAiB,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QAC9D,IAAA,yBAAW,EAAgB,MAAM,EAAE;YACjC,aAAa,EACX,uFAAuF;SAC1F,CAAC;QACF,IAAA,yBAAW,EAAgB,MAAM,EAAE;YACjC,aAAa,EACX,wFAAwF;SAC3F,CAAC;KACH,CAAC,CAAC;IAEH,MAAM,gBAAgB,GAAG,gBAAgB,CAAC,MAAM,CAC9C,CAAC,GAA2B,EAAE,KAAK,EAAE,EAAE;QACrC,IAAI,KAAK,CAAC,UAAU;YAClB,6CAA6C;YAC7C,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,IAAA,sBAAS,EAAC,KAAK,CAAC,UAAU,CAAC,YAAY,CAAC;iBACzD,SAAS,CAAC,SAAA,EAAE,EAAI,CAAC,CAAA,CAAC;iBAClB,QAAQ,EAAE,CAAC;QAChB,OAAO,GAAG,CAAC;IACb,CAAC,EACD,EAAE,CACH,CAAC;IAEF,MAAM,iBAAiB,GAAG,iBAAiB,CAAC,MAAM,CAChD,CAAC,GAA2B,EAAE,KAAK,EAAE,EAAE;QACrC,IAAI,KAAK,CAAC,UAAU,EAAE,CAAC;YACrB,MAAM,UAAU,GAAG,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;YACrC,IAAI,UAAU,EAAE,CAAC;gBACf,6CAA6C;gBAC7C,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,IAAA,sBAAS,EAAC,KAAK,CAAC,UAAU,CAAC,YAAY,CAAC;qBACzD,SAAS,CAAC,SAAA,EAAE,EAAI,CAAC,CAAA,CAAC;qBAClB,IAAI,CAAC,UAAU,CAAC;qBAChB,QAAQ,EAAE,CAAC;YAChB,CAAC;iBAAM,CAAC;gBACN,6CAA6C;gBAC7C,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,IAAA,sBAAS,EAAC,KAAK,CAAC,UAAU,CAAC,YAAY,CAAC;qBACzD,SAAS,CAAC,SAAA,EAAE,EAAI,CAAC,CAAA,CAAC;qBAClB,QAAQ,EAAE,CAAC;YAChB,CAAC;QACH,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC,EACD,EAAE,CACH,CAAC;IAEF,MAAM,KAAK,CAAC,OAAO,CACjB,YAAY,EACZ;QACE,aAAa,EAAE,iBAAiB;QAChC,YAAY,EAAE,gBAAgB;KAC/B,EACD,EAAE,MAAM,EAAE,sBAAU,EAAE,SAAS,EAAE,0BAAS,CAAC,GAAG,EAAE,CACjD,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,cAAc;IAC/B,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
|
@@ -3,7 +3,8 @@ import { AirdropStatics } from '../../AirdropFetcher';
|
|
3
3
|
export declare const platformId = "suilend";
|
4
4
|
export declare const platform: Platform;
|
5
5
|
export declare const airdropStatics: AirdropStatics;
|
6
|
-
export declare const
|
6
|
+
export declare const mSendMint = "0xda097d57ae887fbd002fb5847dd0ab47ae7e1b183fd36832a51182c52257e1bc::msend_series_1::MSEND_SERIES_1";
|
7
|
+
export declare const mSendCoinType = "0x2::coin::Coin<0xda097d57ae887fbd002fb5847dd0ab47ae7e1b183fd36832a51182c52257e1bc::msend_series_1::MSEND_SERIES_1>";
|
7
8
|
export declare const suilendPointsType = "34fe4f3c9e450fed4d0a3c587ed842eec5313c30c3cc3c0841247c49425e246b::suilend_point::SUILEND_POINT";
|
8
9
|
export declare const packageId = "0xf95b06141ed4a174f239417323bde3f209b972f5930d8521ea38a52aff3a6ddf";
|
9
10
|
export declare const obligationType = "0xf95b06141ed4a174f239417323bde3f209b972f5930d8521ea38a52aff3a6ddf::obligation::Obligation";
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.marketsKey = exports.poolsKey = exports.obligationOwnerCapType = exports.marketsRegistry = exports.mainMarket = exports.obligationType = exports.packageId = exports.suilendPointsType = exports.
|
3
|
+
exports.marketsKey = exports.poolsKey = exports.obligationOwnerCapType = exports.marketsRegistry = exports.mainMarket = exports.obligationType = exports.packageId = exports.suilendPointsType = exports.mSendCoinType = exports.mSendMint = exports.airdropStatics = exports.platform = exports.platformId = void 0;
|
4
4
|
exports.platformId = 'suilend';
|
5
5
|
exports.platform = {
|
6
6
|
id: exports.platformId,
|
@@ -16,10 +16,11 @@ exports.airdropStatics = {
|
|
16
16
|
emitterName: 'Suilend',
|
17
17
|
id: 'suilend-airdrop',
|
18
18
|
image: 'https://sonar.watch/img/platforms/suilend.webp',
|
19
|
-
claimEnd:
|
20
|
-
claimStart:
|
19
|
+
claimEnd: 1765512000000,
|
20
|
+
claimStart: 1733976000000,
|
21
21
|
};
|
22
|
-
exports.
|
22
|
+
exports.mSendMint = '0xda097d57ae887fbd002fb5847dd0ab47ae7e1b183fd36832a51182c52257e1bc::msend_series_1::MSEND_SERIES_1';
|
23
|
+
exports.mSendCoinType = `0x2::coin::Coin<${exports.mSendMint}>`;
|
23
24
|
exports.suilendPointsType = '34fe4f3c9e450fed4d0a3c587ed842eec5313c30c3cc3c0841247c49425e246b::suilend_point::SUILEND_POINT';
|
24
25
|
exports.packageId = '0xf95b06141ed4a174f239417323bde3f209b972f5930d8521ea38a52aff3a6ddf';
|
25
26
|
exports.obligationType = `${exports.packageId}::obligation::Obligation`;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/suilend/constants.ts"],"names":[],"mappings":";;;AAGa,QAAA,UAAU,GAAG,SAAS,CAAC;AACvB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,gDAAgD;IACvD,WAAW,EAAE,SAAS,EAAE,sCAAsC;IAC9D,OAAO,EAAE,yBAAyB;IAClC,OAAO,EAAE,qCAAqC;CAC/C,CAAC;AAEW,QAAA,cAAc,GAAmB;IAC5C,SAAS,EAAE,yBAAyB;IACpC,WAAW,EAAE,oBAAoB;IACjC,WAAW,EAAE,SAAS;IACtB,EAAE,EAAE,iBAAiB;IACrB,KAAK,EAAE,gDAAgD;IACvD,QAAQ,EAAE,
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/suilend/constants.ts"],"names":[],"mappings":";;;AAGa,QAAA,UAAU,GAAG,SAAS,CAAC;AACvB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,gDAAgD;IACvD,WAAW,EAAE,SAAS,EAAE,sCAAsC;IAC9D,OAAO,EAAE,yBAAyB;IAClC,OAAO,EAAE,qCAAqC;CAC/C,CAAC;AAEW,QAAA,cAAc,GAAmB;IAC5C,SAAS,EAAE,yBAAyB;IACpC,WAAW,EAAE,oBAAoB;IACjC,WAAW,EAAE,SAAS;IACtB,EAAE,EAAE,iBAAiB;IACrB,KAAK,EAAE,gDAAgD;IACvD,QAAQ,EAAE,aAAa;IACvB,UAAU,EAAE,aAAa;CAC1B,CAAC;AAEW,QAAA,SAAS,GACpB,oGAAoG,CAAC;AAC1F,QAAA,aAAa,GAAG,mBAAmB,iBAAS,GAAG,CAAC;AAChD,QAAA,iBAAiB,GAC5B,gGAAgG,CAAC;AACtF,QAAA,SAAS,GACpB,oEAAoE,CAAC;AAE1D,QAAA,cAAc,GAAG,GAAG,iBAAS,0BAA0B,CAAC;AACxD,QAAA,UAAU,GACrB,oEAAoE,CAAC;AAC1D,QAAA,eAAe,GAC1B,oEAAoE,CAAC;AAE1D,QAAA,sBAAsB,GAAG,GAAG,iBAAS,wCAAwC,iBAAS,EAAE,CAAC;AACzF,QAAA,QAAQ,GAAG,WAAW,CAAC;AACvB,QAAA,UAAU,GAAG,SAAS,CAAC"}
|
@@ -9,7 +9,8 @@ const obligationsFetcher_1 = __importDefault(require("./obligationsFetcher"));
|
|
9
9
|
const marketsJob_1 = __importDefault(require("./marketsJob"));
|
10
10
|
const airdropFetcher_1 = require("./airdropFetcher");
|
11
11
|
Object.defineProperty(exports, "airdropFetcher", { enumerable: true, get: function () { return airdropFetcher_1.airdropFetcher; } });
|
12
|
+
const burnEventsJob_1 = __importDefault(require("./burnEventsJob"));
|
12
13
|
exports.platforms = [constants_1.platform];
|
13
|
-
exports.jobs = [marketsJob_1.default];
|
14
|
+
exports.jobs = [marketsJob_1.default, burnEventsJob_1.default];
|
14
15
|
exports.fetchers = [obligationsFetcher_1.default];
|
15
16
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/suilend/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAAuC;AACvC,8EAAsD;AACtD,8DAAsC;AACtC,qDAAkD;
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/suilend/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAAuC;AACvC,8EAAsD;AACtD,8DAAsC;AACtC,qDAAkD;AAMzC,+FANA,+BAAc,OAMA;AALvB,oEAA2C;AAE9B,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC;AACnC,QAAA,IAAI,GAAU,CAAC,oBAAU,EAAE,uBAAY,CAAC,CAAC;AACzC,QAAA,QAAQ,GAAc,CAAC,4BAAkB,CAAC,CAAC"}
|
@@ -143,3 +143,26 @@ export type SuilendCapsule = {
|
|
143
143
|
id: ID;
|
144
144
|
rarity: 'rare' | 'common' | 'uncommon';
|
145
145
|
};
|
146
|
+
export type BurnEvents = {
|
147
|
+
pointsRecord: Record<string, number>;
|
148
|
+
capsuleRecord: Record<string, number>;
|
149
|
+
};
|
150
|
+
export type BurnEvent = {
|
151
|
+
id: EventId;
|
152
|
+
packageId: string;
|
153
|
+
transactionModule: string;
|
154
|
+
sender: string;
|
155
|
+
type: string;
|
156
|
+
parsedJson: BurnEventJSON;
|
157
|
+
bcs: string;
|
158
|
+
};
|
159
|
+
export type EventId = {
|
160
|
+
txDigest: string;
|
161
|
+
eventSeq: string;
|
162
|
+
};
|
163
|
+
export type BurnEventJSON = {
|
164
|
+
claim_amount: string;
|
165
|
+
manager_id: string;
|
166
|
+
points_burned?: string;
|
167
|
+
rarity?: string;
|
168
|
+
};
|
@@ -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;
|
@@ -42,20 +42,20 @@ const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/token
|
|
42
42
|
const clients_1 = require("../../utils/clients");
|
43
43
|
const getMultipleAccountsInfoSafe_1 = require("../../utils/solana/getMultipleAccountsInfoSafe");
|
44
44
|
const helpers_1 = require("./helpers");
|
45
|
-
const query = (0, graphql_request_1.gql) `
|
46
|
-
query GetAirdropFinalFrontend($authority: String!) {
|
47
|
-
getAirdropFinalFrontend(authority: $authority) {
|
48
|
-
authority
|
49
|
-
community_allocation
|
50
|
-
eligibility
|
51
|
-
main_allocation
|
52
|
-
og_allocation
|
53
|
-
s1_allocation
|
54
|
-
s2_allocation
|
55
|
-
total_allocation
|
56
|
-
__typename
|
57
|
-
}
|
58
|
-
}
|
45
|
+
const query = (0, graphql_request_1.gql) `
|
46
|
+
query GetAirdropFinalFrontend($authority: String!) {
|
47
|
+
getAirdropFinalFrontend(authority: $authority) {
|
48
|
+
authority
|
49
|
+
community_allocation
|
50
|
+
eligibility
|
51
|
+
main_allocation
|
52
|
+
og_allocation
|
53
|
+
s1_allocation
|
54
|
+
s2_allocation
|
55
|
+
total_allocation
|
56
|
+
__typename
|
57
|
+
}
|
58
|
+
}
|
59
59
|
`;
|
60
60
|
const networkId = portfolio_core_1.NetworkId.solana;
|
61
61
|
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
@@ -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;
|