ic-agent 0.7.0

Agent library to communicate with the Internet Computer, following the Public Specification.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use crate::{export::Principal, identity::Identity, Signature};

pub struct AnonymousIdentity;

impl Identity for AnonymousIdentity {
    fn sender(&self) -> Result<Principal, String> {
        Ok(Principal::anonymous())
    }

    fn sign(&self, _blob: &[u8]) -> Result<Signature, String> {
        Ok(Signature {
            signature: None,
            public_key: None,
        })
    }
}