Skip to content
New issue

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

[Feature]: support trace api #471

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions examples/trace.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
use starknet_macros::felt;
use starknet_providers::{Provider, SequencerGatewayProvider};

#[tokio::main]
async fn main() {
let provider = SequencerGatewayProvider::starknet_alpha_goerli();

// https://testnet.starkscan.co/tx/0x023cffcb294f338aad5c8351e0a5d49db6625f09e1df6ac5ebc06649bfbd1345#overview
let hash = felt!("0x023cffcb294f338aad5c8351e0a5d49db6625f09e1df6ac5ebc06649bfbd1345");
let tx_trace = provider.trace_transaction(hash).await.unwrap();
println!("{:?}", tx_trace);
dbg!(tx_trace);

// https://testnet.starkscan.co/block/0x7991a152b4a8d4e9a2d424808a93ad5ae2f4698a6b8e04d0c043f7e4996aabf
let hash = felt!("0x7991a152b4a8d4e9a2d424808a93ad5ae2f4698a6b8e04d0c043f7e4996aabf");
let block_trace = provider.trace_block_transactions(hash).await.unwrap();
println!("{:?}", block_trace);
dbg!(block_trace);
}
Loading
Loading