Skip to content

Commit 509c728

Browse files
committed
feat(ffi): add satscard waitStep for auth delay progress
1 parent 257ac57 commit 509c728

File tree

3 files changed

+425
-291
lines changed

3 files changed

+425
-291
lines changed

cktap-ffi/src/sats_card.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,10 @@ impl SatsCard {
6767
Ok(pubkey_desc)
6868
}
6969

70-
/// Wait 15 seconds or until auth delay timeout is done
71-
pub async fn wait(&self) -> Result<(), CkTapError> {
70+
/// Wait one second of auth delay and return the remaining delay, if any.
71+
pub async fn wait(&self) -> Result<Option<u8>, CkTapError> {
7272
let mut card = self.0.lock().await;
73-
// if auth delay call wait
74-
while card.auth_delay().is_some() {
75-
card.wait(None).await?;
76-
}
77-
Ok(())
73+
card.wait(None).await.map_err(CkTapError::from)
7874
}
7975

8076
/// Verify the card has authentic Coinkite root certificate

0 commit comments

Comments
 (0)