API and Development

1. SolSync API Integration

The SolSync REST API offers a comprehensive suite of endpoints for interacting with the satellite-based blockchain network. Developers can leverage these APIs to build decentralized applications (DApps) or integrate SolSync features into existing platforms.


Key API Endpoints:

  1. Token Swap:

    • Endpoint: /swap

    • Method: POST

    • Purpose: Perform atomic swaps between tokens on the SolSync network.

    • Example Request:

      Copy

      javascriptCopier le codeasync function swapTokens(inputToken, outputToken, amount) {
        const response = await axios.post('https://api.solsync.xyz/swap', {
          inputToken,
          outputToken,
          amount,
        });
        return response.data; // Swap confirmation
      }
  2. Satellite Nodes Information:

    • Endpoint: /nodes

    • Method: GET

    • Purpose: Retrieve real-time data about active satellite nodes.

    • Example Response:

      Copy

      jsonCopier le code[
        {
          "id": "sat-1",
          "status": "active",
          "uptime": 99.9,
          "traffic": 12000,
          "stake": 50000
        },
        {
          "id": "sat-2",
          "status": "active",
          "uptime": 98.5,
          "traffic": 8000,
          "stake": 30000
        }
      ]
  3. Transaction History:

    • Endpoint: /transactions

    • Method: GET

    • Purpose: Retrieve the history of blockchain transactions relayed through the network.

    • Example Request:

      Copy

      javascriptCopier le codeasync function getTransactionHistory(walletAddress) {
        const response = await axios.get(`https://api.solsync.xyz/transactions?wallet=${walletAddress}`);
        return response.data; // Transaction history
      }

Last updated