const { getEtherBalances, getTokenBalances } = require("@mycrypto/eth-scan");
getEtherBalances('http://35.220.203.194:8545',
This post links my 3Box profile to my Github account! Web3 social profiles by 3Box. | |
✅ did:3:bafyreihpzmkt3a5e6duwxqd4cqvtux6b4737m7a5b45cd7obvp735axnqy ✅ | |
Create your profile today to start building social connection and trust online at https://3Box.io/ |
const fromSlpAddress = 'simpleledger:q... put your wallet SLP address here ...' | |
const fromWIF = 'K... put your wallet private key here ...' | |
const childNFT = { | |
group: '--- put your group TXID here', | |
name: 'Some NFT Token Name', | |
ticker: 'NFT.FROG', | |
uri: 'Qm... put your Pinata hash here' | |
} |
const waifuPrefix = 'https://icons.waifufaucet.com/original/'; | |
const ipfsPrefix = 'https://ipfs.io/ipfs/'; | |
if (token.symbol.toLowerCase() === 'waifu') | |
return `${waifuPrefix}${token.id}.png`; | |
if (token.uri && token.uri.startsWith('Qm')) | |
return `${ipfsPrefix}${token.uri}`; |
diff --git a/lib/tokens.js b/lib/tokens.js | |
index 1a76a8a..6fd3fc1 100644 | |
--- a/lib/tokens.js | |
+++ b/lib/tokens.js | |
@@ -61,7 +61,7 @@ class Tokens { | |
utxos.forEach(utxo => { | |
// Skip if this is not a valid token UTXO. | |
- if (!utxo.isValid) return | |
+ if (!utxo.isValid || utxo.utxoType !== 'token') return |
const axios = require('axios'); | |
const slpdbUri = 'https://slpdb.fountainhead.cash/q/'; | |
const btoa = function (str) { | |
return Buffer.from(str).toString('base64'); | |
}; | |
const slpList = [ | |
'simpleledger:qrr7ye5gtemkn6stvnfhh762g234tc4c2sqhruyr2f', | |
'simpleledger:qrt9q69sypxxaypugxptaaz57l4gnq0x4yvl0ns0f2', |
const fromSlpAddress = 'simpleledger:--wallet address here---' | |
const fromWIF = 'Kw--wallet-WIF-here---' | |
const tokenAmount = 1000 | |
async function genGroupNFT (from, fromWif, amount) { | |
try { | |
// const balances = await bchdNetwork.getAllSlpBalancesAndUtxos(fromBchAddress) | |
const balances = await bchdNetwork.getAllSlpBalancesAndUtxos(from) | |
console.log(`balances: ${JSON.stringify(balances, null, 2)}`) | |
console.log("BCH balance:", balances.satoshis_available_bch) |
const currentAddress = 'simpleledger: ....' | |
const to = 'simpleledger:....' | |
const balances = await bchdNetwork.getAllSlpBalancesAndUtxos(currentAddress) | |
const bchBalances = balances.nonSlpUtxos | |
let bchUtxos = [] | |
bchBalances.forEach((j) => j.wif = wifs[currentAddress]) | |
bchBalances.forEach((txo) => bchUtxos.push(txo)) |
const fromBchAddress = 'bitcoincash:qzkrtx54agr74kxduuz3me4a2p2v7z74psgg9lkl5q'
const bitbox = new BITBOX()
const client = new GrpcClient({url: 'bchd.ny1.simpleledger.io' })
const validator = new slpjs.BchdValidator(client, console)
const bchdNetwork = new slpjs.BchdNetwork({ BITBOX: bitbox, client, validator })
async function genGroupNFT (from, fromWif) {