We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm getting error "invalid transaction: Transaction failed to sanitize accounts offsets correctly" making Jupiter swap.
string tokenIn = "SOL"; string tokenOut = "PONKE"; decimal amount = 0.001m;
public class JupiterSwap { public IRpcClient RpcClient { get; } = ClientFactory.GetClient(Cluster.MainNet); public IDexAggregator Dex { get; } public Wallet Wallet { get; } public JupiterSwap(IRpcClient rpcClient, Wallet wallet) { Wallet = wallet; RpcClient = rpcClient; Dex = new JupiterDexAg(Wallet.Account); } public async Task<string> MakeSwap(string tokenIn, string tokenOut, decimal inputAmount) { TokenData tokenA = await Dex.GetTokenBySymbol(tokenIn); TokenData tokenB = await Dex.GetTokenBySymbol(tokenOut); SwapQuoteAg swapQuote = await Dex.GetSwapQuote( tokenA.MintAddress, tokenB.MintAddress, DecimalUtil.ToUlong(inputAmount, tokenA.Decimals) ); var quoteOutput = DecimalUtil.FromBigInteger(swapQuote.OutputAmount, tokenB.Decimals); await Console.Out.WriteLineAsync($"Output Amount: {quoteOutput} {tokenOut}"); await Console.Out.WriteLineAsync(string.Join(" -> ", swapQuote.RoutePlan.Select(p => p.SwapInfo.Label))); var swapTransaction = await Dex.Swap(swapQuote); swapTransaction.Sign(Wallet.Account); var txSignature = await RpcClient.SendTransactionAsync(swapTransaction.Serialize()); return txSignature.Result; } }
The text was updated successfully, but these errors were encountered:
I had the same problem
Sorry, something went wrong.
No branches or pull requests
I'm getting error "invalid transaction: Transaction failed to sanitize accounts offsets correctly" making Jupiter swap.
The text was updated successfully, but these errors were encountered: