1
0
mirror of https://github.com/oceanprotocol/commons.git synced 2023-03-15 18:03:00 +01:00

Merge branch 'master' into feature/analytics

This commit is contained in:
Jernej Pregelj 2019-04-08 11:44:02 +02:00 committed by GitHub
commit 7e26d30fb2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
23 changed files with 1027 additions and 785 deletions

293
client/package-lock.json generated
View File

@ -1026,14 +1026,14 @@
"integrity": "sha512-p2n505t2K0zD1ZvGPhI6EsSviEVLCB7BYowhf/ONmVaWED138PaG4Z9nY6YuHU383uOoIWT+Lq3dLkFzDzstXw=="
},
"@oceanprotocol/keeper-contracts": {
"version": "0.9.0",
"resolved": "https://registry.npmjs.org/@oceanprotocol/keeper-contracts/-/keeper-contracts-0.9.0.tgz",
"integrity": "sha512-QrTCQNiQa9KszH6/dTAS0a8AoW/SIEkZazXTwA2aoePBS0X8fNpsKvT3N2OuR1YPAjCU3rGWzYdV4TNnMNbsSw=="
"version": "0.9.1",
"resolved": "https://registry.npmjs.org/@oceanprotocol/keeper-contracts/-/keeper-contracts-0.9.1.tgz",
"integrity": "sha512-c1LvaH+e1tzow0gZLwSWe19ap+DrZuNmZfxBdwEVEPQXarI0jTXa5qVDoiBow8kBWaqSIUgFAzQOJW8rKdlS1A=="
},
"@oceanprotocol/squid": {
"version": "0.5.0",
"resolved": "https://registry.npmjs.org/@oceanprotocol/squid/-/squid-0.5.0.tgz",
"integrity": "sha512-yGu121WJ9XEX1U4ql/p7ISV36fqNydxGBYgXHbOjeXS/kvNFx3hP2emBf4QA12PjPZcmuLz0wE+7GBL4H/v+eA==",
"version": "0.5.1",
"resolved": "https://registry.npmjs.org/@oceanprotocol/squid/-/squid-0.5.1.tgz",
"integrity": "sha512-YJewmMIpHG5cjsOsgOynky7z+5YT7l5+niW9AqCMOoMGy76VEe1+6nmAhZ/PB9BtIpYCGWOl1Y68I32qhX9IWQ==",
"requires": {
"@oceanprotocol/keeper-contracts": "^0.9.0",
"bignumber.js": "^8.0.1",
@ -1382,9 +1382,9 @@
}
},
"@types/react": {
"version": "16.8.10",
"resolved": "https://registry.npmjs.org/@types/react/-/react-16.8.10.tgz",
"integrity": "sha512-7bUQeZKP4XZH/aB4i7k1i5yuwymDu/hnLMhD9NjVZvQQH7ZUgRN3d6iu8YXzx4sN/tNr0bj8jgguk8hhObzGvA==",
"version": "16.8.13",
"resolved": "https://registry.npmjs.org/@types/react/-/react-16.8.13.tgz",
"integrity": "sha512-otJ4ntMuHGrvm67CdDJMAls4WqotmAmW0g3HmWi9LCjSWXrxoXY/nHXrtmMfvPEEmGFNm6NdgMsJmnfH820Qaw==",
"dev": true,
"requires": {
"@types/prop-types": "*",
@ -1392,9 +1392,9 @@
}
},
"@types/react-datepicker": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/@types/react-datepicker/-/react-datepicker-2.2.0.tgz",
"integrity": "sha512-zVAeDqkQgSdARElFXwXXpaaADyoRMo1SPsBzw6WV2iciJqS3ysSvYjqEKyTZfGbGkgw5sExEI2QKXam/KlCtyg==",
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/@types/react-datepicker/-/react-datepicker-2.2.1.tgz",
"integrity": "sha512-En5Ezrl+o/QvHhAFUxxQox2SDu4vDmo3/uhXj9SwX7ObZ5X4jwSS9CocTHsRCqpsr+F7JGhUJ9KK7FVeknDw4Q==",
"dev": true,
"requires": {
"@types/react": "*",
@ -1441,9 +1441,9 @@
}
},
"@types/react-transition-group": {
"version": "2.0.16",
"resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-2.0.16.tgz",
"integrity": "sha512-FUJEx2BGJPU1qVQoWd9v7wpOwnCPTWhcE4iTaU5prry9SvwiI11lCXOci8Nz9cM/Fuf650l7Skg6nlVeCYjPFA==",
"version": "2.8.0",
"resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-2.8.0.tgz",
"integrity": "sha512-DHZrY4UBypeT/bD2WakC3MkdBHMOkhqWnRRCMqrtNknyhfkCfKmRlpKdxGlPkDKvNl2uDSHcdvmKy8JW0aNETA==",
"dev": true,
"requires": {
"@types/react": "*"
@ -16345,11 +16345,11 @@
}
},
"react-transition-group": {
"version": "2.7.1",
"resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-2.7.1.tgz",
"integrity": "sha512-b0VJTzNRnXxRpCuxng6QJbAzmmrhBn1BZJfPPnHbH2PIo8msdkajqwtfdyGm/OypPXZNfAHKEqeN15wjMXrRJQ==",
"version": "2.9.0",
"resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-2.9.0.tgz",
"integrity": "sha512-+HzNTCHpeQyl4MJ/bdE0u6XRMe9+XG/+aL4mCxVN4DnPBQ0/5bfHWPDuOZUzYdMj94daZaZdCCc1Dzt9R/xSSg==",
"requires": {
"dom-helpers": "^3.3.1",
"dom-helpers": "^3.4.0",
"loose-envify": "^1.4.0",
"prop-types": "^15.6.2",
"react-lifecycles-compat": "^3.0.4"
@ -19177,9 +19177,9 @@
}
},
"typescript": {
"version": "3.4.1",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.4.1.tgz",
"integrity": "sha512-3NSMb2VzDQm8oBTLH6Nj55VVtUEpe/rgkIzMir0qVoLyjDZlnMBva0U6vDiV3IH+sl/Yu6oP5QwsAQtHPmDd2Q==",
"version": "3.4.2",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.4.2.tgz",
"integrity": "sha512-Og2Vn6Mk7JAuWA1hQdDQN/Ekm/SchX80VzLhjKN9ETYrIepBFAd8PkOdOTK2nKt0FCkmMZKBJvQ1dV1gIxPu/A==",
"dev": true
},
"ua-parser-js": {
@ -19657,22 +19657,22 @@
"dev": true
},
"web3": {
"version": "1.0.0-beta.51",
"resolved": "https://registry.npmjs.org/web3/-/web3-1.0.0-beta.51.tgz",
"integrity": "sha512-cSjJe8AwR9TKELLkGwk2HNL+37e+Y3x0nKkdBNpBZQNZR0SeoT3Jckkd7pBgrJKcyupItN+tKF48x5yNRvHzrQ==",
"version": "1.0.0-beta.52",
"resolved": "https://registry.npmjs.org/web3/-/web3-1.0.0-beta.52.tgz",
"integrity": "sha512-IWBV1gS7sElHqD2mkwjdyeEmY4YhWn7C+b+pdOWgDJ6j70ux2bqVMfsP0saZ9nWeF1TWMvUnrFsyZ7C4/VnhTA==",
"requires": {
"@babel/runtime": "^7.3.1",
"@types/node": "^10.12.18",
"web3-bzz": "1.0.0-beta.51",
"web3-core": "1.0.0-beta.51",
"web3-core-helpers": "1.0.0-beta.51",
"web3-core-method": "1.0.0-beta.51",
"web3-eth": "1.0.0-beta.51",
"web3-eth-personal": "1.0.0-beta.51",
"web3-net": "1.0.0-beta.51",
"web3-providers": "1.0.0-beta.51",
"web3-shh": "1.0.0-beta.51",
"web3-utils": "1.0.0-beta.51"
"web3-bzz": "1.0.0-beta.52",
"web3-core": "1.0.0-beta.52",
"web3-core-helpers": "1.0.0-beta.52",
"web3-core-method": "1.0.0-beta.52",
"web3-eth": "1.0.0-beta.52",
"web3-eth-personal": "1.0.0-beta.52",
"web3-net": "1.0.0-beta.52",
"web3-providers": "1.0.0-beta.52",
"web3-shh": "1.0.0-beta.52",
"web3-utils": "1.0.0-beta.52"
},
"dependencies": {
"@types/node": {
@ -19796,9 +19796,9 @@
"integrity": "sha1-wqMN7bPlNdcsz4LjQ5QaULqFM6w="
},
"web3-bzz": {
"version": "1.0.0-beta.51",
"resolved": "https://registry.npmjs.org/web3-bzz/-/web3-bzz-1.0.0-beta.51.tgz",
"integrity": "sha512-9zDifUc3qPOF2WJ2H/81Ki4rTLa4elB0OG8h3IEYHjXOLDHKzswBQC3favhvm/ZQ2WmnkGd04vsU2iQzBmr1OQ==",
"version": "1.0.0-beta.52",
"resolved": "https://registry.npmjs.org/web3-bzz/-/web3-bzz-1.0.0-beta.52.tgz",
"integrity": "sha512-yva0KW0cIEdFyHaGMHuMGjl4jea/esNBVwfFsejNRJy2W2jSMjnji+AFXnkcq8MhOAyNtQD4WzNdad9F51PaZg==",
"requires": {
"@babel/runtime": "^7.3.1",
"@types/node": "^10.12.18",
@ -19807,32 +19807,32 @@
}
},
"web3-core": {
"version": "1.0.0-beta.51",
"resolved": "https://registry.npmjs.org/web3-core/-/web3-core-1.0.0-beta.51.tgz",
"integrity": "sha512-RZRAt0O+LsU1jV6BtuZBQYjE+YcNa9Bu6FzEAMZ92EdgiAkUB2kbTeipVGCMxOST26kWXUtwCwxkkx4g6iy41A==",
"version": "1.0.0-beta.52",
"resolved": "https://registry.npmjs.org/web3-core/-/web3-core-1.0.0-beta.52.tgz",
"integrity": "sha512-UKHNBIj5b4M40DrGJRQKgWTtbqZCCZck38oQgBbtLAUUQmvlZybLf8jGWUfMamyhJg/eBqT/t1l7OcAn5i9zrA==",
"requires": {
"@babel/runtime": "^7.3.1",
"@types/bn.js": "^4.11.4",
"@types/node": "^10.12.18",
"lodash": "^4.17.11",
"web3-utils": "1.0.0-beta.51"
"web3-utils": "1.0.0-beta.52"
}
},
"web3-core-helpers": {
"version": "1.0.0-beta.51",
"resolved": "https://registry.npmjs.org/web3-core-helpers/-/web3-core-helpers-1.0.0-beta.51.tgz",
"integrity": "sha512-kA5JMJyrB5yxX3dQuziBP0Yo9i+MKwtYfA2E7DTbEoUueqjPcEwXMUxmpGROYmufCcfoe/B/FqpC8CzkqmHokw==",
"version": "1.0.0-beta.52",
"resolved": "https://registry.npmjs.org/web3-core-helpers/-/web3-core-helpers-1.0.0-beta.52.tgz",
"integrity": "sha512-VJCJMEplvrU7jCgn0MCuLLa+XWkQVttQpShM5i0XkcKs2gmisMtoLO3lATx2b32ruu29EriBYkkAVzc0/nxppg==",
"requires": {
"@babel/runtime": "^7.3.1",
"lodash": "^4.17.11",
"web3-eth-iban": "1.0.0-beta.51",
"web3-utils": "1.0.0-beta.51"
"web3-eth-iban": "1.0.0-beta.52",
"web3-utils": "1.0.0-beta.52"
}
},
"web3-core-method": {
"version": "1.0.0-beta.51",
"resolved": "https://registry.npmjs.org/web3-core-method/-/web3-core-method-1.0.0-beta.51.tgz",
"integrity": "sha512-Tl5jGWqx01W6OFPNZI1c4wtCt+HPKWldWrLORKfW0zHyXrYDH6V2BuitA7R7j+54+c/61W3C2E6a+g7sQ8+mWA==",
"version": "1.0.0-beta.52",
"resolved": "https://registry.npmjs.org/web3-core-method/-/web3-core-method-1.0.0-beta.52.tgz",
"integrity": "sha512-lLbDsV2pxxrUDIWvRI/u6MsvG8mKGfCYOifXqb+yqAruhoNs/Gahoa/1UTjsn0qhVQafsffFRXaEhi6BQDQOYA==",
"requires": {
"@babel/runtime": "^7.3.1",
"eventemitter3": "3.1.0",
@ -19840,9 +19840,9 @@
}
},
"web3-core-subscriptions": {
"version": "1.0.0-beta.51",
"resolved": "https://registry.npmjs.org/web3-core-subscriptions/-/web3-core-subscriptions-1.0.0-beta.51.tgz",
"integrity": "sha512-bM4KlA37Or/XfrZKLtXlvUSISKWUkXOH/32s0DBnxRkKuey8QKK460H5KF9/HS8LfY7cO11NAepnFe4Tk1rSaQ==",
"version": "1.0.0-beta.52",
"resolved": "https://registry.npmjs.org/web3-core-subscriptions/-/web3-core-subscriptions-1.0.0-beta.52.tgz",
"integrity": "sha512-ZE6VsTVZ9PHV3FOJHnXOxUr4RuwXUpqC+RxCESb/UXvwHNnPbKNPpQjcoc5shaFrtOVtY14bIl35qTxVHSeGWg==",
"requires": {
"@babel/runtime": "^7.3.1",
"eventemitter3": "^3.1.0",
@ -19850,43 +19850,43 @@
}
},
"web3-eth": {
"version": "1.0.0-beta.51",
"resolved": "https://registry.npmjs.org/web3-eth/-/web3-eth-1.0.0-beta.51.tgz",
"integrity": "sha512-w+8YtfKAcEPmOtYf47cjQw3t6dm5YcGvkl4jVZF00WHuvkPMFsXBTbZdH4aVgjPhubl53rdLrJwAP2b7X83+kQ==",
"version": "1.0.0-beta.52",
"resolved": "https://registry.npmjs.org/web3-eth/-/web3-eth-1.0.0-beta.52.tgz",
"integrity": "sha512-mpuIFSIke/ZVdWfEzq0QRJAxcDh50BJflsdUMbNaxf5prP7Sz8FZJz/fHiu4H4cEM6aW8Bi0Hsoqad4+caX6Uw==",
"requires": {
"@babel/runtime": "^7.3.1",
"ethereumjs-tx": "^1.3.7",
"rxjs": "^6.4.0",
"web3-core": "1.0.0-beta.51",
"web3-core-helpers": "1.0.0-beta.51",
"web3-core-method": "1.0.0-beta.51",
"web3-core-subscriptions": "1.0.0-beta.51",
"web3-eth-abi": "1.0.0-beta.51",
"web3-eth-accounts": "1.0.0-beta.51",
"web3-eth-contract": "1.0.0-beta.51",
"web3-eth-ens": "1.0.0-beta.51",
"web3-eth-iban": "1.0.0-beta.51",
"web3-eth-personal": "1.0.0-beta.51",
"web3-net": "1.0.0-beta.51",
"web3-providers": "1.0.0-beta.51",
"web3-utils": "1.0.0-beta.51"
"web3-core": "1.0.0-beta.52",
"web3-core-helpers": "1.0.0-beta.52",
"web3-core-method": "1.0.0-beta.52",
"web3-core-subscriptions": "1.0.0-beta.52",
"web3-eth-abi": "1.0.0-beta.52",
"web3-eth-accounts": "1.0.0-beta.52",
"web3-eth-contract": "1.0.0-beta.52",
"web3-eth-ens": "1.0.0-beta.52",
"web3-eth-iban": "1.0.0-beta.52",
"web3-eth-personal": "1.0.0-beta.52",
"web3-net": "1.0.0-beta.52",
"web3-providers": "1.0.0-beta.52",
"web3-utils": "1.0.0-beta.52"
}
},
"web3-eth-abi": {
"version": "1.0.0-beta.51",
"resolved": "https://registry.npmjs.org/web3-eth-abi/-/web3-eth-abi-1.0.0-beta.51.tgz",
"integrity": "sha512-mTcMpIihZECzZ5oWUh9Jg7x5pVhPv6xPTPWxY9007QKbbBH01GwPogoxBz1X7RfWOwGqZABfxFgXow5NkL0T3A==",
"version": "1.0.0-beta.52",
"resolved": "https://registry.npmjs.org/web3-eth-abi/-/web3-eth-abi-1.0.0-beta.52.tgz",
"integrity": "sha512-c03sH6y7ncp9tBPt0EZEcyFyou4kyYdr72VJMY8ip0JAfZgl4WI9XcGpD207z0lR4Ki1PSCfkh+ZigoXxggouw==",
"requires": {
"@babel/runtime": "^7.3.1",
"ethers": "^4.0.27",
"lodash": "^4.17.11",
"web3-utils": "1.0.0-beta.51"
"web3-utils": "1.0.0-beta.52"
}
},
"web3-eth-accounts": {
"version": "1.0.0-beta.51",
"resolved": "https://registry.npmjs.org/web3-eth-accounts/-/web3-eth-accounts-1.0.0-beta.51.tgz",
"integrity": "sha512-6HJu4Vrli7p1S52mV83juFjWn0w7rUE4q9cZdYwsGmqHGrOmV7E3zuBEyuA+kelPLpSmcJDOnEowvORmRdpAyw==",
"version": "1.0.0-beta.52",
"resolved": "https://registry.npmjs.org/web3-eth-accounts/-/web3-eth-accounts-1.0.0-beta.52.tgz",
"integrity": "sha512-B52yDVK2/3NKce1CESTZ/sD+6lU9pdNk4tPAtTkWTTPlejAbNlI04SdCX+hn2XJpDjsvU2HRSY3uNugVTrRQ6w==",
"requires": {
"@babel/runtime": "^7.3.1",
"crypto-browserify": "3.12.0",
@ -19894,11 +19894,11 @@
"lodash": "^4.17.11",
"scrypt.js": "0.2.0",
"uuid": "3.3.2",
"web3-core": "1.0.0-beta.51",
"web3-core-helpers": "1.0.0-beta.51",
"web3-core-method": "1.0.0-beta.51",
"web3-providers": "1.0.0-beta.51",
"web3-utils": "1.0.0-beta.51"
"web3-core": "1.0.0-beta.52",
"web3-core-helpers": "1.0.0-beta.52",
"web3-core-method": "1.0.0-beta.52",
"web3-providers": "1.0.0-beta.52",
"web3-utils": "1.0.0-beta.52"
},
"dependencies": {
"eth-lib": {
@ -19919,98 +19919,98 @@
}
},
"web3-eth-contract": {
"version": "1.0.0-beta.51",
"resolved": "https://registry.npmjs.org/web3-eth-contract/-/web3-eth-contract-1.0.0-beta.51.tgz",
"integrity": "sha512-iVMay6OXDjDPeiPoeGpa6PQGuwIPxL/8UAVIlWVB1CYG9+FY6kcOUO7vI7dnDVwN1zneAslf9h86px6hgR92OQ==",
"version": "1.0.0-beta.52",
"resolved": "https://registry.npmjs.org/web3-eth-contract/-/web3-eth-contract-1.0.0-beta.52.tgz",
"integrity": "sha512-X5Eqi/onxaBw04urowcYXl4L7eS3NuAFdBxSYP14rdTtP03TbgZEJ1GZDftF3cgMorvfGKcTyxyK0VYj/l+lfg==",
"requires": {
"@babel/runtime": "^7.3.1",
"@types/bn.js": "^4.11.4",
"lodash": "^4.17.11",
"web3-core": "1.0.0-beta.51",
"web3-core-helpers": "1.0.0-beta.51",
"web3-core-method": "1.0.0-beta.51",
"web3-core-subscriptions": "1.0.0-beta.51",
"web3-eth-abi": "1.0.0-beta.51",
"web3-eth-accounts": "1.0.0-beta.51",
"web3-providers": "1.0.0-beta.51",
"web3-utils": "1.0.0-beta.51"
"web3-core": "1.0.0-beta.52",
"web3-core-helpers": "1.0.0-beta.52",
"web3-core-method": "1.0.0-beta.52",
"web3-core-subscriptions": "1.0.0-beta.52",
"web3-eth-abi": "1.0.0-beta.52",
"web3-eth-accounts": "1.0.0-beta.52",
"web3-providers": "1.0.0-beta.52",
"web3-utils": "1.0.0-beta.52"
}
},
"web3-eth-ens": {
"version": "1.0.0-beta.51",
"resolved": "https://registry.npmjs.org/web3-eth-ens/-/web3-eth-ens-1.0.0-beta.51.tgz",
"integrity": "sha512-JpHlAIUZGLGTTHWKBFciv5KGBi/+n0uqaO/dXoIfB/jI0Gcm5GYEwUt8TU/Y0/WVHvw/ttU1e0laJYPzTTEB8w==",
"version": "1.0.0-beta.52",
"resolved": "https://registry.npmjs.org/web3-eth-ens/-/web3-eth-ens-1.0.0-beta.52.tgz",
"integrity": "sha512-8VTOF+v5pAjq1FmakXRceY6VrIoPB7DqfSc+K4aAOJ/tuIMIpe6pt0Bl9IYAbpgFrFqL7ow22d9xcd77ULIwiQ==",
"requires": {
"@babel/runtime": "^7.3.1",
"eth-ens-namehash": "2.0.8",
"lodash": "^4.17.11",
"web3-core": "1.0.0-beta.51",
"web3-core-helpers": "1.0.0-beta.51",
"web3-core-method": "1.0.0-beta.51",
"web3-eth-abi": "1.0.0-beta.51",
"web3-eth-contract": "1.0.0-beta.51",
"web3-net": "1.0.0-beta.51",
"web3-providers": "1.0.0-beta.51",
"web3-utils": "1.0.0-beta.51"
"web3-core": "1.0.0-beta.52",
"web3-core-helpers": "1.0.0-beta.52",
"web3-core-method": "1.0.0-beta.52",
"web3-eth-abi": "1.0.0-beta.52",
"web3-eth-contract": "1.0.0-beta.52",
"web3-net": "1.0.0-beta.52",
"web3-providers": "1.0.0-beta.52",
"web3-utils": "1.0.0-beta.52"
}
},
"web3-eth-iban": {
"version": "1.0.0-beta.51",
"resolved": "https://registry.npmjs.org/web3-eth-iban/-/web3-eth-iban-1.0.0-beta.51.tgz",
"integrity": "sha512-GNLsEWpEkyJqmogsF+mQLlO06tPOudfhVBCPC68SIOw6wQTqAtoqzOot3EJdrEIDGet9eujOoBs6VWAjNbMGRA==",
"version": "1.0.0-beta.52",
"resolved": "https://registry.npmjs.org/web3-eth-iban/-/web3-eth-iban-1.0.0-beta.52.tgz",
"integrity": "sha512-LJZRZ+hZZPU9Fb7xR54mX1li5aKMp9xj9wgZZa4ikdL7iWi0rg1tOacEhbxWGQsjEYhGZYcvxhW9RIdHOwAySg==",
"requires": {
"@babel/runtime": "^7.3.1",
"bn.js": "4.11.8",
"web3-utils": "1.0.0-beta.51"
"web3-utils": "1.0.0-beta.52"
}
},
"web3-eth-personal": {
"version": "1.0.0-beta.51",
"resolved": "https://registry.npmjs.org/web3-eth-personal/-/web3-eth-personal-1.0.0-beta.51.tgz",
"integrity": "sha512-Mq6uAvhfsKf7FSZVqJOfmb7i5zxQ6HkbTRcAyOOOfSmGnTvxSIjtKZCTAVv3UeBh3pxIXn5FSDlKngaj1MbYXg==",
"version": "1.0.0-beta.52",
"resolved": "https://registry.npmjs.org/web3-eth-personal/-/web3-eth-personal-1.0.0-beta.52.tgz",
"integrity": "sha512-tNjoB9KztpZL2ayjWYxaInwMrEGxBV7rGMt3hkhk9y4UxlK+8rZtrboz5hggzcgzHaVGnG73rdynhbuPU/cSAQ==",
"requires": {
"@babel/runtime": "^7.3.1",
"web3-core": "1.0.0-beta.51",
"web3-core-helpers": "1.0.0-beta.51",
"web3-core-method": "1.0.0-beta.51",
"web3-net": "1.0.0-beta.51",
"web3-providers": "1.0.0-beta.51",
"web3-utils": "1.0.0-beta.51"
"web3-core": "1.0.0-beta.52",
"web3-core-helpers": "1.0.0-beta.52",
"web3-core-method": "1.0.0-beta.52",
"web3-net": "1.0.0-beta.52",
"web3-providers": "1.0.0-beta.52",
"web3-utils": "1.0.0-beta.52"
}
},
"web3-net": {
"version": "1.0.0-beta.51",
"resolved": "https://registry.npmjs.org/web3-net/-/web3-net-1.0.0-beta.51.tgz",
"integrity": "sha512-1xeBIb/Tvf6PVNZ0u+pPrULNkLefTf0uuo8Hyx82EfY+mvMz6jvNDyFsD8spDGJUuxlDabFnoZdiaEv7LNwwSg==",
"version": "1.0.0-beta.52",
"resolved": "https://registry.npmjs.org/web3-net/-/web3-net-1.0.0-beta.52.tgz",
"integrity": "sha512-rw66c5A5VTF/m3Acnr9ebIAgbr28q5jhXs8A8/F4VjbsDmUhQuQr3deyTPfyOEyupcnn6QRLoQ1EFVzeaUP7Ng==",
"requires": {
"@babel/runtime": "^7.3.1",
"lodash": "^4.17.11",
"web3-core": "1.0.0-beta.51",
"web3-core-helpers": "1.0.0-beta.51",
"web3-core-method": "1.0.0-beta.51",
"web3-providers": "1.0.0-beta.51",
"web3-utils": "1.0.0-beta.51"
"web3-core": "1.0.0-beta.52",
"web3-core-helpers": "1.0.0-beta.52",
"web3-core-method": "1.0.0-beta.52",
"web3-providers": "1.0.0-beta.52",
"web3-utils": "1.0.0-beta.52"
}
},
"web3-shh": {
"version": "1.0.0-beta.51",
"resolved": "https://registry.npmjs.org/web3-shh/-/web3-shh-1.0.0-beta.51.tgz",
"integrity": "sha512-IA4oaNH+PaGWQtTe7BmENszNTeSTsZ15hBNnOrMIyeF0PeghPj7sCenTtU/q8Ie6jR0oXfTXJOQCS/Q/QC3Ksg==",
"version": "1.0.0-beta.52",
"resolved": "https://registry.npmjs.org/web3-shh/-/web3-shh-1.0.0-beta.52.tgz",
"integrity": "sha512-Qu9cb9fifUFIDTGujnBnInO3D2OCXDAmCowqMWebEazoZxk9P4oYWmumym1ZErixqEWREb4lkoayyEDSpARzSg==",
"requires": {
"@babel/runtime": "^7.3.1",
"web3-core": "1.0.0-beta.51",
"web3-core-helpers": "1.0.0-beta.51",
"web3-core-method": "1.0.0-beta.51",
"web3-core-subscriptions": "1.0.0-beta.51",
"web3-net": "1.0.0-beta.51",
"web3-providers": "1.0.0-beta.51",
"web3-utils": "1.0.0-beta.51"
"web3-core": "1.0.0-beta.52",
"web3-core-helpers": "1.0.0-beta.52",
"web3-core-method": "1.0.0-beta.52",
"web3-core-subscriptions": "1.0.0-beta.52",
"web3-net": "1.0.0-beta.52",
"web3-providers": "1.0.0-beta.52",
"web3-utils": "1.0.0-beta.52"
}
},
"web3-utils": {
"version": "1.0.0-beta.51",
"resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.0.0-beta.51.tgz",
"integrity": "sha512-c9sRSscu0NIjD96X4ToDOgTxGyJevppuB+uHOgWkziaLGqlw/Li1l24nGkvr0Zqpt9SufvfPcWf8EEC92pnwKg==",
"version": "1.0.0-beta.52",
"resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.0.0-beta.52.tgz",
"integrity": "sha512-WdHyzPcZu/sOnNrkcOZT20QEX9FhwD9OJJXENojQNvMK2a1xo3n8JWBcC2gzAGwsa0Aah6z2B3Xwa1P//8FaoA==",
"requires": {
"@babel/runtime": "^7.3.1",
"@types/bn.js": "^4.11.4",
@ -20245,16 +20245,16 @@
}
},
"web3-providers": {
"version": "1.0.0-beta.51",
"resolved": "https://registry.npmjs.org/web3-providers/-/web3-providers-1.0.0-beta.51.tgz",
"integrity": "sha512-aWUEZIou4+zEZbLaBf1GQwbNoERq66mLEB6ubcPz1WEq1T5jfUPfwO4b4W2bEbEZVsoxS1ZJvSFkj1yAtD0X+g==",
"version": "1.0.0-beta.52",
"resolved": "https://registry.npmjs.org/web3-providers/-/web3-providers-1.0.0-beta.52.tgz",
"integrity": "sha512-eRmWOn6BeYfAt8UQmCRnqXo1++IjSiIz7+EY9WJ+m7J5ncq/gQN3idWQxT3QZzGRiAvZlO8ZUuF7ff0vuufakg==",
"requires": {
"@babel/runtime": "^7.3.1",
"@types/node": "^10.12.18",
"eventemitter3": "3.1.0",
"lodash": "^4.17.11",
"url-parse": "1.4.4",
"websocket": "git://github.com/frozeman/WebSocket-Node.git#browserifyCompatible",
"websocket": "^1.0.28",
"xhr2-cookies": "1.1.0"
},
"dependencies": {
@ -20267,6 +20267,17 @@
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-3.1.0.tgz",
"integrity": "sha512-ivIvhpq/Y0uSjcHDcOIccjmYjGLcP09MFGE7ysAwkAvkXfpZlC985pH2/ui64DKazbTW/4kN3yqozUxlXzI6cA=="
},
"websocket": {
"version": "1.0.28",
"resolved": "https://registry.npmjs.org/websocket/-/websocket-1.0.28.tgz",
"integrity": "sha512-00y/20/80P7H4bCYkzuuvvfDvh+dgtXi5kzDf3UcZwN6boTYaKvsrtZ5lIYm1Gsg48siMErd9M4zjSYfYFHTrA==",
"requires": {
"debug": "^2.2.0",
"nan": "^2.11.0",
"typedarray-to-buffer": "^3.1.5",
"yaeti": "^0.0.6"
}
}
}
},

View File

@ -11,7 +11,7 @@
},
"dependencies": {
"@oceanprotocol/art": "^2.2.0",
"@oceanprotocol/squid": "^0.5.1",
"@oceanprotocol/squid": "^0.5.2",
"@oceanprotocol/typographies": "^0.1.0",
"classnames": "^2.2.6",
"filesize": "^4.1.2",
@ -25,9 +25,9 @@
"react-moment": "^0.8.4",
"react-popper": "^1.3.3",
"react-router-dom": "^5.0.0",
"react-transition-group": "^2.7.1",
"react-transition-group": "^2.9.0",
"slugify": "^1.3.4",
"web3": "^1.0.0-beta.51"
"web3": "^1.0.0-beta.52"
},
"devDependencies": {
"@types/classnames": "^2.2.7",
@ -35,16 +35,16 @@
"@types/is-url": "^1.2.28",
"@types/jest": "^24.0.11",
"@types/query-string": "^6.3.0",
"@types/react": "^16.8.10",
"@types/react-datepicker": "^2.2.0",
"@types/react": "^16.8.13",
"@types/react-datepicker": "^2.2.1",
"@types/react-dom": "^16.8.3",
"@types/react-helmet": "^5.0.8",
"@types/react-router-dom": "^4.3.1",
"@types/react-transition-group": "^2.0.16",
"@types/react-transition-group": "^2.8.0",
"@types/web3": "^1.0.18",
"node-sass": "^4.11.0",
"react-scripts": "^2.1.8",
"typescript": "^3.4.1"
"typescript": "^3.4.2"
},
"repository": {
"type": "git",

View File

@ -39,7 +39,7 @@ interface AppState {
}
network: string
web3: Web3
ocean: {}
ocean: any
startLogin: () => void
message: string
}
@ -95,7 +95,7 @@ class App extends Component<{}, AppState> {
)
),
account: '',
ocean: {},
ocean: {} as any,
startLogin: this.startLogin,
requestFromFaucet: this.requestFromFaucet,
message: 'Connecting to Ocean...'
@ -106,73 +106,77 @@ class App extends Component<{}, AppState> {
}
private startLoginProcess = async () => {
if (window.web3) {
const web3 = new Web3(window.web3.currentProvider)
try {
const accounts = await web3.eth.getAccounts()
try {
if (this.state.isWeb3 && window.ethereum) {
await window.ethereum.enable()
const accounts = await this.state.ocean.accounts.list()
if (accounts.length > 0) {
const balance = await accounts[0].getBalance()
this.setState({
isLogged: true,
isWeb3: true,
account: accounts[0],
web3
balance,
account: accounts[0].getId()
})
} else {
if (accounts.length === 0 && window.ethereum) {
await window.ethereum.enable()
const newAccounts = await web3.eth.getAccounts()
if (newAccounts.length > 0) {
this.setState({
isLogged: true,
isWeb3: true,
account: newAccounts[0],
web3
})
} else {
// failed to unlock
}
} else {
// no unlock procedure
}
// not unlocked
}
} catch (e) {
// something went wrong, show error?
} else {
// no metamask/mist, show installation guide!
}
} else {
// no metamask/mist, show installation guide!
} catch (e) {
Logger.log('error logging', e)
// error in logging process
// show error
// rerun bootstrap process?
}
}
private bootstrap = async () => {
if (window.web3) {
this.setState({ isWeb3: true })
const web3 = new Web3(window.web3.currentProvider)
try {
const accounts = await web3.eth.getAccounts()
try {
if (window.web3) {
const web3 = new Web3(window.web3.currentProvider)
const { ocean } = await provideOcean(web3)
const accounts = await ocean.accounts.list()
const network = await ocean.keeper.getNetworkName()
const isNile = network === 'Nile'
if (accounts.length > 0) {
const balance = await accounts[0].getBalance()
this.setState({
isWeb3: true,
isLogged: true,
account: accounts[0],
web3
isNile,
ocean,
web3,
balance,
network,
account: accounts[0].getId(),
isLoading: false
})
} else {
this.setState({
isWeb3: true,
isNile,
ocean,
web3,
network,
isLoading: false
})
}
} catch (e) {
Logger.log('web3 error', e)
} else {
const { ocean } = await provideOcean(this.state.web3)
const network = await ocean.keeper.getNetworkName()
const isNile = network === 'Nile'
this.setState({
isNile,
ocean,
network,
isLoading: false
})
}
}
try {
const { ocean } = await provideOcean()
this.setState({
isLoading: false,
ocean
})
const accounts = await ocean.accounts.list()
const balance = await accounts[0].getBalance()
const network = await ocean.keeper.getNetworkName()
const isNile = network === 'Nile'
this.setState({ balance, network, isNile })
} catch (e) {
Logger.log('ocean/balance error', e)
// error in bootstrap process
// show error connecting to ocean
Logger.log('web3 error', e)
this.setState({
isLoading: false
})

View File

@ -0,0 +1,35 @@
@import '../../styles/variables';
.pagination {
display: flex;
margin-top: $spacer * 2;
margin-bottom: $spacer;
justify-content: center;
> div {
&:first-child {
padding: $spacer / 4;
}
&:last-child {
padding: $spacer / 4;
text-align: right;
}
}
}
.number {
text-align: center;
font-weight: $font-weight-bold;
padding: $spacer / 4;
margin-left: $spacer / 4;
margin-right: $spacer / 4;
display: inline-block;
}
.current {
composes: number;
cursor: default;
pointer-events: none;
color: $brand-grey-light;
}

View File

@ -0,0 +1,82 @@
import React, { PureComponent } from 'react'
import Button from '../atoms/Button'
import styles from './Pagination.module.scss'
const PageNumber = ({
i,
current,
setPage
}: {
i: number
current: boolean
setPage(page: number): void
}) => (
<Button
link
className={current ? styles.current : styles.number}
onClick={() => setPage(i + 1)}
>
{`${i + 1}`}
</Button>
)
const PrevNext = ({
currentPage,
prevPage,
setPage
}: {
currentPage: number
prevPage?: number
setPage(page: number): void
}) => (
<Button
link
onClick={
prevPage ? () => setPage(prevPage) : () => setPage(currentPage + 1)
}
>
{prevPage ? '←' : '→'}
</Button>
)
export default class Pagination extends PureComponent<{
currentPage: number
totalPages: number
prevPage?: number
setPage(page: number): void
}> {
public render() {
const { currentPage, totalPages, prevPage, setPage } = this.props
const isFirst = currentPage === 1
const isLast = currentPage === totalPages
return totalPages > 1 ? (
<div className={styles.pagination}>
<div>
{!isFirst && (
<PrevNext
prevPage={prevPage}
currentPage={currentPage}
setPage={setPage}
/>
)}
</div>
<div>
{Array.from({ length: totalPages }, (_, i) => (
<PageNumber
key={`pagination-number${i + 1}`}
i={i}
current={currentPage === i + 1}
setPage={setPage}
/>
))}
</div>
<div>
{!isLast && (
<PrevNext currentPage={currentPage} setPage={setPage} />
)}
</div>
</div>
) : null
}
}

View File

@ -4,6 +4,7 @@ import { Logger } from '@oceanprotocol/squid'
import { User } from '../../context/User'
import Spinner from '../atoms/Spinner'
import Asset from '../molecules/Asset'
import Web3message from './Web3message'
import styles from './AssetsUser.module.scss'
export default class AssetsUser extends PureComponent<
@ -47,49 +48,48 @@ export default class AssetsUser extends PureComponent<
}
public render() {
return (
this.context.isNile &&
this.context.account && (
<div className={styles.assetsUser}>
{this.props.recent && (
<h2 className={styles.subTitle}>
Your Latest Published Data Sets
</h2>
)}
return this.context.isNile && this.context.account ? (
<div className={styles.assetsUser}>
{this.props.recent && (
<h2 className={styles.subTitle}>
Your Latest Published Data Sets
</h2>
)}
{this.state.isLoading ? (
<Spinner />
) : this.state.results.length ? (
<>
{this.state.results
.slice(
0,
this.props.recent
? this.props.recent
: undefined
)
.filter(asset => !!asset)
.map((asset: any) => (
<Asset
list={this.props.list}
key={asset.id}
asset={asset}
/>
))}
{this.props.recent && (
<Link className={styles.link} to={'/history'}>
All Data Sets
</Link>
)}
</>
) : (
<div className={styles.empty}>
<p>No Data Sets Yet.</p>
<Link to="/publish">+ Publish A Data Set</Link>
</div>
)}
</div>
)
{this.state.isLoading ? (
<Spinner />
) : this.state.results.length ? (
<>
{this.state.results
.slice(
0,
this.props.recent
? this.props.recent
: undefined
)
.filter(asset => !!asset)
.map((asset: any) => (
<Asset
list={this.props.list}
key={asset.id}
asset={asset}
/>
))}
{this.props.recent && (
<Link className={styles.link} to={'/history'}>
All Data Sets
</Link>
)}
</>
) : (
<div className={styles.empty}>
<p>No Data Sets Yet.</p>
<Link to="/publish">+ Publish A Data Set</Link>
</div>
)}
</div>
) : (
<Web3message />
)
}
}

View File

@ -26,9 +26,12 @@ export default class Web3message extends PureComponent {
public noWeb3() {
return (
<div className={styles.message}>
<AccountStatus className={styles.status} /> No Web3 Browser. For
publishing an asset you need to{' '}
<a href="https://docs.oceanprotocol.com/tutorials/metamask-setup/">
<AccountStatus className={styles.status} /> Not a Web3 Browser.
For publishing or consuming an asset you need to{' '}
<a
href="https://docs.oceanprotocol.com/tutorials/metamask-setup/"
target="_blank"
>
setup MetaMask
</a>{' '}
or use any other Web3-capable plugin or browser.
@ -40,7 +43,7 @@ export default class Web3message extends PureComponent {
return (
<div className={styles.message}>
<AccountStatus className={styles.status} /> Account locked. For
publishing an asset you need to unlock your Web3 account.
publishing an asset you need to unlock your Web3 account.{' '}
<Button link onClick={states.startLogin}>
Unlock account
</Button>

View File

@ -1,66 +1,75 @@
//
// commons-server connection
//
export const serviceScheme = 'http'
export const serviceHost = 'localhost'
export const servicePort = 4000
export const serviceScheme = process.env.REACT_APP_SERVICE_SCHEME || 'http'
export const serviceHost = process.env.REACT_APP_SERVICE_HOST || 'localhost'
export const servicePort = process.env.REACT_APP_SERVICE_PORT || 4000
//
// OCEAN REMOTE CONNECTIONS
//
/*
export const nodeScheme = 'https'
export const nodeHost = 'nile.dev-ocean.com'
export const nodePort = 443
export const nodeScheme = process.env.REACT_APP_NODE_SCHEME || 'https'
export const nodeHost = process.env.REACT_APP_NODE_HOST || 'nile.dev-ocean.com'
export const nodePort = process.env.REACT_APP_NODE_PORT || 443
export const aquariusScheme = 'https'
export const aquariusHost = 'nginx-aquarius.dev-ocean.com'
export const aquariusPort = 443
export const aquariusScheme = process.env.REACT_APP_AQUARIUS_SCHEME || 'https'
export const aquariusHost =
process.env.REACT_APP_AQUARIUS_HOST || 'nginx-aquarius.dev-ocean.com'
export const aquariusPort = process.env.REACT_APP_AQUARIUS_PORT || 443
export const brizoScheme = 'https'
export const brizoHost = 'nginx-brizo.dev-ocean.com'
export const brizoPort = 443
export const brizoAddress = '0x376817c638d2a04f475a73af37f7b51a2862d567'
export const brizoScheme = process.env.REACT_APP_BRIZO_SCHEME || 'https'
export const brizoHost =
process.env.REACT_APP_BRIZO_HOST || 'nginx-brizo.dev-ocean.com'
export const brizoPort = process.env.REACT_APP_BRIZO_PORT || 443
export const brizoAddress =
process.env.REACT_APP_BRIZO_ADDRESS ||
'0x376817c638d2a04f475a73af37f7b51a2862d567'
export const parityScheme = 'https'
export const parityHost = 'nile.dev-ocean.com'
export const parityPort = 443
export const parityScheme = process.env.REACT_APP_PARITY_SCHEME || 'https'
export const parityHost =
process.env.REACT_APP_PARITY_HOST || 'nile.dev-ocean.com'
export const parityPort = process.env.REACT_APP_PARITY_PORT || 443
export const secretStoreScheme = 'https'
export const secretStoreHost = 'secret-store.dev-ocean.com'
export const secretStorePort = 443
export const secretStoreScheme =
process.env.REACT_APP_SECRET_STORE_SCHEME || 'https'
export const secretStoreHost =
process.env.REACT_APP_SECRET_STORE_HOST || 'secret-store.dev-ocean.com'
export const secretStorePort = process.env.REACT_APP_SECRET_STORE_PORT || 443
export const faucetScheme = process.env.REACT_APP_FAUCET_SCHEME || 'https'
export const faucetHost =
process.env.REACT_APP_FAUCET_HOST || 'faucet.nile.dev-ocean.com'
export const faucetPort = process.env.REACT_APP_FAUCET_PORT || 443
export const faucetScheme = 'https'
export const faucetHost = 'faucet.nile.dev-ocean.com'
export const faucetPort = 443
*/
//
// OCEAN LOCAL CONNECTIONS
// e.g. when running with barge
//
export const nodeScheme = 'http'
export const nodeHost = 'localhost'
export const nodePort = 8545
// export const nodeScheme = 'http'
// export const nodeHost = 'localhost'
// export const nodePort = 8545
export const aquariusScheme = 'http'
export const aquariusHost = 'aquarius'
export const aquariusPort = 5000
// export const aquariusScheme = 'http'
// export const aquariusHost = 'aquarius'
// export const aquariusPort = 5000
export const brizoScheme = 'http'
export const brizoHost = 'localhost'
export const brizoPort = 8030
export const brizoAddress = '0x00Bd138aBD70e2F00903268F3Db08f2D25677C9e'
// export const brizoScheme = 'http'
// export const brizoHost = 'localhost'
// export const brizoPort = 8030
export const parityScheme = 'http'
export const parityHost = 'localhost'
export const parityPort = 8545
// export const parityScheme = 'http'
// export const parityHost = 'localhost'
// export const parityPort = 8545
// export const threshold = 0
// export const password = 'node0'
// export const address = '0x00bd138abd70e2f00903268f3db08f2d25677c9e'
export const secretStoreScheme = 'http'
export const secretStoreHost = 'localhost'
export const secretStorePort = 12001
// export const secretStoreScheme = 'http'
// export const secretStoreHost = 'localhost'
// export const secretStorePort = 12001
export const faucetScheme = 'http'
export const faucetHost = 'localhost'
export const faucetPort = 3001
// export const faucetScheme = 'http'
// export const faucetHost = 'localhost'
// export const faucetPort = 3001
export const verbose = true
export const verbose = true

View File

@ -1,18 +1,15 @@
[
{
"title": "Publish",
"link": "/publish",
"web3": true
"link": "/publish"
},
{
"title": "History",
"link": "/history",
"web3": true
"link": "/history"
},
{
"title": "Faucet",
"link": "/faucet",
"web3": true
"link": "/faucet"
},
{
"title": "About",

View File

@ -1,4 +1,5 @@
import { Ocean } from '@oceanprotocol/squid'
import Web3 from 'web3'
import {
aquariusHost,
@ -20,7 +21,7 @@ import {
verbose
} from './config/config'
export async function provideOcean() {
export async function provideOcean(web3provider: Web3) {
const nodeUri = `${nodeScheme}://${nodeHost}:${nodePort}`
const aquariusUri = `${aquariusScheme}://${aquariusHost}:${aquariusPort}`
const brizoUri = `${brizoScheme}://${brizoHost}:${brizoPort}`
@ -28,6 +29,7 @@ export async function provideOcean() {
const secretStoreUri = `${secretStoreScheme}://${secretStoreHost}:${secretStorePort}`
const config = {
web3provider,
nodeUri,
aquariusUri,
brizoUri,
@ -37,7 +39,7 @@ export async function provideOcean() {
verbose
}
const ocean = await Ocean.getInstance(config)
const ocean: Ocean = await Ocean.getInstance(config)
return { ocean }
}

View File

@ -3,7 +3,35 @@ import Route from '../components/templates/Route'
class About extends Component {
public render() {
return <Route title="About">Hello About</Route>
return (
<Route
title="About"
description="A marketplace to find and publish open data sets in the Ocean Network."
>
<p>
Commons is built on top of the Ocean{' '}
<a href="https://docs.oceanprotocol.com/concepts/testnets/#the-nile-testnet">
Nile test network
</a>{' '}
and is targeted at enthusiastic data scientists with some
crypto experience. It can be used with any Web3-capable
browser, like Firefox with MetaMask installed.
</p>
<ul>
<li>
<a href="https://blog.oceanprotocol.com/the-commons-marketplace-c57a44288314">
Read the blog post
</a>
</li>
<li>
<a href="https://github.com/oceanprotocol/commons">
Check out oceanprotocol/commons on GitHub
</a>
</li>
</ul>
</Route>
)
}
}

View File

@ -31,7 +31,11 @@ export default class AssetDetails extends PureComponent<AssetDetailsProps> {
{base.copyrightHolder}
</h2>
<div className={styles.metaPrimaryData}>
<span title="Date created">
<span
title={`Date created, published on ${
base.datePublished
}`}
>
<Moment
date={base.dateCreated}
format="L"
@ -41,7 +45,7 @@ export default class AssetDetails extends PureComponent<AssetDetailsProps> {
{base.categories && (
// TODO: Make this link to search for respective category
<Link to={`/search?q=${base.categories[0]}`}>
<Link to={`/search?text=${base.categories[0]}`}>
{base.categories[0]}
</Link>
)}

View File

@ -1,9 +1,9 @@
import React, { PureComponent } from 'react'
import { Logger } from '@oceanprotocol/squid'
import filesize from 'filesize'
import { User } from '../../context/User'
import Button from '../../components/atoms/Button'
import Spinner from '../../components/atoms/Spinner'
import { User } from '../../context/User'
import styles from './AssetFile.module.scss'
import ReactGA from 'react-ga'
@ -92,13 +92,31 @@ export default class AssetFile extends PureComponent<
{this.state.isLoading ? (
<Spinner message={this.state.message} />
) : (
<Button
primary
className={styles.buttonMain}
onClick={() => this.purchaseAsset(ddo, file.index)}
>
Get file
</Button>
<User.Consumer>
{states =>
states.isLogged ? (
<Button
primary
className={styles.buttonMain}
onClick={() =>
this.purchaseAsset(ddo, file.index)
}
>
Get file
</Button>
) : (
states.isWeb3 && (
<Button
primary
className={styles.buttonMain}
onClick={states.startLogin}
>
Get file
</Button>
)
)
}
</User.Consumer>
)}
{this.state.error !== '' && (

View File

@ -1,5 +1,7 @@
import React, { PureComponent } from 'react'
import AssetFile from './AssetFile'
import { User } from '../../context/User'
import Web3message from '../../components/organisms/Web3message'
import styles from './AssetFilesDetails.module.scss'
export default class AssetFilesDetails extends PureComponent<{
@ -16,6 +18,11 @@ export default class AssetFilesDetails extends PureComponent<{
<AssetFile key={file.index} ddo={ddo} file={file} />
))}
</div>
<User.Consumer>
{states =>
(!states.isNile || !states.isLogged) && <Web3message />
}
</User.Consumer>
</>
) : (
<div>No files attached.</div>

View File

@ -5,16 +5,16 @@ import { User } from '../../context/User'
import AssetDetails from './AssetDetails'
import stylesApp from '../../App.module.scss'
interface DetailsProps {
location: Location
match: any
}
interface DetailsState {
ddo: any
metadata: { base: { name: string } }
}
interface DetailsProps {
location: any
match: any
}
export default class Details extends Component<DetailsProps, DetailsState> {
public state = { ddo: {}, metadata: { base: { name: '' } } }

View File

@ -10,15 +10,13 @@ interface FaucetState {
isLoading: boolean
success?: string
error?: string
eth?: string
}
export default class Faucet extends PureComponent<{}, FaucetState> {
public state = {
isLoading: false,
success: undefined,
error: undefined,
eth: 'xx'
error: undefined
}
private getTokens = async (requestFromFaucet: () => any) => {
@ -47,14 +45,20 @@ export default class Faucet extends PureComponent<{}, FaucetState> {
private RequestMarkup = () => (
<User.Consumer>
{states => (
<Button
primary
onClick={() => this.getTokens(states.requestFromFaucet)}
>
Request Ether
</Button>
)}
{states =>
states.isLogged ? (
<Button
primary
onClick={() => this.getTokens(states.requestFromFaucet)}
>
Request Ether
</Button>
) : states.isWeb3 ? (
<Web3message />
) : (
<Web3message />
)
}
</User.Consumer>
)
@ -93,7 +97,9 @@ export default class Faucet extends PureComponent<{}, FaucetState> {
title="Faucet"
description="Shower yourself with some Ether for the Ocean POA network."
>
<Web3message />
<User.Consumer>
{states => !states.isNile && <Web3message />}
</User.Consumer>
<this.ActionMarkup />
</Route>

View File

@ -8,14 +8,14 @@ import styles from './Home.module.scss'
import meta from '../data/meta.json'
interface HomeState {
search?: string
}
interface HomeProps {
history: any
}
interface HomeState {
search?: string
}
class Home extends Component<HomeProps, HomeState> {
public state = { search: '' }

View File

@ -158,9 +158,21 @@ export default class Step extends PureComponent<StepProps, {}> {
{states =>
states.isLogged ? (
<Button primary>Register asset</Button>
) : (
) : states.isWeb3 ? (
<Button onClick={states.startLogin}>
Register asset (login first)
Register asset (unlock Metamask)
</Button>
) : (
<Button
onClick={(e: Event) => {
e.preventDefault()
window.open(
'https://docs.oceanprotocol.com/tutorials/metamask-setup/',
'_blank'
)
}}
>
Register asset (install Metamask)
</Button>
)
}

View File

@ -1,67 +1,107 @@
import React, { Component } from 'react'
import React, { PureComponent } from 'react'
import queryString from 'query-string'
import { Logger } from '@oceanprotocol/squid'
import Spinner from '../components/atoms/Spinner'
import Route from '../components/templates/Route'
import { User } from '../context/User'
import Asset from '../components/molecules/Asset'
import Pagination from '../components/molecules/Pagination'
import styles from './Search.module.scss'
interface SearchProps {
location: Location
history: History
}
interface SearchState {
results: any[]
totalResults: number
offset: number
totalPages: number
currentPage: number
isLoading: boolean
}
interface SearchProps {
location: any
history: any
}
export default class Search extends PureComponent<SearchProps, SearchState> {
public state = {
results: [],
totalResults: 0,
offset: 25,
totalPages: 1,
currentPage: 1,
isLoading: true
}
export default class Search extends Component<SearchProps, SearchState> {
public state = { results: [], isLoading: true }
private readonly searchTerm = queryString.parse(this.props.location.search)
.text
public async componentDidMount() {
const searchParams = queryString.parse(this.props.location.search)
public componentDidMount() {
this.searchAssets()
}
const queryRequest = {
offset: 500,
page: 1,
private searchAssets = async () => {
const searchQuery = {
offset: this.state.offset,
page: this.state.currentPage,
query: {
text: searchParams.text
text: [this.searchTerm],
price: [-1, 1]
},
sort: {
text: 1
datePublished: 1
}
}
const assets = await this.context.ocean.assets.search(searchParams.text)
this.setState({ results: assets, isLoading: false })
Logger.log(`Loaded ${assets.length} assets`)
const search = await this.context.ocean.aquarius.queryMetadata(
searchQuery
)
this.setState({
results: search.results,
totalResults: search.totalResults,
totalPages: search.totalPages,
currentPage: search.page + 1, // first page is always 0 in response
isLoading: false
})
Logger.log(`Loaded ${this.state.results.length} assets`)
}
private setPage = (page: number) => {
this.setState({ currentPage: page })
this.searchAssets()
}
public renderResults = () =>
this.state.isLoading ? (
<Spinner message="Searching..." />
) : this.state.results.length ? (
) : this.state.results && this.state.results.length ? (
<div className={styles.results}>
{this.state.results.map((asset: any) => (
<Asset key={asset.id} asset={asset} />
))}
</div>
) : (
<div>No data sets yet</div>
<div>No data sets found.</div>
)
public render() {
const searchTerm = queryString.parse(this.props.location.search).text
const { totalResults, totalPages, currentPage } = this.state
return (
<Route
title={`Search Results for <span>${searchTerm}</span>`}
title={`${totalResults > 0 && totalResults} Results for <span>${
this.searchTerm
}</span>`}
titleReverse
wide
>
{this.renderResults()}
<Pagination
totalPages={totalPages}
currentPage={currentPage}
prevPage={currentPage - 1}
setPage={this.setPage}
/>
</Route>
)
}

View File

@ -7,19 +7,19 @@
"dependencies": [
{
"name": "keeper-contracts",
"version": "~0.6.12"
"version": "~0.9.1"
},
{
"name": "brizo",
"version": "~0.2.0"
"version": "~0.3.3"
},
{
"name": "aquarius",
"version": "~0.1.8"
"version": "~0.2.1"
},
{
"name": "squid-js",
"version": "~0.3.0"
"version": "~0.5.2"
}
]
}

827
server/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -34,16 +34,16 @@
"@types/jasmine": "^3.3.12",
"@types/jest": "^24.0.11",
"@types/morgan": "^1.7.35",
"@types/node": "^11.12.2",
"@types/node": "^11.13.0",
"@types/request": "^2.48.1",
"chai": "^4.2.0",
"jest": "^24.5.0",
"mocha": "^6.0.2",
"jest": "^24.7.1",
"mocha": "^6.1.1",
"nodemon": "^1.18.10",
"supertest": "^4.0.2",
"ts-jest": "^24.0.1",
"ts-jest": "^24.0.2",
"ts-node": "^8.0.3",
"typescript": "^3.4.1"
"typescript": "^3.4.2"
},
"repository": {
"type": "git",

View File

@ -22,7 +22,10 @@ export class UrlCheckRouter {
headers: { Range: 'bytes=0-' }
},
(error, response) => {
if (response && response.statusCode.toString().startsWith('2')) {
if (
response &&
response.statusCode.toString().startsWith('2')
) {
const result: any = {}
result.found = true