Skip to content

Commit

Permalink
infura network;
Browse files Browse the repository at this point in the history
  • Loading branch information
nanqi committed Jun 10, 2021
1 parent 803f36e commit 926a69e
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/InfuraApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,19 @@ function ethBalance(string $address, int $decimals = 18)
return Utils::toDisplayAmount($balance, $decimals);
}

function receiptStatus(string $txHash): bool
function receiptStatus(string $txHash): ?bool
{
// TODO: Implement receiptStatus() method.
$res = $this->send('eth_getTransactionByHash', ['txhash' => $txHash]);
if (!$res) {
return false;
}

if (!$res['blockNumber']) {
return null;
}

$res = $this->getTransactionReceipt($txHash);
return $res['status'] === '0x1';
}

function sendRawTransaction($raw)
Expand Down

0 comments on commit 926a69e

Please sign in to comment.