Skip to content

Commit

Permalink
bump sdk and enable task queuing
Browse files Browse the repository at this point in the history
  • Loading branch information
sehyunc committed Feb 22, 2024
1 parent 2db9dd1 commit a41bb3f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 45 deletions.
28 changes: 15 additions & 13 deletions trade.renegade.fi/hooks/use-tasks.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { useState } from "react"
import { renegade } from "@/app/providers"
import { useRenegade } from "@/contexts/Renegade/renegade-context"
import { useEffect, useState } from "react"


export const useTasks = () => {
const [tasks, _] = useState<
const [tasks, setTasks] = useState<
{
id?: string | undefined
status?:
Expand All @@ -14,19 +16,19 @@ export const useTasks = () => {
committed?: boolean | undefined
}[]
>([])
// const { accountId } = useRenegade()
const { accountId } = useRenegade()

// useEffect(() => {
// if (!accountId) return
// const interval = setInterval(async () => {
// const _tasks = await renegade.queryTaskQueue(accountId)
// setTasks(_tasks)
// }, 5000)
useEffect(() => {
if (!accountId) return
const interval = setInterval(async () => {
const _tasks = await renegade.queryTaskQueue(accountId)
setTasks(_tasks)
}, 5000)

// return () => {
// clearInterval(interval)
// }
// }, [accountId])
return () => {
clearInterval(interval)
}
}, [accountId])

return tasks
}
2 changes: 1 addition & 1 deletion trade.renegade.fi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"@chakra-ui/react": "^2.8.0",
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@renegade-fi/renegade-js": "^0.4.10",
"@renegade-fi/renegade-js": "0.4.13",
"@t3-oss/env-nextjs": "^0.6.0",
"connectkit": "^1.4.0",
"dayjs": "^1.11.10",
Expand Down
35 changes: 4 additions & 31 deletions trade.renegade.fi/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1721,14 +1721,13 @@
resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.11.8.tgz#6b79032e760a0899cd4204710beede972a3a185f"
integrity sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==

"@renegade-fi/renegade-js@^0.4.10":
version "0.4.10"
resolved "https://registry.yarnpkg.com/@renegade-fi/renegade-js/-/renegade-js-0.4.10.tgz#180941edbae8dede3b31b4b9d9b916ad909d06e5"
integrity sha512-ON0q+SopM0Wj2TkNWh+asbbtEplGMaONUO3UU1pZPn0XS+vaGedwjZW1ir/2mogkmozvmVCxJgOYSmdlRyacIg==
"@renegade-fi/renegade-js@0.4.13":
version "0.4.13"
resolved "https://registry.yarnpkg.com/@renegade-fi/renegade-js/-/renegade-js-0.4.13.tgz#e192e0f5312ef9e824381c1d267d51b34233bea2"
integrity sha512-Pd12kCw+FhcxBIWs9cYj2Ymjxvuu9dmwmET2Ej/s48AvrqwYIdyDQr4lzxr+6YEl+0EAAWx3OnS3o/nq5/gWcA==
dependencies:
"@noble/hashes" "^1.3.0"
axios "^1.3.5"
ffjavascript "^0.2.60"
isomorphic-fetch "^3.0.0"
isomorphic-ws "^5.0.0"
uuid "^9.0.0"
Expand Down Expand Up @@ -4185,15 +4184,6 @@ fetch-blob@^3.1.2, fetch-blob@^3.1.4:
node-domexception "^1.0.0"
web-streams-polyfill "^3.0.3"

ffjavascript@^0.2.60:
version "0.2.60"
resolved "https://registry.yarnpkg.com/ffjavascript/-/ffjavascript-0.2.60.tgz#4d8ae613d6bf4e98b3cc29ba10c626f5853854cf"
integrity sha512-T/9bnEL5xAZRDbQoEMf+pM9nrhK+C3JyZNmqiWub26EQorW7Jt+jR54gpqDhceA4Nj0YctPQwYnl8xa52/A26A==
dependencies:
wasmbuilder "0.0.16"
wasmcurves "0.2.2"
web-worker "^1.2.0"

file-entry-cache@^6.0.1:
version "6.0.1"
resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-6.0.1.tgz#211b2dd9659cb0394b073e7323ac3c933d522027"
Expand Down Expand Up @@ -7001,18 +6991,6 @@ wagmi@^1.4.12:
abitype "0.8.7"
use-sync-external-store "^1.2.0"

wasmbuilder@0.0.16:
version "0.0.16"
resolved "https://registry.yarnpkg.com/wasmbuilder/-/wasmbuilder-0.0.16.tgz#f34c1f2c047d2f6e1065cbfec5603988f16d8549"
integrity sha512-Qx3lEFqaVvp1cEYW7Bfi+ebRJrOiwz2Ieu7ZG2l7YyeSJIok/reEQCQCuicj/Y32ITIJuGIM9xZQppGx5LrQdA==

wasmcurves@0.2.2:
version "0.2.2"
resolved "https://registry.yarnpkg.com/wasmcurves/-/wasmcurves-0.2.2.tgz#ca444f6a6f6e2a5cbe6629d98ff478a62b4ccb2b"
integrity sha512-JRY908NkmKjFl4ytnTu5ED6AwPD+8VJ9oc94kdq7h5bIwbj0L4TDJ69mG+2aLs2SoCmGfqIesMWTEJjtYsoQXQ==
dependencies:
wasmbuilder "0.0.16"

watchpack@2.4.0:
version "2.4.0"
resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-2.4.0.tgz#fa33032374962c78113f93c7f2fb4c54c9862a5d"
Expand All @@ -7033,11 +7011,6 @@ web-streams-polyfill@^3.0.3:
resolved "https://registry.yarnpkg.com/web-streams-polyfill/-/web-streams-polyfill-3.3.2.tgz#32e26522e05128203a7de59519be3c648004343b"
integrity sha512-3pRGuxRF5gpuZc0W+EpwQRmCD7gRqcDOMt688KmdlDAgAyaB1XlN0zq2njfDNm44XVdIouE7pZ6GzbdyH47uIQ==

web-worker@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/web-worker/-/web-worker-1.2.0.tgz#5d85a04a7fbc1e7db58f66595d7a3ac7c9c180da"
integrity sha512-PgF341avzqyx60neE9DD+XS26MMNMoUQRz9NOZwW32nPQrF6p77f1htcnjBSEV8BGMKZ16choqUG4hyI0Hx7mA==

webidl-conversions@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871"
Expand Down

0 comments on commit a41bb3f

Please sign in to comment.