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

Support for Moonbase Alpha (#552)

* upgrading to ocean.js 0.14.6

* proper ocean.js update

* make all explorer links work

* handle new moonbeamalpha config

* add moonbase alpha to chain user preferences

* more ocean.js v0.14 updates

* switch to grid

* upgrading ocean.js to 0.14.7

* lock to @oceanprotocol/contracts v0.5.16

Co-authored-by: Matthias Kretschmann <m@kretschmann.io>
This commit is contained in:
Jamie Hewitt 2021-04-29 15:48:57 +03:00 committed by GitHub
parent 020d4fa05a
commit 0a739cbe93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 33 additions and 29 deletions

View File

@ -1,5 +1,5 @@
# Default network, possible values: # Default network, possible values:
# "development", "ropsten", "rinkeby", "mainnet", "polygon" # "development", "ropsten", "rinkeby", "mainnet", "polygon", "moonbeamalpha"
GATSBY_NETWORK="rinkeby" GATSBY_NETWORK="rinkeby"
#GATSBY_INFURA_PROJECT_ID="xxx" #GATSBY_INFURA_PROJECT_ID="xxx"

30
package-lock.json generated
View File

@ -1573,16 +1573,16 @@
} }
}, },
"@ethereum-navigator/atlas": { "@ethereum-navigator/atlas": {
"version": "0.7.1", "version": "0.7.3",
"resolved": "https://registry.npmjs.org/@ethereum-navigator/atlas/-/atlas-0.7.1.tgz", "resolved": "https://registry.npmjs.org/@ethereum-navigator/atlas/-/atlas-0.7.3.tgz",
"integrity": "sha512-YV7tMVwpRcJbc+Kj/Rr0RzNV/2hHBEEM1/tMWDVLB15dGJfoQuRfPJpFt6uq+Ji6s3EkldIt9kZylEeG5ALKAA==" "integrity": "sha512-kCyV/8wOqSU/gn+H7uSaR/Xc+ZogXrW2QmF5MfZL2+NUS4+y0emlfBphTGwP5bOB0Cg2goJTcI7Y6+0LNcJYzg=="
}, },
"@ethereum-navigator/navigator": { "@ethereum-navigator/navigator": {
"version": "0.5.2", "version": "0.5.3",
"resolved": "https://registry.npmjs.org/@ethereum-navigator/navigator/-/navigator-0.5.2.tgz", "resolved": "https://registry.npmjs.org/@ethereum-navigator/navigator/-/navigator-0.5.3.tgz",
"integrity": "sha512-agSE2xzLxOKKid8QiS4v8jPhnFXW5uSXsICZ4JmS437aCZ8L3SUAy3cDQKikHb2PPZ3AazJO05k8m8i6u77peQ==", "integrity": "sha512-AOhS1EXPrVeWbLvW3fVbw5AZ2mPYXDKOqMojgVz602U/tEjRXAsw/Gwa+oSOssAyU37SNKBaIorEhBiEY+RYdA==",
"requires": { "requires": {
"@ethereum-navigator/atlas": "^0.7.1", "@ethereum-navigator/atlas": "^0.7.2",
"web3": "^1.2.7" "web3": "^1.2.7"
} }
}, },
@ -3622,17 +3622,17 @@
"integrity": "sha512-j4PEZSVtKSqxDYMVh/hd5vk088Bg6a6QkrUMTXN9Q6OIFAMfHM235f1AxaakNrEyK0FKMD908KuJEdfFLRn9Hw==" "integrity": "sha512-j4PEZSVtKSqxDYMVh/hd5vk088Bg6a6QkrUMTXN9Q6OIFAMfHM235f1AxaakNrEyK0FKMD908KuJEdfFLRn9Hw=="
}, },
"@oceanprotocol/contracts": { "@oceanprotocol/contracts": {
"version": "0.5.15", "version": "0.5.16",
"resolved": "https://registry.npmjs.org/@oceanprotocol/contracts/-/contracts-0.5.15.tgz", "resolved": "https://registry.npmjs.org/@oceanprotocol/contracts/-/contracts-0.5.16.tgz",
"integrity": "sha512-16edzNeO2v5WLW9ClsZ9VvMH1w24fZZutCmDhZWPirCAIdojGWRHraompfICjY1fovDljnZ5MpJpffuQ6kgxOA==" "integrity": "sha512-p7aFIUT8RVoMzdPP7ML8G08BnQ09syywKjOT16hqJm0GmofunEuVffUXbryG4EkQ+qRbf/zeoxSmesi79kQXlA=="
}, },
"@oceanprotocol/lib": { "@oceanprotocol/lib": {
"version": "0.14.4", "version": "0.14.7",
"resolved": "https://registry.npmjs.org/@oceanprotocol/lib/-/lib-0.14.4.tgz", "resolved": "https://registry.npmjs.org/@oceanprotocol/lib/-/lib-0.14.7.tgz",
"integrity": "sha512-f6Wj6FLpYmuFSGtnDw0lex0Vru1tGgvZqtwrdBYtMD+hW6Bn3B51+F/9ACVYAiSRDADrqPTDZiZetT2Ji3QY7Q==", "integrity": "sha512-xnf2XX3VjmsvcNjLi8nwfWryTNT/t/oK+eOttOu5CrOBEm4Ghi98LKT1zX3ZlE4WObUDypaXDIkLuaxCtBVOOg==",
"requires": { "requires": {
"@ethereum-navigator/navigator": "^0.5.2", "@ethereum-navigator/navigator": "^0.5.2",
"@oceanprotocol/contracts": "^0.5.10", "@oceanprotocol/contracts": "^0.5.16",
"@types/crypto-js": "^4.0.1", "@types/crypto-js": "^4.0.1",
"cross-fetch": "^3.1.2", "cross-fetch": "^3.1.2",
"crypto-js": "^4.0.0", "crypto-js": "^4.0.0",
@ -18101,7 +18101,7 @@
} }
}, },
"ethereumjs-abi": { "ethereumjs-abi": {
"version": "git+https://github.com/ethereumjs/ethereumjs-abi.git#1ce6a1d64235fabe2aaf827fd606def55693508f", "version": "git+https://github.com/ethereumjs/ethereumjs-abi.git#1a27c59c15ab1e95ee8e5c4ed6ad814c49cc439e",
"from": "git+https://github.com/ethereumjs/ethereumjs-abi.git", "from": "git+https://github.com/ethereumjs/ethereumjs-abi.git",
"requires": { "requires": {
"bn.js": "^4.11.8", "bn.js": "^4.11.8",

View File

@ -27,7 +27,8 @@
"@coingecko/cryptoformat": "^0.4.2", "@coingecko/cryptoformat": "^0.4.2",
"@loadable/component": "^5.14.1", "@loadable/component": "^5.14.1",
"@oceanprotocol/art": "^3.0.0", "@oceanprotocol/art": "^3.0.0",
"@oceanprotocol/lib": "^0.14.4", "@oceanprotocol/contracts": "0.5.16",
"@oceanprotocol/lib": "^0.14.7",
"@oceanprotocol/typographies": "^0.1.0", "@oceanprotocol/typographies": "^0.1.0",
"@portis/web3": "^3.0.3", "@portis/web3": "^3.0.3",
"@sindresorhus/slugify": "^1.0.0", "@sindresorhus/slugify": "^1.0.0",

View File

@ -1,14 +1,13 @@
.buttons { .buttons {
display: flex; display: grid;
justify-content: space-between; gap: calc(var(--spacer) / 4);
grid-template-columns: repeat(auto-fit, minmax(6rem, 1fr));
padding-bottom: calc(var(--spacer) / 8); padding-bottom: calc(var(--spacer) / 8);
} }
.button { .button {
display: block; width: auto;
flex: 0 0 48%; padding: calc(var(--spacer) / 3) calc(var(--spacer) / 4) !important;
padding: calc(var(--spacer) / 3) calc(var(--spacer) / 2)
calc(var(--spacer) / 4) calc(var(--spacer) / 2) !important;
border-radius: var(--border-radius); border-radius: var(--border-radius);
text-transform: none; text-transform: none;
} }

View File

@ -18,8 +18,9 @@ export default function Chain(): ReactElement {
} }
const chains = [ const chains = [
{ name: 'ETH', oceanConfig: 'mainnet' }, { name: 'ETH', oceanConfig: 'mainnet', label: 'Mainnet' },
{ name: 'Polygon/Matic', oceanConfig: 'polygon' } { name: 'Polygon/Matic', oceanConfig: 'polygon', label: 'Mainnet' },
{ name: 'Moonbase Alpha', oceanConfig: 'moonbeamalpha', label: 'Testnet' }
] ]
// TODO: to fully solve https://github.com/oceanprotocol/market/issues/432 // TODO: to fully solve https://github.com/oceanprotocol/market/issues/432
@ -42,7 +43,7 @@ export default function Chain(): ReactElement {
onClick={() => connectOcean(button.oceanConfig)} onClick={() => connectOcean(button.oceanConfig)}
> >
{button.name} {button.name}
<span>Mainnet</span> <span>{button.label}</span>
</Button> </Button>
) )
})} })}

View File

@ -252,7 +252,7 @@ export default function Pool(): ReactElement {
<ExplorerLink <ExplorerLink
networkId={networkId} networkId={networkId}
path={ path={
networkId === 137 networkId === 137 || networkId === 1287
? `tokens/${ddo.dataToken}` ? `tokens/${ddo.dataToken}`
: `token/${ddo.dataToken}` : `token/${ddo.dataToken}`
} }

View File

@ -24,7 +24,7 @@ export default function MetaMain(): ReactElement {
<ExplorerLink <ExplorerLink
networkId={networkId} networkId={networkId}
path={ path={
networkId === 137 networkId === 137 || networkId === 1287
? `tokens/${ddo?.dataToken}` ? `tokens/${ddo?.dataToken}`
: `token/${ddo?.dataToken}` : `token/${ddo?.dataToken}`
} }

View File

@ -16,7 +16,10 @@ export function getOceanConfig(
): ConfigHelperConfig { ): ConfigHelperConfig {
return new ConfigHelper().getConfig( return new ConfigHelper().getConfig(
network, network,
network === 'polygon' || network === 137 network === 'polygon' ||
network === 137 ||
network === 'moonbeamalpha' ||
network === 1287
? undefined ? undefined
: process.env.GATSBY_INFURA_PROJECT_ID : process.env.GATSBY_INFURA_PROJECT_ID
) as ConfigHelperConfig ) as ConfigHelperConfig