Search code examples
nearprotocol

How to delete NEAR account with large state?


I'm attempting to delete a NEAR wallet and transfer the remaining fund to another wallet by using the following command:

near delete choyeumeo.near maimai276.near

But seems like the action failed because the to-be-deleted accounts has too many state. So someone advice me is to delete all the state before trying again.

Here is the transaction id: Explorer

Here is the picture of failed function: Failed function

So I am looking for a way to delete those states. Any help would be much appreciated.


Solution

  • I created a javascript node js file that comes with a list of options to delete your functionCall access keys and full access keys

    This will help clear up your state without having to delete them one by one manually

    this file will allow you to delete all your functionCall Access Keys, all your full Access Keys or all but one specified full access keys with instructions on how to specify the key you want to save

    You can check it out here!

    the code contains the step by step instructions

    please leave feedback if you run into any issues or want an additional feature

    https://github.com/doriancrutcher/mass-delete-access-keys-near