Skip to content
This repository has been archived by the owner on Nov 14, 2022. It is now read-only.

Commit

Permalink
fix #16
Browse files Browse the repository at this point in the history
  • Loading branch information
xboston committed Jul 8, 2019
1 parent aaff7b7 commit 1406808
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ use Metahash\MetaHash;
use Metahash\MetaHashCrypto;

$metaHash = new MetaHash();
$metaHash->setNetwork('main');

$balance = $metaHash->fetchBalance('0x00fa2a5279f8f0fd2f0f9d3280ad70403f01f9d62f52373833');
print_r($balance);
```
Expand Down
1 change: 0 additions & 1 deletion examples/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
// !!! very bad
if (isset($_GET['address'])) {
$crypto = new MetaHash();
$crypto->setNetwork('main');
$balance = \json_encode($crypto->fetchBalance($_GET['address']), JSON_PRETTY_PRINT);
} else {
$balance = false;
Expand Down
1 change: 0 additions & 1 deletion examples/wallets.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use Metahash\MetaHash;

$crypto = new MetaHash();
$crypto->setNetwork('main');

$wallets = [
'0x00fa2a5279f8f0fd2f0f9d3280ad70403f01f9d62f52373833' => 'MetaWat.ch',
Expand Down
8 changes: 7 additions & 1 deletion src/MetaHash.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ class MetaHash
public const NODE_PROXY = 'PROXY';
public const NODE_TORRENT = 'TORRENT';

public const NETWORK_MAIN = 'main';
public const NETWORK_TEST = 'test';
public const NETWORK_DEV = 'dev';

/**
* @var string
*/
Expand Down Expand Up @@ -63,7 +67,9 @@ public function __construct()
'connect_timeout' => self::CONNECT_TIMEOUT,
'debug' => self::DEBUG,
];
$this->client = new GuzzleClient($guzzleOptions);
$this->setClient(new GuzzleClient($guzzleOptions));

$this->setNetwork(self::NETWORK_MAIN);
}

/**
Expand Down

0 comments on commit 1406808

Please sign in to comment.