mirror of
https://github.com/lnbits/lnbits.git
synced 2025-09-19 12:01:12 +02:00
add hivemind placeholder extension.
This commit is contained in:
3
lnbits/extensions/hivemind/README.md
Normal file
3
lnbits/extensions/hivemind/README.md
Normal file
@@ -0,0 +1,3 @@
|
||||
<h1>Hivemind</h1>
|
||||
|
||||
Placeholder for a future <a href="https://bitcoinhivemind.com/">Bitcoin Hivemind</a> extension.
|
11
lnbits/extensions/hivemind/__init__.py
Normal file
11
lnbits/extensions/hivemind/__init__.py
Normal file
@@ -0,0 +1,11 @@
|
||||
from quart import Blueprint
|
||||
from lnbits.db import Database
|
||||
|
||||
db = Database("ext_hivemind")
|
||||
|
||||
hivemind_ext: Blueprint = Blueprint(
|
||||
"hivemind", __name__, static_folder="static", template_folder="templates"
|
||||
)
|
||||
|
||||
|
||||
from .views import * # noqa
|
6
lnbits/extensions/hivemind/config.json
Normal file
6
lnbits/extensions/hivemind/config.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"name": "Hivemind",
|
||||
"short_description": "Make cheap talk expensive!",
|
||||
"icon": "batch_prediction",
|
||||
"contributors": ["fiatjaf"]
|
||||
}
|
10
lnbits/extensions/hivemind/migrations.py
Normal file
10
lnbits/extensions/hivemind/migrations.py
Normal file
@@ -0,0 +1,10 @@
|
||||
# async def m001_initial(db):
|
||||
# await db.execute(
|
||||
# f"""
|
||||
# CREATE TABLE hivemind.hivemind (
|
||||
# id TEXT PRIMARY KEY,
|
||||
# wallet TEXT NOT NULL,
|
||||
# time TIMESTAMP NOT NULL DEFAULT {db.timestamp_now}
|
||||
# );
|
||||
# """
|
||||
# )
|
11
lnbits/extensions/hivemind/models.py
Normal file
11
lnbits/extensions/hivemind/models.py
Normal file
@@ -0,0 +1,11 @@
|
||||
# from sqlite3 import Row
|
||||
# from typing import NamedTuple
|
||||
|
||||
|
||||
# class Example(NamedTuple):
|
||||
# id: str
|
||||
# wallet: str
|
||||
#
|
||||
# @classmethod
|
||||
# def from_row(cls, row: Row) -> "Example":
|
||||
# return cls(**dict(row))
|
35
lnbits/extensions/hivemind/templates/hivemind/index.html
Normal file
35
lnbits/extensions/hivemind/templates/hivemind/index.html
Normal file
@@ -0,0 +1,35 @@
|
||||
{% extends "base.html" %} {% from "macros.jinja" import window_vars with context
|
||||
%} {% block page %}
|
||||
<q-card>
|
||||
<q-card-section>
|
||||
<h5 class="text-subtitle1 q-mt-none q-mb-md">
|
||||
This extension is just a placeholder for now.
|
||||
</h5>
|
||||
<p>
|
||||
<a href="https://bitcoinhivemind.com/">Hivemind</a> is a Bitcoin sidechain
|
||||
project for a peer-to-peer oracle protocol that absorbs accurate data into
|
||||
a blockchain so that Bitcoin users can speculate in prediction markets.
|
||||
</p>
|
||||
<p>
|
||||
These markets have the potential to revolutionize the emergence of
|
||||
diffusion of knowledge in society and fix all sorts of problems in the
|
||||
world.
|
||||
</p>
|
||||
<p>
|
||||
This extension will become fully operative when the
|
||||
<a href="https://drivechain.xyz/">BIP300</a> soft-fork gets activated and
|
||||
Bitcoin Hivemind is launched.
|
||||
</p>
|
||||
</q-card-section>
|
||||
</q-card>
|
||||
{% endblock %} {% block scripts %} {{ window_vars(user) }}
|
||||
<script>
|
||||
new Vue({
|
||||
el: '#vue',
|
||||
mixins: [windowMixin],
|
||||
data: function () {
|
||||
return {}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
{% endblock %}
|
12
lnbits/extensions/hivemind/views.py
Normal file
12
lnbits/extensions/hivemind/views.py
Normal file
@@ -0,0 +1,12 @@
|
||||
from quart import g, render_template
|
||||
|
||||
from lnbits.decorators import check_user_exists, validate_uuids
|
||||
|
||||
from . import hivemind_ext
|
||||
|
||||
|
||||
@hivemind_ext.route("/")
|
||||
@validate_uuids(["usr"], required=True)
|
||||
@check_user_exists()
|
||||
async def index():
|
||||
return await render_template("hivemind/index.html", user=g.user)
|
Reference in New Issue
Block a user