Skip to content
New issue

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

invalid transaction: Transaction failed to sanitize accounts offsets correctly #134

Open
femtoeu opened this issue Mar 4, 2023 · 4 comments

Comments

@femtoeu
Copy link

femtoeu commented Mar 4, 2023

Hello, i'm trying to make swap using jup.ag quote api

tx, err := solana.TransactionFromDecoder(bin.NewBinDecoder(swapTx))
if err != nil {
	log.Fatal(err)
}

_, err = tx.Sign(
	func(key solana.PublicKey) *solana.PrivateKey {
	if account.PublicKey().Equals(key) {
					return &account.PrivateKey
				}
				return nil
			},
		)
		if err != nil {
			log.Fatal(err)
		}

		hash, err := solanaClient.SendTransaction(context.Background(), tx)
		if err != nil {
			log.Fatal(err)
}
log.Println("swap:", hash)

swapTx is []byte that i got from jup.ag api and when i'm was trying to send tx i got this err:
(*jsonrpc.RPCError)(0xc00002b920)({ Code: (int) -32602, Message: (string) (len=78) "invalid transaction: Transaction failed to sanitize accounts offsets correctly", Data: (interface {}) <nil> })

@akbariandev
Copy link

akbariandev commented Aug 17, 2023

Did you find any solution?

@ubuygold
Copy link

ubuygold commented Mar 31, 2024

Same here, do you have any solution?

@AlexandreColauto
Copy link

Same, no succes with Tx from API's.

@AlexandreColauto
Copy link

It seems that tx.Sign() can’t overwrite the origin signature(11111111111…) from jupiter and I have to delete them manually. from #186
That happens when they have a default signature on the api's. we might need to change it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants