hapi-near-connector

Crates.iohapi-near-connector
lib.rshapi-near-connector
version0.3.0
sourcesrc
created_at2022-10-13 13:22:38.423862
updated_at2023-03-09 11:00:38.241457
descriptionRust library for using HAPI protocol in cmart contracts on NEAR.
homepagehttps://hapi.one
repositoryhttps://github.com/HAPIprotocol/hapi-near-connector
max_upload_size
id687171
size11,840
Radiophysicist (Sergei2404)

documentation

https://hapi-one.gitbook.io/

README

Hapi

This is a crate that helps implement the use of the HAPI protocol in your smart contract on Near blockchain.

The crate has an AML structure that stores:

  • account_id: AccountId - the address of the aml contract;
  • pub aml_conditions: UnorderedMap<Category, RiskScore> - a map of categories and corresponding risk levels that you will add.

Note

If the risk level was not set for some categories, then the risk level for the category All is used, which is set during initialization.

Methods


  • get_aml - Returns the aml accountId and vector of added categories with accepted risk levels.

  • update_account_id - Updates account id of aml service.

  • update_category - Updates or add a category with accepted risk score to aml conditions.

  • remove_category - Removes category from aml conditions.

  • assert_risk - Checks the category according to the set level of risk. If the risk level is not set for this category, it checks the All category.

  • get_aml_conditions - Returns reference to UnorderedMap of added categories with accepted risk levels.

  • check_risk - Returns true if the address is risky or false if not.

Commit count: 15

cargo fmt