README.md
This commit is contained in:
parent
a9c06ee2ff
commit
6a6acc91eb
26
README.md
26
README.md
@ -49,10 +49,8 @@ $web3->clientVersion(function ($err, $version) {
|
|||||||
// do something
|
// do something
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (isset($client->result)) {
|
if (isset($client)) {
|
||||||
echo 'Client version: ' . $version->result;
|
echo 'Client version: ' . $version;
|
||||||
} else {
|
|
||||||
// do something rpc error
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
@ -92,7 +90,6 @@ $net = new Net('http://localhost:8545');
|
|||||||
### Batch
|
### Batch
|
||||||
|
|
||||||
web3
|
web3
|
||||||
|
|
||||||
```
|
```
|
||||||
$web3->batch(true);
|
$web3->batch(true);
|
||||||
$web3->clientVersion();
|
$web3->clientVersion();
|
||||||
@ -100,6 +97,9 @@ $web3->hash('0x1234');
|
|||||||
$web3->execute(function ($err, $data) {
|
$web3->execute(function ($err, $data) {
|
||||||
if ($err !== null) {
|
if ($err !== null) {
|
||||||
// do something
|
// do something
|
||||||
|
// it may throw exception or array of exception depends on error type
|
||||||
|
// connection error: throw exception
|
||||||
|
// json rpc error: array of exception
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// do something
|
// do something
|
||||||
@ -123,7 +123,6 @@ $eth->provider->execute(function ($err, $data) {
|
|||||||
```
|
```
|
||||||
|
|
||||||
net
|
net
|
||||||
|
|
||||||
```
|
```
|
||||||
$net->batch(true);
|
$net->batch(true);
|
||||||
$net->version();
|
$net->version();
|
||||||
@ -138,6 +137,21 @@ $net->provider->execute(function ($err, $data) {
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
personal
|
||||||
|
```
|
||||||
|
$personal->batch(true);
|
||||||
|
$personal->listAccounts();
|
||||||
|
$personal->newAccount('123456');
|
||||||
|
|
||||||
|
$personal->provider->execute(function ($err, $data) {
|
||||||
|
if ($err !== null) {
|
||||||
|
// do something
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// do something
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
### Contract
|
### Contract
|
||||||
|
|
||||||
```
|
```
|
||||||
|
Loading…
Reference in New Issue
Block a user