Crates.io | nnsdao_sdk_basic |
lib.rs | nnsdao_sdk_basic |
version | 0.1.2 |
source | src |
created_at | 2022-06-19 15:13:13.698839 |
updated_at | 2022-08-15 05:24:20.765055 |
description | Basic functionality to build a DAO. |
homepage | |
repository | https://github.com/NnsDao/nnsdao_sdk |
max_upload_size | |
id | 608980 |
size | 23,040 |
This SDK provides the basic functionality to build a DAO, which can be imported and used.To use it, you need to implement DaoCustomFn Trait and customize the business logic.
Documentation:
Add this to your Cargo.toml
:
[dependencies]
nnsdao_sdk_basic = "0.1.0"
#[derive(Clone, Debug, Default, CandidType, Deserialize)]
struct CustomFn{}
#[async_trait]
impl DaoCustomFn for CustomFn {
async fn is_member(&self, _member: Principal) -> Result<bool, String> {
Ok(true)
}
async fn handle_proposal(&self) -> Result<(), String> {
Ok(())
}
}
let dao_basic = DaoBasic::new(CustomFn::default());
dao_basic.get_proposal(1);
nnsdao_sdk_basic is distributed under the terms of both the MIT license.
See LICENSE.