Questions tagged [web3php]

Web3 PHP is a PHP 8+ API for interacting with Ethereum RPCs. Use this tag for questions about using the Web3 PHP API.

Web3 PHP is a PHP 8+ API for interacting with Ethereum RPCs.

See the GitHub Repo here: https://github.com/web3-php/web3

13 questions
3
votes
2 answers

Verifying Ethereum (Web3) signed message in PHP

How can i verify Ethereum signed messase with PHP? Message is signed using web3.personal.sign function in Web3.js and signature is then sent to server. How can I verify it with PHP? Are there some pre-built packages (on Packagist) or I should do…
Filip Š
  • 746
  • 2
  • 13
  • 22
2
votes
1 answer

trying to store data on external ipfs node via http api , ipfs.infura.io refusing my connection

I'm trying to store data to ipfs via PHP, I use curl to communicate with API , it works fine on my local node, but I want to use an external node from infura.io but for some reason, ipfs.infura.io is refusing my connection via php even a simple…
hretic
  • 999
  • 9
  • 36
  • 78
1
vote
0 answers

Get past transactions on a contract using web3.php

I am using web3.php script and need to get minted NFT IDs from a contract. Solution I think about is to read past contract "transfer" events and get tokenId from its data. but couldn't find any manual on how to do this with WEB3 PHP or if there is…
mhmd
  • 995
  • 2
  • 15
  • 30
1
vote
0 answers

PHP get estimate GAS using web3 php

I have been stuck for a couple of days while sending money using web3 PHP. Everything is working fine, and others are getting transferred to address successfully. But I am having some issues while getting the estimated GAS. I can get the gas price…
1
vote
1 answer

PHP array in callback smart contract web3.php

I try to read out a smart contract with web3.php, which works fine now, but I always only can read out a function, that returns a single value. When I call a function that returns for example a uint8 array, then I cannot call the elements of the…
HansPeterLoft
  • 489
  • 1
  • 9
  • 28
0
votes
0 answers

web3.php logs event returns null, how to fix this?

I am using Laravel with web3.php library https://github.com/web3p/web3.php my code is $web3 = new Web3('https://data-seed-prebsc-1-s1.binance.org:8545/'); $filter = $web3->eth->getLogs([ 'address' =>…
Wraith
  • 504
  • 6
  • 28
0
votes
1 answer

WEB3.PHP Contract Call

I am using this PHP library https://github.com/web3p/web3.php to make the requests to smart contracts on BSC. $web3 = new Web3('https://bsc-dataseed.binance.org'); $contract = new Contract($web3->provider,…
GPaul
  • 35
  • 6
0
votes
0 answers

e is not a constructor - WalletConnectProvider model not working

Metamask is working perfectly. BinanceChainWallet is working perfectly. WalletConnect provider (model: QR - desktop/mobile wallet support), not working when I click on Wallet-Connect model on the front-end it give me this error only. Platform…
AMHF
  • 19
  • 2
0
votes
0 answers

PHP web3 ERC20 token function call

I have a Smart Contract that represent ERC20 token. I already deployed the smart contract on Binance Testnet using HardHat. I have a deployed Smart Contract address as well. I have integrated Web3 library in PHP laravel project using following…
Jay Vyas
  • 2,674
  • 5
  • 27
  • 58
0
votes
1 answer

Connect web3 php to ropsten test network

I successfully connect ganache blockchain to web3 php, this is some source code in laravel controller : public function DecetralizeID(){ $contractABI = //[{*some abi*}] $contract = new Contract('http://127.0.0.1:7545/',…
0
votes
1 answer

How to get completed, failed, pending status after erc20token transfer

I have a function in node.js to transfer erc20tokens using api like this: app.post('/sendtokens', async(req, res) =>{ console.log(req.body) let privateKey = req.body.privateKey; let receiverPublicKey = req.body.receiverPublicKey; let…
Muhammad Noman
  • 155
  • 1
  • 5
  • 12
0
votes
0 answers

First parameter must either be an object or the name of an existing class on Web3 on PHP

I am creating an ERC Token selling website. When a user signs up on the website, there should be generated an eth wallet automatically for that user and to store in db. After that when ever the user purchase coins from our website, the coin amount…
Muhammad Noman
  • 155
  • 1
  • 5
  • 12
0
votes
1 answer

(MAC) PHP Fatal error: Uncaught Error: Class 'Web3\Web3' not found

I'm new to PHP, and I was trying to run $exampleBase.php from web3.php on mac but it keeps showing error : PHP Fatal error: Uncaught Error: Class 'Web3\Web3' not found in /Users/hsnl/Desktop/code/back-end-php/web3.php/examples/exampleBase.php:7 …
李孟儒
  • 1
  • 1