Skip to content

Instantly share code, notes, and snippets.

@doingthisalright
doingthisalright / PrivateKeyStringToFile.py
Created May 16, 2022 02:11
Convert String Private Keys exported from wallets like Phantom to File Based Private Key
# Taken from https://stackoverflow.com/a/69256259
# Usage: python3 PrivateKeyStringToFile.py <String Private Key>
import base58
import sys
byte_array = base58.b58decode(sys.argv[1])
json_string = "[" + ",".join(map(lambda b: str(b), byte_array)) + "]"
print(json_string)
@doingthisalright
doingthisalright / GenerateNftConfigFiles.js
Created May 17, 2022 22:57
Metaplex: Generate NFT Configuration files
// Usage `node GenerateNftConfigFiles.js`
const fs = require('fs')
const totalNFTSize = 10000;
for (let index = 0; index < totalNFTSize; index++) {
const content = {
"name": `<NAME>`,
"symbol": `<SYM>`,
# Reference for the video: https://youtu.be/asnupAj-IJg
# Create Keypair
solana-keygen new --outfile ~/live/payer.json
# Set Keypair
solana config set --keypair ~/live/payer.json
# Set Network to devnet
solana config set --url https://metaplex.devnet.rpcpool.com
# Verify installation of dependencies
git version
node --version
yarn --version
ts-node --version
solana --version
spl-token --version
# Create and fund wallet
solana-keygen new --outfile ./wallet/solana/devnet.json
@doingthisalright
doingthisalright / MintWithReveal.sh
Created June 8, 2022 10:46
Mint with Reveal: Commands used in the video: https://youtu.be/K2ykv9IffdA
# Reference for the video: https://youtu.be/K2ykv9IffdA
## Create wallets
# BkuPyM8HV8Ea1RhwpydEjJ2YKMjXA81KxKME2AVXaCRW
solana-keygen new --outfile ~/KeyStrokes/nft/wallets/Payer.json
# CQdR5xa2u85GiBpt9hBMrcHN9Z6Jf6QNN1jjaAg7TPBu
solana-keygen new --outfile ~/KeyStrokes/nft/wallets/Minter.json
@doingthisalright
doingthisalright / commands.sh
Created July 13, 2022 09:29
Windows Edition! Launch Solana NFT Collection using Metaplex Candy Machine v2 - Commands used in the video: https://youtu.be/ZSgXg5eimus
# Verify that the required tools are installed
git version
node --version
yarn --version
ts-node --version
solana --version
# Setup Metaplex
git clone https://github.com/metaplex-foundation/metaplex.git ./metaplex
yarn install --cwd ./metaplex/js/
@doingthisalright
doingthisalright / commands.sh
Created July 30, 2022 11:49
Using Sugar to Create Solana NFT with Metaplex Candy Machine - Commands used in the video: https://youtu.be/h37srt7Pm_s
### Setup Sugar
bash <(curl -sSf https://sugar.metaplex.com/install.sh)
sugar --version
### Setup wallets
# Setup Solana Tool Suite
sh -c "$(curl -sSfL https://release.solana.com/v1.10.32/install)"
solana --version
@doingthisalright
doingthisalright / NFTLaunchUsingCM3.sh
Created November 28, 2022 09:24
Create Solana NFT Collection using Candy Machine V3: Commands used in the video: https://youtu.be/0KHv1dMV8zU
# Launching NFT Collection using Candy Machine V3
# https://youtu.be/0KHv1dMV8zU
# Setup Solana Tool Suite
solana --version
solana-keygen --version
# Setup Sugar alpha version
chmod 755 sugarCM3
./sugarCM3 --version
@doingthisalright
doingthisalright / config.json
Created December 10, 2022 11:15
Create Solana NFT Collection using Candy Machine V3: Config file for the video: https://youtu.be/0KHv1dMV8zU
{
"number": 10,
"symbol": "NB",
"sellerFeeBasisPoints": 500,
"isMutable": true,
"isSequential": false,
"creators": [
{
"address": "3icSnuo5kFS7BE5HPXLMrz1x1duK7bt69PJ4vvg2LDV9",
"share": 100
@doingthisalright
doingthisalright / TotalSquaresInRectangles.js
Created December 13, 2022 12:08
Total Number of all sized Squares in a Rectangle of size X x Y
function getTotalSquares(x, y) {
let total = 0;
for (let loop = 0; loop < Math.min(x, y); loop++) {
total += ((x-loop) * (y-loop));
}
return total;
}
console.log(getTotalSquares(4, 11));