Skip to content

Instantly share code, notes, and snippets.

@zQueal
Created June 27, 2021 04:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zQueal/d5c0effcb4b0628e42d0ccb7c54da288 to your computer and use it in GitHub Desktop.
Save zQueal/d5c0effcb4b0628e42d0ccb7c54da288 to your computer and use it in GitHub Desktop.
A simple batch wrapper to simplify using `atto`
@ECHO OFF
SET SEED=%1
:MENU
cls
ECHO.
ECHO Do stuff with NANO seeds.
ECHO.
ECHO 1 - Generate New Seed
ECHO 2 - Enter Seed
ECHO 3 - View Public Address
ECHO 4 - View Balance (Process Receive Blocks)
ECHO 5 - Send NANO
ECHO 6 - Change Representative
ECHO 7 - Help
ECHO 0 - Exit
ECHO.
SET /P M=": "
IF %M%==1 GOTO NEW
IF %M%==2 GOTO ENTSEED
IF %M%==3 GOTO ADDRESS
IF %M%==4 GOTO BALANCE
IF %M%==5 GOTO SENDNANO
IF %M%==6 GOTO CHANGEREP
IF %M%==7 GOTO HELP
IF %M%==0 GOTO EXIT
:NEW
SET /P S="Save it to the desktop? (y/n) "
IF %S%==y GOTO SAVSEED
IF %S%==n GOTO ECHOSEED
:SAVSEED
cls
ECHO Here's your new seed. Keep it in a safe place.
ECHO.
atto new | tee "%USERPROFILE%\Desktop\seed.txt"
PAUSE > NUL
GOTO MENU
:ECHOSEED
cls
ECHO Here's your new seed. Keep it in a safe place.
ECHO.
atto new
PAUSE > NUL
GOTO MENU
:ENTSEED
cls
SET /P SEED="Seed? "
GOTO MENU
:ADDRESS
cls
SET /P INDEX="From which account index? "
echo %SEED% | atto -a %INDEX% address
PAUSE > NUL
GOTO MENU
:BALANCE
cls
SET /P INDEX="From which account index? "
echo %SEED% | atto -a %INDEX% balance
PAUSE > NUL
GOTO MENU
:SENDNANO
cls
SET /P AMOUNT="How much NANO to send? "
SET /P INDEX="From which account index? "
SET /P SENDTO="Send to which address? "
echo %SEED% | atto -a %INDEX% -y send %AMOUNT% %SENDTO%
PAUSE > NUL
GOTO MENU
:CHANGEREP
cls
SET /P INDEX="Change representative for what address index? "
SET /P REP="What's the representatives address? "
echo %SEED% | atto -a %INDEX% representative %REP%
PAUSE > NUL
GOTO MENU
:HELP
cls
ECHO.
ECHO Requires atto in your PATH: https://github.com/codesoap/atto
ECHO This is just a batch wrapper to make working with atto a little easier for some.
ECHO.
ECHO Usage:
ECHO %0 {seed}
ECHO.
ECHO You can supply a seed as an argument, or generate one within the script
ECHO from there you can check balances, view addresses, receive and send NANO
ECHO and even change your representative.
PAUSE > NUL
GOTO MENU
:EXIT
EXIT /B
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment