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
@@ -11,6 +11,7 @@ import json
import os
import struct
import base58
import websockets
from dotenv import load_dotenv
from solders.pubkey import Pubkey
@@ -37,8 +38,8 @@ def decode_create_instruction(ix_data, ix_def, accounts):
offset += 4
value = ix_data[offset : offset + length].decode("utf-8")
offset += length
elif arg["type"] == "publicKey":
value = base64.b64encode(ix_data[offset : offset + 32]).decode("utf-8")
elif arg["type"] == "pubkey":
value = base58.b58encode(ix_data[offset : offset + 32]).decode("utf-8")
offset += 32
else:
raise ValueError(f"Unsupported type: {arg['type']}")
@@ -77,14 +77,22 @@ def decode_create_instruction(ix_data: bytes, keys, accounts) -> dict:
offset += length
return value
def read_pubkey():
nonlocal offset
value = base58.b58encode(ix_data[offset : offset + 32]).decode("utf-8")
offset += 32
return value
name = read_string()
symbol = read_string()
uri = read_string()
creator = read_pubkey()
token_info = {
"name": name,
"symbol": symbol,
"uri": uri,
"creator": creator,
"mint": get_account_key(0),
"metadata": get_account_key(1),
"bonding_curve": get_account_key(2),
@@ -105,6 +113,7 @@ def print_token_info(info, signature):
print(f"Mint: {info['mint']}")
print(f"Bonding curve: {info['bonding_curve']}")
print(f"Associated bonding curve: {info['associated_bonding_curve']}")
print(f"Creator: {info['creator']}")
print(f"Signature: {signature}")
@@ -54,6 +54,7 @@ def parse_create_instruction(data):
("mint", "publicKey"),
("bondingCurve", "publicKey"),
("user", "publicKey"),
("creator", "publicKey"),
]
try:
@@ -36,6 +36,7 @@ def parse_create_instruction(data):
("mint", "publicKey"),
("bondingCurve", "publicKey"),
("user", "publicKey"),
("creator", "publicKey"),
]
try: