@solana/web3.js 1.74.0 → 1.75.0
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.cjs.js +25 -0
- package/lib/index.browser.cjs.js.map +1 -1
- package/lib/index.browser.esm.js +25 -0
- package/lib/index.browser.esm.js.map +1 -1
- package/lib/index.cjs.js +25 -0
- package/lib/index.cjs.js.map +1 -1
- package/lib/index.d.ts +20 -0
- package/lib/index.esm.js +25 -0
- package/lib/index.esm.js.map +1 -1
- package/lib/index.iife.js +25 -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/lib/index.native.js +25 -0
- package/lib/index.native.js.map +1 -1
- package/package.json +4 -4
- package/src/connection.ts +56 -0
package/lib/index.browser.esm.js
CHANGED
|
@@ -3504,6 +3504,13 @@ const GetInflationRewardResult = jsonRpcResult(array(nullable(type({
|
|
|
3504
3504
|
postBalance: number(),
|
|
3505
3505
|
commission: optional(nullable(number()))
|
|
3506
3506
|
}))));
|
|
3507
|
+
/**
|
|
3508
|
+
* Expected JSON RPC response for the "getRecentPrioritizationFees" message
|
|
3509
|
+
*/
|
|
3510
|
+
const GetRecentPrioritizationFeesResult = array(type({
|
|
3511
|
+
slot: number(),
|
|
3512
|
+
prioritizationFee: number()
|
|
3513
|
+
}));
|
|
3507
3514
|
/**
|
|
3508
3515
|
* Expected JSON RPC response for the "getInflationRate" message
|
|
3509
3516
|
*/
|
|
@@ -3705,6 +3712,11 @@ const GetInflationGovernorRpcResult = jsonRpcResult(GetInflationGovernorResult);
|
|
|
3705
3712
|
*/
|
|
3706
3713
|
const GetInflationRateRpcResult = jsonRpcResult(GetInflationRateResult);
|
|
3707
3714
|
|
|
3715
|
+
/**
|
|
3716
|
+
* Expected JSON RPC response for the "getRecentPrioritizationFees" message
|
|
3717
|
+
*/
|
|
3718
|
+
const GetRecentPrioritizationFeesRpcResult = jsonRpcResult(GetRecentPrioritizationFeesResult);
|
|
3719
|
+
|
|
3708
3720
|
/**
|
|
3709
3721
|
* Expected JSON RPC response for the "getEpochInfo" message
|
|
3710
3722
|
*/
|
|
@@ -5602,6 +5614,19 @@ class Connection {
|
|
|
5602
5614
|
return res.result;
|
|
5603
5615
|
}
|
|
5604
5616
|
|
|
5617
|
+
/**
|
|
5618
|
+
* Fetch a list of prioritization fees from recent blocks.
|
|
5619
|
+
*/
|
|
5620
|
+
async getRecentPrioritizationFees(config) {
|
|
5621
|
+
const accounts = config?.lockedWritableAccounts?.map(key => key.toBase58());
|
|
5622
|
+
const args = this._buildArgs(accounts?.length ? [accounts] : []);
|
|
5623
|
+
const unsafeRes = await this._rpcRequest('getRecentPrioritizationFees', args);
|
|
5624
|
+
const res = create(unsafeRes, GetRecentPrioritizationFeesRpcResult);
|
|
5625
|
+
if ('error' in res) {
|
|
5626
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get recent prioritization fees');
|
|
5627
|
+
}
|
|
5628
|
+
return res.result;
|
|
5629
|
+
}
|
|
5605
5630
|
/**
|
|
5606
5631
|
* Fetch a recent blockhash from the cluster
|
|
5607
5632
|
* @return {Promise<{blockhash: Blockhash, feeCalculator: FeeCalculator}>}
|