๐ŸงพFees

This documentation provides details on the API endpoints available for Whirlprivacy.io, focusing on fee-related operations.

โš ๏ธ You must be logged in to use these requests.

Common Headers

For all requests that require user authentication, you must include the following headers:

Header NameValueDescription

X-API-key

base64

API token obtained after authentication.

GET /system/fees/deposit โ€“ Get Deposit Fees

Description:

Returns the deposit fees based on the asset ticker, amount, and chain provided in the request.

Parameters:

ParameterTypeDescription

ticker

string

The asset's ticker symbol.

amount

string

The amount of the asset.

chain

int or string

The blockchain network name.

Response:

{
  "error": [],
  "result": [
    {
        "fees": "string"
    }
  ]
}

Error Handling:

Error CodeDescription

E_INVALID_TICKER

The provided ticker symbol is invalid.

E_UNSUPPORTED_CHAIN_ASSET

The asset is not supported on the chain.

E_INVALID_AMOUNT

The amount provided is invalid.

Error estimating fees, some amounts might be too low

There was an error estimating fees.

Example Code:

const fetch = require('node-fetch');

const BASE_URL = 'https://api.whirlprivacy.io/';
const API_KEY = 'your_api_token';

const getDepositFees = async () => {
  const queryParams = new URLSearchParams({
    ticker: 'asset_ticker',
    amount: 'deposit_amount',
    chain: 'blockchain_network_name'
  });

  try {
    const response = await fetch(`${BASE_URL}system/fees/deposit?${queryParams}`, {
      headers: {
        'X-API-Key': API_KEY
      }
    });
    const data = await response.json();

    console.log(data.result);
  } catch (error) {
    console.error('Error fetching deposit fees:', error);
  }
};

getDepositFees();

GET /system/fees/withdrawal โ€“ Get Withdrawal Fees

Description:

Calculates withdrawal fees based on the asset's ticker, amount, and the blockchain network provided by the authenticated user.

Parameters:

ParameterTypeDescription

ticker

string

The asset's ticker symbol.

amount

string

The amount of the asset.

chain

int or string

The blockchain network name.

Response:

{
  "error": [],
  "result": [
    {
        "fees": "string"
    }
  ]
}

Error Handling:

Error CodeDescription

E_INVALID_TICKER

The provided ticker symbol is invalid.

E_UNSUPPORTED_CHAIN_ASSET

The asset is not supported on the chain.

E_INVALID_AMOUNT

The provided amount is invalid.

E_INVALID_CHAIN

The specified chain is invalid.

E_BALANCE_TOO_LOW

The user's balance is too low.

Error estimating fees, some amounts might be too low

There was an error estimating fees.

Example Code:

const fetch = require('node-fetch');

const BASE_URL = 'https://api.whirlprivacy.io/';
const API_KEY = 'your_api_token';

const getWithdrawalFees = async () => {
  const queryParams = new URLSearchParams({
    ticker: 'asset_ticker',
    amount: 'withdrawal_amount',
    chain: 'blockchain_network_name'
  });

  try {
    const response = await fetch(`${BASE_URL}system/fees/withdrawal?${queryParams}`, {
      headers: {
        'X-API-Key': API_KEY
      }
    });
    const data = await response.json();

    console.log(data.result);
  } catch (error) {
    console.error('Error fetching withdrawal fees:', error);
  }
};

getWithdrawalFees();

GET /system/fees/send โ€“ Get Send Fees

Description:

Retrieves sending fees for an asset based on the ticker, amount, and chain specified in the request.

Parameters:

ParameterTypeDescription

ticker

string

The asset's ticker symbol.

amount

string

The amount of the asset.

chain

int or string

The blockchain network name.

Response:

{
  "error": [],
  "result": [
    {
      "fees": {
        "depositFees": "string",
        "withdrawalFees": "string"
      }
    }
  ]
}

Error Handling:

Error CodeDescription

E_INVALID_TICKER

The provided ticker symbol is invalid.

E_UNSUPPORTED_CHAIN_ASSET

The asset is not supported on the chain.

E_INVALID_AMOUNT

The provided amount is invalid.

E_INVALID_CHAIN

The specified chain is invalid.

Error estimating fees, some amounts might be too low

There was an error estimating fees.

Example Code:

const fetch = require('node-fetch');

const BASE_URL = 'https://api.whirlprivacy.io/';
const API_KEY = 'your_api_token';

const getSendFees = async () => {
  const queryParams = new URLSearchParams({
    ticker: 'asset_ticker',
    amount: 'send_amount',
    chain: 'blockchain_network_name'
  });

  try {
    const response = await fetch(`${BASE_URL}system/fees/send?${queryParams}`, {
      headers: {
        'X-API-Key': API_KEY
      }
    });
    const data = await response.json();

    console.log(data.result);
  } catch (error) {
    console.error('Error fetching send fees:', error);
  }
};

getSendFees();

GET /system/fees/disperse โ€“ Get Disperse Fees

Description:

Calculates the total fees required to disperse a specified asset to multiple addresses, based on the authenticated user's request.

Parameters:

ParameterTypeDescription

ticker

string

The asset's ticker symbol.

amounts

string[]

The amounts to disperse.

chain

int or string

The blockchain network name.

Response:

{
  "error": [],
  "result": [
    {
        "fees": "string"
    }
  ]
}

Error Handling:

Error CodeDescription

E_INVALID_TICKER

The provided ticker symbol is invalid.

E_UNSUPPORTED_CHAIN_ASSET

The asset is not supported on the chain.

E_INVALID_PARAMS

The provided parameters are invalid.

E_INVALID_AMOUNT

One or more amounts are invalid.

E_INVALID_CHAIN

The specified chain is invalid.

E_BALANCE_TOO_LOW

The user's balance is too low.

Error estimating fees, some amounts might be too low

There was an error estimating fees.

Example Code:

const fetch = require('node-fetch');

const BASE_URL = 'https://api.whirlprivacy.io/';
const API_KEY = 'your_api_token';

const getDisperseFees = async () => {
  const queryParams = new URLSearchParams({
    ticker: 'asset_ticker',
    amounts: JSON.stringify(['amount1', 'amount2']),
    chain: 'blockchain_network_name'
  });

  try {
    const response = await fetch(`${BASE_URL}system/fees/disperse?${queryParams}`, {
      headers: {
        'X-API-Key': API_KEY
      }
    });
    const data = await response.json();

    console.log(data.result);
  } catch (error) {
    console.error('Error fetching disperse fees:', error);
  }
};

getDisperseFees();

Last updated