Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Commit 2b30a1b

Browse files
author
Joe C
authored
[token js]: transfer-hook: align key pushing flow with Rust helpers
This PR modifes the ordering of pushing account metas to an instruction to align exactly with the Rust interface's `offchain` helper. Closes #5686
1 parent 1b89c06 commit 2b30a1b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

token/js/src/extensions/transferHook/instructions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,6 @@ export async function addExtraAccountsToInstruction(
172172
const extraAccountMetas = getExtraAccountMetas(extraAccountsInfo);
173173

174174
const accountMetas = instruction.keys;
175-
accountMetas.push({ pubkey: extraAccountsAccount, isSigner: false, isWritable: false });
176175

177176
for (const extraAccountMeta of extraAccountMetas) {
178177
const accountMetaUnchecked = await resolveExtraAccountMeta(
@@ -186,6 +185,7 @@ export async function addExtraAccountsToInstruction(
186185
accountMetas.push(accountMeta);
187186
}
188187
accountMetas.push({ pubkey: transferHook.programId, isSigner: false, isWritable: false });
188+
accountMetas.push({ pubkey: extraAccountsAccount, isSigner: false, isWritable: false });
189189

190190
return new TransactionInstruction({ keys: accountMetas, programId, data: instruction.data });
191191
}

0 commit comments

Comments
 (0)