chore: Update deps

This commit is contained in:
BluJ
2023-02-27 10:38:56 -07:00
parent eec99c06bf
commit 60eb3a8e4b
736 changed files with 133547 additions and 2 deletions

View File

@@ -0,0 +1,184 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.typeFromProps = exports.guardAll = exports.matchNumberWithRange = exports.generateDefault = void 0;
const dependencies_js_1 = require("../dependencies.js");
const isType = dependencies_js_1.matches.shape({ type: dependencies_js_1.matches.string });
const recordString = dependencies_js_1.matches.dictionary([dependencies_js_1.matches.string, dependencies_js_1.matches.unknown]);
const matchDefault = dependencies_js_1.matches.shape({ default: dependencies_js_1.matches.unknown });
const matchNullable = dependencies_js_1.matches.shape({ nullable: dependencies_js_1.matches.literal(true) });
const matchPattern = dependencies_js_1.matches.shape({ pattern: dependencies_js_1.matches.string });
const rangeRegex = /(\[|\()(\*|(\d|\.)+),(\*|(\d|\.)+)(\]|\))/;
const matchRange = dependencies_js_1.matches.shape({ range: dependencies_js_1.matches.regex(rangeRegex) });
const matchIntegral = dependencies_js_1.matches.shape({ integral: dependencies_js_1.matches.literal(true) });
const matchSpec = dependencies_js_1.matches.shape({ spec: recordString });
const matchSubType = dependencies_js_1.matches.shape({ subtype: dependencies_js_1.matches.string });
const matchUnion = dependencies_js_1.matches.shape({
tag: dependencies_js_1.matches.shape({ id: dependencies_js_1.matches.string }),
variants: recordString,
});
const matchValues = dependencies_js_1.matches.shape({
values: dependencies_js_1.matches.arrayOf(dependencies_js_1.matches.string),
});
function charRange(value = "") {
const split = value
.split("-")
.filter(Boolean)
.map((x) => x.charCodeAt(0));
if (split.length < 1)
return null;
if (split.length === 1)
return [split[0], split[0]];
return [split[0], split[1]];
}
/**
* @param generate.charset Pattern like "a-z" or "a-z,1-5"
* @param generate.len Length to make random variable
* @param param1
* @returns
*/
function generateDefault(generate, { random = () => Math.random() } = {}) {
const validCharSets = generate.charset.split(",").map(charRange)
.filter(Array.isArray);
if (validCharSets.length === 0) {
throw new Error("Expecing that we have a valid charset");
}
const max = validCharSets.reduce((acc, x) => x.reduce((x, y) => Math.max(x, y), acc), 0);
let i = 0;
const answer = Array(generate.len);
while (i < generate.len) {
const nextValue = Math.round(random() * max);
const inRange = validCharSets.reduce((acc, [lower, upper]) => acc || (nextValue >= lower && nextValue <= upper), false);
if (!inRange)
continue;
answer[i] = String.fromCharCode(nextValue);
i++;
}
return answer.join("");
}
exports.generateDefault = generateDefault;
function withPattern(value) {
if (matchPattern.test(value))
return dependencies_js_1.matches.regex(RegExp(value.pattern));
return dependencies_js_1.matches.string;
}
function matchNumberWithRange(range) {
const matched = rangeRegex.exec(range);
if (!matched)
return dependencies_js_1.matches.number;
const [, left, leftValue, , rightValue, , right] = matched;
return dependencies_js_1.matches.number
.validate(leftValue === "*"
? (_) => true
: left === "["
? (x) => x >= Number(leftValue)
: (x) => x > Number(leftValue), leftValue === "*"
? "any"
: left === "["
? `greaterThanOrEqualTo${leftValue}`
: `greaterThan${leftValue}`)
.validate(rightValue === "*"
? (_) => true
: right === "]"
? (x) => x <= Number(rightValue)
: (x) => x < Number(rightValue), rightValue === "*"
? "any"
: right === "]"
? `lessThanOrEqualTo${rightValue}`
: `lessThan${rightValue}`);
}
exports.matchNumberWithRange = matchNumberWithRange;
function withIntegral(parser, value) {
if (matchIntegral.test(value)) {
return parser.validate(Number.isInteger, "isIntegral");
}
return parser;
}
function withRange(value) {
if (matchRange.test(value)) {
return matchNumberWithRange(value.range);
}
return dependencies_js_1.matches.number;
}
const isGenerator = dependencies_js_1.matches.shape({ charset: dependencies_js_1.matches.string, len: dependencies_js_1.matches.number }).test;
function defaultNullable(parser, value) {
if (matchDefault.test(value)) {
if (isGenerator(value.default)) {
return parser.defaultTo(parser.unsafeCast(generateDefault(value.default)));
}
return parser.defaultTo(value.default);
}
if (matchNullable.test(value))
return parser.optional();
return parser;
}
/**
* ConfigSpec: Tells the UI how to ask for information, verification, and will send the service a config in a shape via the spec.
* ValueSpecAny: This is any of the values in a config spec.
*
* Use this when we want to convert a value spec any into a parser for what a config will look like
* @param value
* @returns
*/
function guardAll(value) {
if (!isType.test(value)) {
// deno-lint-ignore no-explicit-any
return dependencies_js_1.matches.unknown;
}
switch (value.type) {
case "boolean":
// deno-lint-ignore no-explicit-any
return defaultNullable(dependencies_js_1.matches.boolean, value);
case "string":
// deno-lint-ignore no-explicit-any
return defaultNullable(withPattern(value), value);
case "number":
return defaultNullable(withIntegral(withRange(value), value), value);
case "object":
if (matchSpec.test(value)) {
// deno-lint-ignore no-explicit-any
return defaultNullable(typeFromProps(value.spec), value);
}
// deno-lint-ignore no-explicit-any
return dependencies_js_1.matches.unknown;
case "list": {
const spec = (matchSpec.test(value) && value.spec) || {};
const rangeValidate = (matchRange.test(value) && matchNumberWithRange(value.range).test) ||
(() => true);
const subtype = matchSubType.unsafeCast(value).subtype;
return defaultNullable(dependencies_js_1.matches
// deno-lint-ignore no-explicit-any
.arrayOf(guardAll({ type: subtype, ...spec }))
.validate((x) => rangeValidate(x.length), "valid length"), value);
}
case "enum":
if (matchValues.test(value)) {
return defaultNullable(dependencies_js_1.matches.literals(value.values[0], ...value.values), value);
}
// deno-lint-ignore no-explicit-any
return dependencies_js_1.matches.unknown;
case "union":
if (matchUnion.test(value)) {
return dependencies_js_1.matches.some(...Object.entries(value.variants).map(([variant, spec]) => dependencies_js_1.matches.shape({ [value.tag.id]: dependencies_js_1.matches.literal(variant) }).concat(typeFromProps(spec))));
}
// deno-lint-ignore no-explicit-any
return dependencies_js_1.matches.unknown;
}
// deno-lint-ignore no-explicit-any
return dependencies_js_1.matches.unknown;
}
exports.guardAll = guardAll;
/**
* ConfigSpec: Tells the UI how to ask for information, verification, and will send the service a config in a shape via the spec.
* ValueSpecAny: This is any of the values in a config spec.
*
* Use this when we want to convert a config spec into a parser for what a config will look like
* @param valueDictionary
* @returns
*/
function typeFromProps(valueDictionary) {
// deno-lint-ignore no-explicit-any
if (!recordString.test(valueDictionary))
return dependencies_js_1.matches.unknown;
return dependencies_js_1.matches.shape(Object.fromEntries(Object.entries(valueDictionary).map(([key, value]) => [key, guardAll(value)])));
}
exports.typeFromProps = typeFromProps;

View File

@@ -0,0 +1,368 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
const dntShim = __importStar(require("../_dnt.test_shims.js"));
const PM = __importStar(require("./propertiesMatcher.js"));
const mod_js_1 = require("../deps/deno.land/x/expect@v0.2.9/mod.js");
const dependencies_js_1 = require("../dependencies.js");
const output_js_1 = require("./test/output.js");
const randWithSeed = (seed = 1) => {
return function random() {
const x = Math.sin(seed++) * 10000;
return x - Math.floor(x);
};
};
const bitcoinProperties = output_js_1.config.build();
const anyValue = "";
const _testBoolean = anyValue;
// @ts-expect-error Boolean can't be a string
const _testBooleanBad = anyValue;
const _testString = anyValue;
// @ts-expect-error string can't be a boolean
const _testStringBad = anyValue;
const _testNumber = anyValue;
// @ts-expect-error Number can't be string
const _testNumberBad = anyValue;
const _testObject = anyValue;
// @ts-expect-error Boolean can't be object
const _testObjectBad = anyValue;
const _testObjectNested = anyValue;
const _testList = anyValue;
// @ts-expect-error number[] can't be string[]
const _testListBad = anyValue;
const _testPointer = anyValue;
const testUnionValue = anyValue;
const _testUnion = testUnionValue;
//@ts-expect-error Bad mode name
const _testUnionBadUnion = testUnionValue;
const _testAll = anyValue;
const { test } = dntShim.Deno;
{
test("matchNumberWithRange (1,4)", () => {
const checker = PM.matchNumberWithRange("(1,4)");
(0, mod_js_1.expect)(checker.test(0)).toBe(false);
(0, mod_js_1.expect)(checker.test(1)).toBe(false);
(0, mod_js_1.expect)(checker.test(2)).toBe(true);
(0, mod_js_1.expect)(checker.test(3)).toBe(true);
(0, mod_js_1.expect)(checker.test(4)).toBe(false);
(0, mod_js_1.expect)(checker.test(5)).toBe(false);
});
test("matchNumberWithRange [1,4]", () => {
const checker = PM.matchNumberWithRange("[1,4]");
(0, mod_js_1.expect)(checker.test(0)).toBe(false);
(0, mod_js_1.expect)(checker.test(1)).toBe(true);
(0, mod_js_1.expect)(checker.test(2)).toBe(true);
(0, mod_js_1.expect)(checker.test(3)).toBe(true);
(0, mod_js_1.expect)(checker.test(4)).toBe(true);
(0, mod_js_1.expect)(checker.test(5)).toBe(false);
});
test("matchNumberWithRange [1,*)", () => {
const checker = PM.matchNumberWithRange("[1,*)");
(0, mod_js_1.expect)(checker.test(0)).toBe(false);
(0, mod_js_1.expect)(checker.test(1)).toBe(true);
(0, mod_js_1.expect)(checker.test(2)).toBe(true);
(0, mod_js_1.expect)(checker.test(3)).toBe(true);
(0, mod_js_1.expect)(checker.test(4)).toBe(true);
(0, mod_js_1.expect)(checker.test(5)).toBe(true);
});
test("matchNumberWithRange (*,4]", () => {
const checker = PM.matchNumberWithRange("(*,4]");
(0, mod_js_1.expect)(checker.test(0)).toBe(true);
(0, mod_js_1.expect)(checker.test(1)).toBe(true);
(0, mod_js_1.expect)(checker.test(2)).toBe(true);
(0, mod_js_1.expect)(checker.test(3)).toBe(true);
(0, mod_js_1.expect)(checker.test(4)).toBe(true);
(0, mod_js_1.expect)(checker.test(5)).toBe(false);
});
}
{
test("Generate 1", () => {
const random = randWithSeed(1);
const options = { random };
const generated = PM.generateDefault({ charset: "a-z,B-X,2-5", len: 100 }, options);
(0, mod_js_1.expect)(generated.length).toBe(100);
(0, mod_js_1.expect)(generated).toBe("WwwgjGRkvDaGQSLeKTtlOmdDbXoCBkOn3dxUvkKkrlOFd4FbKuvIosvfPTQhbWCTQakqnwpoHmPnbgyK5CGtSQyGhxEGLjS3oKko");
});
test("Generate Tests", () => {
const random = randWithSeed(2);
const options = { random };
(0, mod_js_1.expect)(PM.generateDefault({ charset: "0-1", len: 100 }, options)).toBe("0000110010000000000011110000010010000011101111001000000000000000100001101000010000001000010000010110");
(0, mod_js_1.expect)(PM.generateDefault({ charset: "a-z", len: 100 }, options)).toBe("qipnycbqmqdtflrhnckgrhftrqnvxbhyyfehpvficljseasxwdyleacmjqemmpnuotkwzlsqdumuaaksxykchljgdoslrfubhepr");
(0, mod_js_1.expect)(PM.generateDefault({ charset: "a,b,c,d,f,g", len: 100 }, options))
.toBe("bagbafcgaaddcabdfadccaadfbddffdcfccfbafbddbbfcdggfcgaffdbcgcagcfbdbfaagbfgfccdbfdfbdagcfdcabbdffaffc");
});
}
{
test("Specs Union", () => {
const checker = PM.guardAll(bitcoinProperties.advanced.spec.pruning);
console.log("Checker = ", dependencies_js_1.matches.Parser.parserAsString(checker.parser));
checker.unsafeCast({ mode: "automatic", size: 1234 });
});
test("A default that is invalid according to the tests", () => {
const checker = PM.typeFromProps({
pubkey_whitelist: {
name: "Pubkey Whitelist (hex)",
description: "A list of pubkeys that are permitted to publish through your relay. A minimum, you need to enter your own Nostr hex (not npub) pubkey. Go to https://damus.io/key/ to convert from npub to hex.",
type: "list",
range: "[1,*)",
subtype: "string",
spec: {
masked: false,
placeholder: "hex (not npub) pubkey",
pattern: "[0-9a-fA-F]{3}",
"pattern-description": "Must be a valid 64-digit hexadecimal value (ie a Nostr hex pubkey, not an npub). Go to https://damus.io/key/ to convert npub to hex.",
},
default: [],
warning: null,
},
});
checker.unsafeCast({
pubkey_whitelist: ["aaa"],
});
});
test("Full spec", () => {
const checker = PM.typeFromProps(bitcoinProperties);
checker.unsafeCast({
rpc: {
enable: true,
username: "asdf",
password: "asdf",
advanced: {
auth: ["test:34$aa"],
serialversion: "non-segwit",
servertimeout: 12,
threads: 12,
workqueue: 12,
},
},
"zmq-enabled": false,
txindex: false,
wallet: {
enable: true,
avoidpartialspends: false,
discardfee: 0,
},
advanced: {
mempool: {
mempoolfullrbf: false,
persistmempool: false,
maxmempool: 3012,
mempoolexpiry: 321,
},
peers: {
listen: false,
onlyconnect: false,
onlyonion: false,
addnode: [{ hostname: "google.com", port: 231 }],
},
dbcache: 123,
pruning: { mode: "automatic", size: 1234 },
blockfilters: {
blockfilterindex: false,
peerblockfilters: false,
},
bloomfilters: {
peerbloomfilters: false,
},
},
});
(0, mod_js_1.expect)(() => checker.unsafeCast({
rpc: {
enable: true,
username: "asdf",
password: "asdf",
advanced: {
auth: ["test:34$aa"],
serialversion: "non-segwit",
servertimeout: 12,
threads: 12,
workqueue: 12,
},
},
"zmq-enabled": false,
txindex: false,
wallet: {
enable: true,
avoidpartialspends: false,
discardfee: 0,
},
advanced: {
mempool: {
mempoolfullrbf: false,
persistmempool: false,
maxmempool: 3012,
mempoolexpiry: 321,
},
peers: {
listen: false,
onlyconnect: false,
onlyonion: false,
addnode: [{ hostname: "google", port: 231 }],
},
dbcache: 123,
pruning: { mode: "automatic", size: 1234 },
blockfilters: {
blockfilterindex: false,
peerblockfilters: false,
},
bloomfilters: {
peerbloomfilters: false,
},
},
})).toThrow();
(0, mod_js_1.expect)(() => checker.unsafeCast({
rpc: {
enable: true,
username: "asdf",
password: "asdf",
advanced: {
auth: ["test34$aa"],
serialversion: "non-segwit",
servertimeout: 12,
threads: 12,
workqueue: 12,
},
},
"zmq-enabled": false,
txindex: false,
wallet: {
enable: true,
avoidpartialspends: false,
discardfee: 0,
},
advanced: {
mempool: {
mempoolfullrbf: false,
persistmempool: false,
maxmempool: 3012,
mempoolexpiry: 321,
},
peers: {
listen: false,
onlyconnect: false,
onlyonion: false,
addnode: [{ hostname: "google.com", port: 231 }],
},
dbcache: 123,
pruning: { mode: "automatic", size: 1234 },
blockfilters: {
blockfilterindex: false,
peerblockfilters: false,
},
bloomfilters: {
peerbloomfilters: false,
},
},
})).toThrow();
(0, mod_js_1.expect)(() => checker.unsafeCast({
rpc: {
enable: true,
username: "asdf",
password: "asdf",
advanced: {
auth: ["test:34$aa"],
serialversion: "non-segwit",
servertimeout: 12,
threads: 12,
workqueue: 12,
},
},
"zmq-enabled": false,
txindex: false,
wallet: {
enable: true,
avoidpartialspends: false,
discardfee: 0,
},
advanced: {
mempool: {
mempoolfullrbf: false,
persistmempool: false,
maxmempool: 3012,
mempoolexpiry: 321,
},
peers: {
listen: false,
onlyconnect: false,
onlyonion: false,
addnode: [{ hostname: "google.com", port: 231 }],
},
dbcache: 123,
pruning: { mode: "automatic", size: "1234" },
blockfilters: {
blockfilterindex: false,
peerblockfilters: false,
},
bloomfilters: {
peerbloomfilters: false,
},
},
})).toThrow();
checker.unsafeCast({
rpc: {
enable: true,
username: "asdf",
password: "asdf",
advanced: {
auth: ["test:34$aa"],
serialversion: "non-segwit",
servertimeout: 12,
threads: 12,
workqueue: 12,
},
},
"zmq-enabled": false,
txindex: false,
wallet: {
enable: true,
avoidpartialspends: false,
discardfee: 0,
},
advanced: {
mempool: {
mempoolfullrbf: false,
persistmempool: false,
maxmempool: 3012,
mempoolexpiry: 321,
},
peers: {
listen: false,
onlyconnect: false,
onlyonion: false,
addnode: [{ hostname: "google.com", port: 231 }],
},
dbcache: 123,
pruning: { mode: "automatic", size: 1234 },
blockfilters: {
blockfilterindex: false,
peerblockfilters: false,
},
bloomfilters: {
peerbloomfilters: false,
},
},
});
});
}

View File

@@ -0,0 +1,433 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.bloomFiltersBip37Spec = exports.peerbloomfilters = exports.blockfilters = exports.blockFiltersSpec = exports.peerblockfilters = exports.blockfilterindex = exports.pruning = exports.pruningSettingsVariants = exports.manual = exports.size1 = exports.automatic = exports.size = exports.disabled = exports.dbcache = exports.peers = exports.peersSpec = exports.addnode = exports.addNodesList = exports.addNodesSpec = exports.port = exports.hostname = exports.onlyonion = exports.onlyconnect = exports.listen = exports.mempool = exports.mempoolSpec = exports.mempoolexpiry = exports.maxmempool = exports.persistmempool = exports.mempoolfullrbf = exports.wallet = exports.walletSpec = exports.discardfee = exports.avoidpartialspends = exports.enable1 = exports.txindex = exports.zmqEnabled = exports.rpc = exports.rpcSettingsSpec = exports.advanced = exports.advancedSpec = exports.workqueue = exports.threads = exports.servertimeout = exports.serialversion = exports.auth = exports.authorizationList = exports.password = exports.username = exports.enable = void 0;
exports.config = exports.advanced1 = exports.advancedSpec1 = exports.bloomfilters = void 0;
const mod_js_1 = require("../../config/mod.js");
exports.enable = mod_js_1.Value.boolean({
"name": "Enable",
"default": true,
"description": "Allow remote RPC requests.",
"warning": null,
});
exports.username = mod_js_1.Value.string({
"name": "Username",
"default": "bitcoin",
"description": "The username for connecting to Bitcoin over RPC.",
"warning": null,
"nullable": false,
"masked": true,
"placeholder": null,
"pattern": "^[a-zA-Z0-9_]+$",
"pattern-description": "Must be alphanumeric (can contain underscore).",
"textarea": null,
});
exports.password = mod_js_1.Value.string({
"name": "RPC Password",
"default": {
"charset": "a-z,2-7",
"len": 20,
},
"description": "The password for connecting to Bitcoin over RPC.",
"warning": null,
"nullable": false,
"masked": true,
"placeholder": null,
"pattern": '^[^\\n"]*$',
"pattern-description": "Must not contain newline or quote characters.",
"textarea": null,
});
exports.authorizationList = mod_js_1.List.string({
"name": "Authorization",
"range": "[0,*)",
"spec": {
"masked": null,
"placeholder": null,
"pattern": "^[a-zA-Z0-9_-]+:([0-9a-fA-F]{2})+\\$([0-9a-fA-F]{2})+$",
"pattern-description": 'Each item must be of the form "<USERNAME>:<SALT>$<HASH>".',
"textarea": false,
},
"default": [],
"description": "Username and hashed password for JSON-RPC connections. RPC clients connect using the usual http basic authentication.",
"warning": null,
});
exports.auth = mod_js_1.Value.list(exports.authorizationList);
exports.serialversion = mod_js_1.Value.enum({
"name": "Serialization Version",
"description": "Return raw transaction or block hex with Segwit or non-SegWit serialization.",
"warning": null,
"default": "segwit",
"values": [
"non-segwit",
"segwit",
],
"value-names": {},
});
exports.servertimeout = mod_js_1.Value.number({
"name": "Rpc Server Timeout",
"default": 30,
"description": "Number of seconds after which an uncompleted RPC call will time out.",
"warning": null,
"nullable": false,
"range": "[5,300]",
"integral": true,
"units": "seconds",
"placeholder": null,
});
exports.threads = mod_js_1.Value.number({
"name": "Threads",
"default": 16,
"description": "Set the number of threads for handling RPC calls. You may wish to increase this if you are making lots of calls via an integration.",
"warning": null,
"nullable": false,
"range": "[1,64]",
"integral": true,
"units": null,
"placeholder": null,
});
exports.workqueue = mod_js_1.Value.number({
"name": "Work Queue",
"default": 128,
"description": "Set the depth of the work queue to service RPC calls. Determines how long the backlog of RPC requests can get before it just rejects new ones.",
"warning": null,
"nullable": false,
"range": "[8,256]",
"integral": true,
"units": "requests",
"placeholder": null,
});
exports.advancedSpec = mod_js_1.Config.of({
"auth": exports.auth,
"serialversion": exports.serialversion,
"servertimeout": exports.servertimeout,
"threads": exports.threads,
"workqueue": exports.workqueue,
});
exports.advanced = mod_js_1.Value.object({
name: "Advanced",
description: "Advanced RPC Settings",
warning: null,
default: null,
"display-as": null,
"unique-by": null,
spec: exports.advancedSpec,
"value-names": {},
});
exports.rpcSettingsSpec = mod_js_1.Config.of({
"enable": exports.enable,
"username": exports.username,
"password": exports.password,
"advanced": exports.advanced,
});
exports.rpc = mod_js_1.Value.object({
name: "RPC Settings",
description: "RPC configuration options.",
warning: null,
default: null,
"display-as": null,
"unique-by": null,
spec: exports.rpcSettingsSpec,
"value-names": {},
});
exports.zmqEnabled = mod_js_1.Value.boolean({
"name": "ZeroMQ Enabled",
"default": true,
"description": "Enable the ZeroMQ interface",
"warning": null,
});
exports.txindex = mod_js_1.Value.boolean({
"name": "Transaction Index",
"default": true,
"description": "Enable the Transaction Index (txindex)",
"warning": null,
});
exports.enable1 = mod_js_1.Value.boolean({
"name": "Enable Wallet",
"default": true,
"description": "Load the wallet and enable wallet RPC calls.",
"warning": null,
});
exports.avoidpartialspends = mod_js_1.Value.boolean({
"name": "Avoid Partial Spends",
"default": true,
"description": "Group outputs by address, selecting all or none, instead of selecting on a per-output basis. This improves privacy at the expense of higher transaction fees.",
"warning": null,
});
exports.discardfee = mod_js_1.Value.number({
"name": "Discard Change Tolerance",
"default": 0.0001,
"description": "The fee rate (in BTC/kB) that indicates your tolerance for discarding change by adding it to the fee.",
"warning": null,
"nullable": false,
"range": "[0,.01]",
"integral": false,
"units": "BTC/kB",
"placeholder": null,
});
exports.walletSpec = mod_js_1.Config.of({
"enable": exports.enable1,
"avoidpartialspends": exports.avoidpartialspends,
"discardfee": exports.discardfee,
});
exports.wallet = mod_js_1.Value.object({
name: "Wallet",
description: "Wallet Settings",
warning: null,
default: null,
"display-as": null,
"unique-by": null,
spec: exports.walletSpec,
"value-names": {},
});
exports.mempoolfullrbf = mod_js_1.Value.boolean({
"name": "Enable Full RBF",
"default": false,
"description": "Policy for your node to use for relaying and mining unconfirmed transactions. For details, see https://github.com/bitcoin/bitcoin/blob/master/doc/release-notes/release-notes-24.0.md#notice-of-new-option-for-transaction-replacement-policies",
"warning": null,
});
exports.persistmempool = mod_js_1.Value.boolean({
"name": "Persist Mempool",
"default": true,
"description": "Save the mempool on shutdown and load on restart.",
"warning": null,
});
exports.maxmempool = mod_js_1.Value.number({
"name": "Max Mempool Size",
"default": 300,
"description": "Keep the transaction memory pool below <n> megabytes.",
"warning": null,
"nullable": false,
"range": "[1,*)",
"integral": true,
"units": "MiB",
"placeholder": null,
});
exports.mempoolexpiry = mod_js_1.Value.number({
"name": "Mempool Expiration",
"default": 336,
"description": "Do not keep transactions in the mempool longer than <n> hours.",
"warning": null,
"nullable": false,
"range": "[1,*)",
"integral": true,
"units": "Hr",
"placeholder": null,
});
exports.mempoolSpec = mod_js_1.Config.of({
"mempoolfullrbf": exports.mempoolfullrbf,
"persistmempool": exports.persistmempool,
"maxmempool": exports.maxmempool,
"mempoolexpiry": exports.mempoolexpiry,
});
exports.mempool = mod_js_1.Value.object({
name: "Mempool",
description: "Mempool Settings",
warning: null,
default: null,
"display-as": null,
"unique-by": null,
spec: exports.mempoolSpec,
"value-names": {},
});
exports.listen = mod_js_1.Value.boolean({
"name": "Make Public",
"default": true,
"description": "Allow other nodes to find your server on the network.",
"warning": null,
});
exports.onlyconnect = mod_js_1.Value.boolean({
"name": "Disable Peer Discovery",
"default": false,
"description": "Only connect to specified peers.",
"warning": null,
});
exports.onlyonion = mod_js_1.Value.boolean({
"name": "Disable Clearnet",
"default": false,
"description": "Only connect to peers over Tor.",
"warning": null,
});
exports.hostname = mod_js_1.Value.string({
"name": "Hostname",
"default": null,
"description": "Domain or IP address of bitcoin peer",
"warning": null,
"nullable": false,
"masked": null,
"placeholder": null,
"pattern": "(^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$)|((^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$)|(^[a-z2-7]{16}\\.onion$)|(^([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]$))",
"pattern-description": "Must be either a domain name, or an IPv4 or IPv6 address. Do not include protocol scheme (eg 'http://') or port.",
"textarea": null,
});
exports.port = mod_js_1.Value.number({
"name": "Port",
"default": null,
"description": "Port that peer is listening on for inbound p2p connections",
"warning": null,
"nullable": true,
"range": "[0,65535]",
"integral": true,
"units": null,
"placeholder": null,
});
exports.addNodesSpec = mod_js_1.Config.of({ "hostname": exports.hostname, "port": exports.port });
exports.addNodesList = mod_js_1.List.obj({
name: "Add Nodes",
range: "[0,*)",
spec: {
spec: exports.addNodesSpec,
"display-as": null,
"unique-by": null,
},
default: [],
description: "Add addresses of nodes to connect to.",
warning: null,
});
exports.addnode = mod_js_1.Value.list(exports.addNodesList);
exports.peersSpec = mod_js_1.Config.of({
"listen": exports.listen,
"onlyconnect": exports.onlyconnect,
"onlyonion": exports.onlyonion,
"addnode": exports.addnode,
});
exports.peers = mod_js_1.Value.object({
name: "Peers",
description: "Peer Connection Settings",
warning: null,
default: null,
"display-as": null,
"unique-by": null,
spec: exports.peersSpec,
"value-names": {},
});
exports.dbcache = mod_js_1.Value.number({
"name": "Database Cache",
"default": null,
"description": "How much RAM to allocate for caching the TXO set. Higher values improve syncing performance, but increase your chance of using up all your system's memory or corrupting your database in the event of an ungraceful shutdown. Set this high but comfortably below your system's total RAM during IBD, then turn down to 450 (or leave blank) once the sync completes.",
"warning": "WARNING: Increasing this value results in a higher chance of ungraceful shutdowns, which can leave your node unusable if it happens during the initial block download. Use this setting with caution. Be sure to set this back to the default (450 or leave blank) once your node is synced. DO NOT press the STOP button if your dbcache is large. Instead, set this number back to the default, hit save, and wait for bitcoind to restart on its own.",
"nullable": true,
"range": "(0,*)",
"integral": true,
"units": "MiB",
"placeholder": null,
});
exports.disabled = mod_js_1.Config.of({});
exports.size = mod_js_1.Value.number({
"name": "Max Chain Size",
"default": 550,
"description": "Limit of blockchain size on disk.",
"warning": "Increasing this value will require re-syncing your node.",
"nullable": false,
"range": "[550,1000000)",
"integral": true,
"units": "MiB",
"placeholder": null,
});
exports.automatic = mod_js_1.Config.of({ "size": exports.size });
exports.size1 = mod_js_1.Value.number({
"name": "Failsafe Chain Size",
"default": 65536,
"description": "Prune blockchain if size expands beyond this.",
"warning": null,
"nullable": false,
"range": "[550,1000000)",
"integral": true,
"units": "MiB",
"placeholder": null,
});
exports.manual = mod_js_1.Config.of({ "size": exports.size1 });
exports.pruningSettingsVariants = mod_js_1.Variants.of({
"disabled": exports.disabled,
"automatic": exports.automatic,
"manual": exports.manual,
});
exports.pruning = mod_js_1.Value.union({
name: "Pruning Settings",
description: "Blockchain Pruning Options\nReduce the blockchain size on disk\n",
warning: "If you set pruning to Manual and your disk is smaller than the total size of the blockchain, you MUST have something running that prunes these blocks or you may overfill your disk!\nDisabling pruning will convert your node into a full archival node. This requires a resync of the entire blockchain, a process that may take several days. Make sure you have enough free disk space or you may fill up your disk.\n",
default: "disabled",
variants: exports.pruningSettingsVariants,
tag: {
"id": "mode",
"name": "Pruning Mode",
"description": '- Disabled: Disable pruning\n- Automatic: Limit blockchain size on disk to a certain number of megabytes\n- Manual: Prune blockchain with the "pruneblockchain" RPC\n',
"warning": null,
"variant-names": {
"disabled": "Disabled",
"automatic": "Automatic",
"manual": "Manual",
},
},
"display-as": null,
"unique-by": null,
"variant-names": null,
});
exports.blockfilterindex = mod_js_1.Value.boolean({
"name": "Compute Compact Block Filters (BIP158)",
"default": true,
"description": "Generate Compact Block Filters during initial sync (IBD) to enable 'getblockfilter' RPC. This is useful if dependent services need block filters to efficiently scan for addresses/transactions etc.",
"warning": null,
});
exports.peerblockfilters = mod_js_1.Value.boolean({
"name": "Serve Compact Block Filters to Peers (BIP157)",
"default": false,
"description": "Serve Compact Block Filters as a peer service to other nodes on the network. This is useful if you wish to connect an SPV client to your node to make it efficient to scan transactions without having to download all block data. 'Compute Compact Block Filters (BIP158)' is required.",
"warning": null,
});
exports.blockFiltersSpec = mod_js_1.Config.of({
"blockfilterindex": exports.blockfilterindex,
"peerblockfilters": exports.peerblockfilters,
});
exports.blockfilters = mod_js_1.Value.object({
name: "Block Filters",
description: "Settings for storing and serving compact block filters",
warning: null,
default: null,
"display-as": null,
"unique-by": null,
spec: exports.blockFiltersSpec,
"value-names": {},
});
exports.peerbloomfilters = mod_js_1.Value.boolean({
"name": "Serve Bloom Filters to Peers",
"default": false,
"description": "Peers have the option of setting filters on each connection they make after the version handshake has completed. Bloom filters are for clients implementing SPV (Simplified Payment Verification) that want to check that block headers connect together correctly, without needing to verify the full blockchain. The client must trust that the transactions in the chain are in fact valid. It is highly recommended AGAINST using for anything except Bisq integration.",
"warning": "This is ONLY for use with Bisq integration, please use Block Filters for all other applications.",
});
exports.bloomFiltersBip37Spec = mod_js_1.Config.of({
"peerbloomfilters": exports.peerbloomfilters,
});
exports.bloomfilters = mod_js_1.Value.object({
name: "Bloom Filters (BIP37)",
description: "Setting for serving Bloom Filters",
warning: null,
default: null,
"display-as": null,
"unique-by": null,
spec: exports.bloomFiltersBip37Spec,
"value-names": {},
});
exports.advancedSpec1 = mod_js_1.Config.of({
"mempool": exports.mempool,
"peers": exports.peers,
"dbcache": exports.dbcache,
"pruning": exports.pruning,
"blockfilters": exports.blockfilters,
"bloomfilters": exports.bloomfilters,
});
exports.advanced1 = mod_js_1.Value.object({
name: "Advanced",
description: "Advanced Settings",
warning: null,
default: null,
"display-as": null,
"unique-by": null,
spec: exports.advancedSpec1,
"value-names": {},
});
exports.config = mod_js_1.Config.of({
"rpc": exports.rpc,
"zmq-enabled": exports.zmqEnabled,
"txindex": exports.txindex,
"wallet": exports.wallet,
"advanced": exports.advanced1,
});