@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.
- package/dist/BSAggregator.d.ts +1 -2
- package/dist/BSAggregator.js +0 -3
- package/dist/interfaces.d.ts +2 -6
- package/package.json +1 -1
package/dist/BSAggregator.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { AccountWithDerivationPath, BlockchainService
|
|
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;
|
package/dist/BSAggregator.js
CHANGED
|
@@ -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`);
|
package/dist/interfaces.d.ts
CHANGED
|
@@ -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:
|
|
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<{
|