Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds --blockhash arg to Close #7456

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

brooksprumo
Copy link
Contributor

@brooksprumo brooksprumo commented Nov 4, 2024

I'd like the --blockhash arg on the Close instruction. This is done by calling .offline_args().

output from `spl-token close --help`

spl-token-close 
Close a token account

USAGE:
    spl-token close [OPTIONS] [--] [TOKEN_MINT_ADDRESS]

ARGS:
    <TOKEN_MINT_ADDRESS>    Token of the associated account to close. To close a specific
                            account, use the `--address` parameter instead

OPTIONS:
        --address <TOKEN_ACCOUNT_ADDRESS>
            Specify the token account to close [default: owner's associated token account]

        --blockhash <BLOCKHASH>
            Use the supplied blockhash

    -C, --config <PATH>
            Configuration file to use

        --close-authority <KEYPAIR>
            Specify the token's close authority if it has one, otherwise specify the token's owner
            keypair. This may be a keypair file or the ASK keyword. Defaults to the client keypair.

        --dump-transaction-message
            Display the base64 encoded binary transaction message in sign-only mode

        --fee-payer <KEYPAIR>
            Specify the fee-payer account. This may be a keypair file, the ASK keyword
            or the pubkey of an offline signer, provided an appropriate --signer argument
            is also passed. Defaults to the client keypair.

    -h, --help
            Print help information

        --multisig-signer [<MULTISIG_SIGNER>...]
            Member signer of a multisig account

        --nonce <PUBKEY>
            Provide the nonce account to use when creating a nonced
            transaction. Nonced transactions are useful when a transaction
            requires a lengthy signing process. Learn more about nonced
            transactions at https://docs.solanalabs.com/cli/examples/durable-nonce

        --nonce-authority <KEYPAIR>
            Provide the nonce authority keypair to use when signing a nonced transaction

        --output <FORMAT>
            Return information in specified output format [possible values: json, json-compact]

        --owner <OWNER_ADDRESS>
            Address of the primary authority controlling a mint or account. Defaults to the client
            keypair address.

    -p, --program-id <ADDRESS>
            SPL Token program id

        --program-2022
            Use token extension program token 2022 with program id:
            TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb

        --recipient <REFUND_ACCOUNT_ADDRESS>
            The address of the account to receive remaining SOL [default: --owner]

        --sign-only
            Sign the transaction offline

        --signer <PUBKEY=SIGNATURE>
            Provide a public-key/signature pair for the transaction

    -u, --url <URL_OR_MONIKER>
            URL for Solana's JSON RPC or moniker (or their first letter): [mainnet-beta, testnet,
            devnet, localhost] Default from the configuration file.

    -v, --verbose
            Show additional information

        --with-compute-unit-limit <COMPUTE-UNIT-LIMIT>
            Set compute unit limit for transaction, in compute units.

        --with-compute-unit-price <COMPUTE-UNIT-PRICE>
            Set compute unit price for transaction, in increments of 0.000001 lamports per compute
            unit.

Copy link
Contributor

@joncinque joncinque left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change looks good to me! The close implementation already takes into account the sign_only field, so this should be the only change needed.

Once you've had a chance to try this locally just to double-check, we can merge it. Thanks for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants