species

0%

Loading the future

Documentation/Quickstart

Quickstart for Developers

Requirements

  • • Onli-You App (for vault ownership)
  • • ProfileTray API key and secret
  • • USDT payment proof (NOWPayments or TRON)

Basic Flow

1

User Setup

User installs Onli-You, creating their Onli ID and vault.

2

Authenticate

Obtain ProfileTray API key/secret.

3

Call Specie API

Make request with signed MCP headers.

4

Receive Receipt

Store receipt locally as proof.

5

(Optional) Verify

Verify via Oracle.RevealGenomes (owner-only access).

Example — Buying from Treasury

curl -X POST https://api.specie.market/mcp/eventRequest \
-H "X-API-Key:$KEY" \
-H "X-Nonce:$NONCE" \
-H "X-Timestamp:$TS" \
-H "X-Event-Id:$EID" \
-H "X-Signature:$SIG" \
-H "Content-Type: application/json" \
-d '{
  "protocol": "mcp",
  "version": "1.0.0",
  "tool": "Specie",
  "action": "BUY",
  "parameters": {
    "amount": 1000,
    "to": "treasury",
    "payWith": {"currency": "USDT_TRC20", "proof": "npmt_9Q3..."}
  }
}'

Response: A signed Receipt confirming issuance.

SDK Example (Node.js)

import crypto from 'crypto';
import fetch from 'node-fetch';

const createSignature = (body, nonce, timestamp, secret) => {
  const data = JSON.stringify(body) + nonce + timestamp;
  return crypto.createHmac('sha256', secret).update(data).digest('hex');
};

async function specieCall(action, params, credentials) {
  const nonce = crypto.randomUUID();
  const timestamp = new Date().toISOString();
  const body = {
    protocol: 'mcp',
    version: '1.0.0',
    tool: 'Specie',
    action,
    parameters: params
  };
  const signature = createSignature(body, nonce, timestamp, credentials.secret);

  const res = await fetch('https://api.specie.market/mcp/eventRequest', {
    method: 'POST',
    headers: {
      'X-API-Key': credentials.apiKey,
      'X-Nonce': nonce,
      'X-Timestamp': timestamp,
      'X-Event-Id': crypto.randomUUID(),
      'X-Signature': signature,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify(body)
  });

  return res.json();
}