charli3_dendrite 1.2.5.dev0__tar.gz → 1.2.5.dev2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {charli3_dendrite-1.2.5.dev0 → charli3_dendrite-1.2.5.dev2}/PKG-INFO +1 -1
- {charli3_dendrite-1.2.5.dev0 → charli3_dendrite-1.2.5.dev2}/pyproject.toml +2 -2
- {charli3_dendrite-1.2.5.dev0 → charli3_dendrite-1.2.5.dev2}/src/charli3_dendrite/dexs/amm/splash.py +154 -91
- {charli3_dendrite-1.2.5.dev0 → charli3_dendrite-1.2.5.dev2}/LICENSE +0 -0
- {charli3_dendrite-1.2.5.dev0 → charli3_dendrite-1.2.5.dev2}/README.md +0 -0
- {charli3_dendrite-1.2.5.dev0 → charli3_dendrite-1.2.5.dev2}/src/charli3_dendrite/__init__.py +0 -0
- {charli3_dendrite-1.2.5.dev0 → charli3_dendrite-1.2.5.dev2}/src/charli3_dendrite/backend/__init__.py +0 -0
- {charli3_dendrite-1.2.5.dev0 → charli3_dendrite-1.2.5.dev2}/src/charli3_dendrite/backend/backend_base.py +0 -0
- {charli3_dendrite-1.2.5.dev0 → charli3_dendrite-1.2.5.dev2}/src/charli3_dendrite/backend/blockfrost/__init__.py +0 -0
- {charli3_dendrite-1.2.5.dev0 → charli3_dendrite-1.2.5.dev2}/src/charli3_dendrite/backend/blockfrost/models.py +0 -0
- {charli3_dendrite-1.2.5.dev0 → charli3_dendrite-1.2.5.dev2}/src/charli3_dendrite/backend/dbsync/__init__.py +0 -0
- {charli3_dendrite-1.2.5.dev0 → charli3_dendrite-1.2.5.dev2}/src/charli3_dendrite/backend/dbsync/models.py +0 -0
- {charli3_dendrite-1.2.5.dev0 → charli3_dendrite-1.2.5.dev2}/src/charli3_dendrite/backend/ogmios_kupo/__init__.py +0 -0
- {charli3_dendrite-1.2.5.dev0 → charli3_dendrite-1.2.5.dev2}/src/charli3_dendrite/backend/ogmios_kupo/models.py +0 -0
- {charli3_dendrite-1.2.5.dev0 → charli3_dendrite-1.2.5.dev2}/src/charli3_dendrite/backend/utils.py +0 -0
- {charli3_dendrite-1.2.5.dev0 → charli3_dendrite-1.2.5.dev2}/src/charli3_dendrite/dataclasses/__init__.py +0 -0
- {charli3_dendrite-1.2.5.dev0 → charli3_dendrite-1.2.5.dev2}/src/charli3_dendrite/dataclasses/datums.py +0 -0
- {charli3_dendrite-1.2.5.dev0 → charli3_dendrite-1.2.5.dev2}/src/charli3_dendrite/dataclasses/models.py +0 -0
- {charli3_dendrite-1.2.5.dev0 → charli3_dendrite-1.2.5.dev2}/src/charli3_dendrite/dexs/__init__.py +0 -0
- {charli3_dendrite-1.2.5.dev0 → charli3_dendrite-1.2.5.dev2}/src/charli3_dendrite/dexs/amm/__init__.py +0 -0
- {charli3_dendrite-1.2.5.dev0 → charli3_dendrite-1.2.5.dev2}/src/charli3_dendrite/dexs/amm/amm_base.py +0 -0
- {charli3_dendrite-1.2.5.dev0 → charli3_dendrite-1.2.5.dev2}/src/charli3_dendrite/dexs/amm/amm_types.py +0 -0
- {charli3_dendrite-1.2.5.dev0 → charli3_dendrite-1.2.5.dev2}/src/charli3_dendrite/dexs/amm/cswap.py +0 -0
- {charli3_dendrite-1.2.5.dev0 → charli3_dendrite-1.2.5.dev2}/src/charli3_dendrite/dexs/amm/minswap.py +0 -0
- {charli3_dendrite-1.2.5.dev0 → charli3_dendrite-1.2.5.dev2}/src/charli3_dendrite/dexs/amm/muesli.py +0 -0
- {charli3_dendrite-1.2.5.dev0 → charli3_dendrite-1.2.5.dev2}/src/charli3_dendrite/dexs/amm/spectrum.py +0 -0
- {charli3_dendrite-1.2.5.dev0 → charli3_dendrite-1.2.5.dev2}/src/charli3_dendrite/dexs/amm/sundae.py +0 -0
- {charli3_dendrite-1.2.5.dev0 → charli3_dendrite-1.2.5.dev2}/src/charli3_dendrite/dexs/amm/vyfi.py +0 -0
- {charli3_dendrite-1.2.5.dev0 → charli3_dendrite-1.2.5.dev2}/src/charli3_dendrite/dexs/amm/wingriders.py +0 -0
- {charli3_dendrite-1.2.5.dev0 → charli3_dendrite-1.2.5.dev2}/src/charli3_dendrite/dexs/core/__init__.py +0 -0
- {charli3_dendrite-1.2.5.dev0 → charli3_dendrite-1.2.5.dev2}/src/charli3_dendrite/dexs/core/base.py +0 -0
- {charli3_dendrite-1.2.5.dev0 → charli3_dendrite-1.2.5.dev2}/src/charli3_dendrite/dexs/core/errors.py +0 -0
- {charli3_dendrite-1.2.5.dev0 → charli3_dendrite-1.2.5.dev2}/src/charli3_dendrite/dexs/ob/__init__.py +0 -0
- {charli3_dendrite-1.2.5.dev0 → charli3_dendrite-1.2.5.dev2}/src/charli3_dendrite/dexs/ob/axo.py +0 -0
- {charli3_dendrite-1.2.5.dev0 → charli3_dendrite-1.2.5.dev2}/src/charli3_dendrite/dexs/ob/djed.py +0 -0
- {charli3_dendrite-1.2.5.dev0 → charli3_dendrite-1.2.5.dev2}/src/charli3_dendrite/dexs/ob/geniusyield.py +0 -0
- {charli3_dendrite-1.2.5.dev0 → charli3_dendrite-1.2.5.dev2}/src/charli3_dendrite/dexs/ob/ob_base.py +0 -0
- {charli3_dendrite-1.2.5.dev0 → charli3_dendrite-1.2.5.dev2}/src/charli3_dendrite/utility.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "charli3_dendrite"
|
|
3
|
-
version = "1.2.5-
|
|
3
|
+
version = "1.2.5-dev2"
|
|
4
4
|
description = ""
|
|
5
5
|
authors = ["Elder Millenial <eldermillenial@protonmail.com>"]
|
|
6
6
|
readme = "README.md"
|
|
@@ -49,7 +49,7 @@ module = ["pycardano", "pycardano.*", "dotenv", "nox"]
|
|
|
49
49
|
ignore_missing_imports = true
|
|
50
50
|
|
|
51
51
|
[tool.bumpversion]
|
|
52
|
-
current_version = "1.2.5-
|
|
52
|
+
current_version = "1.2.5-dev2"
|
|
53
53
|
parse = """(?x)
|
|
54
54
|
(?P<major>\\d+)\\.
|
|
55
55
|
(?P<minor>\\d+)\\.
|
{charli3_dendrite-1.2.5.dev0 → charli3_dendrite-1.2.5.dev2}/src/charli3_dendrite/dexs/amm/splash.py
RENAMED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"""Minswap DEX Module."""
|
|
2
2
|
|
|
3
|
-
from dataclasses import dataclass
|
|
3
|
+
from dataclasses import dataclass, field
|
|
4
|
+
from random import choice
|
|
5
|
+
from string import hexdigits
|
|
4
6
|
from typing import Any
|
|
5
7
|
from typing import List
|
|
6
8
|
from typing import Union
|
|
@@ -71,7 +73,11 @@ class SplashOrderDatum(OrderDatum):
|
|
|
71
73
|
fee: int
|
|
72
74
|
redeemer_address: PlutusFullAddress
|
|
73
75
|
cancel_pkh: bytes
|
|
74
|
-
permitted_executors: List[bytes]
|
|
76
|
+
permitted_executors: List[bytes] = field(
|
|
77
|
+
default_factory=lambda: [
|
|
78
|
+
b"\\\xb2\xc9h\xe5\xd1\xc7\x19zl\xe7aYg1\n7UE\xd9\xbce\x06:\x96C5\xb2"
|
|
79
|
+
]
|
|
80
|
+
)
|
|
75
81
|
|
|
76
82
|
def address_source(self) -> Address:
|
|
77
83
|
"""This method should return the source address associated with the order."""
|
|
@@ -88,6 +94,43 @@ class SplashOrderDatum(OrderDatum):
|
|
|
88
94
|
"""This method should return the type of the order."""
|
|
89
95
|
return OrderType.swap
|
|
90
96
|
|
|
97
|
+
@classmethod
|
|
98
|
+
def create_datum(
|
|
99
|
+
cls,
|
|
100
|
+
address_source: Address,
|
|
101
|
+
in_assets: Assets,
|
|
102
|
+
out_assets: Assets,
|
|
103
|
+
batcher_fee: Assets,
|
|
104
|
+
deposit: Assets,
|
|
105
|
+
address_target: Address | None = None,
|
|
106
|
+
datum_target: PlutusData | None = None,
|
|
107
|
+
) -> "CSwapOrderDatum":
|
|
108
|
+
"""Create a CSwap order datum."""
|
|
109
|
+
# Validate ADA-only restriction
|
|
110
|
+
merged_assets = in_assets + out_assets
|
|
111
|
+
|
|
112
|
+
full_address = PlutusFullAddress.from_address(address_source)
|
|
113
|
+
|
|
114
|
+
beacon = bytes.fromhex("".join(choice(hexdigits) for _ in range(56)))
|
|
115
|
+
|
|
116
|
+
numerator, denominator = float.as_integer_ratio(
|
|
117
|
+
in_assets.quantity() / out_assets.quantity(),
|
|
118
|
+
)
|
|
119
|
+
|
|
120
|
+
return cls(
|
|
121
|
+
tag=b"\x00",
|
|
122
|
+
beacon=beacon,
|
|
123
|
+
in_asset=AssetClass.from_assets(in_assets),
|
|
124
|
+
tradable_input=in_assets.quantity(),
|
|
125
|
+
cost_per_ex_step=batcher_fee.quantity(),
|
|
126
|
+
min_marginal_output=out_assets.quantity(),
|
|
127
|
+
output=AssetClass.from_assets(out_assets),
|
|
128
|
+
base_price=Rationale(numerator=numerator, denominator=denominator),
|
|
129
|
+
fee=0,
|
|
130
|
+
redeemer_address=full_address,
|
|
131
|
+
cancel_pkh=address_source.payment_part.payload,
|
|
132
|
+
)
|
|
133
|
+
|
|
91
134
|
|
|
92
135
|
@dataclass
|
|
93
136
|
class SplashSSPPoolDatum(PoolDatum):
|
|
@@ -741,8 +784,8 @@ class SplashCPPRoyaltyState(SplashCPPState):
|
|
|
741
784
|
"""Splash StableSwap Pool State."""
|
|
742
785
|
|
|
743
786
|
fee: int = 30
|
|
744
|
-
_batcher = Assets(lovelace=
|
|
745
|
-
_deposit = Assets(lovelace=
|
|
787
|
+
_batcher = Assets(lovelace=1000000)
|
|
788
|
+
_deposit = Assets(lovelace=1500000)
|
|
746
789
|
|
|
747
790
|
def _treasury_x(self) -> int:
|
|
748
791
|
return self.pool_datum.treasury_x + self.pool_datum.royalty_x
|
|
@@ -789,92 +832,112 @@ class SplashCPPRoyaltyState(SplashCPPState):
|
|
|
789
832
|
address_target: Address | None = None,
|
|
790
833
|
datum_target: PlutusData | None = None,
|
|
791
834
|
) -> tuple[TransactionOutput | None, PlutusData]:
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
addresses=self.pool_selector().addresses,
|
|
801
|
-
)
|
|
802
|
-
|
|
803
|
-
# Get the output assets
|
|
804
|
-
out_assets, _ = self.get_amount_out(asset=in_assets)
|
|
805
|
-
|
|
806
|
-
# Create the output redeemer
|
|
807
|
-
redeemer = Redeemer(
|
|
808
|
-
CPPoolRedeemer(
|
|
809
|
-
action=2,
|
|
810
|
-
self_index=-1,
|
|
811
|
-
),
|
|
835
|
+
return super(SplashBaseState, self).swap_utxo(
|
|
836
|
+
address_source=address_source,
|
|
837
|
+
in_assets=in_assets,
|
|
838
|
+
out_assets=out_assets,
|
|
839
|
+
tx_builder=tx_builder,
|
|
840
|
+
extra_assets=extra_assets,
|
|
841
|
+
address_target=address_target,
|
|
842
|
+
datum_target=datum_target,
|
|
812
843
|
)
|
|
813
844
|
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
845
|
+
# def swap_utxo(
|
|
846
|
+
# self,
|
|
847
|
+
# address_source: Address,
|
|
848
|
+
# in_assets: Assets,
|
|
849
|
+
# out_assets: Assets,
|
|
850
|
+
# tx_builder: TransactionBuilder | None = None,
|
|
851
|
+
# extra_assets: Assets | None = None,
|
|
852
|
+
# address_target: Address | None = None,
|
|
853
|
+
# datum_target: PlutusData | None = None,
|
|
854
|
+
# ) -> tuple[TransactionOutput | None, PlutusData]:
|
|
855
|
+
# assert self.tx_hash is not None
|
|
856
|
+
# assert self.pool_nft is not None
|
|
857
|
+
# assert self.lp_tokens is not None
|
|
858
|
+
# assert tx_builder is not None
|
|
859
|
+
|
|
860
|
+
# order_info = get_backend().get_pool_in_tx(
|
|
861
|
+
# self.tx_hash,
|
|
862
|
+
# assets=[self.pool_nft.unit()],
|
|
863
|
+
# addresses=self.pool_selector().addresses,
|
|
864
|
+
# )
|
|
865
|
+
|
|
866
|
+
# # Get the output assets
|
|
867
|
+
# out_assets, _ = self.get_amount_out(asset=in_assets)
|
|
868
|
+
|
|
869
|
+
# # Create the output redeemer
|
|
870
|
+
# redeemer = Redeemer(
|
|
871
|
+
# CPPoolRedeemer(
|
|
872
|
+
# action=2,
|
|
873
|
+
# self_index=-1,
|
|
874
|
+
# ),
|
|
875
|
+
# )
|
|
876
|
+
|
|
877
|
+
# # Create the pool input UTxO
|
|
878
|
+
# pool_datum_class = self.pool_datum_class()
|
|
879
|
+
# pool_datum = pool_datum_class.from_cbor(
|
|
880
|
+
# self.pool_datum.to_cbor(),
|
|
881
|
+
# )
|
|
882
|
+
# assets = self.assets + self.pool_nft + self.lp_tokens
|
|
883
|
+
# assets.root[self.assets.unit()] += (
|
|
884
|
+
# pool_datum.treasury_x + self.pool_datum.royalty_x
|
|
885
|
+
# )
|
|
886
|
+
# assets.root[self.assets.unit(1)] += (
|
|
887
|
+
# pool_datum.treasury_y + self.pool_datum.royalty_y
|
|
888
|
+
# )
|
|
889
|
+
# input_utxo = UTxO(
|
|
890
|
+
# TransactionInput(
|
|
891
|
+
# transaction_id=TransactionId(bytes.fromhex(self.tx_hash)),
|
|
892
|
+
# index=self.tx_index,
|
|
893
|
+
# ),
|
|
894
|
+
# output=TransactionOutput(
|
|
895
|
+
# address=order_info[0].address,
|
|
896
|
+
# amount=asset_to_value(assets),
|
|
897
|
+
# datum=self.pool_datum,
|
|
898
|
+
# ),
|
|
899
|
+
# )
|
|
900
|
+
|
|
901
|
+
# # Create the pool output UTxO
|
|
902
|
+
# new_assets = Assets.model_validate(assets.model_dump())
|
|
903
|
+
# new_assets.root[in_assets.unit()] += in_assets.quantity()
|
|
904
|
+
# new_assets.root[out_assets.unit()] += -out_assets.quantity()
|
|
905
|
+
# new_pool_datum = pool_datum_class.from_cbor(
|
|
906
|
+
# self.pool_datum.to_cbor(),
|
|
907
|
+
# )
|
|
908
|
+
|
|
909
|
+
# if in_assets.unit() == new_pool_datum.asset_x.assets.unit():
|
|
910
|
+
# new_pool_datum.treasury_x += int(
|
|
911
|
+
# in_assets.quantity() * new_pool_datum.treasury_fee // 100000,
|
|
912
|
+
# )
|
|
913
|
+
# new_pool_datum.royalty_x += int(
|
|
914
|
+
# in_assets.quantity() * new_pool_datum.royalty_fee // 100000,
|
|
915
|
+
# )
|
|
916
|
+
# elif in_assets.unit() == new_pool_datum.asset_y.assets.unit():
|
|
917
|
+
# new_pool_datum.treasury_y += int(
|
|
918
|
+
# in_assets.quantity() * new_pool_datum.treasury_fee // 100000,
|
|
919
|
+
# )
|
|
920
|
+
# new_pool_datum.royalty_y += int(
|
|
921
|
+
# in_assets.quantity() * new_pool_datum.royalty_fee // 100000,
|
|
922
|
+
# )
|
|
923
|
+
# else:
|
|
924
|
+
# raise ValueError("Invalid input asset")
|
|
925
|
+
|
|
926
|
+
# txo = TransactionOutput(
|
|
927
|
+
# address=order_info[0].address,
|
|
928
|
+
# amount=asset_to_value(new_assets),
|
|
929
|
+
# datum=new_pool_datum,
|
|
930
|
+
# )
|
|
931
|
+
|
|
932
|
+
# # Add the script input
|
|
933
|
+
# pool_hash = Address.decode(order_info[0].address).payment_part.payload
|
|
934
|
+
# script = (
|
|
935
|
+
# get_backend()
|
|
936
|
+
# .get_script_from_address(
|
|
937
|
+
# Address(payment_part=ScriptHash(payload=pool_hash)),
|
|
938
|
+
# )
|
|
939
|
+
# .to_utxo()
|
|
940
|
+
# )
|
|
941
|
+
# tx_builder.add_script_input(utxo=input_utxo, script=script, redeemer=redeemer)
|
|
942
|
+
|
|
943
|
+
# return txo, self.pool_datum
|
|
File without changes
|
|
File without changes
|
{charli3_dendrite-1.2.5.dev0 → charli3_dendrite-1.2.5.dev2}/src/charli3_dendrite/__init__.py
RENAMED
|
File without changes
|
{charli3_dendrite-1.2.5.dev0 → charli3_dendrite-1.2.5.dev2}/src/charli3_dendrite/backend/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{charli3_dendrite-1.2.5.dev0 → charli3_dendrite-1.2.5.dev2}/src/charli3_dendrite/backend/utils.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{charli3_dendrite-1.2.5.dev0 → charli3_dendrite-1.2.5.dev2}/src/charli3_dendrite/dexs/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{charli3_dendrite-1.2.5.dev0 → charli3_dendrite-1.2.5.dev2}/src/charli3_dendrite/dexs/amm/cswap.py
RENAMED
|
File without changes
|
{charli3_dendrite-1.2.5.dev0 → charli3_dendrite-1.2.5.dev2}/src/charli3_dendrite/dexs/amm/minswap.py
RENAMED
|
File without changes
|
{charli3_dendrite-1.2.5.dev0 → charli3_dendrite-1.2.5.dev2}/src/charli3_dendrite/dexs/amm/muesli.py
RENAMED
|
File without changes
|
|
File without changes
|
{charli3_dendrite-1.2.5.dev0 → charli3_dendrite-1.2.5.dev2}/src/charli3_dendrite/dexs/amm/sundae.py
RENAMED
|
File without changes
|
{charli3_dendrite-1.2.5.dev0 → charli3_dendrite-1.2.5.dev2}/src/charli3_dendrite/dexs/amm/vyfi.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{charli3_dendrite-1.2.5.dev0 → charli3_dendrite-1.2.5.dev2}/src/charli3_dendrite/dexs/core/base.py
RENAMED
|
File without changes
|
{charli3_dendrite-1.2.5.dev0 → charli3_dendrite-1.2.5.dev2}/src/charli3_dendrite/dexs/core/errors.py
RENAMED
|
File without changes
|
{charli3_dendrite-1.2.5.dev0 → charli3_dendrite-1.2.5.dev2}/src/charli3_dendrite/dexs/ob/__init__.py
RENAMED
|
File without changes
|
{charli3_dendrite-1.2.5.dev0 → charli3_dendrite-1.2.5.dev2}/src/charli3_dendrite/dexs/ob/axo.py
RENAMED
|
File without changes
|
{charli3_dendrite-1.2.5.dev0 → charli3_dendrite-1.2.5.dev2}/src/charli3_dendrite/dexs/ob/djed.py
RENAMED
|
File without changes
|
|
File without changes
|
{charli3_dendrite-1.2.5.dev0 → charli3_dendrite-1.2.5.dev2}/src/charli3_dendrite/dexs/ob/ob_base.py
RENAMED
|
File without changes
|
|
File without changes
|