-
Notifications
You must be signed in to change notification settings - Fork 280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
_create_account_info returns "Invalid account size" when using TOKEN_2022_PROGRAM_ID #463
Comments
What version of solana-py are you using? |
I am using latest, v0.35.1. Do you have any suggestions what can be wrong? |
You need to pass in solana-py/src/spl/token/instructions.py Lines 1238 to 1240 in 3f40b01
|
i did this, but |
Okay. This is a bug. We'll need to patch. |
Am also encountering this with: import asyncio
from solana.rpc.async_api import AsyncClient
from solders.keypair import Keypair
from solders.pubkey import Pubkey
from spl.token.async_client import AsyncToken
async def main() -> None:
client = AsyncClient("https://api.mainnet-beta.solana.com")
token = AsyncToken(
conn=client,
pubkey=Pubkey.from_string(
"2b1kV6DkPAnxd5ixfnxCpjxmKwqjjaYmCZfHsFu24GXo" # PYUSD
),
program_id=Pubkey.from_string(
"TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb" # Token-2022
),
payer=Keypair(),
)
print(token.get_mint_info())
if __name__ == "__main__":
asyncio.run(main()) Also, |
I am running solana-py on ECLIPSE, which uses TOKEN_2022_PROGRAM_ID for most tokens.
When I do "token.get_or_create_associated_token_account(keypair.pubkey(), payer=keypair, create=True)" it returns error, as len(bytes_data) != ACCOUNT_LAYOUT.sizeof() inside "_create_account_info" triggers ValueError("Invalid account size")
ACCOUNT_LAYOUT for TOKEN_2022_PROGRAM_ID is probably different? Can anybody help?
The text was updated successfully, but these errors were encountered: