@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/package.json
CHANGED
package/src/connection.ts
CHANGED
|
@@ -2599,20 +2599,6 @@ const GetParsedTransactionRpcResult = jsonRpcResult(
|
|
|
2599
2599
|
),
|
|
2600
2600
|
);
|
|
2601
2601
|
|
|
2602
|
-
/**
|
|
2603
|
-
* Expected JSON RPC response for the "getRecentBlockhash" message
|
|
2604
|
-
*
|
|
2605
|
-
* @deprecated Deprecated since RPC v1.8.0. Please use {@link GetLatestBlockhashRpcResult} instead.
|
|
2606
|
-
*/
|
|
2607
|
-
const GetRecentBlockhashAndContextRpcResult = jsonRpcResultAndContext(
|
|
2608
|
-
pick({
|
|
2609
|
-
blockhash: string(),
|
|
2610
|
-
feeCalculator: pick({
|
|
2611
|
-
lamportsPerSignature: number(),
|
|
2612
|
-
}),
|
|
2613
|
-
}),
|
|
2614
|
-
);
|
|
2615
|
-
|
|
2616
2602
|
/**
|
|
2617
2603
|
* Expected JSON RPC response for the "getLatestBlockhash" message
|
|
2618
2604
|
*/
|
|
@@ -4567,13 +4553,29 @@ export class Connection {
|
|
|
4567
4553
|
feeCalculator: FeeCalculator;
|
|
4568
4554
|
}>
|
|
4569
4555
|
> {
|
|
4570
|
-
const
|
|
4571
|
-
|
|
4572
|
-
|
|
4573
|
-
|
|
4574
|
-
|
|
4575
|
-
|
|
4576
|
-
|
|
4556
|
+
const {
|
|
4557
|
+
context,
|
|
4558
|
+
value: {blockhash},
|
|
4559
|
+
} = await this.getLatestBlockhashAndContext(commitment);
|
|
4560
|
+
const feeCalculator = {
|
|
4561
|
+
get lamportsPerSignature(): number {
|
|
4562
|
+
throw new Error(
|
|
4563
|
+
'The capability to fetch `lamportsPerSignature` using the `getRecentBlockhash` API is ' +
|
|
4564
|
+
'no longer offered by the network. Use the `getFeeForMessage` API to obtain the fee ' +
|
|
4565
|
+
'for a given message.',
|
|
4566
|
+
);
|
|
4567
|
+
},
|
|
4568
|
+
toJSON() {
|
|
4569
|
+
return {};
|
|
4570
|
+
},
|
|
4571
|
+
};
|
|
4572
|
+
return {
|
|
4573
|
+
context,
|
|
4574
|
+
value: {
|
|
4575
|
+
blockhash,
|
|
4576
|
+
feeCalculator,
|
|
4577
|
+
},
|
|
4578
|
+
};
|
|
4577
4579
|
}
|
|
4578
4580
|
|
|
4579
4581
|
/**
|
|
@@ -5353,7 +5355,7 @@ export class Connection {
|
|
|
5353
5355
|
commitment?: Finality,
|
|
5354
5356
|
): Promise<ConfirmedTransaction | null> {
|
|
5355
5357
|
const args = this._buildArgsAtLeastConfirmed([signature], commitment);
|
|
5356
|
-
const unsafeRes = await this._rpcRequest('
|
|
5358
|
+
const unsafeRes = await this._rpcRequest('getTransaction', args);
|
|
5357
5359
|
const res = create(unsafeRes, GetTransactionRpcResult);
|
|
5358
5360
|
if ('error' in res) {
|
|
5359
5361
|
throw new SolanaJSONRPCError(res.error, 'failed to get transaction');
|
|
@@ -5384,7 +5386,7 @@ export class Connection {
|
|
|
5384
5386
|
commitment,
|
|
5385
5387
|
'jsonParsed',
|
|
5386
5388
|
);
|
|
5387
|
-
const unsafeRes = await this._rpcRequest('
|
|
5389
|
+
const unsafeRes = await this._rpcRequest('getTransaction', args);
|
|
5388
5390
|
const res = create(unsafeRes, GetParsedTransactionRpcResult);
|
|
5389
5391
|
if ('error' in res) {
|
|
5390
5392
|
throw new SolanaJSONRPCError(
|
|
@@ -5411,7 +5413,7 @@ export class Connection {
|
|
|
5411
5413
|
'jsonParsed',
|
|
5412
5414
|
);
|
|
5413
5415
|
return {
|
|
5414
|
-
methodName: '
|
|
5416
|
+
methodName: 'getTransaction',
|
|
5415
5417
|
args,
|
|
5416
5418
|
};
|
|
5417
5419
|
});
|