๐Ÿ“ฌDeposit

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

Smart Contracts Addresses

Blockchain (Mainnet)Chain IdAddress

Ethereum

1

0x27abF5aE0d9370E8Adcaa6f0bB480F63f4efcCC1

Optimism

10

0x27abF5aE0d9370E8Adcaa6f0bB480F63f4efcCC1

BNB Smart Chain

56

0x27abF5aE0d9370E8Adcaa6f0bB480F63f4efcCC1

Polygon

137

0x27abF5aE0d9370E8Adcaa6f0bB480F63f4efcCC1

zkSync

324

0x142D571ec373C8A969baD69872b57573E70190De

Base

8453

0x27abF5aE0d9370E8Adcaa6f0bB480F63f4efcCC1

Arbitrum

42161

0x27abF5aE0d9370E8Adcaa6f0bB480F63f4efcCC1

Linea

59144

0x27abF5aE0d9370E8Adcaa6f0bB480F63f4efcCC1

Scroll

534352

0x27abF5aE0d9370E8Adcaa6f0bB480F63f4efcCC1

Starknet

23448594291968334

0x03e8d2f9c300b3b4e2c601ad756e5ab8a4c2e2d9205ec0e38da0079f46964a5d

Arbitrum Nova

42170

0x27abF5aE0d9370E8Adcaa6f0bB480F63f4efcCC1

opBNB

204

0x27abF5aE0d9370E8Adcaa6f0bB480F63f4efcCC1

Polygon zkEVM

1101

0x27abF5aE0d9370E8Adcaa6f0bB480F63f4efcCC1

Avalanche

43114

0x27abF5aE0d9370E8Adcaa6f0bB480F63f4efcCC1

Solana

102

F4TuKSLLKjveuA1Vi1TZ3h5WjbyzS2zA4YroiL8Sh4LL

โš ๏ธ 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.

POST /deposit/init - Initiate Deposit

Description:

Designed to initiate a deposit transaction. It requires the user to be authenticated and provides details about the deposit, such as the blockchain chain, ticker, amount, and transaction hash.

Parameters:

ParameterTypeDescriptionRequired

recipient

String

The UUID or the label of the recipient.

Yes

chain

String

Blockchain chain identifier.

Yes

ticker

String

Asset ticker symbol.

Yes

amount

String

Amount to deposit.

Yes

tx

String

Transaction hash of the deposit transaction.

Yes

Response:

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

Error Handling:

Error CodeDescription

E_INVALID_PARAMS

One or more parameters are invalid or missing.

E_UNSUPPORTED_CHAIN_ASSET

The chain or asset is not supported.

E_INVALID_TICKER

The ticker symbol is invalid.

E_INVALID_AMOUNT

The amount is invalid for the specified asset.

E_INVALID_CHAIN

The specified chain is not supported or invalid.

E_MAX_PENDING_OPS

Maximum number of pending deposits reached.

E_PROCESSED_TX

The transaction has already been processed.

E_DEPOSITING

Error initiating deposit.

Example Code:

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

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

const initiateDeposit = async (recipient, chain, ticker, amount, tx) => {
  try {
    const response = await fetch(`${BASE_URL}deposit/init`, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
        'X-API-Key': API_KEY
      },
      body: JSON.stringify({
        recipient,
        chain,
        ticker,
        amount,
        tx
      })
    });
    const data = await response.json();
    console.log(data);
  } catch (error) {
    console.error('Error initiating deposit:', error);
  }
};

initiateDeposit('uuid', 'eth', 'ETH', '0.1', '0xTRANSACTION_HASH');

GET /deposit/history - Get Deposit History

Description:

This endpoint allows authenticated users to fetch their deposit history, paginated by the provided page number.

Parameters:

ParameterTypeDescriptionRequired

uuid or label

String

The UUID or the label of the sender.

Yes

page

Integer

Page number for paginated results.

Yes

Response:

{
  "error": [],
  "result": {
    "data": [
        {
          "tx": "transaction_hash",
          "ticker": "asset_ticker",
          "status": "deposit_status",
          "createdAt": "creation_date",
          "chain": "chain_id",
          "formatted": "formatted_net_amount"
        }
      ]
  },
  "meta": {
    "pagination": {
      "total": "int",
      "perPage": "int",
      "currentPage": "int",
      "lastPage": "int"
    }
  }
}

Status:

StatusDescription

0

Deposit initiated

1

Deposit dropped (invalid)

2

Deposit detected (onchain)

3

Deposit confirmed (onchain)

4

Deposit processing (rhino)

5

Deposit failed

6

Deposit executed

Error Handling:

None

Example Code:

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

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

const getDepositHistory = async (uuid, pageNumber) => {
  try {
    const response = await fetch(`${BASE_URL}deposit/history?uuid=${uuid}&page=${pageNumber}`, {
      headers: {
        'X-API-Key': API_KEY
      }
    });
    const data = await response.json();
    console.log(data.result);
  } catch (error) {
    console.error('Error fetching deposit history:', error);
  }
};

getDepositHistory('uuid', 1); // Call the function with page number 1 as example

Last updated