[][src]Trait node_rpc_runtime_api::compliance_manager::ComplianceManagerApi

pub trait ComplianceManagerApi<Block: BlockT, AccountId, Balance>: Core<Block> where
    AccountId: Codec,
    Balance: Codec, 
{ fn can_transfer(
        &self,
        __runtime_api_at_param__: &BlockId<Block>,
        ticker: Ticker,
        from_did: Option<IdentityId>,
        to_did: Option<IdentityId>
    ) -> Result<AssetComplianceResult, Self::Error> { ... }
fn can_transfer_with_context(
        &self,
        __runtime_api_at_param__: &BlockId<Block>,
        context: ExecutionContext,
        ticker: Ticker,
        from_did: Option<IdentityId>,
        to_did: Option<IdentityId>
    ) -> Result<AssetComplianceResult, Self::Error> { ... } }

The API to interact with Compliance manager.

Provided methods

fn can_transfer(
    &self,
    __runtime_api_at_param__: &BlockId<Block>,
    ticker: Ticker,
    from_did: Option<IdentityId>,
    to_did: Option<IdentityId>
) -> Result<AssetComplianceResult, 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)

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

fn can_transfer_with_context(
    &self,
    __runtime_api_at_param__: &BlockId<Block>,
    context: ExecutionContext,
    ticker: Ticker,
    from_did: Option<IdentityId>,
    to_did: Option<IdentityId>
) -> Result<AssetComplianceResult, 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)

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

Trait Implementations

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

Implementors

Loading content...