@sonarwatch/portfolio-plugins 0.1.1 → 0.2.1
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 +12 -0
- package/package.json +3 -2
- package/src/generators/fetcher/generator.d.ts +4 -0
- package/src/generators/fetcher/generator.js +31 -0
- package/src/generators/fetcher/generator.js.map +1 -0
- package/src/generators/helpers.d.ts +1 -0
- package/src/generators/helpers.js +13 -0
- package/src/generators/helpers.js.map +1 -0
- package/src/generators/job/generator.d.ts +4 -0
- package/src/generators/job/generator.js +27 -0
- package/src/generators/job/generator.js.map +1 -0
- package/src/generators/plugin/generator.js +5 -12
- package/src/generators/plugin/generator.js.map +1 -1
- package/src/index.d.ts +2 -0
- package/src/index.js +11 -10
- package/src/index.js.map +1 -1
- package/src/platforms.d.ts +7 -0
- package/src/platforms.js +34 -0
- package/src/platforms.js.map +1 -0
- package/src/plugins/foo/ammJob.d.ts +3 -0
- package/src/plugins/foo/ammJob.js +17 -0
- package/src/plugins/foo/ammJob.js.map +1 -0
- package/src/plugins/foo/constants.d.ts +2 -0
- package/src/plugins/foo/constants.js +6 -0
- package/src/plugins/foo/constants.js.map +1 -0
- package/src/plugins/foo/index.js +9 -0
- package/src/plugins/foo/index.js.map +1 -0
- package/src/plugins/foo/positionFetcher.d.ts +3 -0
- package/src/plugins/foo/positionFetcher.js +38 -0
- package/src/plugins/foo/positionFetcher.js.map +1 -0
- package/src/plugins/marginfi/constants.d.ts +2 -2
- package/src/plugins/marginfi/constants.js +4 -3
- package/src/plugins/marginfi/constants.js.map +1 -1
- package/src/plugins/marginfi/fetcherExecutor.js +6 -7
- package/src/plugins/marginfi/fetcherExecutor.js.map +1 -1
- package/src/plugins/marginfi/jobExecutor.js +3 -4
- package/src/plugins/marginfi/jobExecutor.js.map +1 -1
- package/src/plugins/marinade/constants.d.ts +1 -1
- package/src/plugins/marinade/constants.js +2 -1
- package/src/plugins/marinade/constants.js.map +1 -1
- package/src/plugins/marinade/index.d.ts +1 -2
- package/src/plugins/marinade/index.js +3 -17
- package/src/plugins/marinade/index.js.map +1 -1
- package/src/plugins/marinade/ticketsFetcher.d.ts +3 -0
- package/src/plugins/marinade/{fetcherExecutor.js → ticketsFetcher.js} +10 -6
- package/src/plugins/marinade/ticketsFetcher.js.map +1 -0
- package/src/plugins/tensor/constants.d.ts +4 -0
- package/src/plugins/tensor/constants.js +9 -0
- package/src/plugins/tensor/constants.js.map +1 -0
- package/src/plugins/tensor/fetcherExecutor.js +89 -0
- package/src/plugins/tensor/fetcherExecutor.js.map +1 -0
- package/src/plugins/tensor/filters.d.ts +2 -0
- package/src/plugins/tensor/filters.js +15 -0
- package/src/plugins/tensor/filters.js.map +1 -0
- package/src/plugins/tensor/index.d.ts +2 -0
- package/src/plugins/{raydium → tensor}/index.js +2 -9
- package/src/plugins/tensor/index.js.map +1 -0
- package/src/plugins/tensor/struct.d.ts +13 -0
- package/src/plugins/tensor/struct.js +15 -0
- package/src/plugins/tensor/struct.js.map +1 -0
- package/src/plugins/{wallettokens → wallet-tokens}/constants.d.ts +1 -1
- package/src/plugins/{wallettokens → wallet-tokens}/constants.js +1 -1
- package/src/plugins/wallet-tokens/constants.js.map +1 -0
- package/src/plugins/wallet-tokens/helpers.d.ts +4 -0
- package/src/plugins/{wallettokens → wallet-tokens}/helpers.js +23 -2
- package/src/plugins/wallet-tokens/helpers.js.map +1 -0
- package/src/plugins/wallet-tokens/index.d.ts +2 -0
- package/src/plugins/wallet-tokens/index.js +30 -0
- package/src/plugins/wallet-tokens/index.js.map +1 -0
- package/src/plugins/wallet-tokens/jobExecutorGenerator.d.ts +2 -0
- package/src/plugins/wallet-tokens/jobExecutorGenerator.js +24 -0
- package/src/plugins/wallet-tokens/jobExecutorGenerator.js.map +1 -0
- package/src/plugins/wallet-tokens/types.js.map +1 -0
- package/src/utils/misc/getImagefromUri.d.ts +6 -0
- package/src/utils/misc/getImagefromUri.js +88 -0
- package/src/utils/misc/getImagefromUri.js.map +1 -0
- package/src/utils/misc/getProtocolFromUrl.d.ts +1 -0
- package/src/utils/misc/getProtocolFromUrl.js +12 -0
- package/src/utils/misc/getProtocolFromUrl.js.map +1 -0
- package/src/utils/misc/isHttpUrl.d.ts +1 -0
- package/src/utils/misc/isHttpUrl.js +10 -0
- package/src/utils/misc/isHttpUrl.js.map +1 -0
- package/src/utils/misc/isIpfsUrl.d.ts +1 -0
- package/src/utils/misc/isIpfsUrl.js +9 -0
- package/src/utils/misc/isIpfsUrl.js.map +1 -0
- package/src/utils/misc/runInBatch.d.ts +1 -0
- package/src/utils/misc/runInBatch.js +17 -0
- package/src/utils/misc/runInBatch.js.map +1 -0
- package/src/plugins/marinade/fetcherExecutor.js.map +0 -1
- package/src/plugins/marinade/jobExecutor.d.ts +0 -3
- package/src/plugins/marinade/jobExecutor.js +0 -14
- package/src/plugins/marinade/jobExecutor.js.map +0 -1
- package/src/plugins/raydium/constants.d.ts +0 -2
- package/src/plugins/raydium/constants.js +0 -6
- package/src/plugins/raydium/constants.js.map +0 -1
- package/src/plugins/raydium/fetcherExecutor.d.ts +0 -3
- package/src/plugins/raydium/fetcherExecutor.js +0 -34
- package/src/plugins/raydium/fetcherExecutor.js.map +0 -1
- package/src/plugins/raydium/index.js.map +0 -1
- package/src/plugins/raydium/jobExecutor.d.ts +0 -3
- package/src/plugins/raydium/jobExecutor.js +0 -14
- package/src/plugins/raydium/jobExecutor.js.map +0 -1
- package/src/plugins/wallettokens/constants.js.map +0 -1
- package/src/plugins/wallettokens/helpers.d.ts +0 -3
- package/src/plugins/wallettokens/helpers.js.map +0 -1
- package/src/plugins/wallettokens/index.d.ts +0 -3
- package/src/plugins/wallettokens/index.js +0 -13
- package/src/plugins/wallettokens/index.js.map +0 -1
- package/src/plugins/wallettokens/jobExecutors/solana.d.ts +0 -3
- package/src/plugins/wallettokens/jobExecutors/solana.js +0 -36
- package/src/plugins/wallettokens/jobExecutors/solana.js.map +0 -1
- package/src/plugins/wallettokens/types.js.map +0 -1
- /package/src/plugins/{raydium → foo}/index.d.ts +0 -0
- /package/src/plugins/{marinade → tensor}/fetcherExecutor.d.ts +0 -0
- /package/src/plugins/{wallettokens → wallet-tokens}/types.d.ts +0 -0
- /package/src/plugins/{wallettokens → wallet-tokens}/types.js +0 -0
package/CHANGELOG.md
CHANGED
@@ -2,6 +2,18 @@
|
|
2
2
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
4
4
|
|
5
|
+
## [0.2.1](https://github.com/sonarwatch/portfolio/compare/plugins-0.2.0...plugins-0.2.1) (2023-07-06)
|
6
|
+
|
7
|
+
|
8
|
+
|
9
|
+
# [0.2.0](https://github.com/sonarwatch/portfolio/compare/plugins-0.1.2...plugins-0.2.0) (2023-07-06)
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
## [0.1.2](https://github.com/sonarwatch/portfolio/compare/plugins-0.1.1...plugins-0.1.2) (2023-07-06)
|
14
|
+
|
15
|
+
|
16
|
+
|
5
17
|
## [0.1.1](https://github.com/sonarwatch/portfolio/compare/plugins-0.1.0...plugins-0.1.1) (2023-07-04)
|
6
18
|
|
7
19
|
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@sonarwatch/portfolio-plugins",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.2.1",
|
4
4
|
"type": "commonjs",
|
5
5
|
"generators": "./generators.json",
|
6
6
|
"dependencies": {
|
@@ -8,6 +8,7 @@
|
|
8
8
|
"@ethersproject/bytes": "^5.7.0",
|
9
9
|
"@metaplex-foundation/beet": "^0.7.1",
|
10
10
|
"@metaplex-foundation/beet-solana": "^0.4.0",
|
11
|
+
"@metaplex-foundation/js": "^0.19.4",
|
11
12
|
"@mysten/sui.js": "^0.37.1",
|
12
13
|
"@solana/web3.js": "^1.77.3",
|
13
14
|
"aptos": "^1.12.0",
|
@@ -20,7 +21,7 @@
|
|
20
21
|
"viem": "^1.2.9"
|
21
22
|
},
|
22
23
|
"peerDependencies": {
|
23
|
-
"@sonarwatch/portfolio-core": "0.
|
24
|
+
"@sonarwatch/portfolio-core": "0.2.1",
|
24
25
|
"tslib": "2.5.0"
|
25
26
|
},
|
26
27
|
"main": "./src/index.js",
|
@@ -0,0 +1,31 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.fetcherGenerator = void 0;
|
4
|
+
const tslib_1 = require("tslib");
|
5
|
+
const devkit_1 = require("@nx/devkit");
|
6
|
+
const node_fs_1 = require("node:fs");
|
7
|
+
const path = tslib_1.__importStar(require("path"));
|
8
|
+
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
9
|
+
const helpers_1 = require("../helpers");
|
10
|
+
function fetcherGenerator(tree, options) {
|
11
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
12
|
+
const fetcherName = (0, helpers_1.toKebabCase)(options.fetcherName);
|
13
|
+
const pluginId = (0, helpers_1.toKebabCase)(options.pluginId);
|
14
|
+
const { networkId } = options;
|
15
|
+
(0, portfolio_core_1.assetNetworkId)(networkId);
|
16
|
+
const libraryRoot = (0, devkit_1.readProjectConfiguration)(tree, 'plugins').root;
|
17
|
+
if (!(0, node_fs_1.existsSync)(`${libraryRoot}/src/plugins/${pluginId}`)) {
|
18
|
+
throw new Error(`The provided plugin does not exist: ${pluginId}`);
|
19
|
+
}
|
20
|
+
const substitutions = {
|
21
|
+
pluginId,
|
22
|
+
fetcherName,
|
23
|
+
networkId,
|
24
|
+
};
|
25
|
+
(0, devkit_1.generateFiles)(tree, path.join(__dirname, 'files'), libraryRoot, substitutions);
|
26
|
+
yield (0, devkit_1.formatFiles)(tree);
|
27
|
+
});
|
28
|
+
}
|
29
|
+
exports.fetcherGenerator = fetcherGenerator;
|
30
|
+
exports.default = fetcherGenerator;
|
31
|
+
//# sourceMappingURL=generator.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/generators/fetcher/generator.ts"],"names":[],"mappings":";;;;AAAA,uCAKoB;AACpB,qCAAqC;AACrC,mDAA6B;AAC7B,+DAA4D;AAE5D,wCAAyC;AAEzC,SAAsB,gBAAgB,CACpC,IAAU,EACV,OAA+B;;QAE/B,MAAM,WAAW,GAAG,IAAA,qBAAW,EAAC,OAAO,CAAC,WAAW,CAAC,CAAC;QACrD,MAAM,QAAQ,GAAG,IAAA,qBAAW,EAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QAC/C,MAAM,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC;QAC9B,IAAA,+BAAc,EAAC,SAAS,CAAC,CAAC;QAE1B,MAAM,WAAW,GAAG,IAAA,iCAAwB,EAAC,IAAI,EAAE,SAAS,CAAC,CAAC,IAAI,CAAC;QAEnE,IAAI,CAAC,IAAA,oBAAU,EAAC,GAAG,WAAW,gBAAgB,QAAQ,EAAE,CAAC,EAAE;YACzD,MAAM,IAAI,KAAK,CAAC,uCAAuC,QAAQ,EAAE,CAAC,CAAC;SACpE;QAED,MAAM,aAAa,GAAG;YACpB,QAAQ;YACR,WAAW;YACX,SAAS;SACV,CAAC;QAEF,IAAA,sBAAa,EACX,IAAI,EACJ,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,EAC7B,WAAW,EACX,aAAa,CACd,CAAC;QACF,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;CAAA;AA5BD,4CA4BC;AAED,kBAAe,gBAAgB,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare function toKebabCase(str: string): string;
|
@@ -0,0 +1,13 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.toKebabCase = void 0;
|
4
|
+
const toKebabCaseRegexp = /[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g;
|
5
|
+
function toKebabCase(str) {
|
6
|
+
var _a;
|
7
|
+
if (!str)
|
8
|
+
return '';
|
9
|
+
return (((_a = str
|
10
|
+
.match(toKebabCaseRegexp)) === null || _a === void 0 ? void 0 : _a.map((x) => x.toLowerCase()).join('-')) || '');
|
11
|
+
}
|
12
|
+
exports.toKebabCase = toKebabCase;
|
13
|
+
//# sourceMappingURL=helpers.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../packages/plugins/src/generators/helpers.ts"],"names":[],"mappings":";;;AAAA,MAAM,iBAAiB,GACrB,oEAAoE,CAAC;AAEvE,SAAgB,WAAW,CAAC,GAAW;;IACrC,IAAI,CAAC,GAAG;QAAE,OAAO,EAAE,CAAC;IACpB,OAAO,CACL,CAAA,MAAA,GAAG;SACA,KAAK,CAAC,iBAAiB,CAAC,0CACvB,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,EAC3B,IAAI,CAAC,GAAG,CAAC,KAAI,EAAE,CACnB,CAAC;AACJ,CAAC;AARD,kCAQC"}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.jobGenerator = void 0;
|
4
|
+
const tslib_1 = require("tslib");
|
5
|
+
const devkit_1 = require("@nx/devkit");
|
6
|
+
const path = tslib_1.__importStar(require("path"));
|
7
|
+
const node_fs_1 = require("node:fs");
|
8
|
+
const helpers_1 = require("../helpers");
|
9
|
+
function jobGenerator(tree, options) {
|
10
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
11
|
+
const jobName = (0, helpers_1.toKebabCase)(options.jobName);
|
12
|
+
const pluginId = (0, helpers_1.toKebabCase)(options.pluginId);
|
13
|
+
const libraryRoot = (0, devkit_1.readProjectConfiguration)(tree, 'plugins').root;
|
14
|
+
if (!(0, node_fs_1.existsSync)(`${libraryRoot}/src/plugins/${pluginId}`)) {
|
15
|
+
throw new Error(`The provided plugin does not exist: ${pluginId}`);
|
16
|
+
}
|
17
|
+
const substitutions = {
|
18
|
+
pluginId,
|
19
|
+
jobName,
|
20
|
+
};
|
21
|
+
(0, devkit_1.generateFiles)(tree, path.join(__dirname, 'files'), libraryRoot, substitutions);
|
22
|
+
yield (0, devkit_1.formatFiles)(tree);
|
23
|
+
});
|
24
|
+
}
|
25
|
+
exports.jobGenerator = jobGenerator;
|
26
|
+
exports.default = jobGenerator;
|
27
|
+
//# sourceMappingURL=generator.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/generators/job/generator.ts"],"names":[],"mappings":";;;;AAAA,uCAKoB;AACpB,mDAA6B;AAC7B,qCAAqC;AAErC,wCAAyC;AAEzC,SAAsB,YAAY,CAAC,IAAU,EAAE,OAA2B;;QACxE,MAAM,OAAO,GAAG,IAAA,qBAAW,EAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAC7C,MAAM,QAAQ,GAAG,IAAA,qBAAW,EAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QAC/C,MAAM,WAAW,GAAG,IAAA,iCAAwB,EAAC,IAAI,EAAE,SAAS,CAAC,CAAC,IAAI,CAAC;QAEnE,IAAI,CAAC,IAAA,oBAAU,EAAC,GAAG,WAAW,gBAAgB,QAAQ,EAAE,CAAC,EAAE;YACzD,MAAM,IAAI,KAAK,CAAC,uCAAuC,QAAQ,EAAE,CAAC,CAAC;SACpE;QAED,MAAM,aAAa,GAAG;YACpB,QAAQ;YACR,OAAO;SACR,CAAC;QAEF,IAAA,sBAAa,EACX,IAAI,EACJ,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,EAC7B,WAAW,EACX,aAAa,CACd,CAAC;QACF,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;CAAA;AArBD,oCAqBC;AAED,kBAAe,YAAY,CAAC"}
|
@@ -4,14 +4,7 @@ exports.pluginGenerator = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
5
5
|
const devkit_1 = require("@nx/devkit");
|
6
6
|
const path = tslib_1.__importStar(require("path"));
|
7
|
-
const
|
8
|
-
function toKebabCase(str) {
|
9
|
-
var _a;
|
10
|
-
if (!str)
|
11
|
-
return '';
|
12
|
-
return (((_a = str
|
13
|
-
.match(toKebabCaseRegexp)) === null || _a === void 0 ? void 0 : _a.map((x) => x.toLowerCase()).join('-')) || '');
|
14
|
-
}
|
7
|
+
const helpers_1 = require("../helpers");
|
15
8
|
function trimAndUpper(text) {
|
16
9
|
return text.replace(/-/, '').toUpperCase();
|
17
10
|
}
|
@@ -29,15 +22,15 @@ function idToSpacedPascalCase(id) {
|
|
29
22
|
}
|
30
23
|
function pluginGenerator(tree, options) {
|
31
24
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
32
|
-
const id = toKebabCase(options.id);
|
25
|
+
const id = (0, helpers_1.toKebabCase)(options.id);
|
33
26
|
const libraryRoot = (0, devkit_1.readProjectConfiguration)(tree, 'plugins').root;
|
34
|
-
|
27
|
+
const substitutions = {
|
35
28
|
id,
|
36
|
-
networkIds: options.networkIds,
|
37
29
|
pascalCaseId: idToPascalCase(id),
|
38
30
|
spacedPascalCaseId: idToSpacedPascalCase(id),
|
39
31
|
loweredPascalCaseId: lowerFirstLetter(idToPascalCase(id)),
|
40
|
-
}
|
32
|
+
};
|
33
|
+
(0, devkit_1.generateFiles)(tree, path.join(__dirname, 'files'), libraryRoot, substitutions);
|
41
34
|
yield (0, devkit_1.formatFiles)(tree);
|
42
35
|
});
|
43
36
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/generators/plugin/generator.ts"],"names":[],"mappings":";;;;AAAA,uCAKoB;AACpB,mDAA6B;
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/generators/plugin/generator.ts"],"names":[],"mappings":";;;;AAAA,uCAKoB;AACpB,mDAA6B;AAE7B,wCAAyC;AAEzC,SAAS,YAAY,CAAC,IAAY;IAChC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;AAC7C,CAAC;AACD,SAAS,aAAa,CAAC,IAAY;IACjC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC;AAC9C,CAAC;AACD,SAAS,gBAAgB,CAAC,MAAc;IACtC,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,iBAAiB,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAChE,CAAC;AAED,SAAS,cAAc,CAAC,EAAU;IAChC,OAAO,EAAE,CAAC,OAAO,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;AAChD,CAAC;AAED,SAAS,oBAAoB,CAAC,EAAU;IACtC,OAAO,EAAE,CAAC,OAAO,CAAC,YAAY,EAAE,aAAa,CAAC,CAAC;AACjD,CAAC;AAED,SAAsB,eAAe,CACnC,IAAU,EACV,OAA8B;;QAE9B,MAAM,EAAE,GAAG,IAAA,qBAAW,EAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QACnC,MAAM,WAAW,GAAG,IAAA,iCAAwB,EAAC,IAAI,EAAE,SAAS,CAAC,CAAC,IAAI,CAAC;QAEnE,MAAM,aAAa,GAAG;YACpB,EAAE;YACF,YAAY,EAAE,cAAc,CAAC,EAAE,CAAC;YAChC,kBAAkB,EAAE,oBAAoB,CAAC,EAAE,CAAC;YAC5C,mBAAmB,EAAE,gBAAgB,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC;SAC1D,CAAC;QAEF,IAAA,sBAAa,EACX,IAAI,EACJ,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,EAC7B,WAAW,EACX,aAAa,CACd,CAAC;QACF,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;CAAA;AArBD,0CAqBC;AAED,kBAAe,eAAe,CAAC"}
|
package/src/index.d.ts
CHANGED
package/src/index.js
CHANGED
@@ -1,19 +1,20 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.fetchers = exports.jobs = void 0;
|
4
|
-
const
|
3
|
+
exports.fetchers = exports.jobs = exports.platforms = void 0;
|
4
|
+
const tslib_1 = require("tslib");
|
5
|
+
const platformsObj = tslib_1.__importStar(require("./platforms"));
|
6
|
+
const wallet_tokens_1 = require("./plugins/wallet-tokens");
|
5
7
|
const marinade_1 = require("./plugins/marinade");
|
6
|
-
const raydium_1 = require("./plugins/raydium");
|
7
8
|
const marginfi_1 = require("./plugins/marginfi");
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
];
|
9
|
+
const tensor_1 = require("./plugins/tensor");
|
10
|
+
const foo_1 = require("./plugins/foo");
|
11
|
+
tslib_1.__exportStar(require("./platforms"), exports);
|
12
|
+
exports.platforms = Object.values(platformsObj);
|
13
|
+
exports.jobs = [...foo_1.jobs, ...marginfi_1.jobs, ...wallet_tokens_1.jobs];
|
14
14
|
exports.fetchers = [
|
15
|
+
...foo_1.fetchers,
|
16
|
+
...tensor_1.fetchers,
|
15
17
|
...marginfi_1.fetchers,
|
16
18
|
...marinade_1.fetchers,
|
17
|
-
...raydium_1.fetchers,
|
18
19
|
];
|
19
20
|
//# 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":"
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/plugins/src/index.ts"],"names":[],"mappings":";;;;AACA,kEAA4C;AAC5C,2DAAmE;AACnE,iDAAkE;AAClE,iDAG4B;AAC5B,6CAA8D;AAC9D,uCAAyE;AAEzE,sDAA4B;AACf,QAAA,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;AAExC,QAAA,IAAI,GAAU,CAAC,GAAG,UAAO,EAAE,GAAG,eAAY,EAAE,GAAG,oBAAgB,CAAC,CAAC;AAEjE,QAAA,QAAQ,GAAc;IACjC,GAAG,cAAW;IACd,GAAG,iBAAc;IACjB,GAAG,mBAAgB;IACnB,GAAG,mBAAgB;CACpB,CAAC"}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import { Platform } from '@sonarwatch/portfolio-core';
|
2
|
+
export declare const marinadePlatform: Platform;
|
3
|
+
export declare const aavePlatform: Platform;
|
4
|
+
export declare const walletnftsPlatform: Platform;
|
5
|
+
export declare const walletTokensPlatform: Platform;
|
6
|
+
export declare const marginfiPlatform: Platform;
|
7
|
+
export declare const tensorPlatform: Platform;
|
package/src/platforms.js
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.tensorPlatform = exports.marginfiPlatform = exports.walletTokensPlatform = exports.walletnftsPlatform = exports.aavePlatform = exports.marinadePlatform = void 0;
|
4
|
+
exports.marinadePlatform = {
|
5
|
+
id: 'marinade',
|
6
|
+
name: 'Marinade',
|
7
|
+
image: 'https://beta.sonar.watch/img/platforms/marinade.png',
|
8
|
+
};
|
9
|
+
exports.aavePlatform = {
|
10
|
+
id: 'aave',
|
11
|
+
name: 'AAVE',
|
12
|
+
image: 'https://beta.sonar.watch/img/platforms/aave.png',
|
13
|
+
};
|
14
|
+
exports.walletnftsPlatform = {
|
15
|
+
id: 'walletnfts',
|
16
|
+
name: 'NFTs',
|
17
|
+
image: 'https://beta.sonar.watch/img/platforms/walletnfts.png',
|
18
|
+
};
|
19
|
+
exports.walletTokensPlatform = {
|
20
|
+
id: 'wallet-tokens',
|
21
|
+
name: 'Tokens',
|
22
|
+
image: 'https://beta.sonar.watch/img/platforms/wallet-tokens.png',
|
23
|
+
};
|
24
|
+
exports.marginfiPlatform = {
|
25
|
+
id: 'marginfi',
|
26
|
+
name: 'Marginfi',
|
27
|
+
image: 'https://beta.sonar.watch/img/platforms/marginfi.png',
|
28
|
+
};
|
29
|
+
exports.tensorPlatform = {
|
30
|
+
id: 'tensor',
|
31
|
+
name: 'Tensor',
|
32
|
+
image: 'https://beta.sonar.watch/img/platforms/tensor.png',
|
33
|
+
};
|
34
|
+
//# sourceMappingURL=platforms.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"platforms.js","sourceRoot":"","sources":["../../../../packages/plugins/src/platforms.ts"],"names":[],"mappings":";;;AAEa,QAAA,gBAAgB,GAAa;IACxC,EAAE,EAAE,UAAU;IACd,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,qDAAqD;CAC7D,CAAC;AACW,QAAA,YAAY,GAAa;IACpC,EAAE,EAAE,MAAM;IACV,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,iDAAiD;CACzD,CAAC;AACW,QAAA,kBAAkB,GAAa;IAC1C,EAAE,EAAE,YAAY;IAChB,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,uDAAuD;CAC/D,CAAC;AACW,QAAA,oBAAoB,GAAa;IAC5C,EAAE,EAAE,eAAe;IACnB,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,0DAA0D;CAClE,CAAC;AACW,QAAA,gBAAgB,GAAa;IACxC,EAAE,EAAE,UAAU;IACd,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,qDAAqD;CAC7D,CAAC;AACW,QAAA,cAAc,GAAa;IACtC,EAAE,EAAE,QAAQ;IACZ,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,mDAAmD;CAC3D,CAAC"}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const tslib_1 = require("tslib");
|
4
|
+
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
5
|
+
const constants_1 = require("./constants");
|
6
|
+
const executor = (cache) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
7
|
+
yield cache.setItem('market_id', 'market_object', {
|
8
|
+
prefix: constants_1.marketsCachePrefix,
|
9
|
+
networkId: portfolio_core_1.NetworkId.ethereum,
|
10
|
+
});
|
11
|
+
});
|
12
|
+
const job = {
|
13
|
+
id: `${constants_1.platformId}-markets`,
|
14
|
+
executor,
|
15
|
+
};
|
16
|
+
exports.default = job;
|
17
|
+
//# sourceMappingURL=ammJob.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ammJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/foo/ammJob.ts"],"names":[],"mappings":";;;AAAA,+DAAgF;AAChF,2CAA6D;AAE7D,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,KAAK,CAAC,OAAO,CAAC,WAAW,EAAE,eAAe,EAAE;QAChD,MAAM,EAAE,8BAAkB;QAC1B,SAAS,EAAE,0BAAS,CAAC,QAAQ;KAC9B,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AACF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,UAAU;IAC3B,QAAQ;CACT,CAAC;AACF,kBAAe,GAAG,CAAC"}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.marketsCachePrefix = exports.platformId = void 0;
|
4
|
+
exports.platformId = 'foo';
|
5
|
+
exports.marketsCachePrefix = `${exports.platformId}-markets`;
|
6
|
+
//# sourceMappingURL=constants.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/foo/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,UAAU,GAAG,KAAK,CAAC;AACnB,QAAA,kBAAkB,GAAG,GAAG,kBAAU,UAAU,CAAC"}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.fetchers = exports.jobs = void 0;
|
4
|
+
const tslib_1 = require("tslib");
|
5
|
+
const ammJob_1 = tslib_1.__importDefault(require("./ammJob"));
|
6
|
+
const positionFetcher_1 = tslib_1.__importDefault(require("./positionFetcher"));
|
7
|
+
exports.jobs = [ammJob_1.default];
|
8
|
+
exports.fetchers = [positionFetcher_1.default];
|
9
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/foo/index.ts"],"names":[],"mappings":";;;;AACA,8DAA8B;AAC9B,gFAAgD;AAEnC,QAAA,IAAI,GAAU,CAAC,gBAAM,CAAC,CAAC;AACvB,QAAA,QAAQ,GAAc,CAAC,yBAAe,CAAC,CAAC"}
|
@@ -0,0 +1,38 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const tslib_1 = require("tslib");
|
4
|
+
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
5
|
+
const constants_1 = require("./constants");
|
6
|
+
const executor = (owner, cache) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
7
|
+
const ethTokenPrice = yield cache.getTokenPrice(portfolio_core_1.ethereumNativeAddress, portfolio_core_1.NetworkId.ethereum);
|
8
|
+
const amount = 2;
|
9
|
+
const price = (ethTokenPrice === null || ethTokenPrice === void 0 ? void 0 : ethTokenPrice.price) || null;
|
10
|
+
const value = price ? amount * price : null;
|
11
|
+
const element = {
|
12
|
+
networkId: portfolio_core_1.NetworkId.ethereum,
|
13
|
+
label: 'Deposit',
|
14
|
+
platformId: constants_1.platformId,
|
15
|
+
type: portfolio_core_1.PortfolioElementType.single,
|
16
|
+
value,
|
17
|
+
data: {
|
18
|
+
asset: {
|
19
|
+
type: portfolio_core_1.PortfolioAssetType.token,
|
20
|
+
networkId: portfolio_core_1.NetworkId.ethereum,
|
21
|
+
value,
|
22
|
+
data: {
|
23
|
+
address: portfolio_core_1.ethereumNativeAddress,
|
24
|
+
amount,
|
25
|
+
price,
|
26
|
+
},
|
27
|
+
},
|
28
|
+
},
|
29
|
+
};
|
30
|
+
return [element];
|
31
|
+
});
|
32
|
+
const fetcher = {
|
33
|
+
id: `${constants_1.platformId}-position`,
|
34
|
+
networkId: portfolio_core_1.NetworkId.ethereum,
|
35
|
+
executor,
|
36
|
+
};
|
37
|
+
exports.default = fetcher;
|
38
|
+
//# sourceMappingURL=positionFetcher.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"positionFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/foo/positionFetcher.ts"],"names":[],"mappings":";;;AAAA,+DASoC;AACpC,2CAAyC;AAEzC,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,aAAa,GAAG,MAAM,KAAK,CAAC,aAAa,CAC7C,sCAAqB,EACrB,0BAAS,CAAC,QAAQ,CACnB,CAAC;IACF,MAAM,MAAM,GAAG,CAAC,CAAC;IACjB,MAAM,KAAK,GAAG,CAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,KAAK,KAAI,IAAI,CAAC;IAC3C,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;IAE5C,MAAM,OAAO,GAA2B;QACtC,SAAS,EAAE,0BAAS,CAAC,QAAQ;QAC7B,KAAK,EAAE,SAAS;QAChB,UAAU,EAAV,sBAAU;QACV,IAAI,EAAE,qCAAoB,CAAC,MAAM;QACjC,KAAK;QACL,IAAI,EAAE;YACJ,KAAK,EAAE;gBACL,IAAI,EAAE,mCAAkB,CAAC,KAAK;gBAC9B,SAAS,EAAE,0BAAS,CAAC,QAAQ;gBAC7B,KAAK;gBACL,IAAI,EAAE;oBACJ,OAAO,EAAE,sCAAqB;oBAC9B,MAAM;oBACN,KAAK;iBACN;aACF;SACF;KACF,CAAC;IAEF,OAAO,CAAC,OAAO,CAAC,CAAC;AACnB,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,WAAW;IAC5B,SAAS,EAAE,0BAAS,CAAC,QAAQ;IAC7B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { PublicKey } from '@solana/web3.js';
|
2
2
|
import BigNumber from 'bignumber.js';
|
3
|
-
export declare const
|
4
|
-
export declare const platformId
|
3
|
+
export declare const prefix = "marginfi-banks";
|
4
|
+
export declare const platformId: string;
|
5
5
|
export declare const MarginfiProgram: PublicKey;
|
6
6
|
export declare const MarginfiAccountAddress = "4qp6Fx6tnZkY5Wropq9wUYgtFxXKwE6viZxFHg3rdAG8";
|
7
7
|
export declare const solFactor: BigNumber;
|
@@ -1,12 +1,13 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.solFactor = exports.MarginfiAccountAddress = exports.MarginfiProgram = exports.platformId = exports.
|
3
|
+
exports.solFactor = exports.MarginfiAccountAddress = exports.MarginfiProgram = exports.platformId = exports.prefix = void 0;
|
4
4
|
const tslib_1 = require("tslib");
|
5
5
|
const web3_js_1 = require("@solana/web3.js");
|
6
6
|
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
7
7
|
const bignumber_js_1 = tslib_1.__importDefault(require("bignumber.js"));
|
8
|
-
|
9
|
-
exports.
|
8
|
+
const platforms_1 = require("../../platforms");
|
9
|
+
exports.prefix = 'marginfi-banks';
|
10
|
+
exports.platformId = platforms_1.marginfiPlatform.id;
|
10
11
|
exports.MarginfiProgram = new web3_js_1.PublicKey('MFv2hWf31Z9kbCa1snEPYctwafyhdvnV7FZnsebVacA');
|
11
12
|
exports.MarginfiAccountAddress = '4qp6Fx6tnZkY5Wropq9wUYgtFxXKwE6viZxFHg3rdAG8';
|
12
13
|
exports.solFactor = new bignumber_js_1.default(Math.pow(10, portfolio_core_1.solanaNetwork.native.decimals));
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/marginfi/constants.ts"],"names":[],"mappings":";;;;AAAA,6CAA4C;AAC5C,+DAA2D;AAC3D,wEAAqC;
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/marginfi/constants.ts"],"names":[],"mappings":";;;;AAAA,6CAA4C;AAC5C,+DAA2D;AAC3D,wEAAqC;AACrC,+CAAmD;AAEtC,QAAA,MAAM,GAAG,gBAAgB,CAAC;AAC1B,QAAA,UAAU,GAAG,4BAAgB,CAAC,EAAE,CAAC;AAEjC,QAAA,eAAe,GAAG,IAAI,mBAAS,CAC1C,6CAA6C,CAC9C,CAAC;AAEW,QAAA,sBAAsB,GACjC,8CAA8C,CAAC;AAEpC,QAAA,SAAS,GAAG,IAAI,sBAAS,CAAC,SAAA,EAAE,EAAI,8BAAa,CAAC,MAAM,CAAC,QAAQ,CAAA,CAAC,CAAC"}
|
@@ -9,9 +9,8 @@ const filters_1 = require("./filters");
|
|
9
9
|
const solana_1 = require("../../utils/solana");
|
10
10
|
const clients_1 = require("../../utils/clients");
|
11
11
|
const tokenPriceToAssetToken_1 = require("../../utils/misc/tokenPriceToAssetToken");
|
12
|
-
const fetcherExecutor = (owner,
|
12
|
+
const fetcherExecutor = (owner, cache) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
13
13
|
var _a;
|
14
|
-
const { tokenPriceCache } = context;
|
15
14
|
const connection = (0, clients_1.getClientSolana)();
|
16
15
|
const accounts = yield (0, solana_1.getParsedProgramAccounts)(connection, MarginfiAccount_1.marginfiAccountStruct, constants_1.MarginfiProgram, (0, filters_1.accountsFilter)(owner));
|
17
16
|
if (accounts.length === 0)
|
@@ -25,14 +24,14 @@ const fetcherExecutor = (owner, context) => tslib_1.__awaiter(void 0, void 0, vo
|
|
25
24
|
if (lendingAccountBalances) {
|
26
25
|
for (let index = 0; index < lendingAccountBalances.length; index += 1) {
|
27
26
|
const accountBalanceInfo = lendingAccountBalances[index];
|
28
|
-
const bankInfo = yield
|
29
|
-
prefix:
|
27
|
+
const bankInfo = yield cache.getItem(accountBalanceInfo.bankPk.toString(), {
|
28
|
+
prefix: constants_1.prefix,
|
30
29
|
networkId: portfolio_core_1.NetworkId.solana,
|
31
|
-
})
|
30
|
+
});
|
32
31
|
if (!bankInfo)
|
33
32
|
continue;
|
34
33
|
const { lendingApr, borrowingApr } = (0, helpers_1.getInterestRates)(bankInfo);
|
35
|
-
const tokenPrice = yield
|
34
|
+
const tokenPrice = yield cache.getTokenPrice(bankInfo.mint.toString(), portfolio_core_1.NetworkId.solana);
|
36
35
|
if (!accountBalanceInfo.assetShares.value.isZero()) {
|
37
36
|
const suppliedQuantity = (0, helpers_1.wrappedI80F48toBigNumber)(accountBalanceInfo.assetShares)
|
38
37
|
.times(bankInfo.dividedAssetShareValue)
|
@@ -69,7 +68,7 @@ const fetcherExecutor = (owner, context) => tslib_1.__awaiter(void 0, void 0, vo
|
|
69
68
|
const element = {
|
70
69
|
type: portfolio_core_1.PortfolioElementType.borrowlend,
|
71
70
|
networkId: portfolio_core_1.NetworkId.solana,
|
72
|
-
platformId:
|
71
|
+
platformId: constants_1.platformId,
|
73
72
|
label: 'Lending',
|
74
73
|
value,
|
75
74
|
data: {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"fetcherExecutor.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/marginfi/fetcherExecutor.ts"],"names":[],"mappings":";;;AAAA,+DAUoC;AACpC,
|
1
|
+
{"version":3,"file":"fetcherExecutor.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/marginfi/fetcherExecutor.ts"],"names":[],"mappings":"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"}
|
@@ -8,14 +8,13 @@ const filters_1 = require("./filters");
|
|
8
8
|
const helpers_1 = require("./helpers");
|
9
9
|
const solana_1 = require("../../utils/solana");
|
10
10
|
const clients_1 = require("../../utils/clients");
|
11
|
-
const jobExecutor = (
|
12
|
-
const { cache } = context;
|
11
|
+
const jobExecutor = (cache) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
13
12
|
const connection = (0, clients_1.getClientSolana)();
|
14
13
|
const banksRawData = yield (0, solana_1.getParsedProgramAccounts)(connection, Bank_1.bankStruct, constants_1.MarginfiProgram, (0, filters_1.banksFilters)());
|
15
14
|
for (let index = 0; index < banksRawData.length; index += 1) {
|
16
15
|
const bank = banksRawData[index];
|
17
|
-
yield cache.
|
18
|
-
prefix:
|
16
|
+
yield cache.setItem(bank.pubkey.toString(), Object.assign(Object.assign({}, bank), { dividedAssetShareValue: (0, helpers_1.wrappedI80F48toBigNumber)(bank.assetShareValue).div(Math.pow(10, bank.mintDecimals)), dividedLiabilityShareValue: (0, helpers_1.wrappedI80F48toBigNumber)(bank.liabilityShareValue).div(Math.pow(10, bank.mintDecimals)) }), {
|
17
|
+
prefix: constants_1.prefix,
|
19
18
|
networkId: portfolio_core_1.NetworkId.solana,
|
20
19
|
});
|
21
20
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"jobExecutor.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/marginfi/jobExecutor.ts"],"names":[],"mappings":";;;AAAA,+
|
1
|
+
{"version":3,"file":"jobExecutor.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/marginfi/jobExecutor.ts"],"names":[],"mappings":";;;AAAA,+DAA2E;AAC3E,2CAAsD;AACtD,yCAA4C;AAC5C,uCAAyC;AACzC,uCAAqD;AACrD,+CAA8D;AAC9D,iDAAsD;AAEtD,MAAM,WAAW,GAAgB,CAAO,KAAY,EAAE,EAAE;IACtD,MAAM,UAAU,GAAG,IAAA,yBAAe,GAAE,CAAC;IAErC,MAAM,YAAY,GAAG,MAAM,IAAA,iCAAwB,EACjD,UAAU,EACV,iBAAU,EACV,2BAAe,EACf,IAAA,sBAAY,GAAE,CACf,CAAC;IAEF,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,YAAY,CAAC,MAAM,EAAE,KAAK,IAAI,CAAC,EAAE;QAC3D,MAAM,IAAI,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;QACjC,MAAM,KAAK,CAAC,OAAO,CACjB,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,kCAEjB,IAAI,KACP,sBAAsB,EAAE,IAAA,kCAAwB,EAC9C,IAAI,CAAC,eAAe,CACrB,CAAC,GAAG,CAAC,SAAA,EAAE,EAAI,IAAI,CAAC,YAAY,CAAA,CAAC,EAC9B,0BAA0B,EAAE,IAAA,kCAAwB,EAClD,IAAI,CAAC,mBAAmB,CACzB,CAAC,GAAG,CAAC,SAAA,EAAE,EAAI,IAAI,CAAC,YAAY,CAAA,CAAC,KAEhC;YACE,MAAM,EAAN,kBAAM;YACN,SAAS,EAAE,0BAAS,CAAC,MAAM;SAC5B,CACF,CAAC;KACH;AACH,CAAC,CAAA,CAAC;AACF,kBAAe,WAAW,CAAC"}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { PublicKey } from '@solana/web3.js';
|
2
2
|
import BigNumber from 'bignumber.js';
|
3
|
-
export declare const platformId
|
3
|
+
export declare const platformId: string;
|
4
4
|
export declare const cachePrefix = "marinade";
|
5
5
|
export declare const marinadeTicketProgramId: PublicKey;
|
6
6
|
export declare const solFactor: BigNumber;
|
@@ -5,7 +5,8 @@ const tslib_1 = require("tslib");
|
|
5
5
|
const web3_js_1 = require("@solana/web3.js");
|
6
6
|
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
7
7
|
const bignumber_js_1 = tslib_1.__importDefault(require("bignumber.js"));
|
8
|
-
|
8
|
+
const platforms_1 = require("../../platforms");
|
9
|
+
exports.platformId = platforms_1.marinadePlatform.id;
|
9
10
|
exports.cachePrefix = 'marinade';
|
10
11
|
exports.marinadeTicketProgramId = new web3_js_1.PublicKey('MarBmsSgKXdrN1egZf5sqe1TMai9K1rChYNDJgjq7aD');
|
11
12
|
exports.solFactor = new bignumber_js_1.default(Math.pow(10, portfolio_core_1.solanaNetwork.native.decimals));
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/marinade/constants.ts"],"names":[],"mappings":";;;;AAAA,6CAA4C;AAC5C,+DAA2D;AAC3D,wEAAqC;
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/marinade/constants.ts"],"names":[],"mappings":";;;;AAAA,6CAA4C;AAC5C,+DAA2D;AAC3D,wEAAqC;AACrC,+CAAmD;AAEtC,QAAA,UAAU,GAAG,4BAAgB,CAAC,EAAE,CAAC;AACjC,QAAA,WAAW,GAAG,UAAU,CAAC;AACzB,QAAA,uBAAuB,GAAG,IAAI,mBAAS,CAClD,6CAA6C,CAC9C,CAAC;AACW,QAAA,SAAS,GAAG,IAAI,sBAAS,CAAC,SAAA,EAAE,EAAI,8BAAa,CAAC,MAAM,CAAC,QAAQ,CAAA,CAAC,CAAC"}
|
@@ -1,21 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.fetchers =
|
3
|
+
exports.fetchers = void 0;
|
4
4
|
const tslib_1 = require("tslib");
|
5
|
-
const
|
6
|
-
|
7
|
-
const fetcherExecutor_1 = tslib_1.__importDefault(require("./fetcherExecutor"));
|
8
|
-
exports.jobs = [
|
9
|
-
{
|
10
|
-
id: 'marinade',
|
11
|
-
executor: jobExecutor_1.default,
|
12
|
-
},
|
13
|
-
];
|
14
|
-
exports.fetchers = [
|
15
|
-
{
|
16
|
-
id: 'marinade',
|
17
|
-
networkId: portfolio_core_1.NetworkId.solana,
|
18
|
-
executor: fetcherExecutor_1.default,
|
19
|
-
},
|
20
|
-
];
|
5
|
+
const ticketsFetcher_1 = tslib_1.__importDefault(require("./ticketsFetcher"));
|
6
|
+
exports.fetchers = [ticketsFetcher_1.default];
|
21
7
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/marinade/index.ts"],"names":[],"mappings":";;;;
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/marinade/index.ts"],"names":[],"mappings":";;;;AACA,8EAA8C;AAEjC,QAAA,QAAQ,GAAc,CAAC,wBAAc,CAAC,CAAC"}
|