Skip to content
Merged
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
36 changes: 36 additions & 0 deletions crates/lib/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,42 @@ impl EnabledMethods {
]
.into_iter()
}

/// Returns a Vec of enabled JSON-RPC method names
pub fn get_enabled_method_names(&self) -> Vec<String> {
let mut methods = Vec::new();
if self.liveness {
methods.push("liveness".to_string());
}
if self.estimate_transaction_fee {
methods.push("estimateTransactionFee".to_string());
}
if self.get_supported_tokens {
methods.push("getSupportedTokens".to_string());
}
if self.get_payer_signer {
methods.push("getPayerSigner".to_string());
}
if self.sign_transaction {
methods.push("signTransaction".to_string());
}
if self.sign_and_send_transaction {
methods.push("signAndSendTransaction".to_string());
}
if self.transfer_transaction {
methods.push("transferTransaction".to_string());
}
if self.get_blockhash {
methods.push("getBlockhash".to_string());
}
if self.get_config {
methods.push("getConfig".to_string());
}
if self.sign_transaction_if_paid {
methods.push("signTransactionIfPaid".to_string());
}
methods
}
}

impl IntoIterator for &EnabledMethods {
Expand Down
Loading