[][src]Trait node_rpc_runtime_api::asset::AssetApi

pub trait AssetApi<Block: BlockT, AccountId>: Core<Block> where
    AccountId: Codec, 
{ fn can_transfer(
        &self,
        __runtime_api_at_param__: &BlockId<Block>,
        sender: AccountId,
        from_custodian: Option<IdentityId>,
        from_portfolio: PortfolioId,
        to_custodian: Option<IdentityId>,
        to_portfolio: PortfolioId,
        ticker: &Ticker,
        value: Balance
    ) -> Result<CanTransferResult, Self::Error> { ... }
fn can_transfer_with_context(
        &self,
        __runtime_api_at_param__: &BlockId<Block>,
        context: ExecutionContext,
        sender: AccountId,
        from_custodian: Option<IdentityId>,
        from_portfolio: PortfolioId,
        to_custodian: Option<IdentityId>,
        to_portfolio: PortfolioId,
        ticker: &Ticker,
        value: Balance
    ) -> Result<CanTransferResult, Self::Error> { ... }
fn can_transfer_granular(
        &self,
        __runtime_api_at_param__: &BlockId<Block>,
        from_custodian: Option<IdentityId>,
        from_portfolio: PortfolioId,
        to_custodian: Option<IdentityId>,
        to_portfolio: PortfolioId,
        ticker: &Ticker,
        value: Balance
    ) -> Result<GranularCanTransferResult, Self::Error> { ... }
fn can_transfer_granular_with_context(
        &self,
        __runtime_api_at_param__: &BlockId<Block>,
        context: ExecutionContext,
        from_custodian: Option<IdentityId>,
        from_portfolio: PortfolioId,
        to_custodian: Option<IdentityId>,
        to_portfolio: PortfolioId,
        ticker: &Ticker,
        value: Balance
    ) -> Result<GranularCanTransferResult, Self::Error> { ... } }

The API to interact with Asset.

Provided methods

fn can_transfer(
    &self,
    __runtime_api_at_param__: &BlockId<Block>,
    sender: AccountId,
    from_custodian: Option<IdentityId>,
    from_portfolio: PortfolioId,
    to_custodian: Option<IdentityId>,
    to_portfolio: PortfolioId,
    ticker: &Ticker,
    value: Balance
) -> Result<CanTransferResult, Self::Error>
[src]

Checks whether a transaction with given parameters can take place or not.

Example

In this example we are checking if Alice can transfer 500 of ticket 0x01 from herself (Id=0x2a) to Bob (Id=0x3905)

TODO: update example

 curl
   -H "Content-Type: application/json"
   -d {
       "id":1, "jsonrpc":"2.0",
       "method": "asset_canTransfer",
       "params":[
           "5CoRaw9Ex4DUjGcnPbPBnc2nez5ZeTmM5WL3ZDVLZzM6eEgE",
           "0x010000000000000000000000",
           "0x2a00000000000000000000000000000000000000000000000000000000000000",
           "0x3905000000000000000000000000000000000000000000000000000000000000",
           500]}
   http://localhost:9933 | python3 -m json.tool

fn can_transfer_with_context(
    &self,
    __runtime_api_at_param__: &BlockId<Block>,
    context: ExecutionContext,
    sender: AccountId,
    from_custodian: Option<IdentityId>,
    from_portfolio: PortfolioId,
    to_custodian: Option<IdentityId>,
    to_portfolio: PortfolioId,
    ticker: &Ticker,
    value: Balance
) -> Result<CanTransferResult, Self::Error>
[src]

Checks whether a transaction with given parameters can take place or not.

Example

In this example we are checking if Alice can transfer 500 of ticket 0x01 from herself (Id=0x2a) to Bob (Id=0x3905)

TODO: update example

 curl
   -H "Content-Type: application/json"
   -d {
       "id":1, "jsonrpc":"2.0",
       "method": "asset_canTransfer",
       "params":[
           "5CoRaw9Ex4DUjGcnPbPBnc2nez5ZeTmM5WL3ZDVLZzM6eEgE",
           "0x010000000000000000000000",
           "0x2a00000000000000000000000000000000000000000000000000000000000000",
           "0x3905000000000000000000000000000000000000000000000000000000000000",
           500]}
   http://localhost:9933 | python3 -m json.tool

fn can_transfer_granular(
    &self,
    __runtime_api_at_param__: &BlockId<Block>,
    from_custodian: Option<IdentityId>,
    from_portfolio: PortfolioId,
    to_custodian: Option<IdentityId>,
    to_portfolio: PortfolioId,
    ticker: &Ticker,
    value: Balance
) -> Result<GranularCanTransferResult, Self::Error>
[src]

Checks whether a transaction with given parameters can take place or not. The result is "granular" meaning each check is run and returned regardless of outcome.

fn can_transfer_granular_with_context(
    &self,
    __runtime_api_at_param__: &BlockId<Block>,
    context: ExecutionContext,
    from_custodian: Option<IdentityId>,
    from_portfolio: PortfolioId,
    to_custodian: Option<IdentityId>,
    to_portfolio: PortfolioId,
    ticker: &Ticker,
    value: Balance
) -> Result<GranularCanTransferResult, Self::Error>
[src]

Checks whether a transaction with given parameters can take place or not. The result is "granular" meaning each check is run and returned regardless of outcome.

Loading content...

Trait Implementations

impl<Block: BlockT, AccountId, __Sr_Api_Error__> RuntimeApiInfo for dyn AssetApi<Block, AccountId, Error = __Sr_Api_Error__>[src]

Implementors

Loading content...