mirror of
https://github.com/oceanprotocol/react.git
synced 2024-12-22 17:23:32 +01:00
lib update
This commit is contained in:
parent
c93784720b
commit
92c4e4ba51
@ -7,7 +7,8 @@ module.exports = function override(config, env) {
|
||||
...config.resolve,
|
||||
alias: {
|
||||
...config.resolve.alias,
|
||||
react: path.resolve('../node_modules/react')
|
||||
react: path.resolve('../node_modules/react'),
|
||||
"@oceanprotocol/lib": path.resolve('../node_modules/@oceanprotocol/lib')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
6917
example/package-lock.json
generated
6917
example/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -7,7 +7,7 @@ import { Metadata } from '@oceanprotocol/lib/dist/node/ddo/interfaces/Metadata'
|
||||
|
||||
export function Publish() {
|
||||
const { publish, publishStepText, isLoading } = usePublish()
|
||||
const [ddo, setDdo] = useState<DDO | undefined>()
|
||||
const [ddo, setDdo] = useState<DDO | undefined|null>()
|
||||
|
||||
const asset = {
|
||||
main: {
|
||||
|
20
package-lock.json
generated
20
package-lock.json
generated
@ -1434,19 +1434,20 @@
|
||||
}
|
||||
},
|
||||
"@oceanprotocol/contracts": {
|
||||
"version": "0.4.1",
|
||||
"resolved": "https://registry.npmjs.org/@oceanprotocol/contracts/-/contracts-0.4.1.tgz",
|
||||
"integrity": "sha512-gc6bCt3pq9cpk1mYDKfsZhLlaM+8yQDFmOjtmT1KGXRmnTBcvmwCQXMrL5VohFaFi7Iqio3FZtuhYyRaEjikCw=="
|
||||
"version": "0.4.4",
|
||||
"resolved": "https://registry.npmjs.org/@oceanprotocol/contracts/-/contracts-0.4.4.tgz",
|
||||
"integrity": "sha512-0+Tp6UdoDTBJZp4yX3kkSrV+CcOS/hJ3SJ4HuWiL5FE5Nlj3JCeV86iuWPkFuXzIdgri00DaGvQhP58knzJ2Uw=="
|
||||
},
|
||||
"@oceanprotocol/lib": {
|
||||
"version": "0.2.5",
|
||||
"resolved": "https://registry.npmjs.org/@oceanprotocol/lib/-/lib-0.2.5.tgz",
|
||||
"integrity": "sha512-zd4xtawMftqJzak+EnAcHOorNL556w2L4DiOipP2tgVsBQmHgkPCWr65EL9dVuETFtGtatOb1RfdkyZPM0P2lA==",
|
||||
"version": "0.3.1",
|
||||
"resolved": "https://registry.npmjs.org/@oceanprotocol/lib/-/lib-0.3.1.tgz",
|
||||
"integrity": "sha512-SaVT6GVYDslSi+rFzTk7IlvEwDPmGALw1cZaYdTByP7z4FSqJUZ2OCJ7kskG614InqbPu4Dg/utx9LKoiAC6YQ==",
|
||||
"requires": {
|
||||
"@ethereum-navigator/navigator": "^0.5.0",
|
||||
"@oceanprotocol/contracts": "^0.4.1",
|
||||
"@oceanprotocol/contracts": "^0.4.4",
|
||||
"decimal.js": "^10.2.0",
|
||||
"fs": "0.0.1-security",
|
||||
"lzma": "^2.3.2",
|
||||
"node-fetch": "^2.6.1",
|
||||
"save-file": "^2.3.1",
|
||||
"uuid": "^8.3.0",
|
||||
@ -6273,6 +6274,11 @@
|
||||
"integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==",
|
||||
"dev": true
|
||||
},
|
||||
"lzma": {
|
||||
"version": "2.3.2",
|
||||
"resolved": "https://registry.npmjs.org/lzma/-/lzma-2.3.2.tgz",
|
||||
"integrity": "sha1-N4OySFi5wOdHoN88vx+1/KqSxEE="
|
||||
},
|
||||
"macos-release": {
|
||||
"version": "2.4.1",
|
||||
"resolved": "https://registry.npmjs.org/macos-release/-/macos-release-2.4.1.tgz",
|
||||
|
@ -25,7 +25,7 @@
|
||||
"dist/"
|
||||
],
|
||||
"dependencies": {
|
||||
"@oceanprotocol/lib": "^0.2.5",
|
||||
"@oceanprotocol/lib": "^0.3.1",
|
||||
"axios": "^0.20.0",
|
||||
"decimal.js": "^10.2.0",
|
||||
"web3": "^1.3.0",
|
||||
|
@ -82,7 +82,7 @@ function useCompute(): UseCompute {
|
||||
computeService,
|
||||
rawAlgorithmMeta
|
||||
)
|
||||
const order = await ocean.compute.order(
|
||||
const tokenTransfer = await ocean.compute.order(
|
||||
accountId,
|
||||
did,
|
||||
computeService.index,
|
||||
@ -91,18 +91,18 @@ function useCompute(): UseCompute {
|
||||
)
|
||||
|
||||
setStep(1)
|
||||
const computeOrder = JSON.parse(order)
|
||||
Logger.log('compute order', computeOrder)
|
||||
const tokenTransfer = await ocean.datatokens.transferWei(
|
||||
computeOrder.dataToken,
|
||||
computeOrder.to,
|
||||
String(computeOrder.numTokens),
|
||||
computeOrder.from
|
||||
)
|
||||
// const computeOrder = JSON.parse(order)
|
||||
// Logger.log('compute order', computeOrder)
|
||||
// const tokenTransfer = await ocean.datatokens.transferWei(
|
||||
// computeOrder.dataToken,
|
||||
// computeOrder.to,
|
||||
// String(computeOrder.numTokens),
|
||||
// computeOrder.from
|
||||
// )
|
||||
setStep(2)
|
||||
const response = await ocean.compute.start(
|
||||
did,
|
||||
(tokenTransfer as any).transactionHash,
|
||||
tokenTransfer,
|
||||
dataTokenAddress,
|
||||
account,
|
||||
undefined,
|
||||
|
@ -50,27 +50,27 @@ function useConsume(): UseConsume {
|
||||
await checkAndBuyDT(ocean, dataTokenAddress, account, config)
|
||||
|
||||
setStep(1)
|
||||
const order = await ocean.assets.order(
|
||||
const tokenTransfer = await ocean.assets.order(
|
||||
did as string,
|
||||
serviceType,
|
||||
accountId
|
||||
)
|
||||
Logger.log('order created', order)
|
||||
Logger.log('order created', tokenTransfer)
|
||||
setStep(2)
|
||||
const res = JSON.parse(order)
|
||||
Logger.log('order parsed', res)
|
||||
Logger.log('ocean.datatokens before transfer', ocean.datatokens)
|
||||
const tokenTransfer = await ocean.datatokens.transferWei(
|
||||
res.dataToken,
|
||||
res.to,
|
||||
String(res.numTokens),
|
||||
res.from
|
||||
)
|
||||
Logger.log('token transfered', tokenTransfer)
|
||||
// const res = JSON.parse(order)
|
||||
// Logger.log('order parsed', res)
|
||||
// Logger.log('ocean.datatokens before transfer', ocean.datatokens)
|
||||
// const tokenTransfer = await ocean.datatokens.transferWei(
|
||||
// res.dataToken,
|
||||
// res.to,
|
||||
// String(res.numTokens),
|
||||
// res.from
|
||||
// )
|
||||
// Logger.log('token transfered', tokenTransfer)
|
||||
setStep(3)
|
||||
await ocean.assets.download(
|
||||
did as string,
|
||||
(tokenTransfer as any).transactionHash,
|
||||
tokenTransfer,
|
||||
dataTokenAddress,
|
||||
account,
|
||||
''
|
||||
|
Loading…
Reference in New Issue
Block a user