@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.browser.esm.js +15 -0
- package/lib/index.browser.esm.js.map +1 -1
- package/lib/index.cjs.js +15 -0
- package/lib/index.cjs.js.map +1 -1
- package/lib/index.d.ts +4 -0
- package/lib/index.esm.js +15 -0
- package/lib/index.esm.js.map +1 -1
- package/lib/index.iife.js +15 -0
- package/lib/index.iife.js.map +1 -1
- package/lib/index.iife.min.js +1 -1
- package/lib/index.iife.min.js.map +1 -1
- package/module.flow.js +5 -0
- package/package.json +1 -1
- package/src/connection.ts +12 -0
package/lib/index.d.ts
CHANGED
|
@@ -1624,6 +1624,10 @@ declare module '@solana/web3.js' {
|
|
|
1624
1624
|
* Fetch the node version
|
|
1625
1625
|
*/
|
|
1626
1626
|
getVersion(): Promise<Version>;
|
|
1627
|
+
/**
|
|
1628
|
+
* Fetch the genesis hash
|
|
1629
|
+
*/
|
|
1630
|
+
getGenesisHash(): Promise<string>;
|
|
1627
1631
|
/**
|
|
1628
1632
|
* Fetch a processed block from the cluster.
|
|
1629
1633
|
*/
|
package/lib/index.esm.js
CHANGED
|
@@ -4312,6 +4312,21 @@ class Connection {
|
|
|
4312
4312
|
|
|
4313
4313
|
return res.result;
|
|
4314
4314
|
}
|
|
4315
|
+
/**
|
|
4316
|
+
* Fetch the genesis hash
|
|
4317
|
+
*/
|
|
4318
|
+
|
|
4319
|
+
|
|
4320
|
+
async getGenesisHash() {
|
|
4321
|
+
const unsafeRes = await this._rpcRequest('getGenesisHash', []);
|
|
4322
|
+
const res = create(unsafeRes, jsonRpcResult(string()));
|
|
4323
|
+
|
|
4324
|
+
if ('error' in res) {
|
|
4325
|
+
throw new Error('failed to get genesis hash: ' + res.error.message);
|
|
4326
|
+
}
|
|
4327
|
+
|
|
4328
|
+
return res.result;
|
|
4329
|
+
}
|
|
4315
4330
|
/**
|
|
4316
4331
|
* Fetch a processed block from the cluster.
|
|
4317
4332
|
*/
|