From 1f2a1abc7509e2baf9ec8028103034fe37834b9d Mon Sep 17 00:00:00 2001 From: jerry Date: Sun, 16 Jun 2024 20:44:17 +0000 Subject: [PATCH 1/8] fix warnings DecimalField should be Decimal type (#1334) --- api/models/currency.py | 3 ++- api/models/market_tick.py | 15 +++++++++++---- api/models/onchain_payment.py | 11 +++++++++-- api/models/order.py | 18 +++++++++++------- 4 files changed, 33 insertions(+), 14 deletions(-) diff --git a/api/models/currency.py b/api/models/currency.py index b9713bc2..1398f2d8 100644 --- a/api/models/currency.py +++ b/api/models/currency.py @@ -1,5 +1,6 @@ import json +from decimal import Decimal from django.core.validators import MinValueValidator from django.db import models from django.utils import timezone @@ -18,7 +19,7 @@ class Currency(models.Model): decimal_places=4, default=None, null=True, - validators=[MinValueValidator(0)], + validators=[MinValueValidator(Decimal(0))], ) timestamp = models.DateTimeField(default=timezone.now) diff --git a/api/models/market_tick.py b/api/models/market_tick.py index ac09d360..ed4020a9 100644 --- a/api/models/market_tick.py +++ b/api/models/market_tick.py @@ -1,5 +1,6 @@ import uuid +from decimal import Decimal from decouple import config from django.core.validators import MaxValueValidator, MinValueValidator from django.db import models @@ -27,21 +28,24 @@ class MarketTick(models.Model): decimal_places=2, default=None, null=True, - validators=[MinValueValidator(0)], + validators=[MinValueValidator(Decimal(0))], ) volume = models.DecimalField( max_digits=8, decimal_places=8, default=None, null=True, - validators=[MinValueValidator(0)], + validators=[MinValueValidator(Decimal(0))], ) premium = models.DecimalField( max_digits=5, decimal_places=2, default=None, null=True, - validators=[MinValueValidator(-100), MaxValueValidator(999)], + validators=[ + MinValueValidator(Decimal(-100)), + MaxValueValidator(Decimal(999)) + ], blank=True, ) currency = models.ForeignKey("api.Currency", null=True, on_delete=models.SET_NULL) @@ -52,7 +56,10 @@ class MarketTick(models.Model): max_digits=4, decimal_places=4, default=0, - validators=[MinValueValidator(0), MaxValueValidator(1)], + validators=[ + MinValueValidator(Decimal(0)), + MaxValueValidator(Decimal(1)) + ], ) def log_a_tick(order): diff --git a/api/models/onchain_payment.py b/api/models/onchain_payment.py index c6959973..83c0a452 100644 --- a/api/models/onchain_payment.py +++ b/api/models/onchain_payment.py @@ -1,3 +1,4 @@ +from decimal import Decimal from django.conf import settings from django.contrib.auth.models import User from django.core.validators import MaxValueValidator, MinValueValidator @@ -58,7 +59,10 @@ class OnchainPayment(models.Model): default=2.05, null=False, blank=False, - validators=[MinValueValidator(1), MaxValueValidator(999)], + validators=[ + MinValueValidator(Decimal(1)), + MaxValueValidator(Decimal(999)) + ], ) mining_fee_rate = models.DecimalField( max_digits=6, @@ -66,7 +70,10 @@ class OnchainPayment(models.Model): default=2.05, null=False, blank=False, - validators=[MinValueValidator(1), MaxValueValidator(999)], + validators=[ + MinValueValidator(Decimal(1)), + MaxValueValidator(Decimal(999)) + ], ) mining_fee_sats = models.PositiveBigIntegerField(default=0, null=False, blank=False) diff --git a/api/models/order.py b/api/models/order.py index 50161281..161f6d3e 100644 --- a/api/models/order.py +++ b/api/models/order.py @@ -1,6 +1,7 @@ # We use custom seeded UUID generation during testing import uuid +from decimal import Decimal from decouple import config from django.conf import settings from django.contrib.auth.models import User @@ -90,7 +91,10 @@ class Order(models.Model): decimal_places=2, default=0, null=True, - validators=[MinValueValidator(-100), MaxValueValidator(999)], + validators=[ + MinValueValidator(Decimal(-100)), + MaxValueValidator(Decimal(999)) + ], blank=True, ) # explicit @@ -135,8 +139,8 @@ class Order(models.Model): default=settings.DEFAULT_BOND_SIZE, null=False, validators=[ - MinValueValidator(settings.MIN_BOND_SIZE), # 2 % - MaxValueValidator(settings.MAX_BOND_SIZE), # 15 % + MinValueValidator(Decimal(settings.MIN_BOND_SIZE)), # 2 % + MaxValueValidator(Decimal(settings.MAX_BOND_SIZE)), # 15 % ], blank=False, ) @@ -147,8 +151,8 @@ class Order(models.Model): decimal_places=6, null=True, validators=[ - MinValueValidator(-90), - MaxValueValidator(90), + MinValueValidator(Decimal(-90)), + MaxValueValidator(Decimal(90)), ], blank=True, ) @@ -157,8 +161,8 @@ class Order(models.Model): decimal_places=6, null=True, validators=[ - MinValueValidator(-180), - MaxValueValidator(180), + MinValueValidator(Decimal(-180)), + MaxValueValidator(Decimal(180)), ], blank=True, ) From e2902f13e7b5eef32fd4bfa6a8867aeeac53cc45 Mon Sep 17 00:00:00 2001 From: Reckless_Satoshi Date: Sun, 16 Jun 2024 21:47:22 +0100 Subject: [PATCH 2/8] chore: update api schema --- docs/assets/schemas/api-latest.yaml | 2 +- tests/api_specs.yaml | 2013 --------------------------- 2 files changed, 1 insertion(+), 2014 deletions(-) delete mode 100644 tests/api_specs.yaml diff --git a/docs/assets/schemas/api-latest.yaml b/docs/assets/schemas/api-latest.yaml index afdd9436..67735029 100644 --- a/docs/assets/schemas/api-latest.yaml +++ b/docs/assets/schemas/api-latest.yaml @@ -1,7 +1,7 @@ openapi: 3.0.3 info: title: RoboSats REST API - version: 0.6.0 + version: 0.6.2 x-logo: url: https://raw.githubusercontent.com/Reckless-Satoshi/robosats/main/frontend/static/assets/images/robosats-0.1.1-banner.png backgroundColor: '#FFFFFF' diff --git a/tests/api_specs.yaml b/tests/api_specs.yaml deleted file mode 100644 index 33e66235..00000000 --- a/tests/api_specs.yaml +++ /dev/null @@ -1,2013 +0,0 @@ -openapi: 3.0.3 -info: - title: RoboSats REST API - version: 0.5.3 - x-logo: - url: https://raw.githubusercontent.com/Reckless-Satoshi/robosats/main/frontend/static/assets/images/robosats-0.1.1-banner.png - backgroundColor: '#FFFFFF' - altText: RoboSats logo - description: |2+ - - REST API Documentation for [RoboSats](https://learn.robosats.com) - A Simple and Private LN P2P Exchange - -

- Note: - The RoboSats REST API is on v0, which in other words, is beta. - We recommend that if you don't have time to actively maintain - your project, do not build it with v0 of the API. A refactored, simpler - and more stable version - v1 will be released soon™. -

- -paths: - /api/book/: - get: - operationId: book_list - description: Get public orders in the book. - summary: Get public orders - parameters: - - in: query - name: currency - schema: - type: integer - description: The currency id to filter by. Currency IDs can be found [here](https://github.com/RoboSats/robosats/blob/main/frontend/static/assets/currencies.json). - Value of `0` means ANY currency - - in: query - name: type - schema: - type: integer - enum: - - 0 - - 1 - - 2 - description: |- - Order type to filter by - - `0` - BUY - - `1` - SELL - - `2` - ALL - tags: - - book - security: - - tokenAuth: [] - - {} - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/OrderPublic' - description: '' - /api/chat/: - get: - operationId: chat_retrieve - description: Returns chat messages for an order with an index higher than `offset`. - tags: - - chat - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PostMessage' - description: '' - post: - operationId: chat_create - description: Adds one new message to the chatroom. - tags: - - chat - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PostMessage' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/PostMessage' - multipart/form-data: - schema: - $ref: '#/components/schemas/PostMessage' - required: true - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PostMessage' - description: '' - /api/historical/: - get: - operationId: historical_list - description: Get historical exchange activity. Currently, it lists each day's - total contracts and their volume in BTC since inception. - summary: Get historical exchange activity - tags: - - historical - security: - - tokenAuth: [] - - {} - responses: - '200': - content: - application/json: - schema: - type: array - items: - type: object - additionalProperties: - type: object - properties: - volume: - type: integer - description: Total Volume traded on that particular date - num_contracts: - type: number - description: Number of successful trades on that particular - date - examples: - TruncatedExample: - value: - - : - code: USD - price: '42069.69' - min_amount: '4.2' - max_amount: '420.69' - summary: Truncated example - description: '' - /api/info/: - get: - operationId: info_retrieve - description: |2 - - Get general info (overview) about the exchange. - - **Info**: - - Current market data - - num. of orders - - book liquidity - - 24h active robots - - 24h non-KYC premium - - 24h volume - - all time volume - - Node info - - lnd version - - node id - - node alias - - network - - Fees - - maker and taker fees - - on-chain swap fees - summary: Get info - tags: - - info - security: - - tokenAuth: [] - - {} - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Info' - description: '' - /api/limits/: - get: - operationId: limits_list - description: Get a list of order limits for every currency pair available. - summary: List order limits - tags: - - limits - security: - - tokenAuth: [] - - {} - responses: - '200': - content: - application/json: - schema: - type: array - items: - type: object - additionalProperties: - type: object - properties: - code: - type: string - description: Three letter currency symbol - price: - type: integer - min_amount: - type: integer - description: Minimum amount allowed in an order in the particular - currency - max_amount: - type: integer - description: Maximum amount allowed in an order in the particular - currency - examples: - TruncatedExample.RealResponseContainsAllTheCurrencies: - value: - - : - code: USD - price: '42069.69' - min_amount: '4.2' - max_amount: '420.69' - summary: Truncated example. Real response contains all the currencies - description: '' - /api/make/: - post: - operationId: make_create - description: |2 - - Create a new order as a maker. - - - Default values for the following fields if not specified: - - `public_duration` - **24** - - `escrow_duration` - **180** - - `bond_size` - **3.0** - - `has_range` - **false** - - `premium` - **0** - summary: Create a maker order - tags: - - make - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/MakeOrder' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/MakeOrder' - multipart/form-data: - schema: - $ref: '#/components/schemas/MakeOrder' - required: true - security: - - tokenAuth: [] - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/ListOrder' - description: '' - '400': - content: - application/json: - schema: - type: object - properties: - bad_request: - type: string - description: Reason for the failure - description: '' - '409': - content: - application/json: - schema: - type: object - properties: - bad_request: - type: string - description: Reason for the failure - description: '' - /api/order/: - get: - operationId: order_retrieve - description: |2+ - - Get the order details. Details include/exclude attributes according to what is the status of the order - - The following fields are available irrespective of whether you are a participant or not (A participant is either a taker or a maker of an order) - All the other fields are only available when you are either the taker or the maker of the order: - - - `id` - - `status` - - `created_at` - - `expires_at` - - `type` - - `currency` - - `amount` - - `has_range` - - `min_amount` - - `max_amount` - - `payment_method` - - `is_explicit` - - `premium` - - `satoshis` - - `maker` - - `taker` - - `escrow_duration` - - `total_secs_exp` - - `penalty` - - `is_maker` - - `is_taker` - - `is_participant` - - `maker_status` - - `taker_status` - - `price_now` - - ### Order Status - - The response of this route changes according to the status of the order. Some fields are documented below (check the 'Responses' section) - with the status code of when they are available and some or not. With v1 API we aim to simplify this - route to make it easier to understand which fields are available on which order status codes. - - `status` specifies the status of the order. Below is a list of possible values (status codes) and what they mean: - - `0` "Waiting for maker bond" - - `1` "Public" - - `2` "Paused" - - `3` "Waiting for taker bond" - - `4` "Cancelled" - - `5` "Expired" - - `6` "Waiting for trade collateral and buyer invoice" - - `7` "Waiting only for seller trade collateral" - - `8` "Waiting only for buyer invoice" - - `9` "Sending fiat - In chatroom" - - `10` "Fiat sent - In chatroom" - - `11` "In dispute" - - `12` "Collaboratively cancelled" - - `13` "Sending satoshis to buyer" - - `14` "Sucessful trade" - - `15` "Failed lightning network routing" - - `16` "Wait for dispute resolution" - - `17` "Maker lost dispute" - - `18` "Taker lost dispute" - - - Notes: - - both `price_now` and `premium_now` are always calculated irrespective of whether `is_explicit` = true or false - - summary: Get order details - parameters: - - in: query - name: order_id - schema: - type: integer - required: true - tags: - - order - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/OrderDetail' - description: '' - '400': - content: - application/json: - schema: - type: object - properties: - bad_request: - type: string - description: Reason for the failure - examples: - OrderCancelled: - value: - bad_request: This order has been cancelled collaborativelly - summary: Order cancelled - WhenTheOrderIsNotPublicAndYouNeitherTheTakerNorMaker: - value: - bad_request: This order is not available - summary: When the order is not public and you neither the taker - nor maker - WhenMakerBondExpires(asMaker): - value: - bad_request: Invoice expired. You did not confirm publishing the - order in time. Make a new order. - summary: When maker bond expires (as maker) - WhenRobosatsNodeIsDown: - value: - bad_request: The Lightning Network Daemon (LND) is down. Write - in the Telegram group to make sure the staff is aware. - summary: When Robosats node is down - description: '' - '403': - content: - application/json: - schema: - type: object - properties: - bad_request: - type: string - description: Reason for the failure - default: This order is not available - description: '' - '404': - content: - application/json: - schema: - type: object - properties: - bad_request: - type: string - description: Reason for the failure - default: Invalid order Id - description: '' - post: - operationId: order_create - description: |2+ - - Update an order - - `action` field is required and determines what is to be done. Below - is an explanation of what each action does: - - - `take` - - If the order has not expired and is still public, on a - successful take, you get the same response as if `GET /order` - was called and the status of the order was `3` (waiting for - taker bond) which means `bond_satoshis` and `bond_invoice` are - present in the response as well. Once the `bond_invoice` is - paid, you successfully become the taker of the order and the - status of the order changes. - - `pause` - - Toggle the status of an order from `1` to `2` and vice versa. Allowed only if status is `1` (Public) or `2` (Paused) - - `update_invoice` - - This action only is valid if you are the buyer. The `invoice` - field needs to be present in the body and the value must be a - valid LN invoice as cleartext PGP message signed with the robot key. Make sure to perform this action only when - both the bonds are locked. i.e The status of your order is - at least `6` (Waiting for trade collateral and buyer invoice) - - `update_address` - - This action is only valid if you are the buyer. This action is - used to set an on-chain payout address if you wish to have your - payout be received on-chain. Only valid if there is an address in the body as - cleartext PGP message signed with the robot key. This enables on-chain swap for the - order, so even if you earlier had submitted a LN invoice, it - will be ignored. You get to choose the `mining_fee_rate` as - well. Mining fee rate is specified in sats/vbyte. - - `cancel` - - This action is used to cancel an existing order. You cannot cancel an order if it's in one of the following states: - - `1` - Cancelled - - `5` - Expired - - `11` - In dispute - - `12` - Collaboratively cancelled - - `13` - Sending satoshis to buyer - - `14` - Successful trade - - `15` - Failed lightning network routing - - `17` - Maker lost dispute - - `18` - Taker lost dispute - - Note that there are penalties involved for cancelling a order - mid-trade so use this action carefully: - - - As a maker if you cancel an order after you have locked your - maker bond, you are returned your bond. This may change in - the future to prevent DDoSing the LN node and you won't be - returned the maker bond. - - As a taker there is a time penalty involved if you `take` an - order and cancel it without locking the taker bond. - - For both taker or maker, if you cancel the order when both - have locked their bonds (status = `6` or `7`), you loose your - bond and a percent of it goes as "rewards" to your - counterparty and some of it the platform keeps. This is to - discourage wasting time and DDoSing the platform. - - For both taker or maker, if you cancel the order when the - escrow is locked (status = `8` or `9`), you trigger a - collaborative cancel request. This sets - `(m|t)aker_asked_cancel` field to `true` depending on whether - you are the maker or the taker respectively, so that your - counterparty is informed that you asked for a cancel. - - For both taker or maker, and your counterparty asked for a - cancel (i.e `(m|t)aker_asked_cancel` is true), and you cancel - as well, a collaborative cancel takes place which returns - both the bonds and escrow to the respective parties. Note - that in the future there will be a cost for even - collaborativelly cancelling orders for both parties. - - `confirm` - - This is a **crucial** action. This confirms the sending and - receiving of fiat depending on whether you are a buyer or - seller. There is not much RoboSats can do to actually confirm - and verify the fiat payment channel. It is up to you to make - sure of the correct amount was received before you confirm. - This action is only allowed when status is either `9` (Sending - fiat - In chatroom) or `10` (Fiat sent - In chatroom) - - If you are the buyer, it simply sets `fiat_sent` to `true` - which means that you have sent the fiat using the payment - method selected by the seller and signals the seller that the - fiat payment was done. - - If you are the seller, be very careful and double check - before performing this action. Check that your fiat payment - method was successful in receiving the funds and whether it - was the correct amount. This action settles the escrow and - pays the buyer and sets the the order status to `13` (Sending - satohis to buyer) and eventually to `14` (successful trade). - - `undo_confirm` - - This action will undo the fiat_sent confirmation by the buyer - it is allowed only once the fiat is confirmed as sent and can - enable the collaborative cancellation option if an off-robosats - payment cannot be completed or is blocked. - - `dispute` - - This action is allowed only if status is `9` or `10`. It sets - the order status to `11` (In dispute) and sets `is_disputed` to - `true`. Both the bonds and the escrow are settled (i.e RoboSats - takes custody of the funds). Disputes can take long to resolve, - it might trigger force closure for unresolved HTLCs). Dispute - winner will have to submit a new invoice for value of escrow + - bond. - - `submit_statement` - - This action updates the dispute statement. Allowed only when - status is `11` (In dispute). `statement` must be sent in the - request body and should be a string. 100 chars < length of - `statement` < 5000 chars. You need to describe the reason for - raising a dispute. The `(m|t)aker_statement` field is set - respectively. Only when both parties have submitted their - dispute statement, the order status changes to `16` (Waiting - for dispute resolution) - - `rate_platform` - - Let us know how much you love (or hate 😢) RoboSats. - You can rate the platform from `1-5` using the `rate` field in the request body - - summary: Update order - parameters: - - in: query - name: order_id - schema: - type: integer - required: true - tags: - - order - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateOrder' - examples: - UserNotAuthenticated: - value: - bad_request: Woops! It seems you do not have a robot avatar - summary: User not authenticated - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/UpdateOrder' - multipart/form-data: - schema: - $ref: '#/components/schemas/UpdateOrder' - required: true - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/OrderDetail' - description: '' - '400': - content: - application/json: - schema: - type: object - properties: - bad_request: - type: string - description: Reason for the failure - examples: - UserNotAuthenticated: - value: - bad_request: Woops! It seems you do not have a robot avatar - summary: User not authenticated - description: '' - /api/price/: - get: - operationId: price_list - description: Get the last market price for each currency. Also, returns some - more info about the last trade in each currency. - summary: Get last market prices - tags: - - price - security: - - tokenAuth: [] - - {} - responses: - '200': - content: - application/json: - schema: - type: array - items: - type: object - additionalProperties: - type: object - properties: - price: - type: integer - volume: - type: integer - premium: - type: integer - timestamp: - type: string - format: date-time - examples: - TruncatedExample.RealResponseContainsAllTheCurrencies: - value: - - : - price: 21948.89 - volume: 0.01366812 - premium: 3.5 - timestamp: '2022-09-13T14:32:40.591774Z' - summary: Truncated example. Real response contains all the currencies - description: '' - /api/reward/: - post: - operationId: reward_create - description: Withdraw user reward by submitting an invoice. The invoice must - be send as cleartext PGP message signed with the robot key - summary: Withdraw reward - tags: - - reward - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ClaimReward' - examples: - UserNotAuthenticated: - value: - bad_request: Woops! It seems you do not have a robot avatar - summary: User not authenticated - WhenNoRewardsEarned: - value: - successful_withdrawal: false - bad_invoice: You have not earned rewards - summary: When no rewards earned - BadInvoiceOrInCaseOfPaymentFailure: - value: - successful_withdrawal: false - bad_invoice: Does not look like a valid lightning invoice - summary: Bad invoice or in case of payment failure - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/ClaimReward' - multipart/form-data: - schema: - $ref: '#/components/schemas/ClaimReward' - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - type: object - properties: - successful_withdrawal: - type: boolean - default: true - description: '' - '400': - content: - application/json: - schema: - oneOf: - - type: object - properties: - successful_withdrawal: - type: boolean - default: false - bad_invoice: - type: string - description: More context for the reason of the failure - - type: object - properties: - successful_withdrawal: - type: boolean - default: false - bad_request: - type: string - description: More context for the reason of the failure - examples: - UserNotAuthenticated: - value: - bad_request: Woops! It seems you do not have a robot avatar - summary: User not authenticated - WhenNoRewardsEarned: - value: - successful_withdrawal: false - bad_invoice: You have not earned rewards - summary: When no rewards earned - BadInvoiceOrInCaseOfPaymentFailure: - value: - successful_withdrawal: false - bad_invoice: Does not look like a valid lightning invoice - summary: Bad invoice or in case of payment failure - description: '' - /api/robot/: - get: - operationId: robot_retrieve - description: |2+ - - Get robot info 🤖 - - An authenticated request (has the token's sha256 hash encoded as base 91 in the Authorization header) will be - returned the information about the state of a robot. - - Make sure you generate your token using cryptographically secure methods. [Here's]() the function the Javascript - client uses to generate the tokens. Since the server only receives the hash of the - token, it is responsibility of the client to create a strong token. Check - [here](https://github.com/RoboSats/robosats/blob/main/frontend/src/utils/token.js) - to see how the Javascript client creates a random strong token and how it validates entropy is optimal for tokens - created by the user at will. - - `public_key` - PGP key associated with the user (Armored ASCII format) - `encrypted_private_key` - Private PGP key. This is only stored on the backend for later fetching by - the frontend and the key can't really be used by the server since it's protected by the token - that only the client knows. Will be made an optional parameter in a future release. - On the Javascript client, It's passphrase is set to be the secret token generated. - - A gpg key can be created by: - - ```shell - gpg --full-gen-key - ``` - - it's public key can be exported in ascii armored format with: - - ```shell - gpg --export --armor - ``` - - and it's private key can be exported in ascii armored format with: - - ```shell - gpg --export-secret-keys --armor - ``` - - summary: Get robot info - tags: - - robot - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - type: object - properties: - encrypted_private_key: - type: string - description: Armored ASCII PGP private key block - nickname: - type: string - description: Username generated (Robot name) - public_key: - type: string - description: Armored ASCII PGP public key block - wants_stealth: - type: boolean - default: false - description: Whether the user prefers stealth invoices - found: - type: boolean - description: Robot had been created in the past. Only if the robot - was created +5 mins ago. - tg_enabled: - type: boolean - description: The robot has telegram notifications enabled - tg_token: - type: string - description: Token to enable telegram with /start - tg_bot_name: - type: string - description: Name of the coordinator's telegram bot - active_order_id: - type: integer - description: Active order id if present - last_order_id: - type: integer - description: Last order id if present - earned_rewards: - type: integer - description: Satoshis available to be claimed - last_login: - type: string - format: date-time - nullable: true - description: Last time the coordinator saw this robot - examples: - SuccessfullyRetrievedRobot: - value: - nickname: SatoshiNakamoto21 - public_key: |- - -----BEGIN PGP PUBLIC KEY BLOCK----- - - ...... - ...... - encrypted_private_key: |- - -----BEGIN PGP PRIVATE KEY BLOCK----- - - ...... - ...... - wants_stealth: true - summary: Successfully retrieved robot - description: '' - /api/stealth/: - post: - operationId: stealth_create - description: Update stealth invoice option for the user - summary: Update stealth option - tags: - - stealth - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Stealth' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/Stealth' - multipart/form-data: - schema: - $ref: '#/components/schemas/Stealth' - required: true - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Stealth' - description: '' - '400': - content: - application/json: - schema: - type: object - properties: - bad_request: - type: string - description: Reason for the failure - description: '' - /api/ticks/: - get: - operationId: ticks_list - description: |- - Get all market ticks. Returns a list of all the market ticks since inception. - CEX price is also recorded for useful insight on the historical premium of Non-KYC BTC. Price is set when taker bond is locked. - summary: Get market ticks - parameters: - - in: query - name: end - schema: - type: string - description: End date formatted as DD-MM-YYYY - - in: query - name: start - schema: - type: string - description: Start date formatted as DD-MM-YYYY - tags: - - ticks - security: - - tokenAuth: [] - - {} - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Tick' - description: '' -components: - schemas: - ActionEnum: - enum: - - pause - - take - - update_invoice - - update_address - - submit_statement - - dispute - - cancel - - confirm - - undo_confirm - - rate_platform - type: string - description: |- - * `pause` - pause - * `take` - take - * `update_invoice` - update_invoice - * `update_address` - update_address - * `submit_statement` - submit_statement - * `dispute` - dispute - * `cancel` - cancel - * `confirm` - confirm - * `undo_confirm` - undo_confirm - * `rate_platform` - rate_platform - BlankEnum: - enum: - - '' - ClaimReward: - type: object - properties: - invoice: - type: string - nullable: true - description: A valid LN invoice with the reward amount to withdraw - maxLength: 2000 - CurrencyEnum: - enum: - - 1 - - 2 - - 3 - - 4 - - 5 - - 6 - - 7 - - 8 - - 9 - - 10 - - 11 - - 12 - - 13 - - 14 - - 15 - - 16 - - 17 - - 18 - - 19 - - 20 - - 21 - - 22 - - 23 - - 24 - - 25 - - 26 - - 27 - - 28 - - 29 - - 30 - - 31 - - 32 - - 33 - - 34 - - 35 - - 36 - - 37 - - 38 - - 39 - - 40 - - 41 - - 42 - - 43 - - 44 - - 45 - - 46 - - 47 - - 48 - - 49 - - 50 - - 51 - - 52 - - 53 - - 54 - - 55 - - 56 - - 57 - - 58 - - 59 - - 60 - - 61 - - 62 - - 63 - - 64 - - 65 - - 66 - - 67 - - 68 - - 69 - - 70 - - 71 - - 72 - - 73 - - 74 - - 75 - - 300 - - 1000 - type: integer - description: |- - * `1` - USD - * `2` - EUR - * `3` - JPY - * `4` - GBP - * `5` - AUD - * `6` - CAD - * `7` - CHF - * `8` - CNY - * `9` - HKD - * `10` - NZD - * `11` - SEK - * `12` - KRW - * `13` - SGD - * `14` - NOK - * `15` - MXN - * `16` - BYN - * `17` - RUB - * `18` - ZAR - * `19` - TRY - * `20` - BRL - * `21` - CLP - * `22` - CZK - * `23` - DKK - * `24` - HRK - * `25` - HUF - * `26` - INR - * `27` - ISK - * `28` - PLN - * `29` - RON - * `30` - ARS - * `31` - VES - * `32` - COP - * `33` - PEN - * `34` - UYU - * `35` - PYG - * `36` - BOB - * `37` - IDR - * `38` - ANG - * `39` - CRC - * `40` - CUP - * `41` - DOP - * `42` - GHS - * `43` - GTQ - * `44` - ILS - * `45` - JMD - * `46` - KES - * `47` - KZT - * `48` - MYR - * `49` - NAD - * `50` - NGN - * `51` - AZN - * `52` - PAB - * `53` - PHP - * `54` - PKR - * `55` - QAR - * `56` - SAR - * `57` - THB - * `58` - TTD - * `59` - VND - * `60` - XOF - * `61` - TWD - * `62` - TZS - * `63` - XAF - * `64` - UAH - * `65` - EGP - * `66` - LKR - * `67` - MAD - * `68` - AED - * `69` - TND - * `70` - ETB - * `71` - GEL - * `72` - UGX - * `73` - RSD - * `74` - IRT - * `75` - BDT - * `300` - XAU - * `1000` - BTC - ExpiryReasonEnum: - enum: - - 0 - - 1 - - 2 - - 3 - - 4 - type: integer - description: |- - * `0` - Expired not taken - * `1` - Maker bond not locked - * `2` - Escrow not locked - * `3` - Invoice not submitted - * `4` - Neither escrow locked or invoice submitted - Info: - type: object - properties: - num_public_buy_orders: - type: integer - num_public_sell_orders: - type: integer - book_liquidity: - type: integer - description: Total amount of BTC in the order book - active_robots_today: - type: integer - last_day_nonkyc_btc_premium: - type: number - format: double - description: Average premium (weighted by volume) of the orders in the last - 24h - last_day_volume: - type: number - format: double - description: Total volume in BTC in the last 24h - lifetime_volume: - type: number - format: double - description: Total volume in BTC since exchange's inception - lnd_version: - type: string - cln_version: - type: string - robosats_running_commit_hash: - type: string - alternative_site: - type: string - alternative_name: - type: string - node_alias: - type: string - node_id: - type: string - network: - type: string - maker_fee: - type: number - format: double - description: Exchange's set maker fee - taker_fee: - type: number - format: double - description: 'Exchange''s set taker fee ' - bond_size: - type: number - format: double - description: Default bond size (percent) - current_swap_fee_rate: - type: number - format: double - description: Swap fees to perform on-chain transaction (percent) - version: - $ref: '#/components/schemas/Version' - notice_severity: - $ref: '#/components/schemas/NoticeSeverityEnum' - notice_message: - type: string - required: - - active_robots_today - - alternative_name - - alternative_site - - bond_size - - book_liquidity - - cln_version - - current_swap_fee_rate - - last_day_nonkyc_btc_premium - - last_day_volume - - lifetime_volume - - lnd_version - - maker_fee - - network - - node_alias - - node_id - - notice_message - - notice_severity - - num_public_buy_orders - - num_public_sell_orders - - robosats_running_commit_hash - - taker_fee - - version - ListOrder: - type: object - properties: - id: - type: integer - readOnly: true - status: - allOf: - - $ref: '#/components/schemas/StatusEnum' - minimum: 0 - maximum: 32767 - created_at: - type: string - format: date-time - expires_at: - type: string - format: date-time - type: - allOf: - - $ref: '#/components/schemas/TypeEnum' - minimum: 0 - maximum: 32767 - currency: - type: integer - nullable: true - amount: - type: string - format: decimal - pattern: ^-?\d{0,10}(?:\.\d{0,8})?$ - nullable: true - has_range: - type: boolean - min_amount: - type: string - format: decimal - pattern: ^-?\d{0,10}(?:\.\d{0,8})?$ - nullable: true - max_amount: - type: string - format: decimal - pattern: ^-?\d{0,10}(?:\.\d{0,8})?$ - nullable: true - payment_method: - type: string - maxLength: 70 - is_explicit: - type: boolean - premium: - type: string - format: decimal - pattern: ^-?\d{0,3}(?:\.\d{0,2})?$ - nullable: true - satoshis: - type: integer - maximum: 5000000 - minimum: 20000 - nullable: true - maker: - type: integer - nullable: true - taker: - type: integer - nullable: true - escrow_duration: - type: integer - maximum: 28800 - minimum: 1800 - bond_size: - type: string - format: decimal - pattern: ^-?\d{0,2}(?:\.\d{0,2})?$ - latitude: - type: string - format: decimal - pattern: ^-?\d{0,2}(?:\.\d{0,6})?$ - nullable: true - longitude: - type: string - format: decimal - pattern: ^-?\d{0,3}(?:\.\d{0,6})?$ - nullable: true - required: - - expires_at - - id - - type - MakeOrder: - type: object - properties: - type: - allOf: - - $ref: '#/components/schemas/TypeEnum' - minimum: 0 - maximum: 32767 - currency: - type: integer - description: Currency id. See [here](https://github.com/RoboSats/robosats/blob/main/frontend/static/assets/currencies.json) - for a list of all IDs - amount: - type: string - format: decimal - pattern: ^-?\d{0,10}(?:\.\d{0,8})?$ - nullable: true - has_range: - type: boolean - default: false - description: |- - Whether the order specifies a range of amount or a fixed amount. - - If `true`, then `min_amount` and `max_amount` fields are **required**. - - If `false` then `amount` is **required** - min_amount: - type: string - format: decimal - pattern: ^-?\d{0,10}(?:\.\d{0,8})?$ - nullable: true - max_amount: - type: string - format: decimal - pattern: ^-?\d{0,10}(?:\.\d{0,8})?$ - nullable: true - payment_method: - type: string - default: not specified - description: Can be any string. The UI recognizes [these payment methods](https://github.com/RoboSats/robosats/blob/main/frontend/src/components/payment-methods/Methods.js) - and displays them with a logo. - maxLength: 70 - is_explicit: - type: boolean - default: false - description: Whether the order is explicitly priced or not. If set to `true` - then `satoshis` need to be specified - premium: - type: string - format: decimal - pattern: ^-?\d{0,3}(?:\.\d{0,2})?$ - nullable: true - satoshis: - type: integer - maximum: 5000000 - minimum: 20000 - nullable: true - public_duration: - type: integer - maximum: 86400 - minimum: 597.6 - escrow_duration: - type: integer - maximum: 28800 - minimum: 1800 - bond_size: - type: string - format: decimal - pattern: ^-?\d{0,2}(?:\.\d{0,2})?$ - latitude: - type: string - format: decimal - pattern: ^-?\d{0,2}(?:\.\d{0,6})?$ - nullable: true - longitude: - type: string - format: decimal - pattern: ^-?\d{0,3}(?:\.\d{0,6})?$ - nullable: true - required: - - currency - - type - Nested: - type: object - properties: - id: - type: integer - readOnly: true - currency: - allOf: - - $ref: '#/components/schemas/CurrencyEnum' - minimum: 0 - maximum: 32767 - exchange_rate: - type: string - format: decimal - pattern: ^-?\d{0,14}(?:\.\d{0,4})?$ - nullable: true - timestamp: - type: string - format: date-time - required: - - currency - - id - NoticeSeverityEnum: - enum: - - none - - warning - - success - - error - - info - type: string - description: |- - * `none` - none - * `warning` - warning - * `success` - success - * `error` - error - * `info` - info - NullEnum: - enum: - - null - OrderDetail: - type: object - properties: - id: - type: integer - readOnly: true - status: - allOf: - - $ref: '#/components/schemas/StatusEnum' - minimum: 0 - maximum: 32767 - created_at: - type: string - format: date-time - expires_at: - type: string - format: date-time - type: - allOf: - - $ref: '#/components/schemas/TypeEnum' - minimum: 0 - maximum: 32767 - currency: - type: integer - nullable: true - amount: - type: string - format: decimal - pattern: ^-?\d{0,10}(?:\.\d{0,8})?$ - nullable: true - has_range: - type: boolean - min_amount: - type: string - format: decimal - pattern: ^-?\d{0,10}(?:\.\d{0,8})?$ - nullable: true - max_amount: - type: string - format: decimal - pattern: ^-?\d{0,10}(?:\.\d{0,8})?$ - nullable: true - payment_method: - type: string - maxLength: 70 - is_explicit: - type: boolean - premium: - type: string - description: Premium over the CEX price set by the maker - premium_now: - type: number - format: double - description: Premium over the CEX price at the current time - satoshis: - type: integer - maximum: 5000000 - minimum: 20000 - nullable: true - satoshis_now: - type: integer - description: Maximum size of the order right now in Satoshis - maker: - type: integer - nullable: true - taker: - type: integer - nullable: true - escrow_duration: - type: integer - maximum: 28800 - minimum: 1800 - total_secs_exp: - type: integer - description: Duration of time (in seconds) to expire, according to the current - status of order.This is duration of time after `created_at` (in seconds) - that the order will automatically expire.This value changes according - to which stage the order is in - penalty: - type: string - format: date-time - description: Time when the user penalty will expire. Penalty applies when - you create orders repeatedly without commiting a bond - is_maker: - type: boolean - description: Whether you are the maker or not - is_taker: - type: boolean - description: Whether you are the taker or not - is_participant: - type: boolean - description: True if you are either a taker or maker, False otherwise - maker_status: - type: string - description: |- - Status of the maker: - - **'Active'** (seen within last 2 min) - - **'Seen Recently'** (seen within last 10 min) - - **'Inactive'** (seen more than 10 min ago) - - Note: When you make a request to this route, your own status get's updated and can be seen by your counterparty - taker_status: - type: string - description: |- - Status of the maker: - - **'Active'** (seen within last 2 min) - - **'Seen Recently'** (seen within last 10 min) - - **'Inactive'** (seen more than 10 min ago) - - Note: When you make a request to this route, your own status get's updated and can be seen by your counterparty - price_now: - type: number - format: double - description: Price of the order in the order's currency at the time of request - (upto 5 significant digits) - premium_percentile: - type: number - format: double - description: (Only if `is_maker`) Premium percentile of your order compared - to other public orders in the same currency currently in the order book - num_similar_orders: - type: integer - description: (Only if `is_maker`) The number of public orders of the same - currency currently in the order book - tg_enabled: - type: boolean - description: (Only if `is_maker`) Whether Telegram notification is enabled - or not - tg_token: - type: string - description: (Only if `is_maker`) Your telegram bot token required to enable - notifications. - tg_bot_name: - type: string - description: (Only if `is_maker`) The Telegram username of the bot - is_buyer: - type: boolean - description: Whether you are a buyer of sats (you will be receiving sats) - is_seller: - type: boolean - description: Whether you are a seller of sats or not (you will be sending - sats) - maker_nick: - type: string - description: Nickname (Robot name) of the maker - taker_nick: - type: string - description: Nickname (Robot name) of the taker - status_message: - type: string - description: The current status of the order corresponding to the `status` - is_fiat_sent: - type: boolean - description: Whether or not the fiat amount is sent by the buyer - is_disputed: - type: boolean - description: Whether or not the counterparty raised a dispute - ur_nick: - type: string - description: Your Nick - maker_locked: - type: boolean - description: True if maker bond is locked, False otherwise - taker_locked: - type: boolean - description: True if taker bond is locked, False otherwise - escrow_locked: - type: boolean - description: True if escrow is locked, False otherwise. Escrow is the sats - to be sold, held by Robosats until the trade is finised. - trade_satoshis: - type: integer - description: 'Seller sees the amount of sats they need to send. Buyer sees - the amount of sats they will receive ' - bond_invoice: - type: string - description: When `status` = `0`, `3`. Bond invoice to be paid - bond_satoshis: - type: integer - description: The bond amount in satoshis - escrow_invoice: - type: string - description: For the seller, the escrow invoice to be held by RoboSats - escrow_satoshis: - type: integer - description: The escrow amount in satoshis - invoice_amount: - type: integer - description: The amount in sats the buyer needs to submit an invoice of - to receive the trade amount - swap_allowed: - type: boolean - description: Whether on-chain swap is allowed - swap_failure_reason: - type: string - description: Reason for why on-chain swap is not available - suggested_mining_fee_rate: - type: integer - description: fee in sats/vbyte for the on-chain swap - swap_fee_rate: - type: number - format: double - description: in percentage, the swap fee rate the platform charges - pending_cancel: - type: boolean - description: Your counterparty requested for a collaborative cancel when - `status` is either `8`, `9` or `10` - asked_for_cancel: - type: boolean - description: You requested for a collaborative cancel `status` is either - `8`, `9` or `10` - statement_submitted: - type: boolean - description: True if you have submitted a statement. Available when `status` - is `11` - retries: - type: integer - description: Number of times ln node has tried to make the payment to you - (only if you are the buyer) - next_retry_time: - type: string - format: date-time - description: The next time payment will be retried. Payment is retried every - 1 sec - failure_reason: - type: string - description: The reason the payout failed - invoice_expired: - type: boolean - description: True if the payout invoice expired. `invoice_amount` will be - re-set and sent which means the user has to submit a new invoice to be - payed - public_duration: - type: integer - maximum: 86400 - minimum: 597.6 - bond_size: - type: string - format: decimal - pattern: ^-?\d{0,2}(?:\.\d{0,2})?$ - trade_fee_percent: - type: integer - description: The fee for the trade (fees differ for maker and taker) - bond_size_sats: - type: integer - description: The size of the bond in sats - bond_size_percent: - type: integer - description: same as `bond_size` - maker_summary: - $ref: '#/components/schemas/Summary' - taker_summary: - $ref: '#/components/schemas/Summary' - platform_summary: - $ref: '#/components/schemas/PlatformSummary' - expiry_reason: - nullable: true - minimum: 0 - maximum: 32767 - oneOf: - - $ref: '#/components/schemas/ExpiryReasonEnum' - - $ref: '#/components/schemas/NullEnum' - expiry_message: - type: string - description: The reason the order expired (message associated with the `expiry_reason`) - num_satoshis: - type: integer - description: only if status = `14` (Successful Trade) and is_buyer = `true` - sent_satoshis: - type: integer - description: only if status = `14` (Successful Trade) and is_buyer = `true` - txid: - type: string - description: Transaction id of the on-chain swap payout. Only if status - = `14` (Successful Trade) and is_buyer = `true` - network: - type: string - description: The network eg. 'testnet', 'mainnet'. Only if status = `14` - (Successful Trade) and is_buyer = `true` - latitude: - type: number - format: double - description: Latitude of the order for F2F payments - longitude: - type: number - format: double - description: Longitude of the order for F2F payments - required: - - expires_at - - id - - type - OrderPublic: - type: object - properties: - id: - type: integer - readOnly: true - created_at: - type: string - format: date-time - expires_at: - type: string - format: date-time - type: - allOf: - - $ref: '#/components/schemas/TypeEnum' - minimum: 0 - maximum: 32767 - currency: - type: integer - nullable: true - amount: - type: string - format: decimal - pattern: ^-?\d{0,10}(?:\.\d{0,8})?$ - nullable: true - has_range: - type: boolean - min_amount: - type: string - format: decimal - pattern: ^-?\d{0,10}(?:\.\d{0,8})?$ - nullable: true - max_amount: - type: string - format: decimal - pattern: ^-?\d{0,10}(?:\.\d{0,8})?$ - nullable: true - payment_method: - type: string - maxLength: 70 - is_explicit: - type: boolean - premium: - type: string - format: decimal - pattern: ^-?\d{0,3}(?:\.\d{0,2})?$ - nullable: true - satoshis: - type: integer - maximum: 5000000 - minimum: 20000 - nullable: true - maker: - type: integer - nullable: true - maker_nick: - type: string - maker_status: - type: string - description: Status of the nick - "Active", "Seen Recently" or "Inactive" - price: - type: number - format: double - description: Price in order's fiat currency - escrow_duration: - type: integer - maximum: 28800 - minimum: 1800 - satoshis_now: - type: integer - description: The amount of sats to be traded at the present moment (not - including the fees) - bond_size: - type: string - format: decimal - pattern: ^-?\d{0,2}(?:\.\d{0,2})?$ - latitude: - type: string - format: decimal - pattern: ^-?\d{0,2}(?:\.\d{0,6})?$ - nullable: true - longitude: - type: string - format: decimal - pattern: ^-?\d{0,3}(?:\.\d{0,6})?$ - nullable: true - required: - - expires_at - - id - - type - PlatformSummary: - type: object - properties: - contract_timestamp: - type: string - format: date-time - description: Timestamp of when the contract was finalized (price and sats - fixed) - contract_total_time: - type: number - format: double - description: The time taken for the contract to complete (from taker taking - the order to completion of order) in seconds - routing_fee_sats: - type: integer - description: Sats payed by the exchange for routing fees. Mining fee in - case of on-chain swap payout - trade_revenue_sats: - type: integer - description: The sats the exchange earned from the trade - PostMessage: - type: object - properties: - PGP_message: - type: string - nullable: true - maxLength: 5000 - order_id: - type: integer - minimum: 0 - description: Order ID of chatroom - offset: - type: integer - minimum: 0 - nullable: true - description: Offset for message index to get as response - required: - - order_id - RatingEnum: - enum: - - '1' - - '2' - - '3' - - '4' - - '5' - type: string - description: |- - * `1` - 1 - * `2` - 2 - * `3` - 3 - * `4` - 4 - * `5` - 5 - StatusEnum: - enum: - - 0 - - 1 - - 2 - - 3 - - 4 - - 5 - - 6 - - 7 - - 8 - - 9 - - 10 - - 11 - - 12 - - 13 - - 14 - - 15 - - 16 - - 17 - - 18 - type: integer - description: |- - * `0` - Waiting for maker bond - * `1` - Public - * `2` - Paused - * `3` - Waiting for taker bond - * `4` - Cancelled - * `5` - Expired - * `6` - Waiting for trade collateral and buyer invoice - * `7` - Waiting only for seller trade collateral - * `8` - Waiting only for buyer invoice - * `9` - Sending fiat - In chatroom - * `10` - Fiat sent - In chatroom - * `11` - In dispute - * `12` - Collaboratively cancelled - * `13` - Sending satoshis to buyer - * `14` - Sucessful trade - * `15` - Failed lightning network routing - * `16` - Wait for dispute resolution - * `17` - Maker lost dispute - * `18` - Taker lost dispute - Stealth: - type: object - properties: - wantsStealth: - type: boolean - required: - - wantsStealth - Summary: - type: object - properties: - sent_fiat: - type: integer - description: same as `amount` (only for buyer) - received_sats: - type: integer - description: same as `trade_satoshis` (only for buyer) - is_swap: - type: boolean - description: True if the payout was on-chain (only for buyer) - received_onchain_sats: - type: integer - description: The on-chain sats received (only for buyer and if `is_swap` - is `true`) - mining_fee_sats: - type: integer - description: Mining fees paid in satoshis (only for buyer and if `is_swap` - is `true`) - swap_fee_sats: - type: integer - description: Exchange swap fee in sats (i.e excluding miner fees) (only - for buyer and if `is_swap` is `true`) - swap_fee_percent: - type: number - format: double - description: same as `swap_fee_rate` (only for buyer and if `is_swap` is - `true` - sent_sats: - type: integer - description: The total sats you sent (only for seller) - received_fiat: - type: integer - description: same as `amount` (only for seller) - trade_fee_sats: - type: integer - description: Exchange fees in sats (Does not include swap fee and miner - fee) - Tick: - type: object - properties: - timestamp: - type: string - format: date-time - currency: - allOf: - - $ref: '#/components/schemas/Nested' - readOnly: true - volume: - type: string - format: decimal - nullable: true - price: - type: string - format: decimal - pattern: ^-?\d{0,14}(?:\.\d{0,2})?$ - nullable: true - premium: - type: string - format: decimal - pattern: ^-?\d{0,3}(?:\.\d{0,2})?$ - nullable: true - fee: - type: string - format: decimal - required: - - currency - TypeEnum: - enum: - - 0 - - 1 - type: integer - description: |- - * `0` - BUY - * `1` - SELL - UpdateOrder: - type: object - properties: - invoice: - type: string - nullable: true - description: |+ - Invoice used for payouts. Must be PGP signed with the robot's public key. The expected Armored PGP header is -----BEGIN PGP SIGNED MESSAGE----- - Hash: SHA512 - - maxLength: 15000 - routing_budget_ppm: - type: integer - maximum: 100001 - minimum: 0 - nullable: true - default: 0 - description: Max budget to allocate for routing in PPM - address: - type: string - nullable: true - description: |+ - Onchain address used for payouts. Must be PGP signed with the robot's public key. The expected Armored PGP header is -----BEGIN PGP SIGNED MESSAGE----- - Hash: SHA512 - - maxLength: 15000 - statement: - type: string - nullable: true - maxLength: 500000 - action: - $ref: '#/components/schemas/ActionEnum' - rating: - nullable: true - oneOf: - - $ref: '#/components/schemas/RatingEnum' - - $ref: '#/components/schemas/BlankEnum' - - $ref: '#/components/schemas/NullEnum' - amount: - type: string - format: decimal - pattern: ^-?\d{0,10}(?:\.\d{0,8})?$ - nullable: true - mining_fee_rate: - type: string - format: decimal - pattern: ^-?\d{0,3}(?:\.\d{0,3})?$ - nullable: true - required: - - action - Version: - type: object - properties: - major: - type: integer - minor: - type: integer - patch: - type: integer - required: - - major - - minor - - patch - securitySchemes: - tokenAuth: - type: apiKey - in: header - name: Authorization - description: Token-based authentication with required prefix "Token" From 27c07e970d57546ad6f24a89b079e91974011432 Mon Sep 17 00:00:00 2001 From: Reckless_Satoshi Date: Sun, 16 Jun 2024 21:54:28 +0100 Subject: [PATCH 3/8] feat: add tests readme --- tests/README.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 tests/README.md diff --git a/tests/README.md b/tests/README.md new file mode 100644 index 00000000..35ecf8b3 --- /dev/null +++ b/tests/README.md @@ -0,0 +1,7 @@ +# Run e2e tests + +``` +docker compose -f docker-tests.yml --env-file tests/compose.env up -d +docker exec coordinator coverage run manage.py test +docker exec coordinator coverage report +``` \ No newline at end of file From f2f65b2ffe9c8563838ebf8ae6281f414505e4dc Mon Sep 17 00:00:00 2001 From: KoalaSat Date: Sun, 16 Jun 2024 21:14:13 +0000 Subject: [PATCH 4/8] feat: add coordinator alias to order summary (#1331) --- frontend/src/components/TradeBox/Prompts/Successful.tsx | 1 + frontend/src/components/TradeBox/TradeSummary.tsx | 3 +++ frontend/static/locales/ca.json | 2 +- frontend/static/locales/cs.json | 2 +- frontend/static/locales/de.json | 2 +- frontend/static/locales/en.json | 2 +- frontend/static/locales/es.json | 2 +- frontend/static/locales/eu.json | 2 +- frontend/static/locales/fr.json | 2 +- frontend/static/locales/it.json | 2 +- frontend/static/locales/ja.json | 2 +- frontend/static/locales/pl.json | 2 +- frontend/static/locales/pt.json | 2 +- frontend/static/locales/ru.json | 2 +- frontend/static/locales/sv.json | 2 +- frontend/static/locales/sw.json | 2 +- frontend/static/locales/th.json | 2 +- frontend/static/locales/zh-SI.json | 2 +- frontend/static/locales/zh-TR.json | 2 +- 19 files changed, 21 insertions(+), 17 deletions(-) diff --git a/frontend/src/components/TradeBox/Prompts/Successful.tsx b/frontend/src/components/TradeBox/Prompts/Successful.tsx index f0fd3be3..5175e878 100644 --- a/frontend/src/components/TradeBox/Prompts/Successful.tsx +++ b/frontend/src/components/TradeBox/Prompts/Successful.tsx @@ -222,6 +222,7 @@ export const SuccessfulPrompt = ({ takerSummary={order.taker_summary} platformSummary={order.platform_summary} orderId={order.id} + coordinatorLongAlias={federation.getCoordinator(order.shortAlias)?.longAlias} /> ) : ( diff --git a/frontend/src/components/TradeBox/TradeSummary.tsx b/frontend/src/components/TradeBox/TradeSummary.tsx index cef4875e..2c691cce 100644 --- a/frontend/src/components/TradeBox/TradeSummary.tsx +++ b/frontend/src/components/TradeBox/TradeSummary.tsx @@ -43,6 +43,7 @@ interface Props { makerHashId: string; takerHashId: string; currencyCode: string; + coordinatorLongAlias: string; makerSummary: TradeRobotSummary; takerSummary: TradeRobotSummary; platformSummary: TradeCoordinatorSummary; @@ -54,6 +55,7 @@ const TradeSummary = ({ makerHashId, takerHashId, currencyCode, + coordinatorLongAlias, makerSummary, takerSummary, platformSummary, @@ -72,6 +74,7 @@ const TradeSummary = ({ const onClickExport = function (): void { const summary = { + coordinator: coordinatorLongAlias, order_id: orderId, currency: currencyCode, maker: makerSummary, diff --git a/frontend/static/locales/ca.json b/frontend/static/locales/ca.json index 321f2a1d..bfbf6f8b 100644 --- a/frontend/static/locales/ca.json +++ b/frontend/static/locales/ca.json @@ -464,8 +464,8 @@ "The order has expired": "L'ordre ha expirat", "The pinned location is approximate. The exact location for the meeting place must be exchanged in the encrypted chat.": "The pinned location is approximate. The exact location for the meeting place must be exchanged in the encrypted chat.", "You cannot take an order yet! Wait {{timeMin}}m {{timeSec}}s": "Encara no pots prendre cap ordre! Espera {{timeMin}}m {{timeSec}}s", - "You receive {{amount}} Sats (Approx)": "Tu reps via Lightning {{amount}} Sats (Approx)", "You receive via {{method}} {{amount}}": "Reps via {{method}} {{amount}}", + "You receive {{amount}} Sats (Approx)": "Tu reps via Lightning {{amount}} Sats (Approx)", "You send via Lightning {{amount}} Sats (Approx)": "Tu envies via Lightning {{amount}} Sats (Approx)", "You send via {{method}} {{amount}}": "Envies via {{method}} {{amount}}", "{{price}} {{currencyCode}}/BTC - Premium: {{premium}}%": "{{price}} {{currencyCode}}/BTC - Prima: {{premium}}%", diff --git a/frontend/static/locales/cs.json b/frontend/static/locales/cs.json index b9d7daf3..fbe6e0d7 100644 --- a/frontend/static/locales/cs.json +++ b/frontend/static/locales/cs.json @@ -464,8 +464,8 @@ "The order has expired": "Nabídka vypršela", "The pinned location is approximate. The exact location for the meeting place must be exchanged in the encrypted chat.": "The pinned location is approximate. The exact location for the meeting place must be exchanged in the encrypted chat.", "You cannot take an order yet! Wait {{timeMin}}m {{timeSec}}s": "Nabídku nemůžeš zatím příjmout! Počkej {{timeMin}}m {{timeSec}}s", - "You receive {{amount}} Sats (Approx)": "You receive {{amount}} Sats (Approx)", "You receive via {{method}} {{amount}}": "You receive via {{method}} {{amount}}", + "You receive {{amount}} Sats (Approx)": "You receive {{amount}} Sats (Approx)", "You send via Lightning {{amount}} Sats (Approx)": "You send via Lightning {{amount}} Sats (Approx)", "You send via {{method}} {{amount}}": "You send via {{method}} {{amount}}", "{{price}} {{currencyCode}}/BTC - Premium: {{premium}}%": "{{price}} {{currencyCode}}/BTC - Přirážka: {{premium}}%", diff --git a/frontend/static/locales/de.json b/frontend/static/locales/de.json index 6dbb989d..2d49cc15 100644 --- a/frontend/static/locales/de.json +++ b/frontend/static/locales/de.json @@ -464,8 +464,8 @@ "The order has expired": "Die Order ist abgelaufen", "The pinned location is approximate. The exact location for the meeting place must be exchanged in the encrypted chat.": "The pinned location is approximate. The exact location for the meeting place must be exchanged in the encrypted chat.", "You cannot take an order yet! Wait {{timeMin}}m {{timeSec}}s": "Du kannst noch keine Order annehmen! Warte {{timeMin}}m {{timeSec}}s", - "You receive {{amount}} Sats (Approx)": "You receive {{amount}} Sats (Approx)", "You receive via {{method}} {{amount}}": "You receive via {{method}} {{amount}}", + "You receive {{amount}} Sats (Approx)": "You receive {{amount}} Sats (Approx)", "You send via Lightning {{amount}} Sats (Approx)": "You send via Lightning {{amount}} Sats (Approx)", "You send via {{method}} {{amount}}": "You send via {{method}} {{amount}}", "{{price}} {{currencyCode}}/BTC - Premium: {{premium}}%": "{{price}} {{currencyCode}}/BTC - Aufschlag: {{premium}}%", diff --git a/frontend/static/locales/en.json b/frontend/static/locales/en.json index f12a0e12..4ef3952a 100644 --- a/frontend/static/locales/en.json +++ b/frontend/static/locales/en.json @@ -464,8 +464,8 @@ "The order has expired": "The order has expired", "The pinned location is approximate. The exact location for the meeting place must be exchanged in the encrypted chat.": "The pinned location is approximate. The exact location for the meeting place must be exchanged in the encrypted chat.", "You cannot take an order yet! Wait {{timeMin}}m {{timeSec}}s": "You cannot take an order yet! Wait {{timeMin}}m {{timeSec}}s", - "You receive {{amount}} Sats (Approx)": "You receive {{amount}} Sats (Approx)", "You receive via {{method}} {{amount}}": "You receive via {{method}} {{amount}}", + "You receive {{amount}} Sats (Approx)": "You receive {{amount}} Sats (Approx)", "You send via Lightning {{amount}} Sats (Approx)": "You send via Lightning {{amount}} Sats (Approx)", "You send via {{method}} {{amount}}": "You send via {{method}} {{amount}}", "{{price}} {{currencyCode}}/BTC - Premium: {{premium}}%": "{{price}} {{currencyCode}}/BTC - Premium: {{premium}}%", diff --git a/frontend/static/locales/es.json b/frontend/static/locales/es.json index 4eb16f37..ad038432 100644 --- a/frontend/static/locales/es.json +++ b/frontend/static/locales/es.json @@ -464,8 +464,8 @@ "The order has expired": "La orden ha expirado", "The pinned location is approximate. The exact location for the meeting place must be exchanged in the encrypted chat.": "The pinned location is approximate. The exact location for the meeting place must be exchanged in the encrypted chat.", "You cannot take an order yet! Wait {{timeMin}}m {{timeSec}}s": "¡No puedes tomar una orden aún! Espera {{timeMin}}m {{timeSec}}s", - "You receive {{amount}} Sats (Approx)": "You receive {{amount}} Sats (Approx)", "You receive via {{method}} {{amount}}": "You receive via {{method}} {{amount}}", + "You receive {{amount}} Sats (Approx)": "You receive {{amount}} Sats (Approx)", "You send via Lightning {{amount}} Sats (Approx)": "You send via Lightning {{amount}} Sats (Approx)", "You send via {{method}} {{amount}}": "You send via {{method}} {{amount}}", "{{price}} {{currencyCode}}/BTC - Premium: {{premium}}%": "{{price}} {{currencyCode}}/BTC - Prima: {{premium}}%", diff --git a/frontend/static/locales/eu.json b/frontend/static/locales/eu.json index d81870f0..88f7ae8b 100644 --- a/frontend/static/locales/eu.json +++ b/frontend/static/locales/eu.json @@ -464,8 +464,8 @@ "The order has expired": "Eskaera iraungi da", "The pinned location is approximate. The exact location for the meeting place must be exchanged in the encrypted chat.": "The pinned location is approximate. The exact location for the meeting place must be exchanged in the encrypted chat.", "You cannot take an order yet! Wait {{timeMin}}m {{timeSec}}s": "Oraindik ezin duzu eskaerarik hartu! Itxaron{{timeMin}}m {{timeSec}}s", - "You receive {{amount}} Sats (Approx)": "You receive {{amount}} Sats (Approx)", "You receive via {{method}} {{amount}}": "You receive via {{method}} {{amount}}", + "You receive {{amount}} Sats (Approx)": "You receive {{amount}} Sats (Approx)", "You send via Lightning {{amount}} Sats (Approx)": "You send via Lightning {{amount}} Sats (Approx)", "You send via {{method}} {{amount}}": "You send via {{method}} {{amount}}", "{{price}} {{currencyCode}}/BTC - Premium: {{premium}}%": "{{price}} {{currencyCode}}/BTC - Prima: %{{premium}}", diff --git a/frontend/static/locales/fr.json b/frontend/static/locales/fr.json index d85ba7e6..cc764b70 100644 --- a/frontend/static/locales/fr.json +++ b/frontend/static/locales/fr.json @@ -464,8 +464,8 @@ "The order has expired": "L'ordre a expiré", "The pinned location is approximate. The exact location for the meeting place must be exchanged in the encrypted chat.": "The pinned location is approximate. The exact location for the meeting place must be exchanged in the encrypted chat.", "You cannot take an order yet! Wait {{timeMin}}m {{timeSec}}s": "Vous ne pouvez pas encore prendre un ordre! Attendez {{timeMin}}m {{timeSec}}s", - "You receive {{amount}} Sats (Approx)": "Vous recevez via Lightning {{amount}} Sats (environ)", "You receive via {{method}} {{amount}}": "Vous recevez via {{méthode}} {{montant}}", + "You receive {{amount}} Sats (Approx)": "Vous recevez via Lightning {{amount}} Sats (environ)", "You send via Lightning {{amount}} Sats (Approx)": "Vous envoyez via Lightning {{amount}} Sats (environ)", "You send via {{method}} {{amount}}": "Vous envoyez via {{method}} {{amount}}", "{{price}} {{currencyCode}}/BTC - Premium: {{premium}}%": "{{price}} {{currencyCode}}/BTC - Prime: {{premium}}%", diff --git a/frontend/static/locales/it.json b/frontend/static/locales/it.json index 280364a4..cf129bf7 100644 --- a/frontend/static/locales/it.json +++ b/frontend/static/locales/it.json @@ -464,8 +464,8 @@ "The order has expired": "L'ordine è scaduto", "The pinned location is approximate. The exact location for the meeting place must be exchanged in the encrypted chat.": "La posizione appuntata è approssimativa. La posizione esatta del luogo dell'incontro deve essere indicata nella chat crittografata.", "You cannot take an order yet! Wait {{timeMin}}m {{timeSec}}s": "Non puoi ancora accettare un ordine! Aspetta {{timeMin}}m {{timeSec}}s", - "You receive {{amount}} Sats (Approx)": "Ricevi {{amount}} Sats via Lightning (approssimativo)", "You receive via {{method}} {{amount}}": "Ricevi {{amount}} via {{method}}", + "You receive {{amount}} Sats (Approx)": "Ricevi {{amount}} Sats via Lightning (approssimativo)", "You send via Lightning {{amount}} Sats (Approx)": "Invii {{amount}} Sats via Lightning (approssimativo)", "You send via {{method}} {{amount}}": "Invii {{amount}} via {{method}}", "{{price}} {{currencyCode}}/BTC - Premium: {{premium}}%": "{{price}} {{currencyCode}}/BTC - Premio: {{premium}}%", diff --git a/frontend/static/locales/ja.json b/frontend/static/locales/ja.json index 6adb6186..cf80e724 100644 --- a/frontend/static/locales/ja.json +++ b/frontend/static/locales/ja.json @@ -464,8 +464,8 @@ "The order has expired": "注文は期限切れになりました", "The pinned location is approximate. The exact location for the meeting place must be exchanged in the encrypted chat.": "The pinned location is approximate. The exact location for the meeting place must be exchanged in the encrypted chat.", "You cannot take an order yet! Wait {{timeMin}}m {{timeSec}}s": "まだ注文を受け取ることはできません!{{timeMin}}分{{timeSec}}秒待ってください", - "You receive {{amount}} Sats (Approx)": "ライトニングで{{amount}} Sats(約)を受け取ります", "You receive via {{method}} {{amount}}": "{{method}}で{{amount}}を受け取ります", + "You receive {{amount}} Sats (Approx)": "ライトニングで{{amount}} Sats(約)を受け取ります", "You send via Lightning {{amount}} Sats (Approx)": "ライトニングで{{amount}} Sats(約)を送信します", "You send via {{method}} {{amount}}": "{{method}}で{{amount}}を送信します", "{{price}} {{currencyCode}}/BTC - Premium: {{premium}}%": "{{price}} {{currencyCode}}/BTC - プレミアム: {{premium}}%", diff --git a/frontend/static/locales/pl.json b/frontend/static/locales/pl.json index bfa11f3b..ee779ba2 100644 --- a/frontend/static/locales/pl.json +++ b/frontend/static/locales/pl.json @@ -464,8 +464,8 @@ "The order has expired": "Zamówienie wygasło", "The pinned location is approximate. The exact location for the meeting place must be exchanged in the encrypted chat.": "The pinned location is approximate. The exact location for the meeting place must be exchanged in the encrypted chat.", "You cannot take an order yet! Wait {{timeMin}}m {{timeSec}}s": "Nie możesz jeszcze przyjąć zamówienia! Czekać {{timeMin}}m {{timeSec}}s", - "You receive {{amount}} Sats (Approx)": "You receive {{amount}} Sats (Approx)", "You receive via {{method}} {{amount}}": "You receive via {{method}} {{amount}}", + "You receive {{amount}} Sats (Approx)": "You receive {{amount}} Sats (Approx)", "You send via Lightning {{amount}} Sats (Approx)": "You send via Lightning {{amount}} Sats (Approx)", "You send via {{method}} {{amount}}": "You send via {{method}} {{amount}}", "{{price}} {{currencyCode}}/BTC - Premium: {{premium}}%": "{{price}} {{currencyCode}}/BTC - Premia: {{premium}}%", diff --git a/frontend/static/locales/pt.json b/frontend/static/locales/pt.json index ff87325b..1d5c18ec 100644 --- a/frontend/static/locales/pt.json +++ b/frontend/static/locales/pt.json @@ -464,8 +464,8 @@ "The order has expired": "A ordem expirou", "The pinned location is approximate. The exact location for the meeting place must be exchanged in the encrypted chat.": "The pinned location is approximate. The exact location for the meeting place must be exchanged in the encrypted chat.", "You cannot take an order yet! Wait {{timeMin}}m {{timeSec}}s": "Você ainda não pode fazer um pedido! Espere {{timeMin}}m {{timeSec}}s", - "You receive {{amount}} Sats (Approx)": "You receive {{amount}} Sats (Approx)", "You receive via {{method}} {{amount}}": "You receive via {{method}} {{amount}}", + "You receive {{amount}} Sats (Approx)": "You receive {{amount}} Sats (Approx)", "You send via Lightning {{amount}} Sats (Approx)": "You send via Lightning {{amount}} Sats (Approx)", "You send via {{method}} {{amount}}": "You send via {{method}} {{amount}}", "{{price}} {{currencyCode}}/BTC - Premium: {{premium}}%": "{{price}} {{currencyCode}}/BTC - Prêmio: {{premium}}%", diff --git a/frontend/static/locales/ru.json b/frontend/static/locales/ru.json index 148c596b..9e0266e7 100644 --- a/frontend/static/locales/ru.json +++ b/frontend/static/locales/ru.json @@ -464,8 +464,8 @@ "The order has expired": "Срок действия ордера истёк", "The pinned location is approximate. The exact location for the meeting place must be exchanged in the encrypted chat.": "Закрепленное местоположение является приблизительным. Точное местоположение места встречи необходимо сообщить в зашифрованном чате.", "You cannot take an order yet! Wait {{timeMin}}m {{timeSec}}s": "Вы ещё не можете взять ордер! Подождите {{timeMin}}м {{timeSec}}с", - "You receive {{amount}} Sats (Approx)": "Вы получаете через Lightning {{amount}} Сатоши (приблизительно)", "You receive via {{method}} {{amount}}": "Вы получаете через {{method}} {{amount}}", + "You receive {{amount}} Sats (Approx)": "Вы получаете через Lightning {{amount}} Сатоши (приблизительно)", "You send via Lightning {{amount}} Sats (Approx)": "Вы отправляете через Lightning {{amount}} Сатоши (приблизительно)", "You send via {{method}} {{amount}}": "Вы отправляете через {{method}} {{amount}}", "{{price}} {{currencyCode}}/BTC - Premium: {{premium}}%": "{{price}} {{currencyCode}}/BTC - Наценка: {{premium}}%", diff --git a/frontend/static/locales/sv.json b/frontend/static/locales/sv.json index b270a58a..28143f9d 100644 --- a/frontend/static/locales/sv.json +++ b/frontend/static/locales/sv.json @@ -464,8 +464,8 @@ "The order has expired": "Ordern har förfallit", "The pinned location is approximate. The exact location for the meeting place must be exchanged in the encrypted chat.": "The pinned location is approximate. The exact location for the meeting place must be exchanged in the encrypted chat.", "You cannot take an order yet! Wait {{timeMin}}m {{timeSec}}s": "Du kan inte ta en order ännu! Vänta {{timeMin}}m {{timeSec}}s", - "You receive {{amount}} Sats (Approx)": "You receive {{amount}} Sats (Approx)", "You receive via {{method}} {{amount}}": "You receive via {{method}} {{amount}}", + "You receive {{amount}} Sats (Approx)": "You receive {{amount}} Sats (Approx)", "You send via Lightning {{amount}} Sats (Approx)": "You send via Lightning {{amount}} Sats (Approx)", "You send via {{method}} {{amount}}": "You send via {{method}} {{amount}}", "{{price}} {{currencyCode}}/BTC - Premium: {{premium}}%": "{{price}} {{currencyCode}}/BTC - Premium: {{premium}}%", diff --git a/frontend/static/locales/sw.json b/frontend/static/locales/sw.json index 9f79be4b..65c2ddb6 100644 --- a/frontend/static/locales/sw.json +++ b/frontend/static/locales/sw.json @@ -464,8 +464,8 @@ "The order has expired": "Agizo limekwisha muda", "The pinned location is approximate. The exact location for the meeting place must be exchanged in the encrypted chat.": "The pinned location is approximate. The exact location for the meeting place must be exchanged in the encrypted chat.", "You cannot take an order yet! Wait {{timeMin}}m {{timeSec}}s": "Hauwezi kuchukua agizo bado! Subiri {{timeMin}}m {{timeSec}}s", - "You receive {{amount}} Sats (Approx)": "Utapokea kupitia Lightning {{amount}} Sats (Takriban)", "You receive via {{method}} {{amount}}": "Utapokea kupitia {{method}} {{amount}}", + "You receive {{amount}} Sats (Approx)": "Utapokea kupitia Lightning {{amount}} Sats (Takriban)", "You send via Lightning {{amount}} Sats (Approx)": "Utatuma kupitia Lightning {{amount}} Sats (Takriban)", "You send via {{method}} {{amount}}": "Utatuma kupitia {{method}} {{amount}}", "{{price}} {{currencyCode}}/BTC - Premium: {{premium}}%": "{{price}} {{currencyCode}}/BTC - Premium: {{premium}}%", diff --git a/frontend/static/locales/th.json b/frontend/static/locales/th.json index ce5fa699..d7a70132 100644 --- a/frontend/static/locales/th.json +++ b/frontend/static/locales/th.json @@ -464,8 +464,8 @@ "The order has expired": "รายการหมดอายุแล้ว", "The pinned location is approximate. The exact location for the meeting place must be exchanged in the encrypted chat.": "The pinned location is approximate. The exact location for the meeting place must be exchanged in the encrypted chat.", "You cannot take an order yet! Wait {{timeMin}}m {{timeSec}}s": "คุณยังไม่สามารถดำเนินรายการได้! รออีก {{timeMin}} นาที {{timeSec}} วินาที", - "You receive {{amount}} Sats (Approx)": "You receive {{amount}} Sats (Approx)", "You receive via {{method}} {{amount}}": "You receive via {{method}} {{amount}}", + "You receive {{amount}} Sats (Approx)": "You receive {{amount}} Sats (Approx)", "You send via Lightning {{amount}} Sats (Approx)": "You send via Lightning {{amount}} Sats (Approx)", "You send via {{method}} {{amount}}": "You send via {{method}} {{amount}}", "{{price}} {{currencyCode}}/BTC - Premium: {{premium}}%": "{{price}} {{currencyCode}}/BTC - ค่าพรีเมี่ยม: {{premium}}%", diff --git a/frontend/static/locales/zh-SI.json b/frontend/static/locales/zh-SI.json index d5ccea56..e1462ba4 100644 --- a/frontend/static/locales/zh-SI.json +++ b/frontend/static/locales/zh-SI.json @@ -464,8 +464,8 @@ "The order has expired": "订单已到期", "The pinned location is approximate. The exact location for the meeting place must be exchanged in the encrypted chat.": "The pinned location is approximate. The exact location for the meeting place must be exchanged in the encrypted chat.", "You cannot take an order yet! Wait {{timeMin}}m {{timeSec}}s": "你暂时还不能吃单!请等{{timeMin}}分 {{timeSec}}秒", - "You receive {{amount}} Sats (Approx)": "You receive {{amount}} Sats (Approx)", "You receive via {{method}} {{amount}}": "你通过{{method}}接收{{amount}}", + "You receive {{amount}} Sats (Approx)": "You receive {{amount}} Sats (Approx)", "You send via Lightning {{amount}} Sats (Approx)": "You send via Lightning {{amount}} Sats (Approx)", "You send via {{method}} {{amount}}": "你通过{{method}}发送{{amount}}", "{{price}} {{currencyCode}}/BTC - Premium: {{premium}}%": "{{price}} {{currencyCode}}/BTC - 溢价: {{premium}}%", diff --git a/frontend/static/locales/zh-TR.json b/frontend/static/locales/zh-TR.json index 91507623..7abecf29 100644 --- a/frontend/static/locales/zh-TR.json +++ b/frontend/static/locales/zh-TR.json @@ -464,8 +464,8 @@ "The order has expired": "訂單已到期", "The pinned location is approximate. The exact location for the meeting place must be exchanged in the encrypted chat.": "The pinned location is approximate. The exact location for the meeting place must be exchanged in the encrypted chat.", "You cannot take an order yet! Wait {{timeMin}}m {{timeSec}}s": "你暫時還不能吃單!請等{{timeMin}}分 {{timeSec}}秒", - "You receive {{amount}} Sats (Approx)": "You receive {{amount}} Sats (Approx)", "You receive via {{method}} {{amount}}": "你通過{{method}}接收{{amount}}", + "You receive {{amount}} Sats (Approx)": "You receive {{amount}} Sats (Approx)", "You send via Lightning {{amount}} Sats (Approx)": "You send via Lightning {{amount}} Sats (Approx)", "You send via {{method}} {{amount}}": "你通過{{method}}發送{{amount}}", "{{price}} {{currencyCode}}/BTC - Premium: {{premium}}%": "{{price}} {{currencyCode}}/BTC - 溢價: {{premium}}%", From f71afb48064bf396507a0e4c9fb38c2661d15993 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 16 Jun 2024 21:18:23 +0000 Subject: [PATCH 5/8] Bump prettier from 3.2.5 to 3.3.2 in /mobile (#1327) Bumps [prettier](https://github.com/prettier/prettier) from 3.2.5 to 3.3.2. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/3.2.5...3.3.2) --- updated-dependencies: - dependency-name: prettier dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- mobile/package-lock.json | 10 +++++----- mobile/package.json | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/mobile/package-lock.json b/mobile/package-lock.json index 5ed3cb12..c31881b6 100644 --- a/mobile/package-lock.json +++ b/mobile/package-lock.json @@ -6,7 +6,7 @@ "packages": { "": { "name": "robosats", - "version": "0.6.1", + "version": "0.6.2", "dependencies": { "@react-native-clipboard/clipboard": "^1.13.2", "@react-native-community/netinfo": "^11.3.0", @@ -37,7 +37,7 @@ "eslint-plugin-react-hooks": "^4.6.2", "jest": "^29.7.0", "metro-react-native-babel-preset": "^0.75.1", - "prettier": "^3.2.5", + "prettier": "^3.3.2", "react-test-renderer": "18.2.0", "typescript": "^5.4.5" } @@ -12714,9 +12714,9 @@ } }, "node_modules/prettier": { - "version": "3.2.5", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz", - "integrity": "sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.2.tgz", + "integrity": "sha512-rAVeHYMcv8ATV5d508CFdn+8/pHPpXeIid1DdrPwXnaAdH7cqjVbpJaT5eq4yRAFU/lsbwYwSF/n5iNrdJHPQA==", "dev": true, "bin": { "prettier": "bin/prettier.cjs" diff --git a/mobile/package.json b/mobile/package.json index 38bfee22..e45c135c 100644 --- a/mobile/package.json +++ b/mobile/package.json @@ -41,7 +41,7 @@ "eslint-plugin-react-hooks": "^4.6.2", "jest": "^29.7.0", "metro-react-native-babel-preset": "^0.75.1", - "prettier": "^3.2.5", + "prettier": "^3.3.2", "react-test-renderer": "18.2.0", "typescript": "^5.4.5" }, From bf6e994792acac16ac0c17f7679532ae9f51c798 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 16 Jun 2024 22:00:17 +0000 Subject: [PATCH 6/8] Bump prettier from 3.2.5 to 3.3.2 in /frontend (#1324) Bumps [prettier](https://github.com/prettier/prettier) from 3.2.5 to 3.3.2. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/3.2.5...3.3.2) --- updated-dependencies: - dependency-name: prettier dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- frontend/package-lock.json | 8 ++++---- frontend/package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/frontend/package-lock.json b/frontend/package-lock.json index af0e67d4..ec3cec07 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -79,7 +79,7 @@ "eslint-plugin-react": "^7.34.0", "eslint-plugin-react-hooks": "^4.6.0", "jest": "^29.6.1", - "prettier": "^3.2.5", + "prettier": "^3.3.2", "ts-node": "^10.9.2", "typescript": "^5.4.2", "webpack": "^5.89.0", @@ -15096,9 +15096,9 @@ } }, "node_modules/prettier": { - "version": "3.2.5", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz", - "integrity": "sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.2.tgz", + "integrity": "sha512-rAVeHYMcv8ATV5d508CFdn+8/pHPpXeIid1DdrPwXnaAdH7cqjVbpJaT5eq4yRAFU/lsbwYwSF/n5iNrdJHPQA==", "dev": true, "bin": { "prettier": "bin/prettier.cjs" diff --git a/frontend/package.json b/frontend/package.json index c84677dd..b1b370e1 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -41,7 +41,7 @@ "eslint-plugin-react": "^7.34.0", "eslint-plugin-react-hooks": "^4.6.0", "jest": "^29.6.1", - "prettier": "^3.2.5", + "prettier": "^3.3.2", "ts-node": "^10.9.2", "typescript": "^5.4.2", "webpack": "^5.89.0", From 74143c8da1cceb299f6f7434051997e86557953f Mon Sep 17 00:00:00 2001 From: KoalaSat Date: Sun, 16 Jun 2024 22:14:32 +0000 Subject: [PATCH 7/8] Disable tor option (#1315) * Disable Tor option * Fix settings save * Remove unused code * Remove unused code 2 --- frontend/src/basic/RobotPage/index.tsx | 4 +-- .../MakerForm/AutocompletePayments.tsx | 2 +- .../src/components/MakerForm/MakerForm.tsx | 6 ---- .../src/components/SettingsForm/index.tsx | 31 +++++++++++++++++-- frontend/src/components/TorConnection.tsx | 4 +-- frontend/src/contexts/FederationContext.tsx | 17 +++------- frontend/src/models/Coordinator.model.ts | 10 ++++-- frontend/src/models/Federation.model.ts | 5 +-- frontend/src/models/Settings.model.ts | 9 +++++- .../System/SystemNativeClient/index.ts | 2 +- .../src/services/api/ApiNativeClient/index.ts | 9 +++++- .../src/services/api/ApiWebClient/index.ts | 2 ++ frontend/src/services/api/index.ts | 1 + frontend/src/utils/federationLottery.ts | 2 -- frontend/static/locales/ca.json | 2 ++ frontend/static/locales/cs.json | 2 ++ frontend/static/locales/de.json | 2 ++ frontend/static/locales/en.json | 2 ++ frontend/static/locales/es.json | 2 ++ frontend/static/locales/eu.json | 2 ++ frontend/static/locales/fr.json | 2 ++ frontend/static/locales/it.json | 2 ++ frontend/static/locales/ja.json | 2 ++ frontend/static/locales/pl.json | 2 ++ frontend/static/locales/pt.json | 2 ++ frontend/static/locales/ru.json | 2 ++ frontend/static/locales/sv.json | 2 ++ frontend/static/locales/sw.json | 2 ++ frontend/static/locales/th.json | 2 ++ frontend/static/locales/zh-SI.json | 2 ++ frontend/static/locales/zh-TR.json | 2 ++ mobile/App.tsx | 1 + 32 files changed, 103 insertions(+), 36 deletions(-) diff --git a/frontend/src/basic/RobotPage/index.tsx b/frontend/src/basic/RobotPage/index.tsx index 6e648929..5ff2599f 100644 --- a/frontend/src/basic/RobotPage/index.tsx +++ b/frontend/src/basic/RobotPage/index.tsx @@ -44,7 +44,7 @@ const RobotPage = (): JSX.Element => { const token = urlToken ?? garage.currentSlot; if (token !== undefined && token !== null && page === 'robot') { setInputToken(token); - if (window.NativeRobosats === undefined || torStatus === 'ON') { + if (window.NativeRobosats === undefined || torStatus === 'ON' || !settings.useProxy) { getGenerateRobot(token); setView('profile'); } @@ -83,7 +83,7 @@ const RobotPage = (): JSX.Element => { garage.deleteSlot(); }; - if (!(window.NativeRobosats === undefined) && !(torStatus === 'ON')) { + if (settings.useProxy && !(window.NativeRobosats === undefined) && !(torStatus === 'ON')) { return ( { - // Why? - // const slot = garage.getSlot(); - // if (slot?.token) void federation.fetchRobot(garage, slot?.token); - }, [garage.currentSlot]); - useEffect(() => { setCurrencyCode(currencyDict[fav.currency === 0 ? 1 : fav.currency]); }, [coordinatorUpdatedAt]); diff --git a/frontend/src/components/SettingsForm/index.tsx b/frontend/src/components/SettingsForm/index.tsx index 1624675b..22eaef92 100644 --- a/frontend/src/components/SettingsForm/index.tsx +++ b/frontend/src/components/SettingsForm/index.tsx @@ -1,4 +1,4 @@ -import React, { useContext } from 'react'; +import React, { useContext, useEffect } from 'react'; import { useTranslation } from 'react-i18next'; import { type UseAppStoreType, AppContext } from '../../contexts/AppContext'; import { @@ -28,17 +28,19 @@ import { QrCode, } from '@mui/icons-material'; import { systemClient } from '../../services/System'; +import { TorIcon } from '../Icons'; import SwapCalls from '@mui/icons-material/SwapCalls'; import { FederationContext, type UseFederationStoreType } from '../../contexts/FederationContext'; +import { GarageContext, UseGarageStoreType } from '../../contexts/GarageContext'; interface SettingsFormProps { dense?: boolean; } const SettingsForm = ({ dense = false }: SettingsFormProps): JSX.Element => { - const { fav, setFav, origin, hostUrl, settings, setSettings } = - useContext(AppContext); + const { fav, setFav, settings, setSettings } = useContext(AppContext); const { federation } = useContext(FederationContext); + const { garage } = useContext(GarageContext); const theme = useTheme(); const { t } = useTranslation(); const fontSizes = [ @@ -237,6 +239,29 @@ const SettingsForm = ({ dense = false }: SettingsFormProps): JSX.Element => { + + {window.NativeRobosats !== undefined && ( + + + + + { + setSettings({ ...settings, useProxy }); + systemClient.setItem('settings_use_proxy', String(useProxy)); + }} + > + + {t('Build-in')} + + + {t('Disabled')} + + + + )} diff --git a/frontend/src/components/TorConnection.tsx b/frontend/src/components/TorConnection.tsx index 006dd1b0..b9d068be 100644 --- a/frontend/src/components/TorConnection.tsx +++ b/frontend/src/components/TorConnection.tsx @@ -55,10 +55,10 @@ const TorIndicator = ({ }; const TorConnectionBadge = (): JSX.Element => { - const { torStatus } = useContext(AppContext); + const { torStatus, settings } = useContext(AppContext); const { t } = useTranslation(); - if (window?.NativeRobosats == null) { + if (window?.NativeRobosats == null || !settings.useProxy) { return <>; } diff --git a/frontend/src/contexts/FederationContext.tsx b/frontend/src/contexts/FederationContext.tsx index dc146e0d..b7998111 100644 --- a/frontend/src/contexts/FederationContext.tsx +++ b/frontend/src/contexts/FederationContext.tsx @@ -111,12 +111,14 @@ export const FederationContextProvider = ({ }, []); useEffect(() => { - // On bitcoin network change we reset book, limits and federation info and fetch everything again - if (window.NativeRobosats === undefined || torStatus === 'ON') { + if (window.NativeRobosats === undefined || torStatus === 'ON' || !settings.useProxy) { void federation.updateUrl(origin, settings, hostUrl); void federation.update(); + + const token = garage.getSlot()?.getRobot()?.token; + if (token) void federation.fetchRobot(garage, token); } - }, [settings.network, torStatus]); + }, [settings.network, settings.useProxy, torStatus]); const onOrderReceived = (order: Order): void => { let newDelay = defaultDelay; @@ -178,15 +180,6 @@ export const FederationContextProvider = ({ if (page === 'offers') void federation.updateBook(); }, [page]); - // use effects to fetchRobots on app start and network change - useEffect(() => { - const slot = garage.getSlot(); - const robot = slot?.getRobot(); - - if (robot && garage.currentSlot && slot?.token && robot.encPrivKey && robot.pubKey) { - void federation.fetchRobot(garage, slot.token); - } - }, [settings.network]); // use effects to fetchRobots on Profile open useEffect(() => { const slot = garage.getSlot(); diff --git a/frontend/src/models/Coordinator.model.ts b/frontend/src/models/Coordinator.model.ts index ef1abb19..c07e771b 100644 --- a/frontend/src/models/Coordinator.model.ts +++ b/frontend/src/models/Coordinator.model.ts @@ -145,7 +145,7 @@ export class Coordinator { public loadingInfo: boolean = false; public limits: LimitList = {}; public loadingLimits: boolean = false; - public loadingRobot: boolean = true; + public loadingRobot: string | null; updateUrl = (origin: Origin, settings: Settings, hostUrl: string): void => { if (settings.selfhostedClient && this.shortAlias !== 'local') { @@ -185,6 +185,7 @@ export class Coordinator { if (this.loadingBook) return; this.loadingBook = true; + this.book = []; apiClient .get(this.url, `${this.basePath}/api/book/`) @@ -297,7 +298,7 @@ export class Coordinator { }; fetchRobot = async (garage: Garage, token: string): Promise => { - if (!this.enabled || !token) return null; + if (!this.enabled || !token || this.loadingRobot === token) return null; const robot = garage?.getSlot(token)?.getRobot() ?? null; const authHeaders = robot?.getAuthHeaders(); @@ -308,6 +309,8 @@ export class Coordinator { if (!hasEnoughEntropy) return null; + this.loadingRobot = token; + garage.updateRobot(token, this.shortAlias, { loading: true }); const newAttributes = await apiClient @@ -330,7 +333,8 @@ export class Coordinator { }) .catch((e) => { console.log(e); - }); + }) + .finally(() => (this.loadingRobot = null)); garage.updateRobot(token, this.shortAlias, { ...newAttributes, diff --git a/frontend/src/models/Federation.model.ts b/frontend/src/models/Federation.model.ts index 7f72531e..2d31e6ce 100644 --- a/frontend/src/models/Federation.model.ts +++ b/frontend/src/models/Federation.model.ts @@ -100,7 +100,7 @@ export class Federation { this.exchange.loadingCoordinators = Object.keys(this.coordinators).length; this.updateEnabledCoordinators(); for (const coor of Object.values(this.coordinators)) { - await coor.update(() => { + coor.update(() => { this.exchange.onlineCoordinators = this.exchange.onlineCoordinators + 1; this.onCoordinatorSaved(); }); @@ -109,10 +109,11 @@ export class Federation { updateBook = async (): Promise => { this.loading = true; + this.book = []; this.triggerHook('onCoordinatorUpdate'); this.exchange.loadingCoordinators = Object.keys(this.coordinators).length; for (const coor of Object.values(this.coordinators)) { - await coor.updateBook(() => { + coor.updateBook(() => { this.onCoordinatorSaved(); }); } diff --git a/frontend/src/models/Settings.model.ts b/frontend/src/models/Settings.model.ts index 203d979f..cbb0ed7a 100644 --- a/frontend/src/models/Settings.model.ts +++ b/frontend/src/models/Settings.model.ts @@ -1,5 +1,6 @@ import i18n from '../i18n/Web'; import { systemClient } from '../services/System'; +import { apiClient } from '../services/api'; import { getHost } from '../utils'; export type Language = @@ -42,8 +43,13 @@ class BaseSettings { : i18n.resolvedLanguage.substring(0, 2); const networkCookie = systemClient.getItem('settings_network'); - this.network = networkCookie !== '' ? networkCookie : 'mainnet'; + this.network = networkCookie && networkCookie !== '' ? networkCookie : 'mainnet'; this.host = getHost(); + + const useProxy = systemClient.getItem('settings_use_proxy'); + this.useProxy = window.NativeRobosats !== undefined && useProxy !== 'false'; + + apiClient.useProxy = this.useProxy; } public frontend: 'basic' | 'pro' = 'basic'; @@ -56,6 +62,7 @@ class BaseSettings { public host?: string; public unsafeClient: boolean = false; public selfhostedClient: boolean = false; + public useProxy: boolean; } export default BaseSettings; diff --git a/frontend/src/services/System/SystemNativeClient/index.ts b/frontend/src/services/System/SystemNativeClient/index.ts index c426442a..9f554c3a 100644 --- a/frontend/src/services/System/SystemNativeClient/index.ts +++ b/frontend/src/services/System/SystemNativeClient/index.ts @@ -28,7 +28,7 @@ class SystemNativeClient implements SystemClient { }; public setCookie: (key: string, value: string) => void = (key, value) => { - delete window.NativeRobosats?.cookies[key]; + window.NativeRobosats?.loadCookie({ key, value }); void window.NativeRobosats?.postMessage({ category: 'system', type: 'setCookie', diff --git a/frontend/src/services/api/ApiNativeClient/index.ts b/frontend/src/services/api/ApiNativeClient/index.ts index 6f794eec..93f8ba39 100644 --- a/frontend/src/services/api/ApiNativeClient/index.ts +++ b/frontend/src/services/api/ApiNativeClient/index.ts @@ -1,8 +1,12 @@ import { type ApiClient, type Auth } from '..'; import { systemClient } from '../../System'; +import ApiWebClient from '../ApiWebClient'; class ApiNativeClient implements ApiClient { - private assetsCache: Record = {}; + public useProxy = true; + + private webClient: ApiClient = new ApiWebClient(); + private readonly assetsPromises = new Map>(); private readonly getHeaders: (auth?: Auth) => HeadersInit = (auth) => { @@ -51,6 +55,7 @@ class ApiNativeClient implements ApiClient { public delete: (baseUrl: string, path: string, auth?: Auth) => Promise = async (baseUrl, path, auth) => { + if (!this.proxy) this.webClient.delete(baseUrl, path, auth); return await window.NativeRobosats?.postMessage({ category: 'http', type: 'delete', @@ -66,6 +71,7 @@ class ApiNativeClient implements ApiClient { body: object, auth?: Auth, ) => Promise = async (baseUrl, path, body, auth) => { + if (!this.proxy) this.webClient.post(baseUrl, path, body, auth); return await window.NativeRobosats?.postMessage({ category: 'http', type: 'post', @@ -81,6 +87,7 @@ class ApiNativeClient implements ApiClient { path, auth, ) => { + if (!this.proxy) this.webClient.get(baseUrl, path, auth); return await window.NativeRobosats?.postMessage({ category: 'http', type: 'get', diff --git a/frontend/src/services/api/ApiWebClient/index.ts b/frontend/src/services/api/ApiWebClient/index.ts index 02fe4054..b28edf27 100644 --- a/frontend/src/services/api/ApiWebClient/index.ts +++ b/frontend/src/services/api/ApiWebClient/index.ts @@ -1,6 +1,8 @@ import { type ApiClient, type Auth } from '..'; class ApiWebClient implements ApiClient { + public useProxy = false; + private readonly getHeaders: (auth?: Auth) => HeadersInit = (auth) => { let headers = { 'Content-Type': 'application/json', diff --git a/frontend/src/services/api/index.ts b/frontend/src/services/api/index.ts index d0013324..21b8effd 100644 --- a/frontend/src/services/api/index.ts +++ b/frontend/src/services/api/index.ts @@ -7,6 +7,7 @@ export interface Auth { } export interface ApiClient { + useProxy: boolean; post: (baseUrl: string, path: string, body: object, auth?: Auth) => Promise; put: (baseUrl: string, path: string, body: object, auth?: Auth) => Promise; get: (baseUrl: string, path: string, auth?: Auth) => Promise; diff --git a/frontend/src/utils/federationLottery.ts b/frontend/src/utils/federationLottery.ts index 4768e256..da49be3b 100644 --- a/frontend/src/utils/federationLottery.ts +++ b/frontend/src/utils/federationLottery.ts @@ -45,7 +45,6 @@ export default function federationLottery(federation: Federation): string[] { // federation[shortAlias] = { badges:{ donatesToDevFund }}; // } -// console.log(federation) // return federation; // } @@ -58,5 +57,4 @@ export default function federationLottery(federation: Federation): string[] { // results.push(rankedCoordinators); // } -// console.log(results) // } diff --git a/frontend/static/locales/ca.json b/frontend/static/locales/ca.json index bfbf6f8b..640e4e82 100644 --- a/frontend/static/locales/ca.json +++ b/frontend/static/locales/ca.json @@ -489,7 +489,9 @@ "Your last order #{{orderID}}": "La teva última ordre #{{orderID}}", "finished order": "finished order", "#43": "Phrases in components/SettingsForm/index.tsx", + "Build-in": "Build-in", "Dark": "Fosc", + "Disabled": "Disabled", "Fiat": "Fiat", "Light": "Clar", "Mainnet": "Mainnet", diff --git a/frontend/static/locales/cs.json b/frontend/static/locales/cs.json index fbe6e0d7..8e12cb8f 100644 --- a/frontend/static/locales/cs.json +++ b/frontend/static/locales/cs.json @@ -489,7 +489,9 @@ "Your last order #{{orderID}}": "Tvá poslední nabídka #{{orderID}}", "finished order": "finished order", "#43": "Phrases in components/SettingsForm/index.tsx", + "Build-in": "Build-in", "Dark": "Dark", + "Disabled": "Disabled", "Fiat": "Fiat", "Light": "Light", "Mainnet": "Mainnet", diff --git a/frontend/static/locales/de.json b/frontend/static/locales/de.json index 2d49cc15..81d79fbe 100644 --- a/frontend/static/locales/de.json +++ b/frontend/static/locales/de.json @@ -489,7 +489,9 @@ "Your last order #{{orderID}}": "Deine letzte Order #{{orderID}}", "finished order": "finished order", "#43": "Phrases in components/SettingsForm/index.tsx", + "Build-in": "Build-in", "Dark": "Dark", + "Disabled": "Disabled", "Fiat": "Fiat", "Light": "Light", "Mainnet": "Mainnet", diff --git a/frontend/static/locales/en.json b/frontend/static/locales/en.json index 4ef3952a..a22e5f96 100644 --- a/frontend/static/locales/en.json +++ b/frontend/static/locales/en.json @@ -489,7 +489,9 @@ "Your last order #{{orderID}}": "Your last order #{{orderID}}", "finished order": "finished order", "#43": "Phrases in components/SettingsForm/index.tsx", + "Build-in": "Build-in", "Dark": "Dark", + "Disabled": "Disabled", "Fiat": "Fiat", "Light": "Light", "Mainnet": "Mainnet", diff --git a/frontend/static/locales/es.json b/frontend/static/locales/es.json index ad038432..0faffd60 100644 --- a/frontend/static/locales/es.json +++ b/frontend/static/locales/es.json @@ -489,7 +489,9 @@ "Your last order #{{orderID}}": "Tu última orden #{{orderID}}", "finished order": "finished order", "#43": "Phrases in components/SettingsForm/index.tsx", + "Build-in": "Build-in", "Dark": "Oscuro", + "Disabled": "Disabled", "Fiat": "Fiat", "Light": "Claro", "Mainnet": "Mainnet", diff --git a/frontend/static/locales/eu.json b/frontend/static/locales/eu.json index 88f7ae8b..7f3340a0 100644 --- a/frontend/static/locales/eu.json +++ b/frontend/static/locales/eu.json @@ -489,7 +489,9 @@ "Your last order #{{orderID}}": "Zure azken eskaera #{{orderID}}", "finished order": "finished order", "#43": "Phrases in components/SettingsForm/index.tsx", + "Build-in": "Build-in", "Dark": "Dark", + "Disabled": "Disabled", "Fiat": "Fiat", "Light": "Light", "Mainnet": "Mainnet", diff --git a/frontend/static/locales/fr.json b/frontend/static/locales/fr.json index cc764b70..746c8e0b 100644 --- a/frontend/static/locales/fr.json +++ b/frontend/static/locales/fr.json @@ -489,7 +489,9 @@ "Your last order #{{orderID}}": "Votre dernière commande #{{orderID}}", "finished order": "finished order", "#43": "Phrases in components/SettingsForm/index.tsx", + "Build-in": "Build-in", "Dark": "Sombre", + "Disabled": "Disabled", "Fiat": "Fiat", "Light": "Light", "Mainnet": "Mainnet", diff --git a/frontend/static/locales/it.json b/frontend/static/locales/it.json index cf129bf7..9ec8bfdb 100644 --- a/frontend/static/locales/it.json +++ b/frontend/static/locales/it.json @@ -489,7 +489,9 @@ "Your last order #{{orderID}}": "Il tuo ultimo ordine #{{orderID}}", "finished order": "finished order", "#43": "Phrases in components/SettingsForm/index.tsx", + "Build-in": "Build-in", "Dark": "Scuro", + "Disabled": "Disabled", "Fiat": "Fiat", "Light": "Chiaro", "Mainnet": "Mainnet", diff --git a/frontend/static/locales/ja.json b/frontend/static/locales/ja.json index cf80e724..c2ecdaae 100644 --- a/frontend/static/locales/ja.json +++ b/frontend/static/locales/ja.json @@ -489,7 +489,9 @@ "Your last order #{{orderID}}": "前回のオーダー #{{orderID}}", "finished order": "finished order", "#43": "Phrases in components/SettingsForm/index.tsx", + "Build-in": "Build-in", "Dark": "ダーク", + "Disabled": "Disabled", "Fiat": "フィアット", "Light": "ライト", "Mainnet": "メインネット", diff --git a/frontend/static/locales/pl.json b/frontend/static/locales/pl.json index ee779ba2..1b2c8cea 100644 --- a/frontend/static/locales/pl.json +++ b/frontend/static/locales/pl.json @@ -489,7 +489,9 @@ "Your last order #{{orderID}}": "Your last order #{{orderID}}", "finished order": "finished order", "#43": "Phrases in components/SettingsForm/index.tsx", + "Build-in": "Build-in", "Dark": "Dark", + "Disabled": "Disabled", "Fiat": "Fiat", "Light": "Light", "Mainnet": "Mainnet", diff --git a/frontend/static/locales/pt.json b/frontend/static/locales/pt.json index 1d5c18ec..8252db48 100644 --- a/frontend/static/locales/pt.json +++ b/frontend/static/locales/pt.json @@ -489,7 +489,9 @@ "Your last order #{{orderID}}": "Sua última ordem #{{orderID}}", "finished order": "ordem finalizada", "#43": "Phrases in components/SettingsForm/index.tsx", + "Build-in": "Build-in", "Dark": "Dark", + "Disabled": "Disabled", "Fiat": "Fiat", "Light": "Light", "Mainnet": "Mainnet", diff --git a/frontend/static/locales/ru.json b/frontend/static/locales/ru.json index 9e0266e7..335d3892 100644 --- a/frontend/static/locales/ru.json +++ b/frontend/static/locales/ru.json @@ -489,7 +489,9 @@ "Your last order #{{orderID}}": "Ваш последний ордер #{{orderID}}", "finished order": "finished order", "#43": "Phrases in components/SettingsForm/index.tsx", + "Build-in": "Build-in", "Dark": "Темный", + "Disabled": "Disabled", "Fiat": "Фиат", "Light": "Светлый", "Mainnet": "Основная сеть", diff --git a/frontend/static/locales/sv.json b/frontend/static/locales/sv.json index 28143f9d..328576cf 100644 --- a/frontend/static/locales/sv.json +++ b/frontend/static/locales/sv.json @@ -489,7 +489,9 @@ "Your last order #{{orderID}}": "Din senaste order #{{orderID}}", "finished order": "finished order", "#43": "Phrases in components/SettingsForm/index.tsx", + "Build-in": "Build-in", "Dark": "Dark", + "Disabled": "Disabled", "Fiat": "Fiat", "Light": "Light", "Mainnet": "Mainnet", diff --git a/frontend/static/locales/sw.json b/frontend/static/locales/sw.json index 65c2ddb6..b07a497c 100644 --- a/frontend/static/locales/sw.json +++ b/frontend/static/locales/sw.json @@ -489,7 +489,9 @@ "Your last order #{{orderID}}": "Amri yako ya mwisho #{{orderID}}", "finished order": "finished order", "#43": "Phrases in components/SettingsForm/index.tsx", + "Build-in": "Build-in", "Dark": "Giza", + "Disabled": "Disabled", "Fiat": "Fiat", "Light": "Nuru", "Mainnet": "Mainnet", diff --git a/frontend/static/locales/th.json b/frontend/static/locales/th.json index d7a70132..c96bc579 100644 --- a/frontend/static/locales/th.json +++ b/frontend/static/locales/th.json @@ -489,7 +489,9 @@ "Your last order #{{orderID}}": "รายการล่าสุดของคุณ #{{orderID}}", "finished order": "finished order", "#43": "Phrases in components/SettingsForm/index.tsx", + "Build-in": "Build-in", "Dark": "Dark", + "Disabled": "Disabled", "Fiat": "Fiat", "Light": "Light", "Mainnet": "Mainnet", diff --git a/frontend/static/locales/zh-SI.json b/frontend/static/locales/zh-SI.json index e1462ba4..671f4b67 100644 --- a/frontend/static/locales/zh-SI.json +++ b/frontend/static/locales/zh-SI.json @@ -489,7 +489,9 @@ "Your last order #{{orderID}}": "你的上一笔交易 #{{orderID}}", "finished order": "finished order", "#43": "Phrases in components/SettingsForm/index.tsx", + "Build-in": "Build-in", "Dark": "深色", + "Disabled": "Disabled", "Fiat": "法币", "Light": "浅色", "Mainnet": "主网", diff --git a/frontend/static/locales/zh-TR.json b/frontend/static/locales/zh-TR.json index 7abecf29..8b2c666e 100644 --- a/frontend/static/locales/zh-TR.json +++ b/frontend/static/locales/zh-TR.json @@ -489,7 +489,9 @@ "Your last order #{{orderID}}": "你的上一筆交易 #{{orderID}}", "finished order": "finished order", "#43": "Phrases in components/SettingsForm/index.tsx", + "Build-in": "Build-in", "Dark": "深色", + "Disabled": "Disabled", "Fiat": "法幣", "Light": "淺色", "Mainnet": "主網", diff --git a/mobile/App.tsx b/mobile/App.tsx index d61444be..e2977573 100644 --- a/mobile/App.tsx +++ b/mobile/App.tsx @@ -71,6 +71,7 @@ const App = () => { loadCookie('settings_mode'); loadCookie('settings_light_qr'); loadCookie('settings_network'); + loadCookie('settings_use_proxy'); loadCookie('garage_slots').then(() => injectMessageResolve(responseId)); }; From ba4b64117900fd752b5ef55f221c62ecfacf00a9 Mon Sep 17 00:00:00 2001 From: KoalaSat Date: Sun, 16 Jun 2024 22:21:38 +0000 Subject: [PATCH 8/8] fix sats text on range orders (#1332) --- frontend/src/components/OrderDetails/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/components/OrderDetails/index.tsx b/frontend/src/components/OrderDetails/index.tsx index 4adb3a32..747159fe 100644 --- a/frontend/src/components/OrderDetails/index.tsx +++ b/frontend/src/components/OrderDetails/index.tsx @@ -178,7 +178,7 @@ const OrderDetails = ({ : coordinator.info?.taker_fee ?? 0; const defaultRoutingBudget = 0.001; const btc_now = order.satoshis_now / 100000000; - const rate = order.amount > 0 ? order.amount / btc_now : Number(order.max_amount) / btc_now; + const rate = Number(order.max_amount ?? order.amount) / btc_now; if (isBuyer) { if (order.amount > 0) {