index.js (355B)
1 #!/usr/bin/env node 2 3 const {signDelegationToken} = require('nostr') 4 5 function usage() { 6 console.log("usage: nostr-delegation-signer <sec-key> <delegation_token>") 7 process.exit(0) 8 } 9 10 const args = process.argv.slice(2) 11 if (args.length !== 2) 12 usage() 13 14 const [privkey, token] = args 15 16 signDelegationToken(privkey, token).then(sig => { 17 console.log(sig) 18 });