Skip to content

Commit 6612c53

Browse files
authored
fix: add errorMessage to query to get queued txs (#475)
* fix: add errorMessage to query to get queued txs * remove unused files * update thirdweb package * getWalletBalance fix
1 parent 56f1455 commit 6612c53

File tree

4 files changed

+27
-47
lines changed

4 files changed

+27
-47
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
"pino": "^8.15.1",
6767
"pino-pretty": "^10.0.0",
6868
"prisma": "^5.2.0",
69-
"thirdweb": "^5.0.0-beta-ca68bc77e74f594360b4da1e9e77793b66cfb12a-20240323045412",
69+
"thirdweb": "^5.1.0",
7070
"uuid": "^9.0.1",
7171
"viem": "^1.14.0",
7272
"zod": "^3.21.4"

src/db/transactions/getQueuedTxs.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export const getQueuedTxs = async ({ pgtx }: GetQueuedTxsParams = {}): Promise<
2323
"sentAt" IS NULL
2424
AND "minedAt" IS NULL
2525
AND "cancelledAt" IS NULL
26+
AND "errorMessage" IS NULL
2627
ORDER BY
2728
"queuedAt"
2829
ASC

src/worker/utils/withdraw.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import { defineChain, prepareTransaction } from "thirdweb";
2-
import { ethers5Adapter } from "thirdweb/adapters/ethers5";
32
import { estimateGasCost } from "thirdweb/transaction";
43
import { getWalletBalance } from "thirdweb/wallets";
5-
import { getWallet } from "../../utils/cache/getWallet";
64
import { thirdwebClient } from "../../utils/sdk";
75

86
interface GetWithdrawValueParams {
@@ -19,11 +17,8 @@ export const getWithdrawValue = async ({
1917
const chain = defineChain(chainId);
2018

2119
// Get wallet balance.
22-
const wallet = await getWallet({ chainId, walletAddress: fromAddress });
23-
const signer = await wallet.getSigner();
24-
const account = await ethers5Adapter.signer.fromEthers(signer);
2520
const { value: balanceWei } = await getWalletBalance({
26-
account,
21+
address: fromAddress,
2722
client: thirdwebClient,
2823
chain,
2924
});

yarn.lock

Lines changed: 24 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -3479,17 +3479,17 @@
34793479
resolved "https://registry.yarnpkg.com/@t3-oss/env-core/-/env-core-0.6.0.tgz#a2e6a6a2b166aad2df7ecc5e7a72400946a84fbe"
34803480
integrity sha512-3FkPAba069WRZVVab/sB1m3eSGn/rZeypx5k+sWEu1d+k0OQdRDnvFS+7MtxYgqVrwaRk3b7yVnX2dgSPVmWPQ==
34813481

3482-
"@tanstack/query-core@5.28.4":
3483-
version "5.28.4"
3484-
resolved "https://registry.yarnpkg.com/@tanstack/query-core/-/query-core-5.28.4.tgz#fa416532f8b33ca8608d40bb9728b60e2e1a38dc"
3485-
integrity sha512-uQZqOFqLWUvXNIQZ63XdKzg22NtHzgCBUfDmjDHi3BoF+nUYeBNvMi/xFPtFrMhqRzG2Ir4mYaGsWZzmiEjXpA==
3482+
"@tanstack/query-core@5.28.9":
3483+
version "5.28.9"
3484+
resolved "https://registry.yarnpkg.com/@tanstack/query-core/-/query-core-5.28.9.tgz#170a7a8794ab73aeffbaf711ac62126479a5d026"
3485+
integrity sha512-hNlfCiqZevr3GRVPXS3MhaGW5hjcxvCsIQ4q6ff7EPlvFwYZaS+0d9EIIgofnegDaU2BbCDlyURoYfRl5rmzow==
34863486

3487-
"@tanstack/react-query@5.28.4":
3488-
version "5.28.4"
3489-
resolved "https://registry.yarnpkg.com/@tanstack/react-query/-/react-query-5.28.4.tgz#32e56ca4fd08513a906fe6323908f0e38ffccbba"
3490-
integrity sha512-BErcoB/QQG6YwLSUKnaGxF+lSc270RH2w3kMBpG0i4YzDCsFs2pdxPX1WVknQvFk9bNgukMb158hc2Zb4SdwSA==
3487+
"@tanstack/react-query@5.28.9":
3488+
version "5.28.9"
3489+
resolved "https://registry.yarnpkg.com/@tanstack/react-query/-/react-query-5.28.9.tgz#13c2049daa5db6c3137473e279b209f76d39708e"
3490+
integrity sha512-vwifBkGXsydsLxFOBMe3+f8kvtDoqDRDwUNjPHVDDt+FoBetCbOWAUHgZn4k+CVeZgLmy7bx6aKeDbe3e8koOQ==
34913491
dependencies:
3492-
"@tanstack/query-core" "5.28.4"
3492+
"@tanstack/query-core" "5.28.9"
34933493

34943494
"@thirdweb-dev/auth@^4.1.47":
34953495
version "4.1.47"
@@ -9037,12 +9037,10 @@ minimist@^1.2.0, minimist@^1.2.5, minimist@^1.2.6:
90379037
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c"
90389038
integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==
90399039

9040-
mipd@0.0.5:
9041-
version "0.0.5"
9042-
resolved "https://registry.yarnpkg.com/mipd/-/mipd-0.0.5.tgz#367ee796531c23f0631f129038700b1406663aec"
9043-
integrity sha512-gbKA784D2WKb5H/GtqEv+Ofd1S9Zj+Z/PGDIl1u1QAbswkxD28BQ5bSXQxkeBzPBABg1iDSbiwGG1XqlOxRspA==
9044-
dependencies:
9045-
viem "^1.1.4"
9040+
mipd@0.0.7:
9041+
version "0.0.7"
9042+
resolved "https://registry.yarnpkg.com/mipd/-/mipd-0.0.7.tgz#bb5559e21fa18dc3d9fe1c08902ef14b7ce32fd9"
9043+
integrity sha512-aAPZPNDQ3uMTdKbuO2YmAw2TxLHO0moa4YKAyETM/DTj5FloZo+a+8tU+iv4GmW+sOxKLSRwcSFuczk+Cpt6fg==
90469044

90479045
mkdirp@^1.0.4:
90489046
version "1.0.4"
@@ -10864,10 +10862,10 @@ text-table@^0.2.0:
1086410862
resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4"
1086510863
integrity sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==
1086610864

10867-
thirdweb@^5.0.0-beta-ca68bc77e74f594360b4da1e9e77793b66cfb12a-20240323045412:
10868-
version "5.0.0-beta-ca68bc77e74f594360b4da1e9e77793b66cfb12a-20240323045412"
10869-
resolved "https://registry.yarnpkg.com/thirdweb/-/thirdweb-5.0.0-beta-ca68bc77e74f594360b4da1e9e77793b66cfb12a-20240323045412.tgz#dd94a5f80b3735d76227dac17c7e44e608653140"
10870-
integrity sha512-CJnhdZq/I48V8iHS6P3gccrjv7VyDj4mAIfaCPwFpauz+l9p+PvuokS6e+BnnHWB1FE1+iRGnrGy4J4PGpDa5g==
10865+
thirdweb@^5.1.0:
10866+
version "5.1.0"
10867+
resolved "https://registry.yarnpkg.com/thirdweb/-/thirdweb-5.1.0.tgz#1df31e2a5c3f39f2926b1a27c04fecbc34e21213"
10868+
integrity sha512-yZwFcfDimePsdJ1HmYT90BBeeCi5/N8oAqUDRKaf2tI12i0Y7ajgpbAQx4Dd/0LJ+hQ2ovOqXaPTiSEXshF5hg==
1087110869
dependencies:
1087210870
"@coinbase/wallet-sdk" "3.7.2"
1087310871
"@emotion/react" "11.11.4"
@@ -10879,15 +10877,15 @@ thirdweb@^5.0.0-beta-ca68bc77e74f594360b4da1e9e77793b66cfb12a-20240323045412:
1087910877
"@radix-ui/react-focus-scope" "1.0.4"
1088010878
"@radix-ui/react-icons" "1.3.0"
1088110879
"@radix-ui/react-tooltip" "1.0.7"
10882-
"@tanstack/react-query" "5.28.4"
10880+
"@tanstack/react-query" "5.28.9"
1088310881
"@walletconnect/ethereum-provider" "2.11.3"
1088410882
abitype "1.0.0"
1088510883
fast-text-encoding "^1.0.6"
1088610884
fuse.js "7.0.0"
10887-
mipd "0.0.5"
10885+
mipd "0.0.7"
1088810886
node-libs-browser "2.2.1"
1088910887
uqr "0.1.2"
10890-
viem "2.8.14"
10888+
viem "2.9.6"
1089110889

1089210890
thread-stream@^0.15.1:
1089310891
version "0.15.2"
@@ -11401,10 +11399,10 @@ vary@~1.1.2:
1140111399
resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc"
1140211400
integrity sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==
1140311401

11404-
viem@2.8.14:
11405-
version "2.8.14"
11406-
resolved "https://registry.yarnpkg.com/viem/-/viem-2.8.14.tgz#25b7e9488f494b0b20124fdeefd96b65d851850a"
11407-
integrity sha512-K5u9OoyPQ7W8VPa6xY2m7oazuhemp0xuK9Ur8AkaXHtcusism9keTXDDaCw6WWFK3YR9HSojHJOtuVQqvRz0ug==
11402+
viem@2.9.6:
11403+
version "2.9.6"
11404+
resolved "https://registry.yarnpkg.com/viem/-/viem-2.9.6.tgz#66819684e878b6ea659ad9c49a0a864512859190"
11405+
integrity sha512-VVFWjGQei2wnWTvAB/xrIf22m6flCwxeBr8LnwejXMTSSi1EORWEswrw2lfKTmw3TlRPSG4uSiQMa/d0l0DKRg==
1140811406
dependencies:
1140911407
"@adraffy/ens-normalize" "1.10.0"
1141011408
"@noble/curves" "1.2.0"
@@ -11415,20 +11413,6 @@ viem@2.8.14:
1141511413
isows "1.0.3"
1141611414
ws "8.13.0"
1141711415

11418-
viem@^1.1.4:
11419-
version "1.21.4"
11420-
resolved "https://registry.yarnpkg.com/viem/-/viem-1.21.4.tgz#883760e9222540a5a7e0339809202b45fe6a842d"
11421-
integrity sha512-BNVYdSaUjeS2zKQgPs+49e5JKocfo60Ib2yiXOWBT6LuVxY1I/6fFX3waEtpXvL1Xn4qu+BVitVtMh9lyThyhQ==
11422-
dependencies:
11423-
"@adraffy/ens-normalize" "1.10.0"
11424-
"@noble/curves" "1.2.0"
11425-
"@noble/hashes" "1.3.2"
11426-
"@scure/bip32" "1.3.2"
11427-
"@scure/bip39" "1.2.1"
11428-
abitype "0.9.8"
11429-
isows "1.0.3"
11430-
ws "8.13.0"
11431-
1143211416
viem@^1.14.0:
1143311417
version "1.14.0"
1143411418
resolved "https://registry.yarnpkg.com/viem/-/viem-1.14.0.tgz#e4b305c4cce500e04a66b951c01856d7b04ab403"

0 commit comments

Comments
 (0)