Skip to content

Commit

Permalink
fix: add maxSupportedTransactionVersion config to remaining `getTra…
Browse files Browse the repository at this point in the history
…nsaction` calls
  • Loading branch information
steveluscher authored and mergify[bot] committed Jul 22, 2022
1 parent 411cfdd commit 7675695
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions src/connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3739,12 +3739,15 @@ export class Connection {
*/
async getParsedTransaction(
signature: TransactionSignature,
commitment?: Finality,
commitmentOrConfig?: GetTransactionConfig | Finality,
): Promise<ParsedConfirmedTransaction | null> {
const {commitment, config} =
extractCommitmentFromConfig(commitmentOrConfig);
const args = this._buildArgsAtLeastConfirmed(
[signature],
commitment,
commitment as Finality,
'jsonParsed',
config,
);
const unsafeRes = await this._rpcRequest('getTransaction', args);
const res = create(unsafeRes, GetParsedTransactionRpcResult);
Expand All @@ -3759,13 +3762,16 @@ export class Connection {
*/
async getParsedTransactions(
signatures: TransactionSignature[],
commitment?: Finality,
commitmentOrConfig?: GetTransactionConfig | Finality,
): Promise<(ParsedConfirmedTransaction | null)[]> {
const {commitment, config} =
extractCommitmentFromConfig(commitmentOrConfig);
const batch = signatures.map(signature => {
const args = this._buildArgsAtLeastConfirmed(
[signature],
commitment,
commitment as Finality,
'jsonParsed',
config,
);
return {
methodName: 'getTransaction',
Expand All @@ -3791,10 +3797,17 @@ export class Connection {
*/
async getTransactions(
signatures: TransactionSignature[],
commitment?: Finality,
commitmentOrConfig?: GetTransactionConfig | Finality,
): Promise<(TransactionResponse | null)[]> {
const {commitment, config} =
extractCommitmentFromConfig(commitmentOrConfig);
const batch = signatures.map(signature => {
const args = this._buildArgsAtLeastConfirmed([signature], commitment);
const args = this._buildArgsAtLeastConfirmed(
[signature],
commitment as Finality,
undefined /* encoding */,
config,
);
return {
methodName: 'getTransaction',
args,
Expand Down

0 comments on commit 7675695

Please sign in to comment.