Near dApp where people can post their ideas.
Public webpage: https://djuanit0x.github.io/nearideas
- The "backend" code lives in the
/contract
folder. This code gets deployed to the NEAR blockchain when you runyarn deploy:contract
. - The frontend code lives in the
/src
folder./src/index.html
is a great place to start exploring. Note that it loads in/src/index.js
.
get_all_ideas(&self) -> &HashMap<u64, Idea>
Returns all ideas as JSON object.
get_deposits_by_idea(&self, idea_id: u64) -> Option<Vec<Deposit>>
Returns all deposits made on an idea by idea_id
.
get_deposits_by_owner(&self, account_id: String) -> Option<Deposit>
Returns all deposits made on all ideas by account_id
.
create_idea(&mut self, title: String, link: String) -> Option<Idea>
Create an idea with title and link to the project that actually do the idea.
upvote_idea(&mut self, idea_id: u64) -> &Idea
Upvote an idea by one. Users need to deposit at least 10 Ⓝ to vote the idea.
deposits_by_ideas
: HashMap<u64, Vec> - All deposits on an idea.
deposits_by_owners
: HashMap<String, Deposit> - All ideas upvoted/deposited by the account id.
ideas
: HashMap<u64, Idea> - All ideas on the blockchain.
owner_account_id
: String - Account id of the depositor.amount
: u128 - Amount of deposit.
idea_id
: u64 - The id of the idea. Starting from 1 and increment by 1 for every new idea.title
: String - The title of your idea.owner_account_id
: String - Account id that creates the idea.link
: String - The link to a project that actually do the idea.vote_count
: u32 - Number of votes on the idea.