cryptomonKeys drops API usage guide

Introduction

Welcome to the cryptomonKeys drops API. This API allows you to manage and automate the transfer of cryptomonKeys NFTs. It is designed to facilitate the integration of cryptomonKeys assets into various applications, bots, or games. With this API, you can programmatically drop cryptomonKeys NFTs, enhancing your project with unique and engaging digital assets. Below, you will find the available endpoints, their descriptions, and examples of how to use them effectively.

Table of Contents

Obtaining an API Key

To obtain an API key, please contact us on Discord.

Client Usage

Python Client

The Python client enables users to interact with the drops API programmatically using Python, get it from Github.

Initialize the DropsAPIClient

base_url = "http://localhost:3091"
auth_token = "your_authorization_token"

client = DropsAPIClient(base_url, auth_token)

Create a drop

transfers = [
  {
    "receiver": "example_receiver",
    "memo": "Test memo",
  }
]

create_response = client.create_transfer(transfers)
print("Create drop Response:", create_response)

Delete a drop

delete_response = client.delete_transfer(transfer_id)
print("Delete Transfer Response:", delete_response) 

query a drop

# Get transfer by ID
transfer_id = create_response['transferIds'][0]
get_response = client.get_transfer(transfer_id)
print("Get Transfer Response:", get_response)

# Get all transfers with optional query parameters
query_params = {'application': 'example_application'}
get_all_response = client.get_transfers(query_params)
print("Get All Transfers Response:", get_all_response)

TypeScript Client

The TypeScript client can be found here

Initialize the TransfersClient

const config = {
  baseURL: "http://localhost:3091",
  authKey: "your_authorization_key",
};
const client = new TransfersClient(config);

Create a drop

const transfers = [
  {
    receiver: "example_receiver",
    memo: "Test memo",
  }
];
const transferIds = await client.postTransfer(transfers);
console.log('Posted transfers with IDs:', transferIds);

Query a drop

for (const transferId of transferIds) {
  const transfer = await client.getTransferById(transferId);
  console.log(`Transfer ${transferId}:`, transfer);
}

Get all transfers with optional query parameters

const filteredTransfers = await client.getTransfers({ application: applicationName, sort_by_time: 'desc' });
console.log('Filtered transfers:', filteredTransfers);

Endpoints

1. Add Transfers to the Queue

POST /transfer

Adds one or more transfers to the processing queue. Each transfer must include a receiver and a memo.

Request Headers

Authorization: your-application-private-key

Request Body

[
  {
    "receiver": "receiverAccount",
    "memo": "This is a transfer memo"
  }
]

Example

curl -X POST http://localhost:3091/transfer \ -H "Authorization: your-application-private-key" \ -H "Content-Type: application/json" \ -d '[ { "receiver": "receiverAccount", "memo": "This is a transfer memo" } ]'

2. Delete a Transfer by ID

DELETE /transfer/{id}

Deletes a transfer from the queue by its ID. Only pending transfers can be deleted.

Request Headers

Authorization: your-application-private-key

Example

curl -X DELETE http://localhost:3091/transfer/transferId \ -H "Authorization: your-application-private-key"

3. Get Transfer by ID

GET /transfer/{id}

Retrieves a transfer by its ID.

Example

curl -X GET http://localhost:3091/transfer/transferId

4. Get All Transfers

GET /transfers

Retrieves all transfers with optional filters such as application, receiver, sender, memo, status, and sort.

Example

curl -X GET "http://localhost:3091/transfers?application=appName&status=Pending"