CallBuilder

CallBuilder

new CallBuilder(axios, wallet)

Creates a new CallBuilder.

Source:
Parameters:
Name Type Description
axios axios

Instance of axios.

wallet Wallet

User's wallet.

Classes

CallBuilder

Methods

appendAccountId(accountIdopt) → {CallBuilder}

Append an account ID to the URL. Uses wallet's account ID by default.

Source:
Parameters:
Name Type Attributes Default Description
accountId string <optional>
null

Custom account ID.

Returns:
Type:
CallBuilder

Self.

appendUrlSegment(segment, optsopt) → {CallBuilder}

Append URL segment.

Source:
Parameters:
Name Type Attributes Description
segment string | number | Array.<string>

URL path segment(s).

opts object <optional>

Options.

Name Type Attributes Default Description
base64 boolean <optional>
false

Treat segment as a base64-encoded value.

Returns:
Type:
CallBuilder

Self.

delete(dataopt) → {Promise}

Perform a DELETE request.

Source:
Parameters:
Name Type Attributes Description
data Object <optional>

Request body.

Returns:
Type:
Promise

Request result.

get(queryopt) → {Promise}

Perform a GET request.

Source:
Parameters:
Name Type Attributes Description
query Object <optional>

Request body.

Returns:
Type:
Promise

Request result.

patch(dataopt) → {Promise}

Perform a PATCH request.

Source:
Parameters:
Name Type Attributes Description
data Object <optional>

Request body.

Returns:
Type:
Promise

Request result.

post(dataopt) → {Promise}

Perform a POST request.

Source:
Parameters:
Name Type Attributes Description
data Object <optional>

Request body.

Returns:
Type:
Promise

Request result.

put(dataopt) → {Promise}

Perform a PUT request.

Source:
Parameters:
Name Type Attributes Description
data Object <optional>

Request body.

Returns:
Type:
Promise

Request result.

withCredentials() → {CallBuilder}

Attach token to this request.

Source:
Parameters:
Name Type Attributes Description
opts.token Token <optional>

Use another token for the request.

opts.wallet Wallet <optional>

Use another wallet for signature. Deprecated.

Returns:
Type:
CallBuilder

Self.

withHeaders(headers)

Set custom headers for the request.

Source:
Parameters:
Name Type Description
headers object

Headers to send along the request.

withOptionalCredentials() → {CallBuilder}

Attach token to this request if any were provided.

Source:
Parameters:
Name Type Attributes Description
opts.token Token <optional>

Use another token for the request.

opts.wallet Wallet <optional>

Use another wallet for signature. Deprecated.

Returns:
Type:
CallBuilder

Self.

withTimeout(timeout) → {CallBuilder}

Set a request timeout.

Source:
Parameters:
Name Type Description
timeout Number

Request timeout.

Returns:
Type:
CallBuilder

Self.