Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion python-client/dlmm/dlmm/dlmm.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from .utils import convert_to_transaction
from .types import ActivationType, ActiveBin, FeeInfo, GetBins, GetPositionByUser, Position, PositionInfo, StrategyParameters, SwapQuote, LBPair, TokenReserve, DlmmHttpError as HTTPError

API_URL = "localhost:3000"
API_URL = "http://localhost:3000"

class DLMM:
'''
Expand Down
12 changes: 6 additions & 6 deletions python-client/dlmm/dlmm/types.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from dataclasses import dataclass
from enum import Enum
from solders.pubkey import Pubkey
from typing import Any, List, TypedDict
from typing import Any, List, TypedDict, Optional

class DlmmHttpError(Exception):
def __init__(self, message):
Expand Down Expand Up @@ -29,7 +29,7 @@ class ActivationType(Enum):
Timestamp=1,

def __str__(self) -> str:
return f"{self.value[1]}
return f"{self.value[1]}"

def __repr__(self) -> str:
return self.name
Expand Down Expand Up @@ -265,7 +265,7 @@ class LBPair:
token_y_mint: str
padding1: List[int]
padding2: List[int]
fee_owner: Pubkey
fee_owner: Optional[Pubkey]
base_key: str

def __init__(self, data: dict) -> None:
Expand All @@ -281,21 +281,21 @@ def __init__(self, data: dict) -> None:
self.token_y_mint = data["tokenYMint"]
self.padding1 = data["padding1"]
self.padding2 = data["padding2"]
self.fee_owner = Pubkey.from_string(data["feeOwner"])
self.fee_owner = Pubkey.from_string(data["feeOwner"]) if "feeOwner" in data else None
self.base_key = data["baseKey"]

@dataclass
class TokenReserve():
public_key: Pubkey
reserve: Pubkey
amount: str
decimal: int
decimal: Optional[int]

def __init__(self, data: dict) -> None:
self.public_key = Pubkey.from_string(data["publicKey"])
self.reserve = Pubkey.from_string(data["reserve"])
self.amount = data["amount"]
self.decimal = data["decimal"]
self.decimal = data.get("decimal", 9) # Default to 9 decimals if not provided

@dataclass
class PositionInfo():
Expand Down