push to crank ix

This commit is contained in:
Adrian Brzeziński 2024-01-06 21:44:22 +01:00
parent 753e9bd38f
commit d3eb967665
4 changed files with 14 additions and 5 deletions

View File

@ -106,7 +106,7 @@ const CreateOpenbookMarketModal = ({
const txChunks = ixObj.innerTransactions
const transactions: Transaction[] = []
const latestBlockhash = await connection.getLatestBlockhash('confirmed')
const latestBlockhash = await connection.getLatestBlockhash('processed')
for (const chunk of txChunks) {
const tx = new Transaction()
tx.add(createComputeBudgetIx(fee))

View File

@ -329,8 +329,15 @@ const CreateSwitchboardOracleModal = ({
const transferAuthIx = aggregatorAccount.setAuthorityInstruction(payer, {
newAuthority: MANGO_DAO_WALLET,
})
const latestBlockhash = await connection.getLatestBlockhash('confirmed')
const txChunks = chunk([...txArray1, lockTx, transferAuthIx], 1)
const pushToCrankIx = await crankAccount.pushInstruction(payer, {
aggregatorAccount: aggregatorAccount,
})
const latestBlockhash = await connection.getLatestBlockhash('processed')
const txChunks = chunk(
[...txArray1, lockTx, transferAuthIx, pushToCrankIx],
1,
)
const transactions: Transaction[] = []
for (const chunkIndex in txChunks) {

View File

@ -131,7 +131,7 @@ export const createProposal = async (
const txChunks = chunk([...instructions, ...insertInstructions], 2)
const transactions: Transaction[] = []
const latestBlockhash = await connection.getLatestBlockhash('confirmed')
const latestBlockhash = await connection.getLatestBlockhash('processed')
for (const chunk of txChunks) {
const tx = new Transaction()
tx.add(createComputeBudgetIx(fee))

View File

@ -167,7 +167,9 @@ export const createLedgerMessage = async (
}),
)
tx.feePayer = wallet.publicKey!
tx.recentBlockhash = (await connection.getLatestBlockhash()).blockhash
tx.recentBlockhash = (
await connection.getLatestBlockhash('processed')
).blockhash
const signedTx = await wallet.signTransaction!(tx)
const serializedTx = signedTx.serialize()