bitcoin-php
bitcoin-php copied to clipboard
Class 'BitWasp\Bitcoin\Address\AddressFactory' not found
Every time getting this error how can i solve ? `<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request; use BitWasp\Bitcoin\Crypto\Random\Random; use BitWasp\Bitcoin\Key\Factory\PrivateKeyFactory;
use BitWasp\Bitcoin\Address\AddressFactory; use BitWasp\Bitcoin\Address\PayToPubKeyHashAddress;
class CheckController extends Controller { public function check(){ $random = new Random();
$privateKeyFactory = new PrivateKeyFactory();
$privateKey = $privateKeyFactory->generateCompressed($random);
$privateKeyWif = $privateKey->toWif();
$addressFactory = new AddressFactory();
$publicKey = $privateKey->getPublicKey();
$address = new PayToPubKeyHashAddress($publicKey->getPubKeyHash());
return $usdtAddress = $addressFactory->fromString($address->getAddress());
}
}`
I mean... I would bet... you can solve that error... by not using code that has been long since expired. Looks like something chatGPT made.
use BitWasp\Bitcoin\Address\AddressFactory;
Doesn't work as there is no AddressFactory that I can tell. Looks like all references to it were removed a long time ago now.