@cityofzion/bs-solana 2.0.3 → 2.0.4

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.
@@ -22,7 +22,7 @@ export declare class BSSolana<N extends string = string> implements IBSSolana<N>
22
22
  tokenService: ITokenService;
23
23
  constructor(name: N, network?: TBSNetwork<TBSSolanaNetworkId>, getLedgerTransport?: TGetLedgerTransport<N>);
24
24
  setNetwork(network: TBSNetwork<TBSSolanaNetworkId>): void;
25
- pingNetwork(network: TBSNetwork<TBSSolanaNetworkId>): Promise<TPingNetworkResponse>;
25
+ pingNode(url: string): Promise<TPingNetworkResponse>;
26
26
  validateAddress(address: string): boolean;
27
27
  validateKey(key: string): boolean;
28
28
  generateAccountFromMnemonic(mnemonic: string, index: number): TBSAccount<N>;
package/dist/BSSolana.js CHANGED
@@ -106,14 +106,14 @@ class BSSolana {
106
106
  __classPrivateFieldSet(this, _BSSolana_connection, new web3_js_1.default.Connection(this.network.url), "f");
107
107
  }
108
108
  // This method is done manually because we need to ensure that the request is aborted after timeout
109
- pingNetwork(network) {
109
+ pingNode(url) {
110
110
  return __awaiter(this, void 0, void 0, function* () {
111
111
  const abortController = new AbortController();
112
112
  const timeout = setTimeout(() => {
113
113
  abortController.abort();
114
114
  }, 5000);
115
115
  const timeStart = Date.now();
116
- const response = yield axios_1.default.post(network.url, {
116
+ const response = yield axios_1.default.post(url, {
117
117
  jsonrpc: '2.0',
118
118
  id: 1234,
119
119
  method: 'getBlockHeight',
@@ -122,7 +122,7 @@ class BSSolana {
122
122
  const latency = Date.now() - timeStart;
123
123
  return {
124
124
  latency,
125
- url: network.url,
125
+ url,
126
126
  height: response.data.result,
127
127
  };
128
128
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cityofzion/bs-solana",
3
- "version": "2.0.3",
3
+ "version": "2.0.4",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "repository": "https://github.com/CityOfZion/blockchain-services",
@@ -21,7 +21,7 @@
21
21
  "@ledgerhq/hw-transport": "~6.31.11",
22
22
  "@metaplex-foundation/js": "~0.20.1",
23
23
  "date-fns": "~4.1.0",
24
- "@cityofzion/blockchain-service": "1.21.3"
24
+ "@cityofzion/blockchain-service": "1.22.1"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@ledgerhq/hw-transport-node-hid": "~6.29.12",