Struct polymesh_api::polymesh::api::portfolio::PortfolioCallApi
source · 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<'api>>
pub fn create_portfolio(&self, name: PortfolioName) -> Result<WrappedCall<'api>>
Creates a portfolio with the given name
.
sourcepub fn delete_portfolio(
&self,
num: PortfolioNumber
) -> Result<WrappedCall<'api>>
pub fn delete_portfolio( &self, num: PortfolioNumber ) -> Result<WrappedCall<'api>>
Deletes a user portfolio. A portfolio can be deleted only if it has no funds.
Errors
PortfolioDoesNotExist
ifnum
doesn’t reference a valid portfolio.PortfolioNotEmpty
if the portfolio still holds any asset
Permissions
- Portfolio
sourcepub fn move_portfolio_funds(
&self,
from: PortfolioId,
to: PortfolioId,
items: Vec<MovePortfolioItem>
) -> Result<WrappedCall<'api>>
pub fn move_portfolio_funds( &self, from: PortfolioId, to: PortfolioId, items: Vec<MovePortfolioItem> ) -> Result<WrappedCall<'api>>
Moves a token amount 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 ticker can’t be repeated in the items vector.
Permissions
- Portfolio
sourcepub fn rename_portfolio(
&self,
num: PortfolioNumber,
to_name: PortfolioName
) -> Result<WrappedCall<'api>>
pub fn rename_portfolio( &self, num: PortfolioNumber, to_name: PortfolioName ) -> Result<WrappedCall<'api>>
Renames a non-default portfolio.
Errors
PortfolioDoesNotExist
ifnum
doesn’t reference a valid portfolio.
Permissions
- Portfolio
sourcepub fn quit_portfolio_custody(
&self,
pid: PortfolioId
) -> Result<WrappedCall<'api>>
pub fn quit_portfolio_custody( &self, pid: PortfolioId ) -> Result<WrappedCall<'api>>
When called by the custodian of portfolio_id
,
allows returning the custody of the portfolio to the portfolio owner unilaterally.
Errors
UnauthorizedCustodian
if the caller is not the current custodian ofportfolio_id
.
Permissions
- Portfolio
pub fn accept_portfolio_custody( &self, auth_id: u64 ) -> Result<WrappedCall<'api>>
sourcepub fn move_portfolio_funds_v2(
&self,
from: PortfolioId,
to: PortfolioId,
funds: Vec<Fund>
) -> Result<WrappedCall<'api>>
pub fn move_portfolio_funds_v2( &self, from: PortfolioId, to: PortfolioId, funds: Vec<Fund> ) -> Result<WrappedCall<'api>>
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 ticker 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
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>
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 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
§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 moresource§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
.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
.