|
1 |
| -import { Knex } from "knex"; |
| 1 | +import { Static } from "@sinclair/typebox"; |
2 | 2 | import { getChainByChainId, getChainBySlug } from "@thirdweb-dev/chains";
|
3 |
| -import { createCustomError } from "../../core/error/customError"; |
4 |
| -import { StatusCodes } from "http-status-codes"; |
5 |
| -import { v4 as uuid } from "uuid"; |
6 |
| -import { connectWithDatabase, getSDK } from "../../core"; |
7 |
| -import { FastifyRequest } from "fastify"; |
8 | 3 | import {
|
9 |
| - ChainId, |
10 | 4 | DeployTransaction,
|
11 | 5 | Transaction,
|
12 | 6 | TransactionError,
|
13 | 7 | } from "@thirdweb-dev/sdk";
|
| 8 | +import { BigNumber } from "ethers"; |
| 9 | +import { FastifyRequest } from "fastify"; |
| 10 | +import { StatusCodes } from "http-status-codes"; |
| 11 | +import { Knex } from "knex"; |
| 12 | +import { v4 as uuid } from "uuid"; |
| 13 | +import { connectWithDatabase, getSDK } from "../../core"; |
| 14 | +import { insertIntoWallets } from "../../core/database/dbOperation"; |
| 15 | +import { createCustomError } from "../../core/error/customError"; |
| 16 | +import { WalletData } from "../../core/interfaces"; |
| 17 | +import { getWalletNonce } from "../../core/services/blockchain"; |
14 | 18 | import {
|
15 |
| - TransactionStatusEnum, |
16 | 19 | TransactionSchema,
|
| 20 | + TransactionStatusEnum, |
17 | 21 | transactionResponseSchema,
|
18 | 22 | } from "../schemas/transaction";
|
19 |
| -import { Static } from "@sinclair/typebox"; |
20 |
| -import { WalletData } from "../../core/interfaces"; |
21 |
| -import { getWalletNonce } from "../../core/services/blockchain"; |
22 |
| -import { BigNumber } from "ethers"; |
23 |
| -import { insertIntoWallets } from "../../core/database/dbOperation"; |
24 | 23 |
|
25 | 24 | const checkNetworkInWalletDB = async (
|
26 | 25 | database: Knex,
|
@@ -92,7 +91,7 @@ export const queueTransaction = async (
|
92 | 91 | chainId: chainId.toLowerCase(),
|
93 | 92 | blockchainNonce: BigNumber.from(walletNonce ?? 0).toNumber(),
|
94 | 93 | lastSyncedTimestamp: new Date(),
|
95 |
| - lastUsedNonce: 0, |
| 94 | + lastUsedNonce: -1, |
96 | 95 | walletType: chainData.slug,
|
97 | 96 | };
|
98 | 97 |
|
|
0 commit comments