Last active
January 21, 2021 05:41
-
-
Save mattlockyer/d092ef8764ed94b713d59954d98aecb1 to your computer and use it in GitHub Desktop.
Signing Messages with near-cli
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// set the network (if you want mainnet) | |
export NEAR_ENV=mainnet | |
// choose 1 or 2 | |
// 1. NEAR wallet login | |
near login | |
// 2. LEDGER replace ACCOUNT_ID | |
// change useLedgerKey value if you are using custom ledger path | |
near repl --accountId="ACCOUNT_ID" --useLedgerKey="44'/397'/0'/0'/1'" | |
// REPL | |
// you should now see > in front of your commands, you are in repl, use ctrl-c twice to exit | |
// SIGNING A MESSAGE | |
// replace MESSAGE | |
// copy and paste into repl, hit enter | |
console.log('\n\nSignature:\n\n' + Buffer.from((await this.account.signTransaction('MESSAGE', []))[1].signature.data).toString('base64') + '\n\n') | |
// copy signature | |
//ctrl-c twice to exit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment