1717 UiAccountData ,
1818 } ,
1919 solana_clap_v3_utils:: {
20- input_parsers:: { pubkey_of_signer, pubkeys_of_multiple_signers, value_of } ,
20+ input_parsers:: { pubkey_of_signer, pubkeys_of_multiple_signers} ,
2121 keypair:: signer_from_path,
2222 } ,
2323 solana_cli_output:: {
@@ -3533,11 +3533,12 @@ pub async fn process_command<'a>(
35333533 )
35343534 } ) ;
35353535
3536- let tranfer_fee_basis_point = value_of :: < u16 > ( arg_matches, "transfer_fee_basis_points" ) ;
3537- let transfer_fee_maximum_fee = value_of :: < f64 > ( arg_matches, "transfer_fee_maximum_fee" )
3538- . map ( |v| spl_token:: ui_amount_to_amount ( v, decimals) ) ;
3539- let transfer_fee = tranfer_fee_basis_point
3540- . map ( |v| ( v, transfer_fee_maximum_fee. unwrap ( ) ) )
3536+ let transfer_fee_basis_point = arg_matches. get_one :: < u16 > ( "transfer_fee_basis_points" ) ;
3537+ let transfer_fee_maximum_fee = arg_matches
3538+ . get_one :: < f64 > ( "transfer_fee_maximum_fee" )
3539+ . map ( |v| spl_token:: ui_amount_to_amount ( * v, decimals) ) ;
3540+ let transfer_fee = transfer_fee_basis_point
3541+ . map ( |v| ( * v, transfer_fee_maximum_fee. unwrap ( ) ) )
35413542 . or ( transfer_fee) ;
35423543
35433544 let ( token_signer, token) =
@@ -3660,7 +3661,9 @@ pub async fn process_command<'a>(
36603661 _ => Field :: Key ( field. to_string ( ) ) ,
36613662 } ;
36623663 let value = arg_matches. value_of ( "value" ) . map ( |v| v. to_string ( ) ) ;
3663- let transfer_lamports = value_of :: < u64 > ( arg_matches, TRANSFER_LAMPORTS_ARG . name ) ;
3664+ let transfer_lamports = arg_matches
3665+ . get_one ( TRANSFER_LAMPORTS_ARG . name )
3666+ . map ( |v : & String | v. parse :: < u64 > ( ) . unwrap ( ) ) ;
36643667 let bulk_signers = vec ! [ authority_signer] ;
36653668
36663669 command_update_metadata (
@@ -3766,7 +3769,10 @@ pub async fn process_command<'a>(
37663769 . await
37673770 }
37683771 ( CommandName :: CreateMultisig , arg_matches) => {
3769- let minimum_signers = value_of :: < u8 > ( arg_matches, "minimum_signers" ) . unwrap ( ) ;
3772+ let minimum_signers = arg_matches
3773+ . get_one ( "minimum_signers" )
3774+ . map ( |v : & String | v. parse :: < u8 > ( ) . unwrap ( ) )
3775+ . unwrap ( ) ;
37703776 let multisig_members =
37713777 pubkeys_of_multiple_signers ( arg_matches, "multisig_member" , & mut wallet_manager)
37723778 . unwrap_or_else ( print_error_and_exit)
@@ -3850,7 +3856,9 @@ pub async fn process_command<'a>(
38503856 push_signer_with_dedup ( owner_signer, & mut bulk_signers) ;
38513857 }
38523858
3853- let mint_decimals = value_of :: < u8 > ( arg_matches, MINT_DECIMALS_ARG . name ) ;
3859+ let mint_decimals = arg_matches
3860+ . get_one ( MINT_DECIMALS_ARG . name )
3861+ . map ( |v : & String | v. parse :: < u8 > ( ) . unwrap ( ) ) ;
38543862 let fund_recipient = arg_matches. is_present ( "fund_recipient" ) ;
38553863 let allow_unfunded_recipient = arg_matches. is_present ( "allow_empty_recipient" )
38563864 || arg_matches. is_present ( "allow_unfunded_recipient" ) ;
@@ -3862,7 +3870,7 @@ pub async fn process_command<'a>(
38623870 println_display ( config, "recipient-is-ata-owner is now the default behavior. The option has been deprecated and will be removed in a future release." . to_string ( ) ) ;
38633871 }
38643872 let use_unchecked_instruction = arg_matches. is_present ( "use_unchecked_instruction" ) ;
3865- let expected_fee = value_of :: < f64 > ( arg_matches , "expected_fee" ) ;
3873+ let expected_fee = arg_matches . get_one :: < f64 > ( "expected_fee" ) . copied ( ) ;
38663874 let memo = value_t ! ( arg_matches, "memo" , String ) . ok ( ) ;
38673875 let transfer_hook_accounts = arg_matches. values_of ( "transfer_hook_account" ) . map ( |v| {
38683876 v. into_iter ( )
@@ -3906,7 +3914,9 @@ pub async fn process_command<'a>(
39063914 let amount = parse_amount_or_all ( arg_matches) ;
39073915 let mint_address =
39083916 pubkey_of_signer ( arg_matches, MINT_ADDRESS_ARG . name , & mut wallet_manager) . unwrap ( ) ;
3909- let mint_decimals = value_of :: < u8 > ( arg_matches, MINT_DECIMALS_ARG . name ) ;
3917+ let mint_decimals = arg_matches
3918+ . get_one ( MINT_DECIMALS_ARG . name )
3919+ . map ( |v : & String | v. parse :: < u8 > ( ) . unwrap ( ) ) ;
39103920 let use_unchecked_instruction = arg_matches. is_present ( "use_unchecked_instruction" ) ;
39113921 let memo = value_t ! ( arg_matches, "memo" , String ) . ok ( ) ;
39123922 command_burn (
@@ -3933,7 +3943,9 @@ pub async fn process_command<'a>(
39333943 . unwrap ( )
39343944 . unwrap ( ) ;
39353945 let amount = value_t_or_exit ! ( arg_matches, "amount" , f64 ) ;
3936- let mint_decimals = value_of :: < u8 > ( arg_matches, MINT_DECIMALS_ARG . name ) ;
3946+ let mint_decimals = arg_matches
3947+ . get_one ( MINT_DECIMALS_ARG . name )
3948+ . map ( |v : & String | v. parse :: < u8 > ( ) . unwrap ( ) ) ;
39373949 let mint_info = config. get_mint_info ( & token, mint_decimals) . await ?;
39383950 let recipient = if let Some ( address) =
39393951 pubkey_of_signer ( arg_matches, "recipient" , & mut wallet_manager) . unwrap ( )
@@ -4058,7 +4070,9 @@ pub async fn process_command<'a>(
40584070 . unwrap ( ) ;
40594071 let mint_address =
40604072 pubkey_of_signer ( arg_matches, MINT_ADDRESS_ARG . name , & mut wallet_manager) . unwrap ( ) ;
4061- let mint_decimals = value_of :: < u8 > ( arg_matches, MINT_DECIMALS_ARG . name ) ;
4073+ let mint_decimals = arg_matches
4074+ . get_one ( MINT_DECIMALS_ARG . name )
4075+ . map ( |v : & String | v. parse :: < u8 > ( ) . unwrap ( ) ) ;
40624076 let use_unchecked_instruction = arg_matches. is_present ( "use_unchecked_instruction" ) ;
40634077 command_approve (
40644078 config,
@@ -4395,7 +4409,9 @@ pub async fn process_command<'a>(
43954409 let maximum_fee = value_t_or_exit ! ( arg_matches, "maximum_fee" , f64 ) ;
43964410 let ( transfer_fee_authority_signer, transfer_fee_authority_pubkey) = config
43974411 . signer_or_default ( arg_matches, "transfer_fee_authority" , & mut wallet_manager) ;
4398- let mint_decimals = value_of :: < u8 > ( arg_matches, MINT_DECIMALS_ARG . name ) ;
4412+ let mint_decimals = arg_matches
4413+ . get_one ( MINT_DECIMALS_ARG . name )
4414+ . map ( |v : & String | v. parse :: < u8 > ( ) . unwrap ( ) ) ;
43994415 let bulk_signers = vec ! [ transfer_fee_authority_signer] ;
44004416
44014417 command_set_transfer_fee (
@@ -4541,7 +4557,9 @@ pub async fn process_command<'a>(
45414557 let ( owner_signer, owner) =
45424558 config. signer_or_default ( arg_matches, "owner" , & mut wallet_manager) ;
45434559
4544- let mint_decimals = value_of :: < u8 > ( arg_matches, MINT_DECIMALS_ARG . name ) ;
4560+ let mint_decimals = arg_matches
4561+ . get_one ( MINT_DECIMALS_ARG . name )
4562+ . map ( |v : & String | v. parse :: < u8 > ( ) . unwrap ( ) ) ;
45454563
45464564 let ( instruction_type, elgamal_keypair, aes_key) = match c {
45474565 CommandName :: DepositConfidentialTokens => {
0 commit comments