@cityofzion/blockchain-service 0.8.0 → 0.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -55,7 +55,8 @@ class BSAggregator {
55
55
  const promises = this.blockchainServices.map((service) => __awaiter(this, void 0, void 0, function* () {
56
56
  let index = 0;
57
57
  const accounts = [];
58
- while (true) {
58
+ let hasError = false;
59
+ while (!hasError) {
59
60
  const generatedAccount = service.generateAccountFromMnemonic(mnemonic, index);
60
61
  if (skippedAddresses && skippedAddresses.find(address => address === generatedAccount.address)) {
61
62
  index++;
@@ -67,10 +68,10 @@ class BSAggregator {
67
68
  address: generatedAccount.address,
68
69
  });
69
70
  if (!totalCount || totalCount <= 0)
70
- break;
71
+ hasError = true;
71
72
  }
72
73
  catch (_a) {
73
- break;
74
+ hasError = true;
74
75
  }
75
76
  }
76
77
  accounts.push(generatedAccount);
package/dist/functions.js CHANGED
@@ -43,7 +43,9 @@ function waitForTransaction(service, txId) {
43
43
  yield service.blockchainDataService.getTransaction(txId);
44
44
  return true;
45
45
  }
46
- catch (_a) { }
46
+ catch (_a) {
47
+ // Empty block
48
+ }
47
49
  attempts++;
48
50
  yield wait(waitMs);
49
51
  } while (attempts < maxAttempts);
@@ -51,6 +51,7 @@ export interface BlockchainService<BSCustomName extends string = string> {
51
51
  generateAccountFromMnemonic(mnemonic: string | string, index: number): AccountWithDerivationPath;
52
52
  generateAccountFromKey(key: string): Account;
53
53
  decrypt(keyOrJson: string, password: string): Promise<Account>;
54
+ encrypt(key: string, password: string): Promise<string>;
54
55
  validateAddress(address: string): boolean;
55
56
  validateEncrypted(keyOrJson: string): boolean;
56
57
  validateKey(key: string): boolean;
@@ -147,6 +148,10 @@ export interface NftResponse {
147
148
  id: string;
148
149
  contractHash: string;
149
150
  collectionName?: string;
151
+ creator: {
152
+ address: string;
153
+ name?: string;
154
+ };
150
155
  collectionImage?: string;
151
156
  symbol: string;
152
157
  image?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cityofzion/blockchain-service",
3
- "version": "0.8.0",
3
+ "version": "0.9.1",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "repository": "https://github.com/CityOfZion/blockchain-services",
@@ -11,10 +11,15 @@
11
11
  ],
12
12
  "devDependencies": {
13
13
  "@types/node": "~20.2.5",
14
+ "@typescript-eslint/eslint-plugin": "^6.5.0",
15
+ "@typescript-eslint/parser": "^6.5.0",
16
+ "eslint": "^8.48.0",
14
17
  "ts-node": "10.9.1",
15
18
  "typescript": "4.9.5"
16
19
  },
17
20
  "scripts": {
18
- "build": "tsc"
21
+ "build": "tsc",
22
+ "lint": "eslint .",
23
+ "format": "eslint --fix"
19
24
  }
20
25
  }