1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-12-02 05:57:29 +01:00

merge v4-c2d into compute-jobs

This commit is contained in:
Bogdan Fazakas 2022-03-30 14:58:20 +03:00
commit 72c7cc9f00
53 changed files with 448 additions and 440 deletions

View File

@ -1,9 +1,8 @@
{ {
"siteTitle": "Ocean Market", "siteTitle": "Ocean Market",
"siteTagline": "A marketplace to find, publish and trade data sets in the Ocean Network.", "siteTagline": "A marketplace to find, publish and trade data sets in the Ocean Network.",
"siteUrl": "https://market.oceanprotocol.com", "siteUrl": "https://v4.market.oceanprotocol.com",
"siteIcon": "node_modules/@oceanprotocol/art/logo/favicon-white.png", "siteImage": "/share.png",
"siteImage": "../src/@images/share.png",
"copyright": "All Rights Reserved. Powered by [Ocean Protocol](https://oceanprotocol.com)", "copyright": "All Rights Reserved. Powered by [Ocean Protocol](https://oceanprotocol.com)",
"menu": [ "menu": [
{ {

302
package-lock.json generated
View File

@ -17,7 +17,8 @@
"@oceanprotocol/typographies": "^0.1.0", "@oceanprotocol/typographies": "^0.1.0",
"@portis/web3": "^4.0.7", "@portis/web3": "^4.0.7",
"@tippyjs/react": "^4.2.6", "@tippyjs/react": "^4.2.6",
"@walletconnect/web3-provider": "^1.7.5", "@urql/exchange-refocus": "^0.2.5",
"@walletconnect/web3-provider": "^1.7.6",
"axios": "^0.26.1", "axios": "^0.26.1",
"bignumber.js": "^9.0.2", "bignumber.js": "^9.0.2",
"chart.js": "^3.7.1", "chart.js": "^3.7.1",
@ -3975,9 +3976,9 @@
} }
}, },
"node_modules/@oclif/plugin-help/node_modules/wrap-ansi/node_modules/ansi-regex": { "node_modules/@oclif/plugin-help/node_modules/wrap-ansi/node_modules/ansi-regex": {
"version": "3.0.0", "version": "3.0.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz",
"integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==",
"dev": true, "dev": true,
"engines": { "engines": {
"node": ">=4" "node": ">=4"
@ -5005,9 +5006,9 @@
"integrity": "sha512-o7nBlaMuasuADCCL2WzhvOXA5GT5ewd/F35cY6ZU69U5OUASR3ZP4CZetVCc5MZePPa/3CL9pzJ4Rhtg1ChwVA==" "integrity": "sha512-o7nBlaMuasuADCCL2WzhvOXA5GT5ewd/F35cY6ZU69U5OUASR3ZP4CZetVCc5MZePPa/3CL9pzJ4Rhtg1ChwVA=="
}, },
"node_modules/@truffle/codec": { "node_modules/@truffle/codec": {
"version": "0.12.3", "version": "0.12.4",
"resolved": "https://registry.npmjs.org/@truffle/codec/-/codec-0.12.3.tgz", "resolved": "https://registry.npmjs.org/@truffle/codec/-/codec-0.12.4.tgz",
"integrity": "sha512-szDlA5KmTwFDL6yjB0i9bwz48nxObbxAwL6MERJRLrs7yQu/3jTtTW3cfw9owtsfqu7DzX4TXAPLp0eYb4PPUQ==", "integrity": "sha512-8XCKMAP22fEVa8xGFA9lqBr5kWhyYW/41ekP0yFEXQhCSPEcZamc6I9h2KQGBrChdxGsKd82Y4138rHGKiQtjQ==",
"dependencies": { "dependencies": {
"@truffle/abi-utils": "^0.2.10", "@truffle/abi-utils": "^0.2.10",
"@truffle/compile-common": "^0.7.29", "@truffle/compile-common": "^0.7.29",
@ -5451,11 +5452,11 @@
} }
}, },
"node_modules/@truffle/debug-utils": { "node_modules/@truffle/debug-utils": {
"version": "6.0.13", "version": "6.0.14",
"resolved": "https://registry.npmjs.org/@truffle/debug-utils/-/debug-utils-6.0.13.tgz", "resolved": "https://registry.npmjs.org/@truffle/debug-utils/-/debug-utils-6.0.14.tgz",
"integrity": "sha512-8BZ82FqOpnfzs2IvfYOgTzthQ0e8yO1Zm86CO4vPlrbTVI0bSemCFevau0QzR5bPXVg558MHpDOhZHmZN6yU1w==", "integrity": "sha512-LhtoKI86QzLFbb0dOQojNR1jl8Le0GL/fkhkaK/thdxMtkt5F7BVoO0f0CbnC9+vfp7qbgEcRct1suw38sVVGQ==",
"dependencies": { "dependencies": {
"@truffle/codec": "^0.12.3", "@truffle/codec": "^0.12.4",
"@trufflesuite/chromafi": "^3.0.0", "@trufflesuite/chromafi": "^3.0.0",
"bn.js": "^5.1.3", "bn.js": "^5.1.3",
"chalk": "^2.4.2", "chalk": "^2.4.2",
@ -6736,6 +6737,18 @@
"graphql": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0" "graphql": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0"
} }
}, },
"node_modules/@urql/exchange-refocus": {
"version": "0.2.5",
"resolved": "https://registry.npmjs.org/@urql/exchange-refocus/-/exchange-refocus-0.2.5.tgz",
"integrity": "sha512-JlrEXlG37mK/WgyxqVrHkLZtBMVC7x3GtgGJHiiXK41AQdU2hVy3IAQ208ENMIrkFw9SHQf8d8h7Wb2EY/1zdw==",
"dependencies": {
"@urql/core": ">=2.3.6",
"wonka": "^4.0.14"
},
"peerDependencies": {
"graphql": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0"
}
},
"node_modules/@use-it/event-listener": { "node_modules/@use-it/event-listener": {
"version": "0.1.7", "version": "0.1.7",
"resolved": "https://registry.npmjs.org/@use-it/event-listener/-/event-listener-0.1.7.tgz", "resolved": "https://registry.npmjs.org/@use-it/event-listener/-/event-listener-0.1.7.tgz",
@ -6745,36 +6758,36 @@
} }
}, },
"node_modules/@walletconnect/browser-utils": { "node_modules/@walletconnect/browser-utils": {
"version": "1.7.5", "version": "1.7.6",
"resolved": "https://registry.npmjs.org/@walletconnect/browser-utils/-/browser-utils-1.7.5.tgz", "resolved": "https://registry.npmjs.org/@walletconnect/browser-utils/-/browser-utils-1.7.6.tgz",
"integrity": "sha512-gm9ufi0n5cGBXoGWDtMVSqIJ0eXYW+ZFuTNVN0fm4oal26J7cPrOdFjzhv5zvx5fKztWQ21DNFZ+PRXBjXg04Q==", "integrity": "sha512-7dZkvybjxIt59YdGqMCft8ydghlR7axSzZVW3Oy6NOYdq0ztZGCV/hpUcQ3pgC3uhpn93XqVPrBAyKLqt+/u5A==",
"dependencies": { "dependencies": {
"@walletconnect/safe-json": "1.0.0", "@walletconnect/safe-json": "1.0.0",
"@walletconnect/types": "^1.7.5", "@walletconnect/types": "^1.7.6",
"@walletconnect/window-getters": "1.0.0", "@walletconnect/window-getters": "1.0.0",
"@walletconnect/window-metadata": "1.0.0", "@walletconnect/window-metadata": "1.0.0",
"detect-browser": "5.2.0" "detect-browser": "5.2.0"
} }
}, },
"node_modules/@walletconnect/client": { "node_modules/@walletconnect/client": {
"version": "1.7.5", "version": "1.7.6",
"resolved": "https://registry.npmjs.org/@walletconnect/client/-/client-1.7.5.tgz", "resolved": "https://registry.npmjs.org/@walletconnect/client/-/client-1.7.6.tgz",
"integrity": "sha512-Vh3h1kfhmJ4Jx//H0lmmfDc5Q2s+R73Nh5cetVN41QPRrAcqHE4lR2ZS8XxRCNBl4/gcHZJIZS9J2Ui4tTXBLA==", "integrity": "sha512-ZAcH9aL+p3psXwcsts51liKiqS/Kez05bYM193QC7mfcGwlFhQWMCRWHb38y8yHrWQMUmtOZ+jKotKjrOitDUw==",
"dependencies": { "dependencies": {
"@walletconnect/core": "^1.7.5", "@walletconnect/core": "^1.7.6",
"@walletconnect/iso-crypto": "^1.7.5", "@walletconnect/iso-crypto": "^1.7.6",
"@walletconnect/types": "^1.7.5", "@walletconnect/types": "^1.7.6",
"@walletconnect/utils": "^1.7.5" "@walletconnect/utils": "^1.7.6"
} }
}, },
"node_modules/@walletconnect/core": { "node_modules/@walletconnect/core": {
"version": "1.7.5", "version": "1.7.6",
"resolved": "https://registry.npmjs.org/@walletconnect/core/-/core-1.7.5.tgz", "resolved": "https://registry.npmjs.org/@walletconnect/core/-/core-1.7.6.tgz",
"integrity": "sha512-c4B8s9fZ/Ah2p460Hxo4e9pwLQVYT2+dVYAfqaxVzfYjhAokDEtO55Bdm1hujtRjQVqwTvCljKxBB+LgMp3k8w==", "integrity": "sha512-gWD80GTgJ/xpYbJ/R5sbto1daDcDqeHl3ODzdtaVbDR2whS16spsEsXxgsM6BXFKqbGJ0r90SkHsNHa8xiekLQ==",
"dependencies": { "dependencies": {
"@walletconnect/socket-transport": "^1.7.5", "@walletconnect/socket-transport": "^1.7.6",
"@walletconnect/types": "^1.7.5", "@walletconnect/types": "^1.7.6",
"@walletconnect/utils": "^1.7.5" "@walletconnect/utils": "^1.7.6"
} }
}, },
"node_modules/@walletconnect/crypto": { "node_modules/@walletconnect/crypto": {
@ -6804,24 +6817,24 @@
"integrity": "sha512-4BwqyWy6KpSvkocSaV7WR3BlZfrxLbJSLkg+j7Gl6pTDE+U55lLhJvQaMuDVazXYxcjBsG09k7UlH7cGiUI5vQ==" "integrity": "sha512-4BwqyWy6KpSvkocSaV7WR3BlZfrxLbJSLkg+j7Gl6pTDE+U55lLhJvQaMuDVazXYxcjBsG09k7UlH7cGiUI5vQ=="
}, },
"node_modules/@walletconnect/http-connection": { "node_modules/@walletconnect/http-connection": {
"version": "1.7.5", "version": "1.7.6",
"resolved": "https://registry.npmjs.org/@walletconnect/http-connection/-/http-connection-1.7.5.tgz", "resolved": "https://registry.npmjs.org/@walletconnect/http-connection/-/http-connection-1.7.6.tgz",
"integrity": "sha512-WDy2Y/07c1F107362jel0voeV6QMJuWbwAKNLtxlX8Y9KNzqZAGlHhIZykSWrMjNGwxBaXoqLPmu60uVvodc6A==", "integrity": "sha512-G2xgqALcy2naHeiFS1N3VEwsgqIbFrbBv9gYaHE3R6RuEb4VVSIVGy6brpN+CoLmI680Kj2EmiJG7yvpNsHKdg==",
"dependencies": { "dependencies": {
"@walletconnect/types": "^1.7.5", "@walletconnect/types": "^1.7.6",
"@walletconnect/utils": "^1.7.5", "@walletconnect/utils": "^1.7.6",
"eventemitter3": "4.0.7", "eventemitter3": "4.0.7",
"xhr2-cookies": "1.1.0" "xhr2-cookies": "1.1.0"
} }
}, },
"node_modules/@walletconnect/iso-crypto": { "node_modules/@walletconnect/iso-crypto": {
"version": "1.7.5", "version": "1.7.6",
"resolved": "https://registry.npmjs.org/@walletconnect/iso-crypto/-/iso-crypto-1.7.5.tgz", "resolved": "https://registry.npmjs.org/@walletconnect/iso-crypto/-/iso-crypto-1.7.6.tgz",
"integrity": "sha512-mJdRs2SqAPOLBBqLhU+ZnAh2c8TL2uDuL/ojV4aBzZ0ZHNT7X2zSOjAiixCb3vvH8GAt30OKmiRo3+ChI/9zvA==", "integrity": "sha512-x80OVfarjPzD02kJgnpmLCxlsFRaymGjlGWzLmtwO8/hp1mrtT/ukFOsl1Fs6Tunp7BdCoJT+9FYFarcvbsG8Q==",
"dependencies": { "dependencies": {
"@walletconnect/crypto": "^1.0.2", "@walletconnect/crypto": "^1.0.2",
"@walletconnect/types": "^1.7.5", "@walletconnect/types": "^1.7.6",
"@walletconnect/utils": "^1.7.5" "@walletconnect/utils": "^1.7.6"
} }
}, },
"node_modules/@walletconnect/jsonrpc-types": { "node_modules/@walletconnect/jsonrpc-types": {
@ -6848,13 +6861,13 @@
"deprecated": "Deprecated in favor of dynamic registry available from: https://github.com/walletconnect/walletconnect-registry" "deprecated": "Deprecated in favor of dynamic registry available from: https://github.com/walletconnect/walletconnect-registry"
}, },
"node_modules/@walletconnect/qrcode-modal": { "node_modules/@walletconnect/qrcode-modal": {
"version": "1.7.5", "version": "1.7.6",
"resolved": "https://registry.npmjs.org/@walletconnect/qrcode-modal/-/qrcode-modal-1.7.5.tgz", "resolved": "https://registry.npmjs.org/@walletconnect/qrcode-modal/-/qrcode-modal-1.7.6.tgz",
"integrity": "sha512-LVq35jc3VMGq1EMcGCObQtEiercMDmUHDnc7A3AmUo0LoAbaPo6c8Hq0zqy2+JhtLmxUhU3ktf+szmCoiUDTUQ==", "integrity": "sha512-SXx8eTllgyGpArwdB8v1WsmAKbxiizqebJLn32C6KRzWVW5FP4FizzgEi+r6xINWSEpWLX72GbeWAoiQDwFVFw==",
"dependencies": { "dependencies": {
"@walletconnect/browser-utils": "^1.7.5", "@walletconnect/browser-utils": "^1.7.6",
"@walletconnect/mobile-registry": "^1.4.0", "@walletconnect/mobile-registry": "^1.4.0",
"@walletconnect/types": "^1.7.5", "@walletconnect/types": "^1.7.6",
"copy-to-clipboard": "^3.3.1", "copy-to-clipboard": "^3.3.1",
"preact": "10.4.1", "preact": "10.4.1",
"qrcode": "1.4.4" "qrcode": "1.4.4"
@ -6876,29 +6889,29 @@
"integrity": "sha512-QJzp/S/86sUAgWY6eh5MKYmSfZaRpIlmCJdi5uG4DJlKkZrHEF7ye7gA+VtbVzvTtpM/gRwO2plQuiooIeXjfg==" "integrity": "sha512-QJzp/S/86sUAgWY6eh5MKYmSfZaRpIlmCJdi5uG4DJlKkZrHEF7ye7gA+VtbVzvTtpM/gRwO2plQuiooIeXjfg=="
}, },
"node_modules/@walletconnect/socket-transport": { "node_modules/@walletconnect/socket-transport": {
"version": "1.7.5", "version": "1.7.6",
"resolved": "https://registry.npmjs.org/@walletconnect/socket-transport/-/socket-transport-1.7.5.tgz", "resolved": "https://registry.npmjs.org/@walletconnect/socket-transport/-/socket-transport-1.7.6.tgz",
"integrity": "sha512-4TYCxrNWb4f5a1NGsALXidr+/6dOiqgVfUQJ4fdP6R7ijL+7jtdiktguU9FIDq5wFXRE+ZdpCpwSAfOt60q/mQ==", "integrity": "sha512-yH2eKD9P34gnOxOfCarERROl5SkiwBR9UcASjcnp2L7r02ZaXHbhheXHUWzcU5HpEXrvz8DGciE7GBQn+aNgQg==",
"dependencies": { "dependencies": {
"@walletconnect/types": "^1.7.5", "@walletconnect/types": "^1.7.6",
"@walletconnect/utils": "^1.7.5", "@walletconnect/utils": "^1.7.6",
"ws": "7.5.3" "ws": "7.5.3"
} }
}, },
"node_modules/@walletconnect/types": { "node_modules/@walletconnect/types": {
"version": "1.7.5", "version": "1.7.6",
"resolved": "https://registry.npmjs.org/@walletconnect/types/-/types-1.7.5.tgz", "resolved": "https://registry.npmjs.org/@walletconnect/types/-/types-1.7.6.tgz",
"integrity": "sha512-0HvZzxD93et4DdrYgAvclI1BqclkZS7iPWRtbGg3r+PQhRPbOkNypzBy6XH6wflbmr+WBGdmyJvynHsdhcCqUA==" "integrity": "sha512-3JVjEzvJgDc5DzaXNxhg4JcdG4U8Qk6HVBELOu+TwiWG31TZRt82uL9CcVZKieFPP/nTWQnj+QkiKSpO7T1KTQ=="
}, },
"node_modules/@walletconnect/utils": { "node_modules/@walletconnect/utils": {
"version": "1.7.5", "version": "1.7.6",
"resolved": "https://registry.npmjs.org/@walletconnect/utils/-/utils-1.7.5.tgz", "resolved": "https://registry.npmjs.org/@walletconnect/utils/-/utils-1.7.6.tgz",
"integrity": "sha512-U954rIIA/g/Cmdqy+n3hMY1DDMmXxGs8w/QmrK9b/H5nkQ3e4QicOyynq5g/JTTesN5HZdDTFiyX9r0GSKa+iA==", "integrity": "sha512-GLneac0Hx52pNHAOkTt/07K+Ht8LmWFaK0nQlHqrLmOJm8WZPnUvMZGMTpSOzgKw47u0cjhE38ipbXOaq8qReA==",
"dependencies": { "dependencies": {
"@walletconnect/browser-utils": "^1.7.5", "@walletconnect/browser-utils": "^1.7.6",
"@walletconnect/encoding": "^1.0.1", "@walletconnect/encoding": "^1.0.1",
"@walletconnect/jsonrpc-utils": "^1.0.0", "@walletconnect/jsonrpc-utils": "^1.0.0",
"@walletconnect/types": "^1.7.5", "@walletconnect/types": "^1.7.6",
"bn.js": "4.11.8", "bn.js": "4.11.8",
"js-sha3": "0.8.0", "js-sha3": "0.8.0",
"query-string": "6.13.5" "query-string": "6.13.5"
@ -6926,15 +6939,15 @@
} }
}, },
"node_modules/@walletconnect/web3-provider": { "node_modules/@walletconnect/web3-provider": {
"version": "1.7.5", "version": "1.7.6",
"resolved": "https://registry.npmjs.org/@walletconnect/web3-provider/-/web3-provider-1.7.5.tgz", "resolved": "https://registry.npmjs.org/@walletconnect/web3-provider/-/web3-provider-1.7.6.tgz",
"integrity": "sha512-x+UWOTu7jd9qog9NWhaspOmVRDJPnQrgZBscnaSC+x/aAsi52VUrd1GZ9c5UNZFgss41fdx3Z2KhkPeVrlrbuQ==", "integrity": "sha512-INjHVTuuISm9rk9QGr8v0IvcmjygEyt+rDB6Iw6G5hK+qwEB+UlrRbXyu0bAmEe4wREpiJmegz7KjiHIxmCTNA==",
"dependencies": { "dependencies": {
"@walletconnect/client": "^1.7.5", "@walletconnect/client": "^1.7.6",
"@walletconnect/http-connection": "^1.7.5", "@walletconnect/http-connection": "^1.7.6",
"@walletconnect/qrcode-modal": "^1.7.5", "@walletconnect/qrcode-modal": "^1.7.6",
"@walletconnect/types": "^1.7.5", "@walletconnect/types": "^1.7.6",
"@walletconnect/utils": "^1.7.5", "@walletconnect/utils": "^1.7.6",
"web3-provider-engine": "16.0.1" "web3-provider-engine": "16.0.1"
} }
}, },
@ -7129,9 +7142,9 @@
} }
}, },
"node_modules/ansi-regex": { "node_modules/ansi-regex": {
"version": "3.0.0", "version": "3.0.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz",
"integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==",
"engines": { "engines": {
"node": ">=4" "node": ">=4"
} }
@ -17422,9 +17435,9 @@
} }
}, },
"node_modules/minimist": { "node_modules/minimist": {
"version": "1.2.5", "version": "1.2.6",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz",
"integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q=="
}, },
"node_modules/minipass": { "node_modules/minipass": {
"version": "2.9.0", "version": "2.9.0",
@ -26715,6 +26728,7 @@
"cross-fetch": "^3.1.5", "cross-fetch": "^3.1.5",
"crypto-js": "^4.1.1", "crypto-js": "^4.1.1",
"decimal.js": "^10.3.1", "decimal.js": "^10.3.1",
"web3": "^1.7.1",
"web3-core": "^1.7.1", "web3-core": "^1.7.1",
"web3-eth-contract": "^1.7.1" "web3-eth-contract": "^1.7.1"
} }
@ -26817,6 +26831,7 @@
"integrity": "sha512-5vwpq6kbvwkQwKqAoOU3L72GZ3Ta8RRrewKj9OJRolx28KLJJ8Dg9Rf7obRwt5jQA9bkYd8gqzMTrI7H3xLfaw==", "integrity": "sha512-5vwpq6kbvwkQwKqAoOU3L72GZ3Ta8RRrewKj9OJRolx28KLJJ8Dg9Rf7obRwt5jQA9bkYd8gqzMTrI7H3xLfaw==",
"dev": true, "dev": true,
"requires": { "requires": {
"@oclif/config": "^1.15.1",
"@oclif/errors": "^1.3.3", "@oclif/errors": "^1.3.3",
"@oclif/parser": "^3.8.3", "@oclif/parser": "^3.8.3",
"@oclif/plugin-help": "^3", "@oclif/plugin-help": "^3",
@ -27144,9 +27159,9 @@
}, },
"dependencies": { "dependencies": {
"ansi-regex": { "ansi-regex": {
"version": "3.0.0", "version": "3.0.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz",
"integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==",
"dev": true "dev": true
}, },
"string-width": { "string-width": {
@ -27905,9 +27920,9 @@
"integrity": "sha512-o7nBlaMuasuADCCL2WzhvOXA5GT5ewd/F35cY6ZU69U5OUASR3ZP4CZetVCc5MZePPa/3CL9pzJ4Rhtg1ChwVA==" "integrity": "sha512-o7nBlaMuasuADCCL2WzhvOXA5GT5ewd/F35cY6ZU69U5OUASR3ZP4CZetVCc5MZePPa/3CL9pzJ4Rhtg1ChwVA=="
}, },
"@truffle/codec": { "@truffle/codec": {
"version": "0.12.3", "version": "0.12.4",
"resolved": "https://registry.npmjs.org/@truffle/codec/-/codec-0.12.3.tgz", "resolved": "https://registry.npmjs.org/@truffle/codec/-/codec-0.12.4.tgz",
"integrity": "sha512-szDlA5KmTwFDL6yjB0i9bwz48nxObbxAwL6MERJRLrs7yQu/3jTtTW3cfw9owtsfqu7DzX4TXAPLp0eYb4PPUQ==", "integrity": "sha512-8XCKMAP22fEVa8xGFA9lqBr5kWhyYW/41ekP0yFEXQhCSPEcZamc6I9h2KQGBrChdxGsKd82Y4138rHGKiQtjQ==",
"requires": { "requires": {
"@truffle/abi-utils": "^0.2.10", "@truffle/abi-utils": "^0.2.10",
"@truffle/compile-common": "^0.7.29", "@truffle/compile-common": "^0.7.29",
@ -28281,11 +28296,11 @@
} }
}, },
"@truffle/debug-utils": { "@truffle/debug-utils": {
"version": "6.0.13", "version": "6.0.14",
"resolved": "https://registry.npmjs.org/@truffle/debug-utils/-/debug-utils-6.0.13.tgz", "resolved": "https://registry.npmjs.org/@truffle/debug-utils/-/debug-utils-6.0.14.tgz",
"integrity": "sha512-8BZ82FqOpnfzs2IvfYOgTzthQ0e8yO1Zm86CO4vPlrbTVI0bSemCFevau0QzR5bPXVg558MHpDOhZHmZN6yU1w==", "integrity": "sha512-LhtoKI86QzLFbb0dOQojNR1jl8Le0GL/fkhkaK/thdxMtkt5F7BVoO0f0CbnC9+vfp7qbgEcRct1suw38sVVGQ==",
"requires": { "requires": {
"@truffle/codec": "^0.12.3", "@truffle/codec": "^0.12.4",
"@trufflesuite/chromafi": "^3.0.0", "@trufflesuite/chromafi": "^3.0.0",
"bn.js": "^5.1.3", "bn.js": "^5.1.3",
"chalk": "^2.4.2", "chalk": "^2.4.2",
@ -29398,6 +29413,15 @@
"wonka": "^4.0.14" "wonka": "^4.0.14"
} }
}, },
"@urql/exchange-refocus": {
"version": "0.2.5",
"resolved": "https://registry.npmjs.org/@urql/exchange-refocus/-/exchange-refocus-0.2.5.tgz",
"integrity": "sha512-JlrEXlG37mK/WgyxqVrHkLZtBMVC7x3GtgGJHiiXK41AQdU2hVy3IAQ208ENMIrkFw9SHQf8d8h7Wb2EY/1zdw==",
"requires": {
"@urql/core": ">=2.3.6",
"wonka": "^4.0.14"
}
},
"@use-it/event-listener": { "@use-it/event-listener": {
"version": "0.1.7", "version": "0.1.7",
"resolved": "https://registry.npmjs.org/@use-it/event-listener/-/event-listener-0.1.7.tgz", "resolved": "https://registry.npmjs.org/@use-it/event-listener/-/event-listener-0.1.7.tgz",
@ -29405,36 +29429,36 @@
"requires": {} "requires": {}
}, },
"@walletconnect/browser-utils": { "@walletconnect/browser-utils": {
"version": "1.7.5", "version": "1.7.6",
"resolved": "https://registry.npmjs.org/@walletconnect/browser-utils/-/browser-utils-1.7.5.tgz", "resolved": "https://registry.npmjs.org/@walletconnect/browser-utils/-/browser-utils-1.7.6.tgz",
"integrity": "sha512-gm9ufi0n5cGBXoGWDtMVSqIJ0eXYW+ZFuTNVN0fm4oal26J7cPrOdFjzhv5zvx5fKztWQ21DNFZ+PRXBjXg04Q==", "integrity": "sha512-7dZkvybjxIt59YdGqMCft8ydghlR7axSzZVW3Oy6NOYdq0ztZGCV/hpUcQ3pgC3uhpn93XqVPrBAyKLqt+/u5A==",
"requires": { "requires": {
"@walletconnect/safe-json": "1.0.0", "@walletconnect/safe-json": "1.0.0",
"@walletconnect/types": "^1.7.5", "@walletconnect/types": "^1.7.6",
"@walletconnect/window-getters": "1.0.0", "@walletconnect/window-getters": "1.0.0",
"@walletconnect/window-metadata": "1.0.0", "@walletconnect/window-metadata": "1.0.0",
"detect-browser": "5.2.0" "detect-browser": "5.2.0"
} }
}, },
"@walletconnect/client": { "@walletconnect/client": {
"version": "1.7.5", "version": "1.7.6",
"resolved": "https://registry.npmjs.org/@walletconnect/client/-/client-1.7.5.tgz", "resolved": "https://registry.npmjs.org/@walletconnect/client/-/client-1.7.6.tgz",
"integrity": "sha512-Vh3h1kfhmJ4Jx//H0lmmfDc5Q2s+R73Nh5cetVN41QPRrAcqHE4lR2ZS8XxRCNBl4/gcHZJIZS9J2Ui4tTXBLA==", "integrity": "sha512-ZAcH9aL+p3psXwcsts51liKiqS/Kez05bYM193QC7mfcGwlFhQWMCRWHb38y8yHrWQMUmtOZ+jKotKjrOitDUw==",
"requires": { "requires": {
"@walletconnect/core": "^1.7.5", "@walletconnect/core": "^1.7.6",
"@walletconnect/iso-crypto": "^1.7.5", "@walletconnect/iso-crypto": "^1.7.6",
"@walletconnect/types": "^1.7.5", "@walletconnect/types": "^1.7.6",
"@walletconnect/utils": "^1.7.5" "@walletconnect/utils": "^1.7.6"
} }
}, },
"@walletconnect/core": { "@walletconnect/core": {
"version": "1.7.5", "version": "1.7.6",
"resolved": "https://registry.npmjs.org/@walletconnect/core/-/core-1.7.5.tgz", "resolved": "https://registry.npmjs.org/@walletconnect/core/-/core-1.7.6.tgz",
"integrity": "sha512-c4B8s9fZ/Ah2p460Hxo4e9pwLQVYT2+dVYAfqaxVzfYjhAokDEtO55Bdm1hujtRjQVqwTvCljKxBB+LgMp3k8w==", "integrity": "sha512-gWD80GTgJ/xpYbJ/R5sbto1daDcDqeHl3ODzdtaVbDR2whS16spsEsXxgsM6BXFKqbGJ0r90SkHsNHa8xiekLQ==",
"requires": { "requires": {
"@walletconnect/socket-transport": "^1.7.5", "@walletconnect/socket-transport": "^1.7.6",
"@walletconnect/types": "^1.7.5", "@walletconnect/types": "^1.7.6",
"@walletconnect/utils": "^1.7.5" "@walletconnect/utils": "^1.7.6"
} }
}, },
"@walletconnect/crypto": { "@walletconnect/crypto": {
@ -29464,24 +29488,24 @@
"integrity": "sha512-4BwqyWy6KpSvkocSaV7WR3BlZfrxLbJSLkg+j7Gl6pTDE+U55lLhJvQaMuDVazXYxcjBsG09k7UlH7cGiUI5vQ==" "integrity": "sha512-4BwqyWy6KpSvkocSaV7WR3BlZfrxLbJSLkg+j7Gl6pTDE+U55lLhJvQaMuDVazXYxcjBsG09k7UlH7cGiUI5vQ=="
}, },
"@walletconnect/http-connection": { "@walletconnect/http-connection": {
"version": "1.7.5", "version": "1.7.6",
"resolved": "https://registry.npmjs.org/@walletconnect/http-connection/-/http-connection-1.7.5.tgz", "resolved": "https://registry.npmjs.org/@walletconnect/http-connection/-/http-connection-1.7.6.tgz",
"integrity": "sha512-WDy2Y/07c1F107362jel0voeV6QMJuWbwAKNLtxlX8Y9KNzqZAGlHhIZykSWrMjNGwxBaXoqLPmu60uVvodc6A==", "integrity": "sha512-G2xgqALcy2naHeiFS1N3VEwsgqIbFrbBv9gYaHE3R6RuEb4VVSIVGy6brpN+CoLmI680Kj2EmiJG7yvpNsHKdg==",
"requires": { "requires": {
"@walletconnect/types": "^1.7.5", "@walletconnect/types": "^1.7.6",
"@walletconnect/utils": "^1.7.5", "@walletconnect/utils": "^1.7.6",
"eventemitter3": "4.0.7", "eventemitter3": "4.0.7",
"xhr2-cookies": "1.1.0" "xhr2-cookies": "1.1.0"
} }
}, },
"@walletconnect/iso-crypto": { "@walletconnect/iso-crypto": {
"version": "1.7.5", "version": "1.7.6",
"resolved": "https://registry.npmjs.org/@walletconnect/iso-crypto/-/iso-crypto-1.7.5.tgz", "resolved": "https://registry.npmjs.org/@walletconnect/iso-crypto/-/iso-crypto-1.7.6.tgz",
"integrity": "sha512-mJdRs2SqAPOLBBqLhU+ZnAh2c8TL2uDuL/ojV4aBzZ0ZHNT7X2zSOjAiixCb3vvH8GAt30OKmiRo3+ChI/9zvA==", "integrity": "sha512-x80OVfarjPzD02kJgnpmLCxlsFRaymGjlGWzLmtwO8/hp1mrtT/ukFOsl1Fs6Tunp7BdCoJT+9FYFarcvbsG8Q==",
"requires": { "requires": {
"@walletconnect/crypto": "^1.0.2", "@walletconnect/crypto": "^1.0.2",
"@walletconnect/types": "^1.7.5", "@walletconnect/types": "^1.7.6",
"@walletconnect/utils": "^1.7.5" "@walletconnect/utils": "^1.7.6"
} }
}, },
"@walletconnect/jsonrpc-types": { "@walletconnect/jsonrpc-types": {
@ -29507,13 +29531,13 @@
"integrity": "sha512-ZtKRio4uCZ1JUF7LIdecmZt7FOLnX72RPSY7aUVu7mj7CSfxDwUn6gBuK6WGtH+NZCldBqDl5DenI5fFSvkKYw==" "integrity": "sha512-ZtKRio4uCZ1JUF7LIdecmZt7FOLnX72RPSY7aUVu7mj7CSfxDwUn6gBuK6WGtH+NZCldBqDl5DenI5fFSvkKYw=="
}, },
"@walletconnect/qrcode-modal": { "@walletconnect/qrcode-modal": {
"version": "1.7.5", "version": "1.7.6",
"resolved": "https://registry.npmjs.org/@walletconnect/qrcode-modal/-/qrcode-modal-1.7.5.tgz", "resolved": "https://registry.npmjs.org/@walletconnect/qrcode-modal/-/qrcode-modal-1.7.6.tgz",
"integrity": "sha512-LVq35jc3VMGq1EMcGCObQtEiercMDmUHDnc7A3AmUo0LoAbaPo6c8Hq0zqy2+JhtLmxUhU3ktf+szmCoiUDTUQ==", "integrity": "sha512-SXx8eTllgyGpArwdB8v1WsmAKbxiizqebJLn32C6KRzWVW5FP4FizzgEi+r6xINWSEpWLX72GbeWAoiQDwFVFw==",
"requires": { "requires": {
"@walletconnect/browser-utils": "^1.7.5", "@walletconnect/browser-utils": "^1.7.6",
"@walletconnect/mobile-registry": "^1.4.0", "@walletconnect/mobile-registry": "^1.4.0",
"@walletconnect/types": "^1.7.5", "@walletconnect/types": "^1.7.6",
"copy-to-clipboard": "^3.3.1", "copy-to-clipboard": "^3.3.1",
"preact": "10.4.1", "preact": "10.4.1",
"qrcode": "1.4.4" "qrcode": "1.4.4"
@ -29535,29 +29559,29 @@
"integrity": "sha512-QJzp/S/86sUAgWY6eh5MKYmSfZaRpIlmCJdi5uG4DJlKkZrHEF7ye7gA+VtbVzvTtpM/gRwO2plQuiooIeXjfg==" "integrity": "sha512-QJzp/S/86sUAgWY6eh5MKYmSfZaRpIlmCJdi5uG4DJlKkZrHEF7ye7gA+VtbVzvTtpM/gRwO2plQuiooIeXjfg=="
}, },
"@walletconnect/socket-transport": { "@walletconnect/socket-transport": {
"version": "1.7.5", "version": "1.7.6",
"resolved": "https://registry.npmjs.org/@walletconnect/socket-transport/-/socket-transport-1.7.5.tgz", "resolved": "https://registry.npmjs.org/@walletconnect/socket-transport/-/socket-transport-1.7.6.tgz",
"integrity": "sha512-4TYCxrNWb4f5a1NGsALXidr+/6dOiqgVfUQJ4fdP6R7ijL+7jtdiktguU9FIDq5wFXRE+ZdpCpwSAfOt60q/mQ==", "integrity": "sha512-yH2eKD9P34gnOxOfCarERROl5SkiwBR9UcASjcnp2L7r02ZaXHbhheXHUWzcU5HpEXrvz8DGciE7GBQn+aNgQg==",
"requires": { "requires": {
"@walletconnect/types": "^1.7.5", "@walletconnect/types": "^1.7.6",
"@walletconnect/utils": "^1.7.5", "@walletconnect/utils": "^1.7.6",
"ws": "7.5.3" "ws": "7.5.3"
} }
}, },
"@walletconnect/types": { "@walletconnect/types": {
"version": "1.7.5", "version": "1.7.6",
"resolved": "https://registry.npmjs.org/@walletconnect/types/-/types-1.7.5.tgz", "resolved": "https://registry.npmjs.org/@walletconnect/types/-/types-1.7.6.tgz",
"integrity": "sha512-0HvZzxD93et4DdrYgAvclI1BqclkZS7iPWRtbGg3r+PQhRPbOkNypzBy6XH6wflbmr+WBGdmyJvynHsdhcCqUA==" "integrity": "sha512-3JVjEzvJgDc5DzaXNxhg4JcdG4U8Qk6HVBELOu+TwiWG31TZRt82uL9CcVZKieFPP/nTWQnj+QkiKSpO7T1KTQ=="
}, },
"@walletconnect/utils": { "@walletconnect/utils": {
"version": "1.7.5", "version": "1.7.6",
"resolved": "https://registry.npmjs.org/@walletconnect/utils/-/utils-1.7.5.tgz", "resolved": "https://registry.npmjs.org/@walletconnect/utils/-/utils-1.7.6.tgz",
"integrity": "sha512-U954rIIA/g/Cmdqy+n3hMY1DDMmXxGs8w/QmrK9b/H5nkQ3e4QicOyynq5g/JTTesN5HZdDTFiyX9r0GSKa+iA==", "integrity": "sha512-GLneac0Hx52pNHAOkTt/07K+Ht8LmWFaK0nQlHqrLmOJm8WZPnUvMZGMTpSOzgKw47u0cjhE38ipbXOaq8qReA==",
"requires": { "requires": {
"@walletconnect/browser-utils": "^1.7.5", "@walletconnect/browser-utils": "^1.7.6",
"@walletconnect/encoding": "^1.0.1", "@walletconnect/encoding": "^1.0.1",
"@walletconnect/jsonrpc-utils": "^1.0.0", "@walletconnect/jsonrpc-utils": "^1.0.0",
"@walletconnect/types": "^1.7.5", "@walletconnect/types": "^1.7.6",
"bn.js": "4.11.8", "bn.js": "4.11.8",
"js-sha3": "0.8.0", "js-sha3": "0.8.0",
"query-string": "6.13.5" "query-string": "6.13.5"
@ -29581,15 +29605,15 @@
} }
}, },
"@walletconnect/web3-provider": { "@walletconnect/web3-provider": {
"version": "1.7.5", "version": "1.7.6",
"resolved": "https://registry.npmjs.org/@walletconnect/web3-provider/-/web3-provider-1.7.5.tgz", "resolved": "https://registry.npmjs.org/@walletconnect/web3-provider/-/web3-provider-1.7.6.tgz",
"integrity": "sha512-x+UWOTu7jd9qog9NWhaspOmVRDJPnQrgZBscnaSC+x/aAsi52VUrd1GZ9c5UNZFgss41fdx3Z2KhkPeVrlrbuQ==", "integrity": "sha512-INjHVTuuISm9rk9QGr8v0IvcmjygEyt+rDB6Iw6G5hK+qwEB+UlrRbXyu0bAmEe4wREpiJmegz7KjiHIxmCTNA==",
"requires": { "requires": {
"@walletconnect/client": "^1.7.5", "@walletconnect/client": "^1.7.6",
"@walletconnect/http-connection": "^1.7.5", "@walletconnect/http-connection": "^1.7.6",
"@walletconnect/qrcode-modal": "^1.7.5", "@walletconnect/qrcode-modal": "^1.7.6",
"@walletconnect/types": "^1.7.5", "@walletconnect/types": "^1.7.6",
"@walletconnect/utils": "^1.7.5", "@walletconnect/utils": "^1.7.6",
"web3-provider-engine": "16.0.1" "web3-provider-engine": "16.0.1"
} }
}, },
@ -29747,9 +29771,9 @@
} }
}, },
"ansi-regex": { "ansi-regex": {
"version": "3.0.0", "version": "3.0.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz",
"integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=" "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw=="
}, },
"ansi-styles": { "ansi-styles": {
"version": "3.2.1", "version": "3.2.1",
@ -38014,9 +38038,9 @@
} }
}, },
"minimist": { "minimist": {
"version": "1.2.5", "version": "1.2.6",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz",
"integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q=="
}, },
"minipass": { "minipass": {
"version": "2.9.0", "version": "2.9.0",

View File

@ -25,7 +25,8 @@
"@oceanprotocol/typographies": "^0.1.0", "@oceanprotocol/typographies": "^0.1.0",
"@portis/web3": "^4.0.7", "@portis/web3": "^4.0.7",
"@tippyjs/react": "^4.2.6", "@tippyjs/react": "^4.2.6",
"@walletconnect/web3-provider": "^1.7.5", "@urql/exchange-refocus": "^0.2.5",
"@walletconnect/web3-provider": "^1.7.6",
"axios": "^0.26.1", "axios": "^0.26.1",
"bignumber.js": "^9.0.2", "bignumber.js": "^9.0.2",
"chart.js": "^3.7.1", "chart.js": "^3.7.1",

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

BIN
public/apple-touch-icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
public/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

1
public/icon.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 6.0 KiB

View File

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

14
public/site.webmanifest Normal file
View File

@ -0,0 +1,14 @@
{
"icons": [
{
"src": "/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/android-chrome-512x512.png",
"sizes": "512x512",
"type": "image/png"
}
]
}

View File

@ -53,7 +53,7 @@ function PoolProvider({ children }: { children: ReactNode }): ReactElement {
const [poolSnapshots, setPoolSnapshots] = useState<PoolDataPoolSnapshots[]>() const [poolSnapshots, setPoolSnapshots] = useState<PoolDataPoolSnapshots[]>()
const [hasUserAddedLiquidity, setUserHasAddedLiquidity] = useState(false) const [hasUserAddedLiquidity, setUserHasAddedLiquidity] = useState(false)
const [isRemoveDisabled, setIsRemoveDisabled] = useState(false) const [isRemoveDisabled, setIsRemoveDisabled] = useState(false)
const [fetchInterval, setFetchInterval] = useState<NodeJS.Timeout>() // const [fetchInterval, setFetchInterval] = useState<NodeJS.Timeout>()
const fetchAllData = useCallback(async () => { const fetchAllData = useCallback(async () => {
if (!asset?.chainId || !asset?.accessDetails?.addressOrId || !owner) return if (!asset?.chainId || !asset?.accessDetails?.addressOrId || !owner) return
@ -78,27 +78,27 @@ function PoolProvider({ children }: { children: ReactNode }): ReactElement {
}, [asset?.chainId, asset?.accessDetails?.addressOrId, owner, accountId]) }, [asset?.chainId, asset?.accessDetails?.addressOrId, owner, accountId])
// Helper: start interval fetching // Helper: start interval fetching
const initFetchInterval = useCallback(() => { // const initFetchInterval = useCallback(() => {
if (fetchInterval) return // if (fetchInterval) return
const newInterval = setInterval(() => { // const newInterval = setInterval(() => {
fetchAllData() // fetchAllData()
LoggerInstance.log( // LoggerInstance.log(
`[pool] Refetch interval fired after ${refreshInterval / 1000}s` // `[pool] Refetch interval fired after ${refreshInterval / 1000}s`
) // )
}, refreshInterval) // }, refreshInterval)
setFetchInterval(newInterval) // setFetchInterval(newInterval)
// Having `accountId` as dependency is important for interval to // // Having `accountId` as dependency is important for interval to
// change after user account switch. // // change after user account switch.
// eslint-disable-next-line react-hooks/exhaustive-deps // // eslint-disable-next-line react-hooks/exhaustive-deps
}, [fetchInterval, fetchAllData, accountId]) // }, [fetchInterval, fetchAllData, accountId])
useEffect(() => { // useEffect(() => {
return () => { // return () => {
clearInterval(fetchInterval) // clearInterval(fetchInterval)
} // }
}, [fetchInterval]) // }, [fetchInterval])
// //
// 0 Fetch all the data on mount if we are on a pool. // 0 Fetch all the data on mount if we are on a pool.
@ -109,8 +109,8 @@ function PoolProvider({ children }: { children: ReactNode }): ReactElement {
if (asset?.accessDetails?.type !== 'dynamic') return if (asset?.accessDetails?.type !== 'dynamic') return
fetchAllData() fetchAllData()
initFetchInterval() // initFetchInterval()
}, [fetchAllData, initFetchInterval, asset?.accessDetails?.type]) }, [fetchAllData, asset?.accessDetails?.type])
// //
// 1 General Pool Info // 1 General Pool Info

View File

@ -1,4 +1,12 @@
import { createClient, Provider, Client } from 'urql' import {
createClient,
Provider,
Client,
cacheExchange,
dedupExchange,
fetchExchange
} from 'urql'
import { refocusExchange } from '@urql/exchange-refocus'
import React, { useState, useEffect, ReactNode, ReactElement } from 'react' import React, { useState, useEffect, ReactNode, ReactElement } from 'react'
import { LoggerInstance } from '@oceanprotocol/lib' import { LoggerInstance } from '@oceanprotocol/lib'
import { getOceanConfig } from '@utils/ocean' import { getOceanConfig } from '@utils/ocean'
@ -7,7 +15,8 @@ let urqlClient: Client
function createUrqlClient(subgraphUri: string) { function createUrqlClient(subgraphUri: string) {
const client = createClient({ const client = createClient({
url: `${subgraphUri}/subgraphs/name/oceanprotocol/ocean-subgraph` url: `${subgraphUri}/subgraphs/name/oceanprotocol/ocean-subgraph`,
exchanges: [dedupExchange, refocusExchange(), cacheExchange, fetchExchange]
}) })
return client return client
} }

View File

@ -10,7 +10,7 @@ function useNftFactory(): NftFactory {
useEffect(() => { useEffect(() => {
if (!web3 || !chainId) return if (!web3 || !chainId) return
const config = getOceanConfig(chainId) const config = getOceanConfig(chainId)
const factory = new NftFactory(config.erc721FactoryAddress, web3) const factory = new NftFactory(config?.erc721FactoryAddress, web3)
setNftFactory(factory) setNftFactory(factory)
}, [web3, chainId]) }, [web3, chainId])

View File

@ -2,7 +2,6 @@ export interface UseSiteMetadata {
siteTitle: string siteTitle: string
siteTagline: string siteTagline: string
siteUrl: string siteUrl: string
siteIcon: string
siteImage: string siteImage: string
copyright: string copyright: string
menu: { menu: {

View File

@ -4,6 +4,7 @@ import { randomIntFromInterval } from './numbers'
export interface WaveProperties { export interface WaveProperties {
width?: number width?: number
height?: number height?: number
viewBox?: string
color?: string color?: string
fill?: boolean fill?: boolean
layerCount?: number layerCount?: number
@ -53,6 +54,7 @@ export class SvgWaves {
return { return {
width: 99, width: 99,
height: 99, height: 99,
viewBox: '0 0 99 99',
color: WaveColors.Pink, color: WaveColors.Pink,
fill: true, fill: true,
layerCount: 4, layerCount: 4,
@ -107,8 +109,7 @@ export class SvgWaves {
generateSvg(): Element { generateSvg(): Element {
const svg = document.createElementNS(SvgWaves.xmlns, 'svg') const svg = document.createElementNS(SvgWaves.xmlns, 'svg')
svg.setAttribute('width', this.properties.width.toString()) svg.setAttribute('viewBox', this.properties.viewBox.toString())
svg.setAttribute('height', this.properties.height.toString())
svg.setAttribute('fill', this.properties.fill ? undefined : 'transparent') svg.setAttribute('fill', this.properties.fill ? undefined : 'transparent')
svg.setAttribute('xmlns', SvgWaves.xmlns) svg.setAttribute('xmlns', SvgWaves.xmlns)

View File

@ -11,13 +11,6 @@ export function getOrderFeedback(
} }
} }
export function getCollectTokensFeedback(
baseTokenSymbol: string,
baseTokenBalance: string
) {
return `Collecting ${baseTokenBalance} ${baseTokenSymbol} from asset `
}
export function getComputeFeedback( export function getComputeFeedback(
baseTokenSymbol?: string, baseTokenSymbol?: string,
datatokenSymbol?: string, datatokenSymbol?: string,

View File

@ -211,7 +211,7 @@ export function getQueryContext(chainId: number): OperationContext {
url: `${getSubgraphUri( url: `${getSubgraphUri(
Number(chainId) Number(chainId)
)}/subgraphs/name/oceanprotocol/ocean-subgraph`, )}/subgraphs/name/oceanprotocol/ocean-subgraph`,
requestPolicy: 'cache-and-network' requestPolicy: 'network-only'
} }
return queryContext return queryContext
} catch (error) { } catch (error) {

View File

@ -4,7 +4,7 @@ import styles from './index.module.css'
import Loader from '../atoms/Loader' import Loader from '../atoms/Loader'
interface ButtonBuyProps { interface ButtonBuyProps {
action: 'download' | 'compute' | 'collect' action: 'download' | 'compute'
disabled: boolean disabled: boolean
hasPreviousOrder: boolean hasPreviousOrder: boolean
hasDatatoken: boolean hasDatatoken: boolean
@ -148,8 +148,6 @@ export default function ButtonBuy({
? 'Start Compute Job' ? 'Start Compute Job'
: priceType === 'free' && algorithmPriceType === 'free' : priceType === 'free' && algorithmPriceType === 'free'
? 'Order Compute Job' ? 'Order Compute Job'
: action === 'collect'
? `Collect ${dtBalance} ${dtSymbol}`
: `Buy Compute Job` : `Buy Compute Job`
return ( return (

View File

@ -6,6 +6,11 @@
position: relative; position: relative;
} }
.hasError {
border-color: var(--brand-alert-red);
background-color: var(--brand-white);
}
.url { .url {
margin: 0; margin: 0;
font-size: var(--font-size-base); font-size: var(--font-size-base);
@ -42,3 +47,7 @@
.info li.success { .info li.success {
color: var(--brand-alert-green); color: var(--brand-alert-green);
} }
.info li.error {
color: var(--brand-alert-red);
}

View File

@ -11,7 +11,7 @@ export default function FileInfo({
file: FileMetadata file: FileMetadata
handleClose(): void handleClose(): void
}): ReactElement { }): ReactElement {
return ( return file.valid ? (
<div className={styles.info}> <div className={styles.info}>
<h3 className={styles.url}>{file.url}</h3> <h3 className={styles.url}>{file.url}</h3>
<ul> <ul>
@ -23,5 +23,20 @@ export default function FileInfo({
&times; &times;
</button> </button>
</div> </div>
) : (
<div className={`${styles.info} ${!file.valid ? styles.hasError : ''}`}>
<h3 className={styles.url}>{file.url}</h3>
<ul>
<li className={styles.error}>
{' '}
No valid file detected. Check your URL and try again.
</li>
{file.contentLength && <li>{prettySize(+file.contentLength)}</li>}
{file.contentType && <li>{cleanupContentType(file.contentType)}</li>}
</ul>
<button className={styles.removeButton} onClick={handleClose}>
&times;
</button>
</div>
) )
} }

View File

@ -10,6 +10,7 @@ import { FormPublishData } from 'src/components/Publish/_types'
export default function FilesInput(props: InputProps): ReactElement { export default function FilesInput(props: InputProps): ReactElement {
const [field, meta, helpers] = useField(props.name) const [field, meta, helpers] = useField(props.name)
const [isInvalidUrl, setIsInvalidUrl] = useState(false)
const [isLoading, setIsLoading] = useState(false) const [isLoading, setIsLoading] = useState(false)
const { values } = useFormikContext<FormPublishData>() const { values } = useFormikContext<FormPublishData>()
@ -23,6 +24,7 @@ export default function FilesInput(props: InputProps): ReactElement {
try { try {
setIsLoading(true) setIsLoading(true)
const checkedFile = await getFileUrlInfo(url, providerUri) const checkedFile = await getFileUrlInfo(url, providerUri)
setIsInvalidUrl(!checkedFile[0].valid)
checkedFile && helpers.setValue([{ url, ...checkedFile[0] }]) checkedFile && helpers.setValue([{ url, ...checkedFile[0] }])
} catch (error) { } catch (error) {
toast.error( toast.error(
@ -63,16 +65,14 @@ export default function FilesInput(props: InputProps): ReactElement {
return ( return (
<> <>
{field?.value?.length && {field.value[0].valid !== undefined ? (
field.value[0].url !== '' &&
field.value[0].valid ? (
<FileInfo file={field.value[0]} handleClose={handleClose} /> <FileInfo file={field.value[0]} handleClose={handleClose} />
) : ( ) : (
<UrlInput <UrlInput
submitText="Validate" submitText="Validate"
{...props} {...props}
name={`${field.name}[0].url`} name={`${field.name}[0].url`}
hasError={Boolean(meta.touched && meta.error)} hasError={Boolean(meta.touched && isInvalidUrl)}
isLoading={isLoading} isLoading={isLoading}
handleButtonClick={handleButtonClick} handleButtonClick={handleButtonClick}
/> />

View File

@ -41,7 +41,9 @@ export default function URLInput({
<InputGroup> <InputGroup>
<InputElement <InputElement
className={`${styles.input} ${ className={`${styles.input} ${
!isLoading && hasError ? styles.hasError : '' !isLoading && meta.error !== undefined && meta.touched
? styles.hasError
: ''
}`} }`}
{...props} {...props}
{...field} {...field}

View File

@ -17,24 +17,35 @@ export default function Seo({
// Remove trailing slash from all URLs // Remove trailing slash from all URLs
const canonical = `${siteUrl}${uri}`.replace(/\/$/, '') const canonical = `${siteUrl}${uri}`.replace(/\/$/, '')
const pageTitle = title
? `${title} - ${siteTitle}`
: `${siteTitle}${siteTagline}`
return ( return (
<Head> <Head>
<html lang="en" /> <html lang="en" />
<title>{`${siteTitle}${siteTagline}`}</title> <title>{pageTitle}</title>
{isBrowser && {isBrowser && window?.location?.hostname !== 'oceanprotocol.com' && (
window.location && <meta name="robots" content="noindex,nofollow" />
window.location.hostname !== 'oceanprotocol.com' && ( )}
<meta name="robots" content="noindex,nofollow" />
)}
<link rel="canonical" href={canonical} /> <link rel="canonical" href={canonical} />
<link rel="icon" href="/favicon.ico" sizes="any" />
<link rel="icon" href="/icon.svg" type="image/svg+xml" />
<link
rel="apple-touch-icon"
sizes="180x180"
href="/apple-touch-icon.png"
/>
<link rel="manifest" href="/site.webmanifest" />
<meta name="theme-color" content="var(--background-content)" />
<meta name="description" content={description} /> <meta name="description" content={description} />
<meta property="og:title" content={title} /> <meta property="og:title" content={title} />
<meta property="og:description" content={description} /> <meta property="og:description" content={description} />
<meta property="og:url" content={uri} /> <meta property="og:url" content={canonical} />
<meta name="image" content={`${siteUrl}${siteImage}`} /> <meta name="image" content={`${siteUrl}${siteImage}`} />
<meta property="og:image" content={`${siteUrl}${siteImage}`} /> <meta property="og:image" content={`${siteUrl}${siteImage}`} />

View File

@ -52,9 +52,12 @@ function getTitle(row: PoolTransaction, locale: string) {
} }
case 'JOIN': case 'JOIN':
case 'EXIT': { case 'EXIT': {
const tokenMoved = row.baseTokenValue > 0 ? row.baseToken : row.datatoken const tokenMoved =
Math.abs(row.baseTokenValue) > 0 ? row.baseToken : row.datatoken
const tokenValueMoved = const tokenValueMoved =
row.baseTokenValue > 0 ? row.baseTokenValue : row.datatokenValue Math.abs(row.baseTokenValue) > 0
? row.baseTokenValue
: row.datatokenValue
const tokenSymbol = tokenMoved.symbol const tokenSymbol = tokenMoved.symbol
title += `${row.type === 'JOIN' ? 'Add' : 'Remove'} ${formatPrice( title += `${row.type === 'JOIN' ? 'Add' : 'Remove'} ${formatPrice(

View File

@ -9,6 +9,7 @@ import { fetchDataForMultipleChains } from '@utils/subgraph'
import { useSiteMetadata } from '@hooks/useSiteMetadata' import { useSiteMetadata } from '@hooks/useSiteMetadata'
import NetworkName from '@shared/NetworkName' import NetworkName from '@shared/NetworkName'
import { getAssetsFromDtList } from '@utils/aquarius' import { getAssetsFromDtList } from '@utils/aquarius'
import { getAsset } from '../../Profile/History/PoolShares/_utils'
import { CancelToken } from 'axios' import { CancelToken } from 'axios'
import Title from './Title' import Title from './Title'
import styles from './index.module.css' import styles from './index.module.css'
@ -22,7 +23,7 @@ const txHistoryQueryByPool = gql`
poolTransactions( poolTransactions(
orderBy: timestamp orderBy: timestamp
orderDirection: desc orderDirection: desc
where: { user: $user, pool: $pool } where: { pool: $pool }
first: 1000 first: 1000
) { ) {
baseToken { baseToken {
@ -172,6 +173,7 @@ export default function PoolTransactions({
} }
if (dtList.length === 0) { if (dtList.length === 0) {
setTransactions([])
setIsLoading(false) setIsLoading(false)
return return
} }
@ -180,8 +182,8 @@ export default function PoolTransactions({
for (let i = 0; i < data.length; i++) { for (let i = 0; i < data.length; i++) {
poolTransactions.push({ poolTransactions.push({
...data[i], ...data[i],
networkId: ddoList[i]?.chainId, networkId: getAsset(ddoList, data[i].datatoken.address).chainId,
asset: ddoList[i] asset: getAsset(ddoList, data[i].datatoken.address)
}) })
} }
const sortedTransactions = poolTransactions.sort( const sortedTransactions = poolTransactions.sort(

View File

@ -11,7 +11,8 @@ export default function TokenApproval({
amount, amount,
tokenAddress, tokenAddress,
tokenSymbol, tokenSymbol,
setSubmitting setSubmitting,
setIsTokenApproved
}: { }: {
actionButton: JSX.Element actionButton: JSX.Element
disabled: boolean disabled: boolean
@ -19,6 +20,7 @@ export default function TokenApproval({
tokenAddress: string tokenAddress: string
tokenSymbol: string tokenSymbol: string
setSubmitting?: (isSubmitting: boolean) => void setSubmitting?: (isSubmitting: boolean) => void
setIsTokenApproved: (isApproved: boolean) => void
}): ReactElement { }): ReactElement {
const { asset, isAssetNetwork } = useAsset() const { asset, isAssetNetwork } = useAsset()
const [tokenApproved, setTokenApproved] = useState(false) const [tokenApproved, setTokenApproved] = useState(false)
@ -44,6 +46,9 @@ export default function TokenApproval({
setTokenApproved( setTokenApproved(
new Decimal(allowanceValue).greaterThanOrEqualTo(new Decimal(amount)) new Decimal(allowanceValue).greaterThanOrEqualTo(new Decimal(amount))
) )
setIsTokenApproved(
new Decimal(allowanceValue).greaterThanOrEqualTo(new Decimal(amount))
)
}, [web3, tokenAddress, spender, accountId, amount, isAssetNetwork]) }, [web3, tokenAddress, spender, accountId, amount, isAssetNetwork])
useEffect(() => { useEffect(() => {

View File

@ -419,7 +419,9 @@ export default function Compute({
} }
hasDatatokenSelectedComputeAsset={hasAlgoAssetDatatoken} hasDatatokenSelectedComputeAsset={hasAlgoAssetDatatoken}
oceanSymbol={ oceanSymbol={
asset?.accessDetails ? asset?.accessDetails.baseToken.symbol : '' asset?.accessDetails
? asset?.accessDetails?.baseToken?.symbol
: ''
} }
dtSymbolSelectedComputeAsset={ dtSymbolSelectedComputeAsset={
selectedAlgorithmAsset?.datatokens[0]?.symbol selectedAlgorithmAsset?.datatokens[0]?.symbol

View File

@ -16,10 +16,3 @@
width: 100%; width: 100%;
margin-top: calc(var(--spacer)); margin-top: calc(var(--spacer));
} }
.collect {
width: 100%;
justify-content: center;
text-align: center;
margin-top: calc(var(--spacer) / 2);
}

View File

@ -7,37 +7,17 @@ import ButtonBuy from '@shared/ButtonBuy'
import { secondsToString } from '@utils/ddo' import { secondsToString } from '@utils/ddo'
import AlgorithmDatasetsListForCompute from './Compute/AlgorithmDatasetsListForCompute' import AlgorithmDatasetsListForCompute from './Compute/AlgorithmDatasetsListForCompute'
import styles from './Download.module.css' import styles from './Download.module.css'
import { import { FileMetadata, LoggerInstance, ZERO_ADDRESS } from '@oceanprotocol/lib'
FileMetadata,
LoggerInstance,
ZERO_ADDRESS,
FixedRateExchange
} from '@oceanprotocol/lib'
import { order } from '@utils/order' import { order } from '@utils/order'
import { AssetExtended } from 'src/@types/AssetExtended' import { AssetExtended } from 'src/@types/AssetExtended'
import { buyDtFromPool } from '@utils/pool' import { buyDtFromPool } from '@utils/pool'
import { downloadFile } from '@utils/provider' import { downloadFile } from '@utils/provider'
import { getCollectTokensFeedback, getOrderFeedback } from '@utils/feedback' import { getOrderFeedback } from '@utils/feedback'
import { getOrderPriceAndFees } from '@utils/accessDetailsAndPricing' import { getOrderPriceAndFees } from '@utils/accessDetailsAndPricing'
import { OrderPriceAndFees } from 'src/@types/Price' import { OrderPriceAndFees } from 'src/@types/Price'
import { toast } from 'react-toastify' import { toast } from 'react-toastify'
import { gql, OperationResult } from 'urql' import { useIsMounted } from '@hooks/useIsMounted'
import { fetchData, getQueryContext } from '@utils/subgraph'
import { getOceanConfig } from '@utils/ocean'
import { FixedRateExchanges } from 'src/@types/subgraph/FixedRateExchanges'
const FixedRateExchangesQuery = gql`
query FixedRateExchanges($user: String, $exchangeId: String) {
fixedRateExchanges(where: { owner: $user, exchangeId: $exchangeId }) {
id
owner {
id
}
exchangeId
baseTokenBalance
}
}
`
export default function Download({ export default function Download({
asset, asset,
file, file,
@ -55,15 +35,15 @@ export default function Download({
}): ReactElement { }): ReactElement {
const { accountId, web3 } = useWeb3() const { accountId, web3 } = useWeb3()
const { isInPurgatory, isAssetNetwork } = useAsset() const { isInPurgatory, isAssetNetwork } = useAsset()
const isMounted = useIsMounted()
const [isDisabled, setIsDisabled] = useState(true) const [isDisabled, setIsDisabled] = useState(true)
const [hasDatatoken, setHasDatatoken] = useState(false) const [hasDatatoken, setHasDatatoken] = useState(false)
const [statusText, setStatusText] = useState('') const [statusText, setStatusText] = useState('')
const [isLoading, setIsLoading] = useState(false) const [isLoading, setIsLoading] = useState(false)
const [isOwned, setIsOwned] = useState(false) const [isOwned, setIsOwned] = useState(false)
const [validOrderTx, setValidOrderTx] = useState('') const [validOrderTx, setValidOrderTx] = useState('')
const [isCollectLoading, setIsCollectLoading] = useState(false)
const [baseTokenBalance, setBaseTokenBalance] = useState(0)
const [collectStatusText, setCollectStatusText] = useState('')
const [orderPriceAndFees, setOrderPriceAndFees] = const [orderPriceAndFees, setOrderPriceAndFees] =
useState<OrderPriceAndFees>() useState<OrderPriceAndFees>()
useEffect(() => { useEffect(() => {
@ -94,12 +74,14 @@ export default function Download({
}, [dtBalance]) }, [dtBalance])
useEffect(() => { useEffect(() => {
if (!accountId || !asset?.accessDetails) return if (!isMounted || !accountId || !asset?.accessDetails) return
setIsDisabled(
const isDisabled =
!asset?.accessDetails.isPurchasable || !asset?.accessDetails.isPurchasable ||
((!isBalanceSufficient || !isAssetNetwork) && !isOwned && !hasDatatoken) ((!isBalanceSufficient || !isAssetNetwork) && !isOwned && !hasDatatoken)
) setIsDisabled(isDisabled)
}, [ }, [
isMounted,
asset?.accessDetails, asset?.accessDetails,
isBalanceSufficient, isBalanceSufficient,
isAssetNetwork, isAssetNetwork,
@ -108,41 +90,19 @@ export default function Download({
isOwned isOwned
]) ])
useEffect(() => {
if (!accountId || asset.nft.owner !== accountId) return
const queryContext = getQueryContext(Number(asset.chainId))
async function getBaseTokenBalance() {
const variables = {
user: accountId.toLowerCase(),
exchangeId: asset?.accessDetails?.addressOrId
}
const result: OperationResult<FixedRateExchanges> = await fetchData(
FixedRateExchangesQuery,
variables,
queryContext
)
result?.data?.fixedRateExchanges[0]?.baseTokenBalance
? setBaseTokenBalance(
parseInt(result?.data?.fixedRateExchanges[0]?.baseTokenBalance)
)
: setBaseTokenBalance(0)
}
getBaseTokenBalance()
}, [accountId, asset?.accessDetails?.addressOrId, asset.chainId, asset.nft])
async function handleOrderOrDownload() { async function handleOrderOrDownload() {
setIsLoading(true) setIsLoading(true)
if (isOwned) { try {
setStatusText( if (isOwned) {
getOrderFeedback( setStatusText(
asset.accessDetails?.baseToken?.symbol, getOrderFeedback(
asset.accessDetails?.datatoken?.symbol asset.accessDetails?.baseToken?.symbol,
)[3] asset.accessDetails?.datatoken?.symbol
) )[3]
await downloadFile(web3, asset, accountId, validOrderTx) )
} else {
try { await downloadFile(web3, asset, accountId, validOrderTx)
} else {
if (!hasDatatoken && asset.accessDetails.type === 'dynamic') { if (!hasDatatoken && asset.accessDetails.type === 'dynamic') {
setStatusText( setStatusText(
getOrderFeedback( getOrderFeedback(
@ -152,9 +112,7 @@ export default function Download({
) )
const tx = await buyDtFromPool(asset.accessDetails, accountId, web3) const tx = await buyDtFromPool(asset.accessDetails, accountId, web3)
if (!tx) { if (!tx) {
toast.error('Failed to buy datatoken from pool!') throw new Error()
setIsLoading(false)
return
} }
} }
setStatusText( setStatusText(
@ -165,51 +123,19 @@ export default function Download({
) )
const orderTx = await order(web3, asset, orderPriceAndFees, accountId) const orderTx = await order(web3, asset, orderPriceAndFees, accountId)
if (!orderTx) { if (!orderTx) {
toast.error('Failed to buy datatoken from pool!') throw new Error()
setIsLoading(false)
return
} }
setIsOwned(true) setIsOwned(true)
setValidOrderTx(orderTx.transactionHash) setValidOrderTx(orderTx.transactionHash)
} catch (ex) {
LoggerInstance.log(ex.message)
setIsLoading(false)
} }
}
setIsLoading(false)
}
async function handleCollectTokens() {
setIsCollectLoading(true)
const config = getOceanConfig(asset?.chainId)
const fixed = new FixedRateExchange(web3, config.fixedRateExchangeAddress)
try {
setCollectStatusText(
getCollectTokensFeedback(
asset.accessDetails.baseToken?.symbol,
baseTokenBalance.toString()
)
)
const tx = await fixed.collectBT(
accountId,
asset?.accessDetails?.addressOrId,
baseTokenBalance.toString()
)
if (!tx) {
setIsCollectLoading(false)
return
}
setBaseTokenBalance(0)
return tx
} catch (error) { } catch (error) {
LoggerInstance.log(error.message) LoggerInstance.error(error)
setIsCollectLoading(false) const message = isOwned
} finally { ? 'Failed to download file!'
setIsCollectLoading(false) : 'Failed to buy datatoken from pool!'
toast.error(message)
} }
setIsLoading(false)
} }
const PurchaseButton = () => ( const PurchaseButton = () => (
@ -234,26 +160,6 @@ export default function Download({
/> />
) )
const CollectTokensButton = () => (
<ButtonBuy
action="collect"
onClick={handleCollectTokens}
disabled={baseTokenBalance === 0 || !baseTokenBalance}
hasPreviousOrder={false}
hasDatatoken={false}
dtSymbol={asset?.accessDetails?.baseToken.symbol}
dtBalance={baseTokenBalance.toString()}
datasetLowPoolLiquidity={false}
assetType=""
stepText={collectStatusText}
assetTimeout=""
isConsumable={false}
consumableFeedback=""
isBalanceSufficient={false}
isLoading={isCollectLoading}
/>
)
return ( return (
<aside className={styles.consume}> <aside className={styles.consume}>
<div className={styles.info}> <div className={styles.info}>
@ -271,13 +177,6 @@ export default function Download({
</div> </div>
</div> </div>
{asset?.accessDetails?.datatoken?.name !== '' &&
asset?.nft.owner === accountId && (
<div className={styles.collect}>
<CollectTokensButton />
</div>
)}
{asset?.metadata?.type === 'algorithm' && ( {asset?.metadata?.type === 'algorithm' && (
<AlgorithmDatasetsListForCompute <AlgorithmDatasetsListForCompute
algorithmDid={asset.id} algorithmDid={asset.id}

View File

@ -1,4 +1,4 @@
import React, { ReactElement } from 'react' import React, { ReactElement, useState } from 'react'
import Loader from '@shared/atoms/Loader' import Loader from '@shared/atoms/Loader'
import Button from '@shared/atoms/Button' import Button from '@shared/atoms/Button'
import styles from './Actions.module.css' import styles from './Actions.module.css'
@ -6,11 +6,13 @@ import ExplorerLink from '@shared/ExplorerLink'
import SuccessConfetti from '@shared/SuccessConfetti' import SuccessConfetti from '@shared/SuccessConfetti'
import { useWeb3 } from '@context/Web3' import { useWeb3 } from '@context/Web3'
import TokenApproval from '@shared/TokenApproval' import TokenApproval from '@shared/TokenApproval'
import Decimal from 'decimal.js'
export default function Actions({ export default function Actions({
isLoading, isLoading,
loaderMessage, loaderMessage,
successMessage, successMessage,
slippage,
txId, txId,
actionName, actionName,
amount, amount,
@ -23,6 +25,7 @@ export default function Actions({
isLoading: boolean isLoading: boolean
loaderMessage: string loaderMessage: string
successMessage: string successMessage: string
slippage?: string
txId: string txId: string
actionName: string actionName: string
amount?: string amount?: string
@ -33,6 +36,7 @@ export default function Actions({
setSubmitting?: (isSubmitting: boolean) => void setSubmitting?: (isSubmitting: boolean) => void
}): ReactElement { }): ReactElement {
const { networkId } = useWeb3() const { networkId } = useWeb3()
const [isTokenApproved, setIsTokenApproved] = useState(false)
const actionButton = ( const actionButton = (
<Button <Button
@ -45,15 +49,34 @@ export default function Actions({
</Button> </Button>
) )
const applySlippage = (amount: string) => {
if (!amount) return '0'
const newAmount = new Decimal(amount)
.mul(
new Decimal(1)
.plus(new Decimal(slippage).div(new Decimal(100)))
.toString()
)
.toString()
return newAmount
}
return ( return (
<> <>
<div className={styles.actions}> <div className={styles.actions}>
{isLoading ? ( {isLoading ? (
<Loader message={loaderMessage} /> <Loader
message={
isTokenApproved || actionName === 'Remove'
? loaderMessage
: `Approving ${tokenSymbol}...`
}
/>
) : actionName === 'Supply' || actionName === 'Swap' ? ( ) : actionName === 'Supply' || actionName === 'Swap' ? (
<TokenApproval <TokenApproval
actionButton={actionButton} actionButton={actionButton}
amount={amount} amount={slippage ? applySlippage(amount) : amount}
setIsTokenApproved={setIsTokenApproved}
tokenAddress={tokenAddress} tokenAddress={tokenAddress}
tokenSymbol={tokenSymbol} tokenSymbol={tokenSymbol}
disabled={isDisabled} disabled={isDisabled}

View File

@ -14,6 +14,7 @@ import { useWeb3 } from '@context/Web3'
import { useAsset } from '@context/Asset' import { useAsset } from '@context/Asset'
import content from '../../../../../../content/price.json' import content from '../../../../../../content/price.json'
import { calcMaxExactIn, LoggerInstance, Pool } from '@oceanprotocol/lib' import { calcMaxExactIn, LoggerInstance, Pool } from '@oceanprotocol/lib'
import { usePool } from '@context/Pool'
export interface FormAddLiquidity { export interface FormAddLiquidity {
amount: string amount: string
@ -31,8 +32,7 @@ export default function Add({
swapFee, swapFee,
datatokenSymbol, datatokenSymbol,
tokenInSymbol, tokenInSymbol,
tokenInAddress, tokenInAddress
fetchAllData
}: { }: {
setShowAdd: (show: boolean) => void setShowAdd: (show: boolean) => void
poolAddress: string poolAddress: string
@ -42,10 +42,10 @@ export default function Add({
datatokenSymbol: string datatokenSymbol: string
tokenInSymbol: string tokenInSymbol: string
tokenInAddress: string tokenInAddress: string
fetchAllData: () => void
}): ReactElement { }): ReactElement {
const { accountId, balance, web3 } = useWeb3() const { accountId, balance, web3 } = useWeb3()
const { isAssetNetwork } = useAsset() const { isAssetNetwork } = useAsset()
const { fetchAllData } = usePool()
const { debug } = useUserPreferences() const { debug } = useUserPreferences()
const [txId, setTxId] = useState<string>() const [txId, setTxId] = useState<string>()
const [amountMax, setAmountMax] = useState<string>() const [amountMax, setAmountMax] = useState<string>()
@ -123,7 +123,10 @@ export default function Add({
<> <>
<Header <Header
title={content.pool.add.title} title={content.pool.add.title}
backAction={() => setShowAdd(false)} backAction={() => {
setShowAdd(false)
fetchAllData()
}}
/> />
<Formik <Formik
initialValues={initialValues} initialValues={initialValues}

View File

@ -20,6 +20,7 @@ import { useWeb3 } from '@context/Web3'
import Decimal from 'decimal.js' import Decimal from 'decimal.js'
import { useAsset } from '@context/Asset' import { useAsset } from '@context/Asset'
import content from '../../../../../../content/price.json' import content from '../../../../../../content/price.json'
import { usePool } from '@context/Pool'
const slippagePresets = ['5', '10', '15', '25', '50'] const slippagePresets = ['5', '10', '15', '25', '50']
@ -29,8 +30,7 @@ export default function Remove({
poolTokens, poolTokens,
totalPoolTokens, totalPoolTokens,
tokenOutAddress, tokenOutAddress,
tokenOutSymbol, tokenOutSymbol
fetchAllData
}: { }: {
setShowRemove: (show: boolean) => void setShowRemove: (show: boolean) => void
poolAddress: string poolAddress: string
@ -38,10 +38,10 @@ export default function Remove({
totalPoolTokens: string totalPoolTokens: string
tokenOutAddress: string tokenOutAddress: string
tokenOutSymbol: string tokenOutSymbol: string
fetchAllData: () => void
}): ReactElement { }): ReactElement {
const { accountId, web3 } = useWeb3() const { accountId, web3 } = useWeb3()
const { isAssetNetwork } = useAsset() const { isAssetNetwork } = useAsset()
const { fetchAllData } = usePool()
const [amountPercent, setAmountPercent] = useState('0') const [amountPercent, setAmountPercent] = useState('0')
const [amountMaxPercent, setAmountMaxPercent] = useState('100') const [amountMaxPercent, setAmountMaxPercent] = useState('100')
@ -157,7 +157,10 @@ export default function Remove({
<div className={styles.remove}> <div className={styles.remove}>
<Header <Header
title={content.pool.remove.title} title={content.pool.remove.title}
backAction={() => setShowRemove(false)} backAction={() => {
setShowRemove(false)
fetchAllData()
}}
/> />
<form className={styles.removeInput}> <form className={styles.removeInput}>

View File

@ -49,7 +49,7 @@
padding-bottom: calc(var(--spacer) / 4); padding-bottom: calc(var(--spacer) / 4);
} }
.update:before { /* .update:before {
content: ''; content: '';
width: 6px; width: 6px;
height: 6px; height: 6px;
@ -72,4 +72,4 @@
100% { 100% {
background: transparent; background: transparent;
} }
} } */

View File

@ -29,8 +29,8 @@ export default function Pool(): ReactElement {
poolSnapshots, poolSnapshots,
hasUserAddedLiquidity, hasUserAddedLiquidity,
isRemoveDisabled, isRemoveDisabled,
refreshInterval,
fetchAllData fetchAllData
// refreshInterval
} = usePool() } = usePool()
const [showAdd, setShowAdd] = useState(false) const [showAdd, setShowAdd] = useState(false)
@ -51,7 +51,6 @@ export default function Pool(): ReactElement {
datatokenSymbol={poolInfo?.datatokenSymbol} datatokenSymbol={poolInfo?.datatokenSymbol}
tokenInAddress={poolInfo?.baseTokenAddress} tokenInAddress={poolInfo?.baseTokenAddress}
tokenInSymbol={poolInfo?.baseTokenSymbol} tokenInSymbol={poolInfo?.baseTokenSymbol}
fetchAllData={fetchAllData}
/> />
) : showRemove ? ( ) : showRemove ? (
<Remove <Remove
@ -61,7 +60,6 @@ export default function Pool(): ReactElement {
totalPoolTokens={poolInfo?.totalPoolTokens} totalPoolTokens={poolInfo?.totalPoolTokens}
tokenOutAddress={poolInfo?.baseTokenAddress} tokenOutAddress={poolInfo?.baseTokenAddress}
tokenOutSymbol={poolInfo?.baseTokenSymbol} tokenOutSymbol={poolInfo?.baseTokenSymbol}
fetchAllData={fetchAllData}
/> />
) : ( ) : (
<> <>
@ -180,7 +178,10 @@ export default function Pool(): ReactElement {
</TokenList> </TokenList>
<div className={styles.update}> <div className={styles.update}>
Fetching every {refreshInterval / 1000} sec. <Button style="text" size="small" onClick={() => fetchAllData()}>
Refresh Data
</Button>
{/* Fetching every {refreshInterval / 1000} sec. */}
</div> </div>
<div className={stylesActions.actions}> <div className={stylesActions.actions}>
<Button <Button

View File

@ -193,6 +193,7 @@ export default function FormTrade({
loaderMessage="Swapping tokens..." loaderMessage="Swapping tokens..."
successMessage="Successfully swapped tokens." successMessage="Successfully swapped tokens."
actionName={content.trade.action} actionName={content.trade.action}
slippage={values.slippage}
amount={ amount={
values.type === 'sell' values.type === 'sell'
? values.datatoken ? values.datatoken

View File

@ -4,10 +4,13 @@ import {
Field, Field,
FieldInputProps, FieldInputProps,
FormikContextType, FormikContextType,
useFormikContext useFormikContext,
useField
} from 'formik' } from 'formik'
import Input from '@shared/FormInput' import debounce from 'lodash.debounce'
import Button from '@shared/atoms/Button' import Button from '@shared/atoms/Button'
import Input from '@shared/FormInput'
import Error from '@shared/FormInput/Error'
import { FormTradeData, TradeItem } from './_types' import { FormTradeData, TradeItem } from './_types'
import UserLiquidity from '../UserLiquidity' import UserLiquidity from '../UserLiquidity'
import { useWeb3 } from '@context/Web3' import { useWeb3 } from '@context/Web3'
@ -28,11 +31,10 @@ export default function TradeInput({
// Connect with form // Connect with form
const { const {
handleChange, handleChange,
setFieldValue,
validateForm, validateForm,
values values
}: FormikContextType<FormTradeData> = useFormikContext() }: FormikContextType<FormTradeData> = useFormikContext()
const [field, meta] = useField(name)
const isTopField = const isTopField =
(name === 'baseToken' && values.type === 'buy') || (name === 'baseToken' && values.type === 'buy') ||
(name === 'datatoken' && values.type === 'sell') (name === 'datatoken' && values.type === 'sell')
@ -61,11 +63,13 @@ export default function TradeInput({
form={form} form={form}
value={`${field.value}`} value={`${field.value}`}
onChange={(e: ChangeEvent<HTMLInputElement>) => { onChange={(e: ChangeEvent<HTMLInputElement>) => {
handleValueChange(name, Number(e.target.value))
validateForm()
handleChange(e) handleChange(e)
handleValueChange(name, Number(e.target.value))
// debounce needed to avoid validating the wrong (pass) value
debounce(() => validateForm(), 100)
}} }}
disabled={!accountId || disabled} disabled={!accountId || disabled}
additionalComponent={<Error meta={meta} />}
/> />
)} )}
</Field> </Field>

View File

@ -149,25 +149,12 @@ export default function AssetActions({
/> />
) )
const tabs: TabsItem[] = [ const tabs: TabsItem[] = [{ title: 'Use', content: UseContent }]
{
title: 'Use',
content: UseContent
}
]
asset?.accessDetails?.type === 'dynamic' && asset?.accessDetails?.type === 'dynamic' &&
tabs.push( tabs.push(
{ { title: 'Pool', content: <Pool /> },
title: 'Pool', { title: 'Trade', content: <Trade /> }
content: <Pool />,
disabled: asset?.accessDetails.datatoken.name === ''
},
{
title: 'Trade',
content: <Trade />,
disabled: asset?.accessDetails.datatoken.name === ''
}
) )
return ( return (

View File

@ -1,18 +1,20 @@
import React, { ReactElement } from 'react' import React, { ReactElement } from 'react'
import styles from './index.module.css' import styles from './index.module.css'
import { Asset } from '@oceanprotocol/lib' import { AssetExtended } from 'src/@types/AssetExtended'
import { decodeTokenURI } from '@utils/nft' import { decodeTokenURI } from '@utils/nft'
import MetaAsset from './MetaAsset' import MetaAsset from './MetaAsset'
import MetaInfo from './MetaInfo' import MetaInfo from './MetaInfo'
import Tooltip from '@shared/atoms/Tooltip' import Tooltip from '@shared/atoms/Tooltip'
import NftTooltip from './NftTooltip' import NftTooltip from './NftTooltip'
import Logo from '@shared/atoms/Logo' import Logo from '@shared/atoms/Logo'
import { FormPublishData } from '../../../Publish/_types'
import { useFormikContext } from 'formik'
export default function MetaMain({ export default function MetaMain({
asset, asset,
nftPublisher nftPublisher
}: { }: {
asset: Asset asset: AssetExtended
nftPublisher: string nftPublisher: string
}): ReactElement { }): ReactElement {
const nftMetadata = decodeTokenURI(asset?.nft?.tokenURI) const nftMetadata = decodeTokenURI(asset?.nft?.tokenURI)
@ -20,12 +22,28 @@ export default function MetaMain({
const blockscoutNetworks = [1287, 2021000, 2021001, 44787, 246, 1285] const blockscoutNetworks = [1287, 2021000, 2021001, 44787, 246, 1285]
const isBlockscoutExplorer = blockscoutNetworks.includes(asset?.chainId) const isBlockscoutExplorer = blockscoutNetworks.includes(asset?.chainId)
// TODO: using this for the publish preview works fine, but produces a console warning
// on asset details page as there is no formik context there:
// Warning: Formik context is undefined, please verify you are calling useFormikContext()
// as child of a <Formik> component.
const formikState = useFormikContext<FormPublishData>()
// checking if the NFT has an image associated (tokenURI)
// if tokenURI is undefined, then we are in Preview
// for Preview we need to show accessDetails.dataImage
// as this is where the NFT's SVG (during publish) is stored
const nftImage = nftMetadata?.image_data
? nftMetadata.image_data
: formikState?.values?.metadata?.nft?.image_data
? formikState.values.metadata.nft.image_data
: null
return ( return (
<aside className={styles.meta}> <aside className={styles.meta}>
<header className={styles.asset}> <header className={styles.asset}>
<div className={styles.nftImage}> <div className={styles.nftImage}>
{nftMetadata?.image_data ? ( {nftImage ? (
<img src={nftMetadata?.image_data} alt={asset?.nft?.name} /> <img src={nftImage} alt={asset?.nft?.name} />
) : ( ) : (
<Logo noWordmark /> <Logo noWordmark />
)} )}

View File

@ -14,14 +14,14 @@ export default function DebugEditMetadata({
const linksTransformed = values.links?.length && const linksTransformed = values.links?.length &&
values.links[0].valid && [values.links[0].url.replace('javascript:', '')] values.links[0].valid && [values.links[0].url.replace('javascript:', '')]
const newMetadata: Metadata = { const newMetadata: Metadata = {
...asset.metadata, ...asset?.metadata,
name: values.name, name: values.name,
description: values.description, description: values.description,
links: linksTransformed, links: linksTransformed,
author: values.author author: values.author
} }
const updatedService: Service = { const updatedService: Service = {
...asset.services[0], ...asset?.services[0],
timeout: mapTimeoutStringToSeconds(values.timeout) timeout: mapTimeoutStringToSeconds(values.timeout)
} }
const updatedAsset: Asset = { const updatedAsset: Asset = {

View File

@ -17,7 +17,6 @@ import { mapTimeoutStringToSeconds } from '@utils/ddo'
import styles from './index.module.css' import styles from './index.module.css'
import content from '../../../../content/pages/edit.json' import content from '../../../../content/pages/edit.json'
import { AssetExtended } from 'src/@types/AssetExtended' import { AssetExtended } from 'src/@types/AssetExtended'
import { setMinterToPublisher, setMinterToDispenser } from '@utils/dispenser'
import { useAbortController } from '@hooks/useAbortController' import { useAbortController } from '@hooks/useAbortController'
import DebugEditMetadata from './DebugEditMetadata' import DebugEditMetadata from './DebugEditMetadata'
import { getOceanConfig } from '@utils/ocean' import { getOceanConfig } from '@utils/ocean'
@ -36,7 +35,6 @@ export default function Edit({
const newAbortController = useAbortController() const newAbortController = useAbortController()
const [success, setSuccess] = useState<string>() const [success, setSuccess] = useState<string>()
const [error, setError] = useState<string>() const [error, setError] = useState<string>()
const [timeoutStringValue, setTimeoutStringValue] = useState<string>()
const isComputeType = asset?.services[0]?.type === 'compute' const isComputeType = asset?.services[0]?.type === 'compute'
const hasFeedback = error || success const hasFeedback = error || success
@ -130,7 +128,7 @@ export default function Edit({
await handleSubmit(values, resetForm) await handleSubmit(values, resetForm)
}} }}
> >
{({ isSubmitting, values, initialValues }) => {({ isSubmitting, values }) =>
isSubmitting || hasFeedback ? ( isSubmitting || hasFeedback ? (
<EditFeedback <EditFeedback
title="Updating Data Set" title="Updating Data Set"
@ -151,8 +149,6 @@ export default function Edit({
<article> <article>
<FormEditMetadata <FormEditMetadata
data={content.form.data} data={content.form.data}
setTimeoutStringValue={setTimeoutStringValue}
values={initialValues}
showPrice={asset?.accessDetails?.type === 'fixed'} showPrice={asset?.accessDetails?.type === 'fixed'}
isComputeDataset={isComputeType} isComputeDataset={isComputeType}
/> />

View File

@ -18,3 +18,15 @@
margin-left: calc(var(--spacer) / 2); margin-left: calc(var(--spacer) / 2);
margin-right: calc(var(--spacer) / 2); margin-right: calc(var(--spacer) / 2);
} }
.actions a {
padding: calc(var(--spacer) / 3);
font-weight: var(--font-weight-bold);
text-transform: uppercase;
transition: 0.2s ease-out;
}
.actions a:hover {
transform: translate3d(0, -0.05rem, 0);
text-decoration: none;
}

View File

@ -3,15 +3,14 @@ import React, { ReactElement } from 'react'
import { useAsset } from '@context/Asset' import { useAsset } from '@context/Asset'
import Button from '@shared/atoms/Button' import Button from '@shared/atoms/Button'
import styles from './FormActions.module.css' import styles from './FormActions.module.css'
import Link from 'next/link'
export default function FormActions({ export default function FormActions({
setShowEdit,
handleClick handleClick
}: { }: {
setShowEdit: (show: boolean) => void
handleClick?: () => void handleClick?: () => void
}): ReactElement { }): ReactElement {
const { isAssetNetwork } = useAsset() const { isAssetNetwork, asset } = useAsset()
const { isValid }: FormikContextType<Partial<any>> = useFormikContext() const { isValid }: FormikContextType<Partial<any>> = useFormikContext()
return ( return (
@ -23,9 +22,9 @@ export default function FormActions({
> >
Submit Submit
</Button> </Button>
<Button style="text" onClick={() => setShowEdit(false)}> <Link href={`/asset/${asset?.id}`} key={asset?.id}>
Cancel Cancel
</Button> </Link>
</footer> </footer>
) )
} }

View File

@ -27,7 +27,6 @@ export default function FormEditComputeDataset({
}): ReactElement { }): ReactElement {
const { appConfig } = useSiteMetadata() const { appConfig } = useSiteMetadata()
const { asset } = useAsset() const { asset } = useAsset()
const [showEditCompute, setShowEditCompute] = useState<boolean>()
const { values }: FormikContextType<ComputePrivacyForm> = useFormikContext() const { values }: FormikContextType<ComputePrivacyForm> = useFormikContext()
const [allAlgorithms, setAllAlgorithms] = useState<AssetSelectionAsset[]>() const [allAlgorithms, setAllAlgorithms] = useState<AssetSelectionAsset[]>()
const newCancelToken = useCancelToken() const newCancelToken = useCancelToken()
@ -83,8 +82,7 @@ export default function FormEditComputeDataset({
/> />
))} ))}
{/* <FormActions setShowEdit={setShowEdit} /> */} <FormActions />
<FormActions setShowEdit={setShowEditCompute} />
</Form> </Form>
) )
} }

View File

@ -53,19 +53,14 @@ function handleTimeoutCustomOption(
export default function FormEditMetadata({ export default function FormEditMetadata({
data, data,
setTimeoutStringValue,
values,
showPrice, showPrice,
isComputeDataset isComputeDataset
}: { }: {
data: InputProps[] data: InputProps[]
setTimeoutStringValue: (value: string) => void
values: Partial<MetadataEditForm>
showPrice: boolean showPrice: boolean
isComputeDataset: boolean isComputeDataset: boolean
}): ReactElement { }): ReactElement {
const { oceanConfig } = useAsset() const { oceanConfig } = useAsset()
const [showEdit, setShowEdit] = useState<boolean>()
const { const {
validateField, validateField,
setFieldValue setFieldValue
@ -118,10 +113,7 @@ export default function FormEditMetadata({
) )
)} )}
<FormActions <FormActions />
setShowEdit={setShowEdit}
// handleClick={() => setTimeoutStringValue(values?.services[0]?.timeout)}
/>
</Form> </Form>
) )
} }

View File

@ -32,6 +32,8 @@
.description { .description {
font-size: var(--font-size-large); font-size: var(--font-size-large);
margin: calc(var(--spacer) * 0.3 / var(--line-height)) 0
calc(var(--spacer) / var(--line-height)) 0;
} }
.title { .title {

View File

@ -11,24 +11,19 @@ import { useWeb3 } from '@context/Web3'
import Alert from '@shared/atoms/Alert' import Alert from '@shared/atoms/Alert'
export default function Edit({ uri }: { uri: string }): ReactElement { export default function Edit({ uri }: { uri: string }): ReactElement {
const { asset, error, loading, owner } = useAsset() const { asset, error, isInPurgatory, owner, title } = useAsset()
const [isCompute, setIsCompute] = useState(false) const [isCompute, setIsCompute] = useState(false)
const [isOnwer, setIsOwner] = useState(false) const [pageTitle, setPageTitle] = useState<string>('')
const { accountId } = useWeb3() const { accountId } = useWeb3()
// Switch type value upon tab change
function handleTabChange(tabName: string) {
LoggerInstance.log('switched to tab', tabName)
// add store restore from
}
useEffect(() => { useEffect(() => {
if (!asset || error) { if (!asset || error || accountId !== owner) {
setPageTitle('Edit action not available')
return return
} }
setPageTitle(isInPurgatory ? '' : `Edit ${title}`)
setIsCompute(asset?.services[0]?.type === 'compute') setIsCompute(asset?.services[0]?.type === 'compute')
setIsOwner(owner === accountId) }, [asset, error, isInPurgatory, title])
}, [asset, error])
const tabs = [ const tabs = [
{ {
@ -42,23 +37,14 @@ export default function Edit({ uri }: { uri: string }): ReactElement {
} }
].filter((tab) => tab !== undefined) ].filter((tab) => tab !== undefined)
return asset && !loading && isOnwer ? ( return asset && asset?.accessDetails && accountId === owner ? (
<Page uri={uri}> <Page title={pageTitle} noPageHeader uri={uri}>
<div className={styles.contianer}> <div className={styles.container}>
<Tabs <Tabs items={tabs} defaultIndex={0} className={styles.edit} />
items={tabs}
handleTabChange={handleTabChange}
defaultIndex={0}
className={styles.edit}
/>
</div> </div>
</Page> </Page>
) : !isOnwer ? ( ) : asset && asset?.accessDetails && accountId !== owner ? (
<Page <Page title={pageTitle} noPageHeader uri={uri}>
title="Edit action available only to asset owner"
noPageHeader
uri={uri}
>
<Alert <Alert
title="Edit action available only to asset owner" title="Edit action available only to asset owner"
text={error} text={error}
@ -66,7 +52,7 @@ export default function Edit({ uri }: { uri: string }): ReactElement {
/> />
</Page> </Page>
) : ( ) : (
<Page title={undefined} uri={uri}> <Page title={pageTitle} noPageHeader uri={uri}>
<Loader /> <Loader />
</Page> </Page>
) )

View File

@ -5,7 +5,7 @@ import { PoolShares_poolShares as PoolShare } from '../../../../@types/subgraph/
import { AssetPoolShare } from '.' import { AssetPoolShare } from '.'
import { Asset } from '@oceanprotocol/lib' import { Asset } from '@oceanprotocol/lib'
function getAsset(items: Asset[], datatoken: string): Asset { export function getAsset(items: Asset[], datatoken: string): Asset {
for (let i = 0; i < items.length; i++) { for (let i = 0; i < items.length; i++) {
if ( if (
items[i].datatokens[0].address.toLowerCase() === datatoken.toLowerCase() items[i].datatokens[0].address.toLowerCase() === datatoken.toLowerCase()
@ -36,7 +36,6 @@ export async function getAssetsFromPoolShares(
data[i].pool.totalShares, data[i].pool.totalShares,
data[i].pool.baseTokenLiquidity data[i].pool.baseTokenLiquidity
) )
console.log(data[i].pool.datatoken.address, userLiquidity)
assetList.push({ assetList.push({
poolShare: data[i], poolShare: data[i],
userLiquidity, userLiquidity,

View File

@ -4,6 +4,10 @@
margin-bottom: var(--spacer); margin-bottom: var(--spacer);
margin-left: calc(var(--spacer) / -4); margin-left: calc(var(--spacer) / -4);
margin-right: calc(var(--spacer) / -4); margin-right: calc(var(--spacer) / -4);
/* Disable all user actions as to not run into unintended
consequences of browsing away from publish. */
pointer-events: none;
} }
@media (min-width: 60rem) { @media (min-width: 60rem) {

View File

@ -4,7 +4,7 @@ import InputElement from '@shared/FormInput/InputElement'
import Logo from '@images/logo.svg' import Logo from '@images/logo.svg'
import Conversion from '@shared/Price/Conversion' import Conversion from '@shared/Price/Conversion'
import { useField } from 'formik' import { useField } from 'formik'
import Error from './Error' import Error from '@shared/FormInput/Error'
export default function Coin({ export default function Coin({
datatokenOptions, datatokenOptions,

View File

@ -3,7 +3,7 @@ import Tooltip from '@shared/atoms/Tooltip'
import styles from './Fees.module.css' import styles from './Fees.module.css'
import { useField } from 'formik' import { useField } from 'formik'
import Input from '@shared/FormInput' import Input from '@shared/FormInput'
import Error from './Error' import Error from '@shared/FormInput/Error'
import { getOpcFees } from '../../../@utils/subgraph' import { getOpcFees } from '../../../@utils/subgraph'
import { OpcFeesQuery_opc as OpcFeesData } from '../../../@types/subgraph/OpcFeesQuery' import { OpcFeesQuery_opc as OpcFeesData } from '../../../@types/subgraph/OpcFeesQuery'
import { useWeb3 } from '@context/Web3' import { useWeb3 } from '@context/Web3'

View File

@ -2,7 +2,7 @@ import Conversion from '@shared/Price/Conversion'
import { Field, useField, useFormikContext } from 'formik' import { Field, useField, useFormikContext } from 'formik'
import React, { ReactElement } from 'react' import React, { ReactElement } from 'react'
import Input from '@shared/FormInput' import Input from '@shared/FormInput'
import Error from './Error' import Error from '@shared/FormInput/Error'
import PriceUnit from '@shared/Price/PriceUnit' import PriceUnit from '@shared/Price/PriceUnit'
import styles from './Price.module.css' import styles from './Price.module.css'
import { FormPublishData } from '../_types' import { FormPublishData } from '../_types'

View File

@ -8,7 +8,7 @@ export default function PageAssetDetails(): ReactElement {
const { did } = router.query const { did } = router.query
return ( return (
<AssetProvider did={did as string}> <AssetProvider did={did as string}>
<PageTemplateAssetDetails uri={router.pathname} /> <PageTemplateAssetDetails uri={router.asPath} />
</AssetProvider> </AssetProvider>
) )
} }