mirror of
https://github.com/chainstacklabs/pumpfun-bonkfun-bot.git
synced 2026-07-27 15:27:44 +00:00
feat(core): add support for creator fee update
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user