Skip to content

Instantly share code, notes, and snippets.

//@version=6
indicator("BTC Rainbow Intercept", shorttitle="Rainbow c", overlay=false, max_lines_count=500)
// --- Inputs ---
slope = input.float(5.7, "Slope", step=0.0001, tooltip="Exponent of the power law: price = 10^(slope·log10(days) + intercept)")
src = input.source(close, "Price source")
projMonths = input.int(4, "Projection horizon (months)", minval=1, maxval=24)
showFlat = input.bool(true, "Show flat-price projection")
showShift = input.bool(true, "Show shifted-price projection")
shiftPct = input.float(-10.0, "Price shift %", step=0.5)
let bitpostInterface: BitpostInterfaceForBitcoinJS = new BitpostInterfaceForBitcoinJS({testnet: true})
let bitpostRequest:BitpostRequest=bitpostInterface.createBitpostRequest(['a', 'b'], 1604188800, 0)
let response = bitpostRequest.sendRequest()
@pedr0-fr
pedr0-fr / lndecode.html
Created June 5, 2019 14:39
Decode lightning invoice courtesy of /u/kinoshitajona
<html>
<input id="text" type="text"></input>
<button onclick="decode()">Decode</button>
<div id="output"></div>
<script>
function decode() {
const el = document.getElementById('text')
const out = document.getElementById('output')
const decoded = JSON.stringify(bolt11.decode(el.value), null, 8)
console.log(decoded)
This file has been truncated, but you can view the full file.
{
"49ccbe785e12a90d680e8eaffcab73ea0a1bbe796796d5667cd71ae96563ab32": {
"size": 815,
"fee": 0.00005141,
"modifiedfee": 0.00005141,
"time": 1535995526,
"height": 539813,
"descendantcount": 1,
"descendantsize": 815,
"descendantfees": 5141,