@sonarwatch/portfolio-plugins 0.14.13 → 0.14.14

Sign up to get free protection for your applications and to get access to all the features.
Files changed (31) hide show
  1. package/CHANGELOG.md +1636 -1632
  2. package/README.md +3 -3
  3. package/package.json +1 -1
  4. package/src/plugins/abex/positionsFetcher.js +1 -1
  5. package/src/plugins/abex/positionsFetcher.js.map +1 -1
  6. package/src/plugins/balancer/helpers/pools.js +21 -21
  7. package/src/plugins/native-stake/solana/solanaValidatorsJob.js +1 -0
  8. package/src/plugins/native-stake/solana/solanaValidatorsJob.js.map +1 -1
  9. package/src/plugins/native-stake/solana/types.d.ts +2 -0
  10. package/src/plugins/parcl/stakingFetcher.js +9 -34
  11. package/src/plugins/parcl/stakingFetcher.js.map +1 -1
  12. package/src/plugins/parcl/types.d.ts +0 -9
  13. package/src/plugins/sushiswap/helpers.js +24 -24
  14. package/src/plugins/tradeport/bidsFetcher.d.ts +3 -0
  15. package/src/plugins/tradeport/bidsFetcher.js +46 -0
  16. package/src/plugins/tradeport/bidsFetcher.js.map +1 -0
  17. package/src/plugins/tradeport/bidsJob.d.ts +3 -0
  18. package/src/plugins/tradeport/bidsJob.js +41 -0
  19. package/src/plugins/tradeport/bidsJob.js.map +1 -0
  20. package/src/plugins/tradeport/constants.d.ts +4 -0
  21. package/src/plugins/tradeport/constants.js +5 -1
  22. package/src/plugins/tradeport/constants.js.map +1 -1
  23. package/src/plugins/tradeport/index.js +4 -2
  24. package/src/plugins/tradeport/index.js.map +1 -1
  25. package/src/plugins/tradeport/types.d.ts +18 -0
  26. package/src/plugins/uniswap-v2/helpers.js +22 -22
  27. package/src/plugins/zeta/airdropFetcher.js +14 -14
  28. package/src/utils/elementbuilder/LevPositionBuilder.js +2 -1
  29. package/src/utils/elementbuilder/LevPositionBuilder.js.map +1 -1
  30. package/src/utils/sei/constants.js +8 -8
  31. 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.14.13",
3
+ "version": "0.14.14",
4
4
  "type": "commonjs",
5
5
  "types": "./src/index.d.ts",
6
6
  "peerDependencies": {
@@ -52,7 +52,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
52
52
  }
53
53
  }
54
54
  element.addPosition({
55
- address: positionInfo.collateralToken,
55
+ address: positionInfo.indexToken,
56
56
  collateralValue: new bignumber_js_1.default(positionInfo.collateralAmount)
57
57
  .multipliedBy(tokenPriceCollateral.price)
58
58
  .dividedBy(Math.pow(10, tokenPriceCollateral.decimals))
@@ -1 +1 @@
1
- {"version":3,"file":"positionsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/abex/positionsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAAqE;AACrE,gEAAqC;AAErC,2CAA6D;AAE7D,iDAAmD;AACnD,uCAImB;AACnB,gFAA6E;AAG7E,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,sBAAY,GAAE,CAAC;IAE9B,MAAM,mBAAmB,GAAG,MAAM,IAAA,gCAAsB,EAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAExE,IAAI,mBAAmB,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAEhD,MAAM,UAAU,GAAG,MAAM,KAAK,CAAC,OAAO,CAAc,8BAAkB,EAAE;QACtE,MAAM,EAAE,sBAAU;QAClB,SAAS,EAAE,0BAAS,CAAC,GAAG;KACzB,CAAC,CAAC;IAEH,IAAI,CAAC,UAAU;QAAE,OAAO,EAAE,CAAC;IAE3B,MAAM,gBAAgB,GAAG,MAAM,IAAA,6BAAmB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SAAA,EAAE,EAAI,oBAAoB,CAAC,QAAQ,CAAA,CAAC;iBAC9C,QAAQ,EAAE;YACb,IAAI,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,6BAAY,CAAC,IAAI,CAAC,CAAC,CAAC,6BAAY,CAAC,KAAK;YAChE,SAAS,EAAE,IAAI,sBAAS,CAAC,YAAY,CAAC,YAAY,CAAC;YACnD,QAAQ;YACR,QAAQ;SACT,CAAC,CAAC;IACL,CAAC;IAED,OAAO,eAAe,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC5C,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,YAAY;IAC7B,SAAS,EAAE,0BAAS,CAAC,GAAG;IACxB,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"positionsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/abex/positionsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAAqE;AACrE,gEAAqC;AAErC,2CAA6D;AAE7D,iDAAmD;AACnD,uCAImB;AACnB,gFAA6E;AAG7E,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,sBAAY,GAAE,CAAC;IAE9B,MAAM,mBAAmB,GAAG,MAAM,IAAA,gCAAsB,EAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAExE,IAAI,mBAAmB,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAEhD,MAAM,UAAU,GAAG,MAAM,KAAK,CAAC,OAAO,CAAc,8BAAkB,EAAE;QACtE,MAAM,EAAE,sBAAU;QAClB,SAAS,EAAE,0BAAS,CAAC,GAAG;KACzB,CAAC,CAAC;IAEH,IAAI,CAAC,UAAU;QAAE,OAAO,EAAE,CAAC;IAE3B,MAAM,gBAAgB,GAAG,MAAM,IAAA,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,CAAC,SAAA,EAAE,EAAI,oBAAoB,CAAC,QAAQ,CAAA,CAAC;iBAC9C,QAAQ,EAAE;YACb,IAAI,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,6BAAY,CAAC,IAAI,CAAC,CAAC,CAAC,6BAAY,CAAC,KAAK;YAChE,SAAS,EAAE,IAAI,sBAAS,CAAC,YAAY,CAAC,YAAY,CAAC;YACnD,QAAQ;YACR,QAAQ;SACT,CAAC,CAAC;IACL,CAAC;IAED,OAAO,eAAe,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC5C,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,YAAY;IAC7B,SAAS,EAAE,0BAAS,CAAC,GAAG;IACxB,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,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;
@@ -34,6 +34,7 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
34
34
  jitoApy: r.jito_apy,
35
35
  stakingApy: r.staking_apy,
36
36
  totalApy: r.total_apy,
37
+ commission: r.commission,
37
38
  }));
38
39
  yield cache.setItem(constants_1.validatorsKey, validators, {
39
40
  prefix: constants_1.platformId,
@@ -1 +1 @@
1
- {"version":3,"file":"solanaValidatorsJob.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/native-stake/solana/solanaValidatorsJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAAuD;AACvD,kDAA6C;AAG7C,4CAAyD;AACzD,2CAA0C;AAG1C,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,GAAG,GAAG,MAAM,eAAK;SACpB,GAAG,CAAgD,uBAAW,EAAE;QAC/D,OAAO,EAAE,KAAK;KACf,CAAC;SACD,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;QACb,MAAM,KAAK,CAAC,qBAAqB,GAAG,EAAE,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;IAEL,IAAI,CAAC,GAAG,CAAC,IAAI;QAAE,MAAM,KAAK,CAAC,sBAAsB,CAAC,CAAC;IAEnD,MAAM,UAAU,GAAgB,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACnD,KAAK,EAAE,CAAC,CAAC,aAAa;QACtB,IAAI,EAAE,CAAC,CAAC,IAAI;QACZ,QAAQ,EAAE,CAAC,CAAC,KAAK;QACjB,OAAO,EAAE,CAAC,CAAC,YAAY;QACvB,OAAO,EAAE,CAAC,CAAC,QAAQ;QACnB,UAAU,EAAE,CAAC,CAAC,WAAW;QACzB,QAAQ,EAAE,CAAC,CAAC,SAAS;KACtB,CAAC,CAAC,CAAC;IAEJ,MAAM,KAAK,CAAC,OAAO,CAAC,yBAAa,EAAE,UAAU,EAAE;QAC7C,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,oBAAoB;IACrC,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
1
+ {"version":3,"file":"solanaValidatorsJob.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/native-stake/solana/solanaValidatorsJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAAuD;AACvD,kDAA6C;AAG7C,4CAAyD;AACzD,2CAA0C;AAG1C,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,GAAG,GAAG,MAAM,eAAK;SACpB,GAAG,CAAgD,uBAAW,EAAE;QAC/D,OAAO,EAAE,KAAK;KACf,CAAC;SACD,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;QACb,MAAM,KAAK,CAAC,qBAAqB,GAAG,EAAE,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;IAEL,IAAI,CAAC,GAAG,CAAC,IAAI;QAAE,MAAM,KAAK,CAAC,sBAAsB,CAAC,CAAC;IAEnD,MAAM,UAAU,GAAgB,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACnD,KAAK,EAAE,CAAC,CAAC,aAAa;QACtB,IAAI,EAAE,CAAC,CAAC,IAAI;QACZ,QAAQ,EAAE,CAAC,CAAC,KAAK;QACjB,OAAO,EAAE,CAAC,CAAC,YAAY;QACvB,OAAO,EAAE,CAAC,CAAC,QAAQ;QACnB,UAAU,EAAE,CAAC,CAAC,WAAW;QACzB,QAAQ,EAAE,CAAC,CAAC,SAAS;QACrB,UAAU,EAAE,CAAC,CAAC,UAAU;KACzB,CAAC,CAAC,CAAC;IAEJ,MAAM,KAAK,CAAC,OAAO,CAAC,yBAAa,EAAE,UAAU,EAAE;QAC7C,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,oBAAoB;IACrC,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
@@ -7,6 +7,7 @@ export type ValidatorApiResponse = {
7
7
  jito_apy: number;
8
8
  staking_apy: number;
9
9
  total_apy: number;
10
+ commission: number;
10
11
  };
11
12
  export type Validator = {
12
13
  voter: string;
@@ -16,4 +17,5 @@ export type Validator = {
16
17
  jitoApy: number;
17
18
  stakingApy: number;
18
19
  totalApy: number;
20
+ commission: number;
19
21
  };
@@ -15,37 +15,11 @@ const constants_1 = require("./constants");
15
15
  const clients_1 = require("../../utils/clients");
16
16
  const solana_1 = require("../../utils/solana");
17
17
  const ElementRegistry_1 = require("../../utils/elementbuilder/ElementRegistry");
18
- const decodePosition = (buffer) => ({
19
- amount: Number(buffer.readBigUInt64LE(1)),
20
- activationEpoch: Number(buffer.readBigUInt64LE(1 + 8)),
21
- unlockingStart: Number(buffer.readBigUInt64LE(1 + 8 + 8)),
22
- });
23
- const decodePositionAccount = (buffer) => {
24
- let i = 0;
25
- buffer.slice(i, i + 8);
26
- i += 8;
27
- const owner = new web3_js_1.PublicKey(buffer.slice(i, i + 32)).toString();
28
- i += 32;
29
- const positions = [];
30
- let position;
31
- for (let t = 0; t < 20; t++) {
32
- position = decodePosition(buffer.slice(i, i + 200));
33
- if (position.amount > 0)
34
- positions.push(position);
35
- else
36
- break;
37
- i += 200;
38
- }
39
- return {
40
- owner,
41
- positions,
42
- };
43
- };
44
18
  const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
45
19
  const client = (0, clients_1.getClientSolana)();
20
+ // https://github.com/pyth-network/governance/blob/f624ea17fd2e7b22c799ffc2a560257d155410a5/staking/app/StakeConnection.ts
46
21
  const accs = yield (0, solana_1.getProgramAccounts)(client, constants_1.stakingProgramId, [
47
22
  {
48
- // account PositionData
49
23
  memcmp: {
50
24
  offset: 0,
51
25
  bytes: 'FM2r3wAdZaa',
@@ -54,22 +28,23 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
54
28
  {
55
29
  memcmp: {
56
30
  offset: 8,
57
- bytes: new web3_js_1.PublicKey(owner).toString(),
31
+ bytes: owner,
58
32
  },
59
33
  },
60
34
  ]);
61
35
  if (accs.length === 0)
62
36
  return [];
63
- const positions = accs.map((acc) => acc && decodePositionAccount(acc.account.data));
37
+ const tokenBalances = yield Promise.all(accs.map((acc) => __awaiter(void 0, void 0, void 0, function* () {
38
+ const tokenAccount = yield client.getTokenAccountBalance(web3_js_1.PublicKey.findProgramAddressSync([Buffer.from('custody'), acc.pubkey.toBuffer()], constants_1.stakingProgramId)[0]);
39
+ return Number(tokenAccount.value.amount);
40
+ })));
64
41
  const elementRegistry = new ElementRegistry_1.ElementRegistry(portfolio_core_1.NetworkId.solana, constants_1.platformId);
65
42
  const element = elementRegistry.addElementMultiple({
66
43
  label: 'Staked',
67
44
  });
68
- positions.forEach((positionAccount) => {
69
- element.addAsset({
70
- address: constants_1.prclMint,
71
- amount: positionAccount.positions.reduce((sum, position) => sum + Number(position.amount), 0),
72
- });
45
+ element.addAsset({
46
+ address: constants_1.prclMint,
47
+ amount: tokenBalances.reduce((sum, current) => sum + current, 0),
73
48
  });
74
49
  return elementRegistry.getElements(cache);
75
50
  });
@@ -1 +1 @@
1
- {"version":3,"file":"stakingFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/parcl/stakingFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAuD;AACvD,6CAA4C;AAE5C,2CAAqE;AAErE,iDAAsD;AACtD,+CAAwD;AAExD,gFAA6E;AAE7E,MAAM,cAAc,GAAG,CAAC,MAAc,EAAY,EAAE,CAAC,CAAC;IACpD,MAAM,EAAE,M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;KAChB,CAAC,CAAC;IAEH,OAAO,CAAC,QAAQ,CAAC;QACf,OAAO,EAAE,oBAAQ;QACjB,MAAM,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,OAAO,EAAE,EAAE,CAAC,GAAG,GAAG,OAAO,EAAE,CAAC,CAAC;KACjE,CAAC,CAAC;IAEH,OAAO,eAAe,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC5C,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"}
@@ -7,12 +7,3 @@ export type ApiAirdropResponse = {
7
7
  merkle_tree?: string;
8
8
  error?: string;
9
9
  };
10
- export type PositionAccount = {
11
- owner: string;
12
- positions: Position[];
13
- };
14
- export type Position = {
15
- amount: number;
16
- activationEpoch: number;
17
- unlockingStart: number;
18
- };
@@ -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;
@@ -0,0 +1,3 @@
1
+ import { Fetcher } from '../../Fetcher';
2
+ declare const fetcher: Fetcher;
3
+ export default fetcher;
@@ -0,0 +1,46 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ const portfolio_core_1 = require("@sonarwatch/portfolio-core");
13
+ const constants_1 = require("./constants");
14
+ const MemoizedCache_1 = require("../../utils/misc/MemoizedCache");
15
+ const ElementRegistry_1 = require("../../utils/elementbuilder/ElementRegistry");
16
+ const bidsMemo = new MemoizedCache_1.MemoizedCache(constants_1.bidsCacheKey, {
17
+ prefix: constants_1.platformId,
18
+ networkId: portfolio_core_1.NetworkId.sui,
19
+ });
20
+ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
21
+ const allBids = yield bidsMemo.getItem(cache);
22
+ if (!allBids)
23
+ return [];
24
+ const bids = allBids.filter((bid) => bid.buyer === owner);
25
+ if (!bids)
26
+ return [];
27
+ const registry = new ElementRegistry_1.ElementRegistry(portfolio_core_1.NetworkId.sui, constants_1.platformId);
28
+ const element = registry.addElementMultiple({
29
+ label: 'Deposit',
30
+ tags: ['Bids'],
31
+ });
32
+ bids.forEach((bid) => {
33
+ element.addAsset({
34
+ address: portfolio_core_1.suiNativeAddress,
35
+ amount: bid.wallet.fields.balance,
36
+ });
37
+ });
38
+ return registry.getElements(cache);
39
+ });
40
+ const fetcher = {
41
+ id: `${constants_1.platformId}-bids`,
42
+ networkId: portfolio_core_1.NetworkId.sui,
43
+ executor,
44
+ };
45
+ exports.default = fetcher;
46
+ //# sourceMappingURL=bidsFetcher.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bidsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/tradeport/bidsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAyE;AAEzE,2CAAuD;AAEvD,kEAA+D;AAE/D,gFAA6E;AAE7E,MAAM,QAAQ,GAAG,IAAI,6BAAa,CAAQ,wBAAY,EAAE;IACtD,MAAM,EAAE,sBAAU;IAClB,SAAS,EAAE,0BAAS,CAAC,GAAG;CACzB,CAAC,CAAC;AAEH,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC9C,IAAI,CAAC,OAAO;QAAE,OAAO,EAAE,CAAC;IAExB,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC;IAC1D,IAAI,CAAC,IAAI;QAAE,OAAO,EAAE,CAAC;IAErB,MAAM,QAAQ,GAAG,IAAI,iCAAe,CAAC,0BAAS,CAAC,GAAG,EAAE,sBAAU,CAAC,CAAC;IAChE,MAAM,OAAO,GAAG,QAAQ,CAAC,kBAAkB,CAAC;QAC1C,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,CAAC,MAAM,CAAC;KACf,CAAC,CAAC;IACH,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;QACnB,OAAO,CAAC,QAAQ,CAAC;YACf,OAAO,EAAE,iCAAgB;YACzB,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO;SAClC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,QAAQ,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AACrC,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,OAAO;IACxB,SAAS,EAAE,0BAAS,CAAC,GAAG;IACxB,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Job } from '../../Job';
2
+ declare const job: Job;
3
+ export default job;
@@ -0,0 +1,41 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ const portfolio_core_1 = require("@sonarwatch/portfolio-core");
13
+ const constants_1 = require("./constants");
14
+ const clients_1 = require("../../utils/clients");
15
+ const getDynamicFieldObjects_1 = require("../../utils/sui/getDynamicFieldObjects");
16
+ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
17
+ const client = (0, clients_1.getClientSui)();
18
+ const objects = yield (0, getDynamicFieldObjects_1.getDynamicFieldObjects)(client, constants_1.bidsStore, {
19
+ showContent: true,
20
+ });
21
+ const bids = objects
22
+ .map((obj) => {
23
+ var _a, _b, _c, _d;
24
+ if (((_b = (_a = obj.data) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.type) && ((_d = (_c = obj.data) === null || _c === void 0 ? void 0 : _c.content) === null || _d === void 0 ? void 0 : _d.type) === constants_1.bidsType) {
25
+ return obj.data.content.fields;
26
+ }
27
+ return [];
28
+ })
29
+ .flat();
30
+ yield cache.setItem(constants_1.bidsCacheKey, bids, {
31
+ prefix: constants_1.platformId,
32
+ networkId: portfolio_core_1.NetworkId.sui,
33
+ });
34
+ });
35
+ const job = {
36
+ id: `${constants_1.platformId}-bids`,
37
+ executor,
38
+ label: 'realtime',
39
+ };
40
+ exports.default = job;
41
+ //# sourceMappingURL=bidsJob.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bidsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/tradeport/bidsJob.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAuD;AAGvD,2CAA4E;AAC5E,iDAAmD;AACnD,mFAAgF;AAGhF,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,MAAM,GAAG,IAAA,sBAAY,GAAE,CAAC;IAE9B,MAAM,OAAO,GAAG,MAAM,IAAA,+CAAsB,EAAC,MAAM,EAAE,qBAAS,EAAE;QAC9D,WAAW,EAAE,IAAI;KAClB,CAAC,CAAC;IAEH,MAAM,IAAI,GAAU,OAAO;SACxB,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;;QACX,IAAI,CAAA,MAAA,MAAA,GAAG,CAAC,IAAI,0CAAE,OAAO,0CAAE,IAAI,KAAI,CAAA,MAAA,MAAA,GAAG,CAAC,IAAI,0CAAE,OAAO,0CAAE,IAAI,MAAK,oBAAQ,EAAE,CAAC;YACpE,OAAO,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,MAAa,CAAC;QACxC,CAAC;QACD,OAAO,EAAE,CAAC;IACZ,CAAC,CAAC;SACD,IAAI,EAAE,CAAC;IAEV,MAAM,KAAK,CAAC,OAAO,CAAC,wBAAY,EAAE,IAAI,EAAE;QACtC,MAAM,EAAE,sBAAU;QAClB,SAAS,EAAE,0BAAS,CAAC,GAAG;KACzB,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AAEF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,OAAO;IACxB,QAAQ;IACR,KAAK,EAAE,UAAU;CAClB,CAAC;AACF,kBAAe,GAAG,CAAC"}
@@ -2,4 +2,8 @@ import { Platform } from '@sonarwatch/portfolio-core';
2
2
  export declare const platformId = "tradeport";
3
3
  export declare const platform: Platform;
4
4
  export declare const locksCacheKey = "locks";
5
+ export declare const bidsCacheKey = "bids";
5
6
  export declare const lockStore = "0x4b705de46a79b29276baf45009bc7d6f70cc0f1407f0c9e03cac5729c0c47946";
7
+ export declare const bidsStore = "0x1e5e7f38e3a61d1d189506d0fc6b7e47e935a292d9e1b23c0f3f1c0f94227772";
8
+ export declare const bidsType = "0xec175e537be9e48f75fa6929291de6454d2502f1091feb22c0d26a22821bbf28::kiosk_biddings::Bid";
9
+ export declare const escrowType = "0xec175e537be9e48f75fa6929291de6454d2502f1091feb22c0d26a22821bbf28::kiosk_biddings::Escrow";
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.lockStore = exports.locksCacheKey = exports.platform = exports.platformId = void 0;
3
+ exports.escrowType = exports.bidsType = exports.bidsStore = exports.lockStore = exports.bidsCacheKey = exports.locksCacheKey = exports.platform = exports.platformId = void 0;
4
4
  exports.platformId = 'tradeport';
5
5
  exports.platform = {
6
6
  id: exports.platformId,
@@ -11,5 +11,9 @@ exports.platform = {
11
11
  // defiLlamaId: 'foo-finance', // from https://defillama.com/docs/api
12
12
  };
13
13
  exports.locksCacheKey = `locks`;
14
+ exports.bidsCacheKey = `bids`;
14
15
  exports.lockStore = '0x4b705de46a79b29276baf45009bc7d6f70cc0f1407f0c9e03cac5729c0c47946';
16
+ exports.bidsStore = '0x1e5e7f38e3a61d1d189506d0fc6b7e47e935a292d9e1b23c0f3f1c0f94227772';
17
+ exports.bidsType = '0xec175e537be9e48f75fa6929291de6454d2502f1091feb22c0d26a22821bbf28::kiosk_biddings::Bid';
18
+ exports.escrowType = '0xec175e537be9e48f75fa6929291de6454d2502f1091feb22c0d26a22821bbf28::kiosk_biddings::Escrow';
15
19
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/tradeport/constants.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG,WAAW,CAAC;AACzB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,WAAW;IACjB,KAAK,EAAE,kDAAkD;IACzD,OAAO,EAAE,4BAA4B;IACrC,OAAO,EAAE,4BAA4B;IACrC,qEAAqE;CACtE,CAAC;AACW,QAAA,aAAa,GAAG,OAAO,CAAC;AAExB,QAAA,SAAS,GACpB,oEAAoE,CAAC"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/tradeport/constants.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG,WAAW,CAAC;AACzB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,WAAW;IACjB,KAAK,EAAE,kDAAkD;IACzD,OAAO,EAAE,4BAA4B;IACrC,OAAO,EAAE,4BAA4B;IACrC,qEAAqE;CACtE,CAAC;AACW,QAAA,aAAa,GAAG,OAAO,CAAC;AACxB,QAAA,YAAY,GAAG,MAAM,CAAC;AAEtB,QAAA,SAAS,GACpB,oEAAoE,CAAC;AAC1D,QAAA,SAAS,GACpB,oEAAoE,CAAC;AAC1D,QAAA,QAAQ,GACnB,yFAAyF,CAAC;AAC/E,QAAA,UAAU,GACrB,4FAA4F,CAAC"}
@@ -7,7 +7,9 @@ exports.fetchers = exports.jobs = exports.platforms = void 0;
7
7
  const constants_1 = require("./constants");
8
8
  const positionsFetcher_1 = __importDefault(require("./positionsFetcher"));
9
9
  const locksJob_1 = __importDefault(require("./locksJob"));
10
+ const bidsJob_1 = __importDefault(require("./bidsJob"));
11
+ const bidsFetcher_1 = __importDefault(require("./bidsFetcher"));
10
12
  exports.platforms = [constants_1.platform];
11
- exports.jobs = [locksJob_1.default];
12
- exports.fetchers = [positionsFetcher_1.default];
13
+ exports.jobs = [locksJob_1.default, bidsJob_1.default];
14
+ exports.fetchers = [positionsFetcher_1.default, bidsFetcher_1.default];
13
15
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/tradeport/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAAuC;AACvC,0EAAkD;AAClD,0DAAkC;AAErB,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC;AACnC,QAAA,IAAI,GAAU,CAAC,kBAAQ,CAAC,CAAC;AACzB,QAAA,QAAQ,GAAc,CAAC,0BAAgB,CAAC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/tradeport/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAAuC;AACvC,0EAAkD;AAClD,0DAAkC;AAClC,wDAAgC;AAChC,gEAAwC;AAE3B,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC;AACnC,QAAA,IAAI,GAAU,CAAC,kBAAQ,EAAE,iBAAO,CAAC,CAAC;AAClC,QAAA,QAAQ,GAAc,CAAC,0BAAgB,EAAE,qBAAW,CAAC,CAAC"}
@@ -23,3 +23,21 @@ export type LockObject = {
23
23
  name: number[];
24
24
  value: Lock;
25
25
  };
26
+ export type Bid = {
27
+ beneficiary: string;
28
+ buyer: string;
29
+ commission: string;
30
+ id: ID;
31
+ nft_id: null;
32
+ nft_type: string;
33
+ price: string;
34
+ wallet: Wallet;
35
+ };
36
+ export type Wallet = {
37
+ fields: Fields;
38
+ type: string;
39
+ };
40
+ export type Fields = {
41
+ balance: string;
42
+ id: ID;
43
+ };
@@ -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* () {
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.LevPositionBuilder = void 0;
7
+ const portfolio_core_1 = require("@sonarwatch/portfolio-core");
7
8
  const bignumber_js_1 = __importDefault(require("bignumber.js"));
8
9
  class LevPositionBuilder {
9
10
  constructor(params) {
@@ -32,7 +33,7 @@ class LevPositionBuilder {
32
33
  collateralValue = new bignumber_js_1.default(this.params.collateralValue);
33
34
  }
34
35
  return {
35
- address: this.params.address,
36
+ address: (0, portfolio_core_1.formatTokenAddress)(this.params.address, networkId),
36
37
  side: this.params.side,
37
38
  liquidationPrice: this.params.liquidationPrice || null,
38
39
  collateralValue: collateralValue.toNumber(),
@@ -1 +1 @@
1
- {"version":3,"file":"LevPositionBuilder.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/elementbuilder/LevPositionBuilder.ts"],"names":[],"mappings":";;;;;;AACA,gEAAqC;AAIrC,MAAa,kBAAkB;IAG7B,YAAY,MAAyB;QACnC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,KAAK;QACH,IAAI,IAAI,CAAC,MAAM,CAAC,gBAAgB;YAAE,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAC/D,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,GAAG,CACD,SAAwB,EACxB,WAA0B;;QAE1B,IAAI,eAAe,CAAC;QACpB,IAAI,IAAI,CAAC,MAAM,CAAC,gBAAgB,EAAE,CAAC;YACjC,MAAM,oBAAoB,GAAG,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;YAClE,I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E;YAC3C,QAAQ,EAAE,MAAA,IAAI,CAAC,MAAM,CAAC,QAAQ,0CAAE,QAAQ,EAAE;YAC1C,KAAK,EAAE,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,IAAI,CAAC,CAAC,CAAC,QAAQ,EAAE;YACjE,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI;YACtB,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ;YAC9B,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ;SAChB,CAAC;IACnB,CAAC;CACF;AA1CD,gDA0CC"}
@@ -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;