@cityofzion/blockchain-service 1.22.5 → 1.22.6
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.
|
@@ -7,6 +7,6 @@ type RetryOptions = {
|
|
|
7
7
|
export declare class BSUtilsHelper {
|
|
8
8
|
static wait(ms: number): Promise<unknown>;
|
|
9
9
|
static retry<T = any>(callback: () => Promise<T>, options?: RetryOptions): Promise<T>;
|
|
10
|
-
static validateNetwork(network: TBSNetwork, availableNetworks: TBSNetwork[],
|
|
10
|
+
static validateNetwork(network: TBSNetwork, availableNetworks: TBSNetwork[], rpcNetworkUrls: string[]): boolean;
|
|
11
11
|
}
|
|
12
12
|
export {};
|
|
@@ -40,13 +40,11 @@ class BSUtilsHelper {
|
|
|
40
40
|
return reject(new error_1.BSError('Timeout: ' + errorMessage, 'TIMEOUT'));
|
|
41
41
|
}));
|
|
42
42
|
}
|
|
43
|
-
static validateNetwork(network, availableNetworks,
|
|
43
|
+
static validateNetwork(network, availableNetworks, rpcNetworkUrls) {
|
|
44
44
|
const isValid = availableNetworks.some(networkItem => (0, lodash_isequal_1.default)({ id: network.id, type: network.type, name: network.name }, { id: networkItem.id, type: networkItem.type, name: networkItem.name }));
|
|
45
45
|
if (!isValid)
|
|
46
46
|
return false;
|
|
47
|
-
|
|
48
|
-
return false;
|
|
49
|
-
return true;
|
|
47
|
+
return rpcNetworkUrls.some(rpcNetworkUrl => rpcNetworkUrl === network.url);
|
|
50
48
|
}
|
|
51
49
|
}
|
|
52
50
|
exports.BSUtilsHelper = BSUtilsHelper;
|
package/dist/interfaces.d.ts
CHANGED
|
@@ -50,7 +50,7 @@ export interface IBlockchainService<N extends string = string, A extends string
|
|
|
50
50
|
tokens: TBSToken[];
|
|
51
51
|
readonly nativeTokens: TBSToken[];
|
|
52
52
|
network: TBSNetwork<A>;
|
|
53
|
-
|
|
53
|
+
rpcNetworkUrls: string[];
|
|
54
54
|
readonly defaultNetwork: TBSNetwork<A>;
|
|
55
55
|
readonly availableNetworks: TBSNetwork<A>[];
|
|
56
56
|
exchangeDataService: IExchangeDataService;
|