Skip to content

Commit

Permalink
Adding more structs for list of compressed nft events. closes #20
Browse files Browse the repository at this point in the history
  • Loading branch information
dougEfresh committed Mar 3, 2024
1 parent 541c307 commit 863d072
Showing 1 changed file with 45 additions and 6 deletions.
51 changes: 45 additions & 6 deletions src/api/types/enhanced.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ impl ParseTransactionsRequest {
pub struct TransactionEvent {
pub nft: Option<NFTEvent>,
pub swap: Option<SwapEvent>,
pub compressed: Option<CompressedNftEvent>,
pub compressed: Option<Vec<CompressedNftEvent>>,
pub set_authority: Option<Vec<Authority>>,
}

#[derive(Deserialize, Serialize, Debug)]
Expand All @@ -51,13 +52,18 @@ pub struct CompressedNftEvent {
#[serde(rename = "type")]
pub transaction_type: TransactionType,
pub tree_id: String,
pub leaf_index: Option<Number>,
pub seq: Option<Number>,
pub asset_id: Option<String>,
pub instruction_index: Option<Number>,
pub inner_instruction_index: Option<Number>,
pub leaf_index: Option<i32>,
pub seq: Option<i32>,
pub asset_id: String,
pub instruction_index: Option<i32>,
pub inner_instruction_index: Option<i32>,
pub new_leaf_owner: Option<String>,
pub old_leaf_owner: Option<String>,
pub new_leaf_delegate: Option<String>,
pub old_leaf_delegate: Option<serde_json::Value>,
pub tree_delegate: Option<String>,
pub metadata: Option<Metadata>,
pub update_args: Option<serde_json::Value>,
}

#[derive(Deserialize, Serialize, Debug)]
Expand Down Expand Up @@ -198,3 +204,36 @@ pub struct InnerInstruction {
pub data: String,
pub program_id: String,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct Collection {
pub key: String,
pub verified: bool,
}

#[derive(Serialize, Deserialize, Debug)]
#[serde(rename_all = "camelCase")]
pub struct Metadata {
pub name: String,
pub symbol: String,
pub uri: String,
pub seller_fee_basis_points: i32,
pub primary_sale_happened: bool,
#[serde(rename = "isMutable")]
pub mutable: bool,
pub edition_nonce: Option<i32>,
pub token_standard: Option<String>,
pub collection: Option<Collection>,
pub token_program_version: String,
pub creators: Option<Vec<serde_json::Value>>,
}

#[derive(Serialize, Deserialize, Debug)]
#[serde(rename_all = "camelCase")]
pub struct Authority {
pub account: String,
pub from: String,
pub to: String,
pub instruction_index: i32,
pub inner_instruction_index: i32,
}

0 comments on commit 863d072

Please sign in to comment.