Skip to content

Instantly share code, notes, and snippets.

@david-dacruz
david-dacruz / SVS.js
Created January 21, 2024 20:08 — forked from fsjuhl/SVS.js
const blockhash = "0x5cb3e33c31019c9e5f77f354f150e4d74eb95a029a69738d45c176bc1447e444"
const fs = require("fs").promises
const seedrandom = require("seedrandom")
const chooser = require("random-seed-weighted-chooser").default
const SparkMD5 = require("spark-md5")
const random = seedrandom(blockhash)
const uniques = [{
@david-dacruz
david-dacruz / createWallet.js
Created December 11, 2023 14:57
Dogecoin create wallet from seed phrase
const bip39 = require('bip39');
const bitcoin = require('bitcoinjs-lib');
const ecc = require('tiny-secp256k1');
const {BIP32Factory} = require('bip32');
const bip32 = BIP32Factory(ecc);
const strength = 128; // Strength in bits, 128 bits results in a 12-word phrase
const mnemonic = bip39.generateMnemonic(strength);
console.log('Seed Phrase:', mnemonic);
@david-dacruz
david-dacruz / walletCreate.js
Created December 11, 2023 13:58
walletCreate
const { PrivateKey } = dogecore;
/*------------- create a new wallet -----------*/
function walletCreate() {
// @ts-ignore
const privateKey = new PrivateKey();
const privkey = privateKey.toWIF();
const address = privateKey.toAddress().toString();
const json = { privkey, address, utxos: [] };
console.log({ json });
@david-dacruz
david-dacruz / create-wallet.js
Created December 11, 2023 13:49
DRC20 wallet creation
import { hostname } from 'os'
import { WALLET_PATH, Wallets } from './wallets.js'
export const create = (app) => app.command('walletcreate')
.description('Create one or more new wallet')
.option('-c, --count <count>', 'amount of wallet to create')
.option('-p, --prefix <prefix>', 'prefix to use whenever naming wallets', hostname())
.action(async ({ count, prefix }) => {
if (count === undefined) {
console.error('You must define a number of wallet to generate: eg --count=10')
/*
Requires to have eslint and eslint-plugin vue installed locally.
(npm i -g eslint eslint-plugin-vue)
https://vuejs.github.io/eslint-plugin-vue/rules/
Put this in a ".eslintrc.json" at the root of the repository.
You can also put in in your $HOME.
*/