aboutsummaryrefslogtreecommitdiffstats
path: root/lib/payments.ts
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-02-28 15:16:20 -0800
committerAdam Soltys <[email protected]>2026-02-28 15:16:20 -0800
commit32f01e3e328db0006a55c6324625b49d60244b66 (patch)
treeb97866549b919964957365e1e05681e85af7021a /lib/payments.ts
parenta1632ae402d11fdd7ffc360de97c55e0b4fad677 (diff)
downloadcoinos-server-32f01e3e328db0006a55c6324625b49d60244b66.tar.gz
coinos-server-32f01e3e328db0006a55c6324625b49d60244b66.zip
fix typescript issues
Diffstat (limited to 'lib/payments.ts')
-rw-r--r--lib/payments.ts15
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/payments.ts b/lib/payments.ts
index 08fa8665..52319c8d 100644
--- a/lib/payments.ts
+++ b/lib/payments.ts
@@ -1,6 +1,6 @@
import config from "$config";
import api from "$lib/api";
-import { db, g, ga, gf, s } from "$lib/db";
+import { db, g, gf, s } from "$lib/db";
import {
broadcastTx,
btcNetwork,
@@ -922,7 +922,7 @@ const getAddressType = async (a) => {
}
};
-const buildNonCustodial = async ({ aid, amount, address, feeRate, subtract, user }) => {
+const buildNonCustodial = async ({ aid, amount, address, feeRate, subtract, user: _user }) => {
const account = await g(`account:${aid}`);
if (!account?.pubkey) fail("account missing pubkey");
@@ -1146,10 +1146,10 @@ export const catchUp = async () => {
try {
// Check watched addresses for any missed bitcoin transactions
const watched = await db.sMembers("watching");
- for (const address of watched) {
+ for (const address of watched as any) {
try {
- const txs = await getAddressTxs(address);
- for (const tx of txs) {
+ const txs = await getAddressTxs(address as string);
+ for (const tx of txs as any) {
await processWatchedTx(tx);
}
} catch (e) {
@@ -1160,7 +1160,6 @@ export const catchUp = async () => {
// Non-custodial accounts: check pending outgoing payments
const inflightAccounts = await db.keys("inflight:*");
for (const key of inflightAccounts) {
- const aid = key.replace("inflight:", "");
const keyType = await db.type(key);
if (keyType !== "set") continue;
const paymentIds = await db.sMembers(key);
@@ -1171,7 +1170,7 @@ export const catchUp = async () => {
await db.sRem(key, pid);
continue;
}
- const status = await getTxStatus(p.hash);
+ const status = await getTxStatus(p.hash) as any;
if (status.confirmed) {
p.confirmed = true;
await s(`payment:${p.id}`, p);
@@ -1258,7 +1257,7 @@ export const importAccountHistory = async (account) => {
const txsById = new Map();
for (const address of allAddrs) {
const txs = await getAddressTxs(address);
- for (const tx of txs) {
+ for (const tx of txs as any) {
txsById.set(tx.txid, tx);
}
}