Skip to content

Instantly share code, notes, and snippets.

View GEEGABYTE1's full-sized avatar

Jaival Patel GEEGABYTE1

View GitHub Profile
@GEEGABYTE1
GEEGABYTE1 / beta.py
Created November 13, 2021 00:30
Sample Basic Mining Function
import hashlib
import random
nonce_limit = 1000000000
zeroes = random.randint(1, 100)
def mine(block_num, transaction_hash, previous_hash):
for nonce in range(nonce_limit):
base_text = str(block_num) + transaction_hash + previous_hash + str(nonce)
@GEEGABYTE1
GEEGABYTE1 / index.js
Created June 1, 2023 04:44
Checking Total Balance Sample Alg
// fetch all tokens
async function checkBal() {
var token_dict = {}
console.log("In function")
const address = desiredWallet; // holder address needs to change
// Get token balances
const balances = await alchemy.core.getTokenBalances(address);
console.log(balances)
@GEEGABYTE1
GEEGABYTE1 / index.js
Created June 1, 2023 04:50
Transaction History Alg
// fetching transaction history
const data = await alchemy.core.getAssetTransfers({
fromBlock:"0x0",
fromAddress: desiredWallet,
category: ["external", "internal", "erc20", "erc721", "erc1155"],
})
// alg 1
var account_sender_count = {}
for (let i =0; i<= transfers.length; i++) {
const cur_transfer_dict = transfers[i]
@GEEGABYTE1
GEEGABYTE1 / index.js
Created June 1, 2023 04:52
Transaction History Length Alg
const data = await alchemy.core.getAssetTransfers({ // fetch Transaction Data
fromBlock:"0x0",
fromAddress: desiredWallet,
category: ["external", "internal", "erc20", "erc721", "erc1155"],
})
const transfers = data['transfers']
const bool_array = []
if (transfers.length > 5) {
bool_array.push(true)