@cityofzion/bs-ethereum 2.8.5 → 2.9.0

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.
@@ -17,7 +17,7 @@ export declare class EthersLedgerServiceEthereum<BSName extends string = string>
17
17
  emitter: LedgerServiceEmitter;
18
18
  getLedgerTransport?: GetLedgerTransport<BSName>;
19
19
  constructor(blockchainService: BSEthereum<BSName>, getLedgerTransport?: GetLedgerTransport<BSName>);
20
- getAccounts(transport: Transport): Promise<Account<BSName>[]>;
20
+ getAccounts(transport: Transport, untilIndex?: number): Promise<Account<BSName>[]>;
21
21
  getAccount(transport: Transport, index: number): Promise<Account<BSName>>;
22
22
  getSigner(transport: Transport, path: string, provider?: ethers.providers.Provider): EthersLedgerSigner;
23
23
  }
@@ -166,11 +166,19 @@ class EthersLedgerServiceEthereum {
166
166
  __classPrivateFieldSet(this, _EthersLedgerServiceEthereum_blockchainService, blockchainService, "f");
167
167
  this.getLedgerTransport = getLedgerTransport;
168
168
  }
169
- getAccounts(transport) {
169
+ getAccounts(transport, untilIndex) {
170
170
  return __awaiter(this, void 0, void 0, function* () {
171
- const accountsByBlockchainService = yield (0, blockchain_service_1.fetchAccountsForBlockchainServices)([__classPrivateFieldGet(this, _EthersLedgerServiceEthereum_blockchainService, "f")], (_service, index) => __awaiter(this, void 0, void 0, function* () {
172
- return this.getAccount(transport, index);
173
- }));
171
+ let accountsByBlockchainService;
172
+ if (untilIndex === undefined) {
173
+ accountsByBlockchainService = yield (0, blockchain_service_1.fetchAccountsForBlockchainServices)([__classPrivateFieldGet(this, _EthersLedgerServiceEthereum_blockchainService, "f")], (_service, index) => __awaiter(this, void 0, void 0, function* () {
174
+ return this.getAccount(transport, index);
175
+ }));
176
+ }
177
+ else {
178
+ accountsByBlockchainService = yield (0, blockchain_service_1.generateAccountUntilIndexForBlockchainService)([__classPrivateFieldGet(this, _EthersLedgerServiceEthereum_blockchainService, "f")], untilIndex, (_service, index) => __awaiter(this, void 0, void 0, function* () {
179
+ return this.getAccount(transport, index);
180
+ }));
181
+ }
174
182
  const accounts = accountsByBlockchainService.get(__classPrivateFieldGet(this, _EthersLedgerServiceEthereum_blockchainService, "f").name);
175
183
  return accounts !== null && accounts !== void 0 ? accounts : [];
176
184
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cityofzion/bs-ethereum",
3
- "version": "2.8.5",
3
+ "version": "2.9.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "repository": "https://github.com/CityOfZion/blockchain-services",
@@ -20,7 +20,7 @@
20
20
  "@ledgerhq/hw-app-eth": "~6.35.7",
21
21
  "@ethersproject/abstract-signer": "~5.7.0",
22
22
  "@ethersproject/properties": "~5.7.0",
23
- "@cityofzion/blockchain-service": "1.14.0"
23
+ "@cityofzion/blockchain-service": "1.15.0"
24
24
  },
25
25
  "devDependencies": {
26
26
  "@ledgerhq/hw-transport-node-hid": "~6.28.5",