Closed 0xaguang closed 2 weeks ago
If you plan to make a pr to fix that issue, I actually take it probably from the transaction itself, as the current state we do listen for complete blocks once they are confirmed, the placeholder is due to the fact that I didn't knew that usually we need to pad the start if 8 bytes or smth if i'm not wrong, but need testing on it to see if it would work by decoding from the txn instead of the logs.
It's done right here: https://github.com/Jay-Frontera/pumpdotfun-fast-listener/blob/main/helpers/pumpfun/index.ts#L46
It basically takes the accounts used on the contract instruction, and will always be the same, so here is where I take some data too.
export const PUMPFUN_SWAP_DATA_STRUCT: Layout<PumpFunSwapDataStruct> = struct([ u64('_'), u64('_'), u64('_'), u64('_'), u64('_'), u64('_'), u64('sol_amount'), u64('token_amount'), bool('is_buy'), anchorPublicKey('user_publickey'), i64('timestamp'), u64('virtual_sol_reserves'), u64('virtual_token_reserves'), ]);
I tried removing the u64 placeholder in the struct and adding the public key ('mint'), but it still couldn't resolve the mint address. I also tried keeping the placeholder and naming it mint_publickey, but that didn't work either. How are you handling this on your end?