NULS JS - API Reference
Options
All
Public
Public/Protected
All
Inherited
Only exported
Menu
Block
Api
constructor
api
resources
url
block
get
Resource
handle
Errors
last
Height
subscribe
Hierarchy
APIServerClass
BlockApi
Index
Constructors
constructor
Properties
api
resources
url
Methods
block
get
Resource
handle
Errors
last
Height
subscribe
Constructors
constructor
new
Block
Api
(
conf
?:
IAPIConfig
)
:
BlockApi
Parameters
Default value
conf:
IAPIConfig
= config.nuls.api.explorer
Returns
BlockApi
Properties
api
api
:
AxiosInstance
Optional
resources
resources
:
Record
<
string
,
string
>
url
url
:
string
Methods
block
block
(
height
:
number
)
:
Promise
<
ApiBlock
>
block
(
hash
:
string
)
:
Promise
<
ApiBlock
>
Parameters
height:
number
Returns
Promise
<
ApiBlock
>
Parameters
hash:
string
Returns
Promise
<
ApiBlock
>
Protected
get
Resource
get
Resource
(
name
:
string
,
...
args
:
string
[]
)
:
string
Parameters
name:
string
Rest
...
args:
string
[]
Returns
string
Protected
handle
Errors
handle
Errors
(
e
:
AxiosError
)
:
AxiosError
Parameters
e:
AxiosError
Returns
AxiosError
last
Height
last
Height
(
)
:
Promise
<
number
>
Returns
Promise
<
number
>
subscribe
subscribe
(
height
?:
number
)
:
SocketEmitter
Parameters
Default value
height:
number
= -1
Returns
SocketEmitter