@cityofzion/bs-ethereum 2.14.0 → 2.14.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/BSEthereum.d.ts +1 -1
- package/dist/BSEthereum.js +3 -3
- package/package.json +2 -2
package/dist/BSEthereum.d.ts
CHANGED
|
@@ -26,7 +26,7 @@ export declare class BSEthereum<N extends string = string, A extends string = TB
|
|
|
26
26
|
constructor(name: N, evm?: TSupportedEVM, network?: TBSNetwork<A>, getLedgerTransport?: TGetLedgerTransport<N>);
|
|
27
27
|
generateSigner(account: TBSAccount<N>): Promise<ethers.Signer & TypedDataSigner>;
|
|
28
28
|
setNetwork(network: TBSNetwork<A>): void;
|
|
29
|
-
|
|
29
|
+
pingNode(url: string): Promise<TPingNetworkResponse>;
|
|
30
30
|
validateAddress(address: string): boolean;
|
|
31
31
|
validateEncrypted(json: string): boolean;
|
|
32
32
|
validateKey(key: string): boolean;
|
package/dist/BSEthereum.js
CHANGED
|
@@ -112,19 +112,19 @@ class BSEthereum {
|
|
|
112
112
|
this.walletConnectService = new WalletConnectServiceEthereum_1.WalletConnectServiceEthereum(this);
|
|
113
113
|
}
|
|
114
114
|
// This method is done manually because we need to ensure that the request is aborted after timeout
|
|
115
|
-
|
|
115
|
+
pingNode(url) {
|
|
116
116
|
return __awaiter(this, void 0, void 0, function* () {
|
|
117
117
|
const abortController = new AbortController();
|
|
118
118
|
const timeout = setTimeout(() => {
|
|
119
119
|
abortController.abort();
|
|
120
120
|
}, 5000);
|
|
121
121
|
const timeStart = Date.now();
|
|
122
|
-
const response = yield axios_1.default.post(
|
|
122
|
+
const response = yield axios_1.default.post(url, { jsonrpc: '2.0', method: 'eth_blockNumber', params: [], id: 1234 }, { timeout: 5000, signal: abortController.signal });
|
|
123
123
|
clearTimeout(timeout);
|
|
124
124
|
const latency = Date.now() - timeStart;
|
|
125
125
|
return {
|
|
126
126
|
latency,
|
|
127
|
-
url
|
|
127
|
+
url,
|
|
128
128
|
height: ethers_1.ethers.BigNumber.from(response.data.result).toNumber(),
|
|
129
129
|
};
|
|
130
130
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cityofzion/bs-ethereum",
|
|
3
|
-
"version": "2.14.
|
|
3
|
+
"version": "2.14.1",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"repository": "https://github.com/CityOfZion/blockchain-services",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"@ethersproject/abstract-signer": "5.7.0",
|
|
20
20
|
"@ethersproject/properties": "5.7.0",
|
|
21
21
|
"@cityofzion/dora-ts": "~0.5.1",
|
|
22
|
-
"@cityofzion/blockchain-service": "1.22.
|
|
22
|
+
"@cityofzion/blockchain-service": "1.22.1"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@ledgerhq/hw-transport": "~6.31.11",
|