I am using node js @solana/web3 and @solana/spl-token and spl-token-swap libraries to perform a swap of token. I am confused with what should be the value of tokenSwapStateAccount and where would I get it ? Can anyone help me with this ?
const swapInstruction = TokenSwap.swapInstruction( tokenSwapStateAccount, swapAuthority, userPublicKey, userTokenA, poolTokenA, poolTokenB, userTokenB, poolMint, feeAccount, null, TOKEN_SWAP_PROGRAM_ID, TOKEN_PROGRAM_ID, amount * 10 ** MintInfoTokenA.decimals, 0 ) transaction.add(swapInstruction)