mirror of
https://github.com/RoboSats/robosats.git
synced 2025-01-18 12:11:35 +00:00
add api info entries for limits and swap availability
This commit is contained in:
parent
6b892c7dde
commit
5509340c99
@ -36,6 +36,14 @@ class InfoSerializer(serializers.Serializer):
|
||||
node_alias = serializers.CharField()
|
||||
node_id = serializers.CharField()
|
||||
network = serializers.CharField()
|
||||
min_order_size = serializers.IntegerField(help_text="Minimum order size in Sats")
|
||||
max_order_size = serializers.IntegerField(help_text="Maximum order size in Sats")
|
||||
swap_enabled = serializers.BooleanField(
|
||||
help_text="Whether the option for onchain swap payouts is available or not"
|
||||
)
|
||||
max_swap = serializers.IntegerField(
|
||||
help_text="Maximum size for onchain swap payouts in Sats"
|
||||
)
|
||||
maker_fee = serializers.FloatField(help_text="Exchange's set maker fee")
|
||||
taker_fee = serializers.FloatField(help_text="Exchange's set taker fee ")
|
||||
bond_size = serializers.FloatField(help_text="Default bond size (percent)")
|
||||
|
@ -787,7 +787,8 @@ class InfoView(viewsets.ViewSet):
|
||||
context["alternative_name"] = config("ALTERNATIVE_NAME")
|
||||
context["node_alias"] = config("NODE_ALIAS")
|
||||
context["node_id"] = config("NODE_ID")
|
||||
context["network"] = config("NETWORK")
|
||||
context["network"] = config("NETWORK", cast=str, default="mainnet")
|
||||
context["maker_fee"] = float(config("FEE")) * float(config("MAKER_FEE_SPLIT"))
|
||||
context["maker_fee"] = float(config("FEE")) * float(config("MAKER_FEE_SPLIT"))
|
||||
context["taker_fee"] = float(config("FEE")) * (
|
||||
1 - float(config("MAKER_FEE_SPLIT"))
|
||||
@ -795,6 +796,10 @@ class InfoView(viewsets.ViewSet):
|
||||
context["bond_size"] = settings.DEFAULT_BOND_SIZE
|
||||
context["notice_severity"] = config("NOTICE_SEVERITY", cast=str, default="none")
|
||||
context["notice_message"] = config("NOTICE_MESSAGE", cast=str, default="")
|
||||
context["min_order_size"] = config("MIN_ORDER_SIZE", cast=int, default=20000)
|
||||
context["max_order_size"] = config("MAX_ORDER_SIZE", cast=int, default=250000)
|
||||
context["swap_enabled"] = not config("DISABLE_ONCHAIN", cast=bool, default=True)
|
||||
context["max_swap"] = config("MAX_SWAP_ALLOWED", cast=int, default=0)
|
||||
|
||||
try:
|
||||
context["current_swap_fee_rate"] = Logics.compute_swap_fee_rate(
|
||||
|
@ -1006,6 +1006,19 @@ components:
|
||||
type: string
|
||||
network:
|
||||
type: string
|
||||
min_order_size:
|
||||
type: integer
|
||||
description: Minimum order size in Sats
|
||||
max_order_size:
|
||||
type: integer
|
||||
description: Maximum order size in Sats
|
||||
swap_enabled:
|
||||
type: boolean
|
||||
description: Whether the option for onchain swap payouts is available or
|
||||
not
|
||||
max_swap:
|
||||
type: integer
|
||||
description: Maximum size for onchain swap payouts in Sats
|
||||
maker_fee:
|
||||
type: number
|
||||
format: double
|
||||
@ -1041,6 +1054,9 @@ components:
|
||||
- lifetime_volume
|
||||
- lnd_version
|
||||
- maker_fee
|
||||
- max_order_size
|
||||
- max_swap
|
||||
- min_order_size
|
||||
- network
|
||||
- node_alias
|
||||
- node_id
|
||||
@ -1049,6 +1065,7 @@ components:
|
||||
- num_public_buy_orders
|
||||
- num_public_sell_orders
|
||||
- robosats_running_commit_hash
|
||||
- swap_enabled
|
||||
- taker_fee
|
||||
- version
|
||||
ListOrder:
|
||||
|
Loading…
Reference in New Issue
Block a user