Skip to content

Commit

Permalink
Merge branch 'main' into the-federation-layer-v0.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Reckless-Satoshi authored Jan 28, 2024
2 parents e681bdc + 4aca6b9 commit 0f8ebdc
Show file tree
Hide file tree
Showing 14 changed files with 213 additions and 190 deletions.
33 changes: 33 additions & 0 deletions api/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from api.logics import Logics
from api.models import Currency, LNPayment, MarketTick, OnchainPayment, Order, Robot
from api.utils import objects_to_hyperlinks
from api.tasks import send_notification

admin.site.unregister(Group)
admin.site.unregister(User)
Expand Down Expand Up @@ -135,13 +136,45 @@ def _logs(self, obj):
return format_html(f'<table style="width: 100%">{with_hyperlinks}</table>')

actions = [
"cancel_public_order",
"maker_wins",
"taker_wins",
"return_everything",
"successful_trade",
"compute_median_trade_time",
]

@admin.action(description="Close public order")
def cancel_public_order(self, request, queryset):
"""
Closes an existing Public/Paused order.
"""
for order in queryset:
if order.status in [Order.Status.PUB, Order.Status.PAU]:
if Logics.return_bond(order.maker_bond):
order.update_status(Order.Status.UCA)
self.message_user(
request,
f"Order {order.id} successfully closed",
messages.SUCCESS,
)
send_notification.delay(
order_id=order.id, message="coordinator_cancelled"
)
else:
self.message_user(
request,
f"Could not unlock bond of {order.id}",
messages.ERROR,
)

else:
self.message_user(
request,
f"Order {order.id} is not public or paused",
messages.ERROR,
)

@admin.action(description="Solve dispute: maker wins")
def maker_wins(self, request, queryset):
"""
Expand Down
6 changes: 6 additions & 0 deletions api/notifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,3 +185,9 @@ def new_chat_message(self, order, chat_message):
self.send_message(user.robot.telegram_chat_id, text)

return

def coordinator_cancelled(self, order):
if order.maker.robot.telegram_enabled:
text = f"🛠️ Your order with ID {order.id} has been cancelled by the coordinator {config('COORDINATOR_ALIAS', cast=str, default='NoAlias')} for the upcoming maintenance stop."
self.send_message(order.maker.robot.telegram_chat_id, text)
return
3 changes: 3 additions & 0 deletions api/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,4 +304,7 @@ def send_notification(order_id=None, chat_message_id=None, message=None):
elif message == "new_chat_message":
telegram.new_chat_message(order, chat_message)

elif message == "coordinator_cancelled":
telegram.coordinator_cancelled(order)

return
2 changes: 1 addition & 1 deletion docs/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ masthead_title : # overrides the website title displayed in the masthe
# breadcrumbs : false # true, false (default)
words_per_minute :
robosats:
node_id : 0282eb467bc073833a039940392592bf10cf338a830ba4e392c1667d7697654c7e
node_id : 037ff12b6a4e4bcb4b944b6d20af08cdff61b3461c1dff0d00a88697414d891bc7
maker_fee : 0.025 # In percent (%)
taker_fee : 0.175 # In percent (%)
total_fee : 0.2 # In percent (%)
Expand Down
4 changes: 4 additions & 0 deletions docs/_data/navigation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ tutorial:
url: "/watch/fr/"
- title: '<span class="side-bar-item">&nbsp;&nbsp;<img style="width:22px;height:13px" src="/assets/vector/polish.svg"/> Polski</span>'
url: "/watch/pl/"
- title: '<span class="side-bar-item">&nbsp;&nbsp;<img style="width:22px;height:13px" src="/assets/vector/russian.svg"/> Русский</span>'
url: "/watch/ru/"
- title: '<span class="side-bar-item"><img id="side-icon-big" src="/assets/vector/readme.svg"/>Read</span>'
url: "/watch/en/"
children:
Expand All @@ -100,6 +102,8 @@ tutorial:
url: "/read/es/"
- title: '<span class="side-bar-item">&nbsp;&nbsp;<img style="width:22px;height:13px" src="/assets/vector/german.svg"/> Deutsch</span>'
url: "/read/de/"
- title: '<span class="side-bar-item">&nbsp;&nbsp;<img style="width:22px;height:13px" src="/assets/vector/russian.svg"/> Русский</span>'
url: "/read/ru/"

contribute:
- title: '<span class="side-bar-item"><img id="side-icon-big" src="/assets/vector/handshake-angle.svg"/>Contribute</span>'
Expand Down
25 changes: 11 additions & 14 deletions docs/_pages/contribute/07-donate.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,11 @@ We do, however, get approached by very enthusiastic bitcoiners who want to boost

You can donate the following ways:

- **Zap us on Nostr:**
All Nostr zaps will go towards the social media team.
Here is the nPub for RoboSats account :

```
npub1p2psats79rypr8lpnl9t5qdekfp700x660qsgw284xvq4s09lqrqqk3m82
```
- **Tip the [RoboSats DevFund Node](https://amboss.space/node/{{site.robosats.node_id}}) via KeySend:**
<div>
<lightning-widget name="DevFund Node" accent="#9c27b0" to="[email protected]" image="https://pbs.twimg.com/profile_images/1524391291475406850/ULKOymid_400x400.jpg"/>
<script src="https://embed.twentyuno.net/js/app.js"></script>
</div>

- **Directly tip the developer working on the features you like.** Check the [active PRs](https://github.com/RoboSats/robosats/pulls) and show your support to the developers with via Lightning tips. Simply write a message, for example "@developer_name, I would like to fund your development of this feature with 6000 Sats". The developer should reply with an LN invoice with a long expiration time.

Expand All @@ -47,14 +45,13 @@ npub1p2psats79rypr8lpnl9t5qdekfp700x660qsgw284xvq4s09lqrqqk3m82
{{site.robosats.leaddev_paynym_code}}
```

- **Tip the [experimental RoboSats coordinator](https://amboss.space/node/{{site.robosats.node_id}}) via KeySend:**
<div>
<lightning-widget name="Experimental Coordinator" accent="#9c27b0" to="{{site.robosats.node_id}}" image="https://pbs.twimg.com/profile_images/1524391291475406850/ULKOymid_400x400.jpg"/>
<script src="https://embed.twentyuno.net/js/app.js"></script>
</div>


- **Zap us on Nostr:**
All Nostr zaps will go towards the social media team.
Here is the nPub for RoboSats account :

```
npub1p2psats79rypr8lpnl9t5qdekfp700x660qsgw284xvq4s09lqrqqk3m82
```



Expand Down
13 changes: 13 additions & 0 deletions docs/_pages/tutorials/read/how-to-use_ru.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
layout: single
title: Самоучитель RoboSats
permalink: /read/ru/
toc: true
toc_sticky: true
sidebar:
title: '<img id="side-icon-verybig" src="/assets/vector/chalkboard-user.svg"/>Учебное пособие'
nav: tutorial
---
![image](https://21ideas.org/img/main-section/main_light.png)
### <a href="https://21ideas.org/robosats/" target="_blank">RoboSats – Простой и приватный способ обмена биткоина</a>
Великолепное руководство по использованию "RoboSats" от 21ideas.org
3 changes: 3 additions & 0 deletions docs/_pages/tutorials/watch/videos-de.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ sidebar:
src: "_pages/docs/tutorials/videos-de.md"
---

#### OrangedMike: ROBOSATS - Bitcoin Kauf, Verkauf und Swap
<iframe width="560" height="315" src="https://www.youtube.com/embed/f5LZzvEp_Zw" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>

#### Einundzwanzig: Bitcoin unabhängig und ohne Registrierung kaufen
<iframe width="560" height="315" src="https://www.youtube.com/embed/kmd46irWXvw" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

Expand Down
16 changes: 16 additions & 0 deletions docs/_pages/tutorials/watch/videos-ru.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
layout: single
title: Смотрите и учитесь
permalink: /watch/ru/
toc: true
toc_sticky: true
sidebar:
title: '<img id="side-icon-verybig" src="/assets/vector/circle-play.svg"/>Учебники'
nav: tutorial
src: "_pages/docs/tutorials/videos-ru.md"
---

### BitKorn Guide | RoboSats. Покупка и продажа Биткоина
<iframe width="560" height="315" src="https://www.youtube.com/embed/QCGWXObIsKY" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>

{% include add_tutorials %}
1 change: 1 addition & 0 deletions docs/assets/vector/russian.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 0f8ebdc

Please sign in to comment.