python-api
python-api copied to clipboard
update the primary_sale_happened property
The update_token_metadata function doesn't allow updating primary_sale_happened. Is there another way to do so?
it is the byte before the last, in line 187. in metadata.py.
_data = bytes([1]) + _get_data_buffer(name, symbol, uri, fee, creators, verified, share) + bytes([0, 0])
value I believe is 1 if the primary sale has happened.
sorry, I am in mobile.
Like this?
_data = bytes([1]) + _get_data_buffer(name, symbol, uri, fee, creators, verified, share) + bytes([1, 0])
The
Like this?
_data = bytes([1]) + _get_data_buffer(name, symbol, uri, fee, creators, verified, share) + bytes([1, 0])
This sadly does not work. Can you elaborate further @crypt0miester ?
The error is: #3 Metaplex Token Metadata instruction
Program log: Error: BorshIoError Program Metaplex Token Metadata consumed 3816 of 200000 compute units Program returned error: Failed to serialize or deserialize account data: Unknown
The
Like this?
_data = bytes([1]) + _get_data_buffer(name, symbol, uri, fee, creators, verified, share) + bytes([1, 0])
This sadly does not work. Can you elaborate further @crypt0miester ?
The error is: #3 Metaplex Token Metadata instruction
Program log: Error: BorshIoError Program Metaplex Token Metadata consumed 3816 of 200000 compute units Program returned error: Failed to serialize or deserialize account data: Unknown
you only changed 0 to 1? have you made any other changes? I will have to test the code. currently AFK.
The
Like this?
_data = bytes([1]) + _get_data_buffer(name, symbol, uri, fee, creators, verified, share) + bytes([1, 0])
This sadly does not work. Can you elaborate further @crypt0miester ? The error is: #3 Metaplex Token Metadata instruction
Program log: Error: BorshIoError Program Metaplex Token Metadata consumed 3816 of 200000 compute units Program returned error: Failed to serialize or deserialize account data: Unknown
you only changed 0 to 1? have you made any other changes? I will have to test the code. currently AFK.
I only change 0 to 1. No other changes.
The
Like this?
_data = bytes([1]) + _get_data_buffer(name, symbol, uri, fee, creators, verified, share) + bytes([1, 0])
This sadly does not work. Can you elaborate further @crypt0miester ? The error is: #3 Metaplex Token Metadata instruction
Program log: Error: BorshIoError Program Metaplex Token Metadata consumed 3816 of 200000 compute units Program returned error: Failed to serialize or deserialize account data: Unknown
you only changed 0 to 1? have you made any other changes? I will have to test the code. currently AFK.
I only change 0 to 1. No other changes.
send me the transaction id
The
Like this?
_data = bytes([1]) + _get_data_buffer(name, symbol, uri, fee, creators, verified, share) + bytes([1, 0])
This sadly does not work. Can you elaborate further @crypt0miester ? The error is: #3 Metaplex Token Metadata instruction
Program log: Error: BorshIoError Program Metaplex Token Metadata consumed 3816 of 200000 compute units Program returned error: Failed to serialize or deserialize account data: Unknown
you only changed 0 to 1? have you made any other changes? I will have to test the code. currently AFK.
I only change 0 to 1. No other changes.
send me the transaction id
3HWEep4QApqbhb3kZpikEt9H1Gp58f4H4YVPM3BsqM9fDUEKc6GR8B1jt59UwpwKJ8iQxsBAHA7BW593evM5zf2H
Any news @crypt0miester? Or any way you can point me to the right docs to try and change the code as well?
contact me in discord CryptoMiester#1865
https://github.com/crypt0miester/python-api/tree/v1.2
here you go, please test it.
https://github.com/crypt0miester/python-api/tree/v1.2
here you go, please test it.
@crypt0miester I fixed some minor bugs to make the "update_primary_sale_happened" function work but the transaction failed.
#1 Metaplex Token Metadata instruction
Program log: Instruction: Update primary sale via token Program log: Error: InvalidAccountData Program Metaplex Token Metadata consumed 1568 of 200000 compute units Program returned error: invalid account data for instruction
https://solscan.io/tx/2aUVQ5zfStewbn1JhFfUDL48NF7U62ABeZi7gjRxxGiTHGr2ymF5EGGE4TZU9kqbsY99cQv6D1Nqvg57R9P7mKVi?cluster=devnet
you probably have a wrong account data value in your code. double check
I think I was trying to call this before minting but after the creation of the metadata. I now tried after the mint and it worked. I was wondering if I always need the private key of the owner to perform the update?
try adding the instruction at the end of the minting.
I tried that but I get:
#5 Metaplex Token Metadata instruction
Program log: Instruction: Update primary sale via token Program log: Owner does not match that on the account given Program Metaplex Token Metadata consumed 5831 of 200000 compute units Program returned error: custom program error: 0x2b
code looks like this:
...
create_master_edition_ix = create_master_edition_instruction(
mint=mint_account,
update_authority=source_account.public_key,
mint_authority=source_account.public_key,
payer=source_account.public_key,
supply=supply,
)
tx = tx.add(create_master_edition_ix)
# update primary sale happened
update_primary_sale_happened_ix = update_primary_sale_happened_instruction(
update_authority=source_account.public_key,
mint_key=mint_account,
token=associated_token_account,
)
tx = tx.add(update_primary_sale_happened_ix)
guess it doesnt work. sorry can't help further.