@sonarwatch/portfolio-plugins 0.12.176 → 0.12.177

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. package/CHANGELOG.md +1510 -1506
  2. package/README.md +3 -3
  3. package/package.json +1 -1
  4. package/src/index.js +4 -0
  5. package/src/index.js.map +1 -1
  6. package/src/plugins/balancer/helpers/pools.js +21 -21
  7. package/src/plugins/elemental/constants.d.ts +6 -0
  8. package/src/plugins/elemental/constants.js +20 -0
  9. package/src/plugins/elemental/constants.js.map +1 -0
  10. package/src/plugins/elemental/depositFetcher.d.ts +5 -0
  11. package/src/plugins/elemental/depositFetcher.js +96 -0
  12. package/src/plugins/elemental/depositFetcher.js.map +1 -0
  13. package/src/plugins/elemental/elementalVaultIDL.d.ts +67 -0
  14. package/src/plugins/elemental/elementalVaultIDL.js +342 -0
  15. package/src/plugins/elemental/elementalVaultIDL.js.map +1 -0
  16. package/src/plugins/elemental/filters.d.ts +3 -0
  17. package/src/plugins/elemental/filters.js +21 -0
  18. package/src/plugins/elemental/filters.js.map +1 -0
  19. package/src/plugins/elemental/helpers.d.ts +5 -0
  20. package/src/plugins/elemental/helpers.js +29 -0
  21. package/src/plugins/elemental/helpers.js.map +1 -0
  22. package/src/plugins/elemental/index.d.ts +6 -0
  23. package/src/plugins/elemental/index.js +13 -0
  24. package/src/plugins/elemental/index.js.map +1 -0
  25. package/src/plugins/elemental/poolsJob.d.ts +3 -0
  26. package/src/plugins/elemental/poolsJob.js +35 -0
  27. package/src/plugins/elemental/poolsJob.js.map +1 -0
  28. package/src/plugins/elemental/structs.d.ts +48 -0
  29. package/src/plugins/elemental/structs.js +50 -0
  30. package/src/plugins/elemental/structs.js.map +1 -0
  31. package/src/plugins/elemental/types.d.ts +37 -0
  32. package/src/plugins/elemental/types.js +3 -0
  33. package/src/plugins/elemental/types.js.map +1 -0
  34. package/src/plugins/sushiswap/helpers.js +24 -24
  35. package/src/plugins/uniswap-v2/helpers.js +22 -22
  36. package/src/plugins/zeta/airdropFetcher.js +14 -14
  37. package/src/utils/elementbuilder/AssetBuilder.d.ts +2 -1
  38. package/src/utils/elementbuilder/AssetBuilder.js +2 -1
  39. package/src/utils/elementbuilder/AssetBuilder.js.map +1 -1
  40. package/src/utils/elementbuilder/PortfolioAssetParams.d.ts +2 -0
  41. package/src/utils/sei/constants.js +8 -8
  42. package/src/utils/sei/getQueryBalanceByOwner.js +4 -4
@@ -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,10 +1,11 @@
1
- import { NetworkIdType, PortfolioAsset } from '@sonarwatch/portfolio-core';
1
+ import { NetworkIdType, PortfolioAsset, PortfolioAssetAttributes } from '@sonarwatch/portfolio-core';
2
2
  import BigNumber from 'bignumber.js';
3
3
  import { PortfolioAssetParams } from './PortfolioAssetParams';
4
4
  import { TokenPriceMap } from '../../TokenPriceMap';
5
5
  export declare class AssetBuilder {
6
6
  address: string;
7
7
  amount: number | BigNumber | string;
8
+ attributes: PortfolioAssetAttributes;
8
9
  alreadyShifted: boolean;
9
10
  constructor(params: PortfolioAssetParams);
10
11
  get(networkId: NetworkIdType, tokenPrices: TokenPriceMap): PortfolioAsset | null;
@@ -10,6 +10,7 @@ class AssetBuilder {
10
10
  constructor(params) {
11
11
  this.address = params.address.toString();
12
12
  this.amount = params.amount;
13
+ this.attributes = params.attributes || {};
13
14
  this.alreadyShifted = params.alreadyShifted || false;
14
15
  }
15
16
  get(networkId, tokenPrices) {
@@ -21,7 +22,7 @@ class AssetBuilder {
21
22
  return null;
22
23
  if (!this.alreadyShifted)
23
24
  amount = amount.dividedBy(Math.pow(10, tokenPrice.decimals));
24
- return (0, tokenPriceToAssetToken_1.default)(tokenPrice.address, amount.toNumber(), networkId, tokenPrice);
25
+ return (0, tokenPriceToAssetToken_1.default)(tokenPrice.address, amount.toNumber(), networkId, tokenPrice, undefined, this.attributes);
25
26
  }
26
27
  }
27
28
  exports.AssetBuilder = AssetBuilder;
@@ -1 +1 @@
1
- {"version":3,"file":"AssetBuilder.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/elementbuilder/AssetBuilder.ts"],"names":[],"mappings":";;;;;;AACA,gEAAqC;AAErC,4FAAoE;AAGpE,MAAa,YAAY;IAKvB,YAAY,MAA4B;QACtC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;QACzC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QAC5B,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,cAAc,IAAI,KAAK,CAAC;IACvD,CAAC;IAED,GAAG,CACD,SAAwB,EACxB,WAA0B;QAE1B,IAAI,MAAM,GAAG,IAAI,sBAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACxC,IAAI,MAAM,CAAC,MAAM,EAAE;YAAE,OAAO,IAAI,CAAC;QACjC,MAAM,UAAU,GAAG,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACjD,IAAI,CAAC,UAAU;YAAE,OAAO,IAAI,CAAC;QAE7B,IAAI,CAAC,IAAI,CAAC,cAAc;YACtB,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,SAAA,EAAE,EAAI,UAAU,CAAC,QAAQ,CAAA,CAAC,CAAC;QAEvD,OAAO,IAAA,gCAAsB,EAC3B,UAAU,CAAC,OAAO,EAClB,MAAM,CAAC,QAAQ,EAAE,EACjB,SAAS,EACT,UAAU,CACX,CAAC;IACJ,CAAC;CACF;AA9BD,oCA8BC"}
1
+ {"version":3,"file":"AssetBuilder.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/elementbuilder/AssetBuilder.ts"],"names":[],"mappings":";;;;;;AAKA,gEAAqC;AAErC,4FAAoE;AAGpE,MAAa,YAAY;IAMvB,YAAY,MAA4B;QACtC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;QACzC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QAC5B,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,IAAI,EAAE,CAAC;QAC1C,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,cAAc,IAAI,KAAK,CAAC;IACvD,CAAC;IAED,GAAG,CACD,SAAwB,EACxB,WAA0B;QAE1B,IAAI,MAAM,GAAG,IAAI,sBAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACxC,IAAI,MAAM,CAAC,MAAM,EAAE;YAAE,OAAO,IAAI,CAAC;QACjC,MAAM,UAAU,GAAG,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACjD,IAAI,CAAC,UAAU;YAAE,OAAO,IAAI,CAAC;QAE7B,IAAI,CAAC,IAAI,CAAC,cAAc;YACtB,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,SAAA,EAAE,EAAI,UAAU,CAAC,QAAQ,CAAA,CAAC,CAAC;QAEvD,OAAO,IAAA,gCAAsB,EAC3B,UAAU,CAAC,OAAO,EAClB,MAAM,CAAC,QAAQ,EAAE,EACjB,SAAS,EACT,UAAU,EACV,SAAS,EACT,IAAI,CAAC,UAAU,CAChB,CAAC;IACJ,CAAC;CACF;AAlCD,oCAkCC"}
@@ -1,7 +1,9 @@
1
1
  import BigNumber from 'bignumber.js';
2
2
  import { PublicKey } from '@solana/web3.js';
3
+ import { PortfolioAssetAttributes } from '@sonarwatch/portfolio-core';
3
4
  export type PortfolioAssetParams = {
4
5
  address: string | PublicKey;
5
6
  amount: number | BigNumber | string;
7
+ attributes?: PortfolioAssetAttributes;
6
8
  alreadyShifted?: boolean;
7
9
  };
@@ -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;