Created
September 28, 2025 12:30
-
-
Save renfei/b7a43621f91ae38cd38763cb1b0fa523 to your computer and use it in GitHub Desktop.
Command to close Ledger's Solana token account and recover deposit in macOS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Get the public key | |
| # Output my public key: ApqJpFXgNnW4Cw8f8fh5sDaz1fYjqiYmWmERaAZTPM7r | |
| solana-keygen pubkey 'usb://ledger?key=0' | |
| # View the token account list | |
| spl-token accounts --owner ApqJpFXgNnW4Cw8f8fh5sDaz1fYjqiYmWmERaAZTPM7r | |
| # Close the specified token account | |
| spl-token close SNS8DJbHc34nKySHVhLGMUUE72ho6igvJaxtq9T3cX3 --recipient ApqJpFXgNnW4Cw8f8fh5sDaz1fYjqiYmWmERaAZTPM7r --close-authority 'usb://ledger?key=0' --owner ApqJpFXgNnW4Cw8f8fh5sDaz1fYjqiYmWmERaAZTPM7r --fee-payer 'usb://ledger?key=0' --url mainnet-beta |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment