Skip to content

Conversation

@porkytheblack
Copy link

API Response Fix
• Changed return type of get_transaction_by_hash and get_transaction_by_version in AptosFullnodeClient from
FullnodeResponse → FullnodeResponse<serde_json::Value>.

Why?
The /transactions/* endpoints return a JSON object. Deserializing that into String blows up with:

JSON er/de error: invalid type: map, expected a string at line 1 column 0

After this patch you can inspect fields directly:

let tx = client.get_transaction_by_hash(hash).await?.into_inner();
println!("version = {}", tx["version"]);

@DariusIMP
Copy link

+1, I stumbled with the same issue

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

Successfully merging this pull request may close these issues.

3 participants