wen-moon-ser / moonshot-sdk

Package for creating buy/sell transactions, and calculating the price of any moonshot token on Solana.
https://moonshot.cc
37 stars 9 forks source link

Transaction Failing #13

Closed antiisaint closed 2 months ago

antiisaint commented 2 months ago

I'm currently running into an issue using the example code provided to buy. The transaction fails to succeed due to this failure

Program Error: "Instruction #4 Failed - The program could not deserialize the given instruction"

Any idea as to why this is occurring? I used different rpcs, yet the same outcome.

antiisaint commented 2 months ago

I would also like to mention that this code snippet doesn't work either.

const collateralAmount = await token.getCollateralAmountByTokens({
    tokenAmount,
    tradeDirection: 'BUY',
  });

The error is

dest[clo.property] = this.defaultLayout.decode(b, offset + contentOffset);
               ^

TypeError: Cannot read properties of null (reading 'property')