Skip to main content

ConfidentialAssetsCallApi

Struct ConfidentialAssetsCallApi 

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

Implementations§

Source§

impl<'api> ConfidentialAssetsCallApi<'api>

Source

pub fn register_accounts( &self, proof: AccountRegistrationProof, ) -> Result<WrappedCall>

Register a dart account.

§Arguments
  • account the dart account to register.
  • encryption_key the encryption key for the dart account.
§Errors
  • BadOrigin if origin isn’t signed.
  • AccountAlreadyCreated if the dart account or encryption key is already registered.
Source

pub fn register_encryption_keys( &self, proof: EncryptionKeyRegistrationProof, ) -> Result<WrappedCall>

Register encryption keys for auditors/mediators.

§Arguments
  • origin - The origin of the call.
  • proof - The auditor/mediator encryption registration proof.
§Errors
  • BadOrigin if origin isn’t signed.
  • EncryptionKeyAlreadyRegistered if the encryption key is already registered.
  • InvalidProof if the proof is invalid.
Source

pub fn create_asset( &self, name: Name, symbol: Symbol, decimals: u8, mediators: BTreeMap<AccountPublicKey, EncryptionPublicKey>, auditors: BTreeSet<EncryptionPublicKey>, data: Vec<u8>, ) -> Result<WrappedCall>

Create a new Confidential Asset.

§Arguments
  • auditor_or_mediator - The auditor or mediator public key.
§Errors
  • BadOrigin if origin isn’t signed.
  • AccountMissing if the auditor or mediator is not registered.
  • EncryptionKeyMissing if the encryption key of the auditor or mediator is not registered.
Source

pub fn register_account_assets( &self, proof: BatchedAccountAssetRegistrationProof, ) -> Result<WrappedCall>

Batch register multiple accounts and assets.

This is used to initialize the first account state commitment of the Confidential asset for the Confidential account.

§Arguments
  • origin - The origin of the call. They must be the owner of the Confidential account.
  • proof - The Batched Account asset registration proof.
§Errors
  • BadOrigin if origin isn’t signed.
  • AccountMissing if the Confidential account is not registered.
  • AssetMissing if the Confidential asset is not registered.
  • AccountAssetAlreadyRegistered if the Confidential account has already registered the Confidential asset.
  • NotAccountOwner if the caller is not the owner of the Confidential account.
  • InvalidProof if the proof is invalid.
Source

pub fn mint_asset(&self, proof: AssetMintingProof) -> Result<WrappedCall>

Mint a Confidential asset.

§Arguments
  • origin - The origin of the call. They must be the owner of the Confidential asset and Confidential account.
  • proof - The minting proof.
§Errors
  • BadOrigin if origin isn’t signed.
  • AccountMissing if the Confidential account is not registered.
  • AssetMissing if the Confidential asset is not registered.
  • NotAccountOwner if the caller is not the owner of the Confidential account.
  • InvalidProof if the proof is invalid.
  • NotAssetOwner if the caller is not the owner of the Confidential asset.
  • MaxTotalSupplyExceeded if the total supply of the Confidential asset exceeds the maximum total supply.
  • NullifierAlreadyUsed if the nullifier for the account state commitment has already been used.
Source

pub fn create_settlement(&self, proof: SettlementProof) -> Result<WrappedCall>

Create a new settlement.

§Arguments
  • origin - The origin of the call.
  • proof - The settlement proof.
§Errors
  • BadOrigin if origin isn’t signed.
  • InvalidProof if the proof is invalid.
  • SettlementMissingLegs if the settlement has no legs.
  • SettlementTooManyLegs if the settlement has more legs than the maximum allowed.
Source

pub fn sender_affirmation( &self, proof: SenderAffirmationProof, ) -> Result<WrappedCall>

Sender affirms a settlement leg.

§Arguments
  • origin - The origin of the call.
  • proof - The sender affirmation proof.
§Errors
  • BadOrigin if origin isn’t signed.
  • SettlementNotPending if the settlement is not pending.
  • SettlementNotFound if the settlement is not found.
  • LegNotFound if the leg is not found in the settlement.
  • AlreadyAffirmed if the leg has already been affirmed by the sender.
Source

pub fn receiver_affirmation( &self, proof: ReceiverAffirmationProof, ) -> Result<WrappedCall>

Receiver affirms a settlement leg.

§Arguments
  • origin - The origin of the call.
  • proof - The receiver affirmation proof.
§Errors
  • BadOrigin if origin isn’t signed.
  • SettlementNotPending if the settlement is not pending.
  • SettlementNotFound if the settlement is not found.
  • LegNotFound if the leg is not found in the settlement.
  • AlreadyAffirmed if the leg has already been affirmed by the receiver.
Source

pub fn mediator_affirmation( &self, proof: MediatorAffirmationProof, ) -> Result<WrappedCall>

Mediator affirms a settlement leg.

§Arguments
  • origin - The origin of the call.
  • proof - The mediator affirmation proof.
§Errors
  • BadOrigin if origin isn’t signed.
  • SettlementNotPending if the settlement is not pending.
  • SettlementNotFound if the settlement is not found.
  • LegNotFound if the leg is not found in the settlement.
  • AlreadyAffirmed if the leg has already been affirmed by the mediator.
  • WrongMediatorId if the mediator ID does not match the expected mediator for the leg.
Source

pub fn sender_update_counter( &self, proof: SenderCounterUpdateProof, ) -> Result<WrappedCall>

Sender updates their counter after a settlement has been executed.

§Arguments
  • origin - The origin of the call.
  • proof - The sender update proof.
§Errors
  • BadOrigin if origin isn’t signed.
  • SettlementNotExecuted if the settlement has not been executed.
  • SettlementNotFound if the settlement is not found.
  • LegNotFound if the leg is not found in the settlement.
Source

pub fn sender_revert_affirmation( &self, proof: SenderRevertAffirmationProof, ) -> Result<WrappedCall>

Sender reverts their affirmation.

§Arguments
  • origin - The origin of the call.
  • proof - The sender revert affirmation proof.
§Errors
  • BadOrigin if origin isn’t signed.
  • SettlementAlreadyExecuted if the settlement has already been executed.
  • SettlementNotFound if the settlement is not found.
  • LegNotFound if the leg is not found in the settlement.
Source

pub fn receiver_revert_affirmation( &self, proof: ReceiverRevertAffirmationProof, ) -> Result<WrappedCall>

Receiver reverts their affirmation.

§Arguments
  • origin - The origin of the call.
  • proof - The receiver revert affirmation proof.
§Errors
  • BadOrigin if origin isn’t signed.
  • SettlementAlreadyExecuted if the settlement has already been executed.
  • SettlementNotFound if the settlement is not found.
  • LegNotFound if the leg is not found in the settlement.
Source

pub fn receiver_claim(&self, proof: ReceiverClaimProof) -> Result<WrappedCall>

Receiver claims their assets after a settlement has been executed.

§Arguments
  • origin - The origin of the call.
  • proof - The receiver claim proof.
§Errors
  • BadOrigin if origin isn’t signed.
  • SettlementNotExecuted if the settlement has not been executed.
  • SettlementNotFound if the settlement is not found.
  • LegNotFound if the leg is not found in the settlement.
Source

pub fn batched_settlement( &self, proof: BatchedSettlementProof<AssetTreeConfig, AccountTreeConfig>, ) -> Result<WrappedCall>

Create a settlement with batched leg affirmations.

§Arguments
  • origin - The origin of the call.
  • proof - The settlement proof with batched leg affirmations.
§Errors
  • BadOrigin if origin isn’t signed.
  • InvalidProof if the proof is invalid.
  • SettlementMissingLegs if the settlement has no legs.
  • SettlementTooManyLegs if the settlement has more legs than the maximum allowed.
Source

pub fn register_fee_accounts( &self, proof: BatchedFeeAccountRegistrationProof, ) -> Result<WrappedCall>

Batch register multiple fee accounts.

This is used to register fee accounts for Confidential private fee payments.

§Arguments
  • origin - The origin of the call.
  • proof - The batched fee account registration proof.
§Errors
  • BadOrigin if origin isn’t signed.
  • FeeAccountAlreadyRegistered if the fee account or encryption key is already registered.
  • NullifierAlreadyUsed if the nullifier for the fee account state commitment has already been used.
  • InvalidFeeAssetId if the fee asset ID is invalid.
  • InvalidProof if the proof is invalid.
  • InsufficientBalance if the caller has insufficient balance to pay the deposit.
Source

pub fn topup_fee_accounts( &self, proof: BatchedFeeAccountTopupProof, ) -> Result<WrappedCall>

Toup a batch of fee accounts.

§Arguments
  • origin - The origin of the call.
  • proof - The batched fee account topup proof.
§Errors
  • BadOrigin if origin isn’t signed.
  • FeeAccountMissing if the fee account is not registered.
  • InvalidFeeAssetId if the fee asset ID is invalid.
  • InvalidProof if the proof is invalid.
  • InsufficientBalance if the caller has insufficient balance to pay the deposit.
Source

pub fn submit_batched_proofs(&self, proof: BatchedProofs) -> Result<WrappedCall>

Submit a batch of proofs.

§Arguments
  • origin - The origin of the call.
  • proof - The batched proofs.
§Errors
  • BadOrigin if origin isn’t signed.
  • InvalidProof if any of the proofs are invalid.
Source

pub fn relayer_submit_batched_proofs( &self, proof: FeePaymentWithBatchedProofs, ) -> Result<WrappedCall>

Relayer submit a batch of proofs paid using a private fee payment.

Users can use a Relayer service to submit their Confidential proofs for privacy (i.e., the origin is not the user). The Relayer is paid/reimbursed using a private fee payment from the user’s Confidential fee account.

Relayers can charge a commission fee on top of the transaction fee (i.e. commission fee + transaction fee = fee amount).

Relayers should verify that the fee payment proof is valid before submitting the batched Confidential proofs. They are not required to verify the batched Confidential proofs. If the user’s Confidential proofs are invalid, the user is still responsible for paying the fee to the relayer.

§Arguments
  • origin - The origin of the call. This is the relayer.
  • proof - The fee payment proof and batched Confidential proofs.
§Errors
  • BadOrigin if origin isn’t signed.
  • InvalidFeePaymentProof if the fee payment proof is invalid.
  • InsufficientFeePayment if the fee payment is insufficient to cover the relayer fee.
Source

pub fn execute_instant_settlement( &self, proof: InstantSettlementProof<AssetTreeConfig, AccountTreeConfig>, ) -> Result<WrappedCall>

Create and execute an instant settlement.

§Arguments
  • origin - The origin of the call.
  • proof - The settlement proof with batched leg affirmations.
§Errors
  • BadOrigin if origin isn’t signed.
  • InvalidProof if the proof is invalid.
  • SettlementMissingLegs if the settlement has no legs.
  • SettlementTooManyLegs if the settlement has more legs than the maximum allowed.
Source

pub fn instant_sender_affirmation( &self, proof: InstantSenderAffirmationProof, ) -> Result<WrappedCall>

Sender affirms a settlement leg as the last pending affirmation.

This can only be used when the sender affirmation is the last pending affirmation for the settlement.

§Arguments
  • origin - The origin of the call.
  • proof - The instant sender affirmation proof.
§Errors
  • BadOrigin if origin isn’t signed.
  • SettlementNotPending if the settlement is not pending.
  • SettlementNotFound if the settlement is not found.
  • LegNotFound if the leg is not found in the settlement.
  • AlreadyAffirmed if the leg has already been affirmed by the sender.
  • NotLastPendingAffirmation if the sender affirmation is not the last pending affirmation for the settlement.
Source

pub fn instant_receiver_affirmation( &self, proof: InstantReceiverAffirmationProof, ) -> Result<WrappedCall>

Receiver affirms a settlement leg as the last pending affirmation.

This can only be used when the receiver affirmation is the last pending affirmation for the settlement.

§Arguments
  • origin - The origin of the call.
  • proof - The instant receiver affirmation proof.
§Errors
  • BadOrigin if origin isn’t signed.
  • SettlementNotPending if the settlement is not pending.
  • SettlementNotFound if the settlement is not found.
  • LegNotFound if the leg is not found in the settlement.
  • AlreadyAffirmed if the leg has already been affirmed by the receiver.
  • NotLastPendingAffirmation if the receiver affirmation is not the last pending affirmation for the settlement.

Trait Implementations§

Source§

impl<'api> Clone for ConfidentialAssetsCallApi<'api>

Source§

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

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

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

Source§

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

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CheckedConversion for T

Source§

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
Source§

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

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

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where 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 T
where 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.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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 more
Source§

impl<Src, Dest> IntoTuple<Dest> for Src
where Dest: FromTuple<Src>,

Source§

fn into_tuple(self) -> Dest

Source§

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

Source§

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

Get a reference to the inner from the outer.

Source§

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

Get a mutable reference to the inner from the outer.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> SaturatedConversion for T

Source§

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

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

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

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

impl<T> ToOwned for T
where T: Clone,

Source§

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 T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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.
Source§

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

Source§

fn unchecked_into(self) -> T

The counterpart to unchecked_from.
Source§

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

Source§

fn unique_saturated_into(self) -> T

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

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

Source§

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
Source§

impl<T> JsonSchemaMaybe for T

Source§

impl<T> MaybeSend for T
where T: Send,