Skip to content

Instantly share code, notes, and snippets.

View drewhaines's full-sized avatar

Drew Haines drewhaines

View GitHub Profile
@drewhaines
drewhaines / get-keys-from-bech32.js
Created February 5, 2022 19:44
This is a Node.js script to convert a bech32 Bip32PrivateKey into the cborHex values required by cardanocli-js. Note the types must be set correctly for the corresponding keys (PaymentExtendedSigningKeyShelley_ed25519_bip32 vs PaymentVerificationKeyShelley_ed25519)
var S = require("@emurgo/cardano-serialization-lib-nodejs")
require("dotenv").config()
var cbor = require("cbor")
walletKey = process.env.TEST_WALLET_KEY
// example
// xprv1jrxh123412341234123412341234123412341234123412341234123412341234123412341234123412341234123412341234123412341234123412341234123412341234123412341234123412342kzx
function harden(num) {
return 0x80000000 + num
@drewhaines
drewhaines / download-assets.js
Created January 1, 2022 00:17
Download all CNFT images from an NFT Collection via Node.js
import { BlockFrostAPI } from "@blockfrost/blockfrost-js"
import download from "download"
const API = new BlockFrostAPI({
projectId: "YOUR_BLOCKFROST_API_KEY", // see: https://blockfrost.io
})
try {
const assets = await API.assetsPolicyByIdAll(
"POLICY_ID"
@drewhaines
drewhaines / send-assets.js
Created December 2, 2021 20:22
Send multiple assets (NFTs) via cardanocli-js
// send multiple assets at once
// ************ run me once ************
const CardanocliJs = require("/Users/drewhaines/sites/cardanocli-js/index")
const socketPath =
"/Users/drewhaines/Library/Application Support/Daedalus Mainnet/cardano-node.socket"
const testnet_socketPath =
"/Users/drewhaines/Library/Application Support/Daedalus Testnet/cardano-node.socket"
const shelleyGenesisPath =
@drewhaines
drewhaines / boxstarter-windows-dev.txt
Last active July 11, 2017 21:28
boxstarter-windows-dev
# As described here: http://boxstarter.org/Learn/WebLauncher
# The command to run, built from the RAW link of this gist
# START http://boxstarter.org/package/url?https://gist.githubusercontent.com/bgriswold/c0353b081173f5a9648ad32f96533db1/raw/
# Windows configuration. See http://boxstarter.org/WinConfig
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions -EnableShowFullPathInTitleBar
Enable-RemoteDesktop
Install-WindowsUpdate -AcceptEula
Enable-MicrosoftUpdate