@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.cjs.js
CHANGED
|
@@ -6037,6 +6037,13 @@ const GetInflationRewardResult = jsonRpcResult(superstruct.array(superstruct.nul
|
|
|
6037
6037
|
postBalance: superstruct.number(),
|
|
6038
6038
|
commission: superstruct.optional(superstruct.nullable(superstruct.number()))
|
|
6039
6039
|
}))));
|
|
6040
|
+
/**
|
|
6041
|
+
* Expected JSON RPC response for the "getRecentPrioritizationFees" message
|
|
6042
|
+
*/
|
|
6043
|
+
const GetRecentPrioritizationFeesResult = superstruct.array(superstruct.type({
|
|
6044
|
+
slot: superstruct.number(),
|
|
6045
|
+
prioritizationFee: superstruct.number()
|
|
6046
|
+
}));
|
|
6040
6047
|
/**
|
|
6041
6048
|
* Expected JSON RPC response for the "getInflationRate" message
|
|
6042
6049
|
*/
|
|
@@ -6261,6 +6268,11 @@ const GetInflationGovernorRpcResult = jsonRpcResult(GetInflationGovernorResult);
|
|
|
6261
6268
|
*/
|
|
6262
6269
|
const GetInflationRateRpcResult = jsonRpcResult(GetInflationRateResult);
|
|
6263
6270
|
|
|
6271
|
+
/**
|
|
6272
|
+
* Expected JSON RPC response for the "getRecentPrioritizationFees" message
|
|
6273
|
+
*/
|
|
6274
|
+
const GetRecentPrioritizationFeesRpcResult = jsonRpcResult(GetRecentPrioritizationFeesResult);
|
|
6275
|
+
|
|
6264
6276
|
/**
|
|
6265
6277
|
* Expected JSON RPC response for the "getEpochInfo" message
|
|
6266
6278
|
*/
|
|
@@ -8158,6 +8170,19 @@ class Connection {
|
|
|
8158
8170
|
return res.result;
|
|
8159
8171
|
}
|
|
8160
8172
|
|
|
8173
|
+
/**
|
|
8174
|
+
* Fetch a list of prioritization fees from recent blocks.
|
|
8175
|
+
*/
|
|
8176
|
+
async getRecentPrioritizationFees(config) {
|
|
8177
|
+
const accounts = config?.lockedWritableAccounts?.map(key => key.toBase58());
|
|
8178
|
+
const args = this._buildArgs(accounts?.length ? [accounts] : []);
|
|
8179
|
+
const unsafeRes = await this._rpcRequest('getRecentPrioritizationFees', args);
|
|
8180
|
+
const res = superstruct.create(unsafeRes, GetRecentPrioritizationFeesRpcResult);
|
|
8181
|
+
if ('error' in res) {
|
|
8182
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get recent prioritization fees');
|
|
8183
|
+
}
|
|
8184
|
+
return res.result;
|
|
8185
|
+
}
|
|
8161
8186
|
/**
|
|
8162
8187
|
* Fetch a recent blockhash from the cluster
|
|
8163
8188
|
* @return {Promise<{blockhash: Blockhash, feeCalculator: FeeCalculator}>}
|