pub struct IdentityCallApi<'api> { /* private fields */ }
Implementations§
Source§impl<'api> IdentityCallApi<'api>
impl<'api> IdentityCallApi<'api>
Sourcepub fn cdd_register_did(
&self,
target_account: AccountId,
secondary_keys: Vec<SecondaryKey<AccountId>>,
) -> Result<WrappedCall>
pub fn cdd_register_did( &self, target_account: AccountId, secondary_keys: Vec<SecondaryKey<AccountId>>, ) -> Result<WrappedCall>
Register target_account
with a new Identity.
§Failure
origin
has to be a active CDD provider. Inactive CDD providers cannot add new claims.target_account
(primary key of the new Identity) can be linked to just one and only one identity.- External secondary keys can be linked to just one identity.
Sourcepub fn invalidate_cdd_claims(
&self,
cdd: IdentityId,
disable_from: u64,
expiry: Option<u64>,
) -> Result<WrappedCall>
pub fn invalidate_cdd_claims( &self, cdd: IdentityId, disable_from: u64, expiry: Option<u64>, ) -> Result<WrappedCall>
Invalidates any claim generated by cdd
from disable_from
timestamps.
You can also define an expiration time,
which will invalidate all claims generated by that cdd
and remove it as CDD member group.
Sourcepub fn accept_primary_key(
&self,
rotation_auth_id: u64,
optional_cdd_auth_id: Option<u64>,
) -> Result<WrappedCall>
pub fn accept_primary_key( &self, rotation_auth_id: u64, optional_cdd_auth_id: Option<u64>, ) -> Result<WrappedCall>
Call this with the new primary key. By invoking this method, caller accepts authorization to become the new primary key of the issuing identity. If a CDD service provider approved this change (or this is not required), primary key of the DID is updated.
The caller (new primary key) must be either a secondary key of the issuing identity, or unlinked to any identity.
Differs from rotate_primary_key_to_secondary in that it will unlink the old primary key instead of leaving it as a secondary key.
§Arguments
owner_auth_id
Authorization from the owner who initiated the changecdd_auth_id
Authorization from a CDD service provider
Sourcepub fn change_cdd_requirement_for_mk_rotation(
&self,
auth_required: bool,
) -> Result<WrappedCall>
pub fn change_cdd_requirement_for_mk_rotation( &self, auth_required: bool, ) -> Result<WrappedCall>
Set if CDD authorization is required for updating primary key of an identity. Callable via root (governance)
§Arguments
auth_required
CDD Authorization required or not
Sourcepub fn join_identity_as_key(&self, auth_id: u64) -> Result<WrappedCall>
pub fn join_identity_as_key(&self, auth_id: u64) -> Result<WrappedCall>
Join an identity as a secondary key.
Sourcepub fn leave_identity_as_key(&self) -> Result<WrappedCall>
pub fn leave_identity_as_key(&self) -> Result<WrappedCall>
Leave the secondary key’s identity.
Sourcepub fn add_claim(
&self,
target: IdentityId,
claim: Claim,
expiry: Option<u64>,
) -> Result<WrappedCall>
pub fn add_claim( &self, target: IdentityId, claim: Claim, expiry: Option<u64>, ) -> Result<WrappedCall>
Adds a new claim record or edits an existing one.
Only called by did_issuer’s secondary key.
Sourcepub fn revoke_claim(
&self,
target: IdentityId,
claim: Claim,
) -> Result<WrappedCall>
pub fn revoke_claim( &self, target: IdentityId, claim: Claim, ) -> Result<WrappedCall>
Marks the specified claim as revoked.
Sourcepub fn freeze_secondary_keys(&self) -> Result<WrappedCall>
pub fn freeze_secondary_keys(&self) -> Result<WrappedCall>
It disables all secondary keys at did
identity.
§Errors
Sourcepub fn unfreeze_secondary_keys(&self) -> Result<WrappedCall>
pub fn unfreeze_secondary_keys(&self) -> Result<WrappedCall>
Re-enables all secondary keys of the caller’s identity.
Adds an authorization.
Removes an authorization. _auth_issuer_pays determines whether the issuer of the authorisation pays the transaction fee
Sourcepub fn gc_add_cdd_claim(&self, target: IdentityId) -> Result<WrappedCall>
pub fn gc_add_cdd_claim(&self, target: IdentityId) -> Result<WrappedCall>
Assuming this is executed by the GC voting majority, adds a new cdd claim record.
Sourcepub fn gc_revoke_cdd_claim(&self, target: IdentityId) -> Result<WrappedCall>
pub fn gc_revoke_cdd_claim(&self, target: IdentityId) -> Result<WrappedCall>
Assuming this is executed by the GC voting majority, removes an existing cdd claim record.
Sourcepub fn revoke_claim_by_index(
&self,
target: IdentityId,
claim_type: ClaimType,
scope: Option<Scope>,
) -> Result<WrappedCall>
pub fn revoke_claim_by_index( &self, target: IdentityId, claim_type: ClaimType, scope: Option<Scope>, ) -> Result<WrappedCall>
Revokes a specific claim using its Claim Unique Index composed by target
,
claim_type
, and scope
.
Please note that origin
must be the issuer of the target claim.
Sourcepub fn rotate_primary_key_to_secondary(
&self,
auth_id: u64,
optional_cdd_auth_id: Option<u64>,
) -> Result<WrappedCall>
pub fn rotate_primary_key_to_secondary( &self, auth_id: u64, optional_cdd_auth_id: Option<u64>, ) -> Result<WrappedCall>
Call this with the new primary key. By invoking this method, caller accepts authorization to become the new primary key of the issuing identity. If a CDD service provider approved this change, (or this is not required), primary key of the DID is updated.
The caller (new primary key) must be either a secondary key of the issuing identity, or unlinked to any identity.
Differs from accept_primary_key in that it will leave the old primary key as a secondary key with the permissions specified in the corresponding RotatePrimaryKeyToSecondary authorization instead of unlinking the old primary key.
§Arguments
owner_auth_id
Authorization from the owner who initiated the changecdd_auth_id
Authorization from a CDD service provider
Adds secondary keys to target identity id
.
Keys are directly added to identity because each of them has an authorization.
§Arguments:
- `origin` which must be the primary key of the identity `id`.
- `id` to which new secondary keys will be added.
- `additional_keys` which includes secondary keys,
coupled with authorization data, to add to target identity.
§Errors
- Can only called by primary key owner.
- Keys should be able to linked to any identity.
Sourcepub fn set_secondary_key_permissions(
&self,
key: AccountId,
perms: Permissions,
) -> Result<WrappedCall>
pub fn set_secondary_key_permissions( &self, key: AccountId, perms: Permissions, ) -> Result<WrappedCall>
Sets permissions for an specific target_key
key.
Only the primary key of an identity is able to set secondary key permissions.
Sourcepub fn remove_secondary_keys(
&self,
keys_to_remove: Vec<AccountId>,
) -> Result<WrappedCall>
pub fn remove_secondary_keys( &self, keys_to_remove: Vec<AccountId>, ) -> Result<WrappedCall>
Removes specified secondary keys of a DID if present.
§Errors
The extrinsic can only called by primary key owner.
Sourcepub fn register_custom_claim_type(&self, ty: Vec<u8>) -> Result<WrappedCall>
pub fn register_custom_claim_type(&self, ty: Vec<u8>) -> Result<WrappedCall>
Register custom claim type.
§Errors
CustomClaimTypeAlreadyExists
The type that is being registered already exists.CounterOverflow
CustomClaimTypeId has overflowed.TooLong
The type being registered is too lang.
Sourcepub fn cdd_register_did_with_cdd(
&self,
target_account: AccountId,
secondary_keys: Vec<SecondaryKey<AccountId>>,
expiry: Option<u64>,
) -> Result<WrappedCall>
pub fn cdd_register_did_with_cdd( &self, target_account: AccountId, secondary_keys: Vec<SecondaryKey<AccountId>>, expiry: Option<u64>, ) -> Result<WrappedCall>
Register target_account
with a new Identity and issue a CDD claim with a blank CddId
§Failure
origin
has to be a active CDD provider. Inactive CDD providers cannot add new claims.target_account
(primary key of the new Identity) can be linked to just one and only one identity.- External secondary keys can be linked to just one identity.
Sourcepub fn create_child_identity(
&self,
secondary_key: AccountId,
) -> Result<WrappedCall>
pub fn create_child_identity( &self, secondary_key: AccountId, ) -> Result<WrappedCall>
Create a child identity and make the secondary_key
it’s primary key.
Only the primary key can create child identities.
§Arguments
secondary_key
the secondary key that will become the primary key of the new identity.
§Errors
KeyNotAllowed
only the primary key can create a new identity.NotASigner
thesecondary_key
is not a secondary key of the caller’s identity.AccountKeyIsBeingUsed
thesecondary_key
can’t be unlinked from it’s current identity.IsChildIdentity
the caller’s identity is already a child identity and can’t create child identities.
Sourcepub fn create_child_identities(
&self,
child_keys: Vec<CreateChildIdentityWithAuth<AccountId>>,
expires_at: u64,
) -> Result<WrappedCall>
pub fn create_child_identities( &self, child_keys: Vec<CreateChildIdentityWithAuth<AccountId>>, expires_at: u64, ) -> Result<WrappedCall>
Create a child identities.
The new primary key for each child identity will need to sign (off-chain) an authorization.
Only the primary key can create child identities.
§Arguments
child_keys
the keys that will become primary keys of their own child identity.
§Errors
KeyNotAllowed
only the primary key can create a new identity.AlreadyLinked
one of the keys is already linked to an identity.DuplicateKey
one of the keys is included multiple times.IsChildIdentity
the caller’s identity is already a child identity and can’t create child identities.
Sourcepub fn unlink_child_identity(
&self,
child_did: IdentityId,
) -> Result<WrappedCall>
pub fn unlink_child_identity( &self, child_did: IdentityId, ) -> Result<WrappedCall>
Unlink a child identity from it’s parent identity.
Only the primary key of the parent or child identities can unlink the identities.
§Arguments
child_did
the child identity to unlink from its parent identity.
§Errors
KeyNotAllowed
only the primary key of either the parent or child identity can unlink the identities.NoParentIdentity
the identitychild_did
doesn’t have a parent identity.NotParentOrChildIdentity
the caller’s identity isn’t the parent or child identity.
Trait Implementations§
Source§impl<'api> Clone for IdentityCallApi<'api>
impl<'api> Clone for IdentityCallApi<'api>
Source§fn clone(&self) -> IdentityCallApi<'api>
fn clone(&self) -> IdentityCallApi<'api>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl<'api> Freeze for IdentityCallApi<'api>
impl<'api> !RefUnwindSafe for IdentityCallApi<'api>
impl<'api> Send for IdentityCallApi<'api>
impl<'api> Sync for IdentityCallApi<'api>
impl<'api> Unpin for IdentityCallApi<'api>
impl<'api> !UnwindSafe for IdentityCallApi<'api>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<Src, Dest> IntoTuple<Dest> for Srcwhere
Dest: FromTuple<Src>,
impl<Src, Dest> IntoTuple<Dest> for Srcwhere
Dest: FromTuple<Src>,
fn into_tuple(self) -> Dest
Source§impl<T, Outer> IsWrappedBy<Outer> for T
impl<T, Outer> IsWrappedBy<Outer> for T
Source§impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
Source§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
Source§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
T
. Read moreSource§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
Source§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
unchecked_from
.Source§impl<T, S> UniqueSaturatedInto<T> for S
impl<T, S> UniqueSaturatedInto<T> for S
Source§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
T
.