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
tx: https://solscan.io/tx/5EuLFb4uZ21bNsEQrGw52sSTHK1RVaz4NBoLqW1sqcC6YhPnQp3SpMYmdwJNNAd3gd8iPPGNj1jA1Q9MucLMnr6Z
func decodeSPLTokenTransfer(tx *solana.Transaction) { // 依次解析命令,解析出的TransferChecked指令为止 for _, inst := range tx.Message.Instructions { progKey, err := tx.ResolveProgramIDIndex(inst.ProgramIDIndex) if err != nil { break } fmt.Printf("progKey is %v \n", progKey) accounts, err := inst.ResolveInstructionAccounts(&tx.Message) if err != nil { break } decodedInst, err := token.DecodeInstruction(accounts, inst.Data) if err != nil { continue } if transferInfo, ok := decodedInst.Impl.(*token.TransferChecked); ok { fmt.Printf("Source %v\n", transferInfo.Accounts.Get(0).PublicKey.String()) fmt.Printf("Destination %v\n", transferInfo.Accounts.Get(2).PublicKey.String()) // 3hL6oKH13MgJCABFKRAa2Rnd856wp78KXm11nw56vzF5 fmt.Printf("token %v\n", transferInfo.Accounts.Get(1).PublicKey.String()) fmt.Printf("amount %d\n", *transferInfo.Amount) fmt.Printf("decimals %d\n", *transferInfo.Decimals) } } }
Destination address : 3hL6oKH13MgJCABFKRAa2Rnd856wp78KXm11nw56vzF5
But the actual receiving address is:2sAUucZzUsBZYn3ag6KHAiV3d51WSDs1k94dCLgE1Bq6
How can we obtain the real token receiving address?
thanks.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
tx: https://solscan.io/tx/5EuLFb4uZ21bNsEQrGw52sSTHK1RVaz4NBoLqW1sqcC6YhPnQp3SpMYmdwJNNAd3gd8iPPGNj1jA1Q9MucLMnr6Z
Destination address : 3hL6oKH13MgJCABFKRAa2Rnd856wp78KXm11nw56vzF5
But the actual receiving address is:2sAUucZzUsBZYn3ag6KHAiV3d51WSDs1k94dCLgE1Bq6
How can we obtain the real token receiving address?
thanks.
The text was updated successfully, but these errors were encountered: