Sending all the ALGO (closing the account) using `algosdk`?

I’m doing some automated tests in javascript / nodejs / jest.

One of the tests involves sending some ALGO, then sending it back (so I don’t ran out of testnet funds).


Every account on Algorand must have a minimum balance of 100,000 microAlgos. If ever a transaction is sent that would result in a balance lower than the minimum, the transaction will fail.

Is there any special method allowing me to send all the testnet ALGO and close the account?


List of methods:

I am searching for “close” and maybe makeApplicationCloseOutTxnFromObject but that would be weird, I want to close an account, not an application, or maybe account is the application, who knows.

You just need to make a simple payment transaction with the closeRemainderTo field set to where you want to close the funds to. I believe the address for testnet dispenser is HZ57J3K46JIJXILONBBZOHX6BKPXEM2VVXNRFSUED6DKFD5ZD24PMJ3MVA

Also note that you should have closed all assets out and removed and created contracts first.