1
0
mirror of https://github.com/oceanprotocol/commons.git synced 2023-03-15 18:03:00 +01:00
commons/client/src/utils/getUserJobs.ts

14 lines
358 B
TypeScript
Raw Normal View History

2020-04-15 14:33:08 +02:00
import { Account } from '@oceanprotocol/squid'
2020-03-30 18:22:48 +02:00
export async function getUserJobs(ocean: any, account: string) {
try {
2020-05-18 14:09:04 +02:00
const account = await ocean.accounts.list()
2020-05-05 11:43:14 +02:00
2020-04-15 14:33:08 +02:00
await account.authenticate()
2020-05-18 14:09:04 +02:00
const jobList = await ocean.compute.status(account[0])
2020-05-05 11:43:14 +02:00
return jobList
2020-03-30 18:22:48 +02:00
} catch (error) {
2020-04-15 14:33:08 +02:00
console.error(error)
2020-03-30 18:22:48 +02:00
}
2020-05-05 11:43:14 +02:00
}