A command-line tool to transfer and then cancel multiple contracts. The way it works is:
- First it transfers Contract to a new recipient address (that you provide as a first argument to
cancel
command) - Then it cancels Contract, with this all unlocked tokens are returned to the New Recipient
- This way you cancel a Contract/Contracts without sending any tokens to the original recipient
- You can use a pre-built binary (with pyinstaller) from
dist
directory like so./dist/batch_cancel_cli -h
This command will show available commands and options for the configuration - Works the same as with poetry bit without a need to install dependencies
- To launch on windows use
PowerShell
, to launch on Mac OS useTerminal
- Requires poetry and python 3.11+ to be installed on your machine
- Install dependencies and a script with
poetry install
- And run the script with
poetry run batch_cancel_cli -h
poetry run batch_cancel_cli cancel
- This command will transfer 4 Contracts in total to
wdrwhnCv4pzW8beKsbPa4S2UDZrXenjg16KJdKSpb5u
and then cancel them on Mainnet, will use a private key provided via--key
command lint argument
./dist/batch_cancel_cli \
--key yx81aSuUVDEsddhLeyBBv2Qkk2cz5qThj1Ugwk6xPTZUqEnNA3uGGvmChhn3RNdA71jqrvo8nWV9L1Y7pbnSA6v \
cancel \
9k5FjrUEnVBvjmjU7EfxZQCwgTeSirSgFu1ZexaduPCk \
GmW9XSD33jKeM1PWLuBbpZYYkNmdHMz4jkS5FHyVUiGi \
35gRe3qLMHWmUJEYMmEw5wNiKZKmiVAygLLX144evJfZ \
4ojq1wTZ4XWoHjER41uZXpw7cyX68LTE83qiMgC41d9F \
-r wdrwhnCv4pzW8beKsbPa4S2UDZrXenjg16KJdKSpb5u
- This command will transfer 2 Contracts in total to
wdrwhnCv4pzW8beKsbPa4S2UDZrXenjg16KJdKSpb5u
and then cancel them on Devnet, will use a custom RPC url and private key located atsigner.json
(default value)
./dist/batch_cancel_cli \
--devnet \
--rpc https://rpc.ankr.com/solana_devnet \
cancel \
9k5FjrUEnVBvjmjU7EfxZQCwgTeSirSgFu1ZexaduPCk \
GmW9XSD33jKeM1PWLuBbpZYYkNmdHMz4jkS5FHyVUiGi \
-r wdrwhnCv4pzW8beKsbPa4S2UDZrXenjg16KJdKSpb5u
- This command will cancel 2 Contracts in total and will check whether either of these contracts have been claimed previously before transferring/cancelling:
./dist/batch_cancel_cli \
--devnet \
--rpc https://rpc.ankr.com/solana_devnet \
cancel \
9k5FjrUEnVBvjmjU7EfxZQCwgTeSirSgFu1ZexaduPCk \
GmW9XSD33jKeM1PWLuBbpZYYkNmdHMz4jkS5FHyVUiGi \
-r wdrwhnCv4pzW8beKsbPa4S2UDZrXenjg16KJdKSpb5u \
--check-claims