@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.cjs.js
CHANGED
|
@@ -5754,18 +5754,6 @@ const GetParsedTransactionRpcResult = jsonRpcResult(superstruct.nullable(superst
|
|
|
5754
5754
|
version: superstruct.optional(TransactionVersionStruct)
|
|
5755
5755
|
})));
|
|
5756
5756
|
|
|
5757
|
-
/**
|
|
5758
|
-
* Expected JSON RPC response for the "getRecentBlockhash" message
|
|
5759
|
-
*
|
|
5760
|
-
* @deprecated Deprecated since RPC v1.8.0. Please use {@link GetLatestBlockhashRpcResult} instead.
|
|
5761
|
-
*/
|
|
5762
|
-
const GetRecentBlockhashAndContextRpcResult = jsonRpcResultAndContext(superstruct.type({
|
|
5763
|
-
blockhash: superstruct.string(),
|
|
5764
|
-
feeCalculator: superstruct.type({
|
|
5765
|
-
lamportsPerSignature: superstruct.number()
|
|
5766
|
-
})
|
|
5767
|
-
}));
|
|
5768
|
-
|
|
5769
5757
|
/**
|
|
5770
5758
|
* Expected JSON RPC response for the "getLatestBlockhash" message
|
|
5771
5759
|
*/
|
|
@@ -7143,13 +7131,27 @@ class Connection {
|
|
|
7143
7131
|
* @deprecated Deprecated since RPC v1.9.0. Please use {@link getLatestBlockhash} instead.
|
|
7144
7132
|
*/
|
|
7145
7133
|
async getRecentBlockhashAndContext(commitment) {
|
|
7146
|
-
const
|
|
7147
|
-
|
|
7148
|
-
|
|
7149
|
-
|
|
7150
|
-
|
|
7151
|
-
}
|
|
7152
|
-
|
|
7134
|
+
const {
|
|
7135
|
+
context,
|
|
7136
|
+
value: {
|
|
7137
|
+
blockhash
|
|
7138
|
+
}
|
|
7139
|
+
} = await this.getLatestBlockhashAndContext(commitment);
|
|
7140
|
+
const feeCalculator = {
|
|
7141
|
+
get lamportsPerSignature() {
|
|
7142
|
+
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.');
|
|
7143
|
+
},
|
|
7144
|
+
toJSON() {
|
|
7145
|
+
return {};
|
|
7146
|
+
}
|
|
7147
|
+
};
|
|
7148
|
+
return {
|
|
7149
|
+
context,
|
|
7150
|
+
value: {
|
|
7151
|
+
blockhash,
|
|
7152
|
+
feeCalculator
|
|
7153
|
+
}
|
|
7154
|
+
};
|
|
7153
7155
|
}
|
|
7154
7156
|
|
|
7155
7157
|
/**
|
|
@@ -7708,7 +7710,7 @@ class Connection {
|
|
|
7708
7710
|
*/
|
|
7709
7711
|
async getConfirmedTransaction(signature, commitment) {
|
|
7710
7712
|
const args = this._buildArgsAtLeastConfirmed([signature], commitment);
|
|
7711
|
-
const unsafeRes = await this._rpcRequest('
|
|
7713
|
+
const unsafeRes = await this._rpcRequest('getTransaction', args);
|
|
7712
7714
|
const res = superstruct.create(unsafeRes, GetTransactionRpcResult);
|
|
7713
7715
|
if ('error' in res) {
|
|
7714
7716
|
throw new SolanaJSONRPCError(res.error, 'failed to get transaction');
|
|
@@ -7730,7 +7732,7 @@ class Connection {
|
|
|
7730
7732
|
*/
|
|
7731
7733
|
async getParsedConfirmedTransaction(signature, commitment) {
|
|
7732
7734
|
const args = this._buildArgsAtLeastConfirmed([signature], commitment, 'jsonParsed');
|
|
7733
|
-
const unsafeRes = await this._rpcRequest('
|
|
7735
|
+
const unsafeRes = await this._rpcRequest('getTransaction', args);
|
|
7734
7736
|
const res = superstruct.create(unsafeRes, GetParsedTransactionRpcResult);
|
|
7735
7737
|
if ('error' in res) {
|
|
7736
7738
|
throw new SolanaJSONRPCError(res.error, 'failed to get confirmed transaction');
|
|
@@ -7747,7 +7749,7 @@ class Connection {
|
|
|
7747
7749
|
const batch = signatures.map(signature => {
|
|
7748
7750
|
const args = this._buildArgsAtLeastConfirmed([signature], commitment, 'jsonParsed');
|
|
7749
7751
|
return {
|
|
7750
|
-
methodName: '
|
|
7752
|
+
methodName: 'getTransaction',
|
|
7751
7753
|
args
|
|
7752
7754
|
};
|
|
7753
7755
|
});
|