FeeCalculatorServer

FeeCalculatorServer

Facilitates interaction with the FeeCalculator server.

Constructor

new FeeCalculatorServer(sdk, serverUrl, opts)

Create a new FeeCalculator server instance.

Source:
Parameters:
Name Type Description
sdk ShelfNetwork

Parent SDK instance.

serverUrl string

FeeCalculator URL.

opts Object
Name Type Attributes Description
allowHttp boolean <optional>

Allow connecting to http servers, default: false. This must be set to false in production deployments!

proxy Object <optional>

Proxy configuration. Look axios docs for more info

httpBasicAuth Object <optional>

HTTP basic auth credentials. Look axios docs for more info.

customHeaders Object <optional>

Custom headers for request.

withCredentials boolean <optional>

Indicates whether or not cross-site Access-Control requests should be made using credentials.

Methods

(async) calculate(query)

Get fee amount.

Source:
Parameters:
Name Type Description
query object

Request options.

Name Type Description
price Number

Lot price.

lotType Number

Lot type.

currency string

Currency.

calculateBulk(pairs)

Get multiple fees.

Source:
Parameters:
Name Type Description
pairs Array.<object>

Array of pairs for convertation.

Name Type Description
price Number

Lot price.

lotType Number

Lot type.

currency string

Currency.

lotId Number

Lot ID. Will be returned in response just for frontend mapping purposes.