pub struct PortfolioQueryApi<'api> { /* private fields */ }
Implementations§
Source§impl<'api> PortfolioQueryApi<'api>
impl<'api> PortfolioQueryApi<'api>
Sourcepub async fn next_portfolio_number(
&self,
key_0: IdentityId,
) -> Result<PortfolioNumber>
pub async fn next_portfolio_number( &self, key_0: IdentityId, ) -> Result<PortfolioNumber>
The next portfolio sequence number of an identity.
Sourcepub async fn portfolios(
&self,
key_0: IdentityId,
key_1: PortfolioNumber,
) -> Result<Option<PortfolioName>>
pub async fn portfolios( &self, key_0: IdentityId, key_1: PortfolioNumber, ) -> Result<Option<PortfolioName>>
The set of existing portfolios with their names. If a certain pair of a DID and
portfolio number maps to None
then such a portfolio doesn’t exist. Conversely, if a
pair maps to Some(name)
then such a portfolio exists and is called name
.
Sourcepub async fn name_to_number(
&self,
key_0: IdentityId,
key_1: PortfolioName,
) -> Result<Option<PortfolioNumber>>
pub async fn name_to_number( &self, key_0: IdentityId, key_1: PortfolioName, ) -> Result<Option<PortfolioNumber>>
Inverse map of Portfolios
used to ensure bijectivitiy,
and uniqueness of names in Portfolios
.
Sourcepub async fn portfolio_asset_count(&self, key_0: PortfolioId) -> Result<u64>
pub async fn portfolio_asset_count(&self, key_0: PortfolioId) -> Result<u64>
How many assets with non-zero balance this portfolio contains.
Sourcepub async fn portfolio_asset_balances(
&self,
key_0: PortfolioId,
key_1: AssetId,
) -> Result<u128>
pub async fn portfolio_asset_balances( &self, key_0: PortfolioId, key_1: AssetId, ) -> Result<u128>
The asset balances of portfolios.
Sourcepub async fn portfolio_locked_assets(
&self,
key_0: PortfolioId,
key_1: AssetId,
) -> Result<u128>
pub async fn portfolio_locked_assets( &self, key_0: PortfolioId, key_1: AssetId, ) -> Result<u128>
Amount of assets locked in a portfolio. These assets show up in portfolio balance but can not be transferred away.
Sourcepub async fn portfolio_custodian(
&self,
key_0: PortfolioId,
) -> Result<Option<IdentityId>>
pub async fn portfolio_custodian( &self, key_0: PortfolioId, ) -> Result<Option<IdentityId>>
The custodian of a particular portfolio. None implies that the identity owner is the custodian.
Sourcepub async fn portfolios_in_custody(
&self,
key_0: IdentityId,
key_1: PortfolioId,
) -> Result<bool>
pub async fn portfolios_in_custody( &self, key_0: IdentityId, key_1: PortfolioId, ) -> Result<bool>
Tracks all the portfolios in custody of a particular identity. Only used by the UIs.
When true
is stored as the value for a given (did, pid)
, it means that pid
is in custody of did
.
false
values are never explicitly stored in the map, and are instead inferred by the absence of a key.
Sourcepub async fn portfolio_nft(
&self,
key_0: PortfolioId,
key_1: (AssetId, NFTId),
) -> Result<bool>
pub async fn portfolio_nft( &self, key_0: PortfolioId, key_1: (AssetId, NFTId), ) -> Result<bool>
The nft associated to the portfolio.
Sourcepub async fn portfolio_locked_nft(
&self,
key_0: PortfolioId,
key_1: (AssetId, NFTId),
) -> Result<bool>
pub async fn portfolio_locked_nft( &self, key_0: PortfolioId, key_1: (AssetId, NFTId), ) -> Result<bool>
All locked nft for a given portfolio.
Sourcepub async fn pre_approved_portfolios(
&self,
key_0: PortfolioId,
key_1: AssetId,
) -> Result<bool>
pub async fn pre_approved_portfolios( &self, key_0: PortfolioId, key_1: AssetId, ) -> Result<bool>
All portfolios that don’t need to affirm the receivement of a given [AssetId
].
Sourcepub async fn allowed_custodians(
&self,
key_0: IdentityId,
key_1: IdentityId,
) -> Result<bool>
pub async fn allowed_custodians( &self, key_0: IdentityId, key_1: IdentityId, ) -> Result<bool>
Custodians allowed to create and take custody of portfolios on an id’s behalf.
Sourcepub async fn storage_version(&self) -> Result<Version>
pub async fn storage_version(&self) -> Result<Version>
Storage version.
Trait Implementations§
Source§impl<'api> Clone for PortfolioQueryApi<'api>
impl<'api> Clone for PortfolioQueryApi<'api>
Source§fn clone(&self) -> PortfolioQueryApi<'api>
fn clone(&self) -> PortfolioQueryApi<'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 PortfolioQueryApi<'api>
impl<'api> !RefUnwindSafe for PortfolioQueryApi<'api>
impl<'api> Send for PortfolioQueryApi<'api>
impl<'api> Sync for PortfolioQueryApi<'api>
impl<'api> Unpin for PortfolioQueryApi<'api>
impl<'api> !UnwindSafe for PortfolioQueryApi<'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
.