Verifying that I control the following Nostr public key: npub12zkknmund6ynu2yaptqamn0q29uje7ms3mqq6uu05v9d7t6tguyqcsaz8h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# To clean up all my docker volumes | |
docker volume rm $(docker volume ls | awk 'NR>1 {print $2}') |
-
Intro to Blink (for communities)
> docs.google.com/presentation/d/149oUcshgpze7nJrRJmy9uziQD8IBEu2VArM6H5sWSeM
-
Stablesats talk
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
./words $(python -c 'from random import random; print(round(random()*2048))') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { createHash } from "crypto" | |
const hashFromPreImage = (preImage) => { | |
const preImageBuf = Buffer.from(preImage, "hex") | |
const sha256 = (buffer: Buffer) => createHash("sha256").update(buffer).digest("hex") | |
return sha256(preImageBuf) | |
} |
Macaroons generated from the $ lncli bakemacaroon
method are output as hex-encoded strings by default. To decode these to a binary file for easy usage with lncli
these are a few options included here for bash
and python
.
The output file from these can be passed to the --macaroonpath
flag directly when using $ lncli
.
This gist contains 3 files that can be imported into postman to play with our api:
grapqhql_api
collection which has our queries and mutationsdevnet
environment variables for local testing (uses regtest network)staging
environment variables for testing against our staging endpoint (uses testnet network)
NewerOlder