feat(core): add support for creator fee update

This commit is contained in:
smypmsa
2025-05-12 20:07:51 +00:00
parent d979427662
commit e41a5f4f4f
18 changed files with 5951 additions and 441 deletions
+6
View File
@@ -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),
}
+1 -1
View File
@@ -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
+3 -5
View File
@@ -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