aboutsummaryrefslogtreecommitdiffstats
path: root/sampleconfig/liquid/elements.conf
blob: 08b60dd6ebe86094c8c4bdf214e98adaae52b67e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
chain=liquidregtest
listen=1
txindex=1

[liquidregtest]
rpcuser=admin1
rpcpassword=123
rpcbind=0.0.0.0
rpcallowip=0.0.0.0/0
rpcwallet=coinos

validatepegin=0
initialfreecoins=2100000000000000
wallet=coinos

zmqpubrawblock=tcp://0.0.0.0:18606
zmqpubrawtx=tcp://0.0.0.0:18607
: #00D; font-weight: bold } /* Literal.Number */ .highlight .s { color: #D20; background-color: #FFF0F0 } /* Literal.String */ .highlight .na { color: #369 } /* Name.Attribute */ .highlight .nb { color: #038 } /* Name.Builtin */ .highlight .nc { color: #B06; font-weight: bold } /* Name.Class */ .highlight .no { color: #036; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555 } /* Name.Decorator */ .highlight .ne { color: #B06; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #06B; font-weight: bold } /* Name.Function */ .highlight .nl { color: #369; font-style: italic } /* Name.Label */ .highlight .nn { color: #B06; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #369; font-weight: bold } /* Name.Property */ .highlight .nt { color: #B06; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #369 } /* Name.Variable */ .highlight .ow { color: #080 } /* Operator.Word */ .highlight .w { color: #BBB } /* Text.Whitespace */ .highlight .mb { color: #00D; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #00D; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #00D; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #00D; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #00D; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #D20; background-color: #FFF0F0 } /* Literal.String.Affix */ .highlight .sb { color: #D20; background-color: #FFF0F0 } /* Literal.String.Backtick */ .highlight .sc { color: #D20; background-color: #FFF0F0 } /* Literal.String.Char */ .highlight .dl { color: #D20; background-color: #FFF0F0 } /* Literal.String.Delimiter */ .highlight .sd { color: #D20; background-color: #FFF0F0 } /* Literal.String.Doc */ .highlight .s2 { color: #D20; background-color: #FFF0F0 } /* Literal.String.Double */ .highlight .se { color: #04D; background-color: #FFF0F0 } /* Literal.String.Escape */ .highlight .sh { color: #D20; background-color: #FFF0F0 } /* Literal.String.Heredoc */ .highlight .si { color: #33B; background-color: #FFF0F0 } /* Literal.String.Interpol */ .highlight .sx { color: #2B2; background-color: #F0FFF0 } /* Literal.String.Other */ .highlight .sr { color: #080; background-color: #FFF0FF } /* Literal.String.Regex */ .highlight .s1 { color: #D20; background-color: #FFF0F0 } /* Literal.String.Single */ .highlight .ss { color: #A60; background-color: #FFF0F0 } /* Literal.String.Symbol */ .highlight .bp { color: #038 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #06B; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #369 } /* Name.Variable.Class */ .highlight .vg { color: #D70 } /* Name.Variable.Global */ .highlight .vi { color: #33B } /* Name.Variable.Instance */ .highlight .vm { color: #369 } /* Name.Variable.Magic */ .highlight .il { color: #00D; font-weight: bold } /* Literal.Number.Integer.Long */
<script>
	import { SvelteToast } from '@zerodevx/svelte-toast';
	import { onDestroy, onMount } from 'svelte';
	import { close, connect, send } from '$lib/socket';
	import { last, invoice, request, ndef, passwordPrompt, pin } from '$lib/store';
	import { page } from '$app/stores';
	import { browser } from '$app/environment';
	import { goto } from '$app/navigation';
	import { LoadingSplash, Invoice, Password, Request } from '$comp';
	import { warning, protectedRoutes } from '$lib/utils';
	import { t, locale } from '$lib/translations';

	const localeLocalStorageKey = 'sveltekit-i18n-locale';

	export let data;

	let { rate, user, subject, token, rates } = data;

	$: update(data);
	let update = (data) => {
		({ rate, user, subject, token, rates } = data);
	};

	onMount(async () => {
		let localStorageLocale = localStorage.getItem(localeLocalStorageKey);
		if (localStorageLocale) locale.set(localStorageLocale);

		locale.subscribe((lng) => {
			if (lng) localStorage.setItem(localeLocalStorageKey, lng);
		});

		if (browser) {
			let log = console.log;
			checkSocket();
			expirePin();

			try {
				$ndef = new NDEFReader();
				await $ndef.scan();

				$ndef.addEventListener('readingerror', (e) => {
					console.log('nfc error', e);
				});

				$ndef.addEventListener('reading', ({ message, serialNumber }) => {
          goto(`/${user.username}/card/${serialNumber.replace(/:/g, '-')}`);
				});
			} catch (error) {
				log('Argh! ' + error);
			}
		}
	});

	$: browser && connect(token);

	let lost,
		checkTimer,
		expireTimer,
		counter = 0;

	let checkSocket = () => {
		counter++;
		lost = Date.now() - $last > 30000;
		if (lost) connect(token);
		if (counter > 5) {
			send('heartbeat', token);
			counter = 0;
		}

		checkTimer = setTimeout(checkSocket, 1000);
	};

	let expirePin = () => {
		$pin = null;
		expireTimer = setTimeout(expirePin, 300000);
	};

	onDestroy(() => {
		if (browser) {
			clearTimeout(checkTimer);
			clearTimeout(expireTimer);
		}
	});
</script>

{#if browser && $passwordPrompt}
	<Password {user} />
{/if}

<svelte:head>
	{#if subject}
		<title>coinos - {subject.username}</title>
		<meta name="lightning" content={`lnurlp:${subject.username}@coinos.io`} />
	{:else}
		<title>coinos</title>
	{/if}

	{#if subject?.profile}
		<meta name="og:image" content={`/api/public/${subject.uuid}-profile.webp`} />
	{:else}
		<meta property="og:image" content="/icons/logo.svg" />
	{/if}
</svelte:head>

<SvelteToast options={{ reversed: true, intro: { y: 192 } }} />

<main data-sveltekit-prefetch class="pb-20">
	<slot />
</main>

{#if $invoice}
	<Invoice {user} />
{/if}

{#if $request}
	<Request {user} />
{/if}