Skip to content

Commit 32dedd7

Browse files
committed
Fix Anchor BN export issue
1 parent ba7a09c commit 32dedd7

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

package-lock.json

+10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@
6666
"bs58": "^6.0.0",
6767
"dotenv": "^16.4.5",
6868
"@coral-xyz/anchor": "^0.30.1"
69-
7069
},
7170
"devDependencies": {
71+
"@types/bn.js": "^5.1.6",
7272
"@types/node": "^20.16.1",
7373
"esbuild": "^0.23.1",
7474
"esbuild-register": "^3.6.0",

src/lib/transaction.ts

+6-5
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import {
1111
TransactionMessage,
1212
VersionedTransaction,
1313
Message,
14-
MessageV0,
1514
MessageCompiledInstruction,
1615
} from "@solana/web3.js";
1716
import { getErrorFromRPCResponse } from "./logs";
@@ -22,8 +21,8 @@ import {
2221
EventParser,
2322
BorshAccountsCoder,
2423
BorshInstructionCoder,
25-
BN,
2624
} from "@coral-xyz/anchor";
25+
import BN from "bn.js";
2726
import * as fs from "fs";
2827
import * as path from "path";
2928

@@ -703,12 +702,14 @@ export async function sendTransaction(
703702
});
704703
}
705704

706-
const hasComputeInstructions = transaction.instructions.some(ix =>
707-
ix.programId.equals(ComputeBudgetProgram.programId)
705+
const hasComputeInstructions = transaction.instructions.some((ix) =>
706+
ix.programId.equals(ComputeBudgetProgram.programId),
708707
);
709708

710709
if (hasComputeInstructions) {
711-
console.log("Transaction already has compute instructions, skipping compute preparation");
710+
console.log(
711+
"Transaction already has compute instructions, skipping compute preparation",
712+
);
712713
return sendTransactionWithRetry(connection, transaction, signers, {
713714
commitment,
714715
...sendOptions,

0 commit comments

Comments
 (0)