Created
December 23, 2020 15:55
-
-
Save cgcardona/437918563af256a21594d2c7db75fbf8 to your computer and use it in GitHub Desktop.
This file contains 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
import { BinTools, Buffer } from "avalanche" | |
const bintools: BinTools = BinTools.getInstance() | |
const main = async (): Promise<any> => { | |
// hex private key exported from metamask | |
let hexPrivKey: string = "461109a6ffdd39be8eb7b763cb52b9cd7190c6e88ad35b7421dfb6f859ead495" | |
let buf: Buffer = Buffer.from(hexPrivKey, 'hex') | |
let encoded: string = `PrivateKey-${bintools.cb58Encode(buf)}` | |
console.log(encoded) | |
// cb58 encoded private key to import into our web wallet | |
// PrivateKey-XrkrRUWpsQ2ctH4D73vghLV1eSGnfp2CdspvvuBxQbHLzJttf | |
} | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment