From 32f01e3e328db0006a55c6324625b49d60244b66 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sat, 28 Feb 2026 15:16:20 -0800 Subject: fix typescript issues --- lib/tb.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lib/tb.ts') diff --git a/lib/tb.ts b/lib/tb.ts index 29411fef..9fbff6c8 100644 --- a/lib/tb.ts +++ b/lib/tb.ts @@ -63,6 +63,7 @@ function u128(n: bigint): bigint { } async function resolveAddresses(addresses: string[]): Promise { + // @ts-ignore const { lookup } = await import("node:dns/promises"); const resolved: string[] = []; for (const addr of addresses) { @@ -181,12 +182,12 @@ async function getAccount(id: bigint) { // Raw microsats balance for internal use function accountBalanceMicro(account: any): bigint { if (!account) return 0n; - return account.credits_posted - account.debits_posted; + return BigInt(account.credits_posted) - BigInt(account.debits_posted); } function accountBalance(account: any): number { if (!account) return 0; - const micro = account.credits_posted - account.debits_posted; + const micro = BigInt(account.credits_posted) - BigInt(account.debits_posted); return Number(micro / MSATS); // Floor division to sats } @@ -685,7 +686,7 @@ export async function tbMultiplyForMicrosats(uid: string): Promise { const multiplyAccount = async (accountId: bigint, ledger: number, houseId: bigint) => { const acct = await client.lookupAccounts([u128(accountId)]); if (!acct.length) return; - const current = acct[0].credits_posted - acct[0].debits_posted; + const current = BigInt(acct[0].credits_posted) - BigInt(acct[0].debits_posted); if (current <= 0n) return; const results = await client.createTransfers([ -- cgit v1.2.3