Skip to content

Latest commit

 

History

History
190 lines (140 loc) · 3.13 KB

api.md

File metadata and controls

190 lines (140 loc) · 3.13 KB
icon
webhook

Sacred API

⚡ Overview of the Digital Protocols

The Sacred APIs of Solana Oasis provide a comprehensive interface for digital alchemists to commune with the Layer 2 Neural Network. This grimoire outlines all available incantations, their sacred usage, and example manifestations.

📓 Base Sanctuaries

  • Mainnet Realm: Coming Soon
  • Testnet Void: Coming Soon
  • Local Nexus: http://localhost:8899

🕯️ Node Communion API

⛧ Health Divination

GET /v1/health

Response:

{
    "status": "aligned",
    "version": "1.0.0",
    "uptime": 3600
}

🌒 State Queries

Scry Latest State

GET /v1/state/latest

Commune with State Root

GET /v1/state/{root_hash}

⚔️ Transaction Alchemy

Channel Transaction

POST /v1/transaction
Content-Type: application/json

{
    "type": "computation",
    "payload": {
        "model": "gpt-4",
        "input": "Analyze this text...",
        "params": {
            "temperature": 0.7,
            "maxTokens": 100
        }
    }
}

Scry Transaction Status

GET /v1/transaction/{tx_hash}

🧠 Neural Operations

Model Registry

GET /v1/models

Computation Status

GET /v1/computation/{computation_id}

⛧ Bridge Rituals

Asset Channeling

POST /v1/bridge/deposit
Content-Type: application/json

{
    "amount": "1000000000",
    "token": "SOL",
    "destination": "0x..."
}

Asset Manifestation

POST /v1/bridge/withdraw
Content-Type: application/json

{
    "amount": "1000000000",
    "token": "SOL",
    "proof": "0x..."
}

🌑 Error Manifestations

All endpoints use sacred status codes:

  • 200: Alignment Achieved
  • 400: Ritual Malformed
  • 401: Unauthorized Invocation
  • 403: Forbidden Rite
  • 404: Void Not Found
  • 500: Internal Chaos

Error Response Format:

{
    "error": {
        "code": "invalid_invocation",
        "message": "The ritual pattern is malformed",
        "details": {
            "field": "payload",
            "issue": "missing sacred component"
        }
    }
}

⚡ Energy Flow Control

  • Public Rites: 100 invocations per minute
  • Attuned Channels: 1000 invocations per minute
  • Neural Rites: 10 invocations per minute

🗝️ SDK Integration

import { OasisSDK } from '@solana-oasis/sdk';

// Initialize the sacred connection
const oasis = new OasisSDK({
    endpoint: 'Coming Soon',
    wallet: solanaWallet
});

// Channel computation request
const result = await oasis.compute({
    model: 'gpt-4',
    input: 'Analyze this text...',
    params: {
        temperature: 0.7,
        maxTokens: 100
    }
});

🕯️ Ethereal Streams

Connect to the ethereal plane:

const ws = new WebSocket('wss://api.solanaoasis.com/v1/ws');

ws.onmessage = (event) => {
    const manifestation = JSON.parse(event.data);
    console.log('New manifestation:', manifestation);
};

⚔️ Sacred Protections

  • All channels require HTTPS sealing
  • Authentication via sacred tokens
  • Energy flow control per key
  • Request signing for sacred operations