Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

SingleSigner::query_nonce

Fetch the next unused nonce. Trait method of SequencedSigner (from dango_types::signer).

Signature

#[async_trait]
impl<S> SequencedSigner for SingleSigner<S, Defined<Nonce>>
where
    S: Secret + Send + Sync,
{
    async fn query_nonce<C>(&self, client: &C) -> anyhow::Result<Nonce>
    where
        C: QueryClient,
        anyhow::Error: From<C::Error>;
}

Example

use {
    anyhow::Result,
    dango_sdk::{HttpClient, SingleSigner},
    dango_types::signer::SequencedSigner,
};
 
async fn check_nonce(
    http: &HttpClient,
    signer: &SingleSigner<impl dango_sdk::Secret + Send + Sync>,
) -> Result<()> {
    let on_chain = signer.query_nonce(http).await?;
    println!("on-chain: {on_chain}, in-memory: {}", signer.nonce());
    Ok(())
}

Parameters

client&C implementing QueryClient.

Returns

Nonce — same value as query_next_nonce; this is the SequencedSigner adapter.

Notes

  • Only available when nonce is Defined (the trait bound SequencedSigner requires it).
  • Identical body to query_next_nonce; exposed via the trait so generic code over SequencedSigner can reach it.

See also