Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Commit 0500f5f

Browse files
authored
Add spl-token transfer --no-wait (#1525)
1 parent 7550748 commit 0500f5f

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

token/cli/src/main.rs

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1238,6 +1238,7 @@ impl offline::ArgsConfig for SignOnlyNeedsDelegateAddress {
12381238

12391239
fn main() {
12401240
let default_decimals = &format!("{}", native_mint::DECIMALS);
1241+
let mut no_wait = false;
12411242
let app_matches = App::new(crate_name!())
12421243
.about(crate_description!())
12431244
.version(crate_version!())
@@ -1504,6 +1505,12 @@ fn main() {
15041505
.takes_value(false)
15051506
.help("Create the associated token account for the recipient if doesn't already exist")
15061507
)
1508+
.arg(
1509+
Arg::with_name("no_wait")
1510+
.long("no-wait")
1511+
.takes_value(false)
1512+
.help("Return signature immediately after submitting the transaction, instead of waiting for confirmations"),
1513+
)
15071514
.arg(multisig_signer_arg())
15081515
.arg(mint_decimals_arg())
15091516
.nonce_args(true)
@@ -2044,6 +2051,7 @@ fn main() {
20442051
let fund_recipient = matches.is_present("fund_recipient");
20452052
let allow_unfunded_recipient = matches.is_present("allow_empty_recipient")
20462053
|| matches.is_present("allow_unfunded_recipient");
2054+
no_wait = matches.is_present("no_wait");
20472055
command_transfer(
20482056
&config,
20492057
token,
@@ -2228,9 +2236,13 @@ fn main() {
22282236
println!("{}", return_signers(&transaction, &OutputFormat::Display)?);
22292237
} else {
22302238
transaction.try_sign(&signer_info.signers, recent_blockhash)?;
2231-
let signature = config
2232-
.rpc_client
2233-
.send_and_confirm_transaction_with_spinner(&transaction)?;
2239+
let signature = if no_wait {
2240+
config.rpc_client.send_transaction(&transaction)?
2241+
} else {
2242+
config
2243+
.rpc_client
2244+
.send_and_confirm_transaction_with_spinner(&transaction)?
2245+
};
22342246
println!("Signature: {}", signature);
22352247
}
22362248
}

0 commit comments

Comments
 (0)