Skip to content
This repository has been archived by the owner on Jan 20, 2025. It is now read-only.

Commit

Permalink
Reject failed transactions in TransactionProcessor + commitment fix (#24
Browse files Browse the repository at this point in the history
)

* v0.1.7

* Revert "Reject failed transactions in TransactionProcessor (#22)"

This reverts commit c9c1d63.

* v0.1.8

* Revert "Revert "Reject failed transactions in TransactionProcessor (#22)""

This reverts commit 3d008ce.

* fix commitment

* v0.1.9
  • Loading branch information
odcheung authored Jan 26, 2023
1 parent c9c1d63 commit 83315db
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/common-sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@orca-so/common-sdk",
"version": "0.1.6",
"version": "0.1.9",
"description": "Common Typescript components across Orca",
"repository": "https://github.com/orca-so/orca-sdks",
"author": "Orca Foundation",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { Wallet } from "@project-serum/anchor/dist/cjs/provider";
import { Commitment, PublicKey, Signer, Transaction, Connection } from "@solana/web3.js";
import { Commitment, Connection, PublicKey, Signer, Transaction } from "@solana/web3.js";
import { SendTxRequest } from "./types";

export class TransactionProcessor {
constructor(
readonly connection: Connection,
readonly wallet: Wallet,
readonly commitment: Commitment = "confirmed"
) {}
) { }

public async signTransaction(txRequest: SendTxRequest): Promise<{
transaction: Transaction;
Expand Down Expand Up @@ -73,7 +73,7 @@ export class TransactionProcessor {
signature: txId,
lastValidBlockHeight: lastValidBlockHeight,
blockhash,
});
}, this.commitment);

if (result.value.err) {
throw new Error(`Transaction failed: ${JSON.stringify(result.value)}`);
Expand Down

0 comments on commit 83315db

Please sign in to comment.