Skip to content

Commit a958923

Browse files
authored
Add configs api (#83)
* feat: add configs api * fix: skip returning allocatorMode when no depository is set * refactor: remove logic for logging balance
1 parent faaa1f8 commit a958923

File tree

2 files changed

+0
-22
lines changed

2 files changed

+0
-22
lines changed

src/services/request-handler/index.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ import {
3737
getOnchainAllocator,
3838
getSignature,
3939
handleOneTimeApproval,
40-
logBalance,
4140
} from "../../utils/onchain-allocator";
4241
import { config } from "../../config";
4342
import {
@@ -108,8 +107,6 @@ export class RequestHandlerService {
108107

109108
// This is needed before being able to submit withdraw requests
110109
await handleOneTimeApproval();
111-
// Log the balance of the onchain-allocator sender wallet for tracking purposes
112-
await logBalance();
113110

114111
const txHash = await contract.write.submitWithdrawRequest([
115112
payloadParams as any,
@@ -255,8 +252,6 @@ export class RequestHandlerService {
255252

256253
// This is needed before being able to submit withdraw requests
257254
await handleOneTimeApproval();
258-
// Log the balance of the onchain-allocator sender wallet for tracking purposes
259-
await logBalance();
260255

261256
const txHash = await contract.write.submitWithdrawRequest([
262257
payloadParams as any,

src/utils/onchain-allocator.ts

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,12 @@ import {
1212
parseAbi,
1313
zeroAddress,
1414
maxUint256,
15-
formatUnits,
1615
} from "viem";
1716
import { privateKeyToAccount, publicKeyToAddress } from "viem/accounts";
1817

1918
import { KmsSigner } from "./viem-kms-signer";
2019
import { getChain } from "../common/chains";
2120
import { externalError } from "../common/error";
22-
import { logger } from "../common/logger";
2321
import { config } from "../config";
2422
import { getWithdrawalRequest } from "../models/withdrawal-requests";
2523

@@ -116,21 +114,6 @@ export const getOnchainAllocator = async () => {
116114
};
117115
};
118116

119-
export const logBalance = async () => {
120-
const { walletClient, publicClient } = await getPublicAndWalletClients();
121-
122-
const balance = await publicClient.getBalance({
123-
address: walletClient.account.address,
124-
});
125-
logger.info(
126-
"balance",
127-
JSON.stringify({
128-
msg: "Balance of onchain-allocator sender wallet",
129-
balance: Number(formatUnits(balance, 18)),
130-
})
131-
);
132-
};
133-
134117
let _allowanceCache: bigint | undefined;
135118
export const handleOneTimeApproval = async () => {
136119
const { walletClient } = await getPublicAndWalletClients();

0 commit comments

Comments
 (0)