Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Class 'BitWasp\Bitcoin\Address\AddressFactory' not found #907

Open
masumetc opened this issue May 6, 2023 · 1 comment
Open

Class 'BitWasp\Bitcoin\Address\AddressFactory' not found #907

masumetc opened this issue May 6, 2023 · 1 comment

Comments

@masumetc
Copy link

masumetc commented May 6, 2023

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());
}

}`

@viraladmin
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants