solana-go icon indicating copy to clipboard operation
solana-go copied to clipboard

invalid transaction: Transaction failed to sanitize accounts offsets correctly

Open femtoeu opened this issue 1 year ago • 4 comments

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> })

femtoeu avatar Mar 04 '23 14:03 femtoeu

Did you find any solution?

akbariandev avatar Aug 17 '23 13:08 akbariandev

Same here, do you have any solution?

ubuygold avatar Mar 31 '24 15:03 ubuygold