|
5 | 5 | clap::{crate_description, crate_name, crate_version, Arg, Command},
|
6 | 6 | solana_clap_v3_utils::{
|
7 | 7 | input_parsers::{
|
8 |
| - parse_url_or_moniker, pubkey_of_signer, signer::SignerSourceParserBuilder, |
| 8 | + parse_url_or_moniker, |
| 9 | + signer::{SignerSource, SignerSourceParserBuilder}, |
9 | 10 | },
|
10 | 11 | input_validators::normalize_to_url_if_moniker,
|
11 |
| - keypair::DefaultSigner, |
| 12 | + keypair::{pubkey_from_source, DefaultSigner}, |
12 | 13 | },
|
13 | 14 | solana_client::nonblocking::rpc_client::RpcClient,
|
14 | 15 | solana_remote_wallet::remote_wallet::RemoteWalletManager,
|
@@ -443,12 +444,23 @@ extraMetas:
|
443 | 444 |
|
444 | 445 | match (command, matches) {
|
445 | 446 | ("create-extra-metas", arg_matches) => {
|
446 |
| - let program_id = pubkey_of_signer(arg_matches, "program_id", &mut wallet_manager) |
447 |
| - .unwrap() |
| 447 | + let program_id_source = arg_matches |
| 448 | + .try_get_one::<SignerSource>("program_id")? |
448 | 449 | .unwrap();
|
449 |
| - let token = pubkey_of_signer(arg_matches, "token", &mut wallet_manager) |
450 |
| - .unwrap() |
| 450 | + let program_id = pubkey_from_source( |
| 451 | + arg_matches, |
| 452 | + program_id_source, |
| 453 | + "program_id", |
| 454 | + &mut wallet_manager, |
| 455 | + ) |
| 456 | + .unwrap(); |
| 457 | + |
| 458 | + let token_source = arg_matches |
| 459 | + .try_get_one::<SignerSource>("program_id")? |
451 | 460 | .unwrap();
|
| 461 | + let token = pubkey_from_source(arg_matches, token_source, "token", &mut wallet_manager) |
| 462 | + .unwrap(); |
| 463 | + |
452 | 464 | let transfer_hook_accounts = arg_matches
|
453 | 465 | .get_many::<Vec<ExtraAccountMeta>>("transfer_hook_accounts")
|
454 | 466 | .unwrap_or_default()
|
@@ -483,12 +495,23 @@ extraMetas:
|
483 | 495 | println!("Signature: {signature}");
|
484 | 496 | }
|
485 | 497 | ("update-extra-metas", arg_matches) => {
|
486 |
| - let program_id = pubkey_of_signer(arg_matches, "program_id", &mut wallet_manager) |
487 |
| - .unwrap() |
| 498 | + let program_id_source = arg_matches |
| 499 | + .try_get_one::<SignerSource>("program_id")? |
488 | 500 | .unwrap();
|
489 |
| - let token = pubkey_of_signer(arg_matches, "token", &mut wallet_manager) |
490 |
| - .unwrap() |
| 501 | + let program_id = pubkey_from_source( |
| 502 | + arg_matches, |
| 503 | + program_id_source, |
| 504 | + "program_id", |
| 505 | + &mut wallet_manager, |
| 506 | + ) |
| 507 | + .unwrap(); |
| 508 | + |
| 509 | + let token_source = arg_matches |
| 510 | + .try_get_one::<SignerSource>("program_id")? |
491 | 511 | .unwrap();
|
| 512 | + let token = pubkey_from_source(arg_matches, token_source, "token", &mut wallet_manager) |
| 513 | + .unwrap(); |
| 514 | + |
492 | 515 | let transfer_hook_accounts = arg_matches
|
493 | 516 | .get_many::<Vec<ExtraAccountMeta>>("transfer_hook_accounts")
|
494 | 517 | .unwrap_or_default()
|
|
0 commit comments