Full-width desktop workspace evidence.
This documents the now-removed Node.js bindings to cala-ledger. It is not
present on main anymore; this is a reference for anyone forking the repo who
wants to bring them back.
Cala-ledger is a Rust library. To make it consumable from a Node.js process we
maintained a napi-rs wrapper crate (cala-nodejs/) that
Example for a $1,000,000 facility at maturity with only $300,000 disbursed in total where $50,000 of the lumpsum has already been repaid. There are 4 paid interest payments, 2 past due payments and 1 currently due payment (each interest payment is $10,000)
| State Name | Paid / Unpaid | Dates (Relative to Due Date & Grace Period) | Amount |
|---|---|---|---|
| Total | Both | All time (includes past, present, future) | $300,000 |
| Outstanding | Unpaid | All time (includes past, present, future) | $250,000 |
| Outstanding & Not Yet Due | Unpaid | Due date has not arrived |
| # To clean up all my docker volumes | |
| docker volume rm $(docker volume ls | awk 'NR>1 {print $2}') | |
| # clean up local branches | |
| git branch -d $(git branch | grep -v main) |
Verifying that I control the following Nostr public key: npub12zkknmund6ynu2yaptqamn0q29uje7ms3mqq6uu05v9d7t6tguyqcsaz8h
-
Intro to Blink (for communities)
> docs.google.com/presentation/d/149oUcshgpze7nJrRJmy9uziQD8IBEu2VArM6H5sWSeM
-
Stablesats talk
| import math | |
| btc = 10_000_000 | |
| usd = 200_000 | |
| btcusd = btc/usd | |
| def cents_from_sats(sats, rate): | |
| return sats / btcusd | |
| def sats_from_cents(cents): |
| it.only("arbitrage BTC/USD with $0.01 strategy", async () => { | |
| const ONE_CENT = { amount: 1n, currency: WalletCurrency.Usd } as UsdPaymentAmount | |
| const ONE_SAT = { amount: 1n, currency: WalletCurrency.Btc } as BtcPaymentAmount | |
| const getUsdForBtcEquivalent = async ( | |
| btcAmount: BtcPaymentAmount, | |
| ): Promise<CurrencyBaseAmount> => { | |
| // console.log({ btcAmount }) | |
| const lnInvoice = await Wallets.addInvoiceForSelf({ | |
| walletId: walletIdB, |
| // Live run here: https://replit.com/@vindard/Conditional-Equivalence-TS | |
| type fn = (a: boolean, b: boolean) => boolean | |
| const test = (fn1: fn, fn2: fn) => { | |
| const check = (a: boolean, b: boolean) => fn1(a, b) === fn2(a, b) | |
| const cases: {[key: string]: [boolean, boolean]} = { | |
| ft: [false, true], | |
| ff: [false, false], | |
| tt: [true, true], |
| #!/bin/bash | |
| ./words $(python -c 'from random import random; print(round(random()*2048))') |