Ошибка:
Код: Выделить всё
Attempt 1 to create associated token account failed: 'solders.transaction.Transaction' object has no attribute 'recent_blockhash' and no __dict__ for setting new attributes
Код: Выделить всё
msg = Message([create_ata_ix], payer.pubkey())
tx_ata = await client.send_transaction(
Transaction([payer], msg, (await client.get_latest_blockhash()).value.blockhash),
opts=TxOpts(skip_preflight=True,
preflight_commitment=Confirmed)
)
Заранее спасибо.
Пытался добавить недавний_блокхэш к транзакции и настроить процесс создания транзакции, но получил еще одну ошибку.
Код: Выделить всё
# Construct the message and the transaction with the blockhash
msg = Message([create_ata_ix], payer.pubkey())
tx_ata = VersionedTransaction(
payer=payer,
message=msg,
recent_blockhash=recent_blockhash # Add the blockhash here
)
# Send the transaction
tx_hash = await client.send_transaction(tx_ata, payer, opts=TxOpts(skip_preflight=True, preflight_commitment=Confirmed))
await client.confirm_transaction(tx_hash.value, commitment="confirmed")
Код: Выделить всё
Attempt 1 to create associated token account failed: VersionedTransaction.__new__() got an unexpected keyword argument 'payer'
Подробнее здесь: https://stackoverflow.com/questions/792 ... ute-recent