MCPcopy Create free account
hub / github.com/0xProject/0x-examples / buildInstructions

Function buildInstructions

solana-example/src/index.ts:51–66  ·  view source on GitHub ↗
(
  instructionsData: Instruction[]
)

Source from the content-addressed store, hash-verified

49}
50
51function buildInstructions(
52 instructionsData: Instruction[]
53): TransactionInstruction[] {
54 return instructionsData.map((ix) => {
55 const keys = ix.accounts.map((acc: InstructionAccount) => ({
56 pubkey: decodePubkey(acc.pubkey),
57 isSigner: acc.is_signer,
58 isWritable: acc.is_writable,
59 }));
60
61 const programId = decodePubkey(ix.program_id);
62 const data = Buffer.from(ix.data);
63
64 return new TransactionInstruction({ keys, programId, data });
65 });
66}
67
68// === Step 3: Resolve Address Lookup Tables ===
69async function resolveAddressLookupTables(

Callers 1

executeSwapFunction · 0.85

Calls 1

decodePubkeyFunction · 0.85

Tested by

no test coverage detected