use candid::CandidType;
use serde::{Deserialize, Serialize};
use super::super::main::CanisterId;
#[derive(
CandidType, Serialize, Deserialize, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Default,
)]
pub struct EcdsaPublicKeyArgument {
pub canister_id: Option<CanisterId>,
pub derivation_path: Vec<Vec<u8>>,
pub key_id: EcdsaKeyId,
}
#[derive(
CandidType, Serialize, Deserialize, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Default,
)]
pub struct EcdsaPublicKeyResponse {
pub public_key: Vec<u8>,
pub chain_code: Vec<u8>,
}
#[derive(
CandidType, Serialize, Deserialize, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Default,
)]
pub struct SignWithEcdsaArgument {
pub message_hash: Vec<u8>,
pub derivation_path: Vec<Vec<u8>>,
pub key_id: EcdsaKeyId,
}
#[derive(
CandidType, Serialize, Deserialize, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Default,
)]
pub struct SignWithEcdsaResponse {
pub signature: Vec<u8>,
}
#[derive(
CandidType, Serialize, Deserialize, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Default,
)]
pub struct EcdsaKeyId {
pub curve: EcdsaCurve,
pub name: String,
}
#[derive(
CandidType, Serialize, Deserialize, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy,
)]
pub enum EcdsaCurve {
#[serde(rename = "secp256k1")]
Secp256k1,
}
impl Default for EcdsaCurve {
fn default() -> Self {
Self::Secp256k1
}
}