mirror of
https://github.com/chainstacklabs/pumpfun-bonkfun-bot.git
synced 2026-08-06 03:57:45 +00:00
feat(core): add support for creator fee update
This commit is contained in:
@@ -22,6 +22,8 @@ class TokenInfo:
|
||||
bonding_curve: Pubkey
|
||||
associated_bonding_curve: Pubkey
|
||||
user: Pubkey
|
||||
creator: Pubkey
|
||||
creator_vault: Pubkey
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, data: dict[str, Any]) -> "TokenInfo":
|
||||
@@ -41,6 +43,8 @@ class TokenInfo:
|
||||
bonding_curve=Pubkey.from_string(data["bondingCurve"]),
|
||||
associated_bonding_curve=Pubkey.from_string(data["associatedBondingCurve"]),
|
||||
user=Pubkey.from_string(data["user"]),
|
||||
creator=Pubkey.from_string(data["creator"]),
|
||||
creator_vault=Pubkey.from_string(data["creator_vault"]),
|
||||
)
|
||||
|
||||
def to_dict(self) -> dict[str, str]:
|
||||
@@ -57,6 +61,8 @@ class TokenInfo:
|
||||
"bondingCurve": str(self.bonding_curve),
|
||||
"associatedBondingCurve": str(self.associated_bonding_curve),
|
||||
"user": str(self.user),
|
||||
"creator": str(self.creator),
|
||||
"creatorVault": str(self.creator_vault),
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -176,7 +176,7 @@ class TokenBuyer(Trader):
|
||||
pubkey=SystemAddresses.TOKEN_PROGRAM, is_signer=False, is_writable=False
|
||||
),
|
||||
AccountMeta(
|
||||
pubkey=SystemAddresses.RENT, is_signer=False, is_writable=False
|
||||
pubkey=token_info.creator_vault, is_signer=False, is_writable=True
|
||||
),
|
||||
AccountMeta(
|
||||
pubkey=PumpAddresses.EVENT_AUTHORITY, is_signer=False, is_writable=False
|
||||
|
||||
@@ -128,7 +128,7 @@ class TokenSeller(Trader):
|
||||
)
|
||||
|
||||
except Exception as e:
|
||||
logger.error(f"Sell operation failed: {str(e)}")
|
||||
logger.error(f"Sell operation failed: {e!s}")
|
||||
return TradeResult(success=False, error_message=str(e))
|
||||
|
||||
async def _send_sell_transaction(
|
||||
@@ -175,9 +175,7 @@ class TokenSeller(Trader):
|
||||
pubkey=SystemAddresses.PROGRAM, is_signer=False, is_writable=False
|
||||
),
|
||||
AccountMeta(
|
||||
pubkey=SystemAddresses.ASSOCIATED_TOKEN_PROGRAM,
|
||||
is_signer=False,
|
||||
is_writable=False,
|
||||
pubkey=token_info.creator_vault, is_signer=False, is_writable=True,
|
||||
),
|
||||
AccountMeta(
|
||||
pubkey=SystemAddresses.TOKEN_PROGRAM, is_signer=False, is_writable=False
|
||||
@@ -209,5 +207,5 @@ class TokenSeller(Trader):
|
||||
),
|
||||
)
|
||||
except Exception as e:
|
||||
logger.error(f"Sell transaction failed: {str(e)}")
|
||||
logger.error(f"Sell transaction failed: {e!s}")
|
||||
raise
|
||||
|
||||
Reference in New Issue
Block a user