Crate nnsdao_sdk_basic

Source
Expand description

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. Example of implementing DaoCustomFn Trait

#[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);

Structs§

ChangeProposalStateArg
Change proposal status parameters
DaoBasic
Basic DAO structure
Proposal
Proposal unit structure
ProposalArg
Create parameters for the proposal
VotesArg
Voting parameters

Enums§

ProposalState
The state of a Proposal
Votes
Votes with weights

Traits§

DaoCustomFn
You need to use the basic methods implemented by the party

Type Aliases§

Equities
Voting weight