[Python] py-near ValueError: access key ed25519:[KEY] does not exist while viewing. when...

Discussão em 'Python' iniciado por Stack, Fevereiro 9, 2025.

  1. Stack

    Stack Membro Participativo

    I was trying to send near tokens from one account to another with this function:

    async def send_tokens(address, amount):
    tr = await acc.send_money(address, NEAR * amount)
    print(tr.transaction.hash)


    on the testnet

    tr = await send_tokens("bob.testnet", 1)


    while reading the balances work fine. i get an error when trying to send tokens.

    here is the full traceback:

    Traceback (most recent call last):
    File "/home/aarav/.nearai/registry/aaravdev.near/send-money/0.0.1/chain-actions.py", line 52, in <module>
    asyncio.run(main())
    File "/home/aarav/.pyenv/versions/3.10.16/lib/python3.10/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
    File "/home/aarav/.pyenv/versions/3.10.16/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
    return future.result()
    File "/home/aarav/.nearai/registry/aaravdev.near/send-money/0.0.1/chain-actions.py", line 43, in main
    tr = await send_tokens("bob.testnet", 1)
    File "/home/aarav/.nearai/registry/aaravdev.near/send-money/0.0.1/chain-actions.py", line 20, in send_tokens
    tr = await acc.send_money(address, NEAR * amount)
    File "/home/aarav/.pyenv/versions/3.10.16/lib/python3.10/site-packages/py_near/account.py", line 249, in send_money
    return await self.sign_and_submit_tx(
    File "/home/aarav/.pyenv/versions/3.10.16/lib/python3.10/site-packages/py_near/account.py", line 147, in sign_and_submit_tx
    access_key = await self.get_access_key(pk)
    File "/home/aarav/.pyenv/versions/3.10.16/lib/python3.10/site-packages/py_near/account.py", line 216, in get_access_key
    raise ValueError(resp["error"])
    ValueError: access key ed25519:DY4zkvw...RuXq does not exist while viewing


    The access key the following error outputs does not match with the access key of the account i am using.

    I tried changing the virtual environments because maybe it's from a cli account, but that did not help.

    Continue reading...

Compartilhe esta Página