mirror of
https://github.com/chainstacklabs/pumpfun-bonkfun-bot.git
synced 2026-08-18 17:58:06 +00:00
fix(core): refactor dataclass to use class vars
This commit is contained in:
+11
-6
@@ -4,7 +4,6 @@ This module contains only system-level addresses that are shared across all plat
|
|||||||
Platform-specific addresses are handled by their respective AddressProvider implementations.
|
Platform-specific addresses are handled by their respective AddressProvider implementations.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from dataclasses import dataclass
|
|
||||||
from typing import Final
|
from typing import Final
|
||||||
|
|
||||||
from solders.pubkey import Pubkey
|
from solders.pubkey import Pubkey
|
||||||
@@ -13,11 +12,6 @@ from solders.pubkey import Pubkey
|
|||||||
LAMPORTS_PER_SOL: Final[int] = 1_000_000_000
|
LAMPORTS_PER_SOL: Final[int] = 1_000_000_000
|
||||||
TOKEN_DECIMALS: Final[int] = 6
|
TOKEN_DECIMALS: Final[int] = 6
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
|
||||||
class SystemAddresses:
|
|
||||||
"""System-level Solana addresses shared across all platforms."""
|
|
||||||
|
|
||||||
# Core system programs
|
# Core system programs
|
||||||
SYSTEM_PROGRAM: Final[Pubkey] = Pubkey.from_string("11111111111111111111111111111111")
|
SYSTEM_PROGRAM: Final[Pubkey] = Pubkey.from_string("11111111111111111111111111111111")
|
||||||
TOKEN_PROGRAM: Final[Pubkey] = Pubkey.from_string(
|
TOKEN_PROGRAM: Final[Pubkey] = Pubkey.from_string(
|
||||||
@@ -37,6 +31,17 @@ class SystemAddresses:
|
|||||||
"So11111111111111111111111111111111111111112"
|
"So11111111111111111111111111111111111111112"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
class SystemAddresses:
|
||||||
|
"""System-level Solana addresses shared across all platforms."""
|
||||||
|
|
||||||
|
# Reference the module-level constants
|
||||||
|
SYSTEM_PROGRAM = SYSTEM_PROGRAM
|
||||||
|
TOKEN_PROGRAM = TOKEN_PROGRAM
|
||||||
|
ASSOCIATED_TOKEN_PROGRAM = ASSOCIATED_TOKEN_PROGRAM
|
||||||
|
RENT = RENT
|
||||||
|
SOL_MINT = SOL_MINT
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_all_system_addresses(cls) -> dict[str, Pubkey]:
|
def get_all_system_addresses(cls) -> dict[str, Pubkey]:
|
||||||
"""Get all system addresses as a dictionary.
|
"""Get all system addresses as a dictionary.
|
||||||
|
|||||||
Reference in New Issue
Block a user