You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello developer, I use GetParsedTransaction to get event data, but the data obtained and the data from Solscan are incorrect. Can I ask for your help?
tx:LofiBXmyHkjVRiK6Ae76DBBDSLUHFrMpdpZzYYYRz4tmWtj2jXP9bARRpMBwGiGDeDhu5Sz8wTvorxYSdD72Nj2
func GetTransaction(ctx context.Context, signature string) {
txSig := solana.MustSignatureFromBase58(signature)
version := uint64(0)
out, err := client.GetParsedTransaction(
context.TODO(),
txSig,
&rpc.GetParsedTransactionOpts{
MaxSupportedTransactionVersion: &version,
Commitment: rpc.CommitmentConfirmed,
},
)
if err != nil {
panic(err)
}
for _, instructions := range out.Meta.InnerInstructions {
for _, uniner := range instructions.Instructions {
if uniner.Program == "" && uniner.ProgramId.String() == "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P" {
binary, err := base58.Decode(uniner.Data.String())
if err != nil {
continue
}
acEvent := models.TransactionData{}
decoder := bin.NewBorshDecoder(binary)
err = decoder.Decode(&acEvent)
if err != nil {
continue
}
fmt.Println(acEvent)
}
}
}
}
Hello developer, I use GetParsedTransaction to get event data, but the data obtained and the data from Solscan are incorrect. Can I ask for your help?
tx:LofiBXmyHkjVRiK6Ae76DBBDSLUHFrMpdpZzYYYRz4tmWtj2jXP9bARRpMBwGiGDeDhu5Sz8wTvorxYSdD72Nj2
out:
Looks like the data type is incorrect,I want to get data like this。
The text was updated successfully, but these errors were encountered: