Skip to content

Commit 6def3bf

Browse files
committed
cli: add solana token-athority command
1 parent b667f12 commit 6def3bf

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)