-
disconnect()
-
Disconnects the client
-
async login(token) → {Promise.<{scope: String, context: ?StructureContext}>}
-
Logs the client in and returns a promise that resolves once authenticated.
Parameters:
Name |
Type |
Description |
token |
String
|
your api token |
Fires:
Throws:
-
async request(args, contextnullable) → {Promise.<Object>}
-
Makes a request to the server. You probably shouldn't use this directly.
Parameters:
Name |
Type |
Attributes |
Description |
args |
Object
|
|
the request to make |
context |
StructureContext
|
<nullable>
|
the context making this request |
Throws:
Returns:
Promise.<Object>
-
retryOnFuelError(retry)
-
Enables or disables automatic retries when out of fuel.
Note that requests will hang indefinitely until fuel is supplied.
You can monitor fuel status by listening to the "outOfFuel" event
Parameters:
Name |
Type |
Default |
Description |
retry |
boolean
|
true
|
if retries should be enabled or disabled |