pub trait MsaRuntimeApi<Block: BlockT, AccountId>: Core<Block>where
AccountId: Codec,{
// Provided methods
fn has_delegation(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
delegator: DelegatorId,
provider: ProviderId,
block_number: BlockNumber,
schema_id: Option<SchemaId>,
) -> Result<bool, ApiError> { ... }
fn get_granted_schemas_by_msa_id(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
delegator: DelegatorId,
provider: ProviderId,
) -> Result<Option<Vec<SchemaGrant<SchemaId, BlockNumber>>>, ApiError> { ... }
fn get_all_granted_delegations_by_msa_id(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
delegator: DelegatorId,
) -> Result<Vec<DelegationResponse<SchemaId, BlockNumber>>, ApiError> { ... }
fn get_ethereum_address_for_msa_id(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
msa_id: MessageSourceId,
) -> Result<AccountId20Response, ApiError> { ... }
fn validate_eth_address_for_msa(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
eth_address: &H160,
msa_id: MessageSourceId,
) -> Result<bool, ApiError> { ... }
}
Expand description
Runtime Version for MSAs
- MUST be incremented if anything changes
- See: https://paritytech.github.io/polkadot/doc/polkadot_primitives/runtime_api/index.html Runtime API definition for MSA
Provided Methods§
Sourcefn has_delegation(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
delegator: DelegatorId,
provider: ProviderId,
block_number: BlockNumber,
schema_id: Option<SchemaId>,
) -> Result<bool, ApiError>
fn has_delegation( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, delegator: DelegatorId, provider: ProviderId, block_number: BlockNumber, schema_id: Option<SchemaId>, ) -> Result<bool, ApiError>
Check to see if a delegation existed between the given delegator and provider at a given block
Sourcefn get_granted_schemas_by_msa_id(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
delegator: DelegatorId,
provider: ProviderId,
) -> Result<Option<Vec<SchemaGrant<SchemaId, BlockNumber>>>, ApiError>
fn get_granted_schemas_by_msa_id( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, delegator: DelegatorId, provider: ProviderId, ) -> Result<Option<Vec<SchemaGrant<SchemaId, BlockNumber>>>, ApiError>
Get the list of schema permission grants (if any) that exist in any delegation between the delegator and provider The returned list contains both schema id and the block number at which permission was revoked (0 if currently not revoked)
Sourcefn get_all_granted_delegations_by_msa_id(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
delegator: DelegatorId,
) -> Result<Vec<DelegationResponse<SchemaId, BlockNumber>>, ApiError>
fn get_all_granted_delegations_by_msa_id( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, delegator: DelegatorId, ) -> Result<Vec<DelegationResponse<SchemaId, BlockNumber>>, ApiError>
Get the list of all delegated providers with schema permission grants (if any) that exist in any delegation between the delegator and provider The returned list contains both schema id and the block number at which permission was revoked (0 if currently not revoked)
Sourcefn get_ethereum_address_for_msa_id(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
msa_id: MessageSourceId,
) -> Result<AccountId20Response, ApiError>
fn get_ethereum_address_for_msa_id( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, msa_id: MessageSourceId, ) -> Result<AccountId20Response, ApiError>
Get the Ethereum address of the given MSA. The address is returned as both a 20-byte binary address and a hex-encoded checksummed string (ERC-55).
Sourcefn validate_eth_address_for_msa(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
eth_address: &H160,
msa_id: MessageSourceId,
) -> Result<bool, ApiError>
fn validate_eth_address_for_msa( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, eth_address: &H160, msa_id: MessageSourceId, ) -> Result<bool, ApiError>
Validate if the given Ethereum address is associated with the given MSA