@sonarwatch/portfolio-plugins 0.12.23 → 0.12.25

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [0.12.25](https://github.com/sonarwatch/portfolio/compare/plugins-0.12.24...plugins-0.12.25) (2024-06-13)
6
+
7
+
8
+
9
+ ## [0.12.24](https://github.com/sonarwatch/portfolio/compare/plugins-0.12.23...plugins-0.12.24) (2024-06-13)
10
+
11
+
12
+
5
13
  ## [0.12.23](https://github.com/sonarwatch/portfolio/compare/plugins-0.12.22...plugins-0.12.23) (2024-06-10)
6
14
 
7
15
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sonarwatch/portfolio-plugins",
3
- "version": "0.12.23",
3
+ "version": "0.12.25",
4
4
  "type": "commonjs",
5
5
  "types": "./src/index.d.ts",
6
6
  "peerDependencies": {
@@ -9,7 +9,7 @@
9
9
  "dependencies": {
10
10
  "@aave/contract-helpers": "^1.28.2",
11
11
  "@aave/math-utils": "^1.28.2",
12
- "@aptos-labs/ts-sdk": "^1.11.0",
12
+ "@aptos-labs/ts-sdk": "^1.19.0",
13
13
  "@bonfida/spl-name-service": "^1.0.10",
14
14
  "@cosmjs/cosmwasm-stargate": "^0.31.1",
15
15
  "ethers": "^5.7.2",
@@ -1,2 +1,2 @@
1
1
  import { AptosClient } from '../clients/types';
2
- export declare function getAccountResources(client: AptosClient, accountAddress: string): Promise<import("@aptos-labs/ts-sdk/dist/common/accountAddress-ccLvlUQe").u[] | null>;
2
+ export declare function getAccountResources(client: AptosClient, accountAddress: string): Promise<import("@aptos-labs/ts-sdk/dist/common/accountAddress-Lv-GSihU").w[] | null>;
@@ -1,2 +1,2 @@
1
1
  import { AptosClient } from '../clients/types';
2
- export declare function getCoinStoreResources(client: AptosClient, owner: string): Promise<import("@aptos-labs/ts-sdk/dist/common/accountAddress-ccLvlUQe").u[] | null>;
2
+ export declare function getCoinStoreResources(client: AptosClient, owner: string): Promise<import("@aptos-labs/ts-sdk/dist/common/accountAddress-Lv-GSihU").w[] | null>;
@@ -1,3 +1,3 @@
1
1
  import { InputViewFunctionData } from '@aptos-labs/ts-sdk';
2
2
  import { AptosClient } from '../clients/types';
3
- export declare function getView(client: AptosClient, payload: InputViewFunctionData): Promise<import("@aptos-labs/ts-sdk/dist/common/accountAddress-ccLvlUQe").a4[] | null>;
3
+ export declare function getView(client: AptosClient, payload: InputViewFunctionData): Promise<import("@aptos-labs/ts-sdk/dist/common/accountAddress-Lv-GSihU").a7[] | null>;
@@ -11,22 +11,23 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.nameService = void 0;
13
13
  const portfolio_core_1 = require("@sonarwatch/portfolio-core");
14
+ const clients_1 = require("../../clients");
14
15
  function getOwner(name) {
15
16
  return __awaiter(this, void 0, void 0, function* () {
16
- const response = yield fetch(`https://www.aptosnames.com/api/mainnet/v1/address/${name}`);
17
- const { address } = yield response.json();
18
- if (!address)
17
+ const res = yield (0, clients_1.getClientAptos)().getName({ name });
18
+ if (!(res === null || res === void 0 ? void 0 : res.owner_address))
19
19
  return null;
20
- return address;
20
+ return res.owner_address;
21
21
  });
22
22
  }
23
23
  function getNames(address) {
24
24
  return __awaiter(this, void 0, void 0, function* () {
25
- const response = yield fetch(`https://www.aptosnames.com/api/mainnet/v1/primary-name/${address}`);
26
- const { name } = yield response.json();
27
- if (!name)
25
+ const res = yield (0, clients_1.getClientAptos)().getAccountNames({
26
+ accountAddress: address,
27
+ });
28
+ if (res.length === 0)
28
29
  return [];
29
- return [`${name}.apt`];
30
+ return res.map((el) => (el.domain ? `${el.domain}.apt` : [])).flat();
30
31
  });
31
32
  }
32
33
  exports.nameService = {
@@ -1 +1 @@
1
- {"version":3,"file":"aptos.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/utils/name-service/services/aptos.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+DAA8D;AAG9D,SAAe,QAAQ,CAAC,IAAY;;QAClC,MAAM,QAAQ,GAAG,MAAM,KAAK,CAC1B,qDAAqD,IAAI,EAAE,CAC5D,CAAC;QACF,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;QAC1C,IAAI,CAAC,OAAO;YAAE,OAAO,IAAI,CAAC;QAC1B,OAAO,OAAO,CAAC;IACjB,CAAC;CAAA;AAED,SAAe,QAAQ,CAAC,OAAe;;QACrC,MAAM,QAAQ,GAAG,MAAM,KAAK,CAC1B,0DAA0D,OAAO,EAAE,CACpE,CAAC;QACF,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;QACvC,IAAI,CAAC,IAAI;YAAE,OAAO,EAAE,CAAC;QACrB,OAAO,CAAC,GAAG,IAAI,MAAM,CAAC,CAAC;IACzB,CAAC;CAAA;AAEY,QAAA,WAAW,GAAgB;IACtC,EAAE,EAAE,OAAO;IACX,OAAO,EAAE,iCAAgB;IACzB,QAAQ;IACR,QAAQ;CACT,CAAC"}
1
+ {"version":3,"file":"aptos.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/utils/name-service/services/aptos.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+DAA8D;AAE9D,2CAA+C;AAE/C,SAAe,QAAQ,CAAC,IAAY;;QAClC,MAAM,GAAG,GAAG,MAAM,IAAA,wBAAc,GAAE,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;QACrD,IAAI,CAAC,CAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,aAAa,CAAA;YAAE,OAAO,IAAI,CAAC;QAErC,OAAO,GAAG,CAAC,aAAa,CAAC;IAC3B,CAAC;CAAA;AAED,SAAe,QAAQ,CAAC,OAAe;;QACrC,MAAM,GAAG,GAAG,MAAM,IAAA,wBAAc,GAAE,CAAC,eAAe,CAAC;YACjD,cAAc,EAAE,OAAO;SACxB,CAAC,CAAC;QAEH,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,EAAE,CAAC;QAChC,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,MAAM,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IACvE,CAAC;CAAA;AAEY,QAAA,WAAW,GAAgB;IACtC,EAAE,EAAE,OAAO;IACX,OAAO,EAAE,iCAAgB;IACzB,QAAQ;IACR,QAAQ;CACT,CAAC"}