@sonarwatch/portfolio-plugins 0.8.106 → 0.8.107
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 +5 -1
- package/package.json +2 -2
- package/src/index.js +4 -0
- package/src/index.js.map +1 -1
- package/src/plugins/balancer/helpers/pools.js +21 -21
- package/src/plugins/lifinity/constants.d.ts +10 -0
- package/src/plugins/lifinity/constants.js +20 -0
- package/src/plugins/lifinity/constants.js.map +1 -0
- package/src/plugins/lifinity/filters.d.ts +2 -0
- package/src/plugins/lifinity/filters.js +15 -0
- package/src/plugins/lifinity/filters.js.map +1 -0
- package/src/plugins/lifinity/index.d.ts +6 -0
- package/src/plugins/lifinity/index.js +12 -0
- package/src/plugins/lifinity/index.js.map +1 -0
- package/src/plugins/lifinity/lockerFetcher.d.ts +3 -0
- package/src/plugins/lifinity/lockerFetcher.js +54 -0
- package/src/plugins/lifinity/lockerFetcher.js.map +1 -0
- package/src/plugins/lifinity/structs.d.ts +30 -0
- package/src/plugins/lifinity/structs.js +31 -0
- package/src/plugins/lifinity/structs.js.map +1 -0
- package/src/plugins/sushiswap/helpers.js +24 -24
- package/src/plugins/uniswap-v2/helpers.js +22 -22
- package/src/utils/solana/constants.d.ts +1 -0
- package/src/utils/solana/constants.js +2 -1
- package/src/utils/solana/constants.js.map +1 -1
package/CHANGELOG.md
CHANGED
@@ -2,10 +2,14 @@
|
|
2
2
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
4
4
|
|
5
|
-
## [0.8.
|
5
|
+
## [0.8.107](https://github.com/sonarwatch/portfolio/compare/plugins-0.8.106...plugins-0.8.107) (2023-11-27)
|
6
6
|
|
7
7
|
|
8
8
|
|
9
|
+
## [0.8.106](https://github.com/sonarwatch/portfolio/compare/plugins-0.8.105...plugins-0.8.106) (2023-11-27)
|
10
|
+
|
11
|
+
|
12
|
+
|
9
13
|
## [0.8.105](https://github.com/sonarwatch/portfolio/compare/plugins-0.8.104...plugins-0.8.105) (2023-11-27)
|
10
14
|
|
11
15
|
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@sonarwatch/portfolio-plugins",
|
3
|
-
"version": "0.8.
|
3
|
+
"version": "0.8.107",
|
4
4
|
"type": "commonjs",
|
5
5
|
"generators": "./generators.json",
|
6
6
|
"dependencies": {
|
@@ -40,7 +40,7 @@
|
|
40
40
|
"web3-v1": "npm:web3@^1.5.0"
|
41
41
|
},
|
42
42
|
"peerDependencies": {
|
43
|
-
"@sonarwatch/portfolio-core": "0.8.
|
43
|
+
"@sonarwatch/portfolio-core": "0.8.107"
|
44
44
|
},
|
45
45
|
"main": "./src/index.js",
|
46
46
|
"types": "./src/index.d.ts"
|
package/src/index.js
CHANGED
@@ -73,6 +73,7 @@ const yearn_1 = require("./plugins/yearn");
|
|
73
73
|
const atrix_1 = require("./plugins/atrix");
|
74
74
|
const _01_1 = require("./plugins/01");
|
75
75
|
const goosefx_1 = require("./plugins/goosefx");
|
76
|
+
const lifinity_1 = require("./plugins/lifinity");
|
76
77
|
var constants_1 = require("./plugins/tokens/constants");
|
77
78
|
Object.defineProperty(exports, "walletTokensPlatform", { enumerable: true, get: function () { return constants_1.walletTokensPlatform; } });
|
78
79
|
Object.defineProperty(exports, "walletNftsPlatform", { enumerable: true, get: function () { return constants_1.walletNftsPlatform; } });
|
@@ -135,6 +136,7 @@ exports.platforms = [
|
|
135
136
|
...atrix_1.platforms,
|
136
137
|
..._01_1.platforms,
|
137
138
|
...goosefx_1.platforms,
|
139
|
+
...lifinity_1.platforms,
|
138
140
|
];
|
139
141
|
// JOBS //
|
140
142
|
exports.jobs = [
|
@@ -184,6 +186,7 @@ exports.jobs = [
|
|
184
186
|
...atrix_1.jobs,
|
185
187
|
..._01_1.jobs,
|
186
188
|
...goosefx_1.jobs,
|
189
|
+
...lifinity_1.jobs,
|
187
190
|
];
|
188
191
|
// FETCHERS //
|
189
192
|
exports.fetchers = [
|
@@ -234,6 +237,7 @@ exports.fetchers = [
|
|
234
237
|
...atrix_1.fetchers,
|
235
238
|
..._01_1.fetchers,
|
236
239
|
...goosefx_1.fetchers,
|
240
|
+
...lifinity_1.fetchers,
|
237
241
|
];
|
238
242
|
exports.fetchersByAddressSystem = (0, getFetchersByAddressSystem_1.getFetchersByAddressSystem)(exports.fetchers);
|
239
243
|
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/plugins/src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAGA,wFAAqF;AACrF,sEAA8C;AAC9C,6CAI0B;AAC1B,yDAIgC;AAChC,iDAG4B;AAC5B,iDAI4B;AAC5B,2CAGyB;AACzB,6CAI0B;AAC1B,+CAI2B;AAC3B,yCAIwB;AACxB,+CAG2B;AAC3B,2CAIyB;AACzB,6CAI0B;AAC1B,2CAIyB;AACzB,6CAG0B;AAC1B,6CAI0B;AAC1B,yCAIwB;AACxB,2DAGiC;AACjC,6CAI0B;AAC1B,2CAIyB;AACzB,2CAIyB;AACzB,qDAA6D;AAC7D,qEAIsC;AACtC,uDAI+B;AAC/B,mDAG6B;AAC7B,qDAG8B;AAC9B,uDAG+B;AAC/B,2CAIyB;AACzB,6CAI0B;AAC1B,6CAG0B;AAC1B,yCAIwB;AACxB,+CAI2B;AAC3B,uDAG+B;AAC/B,yCAGwB;AACxB,2CAIyB;AACzB,iDAI4B;AAC5B,iDAI4B;AAC5B,6CAI0B;AAC1B,+CAI2B;AAC3B,qDAG8B;AAC9B,iDAI4B;AAC5B,iDAI4B;AAC5B,mDAG6B;AAC7B,6CAI0B;AAC1B,2CAIyB;AACzB,iDAI4B;AAC5B,iDAI4B;AAC5B,+CAG2B;AAC3B,yCAIwB;AACxB,2CAIyB;AACzB,mDAI6B;AAC7B,2CAIyB;AACzB,2CAIyB;AACzB,sCAIsB;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,iBAAc;IACjB,GAAG,qBAAiB;IACpB,GAAG,kBAAe;IAClB,GAAG,mBAAgB;IACnB,GAAG,mBAAgB;IACnB,GAAG,oBAAiB;IACpB,GAAG,iBAAc;IACjB,GAAG,gBAAa;IAChB,GAAG,mBAAgB;IACnB,GAAG,mBAAgB;IACnB,GAAG,kBAAe;IAClB,GAAG,eAAY;IACf,GAAG,gBAAa;IAChB,GAAG,oBAAiB;IACpB,GAAG,gBAAa;IAChB,GAAG,gBAAa;IAChB,GAAG,cAAe;IAClB,GAAG,kBAAe;IAClB,GAAG,mBAAgB;CACpB,CAAC;AACW,QAAA,uBAAuB,GAAG,IAAA,uDAA0B,EAAC,gBAAQ,CAAC,CAAC"}
|
@@ -36,27 +36,27 @@ exports.getBalancerPoolsV2 = void 0;
|
|
36
36
|
const graphql_request_1 = __importStar(require("graphql-request"));
|
37
37
|
function getBalancerPoolsV2(url) {
|
38
38
|
return __awaiter(this, void 0, void 0, function* () {
|
39
|
-
const query = (0, graphql_request_1.gql) `
|
40
|
-
query pools {
|
41
|
-
pools(
|
42
|
-
first: 1000
|
43
|
-
orderBy: totalLiquidity
|
44
|
-
orderDirection: desc
|
45
|
-
where: { totalLiquidity_gt: "500" }
|
46
|
-
) {
|
47
|
-
id
|
48
|
-
address
|
49
|
-
symbol
|
50
|
-
totalLiquidity
|
51
|
-
totalShares
|
52
|
-
tokens {
|
53
|
-
balance
|
54
|
-
decimals
|
55
|
-
symbol
|
56
|
-
address
|
57
|
-
}
|
58
|
-
}
|
59
|
-
}
|
39
|
+
const query = (0, graphql_request_1.gql) `
|
40
|
+
query pools {
|
41
|
+
pools(
|
42
|
+
first: 1000
|
43
|
+
orderBy: totalLiquidity
|
44
|
+
orderDirection: desc
|
45
|
+
where: { totalLiquidity_gt: "500" }
|
46
|
+
) {
|
47
|
+
id
|
48
|
+
address
|
49
|
+
symbol
|
50
|
+
totalLiquidity
|
51
|
+
totalShares
|
52
|
+
tokens {
|
53
|
+
balance
|
54
|
+
decimals
|
55
|
+
symbol
|
56
|
+
address
|
57
|
+
}
|
58
|
+
}
|
59
|
+
}
|
60
60
|
`;
|
61
61
|
const res = yield (0, graphql_request_1.default)(url, query);
|
62
62
|
const pools = res.pools;
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import { PublicKey } from '@solana/web3.js';
|
2
|
+
import { Platform } from '@sonarwatch/portfolio-core';
|
3
|
+
export declare const platformId = "lifinity";
|
4
|
+
export declare const platform: Platform;
|
5
|
+
export declare const SmartWalletProgramId: PublicKey;
|
6
|
+
export declare const GovernProgramId: PublicKey;
|
7
|
+
export declare const LifinityLockerProgramId: PublicKey;
|
8
|
+
export declare const rewarder: PublicKey;
|
9
|
+
export declare const veDecimals = 6;
|
10
|
+
export declare const lfntyMint = "LFNTYraetVioAPnGJht4yNg2aUZFXR776cMeN9VMjXp";
|
@@ -0,0 +1,20 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.lfntyMint = exports.veDecimals = exports.rewarder = exports.LifinityLockerProgramId = exports.GovernProgramId = exports.SmartWalletProgramId = exports.platform = exports.platformId = void 0;
|
4
|
+
const web3_js_1 = require("@solana/web3.js");
|
5
|
+
exports.platformId = 'lifinity';
|
6
|
+
exports.platform = {
|
7
|
+
id: exports.platformId,
|
8
|
+
name: 'Lifinity',
|
9
|
+
image: 'https://sonar.watch/img/platforms/lifinity.png',
|
10
|
+
// defiLlamaId: 'foo-finance', // from https://defillama.com/docs/api
|
11
|
+
// website: 'https://myplatform.com',
|
12
|
+
// twitter: 'https://twitter.com/myplatform',
|
13
|
+
};
|
14
|
+
exports.SmartWalletProgramId = new web3_js_1.PublicKey('GokivDYuQXPZCWRkwMhdH2h91KpDQXBEmpgBgs55bnpH');
|
15
|
+
exports.GovernProgramId = new web3_js_1.PublicKey('Govz1VyoyLD5BL6CSCxUJLVLsQHRwjfFj1prNsdNg5Jw');
|
16
|
+
exports.LifinityLockerProgramId = new web3_js_1.PublicKey('LLoc8JX5dLAMVzbzTNKG6EFpkyJ9XCsVAGkqwQKUJoa');
|
17
|
+
exports.rewarder = new web3_js_1.PublicKey('LRewdYDnxyP9HXCL6DQYgTaeL9FKb5Pc8Gr4UbVrtnj');
|
18
|
+
exports.veDecimals = 6;
|
19
|
+
exports.lfntyMint = 'LFNTYraetVioAPnGJht4yNg2aUZFXR776cMeN9VMjXp';
|
20
|
+
//# sourceMappingURL=constants.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/lifinity/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAG/B,QAAA,UAAU,GAAG,UAAU,CAAC;AACxB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,gDAAgD;IACvD,qEAAqE;IACrE,qCAAqC;IACrC,6CAA6C;CAC9C,CAAC;AAEW,QAAA,oBAAoB,GAAG,IAAI,mBAAS,CAC/C,8CAA8C,CAC/C,CAAC;AACW,QAAA,eAAe,GAAG,IAAI,mBAAS,CAC1C,8CAA8C,CAC/C,CAAC;AACW,QAAA,uBAAuB,GAAG,IAAI,mBAAS,CAClD,6CAA6C,CAC9C,CAAC;AAEW,QAAA,QAAQ,GAAG,IAAI,mBAAS,CACnC,6CAA6C,CAC9C,CAAC;AAEW,QAAA,UAAU,GAAG,CAAC,CAAC;AACf,QAAA,SAAS,GAAG,6CAA6C,CAAC"}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.escrowFilter = void 0;
|
4
|
+
const structs_1 = require("./structs");
|
5
|
+
const escrowFilter = (owner) => [
|
6
|
+
{
|
7
|
+
memcmp: {
|
8
|
+
offset: 40,
|
9
|
+
bytes: owner,
|
10
|
+
},
|
11
|
+
},
|
12
|
+
{ dataSize: structs_1.escrowStruct.byteSize },
|
13
|
+
];
|
14
|
+
exports.escrowFilter = escrowFilter;
|
15
|
+
//# sourceMappingURL=filters.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"filters.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/lifinity/filters.ts"],"names":[],"mappings":";;;AACA,uCAAyC;AAElC,MAAM,YAAY,GAAG,CAAC,KAAa,EAA8B,EAAE,CAAC;IACzE;QACE,MAAM,EAAE;YACN,MAAM,EAAE,EAAE;YACV,KAAK,EAAE,KAAK;SACb;KACF;IACD,EAAE,QAAQ,EAAE,sBAAY,CAAC,QAAQ,EAAE;CACpC,CAAC;AARW,QAAA,YAAY,gBAQvB"}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
exports.fetchers = exports.jobs = exports.platforms = void 0;
|
7
|
+
const constants_1 = require("./constants");
|
8
|
+
const lockerFetcher_1 = __importDefault(require("./lockerFetcher"));
|
9
|
+
exports.platforms = [constants_1.platform];
|
10
|
+
exports.jobs = [];
|
11
|
+
exports.fetchers = [lockerFetcher_1.default];
|
12
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/lifinity/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAAuC;AACvC,oEAA4C;AAE/B,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC;AACnC,QAAA,IAAI,GAAU,EAAE,CAAC;AACjB,QAAA,QAAQ,GAAc,CAAC,uBAAa,CAAC,CAAC"}
|
@@ -0,0 +1,54 @@
|
|
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 constants_1 = require("./constants");
|
18
|
+
const clients_1 = require("../../utils/clients");
|
19
|
+
const solana_1 = require("../../utils/solana");
|
20
|
+
const structs_1 = require("./structs");
|
21
|
+
const filters_1 = require("./filters");
|
22
|
+
const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
|
23
|
+
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
24
|
+
const client = (0, clients_1.getClientSolana)();
|
25
|
+
const accounts = yield (0, solana_1.getParsedProgramAccounts)(client, structs_1.escrowStruct, constants_1.LifinityLockerProgramId, (0, filters_1.escrowFilter)(owner));
|
26
|
+
if (accounts.length === 0)
|
27
|
+
return [];
|
28
|
+
let amount = new bignumber_js_1.default(0);
|
29
|
+
for (const account of accounts) {
|
30
|
+
amount = amount.plus(account.amount);
|
31
|
+
}
|
32
|
+
if (amount.isZero())
|
33
|
+
return [];
|
34
|
+
const lfntyTokenPrice = yield cache.getTokenPrice(constants_1.lfntyMint, portfolio_core_1.NetworkId.solana);
|
35
|
+
const asset = (0, tokenPriceToAssetToken_1.default)(constants_1.lfntyMint, amount.dividedBy(Math.pow(10, constants_1.veDecimals)).toNumber(), portfolio_core_1.NetworkId.solana, lfntyTokenPrice);
|
36
|
+
return [
|
37
|
+
{
|
38
|
+
label: 'Staked',
|
39
|
+
type: portfolio_core_1.PortfolioElementType.single,
|
40
|
+
data: { asset },
|
41
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
42
|
+
platformId: constants_1.platformId,
|
43
|
+
value: asset.value,
|
44
|
+
name: 'veLFNTY',
|
45
|
+
},
|
46
|
+
];
|
47
|
+
});
|
48
|
+
const fetcher = {
|
49
|
+
id: `${constants_1.platformId}-locker`,
|
50
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
51
|
+
executor,
|
52
|
+
};
|
53
|
+
exports.default = fetcher;
|
54
|
+
//# sourceMappingURL=lockerFetcher.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"lockerFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/lifinity/lockerFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAA6E;AAC7E,gEAAqC;AAGrC,2CAKqB;AACrB,iDAAsD;AACtD,+CAA8D;AAC9D,uCAAyC;AACzC,uCAAyC;AACzC,qGAA6E;AAE7E,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,MAAM,QAAQ,GAAG,MAAM,IAAA,iCAAwB,EAC7C,MAAM,EACN,sBAAY,EACZ,mCAAuB,EACvB,IAAA,sBAAY,EAAC,KAAK,CAAC,CACpB,CAAC;IACF,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAErC,IAAI,MAAM,GAAG,IAAI,sBAAS,CAAC,CAAC,CAAC,CAAC;IAC9B,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE;QAC9B,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;KACtC;IAED,IAAI,MAAM,CAAC,MAAM,EAAE;QAAE,OAAO,EAAE,CAAC;IAE/B,MAAM,eAAe,GAAG,MAAM,KAAK,CAAC,aAAa,CAC/C,qBAAS,EACT,0BAAS,CAAC,MAAM,CACjB,CAAC;IAEF,MAAM,KAAK,GAAG,IAAA,gCAAsB,EAClC,qBAAS,EACT,MAAM,CAAC,SAAS,CAAC,SAAA,EAAE,EAAI,sBAAU,CAAA,CAAC,CAAC,QAAQ,EAAE,EAC7C,0BAAS,CAAC,MAAM,EAChB,eAAe,CAChB,CAAC;IACF,OAAO;QACL;YACE,KAAK,EAAE,QAAQ;YACf,IAAI,EAAE,qCAAoB,CAAC,MAAM;YACjC,IAAI,EAAE,EAAE,KAAK,EAAE;YACf,SAAS,EAAE,0BAAS,CAAC,MAAM;YAC3B,UAAU,EAAV,sBAAU;YACV,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,IAAI,EAAE,SAAS;SAChB;KACF,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,SAAS;IAC1B,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
/// <reference types="node" />
|
2
|
+
import { BeetStruct } from '@metaplex-foundation/beet';
|
3
|
+
import { PublicKey } from '@metaplex-foundation/js';
|
4
|
+
import BigNumber from 'bignumber.js';
|
5
|
+
export type Locker = {
|
6
|
+
buffer: Buffer;
|
7
|
+
locker: PublicKey;
|
8
|
+
escrow: PublicKey;
|
9
|
+
vault: PublicKey;
|
10
|
+
escrowOwner: PublicKey;
|
11
|
+
sourceAuthority: PublicKey;
|
12
|
+
sourceTokens: PublicKey;
|
13
|
+
tokenProgram: PublicKey;
|
14
|
+
};
|
15
|
+
export declare const lockerStruct: BeetStruct<Locker, Partial<Locker>>;
|
16
|
+
export type Escrow = {
|
17
|
+
buffer: Buffer;
|
18
|
+
locker: PublicKey;
|
19
|
+
owner: PublicKey;
|
20
|
+
bump: number;
|
21
|
+
amount: BigNumber;
|
22
|
+
escrow_started_at: BigNumber;
|
23
|
+
escrow_ends_at: BigNumber;
|
24
|
+
initial_amount: BigNumber;
|
25
|
+
duration: BigNumber;
|
26
|
+
vote_delegate: PublicKey;
|
27
|
+
reserved1: number[];
|
28
|
+
reserved2: number[];
|
29
|
+
};
|
30
|
+
export declare const escrowStruct: BeetStruct<Escrow, Partial<Escrow>>;
|
@@ -0,0 +1,31 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.escrowStruct = exports.lockerStruct = void 0;
|
4
|
+
const beet_1 = require("@metaplex-foundation/beet");
|
5
|
+
const beet_solana_1 = require("@metaplex-foundation/beet-solana");
|
6
|
+
const solana_1 = require("../../utils/solana");
|
7
|
+
exports.lockerStruct = new beet_1.BeetStruct([
|
8
|
+
['buffer', (0, solana_1.blob)(8)],
|
9
|
+
['locker', beet_solana_1.publicKey],
|
10
|
+
['escrow', beet_solana_1.publicKey],
|
11
|
+
['vault', beet_solana_1.publicKey],
|
12
|
+
['escrowOwner', beet_solana_1.publicKey],
|
13
|
+
['sourceAuthority', beet_solana_1.publicKey],
|
14
|
+
['sourceTokens', beet_solana_1.publicKey],
|
15
|
+
['tokenProgram', beet_solana_1.publicKey],
|
16
|
+
], (args) => args);
|
17
|
+
exports.escrowStruct = new beet_1.BeetStruct([
|
18
|
+
['buffer', (0, solana_1.blob)(8)],
|
19
|
+
['locker', beet_solana_1.publicKey],
|
20
|
+
['owner', beet_solana_1.publicKey],
|
21
|
+
['bump', beet_1.u8],
|
22
|
+
['amount', solana_1.u64],
|
23
|
+
['escrow_started_at', solana_1.i64],
|
24
|
+
['escrow_ends_at', solana_1.i64],
|
25
|
+
['initial_amount', solana_1.i64],
|
26
|
+
['duration', solana_1.i64],
|
27
|
+
['vote_delegate', beet_solana_1.publicKey],
|
28
|
+
['reserved1', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 15)],
|
29
|
+
['reserved2', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 32)],
|
30
|
+
], (args) => args);
|
31
|
+
//# sourceMappingURL=structs.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"structs.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/lifinity/structs.ts"],"names":[],"mappings":";;;AAAA,oDAImC;AACnC,kEAA6D;AAG7D,+CAAoD;AAavC,QAAA,YAAY,GAAG,IAAI,iBAAU,CACxC;IACE,CAAC,QAAQ,EAAE,IAAA,aAAI,EAAC,CAAC,CAAC,CAAC;IACnB,CAAC,QAAQ,EAAE,uBAAS,CAAC;IACrB,CAAC,QAAQ,EAAE,uBAAS,CAAC;IACrB,CAAC,OAAO,EAAE,uBAAS,CAAC;IACpB,CAAC,aAAa,EAAE,uBAAS,CAAC;IAC1B,CAAC,iBAAiB,EAAE,uBAAS,CAAC;IAC9B,CAAC,cAAc,EAAE,uBAAS,CAAC;IAC3B,CAAC,cAAc,EAAE,uBAAS,CAAC;CAC5B,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAc,CACzB,CAAC;AAiBW,QAAA,YAAY,GAAG,IAAI,iBAAU,CACxC;IACE,CAAC,QAAQ,EAAE,IAAA,aAAI,EAAC,CAAC,CAAC,CAAC;IACnB,CAAC,QAAQ,EAAE,uBAAS,CAAC;IACrB,CAAC,OAAO,EAAE,uBAAS,CAAC;IACpB,CAAC,MAAM,EAAE,SAAE,CAAC;IACZ,CAAC,QAAQ,EAAE,YAAG,CAAC;IACf,CAAC,mBAAmB,EAAE,YAAG,CAAC;IAC1B,CAAC,gBAAgB,EAAE,YAAG,CAAC;IACvB,CAAC,gBAAgB,EAAE,YAAG,CAAC;IACvB,CAAC,UAAU,EAAE,YAAG,CAAC;IACjB,CAAC,eAAe,EAAE,uBAAS,CAAC;IAC5B,CAAC,WAAW,EAAE,IAAA,4BAAqB,EAAC,SAAE,EAAE,EAAE,CAAC,CAAC;IAC5C,CAAC,WAAW,EAAE,IAAA,4BAAqB,EAAC,SAAE,EAAE,EAAE,CAAC,CAAC;CAC7C,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAc,CACzB,CAAC"}
|
@@ -54,30 +54,30 @@ function sushiV3PairToUniV2(pair) {
|
|
54
54
|
}
|
55
55
|
function getV3PairsAddresses(url, length = 300) {
|
56
56
|
return __awaiter(this, void 0, void 0, function* () {
|
57
|
-
const query = (0, graphql_request_1.gql) `
|
58
|
-
{
|
59
|
-
pools(
|
60
|
-
orderBy: totalValueLockedUSD
|
61
|
-
first: ${length}
|
62
|
-
orderDirection: desc
|
63
|
-
where: { volumeUSD_not: "0", liquidity_not: "0" }
|
64
|
-
) {
|
65
|
-
id
|
66
|
-
token0Price
|
67
|
-
token1Price
|
68
|
-
liquidity
|
69
|
-
token0 {
|
70
|
-
id
|
71
|
-
totalSupply
|
72
|
-
decimals
|
73
|
-
}
|
74
|
-
token1 {
|
75
|
-
id
|
76
|
-
totalSupply
|
77
|
-
decimals
|
78
|
-
}
|
79
|
-
}
|
80
|
-
}
|
57
|
+
const query = (0, graphql_request_1.gql) `
|
58
|
+
{
|
59
|
+
pools(
|
60
|
+
orderBy: totalValueLockedUSD
|
61
|
+
first: ${length}
|
62
|
+
orderDirection: desc
|
63
|
+
where: { volumeUSD_not: "0", liquidity_not: "0" }
|
64
|
+
) {
|
65
|
+
id
|
66
|
+
token0Price
|
67
|
+
token1Price
|
68
|
+
liquidity
|
69
|
+
token0 {
|
70
|
+
id
|
71
|
+
totalSupply
|
72
|
+
decimals
|
73
|
+
}
|
74
|
+
token1 {
|
75
|
+
id
|
76
|
+
totalSupply
|
77
|
+
decimals
|
78
|
+
}
|
79
|
+
}
|
80
|
+
}
|
81
81
|
`;
|
82
82
|
const res = yield (0, graphql_request_1.default)(url, query);
|
83
83
|
const pools = res.pools;
|
@@ -40,28 +40,28 @@ function getPairKey(version) {
|
|
40
40
|
exports.getPairKey = getPairKey;
|
41
41
|
function getPairsV2FromTheGraph(url, length = 300) {
|
42
42
|
return __awaiter(this, void 0, void 0, function* () {
|
43
|
-
const query = (0, graphql_request_1.gql) `
|
44
|
-
{
|
45
|
-
pairs(
|
46
|
-
orderBy: reserveUSD
|
47
|
-
first: ${length}
|
48
|
-
orderDirection: desc
|
49
|
-
where: { trackedReserveETH_not: "0" }
|
50
|
-
) {
|
51
|
-
id
|
52
|
-
reserve0
|
53
|
-
reserve1
|
54
|
-
totalSupply
|
55
|
-
token0 {
|
56
|
-
id
|
57
|
-
decimals
|
58
|
-
}
|
59
|
-
token1 {
|
60
|
-
id
|
61
|
-
decimals
|
62
|
-
}
|
63
|
-
}
|
64
|
-
}
|
43
|
+
const query = (0, graphql_request_1.gql) `
|
44
|
+
{
|
45
|
+
pairs(
|
46
|
+
orderBy: reserveUSD
|
47
|
+
first: ${length}
|
48
|
+
orderDirection: desc
|
49
|
+
where: { trackedReserveETH_not: "0" }
|
50
|
+
) {
|
51
|
+
id
|
52
|
+
reserve0
|
53
|
+
reserve1
|
54
|
+
totalSupply
|
55
|
+
token0 {
|
56
|
+
id
|
57
|
+
decimals
|
58
|
+
}
|
59
|
+
token1 {
|
60
|
+
id
|
61
|
+
decimals
|
62
|
+
}
|
63
|
+
}
|
64
|
+
}
|
65
65
|
`;
|
66
66
|
const res = yield (0, graphql_request_1.default)(url, query);
|
67
67
|
const pairs = res.pairs;
|
@@ -1,7 +1,8 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.solanaToken2022Pid = exports.solanaTokenPid = void 0;
|
3
|
+
exports.associatedTokenProgramId = exports.solanaToken2022Pid = exports.solanaTokenPid = void 0;
|
4
4
|
const web3_js_1 = require("@solana/web3.js");
|
5
5
|
exports.solanaTokenPid = new web3_js_1.PublicKey('TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA');
|
6
6
|
exports.solanaToken2022Pid = new web3_js_1.PublicKey('TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb');
|
7
|
+
exports.associatedTokenProgramId = new web3_js_1.PublicKey('ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL');
|
7
8
|
//# sourceMappingURL=constants.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/solana/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAE/B,QAAA,cAAc,GAAG,IAAI,mBAAS,CACzC,6CAA6C,CAC9C,CAAC;AACW,QAAA,kBAAkB,GAAG,IAAI,mBAAS,CAC7C,6CAA6C,CAC9C,CAAC"}
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/solana/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAE/B,QAAA,cAAc,GAAG,IAAI,mBAAS,CACzC,6CAA6C,CAC9C,CAAC;AACW,QAAA,kBAAkB,GAAG,IAAI,mBAAS,CAC7C,6CAA6C,CAC9C,CAAC;AAEW,QAAA,wBAAwB,GAAG,IAAI,mBAAS,CACnD,8CAA8C,CAC/C,CAAC"}
|