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
-- rename the old enum | |
ALTER TYPE country_code RENAME TO country_code__; | |
-- create the new enum with the old name | |
CREATE TYPE country_code AS ENUM ('DE', 'AT', 'NL', 'CH'); | |
-- ALTER all you enum columns | |
ALTER TABLE user_address | |
ALTER COLUMN country DROP DEFAULT; | |
ALTER TABLE user_address |
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
function toWIF(privkey, network) { | |
const netPriv = new Buffer([network.privatekey]).toString('hex'); | |
let res = `${netPriv}${privkey}` | |
let chk = crypto.createHash('sha256').update(res, 'hex').digest() | |
chk = crypto.createHash('sha256').update(chk).digest() | |
const cheksum = chk.slice(0, 4).toString('hex') | |
res = `${netPriv}${privkey}${cheksum}` | |
const bs58 = require('base-x')('123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz') |