@sonarwatch/portfolio-plugins 0.11.138 → 0.11.139
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +1271 -1267
- package/README.md +3 -3
- 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/foo/constants.js +1 -1
- package/src/plugins/foo/constants.js.map +1 -1
- package/src/plugins/staratlas/constants.d.ts +12 -0
- package/src/plugins/staratlas/constants.js +22 -0
- package/src/plugins/staratlas/constants.js.map +1 -0
- package/src/plugins/staratlas/helpers.d.ts +4 -0
- package/src/plugins/staratlas/helpers.js +26 -0
- package/src/plugins/staratlas/helpers.js.map +1 -0
- package/src/plugins/staratlas/index.d.ts +6 -0
- package/src/plugins/staratlas/index.js +13 -0
- package/src/plugins/staratlas/index.js.map +1 -0
- package/src/plugins/staratlas/lockersFetcher.d.ts +3 -0
- package/src/plugins/staratlas/lockersFetcher.js +54 -0
- package/src/plugins/staratlas/lockersFetcher.js.map +1 -0
- package/src/plugins/staratlas/stakingFetcher.d.ts +3 -0
- package/src/plugins/staratlas/stakingFetcher.js +64 -0
- package/src/plugins/staratlas/stakingFetcher.js.map +1 -0
- package/src/plugins/staratlas/structs.d.ts +33 -0
- package/src/plugins/staratlas/structs.js +34 -0
- package/src/plugins/staratlas/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/sei/constants.js +8 -8
- package/src/utils/sei/getQueryBalanceByOwner.js +4 -4
package/README.md
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
# @sonarwatch/portfolio-plugins
|
2
|
-
|
3
|
-
This library is @sonarwatch/portfolio-plugins
|
1
|
+
# @sonarwatch/portfolio-plugins
|
2
|
+
|
3
|
+
This library is @sonarwatch/portfolio-plugins
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@sonarwatch/portfolio-plugins",
|
3
|
-
"version": "0.11.
|
3
|
+
"version": "0.11.139",
|
4
4
|
"type": "commonjs",
|
5
5
|
"generators": "./generators.json",
|
6
6
|
"dependencies": {
|
@@ -41,7 +41,7 @@
|
|
41
41
|
"web3-v1": "npm:web3@^1.5.0"
|
42
42
|
},
|
43
43
|
"peerDependencies": {
|
44
|
-
"@sonarwatch/portfolio-core": "0.11.
|
44
|
+
"@sonarwatch/portfolio-core": "0.11.139"
|
45
45
|
},
|
46
46
|
"main": "./src/index.js",
|
47
47
|
"types": "./src/index.d.ts"
|
package/src/index.js
CHANGED
@@ -95,6 +95,7 @@ const abex_1 = require("./plugins/abex");
|
|
95
95
|
const kai_1 = require("./plugins/kai");
|
96
96
|
const suilend_1 = require("./plugins/suilend");
|
97
97
|
const symmetry_1 = require("./plugins/symmetry");
|
98
|
+
const staratlas_1 = require("./plugins/staratlas");
|
98
99
|
var constants_1 = require("./plugins/tokens/constants");
|
99
100
|
Object.defineProperty(exports, "walletTokensPlatform", { enumerable: true, get: function () { return constants_1.walletTokensPlatform; } });
|
100
101
|
Object.defineProperty(exports, "walletNftsPlatform", { enumerable: true, get: function () { return constants_1.walletNftsPlatform; } });
|
@@ -183,6 +184,7 @@ exports.platforms = [
|
|
183
184
|
...kai_1.platforms,
|
184
185
|
...suilend_1.platforms,
|
185
186
|
...symmetry_1.platforms,
|
187
|
+
...staratlas_1.platforms,
|
186
188
|
];
|
187
189
|
// JOBS //
|
188
190
|
exports.jobs = [
|
@@ -254,6 +256,7 @@ exports.jobs = [
|
|
254
256
|
...kai_1.jobs,
|
255
257
|
...suilend_1.jobs,
|
256
258
|
...symmetry_1.jobs,
|
259
|
+
...staratlas_1.jobs,
|
257
260
|
];
|
258
261
|
// FETCHERS //
|
259
262
|
exports.fetchers = [
|
@@ -327,6 +330,7 @@ exports.fetchers = [
|
|
327
330
|
...kai_1.fetchers,
|
328
331
|
...suilend_1.fetchers,
|
329
332
|
...symmetry_1.fetchers,
|
333
|
+
...staratlas_1.fetchers,
|
330
334
|
];
|
331
335
|
exports.fetchersByAddressSystem = (0, getFetchersByAddressSystem_1.getFetchersByAddressSystem)(exports.fetchers);
|
332
336
|
//# 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,+CAI2B;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,+CAI2B;AAC3B,yCAIwB;AACxB,2CAIyB;AACzB,mDAI6B;AAC7B,2CAIyB;AACzB,2CAIyB;AACzB,sCAIsB;AACtB,+CAI2B;AAC3B,iDAI4B;AAC5B,yCAIwB;AACxB,mDAI6B;AAC7B,qDAI8B;AAC9B,2CAIyB;AACzB,2CAIyB;AACzB,yCAIwB;AACxB,+CAI2B;AAC3B,2CAIyB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BAAc;IACjB,GAAG,6BAAyB;IAC5B,GAAG,iBAAc;IACjB,GAAG,eAAY;IACf,GAAG,kBAAe;IAClB,GAAG,sBAAkB;IACrB,GAAG,gBAAa;IAChB,GAAG,mBAAgB;IACnB,GAAG,gBAAa;IAChB,GAAG,mBAAgB;IACnB,GAAG,eAAY;IACf,GAAG,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;IACnB,GAAG,eAAY;IACf,GAAG,oBAAiB;IACpB,GAAG,kBAAe;IAClB,GAAG,qBAAkB;IACrB,GAAG,gBAAa;IAChB,GAAG,gBAAa;IAChB,GAAG,eAAY;IACf,GAAG,kBAAe;IAClB,GAAG,gBAAa;IAChB,GAAG,gBAAa;IAChB,GAAG,sBAAmB;IACtB,GAAG,yBAAsB;IACzB,GAAG,gBAAa;IAChB,GAAG,eAAY;IACf,GAAG,oBAAiB;IACpB,GAAG,iBAAc;IACjB,GAAG,2BAAsB;IACzB,GAAG,sBAAkB;IACrB,GAAG,eAAY;IACf,GAAG,cAAW;IACd,GAAG,kBAAe;IAClB,GAAG,mBAAgB;IACnB,GAAG,oBAAiB;CACrB,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;
|
@@ -5,7 +5,7 @@ exports.platformId = 'foo';
|
|
5
5
|
exports.platform = {
|
6
6
|
id: exports.platformId,
|
7
7
|
name: 'Foo Finance',
|
8
|
-
image: 'https://sonar.watch/img/platforms/foo.
|
8
|
+
image: 'https://sonar.watch/img/platforms/foo.webp',
|
9
9
|
website: 'https://foo.com/',
|
10
10
|
twitter: 'https://twitter.com/foo_finance',
|
11
11
|
defiLlamaId: 'foo-finance', // from https://defillama.com/docs/api
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/foo/constants.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG,KAAK,CAAC;AACnB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,aAAa;IACnB,KAAK,EAAE,
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/foo/constants.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG,KAAK,CAAC;AACnB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,aAAa;IACnB,KAAK,EAAE,4CAA4C;IACnD,OAAO,EAAE,kBAAkB;IAC3B,OAAO,EAAE,iCAAiC;IAC1C,WAAW,EAAE,aAAa,EAAE,sCAAsC;CACnE,CAAC;AACW,QAAA,kBAAkB,GAAG,GAAG,kBAAU,UAAU,CAAC"}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { PublicKey } from '@solana/web3.js';
|
2
|
+
import { Platform } from '@sonarwatch/portfolio-core';
|
3
|
+
export declare const platformId = "staratlas";
|
4
|
+
export declare const platform: Platform;
|
5
|
+
export declare const lockerAddress: PublicKey;
|
6
|
+
export declare const stakingPid: PublicKey;
|
7
|
+
export declare const proxyRewarderPid: PublicKey;
|
8
|
+
export declare const lockedVoterPid: PublicKey;
|
9
|
+
export declare const polisMint = "poLisWXnNRwC6oBu1vHiuKQzFjGL4XDSu4g9qjz9qVk";
|
10
|
+
export declare const polisDecimals = 8;
|
11
|
+
export declare const atlasMint = "ATLASXmbPQxBUYbxPsV97usA3fPQYEqzQBUHgiFCUsXx";
|
12
|
+
export declare const atlasDecimals = 8;
|
@@ -0,0 +1,22 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.atlasDecimals = exports.atlasMint = exports.polisDecimals = exports.polisMint = exports.lockedVoterPid = exports.proxyRewarderPid = exports.stakingPid = exports.lockerAddress = exports.platform = exports.platformId = void 0;
|
4
|
+
const web3_js_1 = require("@solana/web3.js");
|
5
|
+
exports.platformId = 'staratlas';
|
6
|
+
exports.platform = {
|
7
|
+
id: exports.platformId,
|
8
|
+
name: 'Star Atlas',
|
9
|
+
image: 'https://sonar.watch/img/platforms/staratlas.webp',
|
10
|
+
website: 'https://staratlas.com/',
|
11
|
+
twitter: 'https://twitter.com/staratlas',
|
12
|
+
// defiLlamaId: 'foo-finance', // from https://defillama.com/docs/api
|
13
|
+
};
|
14
|
+
exports.lockerAddress = new web3_js_1.PublicKey('5WmM9c9WE71y78Ah8Bp8vgyoStscM1ZZyaaFqRf8b2Qa');
|
15
|
+
exports.stakingPid = new web3_js_1.PublicKey('ATLocKpzDbTokxgvnLew3d7drZkEzLzDpzwgrgWKDbmc');
|
16
|
+
exports.proxyRewarderPid = new web3_js_1.PublicKey('gateVwTnKyFrE8nxUUgfzoZTPKgJQZUbLsEidpG4Dp2');
|
17
|
+
exports.lockedVoterPid = new web3_js_1.PublicKey('Lock7kBijGCQLEFAmXcengzXKA88iDNQPriQ7TbgeyG');
|
18
|
+
exports.polisMint = 'poLisWXnNRwC6oBu1vHiuKQzFjGL4XDSu4g9qjz9qVk';
|
19
|
+
exports.polisDecimals = 8;
|
20
|
+
exports.atlasMint = 'ATLASXmbPQxBUYbxPsV97usA3fPQYEqzQBUHgiFCUsXx';
|
21
|
+
exports.atlasDecimals = 8;
|
22
|
+
//# sourceMappingURL=constants.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/staratlas/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAG/B,QAAA,UAAU,GAAG,WAAW,CAAC;AACzB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,YAAY;IAClB,KAAK,EAAE,kDAAkD;IACzD,OAAO,EAAE,wBAAwB;IACjC,OAAO,EAAE,+BAA+B;IACxC,qEAAqE;CACtE,CAAC;AAEW,QAAA,aAAa,GAAG,IAAI,mBAAS,CACxC,8CAA8C,CAC/C,CAAC;AACW,QAAA,UAAU,GAAG,IAAI,mBAAS,CACrC,8CAA8C,CAC/C,CAAC;AACW,QAAA,gBAAgB,GAAG,IAAI,mBAAS,CAC3C,6CAA6C,CAC9C,CAAC;AACW,QAAA,cAAc,GAAG,IAAI,mBAAS,CACzC,6CAA6C,CAC9C,CAAC;AACW,QAAA,SAAS,GAAG,6CAA6C,CAAC;AAC1D,QAAA,aAAa,GAAG,CAAC,CAAC;AAClB,QAAA,SAAS,GAAG,8CAA8C,CAAC;AAC3D,QAAA,aAAa,GAAG,CAAC,CAAC"}
|
@@ -0,0 +1,4 @@
|
|
1
|
+
import { PublicKey } from '@solana/web3.js';
|
2
|
+
export declare function getProxyEscrowAddress(owner: string): PublicKey;
|
3
|
+
export declare function getProxyAddress(proxyEscrowAddress: string, owner: string): PublicKey;
|
4
|
+
export declare function getEscrowAddress(escrowOwner: PublicKey): PublicKey;
|
@@ -0,0 +1,26 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.getEscrowAddress = exports.getProxyAddress = exports.getProxyEscrowAddress = void 0;
|
4
|
+
const web3_js_1 = require("@solana/web3.js");
|
5
|
+
const constants_1 = require("./constants");
|
6
|
+
function getProxyEscrowAddress(owner) {
|
7
|
+
return web3_js_1.PublicKey.findProgramAddressSync([Buffer.from('ProxyEscrow', 'utf8'), new web3_js_1.PublicKey(owner).toBuffer()], constants_1.proxyRewarderPid)[0];
|
8
|
+
}
|
9
|
+
exports.getProxyEscrowAddress = getProxyEscrowAddress;
|
10
|
+
function getProxyAddress(proxyEscrowAddress, owner) {
|
11
|
+
return web3_js_1.PublicKey.findProgramAddressSync([
|
12
|
+
Buffer.from('Proxy', 'utf8'),
|
13
|
+
new web3_js_1.PublicKey(proxyEscrowAddress).toBuffer(),
|
14
|
+
new web3_js_1.PublicKey(owner).toBuffer(),
|
15
|
+
], constants_1.proxyRewarderPid)[0];
|
16
|
+
}
|
17
|
+
exports.getProxyAddress = getProxyAddress;
|
18
|
+
function getEscrowAddress(escrowOwner) {
|
19
|
+
return web3_js_1.PublicKey.findProgramAddressSync([
|
20
|
+
Buffer.from('Escrow', 'utf8'),
|
21
|
+
constants_1.lockerAddress.toBuffer(),
|
22
|
+
escrowOwner.toBuffer(),
|
23
|
+
], constants_1.lockedVoterPid)[0];
|
24
|
+
}
|
25
|
+
exports.getEscrowAddress = getEscrowAddress;
|
26
|
+
//# sourceMappingURL=helpers.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/staratlas/helpers.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAC5C,2CAA8E;AAE9E,SAAgB,qBAAqB,CAAC,KAAa;IACjD,OAAO,mBAAS,CAAC,sBAAsB,CACrC,CAAC,MAAM,CAAC,IAAI,CAAC,aAAa,EAAE,MAAM,CAAC,EAAE,IAAI,mBAAS,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE,CAAC,EACrE,4BAAgB,CACjB,CAAC,CAAC,CAAC,CAAC;AACP,CAAC;AALD,sDAKC;AAED,SAAgB,eAAe,CAAC,kBAA0B,EAAE,KAAa;IACvE,OAAO,mBAAS,CAAC,sBAAsB,CACrC;QACE,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC;QAC5B,IAAI,mBAAS,CAAC,kBAAkB,CAAC,CAAC,QAAQ,EAAE;QAC5C,IAAI,mBAAS,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE;KAChC,EACD,4BAAgB,CACjB,CAAC,CAAC,CAAC,CAAC;AACP,CAAC;AATD,0CASC;AAED,SAAgB,gBAAgB,CAAC,WAAsB;IACrD,OAAO,mBAAS,CAAC,sBAAsB,CACrC;QACE,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC;QAC7B,yBAAa,CAAC,QAAQ,EAAE;QACxB,WAAW,CAAC,QAAQ,EAAE;KACvB,EACD,0BAAc,CACf,CAAC,CAAC,CAAC,CAAC;AACP,CAAC;AATD,4CASC"}
|
@@ -0,0 +1,13 @@
|
|
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 lockersFetcher_1 = __importDefault(require("./lockersFetcher"));
|
9
|
+
const stakingFetcher_1 = __importDefault(require("./stakingFetcher"));
|
10
|
+
exports.platforms = [constants_1.platform];
|
11
|
+
exports.jobs = [];
|
12
|
+
exports.fetchers = [lockersFetcher_1.default, stakingFetcher_1.default];
|
13
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/staratlas/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAAuC;AACvC,sEAA8C;AAC9C,sEAA8C;AAEjC,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC;AACnC,QAAA,IAAI,GAAU,EAAE,CAAC;AACjB,QAAA,QAAQ,GAAc,CAAC,wBAAc,EAAE,wBAAc,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 constants_1 = require("./constants");
|
17
|
+
const clients_1 = require("../../utils/clients");
|
18
|
+
const helpers_1 = require("./helpers");
|
19
|
+
const getParsedAccountInfo_1 = require("../../utils/solana/getParsedAccountInfo");
|
20
|
+
const structs_1 = require("./structs");
|
21
|
+
const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
|
22
|
+
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
23
|
+
const connection = (0, clients_1.getClientSolana)();
|
24
|
+
const proxyEscrowAddress = (0, helpers_1.getProxyEscrowAddress)(owner);
|
25
|
+
const proxyAddress = (0, helpers_1.getProxyAddress)(proxyEscrowAddress.toString(), owner);
|
26
|
+
const escrowAddress = (0, helpers_1.getEscrowAddress)(proxyAddress);
|
27
|
+
const account = yield (0, getParsedAccountInfo_1.getParsedAccountInfo)(connection, structs_1.escrowStruct, escrowAddress);
|
28
|
+
if (!account || account.amount.isZero())
|
29
|
+
return [];
|
30
|
+
const polisTokenPrice = yield cache.getTokenPrice(constants_1.polisMint, portfolio_core_1.NetworkId.solana);
|
31
|
+
const amount = account.amount.div(Math.pow(10, constants_1.polisDecimals)).toNumber();
|
32
|
+
const asset = (0, tokenPriceToAssetToken_1.default)(constants_1.polisMint, amount, portfolio_core_1.NetworkId.solana, polisTokenPrice, polisTokenPrice === null || polisTokenPrice === void 0 ? void 0 : polisTokenPrice.price, {
|
33
|
+
lockedUntil: account.escrowEndsAt.toNumber() * 1000,
|
34
|
+
});
|
35
|
+
return [
|
36
|
+
{
|
37
|
+
type: portfolio_core_1.PortfolioElementType.multiple,
|
38
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
39
|
+
label: 'Staked',
|
40
|
+
platformId: constants_1.platformId,
|
41
|
+
data: {
|
42
|
+
assets: [asset],
|
43
|
+
},
|
44
|
+
value: asset.value,
|
45
|
+
},
|
46
|
+
];
|
47
|
+
});
|
48
|
+
const fetcher = {
|
49
|
+
id: `${constants_1.platformId}-lockers`,
|
50
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
51
|
+
executor,
|
52
|
+
};
|
53
|
+
exports.default = fetcher;
|
54
|
+
//# sourceMappingURL=lockersFetcher.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"lockersFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/staratlas/lockersFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAA6E;AAE7E,2CAAmE;AAEnE,iDAAsD;AACtD,uCAImB;AACnB,kFAA+E;AAC/E,uCAAyC;AACzC,qGAA6E;AAE7E,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,UAAU,GAAG,IAAA,yBAAe,GAAE,CAAC;IAErC,MAAM,kBAAkB,GAAG,IAAA,+BAAqB,EAAC,KAAK,CAAC,CAAC;IACxD,MAAM,YAAY,GAAG,IAAA,yBAAe,EAAC,kBAAkB,CAAC,QAAQ,EAAE,EAAE,KAAK,CAAC,CAAC;IAC3E,MAAM,aAAa,GAAG,IAAA,0BAAgB,EAAC,YAAY,CAAC,CAAC;IACrD,MAAM,OAAO,GAAG,MAAM,IAAA,2CAAoB,EACxC,UAAU,EACV,sBAAY,EACZ,aAAa,CACd,CAAC;IACF,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE;QAAE,OAAO,EAAE,CAAC;IAEnD,MAAM,eAAe,GAAG,MAAM,KAAK,CAAC,aAAa,CAC/C,qBAAS,EACT,0BAAS,CAAC,MAAM,CACjB,CAAC;IACF,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,SAAA,EAAE,EAAI,yBAAa,CAAA,CAAC,CAAC,QAAQ,EAAE,CAAC;IAClE,MAAM,KAAK,GAAG,IAAA,gCAAsB,EAClC,qBAAS,EACT,MAAM,EACN,0BAAS,CAAC,MAAM,EAChB,eAAe,EACf,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,KAAK,EACtB;QACE,WAAW,EAAE,OAAO,CAAC,YAAY,CAAC,QAAQ,EAAE,GAAG,IAAI;KACpD,CACF,CAAC;IACF,OAAO;QACL;YACE,IAAI,EAAE,qCAAoB,CAAC,QAAQ;YACnC,SAAS,EAAE,0BAAS,CAAC,MAAM;YAC3B,KAAK,EAAE,QAAQ;YACf,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,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -0,0 +1,64 @@
|
|
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 constants_1 = require("./constants");
|
17
|
+
const clients_1 = require("../../utils/clients");
|
18
|
+
const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
|
19
|
+
const solana_1 = require("../../utils/solana");
|
20
|
+
const structs_1 = require("./structs");
|
21
|
+
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
22
|
+
const connection = (0, clients_1.getClientSolana)();
|
23
|
+
const accounts = yield (0, solana_1.getParsedProgramAccounts)(connection, structs_1.stakingStruct, constants_1.stakingPid, [
|
24
|
+
{ dataSize: structs_1.stakingStruct.byteSize },
|
25
|
+
{
|
26
|
+
memcmp: { bytes: owner, offset: 8 },
|
27
|
+
},
|
28
|
+
]);
|
29
|
+
if (accounts.length === 0)
|
30
|
+
return [];
|
31
|
+
const atlasTokenPrice = yield cache.getTokenPrice(constants_1.atlasMint, portfolio_core_1.NetworkId.solana);
|
32
|
+
const assets = [];
|
33
|
+
accounts.forEach((account) => {
|
34
|
+
if (!account.totalStake.isZero()) {
|
35
|
+
assets.push((0, tokenPriceToAssetToken_1.default)(constants_1.atlasMint, account.totalStake.div(Math.pow(10, constants_1.atlasDecimals)).toNumber(), portfolio_core_1.NetworkId.solana, atlasTokenPrice, atlasTokenPrice === null || atlasTokenPrice === void 0 ? void 0 : atlasTokenPrice.price, {}));
|
36
|
+
}
|
37
|
+
if (!account.pendingRewards.isZero()) {
|
38
|
+
assets.push((0, tokenPriceToAssetToken_1.default)(constants_1.atlasMint, account.totalStake.div(Math.pow(10, constants_1.atlasDecimals)).toNumber(), portfolio_core_1.NetworkId.solana, atlasTokenPrice, atlasTokenPrice === null || atlasTokenPrice === void 0 ? void 0 : atlasTokenPrice.price, {
|
39
|
+
isClaimable: true,
|
40
|
+
}));
|
41
|
+
}
|
42
|
+
});
|
43
|
+
if (assets.length === 0)
|
44
|
+
return [];
|
45
|
+
return [
|
46
|
+
{
|
47
|
+
type: portfolio_core_1.PortfolioElementType.multiple,
|
48
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
49
|
+
label: 'Staked',
|
50
|
+
platformId: constants_1.platformId,
|
51
|
+
data: {
|
52
|
+
assets,
|
53
|
+
},
|
54
|
+
value: (0, portfolio_core_1.getUsdValueSum)(assets.map((a) => a.value)),
|
55
|
+
},
|
56
|
+
];
|
57
|
+
});
|
58
|
+
const fetcher = {
|
59
|
+
id: `${constants_1.platformId}-staking`,
|
60
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
61
|
+
executor,
|
62
|
+
};
|
63
|
+
exports.default = fetcher;
|
64
|
+
//# sourceMappingURL=stakingFetcher.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"stakingFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/staratlas/stakingFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAKoC;AAEpC,2CAA+E;AAE/E,iDAAsD;AACtD,qGAA6E;AAC7E,+CAA8D;AAC9D,uCAA0C;AAE1C,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,UAAU,GAAG,IAAA,yBAAe,GAAE,CAAC;IAErC,MAAM,QAAQ,GAAG,MAAM,IAAA,iCAAwB,EAC7C,UAAU,EACV,uBAAa,EACb,sBAAU,EACV;QACE,EAAE,QAAQ,EAAE,uBAAa,CAAC,QAAQ,EAAE;QACpC;YACE,MAAM,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE;SACpC;KACF,CACF,CAAC;IACF,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAErC,MAAM,eAAe,GAAG,MAAM,KAAK,CAAC,aAAa,C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AAC,CAAC;SAClD;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"}
|
@@ -0,0 +1,33 @@
|
|
1
|
+
/// <reference types="node" />
|
2
|
+
import { BeetStruct } from '@metaplex-foundation/beet';
|
3
|
+
import { PublicKey } from '@solana/web3.js';
|
4
|
+
import BigNumber from 'bignumber.js';
|
5
|
+
export type Escrow = {
|
6
|
+
buffer: Buffer;
|
7
|
+
locker: PublicKey;
|
8
|
+
owner: PublicKey;
|
9
|
+
bump: number;
|
10
|
+
tokens: PublicKey;
|
11
|
+
amount: BigNumber;
|
12
|
+
escrowStartedAt: BigNumber;
|
13
|
+
escrowEndsAt: BigNumber;
|
14
|
+
voteDelegate: PublicKey;
|
15
|
+
};
|
16
|
+
export declare const escrowStruct: BeetStruct<Escrow, Partial<Escrow>>;
|
17
|
+
export type Staking = {
|
18
|
+
buffer: Buffer;
|
19
|
+
owner: PublicKey;
|
20
|
+
registeredStake: PublicKey;
|
21
|
+
stakeMint: PublicKey;
|
22
|
+
totalStake: BigNumber;
|
23
|
+
activeStake: BigNumber;
|
24
|
+
pendingRewards: BigNumber;
|
25
|
+
paidRewards: BigNumber;
|
26
|
+
currentPeriod: number;
|
27
|
+
stakedAtTs: BigNumber;
|
28
|
+
lastPendingRewardCalcTs: BigNumber;
|
29
|
+
lastHarvestTs: BigNumber;
|
30
|
+
unstakedTs: BigNumber;
|
31
|
+
bump: number;
|
32
|
+
};
|
33
|
+
export declare const stakingStruct: BeetStruct<Staking, Partial<Staking>>;
|
@@ -0,0 +1,34 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.stakingStruct = exports.escrowStruct = 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.escrowStruct = new beet_1.BeetStruct([
|
8
|
+
['buffer', (0, solana_1.blob)(8)],
|
9
|
+
['locker', beet_solana_1.publicKey],
|
10
|
+
['owner', beet_solana_1.publicKey],
|
11
|
+
['bump', beet_1.u8],
|
12
|
+
['tokens', beet_solana_1.publicKey],
|
13
|
+
['amount', solana_1.u64],
|
14
|
+
['escrowStartedAt', solana_1.i64],
|
15
|
+
['escrowEndsAt', solana_1.i64],
|
16
|
+
['voteDelegate', beet_solana_1.publicKey],
|
17
|
+
], (args) => args);
|
18
|
+
exports.stakingStruct = new beet_1.BeetStruct([
|
19
|
+
['buffer', (0, solana_1.blob)(8)],
|
20
|
+
['owner', beet_solana_1.publicKey],
|
21
|
+
['registeredStake', beet_solana_1.publicKey],
|
22
|
+
['stakeMint', beet_solana_1.publicKey],
|
23
|
+
['totalStake', solana_1.u64],
|
24
|
+
['activeStake', solana_1.u64],
|
25
|
+
['pendingRewards', solana_1.u64],
|
26
|
+
['paidRewards', solana_1.u64],
|
27
|
+
['currentPeriod', beet_1.u16],
|
28
|
+
['stakedAtTs', solana_1.i64],
|
29
|
+
['lastPendingRewardCalcTs', solana_1.i64],
|
30
|
+
['lastHarvestTs', solana_1.i64],
|
31
|
+
['unstakedTs', solana_1.i64],
|
32
|
+
['bump', beet_1.u8],
|
33
|
+
], (args) => args);
|
34
|
+
//# sourceMappingURL=structs.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"structs.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/staratlas/structs.ts"],"names":[],"mappings":";;;AAAA,oDAAgE;AAChE,kEAA6D;AAG7D,+CAAoD;AAcvC,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,uBAAS,CAAC;IACrB,CAAC,QAAQ,EAAE,YAAG,CAAC;IACf,CAAC,iBAAiB,EAAE,YAAG,CAAC;IACxB,CAAC,cAAc,EAAE,YAAG,CAAC;IACrB,CAAC,cAAc,EAAE,uBAAS,CAAC;CAC5B,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAc,CACzB,CAAC;AAmBW,QAAA,aAAa,GAAG,IAAI,iBAAU,CACzC;IACE,CAAC,QAAQ,EAAE,IAAA,aAAI,EAAC,CAAC,CAAC,CAAC;IACnB,CAAC,OAAO,EAAE,uBAAS,CAAC;IACpB,CAAC,iBAAiB,EAAE,uBAAS,CAAC;IAC9B,CAAC,WAAW,EAAE,uBAAS,CAAC;IACxB,CAAC,YAAY,EAAE,YAAG,CAAC;IACnB,CAAC,aAAa,EAAE,YAAG,CAAC;IACpB,CAAC,gBAAgB,EAAE,YAAG,CAAC;IACvB,CAAC,aAAa,EAAE,YAAG,CAAC;IACpB,CAAC,eAAe,EAAE,UAAG,CAAC;IACtB,CAAC,YAAY,EAAE,YAAG,CAAC;IACnB,CAAC,yBAAyB,EAAE,YAAG,CAAC;IAChC,CAAC,eAAe,EAAE,YAAG,CAAC;IACtB,CAAC,YAAY,EAAE,YAAG,CAAC;IACnB,CAAC,MAAM,EAAE,SAAE,CAAC;CACb,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAe,CAC1B,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,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;
|