@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/module.flow.js
CHANGED
|
@@ -2373,6 +2373,11 @@ feeCalculator: FeeCalculator,...
|
|
|
2373
2373
|
*/
|
|
2374
2374
|
getVersion(): Promise<Version>;
|
|
2375
2375
|
|
|
2376
|
+
/**
|
|
2377
|
+
* Fetch the genesis hash
|
|
2378
|
+
*/
|
|
2379
|
+
getGenesisHash(): Promise<string>;
|
|
2380
|
+
|
|
2376
2381
|
/**
|
|
2377
2382
|
* Fetch a processed block from the cluster.
|
|
2378
2383
|
*/
|
package/package.json
CHANGED
package/src/connection.ts
CHANGED
|
@@ -2963,6 +2963,18 @@ export class Connection {
|
|
|
2963
2963
|
return res.result;
|
|
2964
2964
|
}
|
|
2965
2965
|
|
|
2966
|
+
/**
|
|
2967
|
+
* Fetch the genesis hash
|
|
2968
|
+
*/
|
|
2969
|
+
async getGenesisHash(): Promise<string> {
|
|
2970
|
+
const unsafeRes = await this._rpcRequest('getGenesisHash', []);
|
|
2971
|
+
const res = create(unsafeRes, jsonRpcResult(string()));
|
|
2972
|
+
if ('error' in res) {
|
|
2973
|
+
throw new Error('failed to get genesis hash: ' + res.error.message);
|
|
2974
|
+
}
|
|
2975
|
+
return res.result;
|
|
2976
|
+
}
|
|
2977
|
+
|
|
2966
2978
|
/**
|
|
2967
2979
|
* Fetch a processed block from the cluster.
|
|
2968
2980
|
*/
|