Skip to content

Commit

Permalink
Add ParseTransactionsRequest
Browse files Browse the repository at this point in the history
  • Loading branch information
0xIchigo committed May 2, 2024
1 parent 3798b10 commit 2672e14
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/types/enhanced_transaction_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,3 +204,15 @@ pub struct CompressedNftEvent {
pub metadata: Option<Metadata>,
pub update_args: Option<Value>,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct ParseTransactionsRequest {
pub transactions: Vec<String>,
}

/// We have a limit of 100 transactions per call, so this helps split the signatures into different chunks
impl ParseTransactionsRequest {
pub fn from_slice(signatures: &[String]) -> Vec<Self> {
signatures.chunks(100).map(|chunk| Self { transactions: chunk.to_vec() }).collect()
}
}

0 comments on commit 2672e14

Please sign in to comment.