@solana/web3.js 1.96.0 → 1.98.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 +24 -22
- package/lib/index.browser.cjs.js.map +1 -1
- package/lib/index.browser.esm.js +24 -22
- package/lib/index.browser.esm.js.map +1 -1
- package/lib/index.cjs.js +24 -22
- package/lib/index.cjs.js.map +1 -1
- package/lib/index.esm.js +24 -22
- package/lib/index.esm.js.map +1 -1
- package/lib/index.iife.js +24 -22
- 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 +24 -22
- package/lib/index.native.js.map +1 -1
- package/package.json +1 -1
- package/src/connection.ts +26 -24
package/lib/index.native.js
CHANGED
|
@@ -5005,18 +5005,6 @@ const GetParsedTransactionRpcResult = jsonRpcResult(superstruct.nullable(superst
|
|
|
5005
5005
|
version: superstruct.optional(TransactionVersionStruct)
|
|
5006
5006
|
})));
|
|
5007
5007
|
|
|
5008
|
-
/**
|
|
5009
|
-
* Expected JSON RPC response for the "getRecentBlockhash" message
|
|
5010
|
-
*
|
|
5011
|
-
* @deprecated Deprecated since RPC v1.8.0. Please use {@link GetLatestBlockhashRpcResult} instead.
|
|
5012
|
-
*/
|
|
5013
|
-
const GetRecentBlockhashAndContextRpcResult = jsonRpcResultAndContext(superstruct.type({
|
|
5014
|
-
blockhash: superstruct.string(),
|
|
5015
|
-
feeCalculator: superstruct.type({
|
|
5016
|
-
lamportsPerSignature: superstruct.number()
|
|
5017
|
-
})
|
|
5018
|
-
}));
|
|
5019
|
-
|
|
5020
5008
|
/**
|
|
5021
5009
|
* Expected JSON RPC response for the "getLatestBlockhash" message
|
|
5022
5010
|
*/
|
|
@@ -6394,13 +6382,27 @@ class Connection {
|
|
|
6394
6382
|
* @deprecated Deprecated since RPC v1.9.0. Please use {@link getLatestBlockhash} instead.
|
|
6395
6383
|
*/
|
|
6396
6384
|
async getRecentBlockhashAndContext(commitment) {
|
|
6397
|
-
const
|
|
6398
|
-
|
|
6399
|
-
|
|
6400
|
-
|
|
6401
|
-
|
|
6402
|
-
}
|
|
6403
|
-
|
|
6385
|
+
const {
|
|
6386
|
+
context,
|
|
6387
|
+
value: {
|
|
6388
|
+
blockhash
|
|
6389
|
+
}
|
|
6390
|
+
} = await this.getLatestBlockhashAndContext(commitment);
|
|
6391
|
+
const feeCalculator = {
|
|
6392
|
+
get lamportsPerSignature() {
|
|
6393
|
+
throw new Error('The capability to fetch `lamportsPerSignature` using the `getRecentBlockhash` API is ' + 'no longer offered by the network. Use the `getFeeForMessage` API to obtain the fee ' + 'for a given message.');
|
|
6394
|
+
},
|
|
6395
|
+
toJSON() {
|
|
6396
|
+
return {};
|
|
6397
|
+
}
|
|
6398
|
+
};
|
|
6399
|
+
return {
|
|
6400
|
+
context,
|
|
6401
|
+
value: {
|
|
6402
|
+
blockhash,
|
|
6403
|
+
feeCalculator
|
|
6404
|
+
}
|
|
6405
|
+
};
|
|
6404
6406
|
}
|
|
6405
6407
|
|
|
6406
6408
|
/**
|
|
@@ -6959,7 +6961,7 @@ class Connection {
|
|
|
6959
6961
|
*/
|
|
6960
6962
|
async getConfirmedTransaction(signature, commitment) {
|
|
6961
6963
|
const args = this._buildArgsAtLeastConfirmed([signature], commitment);
|
|
6962
|
-
const unsafeRes = await this._rpcRequest('
|
|
6964
|
+
const unsafeRes = await this._rpcRequest('getTransaction', args);
|
|
6963
6965
|
const res = superstruct.create(unsafeRes, GetTransactionRpcResult);
|
|
6964
6966
|
if ('error' in res) {
|
|
6965
6967
|
throw new SolanaJSONRPCError(res.error, 'failed to get transaction');
|
|
@@ -6981,7 +6983,7 @@ class Connection {
|
|
|
6981
6983
|
*/
|
|
6982
6984
|
async getParsedConfirmedTransaction(signature, commitment) {
|
|
6983
6985
|
const args = this._buildArgsAtLeastConfirmed([signature], commitment, 'jsonParsed');
|
|
6984
|
-
const unsafeRes = await this._rpcRequest('
|
|
6986
|
+
const unsafeRes = await this._rpcRequest('getTransaction', args);
|
|
6985
6987
|
const res = superstruct.create(unsafeRes, GetParsedTransactionRpcResult);
|
|
6986
6988
|
if ('error' in res) {
|
|
6987
6989
|
throw new SolanaJSONRPCError(res.error, 'failed to get confirmed transaction');
|
|
@@ -6998,7 +7000,7 @@ class Connection {
|
|
|
6998
7000
|
const batch = signatures.map(signature => {
|
|
6999
7001
|
const args = this._buildArgsAtLeastConfirmed([signature], commitment, 'jsonParsed');
|
|
7000
7002
|
return {
|
|
7001
|
-
methodName: '
|
|
7003
|
+
methodName: 'getTransaction',
|
|
7002
7004
|
args
|
|
7003
7005
|
};
|
|
7004
7006
|
});
|