Skip to content

Commit 4faf850

Browse files
Merge pull request #11 from InternetMaximalism/wallet
Wallet
2 parents 4c995af + 6dd5299 commit 4faf850

18 files changed

+104
-100
lines changed

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- name: Use Node.js
2323
uses: actions/setup-node@v4
2424
with:
25-
node-version: 22.13.0
25+
node-version: 22.14.0
2626

2727
- name: Enable Corepack
2828
run: corepack enable

.nvmrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
22.13.0
1+
22.14.0

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ yarn workspace watcher dev
3333
# migrate dev
3434
yarn migrate
3535

36-
# deploy
36+
# migration prod
3737
yarn migrate:deploy
3838

3939
# reset

biome.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
2+
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
33
"formatter": {
44
"enabled": true,
55
"formatWithErrors": false,

docker/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:22.13.0-bookworm-slim AS builder
1+
FROM node:22.14.0-bookworm-slim AS builder
22

33
RUN corepack enable && \
44
corepack prepare yarn@4.6.0 --activate && \
@@ -16,7 +16,7 @@ RUN yarn install --immutable
1616
RUN yarn generate
1717
RUN yarn build
1818

19-
FROM node:22.13.0-bookworm-slim
19+
FROM node:22.14.0-bookworm-slim
2020

2121
RUN corepack enable && \
2222
corepack prepare yarn@4.6.0 --activate && \

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@
2020
},
2121
"devDependencies": {
2222
"@biomejs/biome": "1.9.4",
23-
"@types/node": "^22.13.1",
23+
"@types/node": "^22.13.4",
2424
"tsx": "^4.19.2",
2525
"typescript": "^5.7.3"
2626
},
2727
"dependencies": {
28-
"@prisma/client": "6.3.0",
29-
"prisma": "^6.3.0"
28+
"@prisma/client": "6.3.1",
29+
"prisma": "^6.3.1"
3030
},
3131
"prisma": {
3232
"seed": "tsx --env-file=./.env prisma/seed.ts"

packages/processor/src/constants.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ export const DEFAULT_ID_LENGTH = 20;
66
// poll
77
export const DEFAULT_POLL_OPTIONS: Required<PollOptions> = {
88
maxAttempts: 30,
9-
intervalMs: 6_000,
10-
timeoutMs: 180_000,
9+
intervalMs: 10_000,
10+
timeoutMs: 300_000,
1111
};
1212

1313
// transaction
@@ -19,7 +19,7 @@ export const TRANSACTION_WAIT_TIMEOUT_ERROR_MESSAGE =
1919
"Timed out while waiting for transaction with hash";
2020
export const EXECUTION_REVERTED_ERROR_MESSAGE = "Execution reverted";
2121
export const TRANSACTION_REPLACEMENT_FEE_TOO_LOW = "replacement fee too low";
22-
export const TRANSACTION_MISSING_REVERT_DATA = "missing revert data"; // because of the gasPrice
22+
export const TRANSACTION_MISSING_REVERT_DATA = "missing revert data"; // NOTE: because of the gasPrice
2323

2424
// ethers
2525
export const ETHERS_WAIT_TRANSACTION_TIMEOUT_MESSAGE = "timeout";

packages/processor/src/lib/healthCheck.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import http from "http";
1+
import http from "node:http";
22
import { config, logger } from "@intmax2-withdrawal-aggregator/shared";
33
import { name } from "../../package.json";
44

packages/shared/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"ethers": "^6.13.5",
1010
"pino": "^9.6.0",
1111
"pino-pretty": "^13.0.0",
12-
"viem": "^2.22.21"
12+
"viem": "^2.23.2"
1313
},
1414
"scripts": {
1515
"build": "rm -rf dist tsconfig.tsbuildinfo && tsc",

packages/shared/src/blockchain/ethersTransaction.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ import type {
88
WaitForTransactionOptions,
99
} from "../types";
1010

11+
const DEFAULT_OPTIONS: Required<WaitForTransactionOptions> = {
12+
confirms: 1,
13+
timeout: 30_000,
14+
};
15+
1116
export const getEthersTxOptions = (
1217
contractCallParams: ContractCallParameters,
1318
contractCallOptions: ContractCallOptionsEthers,
@@ -95,11 +100,6 @@ export const replacedEthersTransaction = async ({
95100
}
96101
};
97102

98-
const DEFAULT_OPTIONS: Required<WaitForTransactionOptions> = {
99-
confirms: 1,
100-
timeout: 30_000,
101-
};
102-
103103
export const ethersWaitForTransactionConfirmation = async (
104104
ethereumClient: PublicClient,
105105
transactionHash: string,

packages/shared/src/blockchain/wallet.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ type WalletType = "builder" | "depositAnalyzer" | "withdrawal";
88
const walletConfigs: Record<WalletType, number> = {
99
builder: 0,
1010
depositAnalyzer: 1,
11-
withdrawal: 3, // NOTE: 2 is unused
11+
withdrawal: 2,
1212
};
1313

1414
export const getWalletClient = (

packages/shared/src/config/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export const config = cleanEnv(process.env, {
2828
// contracts
2929
LIQUIDITY_CONTRACT_ADDRESS: str({ devDefault: "0x" }),
3030
LIQUIDITY_CONTRACT_DEPLOYED_BLOCK: num({ devDefault: 0 }),
31-
WITHDRAWAL_CONTRACT_ADDRESS: str(),
31+
WITHDRAWAL_CONTRACT_ADDRESS: str({ devDefault: "0x" }),
3232
// private key
3333
INTMAX2_OWNER_MNEMONIC: str(),
3434
// zkp

packages/shared/src/constants.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { config } from "./config";
33
// block event
44
export const BLOCK_RANGE_MINIMUM = 10000n;
55

6-
// config
6+
// contract
77
export const LIQUIDITY_CONTRACT_ADDRESS = config.LIQUIDITY_CONTRACT_ADDRESS as `0x${string}`;
88
export const LIQUIDITY_CONTRACT_DEPLOYED_BLOCK = BigInt(
99
config.LIQUIDITY_CONTRACT_DEPLOYED_BLOCK,
-34
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import type { Abi, Account } from "viem";
2-
31
export interface BaseEvent {
42
name: string;
53
address: string;
@@ -32,35 +30,3 @@ export interface ClaimedWithdrawalEvent extends BaseEvent {
3230
export interface ClaimedWithdrawalEventLog extends WithdrawalEventLog {
3331
recipient: string;
3432
}
35-
36-
export interface ContractCallParameters {
37-
contractAddress: `0x${string}`;
38-
abi: Abi;
39-
functionName: string;
40-
account: Account;
41-
args: any[];
42-
}
43-
44-
export interface ContractCallOptionsEthers {
45-
value?: bigint;
46-
nonce?: number;
47-
gasPrice?: bigint;
48-
maxFeePerGas?: bigint;
49-
maxPriorityFeePerGas?: bigint;
50-
}
51-
52-
export interface RetryOptionsEthers {
53-
nonce?: number | null;
54-
gasPrice: bigint | null;
55-
}
56-
57-
export interface EthersTransactionExecutionParams {
58-
functionName: string;
59-
contract: any;
60-
callArgs: any;
61-
}
62-
63-
export interface WaitForTransactionOptions {
64-
confirms?: number;
65-
timeout?: number;
66-
}

packages/shared/src/types/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
export * from "./app";
22
export * from "./blockchain";
33
export * from "./withdrawal";
4+
export * from "./transaction";
+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import type { Abi, Account } from "viem";
2+
3+
export interface ContractCallParameters {
4+
contractAddress: `0x${string}`;
5+
abi: Abi;
6+
functionName: string;
7+
account: Account;
8+
args: any[];
9+
}
10+
11+
export interface ContractCallOptionsEthers {
12+
value?: bigint;
13+
nonce?: number;
14+
gasPrice?: bigint;
15+
maxFeePerGas?: bigint;
16+
maxPriorityFeePerGas?: bigint;
17+
}
18+
19+
export interface RetryOptionsEthers {
20+
nonce?: number | null;
21+
gasPrice: bigint | null;
22+
}
23+
24+
export interface EthersTransactionExecutionParams {
25+
functionName: string;
26+
contract: any;
27+
callArgs: any;
28+
}
29+
30+
export interface WaitForTransactionOptions {
31+
confirms?: number;
32+
timeout?: number;
33+
}

packages/watcher/package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
"name": "watcher",
33
"version": "1.0.0",
44
"dependencies": {
5-
"@intmax2-withdrawal-aggregator/shared": "workspace:*"
5+
"@intmax2-withdrawal-aggregator/shared": "workspace:*",
6+
"abitype": "^1.0.8",
7+
"viem": "^2.23.2"
68
},
79
"scripts": {
810
"start": "node dist/index.js",

0 commit comments

Comments
 (0)