Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 7104fc3

Browse files
committedJul 24, 2024
cli: add solana token-athority command
1 parent bce7c24 commit 7104fc3

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
 

‎cli/src/index.ts

+13
Original file line numberDiff line numberDiff line change
@@ -715,6 +715,19 @@ yargs(hideBin(process.argv))
715715
const keypair = Keypair.fromSecretKey(new Uint8Array(JSON.parse(fs.readFileSync(argv["keypair"]).toString())));
716716
console.log(encoding.b58.encode(keypair.secretKey));
717717
})
718+
.command("token-authority <programId>",
719+
"print the token authority address for a given program ID",
720+
(yargs) => yargs
721+
.positional("programId", {
722+
describe: "Program ID",
723+
type: "string",
724+
demandOption: true,
725+
}),
726+
(argv) => {
727+
const programId = new PublicKey(argv["programId"]);
728+
const tokenAuthority = NTT.pdas(programId).tokenAuthority();
729+
console.log(tokenAuthority.toBase58());
730+
})
718731
.demandCommand()
719732
}
720733
)

0 commit comments

Comments
 (0)
Please sign in to comment.