Comments (7)
https://portto.github.io/solana-go-sdk/rpc/get-signatures-for-address.html
from solana-go-sdk.
Hey, thanks for the link above, its working good for me.
I'm using the wallet address to get the transaction signatures and then I use the transaction signatures to get the transactions, only the signatures property in the transactions is an array and it looks like the signature is encoded.
I use this line of code to get the transactions
tr, errTran := c.GetTransaction(context.Background(), signature)
How do I get the signature from this encoded signature value?
Thanks
from solana-go-sdk.
Hey, I'm having the same problem too.
It looks like the actual transaction signature that is in the transactions filed is encoded somehow.
I can't decode it either.
from solana-go-sdk.
signatures on explorer are base58 encoded strings. lots of RPC do use them as well. if you do base58 decode, you will get a 64 bytes array. they are the same value, just represent by different text-encoded. In the other words, when you get a signature that is a byte array. you can just base58 encode it to get a human-friendly string.
from solana-go-sdk.
Hey, when i use your library to get the transaction, I'm needing to find the senders address and the recipients address and I have been relying on the order in which the sender and receiver details are inside the field PostTokenBalances, as shown below.
tr, _ := c.GetTransaction(context.Background(), sig)
recipient := tr.Meta.PostTokenBalances[1].Owner
sender := tr.Meta.PostTokenBalances[0].Owner
The problem I'm having is that sometimes the order in both of the PostTokenBalances and PreTokenBalances fields seems to change around and cause errors in my application.
Are you aware of this problem and how can I work around this to get the correct recipient and sender addresses?
from solana-go-sdk.
pre/post balance and pre/post token balance can only know the final result. if a tx is like A send B 100 token, B send C 100 token, you can only know A lost 100 and C get 100 but you don't have any idea B is the man in the middle. if you would like to know the detail, you need to parse instructions. for decoding an instruction, every program can define on their own way. you should take a look to the program
from solana-go-sdk.
Thanks 🙏🙏🙏🙏
from solana-go-sdk.
Related Issues (20)
- Cant understand how to give instructions for raydium swap HOT 2
- How to create stake account? HOT 2
- [HELP] Deserializing AccountData data field into address lookup tables
- UpdateMetadataAccount returning deprecated error HOT 2
- Any plan to support anchor? HOT 3
- Websocket API support
- How do I initiate a USDT SPL transfer transaction? HOT 4
- Add Priority Fee to Transaction HOT 1
- How do I initiate a USDT SPL transfer transaction? HOT 3
- An optimization suggestion about transaction serialization
- Add unitsConsumed field to RPC simulateTransaction response HOT 1
- GetSlotLeader HOT 2
- Add GetSlotLeaders HOT 1
- Add GetProgramAccounts method to the client folder
- Failing to deserialize token metadata HOT 3
- Error 32002 when creating associated token account HOT 4
- Docs incorrectly uses system.transfer for token transfers HOT 1
- How to deploy smart contract/program? HOT 1
- I cannot find how to confirm a transaction status on the client... HOT 1
- Add new Instructions to already existing transactions HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from solana-go-sdk.