Search
Preparing search index...
The search index is not available
Harmony_SDK_Doc
Options
All
Public
Public/Protected
All
Inherited
Externals
Only exported
Menu
Globals
harmony-network
WSProvider
Class WSProvider
Hierarchy
BaseSocket
WSProvider
SubscriptionMethod
Index
Constructors
constructor
Properties
connection
emitter
handlers
json
Rpc
options
req
Middleware
res
Middleware
subscriptions
url
Accessors
connected
Methods
add
Event
Listener
clear
Subscriptions
create
Websocket
Provider
get
Middleware
get
Subscription
Event
has
Subscription
is
Connecting
on
on
Close
on
Connect
on
Data
on
Error
on
Message
on
Ready
once
push
Middleware
reconnect
register
Event
Listeners
remove
All
Socket
Listeners
remove
Event
Listener
reset
reset
Handlers
send
subscribe
unsubscribe
validate
Object literals
middlewares
Constructors
constructor
new WSProvider
(
url
:
string
, options
?:
any
)
:
WSProvider
Parameters
url:
string
Default value
options:
any
= {}
Returns
WSProvider
Properties
connection
connection
:
W3CWebsocket
|
WebSocket
emitter
emitter
:
mitt.Emitter
handlers
handlers
:
any
json
Rpc
json
Rpc
:
JsonRpc
options
options
:
any
Protected
req
Middleware
req
Middleware
:
ReqMiddleware
= new Map().set('*', [])
Protected
res
Middleware
res
Middleware
:
ResMiddleware
= new Map().set('*', [])
subscriptions
subscriptions
:
any
url
url
:
string
Accessors
connected
get
connected
(
)
:
boolean
Returns
boolean
Methods
add
Event
Listener
add
Event
Listener
(
type
:
string
, handler
:
mitt.Handler
)
:
void
Parameters
type:
string
handler:
mitt.Handler
Returns
void
clear
Subscriptions
clear
Subscriptions
(
unsubscribeMethod
:
string
)
:
Promise
<
boolean
>
Parameters
unsubscribeMethod:
string
Returns
Promise
<
boolean
>
create
Websocket
Provider
create
Websocket
Provider
(
url
:
string
, options
?:
any
)
:
w3cwebsocket
|
WebSocket
Parameters
url:
string
Default value
options:
any
= {}
Returns
w3cwebsocket
|
WebSocket
Protected
get
Middleware
get
Middleware
(
method
:
RPCMethod
|
string
)
:
[
ReqMiddleware
[]
,
ResMiddleware
[]
]
Parameters
method:
RPCMethod
|
string
Returns
[
ReqMiddleware
[]
,
ResMiddleware
[]
]
get
Subscription
Event
get
Subscription
Event
(
subscriptionId
:
any
)
:
any
Parameters
subscriptionId:
any
Returns
any
has
Subscription
has
Subscription
(
subscriptionId
:
string
)
:
boolean
Parameters
subscriptionId:
string
Returns
boolean
is
Connecting
is
Connecting
(
)
:
boolean
Returns
boolean
on
on
(
type
:
string
, handler
:
mitt.Handler
)
:
this
Parameters
type:
string
handler:
mitt.Handler
Returns
this
on
Close
on
Close
(
closeEvent
:
any
)
:
void
Parameters
closeEvent:
any
Returns
void
on
Connect
on
Connect
(
)
:
Promise
<
void
>
Returns
Promise
<
void
>
on
Data
on
Data
(
handler
:
any
)
:
this
Parameters
handler:
any
Returns
this
on
Error
on
Error
(
event
:
any
)
:
void
Parameters
event:
any
Returns
void
on
Message
on
Message
(
msg
:
MessageEvent
)
:
void
Parameters
msg:
MessageEvent
Returns
void
on
Ready
on
Ready
(
event
:
any
)
:
void
Parameters
event:
any
Returns
void
once
once
(
type
:
string
, handler
:
mitt.Handler
)
:
void
Parameters
type:
string
handler:
mitt.Handler
Returns
void
Protected
push
Middleware
push
Middleware
(
fn
:
any
, type
:
MiddlewareType
, match
:
string
|
RPCMethod
|
RegExp
)
:
void
Parameters
fn:
any
type:
MiddlewareType
match:
string
|
RPCMethod
|
RegExp
Returns
void
reconnect
reconnect
(
)
:
void
Returns
void
register
Event
Listeners
register
Event
Listeners
(
)
:
void
Returns
void
remove
All
Socket
Listeners
remove
All
Socket
Listeners
(
)
:
void
Returns
void
remove
Event
Listener
remove
Event
Listener
(
type
?:
string
, handler
?:
mitt.Handler
)
:
any
Parameters
Optional
type:
string
Optional
handler:
mitt.Handler
Returns
any
reset
reset
(
)
:
void
Returns
void
reset
Handlers
reset
Handlers
(
)
:
void
Returns
void
send
send
(
payload
:
RPCRequestPayload
<
object
>
)
:
Promise
<
any
>
Parameters
payload:
RPCRequestPayload
<
object
>
Returns
Promise
<
any
>
subscribe
subscribe
(
payload
:
RPCRequestPayload
<
any
[]
>
)
:
Promise
<
any
>
Parameters
payload:
RPCRequestPayload
<
any
[]
>
Returns
Promise
<
any
>
unsubscribe
unsubscribe
(
payload
:
RPCRequestPayload
<
any
[]
>
)
:
Promise
<
any
>
Parameters
payload:
RPCRequestPayload
<
any
[]
>
Returns
Promise
<
any
>
validate
validate
(
response
:
any
, payload
?:
any
)
:
true
|
Error
Parameters
response:
any
Optional
payload:
any
Returns
true
|
Error
Object literals
middlewares
middlewares
:
object
request
request
:
object
use
use
(
fn
:
ReqMiddleware
, match
?:
string
|
RPCMethod
|
RegExp
)
:
void
Parameters
fn:
ReqMiddleware
Default value
match:
string
|
RPCMethod
|
RegExp
= "*"
Returns
void
response
response
:
object
use
use
(
fn
:
ResMiddleware
, match
?:
string
|
RPCMethod
|
RegExp
)
:
void
Parameters
fn:
ResMiddleware
Default value
match:
string
|
RPCMethod
|
RegExp
= "*"
Returns
void
Globals
harmony-
account
harmony-
contract
harmony-
core
harmony-
crypto
harmony-
network
harmony-
staking
harmony-
transaction
harmony-
utils
Provider
Type
Emitter
Http
Provider
Log
Sub
Messenger
New
Headers
New
Pending
Transactions
Provider
Subscription
Method
WSProvider
constructor
connection
emitter
handlers
json
Rpc
options
req
Middleware
res
Middleware
subscriptions
url
connected
add
Event
Listener
clear
Subscriptions
create
Websocket
Provider
get
Middleware
get
Subscription
Event
has
Subscription
is
Connecting
on
on
Close
on
Connect
on
Data
on
Error
on
Message
on
Ready
once
push
Middleware
reconnect
register
Event
Listeners
remove
All
Socket
Listeners
remove
Event
Listener
reset
reset
Handlers
send
subscribe
unsubscribe
validate
middlewares
Generated using
TypeDoc