Skip to content

Commit

Permalink
feat(ui): wip
Browse files Browse the repository at this point in the history
  • Loading branch information
gabaldon committed Aug 17, 2021
1 parent 7a22723 commit 75c5315
Show file tree
Hide file tree
Showing 4 changed files with 154 additions and 18 deletions.
116 changes: 116 additions & 0 deletions packages/api/src/abi/ConfluxEthUsd.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
[
{
"inputs": [
{ "internalType": "address", "name": "_wrb", "type": "address" }
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint64",
"name": "",
"type": "uint64"
}
],
"name": "PriceUpdated",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "string",
"name": "",
"type": "string"
}
],
"name": "ResultError",
"type": "event"
},
{
"inputs": [],
"name": "ETHUSD3ID",
"outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }],
"stateMutability": "view",
"type": "function",
"constant": true
},
{
"inputs": [],
"name": "lastPrice",
"outputs": [{ "internalType": "uint64", "name": "", "type": "uint64" }],
"stateMutability": "view",
"type": "function",
"constant": true
},
{
"inputs": [],
"name": "lastRequestId",
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
"stateMutability": "view",
"type": "function",
"constant": true
},
{
"inputs": [],
"name": "pending",
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
"stateMutability": "view",
"type": "function",
"constant": true
},
{
"inputs": [],
"name": "request",
"outputs": [
{
"internalType": "contract WitnetRequest",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function",
"constant": true
},
{
"inputs": [],
"name": "timestamp",
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
"stateMutability": "view",
"type": "function",
"constant": true
},
{
"inputs": [],
"name": "requestUpdate",
"outputs": [],
"stateMutability": "payable",
"type": "function",
"payable": true
},
{
"inputs": [],
"name": "completeUpdate",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [{ "internalType": "bytes32", "name": "_id", "type": "bytes32" }],
"name": "valueFor",
"outputs": [
{ "internalType": "int256", "name": "", "type": "int256" },
{ "internalType": "uint256", "name": "", "type": "uint256" },
{ "internalType": "uint256", "name": "", "type": "uint256" }
],
"stateMutability": "view",
"type": "function",
"constant": true
}
]
48 changes: 36 additions & 12 deletions packages/api/src/dataFeeds.json
Original file line number Diff line number Diff line change
@@ -1,74 +1,98 @@
[
{
"abi": "./abi/BtcUsd.json",
"abi": "./src/abi/BtcUsd.json",
"address": "0xF2712e7114A237625EFC8bBA6a6ed1Bb8b6029c9",
"network": "mainnet",
"name": "btc/usd",
"label": "$",
"pollingPeriod": 3600000,
"witnetRequestBoard": {
"address": "0x400DbF3645b345823124aaB22D04013A46D9ceD5",
"abi": "./abi/WitnetRequestBoardProxy.json"
"abi": "./src/abi/WitnetRequestBoardProxy.json"
}
},
{
"abi": "./abi/EthUsd.json",
"abi": "./src/abi/EthUsd.json",
"address": "0x1ebD93231a7fE551E1d6405404Df34909eff4c2C",
"network": "mainnet",
"name": "eth/usd",
"label": "$",
"pollingPeriod": 3600000,
"witnetRequestBoard": {
"address": "0x400DbF3645b345823124aaB22D04013A46D9ceD5",
"abi": "./abi/WitnetRequestBoardProxy.json"
"abi": "./src/abi/WitnetRequestBoardProxy.json"
}
},
{
"abi": "./abi/BtcUsd.json",
"abi": "./src/abi/BtcUsd.json",
"address": "0x58995FaD03158fB9cd64397347bA97714EF8fC12",
"witnetRequestBoard": {
"address": "0x9b42b0D80C428B17A5828dF5C2c96454ca54bD04",
"abi": "./abi/WitnetRequestBoardProxy.json"
"abi": "./src/abi/WitnetRequestBoardProxy.json"
},
"network": "rinkeby",
"name": "btc/usd",
"label": "$",
"pollingPeriod": 900000
},
{
"abi": "./abi/EthUsd.json",
"abi": "./src/abi/EthUsd.json",
"address": "0xAe9821fbA4Bd76fd6D39859bd7c3d4A90b2ceE40",
"witnetRequestBoard": {
"address": "0x9b42b0D80C428B17A5828dF5C2c96454ca54bD04",
"abi": "./abi/WitnetRequestBoardProxy.json"
"abi": "./src/abi/WitnetRequestBoardProxy.json"
},
"network": "rinkeby",
"name": "eth/usd",
"label": "$",
"pollingPeriod": 900000
},
{
"abi": "./abi/BtcUsd.json",
"abi": "./src/abi/BtcUsd.json",
"address": "0x4958806608D2E3Aa22BD8818B555A0a24fe6c38E",
"network": "goerli",
"name": "btc/usd",
"label": "$",
"pollingPeriod": 900000,
"witnetRequestBoard": {
"address": "0x0C4be6AA667df48de54BA174bE7948875fdf152B",
"abi": "./abi/WitnetRequestBoardProxy.json"
"abi": "./src/abi/WitnetRequestBoardProxy.json"
}
},
{
"abi": "./abi/EthUsd.json",
"abi": "./src/abi/EthUsd.json",
"address": "0xAa0AA725aEb1d382F909a8dE3041e9eaD6507501",
"network": "goerli",
"name": "eth/usd",
"label": "$",
"pollingPeriod": 900000,
"witnetRequestBoard": {
"address": "0x0C4be6AA667df48de54BA174bE7948875fdf152B",
"abi": "./abi/WitnetRequestBoardProxy.json"
"abi": "./src/abi/WitnetRequestBoardProxy.json"
}
},
{
"abi": "./src/abi/ConfluxBtcUsd.json",
"address": "0x8934bfeFb0d5d7d4f1fbEf558562f6487787b6cC",
"witnetRequestBoard": {
"address": "0x84f3342E460265D1A271Fc1Bd678A361a9208e72",
"abi": "./src/abi/ConfluxWitnetRequestBoardProxy.json"
},
"network": "conflux",
"name": "btc/usd",
"label": "$",
"pollingPeriod": 900000
},
{
"abi": "./src/abi/ConfluxEthUsd.json",
"address": "0x8E5C614bA4DA97E823D4C3f0DCB02c872C84E6C3",
"witnetRequestBoard": {
"address": "0x84f3342E460265D1A271Fc1Bd678A361a9208e72",
"abi": "./src/abi/ConfluxWitnetRequestBoardProxy.json"
},
"network": "conflux",
"name": "eth/usd",
"label": "$",
"pollingPeriod": 900000
}
]
2 changes: 1 addition & 1 deletion packages/api/src/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export class MongoManager {
async start (uri?: string): Promise<Db | null> {
const mongoDbUri =
uri ||
`mongodb://${process.env.MONGO_DATABASE_USERNAME}:${process.env.MONGO_DATABASE_PASSWORD}@${process.env.DB_HOSTNAME}:${process.env.MONGO_PORT}/database`
process.env.MONGO_URI
return this.connect(mongoDbUri, process.env.MONGO_INITDB_DATABASE as string)
}

Expand Down
6 changes: 1 addition & 5 deletions packages/api/src/web3Middleware/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,7 @@ export class Web3Middleware {
return feed
})

try {
return await Promise.all(promises)
} catch (err) {
console.error('[ERROR]', err.message)
}
return await Promise.all(promises)
}

async listen () {
Expand Down

0 comments on commit 75c5315

Please sign in to comment.