Struct polymesh_api::polymesh::api::identity::IdentityCallApi
source · 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<'api>>
pub fn cdd_register_did( &self, target_account: AccountId, secondary_keys: Vec<SecondaryKey<AccountId>> ) -> Result<WrappedCall<'api>>
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<'api>>
pub fn invalidate_cdd_claims( &self, cdd: IdentityId, disable_from: u64, expiry: Option<u64> ) -> Result<WrappedCall<'api>>
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<'api>>
pub fn accept_primary_key( &self, rotation_auth_id: u64, optional_cdd_auth_id: Option<u64> ) -> Result<WrappedCall<'api>>
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<'api>>
pub fn change_cdd_requirement_for_mk_rotation( &self, auth_required: bool ) -> Result<WrappedCall<'api>>
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<'api>>
pub fn join_identity_as_key(&self, auth_id: u64) -> Result<WrappedCall<'api>>
Join an identity as a secondary key.
sourcepub fn leave_identity_as_key(&self) -> Result<WrappedCall<'api>>
pub fn leave_identity_as_key(&self) -> Result<WrappedCall<'api>>
Leave the secondary key’s identity.
sourcepub fn add_claim(
&self,
target: IdentityId,
claim: Claim,
expiry: Option<u64>
) -> Result<WrappedCall<'api>>
pub fn add_claim( &self, target: IdentityId, claim: Claim, expiry: Option<u64> ) -> Result<WrappedCall<'api>>
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<'api>>
pub fn revoke_claim( &self, target: IdentityId, claim: Claim ) -> Result<WrappedCall<'api>>
Marks the specified claim as revoked.
sourcepub fn freeze_secondary_keys(&self) -> Result<WrappedCall<'api>>
pub fn freeze_secondary_keys(&self) -> Result<WrappedCall<'api>>
It disables all secondary keys at did
identity.
Errors
sourcepub fn unfreeze_secondary_keys(&self) -> Result<WrappedCall<'api>>
pub fn unfreeze_secondary_keys(&self) -> Result<WrappedCall<'api>>
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 add_investor_uniqueness_claim(
&self,
target: IdentityId,
claim: Claim,
proof: [u8; 64],
expiry: Option<u64>
) -> Result<WrappedCall<'api>>
pub fn add_investor_uniqueness_claim( &self, target: IdentityId, claim: Claim, proof: [u8; 64], expiry: Option<u64> ) -> Result<WrappedCall<'api>>
Add Claim::InvestorUniqueness
claim for a given target identity.
Weight of the this extrinsic is depend on the computation that used to validate the proof of claim, which will be a constant independent of user inputs.
Arguments
- origin - Who provides the claim to the user? In this case, it’s the user’s account id as the user provides.
- target -
IdentityId
to which the claim gets assigned. - claim -
InvestorUniqueness
claim details. - proof - To validate the self attestation.
- expiry - Expiry of claim.
Errors
DidMustAlreadyExist
Target should already been a part of the ecosystem.ClaimVariantNotAllowed
When origin trying to pass claim variant other thanInvestorUniqueness
.ConfidentialScopeClaimNotAllowed
When issuer is different from target or CDD_ID is invalid for given user.- `InvalidScopeClaim When proof is invalid.
InvalidCDDId
when you are not the owner of that CDD_ID.
sourcepub fn gc_add_cdd_claim(&self, target: IdentityId) -> Result<WrappedCall<'api>>
pub fn gc_add_cdd_claim(&self, target: IdentityId) -> Result<WrappedCall<'api>>
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<'api>>
pub fn gc_revoke_cdd_claim( &self, target: IdentityId ) -> Result<WrappedCall<'api>>
Assuming this is executed by the GC voting majority, removes an existing cdd claim record.
pub fn add_investor_uniqueness_claim_v2( &self, target: IdentityId, scope: Scope, claim: Claim, proof: ScopeClaimProof, expiry: Option<u64> ) -> Result<WrappedCall<'api>>
sourcepub fn revoke_claim_by_index(
&self,
target: IdentityId,
claim_type: ClaimType,
scope: Option<Scope>
) -> Result<WrappedCall<'api>>
pub fn revoke_claim_by_index( &self, target: IdentityId, claim_type: ClaimType, scope: Option<Scope> ) -> Result<WrappedCall<'api>>
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.
Errors
TargetHasNonZeroBalanceAtScopeId
when you try to revoke aInvestorUniqueness*
claim, andtarget
identity still have any balance on the givenscope
.
sourcepub fn rotate_primary_key_to_secondary(
&self,
auth_id: u64,
optional_cdd_auth_id: Option<u64>
) -> Result<WrappedCall<'api>>
pub fn rotate_primary_key_to_secondary( &self, auth_id: u64, optional_cdd_auth_id: Option<u64> ) -> Result<WrappedCall<'api>>
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<'api>>
pub fn set_secondary_key_permissions( &self, key: AccountId, perms: Permissions ) -> Result<WrappedCall<'api>>
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<'api>>
pub fn remove_secondary_keys( &self, keys_to_remove: Vec<AccountId> ) -> Result<WrappedCall<'api>>
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<'api>>
pub fn register_custom_claim_type( &self, ty: Vec<u8> ) -> Result<WrappedCall<'api>>
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<'api>>
pub fn cdd_register_did_with_cdd( &self, target_account: AccountId, secondary_keys: Vec<SecondaryKey<AccountId>>, expiry: Option<u64> ) -> Result<WrappedCall<'api>>
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<'api>>
pub fn create_child_identity( &self, secondary_key: AccountId ) -> Result<WrappedCall<'api>>
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<'api>>
pub fn create_child_identities( &self, child_keys: Vec<CreateChildIdentityWithAuth<AccountId>>, expires_at: u64 ) -> Result<WrappedCall<'api>>
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<'api>>
pub fn unlink_child_identity( &self, child_did: IdentityId ) -> Result<WrappedCall<'api>>
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> !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
§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
§fn checked_from<T>(t: T) -> Option<Self>where
Self: TryFrom<T>,
fn checked_from<T>(t: T) -> Option<Self>where Self: TryFrom<T>,
§fn checked_into<T>(self) -> Option<T>where
Self: TryInto<T>,
fn checked_into<T>(self) -> Option<T>where Self: TryInto<T>,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere T: Any,
§fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T, Global>) -> Rc<dyn Any, Global>
fn into_any_rc(self: Rc<T, Global>) -> Rc<dyn Any, Global>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.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> 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 more§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere T: UncheckedFrom<S>,
§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
unchecked_from
.source§impl<T, S> UniqueSaturatedInto<T> for Swhere
T: Bounded,
S: TryInto<T>,
impl<T, S> UniqueSaturatedInto<T> for Swhere T: Bounded, S: TryInto<T>,
source§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
T
.