pub struct IdentityCallApi<'api> { /* private fields */ }

Implementations§

source§

impl<'api> IdentityCallApi<'api>

source

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.
source

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.

source

pub fn remove_secondary_keys_old( &self, keys_to_remove: Vec<Signatory<AccountId>> ) -> Result<WrappedCall<'api>>

Deprecated. Use remove_secondary_keys instead.

source

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 change
  • cdd_auth_id Authorization from a CDD service provider
source

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
source

pub fn join_identity_as_key(&self, auth_id: u64) -> Result<WrappedCall<'api>>

Join an identity as a secondary key.

source

pub fn leave_identity_as_key(&self) -> Result<WrappedCall<'api>>

Leave the secondary key’s identity.

source

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.

source

pub fn revoke_claim( &self, target: IdentityId, claim: Claim ) -> Result<WrappedCall<'api>>

Marks the specified claim as revoked.

source

pub fn set_permission_to_signer( &self, key: Signatory<AccountId>, perms: Permissions ) -> Result<WrappedCall<'api>>

Deprecated. Use set_secondary_key_permissions instead.

source

pub fn placeholder_legacy_set_permission_to_signer( &self ) -> Result<WrappedCall<'api>>

Placeholder for removed legacy_set_permission_to_signer.

source

pub fn freeze_secondary_keys(&self) -> Result<WrappedCall<'api>>

It disables all secondary keys at did identity.

Errors
source

pub fn unfreeze_secondary_keys(&self) -> Result<WrappedCall<'api>>

Re-enables all secondary keys of the caller’s identity.

source

pub fn add_authorization( &self, target: Signatory<AccountId>, data: AuthorizationData<AccountId>, expiry: Option<u64> ) -> Result<WrappedCall<'api>>

Adds an authorization.

source

pub fn remove_authorization( &self, target: Signatory<AccountId>, auth_id: u64, _auth_issuer_pays: bool ) -> Result<WrappedCall<'api>>

Removes an authorization. _auth_issuer_pays determines whether the issuer of the authorisation pays the transaction fee

source

pub fn add_secondary_keys_with_authorization_old( &self, additional_keys: Vec<SecondaryKeyWithAuthV1<AccountId>>, expires_at: u64 ) -> Result<WrappedCall<'api>>

Deprecated. Use add_secondary_keys_with_authorization instead.

source

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 than InvestorUniqueness.
  • 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.
source

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.

source

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.

source

pub fn add_investor_uniqueness_claim_v2( &self, target: IdentityId, scope: Scope, claim: Claim, proof: ScopeClaimProof, expiry: Option<u64> ) -> Result<WrappedCall<'api>>

source

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 a InvestorUniqueness* claim, and target identity still have any balance on the given scope.
source

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 change
  • cdd_auth_id Authorization from a CDD service provider
source

pub fn add_secondary_keys_with_authorization( &self, additional_keys: Vec<SecondaryKeyWithAuth<AccountId>>, expires_at: u64 ) -> Result<WrappedCall<'api>>

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.
source

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.

source

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.

source

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.
source

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.

Trait Implementations§

source§

impl<'api> Clone for IdentityCallApi<'api>

source§

fn clone(&self) -> IdentityCallApi<'api>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'api> From<&'api Api> for IdentityCallApi<'api>

source§

fn from(api: &'api Api) -> Self

Converts to this type from the input type.

Auto 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> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CheckedConversion for T

§

fn checked_from<T>(t: T) -> Option<Self>where Self: TryFrom<T>,

Convert from a value of T into an equivalent instance of Option<Self>. Read more
§

fn checked_into<T>(self) -> Option<T>where Self: TryInto<T>,

Consume self to return Some equivalent value of Option<T>. Read more
§

impl<T> Downcast for Twhere T: Any,

§

fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>

Convert 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>

Convert 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)

Convert &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)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> DowncastSync for Twhere T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T, Global>) -> Arc<dyn Any + Sync + Send, Global>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
source§

impl<T> DynClone for Twhere T: Clone,

source§

fn __clone_box(&self, _: Private) -> *mut ()

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T, Outer> IsWrappedBy<Outer> for Twhere Outer: AsRef<T> + AsMut<T> + From<T>, T: From<Outer>,

§

fn from_ref(outer: &Outer) -> &T

Get a reference to the inner from the outer.

§

fn from_mut(outer: &mut Outer) -> &mut T

Get a mutable reference to the inner from the outer.

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> SaturatedConversion for T

source§

fn saturated_from<T>(t: T) -> Selfwhere Self: UniqueSaturatedFrom<T>,

Convert from a value of T into an equivalent instance of Self. Read more
source§

fn saturated_into<T>(self) -> Twhere Self: UniqueSaturatedInto<T>,

Consume self to return an equivalent value of T. Read more
source§

impl<T> SaturatedConversion for T

source§

fn saturated_from<T>(t: T) -> Selfwhere Self: UniqueSaturatedFrom<T>,

Convert from a value of T into an equivalent instance of Self. Read more
source§

fn saturated_into<T>(self) -> Twhere Self: UniqueSaturatedInto<T>,

Consume self to return an equivalent value of T. Read more
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<S, T> UncheckedInto<T> for Swhere T: UncheckedFrom<S>,

§

fn unchecked_into(self) -> T

The counterpart to unchecked_from.
source§

impl<T, S> UniqueSaturatedInto<T> for Swhere T: Bounded, S: TryInto<T>,

source§

fn unique_saturated_into(self) -> T

Consume self to return an equivalent value of T.
source§

impl<T, S> UniqueSaturatedInto<T> for Swhere T: Bounded, S: TryInto<T>,

source§

fn unique_saturated_into(self) -> T

Consume self to return an equivalent value of T.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
§

impl<T> MaybeSend for Twhere T: Send,