AptosVM Decoded Logs
Fetch Aptos decoded log data for versions 2382400000
to 2382410000
for address 0xc0deb00c405f84c85dc13442e305df75d1288100cdd82675695f6148c7ece51c
.
Code
Rust
use futures::StreamExt;
use std::{collections::HashSet, sync::Arc};
use pangea_client::{
core::types::ChainId, query::Bound,
ClientBuilder, Format, WsProvider,
provider::MoveProvider, requests::movement::GetMoveLogsRequest,
};
#[tokio::main]
async fn main() {
dotenvy::dotenv_override().ok();
let client = match ClientBuilder::default()
.endpoint("aptos.app.pangea.foundation")
.build::<WsProvider>()
.await
{
Ok(client) => Arc::new(client),
Err(e) => {
eprintln!("Client failed to initialize:\n{e}");
return;
}
};
{
let request = GetMoveLogsRequest {
chains: HashSet::from([ChainId::APTOS]),
from_block: Bound::Exact(2382400000),
to_block: Bound::Exact(2382410000),
address__in: HashSet::from(["0xc0deb00c405f84c85dc13442e305df75d1288100cdd82675695f6148c7ece51c"
.parse()
.unwrap()]),
..Default::default()
};
let stream = match client
.get_move_logs_decoded_by_format(request, Format::JsonStream, false)
.await
{
Ok(stream) => stream,
Err(e) => {
eprintln!("Request failed\n{e}");
return;
}
};
futures::pin_mut!(stream);
while let Some(chunk) = stream.next().await {
let chunk = String::from_utf8(chunk.unwrap()).unwrap();
println!("{chunk}");
}
}
}
Response
[
...
{
"chain": 2147483643,
"block_number": "0x8e00b0ca",
"block_hash": "0x5d52579982101c40003b6399b4ce9e5d5474a648af00f43ba4c886d8461164df",
"transaction_index": "0x8e00b0ca",
"transaction_hash": "0x5d52579982101c40003b6399b4ce9e5d5474a648af00f43ba4c886d8461164df",
"log_index": "0xf",
"timestamp": 1739913186589700,
"kind": "V1",
"key_creation_number": "0x9",
"key_account_address": "0x68c709c6614e29f401b6bfdd0b89578381ef0fb719515c03b73cf13e45550e06",
"sequence_number": "0x23ee185",
"address": "0xc0deb00c405f84c85dc13442e305df75d1288100cdd82675695f6148c7ece51c",
"module": "user",
"event_name": "PlaceLimitOrderEvent",
"type_tag": "0x00",
"event_data": "0x070000000000000068c709c6614e29f401b6bfdd0b89578381ef0fb719515c03b73cf13e45550e06000000000000000068c709c6614e29f401b6bfdd0b89578381ef0fb719515c03b73cf13e45550e0600d5d07400000000009d150000000000000300d5d07400000000009d15000052015e00e7e82b0300000000",
"decoded": "{\"market_id\":7,\"user\":\"0x68c709c6614e29f401b6bfdd0b89578381ef0fb719515c03b73cf13e45550e06\",\"custodian_id\":0,\"integrator\":\"0x68c709c6614e29f401b6bfdd0b89578381ef0fb719515c03b73cf13e45550e06\",\"side\":false,\"size\":7655637,\"price\":5533,\"restriction\":3,\"self_match_behavior\":0,\"remaining_size\":7655637,\"order_id\":\"0x32be8e7005e01520000159d\"}"
}
]
Query Parameters
chains
: Filters the data bychain
.from_block
/from_version
: Filters the data by a startingversion
. As Move chains use a per-transaction versioned database, we useversion
interchangably withblock_number
and omit blocks altogether.to_block
/to_version
: Filters the data by an endingversion
. As Move chains use a per-transaction versioned database, we useversion
interchangably withblock_number
and omit blocks altogether.address__in
: Filters the data by a list ofaddress
.module__in
: Filters the data by a list ofmodule
.event_name__in
: Filters the data by a list ofevent_name
.type_tag__in
: Filters the data by a list oftype_tag
.