@solana/web3.js 1.25.1 → 1.26.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/lib/index.cjs.js CHANGED
@@ -4349,6 +4349,21 @@ class Connection {
4349
4349
 
4350
4350
  return res.result;
4351
4351
  }
4352
+ /**
4353
+ * Fetch the genesis hash
4354
+ */
4355
+
4356
+
4357
+ async getGenesisHash() {
4358
+ const unsafeRes = await this._rpcRequest('getGenesisHash', []);
4359
+ const res = superstruct.create(unsafeRes, jsonRpcResult(superstruct.string()));
4360
+
4361
+ if ('error' in res) {
4362
+ throw new Error('failed to get genesis hash: ' + res.error.message);
4363
+ }
4364
+
4365
+ return res.result;
4366
+ }
4352
4367
  /**
4353
4368
  * Fetch a processed block from the cluster.
4354
4369
  */