Skip to content

Commit

Permalink
add question queries
Browse files Browse the repository at this point in the history
  • Loading branch information
NicoAcosta committed Oct 18, 2024
1 parent a440c2a commit 80b69d0
Show file tree
Hide file tree
Showing 2 changed files with 122 additions and 0 deletions.
61 changes: 61 additions & 0 deletions ts-interfaces/examples/fixed-question-query.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import { QuestionView, QuestionType } from "../types/questions"
import { AccountAddress, Timestamp } from "../types/basic"

const exampleFixedQuestionQuery: QuestionView = {
data: {
contractAddress: "0x1111aaaabbbbccccddddeeeeffffgggg2222hhhh" as AccountAddress,
questionType: QuestionType.Fixed,
title: "Should we implement EIP-1559?",
description: "Vote on whether to implement Ethereum Improvement Proposal 1559",
creator: "0x3333444455556666777788889999aaaabbbbcccc" as AccountAddress,
kickoff: 1625270400000 as Timestamp,
deadline: 1625875200000 as Timestamp,
isActive: true,
voteCount: 1500
},
user: {
canVote: true,
pointsAtDeadline: 950
},
options: [
{
data: {
title: "Yes, implement EIP-1559",
description: "Support the implementation of EIP-1559 to improve gas fee predictability",
proposer: "0x7777888899990000aaaabbbbccccddddeeeefffff" as AccountAddress,
voteCount: 850,
pointsAtDeadline: 72000
},
user: {
voted: false
}
},
{
data: {
title: "No, don't implement EIP-1559",
description: "Oppose the implementation of EIP-1559 due to concerns about miner revenue",
proposer: "0xbbbbccccddddeeeefffff00001111222233334444" as AccountAddress,
voteCount: 600,
pointsAtDeadline: 53000
},
user: {
voted: false
}
},
{
data: {
title: "Delay implementation for further research",
description: "Postpone the decision on EIP-1559 to allow for more research and discussion",
proposer: "0xddddeeeefffff000011112222333344445555666" as AccountAddress,
voteCount: 50,
pointsAtDeadline: 4800
},
user: {
voted: false
}
}
]
}


console.log(JSON.stringify(exampleFixedQuestionQuery, null, 2))
61 changes: 61 additions & 0 deletions ts-interfaces/examples/open-question-query.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import { QuestionView, QuestionType } from "../types/questions"
import { AccountAddress, Timestamp } from "../types/basic"

// New Open question example
const exampleOpenQuestionQuery: QuestionView = {
data: {
contractAddress: "0x3333bbbbccccddddeeeeffffgggg4444iiii" as AccountAddress,
questionType: QuestionType.Open,
title: "What should be our next community project?",
description: "Propose and vote on ideas for our next community-driven project",
creator: "0x5555666677778888999900001111aaaabbbbcccc" as AccountAddress,
kickoff: 1630454400000 as Timestamp,
deadline: 1631664000000 as Timestamp,
isActive: true,
voteCount: 750
},
user: {
canVote: true,
pointsAtDeadline: 1200
},
options: [
{
data: {
title: "Develop a decentralized social media platform",
description: "Create a censorship-resistant social network using blockchain technology",
proposer: "0x9999000011112222aaaabbbbccccddddeeeefffff" as AccountAddress,
voteCount: 300,
pointsAtDeadline: 45000
},
user: {
voted: false
}
},
{
data: {
title: "Launch a community-owned NFT marketplace",
description: "Build an NFT marketplace where fees are distributed to community members",
proposer: "0xccccddddeeeefffff22223333444455556666777" as AccountAddress,
voteCount: 250,
pointsAtDeadline: 38000
},
user: {
voted: false
}
},
{
data: {
title: "Create a DAO-governed grant program",
description: "Establish a grant program to fund innovative blockchain projects, governed by our DAO",
proposer: "0xeeeefffff000011112222333344445555666777" as AccountAddress,
voteCount: 200,
pointsAtDeadline: 30000
},
user: {
voted: false
}
}
]
}

console.log(JSON.stringify(exampleOpenQuestionQuery, null, 2))

0 comments on commit 80b69d0

Please sign in to comment.