mirror of
https://github.com/oceanprotocol/market.git
synced 2024-11-13 16:54:53 +01:00
merged compute into subgraph-util-methods
This commit is contained in:
commit
a92a7b88d9
2
package-lock.json
generated
2
package-lock.json
generated
@ -16410,7 +16410,7 @@
|
||||
}
|
||||
},
|
||||
"ethereumjs-abi": {
|
||||
"version": "git+https://github.com/ethereumjs/ethereumjs-abi.git#1a27c59c15ab1e95ee8e5c4ed6ad814c49cc439e",
|
||||
"version": "git+https://github.com/ethereumjs/ethereumjs-abi.git#1ce6a1d64235fabe2aaf827fd606def55693508f",
|
||||
"from": "git+https://github.com/ethereumjs/ethereumjs-abi.git",
|
||||
"requires": {
|
||||
"bn.js": "^4.11.8",
|
||||
|
@ -403,11 +403,7 @@ export default function Compute({
|
||||
selectedAlgorithmAsset.dataToken
|
||||
)
|
||||
|
||||
if (
|
||||
!response ||
|
||||
response.status !== 10 ||
|
||||
response.statusText !== 'Job started'
|
||||
) {
|
||||
if (!response) {
|
||||
setError('Error starting compute job.')
|
||||
return
|
||||
}
|
||||
|
@ -136,12 +136,21 @@ function usePricing(): UsePricing {
|
||||
setStep(1, 'buy', ddo)
|
||||
|
||||
Logger.log('Price found for buying', price)
|
||||
Decimal.set({ precision: 18 })
|
||||
|
||||
switch (price?.type) {
|
||||
case 'pool': {
|
||||
const oceanAmmount = new Decimal(price.value).times(1.05).toString()
|
||||
const maxPrice = new Decimal(price.value).times(2).toString()
|
||||
|
||||
setStep(2, 'buy', ddo)
|
||||
Logger.log('Buying token from pool', price, accountId, price)
|
||||
Logger.log(
|
||||
'Buying token from pool',
|
||||
price,
|
||||
accountId,
|
||||
oceanAmmount,
|
||||
maxPrice
|
||||
)
|
||||
tx = await ocean.pool.buyDT(
|
||||
accountId,
|
||||
price.address,
|
||||
@ -198,6 +207,7 @@ function usePricing(): UsePricing {
|
||||
): Promise<TransactionReceipt | void> {
|
||||
if (!ocean || !accountId) return
|
||||
|
||||
Decimal.set({ precision: 18 })
|
||||
if (!config.oceanTokenAddress) {
|
||||
Logger.error(`'oceanTokenAddress' not set in config`)
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user