Skip to content

AptosVM Receipts

Fetch Aptos writeset receipts for versions 2382400000 to 2382400000 for resource event name ValidatorPerformance.

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::GetMoveReceiptsRequest, 
};
 
#[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 = GetMoveReceiptsRequest { 
            chains: HashSet::from([ChainId::APTOS]), 
            from_block: Bound::Exact(2382400000), 
            to_block: Bound::Exact(2382410000), 
            resource_event_name__in: HashSet::from(["ValidatorPerformance".to_string()]), 
            ..Default::default() 
        }; 
        let stream = match client 
            .get_move_receipts_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": "0x8e00b0f5",
    "block_hash": "0x1b88919ed868f744cdfc455cff365fd585e8e6da5335e02914643f7a855d0a2d",
    "transaction_index": "0x8e00b0f5",
    "transaction_hash": "0x1b88919ed868f744cdfc455cff365fd585e8e6da5335e02914643f7a855d0a2d",
    "receipt_index": "0x1",
    "timestamp": 1739913186953619,
    "op": "Modification",
    "state_key": "0x0000000000000000000000000000000000000000000000000000000000000000013d010000000000000000000000000000000000000000000000000000000000000001057374616b651456616c696461746f72506572666f726d616e636500",
    "data": "0x93010400000000000000000000000000000007000000000000000000000000000000050000000000000000000000000000000d0000000000000000000000000000002a0000000000000000000000000000003900000000000000000000000000000028000000000000000000000000000000030000000000000000000000000000000200000000000000000000000000000001000000000000000000000000000000040000000000000000000000000000000200000000000000000000000000000005000000000000000000000000000000020000000000000000000000000000000500000000000000000000000000000004000000000000000000000000000000040000000000000000000000000000000700000000000000000000000000000003000000000000000000000000000000280000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000040000000000000000000000000000000700000000000000000000000000000021000000000000000000000000000000040000000000000000000000000000002c00000000000000000000000000000023000000000000000000000000000000250000000000000000000000000000002500000000000000000000000000000011000000000000000000000000000000010000000000000000000000000000000700000000000000000000000000000009000000000000000000000000000000060000000000000000000000000000000500000000000000000000000000000002000000000000000000000000000000330000000000000000000000000000000600000000000000000000000000000019000000000000000000000000000000030000000000000000000000000000002400000000000000000000000000000003000000000000000000000000000000220000000000000000000000000000001b0000000000000000000000000000002300000000000000000000000000000018000000000000000000000000000000030000000000000000000000000000002a0000000000000000000000000000002b0000000000000000000000000000002100000000000000000000000000000019000000000000000000000000000000200000000000000000000000000000002500000000000000000000000000000015000000000000000000000000000000370000000000000000000000000000001b00000000000000000000000000000028000000000000000000000000000000090000000000000000000000000000003e0000000000000000000000000000000f00000000000000000000000000000030000000000000000000000000000000220000000000000000000000000000001c0000000000000000000000000000001e0000000000000000000000000000001900000000000000000000000000000021000000000000000000000000000000290000000000000000000000000000001f0000000000000000000000000000004d00000000000000000000000000000008000000000000000000000000000000190000000000000000000000000000000d0000000000000000000000000000005300000000000000000000000000000013000000000000000000000000000000040000000000000000000000000000001b0000000000000000000000000000001d00000000000000000000000000000024000000000000000000000000000000130000000000000000000000000000001f00000000000000000000000000000093000000000000000100000000000000310000000000000000000000000000003b000000000000000000000000000000070000000000000000000000000000003b000000000000000000000000000000510000000000000000000000000000001100000000000000000000000000000007000000000000000000000000000000300000000000000000000000000000002800000000000000000000000000000024000000000000000000000000000000190000000000000000000000000000002c000000000000000000000000000000070000000000000000000000000000001000000000000000000000000000000022000000000000000000000000000000210000000000000000000000000000003c0000000000000000000000000000000f00000000000000000000000000000033000000000000000000000000000000080000000000000000000000000000001900000000000000000000000000000023000000000000000000000000000000390000000000000000000000000000001100000000000000000000000000000013000000000000000000000000000000130000000000000000000000000000000f0000000000000000000000000000003200000000000000000000000000000012000000000000000000000000000000010000000000000000000000000000000a0000000000000000000000000000000400000000000000000000000000000026000000000000000000000000000000030000000000000000000000000000000b00000000000000000000000000000006000000000000000000000000000000270000000000000000000000000000002f00000000000000000000000000000007000000000000000000000000000000280000000000000000000000000000001d0000000000000000000000000000000c0000000000000000000000000000000b0000000000000000000000000000000a00000000000000000000000000000011000000000000000000000000000000060000000000000000000000000000002800000000000000000000000000000008000000000000000000000000000000440000000000000000000000000000000b00000000000000000000000000000010000000000000000000000000000000140000000000000000000000000000001c00000000000000000000000000000048000000000000000000000000000000090000000000000000000000000000007c000000000000000000000000000000680000000000000000000000000000001600000000000000000000000000000009000000000000000000000000000000100000000000000000000000000000000700000000000000000000000000000003000000000000000000000000000000060000000000000000000000000000000200000000000000000000000000000007000000000000000000000000000000",
    "slot_deposit": "0x0",
    "bytes_deposit": "0x0",
    "creation_time_usecs": "0x0",
    "access_path_address": "0x0000000000000000000000000000000000000000000000000000000000000001",
    "resource_address": "0x0000000000000000000000000000000000000000000000000000000000000001",
    "resource_module": "stake",
    "resource_event_name": "ValidatorPerformance"
  }
]

Query Parameters

  • chains: Filters the data by chain.
  • from_block / from_version: Filters the data by a starting version. As Move chains use a per-transaction versioned database, we use version interchangably with block_number and omit blocks altogether.
  • to_block / to_version: Filters the data by an ending version. As Move chains use a per-transaction versioned database, we use version interchangably with block_number and omit blocks altogether.
  • access_path_address__in: Filters the data by a list of access_path_address.
  • resource_address__in: Filters the data by a list of resource_address.
  • resource_module__in: Filters the data by a list of resource_module.
  • resource_event_name__in: Filters the data by a list of resource_event_name.