@cityofzion/blockchain-service 1.0.0 → 1.0.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.
@@ -1,9 +1,8 @@
1
- import { AccountWithDerivationPath, BlockchainService, PartialNetwork } from './interfaces';
1
+ import { AccountWithDerivationPath, BlockchainService } from './interfaces';
2
2
  export declare class BSAggregator<BSCustomName extends string = string, BSCustom extends BlockchainService<BSCustomName> = BlockchainService<BSCustomName>> {
3
3
  #private;
4
4
  readonly blockchainServicesByName: Record<BSCustomName, BSCustom>;
5
5
  constructor(blockchainServices: Record<BSCustomName, BSCustom>);
6
- setNetwork(network: PartialNetwork): void;
7
6
  addBlockchain(name: BSCustomName, blockchain: BSCustom): void;
8
7
  validateAddressAllBlockchains(address: string): boolean;
9
8
  validateTextAllBlockchains(text: string): boolean;
@@ -28,9 +28,6 @@ class BSAggregator {
28
28
  this.blockchainServicesByName = blockchainServices;
29
29
  __classPrivateFieldSet(this, _BSAggregator_blockchainServices, Object.values(blockchainServices), "f");
30
30
  }
31
- setNetwork(network) {
32
- __classPrivateFieldGet(this, _BSAggregator_blockchainServices, "f").forEach(bs => bs.setNetwork(network));
33
- }
34
31
  addBlockchain(name, blockchain) {
35
32
  if (this.blockchainServicesByName[name])
36
33
  throw new Error(`The blockchain ${name} already exist`);
@@ -19,11 +19,6 @@ export type Network<T extends string = string> = {
19
19
  name: string;
20
20
  url: string;
21
21
  };
22
- export type PartialNetwork<T extends string = string> = {
23
- id: T;
24
- name?: string;
25
- url?: string;
26
- };
27
22
  export type IntentTransferParam = {
28
23
  receiverAddress: string;
29
24
  tokenHash: string;
@@ -45,7 +40,7 @@ export interface BlockchainService<BSCustomName extends string = string, BSAvail
45
40
  blockchainDataService: BlockchainDataService;
46
41
  tokens: Token[];
47
42
  network: Network<BSAvailableNetworks>;
48
- setNetwork: (partialNetwork: PartialNetwork<BSAvailableNetworks>) => void;
43
+ setNetwork: (partialNetwork: Network<BSAvailableNetworks>) => void;
49
44
  generateAccountFromMnemonic(mnemonic: string | string, index: number): AccountWithDerivationPath;
50
45
  generateAccountFromKey(key: string): Account;
51
46
  decrypt(keyOrJson: string, password: string): Promise<Account>;
@@ -218,6 +213,7 @@ export type BuildNftUrlParams = {
218
213
  };
219
214
  export interface ExplorerService {
220
215
  buildTransactionUrl(hash: string): string;
216
+ buildContractUrl(contractHash: string): string;
221
217
  buildNftUrl(params: BuildNftUrlParams): string;
222
218
  }
223
219
  export type LedgerServiceEmitter = TypedEmitter<{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cityofzion/blockchain-service",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "repository": "https://github.com/CityOfZion/blockchain-services",