This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"address": "0x9687eb285292cba14a60a0c77dfd36dd95b93889", | |
"support": "In Favor", | |
"votes": "8500000.00" | |
} | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const governanceAbi = window.governanceAbi; | |
const gov = new web3.eth.Contract(governanceAbi, governanceAddress); | |
(async () => { | |
// Tell the user that we're waiting on a request to return data | |
ballotListContainer.innerHTML = '<p style="text-align:center;">Fetching ballots...</p>'; | |
const voteCastEvents = await gov.getPastEvents('VoteCast', { | |
fromBlock: 0, | |
toBlock: 'latest' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"against_votes": "601000.00", | |
"description": "10 BTC is actually a decent amount. Boop!", | |
"for_votes": "835000.00", | |
"id": 18, | |
"title": "Reduce WBTC reserves by 10!", | |
"state": "succeeded" | |
} | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let requestParameters = { | |
"network": "ropsten", // mainnet, ropsten | |
"page_size": 100, // integer, defaults to 10 | |
// "proposal_ids": 1, // an integer ID or array of IDs | |
// "state": "active", // "pending", "active", "canceled", "defeated", "succeeded", "queued", "expired", "executed" | |
// "with_detail": true, // boolean | |
// "page_number": 1, // see subsequent response's `pagination_summary` to specify the next page | |
}; | |
requestParameters = '?' + new URLSearchParams(requestParameters).toString(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"delegate": "0xb61c5971d9c0472befceffbe662555b78284c307", | |
"vote_weight": "2.000000%" | |
} | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Ropsten COMP Contract | |
const compAddress = '0xf76d4a441e4ba86a923ce32b89aff89dbccaa075'; | |
const compAbi = window.compAbi; | |
const comp = new web3.eth.Contract(compAbi, compAddress); | |
(async () => { | |
// Tell the user that we're waiting on a request to return data | |
delegateListContainer.innerHTML = '<p style="text-align:center;">Fetching delegates...</p>'; | |
const delegations = await comp.getPastEvents('DelegateVotesChanged', { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Ropsten COMP Contract | |
const compAddress = '0x1fe16de955718cfab7a44605458ab023838c2793'; | |
const compAbi = window.compAbi; | |
const comp = new web3.eth.Contract(compAbi, compAddress); | |
(async () => { | |
const transfers = await comp.getPastEvents('Transfer', { | |
fromBlock: 0, | |
toBlock: 'latest' | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"address": "0xb61c5971d9c0472befceffbe662555b78284c307", | |
"balance": "200000.0000", | |
"delegate": "0xb61c5971d9c0472befceffbe662555b78284c307", | |
} | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let requestParameters = { | |
"page_size": 100, // number of results in a page | |
"network": "ropsten", // mainnet, ropsten | |
"order_by": "balance", // "votes", "balance", "proposals_created" | |
// "page_number": 1, // see subsequent response's `pagination_summary` to specify the next page | |
// addresses: ['0x123'], // array of addresses to filter on | |
// with_history: true, // boolean, returns a list of transaction history for the accounts | |
}; | |
requestParameters = '?' + new URLSearchParams(requestParameters).toString(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl localhost:3000/wallet-balance/eth/ | |
> 100 | |
curl localhost:3000/wallet-balance/ceth/ | |
> 0 | |
curl localhost:3000/supply/eth/5 | |
> OK | |
curl localhost:3000/protocol-balance/eth/ |