@sonarwatch/portfolio-plugins 0.14.2 → 0.14.3

Sign up to get free protection for your applications and to get access to all the features.
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.14.2",
3
+ "version": "0.14.3",
4
4
  "type": "commonjs",
5
5
  "types": "./src/index.d.ts",
6
6
  "peerDependencies": {
@@ -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;
@@ -12,12 +12,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  const portfolio_core_1 = require("@sonarwatch/portfolio-core");
13
13
  const clients_1 = require("../../../utils/clients");
14
14
  const solana_1 = require("../../../utils/solana");
15
- const filters_1 = require("../../../utils/solana/filters");
16
15
  const constants_1 = require("./constants");
17
16
  const structs_1 = require("./structs");
17
+ const filters_1 = require("./filters");
18
18
  const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
19
19
  const client = (0, clients_1.getClientSolana)();
20
- const custodiesAccs = yield (0, solana_1.getParsedProgramAccounts)(client, structs_1.custodyStruct, constants_1.perpsProgramId, (0, filters_1.dataStructSizeFilter)(structs_1.custodyStruct));
20
+ const custodiesAccs = yield (0, solana_1.getParsedProgramAccounts)(client, structs_1.custodyStruct, constants_1.perpsProgramId, (0, filters_1.custodiesFilters)());
21
21
  if (custodiesAccs.length === 0)
22
22
  return;
23
23
  const custodyAccsInfo = custodiesAccs.map((acc) => (Object.assign({ pubkey: acc.pubkey.toString() }, acc)));
@@ -1 +1 @@
1
- {"version":3,"file":"custodiesJob.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/jupiter/exchange/custodiesJob.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAuD;AAGvD,oDAAyD;AACzD,kDAG+B;AAC/B,2DAAqE;AACrE,2CAKqB;AACrB,uCAAwE;AAExE,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,MAAM,aAAa,GAAG,MAAM,IAAA,iCAAwB,EAClD,MAAM,EACN,uBAAa,EACb,0BAAc,EACd,IAAA,8BAAoB,EAAC,uBAAa,CAAC,CACpC,CAAC;IACF,IAAI,aAAa,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO;IACvC,MAAM,eAAe,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,iBACjD,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,QAAQ,EAAE,IACzB,GAAe,EACnB,CAAC,CAAC;IAEJ,MAAM,KAAK,GAAG,CACZ,MAAM,IAAA,sCAA6B,EACjC,MAAM,EACN,6BAAmB,EACnB,aAAa,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CACrC,CACF;SACE,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;SACzC,IAAI,CAAC,CAAC,CAAC,CAAC;IAEX,MAAM,KAAK,CAAC,OAAO,CAAC,wBAAY,EAAE,eAAe,EAAE;QACjD,MAAM,EAAE,sBAAU;QAClB,SAAS,EAAE,0BAAS,CAAC,MAAM;KAC5B,CAAC,CAAC;IACH,MAAM,KAAK,CAAC,OAAO,CAAC,wBAAY,EAAE,KAAK,EAAE;QACvC,MAAM,EAAE,sBAAU;QAClB,SAAS,EAAE,0BAAS,CAAC,MAAM;KAC5B,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AAEF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,YAAY;IAC7B,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
1
+ {"version":3,"file":"custodiesJob.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/jupiter/exchange/custodiesJob.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAuD;AAGvD,oDAAyD;AACzD,kDAG+B;AAC/B,2CAKqB;AACrB,uCAAwE;AACxE,uCAA6C;AAE7C,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,MAAM,aAAa,GAAG,MAAM,IAAA,iCAAwB,EAClD,MAAM,EACN,uBAAa,EACb,0BAAc,EACd,IAAA,0BAAgB,GAAE,CACnB,CAAC;IACF,IAAI,aAAa,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO;IACvC,MAAM,eAAe,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,iBACjD,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,QAAQ,EAAE,IACzB,GAAe,EACnB,CAAC,CAAC;IAEJ,MAAM,KAAK,GAAG,CACZ,MAAM,IAAA,sCAA6B,EACjC,MAAM,EACN,6BAAmB,EACnB,aAAa,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CACrC,CACF;SACE,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;SACzC,IAAI,CAAC,CAAC,CAAC,CAAC;IAEX,MAAM,KAAK,CAAC,OAAO,CAAC,wBAAY,EAAE,eAAe,EAAE;QACjD,MAAM,EAAE,sBAAU;QAClB,SAAS,EAAE,0BAAS,CAAC,MAAM;KAC5B,CAAC,CAAC;IACH,MAAM,KAAK,CAAC,OAAO,CAAC,wBAAY,EAAE,KAAK,EAAE;QACvC,MAAM,EAAE,sBAAU;QAClB,SAAS,EAAE,0BAAS,CAAC,MAAM;KAC5B,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AAEF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,YAAY;IAC7B,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
@@ -3,3 +3,4 @@ export declare const limitFilters: (owner: string) => GetProgramAccountsFilter[]
3
3
  export declare const DCAFilters: (owner: string) => GetProgramAccountsFilter[];
4
4
  export declare const valueAverageFilters: (owner: string) => GetProgramAccountsFilter[];
5
5
  export declare const lockFilters: (owner: string) => GetProgramAccountsFilter[];
6
+ export declare const custodiesFilters: () => GetProgramAccountsFilter[];
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.lockFilters = exports.valueAverageFilters = exports.DCAFilters = exports.limitFilters = void 0;
3
+ exports.custodiesFilters = exports.lockFilters = exports.valueAverageFilters = exports.DCAFilters = exports.limitFilters = void 0;
4
4
  const structs_1 = require("./structs");
5
5
  const limitFilters = (owner) => [
6
6
  {
@@ -47,4 +47,13 @@ const lockFilters = (owner) => [
47
47
  { dataSize: 296 },
48
48
  ];
49
49
  exports.lockFilters = lockFilters;
50
+ const custodiesFilters = () => [
51
+ {
52
+ memcmp: {
53
+ offset: 0,
54
+ bytes: 'HgWVUrv1XE',
55
+ },
56
+ },
57
+ ];
58
+ exports.custodiesFilters = custodiesFilters;
50
59
  //# sourceMappingURL=filters.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"filters.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/jupiter/exchange/filters.ts"],"names":[],"mappings":";;;AACA,uCAAsC;AAE/B,MAAM,YAAY,GAAG,CAAC,KAAa,EAA8B,EAAE,CAAC;IACzE;QACE,MAAM,EAAE;YACN,MAAM,EAAE,CAAC;YACT,KAAK,EAAE,aAAa;SACrB;KACF;IACD;QACE,MAAM,EAAE;YACN,MAAM,EAAE,CAAC;YACT,KAAK,EAAE,KAAK;SACb;KACF;CACF,CAAC;AAbW,QAAA,YAAY,gBAavB;AAEK,MAAM,UAAU,GAAG,CAAC,KAAa,EAA8B,EAAE,CAAC;IACvE;QACE,MAAM,EAAE;YACN,MAAM,EAAE,CAAC;YACT,KAAK,EAAE,KAAK;SACb;KACF;IACD,EAAE,QAAQ,EAAE,mBAAS,CAAC,QAAQ,EAAE;CACjC,CAAC;AARW,QAAA,UAAU,cAQrB;AAEK,MAAM,mBAAmB,GAAG,CACjC,KAAa,EACe,EAAE,CAAC;IAC/B;QACE,MAAM,EAAE;YACN,MAAM,EAAE,EAAE;YACV,KAAK,EAAE,KAAK;SACb;KACF;IACD,EAAE,QAAQ,EAAE,GAAG,EAAE;CAClB,CAAC;AAVW,QAAA,mBAAmB,uBAU9B;AAEK,MAAM,WAAW,GAAG,CAAC,KAAa,EAA8B,EAAE,CAAC;IACxE;QACE,MAAM,EAAE;YACN,MAAM,EAAE,CAAC;YACT,KAAK,EAAE,KAAK;SACb;KACF;IACD,EAAE,QAAQ,EAAE,GAAG,EAAE;CAClB,CAAC;AARW,QAAA,WAAW,eAQtB"}
1
+ {"version":3,"file":"filters.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/jupiter/exchange/filters.ts"],"names":[],"mappings":";;;AACA,uCAAsC;AAE/B,MAAM,YAAY,GAAG,CAAC,KAAa,EAA8B,EAAE,CAAC;IACzE;QACE,MAAM,EAAE;YACN,MAAM,EAAE,CAAC;YACT,KAAK,EAAE,aAAa;SACrB;KACF;IACD;QACE,MAAM,EAAE;YACN,MAAM,EAAE,CAAC;YACT,KAAK,EAAE,KAAK;SACb;KACF;CACF,CAAC;AAbW,QAAA,YAAY,gBAavB;AAEK,MAAM,UAAU,GAAG,CAAC,KAAa,EAA8B,EAAE,CAAC;IACvE;QACE,MAAM,EAAE;YACN,MAAM,EAAE,CAAC;YACT,KAAK,EAAE,KAAK;SACb;KACF;IACD,EAAE,QAAQ,EAAE,mBAAS,CAAC,QAAQ,EAAE;CACjC,CAAC;AARW,QAAA,UAAU,cAQrB;AAEK,MAAM,mBAAmB,GAAG,CACjC,KAAa,EACe,EAAE,CAAC;IAC/B;QACE,MAAM,EAAE;YACN,MAAM,EAAE,EAAE;YACV,KAAK,EAAE,KAAK;SACb;KACF;IACD,EAAE,QAAQ,EAAE,GAAG,EAAE;CAClB,CAAC;AAVW,QAAA,mBAAmB,uBAU9B;AAEK,MAAM,WAAW,GAAG,CAAC,KAAa,EAA8B,EAAE,CAAC;IACxE;QACE,MAAM,EAAE;YACN,MAAM,EAAE,CAAC;YACT,KAAK,EAAE,KAAK;SACb;KACF;IACD,EAAE,QAAQ,EAAE,GAAG,EAAE;CAClB,CAAC;AARW,QAAA,WAAW,eAQtB;AAEK,MAAM,gBAAgB,GAAG,GAA+B,EAAE,CAAC;IAChE;QACE,MAAM,EAAE;YACN,MAAM,EAAE,CAAC;YACT,KAAK,EAAE,YAAY;SACpB;KACF;CACF,CAAC;AAPW,QAAA,gBAAgB,oBAO3B"}
@@ -54,30 +54,30 @@ function sushiV3PairToUniV2(pair) {
54
54
  }
55
55
  function getV3PairsAddresses(url, length = 300) {
56
56
  return __awaiter(this, void 0, void 0, function* () {
57
- const query = (0, graphql_request_1.gql) `
58
- {
59
- pools(
60
- orderBy: totalValueLockedUSD
61
- first: ${length}
62
- orderDirection: desc
63
- where: { volumeUSD_not: "0", liquidity_not: "0" }
64
- ) {
65
- id
66
- token0Price
67
- token1Price
68
- liquidity
69
- token0 {
70
- id
71
- totalSupply
72
- decimals
73
- }
74
- token1 {
75
- id
76
- totalSupply
77
- decimals
78
- }
79
- }
80
- }
57
+ const query = (0, graphql_request_1.gql) `
58
+ {
59
+ pools(
60
+ orderBy: totalValueLockedUSD
61
+ first: ${length}
62
+ orderDirection: desc
63
+ where: { volumeUSD_not: "0", liquidity_not: "0" }
64
+ ) {
65
+ id
66
+ token0Price
67
+ token1Price
68
+ liquidity
69
+ token0 {
70
+ id
71
+ totalSupply
72
+ decimals
73
+ }
74
+ token1 {
75
+ id
76
+ totalSupply
77
+ decimals
78
+ }
79
+ }
80
+ }
81
81
  `;
82
82
  const res = yield (0, graphql_request_1.default)(url, query);
83
83
  const pools = res.pools;
@@ -40,28 +40,28 @@ function getPairKey(version) {
40
40
  exports.getPairKey = getPairKey;
41
41
  function getPairsV2FromTheGraph(url, length = 300) {
42
42
  return __awaiter(this, void 0, void 0, function* () {
43
- const query = (0, graphql_request_1.gql) `
44
- {
45
- pairs(
46
- orderBy: reserveUSD
47
- first: ${length}
48
- orderDirection: desc
49
- where: { trackedReserveETH_not: "0" }
50
- ) {
51
- id
52
- reserve0
53
- reserve1
54
- totalSupply
55
- token0 {
56
- id
57
- decimals
58
- }
59
- token1 {
60
- id
61
- decimals
62
- }
63
- }
64
- }
43
+ const query = (0, graphql_request_1.gql) `
44
+ {
45
+ pairs(
46
+ orderBy: reserveUSD
47
+ first: ${length}
48
+ orderDirection: desc
49
+ where: { trackedReserveETH_not: "0" }
50
+ ) {
51
+ id
52
+ reserve0
53
+ reserve1
54
+ totalSupply
55
+ token0 {
56
+ id
57
+ decimals
58
+ }
59
+ token1 {
60
+ id
61
+ decimals
62
+ }
63
+ }
64
+ }
65
65
  `;
66
66
  const res = yield (0, graphql_request_1.default)(url, query);
67
67
  const pairs = res.pairs;
@@ -42,20 +42,20 @@ const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/token
42
42
  const clients_1 = require("../../utils/clients");
43
43
  const getMultipleAccountsInfoSafe_1 = require("../../utils/solana/getMultipleAccountsInfoSafe");
44
44
  const helpers_1 = require("./helpers");
45
- const query = (0, graphql_request_1.gql) `
46
- query GetAirdropFinalFrontend($authority: String!) {
47
- getAirdropFinalFrontend(authority: $authority) {
48
- authority
49
- community_allocation
50
- eligibility
51
- main_allocation
52
- og_allocation
53
- s1_allocation
54
- s2_allocation
55
- total_allocation
56
- __typename
57
- }
58
- }
45
+ const query = (0, graphql_request_1.gql) `
46
+ query GetAirdropFinalFrontend($authority: String!) {
47
+ getAirdropFinalFrontend(authority: $authority) {
48
+ authority
49
+ community_allocation
50
+ eligibility
51
+ main_allocation
52
+ og_allocation
53
+ s1_allocation
54
+ s2_allocation
55
+ total_allocation
56
+ __typename
57
+ }
58
+ }
59
59
  `;
60
60
  const networkId = portfolio_core_1.NetworkId.solana;
61
61
  const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
@@ -1,16 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.poolQueryMsg = exports.minterQueryMsg = exports.tokenInfoQueryMsg = exports.infoQueryMsg = void 0;
4
- exports.infoQueryMsg = JSON.parse(`{
5
- "info": {}
4
+ exports.infoQueryMsg = JSON.parse(`{
5
+ "info": {}
6
6
  }`);
7
- exports.tokenInfoQueryMsg = JSON.parse(`{
8
- "token_info": {}
7
+ exports.tokenInfoQueryMsg = JSON.parse(`{
8
+ "token_info": {}
9
9
  }`);
10
- exports.minterQueryMsg = JSON.parse(`{
11
- "minter": {}
10
+ exports.minterQueryMsg = JSON.parse(`{
11
+ "minter": {}
12
12
  }`);
13
- exports.poolQueryMsg = JSON.parse(`{
14
- "pool": {}
13
+ exports.poolQueryMsg = JSON.parse(`{
14
+ "pool": {}
15
15
  }`);
16
16
  //# sourceMappingURL=constants.js.map
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  function getQueryBalanceByOwner(owner) {
4
- return JSON.parse(`{
5
- "balance": {
6
- "address": "${owner}"
7
- }
4
+ return JSON.parse(`{
5
+ "balance": {
6
+ "address": "${owner}"
7
+ }
8
8
  }`);
9
9
  }
10
10
  exports.default = getQueryBalanceByOwner;