๐Ÿ”€Disperse

This documentation provides details on the API endpoints available for Whirlprivacy.io, focusing on disperse-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:

POST /disperse/init โ€“ Disperse Init

Description:

Allows a logged-in user to initiate a disperse operation. It is designed to distribute an asset across multiple addresses, optionally incorporating a delay in the disbursement process.

Parameters:

Request Example:

{
  "error": [],
  "result": {
      "chain": "1",
      "ticker": "ETH",
      "recipients": [
        {
          "amount": "0.5",
          "address": "0xABC123..."
        },
        {
          "amount": "1.2",
          "address": "0xDEF456..."
        }
      ],
      "delayMin": 10,
      "delayMax": 60
  }
}

Response:

{
  "error": [],
  "result": "Disperse initiated"
}

Error Handling:

Example Code:

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

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

const disperseInit = async () => {
  try {
    const response = await fetch(`${BASE_URL}disperse/init`, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
        'X-API-Key': API_KEY
      },
      body: JSON.stringify({
        sender: "uuid",
        chain: "1",
        ticker: "ETH",
        recipients: [
          { amount: "0.5", address: "0xABc123..." },
          { amount: "1.2", address: "0xDEf456..." }
        ],
        delayMin: 10,
        delayMax: 60
      })
    });
    const data = await response.json();
    console.log(data.result);
  } catch (error) {
    console.error('Error initiating disperse transaction:', error);
  }
};

disperseInit();

Last updated