Skip to content

Commit 9c2052a

Browse files
committed
add new WHALESHARES ws/http connectors
1 parent 5611efa commit 9c2052a

File tree

3 files changed

+50
-3
lines changed

3 files changed

+50
-3
lines changed

Connectors/ConnectorInterface.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55

66
interface ConnectorInterface
77
{
8-
const PLATFORM_VIZ = 'viz';
9-
const PLATFORM_GOLOS = 'golos';
10-
const PLATFORM_STEEMIT = 'steemit';
8+
const PLATFORM_GOLOS = 'golos';
9+
const PLATFORM_STEEMIT = 'steemit';
10+
const PLATFORM_VIZ = 'viz';
11+
const PLATFORM_WHALESHARES = 'whaleshares';
1112

1213
const ANSWER_FORMAT_ARRAY = 'array';
1314
const ANSWER_FORMAT_OBJECT = 'object';
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
namespace GrapheneNodeClient\Connectors\Http;
4+
5+
6+
7+
class WhalesharesHttpJsonRpcConnector extends HttpJsonRpcConnectorAbstract
8+
{
9+
/**
10+
* @var string
11+
*/
12+
protected $platform = self::PLATFORM_WHALESHARES;
13+
14+
/**
15+
* https or http server
16+
*
17+
* if you set several nodes urls, if with first node will be trouble
18+
* it will connect after $maxNumberOfTriesToCallApi tries to next node
19+
*
20+
* @var string
21+
*/
22+
protected static $nodeURL = ['https://rpc.wls.services'];
23+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
namespace GrapheneNodeClient\Connectors\WebSocket;
4+
5+
6+
class WhalesharesWSConnector extends WSConnectorAbstract
7+
{
8+
/**
9+
* @var string
10+
*/
11+
protected $platform = self::PLATFORM_GOLOS;
12+
13+
/**
14+
* wss or ws server
15+
*
16+
* @var string
17+
*/
18+
protected static $nodeURL = [
19+
'wss://whaleshares.io/ws',
20+
'ws://188.166.99.136:8090',
21+
'ws://rpc.kennybll.com:8090'
22+
];
23+
}

0 commit comments

Comments
 (0)