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