pub struct PortfolioCallApi<'api> { /* private fields */ }

Implementations§

source§

impl<'api> PortfolioCallApi<'api>

source

pub fn create_portfolio(&self, name: PortfolioName) -> Result<WrappedCall<'api>>

Creates a portfolio with the given name.

source

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 if num doesn’t reference a valid portfolio.
  • PortfolioNotEmpty if the portfolio still holds any asset
Permissions
  • Portfolio
source

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 same
  • DifferentIdentityPortfolios if the sender and receiver portfolios belong to different identities
  • UnauthorizedCustodian if the caller is not the custodian of the from portfolio
  • InsufficientPortfolioBalance if the sender does not have enough free balance
  • NoDuplicateAssetsAllowed the same ticker can’t be repeated in the items vector.
Permissions
  • Portfolio
source

pub fn rename_portfolio( &self, num: PortfolioNumber, to_name: PortfolioName ) -> Result<WrappedCall<'api>>

Renames a non-default portfolio.

Errors
  • PortfolioDoesNotExist if num doesn’t reference a valid portfolio.
Permissions
  • Portfolio
source

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 of portfolio_id.
Permissions
  • Portfolio
source

pub fn accept_portfolio_custody( &self, auth_id: u64 ) -> Result<WrappedCall<'api>>

source

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 same
  • DifferentIdentityPortfolios if the sender and receiver portfolios belong to different identities
  • UnauthorizedCustodian if the caller is not the custodian of the from portfolio
  • InsufficientPortfolioBalance if the sender does not have enough free balance
  • NoDuplicateAssetsAllowed 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>

source§

fn clone(&self) -> PortfolioCallApi<'api>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'api> From<&'api Api> for PortfolioCallApi<'api>

source§

fn from(api: &'api Api) -> Self

Converts to this type from the input type.

Auto 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> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CheckedConversion for T

§

fn checked_from<T>(t: T) -> Option<Self>where Self: TryFrom<T>,

Convert from a value of T into an equivalent instance of Option<Self>. Read more
§

fn checked_into<T>(self) -> Option<T>where Self: TryInto<T>,

Consume self to return Some equivalent value of Option<T>. Read more
§

impl<T> Downcast for Twhere T: Any,

§

fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>

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

Convert 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)

Convert &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)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> DowncastSync for Twhere T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T, Global>) -> Arc<dyn Any + Sync + Send, Global>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
source§

impl<T> DynClone for Twhere T: Clone,

source§

fn __clone_box(&self, _: Private) -> *mut ()

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T, Outer> IsWrappedBy<Outer> for Twhere Outer: AsRef<T> + AsMut<T> + From<T>, T: From<Outer>,

§

fn from_ref(outer: &Outer) -> &T

Get a reference to the inner from the outer.

§

fn from_mut(outer: &mut Outer) -> &mut T

Get a mutable reference to the inner from the outer.

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> SaturatedConversion for T

source§

fn saturated_from<T>(t: T) -> Selfwhere Self: UniqueSaturatedFrom<T>,

Convert from a value of T into an equivalent instance of Self. Read more
source§

fn saturated_into<T>(self) -> Twhere Self: UniqueSaturatedInto<T>,

Consume self to return an equivalent value of T. Read more
source§

impl<T> SaturatedConversion for T

source§

fn saturated_from<T>(t: T) -> Selfwhere Self: UniqueSaturatedFrom<T>,

Convert from a value of T into an equivalent instance of Self. Read more
source§

fn saturated_into<T>(self) -> Twhere Self: UniqueSaturatedInto<T>,

Consume self to return an equivalent value of T. Read more
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<S, T> UncheckedInto<T> for Swhere T: UncheckedFrom<S>,

§

fn unchecked_into(self) -> T

The counterpart to unchecked_from.
source§

impl<T, S> UniqueSaturatedInto<T> for Swhere T: Bounded, S: TryInto<T>,

source§

fn unique_saturated_into(self) -> T

Consume self to return an equivalent value of T.
source§

impl<T, S> UniqueSaturatedInto<T> for Swhere T: Bounded, S: TryInto<T>,

source§

fn unique_saturated_into(self) -> T

Consume self to return an equivalent value of T.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
§

impl<T> MaybeSend for Twhere T: Send,