2021-04-08 17:10:51 +02:00
|
|
|
import React, { ReactElement, useEffect, useState } from 'react'
|
Start compute job (#439)
* Wip start compute job
* Wip select algorithm design
* Asset selection form component, for start compute job (#442)
* prototype AssetSelection
* assetselection styling
* typing "fix"
* put back file info icon
* AssetSelection styling in context
* update start job method, fixed algo select, and fixed option typing
* compute logic update
* add has previous orders for algo asset
* fixed search algorithm assets in start compute form
* fixed lint errors
* updated previous order for algo logic and compute flow
* update use price hook and added buy DT for algo
* display only alg of type exchange and sort by value
* display only trusted algo for asset if field is set
* added logic for allow all published algorithms or no algorithms allowed
* asset selection style & spacing tweaks
* refactor get algorithms for compute and edit compute
* fixed form options and more refactoring
* new ButtonBuy component
* shared component between consume/compute
* dealing with various states: loading, previous orders, help text output
* effect dependencies
* move error output into toast
* formik data flow refactor
* ditch custom field change handler
* fix initialValues
* typed form data & validation
* fixes multiple form validation issues along the way
* isInitialValid → validateOnMount
* metadata display tweaks
* error feedback tweaks
* oler assets checks, confeti on succes job, market fee on order, removed algo compute logic
* more startJob logging
* feedback & messaging changes
* metadata display
* return all algos, fixed & dynamic priced ones
* fix DOM nesting
* messaging updates
* copy tweaks
* check algorithm previous history for both acces and compute sercive types
* handle start compute error
* extra checks on start compute response
* styling tweaks, fix toast UI errors
* AssetSelection: empty screen, tweak min/max height
* fix FRE issues on start compute
* check is ordarable before start compute job
* logging tweaks
* disable eslint no-unused-vars rule for some Apollo code blocks
* fix metadata editing for compute assets
* consider dataset timeout for compute too
Co-authored-by: Matthias Kretschmann <m@kretschmann.io>
2021-04-01 17:21:08 +02:00
|
|
|
import styles from './FormComputeDataset.module.css'
|
|
|
|
import { Field, Form, FormikContextType, useFormikContext } from 'formik'
|
2021-11-15 19:29:20 +01:00
|
|
|
import Input from '@shared/FormInput'
|
2022-11-04 14:52:40 +01:00
|
|
|
import { AssetSelectionAsset } from '@shared/FormInput/InputElement/AssetSelection'
|
2021-10-13 18:48:59 +02:00
|
|
|
import { compareAsBN } from '@utils/numbers'
|
2022-11-04 14:52:40 +01:00
|
|
|
import ButtonBuy from '../ButtonBuy'
|
2021-04-08 17:10:51 +02:00
|
|
|
import PriceOutput from './PriceOutput'
|
2021-10-13 18:48:59 +02:00
|
|
|
import { useAsset } from '@context/Asset'
|
|
|
|
import { useWeb3 } from '@context/Web3'
|
2021-10-27 12:27:14 +02:00
|
|
|
import content from '../../../../../content/pages/startComputeDataset.json'
|
2022-06-17 14:51:16 +02:00
|
|
|
import { Asset, ZERO_ADDRESS } from '@oceanprotocol/lib'
|
2022-06-23 17:53:05 +02:00
|
|
|
import { getAccessDetails } from '@utils/accessDetailsAndPricing'
|
2022-06-08 10:46:46 +02:00
|
|
|
import { useMarketMetadata } from '@context/MarketMetadata'
|
|
|
|
import Alert from '@shared/atoms/Alert'
|
2022-08-03 14:48:57 +02:00
|
|
|
import { getTokenBalanceFromSymbol } from '@utils/web3'
|
2022-11-02 16:24:20 +01:00
|
|
|
import { MAX_DECIMALS } from '@utils/constants'
|
|
|
|
import Decimal from 'decimal.js'
|
Start compute job (#439)
* Wip start compute job
* Wip select algorithm design
* Asset selection form component, for start compute job (#442)
* prototype AssetSelection
* assetselection styling
* typing "fix"
* put back file info icon
* AssetSelection styling in context
* update start job method, fixed algo select, and fixed option typing
* compute logic update
* add has previous orders for algo asset
* fixed search algorithm assets in start compute form
* fixed lint errors
* updated previous order for algo logic and compute flow
* update use price hook and added buy DT for algo
* display only alg of type exchange and sort by value
* display only trusted algo for asset if field is set
* added logic for allow all published algorithms or no algorithms allowed
* asset selection style & spacing tweaks
* refactor get algorithms for compute and edit compute
* fixed form options and more refactoring
* new ButtonBuy component
* shared component between consume/compute
* dealing with various states: loading, previous orders, help text output
* effect dependencies
* move error output into toast
* formik data flow refactor
* ditch custom field change handler
* fix initialValues
* typed form data & validation
* fixes multiple form validation issues along the way
* isInitialValid → validateOnMount
* metadata display tweaks
* error feedback tweaks
* oler assets checks, confeti on succes job, market fee on order, removed algo compute logic
* more startJob logging
* feedback & messaging changes
* metadata display
* return all algos, fixed & dynamic priced ones
* fix DOM nesting
* messaging updates
* copy tweaks
* check algorithm previous history for both acces and compute sercive types
* handle start compute error
* extra checks on start compute response
* styling tweaks, fix toast UI errors
* AssetSelection: empty screen, tweak min/max height
* fix FRE issues on start compute
* check is ordarable before start compute job
* logging tweaks
* disable eslint no-unused-vars rule for some Apollo code blocks
* fix metadata editing for compute assets
* consider dataset timeout for compute too
Co-authored-by: Matthias Kretschmann <m@kretschmann.io>
2021-04-01 17:21:08 +02:00
|
|
|
|
|
|
|
export default function FormStartCompute({
|
|
|
|
algorithms,
|
|
|
|
ddoListAlgorithms,
|
2022-03-01 00:43:57 +01:00
|
|
|
selectedAlgorithmAsset,
|
Start compute job (#439)
* Wip start compute job
* Wip select algorithm design
* Asset selection form component, for start compute job (#442)
* prototype AssetSelection
* assetselection styling
* typing "fix"
* put back file info icon
* AssetSelection styling in context
* update start job method, fixed algo select, and fixed option typing
* compute logic update
* add has previous orders for algo asset
* fixed search algorithm assets in start compute form
* fixed lint errors
* updated previous order for algo logic and compute flow
* update use price hook and added buy DT for algo
* display only alg of type exchange and sort by value
* display only trusted algo for asset if field is set
* added logic for allow all published algorithms or no algorithms allowed
* asset selection style & spacing tweaks
* refactor get algorithms for compute and edit compute
* fixed form options and more refactoring
* new ButtonBuy component
* shared component between consume/compute
* dealing with various states: loading, previous orders, help text output
* effect dependencies
* move error output into toast
* formik data flow refactor
* ditch custom field change handler
* fix initialValues
* typed form data & validation
* fixes multiple form validation issues along the way
* isInitialValid → validateOnMount
* metadata display tweaks
* error feedback tweaks
* oler assets checks, confeti on succes job, market fee on order, removed algo compute logic
* more startJob logging
* feedback & messaging changes
* metadata display
* return all algos, fixed & dynamic priced ones
* fix DOM nesting
* messaging updates
* copy tweaks
* check algorithm previous history for both acces and compute sercive types
* handle start compute error
* extra checks on start compute response
* styling tweaks, fix toast UI errors
* AssetSelection: empty screen, tweak min/max height
* fix FRE issues on start compute
* check is ordarable before start compute job
* logging tweaks
* disable eslint no-unused-vars rule for some Apollo code blocks
* fix metadata editing for compute assets
* consider dataset timeout for compute too
Co-authored-by: Matthias Kretschmann <m@kretschmann.io>
2021-04-01 17:21:08 +02:00
|
|
|
setSelectedAlgorithm,
|
|
|
|
isLoading,
|
|
|
|
isComputeButtonDisabled,
|
|
|
|
hasPreviousOrder,
|
|
|
|
hasDatatoken,
|
|
|
|
dtBalance,
|
2021-04-08 17:10:51 +02:00
|
|
|
assetType,
|
|
|
|
assetTimeout,
|
|
|
|
hasPreviousOrderSelectedComputeAsset,
|
|
|
|
hasDatatokenSelectedComputeAsset,
|
2022-11-02 16:24:20 +01:00
|
|
|
datasetSymbol,
|
|
|
|
algorithmSymbol,
|
2021-04-08 17:10:51 +02:00
|
|
|
dtSymbolSelectedComputeAsset,
|
|
|
|
dtBalanceSelectedComputeAsset,
|
|
|
|
selectedComputeAssetType,
|
|
|
|
selectedComputeAssetTimeout,
|
Start compute job (#439)
* Wip start compute job
* Wip select algorithm design
* Asset selection form component, for start compute job (#442)
* prototype AssetSelection
* assetselection styling
* typing "fix"
* put back file info icon
* AssetSelection styling in context
* update start job method, fixed algo select, and fixed option typing
* compute logic update
* add has previous orders for algo asset
* fixed search algorithm assets in start compute form
* fixed lint errors
* updated previous order for algo logic and compute flow
* update use price hook and added buy DT for algo
* display only alg of type exchange and sort by value
* display only trusted algo for asset if field is set
* added logic for allow all published algorithms or no algorithms allowed
* asset selection style & spacing tweaks
* refactor get algorithms for compute and edit compute
* fixed form options and more refactoring
* new ButtonBuy component
* shared component between consume/compute
* dealing with various states: loading, previous orders, help text output
* effect dependencies
* move error output into toast
* formik data flow refactor
* ditch custom field change handler
* fix initialValues
* typed form data & validation
* fixes multiple form validation issues along the way
* isInitialValid → validateOnMount
* metadata display tweaks
* error feedback tweaks
* oler assets checks, confeti on succes job, market fee on order, removed algo compute logic
* more startJob logging
* feedback & messaging changes
* metadata display
* return all algos, fixed & dynamic priced ones
* fix DOM nesting
* messaging updates
* copy tweaks
* check algorithm previous history for both acces and compute sercive types
* handle start compute error
* extra checks on start compute response
* styling tweaks, fix toast UI errors
* AssetSelection: empty screen, tweak min/max height
* fix FRE issues on start compute
* check is ordarable before start compute job
* logging tweaks
* disable eslint no-unused-vars rule for some Apollo code blocks
* fix metadata editing for compute assets
* consider dataset timeout for compute too
Co-authored-by: Matthias Kretschmann <m@kretschmann.io>
2021-04-01 17:21:08 +02:00
|
|
|
stepText,
|
2021-07-06 08:51:37 +02:00
|
|
|
isConsumable,
|
2022-03-30 16:44:10 +02:00
|
|
|
consumableFeedback,
|
|
|
|
datasetOrderPriceAndFees,
|
2022-06-15 15:43:37 +02:00
|
|
|
algoOrderPriceAndFees,
|
|
|
|
providerFeeAmount,
|
2022-11-11 10:54:21 +01:00
|
|
|
validUntil,
|
|
|
|
retry
|
Start compute job (#439)
* Wip start compute job
* Wip select algorithm design
* Asset selection form component, for start compute job (#442)
* prototype AssetSelection
* assetselection styling
* typing "fix"
* put back file info icon
* AssetSelection styling in context
* update start job method, fixed algo select, and fixed option typing
* compute logic update
* add has previous orders for algo asset
* fixed search algorithm assets in start compute form
* fixed lint errors
* updated previous order for algo logic and compute flow
* update use price hook and added buy DT for algo
* display only alg of type exchange and sort by value
* display only trusted algo for asset if field is set
* added logic for allow all published algorithms or no algorithms allowed
* asset selection style & spacing tweaks
* refactor get algorithms for compute and edit compute
* fixed form options and more refactoring
* new ButtonBuy component
* shared component between consume/compute
* dealing with various states: loading, previous orders, help text output
* effect dependencies
* move error output into toast
* formik data flow refactor
* ditch custom field change handler
* fix initialValues
* typed form data & validation
* fixes multiple form validation issues along the way
* isInitialValid → validateOnMount
* metadata display tweaks
* error feedback tweaks
* oler assets checks, confeti on succes job, market fee on order, removed algo compute logic
* more startJob logging
* feedback & messaging changes
* metadata display
* return all algos, fixed & dynamic priced ones
* fix DOM nesting
* messaging updates
* copy tweaks
* check algorithm previous history for both acces and compute sercive types
* handle start compute error
* extra checks on start compute response
* styling tweaks, fix toast UI errors
* AssetSelection: empty screen, tweak min/max height
* fix FRE issues on start compute
* check is ordarable before start compute job
* logging tweaks
* disable eslint no-unused-vars rule for some Apollo code blocks
* fix metadata editing for compute assets
* consider dataset timeout for compute too
Co-authored-by: Matthias Kretschmann <m@kretschmann.io>
2021-04-01 17:21:08 +02:00
|
|
|
}: {
|
|
|
|
algorithms: AssetSelectionAsset[]
|
2021-11-11 08:51:13 +01:00
|
|
|
ddoListAlgorithms: Asset[]
|
2022-03-01 00:43:57 +01:00
|
|
|
selectedAlgorithmAsset: AssetExtended
|
|
|
|
setSelectedAlgorithm: React.Dispatch<React.SetStateAction<AssetExtended>>
|
Start compute job (#439)
* Wip start compute job
* Wip select algorithm design
* Asset selection form component, for start compute job (#442)
* prototype AssetSelection
* assetselection styling
* typing "fix"
* put back file info icon
* AssetSelection styling in context
* update start job method, fixed algo select, and fixed option typing
* compute logic update
* add has previous orders for algo asset
* fixed search algorithm assets in start compute form
* fixed lint errors
* updated previous order for algo logic and compute flow
* update use price hook and added buy DT for algo
* display only alg of type exchange and sort by value
* display only trusted algo for asset if field is set
* added logic for allow all published algorithms or no algorithms allowed
* asset selection style & spacing tweaks
* refactor get algorithms for compute and edit compute
* fixed form options and more refactoring
* new ButtonBuy component
* shared component between consume/compute
* dealing with various states: loading, previous orders, help text output
* effect dependencies
* move error output into toast
* formik data flow refactor
* ditch custom field change handler
* fix initialValues
* typed form data & validation
* fixes multiple form validation issues along the way
* isInitialValid → validateOnMount
* metadata display tweaks
* error feedback tweaks
* oler assets checks, confeti on succes job, market fee on order, removed algo compute logic
* more startJob logging
* feedback & messaging changes
* metadata display
* return all algos, fixed & dynamic priced ones
* fix DOM nesting
* messaging updates
* copy tweaks
* check algorithm previous history for both acces and compute sercive types
* handle start compute error
* extra checks on start compute response
* styling tweaks, fix toast UI errors
* AssetSelection: empty screen, tweak min/max height
* fix FRE issues on start compute
* check is ordarable before start compute job
* logging tweaks
* disable eslint no-unused-vars rule for some Apollo code blocks
* fix metadata editing for compute assets
* consider dataset timeout for compute too
Co-authored-by: Matthias Kretschmann <m@kretschmann.io>
2021-04-01 17:21:08 +02:00
|
|
|
isLoading: boolean
|
|
|
|
isComputeButtonDisabled: boolean
|
|
|
|
hasPreviousOrder: boolean
|
|
|
|
hasDatatoken: boolean
|
|
|
|
dtBalance: string
|
2021-04-08 17:10:51 +02:00
|
|
|
assetType: string
|
|
|
|
assetTimeout: string
|
|
|
|
hasPreviousOrderSelectedComputeAsset?: boolean
|
|
|
|
hasDatatokenSelectedComputeAsset?: boolean
|
2022-11-02 16:24:20 +01:00
|
|
|
datasetSymbol?: string
|
|
|
|
algorithmSymbol?: string
|
2021-04-08 17:10:51 +02:00
|
|
|
dtSymbolSelectedComputeAsset?: string
|
|
|
|
dtBalanceSelectedComputeAsset?: string
|
|
|
|
selectedComputeAssetType?: string
|
|
|
|
selectedComputeAssetTimeout?: string
|
Start compute job (#439)
* Wip start compute job
* Wip select algorithm design
* Asset selection form component, for start compute job (#442)
* prototype AssetSelection
* assetselection styling
* typing "fix"
* put back file info icon
* AssetSelection styling in context
* update start job method, fixed algo select, and fixed option typing
* compute logic update
* add has previous orders for algo asset
* fixed search algorithm assets in start compute form
* fixed lint errors
* updated previous order for algo logic and compute flow
* update use price hook and added buy DT for algo
* display only alg of type exchange and sort by value
* display only trusted algo for asset if field is set
* added logic for allow all published algorithms or no algorithms allowed
* asset selection style & spacing tweaks
* refactor get algorithms for compute and edit compute
* fixed form options and more refactoring
* new ButtonBuy component
* shared component between consume/compute
* dealing with various states: loading, previous orders, help text output
* effect dependencies
* move error output into toast
* formik data flow refactor
* ditch custom field change handler
* fix initialValues
* typed form data & validation
* fixes multiple form validation issues along the way
* isInitialValid → validateOnMount
* metadata display tweaks
* error feedback tweaks
* oler assets checks, confeti on succes job, market fee on order, removed algo compute logic
* more startJob logging
* feedback & messaging changes
* metadata display
* return all algos, fixed & dynamic priced ones
* fix DOM nesting
* messaging updates
* copy tweaks
* check algorithm previous history for both acces and compute sercive types
* handle start compute error
* extra checks on start compute response
* styling tweaks, fix toast UI errors
* AssetSelection: empty screen, tweak min/max height
* fix FRE issues on start compute
* check is ordarable before start compute job
* logging tweaks
* disable eslint no-unused-vars rule for some Apollo code blocks
* fix metadata editing for compute assets
* consider dataset timeout for compute too
Co-authored-by: Matthias Kretschmann <m@kretschmann.io>
2021-04-01 17:21:08 +02:00
|
|
|
stepText: string
|
2021-07-06 08:51:37 +02:00
|
|
|
isConsumable: boolean
|
|
|
|
consumableFeedback: string
|
2022-03-30 16:44:10 +02:00
|
|
|
datasetOrderPriceAndFees?: OrderPriceAndFees
|
|
|
|
algoOrderPriceAndFees?: OrderPriceAndFees
|
2022-06-15 15:43:37 +02:00
|
|
|
providerFeeAmount?: string
|
|
|
|
validUntil?: string
|
2022-11-11 10:54:21 +01:00
|
|
|
retry: boolean
|
Start compute job (#439)
* Wip start compute job
* Wip select algorithm design
* Asset selection form component, for start compute job (#442)
* prototype AssetSelection
* assetselection styling
* typing "fix"
* put back file info icon
* AssetSelection styling in context
* update start job method, fixed algo select, and fixed option typing
* compute logic update
* add has previous orders for algo asset
* fixed search algorithm assets in start compute form
* fixed lint errors
* updated previous order for algo logic and compute flow
* update use price hook and added buy DT for algo
* display only alg of type exchange and sort by value
* display only trusted algo for asset if field is set
* added logic for allow all published algorithms or no algorithms allowed
* asset selection style & spacing tweaks
* refactor get algorithms for compute and edit compute
* fixed form options and more refactoring
* new ButtonBuy component
* shared component between consume/compute
* dealing with various states: loading, previous orders, help text output
* effect dependencies
* move error output into toast
* formik data flow refactor
* ditch custom field change handler
* fix initialValues
* typed form data & validation
* fixes multiple form validation issues along the way
* isInitialValid → validateOnMount
* metadata display tweaks
* error feedback tweaks
* oler assets checks, confeti on succes job, market fee on order, removed algo compute logic
* more startJob logging
* feedback & messaging changes
* metadata display
* return all algos, fixed & dynamic priced ones
* fix DOM nesting
* messaging updates
* copy tweaks
* check algorithm previous history for both acces and compute sercive types
* handle start compute error
* extra checks on start compute response
* styling tweaks, fix toast UI errors
* AssetSelection: empty screen, tweak min/max height
* fix FRE issues on start compute
* check is ordarable before start compute job
* logging tweaks
* disable eslint no-unused-vars rule for some Apollo code blocks
* fix metadata editing for compute assets
* consider dataset timeout for compute too
Co-authored-by: Matthias Kretschmann <m@kretschmann.io>
2021-04-01 17:21:08 +02:00
|
|
|
}): ReactElement {
|
2022-06-08 10:46:46 +02:00
|
|
|
const { siteContent } = useMarketMetadata()
|
2022-06-24 15:06:13 +02:00
|
|
|
const { accountId, balance, isSupportedOceanNetwork } = useWeb3()
|
2021-05-20 00:44:51 +02:00
|
|
|
const { isValid, values }: FormikContextType<{ algorithm: string }> =
|
|
|
|
useFormikContext()
|
2022-02-03 15:31:43 +01:00
|
|
|
const { asset, isAssetNetwork } = useAsset()
|
2022-06-22 14:40:22 +02:00
|
|
|
|
2022-03-31 17:55:22 +02:00
|
|
|
const [datasetOrderPrice, setDatasetOrderPrice] = useState(
|
|
|
|
asset?.accessDetails?.price
|
|
|
|
)
|
|
|
|
const [algoOrderPrice, setAlgoOrderPrice] = useState(
|
|
|
|
selectedAlgorithmAsset?.accessDetails?.price
|
|
|
|
)
|
2022-11-02 16:24:20 +01:00
|
|
|
const [totalPrices, setTotalPrices] = useState([])
|
|
|
|
const [isBalanceSufficient, setIsBalanceSufficient] = useState<boolean>(true)
|
Start compute job (#439)
* Wip start compute job
* Wip select algorithm design
* Asset selection form component, for start compute job (#442)
* prototype AssetSelection
* assetselection styling
* typing "fix"
* put back file info icon
* AssetSelection styling in context
* update start job method, fixed algo select, and fixed option typing
* compute logic update
* add has previous orders for algo asset
* fixed search algorithm assets in start compute form
* fixed lint errors
* updated previous order for algo logic and compute flow
* update use price hook and added buy DT for algo
* display only alg of type exchange and sort by value
* display only trusted algo for asset if field is set
* added logic for allow all published algorithms or no algorithms allowed
* asset selection style & spacing tweaks
* refactor get algorithms for compute and edit compute
* fixed form options and more refactoring
* new ButtonBuy component
* shared component between consume/compute
* dealing with various states: loading, previous orders, help text output
* effect dependencies
* move error output into toast
* formik data flow refactor
* ditch custom field change handler
* fix initialValues
* typed form data & validation
* fixes multiple form validation issues along the way
* isInitialValid → validateOnMount
* metadata display tweaks
* error feedback tweaks
* oler assets checks, confeti on succes job, market fee on order, removed algo compute logic
* more startJob logging
* feedback & messaging changes
* metadata display
* return all algos, fixed & dynamic priced ones
* fix DOM nesting
* messaging updates
* copy tweaks
* check algorithm previous history for both acces and compute sercive types
* handle start compute error
* extra checks on start compute response
* styling tweaks, fix toast UI errors
* AssetSelection: empty screen, tweak min/max height
* fix FRE issues on start compute
* check is ordarable before start compute job
* logging tweaks
* disable eslint no-unused-vars rule for some Apollo code blocks
* fix metadata editing for compute assets
* consider dataset timeout for compute too
Co-authored-by: Matthias Kretschmann <m@kretschmann.io>
2021-04-01 17:21:08 +02:00
|
|
|
|
2021-11-11 08:51:13 +01:00
|
|
|
function getAlgorithmAsset(algorithmId: string): Asset {
|
Start compute job (#439)
* Wip start compute job
* Wip select algorithm design
* Asset selection form component, for start compute job (#442)
* prototype AssetSelection
* assetselection styling
* typing "fix"
* put back file info icon
* AssetSelection styling in context
* update start job method, fixed algo select, and fixed option typing
* compute logic update
* add has previous orders for algo asset
* fixed search algorithm assets in start compute form
* fixed lint errors
* updated previous order for algo logic and compute flow
* update use price hook and added buy DT for algo
* display only alg of type exchange and sort by value
* display only trusted algo for asset if field is set
* added logic for allow all published algorithms or no algorithms allowed
* asset selection style & spacing tweaks
* refactor get algorithms for compute and edit compute
* fixed form options and more refactoring
* new ButtonBuy component
* shared component between consume/compute
* dealing with various states: loading, previous orders, help text output
* effect dependencies
* move error output into toast
* formik data flow refactor
* ditch custom field change handler
* fix initialValues
* typed form data & validation
* fixes multiple form validation issues along the way
* isInitialValid → validateOnMount
* metadata display tweaks
* error feedback tweaks
* oler assets checks, confeti on succes job, market fee on order, removed algo compute logic
* more startJob logging
* feedback & messaging changes
* metadata display
* return all algos, fixed & dynamic priced ones
* fix DOM nesting
* messaging updates
* copy tweaks
* check algorithm previous history for both acces and compute sercive types
* handle start compute error
* extra checks on start compute response
* styling tweaks, fix toast UI errors
* AssetSelection: empty screen, tweak min/max height
* fix FRE issues on start compute
* check is ordarable before start compute job
* logging tweaks
* disable eslint no-unused-vars rule for some Apollo code blocks
* fix metadata editing for compute assets
* consider dataset timeout for compute too
Co-authored-by: Matthias Kretschmann <m@kretschmann.io>
2021-04-01 17:21:08 +02:00
|
|
|
let assetDdo = null
|
2021-11-11 08:51:13 +01:00
|
|
|
ddoListAlgorithms.forEach((ddo: Asset) => {
|
Start compute job (#439)
* Wip start compute job
* Wip select algorithm design
* Asset selection form component, for start compute job (#442)
* prototype AssetSelection
* assetselection styling
* typing "fix"
* put back file info icon
* AssetSelection styling in context
* update start job method, fixed algo select, and fixed option typing
* compute logic update
* add has previous orders for algo asset
* fixed search algorithm assets in start compute form
* fixed lint errors
* updated previous order for algo logic and compute flow
* update use price hook and added buy DT for algo
* display only alg of type exchange and sort by value
* display only trusted algo for asset if field is set
* added logic for allow all published algorithms or no algorithms allowed
* asset selection style & spacing tweaks
* refactor get algorithms for compute and edit compute
* fixed form options and more refactoring
* new ButtonBuy component
* shared component between consume/compute
* dealing with various states: loading, previous orders, help text output
* effect dependencies
* move error output into toast
* formik data flow refactor
* ditch custom field change handler
* fix initialValues
* typed form data & validation
* fixes multiple form validation issues along the way
* isInitialValid → validateOnMount
* metadata display tweaks
* error feedback tweaks
* oler assets checks, confeti on succes job, market fee on order, removed algo compute logic
* more startJob logging
* feedback & messaging changes
* metadata display
* return all algos, fixed & dynamic priced ones
* fix DOM nesting
* messaging updates
* copy tweaks
* check algorithm previous history for both acces and compute sercive types
* handle start compute error
* extra checks on start compute response
* styling tweaks, fix toast UI errors
* AssetSelection: empty screen, tweak min/max height
* fix FRE issues on start compute
* check is ordarable before start compute job
* logging tweaks
* disable eslint no-unused-vars rule for some Apollo code blocks
* fix metadata editing for compute assets
* consider dataset timeout for compute too
Co-authored-by: Matthias Kretschmann <m@kretschmann.io>
2021-04-01 17:21:08 +02:00
|
|
|
if (ddo.id === algorithmId) assetDdo = ddo
|
|
|
|
})
|
|
|
|
return assetDdo
|
|
|
|
}
|
|
|
|
|
|
|
|
useEffect(() => {
|
2022-06-24 15:06:13 +02:00
|
|
|
if (!values.algorithm || !isConsumable) return
|
2022-06-22 14:40:22 +02:00
|
|
|
|
2022-03-01 00:43:57 +01:00
|
|
|
async function fetchAlgorithmAssetExtended() {
|
2022-03-14 15:27:20 +01:00
|
|
|
const algorithmAsset = getAlgorithmAsset(values.algorithm)
|
|
|
|
const accessDetails = await getAccessDetails(
|
|
|
|
algorithmAsset.chainId,
|
|
|
|
algorithmAsset.services[0].datatokenAddress,
|
|
|
|
algorithmAsset.services[0].timeout,
|
2022-06-17 14:51:16 +02:00
|
|
|
accountId || ZERO_ADDRESS // if user is not connected, use ZERO_ADDRESS as accountId
|
2022-03-14 15:27:20 +01:00
|
|
|
)
|
|
|
|
const extendedAlgoAsset: AssetExtended = {
|
|
|
|
...algorithmAsset,
|
2022-06-06 16:46:20 +02:00
|
|
|
accessDetails
|
2022-03-14 15:27:20 +01:00
|
|
|
}
|
|
|
|
setSelectedAlgorithm(extendedAlgoAsset)
|
2021-07-06 08:51:37 +02:00
|
|
|
}
|
2022-03-01 00:43:57 +01:00
|
|
|
fetchAlgorithmAssetExtended()
|
2021-07-06 08:51:37 +02:00
|
|
|
}, [values.algorithm, accountId, isConsumable])
|
Start compute job (#439)
* Wip start compute job
* Wip select algorithm design
* Asset selection form component, for start compute job (#442)
* prototype AssetSelection
* assetselection styling
* typing "fix"
* put back file info icon
* AssetSelection styling in context
* update start job method, fixed algo select, and fixed option typing
* compute logic update
* add has previous orders for algo asset
* fixed search algorithm assets in start compute form
* fixed lint errors
* updated previous order for algo logic and compute flow
* update use price hook and added buy DT for algo
* display only alg of type exchange and sort by value
* display only trusted algo for asset if field is set
* added logic for allow all published algorithms or no algorithms allowed
* asset selection style & spacing tweaks
* refactor get algorithms for compute and edit compute
* fixed form options and more refactoring
* new ButtonBuy component
* shared component between consume/compute
* dealing with various states: loading, previous orders, help text output
* effect dependencies
* move error output into toast
* formik data flow refactor
* ditch custom field change handler
* fix initialValues
* typed form data & validation
* fixes multiple form validation issues along the way
* isInitialValid → validateOnMount
* metadata display tweaks
* error feedback tweaks
* oler assets checks, confeti on succes job, market fee on order, removed algo compute logic
* more startJob logging
* feedback & messaging changes
* metadata display
* return all algos, fixed & dynamic priced ones
* fix DOM nesting
* messaging updates
* copy tweaks
* check algorithm previous history for both acces and compute sercive types
* handle start compute error
* extra checks on start compute response
* styling tweaks, fix toast UI errors
* AssetSelection: empty screen, tweak min/max height
* fix FRE issues on start compute
* check is ordarable before start compute job
* logging tweaks
* disable eslint no-unused-vars rule for some Apollo code blocks
* fix metadata editing for compute assets
* consider dataset timeout for compute too
Co-authored-by: Matthias Kretschmann <m@kretschmann.io>
2021-04-01 17:21:08 +02:00
|
|
|
|
2021-04-08 17:10:51 +02:00
|
|
|
//
|
|
|
|
// Set price for calculation output
|
|
|
|
//
|
|
|
|
useEffect(() => {
|
2022-03-01 00:43:57 +01:00
|
|
|
if (!asset?.accessDetails || !selectedAlgorithmAsset?.accessDetails) return
|
2021-04-08 17:10:51 +02:00
|
|
|
|
2022-06-23 17:53:05 +02:00
|
|
|
setDatasetOrderPrice(
|
|
|
|
datasetOrderPriceAndFees?.price || asset.accessDetails.price
|
|
|
|
)
|
|
|
|
setAlgoOrderPrice(
|
|
|
|
algoOrderPriceAndFees?.price ||
|
|
|
|
selectedAlgorithmAsset?.accessDetails.price
|
|
|
|
)
|
2022-11-02 16:24:20 +01:00
|
|
|
const totalPrices: totalPriceMap[] = []
|
2021-04-16 14:25:35 +02:00
|
|
|
const priceDataset =
|
2022-11-02 16:24:20 +01:00
|
|
|
!datasetOrderPrice || hasPreviousOrder || hasDatatoken
|
2022-06-23 17:53:05 +02:00
|
|
|
? new Decimal(0)
|
2022-11-02 16:24:20 +01:00
|
|
|
: new Decimal(datasetOrderPrice).toDecimalPlaces(MAX_DECIMALS)
|
2021-04-16 14:25:35 +02:00
|
|
|
const priceAlgo =
|
2022-11-02 16:24:20 +01:00
|
|
|
!algoOrderPrice ||
|
|
|
|
hasPreviousOrderSelectedComputeAsset ||
|
|
|
|
hasDatatokenSelectedComputeAsset
|
2022-06-23 17:53:05 +02:00
|
|
|
? new Decimal(0)
|
2022-11-02 16:24:20 +01:00
|
|
|
: new Decimal(algoOrderPrice).toDecimalPlaces(MAX_DECIMALS)
|
2022-06-15 15:43:37 +02:00
|
|
|
const providerFees = providerFeeAmount
|
|
|
|
? new Decimal(providerFeeAmount).toDecimalPlaces(MAX_DECIMALS)
|
|
|
|
: new Decimal(0)
|
2022-10-20 14:17:52 +02:00
|
|
|
|
2022-11-02 16:24:20 +01:00
|
|
|
if (algorithmSymbol === 'OCEAN') {
|
|
|
|
let sum = providerFees.add(priceAlgo)
|
|
|
|
totalPrices.push({
|
|
|
|
value: sum.toDecimalPlaces(MAX_DECIMALS).toString(),
|
|
|
|
symbol: algorithmSymbol
|
|
|
|
})
|
|
|
|
if (algorithmSymbol === datasetSymbol) {
|
|
|
|
sum = sum.add(priceDataset)
|
|
|
|
totalPrices[0].value = sum.toDecimalPlaces(MAX_DECIMALS).toString()
|
|
|
|
} else {
|
|
|
|
totalPrices.push({
|
|
|
|
value: priceDataset.toDecimalPlaces(MAX_DECIMALS).toString(),
|
|
|
|
symbol: datasetSymbol
|
|
|
|
})
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (datasetSymbol === 'OCEAN') {
|
|
|
|
const sum = providerFees.add(priceDataset)
|
|
|
|
totalPrices.push({
|
|
|
|
value: sum.toDecimalPlaces(MAX_DECIMALS).toString(),
|
|
|
|
symbol: datasetSymbol
|
|
|
|
})
|
|
|
|
totalPrices.push({
|
|
|
|
value: priceAlgo.toDecimalPlaces(MAX_DECIMALS).toString(),
|
|
|
|
symbol: algorithmSymbol
|
|
|
|
})
|
|
|
|
} else if (datasetSymbol === algorithmSymbol) {
|
|
|
|
const sum = priceAlgo.add(priceDataset)
|
|
|
|
totalPrices.push({
|
|
|
|
value: sum.toDecimalPlaces(MAX_DECIMALS).toString(),
|
|
|
|
symbol: algorithmSymbol
|
|
|
|
})
|
|
|
|
totalPrices.push({
|
|
|
|
value: providerFees.toDecimalPlaces(MAX_DECIMALS).toString(),
|
|
|
|
symbol: 'OCEAN'
|
|
|
|
})
|
|
|
|
} else {
|
|
|
|
totalPrices.push({
|
|
|
|
value: priceDataset.toDecimalPlaces(MAX_DECIMALS).toString(),
|
|
|
|
symbol: datasetSymbol
|
|
|
|
})
|
|
|
|
totalPrices.push({
|
|
|
|
value: providerFees.toDecimalPlaces(MAX_DECIMALS).toString(),
|
|
|
|
symbol: 'OCEAN'
|
|
|
|
})
|
|
|
|
totalPrices.push({
|
|
|
|
value: priceAlgo.toDecimalPlaces(MAX_DECIMALS).toString(),
|
|
|
|
symbol: algorithmSymbol
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
setTotalPrices(totalPrices)
|
2021-04-08 17:10:51 +02:00
|
|
|
}, [
|
2022-06-17 14:51:16 +02:00
|
|
|
asset,
|
2021-04-08 17:10:51 +02:00
|
|
|
hasPreviousOrder,
|
2021-04-16 14:25:35 +02:00
|
|
|
hasDatatoken,
|
|
|
|
hasPreviousOrderSelectedComputeAsset,
|
2022-03-30 16:44:10 +02:00
|
|
|
hasDatatokenSelectedComputeAsset,
|
|
|
|
datasetOrderPriceAndFees,
|
2022-06-17 14:51:16 +02:00
|
|
|
algoOrderPriceAndFees,
|
2022-10-26 14:25:52 +02:00
|
|
|
providerFeeAmount,
|
2022-11-04 12:16:06 +01:00
|
|
|
isAssetNetwork,
|
|
|
|
selectedAlgorithmAsset?.accessDetails,
|
|
|
|
datasetOrderPrice,
|
|
|
|
algoOrderPrice,
|
|
|
|
algorithmSymbol,
|
|
|
|
datasetSymbol
|
2021-04-08 17:10:51 +02:00
|
|
|
])
|
|
|
|
|
2021-08-31 09:47:55 +02:00
|
|
|
useEffect(() => {
|
2022-11-02 16:24:20 +01:00
|
|
|
totalPrices.forEach((price) => {
|
|
|
|
const baseTokenBalance = getTokenBalanceFromSymbol(balance, price.symbol)
|
|
|
|
if (!baseTokenBalance) {
|
|
|
|
setIsBalanceSufficient(false)
|
|
|
|
return
|
|
|
|
}
|
2022-11-04 12:16:06 +01:00
|
|
|
|
2022-11-02 16:24:20 +01:00
|
|
|
// if one comparison of baseTokenBalance and token price comparison is false then the state will be false
|
|
|
|
setIsBalanceSufficient(
|
2022-11-04 12:16:06 +01:00
|
|
|
baseTokenBalance && compareAsBN(baseTokenBalance, `${price.value}`)
|
2022-11-02 16:24:20 +01:00
|
|
|
)
|
|
|
|
})
|
2022-11-04 12:16:06 +01:00
|
|
|
}, [balance, dtBalance, datasetSymbol, algorithmSymbol, totalPrices])
|
2022-10-26 14:25:52 +02:00
|
|
|
|
Start compute job (#439)
* Wip start compute job
* Wip select algorithm design
* Asset selection form component, for start compute job (#442)
* prototype AssetSelection
* assetselection styling
* typing "fix"
* put back file info icon
* AssetSelection styling in context
* update start job method, fixed algo select, and fixed option typing
* compute logic update
* add has previous orders for algo asset
* fixed search algorithm assets in start compute form
* fixed lint errors
* updated previous order for algo logic and compute flow
* update use price hook and added buy DT for algo
* display only alg of type exchange and sort by value
* display only trusted algo for asset if field is set
* added logic for allow all published algorithms or no algorithms allowed
* asset selection style & spacing tweaks
* refactor get algorithms for compute and edit compute
* fixed form options and more refactoring
* new ButtonBuy component
* shared component between consume/compute
* dealing with various states: loading, previous orders, help text output
* effect dependencies
* move error output into toast
* formik data flow refactor
* ditch custom field change handler
* fix initialValues
* typed form data & validation
* fixes multiple form validation issues along the way
* isInitialValid → validateOnMount
* metadata display tweaks
* error feedback tweaks
* oler assets checks, confeti on succes job, market fee on order, removed algo compute logic
* more startJob logging
* feedback & messaging changes
* metadata display
* return all algos, fixed & dynamic priced ones
* fix DOM nesting
* messaging updates
* copy tweaks
* check algorithm previous history for both acces and compute sercive types
* handle start compute error
* extra checks on start compute response
* styling tweaks, fix toast UI errors
* AssetSelection: empty screen, tweak min/max height
* fix FRE issues on start compute
* check is ordarable before start compute job
* logging tweaks
* disable eslint no-unused-vars rule for some Apollo code blocks
* fix metadata editing for compute assets
* consider dataset timeout for compute too
Co-authored-by: Matthias Kretschmann <m@kretschmann.io>
2021-04-01 17:21:08 +02:00
|
|
|
return (
|
|
|
|
<Form className={styles.form}>
|
2022-06-08 10:46:46 +02:00
|
|
|
<Alert
|
|
|
|
className={styles.warning}
|
|
|
|
state="info"
|
|
|
|
text={siteContent.warning.ctd}
|
|
|
|
/>
|
2022-08-02 11:53:22 +02:00
|
|
|
{content.form.data.map((field: FormFieldContent) => {
|
|
|
|
return (
|
|
|
|
<Field
|
|
|
|
key={field.name}
|
|
|
|
{...field}
|
|
|
|
options={algorithms}
|
|
|
|
component={Input}
|
|
|
|
disabled={isLoading || isComputeButtonDisabled}
|
|
|
|
/>
|
|
|
|
)
|
|
|
|
})}
|
Start compute job (#439)
* Wip start compute job
* Wip select algorithm design
* Asset selection form component, for start compute job (#442)
* prototype AssetSelection
* assetselection styling
* typing "fix"
* put back file info icon
* AssetSelection styling in context
* update start job method, fixed algo select, and fixed option typing
* compute logic update
* add has previous orders for algo asset
* fixed search algorithm assets in start compute form
* fixed lint errors
* updated previous order for algo logic and compute flow
* update use price hook and added buy DT for algo
* display only alg of type exchange and sort by value
* display only trusted algo for asset if field is set
* added logic for allow all published algorithms or no algorithms allowed
* asset selection style & spacing tweaks
* refactor get algorithms for compute and edit compute
* fixed form options and more refactoring
* new ButtonBuy component
* shared component between consume/compute
* dealing with various states: loading, previous orders, help text output
* effect dependencies
* move error output into toast
* formik data flow refactor
* ditch custom field change handler
* fix initialValues
* typed form data & validation
* fixes multiple form validation issues along the way
* isInitialValid → validateOnMount
* metadata display tweaks
* error feedback tweaks
* oler assets checks, confeti on succes job, market fee on order, removed algo compute logic
* more startJob logging
* feedback & messaging changes
* metadata display
* return all algos, fixed & dynamic priced ones
* fix DOM nesting
* messaging updates
* copy tweaks
* check algorithm previous history for both acces and compute sercive types
* handle start compute error
* extra checks on start compute response
* styling tweaks, fix toast UI errors
* AssetSelection: empty screen, tweak min/max height
* fix FRE issues on start compute
* check is ordarable before start compute job
* logging tweaks
* disable eslint no-unused-vars rule for some Apollo code blocks
* fix metadata editing for compute assets
* consider dataset timeout for compute too
Co-authored-by: Matthias Kretschmann <m@kretschmann.io>
2021-04-01 17:21:08 +02:00
|
|
|
|
2021-04-08 17:10:51 +02:00
|
|
|
<PriceOutput
|
|
|
|
hasPreviousOrder={hasPreviousOrder}
|
|
|
|
assetTimeout={assetTimeout}
|
|
|
|
hasPreviousOrderSelectedComputeAsset={
|
|
|
|
hasPreviousOrderSelectedComputeAsset
|
|
|
|
}
|
2022-10-19 15:06:34 +02:00
|
|
|
hasDatatoken={hasDatatoken}
|
2021-04-08 17:10:51 +02:00
|
|
|
selectedComputeAssetTimeout={selectedComputeAssetTimeout}
|
2022-10-19 15:06:34 +02:00
|
|
|
hasDatatokenSelectedComputeAsset={hasDatatokenSelectedComputeAsset}
|
2022-03-01 00:43:57 +01:00
|
|
|
algorithmConsumeDetails={selectedAlgorithmAsset?.accessDetails}
|
2022-11-02 16:24:20 +01:00
|
|
|
symbol={datasetSymbol}
|
|
|
|
algorithmSymbol={algorithmSymbol}
|
2022-03-31 17:55:22 +02:00
|
|
|
datasetOrderPrice={datasetOrderPrice}
|
|
|
|
algoOrderPrice={algoOrderPrice}
|
2022-06-15 15:43:37 +02:00
|
|
|
providerFeeAmount={providerFeeAmount}
|
|
|
|
validUntil={validUntil}
|
2022-11-02 16:24:20 +01:00
|
|
|
totalPrices={totalPrices}
|
2021-04-08 17:10:51 +02:00
|
|
|
/>
|
|
|
|
|
Start compute job (#439)
* Wip start compute job
* Wip select algorithm design
* Asset selection form component, for start compute job (#442)
* prototype AssetSelection
* assetselection styling
* typing "fix"
* put back file info icon
* AssetSelection styling in context
* update start job method, fixed algo select, and fixed option typing
* compute logic update
* add has previous orders for algo asset
* fixed search algorithm assets in start compute form
* fixed lint errors
* updated previous order for algo logic and compute flow
* update use price hook and added buy DT for algo
* display only alg of type exchange and sort by value
* display only trusted algo for asset if field is set
* added logic for allow all published algorithms or no algorithms allowed
* asset selection style & spacing tweaks
* refactor get algorithms for compute and edit compute
* fixed form options and more refactoring
* new ButtonBuy component
* shared component between consume/compute
* dealing with various states: loading, previous orders, help text output
* effect dependencies
* move error output into toast
* formik data flow refactor
* ditch custom field change handler
* fix initialValues
* typed form data & validation
* fixes multiple form validation issues along the way
* isInitialValid → validateOnMount
* metadata display tweaks
* error feedback tweaks
* oler assets checks, confeti on succes job, market fee on order, removed algo compute logic
* more startJob logging
* feedback & messaging changes
* metadata display
* return all algos, fixed & dynamic priced ones
* fix DOM nesting
* messaging updates
* copy tweaks
* check algorithm previous history for both acces and compute sercive types
* handle start compute error
* extra checks on start compute response
* styling tweaks, fix toast UI errors
* AssetSelection: empty screen, tweak min/max height
* fix FRE issues on start compute
* check is ordarable before start compute job
* logging tweaks
* disable eslint no-unused-vars rule for some Apollo code blocks
* fix metadata editing for compute assets
* consider dataset timeout for compute too
Co-authored-by: Matthias Kretschmann <m@kretschmann.io>
2021-04-01 17:21:08 +02:00
|
|
|
<ButtonBuy
|
|
|
|
action="compute"
|
2021-07-06 08:51:37 +02:00
|
|
|
disabled={
|
2021-07-07 09:09:28 +02:00
|
|
|
isComputeButtonDisabled ||
|
|
|
|
!isValid ||
|
2021-08-31 09:47:55 +02:00
|
|
|
!isBalanceSufficient ||
|
2021-07-07 09:09:28 +02:00
|
|
|
!isAssetNetwork ||
|
2022-06-22 12:32:59 +02:00
|
|
|
!selectedAlgorithmAsset?.accessDetails?.isPurchasable
|
2021-07-06 08:51:37 +02:00
|
|
|
}
|
Start compute job (#439)
* Wip start compute job
* Wip select algorithm design
* Asset selection form component, for start compute job (#442)
* prototype AssetSelection
* assetselection styling
* typing "fix"
* put back file info icon
* AssetSelection styling in context
* update start job method, fixed algo select, and fixed option typing
* compute logic update
* add has previous orders for algo asset
* fixed search algorithm assets in start compute form
* fixed lint errors
* updated previous order for algo logic and compute flow
* update use price hook and added buy DT for algo
* display only alg of type exchange and sort by value
* display only trusted algo for asset if field is set
* added logic for allow all published algorithms or no algorithms allowed
* asset selection style & spacing tweaks
* refactor get algorithms for compute and edit compute
* fixed form options and more refactoring
* new ButtonBuy component
* shared component between consume/compute
* dealing with various states: loading, previous orders, help text output
* effect dependencies
* move error output into toast
* formik data flow refactor
* ditch custom field change handler
* fix initialValues
* typed form data & validation
* fixes multiple form validation issues along the way
* isInitialValid → validateOnMount
* metadata display tweaks
* error feedback tweaks
* oler assets checks, confeti on succes job, market fee on order, removed algo compute logic
* more startJob logging
* feedback & messaging changes
* metadata display
* return all algos, fixed & dynamic priced ones
* fix DOM nesting
* messaging updates
* copy tweaks
* check algorithm previous history for both acces and compute sercive types
* handle start compute error
* extra checks on start compute response
* styling tweaks, fix toast UI errors
* AssetSelection: empty screen, tweak min/max height
* fix FRE issues on start compute
* check is ordarable before start compute job
* logging tweaks
* disable eslint no-unused-vars rule for some Apollo code blocks
* fix metadata editing for compute assets
* consider dataset timeout for compute too
Co-authored-by: Matthias Kretschmann <m@kretschmann.io>
2021-04-01 17:21:08 +02:00
|
|
|
hasPreviousOrder={hasPreviousOrder}
|
|
|
|
hasDatatoken={hasDatatoken}
|
2022-08-03 14:48:57 +02:00
|
|
|
btSymbol={asset?.accessDetails?.baseToken?.symbol}
|
2022-02-03 15:31:43 +01:00
|
|
|
dtSymbol={asset?.datatokens[0]?.symbol}
|
Start compute job (#439)
* Wip start compute job
* Wip select algorithm design
* Asset selection form component, for start compute job (#442)
* prototype AssetSelection
* assetselection styling
* typing "fix"
* put back file info icon
* AssetSelection styling in context
* update start job method, fixed algo select, and fixed option typing
* compute logic update
* add has previous orders for algo asset
* fixed search algorithm assets in start compute form
* fixed lint errors
* updated previous order for algo logic and compute flow
* update use price hook and added buy DT for algo
* display only alg of type exchange and sort by value
* display only trusted algo for asset if field is set
* added logic for allow all published algorithms or no algorithms allowed
* asset selection style & spacing tweaks
* refactor get algorithms for compute and edit compute
* fixed form options and more refactoring
* new ButtonBuy component
* shared component between consume/compute
* dealing with various states: loading, previous orders, help text output
* effect dependencies
* move error output into toast
* formik data flow refactor
* ditch custom field change handler
* fix initialValues
* typed form data & validation
* fixes multiple form validation issues along the way
* isInitialValid → validateOnMount
* metadata display tweaks
* error feedback tweaks
* oler assets checks, confeti on succes job, market fee on order, removed algo compute logic
* more startJob logging
* feedback & messaging changes
* metadata display
* return all algos, fixed & dynamic priced ones
* fix DOM nesting
* messaging updates
* copy tweaks
* check algorithm previous history for both acces and compute sercive types
* handle start compute error
* extra checks on start compute response
* styling tweaks, fix toast UI errors
* AssetSelection: empty screen, tweak min/max height
* fix FRE issues on start compute
* check is ordarable before start compute job
* logging tweaks
* disable eslint no-unused-vars rule for some Apollo code blocks
* fix metadata editing for compute assets
* consider dataset timeout for compute too
Co-authored-by: Matthias Kretschmann <m@kretschmann.io>
2021-04-01 17:21:08 +02:00
|
|
|
dtBalance={dtBalance}
|
2021-04-08 17:10:51 +02:00
|
|
|
assetTimeout={assetTimeout}
|
|
|
|
assetType={assetType}
|
|
|
|
hasPreviousOrderSelectedComputeAsset={
|
|
|
|
hasPreviousOrderSelectedComputeAsset
|
|
|
|
}
|
|
|
|
hasDatatokenSelectedComputeAsset={hasDatatokenSelectedComputeAsset}
|
|
|
|
dtSymbolSelectedComputeAsset={dtSymbolSelectedComputeAsset}
|
|
|
|
dtBalanceSelectedComputeAsset={dtBalanceSelectedComputeAsset}
|
|
|
|
selectedComputeAssetType={selectedComputeAssetType}
|
Start compute job (#439)
* Wip start compute job
* Wip select algorithm design
* Asset selection form component, for start compute job (#442)
* prototype AssetSelection
* assetselection styling
* typing "fix"
* put back file info icon
* AssetSelection styling in context
* update start job method, fixed algo select, and fixed option typing
* compute logic update
* add has previous orders for algo asset
* fixed search algorithm assets in start compute form
* fixed lint errors
* updated previous order for algo logic and compute flow
* update use price hook and added buy DT for algo
* display only alg of type exchange and sort by value
* display only trusted algo for asset if field is set
* added logic for allow all published algorithms or no algorithms allowed
* asset selection style & spacing tweaks
* refactor get algorithms for compute and edit compute
* fixed form options and more refactoring
* new ButtonBuy component
* shared component between consume/compute
* dealing with various states: loading, previous orders, help text output
* effect dependencies
* move error output into toast
* formik data flow refactor
* ditch custom field change handler
* fix initialValues
* typed form data & validation
* fixes multiple form validation issues along the way
* isInitialValid → validateOnMount
* metadata display tweaks
* error feedback tweaks
* oler assets checks, confeti on succes job, market fee on order, removed algo compute logic
* more startJob logging
* feedback & messaging changes
* metadata display
* return all algos, fixed & dynamic priced ones
* fix DOM nesting
* messaging updates
* copy tweaks
* check algorithm previous history for both acces and compute sercive types
* handle start compute error
* extra checks on start compute response
* styling tweaks, fix toast UI errors
* AssetSelection: empty screen, tweak min/max height
* fix FRE issues on start compute
* check is ordarable before start compute job
* logging tweaks
* disable eslint no-unused-vars rule for some Apollo code blocks
* fix metadata editing for compute assets
* consider dataset timeout for compute too
Co-authored-by: Matthias Kretschmann <m@kretschmann.io>
2021-04-01 17:21:08 +02:00
|
|
|
stepText={stepText}
|
|
|
|
isLoading={isLoading}
|
|
|
|
type="submit"
|
2022-02-03 15:31:43 +01:00
|
|
|
priceType={asset?.accessDetails?.type}
|
2022-03-01 00:43:57 +01:00
|
|
|
algorithmPriceType={selectedAlgorithmAsset?.accessDetails?.type}
|
2021-08-31 09:47:55 +02:00
|
|
|
isBalanceSufficient={isBalanceSufficient}
|
2021-07-06 08:51:37 +02:00
|
|
|
isConsumable={isConsumable}
|
|
|
|
consumableFeedback={consumableFeedback}
|
2022-03-01 00:43:57 +01:00
|
|
|
isAlgorithmConsumable={
|
|
|
|
selectedAlgorithmAsset?.accessDetails?.isPurchasable
|
|
|
|
}
|
2022-06-14 18:30:35 +02:00
|
|
|
isSupportedOceanNetwork={isSupportedOceanNetwork}
|
2022-06-20 05:54:26 +02:00
|
|
|
hasProviderFee={providerFeeAmount && providerFeeAmount !== '0'}
|
2022-11-11 10:54:21 +01:00
|
|
|
retry={retry}
|
Start compute job (#439)
* Wip start compute job
* Wip select algorithm design
* Asset selection form component, for start compute job (#442)
* prototype AssetSelection
* assetselection styling
* typing "fix"
* put back file info icon
* AssetSelection styling in context
* update start job method, fixed algo select, and fixed option typing
* compute logic update
* add has previous orders for algo asset
* fixed search algorithm assets in start compute form
* fixed lint errors
* updated previous order for algo logic and compute flow
* update use price hook and added buy DT for algo
* display only alg of type exchange and sort by value
* display only trusted algo for asset if field is set
* added logic for allow all published algorithms or no algorithms allowed
* asset selection style & spacing tweaks
* refactor get algorithms for compute and edit compute
* fixed form options and more refactoring
* new ButtonBuy component
* shared component between consume/compute
* dealing with various states: loading, previous orders, help text output
* effect dependencies
* move error output into toast
* formik data flow refactor
* ditch custom field change handler
* fix initialValues
* typed form data & validation
* fixes multiple form validation issues along the way
* isInitialValid → validateOnMount
* metadata display tweaks
* error feedback tweaks
* oler assets checks, confeti on succes job, market fee on order, removed algo compute logic
* more startJob logging
* feedback & messaging changes
* metadata display
* return all algos, fixed & dynamic priced ones
* fix DOM nesting
* messaging updates
* copy tweaks
* check algorithm previous history for both acces and compute sercive types
* handle start compute error
* extra checks on start compute response
* styling tweaks, fix toast UI errors
* AssetSelection: empty screen, tweak min/max height
* fix FRE issues on start compute
* check is ordarable before start compute job
* logging tweaks
* disable eslint no-unused-vars rule for some Apollo code blocks
* fix metadata editing for compute assets
* consider dataset timeout for compute too
Co-authored-by: Matthias Kretschmann <m@kretschmann.io>
2021-04-01 17:21:08 +02:00
|
|
|
/>
|
|
|
|
</Form>
|
|
|
|
)
|
|
|
|
}
|