NULS JS - API Reference
Options
All
Public
Public/Protected
All
Inherited
Only exported
Menu
Contract
Api
constructor
api
resources
url
gas
get
Methods
get
Resource
handle
Errors
validate
view
Hierarchy
APIServerClass
ContractApi
Index
Constructors
constructor
Properties
api
resources
url
Methods
gas
get
Methods
get
Resource
handle
Errors
validate
view
Constructors
constructor
new
Contract
Api
(
conf
?:
IAPIConfig
)
:
ContractApi
Parameters
Default value
conf:
IAPIConfig
= config.nuls.api.explorer
Returns
ContractApi
Properties
api
api
:
AxiosInstance
Optional
resources
resources
:
Record
<
string
,
string
>
url
url
:
string
Methods
gas
gas
(
body
:
IContractCallGasRequest
)
:
Promise
<
IContractCallGasResponse
>
Parameters
body:
IContractCallGasRequest
Returns
Promise
<
IContractCallGasResponse
>
get
Methods
get
Methods
(
contractAddress
:
string
)
:
Promise
<
IContractGetMethodsResponse
>
Parameters
contractAddress:
string
Returns
Promise
<
IContractGetMethodsResponse
>
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
validate
validate
(
body
:
IContractCallValidateRequest
)
:
Promise
<
IContractCallValidateResponse
>
Parameters
body:
IContractCallValidateRequest
Returns
Promise
<
IContractCallValidateResponse
>
view
view
(
contractAddress
:
string
, methodName
:
string
, methodDesc
?:
undefined
|
string
,
...
args
:
ContractCallArgs
)
:
Promise
<
IContractViewResponse
>
Parameters
contractAddress:
string
methodName:
string
Optional
methodDesc:
undefined
|
string
Rest
...
args:
ContractCallArgs
Returns
Promise
<
IContractViewResponse
>