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>
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>
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 rename_portfolio(
&self,
num: PortfolioNumber,
to_name: PortfolioName
) -> Result<WrappedCall>
pub fn rename_portfolio( &self, num: PortfolioNumber, to_name: PortfolioName ) -> Result<WrappedCall>
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>
pub fn quit_portfolio_custody(&self, pid: PortfolioId) -> Result<WrappedCall>
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>
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 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
sourcepub fn pre_approve_portfolio(
&self,
ticker: Ticker,
portfolio_id: PortfolioId
) -> Result<WrappedCall>
pub fn pre_approve_portfolio( &self, ticker: Ticker, portfolio_id: PortfolioId ) -> Result<WrappedCall>
Pre-approves the receivement of an asset to a portfolio.
Arguments
origin
- the secondary key of the sender.ticker
- the [Ticker
] that will be exempt from affirmation.portfolio_id
- the [PortfolioId
] that can receiveticker
without affirmation.
Permissions
- Portfolio
sourcepub fn remove_portfolio_pre_approval(
&self,
ticker: Ticker,
portfolio_id: PortfolioId
) -> Result<WrappedCall>
pub fn remove_portfolio_pre_approval( &self, ticker: Ticker, portfolio_id: PortfolioId ) -> Result<WrappedCall>
Removes the pre approval of an asset to a portfolio.
Arguments
origin
- the secondary key of the sender.ticker
- the [Ticker
] that will be exempt from affirmation.portfolio_id
- the [PortfolioId
] that can receiveticker
without affirmation.
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>
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> !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
§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> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§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 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
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
.