pub struct PortfolioCallApi<'api> { /* private fields */ }
Implementations§
Source§impl<'api> PortfolioCallApi<'api>
impl<'api> PortfolioCallApi<'api>
Sourcepub fn create_portfolio(&self, name: PortfolioName) -> Result<WrappedCall>
pub fn create_portfolio(&self, name: PortfolioName) -> Result<WrappedCall>
Creates a portfolio with the given name
.
Sourcepub fn delete_portfolio(&self, num: PortfolioNumber) -> Result<WrappedCall>
pub fn delete_portfolio(&self, num: PortfolioNumber) -> Result<WrappedCall>
Sourcepub fn rename_portfolio(
&self,
num: PortfolioNumber,
to_name: PortfolioName,
) -> Result<WrappedCall>
pub fn rename_portfolio( &self, num: PortfolioNumber, to_name: PortfolioName, ) -> Result<WrappedCall>
Sourcepub fn quit_portfolio_custody(&self, pid: PortfolioId) -> Result<WrappedCall>
pub fn quit_portfolio_custody(&self, pid: PortfolioId) -> Result<WrappedCall>
pub fn accept_portfolio_custody(&self, auth_id: u64) -> Result<WrappedCall>
Sourcepub fn move_portfolio_funds(
&self,
from: PortfolioId,
to: PortfolioId,
funds: Vec<Fund>,
) -> Result<WrappedCall>
pub fn move_portfolio_funds( &self, from: PortfolioId, to: PortfolioId, funds: Vec<Fund>, ) -> Result<WrappedCall>
Moves fungigle an non-fungible tokens from one portfolio of an identity to another portfolio of the same identity. Must be called by the custodian of the sender. Funds from deleted portfolios can also be recovered via this method.
A short memo can be added to to each token amount moved.
§Errors
PortfolioDoesNotExist
if one or both of the portfolios reference an invalid portfolio.destination_is_same_portfolio
if both sender and receiver portfolio are the sameDifferentIdentityPortfolios
if the sender and receiver portfolios belong to different identitiesUnauthorizedCustodian
if the caller is not the custodian of the from portfolioInsufficientPortfolioBalance
if the sender does not have enough free balanceNoDuplicateAssetsAllowed
the same asset can’t be repeated in the items vector.InvalidTransferNFTNotOwned
if the caller is trying to move an NFT he doesn’t own.InvalidTransferNFTIsLocked
if the caller is trying to move a locked NFT.
§Permissions
- Portfolio
Sourcepub fn pre_approve_portfolio(
&self,
asset_id: AssetId,
portfolio_id: PortfolioId,
) -> Result<WrappedCall>
pub fn pre_approve_portfolio( &self, asset_id: AssetId, portfolio_id: PortfolioId, ) -> Result<WrappedCall>
Sourcepub fn remove_portfolio_pre_approval(
&self,
asset_id: AssetId,
portfolio_id: PortfolioId,
) -> Result<WrappedCall>
pub fn remove_portfolio_pre_approval( &self, asset_id: AssetId, portfolio_id: PortfolioId, ) -> Result<WrappedCall>
Sourcepub fn allow_identity_to_create_portfolios(
&self,
trusted_identity: IdentityId,
) -> Result<WrappedCall>
pub fn allow_identity_to_create_portfolios( &self, trusted_identity: IdentityId, ) -> Result<WrappedCall>
Adds an identity that will be allowed to create and take custody of a portfolio under the caller’s identity.
§Arguments
trusted_identity
- the [IdentityId
] that will be allowed to callcreate_custody_portfolio
.
Sourcepub fn revoke_create_portfolios_permission(
&self,
identity: IdentityId,
) -> Result<WrappedCall>
pub fn revoke_create_portfolios_permission( &self, identity: IdentityId, ) -> Result<WrappedCall>
Removes permission of an identity to create and take custody of a portfolio under the caller’s identity.
§Arguments
identity
- the [IdentityId
] that will have the permissions to callcreate_custody_portfolio
revoked.
Sourcepub fn create_custody_portfolio(
&self,
portfolio_owner_id: IdentityId,
portfolio_name: PortfolioName,
) -> Result<WrappedCall>
pub fn create_custody_portfolio( &self, portfolio_owner_id: IdentityId, portfolio_name: PortfolioName, ) -> Result<WrappedCall>
Creates a portfolio under the portfolio_owner_id
identity and transfers its custody to the caller’s identity.
§Arguments
portfolio_owner_id
- the [IdentityId
] that will own the new portfolio.portfolio_name
- the [PortfolioName
] of the new portfolio.
Trait Implementations§
Source§impl<'api> Clone for PortfolioCallApi<'api>
impl<'api> Clone for PortfolioCallApi<'api>
Source§fn clone(&self) -> PortfolioCallApi<'api>
fn clone(&self) -> PortfolioCallApi<'api>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl<'api> Freeze for PortfolioCallApi<'api>
impl<'api> !RefUnwindSafe for PortfolioCallApi<'api>
impl<'api> Send for PortfolioCallApi<'api>
impl<'api> Sync for PortfolioCallApi<'api>
impl<'api> Unpin for PortfolioCallApi<'api>
impl<'api> !UnwindSafe for PortfolioCallApi<'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
Mutably borrows from an owned value. Read more
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>
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 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>
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 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>,
Consume self to return an equivalent value of
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
The counterpart to
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
Consume self to return an equivalent value of
T
.