From d3d4c46daf71c395c053887ca18cbfce28799b2e Mon Sep 17 00:00:00 2001 From: perfogic Date: Sat, 18 Jan 2025 22:40:10 +0700 Subject: [PATCH 1/2] update compute price unit --- src/program/web3.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/program/web3.ts b/src/program/web3.ts index 00cf917b5..948f6e945 100644 --- a/src/program/web3.ts +++ b/src/program/web3.ts @@ -65,7 +65,7 @@ export class Web3SolanaProgramInteraction { const parsedAmount = toAmount(tokenAmountRaw, token.decimals); const updateCpIx = ComputeBudgetProgram.setComputeUnitPrice({ - microLamports: 1_000_000 + microLamports: 10_000_000 }); const updateCuIx = ComputeBudgetProgram.setComputeUnitLimit({ units: 500_000 From 4ebdb2ca4902ae67b45150366c36854c27aab070 Mon Sep 17 00:00:00 2001 From: perfogic Date: Sat, 18 Jan 2025 22:41:11 +0700 Subject: [PATCH 2/2] add compute price if not is contractAddress --- src/program/web3.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/program/web3.ts b/src/program/web3.ts index 948f6e945..0dc902867 100644 --- a/src/program/web3.ts +++ b/src/program/web3.ts @@ -98,6 +98,13 @@ export class Web3SolanaProgramInteraction { ); } else { const lamportsToSend = tokenAmountRaw * LAMPORTS_PER_SOL; + const updateCpIx = ComputeBudgetProgram.setComputeUnitPrice({ + microLamports: 10_000_000 + }); + const updateCuIx = ComputeBudgetProgram.setComputeUnitLimit({ + units: 500_000 + }); + transaction.add(updateCpIx, updateCuIx); const transferTransaction = transaction.add( SystemProgram.transfer({ fromPubkey: wallet.publicKey,